@loykin/designkit 0.0.1-dev.2 → 0.0.1-dev.3
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 +66 -8
- package/dist/index.cjs +261 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +61 -2
- package/dist/index.d.ts +61 -2
- package/dist/index.js +261 -18
- package/dist/index.js.map +1 -1
- package/dist/styles.css +2 -77
- package/package.json +5 -3
package/dist/index.d.cts
CHANGED
|
@@ -237,7 +237,7 @@ declare function TabsContent({ className, ...props }: Tabs$2.Panel.Props): react
|
|
|
237
237
|
|
|
238
238
|
type ShellId = 'sidebar' | 'header';
|
|
239
239
|
type DensityId = 'compact' | 'default' | 'comfortable';
|
|
240
|
-
type TemplateId = 'table' | 'table-infinity' | 'table-drag' | 'table-card' | 'table-card-list' | 'tabbed' | 'form' | 'form-stacked' | 'form-wizard' | 'form-inline' | 'databody' | 'databody-detail' | 'databody-split' | 'sectioned' | 'typography' | 'colors' | 'login' | 'login-forgot' | 'login-reset' | 'login-otp' | 'dashboard' | 'browse' | 'detail' | 'detail-record' | 'detail-full';
|
|
240
|
+
type TemplateId = 'table' | 'table-infinity' | 'table-drag' | 'table-card' | 'table-card-list' | 'tabbed' | 'form' | 'form-stacked' | 'form-wizard' | 'form-inline' | 'databody' | 'databody-detail' | 'databody-split' | 'sectioned' | 'typography' | 'colors' | 'login' | 'login-forgot' | 'login-reset' | 'login-otp' | 'dashboard' | 'workbench-panel-editor' | 'workbench-sql-editor' | 'workbench-agent-chat' | 'browse' | 'detail' | 'detail-record' | 'detail-full' | 'list-detail';
|
|
241
241
|
interface GlobalTheme {
|
|
242
242
|
radius: number;
|
|
243
243
|
primaryHue: number;
|
|
@@ -294,6 +294,43 @@ interface DashboardBodyTemplateProps {
|
|
|
294
294
|
}
|
|
295
295
|
declare function DashboardBodyTemplate({ theme, className, title, description, topBar, toolbar, variableBar, children, contentClassName, }: DashboardBodyTemplateProps): react_jsx_runtime.JSX.Element;
|
|
296
296
|
|
|
297
|
+
interface WorkbenchBodyTemplateProps {
|
|
298
|
+
theme?: CSSProperties;
|
|
299
|
+
className?: string;
|
|
300
|
+
contentClassName?: string;
|
|
301
|
+
title?: ReactNode;
|
|
302
|
+
description?: ReactNode;
|
|
303
|
+
topBar?: ReactNode;
|
|
304
|
+
/** Right side of the built-in workbench header. Prefer this over toolbar for new code. */
|
|
305
|
+
headerRight?: ReactNode;
|
|
306
|
+
/** @deprecated Use headerRight. */
|
|
307
|
+
toolbar?: ReactNode;
|
|
308
|
+
actions?: ReactNode;
|
|
309
|
+
leftPane?: ReactNode;
|
|
310
|
+
mainPane?: ReactNode;
|
|
311
|
+
rightPane?: ReactNode;
|
|
312
|
+
bottomPane?: ReactNode;
|
|
313
|
+
children?: ReactNode;
|
|
314
|
+
resizable?: boolean;
|
|
315
|
+
leftPaneCollapsed?: boolean;
|
|
316
|
+
rightPaneCollapsed?: boolean;
|
|
317
|
+
bottomPaneCollapsed?: boolean;
|
|
318
|
+
leftPaneWidth?: number;
|
|
319
|
+
rightPaneWidth?: number;
|
|
320
|
+
bottomPaneHeight?: number;
|
|
321
|
+
minLeftPaneWidth?: number;
|
|
322
|
+
maxLeftPaneWidth?: number;
|
|
323
|
+
minRightPaneWidth?: number;
|
|
324
|
+
maxRightPaneWidth?: number;
|
|
325
|
+
minBottomPaneHeight?: number;
|
|
326
|
+
maxBottomPaneHeight?: number;
|
|
327
|
+
leftPaneClassName?: string;
|
|
328
|
+
mainPaneClassName?: string;
|
|
329
|
+
rightPaneClassName?: string;
|
|
330
|
+
bottomPaneClassName?: string;
|
|
331
|
+
}
|
|
332
|
+
declare function WorkbenchBodyTemplate({ theme, className, contentClassName, title, description, topBar, headerRight, toolbar, actions, leftPane, mainPane, rightPane, bottomPane, children, resizable, leftPaneCollapsed, rightPaneCollapsed, bottomPaneCollapsed, leftPaneWidth, rightPaneWidth, bottomPaneHeight, minLeftPaneWidth, maxLeftPaneWidth, minRightPaneWidth, maxRightPaneWidth, minBottomPaneHeight, maxBottomPaneHeight, leftPaneClassName, mainPaneClassName, rightPaneClassName, bottomPaneClassName, }: WorkbenchBodyTemplateProps): react_jsx_runtime.JSX.Element;
|
|
333
|
+
|
|
297
334
|
interface DataBodyTabProps {
|
|
298
335
|
id: string;
|
|
299
336
|
label: React__default.ReactNode;
|
|
@@ -328,6 +365,7 @@ interface DataBodyGroupProps {
|
|
|
328
365
|
description?: React__default.ReactNode;
|
|
329
366
|
actions?: React__default.ReactNode;
|
|
330
367
|
danger?: boolean;
|
|
368
|
+
className?: string;
|
|
331
369
|
children?: React__default.ReactNode;
|
|
332
370
|
}
|
|
333
371
|
declare function DataBodyGroup(props: DataBodyGroupProps): react_jsx_runtime.JSX.Element;
|
|
@@ -443,6 +481,26 @@ declare const DetailBodyTemplate: typeof DetailBodyTemplateRoot & {
|
|
|
443
481
|
Section: typeof DetailBodySection;
|
|
444
482
|
};
|
|
445
483
|
|
|
484
|
+
interface ListDetailBodyTemplateProps {
|
|
485
|
+
theme?: CSSProperties;
|
|
486
|
+
className?: string;
|
|
487
|
+
topBar?: ReactNode;
|
|
488
|
+
/** List pane content — typically a DataGrid, DataGridList, or navigation list */
|
|
489
|
+
list: ReactNode;
|
|
490
|
+
/**
|
|
491
|
+
* Detail pane content. When undefined, `emptyDetail` is shown on desktop
|
|
492
|
+
* and the list pane fills the screen on mobile.
|
|
493
|
+
*/
|
|
494
|
+
detail?: ReactNode;
|
|
495
|
+
/** Placeholder rendered in the detail pane when nothing is selected */
|
|
496
|
+
emptyDetail?: ReactNode;
|
|
497
|
+
/** Width of the list pane in px. Default: 320 */
|
|
498
|
+
listWidth?: number;
|
|
499
|
+
listClassName?: string;
|
|
500
|
+
detailClassName?: string;
|
|
501
|
+
}
|
|
502
|
+
declare function ListDetailBodyTemplate({ theme, className, topBar, list, detail, emptyDetail, listWidth, listClassName, detailClassName, }: ListDetailBodyTemplateProps): react_jsx_runtime.JSX.Element;
|
|
503
|
+
|
|
446
504
|
type FormWizardVariant = 'card' | 'plain';
|
|
447
505
|
interface FormWizardStep {
|
|
448
506
|
key: string;
|
|
@@ -627,6 +685,7 @@ declare function buildTemplateTheme(g: {
|
|
|
627
685
|
radius: number;
|
|
628
686
|
primaryHue: number;
|
|
629
687
|
primaryChroma: number;
|
|
688
|
+
darkMode?: boolean;
|
|
630
689
|
density?: DensityId;
|
|
631
690
|
fontScale?: number;
|
|
632
691
|
lineHeight?: number;
|
|
@@ -643,4 +702,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
643
702
|
|
|
644
703
|
declare const useThemeStore: zustand.UseBoundStore<zustand.StoreApi<ThemeState>>;
|
|
645
704
|
|
|
646
|
-
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BrowseBodyTemplate, type BrowseBodyTemplateProps, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColorsBodyTemplate, type ColorsBodyTemplateProps, DashboardBodyTemplate, type DashboardBodyTemplateProps, DashboardPanel, type DashboardPanelProps, type DataBodyBodyProps, type DataBodyFieldProps, type DataBodyGroupProps, type DataBodyRowProps, type DataBodySectionProps, type DataBodySummaryProps, type DataBodyTabProps, DataBodyTemplate, type DataBodyTemplateProps, DataPage, type DataPageActionsProps, type DataPageContentProps, type DataPageFooterProps, type DataPageGroupBodyProps, type DataPageGroupHeaderProps, type DataPageGroupProps, type DataPageGroupToolbarProps, type DataPageHeaderProps, type DataPageProps, type DataPageTabProps, type DataPageTabsProps, type DataPageTitleBlockProps, type DensityId, type DetailBodyHeaderProps, type DetailBodySectionProps, type DetailBodyTabProps, DetailBodyTemplate, type DetailBodyTemplateProps, type DetailBodyVariant, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateAction, type EmptyStateProps, FormWizardBodyTemplate, type FormWizardBodyTemplateProps, type FormWizardStep, type FormWizardVariant, type GlobalTheme, type GroupLayout, type GroupVariant, Input, Label, type LoginBg, LoginBodyTemplate, type LoginBodyTemplateProps, type LoginCard, type LoginCardWidth, type LoginLayout, type LoginSide, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, PageBreadcrumb, type PageBreadcrumbItem, PageTopBar, type PageTopBarProps, type PageTopBarVariant, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, type ShellId, 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, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs$1 as Tabs, TabsContent, TabsList, TabsTrigger, type TemplateId, type TemplateNavigationGroup, type TemplateNavigationItem, type TemplateOverride, type ThemeState, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypographyBodyTemplate, type TypographyBodyTemplateProps, badgeVariants, buildTemplateTheme, buildTopBar, buttonVariants, cn, navigationMenuTriggerStyle, tabsListVariants, useIsMobile, useSidebar, useStyleInjector, useThemeStore };
|
|
705
|
+
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BrowseBodyTemplate, type BrowseBodyTemplateProps, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColorsBodyTemplate, type ColorsBodyTemplateProps, DashboardBodyTemplate, type DashboardBodyTemplateProps, DashboardPanel, type DashboardPanelProps, type DataBodyBodyProps, type DataBodyFieldProps, type DataBodyGroupProps, type DataBodyRowProps, type DataBodySectionProps, type DataBodySummaryProps, type DataBodyTabProps, DataBodyTemplate, type DataBodyTemplateProps, DataPage, type DataPageActionsProps, type DataPageContentProps, type DataPageFooterProps, type DataPageGroupBodyProps, type DataPageGroupHeaderProps, type DataPageGroupProps, type DataPageGroupToolbarProps, type DataPageHeaderProps, type DataPageProps, type DataPageTabProps, type DataPageTabsProps, type DataPageTitleBlockProps, type DensityId, type DetailBodyHeaderProps, type DetailBodySectionProps, type DetailBodyTabProps, DetailBodyTemplate, type DetailBodyTemplateProps, type DetailBodyVariant, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateAction, type EmptyStateProps, FormWizardBodyTemplate, type FormWizardBodyTemplateProps, type FormWizardStep, type FormWizardVariant, type GlobalTheme, type GroupLayout, type GroupVariant, Input, Label, ListDetailBodyTemplate, type ListDetailBodyTemplateProps, type LoginBg, LoginBodyTemplate, type LoginBodyTemplateProps, type LoginCard, type LoginCardWidth, type LoginLayout, type LoginSide, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, PageBreadcrumb, type PageBreadcrumbItem, PageTopBar, type PageTopBarProps, type PageTopBarVariant, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, type ShellId, 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, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs$1 as Tabs, TabsContent, TabsList, TabsTrigger, type TemplateId, type TemplateNavigationGroup, type TemplateNavigationItem, type TemplateOverride, type ThemeState, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypographyBodyTemplate, type TypographyBodyTemplateProps, WorkbenchBodyTemplate, type WorkbenchBodyTemplateProps, badgeVariants, buildTemplateTheme, buildTopBar, buttonVariants, cn, navigationMenuTriggerStyle, tabsListVariants, useIsMobile, useSidebar, useStyleInjector, useThemeStore };
|
package/dist/index.d.ts
CHANGED
|
@@ -237,7 +237,7 @@ declare function TabsContent({ className, ...props }: Tabs$2.Panel.Props): react
|
|
|
237
237
|
|
|
238
238
|
type ShellId = 'sidebar' | 'header';
|
|
239
239
|
type DensityId = 'compact' | 'default' | 'comfortable';
|
|
240
|
-
type TemplateId = 'table' | 'table-infinity' | 'table-drag' | 'table-card' | 'table-card-list' | 'tabbed' | 'form' | 'form-stacked' | 'form-wizard' | 'form-inline' | 'databody' | 'databody-detail' | 'databody-split' | 'sectioned' | 'typography' | 'colors' | 'login' | 'login-forgot' | 'login-reset' | 'login-otp' | 'dashboard' | 'browse' | 'detail' | 'detail-record' | 'detail-full';
|
|
240
|
+
type TemplateId = 'table' | 'table-infinity' | 'table-drag' | 'table-card' | 'table-card-list' | 'tabbed' | 'form' | 'form-stacked' | 'form-wizard' | 'form-inline' | 'databody' | 'databody-detail' | 'databody-split' | 'sectioned' | 'typography' | 'colors' | 'login' | 'login-forgot' | 'login-reset' | 'login-otp' | 'dashboard' | 'workbench-panel-editor' | 'workbench-sql-editor' | 'workbench-agent-chat' | 'browse' | 'detail' | 'detail-record' | 'detail-full' | 'list-detail';
|
|
241
241
|
interface GlobalTheme {
|
|
242
242
|
radius: number;
|
|
243
243
|
primaryHue: number;
|
|
@@ -294,6 +294,43 @@ interface DashboardBodyTemplateProps {
|
|
|
294
294
|
}
|
|
295
295
|
declare function DashboardBodyTemplate({ theme, className, title, description, topBar, toolbar, variableBar, children, contentClassName, }: DashboardBodyTemplateProps): react_jsx_runtime.JSX.Element;
|
|
296
296
|
|
|
297
|
+
interface WorkbenchBodyTemplateProps {
|
|
298
|
+
theme?: CSSProperties;
|
|
299
|
+
className?: string;
|
|
300
|
+
contentClassName?: string;
|
|
301
|
+
title?: ReactNode;
|
|
302
|
+
description?: ReactNode;
|
|
303
|
+
topBar?: ReactNode;
|
|
304
|
+
/** Right side of the built-in workbench header. Prefer this over toolbar for new code. */
|
|
305
|
+
headerRight?: ReactNode;
|
|
306
|
+
/** @deprecated Use headerRight. */
|
|
307
|
+
toolbar?: ReactNode;
|
|
308
|
+
actions?: ReactNode;
|
|
309
|
+
leftPane?: ReactNode;
|
|
310
|
+
mainPane?: ReactNode;
|
|
311
|
+
rightPane?: ReactNode;
|
|
312
|
+
bottomPane?: ReactNode;
|
|
313
|
+
children?: ReactNode;
|
|
314
|
+
resizable?: boolean;
|
|
315
|
+
leftPaneCollapsed?: boolean;
|
|
316
|
+
rightPaneCollapsed?: boolean;
|
|
317
|
+
bottomPaneCollapsed?: boolean;
|
|
318
|
+
leftPaneWidth?: number;
|
|
319
|
+
rightPaneWidth?: number;
|
|
320
|
+
bottomPaneHeight?: number;
|
|
321
|
+
minLeftPaneWidth?: number;
|
|
322
|
+
maxLeftPaneWidth?: number;
|
|
323
|
+
minRightPaneWidth?: number;
|
|
324
|
+
maxRightPaneWidth?: number;
|
|
325
|
+
minBottomPaneHeight?: number;
|
|
326
|
+
maxBottomPaneHeight?: number;
|
|
327
|
+
leftPaneClassName?: string;
|
|
328
|
+
mainPaneClassName?: string;
|
|
329
|
+
rightPaneClassName?: string;
|
|
330
|
+
bottomPaneClassName?: string;
|
|
331
|
+
}
|
|
332
|
+
declare function WorkbenchBodyTemplate({ theme, className, contentClassName, title, description, topBar, headerRight, toolbar, actions, leftPane, mainPane, rightPane, bottomPane, children, resizable, leftPaneCollapsed, rightPaneCollapsed, bottomPaneCollapsed, leftPaneWidth, rightPaneWidth, bottomPaneHeight, minLeftPaneWidth, maxLeftPaneWidth, minRightPaneWidth, maxRightPaneWidth, minBottomPaneHeight, maxBottomPaneHeight, leftPaneClassName, mainPaneClassName, rightPaneClassName, bottomPaneClassName, }: WorkbenchBodyTemplateProps): react_jsx_runtime.JSX.Element;
|
|
333
|
+
|
|
297
334
|
interface DataBodyTabProps {
|
|
298
335
|
id: string;
|
|
299
336
|
label: React__default.ReactNode;
|
|
@@ -328,6 +365,7 @@ interface DataBodyGroupProps {
|
|
|
328
365
|
description?: React__default.ReactNode;
|
|
329
366
|
actions?: React__default.ReactNode;
|
|
330
367
|
danger?: boolean;
|
|
368
|
+
className?: string;
|
|
331
369
|
children?: React__default.ReactNode;
|
|
332
370
|
}
|
|
333
371
|
declare function DataBodyGroup(props: DataBodyGroupProps): react_jsx_runtime.JSX.Element;
|
|
@@ -443,6 +481,26 @@ declare const DetailBodyTemplate: typeof DetailBodyTemplateRoot & {
|
|
|
443
481
|
Section: typeof DetailBodySection;
|
|
444
482
|
};
|
|
445
483
|
|
|
484
|
+
interface ListDetailBodyTemplateProps {
|
|
485
|
+
theme?: CSSProperties;
|
|
486
|
+
className?: string;
|
|
487
|
+
topBar?: ReactNode;
|
|
488
|
+
/** List pane content — typically a DataGrid, DataGridList, or navigation list */
|
|
489
|
+
list: ReactNode;
|
|
490
|
+
/**
|
|
491
|
+
* Detail pane content. When undefined, `emptyDetail` is shown on desktop
|
|
492
|
+
* and the list pane fills the screen on mobile.
|
|
493
|
+
*/
|
|
494
|
+
detail?: ReactNode;
|
|
495
|
+
/** Placeholder rendered in the detail pane when nothing is selected */
|
|
496
|
+
emptyDetail?: ReactNode;
|
|
497
|
+
/** Width of the list pane in px. Default: 320 */
|
|
498
|
+
listWidth?: number;
|
|
499
|
+
listClassName?: string;
|
|
500
|
+
detailClassName?: string;
|
|
501
|
+
}
|
|
502
|
+
declare function ListDetailBodyTemplate({ theme, className, topBar, list, detail, emptyDetail, listWidth, listClassName, detailClassName, }: ListDetailBodyTemplateProps): react_jsx_runtime.JSX.Element;
|
|
503
|
+
|
|
446
504
|
type FormWizardVariant = 'card' | 'plain';
|
|
447
505
|
interface FormWizardStep {
|
|
448
506
|
key: string;
|
|
@@ -627,6 +685,7 @@ declare function buildTemplateTheme(g: {
|
|
|
627
685
|
radius: number;
|
|
628
686
|
primaryHue: number;
|
|
629
687
|
primaryChroma: number;
|
|
688
|
+
darkMode?: boolean;
|
|
630
689
|
density?: DensityId;
|
|
631
690
|
fontScale?: number;
|
|
632
691
|
lineHeight?: number;
|
|
@@ -643,4 +702,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
643
702
|
|
|
644
703
|
declare const useThemeStore: zustand.UseBoundStore<zustand.StoreApi<ThemeState>>;
|
|
645
704
|
|
|
646
|
-
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BrowseBodyTemplate, type BrowseBodyTemplateProps, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColorsBodyTemplate, type ColorsBodyTemplateProps, DashboardBodyTemplate, type DashboardBodyTemplateProps, DashboardPanel, type DashboardPanelProps, type DataBodyBodyProps, type DataBodyFieldProps, type DataBodyGroupProps, type DataBodyRowProps, type DataBodySectionProps, type DataBodySummaryProps, type DataBodyTabProps, DataBodyTemplate, type DataBodyTemplateProps, DataPage, type DataPageActionsProps, type DataPageContentProps, type DataPageFooterProps, type DataPageGroupBodyProps, type DataPageGroupHeaderProps, type DataPageGroupProps, type DataPageGroupToolbarProps, type DataPageHeaderProps, type DataPageProps, type DataPageTabProps, type DataPageTabsProps, type DataPageTitleBlockProps, type DensityId, type DetailBodyHeaderProps, type DetailBodySectionProps, type DetailBodyTabProps, DetailBodyTemplate, type DetailBodyTemplateProps, type DetailBodyVariant, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateAction, type EmptyStateProps, FormWizardBodyTemplate, type FormWizardBodyTemplateProps, type FormWizardStep, type FormWizardVariant, type GlobalTheme, type GroupLayout, type GroupVariant, Input, Label, type LoginBg, LoginBodyTemplate, type LoginBodyTemplateProps, type LoginCard, type LoginCardWidth, type LoginLayout, type LoginSide, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, PageBreadcrumb, type PageBreadcrumbItem, PageTopBar, type PageTopBarProps, type PageTopBarVariant, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, type ShellId, 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, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs$1 as Tabs, TabsContent, TabsList, TabsTrigger, type TemplateId, type TemplateNavigationGroup, type TemplateNavigationItem, type TemplateOverride, type ThemeState, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypographyBodyTemplate, type TypographyBodyTemplateProps, badgeVariants, buildTemplateTheme, buildTopBar, buttonVariants, cn, navigationMenuTriggerStyle, tabsListVariants, useIsMobile, useSidebar, useStyleInjector, useThemeStore };
|
|
705
|
+
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BrowseBodyTemplate, type BrowseBodyTemplateProps, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColorsBodyTemplate, type ColorsBodyTemplateProps, DashboardBodyTemplate, type DashboardBodyTemplateProps, DashboardPanel, type DashboardPanelProps, type DataBodyBodyProps, type DataBodyFieldProps, type DataBodyGroupProps, type DataBodyRowProps, type DataBodySectionProps, type DataBodySummaryProps, type DataBodyTabProps, DataBodyTemplate, type DataBodyTemplateProps, DataPage, type DataPageActionsProps, type DataPageContentProps, type DataPageFooterProps, type DataPageGroupBodyProps, type DataPageGroupHeaderProps, type DataPageGroupProps, type DataPageGroupToolbarProps, type DataPageHeaderProps, type DataPageProps, type DataPageTabProps, type DataPageTabsProps, type DataPageTitleBlockProps, type DensityId, type DetailBodyHeaderProps, type DetailBodySectionProps, type DetailBodyTabProps, DetailBodyTemplate, type DetailBodyTemplateProps, type DetailBodyVariant, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateAction, type EmptyStateProps, FormWizardBodyTemplate, type FormWizardBodyTemplateProps, type FormWizardStep, type FormWizardVariant, type GlobalTheme, type GroupLayout, type GroupVariant, Input, Label, ListDetailBodyTemplate, type ListDetailBodyTemplateProps, type LoginBg, LoginBodyTemplate, type LoginBodyTemplateProps, type LoginCard, type LoginCardWidth, type LoginLayout, type LoginSide, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, PageBreadcrumb, type PageBreadcrumbItem, PageTopBar, type PageTopBarProps, type PageTopBarVariant, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, type ShellId, 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, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs$1 as Tabs, TabsContent, TabsList, TabsTrigger, type TemplateId, type TemplateNavigationGroup, type TemplateNavigationItem, type TemplateOverride, type ThemeState, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypographyBodyTemplate, type TypographyBodyTemplateProps, WorkbenchBodyTemplate, type WorkbenchBodyTemplateProps, badgeVariants, buildTemplateTheme, buildTopBar, buttonVariants, cn, navigationMenuTriggerStyle, tabsListVariants, useIsMobile, useSidebar, useStyleInjector, useThemeStore };
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { Select as Select$1 } from '@base-ui/react/select';
|
|
|
17
17
|
import { Separator as Separator$1 } from '@base-ui/react/separator';
|
|
18
18
|
import { Dialog } from '@base-ui/react/dialog';
|
|
19
19
|
import * as React2 from 'react';
|
|
20
|
-
import React2__default, { forwardRef, useMemo, Children, useState, Fragment, useEffect } from 'react';
|
|
20
|
+
import React2__default, { forwardRef, useMemo, Children, useState, Fragment, useCallback, useEffect } from 'react';
|
|
21
21
|
import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
|
|
22
22
|
import { Slider as Slider$1 } from '@base-ui/react/slider';
|
|
23
23
|
import { Switch as Switch$1 } from '@base-ui/react/switch';
|
|
@@ -112,7 +112,11 @@ function AvatarGroupCount({ className, ...props }) {
|
|
|
112
112
|
);
|
|
113
113
|
}
|
|
114
114
|
var badgeVariants = cva(
|
|
115
|
-
|
|
115
|
+
// transition-all is replaced with an explicit list to prevent width animation
|
|
116
|
+
// on font swap (e.g. font-display:swap triggering a layout recalc). Inside
|
|
117
|
+
// overflow:clip containers like DataGrid cells, an animated width change makes
|
|
118
|
+
// the pill appear to grow from a clipped state. Color transitions are preserved.
|
|
119
|
+
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,opacity] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
|
|
116
120
|
{
|
|
117
121
|
variants: {
|
|
118
122
|
variant: {
|
|
@@ -2195,6 +2199,194 @@ function DashboardBodyTemplate({
|
|
|
2195
2199
|
/* @__PURE__ */ jsx("div", { className: cn("flex-1 min-h-0 overflow-auto px-[calc(var(--dk-page-padding-x)-0.5rem)] pt-0 pb-(--dk-page-padding-y)", contentClassName), children })
|
|
2196
2200
|
] });
|
|
2197
2201
|
}
|
|
2202
|
+
function clamp(value, min, max) {
|
|
2203
|
+
return Math.min(Math.max(value, min), max);
|
|
2204
|
+
}
|
|
2205
|
+
function ResizeHandle({
|
|
2206
|
+
axis,
|
|
2207
|
+
onPointerDown,
|
|
2208
|
+
className
|
|
2209
|
+
}) {
|
|
2210
|
+
return /* @__PURE__ */ jsxs(
|
|
2211
|
+
"div",
|
|
2212
|
+
{
|
|
2213
|
+
role: "separator",
|
|
2214
|
+
"aria-orientation": axis === "x" ? "vertical" : "horizontal",
|
|
2215
|
+
className: cn(
|
|
2216
|
+
"group/resize relative z-10 shrink-0 touch-none bg-transparent",
|
|
2217
|
+
axis === "x" ? "-mx-1 w-2 cursor-col-resize" : "-my-1 h-2 cursor-row-resize",
|
|
2218
|
+
className
|
|
2219
|
+
),
|
|
2220
|
+
onPointerDown,
|
|
2221
|
+
children: [
|
|
2222
|
+
/* @__PURE__ */ jsx(
|
|
2223
|
+
"div",
|
|
2224
|
+
{
|
|
2225
|
+
className: cn(
|
|
2226
|
+
"absolute bg-border transition-colors group-hover/resize:bg-muted-foreground/40",
|
|
2227
|
+
axis === "x" ? "left-1/2 top-0 h-full w-px -translate-x-1/2" : "left-0 top-1/2 h-px w-full -translate-y-1/2"
|
|
2228
|
+
)
|
|
2229
|
+
}
|
|
2230
|
+
),
|
|
2231
|
+
/* @__PURE__ */ jsx(
|
|
2232
|
+
"div",
|
|
2233
|
+
{
|
|
2234
|
+
className: cn(
|
|
2235
|
+
"absolute rounded-full bg-muted-foreground/35 opacity-0 transition-opacity group-hover/resize:opacity-100",
|
|
2236
|
+
axis === "x" ? "left-1/2 top-1/2 h-10 w-1 -translate-x-1/2 -translate-y-1/2" : "left-1/2 top-1/2 h-1 w-10 -translate-x-1/2 -translate-y-1/2"
|
|
2237
|
+
)
|
|
2238
|
+
}
|
|
2239
|
+
)
|
|
2240
|
+
]
|
|
2241
|
+
}
|
|
2242
|
+
);
|
|
2243
|
+
}
|
|
2244
|
+
function WorkbenchBodyTemplate({
|
|
2245
|
+
theme,
|
|
2246
|
+
className,
|
|
2247
|
+
contentClassName,
|
|
2248
|
+
title,
|
|
2249
|
+
description,
|
|
2250
|
+
topBar,
|
|
2251
|
+
headerRight,
|
|
2252
|
+
toolbar,
|
|
2253
|
+
actions,
|
|
2254
|
+
leftPane,
|
|
2255
|
+
mainPane,
|
|
2256
|
+
rightPane,
|
|
2257
|
+
bottomPane,
|
|
2258
|
+
children,
|
|
2259
|
+
resizable = true,
|
|
2260
|
+
leftPaneCollapsed,
|
|
2261
|
+
rightPaneCollapsed,
|
|
2262
|
+
bottomPaneCollapsed,
|
|
2263
|
+
leftPaneWidth = 260,
|
|
2264
|
+
rightPaneWidth = 320,
|
|
2265
|
+
bottomPaneHeight = 240,
|
|
2266
|
+
minLeftPaneWidth = 180,
|
|
2267
|
+
maxLeftPaneWidth = 440,
|
|
2268
|
+
minRightPaneWidth = 240,
|
|
2269
|
+
maxRightPaneWidth = 520,
|
|
2270
|
+
minBottomPaneHeight = 120,
|
|
2271
|
+
maxBottomPaneHeight = 420,
|
|
2272
|
+
leftPaneClassName,
|
|
2273
|
+
mainPaneClassName,
|
|
2274
|
+
rightPaneClassName,
|
|
2275
|
+
bottomPaneClassName
|
|
2276
|
+
}) {
|
|
2277
|
+
const [leftWidth, setLeftWidth] = useState(leftPaneWidth);
|
|
2278
|
+
const [rightWidth, setRightWidth] = useState(rightPaneWidth);
|
|
2279
|
+
const [bottomHeight, setBottomHeight] = useState(bottomPaneHeight);
|
|
2280
|
+
const startResize = useCallback((event, axis, applyDelta) => {
|
|
2281
|
+
if (!resizable) return;
|
|
2282
|
+
const start = axis === "x" ? event.clientX : event.clientY;
|
|
2283
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
2284
|
+
const previousCursor = document.body.style.cursor;
|
|
2285
|
+
const previousUserSelect = document.body.style.userSelect;
|
|
2286
|
+
document.body.style.cursor = axis === "x" ? "col-resize" : "row-resize";
|
|
2287
|
+
document.body.style.userSelect = "none";
|
|
2288
|
+
const onPointerMove = (moveEvent) => {
|
|
2289
|
+
applyDelta((axis === "x" ? moveEvent.clientX : moveEvent.clientY) - start);
|
|
2290
|
+
};
|
|
2291
|
+
const onPointerUp = () => {
|
|
2292
|
+
document.body.style.cursor = previousCursor;
|
|
2293
|
+
document.body.style.userSelect = previousUserSelect;
|
|
2294
|
+
window.removeEventListener("pointermove", onPointerMove);
|
|
2295
|
+
window.removeEventListener("pointerup", onPointerUp);
|
|
2296
|
+
};
|
|
2297
|
+
window.addEventListener("pointermove", onPointerMove);
|
|
2298
|
+
window.addEventListener("pointerup", onPointerUp, { once: true });
|
|
2299
|
+
}, [resizable]);
|
|
2300
|
+
const headerRightContent = headerRight ?? toolbar;
|
|
2301
|
+
const showHeader = title || description || headerRightContent || actions;
|
|
2302
|
+
const showLeftPane = leftPane && !leftPaneCollapsed;
|
|
2303
|
+
const showRightPane = rightPane && !rightPaneCollapsed;
|
|
2304
|
+
const showBottomPane = bottomPane && !bottomPaneCollapsed;
|
|
2305
|
+
return /* @__PURE__ */ jsxs(DataPage, { className: cn("layout-workbench", className), style: theme, children: [
|
|
2306
|
+
topBar && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: topBar }),
|
|
2307
|
+
showHeader && /* @__PURE__ */ jsx("header", { className: "shrink-0 border-b px-(--dk-page-padding-x) py-[calc(var(--dk-page-padding-y)*0.75)]", children: /* @__PURE__ */ jsxs("div", { className: "flex min-h-[var(--dk-toolbar-height)] items-center justify-between gap-3", children: [
|
|
2308
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
2309
|
+
title && /* @__PURE__ */ jsx("h1", { className: "truncate text-sm font-semibold", children: title }),
|
|
2310
|
+
description && /* @__PURE__ */ jsx("p", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: description })
|
|
2311
|
+
] }),
|
|
2312
|
+
(headerRightContent || actions) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
2313
|
+
headerRightContent,
|
|
2314
|
+
actions
|
|
2315
|
+
] })
|
|
2316
|
+
] }) }),
|
|
2317
|
+
/* @__PURE__ */ jsxs("div", { className: cn("flex min-h-0 flex-1 overflow-hidden", contentClassName), children: [
|
|
2318
|
+
showLeftPane && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2319
|
+
/* @__PURE__ */ jsx(
|
|
2320
|
+
"aside",
|
|
2321
|
+
{
|
|
2322
|
+
className: cn("min-h-0 shrink-0 overflow-hidden border-r bg-card/45", leftPaneClassName),
|
|
2323
|
+
style: { width: leftWidth },
|
|
2324
|
+
children: leftPane
|
|
2325
|
+
}
|
|
2326
|
+
),
|
|
2327
|
+
resizable && /* @__PURE__ */ jsx(
|
|
2328
|
+
ResizeHandle,
|
|
2329
|
+
{
|
|
2330
|
+
axis: "x",
|
|
2331
|
+
onPointerDown: (event) => {
|
|
2332
|
+
const start = leftWidth;
|
|
2333
|
+
startResize(event, "x", (delta) => {
|
|
2334
|
+
setLeftWidth(clamp(start + delta, minLeftPaneWidth, maxLeftPaneWidth));
|
|
2335
|
+
});
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
)
|
|
2339
|
+
] }),
|
|
2340
|
+
/* @__PURE__ */ jsxs("main", { className: cn("flex min-w-0 flex-1 flex-col overflow-hidden", mainPaneClassName), children: [
|
|
2341
|
+
/* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-hidden", children: mainPane ?? children }),
|
|
2342
|
+
showBottomPane && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2343
|
+
resizable && /* @__PURE__ */ jsx(
|
|
2344
|
+
ResizeHandle,
|
|
2345
|
+
{
|
|
2346
|
+
axis: "y",
|
|
2347
|
+
onPointerDown: (event) => {
|
|
2348
|
+
const start = bottomHeight;
|
|
2349
|
+
startResize(event, "y", (delta) => {
|
|
2350
|
+
setBottomHeight(clamp(start - delta, minBottomPaneHeight, maxBottomPaneHeight));
|
|
2351
|
+
});
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
),
|
|
2355
|
+
/* @__PURE__ */ jsx(
|
|
2356
|
+
"section",
|
|
2357
|
+
{
|
|
2358
|
+
className: cn("min-h-0 shrink-0 overflow-hidden border-t bg-card/40", bottomPaneClassName),
|
|
2359
|
+
style: { height: bottomHeight },
|
|
2360
|
+
children: bottomPane
|
|
2361
|
+
}
|
|
2362
|
+
)
|
|
2363
|
+
] })
|
|
2364
|
+
] }),
|
|
2365
|
+
showRightPane && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2366
|
+
resizable && /* @__PURE__ */ jsx(
|
|
2367
|
+
ResizeHandle,
|
|
2368
|
+
{
|
|
2369
|
+
axis: "x",
|
|
2370
|
+
onPointerDown: (event) => {
|
|
2371
|
+
const start = rightWidth;
|
|
2372
|
+
startResize(event, "x", (delta) => {
|
|
2373
|
+
setRightWidth(clamp(start - delta, minRightPaneWidth, maxRightPaneWidth));
|
|
2374
|
+
});
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
),
|
|
2378
|
+
/* @__PURE__ */ jsx(
|
|
2379
|
+
"aside",
|
|
2380
|
+
{
|
|
2381
|
+
className: cn("min-h-0 shrink-0 overflow-hidden border-l bg-card/45", rightPaneClassName),
|
|
2382
|
+
style: { width: rightWidth },
|
|
2383
|
+
children: rightPane
|
|
2384
|
+
}
|
|
2385
|
+
)
|
|
2386
|
+
] })
|
|
2387
|
+
] })
|
|
2388
|
+
] });
|
|
2389
|
+
}
|
|
2198
2390
|
function DataBodyTab(_props) {
|
|
2199
2391
|
return null;
|
|
2200
2392
|
}
|
|
@@ -2267,12 +2459,13 @@ function renderGroupProps(props) {
|
|
|
2267
2459
|
description,
|
|
2268
2460
|
actions,
|
|
2269
2461
|
danger,
|
|
2462
|
+
className,
|
|
2270
2463
|
children
|
|
2271
2464
|
} = props;
|
|
2272
2465
|
const variant = variantProp ?? layoutDefaultVariant[layout];
|
|
2273
2466
|
if (layout === "split") {
|
|
2274
2467
|
const panes = Children.toArray(children);
|
|
2275
|
-
return /* @__PURE__ */ jsxs("div", { className: "py-(--dk-panel-gap)", children: [
|
|
2468
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("py-(--dk-panel-gap)", className), children: [
|
|
2276
2469
|
(title || description || actions) && /* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-start justify-between", children: [
|
|
2277
2470
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
2278
2471
|
title && /* @__PURE__ */ jsx("h2", { className: cn("text-sm font-semibold", danger && "text-destructive"), children: title }),
|
|
@@ -2284,7 +2477,7 @@ function renderGroupProps(props) {
|
|
|
2284
2477
|
] });
|
|
2285
2478
|
}
|
|
2286
2479
|
if (layout === "horizontal") {
|
|
2287
|
-
return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-[calc(var(--dk-panel-gap)*2)] py-(--dk-panel-gap)", children: [
|
|
2480
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("grid grid-cols-3 gap-[calc(var(--dk-panel-gap)*2)] py-(--dk-panel-gap)", className), children: [
|
|
2288
2481
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
2289
2482
|
/* @__PURE__ */ jsx("p", { className: cn("text-sm font-medium", danger && "text-destructive"), children: title }),
|
|
2290
2483
|
description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: description }),
|
|
@@ -2294,7 +2487,7 @@ function renderGroupProps(props) {
|
|
|
2294
2487
|
] });
|
|
2295
2488
|
}
|
|
2296
2489
|
if (layout === "inline") {
|
|
2297
|
-
return /* @__PURE__ */ jsxs("div", { className: "py-(--dk-panel-gap)", children: [
|
|
2490
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("py-(--dk-panel-gap)", className), children: [
|
|
2298
2491
|
(title || description) && /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-start justify-between", children: [
|
|
2299
2492
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
2300
2493
|
title && /* @__PURE__ */ jsx("h2", { className: cn("text-sm font-semibold", danger && "text-destructive"), children: title }),
|
|
@@ -2305,7 +2498,7 @@ function renderGroupProps(props) {
|
|
|
2305
2498
|
/* @__PURE__ */ jsx(GroupWrapper, { layout, variant, children })
|
|
2306
2499
|
] });
|
|
2307
2500
|
}
|
|
2308
|
-
return /* @__PURE__ */ jsxs("div", { className: "py-(--dk-panel-gap)", children: [
|
|
2501
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("py-(--dk-panel-gap)", className), children: [
|
|
2309
2502
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
|
|
2310
2503
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
2311
2504
|
/* @__PURE__ */ jsx("h2", { className: cn("text-sm font-semibold", danger && "text-destructive"), children: title }),
|
|
@@ -2541,8 +2734,8 @@ function BrowseBodyTemplate({
|
|
|
2541
2734
|
{
|
|
2542
2735
|
className: cn(
|
|
2543
2736
|
"min-w-0 flex-1 overflow-hidden px-(--dk-page-padding-x) py-(--dk-page-padding-y)",
|
|
2544
|
-
"[&_.
|
|
2545
|
-
"[&_.
|
|
2737
|
+
"[&_.gridkit-shell]:h-full [&_.gridkit-table-stack]:flex-1 [&_.gridkit-table-stack]:min-h-0",
|
|
2738
|
+
"[&_.gridkit-frame]:flex-1 [&_.gridkit-frame]:min-h-0 [&_.gridkit-frame]:overflow-auto",
|
|
2546
2739
|
contentClassName
|
|
2547
2740
|
),
|
|
2548
2741
|
children
|
|
@@ -2751,6 +2944,52 @@ var DetailBodyTemplate = Object.assign(DetailBodyTemplateRoot, {
|
|
|
2751
2944
|
Tab: DetailBodyTab,
|
|
2752
2945
|
Section: DetailBodySection
|
|
2753
2946
|
});
|
|
2947
|
+
function ListDetailBodyTemplate({
|
|
2948
|
+
theme,
|
|
2949
|
+
className,
|
|
2950
|
+
topBar,
|
|
2951
|
+
list,
|
|
2952
|
+
detail,
|
|
2953
|
+
emptyDetail,
|
|
2954
|
+
listWidth = 320,
|
|
2955
|
+
listClassName,
|
|
2956
|
+
detailClassName
|
|
2957
|
+
}) {
|
|
2958
|
+
return /* @__PURE__ */ jsxs(
|
|
2959
|
+
DataPage,
|
|
2960
|
+
{
|
|
2961
|
+
className: cn("layout-list-detail", className),
|
|
2962
|
+
style: { "--ld-list-width": `${listWidth}px`, ...theme },
|
|
2963
|
+
children: [
|
|
2964
|
+
topBar && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: topBar }),
|
|
2965
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1 overflow-hidden", children: [
|
|
2966
|
+
/* @__PURE__ */ jsx(
|
|
2967
|
+
"aside",
|
|
2968
|
+
{
|
|
2969
|
+
className: cn(
|
|
2970
|
+
"min-h-0 shrink-0 overflow-hidden border-r",
|
|
2971
|
+
detail ? "hidden lg:flex lg:w-[var(--ld-list-width)] lg:flex-col" : "flex w-full flex-col lg:w-[var(--ld-list-width)]",
|
|
2972
|
+
listClassName
|
|
2973
|
+
),
|
|
2974
|
+
children: list
|
|
2975
|
+
}
|
|
2976
|
+
),
|
|
2977
|
+
/* @__PURE__ */ jsx(
|
|
2978
|
+
"main",
|
|
2979
|
+
{
|
|
2980
|
+
className: cn(
|
|
2981
|
+
"min-h-0 min-w-0 flex-1 overflow-auto",
|
|
2982
|
+
!detail && "hidden lg:block",
|
|
2983
|
+
detailClassName
|
|
2984
|
+
),
|
|
2985
|
+
children: detail ?? emptyDetail
|
|
2986
|
+
}
|
|
2987
|
+
)
|
|
2988
|
+
] })
|
|
2989
|
+
]
|
|
2990
|
+
}
|
|
2991
|
+
);
|
|
2992
|
+
}
|
|
2754
2993
|
function FormWizardBodyTemplate({
|
|
2755
2994
|
theme,
|
|
2756
2995
|
title,
|
|
@@ -3402,7 +3641,7 @@ function buildTokenMap({
|
|
|
3402
3641
|
const c = (factor) => (primaryChroma * factor).toFixed(4);
|
|
3403
3642
|
return {
|
|
3404
3643
|
"--dk-radius": `${radius}rem`,
|
|
3405
|
-
"--
|
|
3644
|
+
"--gridkit-radius": `${radius}rem`,
|
|
3406
3645
|
"--radius": `${radius}rem`,
|
|
3407
3646
|
"--radius-sm": `${(radius * 0.6).toFixed(4)}rem`,
|
|
3408
3647
|
"--radius-md": `${(radius * 0.8).toFixed(4)}rem`,
|
|
@@ -3413,9 +3652,9 @@ function buildTokenMap({
|
|
|
3413
3652
|
"--dk-primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
|
|
3414
3653
|
"--dk-primary-foreground": "oklch(0.985 0 0)",
|
|
3415
3654
|
"--dk-ring": `oklch(0.50 ${primaryChroma} ${primaryHue})`,
|
|
3416
|
-
"--
|
|
3417
|
-
"--
|
|
3418
|
-
"--
|
|
3655
|
+
"--gridkit-primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
|
|
3656
|
+
"--gridkit-primary-foreground": "oklch(0.985 0 0)",
|
|
3657
|
+
"--gridkit-ring": `oklch(0.50 ${primaryChroma} ${primaryHue})`,
|
|
3419
3658
|
"--primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
|
|
3420
3659
|
"--primary-foreground": "oklch(0.985 0 0)",
|
|
3421
3660
|
"--color-primary": `oklch(0.52 ${primaryChroma} ${primaryHue})`,
|
|
@@ -3438,8 +3677,8 @@ function buildTokenMap({
|
|
|
3438
3677
|
"--dk-border": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
|
|
3439
3678
|
"--dk-input": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
|
|
3440
3679
|
"--dk-muted": `oklch(0.970 ${c(0.02)} ${primaryHue})`,
|
|
3441
|
-
"--
|
|
3442
|
-
"--
|
|
3680
|
+
"--gridkit-border": `oklch(0.922 ${c(0.04)} ${primaryHue})`,
|
|
3681
|
+
"--gridkit-muted": `oklch(0.970 ${c(0.02)} ${primaryHue})`,
|
|
3443
3682
|
"--dk-font-scale": fontScale,
|
|
3444
3683
|
"--dk-line-height": lineHeight,
|
|
3445
3684
|
"--dk-density": densityValues.density,
|
|
@@ -3484,8 +3723,8 @@ function buildDarkTonalTokens(primaryHue, primaryChroma) {
|
|
|
3484
3723
|
"--dk-border": `oklch(0.32 ${c(0.06)} ${primaryHue})`,
|
|
3485
3724
|
"--dk-input": `oklch(0.35 ${c(0.06)} ${primaryHue})`,
|
|
3486
3725
|
"--dk-muted": `oklch(0.269 ${c(0.03)} ${primaryHue})`,
|
|
3487
|
-
"--
|
|
3488
|
-
"--
|
|
3726
|
+
"--gridkit-border": `oklch(0.32 ${c(0.06)} ${primaryHue})`,
|
|
3727
|
+
"--gridkit-muted": `oklch(0.269 ${c(0.03)} ${primaryHue})`
|
|
3489
3728
|
};
|
|
3490
3729
|
}
|
|
3491
3730
|
function tokenMapToCss(tokens) {
|
|
@@ -3538,7 +3777,7 @@ ${tokenMapToCss(tokens)}
|
|
|
3538
3777
|
}, [g.density]);
|
|
3539
3778
|
}
|
|
3540
3779
|
function buildTemplateTheme(g, ov = {}) {
|
|
3541
|
-
|
|
3780
|
+
const tokens = buildTokenMap({
|
|
3542
3781
|
radius: ov.radius ?? g.radius,
|
|
3543
3782
|
primaryHue: g.primaryHue,
|
|
3544
3783
|
primaryChroma: ov.primaryChroma ?? g.primaryChroma,
|
|
@@ -3549,8 +3788,12 @@ function buildTemplateTheme(g, ov = {}) {
|
|
|
3549
3788
|
fontScale: g.fontScale ?? 1,
|
|
3550
3789
|
lineHeight: g.lineHeight ?? 1
|
|
3551
3790
|
});
|
|
3791
|
+
if (g.darkMode) {
|
|
3792
|
+
Object.assign(tokens, buildDarkTonalTokens(g.primaryHue, ov.primaryChroma ?? g.primaryChroma));
|
|
3793
|
+
}
|
|
3794
|
+
return tokens;
|
|
3552
3795
|
}
|
|
3553
3796
|
|
|
3554
|
-
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BrowseBodyTemplate, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColorsBodyTemplate, DashboardBodyTemplate, DashboardPanel, DataBodyTemplate, DataPage, DetailBodyTemplate, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FormWizardBodyTemplate, Input, Label, LoginBodyTemplate, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, PageBreadcrumb, PageTopBar, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, 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, Slider, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypographyBodyTemplate, badgeVariants, buildTemplateTheme, buildTopBar, buttonVariants, cn, navigationMenuTriggerStyle, tabsListVariants, useIsMobile, useSidebar, useStyleInjector, useThemeStore };
|
|
3797
|
+
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BrowseBodyTemplate, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColorsBodyTemplate, DashboardBodyTemplate, DashboardPanel, DataBodyTemplate, DataPage, DetailBodyTemplate, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FormWizardBodyTemplate, Input, Label, ListDetailBodyTemplate, LoginBodyTemplate, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, PageBreadcrumb, PageTopBar, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, 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, Slider, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypographyBodyTemplate, WorkbenchBodyTemplate, badgeVariants, buildTemplateTheme, buildTopBar, buttonVariants, cn, navigationMenuTriggerStyle, tabsListVariants, useIsMobile, useSidebar, useStyleInjector, useThemeStore };
|
|
3555
3798
|
//# sourceMappingURL=index.js.map
|
|
3556
3799
|
//# sourceMappingURL=index.js.map
|