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.
@@ -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="flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6">
20
- {showSidebarToggle && <SidebarTrigger className="-ml-1" />}
21
- {showSidebarToggle && title && <Separator orientation="vertical" className="mx-2 data-[orientation=vertical]:h-4" />}
22
- {showTitle && title && <h1 className="text-base font-medium">{title}</h1>}
23
- {tabs && tabs.length > 0 && (
24
- <div className="flex-1 flex justify-center">
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
- </div>
35
- )}
36
- <div className="ml-auto flex items-center gap-2">{actions}</div>
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: AppSidebarProps
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
- <PageContainer className={`overflow-hidden ${className ?? ""}`}>
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
  }
@@ -1,14 +1,11 @@
1
- // Primitives
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';