sonance-brand-mcp 1.3.109 → 1.3.111

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 (34) hide show
  1. package/dist/assets/api/sonance-ai-edit/route.ts +30 -7
  2. package/dist/assets/api/sonance-vision-apply/route.ts +33 -8
  3. package/dist/assets/api/sonance-vision-edit/route.ts +33 -8
  4. package/dist/assets/components/alert.tsx +35 -9
  5. package/dist/assets/components/badge.tsx +49 -20
  6. package/dist/assets/components/button.tsx +29 -20
  7. package/dist/assets/components/card.tsx +87 -33
  8. package/dist/assets/components/checkbox.tsx +36 -12
  9. package/dist/assets/components/dialog.tsx +73 -30
  10. package/dist/assets/components/dropdown-menu.tsx +57 -20
  11. package/dist/assets/components/input.tsx +35 -14
  12. package/dist/assets/components/pagination.tsx +86 -35
  13. package/dist/assets/components/popover.tsx +80 -36
  14. package/dist/assets/components/radio-group.tsx +40 -12
  15. package/dist/assets/components/select.tsx +62 -26
  16. package/dist/assets/components/switch.tsx +41 -13
  17. package/dist/assets/components/tabs.tsx +32 -12
  18. package/dist/assets/components/tooltip.tsx +34 -5
  19. package/dist/assets/dev-tools/SonanceDevTools.tsx +441 -365
  20. package/dist/assets/dev-tools/components/ChatHistory.tsx +141 -0
  21. package/dist/assets/dev-tools/components/ChatInterface.tsx +402 -294
  22. package/dist/assets/dev-tools/components/ChatTabBar.tsx +82 -0
  23. package/dist/assets/dev-tools/components/InlineDiffPreview.tsx +204 -0
  24. package/dist/assets/dev-tools/components/InspectorOverlay.tsx +12 -9
  25. package/dist/assets/dev-tools/components/PropertiesPanel.tsx +695 -0
  26. package/dist/assets/dev-tools/components/VisionModeBorder.tsx +16 -7
  27. package/dist/assets/dev-tools/constants.ts +38 -6
  28. package/dist/assets/dev-tools/hooks/useComputedStyles.ts +365 -0
  29. package/dist/assets/dev-tools/index.ts +3 -0
  30. package/dist/assets/dev-tools/panels/AnalysisPanel.tsx +32 -32
  31. package/dist/assets/dev-tools/panels/ComponentsPanel.tsx +277 -127
  32. package/dist/assets/dev-tools/types.ts +51 -2
  33. package/dist/index.js +22 -3
  34. package/package.json +2 -1
@@ -2,19 +2,42 @@
2
2
 
3
3
  import { forwardRef, useState, useRef, useEffect } from "react";
4
4
  import { ChevronDown, Check } from "lucide-react";
5
+ import { cva, type VariantProps } from "class-variance-authority";
5
6
  import { cn } from "@/lib/utils";
6
7
 
7
8
  export type SelectState = "default" | "hover" | "focus" | "open" | "error" | "disabled";
8
9
 
10
+ const selectTriggerVariants = cva(
11
+ "flex w-full items-center justify-between border border-input-border bg-input text-left text-foreground transition-all duration-200 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
12
+ {
13
+ variants: {
14
+ size: {
15
+ xs: "h-7 px-2.5 text-xs rounded-md",
16
+ sm: "h-8 px-3 text-sm rounded-lg",
17
+ md: "h-9 px-3.5 text-sm rounded-lg",
18
+ lg: "h-10 px-4 text-sm rounded-xl",
19
+ },
20
+ selectVariant: {
21
+ default: "hover:border-border-hover focus:border-input-focus focus:ring-2 focus:ring-primary/10",
22
+ glass: "bg-input/80 backdrop-blur-sm hover:border-border-hover focus:border-input-focus focus:ring-2 focus:ring-primary/20",
23
+ },
24
+ },
25
+ defaultVariants: {
26
+ size: "sm",
27
+ selectVariant: "default",
28
+ },
29
+ }
30
+ );
31
+
9
32
  // State styles for Storybook/Figma visualization
