@dinachi/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +131 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +643 -0
  4. package/package.json +56 -0
  5. package/templates/accordion/accordion.tsx +85 -0
  6. package/templates/accordion/index.ts +1 -0
  7. package/templates/alert-dialog/alert-dialog.tsx +162 -0
  8. package/templates/alert-dialog/index.ts +13 -0
  9. package/templates/avatar/avatar.tsx +64 -0
  10. package/templates/avatar/index.ts +1 -0
  11. package/templates/button/button.tsx +54 -0
  12. package/templates/button/index.ts +2 -0
  13. package/templates/checkbox/checkbox.tsx +29 -0
  14. package/templates/checkbox/index.ts +1 -0
  15. package/templates/checkbox-group/checkbox-group.tsx +19 -0
  16. package/templates/checkbox-group/index.ts +1 -0
  17. package/templates/collapsible/collapsible.tsx +65 -0
  18. package/templates/collapsible/index.ts +1 -0
  19. package/templates/context-menu/context-menu.tsx +278 -0
  20. package/templates/context-menu/index.ts +17 -0
  21. package/templates/dialog/dialog.tsx +158 -0
  22. package/templates/dialog/index.ts +1 -0
  23. package/templates/field/field.tsx +119 -0
  24. package/templates/field/index.ts +1 -0
  25. package/templates/form/form.tsx +71 -0
  26. package/templates/form/index.ts +1 -0
  27. package/templates/input/index.ts +2 -0
  28. package/templates/input/input.tsx +17 -0
  29. package/templates/menubar/index.ts +18 -0
  30. package/templates/menubar/menubar.tsx +303 -0
  31. package/templates/navigation-menu/index.ts +13 -0
  32. package/templates/navigation-menu/navigation-menu.tsx +205 -0
  33. package/templates/preview-card/index.ts +1 -0
  34. package/templates/preview-card/preview-card.tsx +142 -0
  35. package/templates/select/index.ts +1 -0
  36. package/templates/select/select.tsx +208 -0
  37. package/templates/slider/index.ts +9 -0
  38. package/templates/slider/slider.tsx +121 -0
  39. package/templates/tabs/index.ts +7 -0
  40. package/templates/tabs/tabs.tsx +89 -0
  41. package/templates/toast/index.ts +1 -0
  42. package/templates/toast/toast.tsx +276 -0
  43. package/templates/toggle/index.ts +1 -0
  44. package/templates/toggle/toggle.tsx +83 -0
  45. package/templates/toolbar/index.ts +1 -0
  46. package/templates/toolbar/toolbar.tsx +124 -0
  47. package/templates/tooltip/index.ts +1 -0
  48. package/templates/tooltip/tooltip.tsx +217 -0
  49. package/templates/utils/utils.ts +7 -0
  50. package/templates/utils/variants.ts +7 -0
