feat(ui): add @snowluma/ui shared UI library
Lifts the shadcn primitives + Tailwind 4 theme tokens from webui into a dedicated workspace package consumable by both webui and SnowLumaDesktop. - 14 primitives (Button, Dialog, AlertDialog, Input, Label, Checkbox, Select, Switch, Tabs, Card, Avatar, Badge, Progress, ScrollArea, Separator, Sheet, Skeleton, Tooltip) + sonner Toaster wrapper - Tailwind 4 theme tokens exported via styles/theme.css - tsup ESM build with declaration files - publishConfig.access=public mirroring @snowluma/sdk Consumers @import '@snowluma/ui/styles/theme.css' for tokens and add an @source directive to scan the package for utility classes.
This commit is contained in:
26 files changed
+1988
-7
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import { Toaster as Sonner, toast, type ToasterProps } from 'sonner';
|
||||
|
||||
/**
|
||||
* SnowLuma-themed toaster. Uses the Tailwind `--*-foreground / --background`
|
||||
* tokens defined in `@snowluma/ui/styles/theme.css` so toasts match the
|
||||
* surrounding chrome in both light and dark mode.
|
||||
*/
|
||||
export function Toaster(props: ToasterProps) {
|
||||
return (
|
||||
<Sonner
|
||||
position="bottom-right"
|
||||
richColors
|
||||
closeButton
|
||||
theme="system"
|
||||
toastOptions={{
|
||||
classNames: {
|
||||
toast: 'group toast group-[.toaster]:bg-card group-[.toaster]:text-card-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',
|
||||
description: 'group-[.toast]:text-muted-foreground',
|
||||
actionButton: 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',
|
||||
cancelButton: 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',
|
||||
},
|
||||
}}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export { toast };
|
||||
export type { ToasterProps };
|
||||
Reference in new issue
Block a user