@yuva-devlab/ui 1.0.1 → 1.1.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/README.md +29 -14
- package/dist/index.cjs +35 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -6
- package/dist/index.d.ts +18 -6
- package/dist/index.js +33 -4
- package/dist/index.js.map +1 -1
- package/dist/preset.css +159 -0
- package/dist/styles/preset.css +159 -0
- package/dist/styles/styles.css +6 -0
- package/dist/styles/themes/finai.css +114 -0
- package/dist/styles/themes/orchestrai.css +75 -0
- package/dist/styles.css +6 -0
- package/dist/themes/finai.css +114 -0
- package/dist/themes/orchestrai.css +75 -0
- package/package.json +10 -2
package/dist/index.d.cts
CHANGED
|
@@ -56,28 +56,40 @@ import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
|
56
56
|
declare function cn(...inputs: ClassValue[]): string;
|
|
57
57
|
|
|
58
58
|
type Theme = "dark" | "light" | "system" | string;
|
|
59
|
+
type Brand = "finai" | "orchestrai" | string;
|
|
59
60
|
interface ThemeProviderProps {
|
|
60
61
|
children: React__default.ReactNode;
|
|
62
|
+
brand?: Brand;
|
|
61
63
|
defaultTheme?: Theme;
|
|
62
64
|
storageKey?: string;
|
|
65
|
+
brandStorageKey?: string;
|
|
63
66
|
attribute?: string;
|
|
67
|
+
brandAttribute?: string;
|
|
64
68
|
enableSystem?: boolean;
|
|
65
69
|
}
|
|
66
70
|
interface ThemeProviderState {
|
|
67
71
|
theme: Theme;
|
|
72
|
+
brand: Brand;
|
|
68
73
|
setTheme: (theme: Theme) => void;
|
|
74
|
+
setBrand: (brand: Brand) => void;
|
|
69
75
|
resolvedTheme: "dark" | "light";
|
|
70
76
|
}
|
|
71
77
|
/**
|
|
72
|
-
* Universal theme provider for Yuva DevLab applications (FinAI, OrchestrAI).
|
|
73
|
-
* Handles HTML class manipulation, data-theme
|
|
74
|
-
* and localStorage persistence.
|
|
78
|
+
* Universal theme & brand provider for Yuva DevLab applications (FinAI, OrchestrAI).
|
|
79
|
+
* Handles HTML class manipulation, data-theme and data-brand attributes,
|
|
80
|
+
* system preferences, and localStorage persistence.
|
|
75
81
|
*/
|
|
76
|
-
declare function ThemeProvider({ children, defaultTheme, storageKey, attribute, enableSystem, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
82
|
+
declare function ThemeProvider({ children, brand: initialBrand, defaultTheme, storageKey, brandStorageKey, attribute, brandAttribute, enableSystem, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
77
83
|
/**
|
|
78
|
-
* Hook to access current theme state and mutate the theme.
|
|
84
|
+
* Hook to access current theme & brand state and mutate the theme/brand.
|
|
79
85
|
*/
|
|
80
86
|
declare const useTheme: () => ThemeProviderState;
|
|
87
|
+
/**
|
|
88
|
+
* ConfigProvider: Brand and Theme Configuration Provider for Yuva DevLab applications.
|
|
89
|
+
*/
|
|
90
|
+
declare const ConfigProvider: typeof ThemeProvider;
|
|
91
|
+
type ConfigProviderProps = ThemeProviderProps;
|
|
92
|
+
declare const useConfig: () => ThemeProviderState;
|
|
81
93
|
|
|
82
94
|
/**
|
|
83
95
|
* Hook to determine if current viewport matches mobile breakpoint (< 768px).
|
|
@@ -762,4 +774,4 @@ interface LoadingStateProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
762
774
|
}
|
|
763
775
|
declare function LoadingState({ rows, className, ...props }: LoadingStateProps): react_jsx_runtime.JSX.Element;
|
|
764
776
|
|
|
765
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, CalendarDayButton, Card, 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, ConfirmDialog, type ConfirmDialogProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, 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, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label, LoadingState, type LoadingStateProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Panel, type PanelProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, SearchableSelect, type SearchableSelectOption, type SearchableSelectProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, 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, StatusChip, type StatusChipProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThemeProvider, type ThemeProviderProps, type ThemeProviderState, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, navigationMenuTriggerStyle, toggleVariants, useFormField, useIsMobile, useSidebar, useTheme };
|
|
777
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, type Brand, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, CalendarDayButton, Card, 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, ConfigProvider, type ConfigProviderProps, ConfirmDialog, type ConfirmDialogProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, 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, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label, LoadingState, type LoadingStateProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Panel, type PanelProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, SearchableSelect, type SearchableSelectOption, type SearchableSelectProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, 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, StatusChip, type StatusChipProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThemeProvider, type ThemeProviderProps, type ThemeProviderState, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, navigationMenuTriggerStyle, toggleVariants, useConfig, useFormField, useIsMobile, useSidebar, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -56,28 +56,40 @@ import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
|
56
56
|
declare function cn(...inputs: ClassValue[]): string;
|
|
57
57
|
|
|
58
58
|
type Theme = "dark" | "light" | "system" | string;
|
|
59
|
+
type Brand = "finai" | "orchestrai" | string;
|
|
59
60
|
interface ThemeProviderProps {
|
|
60
61
|
children: React__default.ReactNode;
|
|
62
|
+
brand?: Brand;
|
|
61
63
|
defaultTheme?: Theme;
|
|
62
64
|
storageKey?: string;
|
|
65
|
+
brandStorageKey?: string;
|
|
63
66
|
attribute?: string;
|
|
67
|
+
brandAttribute?: string;
|
|
64
68
|
enableSystem?: boolean;
|
|
65
69
|
}
|
|
66
70
|
interface ThemeProviderState {
|
|
67
71
|
theme: Theme;
|
|
72
|
+
brand: Brand;
|
|
68
73
|
setTheme: (theme: Theme) => void;
|
|
74
|
+
setBrand: (brand: Brand) => void;
|
|
69
75
|
resolvedTheme: "dark" | "light";
|
|
70
76
|
}
|
|
71
77
|
/**
|
|
72
|
-
* Universal theme provider for Yuva DevLab applications (FinAI, OrchestrAI).
|
|
73
|
-
* Handles HTML class manipulation, data-theme
|
|
74
|
-
* and localStorage persistence.
|
|
78
|
+
* Universal theme & brand provider for Yuva DevLab applications (FinAI, OrchestrAI).
|
|
79
|
+
* Handles HTML class manipulation, data-theme and data-brand attributes,
|
|
80
|
+
* system preferences, and localStorage persistence.
|
|
75
81
|
*/
|
|
76
|
-
declare function ThemeProvider({ children, defaultTheme, storageKey, attribute, enableSystem, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
82
|
+
declare function ThemeProvider({ children, brand: initialBrand, defaultTheme, storageKey, brandStorageKey, attribute, brandAttribute, enableSystem, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
77
83
|
/**
|
|
78
|
-
* Hook to access current theme state and mutate the theme.
|
|
84
|
+
* Hook to access current theme & brand state and mutate the theme/brand.
|
|
79
85
|
*/
|
|
80
86
|
declare const useTheme: () => ThemeProviderState;
|
|
87
|
+
/**
|
|
88
|
+
* ConfigProvider: Brand and Theme Configuration Provider for Yuva DevLab applications.
|
|
89
|
+
*/
|
|
90
|
+
declare const ConfigProvider: typeof ThemeProvider;
|
|
91
|
+
type ConfigProviderProps = ThemeProviderProps;
|
|
92
|
+
declare const useConfig: () => ThemeProviderState;
|
|
81
93
|
|
|
82
94
|
/**
|
|
83
95
|
* Hook to determine if current viewport matches mobile breakpoint (< 768px).
|
|
@@ -762,4 +774,4 @@ interface LoadingStateProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
762
774
|
}
|
|
763
775
|
declare function LoadingState({ rows, className, ...props }: LoadingStateProps): react_jsx_runtime.JSX.Element;
|
|
764
776
|
|
|
765
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, CalendarDayButton, Card, 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, ConfirmDialog, type ConfirmDialogProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, 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, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label, LoadingState, type LoadingStateProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Panel, type PanelProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, SearchableSelect, type SearchableSelectOption, type SearchableSelectProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, 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, StatusChip, type StatusChipProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThemeProvider, type ThemeProviderProps, type ThemeProviderState, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, navigationMenuTriggerStyle, toggleVariants, useFormField, useIsMobile, useSidebar, useTheme };
|
|
777
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, type Brand, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, CalendarDayButton, Card, 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, ConfigProvider, type ConfigProviderProps, ConfirmDialog, type ConfirmDialogProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, 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, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label, LoadingState, type LoadingStateProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Panel, type PanelProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, SearchableSelect, type SearchableSelectOption, type SearchableSelectProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, 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, StatusChip, type StatusChipProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThemeProvider, type ThemeProviderProps, type ThemeProviderState, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, cn, navigationMenuTriggerStyle, toggleVariants, useConfig, useFormField, useIsMobile, useSidebar, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -12,15 +12,20 @@ import { createContext, useContext, useEffect, useState } from "react";
|
|
|
12
12
|
import { jsx } from "react/jsx-runtime";
|
|
13
13
|
var initialState = {
|
|
14
14
|
theme: "system",
|
|
15
|
+
brand: "finai",
|
|
15
16
|
setTheme: () => null,
|
|
17
|
+
setBrand: () => null,
|
|
16
18
|
resolvedTheme: "dark"
|
|
17
19
|
};
|
|
18
20
|
var ThemeProviderContext = createContext(initialState);
|
|
19
21
|
function ThemeProvider({
|
|
20
22
|
children,
|
|
23
|
+
brand: initialBrand = "finai",
|
|
21
24
|
defaultTheme = "system",
|
|
22
25
|
storageKey = "yd-theme",
|
|
26
|
+
brandStorageKey = "yd-brand",
|
|
23
27
|
attribute = "data-theme",
|
|
28
|
+
brandAttribute = "data-brand",
|
|
24
29
|
enableSystem = true,
|
|
25
30
|
...props
|
|
26
31
|
}) {
|
|
@@ -31,6 +36,13 @@ function ThemeProvider({
|
|
|
31
36
|
}
|
|
32
37
|
return defaultTheme;
|
|
33
38
|
});
|
|
39
|
+
const [brand, setBrandState] = useState(() => {
|
|
40
|
+
if (typeof window !== "undefined") {
|
|
41
|
+
const stored = localStorage.getItem(brandStorageKey);
|
|
42
|
+
if (stored) return stored;
|
|
43
|
+
}
|
|
44
|
+
return initialBrand;
|
|
45
|
+
});
|
|
34
46
|
const [resolvedTheme, setResolvedTheme] = useState("dark");
|
|
35
47
|
useEffect(() => {
|
|
36
48
|
const root = window.document.documentElement;
|
|
@@ -40,20 +52,33 @@ function ThemeProvider({
|
|
|
40
52
|
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
41
53
|
activeTheme = systemTheme;
|
|
42
54
|
}
|
|
43
|
-
const isDark = activeTheme.includes("dark") || activeTheme === "orchestrai";
|
|
55
|
+
const isDark = activeTheme.includes("dark") || activeTheme === "orchestrai" || brand === "orchestrai" && activeTheme !== "light";
|
|
44
56
|
const resolved = isDark ? "dark" : "light";
|
|
45
57
|
setResolvedTheme(resolved);
|
|
46
58
|
root.classList.add(resolved);
|
|
59
|
+
if (brandAttribute && brand) {
|
|
60
|
+
root.setAttribute(brandAttribute, brand);
|
|
61
|
+
}
|
|
47
62
|
if (attribute) {
|
|
48
|
-
|
|
63
|
+
const combinedTheme = theme === "system" ? `${brand}-${resolved}` : theme.startsWith(brand) ? theme : `${brand}-${theme}`;
|
|
64
|
+
root.setAttribute(attribute, combinedTheme);
|
|
49
65
|
}
|
|
50
|
-
}, [theme, enableSystem, attribute]);
|
|
66
|
+
}, [theme, brand, enableSystem, attribute, brandAttribute]);
|
|
51
67
|
const value = {
|
|
52
68
|
theme,
|
|
69
|
+
brand,
|
|
53
70
|
setTheme: (newTheme) => {
|
|
54
|
-
|
|
71
|
+
if (typeof window !== "undefined") {
|
|
72
|
+
localStorage.setItem(storageKey, newTheme);
|
|
73
|
+
}
|
|
55
74
|
setThemeState(newTheme);
|
|
56
75
|
},
|
|
76
|
+
setBrand: (newBrand) => {
|
|
77
|
+
if (typeof window !== "undefined") {
|
|
78
|
+
localStorage.setItem(brandStorageKey, newBrand);
|
|
79
|
+
}
|
|
80
|
+
setBrandState(newBrand);
|
|
81
|
+
},
|
|
57
82
|
resolvedTheme
|
|
58
83
|
};
|
|
59
84
|
return /* @__PURE__ */ jsx(ThemeProviderContext.Provider, { ...props, value, children });
|
|
@@ -65,6 +90,8 @@ var useTheme = () => {
|
|
|
65
90
|
}
|
|
66
91
|
return context;
|
|
67
92
|
};
|
|
93
|
+
var ConfigProvider = ThemeProvider;
|
|
94
|
+
var useConfig = useTheme;
|
|
68
95
|
|
|
69
96
|
// src/hooks/use-mobile.ts
|
|
70
97
|
import * as React2 from "react";
|
|
@@ -4039,6 +4066,7 @@ export {
|
|
|
4039
4066
|
CommandList,
|
|
4040
4067
|
CommandSeparator,
|
|
4041
4068
|
CommandShortcut,
|
|
4069
|
+
ConfigProvider,
|
|
4042
4070
|
ConfirmDialog,
|
|
4043
4071
|
ContextMenu,
|
|
4044
4072
|
ContextMenuCheckboxItem,
|
|
@@ -4229,6 +4257,7 @@ export {
|
|
|
4229
4257
|
navigationMenuTriggerStyle,
|
|
4230
4258
|
toast,
|
|
4231
4259
|
toggleVariants,
|
|
4260
|
+
useConfig,
|
|
4232
4261
|
useFormField,
|
|
4233
4262
|
useIsMobile,
|
|
4234
4263
|
useSidebar,
|