prime-ui-kit 0.21.1 → 0.21.3

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.
Files changed (163) hide show
  1. package/README.md +2 -2
  2. package/THIRD_PARTY_NOTICES +13 -0
  3. package/dist/chunks/{chunk-6L7VWEY6.js → chunk-BAJRN3QN.js} +2 -2
  4. package/dist/chunks/{chunk-QFHE5GKW.js → chunk-HMLQCKRL.js} +605 -556
  5. package/dist/chunks/{chunk-S27VR4ON.js → chunk-JO7E6SZQ.js} +105 -40
  6. package/dist/chunks/{chunk-S4H2ZKWJ.js → chunk-R5LI5BO3.js} +2150 -1615
  7. package/dist/chunks/{chunk-IVS3J7AS.js → chunk-SUGCIPD7.js} +1 -1
  8. package/dist/color-picker.js +3 -3
  9. package/dist/components/chat-list/ChatList.d.ts +4 -3
  10. package/dist/components/command-menu/CommandMenu.d.ts +1 -4
  11. package/dist/components/composer/Composer.d.ts +1 -1
  12. package/dist/components/data-table/DataTable.d.ts +9 -7
  13. package/dist/components/data-table/Footer.d.ts +7 -3
  14. package/dist/components/datepicker/DatepickerPanel.d.ts +2 -2
  15. package/dist/components/dnd/labels.d.ts +2 -0
  16. package/dist/components/field-list/FieldList.d.ts +2 -4
  17. package/dist/components/file-upload/FileUpload.d.ts +1 -9
  18. package/dist/components/index.d.ts +2 -2
  19. package/dist/components/kanban/Kanban.d.ts +0 -2
  20. package/dist/components/list/List.d.ts +7 -1
  21. package/dist/components/message/Message.d.ts +7 -3
  22. package/dist/components/message/MessageParts.d.ts +7 -2
  23. package/dist/components/rich-text/RichText.d.ts +12 -4
  24. package/dist/components/scroll-container/ScrollContainer.d.ts +1 -1
  25. package/dist/components/select/selectContext.d.ts +0 -2
  26. package/dist/components/smart-filter/SmartFilter.d.ts +1 -5
  27. package/dist/components/sparkline/Sparkline.d.ts +50 -8
  28. package/dist/components/tag-select/TagSelect.d.ts +0 -2
  29. package/dist/components/textarea/Textarea.d.ts +1 -1
  30. package/dist/icon-set.d.ts +6 -1
  31. package/dist/icon-set.js +10 -2
  32. package/dist/icons/glyph.d.ts +12 -1
  33. package/dist/icons/glyphs/app-window.d.ts +2 -0
  34. package/dist/icons/glyphs/telegram.d.ts +2 -0
  35. package/dist/icons/glyphs/vk.d.ts +2 -0
  36. package/dist/icons/glyphs/whatsapp.d.ts +2 -0
  37. package/dist/icons/registry.d.ts +10 -1
  38. package/dist/index.css +1 -1
  39. package/dist/index.js +7 -3
  40. package/dist/internal/ToolRow.d.ts +3 -1
  41. package/dist/internal/barPlan.d.ts +7 -1
  42. package/dist/internal/blockStack.d.ts +7 -0
  43. package/dist/internal/overlay/DialogParts.d.ts +9 -7
  44. package/dist/internal/richText.d.ts +32 -1
  45. package/dist/internal/selectionIndicator.d.ts +9 -3
  46. package/dist/internal/textFormatting.d.ts +2 -2
  47. package/dist/layout/page/Page.d.ts +2 -1
  48. package/dist/skill/SKILL.md +3 -2
  49. package/dist/skill/api-contract.md +3 -2
  50. package/dist/skill/cheatsheet.md +1 -1
  51. package/dist/skill/checklist.md +6 -1
  52. package/dist/skill/choosing.md +76 -5
  53. package/dist/skill/components.md +2 -2
  54. package/dist/skill/composition.md +108 -20
  55. package/dist/skill/foundations.md +1 -1
  56. package/dist/skill/layouts.md +4 -4
  57. package/dist/skill/reference/components/card/COMPONENT.md +1 -1
  58. package/dist/skill/reference/components/card/examples/screen.tsx +9 -11
  59. package/dist/skill/reference/components/chat-list/COMPONENT.md +6 -5
  60. package/dist/skill/reference/components/chat-list/examples/structure.tsx +4 -4
  61. package/dist/skill/reference/components/command-menu/COMPONENT.md +1 -2
  62. package/dist/skill/reference/components/command-menu/examples/states.tsx +1 -1
  63. package/dist/skill/reference/components/composer/COMPONENT.md +5 -4
  64. package/dist/skill/reference/components/composer/examples/formatting.tsx +1 -1
  65. package/dist/skill/reference/components/data-table/COMPONENT.md +18 -16
  66. package/dist/skill/reference/components/data-table/examples/server.tsx +2 -1
  67. package/dist/skill/reference/components/datepicker/COMPONENT.md +2 -2
  68. package/dist/skill/reference/components/dnd/COMPONENT.md +2 -1
  69. package/dist/skill/reference/components/drawer/COMPONENT.md +9 -6
  70. package/dist/skill/reference/components/drawer/examples/tab-switcher.tsx +158 -0
  71. package/dist/skill/reference/components/field-list/COMPONENT.md +7 -7
  72. package/dist/skill/reference/components/field-list/examples/limits.tsx +2 -2
  73. package/dist/skill/reference/components/file-upload/COMPONENT.md +8 -12
  74. package/dist/skill/reference/components/file-upload/examples/gallery.tsx +2 -2
  75. package/dist/skill/reference/components/file-upload/examples/in-form.tsx +2 -4
  76. package/dist/skill/reference/components/file-upload/examples/narrow.tsx +1 -0
  77. package/dist/skill/reference/components/file-upload/examples/overview.tsx +1 -5
  78. package/dist/skill/reference/components/file-upload/examples/sizes.tsx +1 -1
  79. package/dist/skill/reference/components/file-upload/examples/states.tsx +4 -5
  80. package/dist/skill/reference/components/file-upload/examples/validation.tsx +2 -7
  81. package/dist/skill/reference/components/kanban/COMPONENT.md +1 -2
  82. package/dist/skill/reference/components/list/COMPONENT.md +11 -6
  83. package/dist/skill/reference/components/list/examples/reorder.tsx +30 -3
  84. package/dist/skill/reference/components/message/COMPONENT.md +17 -11
  85. package/dist/skill/reference/components/message/examples/bot-actions.tsx +6 -2
  86. package/dist/skill/reference/components/message/examples/status.tsx +2 -1
  87. package/dist/skill/reference/components/message/examples/text-formatting.tsx +13 -3
  88. package/dist/skill/reference/components/modal/COMPONENT.md +5 -4
  89. package/dist/skill/reference/components/rich-text/COMPONENT.md +45 -7
  90. package/dist/skill/reference/components/rich-text/examples/entities.tsx +20 -0
  91. package/dist/skill/reference/components/scroll-container/COMPONENT.md +5 -5
  92. package/dist/skill/reference/components/scroll-container/examples/overscroll.tsx +2 -2
  93. package/dist/skill/reference/components/select/COMPONENT.md +1 -2
  94. package/dist/skill/reference/components/sheet/COMPONENT.md +5 -4
  95. package/dist/skill/reference/components/smart-filter/COMPONENT.md +3 -5
  96. package/dist/skill/reference/components/sparkline/COMPONENT.md +40 -12
  97. package/dist/skill/reference/components/sparkline/examples/lower-is-better.tsx +46 -0
  98. package/dist/skill/reference/components/sparkline/examples/own-value.tsx +41 -0
  99. package/dist/skill/reference/components/sparkline/examples/reference.tsx +2 -1
  100. package/dist/skill/reference/components/tabs/COMPONENT.md +2 -2
  101. package/dist/skill/reference/components/tag-select/COMPONENT.md +0 -2
  102. package/dist/skill/reference/components/tag-select/examples/overview.tsx +0 -1
  103. package/dist/skill/reference/components/tag-select/examples/sizes.tsx +0 -1
  104. package/dist/skill/reference/components/textarea/COMPONENT.md +4 -3
  105. package/dist/skill/reference/icon-set.ts +6 -1
  106. package/dist/skill/reference/layout/app-shell/COMPONENT.md +1 -1
  107. package/dist/skill/reference/layout/page/COMPONENT.md +13 -12
  108. package/dist/skill/reference/layout/page/examples/collapse.tsx +45 -31
  109. package/dist/skill/reference/layout/page/examples/router.tsx +47 -14
  110. package/dist/skill/ux.md +79 -2
  111. package/package.json +1 -1
  112. package/src/components/card/COMPONENT.md +1 -1
  113. package/src/components/card/examples/screen.tsx +9 -11
  114. package/src/components/chat-list/COMPONENT.md +6 -5
  115. package/src/components/chat-list/examples/structure.tsx +4 -4
  116. package/src/components/command-menu/COMPONENT.md +1 -2
  117. package/src/components/command-menu/examples/states.tsx +1 -1
  118. package/src/components/composer/COMPONENT.md +5 -4
  119. package/src/components/composer/examples/formatting.tsx +1 -1
  120. package/src/components/data-table/COMPONENT.md +18 -16
  121. package/src/components/data-table/examples/server.tsx +2 -1
  122. package/src/components/datepicker/COMPONENT.md +2 -2
  123. package/src/components/dnd/COMPONENT.md +2 -1
  124. package/src/components/drawer/COMPONENT.md +9 -6
  125. package/src/components/drawer/examples/tab-switcher.tsx +158 -0
  126. package/src/components/field-list/COMPONENT.md +7 -7
  127. package/src/components/field-list/examples/limits.tsx +2 -2
  128. package/src/components/file-upload/COMPONENT.md +8 -12
  129. package/src/components/file-upload/examples/gallery.tsx +2 -2
  130. package/src/components/file-upload/examples/in-form.tsx +2 -4
  131. package/src/components/file-upload/examples/narrow.tsx +1 -0
  132. package/src/components/file-upload/examples/overview.tsx +1 -5
  133. package/src/components/file-upload/examples/sizes.tsx +1 -1
  134. package/src/components/file-upload/examples/states.tsx +4 -5
  135. package/src/components/file-upload/examples/validation.tsx +2 -7
  136. package/src/components/kanban/COMPONENT.md +1 -2
  137. package/src/components/list/COMPONENT.md +11 -6
  138. package/src/components/list/examples/reorder.tsx +30 -3
  139. package/src/components/message/COMPONENT.md +17 -11
  140. package/src/components/message/examples/bot-actions.tsx +6 -2
  141. package/src/components/message/examples/status.tsx +2 -1
  142. package/src/components/message/examples/text-formatting.tsx +13 -3
  143. package/src/components/modal/COMPONENT.md +5 -4
  144. package/src/components/rich-text/COMPONENT.md +45 -7
  145. package/src/components/rich-text/examples/entities.tsx +20 -0
  146. package/src/components/scroll-container/COMPONENT.md +5 -5
  147. package/src/components/scroll-container/examples/overscroll.tsx +2 -2
  148. package/src/components/select/COMPONENT.md +1 -2
  149. package/src/components/sheet/COMPONENT.md +5 -4
  150. package/src/components/smart-filter/COMPONENT.md +3 -5
  151. package/src/components/sparkline/COMPONENT.md +40 -12
  152. package/src/components/sparkline/examples/lower-is-better.tsx +46 -0
  153. package/src/components/sparkline/examples/own-value.tsx +41 -0
  154. package/src/components/sparkline/examples/reference.tsx +2 -1
  155. package/src/components/tabs/COMPONENT.md +2 -2
  156. package/src/components/tag-select/COMPONENT.md +0 -2
  157. package/src/components/tag-select/examples/overview.tsx +0 -1
  158. package/src/components/tag-select/examples/sizes.tsx +0 -1
  159. package/src/components/textarea/COMPONENT.md +4 -3
  160. package/src/layout/app-shell/COMPONENT.md +1 -1
  161. package/src/layout/page/COMPONENT.md +13 -12
  162. package/src/layout/page/examples/collapse.tsx +45 -31
  163. package/src/layout/page/examples/router.tsx +47 -14
