@cbrl/design 0.8.0 → 0.10.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 +153 -23
- package/dist/components/account-settings.d.ts +24 -0
- package/dist/components/account-settings.js +49 -0
- package/dist/components/alert-dialog.d.ts +5 -1
- package/dist/components/alert-dialog.js +2 -2
- package/dist/components/app-shell.d.ts +25 -4
- package/dist/components/app-shell.js +89 -47
- package/dist/components/avatar.d.ts +7 -2
- package/dist/components/avatar.js +28 -6
- package/dist/components/container.d.ts +19 -0
- package/dist/components/container.js +46 -0
- package/dist/components/dialog.d.ts +6 -2
- package/dist/components/dialog.js +4 -4
- package/dist/components/dropdown-menu.d.ts +5 -1
- package/dist/components/dropdown-menu.js +2 -2
- package/dist/components/page-header.d.ts +24 -0
- package/dist/components/page-header.js +42 -0
- package/dist/components/settings-dialog.d.ts +65 -10
- package/dist/components/settings-dialog.js +210 -29
- package/dist/components/sheet.d.ts +3 -1
- package/dist/components/sheet.js +2 -2
- package/dist/components/sidebar-core.js +5 -5
- package/dist/components/sidebar-peek.d.ts +40 -0
- package/dist/components/sidebar-peek.js +204 -0
- package/dist/components/table.d.ts +8 -1
- package/dist/components/table.js +5 -4
- package/dist/components/theme-provider.d.ts +1 -1
- package/dist/components/theme-provider.js +4 -1
- package/dist/components/theme-setting.d.ts +12 -0
- package/dist/components/theme-setting.js +66 -0
- package/dist/components/theme-toggle.d.ts +22 -0
- package/dist/components/theme-toggle.js +60 -0
- package/dist/components/tooltip.js +7 -1
- package/dist/components/user-menu.d.ts +17 -0
- package/dist/components/user-menu.js +38 -11
- package/dist/hooks/use-autosave-form.d.ts +36 -0
- package/dist/hooks/use-autosave-form.js +81 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.js +10 -3
- package/package.json +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { toast } from "sonner";
|
|
4
|
+
// src/hooks/use-autosave-form.ts
|
|
5
|
+
function snapshot(form) {
|
|
6
|
+
return JSON.stringify(Array.from(new FormData(form).entries()));
|
|
7
|
+
}
|
|
8
|
+
/** A text field holding an edit not saved yet (Escape undoes it). */
|
|
9
|
+
function isDirtyField(element) {
|
|
10
|
+
return (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) && element.value !== element.defaultValue;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Settings fields that save themselves, as in the Claude app — no "Salvar"
|
|
14
|
+
* button: a text field saves when it loses focus or on Enter, Escape undoes
|
|
15
|
+
* the edit, a select/switch saves on change (call `saveSoon`). Nothing is
|
|
16
|
+
* sent when nothing changed; an invalid form (a required field left empty)
|
|
17
|
+
* goes back to the saved values. Spread `formProps` on the `<form>` and give
|
|
18
|
+
* its fields `defaultValue`s.
|
|
19
|
+
*/
|
|
20
|
+
function useAutosaveForm({ submit, successMessage, onSaved }) {
|
|
21
|
+
const formRef = React.useRef(null);
|
|
22
|
+
const saved = React.useRef(null);
|
|
23
|
+
const [error, setError] = React.useState(null);
|
|
24
|
+
const [pending, startTransition] = React.useTransition();
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
if (formRef.current && saved.current === null) saved.current = snapshot(formRef.current);
|
|
27
|
+
}, []);
|
|
28
|
+
const save = () => {
|
|
29
|
+
const form = formRef.current;
|
|
30
|
+
if (!form) return;
|
|
31
|
+
if (!form.checkValidity()) {
|
|
32
|
+
form.reset();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const current = snapshot(form);
|
|
36
|
+
const previous = saved.current;
|
|
37
|
+
if (current === previous) return;
|
|
38
|
+
saved.current = current;
|
|
39
|
+
startTransition(async () => {
|
|
40
|
+
const result = await submit(new FormData(form));
|
|
41
|
+
if (!result.ok) {
|
|
42
|
+
saved.current = previous;
|
|
43
|
+
setError(result.error);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
setError(null);
|
|
47
|
+
toast.success(successMessage);
|
|
48
|
+
onSaved?.();
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
const onKeyDown = (event) => {
|
|
52
|
+
const target = event.target;
|
|
53
|
+
if (event.key === "Enter" && target instanceof HTMLInputElement) {
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
target.blur();
|
|
56
|
+
}
|
|
57
|
+
if (event.key === "Escape" && (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) && target.value !== target.defaultValue) {
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
target.value = target.defaultValue;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
/** The last save's error, for the row's description. */
|
|
64
|
+
error,
|
|
65
|
+
pending,
|
|
66
|
+
/** Saves after the current event (for selects, switches, pickers). */
|
|
67
|
+
saveSoon: () => {
|
|
68
|
+
setTimeout(save, 0);
|
|
69
|
+
},
|
|
70
|
+
formProps: {
|
|
71
|
+
ref: formRef,
|
|
72
|
+
onBlur: save,
|
|
73
|
+
onKeyDown,
|
|
74
|
+
onSubmit: (event) => {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
save();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export { isDirtyField, useAutosaveForm };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { cn } from "./lib/cn.js";
|
|
|
2
2
|
import { initials } from "./lib/initials.js";
|
|
3
3
|
import { NavItem, NavMatch, NavSection, hasActiveChild, isActive } from "./lib/nav.js";
|
|
4
4
|
import { AppShell, AppShellNavLink, AppShellProps } from "./components/app-shell.js";
|
|
5
|
-
import { UserMenu, UserMenuProps, userMenuInitials } from "./components/user-menu.js";
|
|
5
|
+
import { DropdownMenuAccountHeader, USER_MENU_WIDTH, UserMenu, UserMenuProps, userMenuInitials } from "./components/user-menu.js";
|
|
6
6
|
import { Calendar } from "./components/calendar.js";
|
|
7
7
|
import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarInput, SidebarInset, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar } from "./components/sidebar-core.js";
|
|
8
8
|
import { DateField, DateFieldProps } from "./components/date-field.js";
|
|
@@ -16,6 +16,7 @@ import { Button, buttonVariants } from "./components/button.js";
|
|
|
16
16
|
import { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants } from "./components/button-group.js";
|
|
17
17
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/card.js";
|
|
18
18
|
import { Checkbox } from "./components/checkbox.js";
|
|
19
|
+
import { Container, ContainerProps, containerVariants } from "./components/container.js";
|
|
19
20
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/dialog.js";
|
|
20
21
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/dropdown-menu.js";
|
|
21
22
|
import { EmptyState, EmptyStateProps } from "./components/empty-state.js";
|
|
@@ -29,6 +30,7 @@ import { InputGroup, InputGroupAddon, InputGroupInput } from "./components/input
|
|
|
29
30
|
import { Label } from "./components/label.js";
|
|
30
31
|
import { List, ListEmptyContent, ListFilterConfig, ListItem, ListItemActions, ListItemContent, ListItemDescription, ListItemDescriptor, ListItemLeading, ListItemMedia, ListItemMeta, ListItemTitle, ListItemTrailing, ListPaginationConfig, ListProps, ListSearchConfig, listItemVariants, listVariants } from "./components/list.js";
|
|
31
32
|
import { Main, mainVariants } from "./components/main.js";
|
|
33
|
+
import { PageHeader, PageHeaderProps, PageHeaderSkeleton, PageHeaderSkeletonProps } from "./components/page-header.js";
|
|
32
34
|
import { Pagination, PaginationProps } from "./components/pagination.js";
|
|
33
35
|
import { RadioGroup, RadioGroupItem } from "./components/radio-group.js";
|
|
34
36
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./components/select.js";
|
|
@@ -41,19 +43,24 @@ import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, Tabl
|
|
|
41
43
|
import { Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, tabsListVariants } from "./components/tabs.js";
|
|
42
44
|
import { Textarea } from "./components/textarea.js";
|
|
43
45
|
import { ThemeProvider } from "./components/theme-provider.js";
|
|
46
|
+
import { ThemeChoice, ThemeSetting, ThemeSettingLabels } from "./components/theme-setting.js";
|
|
47
|
+
import { ThemeToggle, ThemeToggleLabels, ThemeToggleProps } from "./components/theme-toggle.js";
|
|
44
48
|
import { Typography, typographyVariants } from "./components/typography.js";
|
|
49
|
+
import { AccountSettings, AccountSettingsLabels, SettingsAccount } from "./components/account-settings.js";
|
|
45
50
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/collapsible.js";
|
|
46
51
|
import { Popover, PopoverContent, PopoverTrigger } from "./components/popover.js";
|
|
47
52
|
import { ScrollArea, ScrollBar } from "./components/scroll-area.js";
|
|
48
53
|
import { Separator } from "./components/separator.js";
|
|
49
54
|
import { SettingRow, SettingRowGroup } from "./components/setting-row.js";
|
|
50
|
-
import { SettingsDialog, SettingsDialogProps, SettingsDialogSection } from "./components/settings-dialog.js";
|
|
55
|
+
import { SettingsDialog, SettingsDialogLabels, SettingsDialogProps, SettingsDialogSection, SettingsEmpty, SettingsGroup, SettingsItem, matchSections } from "./components/settings-dialog.js";
|
|
51
56
|
import { SettingsSection } from "./components/settings-section.js";
|
|
52
57
|
import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./components/sheet.js";
|
|
53
58
|
import "./components/sidebar.js";
|
|
59
|
+
import { APP_TOOLBAR_HEIGHT, AppToolbar, AppToolbarLabels, PeekSidebar, SidebarPeekProvider, useSidebarPeek } from "./components/sidebar-peek.js";
|
|
54
60
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/tooltip.js";
|
|
61
|
+
import { AutosaveFormOptions, AutosaveResult, useAutosaveForm } from "./hooks/use-autosave-form.js";
|
|
55
62
|
import { ElementSize, useElementSize } from "./hooks/use-element-size.js";
|
|
56
63
|
import { HashSection, useHashSection } from "./hooks/use-hash-section.js";
|
|
57
64
|
import { useIsMobile } from "./hooks/use-mobile.js";
|
|
58
65
|
import { ScrollStripEdges, useScrollStrip } from "./hooks/use-scroll-strip.js";
|
|
59
|
-
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, type AppShellNavLink, type AppShellProps, AuthSplitScreen, type AuthSplitScreenProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, type BrandIconProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, DateField, type DateFieldProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type ElementSize, EmptyState, type EmptyStateProps, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, GoogleIcon, type HashSection, HighlightedTextarea, Input, InputGroup, InputGroupAddon, InputGroupInput, Label, List, type ListEmptyContent, type ListFilterConfig, ListItem, ListItemActions, ListItemContent, ListItemDescription, type ListItemDescriptor, ListItemLeading, ListItemMedia, ListItemMeta, ListItemTitle, ListItemTrailing, type ListPaginationConfig, type ListProps, type ListSearchConfig, Main, type NavItem, type NavMatch, type NavSection, Pagination, type PaginationProps, Popover, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, type ScrollStripEdges, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingRow, SettingRowGroup, SettingsDialog, type SettingsDialogProps, type SettingsDialogSection, SettingsSection, 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, StatusDot, type StatusDotProps, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, Textarea, ThemeProvider, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, UserMenu, type UserMenuProps, WhatsappIcon, badgeVariants, buttonGroupVariants, buttonVariants, cn, hasActiveChild as hasActiveNavChild, initials, isActive as isNavItemActive, listItemVariants, listVariants, mainVariants, statusDotVariants, tabsListVariants, typographyVariants, useElementSize, useHashSection, useIsMobile, useScrollStrip, useSidebar, userMenuInitials };
|
|
66
|
+
export { APP_TOOLBAR_HEIGHT, AccountSettings, type AccountSettingsLabels, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, type AppShellNavLink, type AppShellProps, AppToolbar, type AppToolbarLabels, AuthSplitScreen, type AuthSplitScreenProps, type AutosaveFormOptions, type AutosaveResult, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, type BrandIconProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Container, type ContainerProps, DateField, type DateFieldProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuAccountHeader, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type ElementSize, EmptyState, type EmptyStateProps, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, GoogleIcon, type HashSection, HighlightedTextarea, Input, InputGroup, InputGroupAddon, InputGroupInput, Label, List, type ListEmptyContent, type ListFilterConfig, ListItem, ListItemActions, ListItemContent, ListItemDescription, type ListItemDescriptor, ListItemLeading, ListItemMedia, ListItemMeta, ListItemTitle, ListItemTrailing, type ListPaginationConfig, type ListProps, type ListSearchConfig, Main, type NavItem, type NavMatch, type NavSection, PageHeader, type PageHeaderProps, PageHeaderSkeleton, type PageHeaderSkeletonProps, Pagination, type PaginationProps, PeekSidebar, Popover, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, type ScrollStripEdges, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingRow, SettingRowGroup, type SettingsAccount, SettingsDialog, type SettingsDialogLabels, type SettingsDialogProps, type SettingsDialogSection, SettingsEmpty, SettingsGroup, SettingsItem, SettingsSection, 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, SidebarPeekProvider, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, StatusDot, type StatusDotProps, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, Textarea, type ThemeChoice, ThemeProvider, ThemeSetting, type ThemeSettingLabels, ThemeToggle, type ThemeToggleLabels, type ThemeToggleProps, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, USER_MENU_WIDTH, UserMenu, type UserMenuProps, WhatsappIcon, badgeVariants, buttonGroupVariants, buttonVariants, cn, containerVariants, hasActiveChild as hasActiveNavChild, initials, isActive as isNavItemActive, listItemVariants, listVariants, mainVariants, matchSections as matchSettingsSections, statusDotVariants, tabsListVariants, typographyVariants, useAutosaveForm, useElementSize, useHashSection, useIsMobile, useScrollStrip, useSidebar, useSidebarPeek, userMenuInitials };
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { cn } from "./lib/cn.js";
|
|
|
2
2
|
import { initials } from "./lib/initials.js";
|
|
3
3
|
import { hasActiveChild, isActive } from "./lib/nav.js";
|
|
4
4
|
import { AppShell } from "./components/app-shell.js";
|
|
5
|
-
import { UserMenu, userMenuInitials } from "./components/user-menu.js";
|
|
5
|
+
import { DropdownMenuAccountHeader, USER_MENU_WIDTH, UserMenu, userMenuInitials } from "./components/user-menu.js";
|
|
6
6
|
import { Calendar } from "./components/calendar.js";
|
|
7
7
|
import { DateField } from "./components/date-field.js";
|
|
8
8
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger } from "./components/alert-dialog.js";
|
|
@@ -14,6 +14,7 @@ import { Button, buttonVariants } from "./components/button.js";
|
|
|
14
14
|
import { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants } from "./components/button-group.js";
|
|
15
15
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/card.js";
|
|
16
16
|
import { Checkbox } from "./components/checkbox.js";
|
|
17
|
+
import { Container, containerVariants } from "./components/container.js";
|
|
17
18
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/dialog.js";
|
|
18
19
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/dropdown-menu.js";
|
|
19
20
|
import { EmptyState } from "./components/empty-state.js";
|
|
@@ -26,6 +27,7 @@ import { InputGroup, InputGroupAddon, InputGroupInput } from "./components/input
|
|
|
26
27
|
import { Label } from "./components/label.js";
|
|
27
28
|
import { List, ListItem, ListItemActions, ListItemContent, ListItemDescription, ListItemLeading, ListItemMedia, ListItemMeta, ListItemTitle, ListItemTrailing, listItemVariants, listVariants } from "./components/list.js";
|
|
28
29
|
import { Main, mainVariants } from "./components/main.js";
|
|
30
|
+
import { PageHeader, PageHeaderSkeleton } from "./components/page-header.js";
|
|
29
31
|
import { Pagination } from "./components/pagination.js";
|
|
30
32
|
import { RadioGroup, RadioGroupItem } from "./components/radio-group.js";
|
|
31
33
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./components/select.js";
|
|
@@ -38,20 +40,25 @@ import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, Tabl
|
|
|
38
40
|
import { Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, tabsListVariants } from "./components/tabs.js";
|
|
39
41
|
import { Textarea } from "./components/textarea.js";
|
|
40
42
|
import { ThemeProvider } from "./components/theme-provider.js";
|
|
43
|
+
import { ThemeSetting } from "./components/theme-setting.js";
|
|
44
|
+
import { ThemeToggle } from "./components/theme-toggle.js";
|
|
41
45
|
import { Typography, typographyVariants } from "./components/typography.js";
|
|
46
|
+
import { AccountSettings } from "./components/account-settings.js";
|
|
42
47
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/collapsible.js";
|
|
43
48
|
import { Popover, PopoverContent, PopoverTrigger } from "./components/popover.js";
|
|
44
49
|
import { ScrollArea, ScrollBar } from "./components/scroll-area.js";
|
|
45
50
|
import { Separator } from "./components/separator.js";
|
|
46
51
|
import { SettingRow, SettingRowGroup } from "./components/setting-row.js";
|
|
47
|
-
import { SettingsDialog } from "./components/settings-dialog.js";
|
|
52
|
+
import { SettingsDialog, SettingsEmpty, SettingsGroup, SettingsItem, matchSections } from "./components/settings-dialog.js";
|
|
48
53
|
import { SettingsSection } from "./components/settings-section.js";
|
|
49
54
|
import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./components/sheet.js";
|
|
50
55
|
import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarInput, SidebarInset, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar } from "./components/sidebar-core.js";
|
|
51
56
|
import { SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem } from "./components/sidebar-menu.js";
|
|
57
|
+
import { APP_TOOLBAR_HEIGHT, AppToolbar, PeekSidebar, SidebarPeekProvider, useSidebarPeek } from "./components/sidebar-peek.js";
|
|
52
58
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/tooltip.js";
|
|
59
|
+
import { useAutosaveForm } from "./hooks/use-autosave-form.js";
|
|
53
60
|
import { useElementSize } from "./hooks/use-element-size.js";
|
|
54
61
|
import { useHashSection } from "./hooks/use-hash-section.js";
|
|
55
62
|
import { useIsMobile } from "./hooks/use-mobile.js";
|
|
56
63
|
import { useScrollStrip } from "./hooks/use-scroll-strip.js";
|
|
57
|
-
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, AuthSplitScreen, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, DateField, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, GoogleIcon, HighlightedTextarea, Input, InputGroup, InputGroupAddon, InputGroupInput, Label, List, ListItem, ListItemActions, ListItemContent, ListItemDescription, ListItemLeading, ListItemMedia, ListItemMeta, ListItemTitle, ListItemTrailing, Main, Pagination, Popover, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingRow, SettingRowGroup, SettingsDialog, SettingsSection, 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, StatusDot, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, Textarea, ThemeProvider, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, UserMenu, WhatsappIcon, badgeVariants, buttonGroupVariants, buttonVariants, cn, hasActiveChild as hasActiveNavChild, initials, isActive as isNavItemActive, listItemVariants, listVariants, mainVariants, statusDotVariants, tabsListVariants, typographyVariants, useElementSize, useHashSection, useIsMobile, useScrollStrip, useSidebar, userMenuInitials };
|
|
64
|
+
export { APP_TOOLBAR_HEIGHT, AccountSettings, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, AppToolbar, AuthSplitScreen, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Container, DateField, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuAccountHeader, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, GoogleIcon, HighlightedTextarea, Input, InputGroup, InputGroupAddon, InputGroupInput, Label, List, ListItem, ListItemActions, ListItemContent, ListItemDescription, ListItemLeading, ListItemMedia, ListItemMeta, ListItemTitle, ListItemTrailing, Main, PageHeader, PageHeaderSkeleton, Pagination, PeekSidebar, Popover, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingRow, SettingRowGroup, SettingsDialog, SettingsEmpty, SettingsGroup, SettingsItem, SettingsSection, 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, SidebarPeekProvider, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, StatusDot, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, Textarea, ThemeProvider, ThemeSetting, ThemeToggle, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, USER_MENU_WIDTH, UserMenu, WhatsappIcon, badgeVariants, buttonGroupVariants, buttonVariants, cn, containerVariants, hasActiveChild as hasActiveNavChild, initials, isActive as isNavItemActive, listItemVariants, listVariants, mainVariants, matchSections as matchSettingsSections, statusDotVariants, tabsListVariants, typographyVariants, useAutosaveForm, useElementSize, useHashSection, useIsMobile, useScrollStrip, useSidebar, useSidebarPeek, userMenuInitials };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cbrl/design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Design system on Radix + Tailwind v4: shadcn-style components, layout shells and design tokens with an overridable brand accent.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Kayron Cabral",
|