@dinachi/cli 0.5.1 → 0.6.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 (53) hide show
  1. package/dist/index.js +315 -0
  2. package/package.json +12 -5
  3. package/templates/accordion/accordion.tsx +8 -3
  4. package/templates/alert-dialog/alert-dialog.tsx +24 -25
  5. package/templates/alert-dialog/index.ts +1 -1
  6. package/templates/autocomplete/autocomplete.tsx +0 -1
  7. package/templates/avatar/avatar.tsx +1 -3
  8. package/templates/badge/badge.tsx +167 -0
  9. package/templates/badge/index.ts +2 -0
  10. package/templates/button/button.tsx +6 -6
  11. package/templates/button/index.ts +2 -2
  12. package/templates/card/card.tsx +78 -0
  13. package/templates/card/index.ts +1 -0
  14. package/templates/checkbox/checkbox.tsx +2 -3
  15. package/templates/checkbox-group/checkbox-group.tsx +1 -3
  16. package/templates/collapsible/collapsible.tsx +1 -2
  17. package/templates/combobox/combobox.tsx +0 -1
  18. package/templates/context-menu/context-menu.tsx +0 -1
  19. package/templates/dialog/dialog.tsx +1 -1
  20. package/templates/drawer/drawer.tsx +0 -1
  21. package/templates/field/field.tsx +69 -85
  22. package/templates/fieldset/fieldset.tsx +0 -1
  23. package/templates/form/form.tsx +36 -28
  24. package/templates/input/index.ts +1 -2
  25. package/templates/input/input.tsx +0 -1
  26. package/templates/menu/menu.tsx +0 -1
  27. package/templates/menubar/menubar.tsx +21 -22
  28. package/templates/meter/meter.tsx +0 -1
  29. package/templates/navigation-menu/index.ts +1 -13
  30. package/templates/navigation-menu/navigation-menu.tsx +1 -3
  31. package/templates/number-field/number-field.tsx +0 -1
  32. package/templates/popover/popover.tsx +0 -1
  33. package/templates/preview-card/preview-card.tsx +0 -1
  34. package/templates/progress/progress.tsx +0 -1
  35. package/templates/radio/radio.tsx +0 -1
  36. package/templates/scroll-area/scroll-area.tsx +0 -1
  37. package/templates/select/select.tsx +1 -4
  38. package/templates/separator/separator.tsx +0 -1
  39. package/templates/slider/index.ts +10 -0
  40. package/templates/slider/slider.tsx +1 -3
  41. package/templates/switch/switch.tsx +0 -1
  42. package/templates/tabs/index.ts +8 -0
  43. package/templates/tabs/tabs.tsx +8 -3
  44. package/templates/textarea/index.ts +2 -0
  45. package/templates/textarea/textarea.tsx +23 -0
  46. package/templates/toast/toast.tsx +3 -2
  47. package/templates/toggle/toggle.tsx +0 -1
  48. package/templates/toggle-group/toggle-group.tsx +0 -1
  49. package/templates/toolbar/toolbar.tsx +0 -1
  50. package/templates/tooltip/tooltip.tsx +0 -1
  51. package/templates/tsconfig.json +20 -0
  52. package/templates/utils/utils.ts +0 -1
  53. package/templates/utils/variants.ts +0 -1
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
@@ -45,9 +44,9 @@ const MenubarTrigger = React.forwardRef<
45
44
  className={cn(
46
45
  "flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none",
47
46
  "focus:bg-accent focus:text-accent-foreground",
48
- "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
49
- "data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground",
50
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
47
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground",
48
+ "data-popup-open:bg-accent data-popup-open:text-accent-foreground",
49
+ "data-disabled:pointer-events-none data-disabled:opacity-50",
51
50
  className
52
51
  )}
53
52
  {...props}
@@ -88,11 +87,11 @@ const MenubarContent = React.forwardRef<
88
87
  <Menu.Popup
89
88
  ref={ref}
90
89
  className={cn(
91
- "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
92
- "origin-[var(--transform-origin)]",
90
+ "z-50 min-w-48 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
91
+ "origin-(--transform-origin)",
93
92
  "outline-none focus:outline-none focus-visible:outline-none",
94
- "data-[starting-style]:animate-in data-[starting-style]:fade-in-0 data-[starting-style]:zoom-in-95",
95
- "data-[ending-style]:animate-out data-[ending-style]:fade-out-0 data-[ending-style]:zoom-out-95",
93
+ "data-starting-style:animate-in data-starting-style:fade-in-0 data-starting-style:zoom-in-95",
94
+ "data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95",
96
95
  className
97
96
  )}
98
97
  {...props}
@@ -111,8 +110,8 @@ const MenubarItem = React.forwardRef<
111
110
  className={cn(
112
111
  "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",
113
112
  "focus:bg-accent focus:text-accent-foreground",
114
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
115
- "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
113
+ "data-disabled:pointer-events-none data-disabled:opacity-50",
114
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground",
116
115
  inset && "pl-8",
117
116
  className
118
117
  )}
