@flikk/ui 1.0.0-beta.25 → 1.0.0-beta.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.js +4 -0
- package/dist/components/ai/PromptInput/VoiceRecorder.js +4 -0
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +1 -1
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +1 -1
- package/dist/components/charts/BarChart/BarChart.js +2 -2
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +1 -1
- package/dist/components/charts/shared/BarRenderer/BarRenderer.js +2 -2
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +1 -1
- package/dist/components/core/Button/Button.js +1 -1
- package/dist/components/core/Button/Button.theme.js +5 -5
- package/dist/components/core/Calendar/Calendar.theme.js +1 -1
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.theme.js +1 -1
- package/dist/components/core/CommandPalette/CommandItem.js +4 -5
- package/dist/components/core/CommandPalette/CommandPalette.js +1 -1
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +11 -13
- package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +0 -2
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +13 -14
- package/dist/components/core/DotSeparator/DotSeparator.d.ts +3 -0
- package/dist/components/core/DotSeparator/DotSeparator.js +19 -0
- package/dist/components/core/DotSeparator/DotSeparator.theme.d.ts +2 -0
- package/dist/components/core/DotSeparator/DotSeparator.theme.js +10 -0
- package/dist/components/core/DotSeparator/DotSeparator.types.d.ts +25 -0
- package/dist/components/core/DotSeparator/index.d.ts +3 -0
- package/dist/components/core/Drawer/Drawer.theme.js +2 -2
- package/dist/components/core/Dropdown/Dropdown.theme.js +4 -5
- package/dist/components/core/Dropdown/DropdownItem.js +1 -1
- package/dist/components/core/Dropdown/DropdownMenu.js +1 -1
- package/dist/components/core/Empty/Empty.js +1 -1
- package/dist/components/core/ImagePlaceholder/ImagePlaceholder.d.ts +14 -0
- package/dist/components/core/ImagePlaceholder/ImagePlaceholder.js +28 -0
- package/dist/components/core/ImagePlaceholder/ImagePlaceholder.theme.d.ts +6 -0
- package/dist/components/core/ImagePlaceholder/ImagePlaceholder.theme.js +8 -0
- package/dist/components/core/ImagePlaceholder/ImagePlaceholder.types.d.ts +32 -0
- package/dist/components/core/ImagePlaceholder/index.d.ts +2 -0
- package/dist/components/core/MenuItem/MenuItem.js +5 -2
- package/dist/components/core/MenuItem/MenuItem.theme.d.ts +6 -0
- package/dist/components/core/MenuItem/MenuItem.theme.js +19 -16
- package/dist/components/core/MenuItem/MenuItem.types.d.ts +2 -0
- package/dist/components/core/Message/Message.theme.js +1 -1
- package/dist/components/core/Modal/Modal.theme.js +1 -1
- package/dist/components/core/NavItem/NavItem.d.ts +1 -1
- package/dist/components/core/NavItem/NavItem.js +187 -68
- package/dist/components/core/NavItem/NavItem.theme.js +31 -12
- package/dist/components/core/NavItem/NavItem.types.d.ts +17 -39
- package/dist/components/core/Pagination/Pagination.theme.js +3 -3
- package/dist/components/core/Popover/Popover.theme.js +1 -1
- package/dist/components/core/Popover/Popover.types.d.ts +6 -2
- package/dist/components/core/Popover/PopoverBody.js +10 -3
- package/dist/components/core/Progress/Progress.theme.js +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.js +2 -2
- package/dist/components/core/ScrollArea/ScrollArea.theme.js +1 -1
- package/dist/components/core/Segmented/Segmented.js +8 -6
- package/dist/components/core/Segmented/Segmented.theme.js +3 -3
- package/dist/components/core/Sidebar/Sidebar.d.ts +3 -1
- package/dist/components/core/Sidebar/Sidebar.js +53 -16
- package/dist/components/core/Sidebar/Sidebar.theme.js +5 -7
- package/dist/components/core/Sidebar/Sidebar.types.d.ts +125 -8
- package/dist/components/core/Sidebar/SidebarCard.d.ts +25 -0
- package/dist/components/core/Sidebar/SidebarCard.js +68 -0
- package/dist/components/core/Sidebar/SidebarCard.theme.d.ts +8 -0
- package/dist/components/core/Sidebar/SidebarCard.theme.js +18 -0
- package/dist/components/core/Sidebar/SidebarContent.js +10 -6
- package/dist/components/core/Sidebar/SidebarContext.d.ts +17 -16
- package/dist/components/core/Sidebar/SidebarContext.js +43 -20
- package/dist/components/core/Sidebar/SidebarFooter.js +4 -6
- package/dist/components/core/Sidebar/SidebarHeader.js +12 -9
- package/dist/components/core/Sidebar/SidebarLogo.js +39 -8
- package/dist/components/core/Sidebar/SidebarNav.js +4 -3
- package/dist/components/core/Sidebar/SidebarNavGroup.js +4 -7
- package/dist/components/core/Sidebar/SidebarSearch.d.ts +22 -0
- package/dist/components/core/Sidebar/SidebarSearch.js +135 -0
- package/dist/components/core/Sidebar/SidebarToggle.js +6 -1
- package/dist/components/core/Sidebar/SidebarUserProfile.js +33 -17
- package/dist/components/core/Sidebar/index.d.ts +4 -3
- package/dist/components/core/Skeleton/Skeleton.theme.js +1 -1
- package/dist/components/core/Spinner/Spinner.theme.js +1 -1
- package/dist/components/core/Tabs/Tabs.js +6 -1
- package/dist/components/core/Tabs/Tabs.types.d.ts +2 -0
- package/dist/components/core/Tabs/TabsBody.js +5 -3
- package/dist/components/core/Tag/Tag.js +29 -5
- package/dist/components/core/Tag/Tag.theme.js +14 -9
- package/dist/components/core/Tag/Tag.types.d.ts +7 -0
- package/dist/components/core/Tooltip/Tooltip.js +1 -1
- package/dist/components/core/Tooltip/Tooltip.theme.js +1 -2
- package/dist/components/core/index.d.ts +2 -0
- package/dist/components/core/index.js +6 -2
- package/dist/components/data-display/GanttChart/GanttChart.d.ts +1 -1
- package/dist/components/data-display/GanttChart/GanttChart.js +31 -4
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +19 -17
- package/dist/components/data-display/GanttChart/GanttChart.types.d.ts +19 -0
- package/dist/components/data-display/GanttChart/GanttChart.utils.js +1 -1
- package/dist/components/data-display/GanttChart/GanttChartPanel.d.ts +1 -1
- package/dist/components/data-display/GanttChart/GanttChartPanel.js +3 -3
- package/dist/components/data-display/GanttChart/GanttDependencyArrows.js +7 -4
- package/dist/components/data-display/GanttChart/GanttMilestone.js +5 -5
- package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +1 -1
- package/dist/components/data-display/GanttChart/GanttTablePanel.js +1 -1
- package/dist/components/data-display/GanttChart/GanttTableTaskRow.js +2 -2
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +37 -16
- package/dist/components/data-display/GanttChart/GanttTimelineGrid.js +2 -1
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +35 -11
- package/dist/components/data-display/GanttChart/GanttToolbar.js +2 -2
- package/dist/components/data-display/GanttChart/hooks/useGanttDrag.js +3 -2
- package/dist/components/data-display/GanttChart/index.d.ts +1 -1
- package/dist/components/data-display/KPI/KPI.js +13 -3
- package/dist/components/data-display/KPI/KPI.theme.js +3 -3
- package/dist/components/data-display/Metric/Metric.theme.js +3 -3
- package/dist/components/data-display/Table/Table.js +4 -3
- package/dist/components/data-display/Table/Table.theme.js +14 -6
- package/dist/components/data-display/Table/Table.types.d.ts +15 -0
- package/dist/components/data-display/Table/TableColumnManager.js +1 -1
- package/dist/components/data-display/Table/index.d.ts +2 -2
- package/dist/components/effects/Aurora/Aurora.d.ts +6 -17
- package/dist/components/effects/Aurora/Aurora.js +310 -105
- package/dist/components/effects/Aurora/Aurora.types.d.ts +6 -0
- package/dist/components/effects/InteractiveCharacters/InteractiveCharacters.js +3 -3
- package/dist/components/effects/InteractiveCharacters/characters/BlobCharacter.js +13 -4
- package/dist/components/effects/InteractiveCharacters/characters/SmallCharacter.js +13 -4
- package/dist/components/effects/InteractiveCharacters/characters/TallCharacter.js +14 -4
- package/dist/components/effects/MorphingText/MorphingText.js +40 -7
- package/dist/components/effects/StripePattern/StripePattern.d.ts +18 -0
- package/dist/components/effects/StripePattern/StripePattern.js +54 -0
- package/dist/components/effects/StripePattern/StripePattern.types.d.ts +53 -0
- package/dist/components/effects/StripePattern/index.d.ts +2 -0
- package/dist/components/effects/index.d.ts +2 -0
- package/dist/components/effects/index.js +1 -0
- package/dist/components/forms/Checkbox/Checkbox.theme.js +1 -1
- package/dist/components/forms/Combobox/Combobox.js +1 -1
- package/dist/components/forms/Combobox/Combobox.theme.js +2 -4
- package/dist/components/forms/CronInput/CronInput.js +1 -1
- package/dist/components/forms/CronInput/CronInput.theme.js +22 -31
- package/dist/components/forms/DatePicker/DatePicker.theme.js +11 -18
- package/dist/components/forms/DatePicker/DatePickerTrigger.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +7 -14
- package/dist/components/forms/DateRangePicker/DateRangePickerTrigger.js +1 -1
- package/dist/components/forms/FileUpload/FileUpload.animations.d.ts +29 -0
- package/dist/components/forms/FileUpload/FileUpload.animations.js +19 -0
- package/dist/components/forms/FileUpload/FileUpload.js +88 -49
- package/dist/components/forms/FileUpload/FileUpload.theme.d.ts +2 -10
- package/dist/components/forms/FileUpload/FileUpload.theme.js +16 -30
- package/dist/components/forms/FileUpload/FileUpload.types.d.ts +26 -10
- package/dist/components/forms/FileUpload/FileUploadProgress.js +27 -20
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +2 -2
- package/dist/components/forms/Input/Input.theme.js +16 -15
- package/dist/components/forms/InputCounter/InputCounter.theme.js +1 -1
- package/dist/components/forms/Mention/Mention.js +152 -57
- package/dist/components/forms/Mention/Mention.theme.js +16 -23
- package/dist/components/forms/Mention/Mention.types.d.ts +12 -12
- package/dist/components/forms/Mention/Mention.utils.js +32 -4
- package/dist/components/forms/Radio/Radio.theme.js +1 -1
- package/dist/components/forms/RichTextEditor/RichTextEditor.d.ts +18 -0
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +1231 -236
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.d.ts +53 -1
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +99 -25
- package/dist/components/forms/RichTextEditor/RichTextEditor.types.d.ts +42 -3
- package/dist/components/forms/RichTextEditor/index.d.ts +2 -2
- package/dist/components/forms/Select/Select.js +2 -2
- package/dist/components/forms/Select/Select.theme.js +3 -3
- package/dist/components/forms/Slider/Slider.theme.js +1 -1
- package/dist/components/forms/Switch/Switch.theme.js +1 -1
- package/dist/components/forms/TimePicker/TimePicker.theme.js +2 -2
- package/dist/components/forms/TimePicker/TimePickerContent.js +4 -0
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +1 -1
- package/dist/components/forms/forms.theme.js +24 -19
- package/dist/components/forms/index.js +4 -0
- package/dist/components/layout/AppShell/AppShell.d.ts +10 -0
- package/dist/components/layout/AppShell/AppShell.js +84 -0
- package/dist/components/layout/AppShell/AppShell.theme.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShell.theme.js +42 -0
- package/dist/components/layout/AppShell/AppShell.types.d.ts +127 -0
- package/dist/components/layout/AppShell/AppShellContext.d.ts +14 -0
- package/dist/components/layout/AppShell/AppShellContext.js +19 -0
- package/dist/components/layout/AppShell/AppShellFooter.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShellFooter.js +12 -0
- package/dist/components/layout/AppShell/AppShellHeader.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShellHeader.js +12 -0
- package/dist/components/layout/AppShell/AppShellMain.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShellMain.js +19 -0
- package/dist/components/layout/AppShell/AppShellRightPanel.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShellRightPanel.js +16 -0
- package/dist/components/layout/AppShell/AppShellSidebar.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShellSidebar.js +16 -0
- package/dist/components/layout/AppShell/AppShellTopbar.d.ts +3 -0
- package/dist/components/layout/AppShell/AppShellTopbar.js +12 -0
- package/dist/components/layout/AppShell/index.d.ts +3 -0
- package/dist/components/layout/FormLayout/FormLayout.js +9 -4
- package/dist/components/layout/FormLayout/FormLayout.types.d.ts +3 -3
- package/dist/components/layout/FormLayout/FormLayoutSection.js +6 -1
- package/dist/components/layout/PageLayout/PageLayout.d.ts +2 -2
- package/dist/components/layout/PageLayout/PageLayout.js +23 -5
- package/dist/components/layout/PageLayout/PageLayout.theme.d.ts +2 -1
- package/dist/components/layout/PageLayout/PageLayout.theme.js +35 -6
- package/dist/components/layout/PageLayout/PageLayout.types.d.ts +45 -0
- package/dist/components/layout/PageLayout/PageLayoutContent.js +6 -4
- package/dist/components/layout/PageLayout/PageLayoutHeader.js +3 -3
- package/dist/components/layout/PageLayout/PageLayoutSidebar.js +5 -3
- package/dist/components/layout/PageLayout/index.d.ts +1 -1
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.js +2 -0
- package/dist/hooks/useSelectPortal.d.ts +10 -2
- package/dist/hooks/useSelectPortal.js +45 -24
- package/dist/index.js +8 -2
- package/dist/registry.json +10021 -0
- package/dist/styles.css +1 -1
- package/dist/utils/dateUtils.js +11 -1
- package/package.json +4 -2
- package/src/global.scss +29 -8
- package/src/styles/theme.css +174 -100
- package/dist/components/core/Sidebar/SidebarSubmenu.d.ts +0 -7
- package/dist/components/core/Sidebar/SidebarSubmenu.js +0 -12
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const appShellTheme = {
|
|
2
|
+
root: "flex flex-col bg-[var(--color-background)] text-[var(--color-text-primary)]",
|
|
3
|
+
rootViewport: "h-screen overflow-hidden",
|
|
4
|
+
shell: "flex flex-1 min-h-0 min-w-0",
|
|
5
|
+
mainColumn: "flex flex-col flex-1 min-h-0 min-w-0",
|
|
6
|
+
topbar: "shrink-0 border-b border-[var(--color-border)] bg-[var(--color-background)]/90 backdrop-blur supports-[backdrop-filter]:bg-[var(--color-background)]/75",
|
|
7
|
+
sidebar: "flex flex-col shrink-0 overflow-hidden border-r border-[var(--color-border)] bg-[var(--color-background)]/95 backdrop-blur supports-[backdrop-filter]:bg-[var(--color-background)]/85",
|
|
8
|
+
sidebarScroll: "min-h-0 flex-1",
|
|
9
|
+
sidebarCollapsed: "hidden lg:flex",
|
|
10
|
+
header: "shrink-0 border-b border-[var(--color-border)] bg-[var(--color-background)]/90 backdrop-blur supports-[backdrop-filter]:bg-[var(--color-background)]/75",
|
|
11
|
+
main: "flex flex-col flex-1 min-h-0 min-w-0",
|
|
12
|
+
mainScroll: "min-h-0 flex-1",
|
|
13
|
+
mainInner: "mx-auto w-full",
|
|
14
|
+
rightPanel: "flex flex-col shrink-0 overflow-hidden border-l border-[var(--color-border)] bg-[var(--color-background)]/95 backdrop-blur supports-[backdrop-filter]:bg-[var(--color-background)]/85",
|
|
15
|
+
rightPanelScroll: "min-h-0 flex-1",
|
|
16
|
+
footer: "shrink-0 border-t border-[var(--color-border)] bg-[var(--color-background)]/90 backdrop-blur supports-[backdrop-filter]:bg-[var(--color-background)]/75",
|
|
17
|
+
contentPadding: {
|
|
18
|
+
none: "p-0",
|
|
19
|
+
sm: "p-3 sm:p-4",
|
|
20
|
+
md: "p-4 sm:p-6 lg:p-8",
|
|
21
|
+
lg: "p-5 sm:p-8 lg:p-10",
|
|
22
|
+
},
|
|
23
|
+
contentWidth: {
|
|
24
|
+
full: "max-w-none",
|
|
25
|
+
wide: "max-w-7xl",
|
|
26
|
+
contained: "max-w-5xl",
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
const getAppShellTheme = (customTheme) => ({
|
|
30
|
+
...appShellTheme,
|
|
31
|
+
...customTheme,
|
|
32
|
+
contentPadding: {
|
|
33
|
+
...appShellTheme.contentPadding,
|
|
34
|
+
...customTheme === null || customTheme === void 0 ? void 0 : customTheme.contentPadding,
|
|
35
|
+
},
|
|
36
|
+
contentWidth: {
|
|
37
|
+
...appShellTheme.contentWidth,
|
|
38
|
+
...customTheme === null || customTheme === void 0 ? void 0 : customTheme.contentWidth,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export { appShellTheme, getAppShellTheme };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type AppShellScroll = "viewport" | "page";
|
|
3
|
+
export type AppShellSpan = "full" | "main";
|
|
4
|
+
export type AppShellContentWidth = "full" | "wide" | "contained";
|
|
5
|
+
export type AppShellContentPadding = "none" | "sm" | "md" | "lg";
|
|
6
|
+
export interface AppShellTheme {
|
|
7
|
+
/** Outer root container (column layout). */
|
|
8
|
+
root: string;
|
|
9
|
+
/** Extra classes applied when `scroll="viewport"`. */
|
|
10
|
+
rootViewport: string;
|
|
11
|
+
/** Row container holding sidebar / main column / right panel. */
|
|
12
|
+
shell: string;
|
|
13
|
+
/** The middle column (Topbar-in-main? Main, Footer-in-main?). */
|
|
14
|
+
mainColumn: string;
|
|
15
|
+
topbar: string;
|
|
16
|
+
sidebar: string;
|
|
17
|
+
sidebarScroll: string;
|
|
18
|
+
sidebarCollapsed: string;
|
|
19
|
+
header: string;
|
|
20
|
+
main: string;
|
|
21
|
+
mainScroll: string;
|
|
22
|
+
mainInner: string;
|
|
23
|
+
rightPanel: string;
|
|
24
|
+
rightPanelScroll: string;
|
|
25
|
+
footer: string;
|
|
26
|
+
contentPadding: Record<AppShellContentPadding, string>;
|
|
27
|
+
contentWidth: Record<AppShellContentWidth, string>;
|
|
28
|
+
}
|
|
29
|
+
export interface AppShellThemeOverrides {
|
|
30
|
+
root?: string;
|
|
31
|
+
rootViewport?: string;
|
|
32
|
+
shell?: string;
|
|
33
|
+
mainColumn?: string;
|
|
34
|
+
topbar?: string;
|
|
35
|
+
sidebar?: string;
|
|
36
|
+
sidebarScroll?: string;
|
|
37
|
+
sidebarCollapsed?: string;
|
|
38
|
+
header?: string;
|
|
39
|
+
main?: string;
|
|
40
|
+
mainScroll?: string;
|
|
41
|
+
mainInner?: string;
|
|
42
|
+
rightPanel?: string;
|
|
43
|
+
rightPanelScroll?: string;
|
|
44
|
+
footer?: string;
|
|
45
|
+
contentPadding?: Partial<Record<AppShellContentPadding, string>>;
|
|
46
|
+
contentWidth?: Partial<Record<AppShellContentWidth, string>>;
|
|
47
|
+
}
|
|
48
|
+
export interface AppShellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
49
|
+
/**
|
|
50
|
+
* Scroll model. `"viewport"` makes the root `h-screen overflow-hidden`
|
|
51
|
+
* and only `Main` scrolls. `"page"` lets the whole document scroll.
|
|
52
|
+
* @default "viewport"
|
|
53
|
+
*/
|
|
54
|
+
scroll?: AppShellScroll;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the Topbar spans the full viewport width (over the Sidebar)
|
|
57
|
+
* or only sits above Main + RightPanel.
|
|
58
|
+
* @default "full"
|
|
59
|
+
*/
|
|
60
|
+
topbarSpan?: AppShellSpan;
|
|
61
|
+
/**
|
|
62
|
+
* Whether the Footer spans the full viewport width (under the Sidebar)
|
|
63
|
+
* or only sits below Main + RightPanel.
|
|
64
|
+
* @default "full"
|
|
65
|
+
*/
|
|
66
|
+
footerSpan?: AppShellSpan;
|
|
67
|
+
/**
|
|
68
|
+
* Max content width applied to AppShell.Main when not overridden.
|
|
69
|
+
* @default "full"
|
|
70
|
+
*/
|
|
71
|
+
contentWidth?: AppShellContentWidth;
|
|
72
|
+
/**
|
|
73
|
+
* Responsive content padding applied to AppShell.Main when not overridden.
|
|
74
|
+
* @default "md"
|
|
75
|
+
*/
|
|
76
|
+
contentPadding?: AppShellContentPadding;
|
|
77
|
+
/**
|
|
78
|
+
* Theme overrides for the AppShell root wrapper (root, shell, mainColumn).
|
|
79
|
+
* Style individual slots via their own `theme` props on each sub-component.
|
|
80
|
+
*/
|
|
81
|
+
theme?: AppShellThemeOverrides;
|
|
82
|
+
}
|
|
83
|
+
export interface AppShellTopbarProps extends React.HTMLAttributes<HTMLElement> {
|
|
84
|
+
/** Stick to top of chrome. Only meaningful when `scroll="page"`. @default true */
|
|
85
|
+
sticky?: boolean;
|
|
86
|
+
/** Theme overrides. */
|
|
87
|
+
theme?: AppShellThemeOverrides;
|
|
88
|
+
}
|
|
89
|
+
export interface AppShellSidebarProps extends React.HTMLAttributes<HTMLElement> {
|
|
90
|
+
/** CSS width value. @default "16rem" */
|
|
91
|
+
width?: string;
|
|
92
|
+
/** Hide on mobile (below `lg`). @default true */
|
|
93
|
+
collapsedOnMobile?: boolean;
|
|
94
|
+
/** Theme overrides. */
|
|
95
|
+
theme?: AppShellThemeOverrides;
|
|
96
|
+
}
|
|
97
|
+
export interface AppShellHeaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
98
|
+
/**
|
|
99
|
+
* Stick to top of the scrolling Main region. Header sticks at its position
|
|
100
|
+
* inside Main's content padding; for a flush edge-to-edge sticky bar, use
|
|
101
|
+
* AppShell.Topbar instead.
|
|
102
|
+
* @default true
|
|
103
|
+
*/
|
|
104
|
+
sticky?: boolean;
|
|
105
|
+
/** Theme overrides. */
|
|
106
|
+
theme?: AppShellThemeOverrides;
|
|
107
|
+
}
|
|
108
|
+
export interface AppShellMainProps extends React.HTMLAttributes<HTMLElement> {
|
|
109
|
+
/** Max content width. Inherits from AppShell when omitted. */
|
|
110
|
+
contentWidth?: AppShellContentWidth;
|
|
111
|
+
/** Responsive padding. Inherits from AppShell when omitted. */
|
|
112
|
+
contentPadding?: AppShellContentPadding;
|
|
113
|
+
/** Theme overrides. */
|
|
114
|
+
theme?: AppShellThemeOverrides;
|
|
115
|
+
}
|
|
116
|
+
export interface AppShellRightPanelProps extends React.HTMLAttributes<HTMLElement> {
|
|
117
|
+
/** CSS width value. @default "20rem" */
|
|
118
|
+
width?: string;
|
|
119
|
+
/** Theme overrides. */
|
|
120
|
+
theme?: AppShellThemeOverrides;
|
|
121
|
+
}
|
|
122
|
+
export interface AppShellFooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
123
|
+
/** Stick to bottom of chrome. Only meaningful when `scroll="page"`. @default true */
|
|
124
|
+
sticky?: boolean;
|
|
125
|
+
/** Theme overrides. */
|
|
126
|
+
theme?: AppShellThemeOverrides;
|
|
127
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { AppShellContentPadding, AppShellContentWidth, AppShellScroll } from "./AppShell.types";
|
|
3
|
+
export interface AppShellContextValue {
|
|
4
|
+
scroll: AppShellScroll;
|
|
5
|
+
contentWidth: AppShellContentWidth;
|
|
6
|
+
contentPadding: AppShellContentPadding;
|
|
7
|
+
}
|
|
8
|
+
export declare const AppShellProvider: React.Provider<AppShellContextValue | undefined>;
|
|
9
|
+
/**
|
|
10
|
+
* Reads AppShell root context. Returns sensible defaults when used outside
|
|
11
|
+
* an `<AppShell>` (so individual slot components remain usable standalone
|
|
12
|
+
* for testing or partial composition).
|
|
13
|
+
*/
|
|
14
|
+
export declare const useAppShellContext: () => AppShellContextValue;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
const AppShellContext = React__default.createContext(undefined);
|
|
4
|
+
const AppShellProvider = AppShellContext.Provider;
|
|
5
|
+
/**
|
|
6
|
+
* Reads AppShell root context. Returns sensible defaults when used outside
|
|
7
|
+
* an `<AppShell>` (so individual slot components remain usable standalone
|
|
8
|
+
* for testing or partial composition).
|
|
9
|
+
*/
|
|
10
|
+
const useAppShellContext = () => {
|
|
11
|
+
const ctx = React__default.useContext(AppShellContext);
|
|
12
|
+
return (ctx !== null && ctx !== void 0 ? ctx : {
|
|
13
|
+
scroll: "viewport",
|
|
14
|
+
contentWidth: "full",
|
|
15
|
+
contentPadding: "md",
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { AppShellProvider, useAppShellContext };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { getAppShellTheme } from './AppShell.theme.js';
|
|
5
|
+
|
|
6
|
+
const AppShellFooter = React__default.forwardRef(({ sticky = true, className, theme: customTheme, children, ...props }, ref) => {
|
|
7
|
+
const theme = getAppShellTheme(customTheme);
|
|
8
|
+
return (jsx("footer", { ref: ref, className: cn(theme.footer, sticky && "sticky bottom-0 z-20", className), ...props, children: children }));
|
|
9
|
+
});
|
|
10
|
+
AppShellFooter.displayName = "AppShell.Footer";
|
|
11
|
+
|
|
12
|
+
export { AppShellFooter };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { getAppShellTheme } from './AppShell.theme.js';
|
|
5
|
+
|
|
6
|
+
const AppShellHeader = React__default.forwardRef(({ sticky = true, className, theme: customTheme, children, ...props }, ref) => {
|
|
7
|
+
const theme = getAppShellTheme(customTheme);
|
|
8
|
+
return (jsx("header", { ref: ref, className: cn(theme.header, sticky && "sticky top-0 z-10", className), ...props, children: children }));
|
|
9
|
+
});
|
|
10
|
+
AppShellHeader.displayName = "AppShell.Header";
|
|
11
|
+
|
|
12
|
+
export { AppShellHeader };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { ScrollArea } from '../../core/ScrollArea/ScrollArea.js';
|
|
5
|
+
import '../../core/ScrollArea/smooth/SmoothScrollEngine.js';
|
|
6
|
+
import { getAppShellTheme } from './AppShell.theme.js';
|
|
7
|
+
import { useAppShellContext } from './AppShellContext.js';
|
|
8
|
+
|
|
9
|
+
const AppShellMain = React__default.forwardRef(({ className, theme: customTheme, contentWidth, contentPadding, children, ...props }, ref) => {
|
|
10
|
+
const theme = getAppShellTheme(customTheme);
|
|
11
|
+
const ctx = useAppShellContext();
|
|
12
|
+
const resolvedWidth = contentWidth !== null && contentWidth !== void 0 ? contentWidth : ctx.contentWidth;
|
|
13
|
+
const resolvedPadding = contentPadding !== null && contentPadding !== void 0 ? contentPadding : ctx.contentPadding;
|
|
14
|
+
const inner = (jsx("div", { className: cn(theme.mainInner, theme.contentWidth[resolvedWidth], theme.contentPadding[resolvedPadding]), children: children }));
|
|
15
|
+
return (jsx("main", { ref: ref, className: cn(theme.main, className), ...props, children: ctx.scroll === "viewport" ? (jsx(ScrollArea, { type: "hover", size: "thin", className: theme.mainScroll, children: inner })) : (inner) }));
|
|
16
|
+
});
|
|
17
|
+
AppShellMain.displayName = "AppShell.Main";
|
|
18
|
+
|
|
19
|
+
export { AppShellMain };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { ScrollArea } from '../../core/ScrollArea/ScrollArea.js';
|
|
5
|
+
import '../../core/ScrollArea/smooth/SmoothScrollEngine.js';
|
|
6
|
+
import { getAppShellTheme } from './AppShell.theme.js';
|
|
7
|
+
import { useAppShellContext } from './AppShellContext.js';
|
|
8
|
+
|
|
9
|
+
const AppShellRightPanel = React__default.forwardRef(({ width = "20rem", className, theme: customTheme, style, children, "aria-label": ariaLabel = "Secondary", ...props }, ref) => {
|
|
10
|
+
const theme = getAppShellTheme(customTheme);
|
|
11
|
+
const ctx = useAppShellContext();
|
|
12
|
+
return (jsx("aside", { ref: ref, "aria-label": ariaLabel, className: cn(theme.rightPanel, className), style: { width, ...style }, ...props, children: ctx.scroll === "viewport" ? (jsx(ScrollArea, { type: "hover", size: "thin", className: theme.rightPanelScroll, children: children })) : (children) }));
|
|
13
|
+
});
|
|
14
|
+
AppShellRightPanel.displayName = "AppShell.RightPanel";
|
|
15
|
+
|
|
16
|
+
export { AppShellRightPanel };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { ScrollArea } from '../../core/ScrollArea/ScrollArea.js';
|
|
5
|
+
import '../../core/ScrollArea/smooth/SmoothScrollEngine.js';
|
|
6
|
+
import { getAppShellTheme } from './AppShell.theme.js';
|
|
7
|
+
import { useAppShellContext } from './AppShellContext.js';
|
|
8
|
+
|
|
9
|
+
const AppShellSidebar = React__default.forwardRef(({ width = "16rem", collapsedOnMobile = true, className, theme: customTheme, style, children, "aria-label": ariaLabel = "Primary", ...props }, ref) => {
|
|
10
|
+
const theme = getAppShellTheme(customTheme);
|
|
11
|
+
const ctx = useAppShellContext();
|
|
12
|
+
return (jsx("aside", { ref: ref, "aria-label": ariaLabel, className: cn(theme.sidebar, collapsedOnMobile && theme.sidebarCollapsed, className), style: { width, ...style }, ...props, children: ctx.scroll === "viewport" ? (jsx(ScrollArea, { type: "hover", size: "thin", className: theme.sidebarScroll, children: children })) : (children) }));
|
|
13
|
+
});
|
|
14
|
+
AppShellSidebar.displayName = "AppShell.Sidebar";
|
|
15
|
+
|
|
16
|
+
export { AppShellSidebar };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { cn } from '../../../utils/cn.js';
|
|
4
|
+
import { getAppShellTheme } from './AppShell.theme.js';
|
|
5
|
+
|
|
6
|
+
const AppShellTopbar = React__default.forwardRef(({ sticky = true, className, theme: customTheme, children, ...props }, ref) => {
|
|
7
|
+
const theme = getAppShellTheme(customTheme);
|
|
8
|
+
return (jsx("header", { ref: ref, className: cn(theme.topbar, sticky && "sticky top-0 z-20", className), ...props, children: children }));
|
|
9
|
+
});
|
|
10
|
+
AppShellTopbar.displayName = "AppShell.Topbar";
|
|
11
|
+
|
|
12
|
+
export { AppShellTopbar };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { AppShell } from "./AppShell";
|
|
2
|
+
export type { AppShellProps, AppShellTopbarProps, AppShellSidebarProps, AppShellHeaderProps, AppShellMainProps, AppShellRightPanelProps, AppShellFooterProps, AppShellScroll, AppShellSpan, AppShellContentWidth, AppShellContentPadding, AppShellTheme, AppShellThemeOverrides, } from "./AppShell.types";
|
|
3
|
+
export { appShellTheme, getAppShellTheme } from "./AppShell.theme";
|
|
@@ -30,6 +30,7 @@ import '../../core/Dropdown/DropdownItem.js';
|
|
|
30
30
|
import '../../core/Dropdown/DropdownSection.js';
|
|
31
31
|
import '../../core/Dropdown/DropdownSeparator.js';
|
|
32
32
|
import '../../core/Dropdown/Dropdown.theme.js';
|
|
33
|
+
import '../../core/DotSeparator/DotSeparator.js';
|
|
33
34
|
import '../../core/Kbd/Kbd.js';
|
|
34
35
|
import '../../core/MenuItem/MenuItem.js';
|
|
35
36
|
import '../../core/Link/Link.js';
|
|
@@ -77,17 +78,19 @@ import '../../core/Sidebar/SidebarContent.js';
|
|
|
77
78
|
import '../../core/Sidebar/SidebarFooter.js';
|
|
78
79
|
import '../../core/Sidebar/SidebarNav.js';
|
|
79
80
|
import '../../core/Sidebar/SidebarNavGroup.js';
|
|
80
|
-
import 'motion/react';
|
|
81
81
|
import '../../core/Sidebar/SidebarToggle.js';
|
|
82
82
|
import '../../core/Sidebar/SidebarMobileTrigger.js';
|
|
83
83
|
import '../../core/Sidebar/SidebarUserProfile.js';
|
|
84
84
|
import '../../core/Sidebar/SidebarLogo.js';
|
|
85
|
+
import '../../core/Sidebar/SidebarSearch.js';
|
|
86
|
+
import '../../core/Sidebar/SidebarCard.js';
|
|
85
87
|
import '../../core/Sidebar/SidebarContext.js';
|
|
86
88
|
import '../../core/OfflineIndicator/OfflineIndicator.js';
|
|
87
89
|
import '../../core/ContextMenu/ContextMenu.js';
|
|
88
90
|
import '../../core/ContextMenu/ContextMenu.theme.js';
|
|
89
91
|
import '../../core/Pill/Pill.js';
|
|
90
92
|
import '../../core/Icon/Icon.js';
|
|
93
|
+
import '../../core/ImagePlaceholder/ImagePlaceholder.js';
|
|
91
94
|
import { formLayoutTheme } from './FormLayout.theme.js';
|
|
92
95
|
import { FormLayoutSection } from './FormLayoutSection.js';
|
|
93
96
|
import { FormLayoutFooter } from './FormLayoutFooter.js';
|
|
@@ -95,13 +98,15 @@ import { FormLayoutFooter } from './FormLayoutFooter.js';
|
|
|
95
98
|
const isFooter = (child) => React__default.isValidElement(child) && child.type === FormLayoutFooter;
|
|
96
99
|
const FormLayoutRoot = React__default.forwardRef(({ className, theme: customTheme, children, ...props }, ref) => {
|
|
97
100
|
const theme = { ...formLayoutTheme, ...customTheme };
|
|
98
|
-
// Inject <Separator /> between any adjacent children, unless one of them is Footer
|
|
99
|
-
// (Footer already has border-t, so no separator needed before it)
|
|
101
|
+
// Inject <Separator /> between any adjacent children, unless one of them is Footer.
|
|
100
102
|
const childArray = React__default.Children.toArray(children).filter(Boolean);
|
|
101
103
|
const rendered = childArray.map((child, index) => {
|
|
102
104
|
const prev = childArray[index - 1];
|
|
103
105
|
const needsSeparator = index > 0 && !isFooter(child) && !isFooter(prev);
|
|
104
|
-
|
|
106
|
+
const childKey = React__default.isValidElement(child) && child.key != null
|
|
107
|
+
? child.key
|
|
108
|
+
: `form-layout-child-${index}`;
|
|
109
|
+
return (jsxs(React__default.Fragment, { children: [needsSeparator && jsx(Separator, {}), child] }, childKey));
|
|
105
110
|
});
|
|
106
111
|
return (jsx("div", { ref: ref, className: cn(theme.root, className), ...props, children: rendered }));
|
|
107
112
|
});
|
|
@@ -25,11 +25,11 @@ export interface FormLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
25
25
|
/** Theme overrides for the root container. */
|
|
26
26
|
theme?: FormLayoutThemeOverrides;
|
|
27
27
|
}
|
|
28
|
-
export interface FormLayoutSectionProps extends React.HTMLAttributes<HTMLElement> {
|
|
28
|
+
export interface FormLayoutSectionProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"> {
|
|
29
29
|
/** Optional section title. If omitted along with subtitle and action, the sidebar column is hidden. */
|
|
30
|
-
title?:
|
|
30
|
+
title?: React.ReactNode;
|
|
31
31
|
/** Optional subtitle displayed below the title. */
|
|
32
|
-
subtitle?:
|
|
32
|
+
subtitle?: React.ReactNode;
|
|
33
33
|
/** Optional action element rendered below the subtitle. */
|
|
34
34
|
action?: React.ReactNode;
|
|
35
35
|
/** Additional className applied to the content area. */
|
|
@@ -4,9 +4,14 @@ import { cn } from '../../../utils/cn.js';
|
|
|
4
4
|
import { formLayoutTheme } from './FormLayout.theme.js';
|
|
5
5
|
|
|
6
6
|
const FormLayoutSection = React__default.forwardRef(({ title, subtitle, action, className, contentClassName, theme: customTheme, children, ...props }, ref) => {
|
|
7
|
+
var _a;
|
|
7
8
|
const theme = { ...formLayoutTheme, ...customTheme };
|
|
8
9
|
const hasSidebar = !!(title || subtitle || action);
|
|
9
|
-
|
|
10
|
+
const generatedTitleId = React__default.useId();
|
|
11
|
+
const titleId = title
|
|
12
|
+
? (_a = props["aria-labelledby"]) !== null && _a !== void 0 ? _a : generatedTitleId
|
|
13
|
+
: props["aria-labelledby"];
|
|
14
|
+
return (jsxs("section", { ref: ref, className: cn(theme.section, className), "aria-labelledby": titleId, ...props, children: [hasSidebar && (jsxs("div", { className: theme.sectionSidebar, children: [title && (jsx("h2", { id: titleId, className: theme.sectionTitle, children: title })), subtitle && (jsx("div", { className: theme.sectionSubtitle, children: subtitle })), action && jsx("div", { className: theme.sectionAction, children: action })] })), jsx("div", { className: cn(hasSidebar ? theme.sectionContent : theme.sectionContentFull, contentClassName), children: children })] }));
|
|
10
15
|
});
|
|
11
16
|
FormLayoutSection.displayName = "FormLayout.Section";
|
|
12
17
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { PageLayoutProps } from "./PageLayout.types";
|
|
2
|
+
import type { PageLayoutContentProps, PageLayoutProps } from "./PageLayout.types";
|
|
3
3
|
export declare const PageLayout: React.ForwardRefExoticComponent<PageLayoutProps & React.RefAttributes<HTMLDivElement>> & {
|
|
4
4
|
Sidebar: React.ForwardRefExoticComponent<import("./PageLayout.types").PageLayoutSidebarProps & React.RefAttributes<HTMLElement>>;
|
|
5
5
|
Header: React.ForwardRefExoticComponent<import("./PageLayout.types").PageLayoutHeaderProps & React.RefAttributes<HTMLElement>>;
|
|
6
|
-
Content: React.ForwardRefExoticComponent<
|
|
6
|
+
Content: React.ForwardRefExoticComponent<PageLayoutContentProps & React.RefAttributes<HTMLElement>>;
|
|
7
7
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getPageLayoutTheme } from './PageLayout.theme.js';
|
|
5
5
|
import { PageLayoutSidebar } from './PageLayoutSidebar.js';
|
|
6
6
|
import { PageLayoutHeader } from './PageLayoutHeader.js';
|
|
7
7
|
import { PageLayoutContent } from './PageLayoutContent.js';
|
|
8
8
|
|
|
9
|
-
const PageLayoutRoot = React__default.forwardRef(({ className, theme: customTheme, children, ...props }, ref) => {
|
|
10
|
-
const theme =
|
|
9
|
+
const PageLayoutRoot = React__default.forwardRef(({ className, theme: customTheme, variant = "auto", contentWidth = "full", contentPadding = "md", children, ...props }, ref) => {
|
|
10
|
+
const theme = getPageLayoutTheme(customTheme);
|
|
11
11
|
// Separate Sidebar children from the rest (Header, Content)
|
|
12
12
|
// so we can wrap non-sidebar children in a vertical main column.
|
|
13
13
|
const childArray = React__default.Children.toArray(children);
|
|
@@ -21,7 +21,25 @@ const PageLayoutRoot = React__default.forwardRef(({ className, theme: customThem
|
|
|
21
21
|
main.push(child);
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
const resolvedVariant = variant === "auto"
|
|
25
|
+
? sidebar.length > 0
|
|
26
|
+
? "sidebar"
|
|
27
|
+
: "topbar"
|
|
28
|
+
: variant;
|
|
29
|
+
const mainChildren = main.map((child) => {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
if (React__default.isValidElement(child) &&
|
|
32
|
+
child.type === PageLayoutContent) {
|
|
33
|
+
return React__default.cloneElement(child, {
|
|
34
|
+
contentWidth: (_a = child.props.contentWidth) !== null && _a !== void 0 ? _a : contentWidth,
|
|
35
|
+
contentPadding: (_b = child.props.contentPadding) !== null && _b !== void 0 ? _b : contentPadding,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return child;
|
|
39
|
+
});
|
|
40
|
+
return (jsx("div", { ref: ref, className: cn(theme.root, className), ...props, children: jsxs("div", { className: cn(theme.shell, resolvedVariant === "sidebar"
|
|
41
|
+
? theme.sidebarLayout
|
|
42
|
+
: theme.topbarLayout), children: [resolvedVariant === "sidebar" && sidebar, jsx("div", { className: cn(theme.main), children: mainChildren })] }) }));
|
|
25
43
|
});
|
|
26
44
|
PageLayoutRoot.displayName = "PageLayout";
|
|
27
45
|
const PageLayout = Object.assign(PageLayoutRoot, {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type { PageLayoutTheme } from "./PageLayout.types";
|
|
1
|
+
import type { PageLayoutTheme, PageLayoutThemeOverrides } from "./PageLayout.types";
|
|
2
2
|
export declare const pageLayoutTheme: PageLayoutTheme;
|
|
3
|
+
export declare const getPageLayoutTheme: (customTheme?: PageLayoutThemeOverrides) => PageLayoutTheme;
|
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
const pageLayoutTheme = {
|
|
2
|
-
root: "
|
|
3
|
-
|
|
2
|
+
root: "min-h-screen overflow-hidden bg-white text-[var(--color-text-primary)]",
|
|
3
|
+
shell: "h-full min-h-[inherit] min-w-0",
|
|
4
|
+
sidebarLayout: "flex",
|
|
5
|
+
topbarLayout: "flex flex-col",
|
|
6
|
+
sidebar: "flex flex-col shrink-0 overflow-hidden border-r border-[var(--color-border)] bg-[var(--color-background)]/95 backdrop-blur supports-[backdrop-filter]:bg-[var(--color-background)]/85",
|
|
7
|
+
sidebarScroll: "min-h-0 flex-1",
|
|
4
8
|
sidebarCollapsed: "hidden lg:flex",
|
|
5
|
-
main: "flex flex-col flex-1 min-w-0 overflow-hidden",
|
|
6
|
-
header: "shrink-0 border-b border-[var(--color-border)] bg-[var(--color-background)]",
|
|
7
|
-
content: "flex-1
|
|
9
|
+
main: "flex flex-col flex-1 min-h-0 min-w-0 overflow-hidden",
|
|
10
|
+
header: "shrink-0 border-b border-[var(--color-border)] bg-[var(--color-background)]/90 backdrop-blur supports-[backdrop-filter]:bg-[var(--color-background)]/75",
|
|
11
|
+
content: "flex flex-1 min-h-0 min-w-0",
|
|
12
|
+
contentScroll: "min-h-0 flex-1",
|
|
13
|
+
contentInner: "mx-auto w-full",
|
|
14
|
+
contentPadding: {
|
|
15
|
+
none: "p-0",
|
|
16
|
+
sm: "p-3 sm:p-4",
|
|
17
|
+
md: "p-4 sm:p-6 lg:p-8",
|
|
18
|
+
lg: "p-5 sm:p-8 lg:p-10",
|
|
19
|
+
},
|
|
20
|
+
contentWidth: {
|
|
21
|
+
full: "max-w-none",
|
|
22
|
+
wide: "max-w-7xl",
|
|
23
|
+
contained: "max-w-5xl",
|
|
24
|
+
},
|
|
8
25
|
};
|
|
26
|
+
const getPageLayoutTheme = (customTheme) => ({
|
|
27
|
+
...pageLayoutTheme,
|
|
28
|
+
...customTheme,
|
|
29
|
+
contentPadding: {
|
|
30
|
+
...pageLayoutTheme.contentPadding,
|
|
31
|
+
...customTheme === null || customTheme === void 0 ? void 0 : customTheme.contentPadding,
|
|
32
|
+
},
|
|
33
|
+
contentWidth: {
|
|
34
|
+
...pageLayoutTheme.contentWidth,
|
|
35
|
+
...customTheme === null || customTheme === void 0 ? void 0 : customTheme.contentWidth,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
9
38
|
|
|
10
|
-
export { pageLayoutTheme };
|
|
39
|
+
export { getPageLayoutTheme, pageLayoutTheme };
|
|
@@ -1,21 +1,56 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface PageLayoutTheme {
|
|
3
3
|
root: string;
|
|
4
|
+
shell: string;
|
|
5
|
+
sidebarLayout: string;
|
|
6
|
+
topbarLayout: string;
|
|
4
7
|
sidebar: string;
|
|
8
|
+
sidebarScroll: string;
|
|
5
9
|
sidebarCollapsed: string;
|
|
6
10
|
main: string;
|
|
7
11
|
header: string;
|
|
8
12
|
content: string;
|
|
13
|
+
contentScroll: string;
|
|
14
|
+
contentInner: string;
|
|
15
|
+
contentPadding: Record<PageLayoutContentPadding, string>;
|
|
16
|
+
contentWidth: Record<PageLayoutContentWidth, string>;
|
|
9
17
|
}
|
|
10
18
|
export interface PageLayoutThemeOverrides {
|
|
11
19
|
root?: string;
|
|
20
|
+
shell?: string;
|
|
21
|
+
sidebarLayout?: string;
|
|
22
|
+
topbarLayout?: string;
|
|
12
23
|
sidebar?: string;
|
|
24
|
+
sidebarScroll?: string;
|
|
13
25
|
sidebarCollapsed?: string;
|
|
14
26
|
main?: string;
|
|
15
27
|
header?: string;
|
|
16
28
|
content?: string;
|
|
29
|
+
contentScroll?: string;
|
|
30
|
+
contentInner?: string;
|
|
31
|
+
contentPadding?: Partial<Record<PageLayoutContentPadding, string>>;
|
|
32
|
+
contentWidth?: Partial<Record<PageLayoutContentWidth, string>>;
|
|
17
33
|
}
|
|
34
|
+
export type PageLayoutVariant = "auto" | "sidebar" | "topbar";
|
|
35
|
+
export type PageLayoutContentWidth = "full" | "wide" | "contained";
|
|
36
|
+
export type PageLayoutContentPadding = "none" | "sm" | "md" | "lg";
|
|
18
37
|
export interface PageLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
38
|
+
/**
|
|
39
|
+
* Layout variant. "auto" uses sidebar layout when a PageLayout.Sidebar child
|
|
40
|
+
* is present, otherwise it uses the topbar layout.
|
|
41
|
+
* @default "auto"
|
|
42
|
+
*/
|
|
43
|
+
variant?: PageLayoutVariant;
|
|
44
|
+
/**
|
|
45
|
+
* Maximum content width applied to PageLayout.Content children.
|
|
46
|
+
* @default "full"
|
|
47
|
+
*/
|
|
48
|
+
contentWidth?: PageLayoutContentWidth;
|
|
49
|
+
/**
|
|
50
|
+
* Responsive padding applied to PageLayout.Content children.
|
|
51
|
+
* @default "md"
|
|
52
|
+
*/
|
|
53
|
+
contentPadding?: PageLayoutContentPadding;
|
|
19
54
|
/** Theme overrides for the root container. */
|
|
20
55
|
theme?: PageLayoutThemeOverrides;
|
|
21
56
|
}
|
|
@@ -34,6 +69,16 @@ export interface PageLayoutHeaderProps extends React.HTMLAttributes<HTMLElement>
|
|
|
34
69
|
theme?: PageLayoutThemeOverrides;
|
|
35
70
|
}
|
|
36
71
|
export interface PageLayoutContentProps extends React.HTMLAttributes<HTMLElement> {
|
|
72
|
+
/**
|
|
73
|
+
* Maximum content width. Inherits from PageLayout when omitted.
|
|
74
|
+
* @default "full"
|
|
75
|
+
*/
|
|
76
|
+
contentWidth?: PageLayoutContentWidth;
|
|
77
|
+
/**
|
|
78
|
+
* Responsive padding. Inherits from PageLayout when omitted.
|
|
79
|
+
* @default "md"
|
|
80
|
+
*/
|
|
81
|
+
contentPadding?: PageLayoutContentPadding;
|
|
37
82
|
/** Theme overrides for the content area. */
|
|
38
83
|
theme?: PageLayoutThemeOverrides;
|
|
39
84
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
|
-
import {
|
|
4
|
+
import { ScrollArea } from '../../core/ScrollArea/ScrollArea.js';
|
|
5
|
+
import '../../core/ScrollArea/smooth/SmoothScrollEngine.js';
|
|
6
|
+
import { getPageLayoutTheme } from './PageLayout.theme.js';
|
|
5
7
|
|
|
6
|
-
const PageLayoutContent = React__default.forwardRef(({ className, theme: customTheme, children, ...props }, ref) => {
|
|
7
|
-
const theme =
|
|
8
|
-
return (jsx("main", { ref: ref, className: cn(theme.content, className), ...props, children: children }));
|
|
8
|
+
const PageLayoutContent = React__default.forwardRef(({ className, theme: customTheme, contentWidth = "full", contentPadding = "md", children, ...props }, ref) => {
|
|
9
|
+
const theme = getPageLayoutTheme(customTheme);
|
|
10
|
+
return (jsx("main", { ref: ref, className: cn(theme.content, className), ...props, children: jsx(ScrollArea, { type: "hover", size: "thin", className: theme.contentScroll, children: jsx("div", { className: cn(theme.contentInner, theme.contentWidth[contentWidth], theme.contentPadding[contentPadding]), children: children }) }) }));
|
|
9
11
|
});
|
|
10
12
|
PageLayoutContent.displayName = "PageLayout.Content";
|
|
11
13
|
|