@cbrl/design 0.9.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.
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
- declare function Table({ className, ...props }: React.ComponentProps<'table'>): React.JSX.Element;
2
+ declare function Table({ className, variant, ...props }: React.ComponentProps<'table'> & {
3
+ /**
4
+ * `settings`: a table inside a settings group, as in the Claude app's
5
+ * "where you signed in" list — small muted header, 44px rows, edges aligned
6
+ * with the group (no side padding on the first/last column), no hover fill.
7
+ */
8
+ variant?: 'default' | 'settings';
9
+ }): React.JSX.Element;
3
10
  declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): React.JSX.Element;
4
11
  declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): React.JSX.Element;
5
12
  declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): React.JSX.Element;
@@ -2,12 +2,13 @@ import { cn } from "../lib/cn.js";
2
2
  import "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  // src/components/table.tsx
5
- function Table({ className, ...props }) {
5
+ function Table({ className, variant = "default", ...props }) {
6
6
  return /* @__PURE__ */ jsx("div", {
7
7
  "data-slot": "table-container",
8
8
  className: "relative w-full overflow-x-auto",
9
9
  children: /* @__PURE__ */ jsx("table", {
10
10
  "data-slot": "table",
11
+ "data-variant": variant,
11
12
  className: cn("w-full caption-bottom text-sm", className),
12
13
  ...props
13
14
  })
@@ -37,21 +38,21 @@ function TableFooter({ className, ...props }) {
37
38
  function TableRow({ className, ...props }) {
38
39
  return /* @__PURE__ */ jsx("tr", {
39
40
  "data-slot": "table-row",
40
- className: cn("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors", className),
41
+ className: cn("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors in-data-[variant=settings]:hover:bg-transparent", className),
41
42
  ...props
42
43
  });
43
44
  }
44
45
  function TableHead({ className, ...props }) {
45
46
  return /* @__PURE__ */ jsx("th", {
46
47
  "data-slot": "table-head",
47
- className: cn("text-muted-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
48
+ className: cn("text-muted-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", "in-data-[variant=settings]:h-8 in-data-[variant=settings]:px-3 in-data-[variant=settings]:text-xs in-data-[variant=settings]:font-normal in-data-[variant=settings]:first:pl-0 in-data-[variant=settings]:last:pr-0", className),
48
49
  ...props
49
50
  });
50
51
  }
51
52
  function TableCell({ className, ...props }) {
52
53
  return /* @__PURE__ */ jsx("td", {
53
54
  "data-slot": "table-cell",
54
- className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
55
+ className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", "in-data-[variant=settings]:h-11 in-data-[variant=settings]:px-3 in-data-[variant=settings]:py-0 in-data-[variant=settings]:[&>*+*]:ml-1.5 in-data-[variant=settings]:first:pl-0 in-data-[variant=settings]:last:pr-0", className),
55
56
  ...props
56
57
  });
57
58
  }
@@ -11,5 +11,5 @@ import { ThemeProvider as ThemeProvider$1 } from "next-themes";
11
11
  * </ThemeProvider>
12
12
  * ```
13
13
  */
14
- declare function ThemeProvider({ children, ...props }: React.ComponentProps<typeof ThemeProvider$1>): React.JSX.Element;
14
+ declare function ThemeProvider({ children, attribute, defaultTheme, enableSystem, ...props }: React.ComponentProps<typeof ThemeProvider$1>): React.JSX.Element;
15
15
  export { ThemeProvider };
@@ -13,8 +13,11 @@ import { ThemeProvider as ThemeProvider$1 } from "next-themes";
13
13
  * </ThemeProvider>
14
14
  * ```
15
15
  */
16
- function ThemeProvider({ children, ...props }) {
16
+ function ThemeProvider({ children, attribute = "class", defaultTheme = "system", enableSystem = true, ...props }) {
17
17
  return /* @__PURE__ */ jsx(ThemeProvider$1, {
18
+ attribute,
19
+ defaultTheme,
20
+ enableSystem,
18
21
  ...props,
19
22
  children
20
23
  });
@@ -0,0 +1,12 @@
1
+ export type ThemeChoice = 'system' | 'light' | 'dark';
2
+ export type ThemeSettingLabels = {
3
+ group: string;
4
+ system: string;
5
+ light: string;
6
+ dark: string;
7
+ };
8
+ /** System, light or dark as three icon segments; next-themes stores the choice. */
9
+ export declare function ThemeSetting({ labels: labelsProp, className }: {
10
+ labels?: Partial<ThemeSettingLabels>;
11
+ className?: string;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1,66 @@
1
+ "use client";
2
+ import { cn } from "../lib/cn.js";
3
+ import { Tooltip as Tooltip$1, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
4
+ import { useSyncExternalStore } from "react";
5
+ import { RadioGroup } from "radix-ui";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Monitor, Moon, Sun } from "lucide-react";
8
+ import { useTheme } from "next-themes";
9
+ // src/components/theme-setting.tsx
10
+ const DEFAULT_LABELS = {
11
+ group: "Tema",
12
+ system: "Sistema",
13
+ light: "Claro",
14
+ dark: "Escuro"
15
+ };
16
+ const CHOICES = [
17
+ {
18
+ value: "system",
19
+ icon: Monitor
20
+ },
21
+ {
22
+ value: "light",
23
+ icon: Sun
24
+ },
25
+ {
26
+ value: "dark",
27
+ icon: Moon
28
+ }
29
+ ];
30
+ const subscribeNothing = () => () => {};
31
+ /** True once hydrated: next-themes only knows the stored theme in the browser. */
32
+ function useHydrated() {
33
+ return useSyncExternalStore(subscribeNothing, () => true, () => false);
34
+ }
35
+ /** System, light or dark as three icon segments; next-themes stores the choice. */
36
+ function ThemeSetting({ labels: labelsProp, className }) {
37
+ const labels = {
38
+ ...DEFAULT_LABELS,
39
+ ...labelsProp
40
+ };
41
+ const { theme, setTheme } = useTheme();
42
+ const value = useHydrated() ? theme ?? "system" : void 0;
43
+ return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(RadioGroup.Root, {
44
+ "aria-label": labels.group,
45
+ value,
46
+ onValueChange: setTheme,
47
+ orientation: "horizontal",
48
+ className: cn("inline-flex gap-0.5", className),
49
+ children: CHOICES.map(({ value: choice, icon: Icon }) => /* @__PURE__ */ jsxs(Tooltip$1, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
50
+ asChild: true,
51
+ children: /* @__PURE__ */ jsx(RadioGroup.Item, {
52
+ value: choice,
53
+ "aria-label": labels[choice],
54
+ className: "text-muted-foreground hover:text-foreground data-[state=checked]:bg-foreground/10 data-[state=checked]:text-foreground focus-visible:ring-ring/50 flex size-7 cursor-pointer items-center justify-center rounded-sm transition-colors outline-none focus-visible:ring-2",
55
+ children: /* @__PURE__ */ jsx(Icon, {
56
+ "aria-hidden": true,
57
+ className: "size-4"
58
+ })
59
+ })
60
+ }), /* @__PURE__ */ jsx(TooltipContent, {
61
+ side: "bottom",
62
+ children: labels[choice]
63
+ })] }, choice))
64
+ }) });
65
+ }
66
+ export { ThemeSetting };
@@ -4,7 +4,13 @@ import "react";
4
4
  import { Tooltip as Tooltip$1 } from "radix-ui";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  // src/components/tooltip.tsx
7
- function TooltipProvider({ delayDuration = 0, ...props }) {
7
+ /**
8
+ * Hover delay before a tooltip opens: long enough that clicking a button does
9
+ * not flash its tooltip, short enough to still help. Moving between nearby
10
+ * tooltips skips the delay (Radix `skipDelayDuration`).
11
+ */
12
+ const TOOLTIP_DELAY = 500;
13
+ function TooltipProvider({ delayDuration = TOOLTIP_DELAY, ...props }) {
8
14
  return /* @__PURE__ */ jsx(Tooltip$1.Provider, {
9
15
  "data-slot": "tooltip-provider",
10
16
  delayDuration,
@@ -24,4 +24,21 @@ export type UserMenuProps = {
24
24
  * and any links are wired by the consumer — this component is presentation. */
25
25
  children: React.ReactNode;
26
26
  };
27
+ /**
28
+ * Width of the account menu's popup (17rem, 272px — the Claude app's). Apps
29
+ * composing their own account menu (e.g. with a context switcher) use it on
30
+ * their `DropdownMenuContent` so every app's menu has the same size.
31
+ */
32
+ export declare const USER_MENU_WIDTH = "w-68";
33
+ /**
34
+ * Who is signed in, on top of an account menu (name over e-mail, optionally
35
+ * with the avatar). `UserMenu` draws it; apps composing their own account
36
+ * menu put it first in their `DropdownMenuContent`.
37
+ */
38
+ export declare function DropdownMenuAccountHeader({ name, secondary, avatarUrl }: {
39
+ name: string | null;
40
+ secondary?: string | null;
41
+ /** Pass it (even `null`) to show the avatar beside the identity. */
42
+ avatarUrl?: string | null;
43
+ }): React.JSX.Element;
27
44
  export declare function UserMenu({ name, secondary, avatarUrl, triggerLabel, trigger, align, children }: UserMenuProps): React.JSX.Element;
@@ -12,6 +12,39 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
12
  function userMenuInitials(name, secondary) {
13
13
  return initials(name, secondary);
14
14
  }
15
+ /**
16
+ * Width of the account menu's popup (17rem, 272px — the Claude app's). Apps
17
+ * composing their own account menu (e.g. with a context switcher) use it on
18
+ * their `DropdownMenuContent` so every app's menu has the same size.
19
+ */
20
+ const USER_MENU_WIDTH = "w-68";
21
+ /**
22
+ * Who is signed in, on top of an account menu (name over e-mail, optionally
23
+ * with the avatar). `UserMenu` draws it; apps composing their own account
24
+ * menu put it first in their `DropdownMenuContent`.
25
+ */
26
+ function DropdownMenuAccountHeader({ name, secondary = null, avatarUrl }) {
27
+ return /* @__PURE__ */ jsxs(DropdownMenuLabel, {
28
+ "data-slot": "dropdown-menu-account-header",
29
+ className: "flex items-center gap-2 font-normal",
30
+ children: [avatarUrl === void 0 ? null : /* @__PURE__ */ jsxs(Avatar, {
31
+ size: "default",
32
+ children: [avatarUrl ? /* @__PURE__ */ jsx(AvatarImage, {
33
+ src: avatarUrl,
34
+ alt: name ?? secondary ?? ""
35
+ }) : null, /* @__PURE__ */ jsx(AvatarFallback, { children: initials(name, secondary) })]
36
+ }), /* @__PURE__ */ jsxs("span", {
37
+ className: "flex min-w-0 flex-col gap-1",
38
+ children: [name ? /* @__PURE__ */ jsx("span", {
39
+ className: "text-foreground truncate text-sm font-medium",
40
+ children: name
41
+ }) : null, secondary ? /* @__PURE__ */ jsx("span", {
42
+ className: "truncate text-xs",
43
+ children: secondary
44
+ }) : null]
45
+ })]
46
+ });
47
+ }
15
48
  function UserMenu({ name, secondary = null, avatarUrl = null, triggerLabel = "Account", trigger, align = "end", children }) {
16
49
  return /* @__PURE__ */ jsxs(DropdownMenu, {
17
50
  modal: false,
@@ -32,18 +65,12 @@ function UserMenu({ name, secondary = null, avatarUrl = null, triggerLabel = "Ac
32
65
  })
33
66
  }), /* @__PURE__ */ jsxs(DropdownMenuContent, {
34
67
  align,
35
- className: "w-56",
36
- children: [name || secondary ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(DropdownMenuLabel, {
37
- className: "flex flex-col gap-1 font-normal",
38
- children: [name ? /* @__PURE__ */ jsx("span", {
39
- className: "text-sm font-medium",
40
- children: name
41
- }) : null, secondary ? /* @__PURE__ */ jsx("span", {
42
- className: "text-muted-foreground truncate text-xs",
43
- children: secondary
44
- }) : null]
68
+ className: USER_MENU_WIDTH,
69
+ children: [name || secondary ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenuAccountHeader, {
70
+ name,
71
+ secondary
45
72
  }), /* @__PURE__ */ jsx(DropdownMenuSeparator, {})] }) : null, children]
46
73
  })]
47
74
  });
48
75
  }
49
- export { UserMenu, userMenuInitials };
76
+ export { DropdownMenuAccountHeader, USER_MENU_WIDTH, UserMenu, userMenuInitials };
@@ -0,0 +1,36 @@
1
+ import * as React from "react";
2
+ export type AutosaveResult = {
3
+ ok: true;
4
+ } | {
5
+ ok: false;
6
+ error: string;
7
+ };
8
+ export type AutosaveFormOptions = {
9
+ /** Persists the form (e.g. a server action); `ok: false` keeps the field dirty and shows `error`. */
10
+ submit: (formData: FormData) => Promise<AutosaveResult>;
11
+ /** Short confirmation toast after a save ("Negócio atualizado."). */
12
+ successMessage: string;
13
+ /** After a successful save (e.g. the router's refresh). */
14
+ onSaved?: () => void;
15
+ };
16
+ /**
17
+ * Settings fields that save themselves, as in the Claude app — no "Salvar"
18
+ * button: a text field saves when it loses focus or on Enter, Escape undoes
19
+ * the edit, a select/switch saves on change (call `saveSoon`). Nothing is
20
+ * sent when nothing changed; an invalid form (a required field left empty)
21
+ * goes back to the saved values. Spread `formProps` on the `<form>` and give
22
+ * its fields `defaultValue`s.
23
+ */
24
+ export declare function useAutosaveForm({ submit, successMessage, onSaved }: AutosaveFormOptions): {
25
+ /** The last save's error, for the row's description. */
26
+ error: string | null;
27
+ pending: boolean;
28
+ /** Saves after the current event (for selects, switches, pickers). */
29
+ saveSoon: () => void;
30
+ formProps: {
31
+ ref: React.RefObject<HTMLFormElement | null>;
32
+ onBlur: () => void;
33
+ onKeyDown: (event: React.KeyboardEvent<HTMLFormElement>) => void;
34
+ onSubmit: (event: React.FormEvent<HTMLFormElement>) => void;
35
+ };
36
+ };
@@ -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";
@@ -43,20 +43,24 @@ import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, Tabl
43
43
  import { Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, tabsListVariants } from "./components/tabs.js";
44
44
  import { Textarea } from "./components/textarea.js";
45
45
  import { ThemeProvider } from "./components/theme-provider.js";
46
+ import { ThemeChoice, ThemeSetting, ThemeSettingLabels } from "./components/theme-setting.js";
46
47
  import { ThemeToggle, ThemeToggleLabels, ThemeToggleProps } from "./components/theme-toggle.js";
47
48
  import { Typography, typographyVariants } from "./components/typography.js";
49
+ import { AccountSettings, AccountSettingsLabels, SettingsAccount } from "./components/account-settings.js";
48
50
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/collapsible.js";
49
51
  import { Popover, PopoverContent, PopoverTrigger } from "./components/popover.js";
50
52
  import { ScrollArea, ScrollBar } from "./components/scroll-area.js";
51
53
  import { Separator } from "./components/separator.js";
52
54
  import { SettingRow, SettingRowGroup } from "./components/setting-row.js";
53
- import { SettingsDialog, SettingsDialogProps, SettingsDialogSection } from "./components/settings-dialog.js";
55
+ import { SettingsDialog, SettingsDialogLabels, SettingsDialogProps, SettingsDialogSection, SettingsEmpty, SettingsGroup, SettingsItem, matchSections } from "./components/settings-dialog.js";
54
56
  import { SettingsSection } from "./components/settings-section.js";
55
57
  import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./components/sheet.js";
56
58
  import "./components/sidebar.js";
59
+ import { APP_TOOLBAR_HEIGHT, AppToolbar, AppToolbarLabels, PeekSidebar, SidebarPeekProvider, useSidebarPeek } from "./components/sidebar-peek.js";
57
60
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/tooltip.js";
61
+ import { AutosaveFormOptions, AutosaveResult, useAutosaveForm } from "./hooks/use-autosave-form.js";
58
62
  import { ElementSize, useElementSize } from "./hooks/use-element-size.js";
59
63
  import { HashSection, useHashSection } from "./hooks/use-hash-section.js";
60
64
  import { useIsMobile } from "./hooks/use-mobile.js";
61
65
  import { ScrollStripEdges, useScrollStrip } from "./hooks/use-scroll-strip.js";
62
- 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, Container, type ContainerProps, 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, PageHeader, type PageHeaderProps, PageHeaderSkeleton, type PageHeaderSkeletonProps, 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, ThemeToggle, type ThemeToggleLabels, type ThemeToggleProps, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, UserMenu, type UserMenuProps, WhatsappIcon, badgeVariants, buttonGroupVariants, buttonVariants, cn, containerVariants, 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";
@@ -40,21 +40,25 @@ import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, Tabl
40
40
  import { Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, tabsListVariants } from "./components/tabs.js";
41
41
  import { Textarea } from "./components/textarea.js";
42
42
  import { ThemeProvider } from "./components/theme-provider.js";
43
+ import { ThemeSetting } from "./components/theme-setting.js";
43
44
  import { ThemeToggle } from "./components/theme-toggle.js";
44
45
  import { Typography, typographyVariants } from "./components/typography.js";
46
+ import { AccountSettings } from "./components/account-settings.js";
45
47
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/collapsible.js";
46
48
  import { Popover, PopoverContent, PopoverTrigger } from "./components/popover.js";
47
49
  import { ScrollArea, ScrollBar } from "./components/scroll-area.js";
48
50
  import { Separator } from "./components/separator.js";
49
51
  import { SettingRow, SettingRowGroup } from "./components/setting-row.js";
50
- import { SettingsDialog } from "./components/settings-dialog.js";
52
+ import { SettingsDialog, SettingsEmpty, SettingsGroup, SettingsItem, matchSections } from "./components/settings-dialog.js";
51
53
  import { SettingsSection } from "./components/settings-section.js";
52
54
  import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./components/sheet.js";
53
55
  import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarInput, SidebarInset, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar } from "./components/sidebar-core.js";
54
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";
55
58
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/tooltip.js";
59
+ import { useAutosaveForm } from "./hooks/use-autosave-form.js";
56
60
  import { useElementSize } from "./hooks/use-element-size.js";
57
61
  import { useHashSection } from "./hooks/use-hash-section.js";
58
62
  import { useIsMobile } from "./hooks/use-mobile.js";
59
63
  import { useScrollStrip } from "./hooks/use-scroll-strip.js";
60
- 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, Container, 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, PageHeader, PageHeaderSkeleton, 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, ThemeToggle, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, UserMenu, WhatsappIcon, badgeVariants, buttonGroupVariants, buttonVariants, cn, containerVariants, 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.9.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",