@@ -199,7 +199,7 @@ Other attributes: Root `data-orientation`, `data-size`, `data-tone`, `data-full-
199
199
 
200
200
  ## Layout & spacing
201
201
  - Tabs are a bar, not a surface: the root has no fill, padding, radius or `data-depth`. On a page or in a `Card.Body`, put it straight into the host's padded region and the panel content straight into `Tabs.Panel`. The strip's edges and the panel content share the host's content edge; the panel stands one tier gap below the strip (`--prime-space-3` … `--prime-space-8`).
202
- - In a Modal or Drawer the tabs belong to the header: `Tabs.Root` wraps `X.Header` and `X.Body`, `Tabs.List` goes last into the header, the panels into the body. The header becomes the strip (painted like it, no hairline, edge to edge — the header hands the bar its side padding as `--prime-bleed-inline`), the active tab is the body rising into it, and the root renders no box (`display: contents`), so only the body scrolls and the tabs stay in view.
202
+ - In a Modal or Drawer the tabs belong to the header: `Tabs.Root` wraps `X.Header` and `X.Body`, `Tabs.List` goes last into the header, the panels into the body. The header becomes the strip (painted like it, no hairline, edge to edge — the header hands the bar its side padding as `--prime-bleed-inline`), the active tab is the body rising into it, and the root renders no box (`display: contents`), so only the body scrolls and the tabs stay in view. A panel in the body stands its blocks 32 apart — the step between the body's sections — so a tab of self-titled blocks (charts, titled cards) or of `X.Section`s needs no spacing wrapper.
203
203
 
204
204
  ```tsx
205
205
  <Drawer.Content>
@@ -216,7 +216,7 @@ Other attributes: Root `data-orientation`, `data-size`, `data-tone`, `data-full-
216
216
  ```
217
217
  - The folder paints the host's `layer-current`, so the active tab is always the colour of the surface it stands on; controls in a panel read the host's field and fill tokens.
218
218
  - Vertical: the column is as wide as its widest section (at least four control heights, at most 40% of the root) and as tall as its sections; the panel sits beside it, one gap away.
219
- - The list is a switcher (foundation §9): it never wraps — it collapses, then scrolls horizontally with faded edges (hidden scrollbar, `overscroll-behavior: contain`). Give the list's container a width (`min-width: 0` on flex children).
219
+ - The list is a switcher (foundation §9): it never wraps — it collapses, then scrolls horizontally with faded edges (hidden scrollbar; at its sideways edge it stops, a vertical wheel goes on to the page). Give the list's container a width (`min-width: 0` on flex children).
220
220
  - Without `size` the tabs take the tier of their host (a Card, a Drawer, a form), else `m`.
221
221
  - A horizontal tab is never narrower than its content (`min-width: max-content`; the tab bounds that content between `minItemWidth` and `maxItemWidth`), so a label is never cut to make room. Full width, tabs tend to equal widths, not widths in proportion to their labels (`flex: 1 1 0`): a long label keeps its width, the short ones share the rest.
222
222
  - A vertical Tabs.Root is a size container: give it a width (it measures itself to switch to a row).
