@dinachi/cli 0.6.2 → 0.7.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.
- package/LICENSE +21 -0
- package/dist/index.js +122 -33
- package/package.json +3 -4
- package/templates/alert-dialog/alert-dialog.tsx +60 -45
- package/templates/autocomplete/autocomplete.tsx +23 -17
- package/templates/badge/badge.tsx +58 -119
- package/templates/card/card.tsx +1 -1
- package/templates/checkbox/checkbox.tsx +16 -14
- package/templates/combobox/combobox.tsx +22 -16
- package/templates/context-menu/context-menu.tsx +124 -186
- package/templates/context-menu/index.ts +3 -1
- package/templates/dialog/dialog.tsx +26 -27
- package/templates/drawer/drawer.tsx +23 -21
- package/templates/field/field.tsx +5 -15
- package/templates/form/form.tsx +9 -66
- package/templates/label/index.ts +1 -0
- package/templates/label/label.tsx +21 -0
- package/templates/menu/index.ts +2 -0
- package/templates/menu/menu.tsx +59 -61
- package/templates/menubar/index.ts +1 -0
- package/templates/menubar/menubar.tsx +52 -71
- package/templates/navigation-menu/navigation-menu.tsx +61 -18
- package/templates/popover/index.ts +4 -1
- package/templates/popover/popover.tsx +89 -34
- package/templates/preview-card/preview-card.tsx +19 -5
- package/templates/radio/index.ts +1 -1
- package/templates/radio/radio.tsx +30 -14
- package/templates/select/select.tsx +83 -76
- package/templates/skeleton/index.ts +1 -0
- package/templates/skeleton/skeleton.tsx +12 -0
- package/templates/slider/slider.tsx +9 -15
- package/templates/switch/switch.tsx +15 -11
- package/templates/tabs/tabs.tsx +2 -2
- package/templates/toast/toast.tsx +76 -48
- package/templates/toggle/toggle.tsx +0 -17
- package/templates/toggle-group/toggle-group.tsx +8 -3
- package/templates/toolbar/toolbar.tsx +5 -4
- package/templates/tooltip/tooltip.tsx +9 -54
|
@@ -10,58 +10,13 @@ const TooltipProvider: typeof BaseTooltip.Provider = BaseTooltip.Provider;
|
|
|
10
10
|
// Root Component
|
|
11
11
|
const Tooltip: typeof BaseTooltip.Root = BaseTooltip.Root;
|
|
12
12
|
|
|
13
|
-
// Trigger Component
|
|
14
|
-
|
|
15
|
-
extends React.ComponentProps<typeof BaseTooltip.Trigger> {
|
|
16
|
-
variant?: "default" | "ghost" | "outline" | "icon";
|
|
17
|
-
size?: "default" | "sm" | "lg" | "icon";
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const TooltipTrigger: React.ForwardRefExoticComponent<
|
|
21
|
-
TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>
|
|
22
|
-
> = React.forwardRef<
|
|
13
|
+
// Trigger Component — a simple pass-through. Style via `render` prop.
|
|
14
|
+
const TooltipTrigger = React.forwardRef<
|
|
23
15
|
HTMLButtonElement,
|
|
24
|
-
|
|
25
|
-
>(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
ref
|
|
29
|
-
) => {
|
|
30
|
-
const variantStyles = {
|
|
31
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
32
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
33
|
-
outline:
|
|
34
|
-
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
35
|
-
icon: "bg-transparent hover:bg-transparent rounded-full w-fit h-fit",
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const sizeStyles = {
|
|
39
|
-
default: "h-10 px-4 py-2",
|
|
40
|
-
sm: "h-9 rounded-md px-3",
|
|
41
|
-
lg: "h-11 rounded-md px-8",
|
|
42
|
-
icon: "size-auto",
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const triggerClassName = cn(
|
|
46
|
-
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors",
|
|
47
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
48
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
49
|
-
"data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground",
|
|
50
|
-
variantStyles[variant],
|
|
51
|
-
sizeStyles[size],
|
|
52
|
-
className
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<BaseTooltip.Trigger
|
|
57
|
-
ref={ref}
|
|
58
|
-
className={triggerClassName}
|
|
59
|
-
render={render}
|
|
60
|
-
{...props}
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
);
|
|
16
|
+
React.ComponentProps<typeof BaseTooltip.Trigger>
|
|
17
|
+
>(({ className, ...props }, ref) => (
|
|
18
|
+
<BaseTooltip.Trigger ref={ref} className={className} {...props} />
|
|
19
|
+
));
|
|
65
20
|
TooltipTrigger.displayName = "TooltipTrigger";
|
|
66
21
|
|
|
67
22
|
// Portal Component
|
|
@@ -105,10 +60,10 @@ const TooltipPopup: React.ForwardRefExoticComponent<
|
|
|
105
60
|
<BaseTooltip.Popup
|
|
106
61
|
ref={ref}
|
|
107
62
|
className={cn(
|
|
108
|
-
"origin-
|
|
63
|
+
"origin-(--transform-origin) rounded-md px-3 py-1.5 text-sm shadow-md",
|
|
109
64
|
"transition-[transform,scale,opacity] duration-200",
|
|
110
|
-
"data-
|
|
111
|
-
"data-
|
|
65
|
+
"data-ending-style:scale-95 data-ending-style:opacity-0",
|
|
66
|
+
"data-starting-style:scale-95 data-starting-style:opacity-0",
|
|
112
67
|
variantStyles[variant],
|
|
113
68
|
className
|
|
114
69
|
)}
|