prime-ui-kit 0.4.1 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,10 @@ export type AppShellMainProps = {
16
16
  className?: string;
17
17
  children?: React.ReactNode;
18
18
  } & React.HTMLAttributes<HTMLElement>;
19
+ export type AppShellMainInsetProps = {
20
+ className?: string;
21
+ children?: React.ReactNode;
22
+ } & React.HTMLAttributes<HTMLDivElement>;
19
23
  export type AppShellTemplateProps = {
20
24
  fillViewport?: boolean;
21
25
  className?: string;
@@ -36,6 +40,10 @@ export declare const AppShell: {
36
40
  className?: string;
37
41
  children?: React.ReactNode;
38
42
  } & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
43
+ MainInset: React.ForwardRefExoticComponent<{
44
+ className?: string;
45
+ children?: React.ReactNode;
46
+ } & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
39
47
  Template: React.ForwardRefExoticComponent<{
40
48
  fillViewport?: boolean;
41
49
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../../src/layout/app-shell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAmBzC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAEzC,iBAAS,WAAW,CAAC,EAAE,SAAS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E,eAAO,MAAM,QAAQ;;uBApIJ,OAAO;oBACV,MAAM;mBACP,KAAK,CAAC,SAAS;;;;oBAmCd,MAAM;mBACP,KAAK,CAAC,SAAS;;;oBAwBd,MAAM;mBACP,KAAK,CAAC,SAAS;;;uBAiCX,OAAO;oBACV,MAAM;QAClB,2CAA2C;aACtC,KAAK,CAAC,SAAS;mBACT,KAAK,CAAC,SAAS;mBACf,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC;oBACjC,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC;;CAoChD,CAAC"}
@@ -1,4 +1,4 @@
1
- export type { AppShellMainProps, AppShellNavProps, AppShellRootProps, AppShellTemplateProps, } from "./app-shell/AppShell";
1
+ export type { AppShellMainInsetProps, AppShellMainProps, AppShellNavProps, AppShellRootProps, AppShellTemplateProps, } from "./app-shell/AppShell";
2
2
  export { AppShell } from "./app-shell/AppShell";
3
3
  export type { SidebarContentProps, SidebarFooterProps, SidebarGroupLabelProps, SidebarGroupProps, SidebarHeaderMainProps, SidebarHeaderProps, SidebarHeaderRowProps, SidebarIdentityButtonProps, SidebarMenuActionProps, SidebarMenuButtonProps, SidebarMenuIconProps, SidebarMenuItemProps, SidebarMenuLabelProps, SidebarMenuLinkProps, SidebarMenuProps, SidebarMenuRouterLinkProps, SidebarMenuTrailingProps, SidebarNavCategoryCountProps, SidebarNavCategoryLabelProps, SidebarNavCategoryPanelProps, SidebarNavCategoryProps, SidebarNavCategoryTriggerProps, SidebarNavDocTreeProps, SidebarNavPanelBodyProps, SidebarNavPanelHeadingProps, SidebarNavPanelProps, SidebarResponsive, SidebarRootProps, SidebarSize, SidebarTextProps, SidebarToggleButtonProps, } from "./sidebar/Sidebar";
4
4
  export { Sidebar, useSidebarContext } from "./sidebar/Sidebar";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layout/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,uBAAuB,EACvB,8BAA8B,EAC9B,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layout/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,uBAAuB,EACvB,8BAA8B,EAC9B,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prime-ui-kit",
3
- "version": "0.4.1",
3
+ "version": "0.5.1",
4
4
  "description": "React 19 UI kit: CSS Modules, semantic design tokens (--prime-sys-*), composable components — forms, modals, selects, tables, navigation, overlays. TypeScript, ESM, a11y-oriented.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -2,27 +2,27 @@
2
2
 
3
3
  ## About
4
4
 
5
- Semantic **page column** primitives: **`PageContent.Section`** (a **`<section>`** page region without its own outer padding), **`PageContent.Root`** (full padded column with optional **`maxWidth`**), **`PageContent.Title`** → **`<h1>`**, **`PageContent.Description`** with **`measure`**, and **`PageContent.Body`**. Typography uses kit tokens.
5
+ Семантические примитивы **контентной колонки**: **`PageContent.Section`** (регион страницы **`<section>`** без собственных внешних полей), **`PageContent.Root`** (обёртка страницы с опциональным **`maxWidth`**, **без** дублирующих полей к краю колонки), **`PageContent.Title`** → **`<h1>`**, **`PageContent.Description`** с **`measure`**, **`PageContent.Body`**. Типографика токены кита.
6
6
 
7
- - **Use `PageContent.Section`** when a parent already applies outer padding (e.g. an inset wrapper inside **`AppShell.Main`**, or the same pattern as playground routes) without wrapping in **`Root`**.
8
- - **Use `PageContent.Root`** when you need that outer padding and optional **`maxWidth`** (`full` | `readable` | `wide`; default **`full`**).
9
- - **Use `Description` `measure="full"`** when the parent column is already inset; default **`measure="readable"`** keeps the lead ~65ch for reading.
7
+ - **В приложении с `AppShell.Template`** внешние поля колонки задаёт **`AppShell.MainInset`** (встроен в шаблон). Тогда для маршрута чаще берут **`PageContent.Section`** + **`Header`** / **`Body`**, либо **`PageContent.Root`** только ради **`maxWidth`**, без ожидания «второго» слоя полей.
8
+ - **`PageContent.Root`** когда нужен **`maxWidth`** (`full` | `readable` | `wide`; по умолчанию **`full`**) и структура шапки/тела; краевые поля **не** входят в корень — их даёт **`MainInset`**.
9
+ - **`Description`** с **`measure="full"`**, если ширину уже ограничивает родитель; по умолчанию **`measure="readable"`** узкая мера лида ~65ch.
10
10
 
11
11
  ## Composition
12
12
 
13
- - **`PageContent.Root`** — outer wrapper: padding + optional max-width (`data-max-width`).
14
- - **`PageContent.Section`** — **`<section>`** without extra outer padding; pair with **`aria-labelledby`** pointing at **`PageContent.Title`** `id`.
15
- - **`PageContent.Header`** — stacks title + description with spacing.
16
- - **`PageContent.Title`** — **`<h1>`** (one per route).
17
- - **`PageContent.Description`** — **`<p>`** lead; **`measure`** controls max width.
18
- - **`PageContent.Body`** — main blocks below the header (demos, forms, tables).
13
+ - **`PageContent.Root`** — внешняя обёртка: **`maxWidth`** через `data-max-width` (кроме `full`), **padding по краям колонки — 0** (поля у **`AppShell.MainInset`**).
14
+ - **`PageContent.Section`** — **`<section>`**; сочетайте с **`aria-labelledby`** на заголовок **`PageContent.Title`**.
15
+ - **`PageContent.Header`** — заголовок + описание с отступами.
16
+ - **`PageContent.Title`** — **`<h1>`** (один на вью).
17
+ - **`PageContent.Description`** — лид **`<p>`**; **`measure`** ширина текста.
18
+ - **`PageContent.Body`** — блоки под шапкой.
19
19
 
20
- ### Canonical example (inside an inset content column)
20
+ ### Canonical example (маршрут внутри `AppShell.Template`)
21
21
 
22
22
  ```tsx
23
23
  import { PageContent } from "prime-ui-kit";
24
24
 
25
- export function DocRouteBody() {
25
+ export function SettingsPage() {
26
26
  return (
27
27
  <PageContent.Section aria-labelledby="page-heading">
28
28
  <PageContent.Header>
@@ -31,18 +31,18 @@ export function DocRouteBody() {
31
31
  Manage your workspace profile and notifications.
32
32
  </PageContent.Description>
33
33
  </PageContent.Header>
34
- <PageContent.Body>{/* page blocks */}</PageContent.Body>
34
+ <PageContent.Body>{/* блоки страницы */}</PageContent.Body>
35
35
  </PageContent.Section>
36
36
  );
37
37
  }
38
38
  ```
39
39
 
40
- ### Canonical example (standalone column)
40
+ ### Canonical example (узкая колонка + `maxWidth`)
41
41
 
42
42
  ```tsx
43
43
  import { PageContent } from "prime-ui-kit";
44
44
 
45
- export function StandalonePage() {
45
+ export function AccountPage() {
46
46
  return (
47
47
  <PageContent.Root maxWidth="readable">
48
48
  <PageContent.Header>
@@ -57,13 +57,13 @@ export function StandalonePage() {
57
57
 
58
58
  ### Playground
59
59
 
60
- Live demo and API tables: **`playground/sections/PageContentSection.tsx`** — **`Section`** → **`Header`** (**`Title`**, **`Description measure="full"`**) → **`Body`**. There is no **`playground/snippets/page-content/`** tree; the section is the single demo surface.
60
+ Живые примеры и таблицы API: **`playground/sections/PageContentSection.tsx`**.
61
61
 
62
62
  ## Rules
63
63
 
64
- - Prefer **one** `h1` per view — **`PageContent.Title`**.
65
- - Do not nest **`PageContent.Root`** inside a region that already applies the same outer padding unless you intentionally want double padding; use **`Section`** instead.
66
- - **`Description`** defaults to a readable measure; use **`measure="full"`** when the layout already constrains width.
64
+ - На вью — **один** `h1` через **`PageContent.Title`**.
65
+ - **Не** вкладывайте **`PageContent.Root`** в область, где уже есть тот же слой полей, что у **`AppShell.MainInset`** у корня **нет** своих краевых полей; при необходимости используйте **`Section`**.
66
+ - **`Description`**: по умолчанию узкая мера; **`measure="full"`**, когда колонка уже ограничена снаружи.
67
67
 
68
68
  ## API
69
69
 
@@ -71,53 +71,53 @@ Live demo and API tables: **`playground/sections/PageContentSection.tsx`** — *
71
71
 
72
72
  | Prop | Type | Default | Required | Description |
73
73
  |------|------|---------|----------|-------------|
74
- | maxWidth | `full` \| `readable` \| `wide` | `full` | No | Limits the content column; drives `data-max-width` when not `full`. |
75
- | className | `string` | — | No | Class on the root wrapper. |
76
- | children | `React.ReactNode` | — | No | Header, body, nested sections. |
77
- | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Native `div` attributes, including `ref` (`forwardRef`). |
74
+ | maxWidth | `full` \| `readable` \| `wide` | `full` | No | Ограничение ширины контентной колонки; `data-max-width`, кроме `full`. |
75
+ | className | `string` | — | No | Класс на корневой обёртке. |
76
+ | children | `React.ReactNode` | — | No | Шапка, тело, секции. |
77
+ | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | В т.ч. `ref` (`forwardRef`). |
78
78
 
79
79
  ### PageContent.Section
80
80
 
81
81
  | Prop | Type | Default | Required | Description |
82
82
  |------|------|---------|----------|-------------|
83
- | className | `string` | — | No | Class on **`<section>`** (page region without outer padding—use when an inset wrapper or **`PageContent.Root`** already provides margins). |
84
- | children | `React.ReactNode` | — | No | Usually **`Header`** + **`Body`** (playground routes follow this). |
85
- | …rest | `React.HTMLAttributes<HTMLElement>` | — | No | Native **`<section>`** attributes, including `ref` (`forwardRef`). |
83
+ | className | `string` | — | No | Класс на **`<section>`**. |
84
+ | children | `React.ReactNode` | — | No | Обычно **`Header`** + **`Body`**. |
85
+ | …rest | `React.HTMLAttributes<HTMLElement>` | — | No | В т.ч. `ref` (`forwardRef`). |
86
86
 
87
87
  ### PageContent.Header
88
88
 
89
89
  | Prop | Type | Default | Required | Description |
90
90
  |------|------|---------|----------|-------------|
91
- | className | `string` | — | No | Class on the header block (title + description). |
92
- | children | `React.ReactNode` | — | No | Usually **`PageContent.Title`** and **`PageContent.Description`** (`measure` as needed). |
93
- | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Native `div` attributes. |
91
+ | className | `string` | — | No | Класс на блоке шапки. |
92
+ | children | `React.ReactNode` | — | No | **`Title`**, **`Description`**. |
93
+ | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Атрибуты `div`. |
94
94
 
95
95
  ### PageContent.Title
96
96
 
97
97
  | Prop | Type | Default | Required | Description |
98
98
  |------|------|---------|----------|-------------|
99
- | className | `string` | — | No | Class on **`<h1>`**. |
100
- | children | `React.ReactNode` | — | No | Page heading. |
101
- | …rest | `React.HTMLAttributes<HTMLHeadingElement>` | — | No | Native **`h1`** attributes, including `ref` (`forwardRef`). |
99
+ | className | `string` | — | No | Класс на **`<h1>`**. |
100
+ | children | `React.ReactNode` | — | No | Заголовок страницы. |
101
+ | …rest | `React.HTMLAttributes<HTMLHeadingElement>` | — | No | В т.ч. `ref` (`forwardRef`). |
102
102
 
103
103
  ### PageContent.Description
104
104
 
105
105
  | Prop | Type | Default | Required | Description |
106
106
  |------|------|---------|----------|-------------|
107
- | measure | `readable` \| `full` | `readable` | No | `readable` — ~65ch; `full` — parent width (e.g. when the content column is already inset). |
108
- | className | `string` | — | No | Class on the lead **`<p>`**. |
109
- | children | `React.ReactNode` | — | No | Intro text under the title. |
110
- | …rest | `React.HTMLAttributes<HTMLParagraphElement>` | — | No | Native **`p`** attributes, including `ref` (`forwardRef`). |
107
+ | measure | `readable` \| `full` | `readable` | No | `readable` — ~65ch; `full` — ширина родителя. |
108
+ | className | `string` | — | No | Класс на **`<p>`**. |
109
+ | children | `React.ReactNode` | — | No | Вводный текст. |
110
+ | …rest | `React.HTMLAttributes<HTMLParagraphElement>` | — | No | В т.ч. `ref` (`forwardRef`). |
111
111
 
112
112
  ### PageContent.Body
113
113
 
114
114
  | Prop | Type | Default | Required | Description |
115
115
  |------|------|---------|----------|-------------|
116
- | className | `string` | — | No | Class on the main content wrapper below the header. |
117
- | children | `React.ReactNode` | — | No | Page content under the header. |
118
- | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Native `div` attributes. |
116
+ | className | `string` | — | No | Класс на обёртке контента под шапкой. |
117
+ | children | `React.ReactNode` | — | No | Основное содержимое. |
118
+ | …rest | `React.HTMLAttributes<HTMLDivElement>` | — | No | Атрибуты `div`. |
119
119
 
120
120
  ## Related
121
121
 
122
- - [Typography](../typography/COMPONENT.md) — inline roles elsewhere on the page.
123
- - [AppShell](../../layout/app-shell/AppShell.tsx) — grid shell (`nav` + **`main`**); page padding is app-level (e.g. **`PageContent.Root`** or a wrapper inside **`main`**).
122
+ - [Typography](../typography/COMPONENT.md) — роли текста на странице.
123
+ - [AppShell](../../layout/app-shell/COMPONENT.md) — сетка и **`MainInset`**.
@@ -0,0 +1,90 @@
1
+ # AppShell
2
+
3
+ ## About
4
+
5
+ Каркас приложения: **сетка** `nav` + **`main`** (прокручиваемая колонка). **`AppShell.Template`** — каноничный способ собрать оболочку: он задаёт **`data-layout-template="app"`** (зазор у колонки nav при открытом **Sidebar** с `sidebarSlot="page-nav"`), **всегда** оборачивает дочерние маршруты в **`AppShell.MainInset`** с едиными полями контентной колонки (**`--prime-sys-spacing-x6`** по вертикали и горизонтали — тот же формат, что в playground до выделения в кит), и при монтировании **внутри React Router** сбрасывает прокрутку **`main`** на смене пути.
6
+
7
+ **Не** добавляйте второй слой с теми же полями вокруг страницы: используйте **`PageContent.Section`** или **`PageContent.Root`** (без дублирующих внешних отступов у корня — их даёт **`MainInset`**).
8
+
9
+ ## Composition
10
+
11
+ - **`AppShell.Root`** — корневая сетка; опционально **`fillViewport`** (типично для фиксированной высоты вьюпорта и прокрутки только в **`main`**).
12
+ - **`AppShell.Nav`** — слот навигации (**`data-layout-region="nav"`**).
13
+ - **`AppShell.Main`** — основная колонка (**`<main>`**, **`ScrollContainer`**, **`data-layout-region="main"`**).
14
+ - **`AppShell.MainInset`** — **единый** внутренний отступ контентной колонки; в **`Template`** уже вложен в **`Main`**. Используйте отдельно только в особых маршрутах без **`Template`** (например **`AppShell.Root`** + один **`Main`** + **`MainInset`** без боковой колонки — корень сетки растянет **`main`** на всю ширину).
15
+ - **`AppShell.Template`** — **`Root`** + **`Nav`** + **`Main`**, внутри **`Main`** — **`MainInset`** (дети шаблона) + сброс прокрутки при смене **`pathname`** (только если предок — React Router).
16
+
17
+ ### Canonical example (приложение с сайдбаром)
18
+
19
+ ```tsx
20
+ import { AppShell, Sidebar } from "prime-ui-kit";
21
+ import { Outlet } from "react-router-dom";
22
+
23
+ export function AppLayout() {
24
+ return (
25
+ <AppShell.Template fillViewport nav={<Sidebar.Root /* … */>{/* … */}</Sidebar.Root>}>
26
+ <Outlet />
27
+ </AppShell.Template>
28
+ );
29
+ }
30
+ ```
31
+
32
+ ### Canonical example (одна колонка без `nav`, те же поля)
33
+
34
+ ```tsx
35
+ import { AppShell } from "prime-ui-kit";
36
+
37
+ export function FullWidthMainRoute() {
38
+ return (
39
+ <AppShell.Root fillViewport>
40
+ <AppShell.Main>
41
+ <AppShell.MainInset>{/* страница */}</AppShell.MainInset>
42
+ </AppShell.Main>
43
+ </AppShell.Root>
44
+ );
45
+ }
46
+ ```
47
+
48
+ ## Rules
49
+
50
+ - Обертка-приложения с **`AppShell.Template`** должна находиться **внутри** **`BrowserRouter`** / **`MemoryRouter`**, чтобы сброс прокрутки работал; в тестах без роутера сброс не подключается (это нормально).
51
+ - **`ref`**, переданный в **`AppShell.Template`**, по-прежнему вешается на элемент **`main`** (как на **`AppShell.Main`**).
52
+ - Не дублируйте классы/обёртки с теми же отступами, что у **`MainInset`**, и не задавайте произвольные «поля страницы» литералами — один источник правды в ките.
53
+
54
+ ## API
55
+
56
+ ### AppShell.Root
57
+
58
+ | Prop | Type | Default | Required | Description |
59
+ |------|------|---------|----------|-------------|
60
+ | fillViewport | `boolean` | `false` | No | Растягивает корень на высоту вьюпорта. |
61
+ | className | `string` | — | No | Класс на корневом `div`. |
62
+ | children | `React.ReactNode` | — | No | Обычно `Nav` + `Main`. |
63
+ | …rest | `HTMLAttributes<HTMLDivElement>` | — | No | В т.ч. `ref` (`forwardRef`). |
64
+
65
+ ### AppShell.Template
66
+
67
+ | Prop | Type | Default | Required | Description |
68
+ |------|------|---------|----------|-------------|
69
+ | fillViewport | `boolean` | — | No | Пробрасывается в `Root`. |
70
+ | className | `string` | — | No | Класс на `Root`. |
71
+ | nav | `React.ReactNode` | — | **Yes** | Левая колонка (напр. `Sidebar.Root`). |
72
+ | children | `React.ReactNode` | — | No | Контент внутри `MainInset` внутри `main`. |
73
+ | navProps | `Omit<AppShellNavProps, "children">` | — | No | Пропсы на слот навигации. |
74
+ | mainProps | `Omit<AppShellMainProps, "children">` | — | No | Пропсы на `main` (напр. `id`, `tabIndex`). |
75
+ | …rest | `HTMLAttributes<HTMLDivElement>` | — | No | Остальное на `Root` (без `children` / без `ref` на типе — `ref` на `main`). |
76
+
77
+ ### AppShell.MainInset
78
+
79
+ | Prop | Type | Default | Required | Description |
80
+ |------|------|---------|----------|-------------|
81
+ | className | `string` | — | No | Доп. класс; поля заданы модулем кита. |
82
+ | children | `React.ReactNode` | — | No | Содержимое колонки. |
83
+ | …rest | `HTMLAttributes<HTMLDivElement>` | — | No | В т.ч. `ref` (`forwardRef`). |
84
+
85
+ `AppShell.Nav` и `AppShell.Main` — см. исходные типы в **`AppShell.tsx`**.
86
+
87
+ ## Related
88
+
89
+ - [PageContent](../../components/page-content/COMPONENT.md) — секции и корень страницы внутри инсета.
90
+ - [Sidebar](../sidebar/COMPONENT.md) — навигация в слоте `nav`.
@@ -8,7 +8,7 @@
8
8
 
9
9
  **When to use**
10
10
 
11
- - Persistent app navigation beside main content, including **`AppShell.Template`** nav slot with **`sidebarSlot="page-nav"`**.
11
+ - Persistent app navigation beside main content, including **`AppShell.Template`** nav slot with **`sidebarSlot="page-nav"`** (контентная колонка получает поля из **`AppShell.MainInset`** внутри шаблона — не дублировать).
12
12
  - Desktop width toggle (expanded vs icon rail) with optional tooltips in **`compact`**.
13
13
  - Mobile drawer behavior when **`responsive={true}`** (default): overlay, backdrop; **edge**-кнопка **`Sidebar.ToggleButton`** на границе панели и смещается вместе с ней (в т.ч. при закрытии drawer).
14
14