@@ -30,7 +30,6 @@ TagSelect field frame: label · control · hint/error (sin
30
30
  │ ├── input[type=hidden] × value with `name`
31
31
  │ └── chevron
32
32
  └── list (portal) role="listbox", multi-select
33
- ├── panel hint labels.panelHint (`""` hides it)
34
33
  ├── «Создать» row with `creatable`: plus icon · labels.create · preview Badge
35
34
  └── option row Checkbox.Indicator · Badge [· «⋯» Button → Popover menu]; picked options first
36
35
  ```
@@ -150,7 +149,6 @@ No `variant` or `tone`. The control is the field look; chips are the kit's soft
150
149
 
151
150
  | Key | Default | Used for |
152
151
  |---|---|---|
153
- | `panelHint` | `"Выберите вариант или создайте новый"` | Line above the list; `""` hides it. |
154
152
  | `create` | `"Создать"` | Action text before the preview of a new tag. |
155
153
  | `remove` | `"Удалить {label}"` | Accessible name of a chip's remove button; `{label}` is the tag text. |
156
154
  | `more` | `"Показать ещё {count}"` | Accessible name of the «+N» chip; `{count}` is the number of hidden tags. |
@@ -15,7 +15,6 @@ export default function TagSelectOverviewExample() {
15
15
  options={OPTIONS}
16
16
  defaultValue={["design"]}
17
17
  placeholder="Добавить метку"
18
- labels={{ panelHint: "Выберите метку" }}
19
18
  />
20
19
  );
21
20
  }
@@ -19,7 +19,6 @@ export default function TagSelectSizesExample() {
19
19
  label={size}
20
20
  options={OPTIONS}
21
21
  defaultValue={["design", "backend"]}
22
- labels={{ panelHint: "Выберите метку" }}
23
22
  />
24
23
  ))}
25
24
  </div>
@@ -59,7 +59,7 @@ Unlike Input, Textarea has no Wrapper / Field parts: `Textarea.Root` renders the
59
59
  | `id` | `string` | — | Id of the `<textarea>` (auto-generated when omitted); hint id is `<id>-hint`, error id is `<id>-error`. |
60
60
  | `aria-describedby` | `string` | — | Merged before the hint/error ids. |
61
61
  | `onCommit` | `(value: string) => void \| Promise<void>` | — | Inline save: fires with a changed value on blur and Mod+Enter; Escape reverts. Return a Promise: the field shows a spinner and stays editable; a rejection restores the value — show why through `error`. |
62
- | `formatting` | `boolean` | `false` | Selecting text shows a floating toolbar of seven Markdown tools and enables their hotkeys; a tool wraps the selection, a second press unwraps it. Off: plain text. |
62
+ | `formatting` | `boolean` | `false` | Selecting text shows a floating toolbar of eight Markdown tools and enables their hotkeys; a tool wraps the selection, a second press unwraps it. Off: plain text. |
63
63
  | `children` | `ReactNode` | — | Actions in the field's top end corner: `Textarea.CopyButton`, `Textarea.Action`. |
64
64
  | `labels` | `Partial<TextareaLabels>` | — | Built-in strings, see Labels. |
65
65
  | `className` | `string` | — | Class on the field frame `<div>` (label, field box, support row), as on every field root. |
@@ -116,7 +116,7 @@ Textarea has no `variant` or `tone`: one field treatment (fill, no visible borde
116
116
  | Value | Looks like | Use when | Default |
117
117
  |---|---|---|---|
118
118
  | `focusRing` | `false`: no focus ring; focus fill and caret remain | A single composer field where focus is obvious | `true` |
119
- | `formatting` | A floating toolbar over a selection (bold, italic, strikethrough, code, spoiler, link, quote) and the Mod-hotkeys; each writes Markdown around the selection | The text is shown later with its Markdown (Message renders the same subset) | `false` |
119
+ | `formatting` | A floating toolbar over a selection (bold, italic, underline, strikethrough, code, spoiler, link, quote) and the Mod-hotkeys; each writes Markdown around the selection | The text is shown later with its Markdown (Message renders the same subset) | `false` |
120
120
  | `reserveSupportRow` | Empty support row of hint height | Live validation, fields side by side | `false` |
121
121
  | `required` / `optional` | Red `*` / muted «необязательно» after the label | Mark the minority of the form | — / `false` |
122
122
 
@@ -164,7 +164,7 @@ Inline save (`onCommit`): the text at focus is the committed one; blur and Mod+E
164
164
  | `Tab` | Focuses the field, then the buttons in its corner; Enter inserts a line break instead of submitting the form. |
165
165
  | `Mod+Enter` | With `onCommit`: saves a changed text; focus stays in the field. |
166
166
  | `Escape` | With `formatting`: first clears a selection with the toolbar. With `onCommit`: puts the committed text back. |
167
- | `Mod + B` · `Mod + I` · `Mod + Shift + X` · `Mod + E` · `Mod + Shift + H` · `Mod + K` · `Mod + Shift + 9` | With `formatting`: bold, italic, strikethrough, code, spoiler, link and quote for the selection; the physical key counts, so any layout works. |
167
+ | `Mod + B` · `Mod + I` · `Mod + U` · `Mod + Shift + X` · `Mod + E` · `Mod + Shift + H` · `Mod + K` · `Mod + Shift + 9` | With `formatting`: bold, italic, underline, strikethrough, code, spoiler, link and quote for the selection; the physical key counts, so any layout works. |
168
168
  | `←` · `→` | Move between the formatting buttons. |
169
169
  | `Home` · `End` | Jump to the first / last formatting button. |
170
170
 
@@ -194,6 +194,7 @@ Inline save (`onCommit`): the text at focus is the committed one; blur and Mod+E
194
194
  | `formatting` | `"Форматирование"` | Accessible name of the formatting toolbar. |
195
195
  | `bold` | `"Жирный"` | Bold tool. |
196
196
  | `italic` | `"Курсив"` | Italic tool. |
197
+ | `underline` | `"Подчёркнутый"` | Underline tool (`__…__`). |
197
198
  | `strikethrough` | `"Зачёркнутый"` | Strikethrough tool. |
198
199
  | `code` | `"Моноширинный"` | Code tool. |
199
200
  | `spoiler` | `"Скрытый текст"` | Spoiler tool (`\|\|…\|\|`). |
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * `prime-ui-kit/icons` — the full animated glyph set as named components (`<BellIcon />`), each a
3
- * Lucide drawing with one gesture; import only what you use, the rest is never bundled. The
3
+ * Lucide drawing (or a Simple Icons brand mark: `<TelegramIcon />`) with one gesture; import only
4
+ * what you use, the rest is never bundled. The
4
5
  * semantic `<Icon name>` set lives in the main entry. Generated by `bun run icons:add`.
5
6
  */
6
7
  export type { DomainIconProps as GlyphIconProps, Glyph } from "./icons/glyph";
@@ -20,6 +21,7 @@ export { AlignVerticalSpaceAround as AlignVerticalSpaceAroundIcon } from "./icon
20
21
  export { Ambulance as AmbulanceIcon } from "./icons/glyphs/ambulance";
21
22
  export { Angry as AngryIcon } from "./icons/glyphs/angry";
22
23
  export { Annoyed as AnnoyedIcon } from "./icons/glyphs/annoyed";
24
+ export { AppWindow as AppWindowIcon } from "./icons/glyphs/app-window";
23
25
  export { Archive as ArchiveIcon } from "./icons/glyphs/archive";
24
26
  export { ArrowBigDown as ArrowBigDownIcon } from "./icons/glyphs/arrow-big-down";
25
27
  export { ArrowBigDownDash as ArrowBigDownDashIcon } from "./icons/glyphs/arrow-big-down-dash";
@@ -461,6 +463,7 @@ export { SwissFranc as SwissFrancIcon } from "./icons/glyphs/swiss-franc";
461
463
  export { SwitchCamera as SwitchCameraIcon } from "./icons/glyphs/switch-camera";
462
464
  export { Syringe as SyringeIcon } from "./icons/glyphs/syringe";
463
465
  export { Tablet as TabletIcon } from "./icons/glyphs/tablet";
466
+ export { Telegram as TelegramIcon } from "./icons/glyphs/telegram";
464
467
  export { Telescope as TelescopeIcon } from "./icons/glyphs/telescope";
465
468
  export { Terminal as TerminalIcon } from "./icons/glyphs/terminal";
466
469
  export { TextAlignCenter as TextAlignCenterIcon } from "./icons/glyphs/text-align-center";
@@ -502,6 +505,7 @@ export { Users as UsersIcon } from "./icons/glyphs/users";
502
505
  export { UsersRound as UsersRoundIcon } from "./icons/glyphs/users-round";
503
506
  export { Vibrate as VibrateIcon } from "./icons/glyphs/vibrate";
504
507
  export { Video as VideoIcon } from "./icons/glyphs/video";
508
+ export { Vk as VkIcon } from "./icons/glyphs/vk";
505
509
  export { Volume as VolumeIcon } from "./icons/glyphs/volume";
506
510
  export { Volume2 as Volume2Icon } from "./icons/glyphs/volume-2";
507
511
  export { VolumeX as VolumeXIcon } from "./icons/glyphs/volume-x";
@@ -513,6 +517,7 @@ export { WavesArrowUp as WavesArrowUpIcon } from "./icons/glyphs/waves-arrow-up"
513
517
  export { WavesLadder as WavesLadderIcon } from "./icons/glyphs/waves-ladder";
514
518
  export { Waypoints as WaypointsIcon } from "./icons/glyphs/waypoints";
515
519
  export { Webhook as WebhookIcon } from "./icons/glyphs/webhook";
520
+ export { Whatsapp as WhatsappIcon } from "./icons/glyphs/whatsapp";
516
521
  export { Wifi as WifiIcon } from "./icons/glyphs/wifi";
517
522
  export { WifiCog as WifiCogIcon } from "./icons/glyphs/wifi-cog";
518
523
  export { WifiLow as WifiLowIcon } from "./icons/glyphs/wifi-low";
@@ -128,7 +128,7 @@ The navigation of the nearest `AppShell.Root` for a trigger outside the rail (a
128
128
  - Two full-height planes edge to edge: no inset, radius, shadow or border — the boundary is the fill change (the Sidebar rail is layer 1, the panel the page: white rail beside a gray page in light, a rail one step lighter than the near-black page in dark).
129
129
  - Main hands the page its edge air: `--page-gutter` is the page gutter `--prime-layout-gutter` — `--prime-layout-gutter-s` (16) → `-m` (24) from 640px → `-l` (32) from 1024px; `--page-top` is `--prime-space-6` (24) → `--prime-space-8` (32) from 1024px. `Page.Root` pads itself with them (its top bar steps out to the panel's edges). Main itself pads only the bottom: `--prime-space-16`, the scroll tail of a long page. Inside Main the page gutter is the small one again, so a frame nested in the page starts from its own gutter, not the shell's.
130
130
  - A page that fills the panel height (`Page.Root fill`): Main's bottom padding drops to the side gutter, so no long scroll tail stays under it — beside the Sidebar rail too.
131
- - Main scrolls with `overscroll-behavior: contain`, so its scroll never chains to the document.
131
+ - Main hands its scroll on at its end (ScrollContainer `overscrollBehavior="auto"`): without `fillViewport` it is not a scroller and the document scrolls under the pointer.
132
132
  - Nav column: sticky at the top, viewport high, `z-index: --prime-z-sticky` (above the panel, so the compact Sidebar toggle can ride the rail edge); with `fillViewport` it fills the shell height instead.
133
133
  - Footer: no padding of its own (BottomNav keeps the bottom safe-area inset), sticky at the bottom, `z-index: --prime-z-sticky`.
134
134
  - A floating BottomNav (`floating`) in the footer: the footer takes no height, the capsule overlays the page, and Main keeps extra bottom room (the capsule height and the safe-area inset) so its last line never ends up under it.
@@ -9,8 +9,8 @@
9
9
  - Every route rendered inside `AppShell.Main`: the app is navigation and the page, and the page carries its own top (`Page.TopBar`), title (`Page.Title`, the `<h1>`) and body.
10
10
  - A work screen (a list, a board, a chat, a schedule): `Page.TopBar` with the title (`Page.Heading`), the page's tools (`Page.Tools`: sections, search and filter, view), all its buttons (`Page.Actions`) and the active filters (`Page.Chips`).
11
11
  - A filter stands next to what it filters. `Page.Tools` holds what acts on the whole page: sections, the view, a period that drives several blocks (the KPI cards and the table), and a search and filter only when it narrows several views of one set (a board and its list). A table's search, filter, chips, «Колонки» and selection menu always belong to its own tools row (DataTable `toolbar` + `toolbarChips`), on a page that is only the table too.
12
- - A section with sub-pages (the «Мессенджеры» item of the Sidebar with «Каналы» and «Статистика»): each sub-page is a route of its own, `Page.Title` stays the section's name, and the switch is a `SegmentedControl` of links (`SegmentedControl.Item asChild`) in `Page.Tools`; the body is the current sub-page. The Sidebar keeps the section's item current on every sub-route — a router `NavLink` to the section's path without `end`, or `current={pathname.startsWith("/messengers")}`.
13
- - A document page (settings, a long form, help) or an overview (a dashboard): `Page.Header` in the flow — the large title and its buttons — and `Page.TopBar collapse`, which repeats the title once it scrolls away and keeps the path and the buttons in reach.
12
+ - A section with sub-pages (the «Мессенджеры» item of the Sidebar with «Каналы», «Шаблоны» and «Статистика»): each sub-page is a route of its own, `Page.Title` stays the section's name, and the switch is a `SegmentedControl` of links (`SegmentedControl.Item asChild`) in `Page.Tools`, on a line of its own under the title at the start (see Top bar plan), so it stays put while each sub-page brings its own `Page.Actions` or none; the body is the current sub-page. The Sidebar keeps the section's item current on every sub-route — a router `NavLink` to the section's path without `end`, or `current={pathname.startsWith("/messengers")}`.
13
+ - A document page (settings, a long form, help) read top to bottom with no page tools: `Page.Header` in the flow — the large title and its buttons — and `Page.TopBar collapse` with the path in its `Page.Heading`, which repeats the title once it scrolls away. A dashboard or an analytics page titles itself in `Page.TopBar` like a list.
14
14
  - A nested record: a `Breadcrumb` path in `Page.Heading`; in the bar the title reads as its last level.
15
15
  - A text page held to a reading measure (`maxWidth="readable"`), a wide dashboard capped at the content width (`maxWidth="wide"`).
16
16
  - The tiles of a dashboard — KPI cards, charts, panels — as one board (`Page.Grid` + `Page.Cell`).
@@ -94,7 +94,7 @@ Page.Root the page column (<div>); maxWidth, fill, labe
94
94
  | `…rest` | `HTMLAttributes<HTMLElement>` | — | `children` (`Page.Heading`, `Page.Tools`, `Page.Actions`, `Page.Chips` — direct children), `className` and the other attributes. |
95
95
 
96
96
  ### Page.Header
97
- `ref` → `HTMLDivElement`. The document header in the page flow (settings, long forms, overviews): a `Page.Heading` and its `Page.Actions` in one row; the actions wrap under it on a narrow column.
97
+ `ref` → `HTMLDivElement`. The document header in the page flow (settings, long forms): a `Page.Heading` and its `Page.Actions` in one row; the actions wrap under it on a narrow column.
98
98
 
99
99
  | Prop | Type | Default | Description |
100
100
  |---|---|---|---|
@@ -123,7 +123,7 @@ Page.Root the page column (<div>); maxWidth, fill, labe
123
123
  | `…rest` | `HTMLAttributes<HTMLParagraphElement>` | — | `children`, `className` and the other paragraph attributes. |
124
124
 
125
125
  ### Page.Tools
126
- `ref` → `HTMLDivElement`. What acts on the whole page: sections (route links of sub-pages), view, a shared period; a filter only over several views — a table's go in its `toolbar`. The DataTable tool row: a search takes the free room, the rest keep their width. Named, a `group`.
126
+ `ref` → `HTMLDivElement`. What acts on the whole page: sub-page links, view, a shared period, a filter over several views (a table's tools go in its `toolbar`). Sub-page links take a line of their own at the start. Named, a `group`.
127
127
 
128
128
  | Prop | Type | Default | Description |
129
129
  |---|---|---|---|
@@ -226,8 +226,8 @@ No DOM, no ref. Holds the page from anywhere inside it: a press on a `Sidebar.It
226
226
  ### Place of Page.Heading
227
227
  | Value | Looks like | Use when | Default |
228
228
  |---|---|---|---|
229
- | in `Page.TopBar` | one line as high as the Sidebar brand row: path › title-m, the caption description under the whole line; both truncate | work screens: lists, boards, chats, records | |
230
- | in `Page.Header` in the flow | the large document header: path over a heading-m title, body-m description, the header's `Page.Actions` beside it, wrapping under it | document pages and overviews | |
229
+ | in `Page.TopBar` | one line as high as the Sidebar brand row: path › title-m, the caption description under the whole line; both truncate | screens of data: lists, boards, chats, records, dashboards and analytics | |
230
+ | in `Page.Header` in the flow | the large document header: path over a heading-m title, body-m description, the header's `Page.Actions` beside it, wrapping under it | document pages with no page tools: settings, long forms, help | |
231
231
 
232
232
  The size follows the place; the consumer passes nothing, and there are no title size props. One `Page.Title` (`<h1>`) per page, in one of the two places. A bar with no visible title still holds the `<h1>`: a `Page.Title` wrapped in `VisuallyHidden`, or a flow `Page.Title` (with `collapse` the bar repeats it).
233
233
 
@@ -236,7 +236,7 @@ The size follows the place; the consumer passes nothing, and there are no title
236
236
  |---|---|---|---|
237
237
  | `fill` (Root) | the page is as high as main; the body takes what the bar and the header leave; main keeps gutter-high air under it | a full-height table, board, chat or `Page.Split` in an `AppShell.Root fillViewport` | `false` |
238
238
  | `sticky` (TopBar) | the bar stays at the top of main while the page scrolls under it | every page; `false` for a bar that should scroll away | `true` |
239
- | `collapse` (TopBar) | the flow title rises into the bar's title row once it scrolls away | a document page or an overview with the title in the flow | `false` |
239
+ | `collapse` (TopBar) | the flow title rises into the bar's title row once it scrolls away | a document page with the path in the bar and the title in the flow | `false` |
240
240
  | `dirty` (Guard) | nothing until a person leaves: a press on the navigation or the path asks «leave without saving?» | a form that is the page has unsaved changes | `false` |
241
241
  | `busy` (Guard) | nothing until a person leaves: a press on the navigation or the path does nothing | the page's save request runs | `false` |
242
242
 
@@ -245,13 +245,13 @@ One plan, chosen from the natural widths of the groups (`data-plan` on the bar's
245
245
 
246
246
  | Step | Looks like | Use when | Default |
247
247
  |---|---|---|---|
248
- | `one` | `[Heading 1fr][Tools][Actions]` on one line | everything fits | yes |
249
- | `below` | the tools on a line of their own under the heading and the actions — the one tool row, as the DataTable `toolbar`: a search (`SmartFilter.Toolbar`, `Input.Root`) takes the free room, switchers, pickers and buttons keep their width at the end; under 36rem the search takes a line of its own and a `SegmentedControl.Root` / `Datepicker.Root` / Select fills the line it stands on | heading + tools + actions do not fit | |
248
+ | `one` | `[Heading 1fr][Tools][Actions]` on one line | everything fits, and the tools hold no navigation | yes |
249
+ | `below` | the tools on a line of their own under the heading and the actions — the one tool row, as the DataTable `toolbar`: a search (`SmartFilter.Toolbar`, `Input.Root`) takes the free room, switchers, pickers and buttons keep their width at the end; under 36rem the search takes a line of its own and a `SegmentedControl.Root` / `Datepicker.Root` / Select fills the line it stands on | heading + tools + actions do not fit; always for a section's sub-pages (the tools hold a navigation — a `SegmentedControl` of links), gathered at the start | |
250
250
  | `icons-secondary` | as `below`; secondary Buttons with a `Button.Icon` show only the icon, the label is their name and their tooltip | heading + actions still do not fit | |
251
251
  | `icons` | the primary Button gives way to its icon too | still too wide | |
252
252
  | `fold` | the secondary Buttons fold into «⋯» (`labels.more`); the primary stays | still too wide, and «⋯» is narrower than their icons (a single secondary keeps its icon); past it a Breadcrumb path folds into «…»; if the path and the title still do not share the line, the heading stacks: the path on its own line over the title, the title and the description wrapping (`data-heading="stack"`); a heading without a path truncates | |
253
253
 
254
- The actions stay on the first line beside the heading at every step; `Page.Chips` is always a line under everything; nothing overflows. The primary is the first solid `Button.Root`; a Button without an icon keeps its label at every step; anything that is not a `Button.Root` stays as it is.
254
+ A section's sub-pages never share the first line: there they would stand where each sub-page's own heading and actions leave room, and those differ («Подключить канал» on one, none on another), so the switch would move under the pointer. On a line of their own at the start they stand at one place on every sub-page and at every width. The actions stay on the first line beside the heading at every step; `Page.Chips` is always a line under everything; nothing overflows. The primary is the first solid `Button.Root`; a Button without an icon keeps its label at every step; anything that is not a `Button.Root` stays as it is.
255
255
 
256
256
  ### Grid columns
257
257
  | Grid width | Cell `span` 1–3 | `span` 4 | `span` 5–6 | `span` 7–12 | `rows` |
@@ -342,9 +342,9 @@ A wide cell (`span` 7–11) written next to a narrow one (`span` 4–5) is a pai
342
342
  | [structure.tsx](examples/structure.tsx) | A document page in the flow: the path over the large title, its line of data and the page's buttons beside them, then the body with a section — `Page.Header`, `Page.Heading`, `Page.Description`, `Page.Section`. |
343
343
  | [top-bar.tsx](examples/top-bar.tsx) | A nested record in the top bar: the path ending in the title, a line of data, the page's tools and its buttons — `Page.TopBar`, `Page.Heading`, `Page.Tools`, `Page.Actions`. |
344
344
  | [loading.tsx](examples/loading.tsx) | A page whose figures load after it opens: the line of data keeps its place under the title while it loads, so nothing in the bar moves — `loading`. |
345
- | [collapse.tsx](examples/collapse.tsx) | An overview whose large title scrolls away under the top bar: the bar repeats it with its line of data and keeps the period and the page's buttons in reach — `collapse`. |
345
+ | [collapse.tsx](examples/collapse.tsx) | A document page whose large title scrolls away under the top bar: the bar holds the path and repeats the title after it once the title is out of view — `collapse`, `Page.Header`. |
346
346
  | [tools.tsx](examples/tools.tsx) | The orders page's tools in its top bar: sections with counts, the search and filter that narrow both views, the view, in the order written; the active filters on a line under everything — `Page.Tools`, `Page.Chips`. |
347
- | [router.tsx](examples/router.tsx) | A section with sub-pages: the title is the section, each sub-page is a route of its own, the switch in the bar is their links and the body cross-fades between them; render it inside a router — `Page.Tools`, `asChild`. |
347
+ | [router.tsx](examples/router.tsx) | A section with sub-pages: the title is the section, each sub-page is a route of its own with its own actions, the switch in the bar is their links on a line of their own and the body cross-fades between them; render it inside a router — `Page.Tools`, `asChild`. |
348
348
  | [actions-collapse.tsx](examples/actions-collapse.tsx) | The buttons of an invoices page on a tablet-wide column: the line runs short, so the secondary buttons show only their icons with the label as the name and the tooltip, the primary keeps its label — `Page.Actions`, `Button.Icon`. |
349
349
  | [sections.tsx](examples/sections.tsx) | A page with titled sections: tiles of one screen close together, a new topic set off by air, a link at the end of the heading — `Page.Section`, `label`, `description`, `Page.Actions`. |
350
350
  | [grid.tsx](examples/grid.tsx) | A dashboard board: four KPI tiles, a chart two rows high beside two panels, one gap on both axes — `Page.Grid`, `Page.Cell`, `span`, `rows`. |
@@ -365,6 +365,7 @@ A wide cell (`span` 7–11) written next to a narrow one (`span` 4–5) is a pai
365
365
  - `SmartFilter.Root` inside the bar, around `Page.Tools` → it holds no DOM; wrap it around `Page.Root` so its Toolbar (in `Page.Tools`) and its Chips (in `Page.Chips`) share it.
366
366
  - A table's search, filter, chips or «Колонки» in `Page.Tools` / `Page.Chips` → they read as filters of the whole page and move when the page grows a block; they go in the table's `toolbar` / `toolbarChips` on every page, the one that is only the table too. The bar keeps the title, sections, the view, a period that drives every block and the page's buttons.
367
367
  - Sub-pages of a section as a second Sidebar level, a tab strip inside `Page.Body`, or a title that names the sub-page → the title stays the section, the sub-pages are route links in `Page.Tools` (`SegmentedControl.Item asChild`), and the section's Sidebar item stays current on every sub-route.
368
+ - A dashboard or analytics page with a bar of tools only (`collapse`) over a large title in the flow → the title and its line of data go in the bar's `Page.Heading` beside the tools, as on a list; the flow header is for document pages.
368
369
  - `Page.Header` inside `Page.TopBar` → the bar takes `Page.Heading` and `Page.Actions` directly; `Page.Header` is the flow's document header.
369
370
  - A hand-made menu button for the phone Sidebar → the bar draws it while the Sidebar is off-canvas.
370
371
  - Hiding buttons with media queries on a phone → `Page.Actions` in the bar collapses and folds them by measured width.
@@ -1,60 +1,74 @@
1
- /** An overview whose large title scrolls away under the top bar: the bar repeats it with its line of data and keeps the period and the page's buttons in reach — `collapse`. */
2
- import { AppShell, Button, Card, Icon, Page, SegmentedControl, Typography } from "prime-ui-kit";
3
- import * as React from "react";
1
+ /** A document page whose large title scrolls away under the top bar: the bar holds the path and repeats the title after it once the title is out of view — `collapse`, `Page.Header`. */
2
+ import { AppShell, Breadcrumb, Button, Card, Icon, Page, Typography } from "prime-ui-kit";
4
3
 
5
4
  import styles from "./examples.module.css";
6
5
 
7
- const WEEKS = [
6
+ const SECTIONS = [
8
7
  {
9
- id: "w41",
10
- title: "6–12 октября",
11
- text: "Выручка 1,2 млн ₽, 312 заказов, средний чек 3 850 ₽.",
8
+ id: "terms",
9
+ title: "Сроки",
10
+ text: "Клиент может вернуть заказ в течение 14 дней после получения. Срок считается от даты в акте приёмки.",
11
+ },
12
+ {
13
+ id: "condition",
14
+ title: "Состояние товара",
15
+ text: "Товар принимается в заводской упаковке, без следов использования, с ярлыками и полным комплектом.",
16
+ },
17
+ {
18
+ id: "refund",
19
+ title: "Возврат денег",
20
+ text: "Деньги возвращаются тем же способом, которым был оплачен заказ, в течение 10 рабочих дней после проверки.",
21
+ },
22
+ {
23
+ id: "delivery",
24
+ title: "Доставка при возврате",
25
+ text: "Если товар с браком, доставку оплачивает магазин. В остальных случаях — клиент по тарифу службы доставки.",
26
+ },
27
+ {
28
+ id: "exceptions",
29
+ title: "Исключения",
30
+ text: "Не возвращаются товары, изготовленные по индивидуальному заказу, и цифровые лицензии после активации.",
12
31
  },
13
- { id: "w40", title: "29 сентября – 5 октября", text: "Выручка 1,1 млн ₽, 298 заказов." },
14
- { id: "w39", title: "22–28 сентября", text: "Выручка 0,9 млн ₽, 264 заказа." },
15
- { id: "w38", title: "15–21 сентября", text: "Выручка 1,0 млн ₽, 281 заказ." },
16
- { id: "w37", title: "8–14 сентября", text: "Выручка 0,8 млн ₽, 240 заказов." },
17
32
  ];
18
33
 
19
34
  export default function PageCollapseExample() {
20
- const [period, setPeriod] = React.useState("week");
21
-
22
35
  return (
23
36
  <div className={`${styles.window} ${styles.tall}`}>
24
37
  <AppShell.Root fillViewport className={styles.shell}>
25
38
  <AppShell.Main>
26
- <Page.Root>
39
+ <Page.Root maxWidth="readable">
27
40
  <Page.TopBar collapse>
28
- <Page.Tools aria-label="Продажи">
29
- <SegmentedControl.Root value={period} onValueChange={setPeriod} aria-label="Период">
30
- <SegmentedControl.Item value="week">Неделя</SegmentedControl.Item>
31
- <SegmentedControl.Item value="month">Месяц</SegmentedControl.Item>
32
- </SegmentedControl.Root>
33
- </Page.Tools>
41
+ <Page.Heading>
42
+ <Breadcrumb.Root>
43
+ <Breadcrumb.Item href="#documents">Документы</Breadcrumb.Item>
44
+ </Breadcrumb.Root>
45
+ </Page.Heading>
46
+ </Page.TopBar>
47
+ <Page.Header>
48
+ <Page.Heading>
49
+ <Page.Title>Политика возвратов</Page.Title>
50
+ <Page.Description>
51
+ Действует с 1 сентября для всех заказов магазина.
52
+ </Page.Description>
53
+ </Page.Heading>
34
54
  <Page.Actions>
35
55
  <Button.Root variant="soft" tone="neutral">
36
56
  <Button.Icon>
37
57
  <Icon name="action.download" />
38
58
  </Button.Icon>
39
- Отчёт
59
+ Скачать PDF
40
60
  </Button.Root>
41
61
  </Page.Actions>
42
- </Page.TopBar>
43
- <Page.Header>
44
- <Page.Heading>
45
- <Page.Title>Продажи</Page.Title>
46
- <Page.Description>Интернет-магазин · на 14 октября, 9:40</Page.Description>
47
- </Page.Heading>
48
62
  </Page.Header>
49
63
  <Page.Body>
50
- {WEEKS.map((week) => (
51
- <Card.Root key={week.id} variant="panel">
64
+ {SECTIONS.map((section) => (
65
+ <Card.Root key={section.id} variant="panel">
52
66
  <Card.Header>
53
- <Card.Title as="h2">{week.title}</Card.Title>
67
+ <Card.Title as="h2">{section.title}</Card.Title>
54
68
  </Card.Header>
55
69
  <Card.Body>
56
70
  <Typography variant="body-m" tone="secondary">
57
- {week.text}
71
+ {section.text}
58
72
  </Typography>
59
73
  </Card.Body>
60
74
  </Card.Root>
@@ -1,4 +1,4 @@
1
- /** A section with sub-pages: the title is the section, each sub-page is a route of its own, the switch in the bar is their links and the body cross-fades between them; render it inside a router — `Page.Tools`, `asChild`. */
1
+ /** A section with sub-pages: the title is the section, each sub-page is a route of its own with its own actions, the switch in the bar is their links on a line of their own and the body cross-fades between them; render it inside a router — `Page.Tools`, `asChild`. */
2
2
  import {
3
3
  Button,
4
4
  Card,
@@ -12,10 +12,13 @@ import {
12
12
  import { Link, Route, Routes, useLocation } from "react-router-dom";
13
13
 
14
14
  type Channel = { id: string; name: string; dialogs: number; reply: string };
15
+ type Template = { id: string; name: string; uses: number };
15
16
 
17
+ // The action of each sub-page: its own label, none on the statistics.
16
18
  const SUB_PAGES = [
17
- { to: "/messengers/channels", label: "Каналы" },
18
- { to: "/messengers/stats", label: "Статистика" },
19
+ { to: "/messengers/channels", label: "Каналы", action: "Подключить канал" },
20
+ { to: "/messengers/templates", label: "Шаблоны", action: "Новый шаблон" },
21
+ { to: "/messengers/stats", label: "Статистика", action: null },
19
22
  ];
20
23
 
21
24
  const CHANNELS: Channel[] = [
@@ -25,6 +28,23 @@ const CHANNELS: Channel[] = [
25
28
  { id: "avito", name: "Авито · Склад на Южной", dialogs: 59, reply: "25 мин" },
26
29
  ];
27
30
 
31
+ const TEMPLATES: Template[] = [
32
+ { id: "greeting", name: "Приветствие в рабочее время", uses: 812 },
33
+ { id: "night", name: "Ответ ночью", uses: 264 },
34
+ { id: "delivery", name: "Сроки доставки", uses: 151 },
35
+ ];
36
+
37
+ const TEMPLATE_COLUMNS: DataTableColumn<Template>[] = [
38
+ { id: "name", header: "Шаблон", cell: (row) => row.name },
39
+ {
40
+ id: "uses",
41
+ header: "Отправок",
42
+ numeric: true,
43
+ headerAlign: "end",
44
+ cell: (row) => row.uses,
45
+ },
46
+ ];
47
+
28
48
  const COLUMNS: DataTableColumn<Channel>[] = [
29
49
  { id: "name", header: "Канал", cell: (row) => row.name },
30
50
  {
@@ -46,7 +66,7 @@ const COLUMNS: DataTableColumn<Channel>[] = [
46
66
  export default function PageRouterExample() {
47
67
  const location = useLocation();
48
68
  // The first sub-page answers every other path of the section (here the preview's «/»).
49
- const current = SUB_PAGES.find((page) => page.to === location.pathname)?.to ?? SUB_PAGES[0].to;
69
+ const current = SUB_PAGES.find((page) => page.to === location.pathname) ?? SUB_PAGES[0];
50
70
 
51
71
  return (
52
72
  <Page.Root>
@@ -56,7 +76,7 @@ export default function PageRouterExample() {
56
76
  <Page.Description>4 канала · 1 280 диалогов за октябрь</Page.Description>
57
77
  </Page.Heading>
58
78
  <Page.Tools aria-label="Мессенджеры">
59
- <SegmentedControl.Root value={current} aria-label="Подразделы">
79
+ <SegmentedControl.Root value={current.to} aria-label="Подразделы">
60
80
  {SUB_PAGES.map((page) => (
61
81
  <SegmentedControl.Item key={page.to} value={page.to} asChild>
62
82
  <Link to={page.to}>{page.label}</Link>
@@ -64,18 +84,20 @@ export default function PageRouterExample() {
64
84
  ))}
65
85
  </SegmentedControl.Root>
66
86
  </Page.Tools>
67
- <Page.Actions>
68
- <Button.Root>
69
- <Button.Icon>
70
- <Icon name="action.add" />
71
- </Button.Icon>
72
- Подключить канал
73
- </Button.Root>
74
- </Page.Actions>
87
+ {current.action ? (
88
+ <Page.Actions>
89
+ <Button.Root>
90
+ <Button.Icon>
91
+ <Icon name="action.add" />
92
+ </Button.Icon>
93
+ {current.action}
94
+ </Button.Root>
95
+ </Page.Actions>
96
+ ) : null}
75
97
  </Page.TopBar>
76
98
  <Page.Body>
77
99
  {/* `location` keeps the leaving sub-page on its own route while it fades out. */}
78
- <Crossfade state={current}>
100
+ <Crossfade state={current.to}>
79
101
  <Routes location={location}>
80
102
  <Route
81
103
  path="/messengers/stats"
@@ -105,6 +127,17 @@ export default function PageRouterExample() {
105
127
  </Page.Grid>
106
128
  }
107
129
  />
130
+ <Route
131
+ path="/messengers/templates"
132
+ element={
133
+ <DataTable
134
+ columns={TEMPLATE_COLUMNS}
135
+ rows={TEMPLATES}
136
+ getRowKey={(row) => row.id}
137
+ paging="none"
138
+ />
139
+ }
140
+ />
108
141
  <Route
109
142
  path="*"
110
143
  element={
package/dist/skill/ux.md CHANGED
@@ -34,6 +34,7 @@ adds text that explains what the layout failed to show.
34
34
  | A base value and its overrides (a price and its changes by month) | one list: the base is the first, pinned row | `FieldList` `getLocked` |
35
35
  | Small attributes of a record (an icon, a color, a flag) | compact controls in the record's row, not fields of their own | icon-only `Select`, `ColorPresets`, `Switch` |
36
36
  | Short texts in an order the person sets | one column, a handle per row | `FieldList` `reorderable` |
37
+ | Records of one kind, some fixed by the system (funnel stages, default roles) | one list in their real order, the fixed rows pinned in place | `List` `locked`, `FieldList` `getLocked` |
37
38
  | Settings that most people never touch | behind a disclosure, after the common ones | `Accordion`, a «Дополнительно» section |
38
39
  | One of a few options, sent with a form | all visible | `Radio.Group` |
39
40
  | One of a few modes of what the screen shows | all visible | `SegmentedControl` |
@@ -81,6 +82,36 @@ records they cannot see. A set that can be empty shows its empty state, never a
81
82
  </Drawer.Section>
82
83
  ```
83
84
 
85
+ **One kind, one list.** Records of one kind stay one list in the order they really have, whoever made
86
+ them: the stages of a funnel, the team's and the system's alike, read top to bottom as the board shows
87
+ them. What some rows cannot do (move, be removed) is a mark on those rows — the lock in the grip's
88
+ place — never a second section. Two lists split one order in two, and their columns no longer line up.
89
+ The test: does the board, the report or the process read these records as one sequence? Then they are
90
+ one list.
91
+
92
+ ```tsx partial
93
+ // bad — the system stages in a section of their own under the team's; one order, two lists
94
+ <Drawer.Section label="Свои этапы">
95
+ <List.Root aria-label="Свои этапы" onReorder={reorder}>…</List.Root>
96
+ </Drawer.Section>
97
+ <Drawer.Section label="Системные этапы">
98
+ <List.Root aria-label="Системные этапы">…</List.Root>
99
+ </Drawer.Section>
100
+ ```
101
+
102
+ ```tsx good
103
+ // good — one list in board order; the system stages hold their places with a lock
104
+ // declare: const stages: { id: string; name: string; system: boolean }[]
105
+ // declare: const reorder: (id: string, beforeId: string | null) => void
106
+ <List.Root aria-label="Этапы воронки" onReorder={reorder}>
107
+ {stages.map((stage) => (
108
+ <List.Item key={stage.id} value={stage.id} locked={stage.system}>
109
+ <List.ItemText>{stage.name}</List.ItemText>
110
+ </List.Item>
111
+ ))}
112
+ </List.Root>
113
+ ```
114
+
84
115
  ## 3. Label economy
85
116
 
86
117
  Every word on screen must carry something the person does not see already.
@@ -91,6 +122,46 @@ Every word on screen must carry something the person does not see already.
91
122
  list already counts. The list label names the rows.
92
123
  - **No label that repeats its heading.** A field «Цена» inside the section «Цена» needs no label of
93
124
  its own beyond what the section says; a group of one field is the field.
125
+ - **A heading only where it names what nothing else names.** A block that names itself — a chart or a
126
+ card with its own title, a table with its toolbar — gets no section heading over it, and the first
127
+ block of a tab never repeats the tab («Характеристики» under the tab «Характеристики»). A section
128
+ heading stands where several blocks share a topic that none of them names. The test: delete the
129
+ heading and read the screen; if nothing is lost, it goes. Blocks without a heading stand one under
130
+ another with the section step between them (a `Tabs.Panel` in a dialog body spaces them by itself;
131
+ no wrapper of your own).
132
+
133
+ ```tsx partial
134
+ // bad — a section over a chart that has its own title, under a tab of the same name
135
+ <Tabs.Panel value="analytics">
136
+ <Drawer.Section label="Аналитика" description="За 30 дней">
137
+ <ChartFrame.Root>
138
+ <ChartFrame.Header>
139
+ <ChartFrame.Title>Продажи</ChartFrame.Title>
140
+ </ChartFrame.Header>
141
+ …
142
+ </ChartFrame.Root>
143
+ </Drawer.Section>
144
+ </Tabs.Panel>
145
+ ```
146
+
147
+ ```tsx good
148
+ // good — the charts name themselves; the tab names the topic, the period is the tab's switcher
149
+ // declare: const sales: Parameters<typeof ChartFrame.Root>[0]["rows"]
150
+ // declare: const refunds: Parameters<typeof ChartFrame.Root>[0]["rows"]
151
+ <Tabs.Panel value="analytics">
152
+ <ChartFrame.Root rows={sales}>
153
+ <ChartFrame.Header>
154
+ <ChartFrame.Title>Продажи</ChartFrame.Title>
155
+ </ChartFrame.Header>
156
+ </ChartFrame.Root>
157
+ <ChartFrame.Root rows={refunds}>
158
+ <ChartFrame.Header>
159
+ <ChartFrame.Title>Возвраты</ChartFrame.Title>
160
+ </ChartFrame.Header>
161
+ </ChartFrame.Root>
162
+ </Tabs.Panel>
163
+ ```
164
+
94
165
  - **A unit lives in one place.** In the field (`Input.InlineAffix`) or in the heading, never both;
95
166
  never in the field's own label («Бюджет», not «Бюджет, ₽»). Prefer the field: the unit stays
96
167
  beside the number when the row stacks, and a screen reader hears it with the field (the affix
@@ -111,6 +182,11 @@ Every word on screen must carry something the person does not see already.
111
182
  | «Звук» (Switch) — «Применяется сразу, без сохранения» | no hint |
112
183
  | «Отключить доступ» — «Сотрудник не сможет войти, история его действий останется» | «Входы прекратятся» |
113
184
  | «Почта для входа» — «На эту почту придёт ссылка для входа в систему» | «Для входа и уведомлений» |
185
+ - **Helper text is opt-in.** A hint, a limit, a counter, a range line («Показано 1–20 из 240») or a
186
+ description shows only where it tells this person something they need for this task; the kit
187
+ draws none of its own unless asked — DataTable shows its range with `showRange`, and FieldList and
188
+ FileUpload at `max` close up their add control without a word, so a limit worth knowing goes in
189
+ `hint` («До 10 фото»). Turn one on for a reason you can name, never because the prop exists.
114
190
  - **One name per thing.** The same action, entity and status keep one word on the whole screen
115
191
  (and across screens): «Счёт», not «Счёт» in the title and «Инвойс» in the button.
116
192
  - **Count the labels.** On a form of repeating rows, labels on screen ≤ number of columns + the
@@ -158,8 +234,9 @@ Which button starts each step and how the confirm behaves:
158
234
  ## 6. Nothing to guess
159
235
 
160
236
  - **A disabled control says why** when the reason is not on screen: a `hint` under the field, a
161
- line beside the button («Не больше 3», as `FieldList` does at `max`), or the disabled control
162
- itself in `Tooltip.Trigger`. An action a person may never take (no permission) is hidden, not
237
+ line beside the button, or the disabled control itself in `Tooltip.Trigger`. A control that
238
+ leaves at a limit (the add button of `FieldList` or `FileUpload` at `max`) says it ahead, in the
239
+ list's `hint`. An action a person may never take (no permission) is hidden, not
163
240
  disabled.
164
241
  - **The screen answers the latest question.** A request a value starts (a search, a filter, a page,
165
242
  a period) is cancelled when the value changes again — abort it (`AbortController`) or drop its
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prime-ui-kit",
3
- "version": "0.21.1",
3
+ "version": "0.21.3",
4
4
  "packageManager": "bun@1.3.13",
5
5
  "description": "React 19 UI kit for product interfaces: 79 composable components on one design contract — forms, selects, tables, overlays, navigation, app shell. CSS Modules, --prime-* tokens, light and dark themes, TypeScript, a11y, Next.js App Router ready. Ships COMPONENT.md docs, copyable examples and an agent skill.",
6
6
  "bin": {
@@ -220,7 +220,7 @@ No `labels`.
220
220
  | [flat.tsx](examples/flat.tsx) | A flat tile without the raised shadow next to the default one, for dense grids — `flat`. |
221
221
  | [states.tsx](examples/states.tsx) | A KPI tile while its report loads next to the loaded one, in the `stat-trend` and `mini` templates — `loading`. |
222
222
  | [narrow.tsx](examples/narrow.tsx) | The card is a size container: the split template stacks its cells below 22rem and the trend value shrinks below 20rem — `variant`. |
223
- | [screen.tsx](examples/screen.tsx) | A dashboard: the title and a line of data in the page flow, the period switch and the report in the top bar that keeps the title once it scrolls away; one grid of KPI tiles that cross-fade to the new period, a revenue trend, invoiced against paid beside two panels, and the latest payments with a link to the list — `collapse`, `Page.Grid`. |
223
+ | [screen.tsx](examples/screen.tsx) | A dashboard: the title with a line of data, the period switch and the report in the page's top bar; one grid of KPI tiles that cross-fade to the new period, a revenue trend, invoiced against paid beside two panels, and the latest payments with a link to the list — `Page.TopBar`, `Page.Grid`. |
224
224
 
225
225
  ## Mistakes
226
226
  - A `<div>` with a border styled as a card → use `Card.Root`; depth comes from fill, not lines.