@@ -130,8 +129,8 @@ const MenubarCheckboxItem = React.forwardRef<
130
129
  className={cn(
131
130
  "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
132
131
  "focus:bg-accent focus:text-accent-foreground",
133
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
134
- "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
132
+ "data-disabled:pointer-events-none data-disabled:opacity-50",
133
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground",
135
134
  className
136
135
  )}
137
136
  checked={checked}
@@ -162,14 +161,14 @@ const MenubarRadioItem = React.forwardRef<
162
161
  className={cn(
163
162
  "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
164
163
  "focus:bg-accent focus:text-accent-foreground",
165
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
166
- "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
164
+ "data-disabled:pointer-events-none data-disabled:opacity-50",
165
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground",
167
166
  className
168
167
  )}
169
168
  {...props}
170
169
  >
171
170
  <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
172
- <Circle className="h-2 w-2 fill-current data-[checked]:block data-[unchecked]:hidden" />
171
+ <Circle className="h-2 w-2 fill-current data-checked:block data-unchecked:hidden" />
173
172
  </span>
174
173
  {children}
175
174
  </Menu.RadioItem>
@@ -246,9 +245,9 @@ const MenubarSubTrigger = React.forwardRef<
246
245
  className={cn(
247
246
  "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",
248
247
  "focus:bg-accent focus:text-accent-foreground",
249
- "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
250
- "data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground",
251
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
248
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground",
249
+ "data-popup-open:bg-accent data-popup-open:text-accent-foreground",
250
+ "data-disabled:pointer-events-none data-disabled:opacity-50",
252
251
  inset && "pl-8",
253
252
  className
254
253
  )}
@@ -269,11 +268,11 @@ const MenubarSubContent = React.forwardRef<
269
268
  <Menu.Popup
270
269
  ref={ref}
271
270
  className={cn(
272
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg",
273
- "origin-[var(--transform-origin)]",
271
+ "z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg",
272
+ "origin-(--transform-origin)",
274
273
  "outline-none focus:outline-none focus-visible:outline-none",
275
- "data-[starting-style]:animate-in data-[starting-style]:fade-in-0 data-[starting-style]:zoom-in-95",
276
- "data-[ending-style]:animate-out data-[ending-style]:fade-out-0 data-[ending-style]:zoom-out-95",
274
+ "data-starting-style:animate-in data-starting-style:fade-in-0 data-starting-style:zoom-in-95",
275
+ "data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95",
277
276
  className
278
277
  )}
279
278
  {...props}
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
@@ -1,13 +1 @@
1
- export {
2
- NavigationMenu,
3
- NavigationMenuList,
4
- NavigationMenuItem,
5
- NavigationMenuContent,
6
- NavigationMenuTrigger,
7
- NavigationMenuLink,
8
- NavigationMenuIndicator,
9
- NavigationMenuPortal,
10
- NavigationMenuPositioner,
11
- NavigationMenuPopup,
12
- NavigationMenuViewport,
13
- } from "./navigation-menu"
1
+ export * from "./navigation-menu"
@@ -1,12 +1,10 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
5
4
  import { NavigationMenu as BaseNavigationMenu } from "@base-ui/react/navigation-menu"
5
+ import { useRender } from "@base-ui/react/use-render"
6
6
  import { cn } from "@/lib/utils"
7
7
  import { ChevronDown } from "lucide-react"
8
- import { useRender } from "@base-ui/react/use-render"
9
-
10
8
 
11
9
  const NavigationMenu = React.forwardRef<
12
10
  React.ComponentRef<typeof BaseNavigationMenu.Root>,
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
@@ -6,8 +5,6 @@ import { Select as SelectPrimitive } from "@base-ui/react/select"
6
5
  import { cn } from "@/lib/utils"
7
6
  import { Check, ChevronDown } from "lucide-react"
8
7
 
9
-
10
-
11
8
  // Re-export root components for better tree-shaking
12
9
  const Select = SelectPrimitive.Root
13
10
  const SelectGroup = SelectPrimitive.Group
@@ -23,7 +20,7 @@ const SelectTrigger = React.forwardRef<
23
20
  <SelectPrimitive.Trigger
24
21
  ref={ref}
25
22
  className={cn(
26
- "flex h-10 w-full items-center cursor-pointer justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
23
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
27
24
  className
28
25
  )}
29
26
  {...props}
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
@@ -6,4 +6,14 @@ export {
6
6
  SliderRange,
7
7
  SliderThumb,
8
8
  SliderDirectionProvider,
9
+ } from './slider'
10
+
11
+ export type {
12
+ SliderProps,
13
+ SliderValueProps,
14
+ SliderControlProps,
15
+ SliderTrackProps,
16
+ SliderRangeProps,
17
+ SliderThumbProps,
18
+ SliderDirectionProviderProps,
9
19
  } from './slider'
@@ -1,9 +1,7 @@
1
- // @ts-nocheck
2
1
  import * as React from "react";
3
2
  import { Slider as BaseSlider } from "@base-ui/react/slider";
