@alfakit/react 0.1.1 → 0.1.6
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/CHANGELOG.md +16 -0
- package/dist/components/actions/action-button.d.ts.map +1 -1
- package/dist/components/actions/action-button.js +5 -4
- package/dist/components/actions/action-button.js.map +1 -1
- package/dist/components/actions/action-modals.d.ts.map +1 -1
- package/dist/components/actions/action-modals.js +6 -5
- package/dist/components/actions/action-modals.js.map +1 -1
- package/dist/components/ai/copilot.d.ts +3 -1
- package/dist/components/ai/copilot.d.ts.map +1 -1
- package/dist/components/ai/copilot.js +4 -1
- package/dist/components/ai/copilot.js.map +1 -1
- package/dist/components/cms/live-preview.js +3 -2
- package/dist/components/cms/live-preview.js.map +1 -1
- package/dist/components/cms/page.js +1 -1
- package/dist/components/fields/builder.js +15 -6
- package/dist/components/fields/builder.js.map +1 -1
- package/dist/components/fields/color-picker.js +1 -0
- package/dist/components/fields/color-picker.js.map +1 -1
- package/dist/components/fields/file-upload.js +11 -10
- package/dist/components/fields/file-upload.js.map +1 -1
- package/dist/components/fields/image-editor-dialog.js +4 -2
- package/dist/components/fields/image-editor-dialog.js.map +1 -1
- package/dist/components/fields/item-actions.js +10 -10
- package/dist/components/fields/item-actions.js.map +1 -1
- package/dist/components/fields/key-value.d.ts.map +1 -1
- package/dist/components/fields/key-value.js +3 -3
- package/dist/components/fields/key-value.js.map +1 -1
- package/dist/components/fields/modal-table-select.js +6 -5
- package/dist/components/fields/modal-table-select.js.map +1 -1
- package/dist/components/fields/one-time-code-input.js +1 -1
- package/dist/components/fields/one-time-code-input.js.map +1 -1
- package/dist/components/fields/repeater-table.js +12 -1
- package/dist/components/fields/repeater-table.js.map +1 -1
- package/dist/components/fields/repeater.js +2 -2
- package/dist/components/fields/repeater.js.map +1 -1
- package/dist/components/fields/rich-editor.js +2 -1
- package/dist/components/fields/rich-editor.js.map +1 -1
- package/dist/components/fields/select.js +3 -3
- package/dist/components/fields/select.js.map +1 -1
- package/dist/components/file-manager/file-manager.js +1 -1
- package/dist/components/file-manager/file-manager.js.map +1 -1
- package/dist/components/form/form-block.d.ts.map +1 -1
- package/dist/components/form/form-block.js +14 -2
- package/dist/components/form/form-block.js.map +1 -1
- package/dist/components/form/form-context.js +7 -3
- package/dist/components/form/form-context.js.map +1 -1
- package/dist/components/kanban/kanban.js +4 -3
- package/dist/components/kanban/kanban.js.map +1 -1
- package/dist/components/layout/fused-group.js +1 -0
- package/dist/components/layout/fused-group.js.map +1 -1
- package/dist/components/layout/section.js +2 -2
- package/dist/components/layout/section.js.map +1 -1
- package/dist/components/layout/tabs.d.ts.map +1 -1
- package/dist/components/layout/tabs.js +54 -15
- package/dist/components/layout/tabs.js.map +1 -1
- package/dist/components/panel/app-sidebar.d.ts +2 -3
- package/dist/components/panel/app-sidebar.d.ts.map +1 -1
- package/dist/components/panel/app-sidebar.js +1 -24
- package/dist/components/panel/app-sidebar.js.map +1 -1
- package/dist/components/panel/brand.d.ts +10 -0
- package/dist/components/panel/brand.d.ts.map +1 -0
- package/dist/components/panel/brand.js +37 -0
- package/dist/components/panel/brand.js.map +1 -0
- package/dist/components/panel/global-search.js +1 -0
- package/dist/components/panel/global-search.js.map +1 -1
- package/dist/components/panel/index.d.ts +2 -1
- package/dist/components/panel/shortcut-keys.js +1 -0
- package/dist/components/panel/shortcut-keys.js.map +1 -1
- package/dist/components/panel/tenant-menu.js +2 -2
- package/dist/components/panel/tenant-menu.js.map +1 -1
- package/dist/components/panel/topbar.js +1 -1
- package/dist/components/realtime/live-records-pill.d.ts.map +1 -1
- package/dist/components/realtime/live-records-pill.js +6 -3
- package/dist/components/realtime/live-records-pill.js.map +1 -1
- package/dist/components/table/cells.d.ts +6 -0
- package/dist/components/table/cells.d.ts.map +1 -1
- package/dist/components/table/cells.js +15 -3
- package/dist/components/table/cells.js.map +1 -1
- package/dist/components/table/column-manager.js +8 -7
- package/dist/components/table/column-manager.js.map +1 -1
- package/dist/components/table/content-layout.js +2 -1
- package/dist/components/table/content-layout.js.map +1 -1
- package/dist/components/table/grouping.js +11 -1
- package/dist/components/table/grouping.js.map +1 -1
- package/dist/components/table/pagination.js +16 -13
- package/dist/components/table/pagination.js.map +1 -1
- package/dist/components/table/table-block.js +14 -4
- package/dist/components/table/table-block.js.map +1 -1
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +3 -1
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +3 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +3 -1
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/tooltip.js +3 -1
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components.css +347 -0
- package/dist/context.d.ts +5 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +5 -1
- package/dist/context.js.map +1 -1
- package/dist/create-alfakit.d.ts.map +1 -1
- package/dist/create-alfakit.js +8 -5
- package/dist/create-alfakit.js.map +1 -1
- package/dist/eject-manifest.json +16 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +24 -21
- package/dist/layouts/app-layout.d.ts.map +1 -1
- package/dist/layouts/app-layout.js +2 -29
- package/dist/layouts/app-layout.js.map +1 -1
- package/dist/layouts/auth-layout.js +2 -2
- package/dist/layouts/auth-layout.js.map +1 -1
- package/dist/layouts/fullscreen-layout.js +1 -1
- package/dist/layouts/fullscreen-layout.js.map +1 -1
- package/dist/layouts/lazy-layouts.js +15 -0
- package/dist/layouts/lazy-layouts.js.map +1 -0
- package/dist/layouts/max-widths.js +34 -0
- package/dist/layouts/max-widths.js.map +1 -0
- package/dist/layouts/panel-layouts.d.ts +10 -0
- package/dist/layouts/panel-layouts.d.ts.map +1 -0
- package/dist/layouts/panel-layouts.js +20 -0
- package/dist/layouts/panel-layouts.js.map +1 -0
- package/dist/layouts/top-nav-layout.js +2 -2
- package/dist/layouts/top-nav-layout.js.map +1 -1
- package/dist/pages/page.d.ts.map +1 -1
- package/dist/pages/page.js +12 -7
- package/dist/pages/page.js.map +1 -1
- package/dist/standalone/alfakit-component.js +11 -6
- package/dist/standalone/alfakit-component.js.map +1 -1
- package/dist/standalone/alfakit-toaster.d.ts.map +1 -1
- package/dist/standalone/alfakit-toaster.js +8 -1
- package/dist/standalone/alfakit-toaster.js.map +1 -1
- package/dist/standalone.css +54 -0
- package/dist/starter-kit/dashboard-widgets.d.ts +33 -0
- package/dist/starter-kit/dashboard-widgets.d.ts.map +1 -0
- package/dist/starter-kit/dashboard-widgets.js +53 -0
- package/dist/starter-kit/dashboard-widgets.js.map +1 -0
- package/dist/starter-kit/impersonation-banner.js +34 -0
- package/dist/starter-kit/impersonation-banner.js.map +1 -0
- package/dist/starter-kit/index.d.ts +3 -2
- package/dist/starter-kit/index.js +3 -2
- package/dist/starter-kit/starter-kit.d.ts +6 -0
- package/dist/starter-kit/starter-kit.d.ts.map +1 -1
- package/dist/starter-kit/starter-kit.js +18 -7
- package/dist/starter-kit/starter-kit.js.map +1 -1
- package/dist/starter-kit/widgets-loaded.js +21 -5
- package/dist/starter-kit/widgets-loaded.js.map +1 -1
- package/dist/starter-kit/widgets-triggers.js +35 -3
- package/dist/starter-kit/widgets-triggers.js.map +1 -1
- package/dist/starter-kit/widgets.d.ts +13 -5
- package/dist/starter-kit/widgets.d.ts.map +1 -1
- package/dist/starter-kit/widgets.js +56 -18
- package/dist/starter-kit/widgets.js.map +1 -1
- package/dist/styles.css +15 -2
- package/dist/themes.css +8 -335
- package/package.json +2 -2
- package/src/components/actions/action-button.tsx +7 -4
- package/src/components/actions/action-modals.tsx +13 -1
- package/src/components/ai/copilot.tsx +14 -1
- package/src/components/cms/live-preview.tsx +5 -2
- package/src/components/fields/builder.tsx +14 -5
- package/src/components/fields/color-picker.tsx +1 -0
- package/src/components/fields/file-upload.tsx +21 -10
- package/src/components/fields/image-editor-dialog.tsx +7 -2
- package/src/components/fields/item-actions.tsx +32 -9
- package/src/components/fields/key-value.tsx +3 -2
- package/src/components/fields/modal-table-select.tsx +8 -3
- package/src/components/fields/one-time-code-input.tsx +1 -1
- package/src/components/fields/repeater-table.tsx +12 -1
- package/src/components/fields/repeater.tsx +2 -3
- package/src/components/fields/rich-editor.tsx +3 -0
- package/src/components/fields/select.tsx +7 -3
- package/src/components/file-manager/file-manager.tsx +1 -1
- package/src/components/form/form-block.tsx +26 -1
- package/src/components/form/form-context.tsx +3 -6
- package/src/components/kanban/kanban.tsx +16 -3
- package/src/components/layout/fused-group.tsx +5 -1
- package/src/components/layout/section.tsx +2 -2
- package/src/components/layout/tabs.tsx +72 -17
- package/src/components/panel/app-sidebar.tsx +2 -38
- package/src/components/panel/brand.tsx +46 -0
- package/src/components/panel/global-search.tsx +1 -1
- package/src/components/panel/shortcut-keys.tsx +4 -1
- package/src/components/panel/tenant-menu.tsx +2 -2
- package/src/components/realtime/live-records-pill.tsx +4 -3
- package/src/components/table/cells.tsx +27 -5
- package/src/components/table/column-manager.tsx +12 -10
- package/src/components/table/content-layout.tsx +5 -1
- package/src/components/table/grouping.tsx +15 -1
- package/src/components/table/pagination.tsx +16 -9
- package/src/components/table/table-block.tsx +25 -12
- package/src/components/ui/dialog.tsx +5 -1
- package/src/components/ui/popover.tsx +5 -1
- package/src/components/ui/sheet.tsx +5 -1
- package/src/components/ui/tooltip.tsx +5 -1
- package/src/context.tsx +10 -0
- package/src/create-alfakit.tsx +11 -2
- package/src/index.ts +2 -0
- package/src/layouts/app-layout.tsx +4 -28
- package/src/layouts/auth-layout.tsx +2 -2
- package/src/layouts/fullscreen-layout.tsx +1 -1
- package/src/layouts/lazy-layouts.ts +14 -0
- package/src/layouts/max-widths.ts +29 -0
- package/src/layouts/panel-layouts.ts +17 -0
- package/src/layouts/top-nav-layout.tsx +2 -2
- package/src/pages/page.tsx +21 -12
- package/src/standalone/alfakit-component.tsx +18 -7
- package/src/standalone/alfakit-toaster.tsx +21 -2
- package/src/starter-kit/dashboard-widgets.tsx +78 -0
- package/src/starter-kit/impersonation-banner.tsx +48 -0
- package/src/starter-kit/index.ts +2 -0
- package/src/starter-kit/starter-kit.tsx +31 -4
- package/src/starter-kit/widgets-loaded.tsx +23 -1
- package/src/starter-kit/widgets-triggers.tsx +37 -2
- package/src/starter-kit/widgets.tsx +95 -20
- package/src/styles.css +15 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-alfakit.js","names":[],"sources":["../src/create-alfakit.tsx"],"sourcesContent":["import {\n ActionRunner,\n PANEL_TOAST_OFFSET,\n Translator,\n applyDocumentLocale,\n applyPanelTheme,\n configureCharts,\n configureRealtime,\n debugRecorder,\n effectiveErrorNotifications,\n initializeAppearance,\n installErrorNotifications,\n installPrefetchInvalidation,\n installSpaUrlExceptions,\n registerRichEditorExtensions,\n reloadOnExpiredPage,\n resolveRequestErrorNotification,\n resolveToastPosition,\n setRequestErrorReporter,\n whenIdle,\n type AlfakitOptions,\n type AlfakitPageProps,\n type ErrorNotificationsSchema,\n type PanelSchema,\n} from '@alfakit/core'\nimport type { InertiaAppSSRResponse, Page } from '@inertiajs/core'\nimport { createInertiaApp, router, usePage } from '@inertiajs/react'\nimport { Direction } from 'radix-ui'\nimport {\n StrictMode,\n createElement,\n useLayoutEffect,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { ActionModals } from './components/actions/action-modals'\nimport { DevToolsSlot } from './components/dev-tools/dev-tools-slot'\nimport { FlashToasts, showToast } from './components/notifications/flash-toasts'\nimport { RealtimeNotifications } from './components/notifications/realtime-notifications'\nimport { ImpersonationBanner } from './components/panel/impersonation-banner'\nimport { PwaManager } from './components/panel/pwa'\nimport { SchemaContractGuard } from './components/panel/schema-contract-guard'\nimport { Toaster } from './components/ui/sonner'\nimport { TooltipProvider } from './components/ui/tooltip'\nimport { AlfakitProvider, useAlfakit, type AlfakitContextValue, type AnyComponent } from './context'\nimport { discoverComponents } from './lib/discovery'\nimport { preloadIcons } from './lib/icons'\nimport { AlfakitPage } from './pages/page'\nimport { builtInComponents, createDefaultRegistry } from './registry'\n\n/**\n * Rendered inside Inertia's page tree, so it follows the current page: the reading\n * direction for Radix primitives, modals and toasts.\n */\nexport function AlfakitRoot({\n children,\n toasterId,\n}: {\n children: ReactNode\n /** Starter kit mode: Alfakit's toaster gets an id so the host's id-less one never doubles its toasts. */\n toasterId?: string\n}) {\n const panel = usePage<AlfakitPageProps>().props.alfakit\n const { translator, registry } = useAlfakit()\n const localization = panel?.localization\n const direction = localization?.direction ?? 'ltr'\n\n // Every visit (including the redirect after a language switch) may carry new strings,\n // so the translator is updated before children render.\n if (panel) {\n translator.setTranslations(panel.translations ?? {})\n translator.setLocale(localization?.tag ?? 'en')\n }\n\n useLayoutEffect(() => {\n applyDocumentLocale(localization)\n }, [localization])\n\n useLayoutEffect(() => {\n applyPanelTheme(panel)\n }, [panel])\n\n return (\n <Direction.Provider dir={direction}>\n <TooltipProvider delayDuration={0}>\n <SchemaContractGuard panel={panel}>{children}</SchemaContractGuard>\n <ActionModals />\n <FlashToasts />\n <RealtimeNotifications />\n {/* `Panel::pwa()`: service worker and the \"new version\" toast. */}\n <PwaManager />\n {/* Schema inspector: renders (and loads its code) only with `alfakitDevTools`. */}\n <DevToolsSlot />\n {/* Replace with createAlfakit({ components: { 'panel:impersonation-banner': … } }). */}\n {panel?.impersonation &&\n createElement(registry.resolve('panel:impersonation-banner') ?? ImpersonationBanner, {\n impersonation: panel.impersonation,\n })}\n <Toaster\n id={toasterId}\n position={resolveToastPosition(panel?.toastPosition, direction)}\n offset={PANEL_TOAST_OFFSET}\n mobileOffset={PANEL_TOAST_OFFSET}\n dir={direction}\n richColors\n closeButton\n />\n </TooltipProvider>\n </Direction.Provider>\n )\n}\n\nexport interface CreateAlfakitOptions extends AlfakitOptions<AnyComponent> {\n /** Wrap the whole app (e.g. with your own providers). */\n withApp?: (app: ReactNode) => ReactNode\n strictMode?: boolean\n}\n\n/** Renders one Inertia page to HTML: what `createInertiaApp` returns on the server. */\nexport type AlfakitRenderFunction = (\n page: Page,\n renderToString: (element: ReactElement) => string,\n) => Promise<InertiaAppSSRResponse>\n\n/**\n * The Inertia app shared by `createAlfakit()` (browser) and `createAlfakitServer()` (Node):\n * the same registry, pages, layout and providers. In the browser it mounts, or hydrates\n * server-rendered markup; on the server (no `window`) Inertia returns a render function.\n */\nexport function bootAlfakit(\n options: CreateAlfakitOptions = {},\n): Promise<void | AlfakitRenderFunction> {\n // Auto-registered files sit between the built-ins and the explicit `components` / `pages`.\n const discovered = discoverComponents(options.discover)\n const registry = createDefaultRegistry()\n .registerMany(discovered.components)\n .registerMany(options.components ?? {})\n const pages: Record<string, AnyComponent> = {\n 'Alfakit/Page': AlfakitPage,\n ...discovered.pages,\n ...options.pages,\n }\n const isServer = typeof window === 'undefined'\n\n // Every panel page draws named icons: fetch `lucide-react/dynamic` while booting.\n preloadIcons()\n\n // `'js:name'` chart option callbacks and Chart.js plugins for every chart widget.\n configureCharts(options)\n // `createAlfakit({ echo })`: Laravel Echo for `Panel::realtime()` without `window.Echo`.\n if (options.echo !== undefined && !isServer) configureRealtime(null, { echo: options.echo })\n // Rich content plugin extensions, loaded when an editor needs them.\n registerRichEditorExtensions(options.richEditorExtensions ?? {})\n\n // The browser's current panel, read by the SPA-exception and error-notification listeners.\n let currentPanel: PanelSchema | null = null\n // The open page's error notifications (its override, else the panel's).\n let currentErrorNotifications: ErrorNotificationsSchema | false | undefined\n\n // One translator and action runner for the browser session; a server render gets fresh\n // ones per request so concurrent renders never share a locale or endpoints.\n const createContext = (): AlfakitContextValue => {\n const translator = new Translator()\n\n return {\n registry,\n pages,\n translator,\n // The runner's endpoints are refreshed on every navigation from the shared props.\n actions: new ActionRunner({\n endpoints: { action: '', modal: '' },\n // A failed action request is a toast, never a silent no-op.\n onError: (error) => {\n const notification = resolveRequestErrorNotification(\n error,\n currentErrorNotifications,\n (key, replacements, fallback) => translator.t(key, replacements, fallback),\n )\n\n if (notification) showToast(notification)\n },\n }),\n }\n }\n\n const browserContext = isServer ? null : createContext()\n\n const sync = (context: AlfakitContextValue, page: Page, applyToDocument: boolean) => {\n const props = page.props as unknown as AlfakitPageProps\n const panel = props.alfakit\n\n if (!panel) return\n\n if (context === browserContext) {\n currentPanel = panel\n currentErrorNotifications = effectiveErrorNotifications(panel, props.page)\n }\n\n context.translator.setTranslations(panel.translations ?? {})\n context.translator.setLocale(panel.localization?.tag ?? 'en')\n context.actions.setEndpoints({\n action: panel.endpoints.action ?? '',\n modal: panel.endpoints.modal ?? '',\n })\n\n if (applyToDocument) {\n applyDocumentLocale(panel.localization)\n applyPanelTheme(panel)\n // Internal requests and form stores are only recorded while the page carries the debug prop.\n debugRecorder.setEnabled(props.alfakitDebug !== undefined)\n }\n }\n\n if (browserContext) {\n router.on('navigate', (event) => sync(browserContext, event.detail.page, true))\n reloadOnExpiredPage()\n // Prefetched pages and deferred table totals are dropped after every mutation.\n installPrefetchInvalidation()\n installSpaUrlExceptions(() => currentPanel)\n installErrorNotifications(\n () => ({ errorNotifications: currentErrorNotifications }),\n (notification) => showToast(notification),\n )\n // Failed internal requests without their own handler (form live refreshes, step\n // validation) show the configured error notification too.\n setRequestErrorReporter((error) => {\n const notification = resolveRequestErrorNotification(\n error,\n currentErrorNotifications,\n (key, replacements, fallback) => browserContext.translator.t(key, replacements, fallback),\n )\n\n if (notification) showToast(notification)\n })\n }\n\n return createInertiaApp<AlfakitPageProps>({\n title: (title) => title,\n progress: options.progress === undefined ? { color: 'var(--primary)' } : options.progress,\n resolve: (name, page) => {\n const component = pages[name]\n\n if (!component) {\n throw new Error(\n `Alfakit: page component \"${name}\" is not registered. Pass it to createAlfakit({ pages }).`,\n )\n }\n\n // The page's auto-registered components load first, so the server render and the\n // hydration both show them (no flash, no mismatch).\n // Built-ins split per type (`builtInComponents`) load the same way.\n const pending = [\n builtInComponents.preloadFor(page),\n discovered.discovery.preloadFor(page),\n ].filter((promise) => promise !== undefined)\n\n return pending.length > 0 ? Promise.all(pending).then(() => component) : component\n },\n layout: () => AlfakitRoot,\n strictMode: options.strictMode ?? true,\n withApp: (app, { page, ssr }) => {\n const context = browserContext ?? createContext()\n\n sync(context, page as Page, !ssr)\n\n // Panel pages only: other pages (`pages` option) follow the application's own dark\n // mode, like standalone components do.\n const panel = (page.props as unknown as Partial<AlfakitPageProps>).alfakit\n\n if (!ssr && panel) {\n initializeAppearance(panel)\n }\n\n const tree = <AlfakitProvider value={context}>{app}</AlfakitProvider>\n\n const wrapped = options.withApp ? options.withApp(tree) : tree\n\n return options.strictMode === false ? <>{wrapped}</> : <StrictMode>{wrapped}</StrictMode>\n },\n }) as Promise<void | AlfakitRenderFunction>\n}\n\n/**\n * Boot the Alfakit panel frontend. Call once from your panel entry file. Markup rendered by\n * `createAlfakitServer()` (`@alfakit/react/server`) is hydrated instead of re-rendered.\n *\n * ```tsx\n * createAlfakit({\n * // Files in resources/js/alfakit/fields, columns, … register themselves.\n * discover: import.meta.glob('./{fields,columns,entries,widgets,pages,components,blocks}/**\\/*.tsx'),\n * components: { 'map-picker': MapPicker },\n * })\n * ```\n */\nexport async function createAlfakit(options: CreateAlfakitOptions = {}): Promise<void> {\n await bootAlfakit(options)\n\n // After the first render: the remaining split built-ins (action modals' fields).\n whenIdle(() => void builtInComponents.preloadAll())\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"create-alfakit.js","names":[],"sources":["../src/create-alfakit.tsx"],"sourcesContent":["import {\n ActionRunner,\n PANEL_TOAST_OFFSET,\n Translator,\n applyDocumentLocale,\n applyPanelTheme,\n configureCharts,\n configureRealtime,\n debugRecorder,\n documentNonce,\n effectiveErrorNotifications,\n initializeAppearance,\n installErrorNotifications,\n installPrefetchInvalidation,\n installSpaUrlExceptions,\n registerRichEditorExtensions,\n reloadOnExpiredPage,\n resolveRequestErrorNotification,\n resolveToastPosition,\n setRequestErrorReporter,\n whenIdle,\n type AlfakitOptions,\n type AlfakitPageProps,\n type ErrorNotificationsSchema,\n type PanelSchema,\n} from '@alfakit/core'\nimport type { InertiaAppSSRResponse, Page } from '@inertiajs/core'\nimport { createInertiaApp, router, usePage } from '@inertiajs/react'\nimport { Direction } from 'radix-ui'\nimport {\n StrictMode,\n createElement,\n useLayoutEffect,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { ActionModals } from './components/actions/action-modals'\nimport { DevToolsSlot } from './components/dev-tools/dev-tools-slot'\nimport { FlashToasts, showToast } from './components/notifications/flash-toasts'\nimport { RealtimeNotifications } from './components/notifications/realtime-notifications'\nimport { ImpersonationBanner } from './components/panel/impersonation-banner'\nimport { PwaManager } from './components/panel/pwa'\nimport { SchemaContractGuard } from './components/panel/schema-contract-guard'\nimport { Toaster } from './components/ui/sonner'\nimport { TooltipProvider } from './components/ui/tooltip'\nimport { AlfakitProvider, useAlfakit, type AlfakitContextValue, type AnyComponent } from './context'\nimport { panelLayouts } from './layouts/panel-layouts'\nimport { discoverComponents } from './lib/discovery'\nimport { preloadIcons } from './lib/icons'\nimport { AlfakitPage } from './pages/page'\nimport { builtInComponents, createDefaultRegistry } from './registry'\n\n/**\n * Rendered inside Inertia's page tree, so it follows the current page: the reading\n * direction for Radix primitives, modals and toasts.\n */\nexport function AlfakitRoot({\n children,\n toasterId,\n}: {\n children: ReactNode\n /** Starter kit mode: Alfakit's toaster gets an id so the host's id-less one never doubles its toasts. */\n toasterId?: string\n}) {\n const panel = usePage<AlfakitPageProps>().props.alfakit\n const { translator, registry } = useAlfakit()\n const localization = panel?.localization\n const direction = localization?.direction ?? 'ltr'\n\n // Every visit (including the redirect after a language switch) may carry new strings,\n // so the translator is updated before children render.\n if (panel) {\n translator.setTranslations(panel.translations ?? {})\n translator.setLocale(localization?.tag ?? 'en')\n }\n\n // Starter kit mode: the host app owns `<html lang dir>` (its own pages and layout are not\n // mirrored); `AlfakitStarterKitRoot` puts the direction on Alfakit's own root element.\n const ownsDocument = panel?.starterKit !== true\n\n useLayoutEffect(() => {\n if (ownsDocument) applyDocumentLocale(localization)\n }, [localization, ownsDocument])\n\n useLayoutEffect(() => {\n applyPanelTheme(panel)\n }, [panel])\n\n return (\n <Direction.Provider dir={direction}>\n <TooltipProvider delayDuration={0}>\n <SchemaContractGuard panel={panel}>{children}</SchemaContractGuard>\n <ActionModals />\n <FlashToasts />\n <RealtimeNotifications />\n {/* `Panel::pwa()`: service worker and the \"new version\" toast. */}\n <PwaManager />\n {/* Schema inspector: renders (and loads its code) only with `alfakitDevTools`. */}\n <DevToolsSlot />\n {/* Replace with createAlfakit({ components: { 'panel:impersonation-banner': … } }). */}\n {panel?.impersonation &&\n createElement(registry.resolve('panel:impersonation-banner') ?? ImpersonationBanner, {\n impersonation: panel.impersonation,\n })}\n <Toaster\n id={toasterId}\n position={resolveToastPosition(panel?.toastPosition, direction)}\n offset={PANEL_TOAST_OFFSET}\n mobileOffset={PANEL_TOAST_OFFSET}\n dir={direction}\n richColors\n closeButton\n />\n </TooltipProvider>\n </Direction.Provider>\n )\n}\n\nexport interface CreateAlfakitOptions extends AlfakitOptions<AnyComponent> {\n /** Wrap the whole app (e.g. with your own providers). */\n withApp?: (app: ReactNode) => ReactNode\n strictMode?: boolean\n}\n\n/** Renders one Inertia page to HTML: what `createInertiaApp` returns on the server. */\nexport type AlfakitRenderFunction = (\n page: Page,\n renderToString: (element: ReactElement) => string,\n) => Promise<InertiaAppSSRResponse>\n\n/**\n * The Inertia app shared by `createAlfakit()` (browser) and `createAlfakitServer()` (Node):\n * the same registry, pages, layout and providers. In the browser it mounts, or hydrates\n * server-rendered markup; on the server (no `window`) Inertia returns a render function.\n */\nexport function bootAlfakit(\n options: CreateAlfakitOptions = {},\n): Promise<void | AlfakitRenderFunction> {\n // Auto-registered files sit between the built-ins and the explicit `components` / `pages`.\n const discovered = discoverComponents(options.discover)\n const registry = createDefaultRegistry()\n .registerMany(panelLayouts)\n .registerMany(discovered.components)\n .registerMany(options.components ?? {})\n const pages: Record<string, AnyComponent> = {\n 'Alfakit/Page': AlfakitPage,\n ...discovered.pages,\n ...options.pages,\n }\n const isServer = typeof window === 'undefined'\n\n // Every panel page draws named icons: fetch `lucide-react/dynamic` while booting.\n preloadIcons()\n\n // `'js:name'` chart option callbacks and Chart.js plugins for every chart widget.\n configureCharts(options)\n // `createAlfakit({ echo })`: Laravel Echo for `Panel::realtime()` without `window.Echo`.\n if (options.echo !== undefined && !isServer) configureRealtime(null, { echo: options.echo })\n // Rich content plugin extensions, loaded when an editor needs them.\n registerRichEditorExtensions(options.richEditorExtensions ?? {})\n\n // The browser's current panel, read by the SPA-exception and error-notification listeners.\n let currentPanel: PanelSchema | null = null\n // The open page's error notifications (its override, else the panel's).\n let currentErrorNotifications: ErrorNotificationsSchema | false | undefined\n\n // One translator and action runner for the browser session; a server render gets fresh\n // ones per request so concurrent renders never share a locale or endpoints.\n const createContext = (): AlfakitContextValue => {\n const translator = new Translator()\n\n return {\n registry,\n pages,\n translator,\n // The runner's endpoints are refreshed on every navigation from the shared props.\n actions: new ActionRunner({\n endpoints: { action: '', modal: '' },\n // A failed action request is a toast, never a silent no-op.\n onError: (error) => {\n const notification = resolveRequestErrorNotification(\n error,\n currentErrorNotifications,\n (key, replacements, fallback) => translator.t(key, replacements, fallback),\n )\n\n if (notification) showToast(notification)\n },\n }),\n }\n }\n\n const browserContext = isServer ? null : createContext()\n\n const sync = (context: AlfakitContextValue, page: Page, applyToDocument: boolean) => {\n const props = page.props as unknown as AlfakitPageProps\n const panel = props.alfakit\n\n if (!panel) return\n\n if (context === browserContext) {\n currentPanel = panel\n currentErrorNotifications = effectiveErrorNotifications(panel, props.page)\n }\n\n context.translator.setTranslations(panel.translations ?? {})\n context.translator.setLocale(panel.localization?.tag ?? 'en')\n context.actions.setEndpoints({\n action: panel.endpoints.action ?? '',\n modal: panel.endpoints.modal ?? '',\n })\n\n if (applyToDocument) {\n applyDocumentLocale(panel.localization)\n applyPanelTheme(panel)\n // Internal requests and form stores are only recorded while the page carries the debug prop.\n debugRecorder.setEnabled(props.alfakitDebug !== undefined)\n }\n }\n\n if (browserContext) {\n router.on('navigate', (event) => sync(browserContext, event.detail.page, true))\n reloadOnExpiredPage()\n // Prefetched pages and deferred table totals are dropped after every mutation.\n installPrefetchInvalidation()\n installSpaUrlExceptions(() => currentPanel)\n installErrorNotifications(\n () => ({ errorNotifications: currentErrorNotifications }),\n (notification) => showToast(notification),\n )\n // Failed internal requests without their own handler (form live refreshes, step\n // validation) show the configured error notification too.\n setRequestErrorReporter((error) => {\n const notification = resolveRequestErrorNotification(\n error,\n currentErrorNotifications,\n (key, replacements, fallback) => browserContext.translator.t(key, replacements, fallback),\n )\n\n if (notification) showToast(notification)\n })\n }\n\n return createInertiaApp<AlfakitPageProps>({\n title: (title) => title,\n progress: options.progress === undefined ? { color: 'var(--primary)' } : options.progress,\n // The page's CSP nonce, so the progress bar's injected <style> passes a nonce-based policy.\n nonce: documentNonce(),\n resolve: (name, page) => {\n const component = pages[name]\n\n if (!component) {\n throw new Error(\n `Alfakit: page component \"${name}\" is not registered. Pass it to createAlfakit({ pages }).`,\n )\n }\n\n // The page's auto-registered components load first, so the server render and the\n // hydration both show them (no flash, no mismatch).\n // Built-ins split per type (`builtInComponents`) load the same way.\n const pending = [\n builtInComponents.preloadFor(page),\n discovered.discovery.preloadFor(page),\n ].filter((promise) => promise !== undefined)\n\n return pending.length > 0 ? Promise.all(pending).then(() => component) : component\n },\n layout: () => AlfakitRoot,\n strictMode: options.strictMode ?? true,\n withApp: (app, { page, ssr }) => {\n const context = browserContext ?? createContext()\n\n sync(context, page as Page, !ssr)\n\n // Panel pages only: other pages (`pages` option) follow the application's own dark\n // mode, like standalone components do.\n const panel = (page.props as unknown as Partial<AlfakitPageProps>).alfakit\n\n if (!ssr && panel) {\n initializeAppearance(panel)\n }\n\n const tree = <AlfakitProvider value={context}>{app}</AlfakitProvider>\n\n const wrapped = options.withApp ? options.withApp(tree) : tree\n\n return options.strictMode === false ? <>{wrapped}</> : <StrictMode>{wrapped}</StrictMode>\n },\n }) as Promise<void | AlfakitRenderFunction>\n}\n\n/**\n * Boot the Alfakit panel frontend. Call once from your panel entry file. Markup rendered by\n * `createAlfakitServer()` (`@alfakit/react/server`) is hydrated instead of re-rendered.\n *\n * ```tsx\n * createAlfakit({\n * // Files in resources/js/alfakit/fields, columns, … register themselves.\n * discover: import.meta.glob('./{fields,columns,entries,widgets,pages,components,blocks}/**\\/*.tsx'),\n * components: { 'map-picker': MapPicker },\n * })\n * ```\n */\nexport async function createAlfakit(options: CreateAlfakitOptions = {}): Promise<void> {\n await bootAlfakit(options)\n\n // After the first render: the remaining split built-ins (action modals' fields).\n whenIdle(() => void builtInComponents.preloadAll())\n}\n"],"mappings":"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"}
|
package/dist/eject-manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@alfakit/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"adapter": "react",
|
|
5
|
-
"generatedAt": "2026-10-
|
|
5
|
+
"generatedAt": "2026-10-21T13:38:32.415Z",
|
|
6
6
|
"components": {
|
|
7
7
|
"TextInput": {
|
|
8
8
|
"file": "src/components/fields/text-input.tsx",
|
|
@@ -347,6 +347,9 @@
|
|
|
347
347
|
"PageHeader": "PageHeader",
|
|
348
348
|
"PageShell": "PageShell"
|
|
349
349
|
},
|
|
350
|
+
"src/layouts/panel-layouts.ts": {
|
|
351
|
+
"panelLayouts": "panelLayouts"
|
|
352
|
+
},
|
|
350
353
|
"src/registry.ts": {
|
|
351
354
|
"createDefaultRegistry": "createDefaultRegistry"
|
|
352
355
|
},
|
|
@@ -687,7 +690,9 @@
|
|
|
687
690
|
"UndoButton": "UndoButton"
|
|
688
691
|
},
|
|
689
692
|
"src/components/panel/app-sidebar.tsx": {
|
|
690
|
-
"AppSidebar": "AppSidebar"
|
|
693
|
+
"AppSidebar": "AppSidebar"
|
|
694
|
+
},
|
|
695
|
+
"src/components/panel/brand.tsx": {
|
|
691
696
|
"Brand": "Brand"
|
|
692
697
|
},
|
|
693
698
|
"src/components/panel/bottom-nav.tsx": {
|
|
@@ -899,6 +904,10 @@
|
|
|
899
904
|
"AlfakitToasterProps": "AlfakitToasterProps",
|
|
900
905
|
"configureAlfakit": "configureAlfakit"
|
|
901
906
|
},
|
|
907
|
+
"src/starter-kit/dashboard-widgets.tsx": {
|
|
908
|
+
"AlfakitWidgets": "AlfakitWidgets",
|
|
909
|
+
"AlfakitWidgetsProps": "AlfakitWidgetsProps"
|
|
910
|
+
},
|
|
902
911
|
"src/starter-kit/navigation.ts": {
|
|
903
912
|
"useAlfakitNavigation": "useAlfakitNavigation",
|
|
904
913
|
"AlfakitNavigation": "AlfakitNavigation"
|
|
@@ -911,12 +920,15 @@
|
|
|
911
920
|
"StarterKitPageOptions": "StarterKitPageOptions"
|
|
912
921
|
},
|
|
913
922
|
"src/starter-kit/widgets.tsx": {
|
|
923
|
+
"AlfakitCopilot": "AlfakitCopilot",
|
|
914
924
|
"AlfakitNotifications": "AlfakitNotifications",
|
|
915
925
|
"AlfakitSearch": "AlfakitSearch",
|
|
916
926
|
"AlfakitTenantSwitcher": "AlfakitTenantSwitcher",
|
|
917
927
|
"AlfakitHeaderWidgetProps": "AlfakitHeaderWidgetProps"
|
|
918
928
|
},
|
|
919
929
|
"src/starter-kit/index.ts": {
|
|
930
|
+
"AlfakitWidgets": "AlfakitWidgets",
|
|
931
|
+
"AlfakitWidgetsProps": "AlfakitWidgetsProps",
|
|
920
932
|
"useAlfakitNavigation": "useAlfakitNavigation",
|
|
921
933
|
"AlfakitNavigation": "AlfakitNavigation",
|
|
922
934
|
"AlfakitStarterKitRoot": "AlfakitStarterKitRoot",
|
|
@@ -924,6 +936,7 @@
|
|
|
924
936
|
"createStarterKitPage": "createStarterKitPage",
|
|
925
937
|
"StarterKitLayout": "StarterKitLayout",
|
|
926
938
|
"StarterKitPageOptions": "StarterKitPageOptions",
|
|
939
|
+
"AlfakitCopilot": "AlfakitCopilot",
|
|
927
940
|
"AlfakitNotifications": "AlfakitNotifications",
|
|
928
941
|
"AlfakitSearch": "AlfakitSearch",
|
|
929
942
|
"AlfakitTenantSwitcher": "AlfakitTenantSwitcher",
|
package/dist/index.d.ts
CHANGED
|
@@ -85,7 +85,8 @@ import { NotificationsMenu } from "./components/notifications/notifications-menu
|
|
|
85
85
|
import { RealtimeNotifications } from "./components/notifications/realtime-notifications.js";
|
|
86
86
|
import { UndoButton } from "./components/notifications/undo-button.js";
|
|
87
87
|
import "./components/notifications/index.js";
|
|
88
|
-
import {
|
|
88
|
+
import { Brand } from "./components/panel/brand.js";
|
|
89
|
+
import { AppSidebar } from "./components/panel/app-sidebar.js";
|
|
89
90
|
import { BottomNav } from "./components/panel/bottom-nav.js";
|
|
90
91
|
import { DebugPanelSlot } from "./components/panel/debug-panel-slot.js";
|
|
91
92
|
import { DebugPanel, DebugTreeNode } from "./components/panel/debug-panel.js";
|
|
@@ -138,14 +139,16 @@ import { DiscoveredComponents, discoverComponents, discoveredComponent } from ".
|
|
|
138
139
|
import { Icon } from "./lib/icons.js";
|
|
139
140
|
import { cn } from "./lib/utils.js";
|
|
140
141
|
import { AlfakitPage, ContentBlockRenderer, PageContent, PageHeader, PageShell } from "./pages/page.js";
|
|
142
|
+
import { panelLayouts } from "./layouts/panel-layouts.js";
|
|
141
143
|
import { createDefaultRegistry } from "./registry.js";
|
|
142
144
|
import { AlfakitComponent, AlfakitComponentProps } from "./standalone/alfakit-component.js";
|
|
143
145
|
import { AlfakitToaster, AlfakitToasterProps } from "./standalone/alfakit-toaster.js";
|
|
144
146
|
import { configureAlfakit } from "./standalone/configure.js";
|
|
145
147
|
import "./standalone/index.js";
|
|
148
|
+
import { AlfakitWidgets, AlfakitWidgetsProps } from "./starter-kit/dashboard-widgets.js";
|
|
146
149
|
import { AlfakitNavigation, useAlfakitNavigation } from "./starter-kit/navigation.js";
|
|
147
150
|
import { AlfakitStarterKitRoot, StarterKitContentLayout, StarterKitLayout, StarterKitPageOptions, createStarterKitPage } from "./starter-kit/starter-kit.js";
|
|
148
|
-
import { AlfakitHeaderWidgetProps, AlfakitNotifications, AlfakitSearch, AlfakitTenantSwitcher } from "./starter-kit/widgets.js";
|
|
151
|
+
import { AlfakitCopilot, AlfakitHeaderWidgetProps, AlfakitNotifications, AlfakitSearch, AlfakitTenantSwitcher } from "./starter-kit/widgets.js";
|
|
149
152
|
import "./starter-kit/index.js";
|
|
150
153
|
import { Alert, AlertDescription, AlertTitle } from "./components/ui/alert.js";
|
|
151
154
|
import { Avatar, AvatarFallback, AvatarImage } from "./components/ui/avatar.js";
|
|
@@ -177,4 +180,4 @@ import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, Tabl
|
|
|
177
180
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./components/ui/tabs.js";
|
|
178
181
|
import { Textarea } from "./components/ui/textarea.js";
|
|
179
182
|
export * from "@alfakit/core";
|
|
180
|
-
export { ActionButton, ActionGroupMenu, ActionList, ActionModals, AiCopilot, AiStream, Alert, AlertDescription, AlertTitle, AlfakitAnalytics, AlfakitComponent, type AlfakitComponentProps, type AlfakitContextValue, type AlfakitHeaderWidgetProps, type AlfakitNavigation, AlfakitNotifications, AlfakitPage, AlfakitProvider, AlfakitSearch, AlfakitStarterKitRoot, AlfakitTenantSwitcher, AlfakitToaster, type AlfakitToasterProps, AnalyticsBreakdown, type AnyComponent, AppLayout, AppPage, AppSidebar, AuthLayout, Avatar, AvatarFallback, AvatarImage, Badge, BlankLayout, BottomNav, Brand, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Breadcrumbs, BuilderField, Button, CMS_BLOCK_COMPONENTS, Calendar, CalendarWidget, CallToActionBlock, CalloutComponent, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartWidget, Checkbox, CheckboxField, CheckboxListField, CmsBlockHeading, type CmsBlockProps, CmsBlocks, type CmsContextValue, CmsFooter, CmsHead, CmsHeader, CmsImage, CmsLanguageSwitcher, CmsLinkButton, CmsLivePreview, CmsMenuList, CmsNav, CmsPage, CmsProvider, CodeEditorField, CodeEntryComponent, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorEntryComponent, ColorPickerField, ColumnManager, ColumnsBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConflictBanner, ContentBlockRenderer, ContentLayout, ContentLayoutSort, type CreateAlfakitOptions, CustomizableWidgetGrid, DataTable, DatePickerField, DebugPanel, DebugPanelSlot, DebugTreeNode, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type DiscoveredComponents, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmbedBlock, EmptyStateComponent, EntryPlaceholder, EntryWrapper, FaqBlock, FeaturesBlock, type FieldBinding, FieldWrapper, FieldsetComponent, FileManager, FileManagerPickerField, FileUploadField, FilterIndicators, FlashToasts, FlexComponent, FormBlock, FormProvider, FormattedText, FullscreenLayout, type FullscreenLayoutProps, FusedGroupComponent, GalleryBlock, GlobalSearch, GridComponent, HelpdeskChat, type HelpdeskChatProps, HelpdeskInbox, HeroBlock, HiddenField, HtmlComponent, Icon, IconComponent, IconEntryComponent, IconPickerField, ImageBlock, ImageComponent, ImageEntryComponent, ImpersonationBanner, Input, Kanban, KeyValueEntryComponent, KeyValueField, KeyboardShortcuts, Label, LazyPlaceholder, LiveRecordsPill, LocaleSubMenu, LocaleSwitcher, MixedContent, ModalTableSelectField, MoneyInputField, NotificationActionButton, NotificationsMenu, OneTimeCodeInputField, PageActionProvider, PageBlock, type PageBlockProps, PageContent, PageForm, PageHeader, PageInfolist, type PageMethodBinding, type PageMethodMap, type PageMethodsBinding, PageShell, PageTable, PageWidgets, PlaceholderComponent, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PwaManager, PwaMenuItems, QueryBuilderRulesField, RadioField, RadioGroup, RadioGroupItem, RealtimeNotifications, RecordCell, RecordPresence, RecordVersionsComponent, RenderComponent, RepeatableEntryComponent, RepeaterField, RichEditorField, RichTextBlock, SchemaChildren, SchemaRenderer, ScrollArea, ScrollBar, SectionBlock, SectionComponent, Select, SelectContent, SelectField, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShortcutKeys, ShortcutsOverlay, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignInLink, Skeleton, SliderField, Slot, Spinner, Spreadsheet, type StandaloneContextValue, StandaloneProvider, StarterKitContentLayout, type StarterKitLayout, type StarterKitPageOptions, StatsOverviewWidget, Switch, Table, TableBody, TableCaption, TableCell, TableCellContent, TableFilters, TableFooter, TableHead, TableHeader, TablePagination, TableRow, TableViews, Tabs, TabsComponent, TabsContent, TabsList, TabsTrigger, TagsInputField, TenantMenu, TestimonialsBlock, TextComponent, TextEntryComponent, TextInputField, Textarea, TextareaField, ThemeToggle, Toaster, ToggleButtonsField, ToggleField, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopNavLayout, Topbar, TopbarLocaleSwitcher, TranslationManager, Tree, UndoButton, UnorderedListComponent, type UsePageMethodOptions, UserAvatar, UserMenu, ViewComponent, ViewEntryComponent, type VirtualListBinding, WidgetGrid, WidgetRenderer, WizardComponent, badgeColorClasses, badgeVariants, buttonVariants, cn, colorClass, configureAlfakit, createAlfakit, createDefaultRegistry, createStarterKitPage, cssColor, discoverComponents, discoveredComponent, extraProps, ghostButtonColorClasses, iconBackgroundColorClasses, iconSizeClasses, installPwa, outlineButtonColorClasses, parseStyle, showToast, solidButtonColorClasses, switchOffColorClasses, switchOnColorClasses, textColorClasses, useActionRunner, useAlfakit, useAlfakitNavigation, useAlfakitProps, useAppPage, useChoice, useCms, useDirection, useField, useFormState, useFormStore, useFormatter, useHydrated, useIsMobile, useLiveProps, useLiveUpdates, useLocalization, useOptionalAlfakit, useOptionalFormStore, usePageActionContext, usePageBlock, usePageForm, usePageMethod, usePageMethods, usePageSchema, usePanel, usePollComponent, useRegistry, useReloadProps, useSchemaComponentContext, useScrollToErroredItem, useShortcut, useSidebar, useStandalone, useStore, useStoreSelector, useT, useVirtualList };
|
|
183
|
+
export { ActionButton, ActionGroupMenu, ActionList, ActionModals, AiCopilot, AiStream, Alert, AlertDescription, AlertTitle, AlfakitAnalytics, AlfakitComponent, type AlfakitComponentProps, type AlfakitContextValue, AlfakitCopilot, type AlfakitHeaderWidgetProps, type AlfakitNavigation, AlfakitNotifications, AlfakitPage, AlfakitProvider, AlfakitSearch, AlfakitStarterKitRoot, AlfakitTenantSwitcher, AlfakitToaster, type AlfakitToasterProps, AlfakitWidgets, type AlfakitWidgetsProps, AnalyticsBreakdown, type AnyComponent, AppLayout, AppPage, AppSidebar, AuthLayout, Avatar, AvatarFallback, AvatarImage, Badge, BlankLayout, BottomNav, Brand, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Breadcrumbs, BuilderField, Button, CMS_BLOCK_COMPONENTS, Calendar, CalendarWidget, CallToActionBlock, CalloutComponent, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartWidget, Checkbox, CheckboxField, CheckboxListField, CmsBlockHeading, type CmsBlockProps, CmsBlocks, type CmsContextValue, CmsFooter, CmsHead, CmsHeader, CmsImage, CmsLanguageSwitcher, CmsLinkButton, CmsLivePreview, CmsMenuList, CmsNav, CmsPage, CmsProvider, CodeEditorField, CodeEntryComponent, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorEntryComponent, ColorPickerField, ColumnManager, ColumnsBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConflictBanner, ContentBlockRenderer, ContentLayout, ContentLayoutSort, type CreateAlfakitOptions, CustomizableWidgetGrid, DataTable, DatePickerField, DebugPanel, DebugPanelSlot, DebugTreeNode, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type DiscoveredComponents, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmbedBlock, EmptyStateComponent, EntryPlaceholder, EntryWrapper, FaqBlock, FeaturesBlock, type FieldBinding, FieldWrapper, FieldsetComponent, FileManager, FileManagerPickerField, FileUploadField, FilterIndicators, FlashToasts, FlexComponent, FormBlock, FormProvider, FormattedText, FullscreenLayout, type FullscreenLayoutProps, FusedGroupComponent, GalleryBlock, GlobalSearch, GridComponent, HelpdeskChat, type HelpdeskChatProps, HelpdeskInbox, HeroBlock, HiddenField, HtmlComponent, Icon, IconComponent, IconEntryComponent, IconPickerField, ImageBlock, ImageComponent, ImageEntryComponent, ImpersonationBanner, Input, Kanban, KeyValueEntryComponent, KeyValueField, KeyboardShortcuts, Label, LazyPlaceholder, LiveRecordsPill, LocaleSubMenu, LocaleSwitcher, MixedContent, ModalTableSelectField, MoneyInputField, NotificationActionButton, NotificationsMenu, OneTimeCodeInputField, PageActionProvider, PageBlock, type PageBlockProps, PageContent, PageForm, PageHeader, PageInfolist, type PageMethodBinding, type PageMethodMap, type PageMethodsBinding, PageShell, PageTable, PageWidgets, PlaceholderComponent, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PwaManager, PwaMenuItems, QueryBuilderRulesField, RadioField, RadioGroup, RadioGroupItem, RealtimeNotifications, RecordCell, RecordPresence, RecordVersionsComponent, RenderComponent, RepeatableEntryComponent, RepeaterField, RichEditorField, RichTextBlock, SchemaChildren, SchemaRenderer, ScrollArea, ScrollBar, SectionBlock, SectionComponent, Select, SelectContent, SelectField, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShortcutKeys, ShortcutsOverlay, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignInLink, Skeleton, SliderField, Slot, Spinner, Spreadsheet, type StandaloneContextValue, StandaloneProvider, StarterKitContentLayout, type StarterKitLayout, type StarterKitPageOptions, StatsOverviewWidget, Switch, Table, TableBody, TableCaption, TableCell, TableCellContent, TableFilters, TableFooter, TableHead, TableHeader, TablePagination, TableRow, TableViews, Tabs, TabsComponent, TabsContent, TabsList, TabsTrigger, TagsInputField, TenantMenu, TestimonialsBlock, TextComponent, TextEntryComponent, TextInputField, Textarea, TextareaField, ThemeToggle, Toaster, ToggleButtonsField, ToggleField, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopNavLayout, Topbar, TopbarLocaleSwitcher, TranslationManager, Tree, UndoButton, UnorderedListComponent, type UsePageMethodOptions, UserAvatar, UserMenu, ViewComponent, ViewEntryComponent, type VirtualListBinding, WidgetGrid, WidgetRenderer, WizardComponent, badgeColorClasses, badgeVariants, buttonVariants, cn, colorClass, configureAlfakit, createAlfakit, createDefaultRegistry, createStarterKitPage, cssColor, discoverComponents, discoveredComponent, extraProps, ghostButtonColorClasses, iconBackgroundColorClasses, iconSizeClasses, installPwa, outlineButtonColorClasses, panelLayouts, parseStyle, showToast, solidButtonColorClasses, switchOffColorClasses, switchOnColorClasses, textColorClasses, useActionRunner, useAlfakit, useAlfakitNavigation, useAlfakitProps, useAppPage, useChoice, useCms, useDirection, useField, useFormState, useFormStore, useFormatter, useHydrated, useIsMobile, useLiveProps, useLiveUpdates, useLocalization, useOptionalAlfakit, useOptionalFormStore, usePageActionContext, usePageBlock, usePageForm, usePageMethod, usePageMethods, usePageSchema, usePanel, usePollComponent, useRegistry, useReloadProps, useSchemaComponentContext, useScrollToErroredItem, useShortcut, useSidebar, useStandalone, useStore, useStoreSelector, useT, useVirtualList };
|
package/dist/index.js
CHANGED
|
@@ -99,26 +99,7 @@ import { DataTable } from "./components/table/table-block.js";
|
|
|
99
99
|
import { ChartWidget } from "./components/widgets/chart-lazy.js";
|
|
100
100
|
import { StatsOverviewWidget } from "./components/widgets/stats-overview.js";
|
|
101
101
|
import { WidgetGrid, WidgetRenderer } from "./components/widgets/widgets-block.js";
|
|
102
|
-
import { ScrollArea, ScrollBar } from "./components/ui/scroll-area.js";
|
|
103
|
-
import { NotificationsMenu } from "./components/notifications/notifications-menu.js";
|
|
104
|
-
import { Separator } from "./components/ui/separator.js";
|
|
105
|
-
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar } from "./components/ui/sidebar.js";
|
|
106
|
-
import { GlobalSearch } from "./components/panel/global-search.js";
|
|
107
|
-
import { TenantMenu } from "./components/panel/tenant-menu.js";
|
|
108
|
-
import { LocaleSubMenu, LocaleSwitcher, TopbarLocaleSwitcher } from "./components/panel/locale-switcher.js";
|
|
109
|
-
import { PwaManager, PwaMenuItems, installPwa } from "./components/panel/pwa.js";
|
|
110
|
-
import { SignInLink, UserAvatar, UserMenu } from "./components/panel/user-menu.js";
|
|
111
|
-
import { AppSidebar, Brand } from "./components/panel/app-sidebar.js";
|
|
112
|
-
import { BottomNav } from "./components/panel/bottom-nav.js";
|
|
113
|
-
import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./components/ui/breadcrumb.js";
|
|
114
|
-
import { DebugPanelSlot } from "./components/panel/debug-panel-slot.js";
|
|
115
|
-
import { ThemeToggle } from "./components/panel/theme-toggle.js";
|
|
116
|
-
import { Breadcrumbs, Topbar } from "./components/panel/topbar.js";
|
|
117
|
-
import { TopNavLayout } from "./layouts/top-nav-layout.js";
|
|
118
|
-
import { AppLayout } from "./layouts/app-layout.js";
|
|
119
|
-
import { AuthLayout } from "./layouts/auth-layout.js";
|
|
120
102
|
import { BlankLayout } from "./layouts/blank-layout.js";
|
|
121
|
-
import { FullscreenLayout } from "./layouts/fullscreen-layout.js";
|
|
122
103
|
import { AlfakitPage, ContentBlockRenderer, PageContent, PageHeader, PageShell } from "./pages/page.js";
|
|
123
104
|
import { AppPage, PageBlock, PageForm, PageInfolist, PageTable, PageWidgets, useAppPage, usePageBlock } from "./app/components.js";
|
|
124
105
|
import { useLiveProps, usePageForm, usePageMethod, usePageMethods, useReloadProps, useShortcut } from "./app/hooks.js";
|
|
@@ -129,6 +110,7 @@ import { CmsBlockHeading, CmsImage, CmsLinkButton } from "./components/cms/parts
|
|
|
129
110
|
import { CMS_BLOCK_COMPONENTS, CallToActionBlock, CmsBlocks, ColumnsBlock, EmbedBlock, FaqBlock, FeaturesBlock, GalleryBlock, HeroBlock, ImageBlock, RichTextBlock, SectionBlock, TestimonialsBlock } from "./components/cms/blocks.js";
|
|
130
111
|
import { CmsHead } from "./components/cms/head.js";
|
|
131
112
|
import { CmsLanguageSwitcher, CmsMenuList, CmsNav } from "./components/cms/menu.js";
|
|
113
|
+
import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./components/ui/breadcrumb.js";
|
|
132
114
|
import { CmsFooter, CmsHeader, CmsPage } from "./components/cms/page.js";
|
|
133
115
|
import { CodeEntryComponent } from "./components/entries/code-entry.js";
|
|
134
116
|
import { ColorEntryComponent, IconEntryComponent, ImageEntryComponent, KeyValueEntryComponent, RepeatableEntryComponent } from "./components/entries/other-entries.js";
|
|
@@ -141,21 +123,42 @@ import { HtmlComponent, PlaceholderComponent, TextComponent, ViewComponent } fro
|
|
|
141
123
|
import { SchemaChildren } from "./components/layout/schema-children.js";
|
|
142
124
|
import { TabsComponent } from "./components/layout/tabs.js";
|
|
143
125
|
import { WizardComponent } from "./components/layout/wizard.js";
|
|
126
|
+
import { ScrollArea, ScrollBar } from "./components/ui/scroll-area.js";
|
|
127
|
+
import { NotificationsMenu } from "./components/notifications/notifications-menu.js";
|
|
144
128
|
import { RealtimeNotifications } from "./components/notifications/realtime-notifications.js";
|
|
129
|
+
import { Separator } from "./components/ui/separator.js";
|
|
130
|
+
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar } from "./components/ui/sidebar.js";
|
|
131
|
+
import { Brand } from "./components/panel/brand.js";
|
|
132
|
+
import { GlobalSearch } from "./components/panel/global-search.js";
|
|
133
|
+
import { TenantMenu } from "./components/panel/tenant-menu.js";
|
|
134
|
+
import { LocaleSubMenu, LocaleSwitcher, TopbarLocaleSwitcher } from "./components/panel/locale-switcher.js";
|
|
135
|
+
import { PwaManager, PwaMenuItems, installPwa } from "./components/panel/pwa.js";
|
|
136
|
+
import { SignInLink, UserAvatar, UserMenu } from "./components/panel/user-menu.js";
|
|
137
|
+
import { AppSidebar } from "./components/panel/app-sidebar.js";
|
|
138
|
+
import { BottomNav } from "./components/panel/bottom-nav.js";
|
|
139
|
+
import { DebugPanelSlot } from "./components/panel/debug-panel-slot.js";
|
|
145
140
|
import { DebugPanel, DebugTreeNode } from "./components/panel/debug-panel.js";
|
|
146
141
|
import { ImpersonationBanner } from "./components/panel/impersonation-banner.js";
|
|
147
142
|
import { ShortcutKeys } from "./components/panel/shortcut-keys.js";
|
|
148
143
|
import { ShortcutsOverlay } from "./components/panel/shortcuts-overlay.js";
|
|
144
|
+
import { ThemeToggle } from "./components/panel/theme-toggle.js";
|
|
145
|
+
import { Breadcrumbs, Topbar } from "./components/panel/topbar.js";
|
|
149
146
|
import { RecordVersionsComponent } from "./components/versions/record-versions.js";
|
|
150
147
|
import { CustomizableWidgetGrid } from "./components/widgets/dashboard-customizer.js";
|
|
151
148
|
import { Toaster } from "./components/ui/sonner.js";
|
|
149
|
+
import { TopNavLayout } from "./layouts/top-nav-layout.js";
|
|
150
|
+
import { AppLayout } from "./layouts/app-layout.js";
|
|
151
|
+
import { AuthLayout } from "./layouts/auth-layout.js";
|
|
152
|
+
import { FullscreenLayout } from "./layouts/fullscreen-layout.js";
|
|
153
|
+
import { panelLayouts } from "./layouts/panel-layouts.js";
|
|
152
154
|
import { createAlfakit } from "./create-alfakit.js";
|
|
153
155
|
import { AlfakitToaster } from "./standalone/alfakit-toaster.js";
|
|
154
156
|
import { AlfakitComponent } from "./standalone/alfakit-component.js";
|
|
157
|
+
import { AlfakitWidgets } from "./starter-kit/dashboard-widgets.js";
|
|
155
158
|
import { useAlfakitNavigation } from "./starter-kit/navigation.js";
|
|
156
159
|
import { AlfakitStarterKitRoot, StarterKitContentLayout, createStarterKitPage } from "./starter-kit/starter-kit.js";
|
|
157
|
-
import { AlfakitNotifications, AlfakitSearch, AlfakitTenantSwitcher } from "./starter-kit/widgets.js";
|
|
160
|
+
import { AlfakitCopilot, AlfakitNotifications, AlfakitSearch, AlfakitTenantSwitcher } from "./starter-kit/widgets.js";
|
|
158
161
|
import { Alert, AlertDescription, AlertTitle } from "./components/ui/alert.js";
|
|
159
162
|
import { Calendar } from "./components/ui/calendar.js";
|
|
160
163
|
export * from "@alfakit/core";
|
|
161
|
-
export { ActionButton, ActionGroupMenu, ActionList, ActionModals, AiCopilot, AiStream, Alert, AlertDescription, AlertTitle, AlfakitAnalytics, AlfakitComponent, AlfakitNotifications, AlfakitPage, AlfakitProvider, AlfakitSearch, AlfakitStarterKitRoot, AlfakitTenantSwitcher, AlfakitToaster, AnalyticsBreakdown, AppLayout, AppPage, AppSidebar, AuthLayout, Avatar, AvatarFallback, AvatarImage, Badge, BlankLayout, BottomNav, Brand, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Breadcrumbs, BuilderField, Button, CMS_BLOCK_COMPONENTS, Calendar, CalendarWidget, CallToActionBlock, CalloutComponent, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartWidget, Checkbox, CheckboxField, CheckboxListField, CmsBlockHeading, CmsBlocks, CmsFooter, CmsHead, CmsHeader, CmsImage, CmsLanguageSwitcher, CmsLinkButton, CmsLivePreview, CmsMenuList, CmsNav, CmsPage, CmsProvider, CodeEditorField, CodeEntryComponent, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorEntryComponent, ColorPickerField, ColumnManager, ColumnsBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConflictBanner, ContentBlockRenderer, ContentLayout, ContentLayoutSort, CustomizableWidgetGrid, DataTable, DatePickerField, DebugPanel, DebugPanelSlot, DebugTreeNode, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmbedBlock, EmptyStateComponent, EntryPlaceholder, EntryWrapper, FaqBlock, FeaturesBlock, FieldWrapper, FieldsetComponent, FileManager, FileManagerPickerField, FileUploadField, FilterIndicators, FlashToasts, FlexComponent, FormBlock, FormProvider, FormattedText, FullscreenLayout, FusedGroupComponent, GalleryBlock, GlobalSearch, GridComponent, HelpdeskChat, HelpdeskInbox, HeroBlock, HiddenField, HtmlComponent, Icon, IconComponent, IconEntryComponent, IconPickerField, ImageBlock, ImageComponent, ImageEntryComponent, ImpersonationBanner, Input, Kanban, KeyValueEntryComponent, KeyValueField, KeyboardShortcuts, Label, LazyPlaceholder, LiveRecordsPill, LocaleSubMenu, LocaleSwitcher, MixedContent, ModalTableSelectField, MoneyInputField, NotificationActionButton, NotificationsMenu, OneTimeCodeInputField, PageActionProvider, PageBlock, PageContent, PageForm, PageHeader, PageInfolist, PageShell, PageTable, PageWidgets, PlaceholderComponent, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PwaManager, PwaMenuItems, QueryBuilderRulesField, RadioField, RadioGroup, RadioGroupItem, RealtimeNotifications, RecordCell, RecordPresence, RecordVersionsComponent, RenderComponent, RepeatableEntryComponent, RepeaterField, RichEditorField, RichTextBlock, SchemaChildren, SchemaRenderer, ScrollArea, ScrollBar, SectionBlock, SectionComponent, Select, SelectContent, SelectField, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShortcutKeys, ShortcutsOverlay, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignInLink, Skeleton, SliderField, Slot, Spinner, Spreadsheet, StandaloneProvider, StarterKitContentLayout, StatsOverviewWidget, Switch, Table, TableBody, TableCaption, TableCell, TableCellContent, TableFilters, TableFooter, TableHead, TableHeader, TablePagination, TableRow, TableViews, Tabs, TabsComponent, TabsContent, TabsList, TabsTrigger, TagsInputField, TenantMenu, TestimonialsBlock, TextComponent, TextEntryComponent, TextInputField, Textarea, TextareaField, ThemeToggle, Toaster, ToggleButtonsField, ToggleField, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopNavLayout, Topbar, TopbarLocaleSwitcher, TranslationManager, Tree, UndoButton, UnorderedListComponent, UserAvatar, UserMenu, ViewComponent, ViewEntryComponent, WidgetGrid, WidgetRenderer, WizardComponent, badgeColorClasses, badgeVariants, buttonVariants, cn, colorClass, configureAlfakit, createAlfakit, createDefaultRegistry, createStarterKitPage, cssColor, discoverComponents, discoveredComponent, extraProps, ghostButtonColorClasses, iconBackgroundColorClasses, iconSizeClasses, installPwa, outlineButtonColorClasses, parseStyle, showToast, solidButtonColorClasses, switchOffColorClasses, switchOnColorClasses, textColorClasses, useActionRunner, useAlfakit, useAlfakitNavigation, useAlfakitProps, useAppPage, useChoice, useCms, useDirection, useField, useFormState, useFormStore, useFormatter, useHydrated, useIsMobile, useLiveProps, useLiveUpdates, useLocalization, useOptionalAlfakit, useOptionalFormStore, usePageActionContext, usePageBlock, usePageForm, usePageMethod, usePageMethods, usePageSchema, usePanel, usePollComponent, useRegistry, useReloadProps, useSchemaComponentContext, useScrollToErroredItem, useShortcut, useSidebar, useStandalone, useStore, useStoreSelector, useT, useVirtualList };
|
|
164
|
+
export { ActionButton, ActionGroupMenu, ActionList, ActionModals, AiCopilot, AiStream, Alert, AlertDescription, AlertTitle, AlfakitAnalytics, AlfakitComponent, AlfakitCopilot, AlfakitNotifications, AlfakitPage, AlfakitProvider, AlfakitSearch, AlfakitStarterKitRoot, AlfakitTenantSwitcher, AlfakitToaster, AlfakitWidgets, AnalyticsBreakdown, AppLayout, AppPage, AppSidebar, AuthLayout, Avatar, AvatarFallback, AvatarImage, Badge, BlankLayout, BottomNav, Brand, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Breadcrumbs, BuilderField, Button, CMS_BLOCK_COMPONENTS, Calendar, CalendarWidget, CallToActionBlock, CalloutComponent, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartWidget, Checkbox, CheckboxField, CheckboxListField, CmsBlockHeading, CmsBlocks, CmsFooter, CmsHead, CmsHeader, CmsImage, CmsLanguageSwitcher, CmsLinkButton, CmsLivePreview, CmsMenuList, CmsNav, CmsPage, CmsProvider, CodeEditorField, CodeEntryComponent, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorEntryComponent, ColorPickerField, ColumnManager, ColumnsBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConflictBanner, ContentBlockRenderer, ContentLayout, ContentLayoutSort, CustomizableWidgetGrid, DataTable, DatePickerField, DebugPanel, DebugPanelSlot, DebugTreeNode, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmbedBlock, EmptyStateComponent, EntryPlaceholder, EntryWrapper, FaqBlock, FeaturesBlock, FieldWrapper, FieldsetComponent, FileManager, FileManagerPickerField, FileUploadField, FilterIndicators, FlashToasts, FlexComponent, FormBlock, FormProvider, FormattedText, FullscreenLayout, FusedGroupComponent, GalleryBlock, GlobalSearch, GridComponent, HelpdeskChat, HelpdeskInbox, HeroBlock, HiddenField, HtmlComponent, Icon, IconComponent, IconEntryComponent, IconPickerField, ImageBlock, ImageComponent, ImageEntryComponent, ImpersonationBanner, Input, Kanban, KeyValueEntryComponent, KeyValueField, KeyboardShortcuts, Label, LazyPlaceholder, LiveRecordsPill, LocaleSubMenu, LocaleSwitcher, MixedContent, ModalTableSelectField, MoneyInputField, NotificationActionButton, NotificationsMenu, OneTimeCodeInputField, PageActionProvider, PageBlock, PageContent, PageForm, PageHeader, PageInfolist, PageShell, PageTable, PageWidgets, PlaceholderComponent, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PwaManager, PwaMenuItems, QueryBuilderRulesField, RadioField, RadioGroup, RadioGroupItem, RealtimeNotifications, RecordCell, RecordPresence, RecordVersionsComponent, RenderComponent, RepeatableEntryComponent, RepeaterField, RichEditorField, RichTextBlock, SchemaChildren, SchemaRenderer, ScrollArea, ScrollBar, SectionBlock, SectionComponent, Select, SelectContent, SelectField, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShortcutKeys, ShortcutsOverlay, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignInLink, Skeleton, SliderField, Slot, Spinner, Spreadsheet, StandaloneProvider, StarterKitContentLayout, StatsOverviewWidget, Switch, Table, TableBody, TableCaption, TableCell, TableCellContent, TableFilters, TableFooter, TableHead, TableHeader, TablePagination, TableRow, TableViews, Tabs, TabsComponent, TabsContent, TabsList, TabsTrigger, TagsInputField, TenantMenu, TestimonialsBlock, TextComponent, TextEntryComponent, TextInputField, Textarea, TextareaField, ThemeToggle, Toaster, ToggleButtonsField, ToggleField, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopNavLayout, Topbar, TopbarLocaleSwitcher, TranslationManager, Tree, UndoButton, UnorderedListComponent, UserAvatar, UserMenu, ViewComponent, ViewEntryComponent, WidgetGrid, WidgetRenderer, WizardComponent, badgeColorClasses, badgeVariants, buttonVariants, cn, colorClass, configureAlfakit, createAlfakit, createDefaultRegistry, createStarterKitPage, cssColor, discoverComponents, discoveredComponent, extraProps, ghostButtonColorClasses, iconBackgroundColorClasses, iconSizeClasses, installPwa, outlineButtonColorClasses, panelLayouts, parseStyle, showToast, solidButtonColorClasses, switchOffColorClasses, switchOnColorClasses, textColorClasses, useActionRunner, useAlfakit, useAlfakitNavigation, useAlfakitProps, useAppPage, useChoice, useCms, useDirection, useField, useFormState, useFormStore, useFormatter, useHydrated, useIsMobile, useLiveProps, useLiveUpdates, useLocalization, useOptionalAlfakit, useOptionalFormStore, usePageActionContext, usePageBlock, usePageForm, usePageMethod, usePageMethods, usePageSchema, usePanel, usePollComponent, useRegistry, useReloadProps, useSchemaComponentContext, useScrollToErroredItem, useShortcut, useSidebar, useStandalone, useStore, useStoreSelector, useT, useVirtualList };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-layout.d.ts","names":[],"sources":["../../src/layouts/app-layout.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"app-layout.d.ts","names":[],"sources":["../../src/layouts/app-layout.tsx"],"mappings":";;;iBAwBiB;EACf,UAAU;EACV,cAAc;EACd,kBAAkB;;wBAuBJ,YAAY,UAAU,aAAa,mBAAmB,iCAAc,IAAA"}
|
|
@@ -6,39 +6,12 @@ import { TopbarLocaleSwitcher } from "../components/panel/locale-switcher.js";
|
|
|
6
6
|
import { AppSidebar } from "../components/panel/app-sidebar.js";
|
|
7
7
|
import { BottomNav } from "../components/panel/bottom-nav.js";
|
|
8
8
|
import { Topbar } from "../components/panel/topbar.js";
|
|
9
|
+
import { MAX_WIDTHS } from "./max-widths.js";
|
|
9
10
|
import { TopNavLayout } from "./top-nav-layout.js";
|
|
10
11
|
import { hasMobilePreset, hasTopbar, sidebarDefaultOpen, sidebarWidthStyle } from "@alfakit/core";
|
|
11
12
|
import { createElement } from "react";
|
|
12
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
//#region src/layouts/app-layout.tsx
|
|
14
|
-
const MAX_WIDTHS = {
|
|
15
|
-
"3xs": "max-w-3xs",
|
|
16
|
-
"2xs": "max-w-2xs",
|
|
17
|
-
xs: "max-w-xs",
|
|
18
|
-
sm: "max-w-sm",
|
|
19
|
-
md: "max-w-md",
|
|
20
|
-
lg: "max-w-lg",
|
|
21
|
-
xl: "max-w-xl",
|
|
22
|
-
"2xl": "max-w-2xl",
|
|
23
|
-
"3xl": "max-w-3xl",
|
|
24
|
-
"4xl": "max-w-4xl",
|
|
25
|
-
"5xl": "max-w-5xl",
|
|
26
|
-
"6xl": "max-w-6xl",
|
|
27
|
-
"7xl": "max-w-7xl",
|
|
28
|
-
none: "max-w-none",
|
|
29
|
-
min: "max-w-min",
|
|
30
|
-
max: "max-w-max",
|
|
31
|
-
fit: "max-w-fit",
|
|
32
|
-
prose: "max-w-prose",
|
|
33
|
-
container: "container",
|
|
34
|
-
"screen-sm": "max-w-(--breakpoint-sm)",
|
|
35
|
-
"screen-md": "max-w-(--breakpoint-md)",
|
|
36
|
-
"screen-lg": "max-w-(--breakpoint-lg)",
|
|
37
|
-
"screen-xl": "max-w-(--breakpoint-xl)",
|
|
38
|
-
"screen-2xl": "max-w-(--breakpoint-2xl)",
|
|
39
|
-
full: "max-w-full",
|
|
40
|
-
screen: "max-w-screen"
|
|
41
|
-
};
|
|
42
15
|
/** Sidebar + topbar shell used by every authenticated page. */
|
|
43
16
|
/**
|
|
44
17
|
* Stands in for the top bar on phones when the panel has `topbar(false)`: the sidebar
|
|
@@ -99,6 +72,6 @@ function AppLayout({ children, breadcrumbs, maxContentWidth }) {
|
|
|
99
72
|
});
|
|
100
73
|
}
|
|
101
74
|
//#endregion
|
|
102
|
-
export { AppLayout,
|
|
75
|
+
export { AppLayout, MobileTopbar };
|
|
103
76
|
|
|
104
77
|
//# sourceMappingURL=app-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-layout.js","names":[],"sources":["../../src/layouts/app-layout.tsx"],"sourcesContent":["import {\n hasMobilePreset,\n hasTopbar,\n sidebarDefaultOpen,\n sidebarWidthStyle,\n type BreadcrumbSchema,\n type Width,\n} from '@alfakit/core'\nimport { createElement, type CSSProperties, type ReactNode } from 'react'\nimport { AppSidebar } from '../components/panel/app-sidebar'\nimport { BottomNav } from '../components/panel/bottom-nav'\nimport { TopbarLocaleSwitcher } from '../components/panel/locale-switcher'\nimport { Slot } from '../components/panel/slot'\nimport { Topbar } from '../components/panel/topbar'\nimport { SidebarInset, SidebarProvider, SidebarTrigger } from '../components/ui/sidebar'\nimport { useAlfakitProps, useRegistry } from '../context'\nimport { cn } from '../lib/utils'\nimport { TopNavLayout } from './top-nav-layout'\n\
|
|
1
|
+
{"version":3,"file":"app-layout.js","names":[],"sources":["../../src/layouts/app-layout.tsx"],"sourcesContent":["import {\n hasMobilePreset,\n hasTopbar,\n sidebarDefaultOpen,\n sidebarWidthStyle,\n type BreadcrumbSchema,\n type Width,\n} from '@alfakit/core'\nimport { createElement, type CSSProperties, type ReactNode } from 'react'\nimport { AppSidebar } from '../components/panel/app-sidebar'\nimport { BottomNav } from '../components/panel/bottom-nav'\nimport { TopbarLocaleSwitcher } from '../components/panel/locale-switcher'\nimport { Slot } from '../components/panel/slot'\nimport { Topbar } from '../components/panel/topbar'\nimport { SidebarInset, SidebarProvider, SidebarTrigger } from '../components/ui/sidebar'\nimport { useAlfakitProps, useRegistry } from '../context'\nimport { cn } from '../lib/utils'\nimport { MAX_WIDTHS } from './max-widths'\nimport { TopNavLayout } from './top-nav-layout'\n\n// Re-exported for code that imported it from here; the map lives in `./max-widths` so the\n// starter kit's content layout doesn't pull the panel chrome in.\nexport { MAX_WIDTHS } from './max-widths'\n\nexport interface AppLayoutProps {\n children: ReactNode\n breadcrumbs?: BreadcrumbSchema[]\n maxContentWidth?: Width | string\n}\n\n/** Sidebar + topbar shell used by every authenticated page. */\n/**\n * Stands in for the top bar on phones when the panel has `topbar(false)`: the sidebar\n * toggle has to stay reachable.\n */\nexport function MobileTopbar() {\n return (\n <header\n data-slot=\"topbar\"\n data-variant=\"mobile\"\n className=\"bg-background/80 sticky top-0 z-20 flex h-12 shrink-0 items-center gap-2 border-b px-4 backdrop-blur md:hidden\"\n >\n <SidebarTrigger className=\"-ms-1\" />\n <div className=\"ms-auto flex items-center gap-1\">\n <TopbarLocaleSwitcher />\n </div>\n </header>\n )\n}\n\nexport function AppLayout({ children, breadcrumbs, maxContentWidth }: AppLayoutProps) {\n const props = useAlfakitProps()\n const registry = useRegistry()\n const layout = props.alfakit.theme?.design?.layout ?? 'sidebar'\n // Replace the sidebar or top bar everywhere with createAlfakit({ components: { 'panel:sidebar': … } }).\n const Sidebar = registry.resolve('panel:sidebar') ?? AppSidebar\n const Bar = registry.resolve('panel:topbar') ?? Topbar\n // The mobile preset's bottom bar (`Panel::mobile()`), hidden from `md` up.\n const Bottom = registry.resolve('panel:bottom-nav') ?? BottomNav\n const width = maxContentWidth ?? props.alfakit.maxContentWidth ?? '7xl'\n\n if (layout === 'topbar') {\n return (\n <TopNavLayout breadcrumbs={breadcrumbs} maxContentWidth={maxContentWidth}>\n {children}\n </TopNavLayout>\n )\n }\n\n return (\n // The rail layout starts as icons only until the user expands it.\n <SidebarProvider\n defaultOpen={sidebarDefaultOpen(props.alfakitSidebarOpen, layout)}\n style={sidebarWidthStyle(props.alfakit) as CSSProperties | undefined}\n >\n <Slot name=\"body.start\" />\n <Slot name=\"layout.start\" />\n {createElement(Sidebar)}\n <SidebarInset>\n <Slot name=\"topbar.before\" />\n {/* `topbar(false)`: no top bar, except a slim one with the sidebar toggle on phones. */}\n {hasTopbar(props.alfakit) ? createElement(Bar, { breadcrumbs }) : <MobileTopbar />}\n <Slot name=\"topbar.after\" />\n <Slot name=\"content.before\" />\n <div\n data-slot=\"content\"\n className={cn(\n 'mx-auto flex w-full min-w-0 flex-1 flex-col gap-6 p-4 md:p-6',\n MAX_WIDTHS[width] ?? 'max-w-7xl',\n )}\n >\n <Slot name=\"content.start\" />\n {children}\n <Slot name=\"content.end\" />\n </div>\n <Slot name=\"content.after\" />\n <Slot name=\"footer\" />\n </SidebarInset>\n {hasMobilePreset(props.alfakit) && createElement(Bottom)}\n <Slot name=\"layout.end\" />\n <Slot name=\"body.end\" />\n </SidebarProvider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmCA,SAAgB,eAAe;CAC7B,OACE,qBAAC,UAAD;EACE,aAAU;EACV,gBAAa;EACb,WAAU;EAHZ,UAAA,CAKE,oBAAC,gBAAD,EAAgB,WAAU,QAAS,CAAA,GACnC,oBAAC,OAAD;GAAK,WAAU;GACb,UAAA,oBAAC,sBAAD,CAAuB,CAAA;EACpB,CAAA,CACC;;AAEZ;AAEA,SAAgB,UAAU,EAAE,UAAU,aAAa,mBAAmC;CACpF,MAAM,QAAQ,gBAAgB;CAC9B,MAAM,WAAW,YAAY;CAC7B,MAAM,SAAS,MAAM,QAAQ,OAAO,QAAQ,UAAU;CAEtD,MAAM,UAAU,SAAS,QAAQ,eAAe,KAAK;CACrD,MAAM,MAAM,SAAS,QAAQ,cAAc,KAAK;CAEhD,MAAM,SAAS,SAAS,QAAQ,kBAAkB,KAAK;CACvD,MAAM,QAAQ,mBAAmB,MAAM,QAAQ,mBAAmB;CAElE,IAAI,WAAW,UACb,OACE,oBAAC,cAAD;EAA2B;EAA8B;EACtD;CACW,CAAA;CAIlB,OAEE,qBAAC,iBAAD;EACE,aAAa,mBAAmB,MAAM,oBAAoB,MAAM;EAChE,OAAO,kBAAkB,MAAM,OAAO;EAFxC,UAAA;GAIE,oBAAC,MAAD,EAAM,MAAK,aAAc,CAAA;GACzB,oBAAC,MAAD,EAAM,MAAK,eAAgB,CAAA;GAC1B,cAAc,OAAO;GACtB,qBAAC,cAAD,EAAA,UAAA;IACE,oBAAC,MAAD,EAAM,MAAK,gBAAiB,CAAA;IAE3B,UAAU,MAAM,OAAO,IAAI,cAAc,KAAK,EAAE,YAAY,CAAC,IAAI,oBAAC,cAAD,CAAe,CAAA;IACjF,oBAAC,MAAD,EAAM,MAAK,eAAgB,CAAA;IAC3B,oBAAC,MAAD,EAAM,MAAK,iBAAkB,CAAA;IAC7B,qBAAC,OAAD;KACE,aAAU;KACV,WAAW,GACT,gEACA,WAAW,UAAU,WACvB;KALF,UAAA;MAOE,oBAAC,MAAD,EAAM,MAAK,gBAAiB,CAAA;MAC3B;MACD,oBAAC,MAAD,EAAM,MAAK,cAAe,CAAA;KACvB;;IACL,oBAAC,MAAD,EAAM,MAAK,gBAAiB,CAAA;IAC5B,oBAAC,MAAD,EAAM,MAAK,SAAU,CAAA;GACT,EAAA,CAAA;GACb,gBAAgB,MAAM,OAAO,KAAK,cAAc,MAAM;GACvD,oBAAC,MAAD,EAAM,MAAK,aAAc,CAAA;GACzB,oBAAC,MAAD,EAAM,MAAK,WAAY,CAAA;EACR;;AAErB"}
|
|
@@ -2,10 +2,10 @@ import { usePanel } from "../context.js";
|
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../components/ui/card.js";
|
|
4
4
|
import { Slot } from "../components/panel/slot.js";
|
|
5
|
+
import { Brand } from "../components/panel/brand.js";
|
|
5
6
|
import { LocaleSwitcher } from "../components/panel/locale-switcher.js";
|
|
6
|
-
import { Brand } from "../components/panel/app-sidebar.js";
|
|
7
7
|
import { ThemeToggle } from "../components/panel/theme-toggle.js";
|
|
8
|
-
import { MAX_WIDTHS } from "./
|
|
8
|
+
import { MAX_WIDTHS } from "./max-widths.js";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
//#region src/layouts/auth-layout.tsx
|
|
11
11
|
/** Centered card used by login, registration, password reset and simple profile pages. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-layout.js","names":[],"sources":["../../src/layouts/auth-layout.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Brand } from '../components/panel/
|
|
1
|
+
{"version":3,"file":"auth-layout.js","names":[],"sources":["../../src/layouts/auth-layout.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Brand } from '../components/panel/brand'\nimport { LocaleSwitcher } from '../components/panel/locale-switcher'\nimport { Slot } from '../components/panel/slot'\nimport { ThemeToggle } from '../components/panel/theme-toggle'\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../components/ui/card'\nimport { usePanel } from '../context'\nimport { cn } from '../lib/utils'\nimport { MAX_WIDTHS } from './max-widths'\n\nexport interface AuthLayoutProps {\n children: ReactNode\n heading?: string\n subheading?: string\n}\n\n/** Centered card used by login, registration, password reset and simple profile pages. */\nexport function AuthLayout({ children, heading, subheading }: AuthLayoutProps) {\n // `simplePageMaxContentWidth()` on the panel; `md` by default.\n const width = usePanel()?.simplePageMaxContentWidth ?? 'md'\n\n return (\n <div className=\"bg-muted/40 flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10\">\n <Slot name=\"simple.layout.start\" />\n <div className=\"absolute end-4 top-4 flex items-center gap-1\">\n <LocaleSwitcher />\n <ThemeToggle />\n </div>\n <div className={cn('flex w-full flex-col gap-6', MAX_WIDTHS[width] ?? 'max-w-md')}>\n <div className=\"flex justify-center\">\n <Brand />\n </div>\n <Slot name=\"auth.before\" />\n <Card>\n <Slot name=\"simple.page.start\" />\n {(heading || subheading) && (\n <CardHeader className=\"text-center\">\n {heading && (\n <CardTitle role=\"heading\" aria-level={1} className=\"text-xl\">\n {heading}\n </CardTitle>\n )}\n {subheading && <CardDescription>{subheading}</CardDescription>}\n </CardHeader>\n )}\n <CardContent>\n {/* The server sends each form's slots on its own page only (Slot::pageTypes()). */}\n <Slot name=\"auth.login.form.before\" />\n <Slot name=\"auth.register.form.before\" />\n <Slot name=\"auth.password-reset.request.form.before\" />\n <Slot name=\"auth.password-reset.reset.form.before\" />\n {children}\n <Slot name=\"auth.login.form.after\" />\n <Slot name=\"auth.register.form.after\" />\n <Slot name=\"auth.password-reset.request.form.after\" />\n <Slot name=\"auth.password-reset.reset.form.after\" />\n </CardContent>\n <Slot name=\"simple.page.end\" />\n </Card>\n <Slot name=\"auth.after\" />\n <Slot name=\"footer\" />\n </div>\n <Slot name=\"simple.layout.end\" />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;AAiBA,SAAgB,WAAW,EAAE,UAAU,SAAS,cAA+B;CAE7E,MAAM,QAAQ,SAAS,CAAC,EAAE,6BAA6B;CAEvD,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,oBAAC,MAAD,EAAM,MAAK,sBAAuB,CAAA;GAClC,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,oBAAC,gBAAD,CAAiB,CAAA,GACjB,oBAAC,aAAD,CAAc,CAAA,CACX;;GACL,qBAAC,OAAD;IAAK,WAAW,GAAG,8BAA8B,WAAW,UAAU,UAAU;IAAhF,UAAA;KACE,oBAAC,OAAD;MAAK,WAAU;MACb,UAAA,oBAAC,OAAD,CAAQ,CAAA;KACL,CAAA;KACL,oBAAC,MAAD,EAAM,MAAK,cAAe,CAAA;KAC1B,qBAAC,MAAD,EAAA,UAAA;MACE,oBAAC,MAAD,EAAM,MAAK,oBAAqB,CAAA;OAC9B,WAAW,eACX,qBAAC,YAAD;OAAY,WAAU;OAAtB,UAAA,CACG,WACC,oBAAC,WAAD;QAAW,MAAK;QAAU,cAAY;QAAG,WAAU;QAChD,UAAA;OACQ,CAAA,GAEZ,cAAc,oBAAC,iBAAD,EAAA,UAAkB,WAA4B,CAAA,CACnD;;MAEd,qBAAC,aAAD,EAAA,UAAA;OAEE,oBAAC,MAAD,EAAM,MAAK,yBAA0B,CAAA;OACrC,oBAAC,MAAD,EAAM,MAAK,4BAA6B,CAAA;OACxC,oBAAC,MAAD,EAAM,MAAK,0CAA2C,CAAA;OACtD,oBAAC,MAAD,EAAM,MAAK,wCAAyC,CAAA;OACnD;OACD,oBAAC,MAAD,EAAM,MAAK,wBAAyB,CAAA;OACpC,oBAAC,MAAD,EAAM,MAAK,2BAA4B,CAAA;OACvC,oBAAC,MAAD,EAAM,MAAK,yCAA0C,CAAA;OACrD,oBAAC,MAAD,EAAM,MAAK,uCAAwC,CAAA;MACxC,EAAA,CAAA;MACb,oBAAC,MAAD,EAAM,MAAK,kBAAmB,CAAA;KAC1B,EAAA,CAAA;KACN,oBAAC,MAAD,EAAM,MAAK,aAAc,CAAA;KACzB,oBAAC,MAAD,EAAM,MAAK,SAAU,CAAA;IAClB;;GACL,oBAAC,MAAD,EAAM,MAAK,oBAAqB,CAAA;EAC7B;;AAET"}
|
|
@@ -4,9 +4,9 @@ import { Button } from "../components/ui/button.js";
|
|
|
4
4
|
import { Slot } from "../components/panel/slot.js";
|
|
5
5
|
import { NotificationsMenu } from "../components/notifications/notifications-menu.js";
|
|
6
6
|
import { Separator } from "../components/ui/separator.js";
|
|
7
|
+
import { Brand } from "../components/panel/brand.js";
|
|
7
8
|
import { TopbarLocaleSwitcher } from "../components/panel/locale-switcher.js";
|
|
8
9
|
import { UserMenu } from "../components/panel/user-menu.js";
|
|
9
|
-
import { Brand } from "../components/panel/app-sidebar.js";
|
|
10
10
|
import { DebugPanelSlot } from "../components/panel/debug-panel-slot.js";
|
|
11
11
|
import { ThemeToggle } from "../components/panel/theme-toggle.js";
|
|
12
12
|
import { Link } from "@inertiajs/react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fullscreen-layout.js","names":[],"sources":["../../src/layouts/fullscreen-layout.tsx"],"sourcesContent":["import type { PageSchema } from '@alfakit/core'\nimport { Link } from '@inertiajs/react'\nimport { LogOutIcon } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport { NotificationsMenu } from '../components/notifications/notifications-menu'\nimport { Brand } from '../components/panel/
|
|
1
|
+
{"version":3,"file":"fullscreen-layout.js","names":[],"sources":["../../src/layouts/fullscreen-layout.tsx"],"sourcesContent":["import type { PageSchema } from '@alfakit/core'\nimport { Link } from '@inertiajs/react'\nimport { LogOutIcon } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport { NotificationsMenu } from '../components/notifications/notifications-menu'\nimport { Brand } from '../components/panel/brand'\nimport { DebugPanelSlot } from '../components/panel/debug-panel-slot'\nimport { TopbarLocaleSwitcher } from '../components/panel/locale-switcher'\nimport { Slot } from '../components/panel/slot'\nimport { ThemeToggle } from '../components/panel/theme-toggle'\nimport { UserMenu } from '../components/panel/user-menu'\nimport { Button } from '../components/ui/button'\nimport { Separator } from '../components/ui/separator'\nimport { useT } from '../context'\nimport { Icon } from '../lib/icons'\n\nexport interface FullscreenLayoutProps {\n children: ReactNode\n page?: PageSchema\n}\n\n/**\n * `$layout = 'fullscreen'`: the whole viewport for an app screen (point of sale, kiosk,\n * board). No sidebar or topbar; an optional slim header keeps the brand, the page title,\n * notifications, the user menu and a way back to the panel. Toasts, modals and the debug\n * panel work as on every other page. Replace it with `components: { 'layout:fullscreen': … }`.\n */\nexport function FullscreenLayout({ children, page }: FullscreenLayoutProps) {\n const t = useT()\n const header = page?.fullscreen?.header !== false\n const exitUrl = page?.fullscreen?.exitUrl\n\n return (\n <div data-layout=\"fullscreen\" className=\"bg-background flex h-svh min-h-0 flex-col\">\n <Slot name=\"body.start\" />\n <Slot name=\"layout.start\" />\n {header ? (\n <header\n data-slot=\"topbar\"\n data-variant=\"fullscreen\"\n className=\"bg-background flex h-12 shrink-0 items-center gap-3 border-b px-3 md:px-4\"\n >\n <Slot name=\"topbar.logo.before\" />\n <Brand className=\"hidden shrink-0 sm:flex\" />\n <Slot name=\"topbar.logo.after\" />\n <Separator orientation=\"vertical\" className=\"hidden h-4 sm:block\" />\n <h1 className=\"min-w-0 truncate text-sm font-semibold\">{page?.heading ?? page?.title}</h1>\n <Slot name=\"topbar.start\" />\n <div className=\"ms-auto flex shrink-0 items-center gap-1\">\n <Slot name=\"topbar.end\" />\n <NotificationsMenu />\n <TopbarLocaleSwitcher />\n <ThemeToggle />\n <DebugPanelSlot />\n <UserMenu variant=\"topbar\" />\n {exitUrl && (\n <Button variant=\"ghost\" size=\"sm\" asChild>\n <Link href={exitUrl} data-slot=\"fullscreen-exit\">\n <Icon\n name=\"alfakit::panels.widgets.account.logout-button\"\n fallback={LogOutIcon}\n className=\"rtl:rotate-180\"\n aria-hidden=\"true\"\n />\n <span className=\"hidden sm:inline\">{t('exit_fullscreen', {}, 'Exit')}</span>\n <span className=\"sr-only sm:hidden\">{t('exit_fullscreen', {}, 'Exit')}</span>\n </Link>\n </Button>\n )}\n </div>\n </header>\n ) : (\n <div className=\"fixed end-3 bottom-3 z-40\">\n <DebugPanelSlot />\n </div>\n )}\n <main data-slot=\"content\" className=\"flex min-h-0 w-full min-w-0 flex-1 flex-col\">\n <Slot name=\"content.start\" />\n {children}\n <Slot name=\"content.end\" />\n </main>\n <Slot name=\"layout.end\" />\n <Slot name=\"body.end\" />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,iBAAiB,EAAE,UAAU,QAA+B;CAC1E,MAAM,IAAI,KAAK;CACf,MAAM,SAAS,MAAM,YAAY,WAAW;CAC5C,MAAM,UAAU,MAAM,YAAY;CAElC,OACE,qBAAC,OAAD;EAAK,eAAY;EAAa,WAAU;EAAxC,UAAA;GACE,oBAAC,MAAD,EAAM,MAAK,aAAc,CAAA;GACzB,oBAAC,MAAD,EAAM,MAAK,eAAgB,CAAA;GAC1B,SACC,qBAAC,UAAD;IACE,aAAU;IACV,gBAAa;IACb,WAAU;IAHZ,UAAA;KAKE,oBAAC,MAAD,EAAM,MAAK,qBAAsB,CAAA;KACjC,oBAAC,OAAD,EAAO,WAAU,0BAA2B,CAAA;KAC5C,oBAAC,MAAD,EAAM,MAAK,oBAAqB,CAAA;KAChC,oBAAC,WAAD;MAAW,aAAY;MAAW,WAAU;KAAuB,CAAA;KACnE,oBAAC,MAAD;MAAI,WAAU;MAA0C,UAAA,MAAM,WAAW,MAAM;KAAU,CAAA;KACzF,oBAAC,MAAD,EAAM,MAAK,eAAgB,CAAA;KAC3B,qBAAC,OAAD;MAAK,WAAU;MAAf,UAAA;OACE,oBAAC,MAAD,EAAM,MAAK,aAAc,CAAA;OACzB,oBAAC,mBAAD,CAAoB,CAAA;OACpB,oBAAC,sBAAD,CAAuB,CAAA;OACvB,oBAAC,aAAD,CAAc,CAAA;OACd,oBAAC,gBAAD,CAAiB,CAAA;OACjB,oBAAC,UAAD,EAAU,SAAQ,SAAU,CAAA;OAC3B,WACC,oBAAC,QAAD;QAAQ,SAAQ;QAAQ,MAAK;QAAK,SAAA;QAChC,UAAA,qBAAC,MAAD;SAAM,MAAM;SAAS,aAAU;SAA/B,UAAA;UACE,oBAAC,MAAD;WACE,MAAK;WACL,UAAU;WACV,WAAU;WACV,eAAY;UACb,CAAA;UACD,oBAAC,QAAD;WAAM,WAAU;WAAoB,UAAA,EAAE,mBAAmB,CAAC,GAAG,MAAM;UAAQ,CAAA;UAC3E,oBAAC,QAAD;WAAM,WAAU;WAAqB,UAAA,EAAE,mBAAmB,CAAC,GAAG,MAAM;UAAQ,CAAA;SACxE;;OACA,CAAA;MAEP;;IACC;GAER,CAAA,IAAA,oBAAC,OAAD;IAAK,WAAU;IACb,UAAA,oBAAC,gBAAD,CAAiB,CAAA;GACd,CAAA;GAEP,qBAAC,QAAD;IAAM,aAAU;IAAU,WAAU;IAApC,UAAA;KACE,oBAAC,MAAD,EAAM,MAAK,gBAAiB,CAAA;KAC3B;KACD,oBAAC,MAAD,EAAM,MAAK,cAAe,CAAA;IACtB;;GACN,oBAAC,MAAD,EAAM,MAAK,aAAc,CAAA;GACzB,oBAAC,MAAD,EAAM,MAAK,WAAY,CAAA;EACpB;;AAET"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { discoveredComponent } from "../lib/discovery.js";
|
|
2
|
+
import { lazyComponents } from "@alfakit/core";
|
|
3
|
+
//#region src/layouts/lazy-layouts.ts
|
|
4
|
+
/**
|
|
5
|
+
* The fullscreen layout (`$layout = 'fullscreen'`), loaded on demand by starter kit pages:
|
|
6
|
+
* they render in the host's layout, so the page chunk never imports the panel's header,
|
|
7
|
+
* menus and notifications for a layout few pages use. Only the starter kit registers it;
|
|
8
|
+
* `createAlfakit()` registers the layouts themselves up front (`panelLayouts`), so a panel's
|
|
9
|
+
* bundle has no extra lazy entry points.
|
|
10
|
+
*/
|
|
11
|
+
const lazyPanelLayouts = lazyComponents({ "layout:fullscreen": () => import("./fullscreen-layout.js").then((m) => m.FullscreenLayout) }).map(discoveredComponent).components;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { lazyPanelLayouts };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=lazy-layouts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-layouts.js","names":[],"sources":["../../src/layouts/lazy-layouts.ts"],"sourcesContent":["import { lazyComponents } from '@alfakit/core'\nimport type { AnyComponent } from '../context'\nimport { discoveredComponent } from '../lib/discovery'\n\n/**\n * The fullscreen layout (`$layout = 'fullscreen'`), loaded on demand by starter kit pages:\n * they render in the host's layout, so the page chunk never imports the panel's header,\n * menus and notifications for a layout few pages use. Only the starter kit registers it;\n * `createAlfakit()` registers the layouts themselves up front (`panelLayouts`), so a panel's\n * bundle has no extra lazy entry points.\n */\nexport const lazyPanelLayouts: Record<string, AnyComponent> = lazyComponents<AnyComponent>({\n 'layout:fullscreen': () => import('./fullscreen-layout').then((m) => m.FullscreenLayout),\n}).map(discoveredComponent).components\n"],"mappings":";;;;;;;;;;AAWA,MAAa,mBAAiD,eAA6B,EACzF,2BAA2B,OAAO,yBAAsB,CAAC,MAAM,MAAM,EAAE,gBAAgB,EACzF,CAAC,CAAC,CAAC,IAAI,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/layouts/max-widths.ts
|
|
2
|
+
/** Tailwind classes for the `maxContentWidth` setting of the panel and its pages. */
|
|
3
|
+
const MAX_WIDTHS = {
|
|
4
|
+
"3xs": "max-w-3xs",
|
|
5
|
+
"2xs": "max-w-2xs",
|
|
6
|
+
xs: "max-w-xs",
|
|
7
|
+
sm: "max-w-sm",
|
|
8
|
+
md: "max-w-md",
|
|
9
|
+
lg: "max-w-lg",
|
|
10
|
+
xl: "max-w-xl",
|
|
11
|
+
"2xl": "max-w-2xl",
|
|
12
|
+
"3xl": "max-w-3xl",
|
|
13
|
+
"4xl": "max-w-4xl",
|
|
14
|
+
"5xl": "max-w-5xl",
|
|
15
|
+
"6xl": "max-w-6xl",
|
|
16
|
+
"7xl": "max-w-7xl",
|
|
17
|
+
none: "max-w-none",
|
|
18
|
+
min: "max-w-min",
|
|
19
|
+
max: "max-w-max",
|
|
20
|
+
fit: "max-w-fit",
|
|
21
|
+
prose: "max-w-prose",
|
|
22
|
+
container: "container",
|
|
23
|
+
"screen-sm": "max-w-(--breakpoint-sm)",
|
|
24
|
+
"screen-md": "max-w-(--breakpoint-md)",
|
|
25
|
+
"screen-lg": "max-w-(--breakpoint-lg)",
|
|
26
|
+
"screen-xl": "max-w-(--breakpoint-xl)",
|
|
27
|
+
"screen-2xl": "max-w-(--breakpoint-2xl)",
|
|
28
|
+
full: "max-w-full",
|
|
29
|
+
screen: "max-w-screen"
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { MAX_WIDTHS };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=max-widths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max-widths.js","names":[],"sources":["../../src/layouts/max-widths.ts"],"sourcesContent":["/** Tailwind classes for the `maxContentWidth` setting of the panel and its pages. */\nexport const MAX_WIDTHS: Record<string, string> = {\n '3xs': 'max-w-3xs',\n '2xs': 'max-w-2xs',\n xs: 'max-w-xs',\n sm: 'max-w-sm',\n md: 'max-w-md',\n lg: 'max-w-lg',\n xl: 'max-w-xl',\n '2xl': 'max-w-2xl',\n '3xl': 'max-w-3xl',\n '4xl': 'max-w-4xl',\n '5xl': 'max-w-5xl',\n '6xl': 'max-w-6xl',\n '7xl': 'max-w-7xl',\n none: 'max-w-none',\n min: 'max-w-min',\n max: 'max-w-max',\n fit: 'max-w-fit',\n prose: 'max-w-prose',\n container: 'container',\n 'screen-sm': 'max-w-(--breakpoint-sm)',\n 'screen-md': 'max-w-(--breakpoint-md)',\n 'screen-lg': 'max-w-(--breakpoint-lg)',\n 'screen-xl': 'max-w-(--breakpoint-xl)',\n 'screen-2xl': 'max-w-(--breakpoint-2xl)',\n full: 'max-w-full',\n screen: 'max-w-screen',\n}\n"],"mappings":";;AACA,MAAa,aAAqC;CAChD,OAAO;CACP,OAAO;CACP,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,MAAM;CACN,KAAK;CACL,KAAK;CACL,KAAK;CACL,OAAO;CACP,WAAW;CACX,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CACb,cAAc;CACd,MAAM;CACN,QAAQ;AACV"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnyComponent } from "../context.js";
|
|
2
|
+
//#region src/layouts/panel-layouts.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The panel's own layouts (sidebar or top navigation, auth card, blank, fullscreen), which
|
|
5
|
+
* `createAlfakit()` registers up front. Starter kit pages render in the host's layout and
|
|
6
|
+
* never import these: `PageShell` loads one on demand if such a page asks for it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const panelLayouts: Record<string, AnyComponent>;
|
|
9
|
+
//#endregion
|
|
10
|
+
//# sourceMappingURL=panel-layouts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-layouts.d.ts","names":[],"sources":["../../src/layouts/panel-layouts.ts"],"mappings":";;;;;;;qBAWa,cAAc,eAAe"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BlankLayout } from "./blank-layout.js";
|
|
2
|
+
import { AppLayout } from "./app-layout.js";
|
|
3
|
+
import { AuthLayout } from "./auth-layout.js";
|
|
4
|
+
import { FullscreenLayout } from "./fullscreen-layout.js";
|
|
5
|
+
//#region src/layouts/panel-layouts.ts
|
|
6
|
+
/**
|
|
7
|
+
* The panel's own layouts (sidebar or top navigation, auth card, blank, fullscreen), which
|
|
8
|
+
* `createAlfakit()` registers up front. Starter kit pages render in the host's layout and
|
|
9
|
+
* never import these: `PageShell` loads one on demand if such a page asks for it.
|
|
10
|
+
*/
|
|
11
|
+
const panelLayouts = {
|
|
12
|
+
"layout:app": AppLayout,
|
|
13
|
+
"layout:auth": AuthLayout,
|
|
14
|
+
"layout:blank": BlankLayout,
|
|
15
|
+
"layout:fullscreen": FullscreenLayout
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { panelLayouts };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=panel-layouts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-layouts.js","names":[],"sources":["../../src/layouts/panel-layouts.ts"],"sourcesContent":["import type { AnyComponent } from '../context'\nimport { AppLayout } from './app-layout'\nimport { AuthLayout } from './auth-layout'\nimport { BlankLayout } from './blank-layout'\nimport { FullscreenLayout } from './fullscreen-layout'\n\n/**\n * The panel's own layouts (sidebar or top navigation, auth card, blank, fullscreen), which\n * `createAlfakit()` registers up front. Starter kit pages render in the host's layout and\n * never import these: `PageShell` loads one on demand if such a page asks for it.\n */\nexport const panelLayouts: Record<string, AnyComponent> = {\n 'layout:app': AppLayout,\n 'layout:auth': AuthLayout,\n 'layout:blank': BlankLayout,\n 'layout:fullscreen': FullscreenLayout,\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAa,eAA6C;CACxD,cAAc;CACd,eAAe;CACf,gBAAgB;CAChB,qBAAqB;AACvB"}
|