ai-design-system 0.1.27 → 0.1.29
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/components/composites/AppHeader/AppHeader.tsx +15 -9
- package/components/features/PageLayout/PageLayout.tsx +16 -7
- package/components/index.ts +7 -10
- package/dist/index.cjs +8500 -9043
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +9 -0
- package/dist/index.d.ts +16 -272
- package/dist/index.js +8279 -8616
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,12 +16,17 @@ export const AppHeader = React.memo<AppHeaderProps>(({
|
|
|
16
16
|
}) => {
|
|
17
17
|
return (
|
|
18
18
|
<header className={`flex h-14 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-14 ${className || ""}`}>
|
|
19
|
-
<div className="
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
<div className="grid w-full grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center px-4 lg:px-6">
|
|
20
|
+
<div className="min-w-0 flex items-center gap-1 lg:gap-2">
|
|
21
|
+
{showSidebarToggle && <SidebarTrigger className="-ml-1" />}
|
|
22
|
+
{showSidebarToggle && showTitle && title && (
|
|
23
|
+
<Separator orientation="vertical" className="mx-2 data-[orientation=vertical]:h-4" />
|
|
24
|
+
)}
|
|
25
|
+
{showTitle && title && <h1 className="max-w-[28rem] truncate text-base font-medium">{title}</h1>}
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div className="justify-self-center">
|
|
29
|
+
{tabs && tabs.length > 0 && (
|
|
25
30
|
<Tabs defaultValue={defaultTab || tabs[0]?.value} onValueChange={onTabChange}>
|
|
26
31
|
<TabsList>
|
|
27
32
|
{tabs.map((tab) => (
|
|
@@ -31,9 +36,10 @@ export const AppHeader = React.memo<AppHeaderProps>(({
|
|
|
31
36
|
))}
|
|
32
37
|
</TabsList>
|
|
33
38
|
</Tabs>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
)}
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div className="flex min-w-0 items-center justify-end gap-2">{actions}</div>
|
|
37
43
|
</div>
|
|
38
44
|
</header>
|
|
39
45
|
)
|
|
@@ -44,8 +44,9 @@ import { PageContainer } from "@/components/composites/PageContainer"
|
|
|
44
44
|
export interface PageLayoutProps {
|
|
45
45
|
/**
|
|
46
46
|
* Sidebar configuration
|
|
47
|
+
* Optional for apps that need header + content layout without a sidebar.
|
|
47
48
|
*/
|
|
48
|
-
sidebar
|
|
49
|
+
sidebar?: AppSidebarProps
|
|
49
50
|
/**
|
|
50
51
|
* Header configuration
|
|
51
52
|
*/
|
|
@@ -127,6 +128,19 @@ export const PageLayout = React.memo<PageLayoutProps>(
|
|
|
127
128
|
<div className="flex min-h-0 flex-1 flex-col">{children}</div>
|
|
128
129
|
)
|
|
129
130
|
|
|
131
|
+
const pageContainer = (
|
|
132
|
+
<PageContainer className={`overflow-hidden ${className ?? ""}`}>
|
|
133
|
+
<AppHeader {...header} />
|
|
134
|
+
<div className={`min-h-0 flex-1 overflow-x-hidden ${layoutSections ? "overflow-hidden" : "overflow-y-auto"}`}>
|
|
135
|
+
{contentArea}
|
|
136
|
+
</div>
|
|
137
|
+
</PageContainer>
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
if (!sidebar) {
|
|
141
|
+
return pageContainer
|
|
142
|
+
}
|
|
143
|
+
|
|
130
144
|
return (
|
|
131
145
|
<LayoutProvider
|
|
132
146
|
defaultOpen={defaultSidebarOpen}
|
|
@@ -134,12 +148,7 @@ export const PageLayout = React.memo<PageLayoutProps>(
|
|
|
134
148
|
sidebarWidthIcon={sidebarWidthIcon}
|
|
135
149
|
>
|
|
136
150
|
<AppSidebar {...sidebar} />
|
|
137
|
-
|
|
138
|
-
<AppHeader {...header} />
|
|
139
|
-
<div className={`min-h-0 flex-1 overflow-x-hidden ${layoutSections ? "overflow-hidden" : "overflow-y-auto"}`}>
|
|
140
|
-
{contentArea}
|
|
141
|
-
</div>
|
|
142
|
-
</PageContainer>
|
|
151
|
+
{pageContainer}
|
|
143
152
|
</LayoutProvider>
|
|
144
153
|
)
|
|
145
154
|
}
|
package/components/index.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
//
|
|
2
|
-
export * from './primitives';
|
|
3
|
-
|
|
4
|
-
// Composites
|
|
5
|
-
export * from './composites';
|
|
6
|
-
|
|
7
|
-
// Blocks
|
|
8
|
-
export * from './blocks';
|
|
9
|
-
|
|
10
|
-
// Features
|
|
1
|
+
// Root public runtime API: feature-layer values only.
|
|
11
2
|
export * from './features';
|
|
12
3
|
|
|
4
|
+
// Root public type API: allow contracts from all layers.
|
|
5
|
+
export type * from './primitives';
|
|
6
|
+
export type * from './composites';
|
|
7
|
+
export type * from './blocks';
|
|
8
|
+
export type * from './features';
|
|
9
|
+
|
|
13
10
|
// Utilities
|
|
14
11
|
export { cn } from '@/lib/utils';
|