create-next-imagicma 0.1.11 → 0.1.13

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.
Files changed (96) hide show
  1. package/README.md +0 -2
  2. package/package.json +1 -1
  3. package/template-hono/AGENTS.md +53 -95
  4. package/template-hono/README.md +3 -31
  5. package/template-hono/client/public/imagicma-picker-bridge.js +6 -2
  6. package/template-hono/client/public/imagicma-preview-feedback.js +1 -0
  7. package/template-hono/client/src/lib/imagicma-preview-bridge.ts +1 -1
  8. package/template-hono/client/src/lib/imagicma-preview-picker.ts +130 -28
  9. package/template-hono/vite.config.ts +1 -1
  10. package/template/.env.example +0 -10
  11. package/template/AGENTS.md +0 -225
  12. package/template/README.md +0 -34
  13. package/template/app/_components/DevPreviewShield.tsx +0 -638
  14. package/template/app/api/greeting/route.ts +0 -27
  15. package/template/app/error.tsx +0 -93
  16. package/template/app/favicon.ico +0 -0
  17. package/template/app/globals.css +0 -767
  18. package/template/app/hello/_components/HelloClient.tsx +0 -94
  19. package/template/app/hello/page.tsx +0 -23
  20. package/template/app/layout.tsx +0 -32
  21. package/template/app/page.tsx +0 -27
  22. package/template/app/providers.tsx +0 -25
  23. package/template/components/ui/accordion.tsx +0 -58
  24. package/template/components/ui/alert-dialog.tsx +0 -141
  25. package/template/components/ui/alert.tsx +0 -61
  26. package/template/components/ui/aspect-ratio.tsx +0 -7
  27. package/template/components/ui/avatar.tsx +0 -51
  28. package/template/components/ui/badge.tsx +0 -40
  29. package/template/components/ui/breadcrumb.tsx +0 -117
  30. package/template/components/ui/button.tsx +0 -64
  31. package/template/components/ui/calendar.tsx +0 -72
  32. package/template/components/ui/card.tsx +0 -87
  33. package/template/components/ui/carousel.tsx +0 -262
  34. package/template/components/ui/chart.tsx +0 -365
  35. package/template/components/ui/checkbox.tsx +0 -30
  36. package/template/components/ui/collapsible.tsx +0 -11
  37. package/template/components/ui/command.tsx +0 -153
  38. package/template/components/ui/context-menu.tsx +0 -200
  39. package/template/components/ui/dialog.tsx +0 -122
  40. package/template/components/ui/drawer.tsx +0 -118
  41. package/template/components/ui/dropdown-menu.tsx +0 -200
  42. package/template/components/ui/form.tsx +0 -178
  43. package/template/components/ui/hover-card.tsx +0 -29
  44. package/template/components/ui/input-otp.tsx +0 -71
  45. package/template/components/ui/input.tsx +0 -25
  46. package/template/components/ui/label.tsx +0 -26
  47. package/template/components/ui/menubar.tsx +0 -256
  48. package/template/components/ui/navigation-menu.tsx +0 -130
  49. package/template/components/ui/pagination.tsx +0 -119
  50. package/template/components/ui/popover.tsx +0 -31
  51. package/template/components/ui/progress.tsx +0 -28
  52. package/template/components/ui/radio-group.tsx +0 -44
  53. package/template/components/ui/resizable.tsx +0 -45
  54. package/template/components/ui/scroll-area.tsx +0 -48
  55. package/template/components/ui/select.tsx +0 -160
  56. package/template/components/ui/separator.tsx +0 -31
  57. package/template/components/ui/sheet.tsx +0 -140
  58. package/template/components/ui/sidebar.tsx +0 -732
  59. package/template/components/ui/skeleton.tsx +0 -17
  60. package/template/components/ui/slider.tsx +0 -28
  61. package/template/components/ui/switch.tsx +0 -29
  62. package/template/components/ui/table.tsx +0 -119
  63. package/template/components/ui/tabs.tsx +0 -55
  64. package/template/components/ui/textarea.tsx +0 -24
  65. package/template/components/ui/toast.tsx +0 -129
  66. package/template/components/ui/toaster.tsx +0 -35
  67. package/template/components/ui/toggle-group.tsx +0 -61
  68. package/template/components/ui/toggle.tsx +0 -45
  69. package/template/components/ui/tooltip.tsx +0 -30
  70. package/template/drizzle.config.ts +0 -50
  71. package/template/eslint.config.mjs +0 -18
  72. package/template/gitignore +0 -46
  73. package/template/hooks/use-greeting.ts +0 -15
  74. package/template/hooks/use-mobile.ts +0 -21
  75. package/template/hooks/use-toast.ts +0 -194
  76. package/template/lib/queryClient.ts +0 -59
  77. package/template/lib/theme/default-theme.ts +0 -11
  78. package/template/lib/utils.ts +0 -6
  79. package/template/next.config.ts +0 -8
  80. package/template/package.json +0 -76
  81. package/template/pnpm-lock.yaml +0 -6937
  82. package/template/postcss.config.mjs +0 -7
  83. package/template/process-compose.yaml +0 -13
  84. package/template/public/file.svg +0 -1
  85. package/template/public/globe.svg +0 -1
  86. package/template/public/imagicma-picker-bridge.js +0 -374
  87. package/template/public/next.svg +0 -1
  88. package/template/public/vercel.svg +0 -1
  89. package/template/public/window.svg +0 -1
  90. package/template/server/db.ts +0 -24
  91. package/template/server/storage.ts +0 -41
  92. package/template/shared/routes.ts +0 -13
  93. package/template/shared/schema.ts +0 -17
  94. package/template/tailwind.config.mjs +0 -96
  95. package/template/tsconfig.json +0 -35
  96. package/template/types/pg.d.ts +0 -19
