@codapet/design-system 0.8.2 → 0.8.4
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/AGENTS.md +21 -1
- package/dist/index.d.mts +32 -3
- package/dist/index.mjs +75 -28
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +2 -0
- package/package.json +4 -1
package/AGENTS.md
CHANGED
|
@@ -72,6 +72,26 @@ These are the foot-guns. Knowing them prevents most "why does my Button look wro
|
|
|
72
72
|
- `Dialog`/`Drawer` are the standard Radix/Vaul primitives.
|
|
73
73
|
- **`SmartDialog*`** is a CodaPet addition: same API surface, but renders `Drawer` on `≤600px` and `Dialog` above. Prefer it for any modal that should bottom-sheet on mobile. Replace every `Dialog` token with `SmartDialog` (`SmartDialogTrigger`, `SmartDialogContent`, etc.).
|
|
74
74
|
|
|
75
|
+
### Tooltip / RichTooltip
|
|
76
|
+
|
|
77
|
+
- `TooltipContent` (the plain text tooltip) defaults to brand blue (`bg-primary`), including its arrow. The arrow used to be hardcoded — it now honors two extra props so a restyled body and its arrow stay in sync:
|
|
78
|
+
- `arrowClassName?: string` — merged (via `cn`) onto the arrow. Recolor it to match a custom surface.
|
|
79
|
+
- `hideArrow?: boolean` — omit the arrow entirely.
|
|
80
|
+
- White-tooltip example (recolor body **and** arrow together, otherwise the arrow stays blue). If the body has a shadow, add a matching **`drop-shadow`** to the arrow — a plain `shadow-*` won't follow the diamond shape and a white arrow is invisible without it:
|
|
81
|
+
```tsx
|
|
82
|
+
<TooltipContent
|
|
83
|
+
className="bg-white text-foreground shadow-md"
|
|
84
|
+
arrowClassName="bg-white fill-white drop-shadow-[0_2px_2px_rgba(0,0,0,0.12)]"
|
|
85
|
+
/>
|
|
86
|
+
```
|
|
87
|
+
- `RichTooltipContent` (icon + heading + body, optionally `dismissible`) is dark by default. Its surface, text and arrow are no longer hardcoded:
|
|
88
|
+
- `variant?: "dark" | "light"` — `"dark"` (default) is the original dark surface + white text; `"light"` is a white surface + dark text, and **ships a soft `shadow-md` on the surface plus a matching `drop-shadow` on the arrow** so it's visible on light backgrounds out of the box. Both look correct in either app theme. Pick a variant instead of hand-rolling colors.
|
|
89
|
+
- `surfaceClassName?: string` — merged onto the inner surface `div`. Overrides the background (and text, since text color lives on the same element): `surfaceClassName="bg-white text-foreground"`.
|
|
90
|
+
- `arrowClassName?: string` — merged onto the arrow so it matches a custom surface (e.g. `arrowClassName="fill-white"`). When you give the surface a shadow via `surfaceClassName`, pair it with a `drop-shadow` here (e.g. `arrowClassName="fill-white drop-shadow-[0_2px_2px_rgba(0,0,0,0.12)]"`).
|
|
91
|
+
- `hideArrow?: boolean` — omit the arrow.
|
|
92
|
+
- `className` still lands on the **outer** (transparent) positioning wrapper, not the visible surface — that's why `className="bg-white"` alone never worked. Use `surfaceClassName`/`variant` for appearance.
|
|
93
|
+
- Exported types: `TooltipContentProps`, `RichTooltipContentProps`, `RichTooltipVariant`. All new props are optional and defaults are unchanged, so existing usages render identically.
|
|
94
|
+
|
|
75
95
|
## Components added on top of shadcn
|
|
76
96
|
|
|
77
97
|
These don't exist in shadcn — reach for them instead of building your own:
|
|
@@ -100,7 +120,7 @@ These don't exist in shadcn — reach for them instead of building your own:
|
|
|
100
120
|
The brand palette lives in CSS variables exposed as Tailwind colors. Use these, not `bg-blue-600`, `text-gray-500`, `border-red-300`, etc. — raw colors won't dark-mode correctly.
|
|
101
121
|
|
|
102
122
|
- **Brand**: `brand-{subtle,light,normal,vibrant,dark}`, `brand-text-vibrant`. `primary` aliases `brand-normal`.
|
|
103
|
-
- **Surfaces** (backgrounds): `gray-surface-{light,default,dark}`, `primary-surface-{subtle,light,default}`, `secondary-surface-default`, `sand-{subtle,light,normal,dark}`, `sage-{light,normal,dark}`, `rose-{light,normal,dark}`, `error-surface-{subtle,light,default,dark}`, `success-surface-{subtle,default}`, `warning-surface-{subtle,light}`.
|
|
123
|
+
- **Surfaces** (backgrounds): `gray-surface-{light,default,dark}`, `primary-surface-{subtle,light,default}`, `secondary-surface-default`, `sand-{subtle,light,normal,dark}`, `sage-{light,normal,dark}`, `rose-{light,normal,dark}`, `error-surface-{subtle,light,default,dark}`, `error-destructive` (filled destructive buttons only), `success-surface-{subtle,default}`, `warning-surface-{subtle,light}`.
|
|
104
124
|
- **Strokes** (borders): `gray-stroke-{light,default}`, `primary-stroke-default`, `secondary-stroke-{light,default}`, `error-stroke-{light,default}`, `success-stroke-light`, `warning-stroke-{default,dark}`, `sand-stroke-disabled`.
|
|
105
125
|
- **Text**: `vibrant-text-{display,heading,body,details,white-darker}`, `secondary-text-dark`, `gray-subtle`, `foreground-secondary`, `destructive-text`.
|
|
106
126
|
- **Icons**: `gray-icon-{subtle,light,default,dark}`, `icon-disabled`.
|
package/dist/index.d.mts
CHANGED
|
@@ -724,15 +724,44 @@ declare function Tooltip({ persistent, ...props }: React$1.ComponentProps<typeof
|
|
|
724
724
|
persistent?: boolean;
|
|
725
725
|
}): react_jsx_runtime.JSX.Element;
|
|
726
726
|
declare function TooltipTrigger({ ...props }: React$1.ComponentProps<typeof TooltipPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
727
|
-
|
|
727
|
+
interface TooltipContentProps extends React$1.ComponentProps<typeof TooltipPrimitive.Content> {
|
|
728
|
+
/** Omit the arrow entirely. Defaults to `false`. */
|
|
729
|
+
hideArrow?: boolean;
|
|
730
|
+
/**
|
|
731
|
+
* Classes merged (via `cn`) onto the arrow. Use to recolor it so it matches a
|
|
732
|
+
* custom surface, e.g. `arrowClassName="bg-white fill-white"`.
|
|
733
|
+
*/
|
|
734
|
+
arrowClassName?: string;
|
|
735
|
+
}
|
|
736
|
+
declare function TooltipContent({ className, sideOffset, hideArrow, arrowClassName, children, ...props }: TooltipContentProps): react_jsx_runtime.JSX.Element;
|
|
737
|
+
type RichTooltipVariant = 'dark' | 'light';
|
|
728
738
|
interface RichTooltipContentProps extends Omit<React$1.ComponentProps<typeof TooltipPrimitive.Content>, 'children'> {
|
|
729
739
|
icon?: React$1.ReactNode;
|
|
730
740
|
heading?: string;
|
|
731
741
|
dismissible?: boolean;
|
|
732
742
|
onDismiss?: () => void;
|
|
733
743
|
children: React$1.ReactNode;
|
|
744
|
+
/**
|
|
745
|
+
* Preset surface + text + arrow combo. `"dark"` (default) keeps the original
|
|
746
|
+
* dark surface with white text; `"light"` renders a white surface with dark
|
|
747
|
+
* text. Both look correct out of the box regardless of the app theme.
|
|
748
|
+
*/
|
|
749
|
+
variant?: RichTooltipVariant;
|
|
750
|
+
/**
|
|
751
|
+
* Classes merged (via `cn`) onto the inner surface `div`, so the background
|
|
752
|
+
* (and text color) can be overridden, e.g. `surfaceClassName="bg-white text-foreground"`.
|
|
753
|
+
* Wins over the `variant` defaults.
|
|
754
|
+
*/
|
|
755
|
+
surfaceClassName?: string;
|
|
756
|
+
/**
|
|
757
|
+
* Classes merged (via `cn`) onto the arrow so it matches a custom surface,
|
|
758
|
+
* e.g. `arrowClassName="fill-white"`. Wins over the `variant` defaults.
|
|
759
|
+
*/
|
|
760
|
+
arrowClassName?: string;
|
|
761
|
+
/** Omit the arrow entirely. Defaults to `false`. */
|
|
762
|
+
hideArrow?: boolean;
|
|
734
763
|
}
|
|
735
|
-
declare function RichTooltipContent({ className, sideOffset, icon, heading, dismissible, onDismiss, children, ...props }: RichTooltipContentProps): react_jsx_runtime.JSX.Element;
|
|
764
|
+
declare function RichTooltipContent({ className, sideOffset, icon, heading, dismissible, onDismiss, children, variant, surfaceClassName, arrowClassName, hideArrow, ...props }: RichTooltipContentProps): react_jsx_runtime.JSX.Element;
|
|
736
765
|
|
|
737
766
|
type SidebarContextProps = {
|
|
738
767
|
state: 'expanded' | 'collapsed';
|
|
@@ -930,4 +959,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
930
959
|
|
|
931
960
|
declare function useIsMobile(): boolean;
|
|
932
961
|
|
|
933
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertBanner, type AlertBannerProps, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, AutoResizeTextarea, Avatar, AvatarFallback, AvatarImage, Badge, BadgeActionable, type BadgeActionableProps, BadgeInformative, BadgeInformativeGroup, BadgeInformativeItem, type BadgeInformativeProps, BadgeNumber, type BadgeNumberProps, Body, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, type DateFormat, DateInput, type DateInputProps, DateRangeInput, type DateRangeInputProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayHeading, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DropdownSelect, DropdownSelectContent, type DropdownSelectContentProps, DropdownSelectLabel, type DropdownSelectLabelProps, DropdownSelectOption, type DropdownSelectOptionProps, type DropdownSelectProps, DropdownSelectTrigger, type DropdownSelectTriggerProps, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HeadingL, HeadingLMedium, HeadingM, HeadingMMedium, HeadingS, HeadingSMedium, HeadingXL, HeadingXLMedium, HeadingXS, HeadingXSMedium, HeadingXXS, HeadingXXSMedium, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MultiSelectFreeText, type MultiSelectFreeTextOption, type MultiSelectFreeTextProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, OptionCard, type OptionCardProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, ProgressBar, type ProgressBarProps, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RichTooltipContent, type RichTooltipContentProps, ScrollArea, ScrollBar, SearchInput, type SearchInputProps, type SearchSuggestion, SearchableSelect, SearchableSelectContent, SearchableSelectEmpty, SearchableSelectGroup, SearchableSelectItem, type SearchableSelectOption, type SearchableSelectProps, SearchableSelectTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, SmartDialog, SmartDialogClose, SmartDialogContent, SmartDialogDescription, SmartDialogFooter, SmartDialogHeader, SmartDialogTitle, SmartDialogTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, ThemeProvider, ThemeToggle, type TimeFormat, TimeInput, type TimeInputProps, type TimeValue, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, alertBannerVariants, badgeActionableVariants, badgeInformativeVariants, badgeNumberVariants, badgeVariants, bodyTextVariants, buttonVariants, cn, displayTextVariants, inputVariants, labelTextVariants, navigationMenuTriggerStyle, optionCardVariants, progressBarVariants, tabsTriggerVariants, toggleVariants, useFormField, useIsMobile, useSidebar };
|
|
962
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertBanner, type AlertBannerProps, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, AutoResizeTextarea, Avatar, AvatarFallback, AvatarImage, Badge, BadgeActionable, type BadgeActionableProps, BadgeInformative, BadgeInformativeGroup, BadgeInformativeItem, type BadgeInformativeProps, BadgeNumber, type BadgeNumberProps, Body, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, type DateFormat, DateInput, type DateInputProps, DateRangeInput, type DateRangeInputProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayHeading, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DropdownSelect, DropdownSelectContent, type DropdownSelectContentProps, DropdownSelectLabel, type DropdownSelectLabelProps, DropdownSelectOption, type DropdownSelectOptionProps, type DropdownSelectProps, DropdownSelectTrigger, type DropdownSelectTriggerProps, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HeadingL, HeadingLMedium, HeadingM, HeadingMMedium, HeadingS, HeadingSMedium, HeadingXL, HeadingXLMedium, HeadingXS, HeadingXSMedium, HeadingXXS, HeadingXXSMedium, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MultiSelectFreeText, type MultiSelectFreeTextOption, type MultiSelectFreeTextProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, OptionCard, type OptionCardProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, ProgressBar, type ProgressBarProps, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RichTooltipContent, type RichTooltipContentProps, type RichTooltipVariant, ScrollArea, ScrollBar, SearchInput, type SearchInputProps, type SearchSuggestion, SearchableSelect, SearchableSelectContent, SearchableSelectEmpty, SearchableSelectGroup, SearchableSelectItem, type SearchableSelectOption, type SearchableSelectProps, SearchableSelectTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, SmartDialog, SmartDialogClose, SmartDialogContent, SmartDialogDescription, SmartDialogFooter, SmartDialogHeader, SmartDialogTitle, SmartDialogTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, ThemeProvider, ThemeToggle, type TimeFormat, TimeInput, type TimeInputProps, type TimeValue, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, alertBannerVariants, badgeActionableVariants, badgeInformativeVariants, badgeNumberVariants, badgeVariants, bodyTextVariants, buttonVariants, cn, displayTextVariants, inputVariants, labelTextVariants, navigationMenuTriggerStyle, optionCardVariants, progressBarVariants, tabsTriggerVariants, toggleVariants, useFormField, useIsMobile, useSidebar };
|
package/dist/index.mjs
CHANGED
|
@@ -255,7 +255,7 @@ var buttonVariants = cva3(
|
|
|
255
255
|
"ghost-secondary": "text-foreground-secondary hover:bg-gray-surface-light hover:text-accent-foreground dark:hover:bg-accent/50 active:bg-gray-surface-default",
|
|
256
256
|
"ghost-destructive": "bg-transparent text-destructive-text hover:bg-destructive-hover focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 active:bg-destructive-active",
|
|
257
257
|
link: "text-foreground-secondary underline-offset-4 underline hover:bg-none active:bg-none hover:text-brand-vibrant",
|
|
258
|
-
destructive: "bg-error-
|
|
258
|
+
destructive: "bg-error-destructive text-primary-foreground hover:bg-red-800 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 active:bg-error-surface-dark",
|
|
259
259
|
"destructive-secondary": "bg-error-surface-light border border-error-stroke-light text-destructive-text hover:border-error-surface-default focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 active:bg-destructive-active",
|
|
260
260
|
"destructive-tertiary": "bg-transparent border border-error-stroke-light text-destructive-text hover:bg-destructive-hover focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 active:bg-destructive-active"
|
|
261
261
|
},
|
|
@@ -448,7 +448,8 @@ var textareaBaseStyles = [
|
|
|
448
448
|
"border-gray-stroke-default bg-background",
|
|
449
449
|
// Hover/Focus/Active states
|
|
450
450
|
"hover:border-focus-ring",
|
|
451
|
-
"focus:border-focus-ring
|
|
451
|
+
"focus:border-focus-ring",
|
|
452
|
+
"focus-visible:border",
|
|
452
453
|
"active:border-focus-ring",
|
|
453
454
|
// Textarea specific
|
|
454
455
|
"field-sizing-content min-h-16 resize-y px-3 py-2"
|
|
@@ -456,7 +457,8 @@ var textareaBaseStyles = [
|
|
|
456
457
|
var errorStyles = [
|
|
457
458
|
"border-error-stroke-default bg-background",
|
|
458
459
|
"hover:border-error-stroke-default",
|
|
459
|
-
"focus:border-error-stroke-default
|
|
460
|
+
"focus:border-error-stroke-default",
|
|
461
|
+
"focus-visible:border",
|
|
460
462
|
"active:border-error-stroke-default"
|
|
461
463
|
].join(" ");
|
|
462
464
|
var Textarea = React6.forwardRef(
|
|
@@ -2272,7 +2274,7 @@ var inputVariants = cva8(
|
|
|
2272
2274
|
// File input styles
|
|
2273
2275
|
"file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
2274
2276
|
// Disabled styles
|
|
2275
|
-
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-60"
|
|
2277
|
+
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-60 disabled:text-gray-icon-subtle"
|
|
2276
2278
|
],
|
|
2277
2279
|
{
|
|
2278
2280
|
variants: {
|
|
@@ -2304,12 +2306,14 @@ var Input = React22.forwardRef(
|
|
|
2304
2306
|
const stateStyles = error ? [
|
|
2305
2307
|
"border-error-stroke-default bg-background",
|
|
2306
2308
|
"hover:border-error-stroke-default",
|
|
2307
|
-
"focus:border-error-stroke-default
|
|
2309
|
+
"focus:border-error-stroke-default",
|
|
2310
|
+
"focus-visible:border",
|
|
2308
2311
|
"active:border-error-stroke-default"
|
|
2309
2312
|
] : [
|
|
2310
2313
|
"border-gray-stroke-default bg-background",
|
|
2311
2314
|
"hover:border-focus-ring",
|
|
2312
|
-
"focus:border-focus-ring
|
|
2315
|
+
"focus:border-focus-ring",
|
|
2316
|
+
"focus-visible:border",
|
|
2313
2317
|
"active:border-focus-ring"
|
|
2314
2318
|
];
|
|
2315
2319
|
if (leftIcon || rightIcon) {
|
|
@@ -5885,9 +5889,9 @@ function Skeleton({ className, ...props }) {
|
|
|
5885
5889
|
}
|
|
5886
5890
|
|
|
5887
5891
|
// src/components/ui/tooltip.tsx
|
|
5888
|
-
import * as React48 from "react";
|
|
5889
5892
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
5890
5893
|
import { X as X4 } from "lucide-react";
|
|
5894
|
+
import * as React48 from "react";
|
|
5891
5895
|
import { jsx as jsx51, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5892
5896
|
function TooltipProvider({
|
|
5893
5897
|
delayDuration = 0,
|
|
@@ -5938,6 +5942,8 @@ function TooltipTrigger({
|
|
|
5938
5942
|
function TooltipContent({
|
|
5939
5943
|
className,
|
|
5940
5944
|
sideOffset = 0,
|
|
5945
|
+
hideArrow = false,
|
|
5946
|
+
arrowClassName,
|
|
5941
5947
|
children,
|
|
5942
5948
|
...props
|
|
5943
5949
|
}) {
|
|
@@ -5947,17 +5953,39 @@ function TooltipContent({
|
|
|
5947
5953
|
"data-slot": "tooltip-content",
|
|
5948
5954
|
sideOffset,
|
|
5949
5955
|
className: cn(
|
|
5950
|
-
"bg-primary text-primary-foreground 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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
5956
|
+
"bg-primary text-primary-foreground 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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance ",
|
|
5951
5957
|
className
|
|
5952
5958
|
),
|
|
5953
5959
|
...props,
|
|
5954
5960
|
children: [
|
|
5955
5961
|
children,
|
|
5956
|
-
/* @__PURE__ */ jsx51(
|
|
5962
|
+
!hideArrow && /* @__PURE__ */ jsx51(
|
|
5963
|
+
TooltipPrimitive.Arrow,
|
|
5964
|
+
{
|
|
5965
|
+
className: cn(
|
|
5966
|
+
"bg-primary fill-primary z-10 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",
|
|
5967
|
+
arrowClassName
|
|
5968
|
+
)
|
|
5969
|
+
}
|
|
5970
|
+
)
|
|
5957
5971
|
]
|
|
5958
5972
|
}
|
|
5959
5973
|
) });
|
|
5960
5974
|
}
|
|
5975
|
+
var richTooltipVariants = {
|
|
5976
|
+
dark: {
|
|
5977
|
+
surface: "bg-gray-surface-dark",
|
|
5978
|
+
text: "text-white",
|
|
5979
|
+
mutedText: "text-white/70 hover:text-white",
|
|
5980
|
+
arrow: "fill-gray-surface-dark"
|
|
5981
|
+
},
|
|
5982
|
+
light: {
|
|
5983
|
+
surface: "bg-white shadow-md",
|
|
5984
|
+
text: "text-gray-surface-dark",
|
|
5985
|
+
mutedText: "text-gray-surface-dark/70 hover:text-gray-surface-dark",
|
|
5986
|
+
arrow: "fill-white drop-shadow-[0_2px_2px_rgba(0,0,0,0.12)]"
|
|
5987
|
+
}
|
|
5988
|
+
};
|
|
5961
5989
|
function RichTooltipContent({
|
|
5962
5990
|
className,
|
|
5963
5991
|
sideOffset = 4,
|
|
@@ -5966,6 +5994,10 @@ function RichTooltipContent({
|
|
|
5966
5994
|
dismissible = false,
|
|
5967
5995
|
onDismiss,
|
|
5968
5996
|
children,
|
|
5997
|
+
variant = "dark",
|
|
5998
|
+
surfaceClassName,
|
|
5999
|
+
arrowClassName,
|
|
6000
|
+
hideArrow = false,
|
|
5969
6001
|
...props
|
|
5970
6002
|
}) {
|
|
5971
6003
|
const close = React48.useContext(TooltipCloseContext);
|
|
@@ -5973,6 +6005,7 @@ function RichTooltipContent({
|
|
|
5973
6005
|
close?.();
|
|
5974
6006
|
onDismiss?.();
|
|
5975
6007
|
};
|
|
6008
|
+
const styles = richTooltipVariants[variant] ?? richTooltipVariants.dark;
|
|
5976
6009
|
return /* @__PURE__ */ jsx51(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs30(
|
|
5977
6010
|
TooltipPrimitive.Content,
|
|
5978
6011
|
{
|
|
@@ -5987,29 +6020,43 @@ function RichTooltipContent({
|
|
|
5987
6020
|
},
|
|
5988
6021
|
...props,
|
|
5989
6022
|
children: [
|
|
5990
|
-
/* @__PURE__ */ jsxs30(
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
className: "flex
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6023
|
+
/* @__PURE__ */ jsxs30(
|
|
6024
|
+
"div",
|
|
6025
|
+
{
|
|
6026
|
+
className: cn(
|
|
6027
|
+
"flex items-start gap-3 rounded-[12px] px-3 py-4 text-sm leading-5 max-w-sm",
|
|
6028
|
+
styles.surface,
|
|
6029
|
+
styles.text,
|
|
6030
|
+
surfaceClassName
|
|
6031
|
+
),
|
|
6032
|
+
children: [
|
|
6033
|
+
icon && /* @__PURE__ */ jsx51("span", { className: "flex items-center justify-center shrink-0 size-5 [&_svg]:size-5", children: icon }),
|
|
6034
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
6035
|
+
heading && /* @__PURE__ */ jsx51("p", { className: "font-semibold text-sm leading-5", children: heading }),
|
|
6036
|
+
/* @__PURE__ */ jsx51("div", { className: "font-normal text-sm leading-5", children })
|
|
6037
|
+
] }),
|
|
6038
|
+
dismissible && /* @__PURE__ */ jsx51(
|
|
6039
|
+
"button",
|
|
6040
|
+
{
|
|
6041
|
+
type: "button",
|
|
6042
|
+
onClick: handleDismiss,
|
|
6043
|
+
className: cn(
|
|
6044
|
+
"flex items-center justify-center shrink-0 size-5 transition-colors cursor-pointer",
|
|
6045
|
+
styles.mutedText
|
|
6046
|
+
),
|
|
6047
|
+
"aria-label": "Dismiss",
|
|
6048
|
+
children: /* @__PURE__ */ jsx51(X4, { className: "size-3.5" })
|
|
6049
|
+
}
|
|
6050
|
+
)
|
|
6051
|
+
]
|
|
6052
|
+
}
|
|
6053
|
+
),
|
|
6054
|
+
!hideArrow && /* @__PURE__ */ jsx51(
|
|
6008
6055
|
TooltipPrimitive.Arrow,
|
|
6009
6056
|
{
|
|
6010
6057
|
width: 16,
|
|
6011
6058
|
height: 12,
|
|
6012
|
-
className:
|
|
6059
|
+
className: cn(styles.arrow, arrowClassName)
|
|
6013
6060
|
}
|
|
6014
6061
|
)
|
|
6015
6062
|
]
|