@dinachi/cli 0.6.2 → 0.6.3
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/LICENSE +21 -0
- package/package.json +2 -2
- package/templates/alert-dialog/alert-dialog.tsx +3 -3
- package/templates/autocomplete/autocomplete.tsx +18 -12
- package/templates/combobox/combobox.tsx +18 -12
- package/templates/menubar/index.ts +1 -0
- package/templates/menubar/menubar.tsx +9 -0
- package/templates/popover/popover.tsx +14 -9
- package/templates/radio/radio.tsx +1 -1
- package/templates/select/select.tsx +11 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DinachiUI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dinachi/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "CLI for adding Dinachi UI components to your project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/
|
|
18
|
+
"url": "git+https://github.com/raymond-UI/dinachiUI.git"
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://dinachi.dev",
|
|
21
21
|
"bin": {
|
|
@@ -33,7 +33,7 @@ const AlertDialogBackdrop = React.forwardRef<
|
|
|
33
33
|
ref={ref}
|
|
34
34
|
className={cn(
|
|
35
35
|
"fixed inset-0 z-50 bg-black/80",
|
|
36
|
-
"data-
|
|
36
|
+
"data-starting-style:opacity-0 data-ending-style:opacity-0",
|
|
37
37
|
"transition-all duration-150",
|
|
38
38
|
className
|
|
39
39
|
)}
|
|
@@ -50,8 +50,8 @@ const AlertDialogPopup = React.forwardRef<
|
|
|
50
50
|
ref={ref}
|
|
51
51
|
className={cn(
|
|
52
52
|
"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",
|
|
53
|
-
"data-
|
|
54
|
-
"data-
|
|
53
|
+
"data-starting-style:scale-95 data-starting-style:opacity-0",
|
|
54
|
+
"data-ending-style:scale-95 data-ending-style:opacity-0",
|
|
55
55
|
"transition-all duration-150",
|
|
56
56
|
className
|
|
57
57
|
)}
|
|
@@ -71,24 +71,30 @@ AutocompleteClear.displayName = "AutocompleteClear"
|
|
|
71
71
|
|
|
72
72
|
const AutocompleteContent = React.forwardRef<
|
|
73
73
|
React.ComponentRef<typeof AutocompletePrimitive.Popup>,
|
|
74
|
-
React.ComponentPropsWithoutRef<typeof AutocompletePrimitive.Popup>
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
React.ComponentPropsWithoutRef<typeof AutocompletePrimitive.Popup> & {
|
|
75
|
+
readonly portal?: boolean
|
|
76
|
+
}
|
|
77
|
+
>(({ className, portal = true, ...props }, ref) => {
|
|
78
|
+
const content = (
|
|
77
79
|
<AutocompletePrimitive.Positioner sideOffset={4}>
|
|
78
80
|
<AutocompletePrimitive.Popup
|
|
79
81
|
ref={ref}
|
|
80
82
|
className={cn(
|
|
81
|
-
"relative z-50 min-w-
|
|
82
|
-
"origin-
|
|
83
|
-
"data-
|
|
84
|
-
"data-
|
|
83
|
+
"relative z-50 min-w-48 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
84
|
+
"origin-(--transform-origin) outline-none",
|
|
85
|
+
"data-starting-style:animate-in data-starting-style:fade-in-0 data-starting-style:zoom-in-95",
|
|
86
|
+
"data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95",
|
|
85
87
|
className
|
|
86
88
|
)}
|
|
87
89
|
{...props}
|
|
88
90
|
/>
|
|
89
91
|
</AutocompletePrimitive.Positioner>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
if (!portal) return content
|
|
95
|
+
|
|
96
|
+
return <AutocompletePortal>{content}</AutocompletePortal>
|
|
97
|
+
})
|
|
92
98
|
AutocompleteContent.displayName = "AutocompleteContent"
|
|
93
99
|
|
|
94
100
|
const AutocompleteList = React.forwardRef<
|
|
@@ -113,8 +119,8 @@ const AutocompleteItem = React.forwardRef<
|
|
|
113
119
|
ref={ref}
|
|
114
120
|
className={cn(
|
|
115
121
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",
|
|
116
|
-
"data-
|
|
117
|
-
"data-
|
|
122
|
+
"data-highlighted:bg-accent data-highlighted:text-accent-foreground",
|
|
123
|
+
"data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
118
124
|
inset && "pl-8",
|
|
119
125
|
className
|
|
120
126
|
)}
|
|
@@ -151,7 +157,7 @@ const AutocompleteEmpty = React.forwardRef<
|
|
|
151
157
|
>(({ className, ...props }, ref) => (
|
|
152
158
|
<AutocompletePrimitive.Empty
|
|
153
159
|
ref={ref}
|
|
154
|
-
className={cn("
|
|
160
|
+
className={cn("p-2 text-center text-sm text-muted-foreground", className)}
|
|
155
161
|
{...props}
|
|
156
162
|
/>
|
|
157
163
|
))
|
|
@@ -71,24 +71,30 @@ ComboboxClear.displayName = "ComboboxClear"
|
|
|
71
71
|
|
|
72
72
|
const ComboboxContent = React.forwardRef<
|
|
73
73
|
React.ComponentRef<typeof ComboboxPrimitive.Popup>,
|
|
74
|
-
React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Popup>
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Popup> & {
|
|
75
|
+
readonly portal?: boolean
|
|
76
|
+
}
|
|
77
|
+
>(({ className, portal = true, ...props }, ref) => {
|
|
78
|
+
const content = (
|
|
77
79
|
<ComboboxPrimitive.Positioner sideOffset={4}>
|
|
78
80
|
<ComboboxPrimitive.Popup
|
|
79
81
|
ref={ref}
|
|
80
82
|
className={cn(
|
|
81
|
-
"relative z-50 min-w-
|
|
82
|
-
"origin-
|
|
83
|
-
"data-
|
|
84
|
-
"data-
|
|
83
|
+
"relative z-50 min-w-48 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
84
|
+
"origin-(--transform-origin) outline-none",
|
|
85
|
+
"data-starting-style:animate-in data-starting-style:fade-in-0 data-starting-style:zoom-in-95",
|
|
86
|
+
"data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95",
|
|
85
87
|
className
|
|
86
88
|
)}
|
|
87
89
|
{...props}
|
|
88
90
|
/>
|
|
89
91
|
</ComboboxPrimitive.Positioner>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
if (!portal) return content
|
|
95
|
+
|
|
96
|
+
return <ComboboxPortal>{content}</ComboboxPortal>
|
|
97
|
+
})
|
|
92
98
|
ComboboxContent.displayName = "ComboboxContent"
|
|
93
99
|
|
|
94
100
|
const ComboboxList = React.forwardRef<
|
|
@@ -113,8 +119,8 @@ const ComboboxItem = React.forwardRef<
|
|
|
113
119
|
ref={ref}
|
|
114
120
|
className={cn(
|
|
115
121
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
116
|
-
"data-
|
|
117
|
-
"data-
|
|
122
|
+
"data-highlighted:bg-accent data-highlighted:text-accent-foreground",
|
|
123
|
+
"data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
118
124
|
inset && "pl-10",
|
|
119
125
|
className
|
|
120
126
|
)}
|
|
@@ -156,7 +162,7 @@ const ComboboxEmpty = React.forwardRef<
|
|
|
156
162
|
>(({ className, ...props }, ref) => (
|
|
157
163
|
<ComboboxPrimitive.Empty
|
|
158
164
|
ref={ref}
|
|
159
|
-
className={cn("
|
|
165
|
+
className={cn("p-2 text-center text-sm text-muted-foreground", className)}
|
|
160
166
|
{...props}
|
|
161
167
|
/>
|
|
162
168
|
))
|
|
@@ -175,6 +175,14 @@ const MenubarRadioItem = React.forwardRef<
|
|
|
175
175
|
))
|
|
176
176
|
MenubarRadioItem.displayName = "MenubarRadioItem"
|
|
177
177
|
|
|
178
|
+
const MenubarGroup = React.forwardRef<
|
|
179
|
+
React.ComponentRef<typeof Menu.Group>,
|
|
180
|
+
React.ComponentProps<typeof Menu.Group>
|
|
181
|
+
>(({ className, ...props }, ref) => (
|
|
182
|
+
<Menu.Group ref={ref} className={cn(className)} {...props} />
|
|
183
|
+
))
|
|
184
|
+
MenubarGroup.displayName = "MenubarGroup"
|
|
185
|
+
|
|
178
186
|
const MenubarLabel = React.forwardRef<
|
|
179
187
|
React.ComponentRef<typeof Menu.GroupLabel>,
|
|
180
188
|
React.ComponentProps<typeof Menu.GroupLabel> & {
|
|
@@ -293,6 +301,7 @@ export {
|
|
|
293
301
|
MenubarCheckboxItem,
|
|
294
302
|
MenubarRadioGroup,
|
|
295
303
|
MenubarRadioItem,
|
|
304
|
+
MenubarGroup,
|
|
296
305
|
MenubarLabel,
|
|
297
306
|
MenubarSeparator,
|
|
298
307
|
MenubarShortcut,
|
|
@@ -17,10 +17,11 @@ const PopoverContent = React.forwardRef<
|
|
|
17
17
|
readonly sideOffset?: number
|
|
18
18
|
readonly align?: "start" | "center" | "end"
|
|
19
19
|
readonly side?: "top" | "bottom" | "left" | "right"
|
|
20
|
+
readonly portal?: boolean
|
|
20
21
|
}
|
|
21
|
-
>(({ className, align = "center", side = "bottom", sideOffset = 8, ...props }, ref) =>
|
|
22
|
-
|
|
23
|
-
<PopoverPrimitive.Positioner
|
|
22
|
+
>(({ className, align = "center", side = "bottom", sideOffset = 8, portal = true, ...props }, ref) => {
|
|
23
|
+
const content = (
|
|
24
|
+
<PopoverPrimitive.Positioner
|
|
24
25
|
align={align}
|
|
25
26
|
side={side}
|
|
26
27
|
sideOffset={sideOffset}
|
|
@@ -29,17 +30,21 @@ const PopoverContent = React.forwardRef<
|
|
|
29
30
|
ref={ref}
|
|
30
31
|
className={cn(
|
|
31
32
|
"z-50 rounded-lg border bg-popover px-6 py-4 text-popover-foreground shadow-lg outline-none",
|
|
32
|
-
"origin-
|
|
33
|
-
"data-
|
|
34
|
-
"data-
|
|
33
|
+
"origin-(--transform-origin)",
|
|
34
|
+
"data-starting-style:scale-90 data-starting-style:opacity-0",
|
|
35
|
+
"data-ending-style:scale-90 data-ending-style:opacity-0",
|
|
35
36
|
"transition-[transform,opacity] duration-150",
|
|
36
37
|
className
|
|
37
38
|
)}
|
|
38
39
|
{...props}
|
|
39
40
|
/>
|
|
40
41
|
</PopoverPrimitive.Positioner>
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
if (!portal) return content
|
|
45
|
+
|
|
46
|
+
return <PopoverPrimitive.Portal>{content}</PopoverPrimitive.Portal>
|
|
47
|
+
})
|
|
43
48
|
PopoverContent.displayName = "PopoverContent"
|
|
44
49
|
|
|
45
50
|
// Optimized PopoverArrow
|
|
@@ -113,7 +118,7 @@ const PopoverBackdrop = React.forwardRef<
|
|
|
113
118
|
ref={ref}
|
|
114
119
|
className={cn(
|
|
115
120
|
"fixed inset-0 z-40 bg-black/50",
|
|
116
|
-
"data-
|
|
121
|
+
"data-starting-style:opacity-0 data-ending-style:opacity-0",
|
|
117
122
|
"transition-opacity duration-150",
|
|
118
123
|
className
|
|
119
124
|
)}
|
|
@@ -21,7 +21,7 @@ const Radio = React.forwardRef<
|
|
|
21
21
|
<RadioPrimitive.Root
|
|
22
22
|
ref={ref}
|
|
23
23
|
className={cn(
|
|
24
|
-
"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background",
|
|
24
|
+
"flex items-center justify-center aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background",
|
|
25
25
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
26
26
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
27
27
|
className
|
|
@@ -39,9 +39,10 @@ const SelectContent = React.forwardRef<
|
|
|
39
39
|
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Popup> & {
|
|
40
40
|
readonly position?: "item-aligned" | "popper"
|
|
41
41
|
readonly sideOffset?: number
|
|
42
|
+
readonly portal?: boolean
|
|
42
43
|
}
|
|
43
|
-
>(({ className, children, position = "popper", sideOffset = 4, ...props }, ref) =>
|
|
44
|
-
|
|
44
|
+
>(({ className, children, position = "popper", sideOffset = 4, portal = true, ...props }, ref) => {
|
|
45
|
+
const content = (
|
|
45
46
|
<SelectPrimitive.Positioner
|
|
46
47
|
sideOffset={sideOffset}
|
|
47
48
|
alignItemWithTrigger={position === "item-aligned"}
|
|
@@ -49,7 +50,7 @@ const SelectContent = React.forwardRef<
|
|
|
49
50
|
<SelectPrimitive.Popup
|
|
50
51
|
ref={ref}
|
|
51
52
|
className={cn(
|
|
52
|
-
"relative z-50 max-h-96 min-w-
|
|
53
|
+
"relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
53
54
|
"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",
|
|
54
55
|
"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",
|
|
55
56
|
position === "popper" &&
|
|
@@ -65,8 +66,12 @@ const SelectContent = React.forwardRef<
|
|
|
65
66
|
<SelectScrollDownArrow />
|
|
66
67
|
</SelectPrimitive.Popup>
|
|
67
68
|
</SelectPrimitive.Positioner>
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
if (!portal) return content
|
|
72
|
+
|
|
73
|
+
return <SelectPrimitive.Portal>{content}</SelectPrimitive.Portal>
|
|
74
|
+
})
|
|
70
75
|
SelectContent.displayName = "SelectContent"
|
|
71
76
|
|
|
72
77
|
// Add scroll arrows for better UX with large lists
|
|
@@ -143,7 +148,7 @@ const SelectItem = React.forwardRef<
|
|
|
143
148
|
ref={ref}
|
|
144
149
|
className={cn(
|
|
145
150
|
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-2 text-sm outline-none",
|
|
146
|
-
"focus:bg-accent focus:text-accent-foreground data-
|
|
151
|
+
"focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
147
152
|
// Dynamic padding based on indicator presence and position
|
|
148
153
|
showIndicator && isLeftIndicator && "pl-8",
|
|
149
154
|
showIndicator && isRightIndicator && "pr-8",
|