@@ -0,0 +1,85 @@
1
+ // @ts-nocheck
2
+ import * as React from "react";
3
+ import { Accordion as BaseAccordion } from "@base-ui-components/react/accordion";
4
+ import { cn } from "@/lib/utils"
5
+ import { ChevronDown } from "lucide-react";
6
+
7
+ const Accordion = BaseAccordion.Root;
8
+
9
+ const AccordionItem = React.forwardRef<
10
+ HTMLDivElement,
11
+ React.ComponentProps<typeof BaseAccordion.Item>
12
+ >(({ className, ...props }, ref) => (
13
+ <BaseAccordion.Item
14
+ ref={ref}
15
+ className={cn("border-b", className)}
16
+ {...props}
17
+ />
18
+ ));
19
+ AccordionItem.displayName = "AccordionItem";
20
+
21
+ const AccordionHeader = React.forwardRef<
22
+ HTMLHeadingElement,
23
+ React.ComponentProps<typeof BaseAccordion.Header>
24
+ >(({ className, ...props }, ref) => (
25
+ <BaseAccordion.Header
26
+ ref={ref}
27
+ className={cn("flex", className)}
28
+ {...props}
29
+ />
30
+ ));
31
+ AccordionHeader.displayName = "AccordionHeader";
32
+
33
+ const AccordionTrigger = React.forwardRef<
34
+ HTMLButtonElement,
35
+ React.ComponentProps<typeof BaseAccordion.Trigger> & {
36
+ children?: React.ReactNode;
37
+ }
38
+ >(({ className, children, ...props }, ref) => (
39
+ <BaseAccordion.Trigger
40
+ ref={ref}
41
+ className={cn(
42
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline",
43
+ "[&[data-panel-open]>svg]:rotate-180",
44
+ "disabled:pointer-events-none disabled:opacity-50",
45
+ className
46
+ )}
47
+ {...props}
48
+ >
49
+ {children}
50
+ <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
51
+ </BaseAccordion.Trigger>
52
+ ));
53
+ AccordionTrigger.displayName = "AccordionTrigger";
54
+
55
+ const AccordionPanel = React.forwardRef<
56
+ HTMLDivElement,
57
+ React.ComponentProps<typeof BaseAccordion.Panel>
58
+ >(({ className, children, ...props }, ref) => (
59
+ <BaseAccordion.Panel
60
+ ref={ref}
61
+ className={cn(
62
+ "overflow-hidden text-sm",
63
+ "data-[starting-style]:animate-in data-[starting-style]:slide-down-from-top",
64
+ "data-[ending-style]:animate-out data-[ending-style]:slide-up-to-top",
65
+ "transition-all duration-200 ease-in-out",
66
+ className
67
+ )}
68
+ style={{
69
+ "--accordion-panel-height": "var(--accordion-panel-height)",
70
+ "--accordion-panel-width": "var(--accordion-panel-width)",
71
+ } as React.CSSProperties}
72
+ {...props}
73
+ >
74
+ <div className="pb-4 pt-0">{children}</div>
75
+ </BaseAccordion.Panel>
76
+ ));
77
+ AccordionPanel.displayName = "AccordionPanel";
78
+
79
+ export {
80
+ Accordion,
81
+ AccordionItem,
82
+ AccordionHeader,
83
+ AccordionTrigger,
84
+ AccordionPanel
85
+ };
@@ -0,0 +1 @@
1
+ export * from "./accordion";
@@ -0,0 +1,162 @@
1
+ // @ts-nocheck
2
+ import * as React from "react"
3
+ import { AlertDialog as BaseAlertDialog } from "@base-ui-components/react/alert-dialog"
4
+ import { cn } from "@/lib/utils"
5
+
6
+ const AlertDialog = BaseAlertDialog.Root
7
+
8
+ const AlertDialogTrigger = React.forwardRef<
9
+ HTMLButtonElement,
10
+ React.ComponentProps<typeof BaseAlertDialog.Trigger>
11
+ >(({ className, ...props }, ref) => (
12
+ <BaseAlertDialog.Trigger
13
+ ref={ref}
14
+ className={cn(
15
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors",
16
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
17
+ "disabled:pointer-events-none disabled:opacity-50",
18
+ "bg-primary text-primary-foreground hover:bg-primary/90",
19
+ "h-10 px-4 py-2",
20
+ className
21
+ )}
22
+ {...props}
23
+ />
24
+ ))
25
+ AlertDialogTrigger.displayName = "AlertDialogTrigger"
26
+
27
+ const AlertDialogPortal = BaseAlertDialog.Portal
28
+
29
+ const AlertDialogBackdrop = React.forwardRef<
30
+ HTMLDivElement,
31
+ React.ComponentProps<typeof BaseAlertDialog.Backdrop>
32
+ >(({ className, ...props }, ref) => (
33
+ <BaseAlertDialog.Backdrop
34
+ ref={ref}
35
+ className={cn(
36
+ "fixed inset-0 z-50 bg-black/80",
37
+ "data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",
38
+ "transition-all duration-150",
39
+ className
40
+ )}
41
+ {...props}
42
+ />
43
+ ))
44
+ AlertDialogBackdrop.displayName = "AlertDialogBackdrop"
45
+
46
+ const AlertDialogPopup = React.forwardRef<
47
+ HTMLDivElement,
48
+ React.ComponentProps<typeof BaseAlertDialog.Popup>
49
+ >(({ className, ...props }, ref) => (
50
+ <BaseAlertDialog.Popup
51
+ ref={ref}
52
+ className={cn(
53
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg sm:rounded-lg",
54
+ "data-[starting-style]:scale-95 data-[starting-style]:opacity-0",
55
+ "data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
56
+ "transition-all duration-150",
57
+ className
58
+ )}
59
+ {...props}
60
+ />
61
+ ))
62
+ AlertDialogPopup.displayName = "AlertDialogPopup"
63
+
64
+ const AlertDialogTitle = React.forwardRef<
65
+ HTMLHeadingElement,
66
+ React.ComponentProps<typeof BaseAlertDialog.Title>
67
+ >(({ className, ...props }, ref) => (
68
+ <BaseAlertDialog.Title
69
+ ref={ref}
70
+ className={cn("text-lg font-semibold", className)}
71
+ {...props}
72
+ />
73
+ ))
74
+ AlertDialogTitle.displayName = "AlertDialogTitle"
75
+
76
+ const AlertDialogDescription = React.forwardRef<
77
+ HTMLParagraphElement,
78
+ React.ComponentProps<typeof BaseAlertDialog.Description>
79
+ >(({ className, ...props }, ref) => (
80
+ <BaseAlertDialog.Description
81
+ ref={ref}
82
+ className={cn("text-sm text-muted-foreground", className)}
83
+ {...props}
84
+ />
85
+ ))
86
+ AlertDialogDescription.displayName = "AlertDialogDescription"
87
+
88
+ const AlertDialogAction = React.forwardRef<
89
+ HTMLButtonElement,
90
+ React.ComponentProps<typeof BaseAlertDialog.Close>
91
+ >(({ className, ...props }, ref) => (
92
+ <BaseAlertDialog.Close
93
+ ref={ref}
94
+ className={cn(
95
+ "inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground transition-colors",
96
+ "hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
97
+ "disabled:cursor-not-allowed disabled:opacity-50",
98
+ className
99
+ )}
100
+ {...props}
101
+ />
102
+ ))
103
+ AlertDialogAction.displayName = "AlertDialogAction"
104
+
105
+ const AlertDialogCancel = React.forwardRef<
106
+ HTMLButtonElement,
107
+ React.ComponentProps<typeof BaseAlertDialog.Close>
108
+ >(({ className, ...props }, ref) => (
109
+ <BaseAlertDialog.Close
110
+ ref={ref}
111
+ className={cn(
112
+ "inline-flex h-10 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-semibold shadow-sm transition-colors",
113
+ "hover:bg-accent hover:text-accent-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
114
+ "disabled:cursor-not-allowed disabled:opacity-50",
115
+ className
116
+ )}
117
+ {...props}
118
+ />
119
+ ))
120
+ AlertDialogCancel.displayName = "AlertDialogCancel"
121
+
122
+ const AlertDialogHeader = ({
123
+ className,
124
+ ...props
125
+ }: React.HTMLAttributes<HTMLDivElement>) => (
126
+ <div
127
+ className={cn(
128
+ "flex flex-col space-y-2 text-center sm:text-left",
129
+ className
130
+ )}
131
+ {...props}
132
+ />
133
+ )
134
+ AlertDialogHeader.displayName = "AlertDialogHeader"
135
+
136
+ const AlertDialogFooter = ({
137
+ className,
138
+ ...props
139
+ }: React.HTMLAttributes<HTMLDivElement>) => (
140
+ <div
141
+ className={cn(
142
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
143
+ className
144
+ )}
145
+ {...props}
146
+ />
147
+ )
148
+ AlertDialogFooter.displayName = "AlertDialogFooter"
149
+
150
+ export {
151
+ AlertDialog,
152
+ AlertDialogTrigger,
153
+ AlertDialogPortal,
154
+ AlertDialogBackdrop,
155
+ AlertDialogPopup,
156
+ AlertDialogTitle,
157
+ AlertDialogDescription,
158
+ AlertDialogAction,
159
+ AlertDialogCancel,
160
+ AlertDialogHeader,
161
+ AlertDialogFooter,
162
+ }
@@ -0,0 +1,13 @@
1
+ export {
2
+ AlertDialog,
3
+ AlertDialogTrigger,
4
+ AlertDialogPortal,
5
+ AlertDialogBackdrop,
6
+ AlertDialogPopup,
7
+ AlertDialogTitle,
8
+ AlertDialogDescription,
9
+ AlertDialogAction,
10
+ AlertDialogCancel,
11
+ AlertDialogHeader,
12
+ AlertDialogFooter,
13
+ } from "./alert-dialog"
@@ -0,0 +1,64 @@
1
+ // @ts-nocheck
2
+ import * as React from "react";
3
+ import { Avatar as BaseAvatar } from "@base-ui-components/react";
4
+ import { cva, type VariantProps } from "class-variance-authority";
5
+ import { cn } from "@/lib/utils"
6
+
7
+
8
+ const avatarVariants = cva(
9
+ "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
10
+ {
11
+ variants: {
12
+ size: {
13
+ sm: "h-8 w-8",
14
+ md: "h-10 w-10",
15
+ lg: "h-12 w-12",
16
+ },
17
+ },
18
+ defaultVariants: {
19
+ size: "md",
20
+ },
21
+ }
22
+ );
23
+
24
+ const Avatar = React.forwardRef<
25
+ React.ElementRef<typeof BaseAvatar.Root>,
26
+ React.ComponentPropsWithoutRef<typeof BaseAvatar.Root> &
27
+ VariantProps<typeof avatarVariants>
28
+ >(({ className, size, ...props }, ref) => (
29
+ <BaseAvatar.Root
30
+ ref={ref}
31
+ className={cn(avatarVariants({ size }), className)}
32
+ {...props}
33
+ />
34
+ ));
35
+ Avatar.displayName = "Avatar";
36
+
37
+ const AvatarImage = React.forwardRef<
38
+ React.ElementRef<typeof BaseAvatar.Image>,
39
+ React.ComponentPropsWithoutRef<typeof BaseAvatar.Image>
40
+ >(({ className, ...props }, ref) => (
41
+ <BaseAvatar.Image
42
+ ref={ref}
43
+ className={cn("aspect-square h-full w-full", className)}
44
+ {...props}
45
+ />
46
+ ));
47
+ AvatarImage.displayName = "AvatarImage";
48
+
49
+ const AvatarFallback = React.forwardRef<
50
+ React.ElementRef<typeof BaseAvatar.Fallback>,
51
+ React.ComponentPropsWithoutRef<typeof BaseAvatar.Fallback>
52
+ >(({ className, ...props }, ref) => (
53
+ <BaseAvatar.Fallback
54
+ ref={ref}
55
+ className={cn(
56
+ "flex h-full w-full items-center justify-center rounded-full bg-muted",
57
+ className
58
+ )}
59
+ {...props}
60
+ />
61
+ ));
62
+ AvatarFallback.displayName = "AvatarFallback";
63
+
64
+ export { Avatar, AvatarImage, AvatarFallback };
@@ -0,0 +1 @@
1
+ export * from "./avatar";
@@ -0,0 +1,54 @@
1
+ // @ts-nocheck
2
+ import * as React from "react"
3
+ import { cva, type VariantProps } from "class-variance-authority"
4
+ import { cn } from "@/lib/utils"
5
+
6
+ const buttonVariants = cva(
7
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
12
+ destructive:
13
+ "bg-destructive text-destructive-foreground hover:bg-destructive/90",
14
+ outline:
15
+ "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
16
+ secondary:
17
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",
18
+ ghost: "hover:bg-accent hover:text-accent-foreground",
19
+ link: "text-primary underline-offset-4 hover:underline",
20
+ },
21
+ size: {
22
+ default: "h-10 px-4 py-2",
23
+ sm: "h-9 rounded-md px-3",
24
+ lg: "h-11 rounded-md px-8",
25
+ icon: "h-10 w-10",
26
+ },
27
+ },
28
+ defaultVariants: {
29
+ variant: "default",
30
+ size: "default",
31
+ },
32
+ }
33
+ )
34
+
35
+ export interface ButtonProps
36
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
37
+ VariantProps<typeof buttonVariants> {
38
+ asChild?: boolean
39
+ }
40
+
41
+ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
42
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
43
+ return (
44
+ <button
45
+ className={cn(buttonVariants({ variant, size, className }))}
46
+ ref={ref}
47
+ {...props}
48
+ />
49
+ )
50
+ }
51
+ )
52
+ Button.displayName = "Button"
53
+
54
+ export { Button, buttonVariants }
@@ -0,0 +1,2 @@
1
+ export { Button, buttonVariants } from "./button"
2
+ export type { ButtonProps } from "./button"
@@ -0,0 +1,29 @@
1
+ // @ts-nocheck
2
+ import * as React from "react";
3
+ import { Checkbox as BaseCheckbox } from "@base-ui-components/react";
4
+ import { cn } from "@/lib/utils"
5
+ import { Check } from "lucide-react";
6
+
7
+ const Checkbox = React.forwardRef<
8
+ React.ElementRef<typeof BaseCheckbox.Root>,
9
+ React.ComponentPropsWithoutRef<typeof BaseCheckbox.Root>
10
+ >(({ className, ...props }, ref) => (
11
+ <BaseCheckbox.Root
12
+ ref={ref}
13
+ className={cn(
14
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
15
+ "data-[checked]:bg-primary data-[checked]:text-primary-foreground",
16
+ className
17
+ )}
18
+ {...props}
19
+ >
20
+ <BaseCheckbox.Indicator
21
+ className={cn("flex items-center justify-center text-current")}
22
+ >
23
+ <Check className="h-4 w-4" />
24
+ </BaseCheckbox.Indicator>
25
+ </BaseCheckbox.Root>
26
+ ));
27
+ Checkbox.displayName = "Checkbox";
28
+
29
+ export { Checkbox };
@@ -0,0 +1 @@
1
+ export * from "./checkbox";
@@ -0,0 +1,19 @@
1
+ // @ts-nocheck
2
+ import * as React from "react";
3
+ import { CheckboxGroup as BaseCheckboxGroup } from "@base-ui-components/react/checkbox-group";
4
+ import { cn } from "@/lib/utils"
5
+
6
+
7
+ const CheckboxGroup = React.forwardRef<
8
+ React.ElementRef<typeof BaseCheckboxGroup>,
9
+ React.ComponentPropsWithoutRef<typeof BaseCheckboxGroup>
10
+ >(({ className, ...props }, ref) => (
11
+ <BaseCheckboxGroup
12
+ ref={ref}
13
+ className={cn("flex flex-col items-start gap-1", className)}
14
+ {...props}
15
+ />
16
+ ));
17
+ CheckboxGroup.displayName = "CheckboxGroup";
18
+
19
+ export { CheckboxGroup };
@@ -0,0 +1 @@
1
+ export * from "./checkbox-group";
@@ -0,0 +1,65 @@
1
+ // @ts-nocheck
2
+
3
+ "use client"
4
+ import * as React from "react"
5
+ import { Collapsible as BaseCollapsible } from "@base-ui-components/react/collapsible"
6
+ import { cn } from "@/lib/utils"
7
+
8
+ const Collapsible = React.forwardRef<
9
+ React.ElementRef<typeof BaseCollapsible.Root>,
10
+ React.ComponentPropsWithoutRef<typeof BaseCollapsible.Root>
11
+ >(({ className, ...props }, ref) => (
12
+ <BaseCollapsible.Root ref={ref} className={cn("w-full", className)} {...props} />
13
+ ))
14
+ Collapsible.displayName = "Collapsible"
15
+
16
+ const CollapsibleTrigger = React.forwardRef<
17
+ React.ElementRef<typeof BaseCollapsible.Trigger>,
18
+ React.ComponentPropsWithoutRef<typeof BaseCollapsible.Trigger>
19
+ >(({ className, ...props }, ref) => (
20
+ <BaseCollapsible.Trigger
21
+ ref={ref}
22
+ className={cn(
23
+ "flex w-full items-center justify-between rounded-md p-4 font-medium transition-colors",
24
+ "hover:bg-accent hover:text-accent-foreground",
25
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
26
+ "disabled:pointer-events-none disabled:opacity-50",
27
+ "[&[data-panel-open]>svg]:rotate-180",
28
+ className
29
+ )}
30
+ {...props}
31
+ />
32
+ ))
33
+ CollapsibleTrigger.displayName = "CollapsibleTrigger"
34
+
35
+ const CollapsiblePanel = React.forwardRef<
36
+ React.ElementRef<typeof BaseCollapsible.Panel>,
37
+ React.ComponentPropsWithoutRef<typeof BaseCollapsible.Panel>
38
+ >(({ className, ...props }, ref) => (
39
+ <BaseCollapsible.Panel
40
+ ref={ref}
41
+ className={cn(
42
+ "overflow-hidden text-sm transition-all",
43
+ "data-[ending-style]:h-0 data-[starting-style]:h-0",
44
+ "data-[open]:animate-in data-[open]:slide-down-from-top",
45
+ "data-[closed]:animate-out data-[closed]:slide-up-to-top",
46
+ className
47
+ )}
48
+ style={{
49
+ "--collapsible-panel-height": "var(--collapsible-panel-height)",
50
+ "--collapsible-panel-width": "var(--collapsible-panel-width)",
51
+ } as React.CSSProperties}
52
+ {...props}
53
+ />
54
+ ))
55
+ CollapsiblePanel.displayName = "CollapsiblePanel"
56
+
57
+ export type CollapsibleProps = React.ComponentPropsWithoutRef<typeof BaseCollapsible.Root>
58
+ export type CollapsibleTriggerProps = React.ComponentPropsWithoutRef<typeof BaseCollapsible.Trigger>
59
+ export type CollapsiblePanelProps = React.ComponentPropsWithoutRef<typeof BaseCollapsible.Panel>
60
+
61
+ export {
62
+ Collapsible,
63
+ CollapsibleTrigger,
64
+ CollapsiblePanel,
65
+ }
@@ -0,0 +1 @@
1
+ export * from "./collapsible"