@logickernel/frame 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/dist/index.d.mts +14 -9
- package/dist/index.d.ts +14 -9
- package/dist/index.js +3 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -479,9 +479,7 @@ For cross-origin requests, use the full API URL:
|
|
|
479
479
|
```typescript
|
|
480
480
|
<AppSidebar
|
|
481
481
|
user={user}
|
|
482
|
-
organizations={organizations}
|
|
483
482
|
organizationId={orgId}
|
|
484
|
-
useApiNavigation={true}
|
|
485
483
|
apiBaseUrl="https://kernel.example.com/api"
|
|
486
484
|
/>
|
|
487
485
|
```
|
package/dist/index.d.mts
CHANGED
|
@@ -111,12 +111,6 @@ interface AppLayoutProps {
|
|
|
111
111
|
organizationId?: string;
|
|
112
112
|
/** Custom API base URL (API mode only, defaults to "/api" which constructs "/api/navigation/{organizationId}") */
|
|
113
113
|
apiBaseUrl?: string;
|
|
114
|
-
/** Enable API mode - library will fetch navigation from API */
|
|
115
|
-
useApiNavigation?: boolean;
|
|
116
|
-
/** Custom header content (breadcrumbs, actions, etc.) */
|
|
117
|
-
headerContent?: ReactNode;
|
|
118
|
-
/** Show/hide default header (default: true) */
|
|
119
|
-
showHeader?: boolean;
|
|
120
114
|
/** Children to render in the main content area */
|
|
121
115
|
children: ReactNode;
|
|
122
116
|
}
|
|
@@ -168,18 +162,29 @@ declare function AppSidebar({ user, adapter: externalAdapter, data, organization
|
|
|
168
162
|
* This component wraps AppSidebar and SidebarInset in SidebarProvider and provides
|
|
169
163
|
* a default header with sidebar trigger. It handles all layout concerns internally.
|
|
170
164
|
*
|
|
165
|
+
* Navigation mode is determined automatically:
|
|
166
|
+
* - If `data` prop is provided, uses props mode
|
|
167
|
+
* - If `data` is not provided, automatically uses API mode (fetches from API)
|
|
168
|
+
*
|
|
171
169
|
* @example
|
|
172
170
|
* ```tsx
|
|
171
|
+
* // API mode (no data prop)
|
|
172
|
+
* <AppLayout
|
|
173
|
+
* user={user}
|
|
174
|
+
* >
|
|
175
|
+
* {children}
|
|
176
|
+
* </AppLayout>
|
|
177
|
+
*
|
|
178
|
+
* // Props mode (with data prop)
|
|
173
179
|
* <AppLayout
|
|
174
180
|
* user={user}
|
|
175
|
-
*
|
|
176
|
-
* headerContent={<Breadcrumb>...</Breadcrumb>}
|
|
181
|
+
* data={{ organizations: [...], navigationItems: [...] }}
|
|
177
182
|
* >
|
|
178
183
|
* {children}
|
|
179
184
|
* </AppLayout>
|
|
180
185
|
* ```
|
|
181
186
|
*/
|
|
182
|
-
declare function AppLayout({ user, adapter, data, organizationId, apiBaseUrl,
|
|
187
|
+
declare function AppLayout({ user, adapter, data, organizationId, apiBaseUrl, children, }: AppLayoutProps): react_jsx_runtime.JSX.Element;
|
|
183
188
|
|
|
184
189
|
interface NavMainProps {
|
|
185
190
|
items: NavigationItem[];
|
package/dist/index.d.ts
CHANGED
|
@@ -111,12 +111,6 @@ interface AppLayoutProps {
|
|
|
111
111
|
organizationId?: string;
|
|
112
112
|
/** Custom API base URL (API mode only, defaults to "/api" which constructs "/api/navigation/{organizationId}") */
|
|
113
113
|
apiBaseUrl?: string;
|
|
114
|
-
/** Enable API mode - library will fetch navigation from API */
|
|
115
|
-
useApiNavigation?: boolean;
|
|
116
|
-
/** Custom header content (breadcrumbs, actions, etc.) */
|
|
117
|
-
headerContent?: ReactNode;
|
|
118
|
-
/** Show/hide default header (default: true) */
|
|
119
|
-
showHeader?: boolean;
|
|
120
114
|
/** Children to render in the main content area */
|
|
121
115
|
children: ReactNode;
|
|
122
116
|
}
|
|
@@ -168,18 +162,29 @@ declare function AppSidebar({ user, adapter: externalAdapter, data, organization
|
|
|
168
162
|
* This component wraps AppSidebar and SidebarInset in SidebarProvider and provides
|
|
169
163
|
* a default header with sidebar trigger. It handles all layout concerns internally.
|
|
170
164
|
*
|
|
165
|
+
* Navigation mode is determined automatically:
|
|
166
|
+
* - If `data` prop is provided, uses props mode
|
|
167
|
+
* - If `data` is not provided, automatically uses API mode (fetches from API)
|
|
168
|
+
*
|
|
171
169
|
* @example
|
|
172
170
|
* ```tsx
|
|
171
|
+
* // API mode (no data prop)
|
|
172
|
+
* <AppLayout
|
|
173
|
+
* user={user}
|
|
174
|
+
* >
|
|
175
|
+
* {children}
|
|
176
|
+
* </AppLayout>
|
|
177
|
+
*
|
|
178
|
+
* // Props mode (with data prop)
|
|
173
179
|
* <AppLayout
|
|
174
180
|
* user={user}
|
|
175
|
-
*
|
|
176
|
-
* headerContent={<Breadcrumb>...</Breadcrumb>}
|
|
181
|
+
* data={{ organizations: [...], navigationItems: [...] }}
|
|
177
182
|
* >
|
|
178
183
|
* {children}
|
|
179
184
|
* </AppLayout>
|
|
180
185
|
* ```
|
|
181
186
|
*/
|
|
182
|
-
declare function AppLayout({ user, adapter, data, organizationId, apiBaseUrl,
|
|
187
|
+
declare function AppLayout({ user, adapter, data, organizationId, apiBaseUrl, children, }: AppLayoutProps): react_jsx_runtime.JSX.Element;
|
|
183
188
|
|
|
184
189
|
interface NavMainProps {
|
|
185
190
|
items: NavigationItem[];
|
package/dist/index.js
CHANGED
|
@@ -1264,32 +1264,21 @@ function AppLayout({
|
|
|
1264
1264
|
data,
|
|
1265
1265
|
organizationId,
|
|
1266
1266
|
apiBaseUrl,
|
|
1267
|
-
useApiNavigation,
|
|
1268
|
-
headerContent,
|
|
1269
|
-
showHeader = true,
|
|
1270
1267
|
children
|
|
1271
1268
|
}) {
|
|
1272
|
-
const isApiMode = useApiNavigation === true;
|
|
1273
|
-
const navigationApiBaseUrl = apiBaseUrl;
|
|
1274
1269
|
return /* @__PURE__ */ jsxRuntime.jsxs(SidebarProvider, { children: [
|
|
1275
1270
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1276
1271
|
AppSidebar,
|
|
1277
1272
|
{
|
|
1278
1273
|
user,
|
|
1279
1274
|
adapter,
|
|
1280
|
-
data
|
|
1275
|
+
data,
|
|
1281
1276
|
organizationId,
|
|
1282
|
-
apiBaseUrl
|
|
1277
|
+
apiBaseUrl
|
|
1283
1278
|
}
|
|
1284
1279
|
),
|
|
1285
1280
|
/* @__PURE__ */ jsxRuntime.jsxs(SidebarInset, { children: [
|
|
1286
|
-
|
|
1287
|
-
/* @__PURE__ */ jsxRuntime.jsx(SidebarTrigger, {}),
|
|
1288
|
-
headerContent && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1289
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-px bg-border" }),
|
|
1290
|
-
headerContent
|
|
1291
|
-
] })
|
|
1292
|
-
] }),
|
|
1281
|
+
/* @__PURE__ */ jsxRuntime.jsx(SidebarTrigger, {}),
|
|
1293
1282
|
/* @__PURE__ */ jsxRuntime.jsx("main", { className: "flex flex-1 flex-col gap-4 p-4 md:p-6", children })
|
|
1294
1283
|
] })
|
|
1295
1284
|
] });
|