4
3
  import { DirectionProvider } from "@base-ui/react/direction-provider";
5
- import { cn } from "@/lib/utils"
6
-
4
+ import { cn } from "@/lib/utils";
7
5
 
8
6
  const Slider = React.forwardRef<
9
7
  React.ComponentRef<typeof BaseSlider.Root>,
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
@@ -4,4 +4,12 @@ export {
4
4
  TabsTrigger,
5
5
  TabsContent,
6
6
  TabsIndicator,
7
+ } from './tabs'
8
+
9
+ export type {
10
+ TabsProps,
11
+ TabsListProps,
12
+ TabsTriggerProps,
13
+ TabsContentProps,
14
+ TabsIndicatorProps,
7
15
  } from './tabs'
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import * as React from "react";
3
2
  import { Tabs as BaseTabs } from "@base-ui/react/tabs";
4
3
  import { cn } from "@/lib/utils";
@@ -22,7 +21,7 @@ const TabsList = React.forwardRef<
22
21
  <BaseTabs.List
23
22
  ref={ref}
24
23
  className={cn(
25
- "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
24
+ "inline-flex h-10 items-center justify-center rounded-md p-1 text-muted-foreground z-0",
26
25
  className
27
26
  )}
28
27
  {...props}
@@ -40,7 +39,7 @@ const TabsTrigger = React.forwardRef<
40
39
  "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all",
41
40
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
42
41
  "disabled:pointer-events-none disabled:opacity-50",
43
- "data-[selected]:bg-background data-[selected]:text-foreground data-[selected]:shadow-sm",
42
+ "data-[selected]:bg-muted data-[selected]:text-foreground data-[selected]:shadow-sm",
44
43
  "hover:text-foreground",
45
44
  className
46
45
  )}
@@ -80,6 +79,12 @@ const TabsIndicator = React.forwardRef<
80
79
  ));
81
80
  TabsIndicator.displayName = "TabsIndicator";
82
81
 
82
+ export type TabsProps = React.ComponentProps<typeof BaseTabs.Root>;
83
+ export type TabsListProps = React.ComponentProps<typeof BaseTabs.List>;
84
+ export type TabsTriggerProps = React.ComponentProps<typeof BaseTabs.Tab>;
85
+ export type TabsContentProps = React.ComponentProps<typeof BaseTabs.Panel>;
86
+ export type TabsIndicatorProps = React.ComponentProps<typeof BaseTabs.Indicator>;
87
+
83
88
  export {
84
89
  Tabs,
85
90
  TabsList,
@@ -0,0 +1,2 @@
1
+ export { Textarea } from './textarea'
2
+ export type { TextareaProps } from './textarea'
@@ -0,0 +1,23 @@
1
+ import * as React from "react"
2
+ import { cn } from "@/lib/utils"
3
+
4
+ export interface TextareaProps
5
+ extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
6
+
7
+ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
8
+ ({ className, ...props }, ref) => {
9
+ return (
10
+ <textarea
11
+ className={cn(
12
+ "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background 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",
13
+ className
14
+ )}
15
+ ref={ref}
16
+ {...props}
17
+ />
18
+ )
19
+ }
20
+ )
21
+ Textarea.displayName = "Textarea"
22
+
23
+ export { Textarea }
@@ -1,4 +1,5 @@
1
- // @ts-nocheck
1
+ "use client";
2
+
2
3
  import * as React from "react";
3
4
  import { Toast as BaseToast } from "@base-ui/react/toast";
4
5
  import { cn } from "@/lib/utils";
@@ -24,7 +25,7 @@ const ToastViewport = React.forwardRef<
24
25
  ToastViewport.displayName = "ToastViewport";
25
26
 
26
27
  // Toast Portal
27
- const ToastPortal = BaseToast.Portal;
28
+ const ToastPortal: typeof BaseToast.Portal = BaseToast.Portal;
28
29
 
29
30
  // Toast variants for different types
30
31
  const toastVariants = cva(
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client"
3
2
 
4
3
  import * as React from "react"
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import * as React from "react";
3
2
  import { Toolbar as BaseToolbar } from "@base-ui/react/toolbar";
4
3
  import { cn } from "@/lib/utils";
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  "use client";
3
2
 
4
3
  import * as React from "react";
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "jsx": "react-jsx",
8
+ "noEmit": true,
9
+ "skipLibCheck": true,
10
+ "strict": true,
11
+ "esModuleInterop": true,
12
+ "isolatedModules": true,
13
+ "baseUrl": ".",
14
+ "paths": {
15
+ "@/lib/*": ["./utils/*"]
16
+ }
17
+ },
18
+ "include": ["**/*.tsx", "**/*.ts"],
19
+ "exclude": ["node_modules"]
20
+ }
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import { type ClassValue, clsx } from "clsx"
3
2
  import { twMerge } from "tailwind-merge"
4
3
 
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  // This file can contain shared utilities that are NOT component-specific
3
2
  // Following shadcn pattern, component variants are embedded in each component
4
3