@@ -1,178 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as LabelPrimitive from "@radix-ui/react-label"
5
- import { Slot } from "@radix-ui/react-slot"
6
- import {
7
- Controller,
8
- FormProvider,
9
- useFormContext,
10
- type ControllerProps,
11
- type FieldPath,
12
- type FieldValues,
13
- } from "react-hook-form"
14
-
15
- import { cn } from "@/lib/utils"
16
- import { Label } from "@/components/ui/label"
17
-
18
- const Form = FormProvider
19
-
20
- type FormFieldContextValue<
21
- TFieldValues extends FieldValues = FieldValues,
22
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
23
- > = {
24
- name: TName
25
- }
26
-
27
- const FormFieldContext = React.createContext<FormFieldContextValue>(
28
- {} as FormFieldContextValue
29
- )
30
-
31
- const FormField = <
32
- TFieldValues extends FieldValues = FieldValues,
33
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
34
- >({
35
- ...props
36
- }: ControllerProps<TFieldValues, TName>) => {
37
- return (
38
- <FormFieldContext.Provider value={{ name: props.name }}>
39
- <Controller {...props} />
40
- </FormFieldContext.Provider>
41
- )
42
- }
43
-
44
- const useFormField = () => {
45
- const fieldContext = React.useContext(FormFieldContext)
46
- const itemContext = React.useContext(FormItemContext)
47
- const { getFieldState, formState } = useFormContext()
48
-
49
- const fieldState = getFieldState(fieldContext.name, formState)
50
-
51
- if (!fieldContext) {
52
- throw new Error("useFormField should be used within <FormField>")
53
- }
54
-
55
- const { id } = itemContext
56
-
57
- return {
58
- id,
59
- name: fieldContext.name,
60
- formItemId: `${id}-form-item`,
61
- formDescriptionId: `${id}-form-item-description`,
62
- formMessageId: `${id}-form-item-message`,
63
- ...fieldState,
64
- }
65
- }
66
-
67
- type FormItemContextValue = {
68
- id: string
69
- }
70
-
71
- const FormItemContext = React.createContext<FormItemContextValue>(
72
- {} as FormItemContextValue
73
- )
74
-
75
- const FormItem = React.forwardRef<
76
- HTMLDivElement,
77
- React.HTMLAttributes<HTMLDivElement>
78
- >(({ className, ...props }, ref) => {
79
- const id = React.useId()
80
-
81
- return (
82
- <FormItemContext.Provider value={{ id }}>
83
- <div ref={ref} className={cn("space-y-2", className)} {...props} />
84
- </FormItemContext.Provider>
85
- )
86
- })
87
- FormItem.displayName = "FormItem"
88
-
89
- const FormLabel = React.forwardRef<
90
- React.ElementRef<typeof LabelPrimitive.Root>,
91
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
92
- >(({ className, ...props }, ref) => {
93
- const { error, formItemId } = useFormField()
94
-
95
- return (
96
- <Label
97
- ref={ref}
98
- className={cn(error && "text-destructive", className)}
99
- htmlFor={formItemId}
100
- {...props}
101
- />
102
- )
103
- })
104
- FormLabel.displayName = "FormLabel"
105
-
106
- const FormControl = React.forwardRef<
107
- React.ElementRef<typeof Slot>,
108
- React.ComponentPropsWithoutRef<typeof Slot>
109
- >(({ ...props }, ref) => {
110
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
111
-
112
- return (
113
- <Slot
114
- ref={ref}
115
- id={formItemId}
116
- aria-describedby={
117
- !error
118
- ? `${formDescriptionId}`
119
- : `${formDescriptionId} ${formMessageId}`
120
- }
121
- aria-invalid={!!error}
122
- {...props}
123
- />
124
- )
125
- })
126
- FormControl.displayName = "FormControl"
127
-
128
- const FormDescription = React.forwardRef<
129
- HTMLParagraphElement,
130
- React.HTMLAttributes<HTMLParagraphElement>
131
- >(({ className, ...props }, ref) => {
132
- const { formDescriptionId } = useFormField()
133
-
134
- return (
135
- <p
136
- ref={ref}
137
- id={formDescriptionId}
138
- className={cn("text-sm text-muted-foreground", className)}
139
- {...props}
140
- />
141
- )
142
- })
143
- FormDescription.displayName = "FormDescription"
144
-
145
- const FormMessage = React.forwardRef<
146
- HTMLParagraphElement,
147
- React.HTMLAttributes<HTMLParagraphElement>
148
- >(({ className, children, ...props }, ref) => {
149
- const { error, formMessageId } = useFormField()
150
- const body = error ? String(error?.message ?? "") : children
151
-
152
- if (!body) {
153
- return null
154
- }
155
-
156
- return (
157
- <p
158
- ref={ref}
159
- id={formMessageId}
160
- className={cn("text-sm font-medium text-destructive", className)}
161
- {...props}
162
- >
163
- {body}
164
- </p>
165
- )
166
- })
167
- FormMessage.displayName = "FormMessage"
168
-
169
- export {
170
- useFormField,
171
- Form,
172
- FormItem,
173
- FormLabel,
174
- FormControl,
175
- FormDescription,
176
- FormMessage,
177
- FormField,
178
- }
@@ -1,29 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as HoverCardPrimitive from "@radix-ui/react-hover-card"
5
-
6
- import { cn } from "@/lib/utils"
7
-
8
- const HoverCard = HoverCardPrimitive.Root
9
-
10
- const HoverCardTrigger = HoverCardPrimitive.Trigger
11
-
12
- const HoverCardContent = React.forwardRef<
13
- React.ElementRef<typeof HoverCardPrimitive.Content>,
14
- React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>
15
- >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
16
- <HoverCardPrimitive.Content
17
- ref={ref}
18
- align={align}
19
- sideOffset={sideOffset}
20
- className={cn(
21
- "z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]",
22
- className
23
- )}
24
- {...props}
25
- />
26
- ))
27
- HoverCardContent.displayName = HoverCardPrimitive.Content.displayName
28
-
29
- export { HoverCard, HoverCardTrigger, HoverCardContent }
@@ -1,71 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react"
4
- import { OTPInput, OTPInputContext } from "input-otp"
5
- import { Dot } from "lucide-react"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- const InputOTP = React.forwardRef<
10
- React.ElementRef<typeof OTPInput>,
11
- React.ComponentPropsWithoutRef<typeof OTPInput>
12
- >(({ className, containerClassName, ...props }, ref) => (
13
- <OTPInput
14
- ref={ref}
15
- containerClassName={cn(
16
- "flex items-center gap-2 has-[:disabled]:opacity-50",
17
- containerClassName
18
- )}
19
- className={cn("disabled:cursor-not-allowed", className)}
20
- {...props}
21
- />
22
- ))
23
- InputOTP.displayName = "InputOTP"
24
-
25
- const InputOTPGroup = React.forwardRef<
26
- React.ElementRef<"div">,
27
- React.ComponentPropsWithoutRef<"div">
28
- >(({ className, ...props }, ref) => (
29
- <div ref={ref} className={cn("flex items-center", className)} {...props} />
30
- ))
31
- InputOTPGroup.displayName = "InputOTPGroup"
32
-
33
- const InputOTPSlot = React.forwardRef<
34
- React.ElementRef<"div">,
35
- React.ComponentPropsWithoutRef<"div"> & { index: number }
36
- >(({ index, className, ...props }, ref) => {
37
- const inputOTPContext = React.useContext(OTPInputContext)
38
- const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]
39
-
40
- return (
41
- <div
42
- ref={ref}
43
- className={cn(
44
- "relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
45
- isActive && "z-10 ring-2 ring-ring ring-offset-background",
46
- className
47
- )}
48
- {...props}
49
- >
50
- {char}
51
- {hasFakeCaret && (
52
- <div className="pointer-events-none absolute inset-0 flex items-center justify-center">
53
- <div className="h-4 w-px animate-caret-blink bg-foreground duration-1000" />
54
- </div>
55
- )}
56
- </div>
57
- )
58
- })
59
- InputOTPSlot.displayName = "InputOTPSlot"
60
-
61
- const InputOTPSeparator = React.forwardRef<
62
- React.ElementRef<"div">,
63
- React.ComponentPropsWithoutRef<"div">
64
- >(({ ...props }, ref) => (
65
- <div ref={ref} role="separator" {...props}>
66
- <Dot />
67
- </div>
68
- ))
69
- InputOTPSeparator.displayName = "InputOTPSeparator"
70
-
71
- export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
@@ -1,25 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
8
- ({ className, type, ...props }, ref) => {
9
- // h-9 to match icon buttons and default buttons.
10
- return (
11
- <input
12
- type={type}
13
- className={cn(
14
- "flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
15
- className
16
- )}
17
- ref={ref}
18
- {...props}
19
- />
20
- )
21
- }
22
- )
23
- Input.displayName = "Input"
24
-
25
- export { Input }
@@ -1,26 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react"
4
- import * as LabelPrimitive from "@radix-ui/react-label"
5
- import { cva, type VariantProps } from "class-variance-authority"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- const labelVariants = cva(
10
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
11
- )
12
-
13
- const Label = React.forwardRef<
14
- React.ElementRef<typeof LabelPrimitive.Root>,
15
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
16
- VariantProps<typeof labelVariants>
17
- >(({ className, ...props }, ref) => (
18
- <LabelPrimitive.Root
19
- ref={ref}
20
- className={cn(labelVariants(), className)}
21
- {...props}
22
- />
23
- ))
24
- Label.displayName = LabelPrimitive.Root.displayName
25
-
26
- export { Label }
@@ -1,256 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as MenubarPrimitive from "@radix-ui/react-menubar"
5
- import { Check, ChevronRight, Circle } from "lucide-react"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- function MenubarMenu({
10
- ...props
11
- }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
12
- return <MenubarPrimitive.Menu {...props} />
13
- }
14
-
15
- function MenubarGroup({
16
- ...props
17
- }: React.ComponentProps<typeof MenubarPrimitive.Group>) {
18
- return <MenubarPrimitive.Group {...props} />
19
- }
20
-
21
- function MenubarPortal({
22
- ...props
23
- }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
24
- return <MenubarPrimitive.Portal {...props} />
25
- }
26
-
27
- function MenubarRadioGroup({
28
- ...props
29
- }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
30
- return <MenubarPrimitive.RadioGroup {...props} />
31
- }
32
-
33
- function MenubarSub({
34
- ...props
35
- }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
36
- return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
37
- }
38
-
39
- const Menubar = React.forwardRef<
40
- React.ElementRef<typeof MenubarPrimitive.Root>,
41
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
42
- >(({ className, ...props }, ref) => (
43
- <MenubarPrimitive.Root
44
- ref={ref}
45
- className={cn(
46
- "flex h-10 items-center space-x-1 rounded-md border bg-background p-1",
47
- className
48
- )}
49
- {...props}
50
- />
51
- ))
52
- Menubar.displayName = MenubarPrimitive.Root.displayName
53
-
54
- const MenubarTrigger = React.forwardRef<
55
- React.ElementRef<typeof MenubarPrimitive.Trigger>,
56
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
57
- >(({ className, ...props }, ref) => (
58
- <MenubarPrimitive.Trigger
59
- ref={ref}
60
- className={cn(
61
- "flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
62
- className
63
- )}
64
- {...props}
65
- />
66
- ))
67
- MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
68
-
69
- const MenubarSubTrigger = React.forwardRef<
70
- React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
71
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
72
- inset?: boolean
73
- }
74
- >(({ className, inset, children, ...props }, ref) => (
75
- <MenubarPrimitive.SubTrigger
76
- ref={ref}
77
- className={cn(
78
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
79
- inset && "pl-8",
80
- className
81
- )}
82
- {...props}
83
- >
84
- {children}
85
- <ChevronRight className="ml-auto h-4 w-4" />
86
- </MenubarPrimitive.SubTrigger>
87
- ))
88
- MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
89
-
90
- const MenubarSubContent = React.forwardRef<
91
- React.ElementRef<typeof MenubarPrimitive.SubContent>,
92
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
93
- >(({ className, ...props }, ref) => (
94
- <MenubarPrimitive.SubContent
95
- ref={ref}
96
- className={cn(
97
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]",
98
- className
99
- )}
100
- {...props}
101
- />
102
- ))
103
- MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
104
-
105
- const MenubarContent = React.forwardRef<
106
- React.ElementRef<typeof MenubarPrimitive.Content>,
107
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
108
- >(
109
- (
110
- { className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
111
- ref
112
- ) => (
113
- <MenubarPrimitive.Portal>
114
- <MenubarPrimitive.Content
115
- ref={ref}
116
- align={align}
117
- alignOffset={alignOffset}
118
- sideOffset={sideOffset}
119
- className={cn(
120
- "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]",
121
- className
122
- )}
123
- {...props}
124
- />
125
- </MenubarPrimitive.Portal>
126
- )
127
- )
128
- MenubarContent.displayName = MenubarPrimitive.Content.displayName
129
-
130
- const MenubarItem = React.forwardRef<
131
- React.ElementRef<typeof MenubarPrimitive.Item>,
132
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
133
- inset?: boolean
134
- }
135
- >(({ className, inset, ...props }, ref) => (
136
- <MenubarPrimitive.Item
137
- ref={ref}
138
- className={cn(
139
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
140
- inset && "pl-8",
141
- className
142
- )}
143
- {...props}
144
- />
145
- ))
146
- MenubarItem.displayName = MenubarPrimitive.Item.displayName
147
-
148
- const MenubarCheckboxItem = React.forwardRef<
149
- React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
150
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
151
- >(({ className, children, checked, ...props }, ref) => (
152
- <MenubarPrimitive.CheckboxItem
153
- ref={ref}
154
- className={cn(
155
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
156
- className
157
- )}
158
- checked={checked}
159
- {...props}
160
- >
161
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
162
- <MenubarPrimitive.ItemIndicator>
163
- <Check className="h-4 w-4" />
164
- </MenubarPrimitive.ItemIndicator>
165
- </span>
166
- {children}
167
- </MenubarPrimitive.CheckboxItem>
168
- ))
169
- MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
170
-
171
- const MenubarRadioItem = React.forwardRef<
172
- React.ElementRef<typeof MenubarPrimitive.RadioItem>,
173
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
174
- >(({ className, children, ...props }, ref) => (
175
- <MenubarPrimitive.RadioItem
176
- ref={ref}
177
- className={cn(
178
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
179
- className
180
- )}
181
- {...props}
182
- >
183
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
184
- <MenubarPrimitive.ItemIndicator>
185
- <Circle className="h-2 w-2 fill-current" />
186
- </MenubarPrimitive.ItemIndicator>
187
- </span>
188
- {children}
189
- </MenubarPrimitive.RadioItem>
190
- ))
191
- MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
192
-
193
- const MenubarLabel = React.forwardRef<
194
- React.ElementRef<typeof MenubarPrimitive.Label>,
195
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
196
- inset?: boolean
197
- }
198
- >(({ className, inset, ...props }, ref) => (
199
- <MenubarPrimitive.Label
200
- ref={ref}
201
- className={cn(
202
- "px-2 py-1.5 text-sm font-semibold",
203
- inset && "pl-8",
204
- className
205
- )}
206
- {...props}
207
- />
208
- ))
209
- MenubarLabel.displayName = MenubarPrimitive.Label.displayName
210
-
211
- const MenubarSeparator = React.forwardRef<
212
- React.ElementRef<typeof MenubarPrimitive.Separator>,
213
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
214
- >(({ className, ...props }, ref) => (
215
- <MenubarPrimitive.Separator
216
- ref={ref}
217
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
218
- {...props}
219
- />
220
- ))
221
- MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
222
-
223
- const MenubarShortcut = ({
224
- className,
225
- ...props
226
- }: React.HTMLAttributes<HTMLSpanElement>) => {
227
- return (
228
- <span
229
- className={cn(
230
- "ml-auto text-xs tracking-widest text-muted-foreground",
231
- className
232
- )}
233
- {...props}
234
- />
235
- )
236
- }
237
- MenubarShortcut.displayname = "MenubarShortcut"
238
-
239
- export {
240
- Menubar,
241
- MenubarMenu,
242
- MenubarTrigger,
243
- MenubarContent,
244
- MenubarItem,
245
- MenubarSeparator,
246
- MenubarLabel,
247
- MenubarCheckboxItem,
248
- MenubarRadioGroup,
249
- MenubarRadioItem,
250
- MenubarPortal,
251
- MenubarSubContent,
252
- MenubarSubTrigger,
253
- MenubarGroup,
254
- MenubarSub,
255
- MenubarShortcut,
256
- }