@codefast/ui 0.0.50 → 0.0.53
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/{chunk-ZTEJNUH6.js → chunk-46W6RAYD.js} +1 -1
- package/dist/chunk-46W6RAYD.js.map +1 -0
- package/dist/{chunk-CERSQE5J.js → chunk-4JHGPRLG.js} +1 -1
- package/dist/chunk-4JHGPRLG.js.map +1 -0
- package/dist/{chunk-I6QCJDIF.mjs → chunk-5RENVAXH.mjs} +1 -1
- package/dist/chunk-5RENVAXH.mjs.map +1 -0
- package/dist/{chunk-47CSACCM.mjs → chunk-7ABWX5CF.mjs} +2 -2
- package/dist/chunk-7ABWX5CF.mjs.map +1 -0
- package/dist/{chunk-XHNT6PVI.mjs → chunk-BM5KYF6Y.mjs} +1 -1
- package/dist/chunk-BM5KYF6Y.mjs.map +1 -0
- package/dist/{chunk-P5AV3QU7.mjs → chunk-BNKSZEF2.mjs} +1 -1
- package/dist/chunk-BNKSZEF2.mjs.map +1 -0
- package/dist/{chunk-SDGUDONZ.js → chunk-DCDB56BO.js} +1 -1
- package/dist/chunk-DCDB56BO.js.map +1 -0
- package/dist/{chunk-6FL3EBDQ.mjs → chunk-HMD2ZU33.mjs} +1 -1
- package/dist/chunk-HMD2ZU33.mjs.map +1 -0
- package/dist/{chunk-JOBEKA4M.mjs → chunk-K63K4LTH.mjs} +2 -2
- package/dist/chunk-K63K4LTH.mjs.map +1 -0
- package/dist/{chunk-VXPAGNPJ.js → chunk-LJSD47ZL.js} +1 -1
- package/dist/chunk-LJSD47ZL.js.map +1 -0
- package/dist/{chunk-GDMHMSJ2.mjs → chunk-MFYACCZV.mjs} +1 -1
- package/dist/chunk-MFYACCZV.mjs.map +1 -0
- package/dist/{chunk-LG7ACTRE.js → chunk-PRCS3RWN.js} +1 -1
- package/dist/chunk-PRCS3RWN.js.map +1 -0
- package/dist/{chunk-OP6Q7VT5.js → chunk-RHFF4JNH.js} +1 -1
- package/dist/chunk-RHFF4JNH.js.map +1 -0
- package/dist/{chunk-SCPFGC2X.js → chunk-SCXRD727.js} +1 -1
- package/dist/chunk-SCXRD727.js.map +1 -0
- package/dist/{chunk-X3LRJQM3.js → chunk-VZVI3OHH.js} +2 -2
- package/dist/chunk-VZVI3OHH.js.map +1 -0
- package/dist/{chunk-UYRRHPPH.js → chunk-X4BEEJEW.js} +2 -2
- package/dist/chunk-X4BEEJEW.js.map +1 -0
- package/dist/{chunk-PWF46YXQ.mjs → chunk-Y2GMHG3Z.mjs} +1 -1
- package/dist/chunk-Y2GMHG3Z.mjs.map +1 -0
- package/dist/{chunk-MU2MZ434.mjs → chunk-ZIB4ZTST.mjs} +1 -1
- package/dist/chunk-ZIB4ZTST.mjs.map +1 -0
- package/dist/plugin/animate.plugin.js +1 -1
- package/dist/plugin/animate.plugin.mjs +1 -1
- package/dist/react/accordion.js.map +1 -1
- package/dist/react/accordion.mjs.map +1 -1
- package/dist/react/alert-dialog.js +1 -1
- package/dist/react/alert-dialog.js.map +1 -1
- package/dist/react/alert-dialog.mjs +1 -1
- package/dist/react/alert-dialog.mjs.map +1 -1
- package/dist/react/alert.js.map +1 -1
- package/dist/react/alert.mjs.map +1 -1
- package/dist/react/aspect-ratio.d.mts +1 -1
- package/dist/react/aspect-ratio.d.ts +1 -1
- package/dist/react/aspect-ratio.js.map +1 -1
- package/dist/react/aspect-ratio.mjs.map +1 -1
- package/dist/react/avatar.js.map +1 -1
- package/dist/react/avatar.mjs.map +1 -1
- package/dist/react/badge.js.map +1 -1
- package/dist/react/badge.mjs.map +1 -1
- package/dist/react/blockquote.js.map +1 -1
- package/dist/react/blockquote.mjs.map +1 -1
- package/dist/react/box.js.map +1 -1
- package/dist/react/box.mjs.map +1 -1
- package/dist/react/breadcrumb.js.map +1 -1
- package/dist/react/breadcrumb.mjs.map +1 -1
- package/dist/react/button.js +1 -1
- package/dist/react/button.mjs +1 -1
- package/dist/react/calendar.js +1 -1
- package/dist/react/calendar.js.map +1 -1
- package/dist/react/calendar.mjs +1 -1
- package/dist/react/calendar.mjs.map +1 -1
- package/dist/react/card.js.map +1 -1
- package/dist/react/card.mjs.map +1 -1
- package/dist/react/carousel.js +1 -1
- package/dist/react/carousel.js.map +1 -1
- package/dist/react/carousel.mjs +1 -1
- package/dist/react/carousel.mjs.map +1 -1
- package/dist/react/checkbox-cards.js +1 -1
- package/dist/react/checkbox-cards.js.map +1 -1
- package/dist/react/checkbox-cards.mjs +1 -1
- package/dist/react/checkbox-cards.mjs.map +1 -1
- package/dist/react/checkbox-group.js +1 -1
- package/dist/react/checkbox-group.js.map +1 -1
- package/dist/react/checkbox-group.mjs +1 -1
- package/dist/react/checkbox-group.mjs.map +1 -1
- package/dist/react/checkbox-group.primitive.js +1 -1
- package/dist/react/checkbox-group.primitive.mjs +1 -1
- package/dist/react/checkbox.js.map +1 -1
- package/dist/react/checkbox.mjs.map +1 -1
- package/dist/react/code.js.map +1 -1
- package/dist/react/code.mjs.map +1 -1
- package/dist/react/collapsible.js.map +1 -1
- package/dist/react/collapsible.mjs.map +1 -1
- package/dist/react/command.js +1 -1
- package/dist/react/command.js.map +1 -1
- package/dist/react/command.mjs +1 -1
- package/dist/react/command.mjs.map +1 -1
- package/dist/react/container.js.map +1 -1
- package/dist/react/container.mjs.map +1 -1
- package/dist/react/context-menu.js.map +1 -1
- package/dist/react/context-menu.mjs.map +1 -1
- package/dist/react/data-table.d.mts +1 -1
- package/dist/react/data-table.d.ts +1 -1
- package/dist/react/data-table.js +1 -1
- package/dist/react/data-table.js.map +1 -1
- package/dist/react/data-table.mjs +1 -1
- package/dist/react/data-table.mjs.map +1 -1
- package/dist/react/dialog.js +1 -1
- package/dist/react/dialog.mjs +1 -1
- package/dist/react/drawer.js.map +1 -1
- package/dist/react/drawer.mjs.map +1 -1
- package/dist/react/dropdown-menu.js +1 -1
- package/dist/react/dropdown-menu.mjs +1 -1
- package/dist/react/em.js.map +1 -1
- package/dist/react/em.mjs.map +1 -1
- package/dist/react/form.js +1 -1
- package/dist/react/form.js.map +1 -1
- package/dist/react/form.mjs +1 -1
- package/dist/react/form.mjs.map +1 -1
- package/dist/react/heading.js.map +1 -1
- package/dist/react/heading.mjs.map +1 -1
- package/dist/react/hover-card.js.map +1 -1
- package/dist/react/hover-card.mjs.map +1 -1
- package/dist/react/input-otp.js.map +1 -1
- package/dist/react/input-otp.mjs.map +1 -1
- package/dist/react/input.js.map +1 -1
- package/dist/react/input.mjs.map +1 -1
- package/dist/react/kbd.js.map +1 -1
- package/dist/react/kbd.mjs.map +1 -1
- package/dist/react/label.js +1 -1
- package/dist/react/label.mjs +1 -1
- package/dist/react/menubar.js.map +1 -1
- package/dist/react/menubar.mjs.map +1 -1
- package/dist/react/navigation-menu.js.map +1 -1
- package/dist/react/navigation-menu.mjs.map +1 -1
- package/dist/react/pagination.js +1 -1
- package/dist/react/pagination.js.map +1 -1
- package/dist/react/pagination.mjs +1 -1
- package/dist/react/pagination.mjs.map +1 -1
- package/dist/react/popover.js.map +1 -1
- package/dist/react/popover.mjs.map +1 -1
- package/dist/react/pre.js.map +1 -1
- package/dist/react/pre.mjs.map +1 -1
- package/dist/react/progress.js.map +1 -1
- package/dist/react/progress.mjs.map +1 -1
- package/dist/react/quote.js.map +1 -1
- package/dist/react/quote.mjs.map +1 -1
- package/dist/react/radio-cards.js.map +1 -1
- package/dist/react/radio-cards.mjs.map +1 -1
- package/dist/react/radio-group.js.map +1 -1
- package/dist/react/radio-group.mjs.map +1 -1
- package/dist/react/radio.js.map +1 -1
- package/dist/react/radio.mjs.map +1 -1
- package/dist/react/resizable.js.map +1 -1
- package/dist/react/resizable.mjs.map +1 -1
- package/dist/react/scroll-area.js.map +1 -1
- package/dist/react/scroll-area.mjs.map +1 -1
- package/dist/react/section.js.map +1 -1
- package/dist/react/section.mjs.map +1 -1
- package/dist/react/select.js +1 -1
- package/dist/react/select.mjs +1 -1
- package/dist/react/separator.js.map +1 -1
- package/dist/react/separator.mjs.map +1 -1
- package/dist/react/sheet.js +1 -1
- package/dist/react/sheet.js.map +1 -1
- package/dist/react/sheet.mjs +1 -1
- package/dist/react/sheet.mjs.map +1 -1
- package/dist/react/skeleton.js.map +1 -1
- package/dist/react/skeleton.mjs.map +1 -1
- package/dist/react/slider.js.map +1 -1
- package/dist/react/slider.mjs.map +1 -1
- package/dist/react/sonner.js.map +1 -1
- package/dist/react/sonner.mjs.map +1 -1
- package/dist/react/spinner.js +1 -1
- package/dist/react/spinner.mjs +1 -1
- package/dist/react/strong.js.map +1 -1
- package/dist/react/strong.mjs.map +1 -1
- package/dist/react/switch.js.map +1 -1
- package/dist/react/switch.mjs.map +1 -1
- package/dist/react/table.js.map +1 -1
- package/dist/react/table.mjs.map +1 -1
- package/dist/react/tabs.js.map +1 -1
- package/dist/react/tabs.mjs.map +1 -1
- package/dist/react/text.js.map +1 -1
- package/dist/react/text.mjs.map +1 -1
- package/dist/react/textarea.js.map +1 -1
- package/dist/react/textarea.mjs.map +1 -1
- package/dist/react/toggle-group.js +1 -1
- package/dist/react/toggle-group.js.map +1 -1
- package/dist/react/toggle-group.mjs +1 -1
- package/dist/react/toggle-group.mjs.map +1 -1
- package/dist/react/toggle.js +1 -1
- package/dist/react/toggle.mjs +1 -1
- package/dist/react/tooltip.js.map +1 -1
- package/dist/react/tooltip.mjs.map +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/tailwind.config.js +1 -1
- package/dist/tailwind.config.js.map +1 -1
- package/dist/tailwind.config.mjs +1 -1
- package/dist/tailwind.config.mjs.map +1 -1
- package/package.json +5 -5
- package/plugin/animate.plugin.ts +2 -5
- package/src/react/accordion.tsx +36 -60
- package/src/react/alert-dialog.tsx +57 -125
- package/src/react/alert.tsx +16 -42
- package/src/react/aspect-ratio.tsx +2 -4
- package/src/react/avatar.tsx +15 -43
- package/src/react/badge.tsx +3 -8
- package/src/react/blockquote.tsx +5 -8
- package/src/react/box.tsx +4 -6
- package/src/react/breadcrumb.tsx +17 -50
- package/src/react/button.tsx +5 -20
- package/src/react/calendar.tsx +6 -22
- package/src/react/card.tsx +22 -56
- package/src/react/carousel.tsx +20 -76
- package/src/react/checkbox-cards.tsx +28 -55
- package/src/react/checkbox-group.primitive.tsx +24 -78
- package/src/react/checkbox-group.tsx +26 -49
- package/src/react/checkbox.tsx +15 -19
- package/src/react/code.tsx +4 -6
- package/src/react/collapsible.tsx +19 -29
- package/src/react/command.tsx +69 -134
- package/src/react/container.tsx +5 -9
- package/src/react/context-menu.tsx +146 -224
- package/src/react/data-table.tsx +16 -44
- package/src/react/dialog.tsx +45 -90
- package/src/react/drawer.tsx +44 -91
- package/src/react/dropdown-menu.tsx +126 -194
- package/src/react/em.tsx +4 -6
- package/src/react/form.tsx +49 -84
- package/src/react/heading.tsx +4 -6
- package/src/react/hover-card.tsx +22 -38
- package/src/react/input-otp.tsx +26 -37
- package/src/react/input.tsx +6 -16
- package/src/react/kbd.tsx +14 -16
- package/src/react/label.tsx +11 -12
- package/src/react/menubar.tsx +129 -208
- package/src/react/navigation-menu.tsx +105 -147
- package/src/react/pagination.tsx +18 -50
- package/src/react/popover.tsx +25 -40
- package/src/react/pre.tsx +4 -6
- package/src/react/progress.tsx +15 -22
- package/src/react/quote.tsx +4 -6
- package/src/react/radio-cards.tsx +7 -27
- package/src/react/radio-group.tsx +7 -27
- package/src/react/radio.tsx +14 -18
- package/src/react/resizable.tsx +2 -7
- package/src/react/scroll-area.tsx +30 -52
- package/src/react/section.tsx +4 -6
- package/src/react/select.tsx +108 -161
- package/src/react/separator.tsx +3 -12
- package/src/react/sheet.tsx +21 -71
- package/src/react/skeleton.tsx +1 -6
- package/src/react/slider.tsx +20 -27
- package/src/react/sonner.tsx +2 -4
- package/src/react/spinner.tsx +2 -7
- package/src/react/strong.tsx +4 -6
- package/src/react/switch.tsx +12 -14
- package/src/react/table.tsx +37 -82
- package/src/react/tabs.tsx +34 -44
- package/src/react/text.tsx +5 -8
- package/src/react/textarea.tsx +12 -14
- package/src/react/toggle-group.tsx +16 -57
- package/src/react/toggle.tsx +8 -15
- package/src/react/tooltip.tsx +24 -39
- package/tailwind.config.ts +2 -2
- package/dist/chunk-47CSACCM.mjs.map +0 -1
- package/dist/chunk-6FL3EBDQ.mjs.map +0 -1
- package/dist/chunk-CERSQE5J.js.map +0 -1
- package/dist/chunk-GDMHMSJ2.mjs.map +0 -1
- package/dist/chunk-I6QCJDIF.mjs.map +0 -1
- package/dist/chunk-JOBEKA4M.mjs.map +0 -1
- package/dist/chunk-LG7ACTRE.js.map +0 -1
- package/dist/chunk-MU2MZ434.mjs.map +0 -1
- package/dist/chunk-OP6Q7VT5.js.map +0 -1
- package/dist/chunk-P5AV3QU7.mjs.map +0 -1
- package/dist/chunk-PWF46YXQ.mjs.map +0 -1
- package/dist/chunk-SCPFGC2X.js.map +0 -1
- package/dist/chunk-SDGUDONZ.js.map +0 -1
- package/dist/chunk-UYRRHPPH.js.map +0 -1
- package/dist/chunk-VXPAGNPJ.js.map +0 -1
- package/dist/chunk-X3LRJQM3.js.map +0 -1
- package/dist/chunk-XHNT6PVI.mjs.map +0 -1
- package/dist/chunk-ZTEJNUH6.js.map +0 -1
package/src/react/menubar.tsx
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
5
|
-
CheckIcon,
|
|
6
|
-
ChevronRightIcon,
|
|
7
|
-
DotFilledIcon,
|
|
8
|
-
} from '@radix-ui/react-icons';
|
|
4
|
+
import { CheckIcon, ChevronRightIcon, DotFilledIcon } from '@radix-ui/react-icons';
|
|
9
5
|
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
|
10
6
|
import { cn } from '../lib/utils';
|
|
11
7
|
|
|
@@ -20,27 +16,21 @@ const MenubarMenu = MenubarPrimitive.Menu;
|
|
|
20
16
|
* Component: MenubarGroup
|
|
21
17
|
* -------------------------------------------------------------------------- */
|
|
22
18
|
|
|
23
|
-
type MenubarGroupProps = React.ComponentPropsWithoutRef<
|
|
24
|
-
typeof MenubarPrimitive.Group
|
|
25
|
-
>;
|
|
19
|
+
type MenubarGroupProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Group>;
|
|
26
20
|
const MenubarGroup = MenubarPrimitive.Group;
|
|
27
21
|
|
|
28
22
|
/* -----------------------------------------------------------------------------
|
|
29
23
|
* Component: MenubarSub
|
|
30
24
|
* -------------------------------------------------------------------------- */
|
|
31
25
|
|
|
32
|
-
type MenubarSubProps = React.ComponentPropsWithoutRef<
|
|
33
|
-
typeof MenubarPrimitive.Sub
|
|
34
|
-
>;
|
|
26
|
+
type MenubarSubProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Sub>;
|
|
35
27
|
const MenubarSub = MenubarPrimitive.Sub;
|
|
36
28
|
|
|
37
29
|
/* -----------------------------------------------------------------------------
|
|
38
30
|
* Component: MenubarRadioGroup
|
|
39
31
|
* -------------------------------------------------------------------------- */
|
|
40
32
|
|
|
41
|
-
type MenubarRadioGroupProps = React.ComponentPropsWithoutRef<
|
|
42
|
-
typeof MenubarPrimitive.RadioGroup
|
|
43
|
-
>;
|
|
33
|
+
type MenubarRadioGroupProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioGroup>;
|
|
44
34
|
const MenubarRadioGroup = MenubarPrimitive.RadioGroup;
|
|
45
35
|
|
|
46
36
|
/* -----------------------------------------------------------------------------
|
|
@@ -48,22 +38,15 @@ const MenubarRadioGroup = MenubarPrimitive.RadioGroup;
|
|
|
48
38
|
* -------------------------------------------------------------------------- */
|
|
49
39
|
|
|
50
40
|
type MenubarElement = React.ElementRef<typeof MenubarPrimitive.Root>;
|
|
51
|
-
type MenubarProps = React.ComponentPropsWithoutRef<
|
|
52
|
-
typeof MenubarPrimitive.Root
|
|
53
|
-
>;
|
|
41
|
+
type MenubarProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>;
|
|
54
42
|
|
|
55
|
-
const Menubar = React.forwardRef<MenubarElement, MenubarProps>(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
65
|
-
),
|
|
66
|
-
);
|
|
43
|
+
const Menubar = React.forwardRef<MenubarElement, MenubarProps>(({ className, ...props }, ref) => (
|
|
44
|
+
<MenubarPrimitive.Root
|
|
45
|
+
ref={ref}
|
|
46
|
+
className={cn('bg-background flex h-10 items-center space-x-1 rounded-md border p-1 shadow-sm', className)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
));
|
|
67
50
|
|
|
68
51
|
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
69
52
|
|
|
@@ -72,14 +55,9 @@ Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
|
72
55
|
* -------------------------------------------------------------------------- */
|
|
73
56
|
|
|
74
57
|
type MenubarTriggerElement = React.ElementRef<typeof MenubarPrimitive.Trigger>;
|
|
75
|
-
type MenubarTriggerProps = React.ComponentPropsWithoutRef<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const MenubarTrigger = React.forwardRef<
|
|
80
|
-
MenubarTriggerElement,
|
|
81
|
-
MenubarTriggerProps
|
|
82
|
-
>(({ className, ...props }, ref) => (
|
|
58
|
+
type MenubarTriggerProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>;
|
|
59
|
+
|
|
60
|
+
const MenubarTrigger = React.forwardRef<MenubarTriggerElement, MenubarTriggerProps>(({ className, ...props }, ref) => (
|
|
83
61
|
<MenubarPrimitive.Trigger
|
|
84
62
|
ref={ref}
|
|
85
63
|
className={cn(
|
|
@@ -96,32 +74,28 @@ MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
|
|
|
96
74
|
* Component: MenubarSubTrigger
|
|
97
75
|
* -------------------------------------------------------------------------- */
|
|
98
76
|
|
|
99
|
-
type MenubarSubTriggerElement = React.ElementRef<
|
|
100
|
-
typeof MenubarPrimitive.SubTrigger
|
|
101
|
-
>;
|
|
77
|
+
type MenubarSubTriggerElement = React.ElementRef<typeof MenubarPrimitive.SubTrigger>;
|
|
102
78
|
|
|
103
|
-
interface MenubarSubTriggerProps
|
|
104
|
-
extends React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> {
|
|
79
|
+
interface MenubarSubTriggerProps extends React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> {
|
|
105
80
|
inset?: boolean;
|
|
106
81
|
}
|
|
107
82
|
|
|
108
|
-
const MenubarSubTrigger = React.forwardRef<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
));
|
|
83
|
+
const MenubarSubTrigger = React.forwardRef<MenubarSubTriggerElement, MenubarSubTriggerProps>(
|
|
84
|
+
({ children, className, inset, ...props }, ref) => (
|
|
85
|
+
<MenubarPrimitive.SubTrigger
|
|
86
|
+
ref={ref}
|
|
87
|
+
className={cn(
|
|
88
|
+
'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none',
|
|
89
|
+
inset && 'pl-8',
|
|
90
|
+
className,
|
|
91
|
+
)}
|
|
92
|
+
{...props}
|
|
93
|
+
>
|
|
94
|
+
{children}
|
|
95
|
+
<ChevronRightIcon className="ml-auto size-4" />
|
|
96
|
+
</MenubarPrimitive.SubTrigger>
|
|
97
|
+
),
|
|
98
|
+
);
|
|
125
99
|
|
|
126
100
|
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
127
101
|
|
|
@@ -129,28 +103,23 @@ MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
|
129
103
|
* Component: MenubarSubContent
|
|
130
104
|
* -------------------------------------------------------------------------- */
|
|
131
105
|
|
|
132
|
-
type MenubarSubContentElement = React.ElementRef<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
)}
|
|
150
|
-
{...props}
|
|
151
|
-
/>
|
|
152
|
-
</MenubarPrimitive.Portal>
|
|
153
|
-
));
|
|
106
|
+
type MenubarSubContentElement = React.ElementRef<typeof MenubarPrimitive.SubContent>;
|
|
107
|
+
type MenubarSubContentProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>;
|
|
108
|
+
|
|
109
|
+
const MenubarSubContent = React.forwardRef<MenubarSubContentElement, MenubarSubContentProps>(
|
|
110
|
+
({ className, ...props }, ref) => (
|
|
111
|
+
<MenubarPrimitive.Portal>
|
|
112
|
+
<MenubarPrimitive.SubContent
|
|
113
|
+
ref={ref}
|
|
114
|
+
className={cn(
|
|
115
|
+
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 z-50 min-w-32 rounded-md border p-1 shadow-md',
|
|
116
|
+
className,
|
|
117
|
+
)}
|
|
118
|
+
{...props}
|
|
119
|
+
/>
|
|
120
|
+
</MenubarPrimitive.Portal>
|
|
121
|
+
),
|
|
122
|
+
);
|
|
154
123
|
|
|
155
124
|
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
156
125
|
|
|
@@ -159,18 +128,10 @@ MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
|
159
128
|
* -------------------------------------------------------------------------- */
|
|
160
129
|
|
|
161
130
|
type MenubarContentElement = React.ElementRef<typeof MenubarPrimitive.Content>;
|
|
162
|
-
type MenubarContentProps = React.ComponentPropsWithoutRef<
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
const MenubarContent = React.forwardRef<
|
|
167
|
-
MenubarContentElement,
|
|
168
|
-
MenubarContentProps
|
|
169
|
-
>(
|
|
170
|
-
(
|
|
171
|
-
{ className, align = 'start', alignOffset = -4, sideOffset = 8, ...props },
|
|
172
|
-
ref,
|
|
173
|
-
) => (
|
|
131
|
+
type MenubarContentProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>;
|
|
132
|
+
|
|
133
|
+
const MenubarContent = React.forwardRef<MenubarContentElement, MenubarContentProps>(
|
|
134
|
+
({ className, align = 'start', alignOffset = -4, sideOffset = 8, ...props }, ref) => (
|
|
174
135
|
<MenubarPrimitive.Portal>
|
|
175
136
|
<MenubarPrimitive.Content
|
|
176
137
|
ref={ref}
|
|
@@ -195,145 +156,116 @@ MenubarContent.displayName = MenubarPrimitive.Content.displayName;
|
|
|
195
156
|
|
|
196
157
|
type MenubarItemElement = React.ElementRef<typeof MenubarPrimitive.Item>;
|
|
197
158
|
|
|
198
|
-
interface MenubarItemProps
|
|
199
|
-
extends React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> {
|
|
159
|
+
interface MenubarItemProps extends React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> {
|
|
200
160
|
inset?: boolean;
|
|
201
161
|
}
|
|
202
162
|
|
|
203
|
-
const MenubarItem = React.forwardRef<MenubarItemElement, MenubarItemProps>(
|
|
204
|
-
|
|
205
|
-
<MenubarPrimitive.Item
|
|
206
|
-
ref={ref}
|
|
207
|
-
className={cn(
|
|
208
|
-
'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',
|
|
209
|
-
inset && 'pl-8',
|
|
210
|
-
className,
|
|
211
|
-
)}
|
|
212
|
-
{...props}
|
|
213
|
-
/>
|
|
214
|
-
),
|
|
215
|
-
);
|
|
216
|
-
|
|
217
|
-
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
218
|
-
|
|
219
|
-
/* -----------------------------------------------------------------------------
|
|
220
|
-
* Component: MenubarCheckboxItem
|
|
221
|
-
* -------------------------------------------------------------------------- */
|
|
222
|
-
|
|
223
|
-
type MenubarCheckboxItemElement = React.ElementRef<
|
|
224
|
-
typeof MenubarPrimitive.CheckboxItem
|
|
225
|
-
>;
|
|
226
|
-
type MenubarCheckboxItemProps = React.ComponentPropsWithoutRef<
|
|
227
|
-
typeof MenubarPrimitive.CheckboxItem
|
|
228
|
-
>;
|
|
229
|
-
|
|
230
|
-
const MenubarCheckboxItem = React.forwardRef<
|
|
231
|
-
MenubarCheckboxItemElement,
|
|
232
|
-
MenubarCheckboxItemProps
|
|
233
|
-
>(({ children, className, checked, ...props }, ref) => (
|
|
234
|
-
<MenubarPrimitive.CheckboxItem
|
|
163
|
+
const MenubarItem = React.forwardRef<MenubarItemElement, MenubarItemProps>(({ className, inset, ...props }, ref) => (
|
|
164
|
+
<MenubarPrimitive.Item
|
|
235
165
|
ref={ref}
|
|
236
166
|
className={cn(
|
|
237
|
-
'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5
|
|
167
|
+
'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',
|
|
168
|
+
inset && 'pl-8',
|
|
238
169
|
className,
|
|
239
170
|
)}
|
|
240
|
-
checked={checked}
|
|
241
171
|
{...props}
|
|
242
|
-
|
|
243
|
-
<span className="absolute left-2 flex size-3.5 items-center justify-center">
|
|
244
|
-
<MenubarPrimitive.ItemIndicator>
|
|
245
|
-
<CheckIcon className="size-4" />
|
|
246
|
-
</MenubarPrimitive.ItemIndicator>
|
|
247
|
-
</span>
|
|
248
|
-
{children}
|
|
249
|
-
</MenubarPrimitive.CheckboxItem>
|
|
172
|
+
/>
|
|
250
173
|
));
|
|
251
174
|
|
|
252
|
-
|
|
175
|
+
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
253
176
|
|
|
254
177
|
/* -----------------------------------------------------------------------------
|
|
255
|
-
* Component:
|
|
178
|
+
* Component: MenubarCheckboxItem
|
|
256
179
|
* -------------------------------------------------------------------------- */
|
|
257
180
|
|
|
258
|
-
type
|
|
259
|
-
|
|
260
|
-
>;
|
|
261
|
-
type MenubarRadioItemProps = React.ComponentPropsWithoutRef<
|
|
262
|
-
typeof MenubarPrimitive.RadioItem
|
|
263
|
-
>;
|
|
264
|
-
|
|
265
|
-
const MenubarRadioItem = React.forwardRef<
|
|
266
|
-
MenubarRadioItemElement,
|
|
267
|
-
MenubarRadioItemProps
|
|
268
|
-
>(({ children, className, ...props }, ref) => (
|
|
269
|
-
<MenubarPrimitive.RadioItem
|
|
270
|
-
ref={ref}
|
|
271
|
-
className={cn(
|
|
272
|
-
'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',
|
|
273
|
-
className,
|
|
274
|
-
)}
|
|
275
|
-
{...props}
|
|
276
|
-
>
|
|
277
|
-
<span className="absolute left-2 flex size-3.5 items-center justify-center">
|
|
278
|
-
<MenubarPrimitive.ItemIndicator>
|
|
279
|
-
<DotFilledIcon className="size-4 fill-current" />
|
|
280
|
-
</MenubarPrimitive.ItemIndicator>
|
|
281
|
-
</span>
|
|
282
|
-
{children}
|
|
283
|
-
</MenubarPrimitive.RadioItem>
|
|
284
|
-
));
|
|
181
|
+
type MenubarCheckboxItemElement = React.ElementRef<typeof MenubarPrimitive.CheckboxItem>;
|
|
182
|
+
type MenubarCheckboxItemProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>;
|
|
285
183
|
|
|
286
|
-
|
|
184
|
+
const MenubarCheckboxItem = React.forwardRef<MenubarCheckboxItemElement, MenubarCheckboxItemProps>(
|
|
185
|
+
({ children, className, checked, ...props }, ref) => (
|
|
186
|
+
<MenubarPrimitive.CheckboxItem
|
|
187
|
+
ref={ref}
|
|
188
|
+
className={cn(
|
|
189
|
+
'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',
|
|
190
|
+
className,
|
|
191
|
+
)}
|
|
192
|
+
checked={checked}
|
|
193
|
+
{...props}
|
|
194
|
+
>
|
|
195
|
+
<span className="absolute left-2 flex size-3.5 items-center justify-center">
|
|
196
|
+
<MenubarPrimitive.ItemIndicator>
|
|
197
|
+
<CheckIcon className="size-4" />
|
|
198
|
+
</MenubarPrimitive.ItemIndicator>
|
|
199
|
+
</span>
|
|
200
|
+
{children}
|
|
201
|
+
</MenubarPrimitive.CheckboxItem>
|
|
202
|
+
),
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
|
|
287
206
|
|
|
288
207
|
/* -----------------------------------------------------------------------------
|
|
289
|
-
* Component:
|
|
208
|
+
* Component: MenubarRadioItem
|
|
290
209
|
* -------------------------------------------------------------------------- */
|
|
291
210
|
|
|
292
|
-
type
|
|
211
|
+
type MenubarRadioItemElement = React.ElementRef<typeof MenubarPrimitive.RadioItem>;
|
|
212
|
+
type MenubarRadioItemProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>;
|
|
293
213
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
const MenubarLabel = React.forwardRef<MenubarLabelElement, MenubarLabelProps>(
|
|
300
|
-
({ className, inset, ...props }, ref) => (
|
|
301
|
-
<MenubarPrimitive.Label
|
|
214
|
+
const MenubarRadioItem = React.forwardRef<MenubarRadioItemElement, MenubarRadioItemProps>(
|
|
215
|
+
({ children, className, ...props }, ref) => (
|
|
216
|
+
<MenubarPrimitive.RadioItem
|
|
302
217
|
ref={ref}
|
|
303
218
|
className={cn(
|
|
304
|
-
'
|
|
305
|
-
inset && 'pl-8',
|
|
219
|
+
'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50',
|
|
306
220
|
className,
|
|
307
221
|
)}
|
|
308
222
|
{...props}
|
|
309
|
-
|
|
223
|
+
>
|
|
224
|
+
<span className="absolute left-2 flex size-3.5 items-center justify-center">
|
|
225
|
+
<MenubarPrimitive.ItemIndicator>
|
|
226
|
+
<DotFilledIcon className="size-4 fill-current" />
|
|
227
|
+
</MenubarPrimitive.ItemIndicator>
|
|
228
|
+
</span>
|
|
229
|
+
{children}
|
|
230
|
+
</MenubarPrimitive.RadioItem>
|
|
310
231
|
),
|
|
311
232
|
);
|
|
312
233
|
|
|
313
|
-
|
|
234
|
+
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
|
|
314
235
|
|
|
315
236
|
/* -----------------------------------------------------------------------------
|
|
316
|
-
* Component:
|
|
237
|
+
* Component: MenubarLabel
|
|
317
238
|
* -------------------------------------------------------------------------- */
|
|
318
239
|
|
|
319
|
-
type
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
MenubarSeparatorElement,
|
|
328
|
-
MenubarSeparatorProps
|
|
329
|
-
>(({ className, ...props }, ref) => (
|
|
330
|
-
<MenubarPrimitive.Separator
|
|
240
|
+
type MenubarLabelElement = React.ElementRef<typeof MenubarPrimitive.Label>;
|
|
241
|
+
|
|
242
|
+
interface MenubarLabelProps extends React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> {
|
|
243
|
+
inset?: boolean;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const MenubarLabel = React.forwardRef<MenubarLabelElement, MenubarLabelProps>(({ className, inset, ...props }, ref) => (
|
|
247
|
+
<MenubarPrimitive.Label
|
|
331
248
|
ref={ref}
|
|
332
|
-
className={cn('
|
|
249
|
+
className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}
|
|
333
250
|
{...props}
|
|
334
251
|
/>
|
|
335
252
|
));
|
|
336
253
|
|
|
254
|
+
MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
|
|
255
|
+
|
|
256
|
+
/* -----------------------------------------------------------------------------
|
|
257
|
+
* Component: MenubarSeparator
|
|
258
|
+
* -------------------------------------------------------------------------- */
|
|
259
|
+
|
|
260
|
+
type MenubarSeparatorElement = React.ElementRef<typeof MenubarPrimitive.Separator>;
|
|
261
|
+
type MenubarSeparatorProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>;
|
|
262
|
+
|
|
263
|
+
const MenubarSeparator = React.forwardRef<MenubarSeparatorElement, MenubarSeparatorProps>(
|
|
264
|
+
({ className, ...props }, ref) => (
|
|
265
|
+
<MenubarPrimitive.Separator ref={ref} className={cn('bg-muted -mx-1 my-1 h-px', className)} {...props} />
|
|
266
|
+
),
|
|
267
|
+
);
|
|
268
|
+
|
|
337
269
|
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
338
270
|
|
|
339
271
|
/* -----------------------------------------------------------------------------
|
|
@@ -342,19 +274,8 @@ MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
|
342
274
|
|
|
343
275
|
type MenubarShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
344
276
|
|
|
345
|
-
function MenubarShortcut({
|
|
346
|
-
className,
|
|
347
|
-
...props
|
|
348
|
-
}: MenubarShortcutProps): React.JSX.Element {
|
|
349
|
-
return (
|
|
350
|
-
<span
|
|
351
|
-
className={cn(
|
|
352
|
-
'text-muted-foreground ml-auto text-xs tracking-widest',
|
|
353
|
-
className,
|
|
354
|
-
)}
|
|
355
|
-
{...props}
|
|
356
|
-
/>
|
|
357
|
-
);
|
|
277
|
+
function MenubarShortcut({ className, ...props }: MenubarShortcutProps): React.JSX.Element {
|
|
278
|
+
return <span className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)} {...props} />;
|
|
358
279
|
}
|
|
359
280
|
|
|
360
281
|
/* -----------------------------------------------------------------------------
|