10
33
  const getStateStyles = (state?: SelectState) => {
11
34
  if (!state || state === "default") return "";
12
35
 
13
36
  const stateMap: Record<string, string> = {
14
37
  hover: "border-border-hover",
15
- focus: "border-input-focus",
16
- open: "border-input-focus",
17
- error: "border-error",
38
+ focus: "border-input-focus ring-2 ring-primary/10",
39
+ open: "border-input-focus ring-2 ring-primary/10",
40
+ error: "border-error ring-2 ring-error/10",
18
41
  disabled: "opacity-50 cursor-not-allowed",
19
42
  };
20
43
 
@@ -27,7 +50,7 @@ interface SelectOption {
27
50
  disabled?: boolean;
28
51
  }
29
52
 
30
- interface SelectProps {
53
+ interface SelectProps extends VariantProps<typeof selectTriggerVariants> {
31
54
  id?: string;
32
55
  value?: string;
33
56
  defaultValue?: string;
@@ -57,6 +80,8 @@ export function Select({
57
80
  className,
58
81
  state,
59
82
  style,
83
+ size,
84
+ selectVariant,
60
85
  }: SelectProps) {
61
86
  const isDisabled = disabled || state === "disabled";
62
87
  const hasError = error || state === "error";
@@ -101,7 +126,7 @@ export function Select({
101
126
  return (
102
127
  <div data-sonance-name="select" className={cn("w-full", className)} ref={containerRef}>
103
128
  {label && (
104
- <label className="mb-2 block text-xs font-medium uppercase tracking-widest text-foreground-muted">
129
+ <label className="mb-1.5 block text-[11px] font-medium uppercase tracking-wide text-foreground-muted">
105
130
  {label}
106
131
  </label>
107
132
  )}
@@ -113,12 +138,9 @@ export function Select({
113
138
  disabled={isDisabled}
114
139
  style={style}
115
140
  className={cn(
116
- "flex w-full items-center justify-between border border-input-border bg-input px-4 py-3",
117
- "text-left text-foreground transition-colors duration-200",
118
- "focus:border-input-focus focus:outline-none",
119
- "disabled:cursor-not-allowed disabled:opacity-50",
120
- hasError && "border-error",
121
- (isOpen || isOpenState) && "border-input-focus",
141
+ selectTriggerVariants({ size, selectVariant }),
142
+ hasError && "border-error ring-2 ring-error/10",
143
+ (isOpen || isOpenState) && "border-input-focus ring-2 ring-primary/10",
122
144
  getStateStyles(state)
123
145
  )}
124
146
  >
@@ -127,7 +149,7 @@ export function Select({
127
149
  </span>
128
150
  <ChevronDown
129
151
  className={cn(
130
- "h-4 w-4 text-foreground-muted transition-transform duration-200",
152
+ "h-3.5 w-3.5 text-foreground-muted transition-transform duration-200",
131
153
  (isOpen || isOpenState) && "rotate-180"
132
154
  )}
133
155
  />
@@ -136,8 +158,9 @@ export function Select({
136
158
  {isOpen && (
137
159
  <div
138
160
  className={cn(
139
- "absolute z-50 mt-1 w-full border border-border bg-card shadow-lg",
140
- "max-h-60 overflow-auto"
161
+ "absolute z-50 mt-1.5 w-full rounded-xl border border-border bg-card/95 backdrop-blur-md shadow-xl",
162
+ "max-h-60 overflow-auto p-1",
163
+ "animate-in fade-in-0 zoom-in-95 duration-150"
141
164
  )}
142
165
  >
143
166
  {options.map((option) => (
@@ -147,7 +170,7 @@ export function Select({
147
170
  onClick={() => !option.disabled && handleSelect(option.value)}
148
171
  disabled={option.disabled}
149
172
  className={cn(
150
- "flex w-full items-center justify-between px-4 py-2.5 text-left text-sm",
173
+ "flex w-full items-center justify-between px-3 py-2 text-left text-sm rounded-lg",
151
174
  "transition-colors duration-150",
152
175
  option.value === value
153
176
  ? "bg-primary text-primary-foreground"
@@ -156,13 +179,13 @@ export function Select({
156
179
  )}
157
180
  >
158
181
  {option.label}
159
- {option.value === value && <Check className="h-4 w-4" />}
182
+ {option.value === value && <Check className="h-3.5 w-3.5" />}
160
183
  </button>
161
184
  ))}
162
185
  </div>
163
186
  )}
164
187
  </div>
165
- {error && <p id="p-error" className="mt-1 text-sm text-error">{error}</p>}
188
+ {error && <p id="p-error" className="mt-1 text-xs text-error">{error}</p>}
166
189
  </div>
167
190
  );
168
191
  }
@@ -184,23 +207,32 @@ const getNativeSelectStateStyles = (state?: NativeSelectState) => {
184
207
  };
185
208
 
186
209
  // Native Select for forms
187
- interface NativeSelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
210
+ interface NativeSelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "size"> {
188
211
  label?: string;
189
212
  error?: string;
190
213
  options: SelectOption[];
191
214
  /** Visual state for Storybook/Figma documentation */
192
215
  state?: NativeSelectState;
216
+ /** Size variant */
217
+ size?: "xs" | "sm" | "md" | "lg";
193
218
  }
194
219
 
195
220
  export const NativeSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(
196
- ({ className, label, error, options, state, disabled, ...props }, ref) => {
221
+ ({ className, label, error, options, state, disabled, size = "sm", ...props }, ref) => {
197
222
  const isDisabled = disabled || state === "disabled";
198
223
  const hasError = error || state === "error";
199
224
 
225
+ const sizeClasses = {
226
+ xs: "h-7 px-2.5 pr-8 text-xs rounded-md",
227
+ sm: "h-8 px-3 pr-9 text-sm rounded-lg",
228
+ md: "h-9 px-3.5 pr-9 text-sm rounded-lg",
229
+ lg: "h-10 px-4 pr-10 text-sm rounded-xl",
230
+ };
231
+
200
232
  return (
201
233
  <div data-sonance-name="select" className="w-full">
202
234
  {label && (
203
- <label className="mb-2 block text-xs font-medium uppercase tracking-widest text-foreground-muted">
235
+ <label className="mb-1.5 block text-[11px] font-medium uppercase tracking-wide text-foreground-muted">
204
236
  {label}
205
237
  </label>
206
238
  )}
@@ -209,11 +241,13 @@ export const NativeSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(
209
241
  ref={ref}
210
242
  disabled={isDisabled}
211
243
  className={cn(
212
- "w-full appearance-none border border-input-border bg-input px-4 py-3 pr-10",
213
- "text-foreground transition-colors duration-200",
214
- "focus:border-input-focus focus:outline-none",
244
+ "w-full appearance-none border border-input-border bg-input",
245
+ sizeClasses[size],
246
+ "text-foreground transition-all duration-200",
247
+ "hover:border-border-hover",
248
+ "focus:border-input-focus focus:outline-none focus:ring-2 focus:ring-primary/10",
215
249
  "disabled:cursor-not-allowed disabled:opacity-50",
216
- hasError && "border-error",
250
+ hasError && "border-error ring-2 ring-error/10",
217
251
  getNativeSelectStateStyles(state),
218
252
  className
219
253
  )} data-sonance-name="select"
@@ -225,9 +259,9 @@ export const NativeSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(
225
259
  </option>
226
260
  ))}
227
261
  </select>
228
- <ChevronDown className="pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-foreground-muted" />
262
+ <ChevronDown className="pointer-events-none absolute right-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-foreground-muted" />
229
263
  </div>
230
- {error && <p id="native-select-p-error" className="mt-1 text-sm text-error">{error}</p>}
264
+ {error && <p id="native-select-p-error" className="mt-1 text-xs text-error">{error}</p>}
231
265
  </div>
232
266
  );
233
267
  }
@@ -235,3 +269,5 @@ export const NativeSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(
235
269
 
236
270
  NativeSelect.displayName = "NativeSelect";
237
271
 
272
+ export { selectTriggerVariants };
273
+
@@ -1,11 +1,37 @@
1
1
  "use client";
2
2
 
3
3
  import { forwardRef, useId } from "react";
4
+ import { cva, type VariantProps } from "class-variance-authority";
4
5
  import { cn } from "@/lib/utils";
5
6
 
6
7
  export type SwitchState = "default" | "hover" | "focus" | "checked" | "disabled";
7
8
 
8
- interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
9
+ const switchTrackVariants = cva(
10
+ "relative inline-flex shrink-0 cursor-pointer items-center rounded-full border border-border bg-input transition-all duration-200 has-[:checked]:border-primary has-[:checked]:bg-primary has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50 has-[:focus]:ring-2 has-[:focus]:ring-primary/20 has-[:focus]:ring-offset-2 has-[:focus]:ring-offset-background",
11
+ {
12
+ variants: {
13
+ size: {
14
+ xs: "h-4 w-7",
15
+ sm: "h-5 w-9",
16
+ md: "h-6 w-11",
17
+ lg: "h-7 w-12",
18
+ },
19
+ },
20
+ defaultVariants: {
21
+ size: "sm",
22
+ },
23
+ }
24
+ );
25
+
26
+ const switchThumbSizes = {
27
+ xs: { size: "h-3 w-3", translate: "peer-checked:translate-x-3" },
28
+ sm: { size: "h-4 w-4", translate: "peer-checked:translate-x-4" },
29
+ md: { size: "h-5 w-5", translate: "peer-checked:translate-x-5" },
30
+ lg: { size: "h-6 w-6", translate: "peer-checked:translate-x-5" },
31
+ };
32
+
33
+ interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size">,
34
+ VariantProps<typeof switchTrackVariants> {
9
35
  label?: string;
10
36
  description?: string;
11
37
  /** Visual state for Storybook/Figma documentation */
@@ -18,7 +44,7 @@ const getTrackStateStyles = (state?: SwitchState) => {
18
44
 
19
45
  const stateMap: Record<string, string> = {
20
46
  hover: "border-border-hover",
21
- focus: "ring-2 ring-border-focus ring-offset-2 ring-offset-background",
47
+ focus: "ring-2 ring-primary/20 ring-offset-2 ring-offset-background",
22
48
  checked: "border-primary bg-primary",
23
49
  disabled: "opacity-50 cursor-not-allowed",
24
50
  };
@@ -27,7 +53,7 @@ const getTrackStateStyles = (state?: SwitchState) => {
27
53
  };
28
54
 
29
55
  export const Switch = forwardRef<HTMLInputElement, SwitchProps>(
30
- ({ className, label, description, id, state, disabled, checked, defaultChecked, onChange, style, ...props }, ref) => {
56
+ ({ className, label, description, id, state, disabled, checked, defaultChecked, onChange, style, size = "sm", ...props }, ref) => {
31
57
  const uniqueId = useId();
32
58
  const inputId = id || `switch-${uniqueId}`;
33
59
  const isDisabled = disabled || state === "disabled";
@@ -36,17 +62,15 @@ export const Switch = forwardRef<HTMLInputElement, SwitchProps>(
36
62
  const isControlled = checked !== undefined || onChange !== undefined;
37
63
  const isCheckedForState = state === "checked";
38
64
 
65
+ const thumbConfig = switchThumbSizes[size || "sm"];
66
+
39
67
  return (
40
- <div data-sonance-name="switch" className="flex items-start gap-3">
68
+ <div data-sonance-name="switch" className="flex items-start gap-2.5">
41
69
  <label
42
70
  htmlFor={inputId}
43
71
  style={style}
44
72
  className={cn(
45
- "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full",
46
- "border border-border bg-input transition-colors duration-200",
47
- "has-[:checked]:border-primary has-[:checked]:bg-primary",
48
- "has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50",
49
- "has-[:focus]:ring-2 has-[:focus]:ring-border-focus has-[:focus]:ring-offset-2 has-[:focus]:ring-offset-background",
73
+ switchTrackVariants({ size }),
50
74
  getTrackStateStyles(state),
51
75
  className
52
76
  )}
@@ -66,10 +90,12 @@ export const Switch = forwardRef<HTMLInputElement, SwitchProps>(
66
90
  <span
67
91
  id="switch-span"
68
92
  className={cn(
69
- "pointer-events-none absolute left-0.5 h-5 w-5 rounded-full bg-foreground-muted shadow-sm",
70
- "transition-transform duration-200",
71
- "peer-checked:translate-x-5 peer-checked:bg-primary-foreground",
72
- state === "checked" && "translate-x-5 bg-primary-foreground"
93
+ "pointer-events-none absolute left-0.5 rounded-full bg-foreground-muted shadow-sm",
94
+ "transition-all duration-200 ease-out",
95
+ "peer-checked:bg-primary-foreground",
96
+ thumbConfig.size,
97
+ thumbConfig.translate,
98
+ state === "checked" && "translate-x-4 bg-primary-foreground"
73
99
  )}
74
100
  />
75
101
  </label>
@@ -95,3 +121,5 @@ export const Switch = forwardRef<HTMLInputElement, SwitchProps>(
95
121
 
96
122
  Switch.displayName = "Switch";
97
123
 
124
+ export { switchTrackVariants };
125
+
@@ -1,18 +1,36 @@
1
1
  "use client";
2
2
 
3
3
  import { createContext, useContext, useState } from "react";
4
+ import { cva, type VariantProps } from "class-variance-authority";
4
5
  import { cn } from "@/lib/utils";
5
6
 
6
7
  export type TabsTriggerState = "default" | "hover" | "focus" | "active" | "disabled";
7
8
 
9
+ const tabsTriggerVariants = cva(
10
+ "relative font-medium transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/20",
11
+ {
12
+ variants: {
13
+ size: {
14
+ xs: "px-2.5 py-1 text-[10px] rounded-md",
15
+ sm: "px-3 py-1.5 text-xs rounded-lg",
16
+ md: "px-3.5 py-2 text-sm rounded-lg",
17
+ lg: "px-4 py-2.5 text-sm rounded-xl",
18
+ },
19
+ },
20
+ defaultVariants: {
21
+ size: "sm",
22
+ },
23
+ }
24
+ );
25
+
8
26
  // State styles for Storybook/Figma visualization
9
27
  const getStateStyles = (state?: TabsTriggerState, isActive?: boolean) => {
10
28
  if (!state || state === "default") return "";
11
29
 
12
30
  const stateMap: Record<string, string> = {
13
31
  hover: "text-foreground",
14
- focus: "ring-2 ring-border-focus",
15
- active: "text-foreground",
32
+ focus: "ring-2 ring-primary/20",
33
+ active: "text-foreground bg-background shadow-sm",
16
34
  disabled: "opacity-50 cursor-not-allowed",
17
35
  };
18
36
 
@@ -22,6 +40,7 @@ const getStateStyles = (state?: TabsTriggerState, isActive?: boolean) => {
22
40
  interface TabsContextValue {
23
41
  value: string;
24
42
  onChange: (value: string) => void;
43
+ size: "xs" | "sm" | "md" | "lg";
25
44
  }
26
45
 
27
46
  const TabsContext = createContext<TabsContextValue | null>(null);
@@ -32,6 +51,8 @@ interface TabsProps {
32
51
  onValueChange?: (value: string) => void;
33
52
  className?: string;
34
53
  children: React.ReactNode;
54
+ /** Size variant for tabs */
55
+ size?: "xs" | "sm" | "md" | "lg";
35
56
  }
36
57
 
37
58
  export function Tabs({
@@ -40,6 +61,7 @@ export function Tabs({
40
61
  onValueChange,
41
62
  className,
42
63
  children,
64
+ size = "sm",
43
65
  }: TabsProps) {
44
66
  const [internalValue, setInternalValue] = useState(defaultValue);
45
67
  const value = controlledValue ?? internalValue;
@@ -50,7 +72,7 @@ export function Tabs({
50
72
  };
51
73
 
52
74
  return (
53
- <TabsContext.Provider value={{ value, onChange }}>
75
+ <TabsContext.Provider value={{ value, onChange, size }}>
54
76
  <div className={cn("w-full", className)}>{children}</div>
55
77
  </TabsContext.Provider>
56
78
  );
@@ -66,7 +88,7 @@ export function TabsList({ className, children }: TabsListProps) {
66
88
  <div data-sonance-name="tabs"
67
89
  role="tablist"
68
90
  className={cn(
69
- "inline-flex items-center gap-1 border-b border-border",
91
+ "inline-flex items-center gap-1 rounded-lg bg-muted/50 p-1",
70
92
  className
71
93
  )}
72
94
  >
@@ -105,20 +127,16 @@ export function TabsTrigger({
105
127
  disabled={isDisabled}
106
128
  onClick={() => !isDisabled && context.onChange(value)}
107
129
  className={cn(
108
- "relative px-4 py-2.5 text-sm font-medium transition-colors",
109
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
130
+ tabsTriggerVariants({ size: context.size }),
110
131
  isActive
111
- ? "text-foreground"
112
- : "text-foreground-muted hover:text-foreground",
132
+ ? "text-foreground bg-background shadow-sm"
133
+ : "text-foreground-muted hover:text-foreground hover:bg-background/50",
113
134
  isDisabled && "cursor-not-allowed opacity-50",
114
135
  getStateStyles(state, isActive),
115
136
  className
116
137
  )}
117
138
  >
118
139
  {children}
119
- {isActive && (
120
- <span id="tabs-trigger-span" className="absolute bottom-0 left-0 right-0 h-0.5 bg-primary" />
121
- )}
122
140
  </button>
123
141
  );
124
142
  }
@@ -138,7 +156,7 @@ export function TabsContent({ value, className, children }: TabsContentProps) {
138
156
  return (
139
157
  <div
140
158
  role="tabpanel"
141
- className={cn("mt-4 focus:outline-none", className)}
159
+ className={cn("mt-3 focus:outline-none animate-in fade-in-0 duration-200", className)}
142
160
  tabIndex={0}
143
161
  >
144
162
  {children}
@@ -146,3 +164,5 @@ export function TabsContent({ value, className, children }: TabsContentProps) {
146
164
  );
147
165
  }
148
166
 
167
+ export { tabsTriggerVariants };
168
+
@@ -2,6 +2,7 @@
2
2
 
3
3
  import * as React from "react"
4
4
  import * as TooltipPrimitive from "@radix-ui/react-tooltip"
5
+ import { cva, type VariantProps } from "class-variance-authority"
5
6
 
6
7
  import { cn } from "@/lib/utils"
7
8
 
@@ -11,15 +12,43 @@ const Tooltip = TooltipPrimitive.Root
11
12
 
12
13
  const TooltipTrigger = TooltipPrimitive.Trigger
13
14
 
15
+ const tooltipContentVariants = cva(
16
+ "z-50 overflow-hidden border shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",
17
+ {
18
+ variants: {
19
+ size: {
20
+ xs: "px-2 py-1 text-[10px] rounded-md",
21
+ sm: "px-2.5 py-1 text-xs rounded-lg",
22
+ md: "px-3 py-1.5 text-sm rounded-lg",
23
+ lg: "px-3.5 py-2 text-sm rounded-xl",
24
+ },
25
+ tooltipVariant: {
26
+ default: "bg-popover text-popover-foreground border-border",
27
+ glass: "bg-popover/95 text-popover-foreground border-border/50 backdrop-blur-md",
28
+ dark: "bg-foreground text-background border-foreground",
29
+ },
30
+ },
31
+ defaultVariants: {
32
+ size: "sm",
33
+ tooltipVariant: "glass",
34
+ },
35
+ }
36
+ )
37
+
38
+ interface TooltipContentProps
39
+ extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>,
40
+ VariantProps<typeof tooltipContentVariants> {}
41
+
14
42
  const TooltipContent = React.forwardRef<
15
43
  React.ElementRef<typeof TooltipPrimitive.Content>,
16
- React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
17
- >(({ className, sideOffset = 4, ...props }, ref) => (
18
- <TooltipPrimitive.Content data-sonance-name="tooltip"
44
+ TooltipContentProps
45
+ >(({ className, sideOffset = 4, size, tooltipVariant, ...props }, ref) => (
46
+ <TooltipPrimitive.Content
47
+ data-sonance-name="tooltip"
19
48
  ref={ref}
20
49
  sideOffset={sideOffset}
21
50
  className={cn(
22
- "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",
51
+ tooltipContentVariants({ size, tooltipVariant }),
23
52
  className
24
53
  )}
25
54
  {...props}
@@ -27,4 +56,4 @@ const TooltipContent = React.forwardRef<
27
56
  ))
28
57
  TooltipContent.displayName = TooltipPrimitive.Content.displayName
29
58
 
30
- export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
59
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, tooltipContentVariants }