@bitakit/full-width-layout 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +42 -0
- package/CLAUDE.md +1 -0
- package/README.md +41 -2
- package/dist/plugin.d.ts +22 -0
- package/dist/plugin.js +23 -0
- package/dist/plugin.permissions.json +7 -0
- package/dist/plugin.slots.json +13 -0
- package/dist/ui/layouts/app.d.ts +12 -0
- package/dist/ui/layouts/app.js +30 -0
- package/marketplace/README.md +42 -0
- package/marketplace/screenshots/01-full-width-wide.png +0 -0
- package/marketplace/screenshots/02-full-width-menu.png +0 -0
- package/marketplace/screenshots/03-full-width-phone.png +0 -0
- package/marketplace/screenshots/04-full-width-phone-menu.png +0 -0
- package/package.json +60 -4
- package/styles.css +2 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @bitakit/full-width-layout — guide for agents
|
|
2
|
+
|
|
3
|
+
> For agents building an app with this package (it ships in `node_modules/@bitakit/full-width-layout`).
|
|
4
|
+
> To change the package itself, follow the repository's own AGENTS.md instead.
|
|
5
|
+
|
|
6
|
+
The Full-width layout is a frame for the app's normal pages: the page has the whole width, and the navigation
|
|
7
|
+
waits behind a menu button. It is a discovered plugin with the ID `full-width`, needs `@bitakit/shell`
|
|
8
|
+
and adds no Actions, services, settings or pages.
|
|
9
|
+
|
|
10
|
+
## What it provides
|
|
11
|
+
|
|
12
|
+
| Kind | IDs |
|
|
13
|
+
| ----- | ------------------------------------- |
|
|
14
|
+
| Frame | `full-width:default` for `layout.app` |
|
|
15
|
+
|
|
16
|
+
## Pick it
|
|
17
|
+
|
|
18
|
+
- As the only candidate for `layout.app` it renders without a choice. With another frame
|
|
19
|
+
package installed, Shell's own frame stays until one is chosen:
|
|
20
|
+
`npx bitakit shell use full-width` (or the package name) writes
|
|
21
|
+
`choose: { 'layout.app': 'full-width:default' }` into `bitakit.config.ts`. `npx bitakit shell`
|
|
22
|
+
shows what renders; `npx bitakit shell reset` returns to Shell's own.
|
|
23
|
+
- The app's own `src/layouts/app.tsx` wins over every package that `bitakit.config.ts` does not
|
|
24
|
+
choose. Do not write one beside this package.
|
|
25
|
+
|
|
26
|
+
## What the app keeps doing
|
|
27
|
+
|
|
28
|
+
- `src/app/(app)/layout.tsx` still renders `<AppShell brand account header>{children}</AppShell>`.
|
|
29
|
+
It shows `header` in its bar, and `brand` and `account` in the menu's drawer at every width.
|
|
30
|
+
- Navigation entries stay Actions in `shell.navigation` (or the configured `navigationSlot`);
|
|
31
|
+
the drawer lists them with Shell's own item, icons and badges included.
|
|
32
|
+
- Header widgets, toolbar Actions, `shell.content.*` and `shell.footer` render as in Shell's own
|
|
33
|
+
frame. `sidebar.*` slots do not render: they belong to sidebar frames.
|
|
34
|
+
- What people need on every page belongs in `shell.toolbar` or a header slot: the navigation is
|
|
35
|
+
two steps away here.
|
|
36
|
+
|
|
37
|
+
## Rules
|
|
38
|
+
|
|
39
|
+
- Do not add a second menu, sidebar or navigation from the app: the frame draws the app's
|
|
40
|
+
navigation once.
|
|
41
|
+
- The Layout settings `shell.layout`, `shell.sidebar*` and `shell.navbar` describe Shell's own
|
|
42
|
+
frame and are hidden while it renders; do not read them to decide what it shows.
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
package/README.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Full-width layout
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A frame for BitaKit apps that gives the page the whole width. One bar across the top holds the
|
|
4
|
+
product mark, the header places and the toolbar; the navigation, the workspace switcher and the
|
|
5
|
+
account menu wait behind the bar's menu button. For apps where people stay on one page for a
|
|
6
|
+
long time: an editor, a board, a report.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install @bitakit/full-width-layout
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The package is a BitaKit plugin (ID `full-width`) and needs `@bitakit/shell`. It brings one frame,
|
|
15
|
+
`full-width:default`. When it is the only frame package of the app, it renders as soon as it is
|
|
16
|
+
installed. Beside another one, choose it:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npx bitakit shell use @bitakit/full-width-layout
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`npx bitakit shell reset` returns to Shell's own frame.
|
|
23
|
+
|
|
24
|
+
## What it shows where
|
|
25
|
+
|
|
26
|
+
- The bar: the menu button, the `shell.brand` slot, the header places, what the app hands to
|
|
27
|
+
`<AppShell header>` and the toolbar.
|
|
28
|
+
- Behind the menu button, in a drawer from the start side: the app's brand, every navigation
|
|
29
|
+
entry and the account menu. The drawer closes when a link is followed.
|
|
30
|
+
- The page, with the places around it and the footer, as in every frame.
|
|
31
|
+
|
|
32
|
+
The frame is the same at every width; on a phone the bar wraps onto more lines. Features
|
|
33
|
+
change nothing: their navigation Actions, toolbar Actions and header widgets appear as they do in
|
|
34
|
+
Shell's own frame. The Layout settings that describe Shell's own sidebar and navigation bar are
|
|
35
|
+
not offered while the Full-width layout renders; content width, density, corners and themes apply as usual.
|
|
36
|
+
|
|
37
|
+
## Good to know
|
|
38
|
+
|
|
39
|
+
- Navigation takes two steps here (open the menu, then the entry). Put what people need on
|
|
40
|
+
every page into the toolbar or a header place.
|
|
41
|
+
- An app without navigation entries, brand and account gets no menu button.
|
|
42
|
+
- The frame's texts are Shell's own ("Main navigation"), so it ships no catalogs.
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Generated by BitaKit. Do not edit.
|
|
2
|
+
import type { DiscoveredFile, DiscoveredSlotEntry, DiscoveredServiceEntry, DiscoveredActionEntry, DiscoveredConfigEntry, DiscoveredEventsEntry, DiscoveredCancelableEntry, DiscoveredSettingsEntry } from '@bitakit/core';
|
|
3
|
+
|
|
4
|
+
type PluginSettings = {};
|
|
5
|
+
type PluginSlots = {};
|
|
6
|
+
type PluginServices = {};
|
|
7
|
+
type PluginActions = {};
|
|
8
|
+
type PluginEvents = {};
|
|
9
|
+
type PluginCancelable = {};
|
|
10
|
+
declare module '@bitakit/core' {
|
|
11
|
+
interface ServiceMap extends PluginServices {}
|
|
12
|
+
interface ActionMap extends PluginActions {}
|
|
13
|
+
interface EventMap extends PluginEvents {}
|
|
14
|
+
interface CancelableEventMap extends PluginCancelable {}
|
|
15
|
+
interface SlotMap extends PluginSlots {}
|
|
16
|
+
interface SettingsMap extends PluginSettings {}
|
|
17
|
+
interface ConfigMap { "full-width": {} }
|
|
18
|
+
}
|
|
19
|
+
import type { Plugin } from '@bitakit/core';
|
|
20
|
+
/** Creates the "full-width" plugin. Apps discover it through package.json bitakit.plugin. */
|
|
21
|
+
declare const plugin: () => Plugin & { readonly id: "full-width" };
|
|
22
|
+
export default plugin;
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
// Generated by BitaKit. Do not edit.
|
|
3
|
+
import { definePlugin, discoveredFile, discoverActions, discoverServices, discoverSlots, discoverConfig, discoverInterceptors, discoverInstallers, discoverEvents, discoverSettings, pluginSettingsPage, pluginPage, pluginSlot, pluginLayout, pluginProvider } from '@bitakit/core';
|
|
4
|
+
import * as module0 from "./ui/layouts/app.js";
|
|
5
|
+
|
|
6
|
+
/** Creates the "full-width" plugin; apps call this once per runtime. */
|
|
7
|
+
export default function plugin() {
|
|
8
|
+
return definePlugin({
|
|
9
|
+
id: "full-width",
|
|
10
|
+
metadata: {"title":"Full-width layout","version":"0.3.0","description":"A frame for BitaKit apps that gives the page the whole width: one bar, the navigation behind its menu button.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/mvavesal/bitakit-layouts.git","directory":"packages/full-width"},"name":"@bitakit/full-width-layout"},
|
|
11
|
+
dependencies: ["shell"],
|
|
12
|
+
events: discoverEvents([]),
|
|
13
|
+
settings: discoverSettings([]),
|
|
14
|
+
slots: discoverSlots([], "full-width"),
|
|
15
|
+
services: discoverServices([], "full-width"),
|
|
16
|
+
actions: discoverActions([], "full-width"),
|
|
17
|
+
config: discoverConfig([]),
|
|
18
|
+
interceptors: discoverInterceptors([]),
|
|
19
|
+
installs: discoverInstallers([]),
|
|
20
|
+
ui: { pages: [], slots: [pluginLayout(module0, "app", "default", "ui/layouts/app.tsx")], providers: [] },
|
|
21
|
+
setup: undefined,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* `full-width:default`: the page has the whole width at every screen size. One bar across the top
|
|
4
|
+
* holds the `shell.brand` slot, the header places, what the app handed to `<AppShell header>` and
|
|
5
|
+
* the toolbar. Everything else waits behind the bar's menu button, in Shell's drawer: the app's
|
|
6
|
+
* brand, the navigation and the account, as in Shell's own sidebar on a phone. The drawer closes
|
|
7
|
+
* when the route changes. The navigation is the app's slot, read through `useShellNavigation()`
|
|
8
|
+
* and drawn with Shell's own item.
|
|
9
|
+
*/
|
|
10
|
+
export default function FocusLayout({ children }: {
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import MenuIcon from 'reicon-react/icons/Menu';
|
|
5
|
+
import { PluginSlot, useBitaKitNavigation, useTranslation } from '@bitakit/ui';
|
|
6
|
+
import { AppBar, Button } from '@bitakit/ui/components';
|
|
7
|
+
import { AppShell, useShellNavigation, useShellParts } from '@bitakit/shell';
|
|
8
|
+
/**
|
|
9
|
+
* `full-width:default`: the page has the whole width at every screen size. One bar across the top
|
|
10
|
+
* holds the `shell.brand` slot, the header places, what the app handed to `<AppShell header>` and
|
|
11
|
+
* the toolbar. Everything else waits behind the bar's menu button, in Shell's drawer: the app's
|
|
12
|
+
* brand, the navigation and the account, as in Shell's own sidebar on a phone. The drawer closes
|
|
13
|
+
* when the route changes. The navigation is the app's slot, read through `useShellNavigation()`
|
|
14
|
+
* and drawn with Shell's own item.
|
|
15
|
+
*/
|
|
16
|
+
export default function FocusLayout({ children }) {
|
|
17
|
+
const t = useTranslation();
|
|
18
|
+
const navigation = useShellNavigation();
|
|
19
|
+
const parts = useShellParts();
|
|
20
|
+
const { pathname } = useBitaKitNavigation();
|
|
21
|
+
// Open for one route only, so following a link closes the drawer without an effect.
|
|
22
|
+
const [openAt, setOpenAt] = useState(null);
|
|
23
|
+
if (navigation.error)
|
|
24
|
+
throw navigation.error;
|
|
25
|
+
const { items, isActive } = navigation;
|
|
26
|
+
const label = t('shell.ui.navigation', undefined, 'Main navigation');
|
|
27
|
+
return (_jsxs("div", { "data-shell-frame": "full-width", className: "flex min-h-svh w-full min-w-0 flex-col", children: [_jsx(AppBar, { left:
|
|
28
|
+
// One wrapping row: the start of the bar never pushes the page wider than the screen.
|
|
29
|
+
_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2", children: [items.length || parts.brand || parts.account ? (_jsxs(AppShell.Drawer, { id: "navigation", side: "start", title: label, description: t('shell.ui.navigationDescription', undefined, 'Links to the areas of this app.'), open: openAt === pathname, onOpenChange: (open) => setOpenAt(open ? pathname : null), footer: parts.account ? _jsx(AppShell.Account, {}) : undefined, trigger: _jsx(Button, { size: "icon", variant: "ghost", "aria-label": t('shell.ui.toggle', undefined, 'Toggle navigation'), children: _jsx(MenuIcon, { "aria-hidden": "true" }) }), children: [_jsx(AppShell.Brand, {}), items.length ? (_jsx("nav", { "aria-label": label, children: _jsx("ul", { className: "flex flex-col gap-1", children: items.map((item) => (_jsx("li", { children: _jsx(AppShell.NavigationItem, { item: item, active: isActive(item.href), layout: "sidebar" }) }, item.key))) }) })) : null] })) : null, _jsx(PluginSlot, { name: "shell.brand" }), _jsx(PluginSlot, { name: "shell.header.start" }), _jsx(AppShell.Header, {})] }), center: _jsx(PluginSlot, { name: "shell.header.center" }), right: _jsxs(_Fragment, { children: [_jsx(AppShell.Toolbar, {}), _jsx(PluginSlot, { name: "shell.header.end" })] }), bottom: _jsx(PluginSlot, { name: "shell.header.rows" }) }), _jsx(AppShell.Surface, { children: children }), _jsx(AppShell.Footer, {})] }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Full-width layout
|
|
2
|
+
|
|
3
|
+
A frame for BitaKit apps that gives the page the whole width. One bar across the top holds the
|
|
4
|
+
product mark, the header places and the toolbar; the navigation, the workspace switcher and the
|
|
5
|
+
account menu wait behind the bar's menu button. For apps where people stay on one page for a
|
|
6
|
+
long time: an editor, a board, a report.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install @bitakit/full-width-layout
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The package is a BitaKit plugin (ID `full-width`) and needs `@bitakit/shell`. It brings one frame,
|
|
15
|
+
`full-width:default`. When it is the only frame package of the app, it renders as soon as it is
|
|
16
|
+
installed. Beside another one, choose it:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npx bitakit shell use @bitakit/full-width-layout
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`npx bitakit shell reset` returns to Shell's own frame.
|
|
23
|
+
|
|
24
|
+
## What it shows where
|
|
25
|
+
|
|
26
|
+
- The bar: the menu button, the `shell.brand` slot, the header places, what the app hands to
|
|
27
|
+
`<AppShell header>` and the toolbar.
|
|
28
|
+
- Behind the menu button, in a drawer from the start side: the app's brand, every navigation
|
|
29
|
+
entry and the account menu. The drawer closes when a link is followed.
|
|
30
|
+
- The page, with the places around it and the footer, as in every frame.
|
|
31
|
+
|
|
32
|
+
The frame is the same at every width; on a phone the bar wraps onto more lines. Features
|
|
33
|
+
change nothing: their navigation Actions, toolbar Actions and header widgets appear as they do in
|
|
34
|
+
Shell's own frame. The Layout settings that describe Shell's own sidebar and navigation bar are
|
|
35
|
+
not offered while the Full-width layout renders; content width, density, corners and themes apply as usual.
|
|
36
|
+
|
|
37
|
+
## Good to know
|
|
38
|
+
|
|
39
|
+
- Navigation takes two steps here (open the menu, then the entry). Put what people need on
|
|
40
|
+
every page into the toolbar or a header place.
|
|
41
|
+
- An app without navigation entries, brand and account gets no menu button.
|
|
42
|
+
- The frame's texts are Shell's own ("Main navigation"), so it ships no catalogs.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitakit/full-width-layout",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "A frame for BitaKit apps that gives the page the whole width: one bar, the navigation behind its menu button.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"./styles.css"
|
|
8
|
+
],
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"styles.css",
|
|
12
|
+
"README.md",
|
|
13
|
+
"AGENTS.md",
|
|
14
|
+
"CLAUDE.md",
|
|
15
|
+
"marketplace"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
"./plugin": {
|
|
19
|
+
"types": "./dist/plugin.d.ts",
|
|
20
|
+
"default": "./dist/plugin.js"
|
|
21
|
+
},
|
|
22
|
+
"./styles.css": "./styles.css",
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
"bitakit": {
|
|
26
|
+
"plugin": "./plugin",
|
|
27
|
+
"id": "full-width",
|
|
28
|
+
"title": "Full-width layout",
|
|
29
|
+
"styles": "./styles.css",
|
|
30
|
+
"dependencies": [
|
|
31
|
+
"shell"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "bitakit build",
|
|
36
|
+
"typecheck": "bitakit build --check",
|
|
37
|
+
"test": "node --test tests/*.test.mjs"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"reicon-react": "1.2.5"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@bitakit/core": "^0.3.7",
|
|
44
|
+
"@bitakit/shell": "^0.3.4",
|
|
45
|
+
"@bitakit/ui": "^0.3.4",
|
|
46
|
+
"react": "^19.0.0",
|
|
47
|
+
"react-dom": "^19.0.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@bitakit/cli": "^0.3.8",
|
|
51
|
+
"@bitakit/layout-testing": "*"
|
|
52
|
+
},
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"repository": {
|
|
55
|
+
"type": "git",
|
|
56
|
+
"url": "git+https://github.com/mvavesal/bitakit-layouts.git",
|
|
57
|
+
"directory": "packages/full-width"
|
|
58
|
+
},
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
}
|
|
62
|
+
}
|
package/styles.css
ADDED