@lessly/ui 0.3.0 → 0.3.2
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/dist/index.d.ts +5 -6
- package/dist/index.js +7 -4
- package/dist/styles.css +10 -10
- package/package.json +17 -14
package/dist/index.d.ts
CHANGED
|
@@ -760,11 +760,10 @@ type NavRowProps = NavRowOwnProps & Omit<React$1.ComponentPropsWithoutRef<'butto
|
|
|
760
760
|
/** Nav row primitive (rail and menu variants). Composes an icon, label and trailing slot
|
|
761
761
|
* into a button, or into a single child via `asChild` (e.g. a router `<Link>`).
|
|
762
762
|
*
|
|
763
|
-
* Rail rows are designed for the `bg-surface` canvas
|
|
764
|
-
*
|
|
765
|
-
*
|
|
766
|
-
*
|
|
767
|
-
* `bg-surface` canvas in light theme. */
|
|
763
|
+
* Rail rows are designed for the `bg-surface` canvas. In the light theme `--hov-bg` is an
|
|
764
|
+
* opaque `#ffffff` plate, so a rail `NavRow` has no hover contrast on a surface that is
|
|
765
|
+
* already white — notably a `--menu-bg` plate. Use the `menu` variant there; its
|
|
766
|
+
* `--menu-hov` is tuned for that surface. */
|
|
768
767
|
declare const NavRow: React$1.ForwardRefExoticComponent<NavRowProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
769
768
|
|
|
770
769
|
type NavSectionLabelProps = React$1.HTMLAttributes<HTMLDivElement>;
|
|
@@ -849,4 +848,4 @@ declare function AppShell({ sidebar, topBar, children, className }: AppShellProp
|
|
|
849
848
|
/** Alias of AppShell — reads better in app router files. */
|
|
850
849
|
declare const AuthenticatedLayout: typeof AppShell;
|
|
851
850
|
|
|
852
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppShell, type AppShellProps, AppSidebar, type AppSidebarProps, AspectRatio, AuthenticatedLayout, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, 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, CopyButton, type CopyButtonProps, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DocsLink, type DocsLinkProps, 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, EmptyState, type EmptyStateProps, ExtensionIcon, type ExtensionIconProps, ExtensionLink, type ExtensionLinkProps, type ExtensionLinkUiMode, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, InlineError, type InlineErrorProps, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label, MenuDivider, MenuPopup, type MenuPopupProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, type NavItem, type NavLinkComponent, NavRow, type NavRowProps, type NavRowVariant, NavSectionLabel, type NavSectionLabelProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, SectionIntro, Select, type SelectOption, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarNav, SidebarNavLink, type SidebarNavLinkProps, type SidebarNavProps, Skeleton, Slider, StatCard, type StatCardProps, StatusDot, type StatusDotProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, ThemeToggle, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseSidebarOptions, type UseSidebarResult, UserMenu, type UserMenuItem, type UserMenuProps, type UserMenuUser, alertVariants, badgeVariants, buttonVariants, cn, isKnownExtensionIcon, navigationMenuTriggerStyle, statusDotVariants, toggleVariants, useCarousel, useFormField, useIsMobile, useSidebar, useTheme };
|
|
851
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppShell, type AppShellProps, AppSidebar, type AppSidebarProps, AspectRatio, AuthenticatedLayout, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, type CarouselContextProps, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, 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, CopyButton, type CopyButtonProps, DatePicker, type DatePickerProps, type DeltaDirection, type DeltaTone, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DocsLink, type DocsLinkProps, 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, EmptyState, type EmptyStateProps, ExtensionIcon, type ExtensionIconProps, ExtensionLink, type ExtensionLinkProps, type ExtensionLinkUiMode, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, InlineError, type InlineErrorProps, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, MenuDivider, MenuPopup, type MenuPopupProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, type NavItem, type NavLinkComponent, NavRow, type NavRowProps, type NavRowVariant, NavSectionLabel, type NavSectionLabelProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, type PaginationLinkProps, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, type ResolvedTheme, ScrollArea, ScrollBar, SectionIntro, type SectionIntroProps, Select, type SelectOption, type SelectProps, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarNav, SidebarNavLink, type SidebarNavLinkProps, type SidebarNavProps, Skeleton, Slider, StatCard, type StatCardProps, StatusDot, type StatusDotProps, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, type Theme, ThemeToggle, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseSidebarOptions, type UseSidebarResult, UserMenu, type UserMenuItem, type UserMenuProps, type UserMenuUser, alertVariants, badgeVariants, buttonVariants, cn, isKnownExtensionIcon, navigationMenuTriggerStyle, statusDotVariants, toggleVariants, useCarousel, useFormField, useIsMobile, useSidebar, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -1878,6 +1878,10 @@ NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayN
|
|
|
1878
1878
|
// src/hooks/useTheme.ts
|
|
1879
1879
|
import { useEffect, useState, useCallback } from "react";
|
|
1880
1880
|
var STORAGE_KEY = "lessly_theme";
|
|
1881
|
+
var THEMES = ["light", "dark", "system"];
|
|
1882
|
+
function parseStoredTheme(stored) {
|
|
1883
|
+
return THEMES.includes(stored) ? stored : "system";
|
|
1884
|
+
}
|
|
1881
1885
|
function getSystemTheme() {
|
|
1882
1886
|
if (typeof window === "undefined") return "dark";
|
|
1883
1887
|
return window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark";
|
|
@@ -1896,10 +1900,9 @@ function applyTheme(resolved) {
|
|
|
1896
1900
|
}
|
|
1897
1901
|
}
|
|
1898
1902
|
function useTheme() {
|
|
1899
|
-
const [theme, setThemeState] = useState(
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
});
|
|
1903
|
+
const [theme, setThemeState] = useState(
|
|
1904
|
+
() => parseStoredTheme(localStorage.getItem(STORAGE_KEY))
|
|
1905
|
+
);
|
|
1903
1906
|
const resolvedTheme = resolveTheme(theme);
|
|
1904
1907
|
const setTheme = useCallback((newTheme) => {
|
|
1905
1908
|
setThemeState(newTheme);
|
package/dist/styles.css
CHANGED
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
--spacing: 0.25rem;
|
|
60
60
|
}
|
|
61
61
|
:root {
|
|
62
|
-
--color-bg-primary: #
|
|
62
|
+
--color-bg-primary: #191b24;
|
|
63
63
|
--color-bg-secondary: #12141b;
|
|
64
|
-
--color-bg-surface: #
|
|
65
|
-
--color-bg-elevated: #
|
|
66
|
-
--color-bg-sunken: #
|
|
64
|
+
--color-bg-surface: #1f222d;
|
|
65
|
+
--color-bg-elevated: #252936;
|
|
66
|
+
--color-bg-sunken: #0e1015;
|
|
67
67
|
--color-bg-brand: #06297d;
|
|
68
|
-
--color-bg-brand-subtle: #
|
|
68
|
+
--color-bg-brand-subtle: #1f2541;
|
|
69
69
|
--color-bg-brand-bright: #165ff2;
|
|
70
70
|
--color-bg-brand-hover: #08349b;
|
|
71
71
|
--color-bg-success: #13703c;
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
--color-bg-rose-subtle: #1a090b;
|
|
80
80
|
--color-text-primary: #eeeff0;
|
|
81
81
|
--color-text-secondary: #a5a9b5;
|
|
82
|
-
--color-text-tertiary: #
|
|
82
|
+
--color-text-tertiary: #8a93a8;
|
|
83
83
|
--color-text-disabled: #60687f;
|
|
84
84
|
--color-text-inverse: #0e1015;
|
|
85
85
|
--color-text-on-brand: #f6f7f7;
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
--color-icon-success: #2eda76;
|
|
100
100
|
--color-icon-warning: #efb042;
|
|
101
101
|
--color-icon-danger: #f06a6a;
|
|
102
|
-
--color-border-subtle: #
|
|
102
|
+
--color-border-subtle: #2a2e3b;
|
|
103
103
|
--color-border-default: #60687f;
|
|
104
104
|
--color-border-strong: #737c95;
|
|
105
105
|
--color-border-brand: #165ff2;
|
|
@@ -118,10 +118,10 @@
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
.light {
|
|
121
|
-
--color-bg-primary: #
|
|
121
|
+
--color-bg-primary: #f6f7f7;
|
|
122
122
|
--color-bg-secondary: #eeeff0;
|
|
123
|
-
--color-bg-surface: #
|
|
124
|
-
--color-bg-elevated: #
|
|
123
|
+
--color-bg-surface: #f2f3f4;
|
|
124
|
+
--color-bg-elevated: #edeef0;
|
|
125
125
|
--color-bg-sunken: #e1e2e4;
|
|
126
126
|
--color-bg-brand: #06297d;
|
|
127
127
|
--color-bg-brand-subtle: #e4ecfe;
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lessly/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Lessly design system — shared UI primitives, tokens, and theme",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"packageManager": "pnpm@10.30.3",
|
|
6
7
|
"main": "./dist/index.js",
|
|
7
8
|
"module": "./dist/index.js",
|
|
8
9
|
"types": "./dist/index.d.ts",
|
|
@@ -26,6 +27,20 @@
|
|
|
26
27
|
"engines": {
|
|
27
28
|
"node": ">=20"
|
|
28
29
|
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsup && node scripts/build-styles.mjs",
|
|
32
|
+
"prepare": "pnpm build",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"type-check": "tsc --noEmit",
|
|
35
|
+
"lint": "eslint .",
|
|
36
|
+
"prepublishOnly": "pnpm build && pnpm test && node scripts/check-package-contract.mjs",
|
|
37
|
+
"storybook": "storybook dev -p 6006 --no-open",
|
|
38
|
+
"build-storybook": "storybook build",
|
|
39
|
+
"changeset": "changeset",
|
|
40
|
+
"release:version": "changeset version && node scripts/stamp-changelog-date.mjs",
|
|
41
|
+
"release:publish": "node scripts/release-publish.mjs",
|
|
42
|
+
"release:tag": "changeset tag"
|
|
43
|
+
},
|
|
29
44
|
"publishConfig": {
|
|
30
45
|
"registry": "https://registry.npmjs.org/",
|
|
31
46
|
"access": "public"
|
|
@@ -101,17 +116,5 @@
|
|
|
101
116
|
"typescript-eslint": "^8.63.0",
|
|
102
117
|
"vite": "^5.4.21",
|
|
103
118
|
"vitest": "^3.0.5"
|
|
104
|
-
},
|
|
105
|
-
"scripts": {
|
|
106
|
-
"build": "tsup && node scripts/build-styles.mjs",
|
|
107
|
-
"test": "vitest run",
|
|
108
|
-
"type-check": "tsc --noEmit",
|
|
109
|
-
"lint": "eslint .",
|
|
110
|
-
"storybook": "storybook dev -p 6006 --no-open",
|
|
111
|
-
"build-storybook": "storybook build",
|
|
112
|
-
"changeset": "changeset",
|
|
113
|
-
"release:version": "changeset version && node scripts/stamp-changelog-date.mjs",
|
|
114
|
-
"release:publish": "node scripts/release-publish.mjs",
|
|
115
|
-
"release:tag": "changeset tag"
|
|
116
119
|
}
|
|
117
|
-
}
|
|
120
|
+
}
|