prime-ui-kit 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -18
- package/dist/chunks/{chunk-4PSQ64S4.js → chunk-7WWZYGRC.js} +3697 -3738
- package/dist/chunks/{chunk-6TPHKCUJ.js → chunk-A4WE3UNC.js} +27340 -26893
- package/dist/chunks/{chunk-A7OQWH6R.js → chunk-PRP4B6OG.js} +1 -1
- package/dist/chunks/{chunk-HDBQICPW.js → chunk-SVFWPLNW.js} +49 -20
- package/dist/color-picker.d.ts +1 -1
- package/dist/color-picker.js +3 -3
- package/dist/components/breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/components/chart-frame/ChartFrame.d.ts +1 -1
- package/dist/components/chat/ChatRows.d.ts +5 -1
- package/dist/components/color-picker/ColorPicker.d.ts +18 -1
- package/dist/components/data-table/DataTable.d.ts +1 -1
- package/dist/components/index.d.ts +0 -4
- package/dist/components/pagination/Pagination.d.ts +5 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/slider/Slider.d.ts +1 -1
- package/dist/components/smart-filter/SmartFilter.d.ts +4 -5
- package/dist/icon-set.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +5 -9
- package/dist/internal/barPlan.d.ts +44 -0
- package/dist/internal/overlay/FloatingPanel.d.ts +1 -1
- package/dist/internal/overlay/focus.d.ts +3 -2
- package/dist/internal/parts.d.ts +1 -1
- package/dist/internal/slot.d.ts +0 -30
- package/dist/layout/app-shell/AppShell.d.ts +19 -38
- package/dist/layout/index.d.ts +3 -3
- package/dist/layout/page/Page.d.ts +263 -0
- package/dist/layout/sidebar/Sidebar.d.ts +1 -1
- package/dist/skill/SKILL.md +10 -10
- package/dist/skill/anti-slop.md +101 -5
- package/dist/skill/api-contract.md +1 -1
- package/dist/skill/cheatsheet.md +27 -22
- package/dist/skill/checklist.md +7 -3
- package/dist/skill/choosing.md +9 -8
- package/dist/skill/components.md +3 -5
- package/dist/skill/composition.md +177 -152
- package/dist/skill/foundations.md +9 -9
- package/dist/skill/layouts.md +39 -98
- package/dist/skill/reference/components/avatar/COMPONENT.md +2 -2
- package/dist/skill/reference/components/avatar/examples/team-group.tsx +1 -1
- package/dist/skill/reference/components/banner/COMPONENT.md +4 -4
- package/dist/skill/reference/components/banner/examples/examples.module.css +6 -1
- package/dist/skill/reference/components/banner/examples/page-strip.tsx +24 -22
- package/dist/skill/reference/components/breadcrumb/COMPONENT.md +9 -8
- package/dist/skill/reference/components/button/COMPONENT.md +1 -0
- package/dist/skill/reference/components/button/examples/hold-to-confirm.tsx +1 -1
- package/dist/skill/reference/components/button/examples/on-colored-host.tsx +8 -8
- package/dist/skill/reference/components/card/COMPONENT.md +7 -7
- package/dist/skill/reference/components/card/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/card/examples/screen.tsx +184 -198
- package/dist/skill/reference/components/chart-frame/COMPONENT.md +1 -1
- package/dist/skill/reference/components/chart-frame/examples/fill-height.tsx +9 -9
- package/dist/skill/reference/components/chat/COMPONENT.md +4 -4
- package/dist/skill/reference/components/chat/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/chat/examples/screen.tsx +110 -117
- package/dist/skill/reference/components/chat-list/COMPONENT.md +2 -2
- package/dist/skill/reference/components/chat-list/examples/controlled.tsx +2 -2
- package/dist/skill/reference/components/chat-list/examples/examples.module.css +8 -0
- package/dist/skill/reference/components/checkbox/examples/examples.module.css +3 -2
- package/dist/skill/reference/components/code-block/COMPONENT.md +1 -1
- package/dist/skill/reference/components/code-block/examples/color-scheme.tsx +2 -4
- package/dist/skill/reference/components/code-block/examples/examples.module.css +0 -11
- package/dist/skill/reference/components/color-picker/COMPONENT.md +18 -7
- package/dist/skill/reference/components/color-picker/examples/examples.module.css +2 -5
- package/dist/skill/reference/components/color-picker/examples/overview.tsx +5 -10
- package/dist/skill/reference/components/color-picker/examples/sizes.tsx +4 -8
- package/dist/skill/reference/components/crossfade/COMPONENT.md +2 -2
- package/dist/skill/reference/components/crossfade/examples/screen.tsx +107 -112
- package/dist/skill/reference/components/data-table/COMPONENT.md +5 -5
- package/dist/skill/reference/components/data-table/examples/examples.module.css +9 -0
- package/dist/skill/reference/components/data-table/examples/screen.tsx +42 -52
- package/dist/skill/reference/components/data-table/examples/server.tsx +6 -2
- package/dist/skill/reference/components/datepicker/examples/examples.module.css +6 -0
- package/dist/skill/reference/components/datepicker/examples/inline-panel.tsx +3 -1
- package/dist/skill/reference/components/description-list/COMPONENT.md +1 -1
- package/dist/skill/reference/components/description-list/examples/screen.tsx +120 -127
- package/dist/skill/reference/components/digit-input/examples/grouped.tsx +4 -4
- package/dist/skill/reference/components/digit-input/examples/validation.tsx +1 -1
- package/dist/skill/reference/components/divider/COMPONENT.md +2 -2
- package/dist/skill/reference/components/divider/examples/examples.module.css +4 -1
- package/dist/skill/reference/components/divider/examples/vertical.tsx +22 -9
- package/dist/skill/reference/components/dnd/examples/examples.module.css +3 -1
- package/dist/skill/reference/components/drawer/COMPONENT.md +1 -1
- package/dist/skill/reference/components/drawer/examples/placement.tsx +26 -31
- package/dist/skill/reference/components/drawer/examples/screen.tsx +137 -160
- package/dist/skill/reference/components/dropdown/COMPONENT.md +1 -1
- package/dist/skill/reference/components/example-frame/COMPONENT.md +3 -3
- package/dist/skill/reference/components/field-list/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/field-list/examples/screen.tsx +19 -19
- package/dist/skill/reference/components/fieldset/COMPONENT.md +1 -1
- package/dist/skill/reference/components/fieldset/examples/states.tsx +1 -1
- package/dist/skill/reference/components/file-upload/COMPONENT.md +1 -1
- package/dist/skill/reference/components/file-upload/examples/screen.module.css +2 -2
- package/dist/skill/reference/components/file-upload/examples/screen.tsx +65 -81
- package/dist/skill/reference/components/gallery/COMPONENT.md +1 -0
- package/dist/skill/reference/components/gantt/COMPONENT.md +1 -1
- package/dist/skill/reference/components/gantt/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/gantt/examples/screen.tsx +55 -73
- package/dist/skill/reference/components/hint/examples/examples.module.css +10 -1
- package/dist/skill/reference/components/hint/examples/overview.tsx +1 -1
- package/dist/skill/reference/components/kanban/COMPONENT.md +1 -1
- package/dist/skill/reference/components/kanban/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/kanban/examples/screen.tsx +50 -65
- package/dist/skill/reference/components/kbd/COMPONENT.md +1 -1
- package/dist/skill/reference/components/label/examples/examples.module.css +12 -1
- package/dist/skill/reference/components/label/examples/overview.tsx +1 -1
- package/dist/skill/reference/components/list/COMPONENT.md +3 -3
- package/dist/skill/reference/components/media-viewer/examples/controlled.tsx +16 -16
- package/dist/skill/reference/components/media-viewer/examples/examples.module.css +1 -3
- package/dist/skill/reference/components/pagination/COMPONENT.md +11 -3
- package/dist/skill/reference/components/pagination/examples/controlled.tsx +2 -1
- package/dist/skill/reference/components/popover/COMPONENT.md +3 -2
- package/dist/skill/reference/components/popover/examples/width.tsx +13 -1
- package/dist/skill/reference/components/slider/COMPONENT.md +3 -3
- package/dist/skill/reference/components/slider/examples/states.tsx +14 -10
- package/dist/skill/reference/components/smart-filter/COMPONENT.md +13 -13
- package/dist/skill/reference/components/smart-filter/examples/examples.module.css +3 -0
- package/dist/skill/reference/components/smart-filter/examples/many-values.tsx +12 -8
- package/dist/skill/reference/components/smart-filter/examples/sizes.tsx +7 -3
- package/dist/skill/reference/components/sparkline/COMPONENT.md +1 -0
- package/dist/skill/reference/components/sparkline/examples/curve.tsx +16 -11
- package/dist/skill/reference/components/sparkline/examples/states.tsx +14 -10
- package/dist/skill/reference/components/switch/COMPONENT.md +1 -1
- package/dist/skill/reference/components/tabs/COMPONENT.md +1 -1
- package/dist/skill/reference/components/typography/COMPONENT.md +2 -2
- package/dist/skill/reference/foundation.md +15 -11
- package/dist/skill/reference/layout/app-shell/COMPONENT.md +25 -38
- package/dist/skill/reference/layout/app-shell/examples/footer.tsx +10 -10
- package/dist/skill/reference/layout/app-shell/examples/overview.tsx +20 -22
- package/dist/skill/reference/layout/app-shell/examples/screen.module.css +2 -2
- package/dist/skill/reference/layout/app-shell/examples/screen.tsx +25 -30
- package/dist/skill/reference/layout/app-shell/examples/template.tsx +13 -17
- package/dist/skill/reference/layout/bottom-nav/COMPONENT.md +3 -3
- package/dist/skill/reference/layout/bottom-nav/examples/floating-action.tsx +10 -19
- package/dist/skill/reference/layout/bottom-nav/examples/floating.tsx +10 -19
- package/dist/skill/reference/layout/bottom-nav/examples/in-app-shell.tsx +11 -19
- package/dist/skill/reference/layout/page/COMPONENT.md +353 -0
- package/dist/skill/reference/layout/page/examples/actions-collapse.tsx +45 -0
- package/dist/skill/reference/layout/page/examples/collapse.tsx +68 -0
- package/dist/skill/reference/{components/page-content → layout/page}/examples/examples.module.css +33 -4
- package/{src/components/page-content → dist/skill/reference/layout/page}/examples/grid.tsx +15 -15
- package/dist/skill/reference/{components/page-content → layout/page}/examples/list-detail.tsx +14 -14
- package/dist/skill/reference/layout/page/examples/narrow.tsx +75 -0
- package/dist/skill/reference/layout/page/examples/overview.tsx +57 -0
- package/dist/skill/reference/{components/page-content → layout/page}/examples/screen.module.css +1 -1
- package/{src/components/page-content → dist/skill/reference/layout/page}/examples/screen.tsx +29 -19
- package/dist/skill/reference/{components/page-content → layout/page}/examples/sections.tsx +17 -24
- package/dist/skill/reference/layout/page/examples/structure.tsx +41 -0
- package/dist/skill/reference/{components/page-toolbar/examples/narrow.tsx → layout/page/examples/tools.tsx} +38 -35
- package/dist/skill/reference/layout/page/examples/top-bar.tsx +85 -0
- package/dist/skill/reference/{components/page-content → layout/page}/examples/variants.tsx +7 -7
- package/dist/skill/reference/layout/sidebar/COMPONENT.md +5 -4
- package/dist/skill/reference/layout/sidebar/examples/dismiss.tsx +10 -7
- package/dist/skill/reference/layout/sidebar/examples/narrow.tsx +11 -8
- package/dist/skill/responsive.md +88 -74
- package/dist/tokens/layers.d.ts +2 -0
- package/dist/tokens/primitives.d.ts +12 -2
- package/dist/tokens/semantic.d.ts +7 -0
- package/dist/tokens/themes/dark.d.ts +7 -2
- package/package.json +2 -2
- package/src/components/avatar/COMPONENT.md +2 -2
- package/src/components/avatar/examples/team-group.tsx +1 -1
- package/src/components/banner/COMPONENT.md +4 -4
- package/src/components/banner/examples/examples.module.css +6 -1
- package/src/components/banner/examples/page-strip.tsx +24 -22
- package/src/components/breadcrumb/COMPONENT.md +9 -8
- package/src/components/button/COMPONENT.md +1 -0
- package/src/components/button/examples/hold-to-confirm.tsx +1 -1
- package/src/components/button/examples/on-colored-host.tsx +8 -8
- package/src/components/card/COMPONENT.md +7 -7
- package/src/components/card/examples/screen.module.css +1 -1
- package/src/components/card/examples/screen.tsx +184 -198
- package/src/components/chart-frame/COMPONENT.md +1 -1
- package/src/components/chart-frame/examples/fill-height.tsx +9 -9
- package/src/components/chat/COMPONENT.md +4 -4
- package/src/components/chat/examples/screen.module.css +1 -1
- package/src/components/chat/examples/screen.tsx +110 -117
- package/src/components/chat-list/COMPONENT.md +2 -2
- package/src/components/chat-list/examples/controlled.tsx +2 -2
- package/src/components/chat-list/examples/examples.module.css +8 -0
- package/src/components/checkbox/examples/examples.module.css +3 -2
- package/src/components/code-block/COMPONENT.md +1 -1
- package/src/components/code-block/examples/color-scheme.tsx +2 -4
- package/src/components/code-block/examples/examples.module.css +0 -11
- package/src/components/color-picker/COMPONENT.md +18 -7
- package/src/components/color-picker/examples/examples.module.css +2 -5
- package/src/components/color-picker/examples/overview.tsx +5 -10
- package/src/components/color-picker/examples/sizes.tsx +4 -8
- package/src/components/crossfade/COMPONENT.md +2 -2
- package/src/components/crossfade/examples/screen.tsx +107 -112
- package/src/components/data-table/COMPONENT.md +5 -5
- package/src/components/data-table/examples/examples.module.css +9 -0
- package/src/components/data-table/examples/screen.tsx +42 -52
- package/src/components/data-table/examples/server.tsx +6 -2
- package/src/components/datepicker/examples/examples.module.css +6 -0
- package/src/components/datepicker/examples/inline-panel.tsx +3 -1
- package/src/components/description-list/COMPONENT.md +1 -1
- package/src/components/description-list/examples/screen.tsx +120 -127
- package/src/components/digit-input/examples/grouped.tsx +4 -4
- package/src/components/digit-input/examples/validation.tsx +1 -1
- package/src/components/divider/COMPONENT.md +2 -2
- package/src/components/divider/examples/examples.module.css +4 -1
- package/src/components/divider/examples/vertical.tsx +22 -9
- package/src/components/dnd/examples/examples.module.css +3 -1
- package/src/components/drawer/COMPONENT.md +1 -1
- package/src/components/drawer/examples/placement.tsx +26 -31
- package/src/components/drawer/examples/screen.tsx +137 -160
- package/src/components/dropdown/COMPONENT.md +1 -1
- package/src/components/example-frame/COMPONENT.md +3 -3
- package/src/components/field-list/examples/screen.module.css +1 -1
- package/src/components/field-list/examples/screen.tsx +19 -19
- package/src/components/fieldset/COMPONENT.md +1 -1
- package/src/components/fieldset/examples/states.tsx +1 -1
- package/src/components/file-upload/COMPONENT.md +1 -1
- package/src/components/file-upload/examples/screen.module.css +2 -2
- package/src/components/file-upload/examples/screen.tsx +65 -81
- package/src/components/gallery/COMPONENT.md +1 -0
- package/src/components/gantt/COMPONENT.md +1 -1
- package/src/components/gantt/examples/screen.module.css +1 -1
- package/src/components/gantt/examples/screen.tsx +55 -73
- package/src/components/hint/examples/examples.module.css +10 -1
- package/src/components/hint/examples/overview.tsx +1 -1
- package/src/components/kanban/COMPONENT.md +1 -1
- package/src/components/kanban/examples/screen.module.css +1 -1
- package/src/components/kanban/examples/screen.tsx +50 -65
- package/src/components/kbd/COMPONENT.md +1 -1
- package/src/components/label/examples/examples.module.css +12 -1
- package/src/components/label/examples/overview.tsx +1 -1
- package/src/components/list/COMPONENT.md +3 -3
- package/src/components/media-viewer/examples/controlled.tsx +16 -16
- package/src/components/media-viewer/examples/examples.module.css +1 -3
- package/src/components/pagination/COMPONENT.md +11 -3
- package/src/components/pagination/examples/controlled.tsx +2 -1
- package/src/components/popover/COMPONENT.md +3 -2
- package/src/components/popover/examples/width.tsx +13 -1
- package/src/components/slider/COMPONENT.md +3 -3
- package/src/components/slider/examples/states.tsx +14 -10
- package/src/components/smart-filter/COMPONENT.md +13 -13
- package/src/components/smart-filter/examples/examples.module.css +3 -0
- package/src/components/smart-filter/examples/many-values.tsx +12 -8
- package/src/components/smart-filter/examples/sizes.tsx +7 -3
- package/src/components/sparkline/COMPONENT.md +1 -0
- package/src/components/sparkline/examples/curve.tsx +16 -11
- package/src/components/sparkline/examples/states.tsx +14 -10
- package/src/components/switch/COMPONENT.md +1 -1
- package/src/components/tabs/COMPONENT.md +1 -1
- package/src/components/typography/COMPONENT.md +2 -2
- package/src/layout/app-shell/COMPONENT.md +25 -38
- package/src/layout/app-shell/examples/footer.tsx +10 -10
- package/src/layout/app-shell/examples/overview.tsx +20 -22
- package/src/layout/app-shell/examples/screen.module.css +2 -2
- package/src/layout/app-shell/examples/screen.tsx +25 -30
- package/src/layout/app-shell/examples/template.tsx +13 -17
- package/src/layout/bottom-nav/COMPONENT.md +3 -3
- package/src/layout/bottom-nav/examples/floating-action.tsx +10 -19
- package/src/layout/bottom-nav/examples/floating.tsx +10 -19
- package/src/layout/bottom-nav/examples/in-app-shell.tsx +11 -19
- package/src/layout/page/COMPONENT.md +353 -0
- package/src/layout/page/examples/actions-collapse.tsx +45 -0
- package/src/layout/page/examples/collapse.tsx +68 -0
- package/src/{components/page-content → layout/page}/examples/examples.module.css +33 -4
- package/{dist/skill/reference/components/page-content → src/layout/page}/examples/grid.tsx +15 -15
- package/src/{components/page-content → layout/page}/examples/list-detail.tsx +14 -14
- package/src/layout/page/examples/narrow.tsx +75 -0
- package/src/layout/page/examples/overview.tsx +57 -0
- package/src/{components/page-content → layout/page}/examples/screen.module.css +1 -1
- package/{dist/skill/reference/components/page-content → src/layout/page}/examples/screen.tsx +29 -19
- package/src/{components/page-content → layout/page}/examples/sections.tsx +17 -24
- package/src/layout/page/examples/structure.tsx +41 -0
- package/src/{components/page-toolbar/examples/narrow.tsx → layout/page/examples/tools.tsx} +38 -35
- package/src/layout/page/examples/top-bar.tsx +85 -0
- package/src/{components/page-content → layout/page}/examples/variants.tsx +7 -7
- package/src/layout/sidebar/COMPONENT.md +5 -4
- package/src/layout/sidebar/examples/dismiss.tsx +10 -7
- package/src/layout/sidebar/examples/narrow.tsx +11 -8
- package/src/styles/theme-dark.css +12 -10
- package/src/styles/theme-light.css +3 -0
- package/src/styles/tokens.css +3 -1
- package/dist/components/page-content/PageContent.d.ts +0 -192
- package/dist/components/page-toolbar/PageToolbar.d.ts +0 -55
- package/dist/layout/app-header/AppHeader.d.ts +0 -118
- package/dist/skill/reference/components/page-content/COMPONENT.md +0 -264
- package/dist/skill/reference/components/page-content/examples/narrow.tsx +0 -25
- package/dist/skill/reference/components/page-content/examples/overview.tsx +0 -41
- package/dist/skill/reference/components/page-toolbar/COMPONENT.md +0 -147
- package/dist/skill/reference/components/page-toolbar/examples/examples.module.css +0 -16
- package/dist/skill/reference/components/page-toolbar/examples/overview.tsx +0 -113
- package/dist/skill/reference/components/page-toolbar/examples/save-changes.tsx +0 -43
- package/dist/skill/reference/components/page-toolbar/examples/without-search.tsx +0 -60
- package/dist/skill/reference/layout/app-header/COMPONENT.md +0 -187
- package/dist/skill/reference/layout/app-header/examples/breadcrumbs.tsx +0 -37
- package/dist/skill/reference/layout/app-header/examples/examples.module.css +0 -28
- package/dist/skill/reference/layout/app-header/examples/in-app-shell.tsx +0 -67
- package/dist/skill/reference/layout/app-header/examples/narrow.tsx +0 -66
- package/dist/skill/reference/layout/app-header/examples/overview.tsx +0 -34
- package/dist/skill/reference/layout/app-header/examples/page-title.tsx +0 -78
- package/dist/skill/reference/layout/app-shell/examples/contained.tsx +0 -30
- package/src/components/page-content/COMPONENT.md +0 -264
- package/src/components/page-content/examples/narrow.tsx +0 -25
- package/src/components/page-content/examples/overview.tsx +0 -41
- package/src/components/page-toolbar/COMPONENT.md +0 -147
- package/src/components/page-toolbar/examples/examples.module.css +0 -16
- package/src/components/page-toolbar/examples/overview.tsx +0 -113
- package/src/components/page-toolbar/examples/save-changes.tsx +0 -43
- package/src/components/page-toolbar/examples/without-search.tsx +0 -60
- package/src/layout/app-header/COMPONENT.md +0 -187
- package/src/layout/app-header/examples/breadcrumbs.tsx +0 -37
- package/src/layout/app-header/examples/examples.module.css +0 -28
- package/src/layout/app-header/examples/in-app-shell.tsx +0 -67
- package/src/layout/app-header/examples/narrow.tsx +0 -66
- package/src/layout/app-header/examples/overview.tsx +0 -34
- package/src/layout/app-header/examples/page-title.tsx +0 -78
- package/src/layout/app-shell/examples/contained.tsx +0 -30
- package/dist/chunks/{chunk-U3Q2I3MY.js → chunk-2ODXLPW3.js} +2 -2
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/** A dashboard panel without search on a tablet-width column: the sections fill the top row, the period selector alone in the bottom row stretches to the full width — `PageToolbar.Sections`, `PageToolbar.View`. */
|
|
2
|
-
import { Icon, PageToolbar, SegmentedControl, Select } from "prime-ui-kit";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import styles from "./examples.module.css";
|
|
6
|
-
|
|
7
|
-
const SECTIONS = [
|
|
8
|
-
{ value: "overview", label: "Обзор" },
|
|
9
|
-
{ value: "activity", label: "Активность" },
|
|
10
|
-
{ value: "resources", label: "Ресурсы" },
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
const PERIODS = [
|
|
14
|
-
{ value: "1h", label: "1 час" },
|
|
15
|
-
{ value: "24h", label: "24 часа" },
|
|
16
|
-
{ value: "7d", label: "7 дней" },
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
export default function PageToolbarWithoutSearchExample() {
|
|
20
|
-
const [section, setSection] = React.useState("overview");
|
|
21
|
-
const [period, setPeriod] = React.useState("24h");
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div className={styles.tablet}>
|
|
25
|
-
<PageToolbar.Root aria-label="Панель мониторинга">
|
|
26
|
-
<PageToolbar.Sections>
|
|
27
|
-
<SegmentedControl.Root
|
|
28
|
-
fullWidth
|
|
29
|
-
value={section}
|
|
30
|
-
onValueChange={setSection}
|
|
31
|
-
aria-label="Раздел"
|
|
32
|
-
>
|
|
33
|
-
{SECTIONS.map((item) => (
|
|
34
|
-
<SegmentedControl.Item key={item.value} value={item.value}>
|
|
35
|
-
{item.label}
|
|
36
|
-
</SegmentedControl.Item>
|
|
37
|
-
))}
|
|
38
|
-
</SegmentedControl.Root>
|
|
39
|
-
</PageToolbar.Sections>
|
|
40
|
-
<PageToolbar.View>
|
|
41
|
-
<Select.Root value={period} onValueChange={setPeriod}>
|
|
42
|
-
<Select.Trigger aria-label="Период">
|
|
43
|
-
<Select.TriggerIcon>
|
|
44
|
-
<Icon name="field.calendar" />
|
|
45
|
-
</Select.TriggerIcon>
|
|
46
|
-
<Select.Value />
|
|
47
|
-
</Select.Trigger>
|
|
48
|
-
<Select.Content>
|
|
49
|
-
{PERIODS.map((item) => (
|
|
50
|
-
<Select.Item key={item.value} value={item.value}>
|
|
51
|
-
{item.label}
|
|
52
|
-
</Select.Item>
|
|
53
|
-
))}
|
|
54
|
-
</Select.Content>
|
|
55
|
-
</Select.Root>
|
|
56
|
-
</PageToolbar.View>
|
|
57
|
-
</PageToolbar.Root>
|
|
58
|
-
</div>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
# AppHeader
|
|
2
|
-
|
|
3
|
-
**Category:** page
|
|
4
|
-
**Kind:** layout
|
|
5
|
-
|
|
6
|
-
> The page's bar at the top of the app's content panel: the page title with a line of data, the page's tools and its own buttons — only what the current page needs.
|
|
7
|
-
|
|
8
|
-
## When to use
|
|
9
|
-
- Every page of an app built on [AppShell](../app-shell/COMPONENT.md): the page titles itself here — `AppHeader.Title` (the page's `<h1>`) with an `AppHeader.Description` that carries data, the path up (`Breadcrumb`) on a nested record.
|
|
10
|
-
- The page's tools — its own search and filter, sections, the view, the primary action — as a [PageToolbar](../../components/page-toolbar/COMPONENT.md) in `AppHeader.Tools`.
|
|
11
|
-
- The phone header: in an `AppShell` whose Sidebar is off-canvas the header leads with the menu button that opens it by itself; the title and the page's action as an icon follow.
|
|
12
|
-
- A page that owns its header: render `AppHeader.Root` at the top of the page — inside the shell it renders in the shell's header row and replaces `AppShell.Template`'s `header` while the page is on screen.
|
|
13
|
-
|
|
14
|
-
## When not to use
|
|
15
|
-
- A document page (settings, a long form, an article) → its title is `PageContent.Header` in main ([PageContent](../../components/page-content/COMPONENT.md)); the header then has no title.
|
|
16
|
-
- App navigation → [Sidebar](../sidebar/COMPONENT.md) and, on a phone, [BottomNav](../bottom-nav/COMPONENT.md); the header holds at most the menu button.
|
|
17
|
-
- Anything that is not about the current page (a global search, app-wide buttons) → the header row is per page; the app's own places live in the Sidebar.
|
|
18
|
-
|
|
19
|
-
## Import
|
|
20
|
-
```tsx
|
|
21
|
-
import { AppHeader } from "prime-ui-kit";
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Anatomy
|
|
25
|
-
```
|
|
26
|
-
AppHeader.Root <header>, the page's sticky bar; in an AppShell it renders in the shell's header row
|
|
27
|
-
├─ AppHeader.Start leading zone, takes the free width
|
|
28
|
-
│ ├─ (menu button) drawn while the shell's Sidebar is off-canvas; AppHeader.MenuButton places it elsewhere
|
|
29
|
-
│ ├─ Breadcrumb the path up, only on a nested record
|
|
30
|
-
│ ├─ AppHeader.Separator short vertical line between the path and the title
|
|
31
|
-
│ └─ AppHeader.Title the page title, truncates
|
|
32
|
-
│ ├─ AppHeader.Icon decorative glyph on a tile shaped like a soft button m
|
|
33
|
-
│ └─ AppHeader.Description a muted line of data under the name
|
|
34
|
-
├─ AppHeader.Actions the page's own buttons at the end of the title row
|
|
35
|
-
└─ AppHeader.Tools second row, full width: the page's tools (a PageToolbar.Root)
|
|
36
|
-
```
|
|
37
|
-
The name of `AppHeader.Title` (not the icon or the description) is the page's `<h1>`.
|
|
38
|
-
|
|
39
|
-
## API
|
|
40
|
-
|
|
41
|
-
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
42
|
-
|
|
43
|
-
### AppHeader.Root
|
|
44
|
-
`ref` → `HTMLElement`. The page's sticky `<header>`: its title, tools and own buttons. In an `AppShell` it renders in the shell's header row and, while the Sidebar is off-canvas, leads with the menu button. Icon buttons inside are `soft`.
|
|
45
|
-
|
|
46
|
-
| Prop | Type | Default | Description |
|
|
47
|
-
|---|---|---|---|
|
|
48
|
-
| `labels` | `Partial<AppHeaderLabels>` | — | Built-in strings, see Labels. |
|
|
49
|
-
| `…rest` | `HTMLAttributes<HTMLElement>` | — | `children` (`AppHeader.Start`, `AppHeader.Actions`, `AppHeader.Tools`), `className` and the other attributes. |
|
|
50
|
-
|
|
51
|
-
### AppHeader.Start
|
|
52
|
-
`ref` → `HTMLDivElement`. The leading zone that takes the free width: the menu button, the path up (a Breadcrumb) and the title.
|
|
53
|
-
|
|
54
|
-
| Prop | Type | Default | Description |
|
|
55
|
-
|---|---|---|---|
|
|
56
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
57
|
-
|
|
58
|
-
### AppHeader.Title
|
|
59
|
-
`ref` → `HTMLDivElement`. The page title: an optional `AppHeader.Icon`, the name (title-s, truncates) and an optional `AppHeader.Description` under it. The name is the page heading `<h1>`; the description stays outside its accessible name.
|
|
60
|
-
|
|
61
|
-
| Prop | Type | Default | Description |
|
|
62
|
-
|---|---|---|---|
|
|
63
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (the name, `AppHeader.Icon`, `AppHeader.Description` in any order), `className` and the other div attributes. |
|
|
64
|
-
|
|
65
|
-
### AppHeader.Icon
|
|
66
|
-
`ref` → `HTMLSpanElement`. Decorative glyph before the title (`aria-hidden`) on a tile shaped like the bar's soft buttons: control m square (36), its radius and the subtle fill.
|
|
67
|
-
|
|
68
|
-
| Prop | Type | Default | Description |
|
|
69
|
-
|---|---|---|---|
|
|
70
|
-
| `…rest` | `HTMLAttributes<HTMLSpanElement>` | — | `children` (an `Icon`), `className` and the other span attributes. |
|
|
71
|
-
|
|
72
|
-
### AppHeader.Description
|
|
73
|
-
`ref` → `HTMLSpanElement`. Muted line under the title that carries data («128 в работе · 6 ждут оплаты», a status and a date); truncates on a narrow header, never hides.
|
|
74
|
-
|
|
75
|
-
| Prop | Type | Default | Description |
|
|
76
|
-
|---|---|---|---|
|
|
77
|
-
| `…rest` | `HTMLAttributes<HTMLSpanElement>` | — | `children`, `className` and the other span attributes. |
|
|
78
|
-
|
|
79
|
-
### AppHeader.Separator
|
|
80
|
-
`ref` → `HTMLDivElement`. The `inset` vertical `Divider` between groups in a zone — the path and the title: one text line tall, the tier gap on each side.
|
|
81
|
-
|
|
82
|
-
| Prop | Type | Default | Description |
|
|
83
|
-
|---|---|---|---|
|
|
84
|
-
| `…rest` | `Omit<DividerProps, "orientation" \| "children" \| "align" \| "size" \| "inset">` | — | `className` and the other div attributes. |
|
|
85
|
-
|
|
86
|
-
### AppHeader.Tools
|
|
87
|
-
`ref` → `HTMLDivElement`. The page's tools in the header (a `PageToolbar.Root`): the header's second row, full width under the title row, wherever it is written in `AppHeader.Root` — directly, in a fragment or inside a component of the page.
|
|
88
|
-
|
|
89
|
-
| Prop | Type | Default | Description |
|
|
90
|
-
|---|---|---|---|
|
|
91
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (a `PageToolbar.Root`), `className` and the other div attributes. |
|
|
92
|
-
|
|
93
|
-
### AppHeader.Actions
|
|
94
|
-
`ref` → `HTMLDivElement`. The trailing row of the page's own buttons in the title row (export, a more menu); the page's primary action goes into the PageToolbar in `AppHeader.Tools` when the page has tools. Never wraps.
|
|
95
|
-
|
|
96
|
-
| Prop | Type | Default | Description |
|
|
97
|
-
|---|---|---|---|
|
|
98
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
99
|
-
|
|
100
|
-
### AppHeader.MenuButton
|
|
101
|
-
`ref` → `HTMLButtonElement`. The menu button the header draws by itself, placed elsewhere: a soft icon `Button` named by `labels.menu` that opens the shell's off-canvas Sidebar. Nothing while the Sidebar is a rail, or outside a shell.
|
|
102
|
-
|
|
103
|
-
| Prop | Type | Default | Description |
|
|
104
|
-
|---|---|---|---|
|
|
105
|
-
| `…rest` | `Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" \| "children" \| "aria-expanded" \| "aria-controls">` | — | `onClick` (runs first; `preventDefault()` stops the toggle), `aria-label` (replaces `labels.menu`), `className` and the other button attributes. |
|
|
106
|
-
|
|
107
|
-
## Variants
|
|
108
|
-
|
|
109
|
-
### Structure
|
|
110
|
-
| Value | Looks like | Use when | Default |
|
|
111
|
-
|---|---|---|---|
|
|
112
|
-
| `AppHeader.Title` | Icon, name and a line of data under it, like the Sidebar brand | A top-level page | |
|
|
113
|
-
| Breadcrumb in Start | The path, `AppHeader.Separator` and the record as the title | A nested record page | |
|
|
114
|
-
| with `AppHeader.Actions` | A row of the page's buttons at the end of the title row | Export, a more menu of the page | |
|
|
115
|
-
| with `AppHeader.Tools` | A second row under the title row with the page's PageToolbar | The page has search, filters, sections, a view or a primary action | |
|
|
116
|
-
| no `AppHeader.Title` | Only the menu button and the page's buttons | A document page: its title is `PageContent.Header` in main | |
|
|
117
|
-
| with `AppHeader.MenuButton` | The menu button at the place of the part instead of the start | The button belongs elsewhere in the bar (after a back button, in Actions) | |
|
|
118
|
-
|
|
119
|
-
## States
|
|
120
|
-
| State | Driven by | DOM |
|
|
121
|
-
|---|---|---|
|
|
122
|
-
| in an app shell | `AppHeader.Root` anywhere inside `AppShell.Root` (a page's own one in main) | renders in the shell's header row at the top of the panel; the latest one on screen wins over `AppShell.Template`'s `header` |
|
|
123
|
-
| with the menu button | the shell's Sidebar is off-canvas (`offCanvas="auto"` on a phone, `"always"`) | a soft icon Button leads `AppHeader.Start` (or the row) with `aria-expanded` and `aria-controls` from the shell; gone while the Sidebar is a rail on screen and outside a shell |
|
|
124
|
-
| with page tools | an `AppHeader.Tools` anywhere in Root (directly, in a fragment, inside a component of the page) | rendered after the title row (DOM and Tab order follow the rows), full width, `--prime-space-3` under it |
|
|
125
|
-
| narrow header | header width below 36rem (container `prime-app-header`) | the icon tile hides; the title and its line of data truncate |
|
|
126
|
-
| short viewport | viewport below 480px high (a phone on its side) | Root stops sticking |
|
|
127
|
-
|
|
128
|
-
## Layout & spacing
|
|
129
|
-
- Row min height = control m + `--prime-space-2` (44), padding-block `--prime-space-3` (the top grows to the safe-area inset): 68 in all, the height of the Sidebar header, so the brand and the title share one line.
|
|
130
|
-
- Inline padding: the page gutter `--prime-layout-gutter` (16 → 24 → 32, the same as `AppShell.Main`), so in the shell's header row the header lines up with the page; in a frame inside the page (a preview) the small gutter. Main's top air ([AppShell](../app-shell/COMPONENT.md)) stands between the header and the page's first block.
|
|
131
|
-
- Icon buttons are `soft` neutral (the menu button is), never `ghost`: every button on the bar has a shape.
|
|
132
|
-
- Gaps: `--prime-space-3` between zones, `--prime-space-2` inside Start and Actions; `AppHeader.Separator` is the `inset` vertical Divider: the tier gap on each side (8 at `m`) and one text line tall (20 at `m`).
|
|
133
|
-
- `AppHeader.Icon` is a 36 tile with the radius and fill of a soft neutral button m, so it lines up with the buttons on the bar.
|
|
134
|
-
- On the panel surface with no divider or shadow (depth from fill); `z-index: --prime-z-sticky`.
|
|
135
|
-
- Sticky at `top: 0` of its scroller (static on a viewport below 480px high). The shared sticky surface paints its fill one border width past the top edge, so no sub-pixel seam of the scrolling rows shows above it.
|
|
136
|
-
- Controls inside are size `m`.
|
|
137
|
-
- `AppHeader.Tools` is the header's second row: the full width under the title row, 12 apart, sticky with it. The PageToolbar inside lays itself out from that width — one row from 56rem, stacked rows below, the primary action on its own row when the search would get less than 18rem beside it — so on a phone the page tools wrap under the title, never squeeze it.
|
|
138
|
-
|
|
139
|
-
## Accessibility
|
|
140
|
-
|
|
141
|
-
### Keyboard
|
|
142
|
-
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
143
|
-
|
|
144
|
-
| Key | Action |
|
|
145
|
-
|---|---|
|
|
146
|
-
| `Tab` | Moves through the menu button, the path links and the page's buttons in reading order, then the page tools in the second row. |
|
|
147
|
-
| `Enter` · `Space` | Presses the focused button: opens the menu or runs the action. |
|
|
148
|
-
|
|
149
|
-
### ARIA
|
|
150
|
-
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
151
|
-
|
|
152
|
-
- Root is a `<header>`: the banner landmark when it sits at the top level of the page.
|
|
153
|
-
- The menu button is named by `labels.menu`; `aria-expanded` (whether the Sidebar panel is open) and `aria-controls` (its `<nav>`) come from the shell.
|
|
154
|
-
- The name of `AppHeader.Title` is the page heading `<h1>`; the description sits next to it, outside its accessible name. One `<h1>` per page: in the header on app pages, `PageContent.Title` on a document page (whose header has no title).
|
|
155
|
-
- `AppHeader.Tools` follows the title row in the DOM, so Tab and screen readers meet the page tools after the header's own buttons.
|
|
156
|
-
|
|
157
|
-
### Labels
|
|
158
|
-
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
159
|
-
|
|
160
|
-
| Key | Default | Used for |
|
|
161
|
-
|---|---|---|
|
|
162
|
-
| `menu` | `"Открыть меню"` | Name of the menu button (drawn by the header or `AppHeader.MenuButton`). |
|
|
163
|
-
|
|
164
|
-
## Examples
|
|
165
|
-
| Example | Shows |
|
|
166
|
-
|---|---|
|
|
167
|
-
| [overview.tsx](examples/overview.tsx) | The page's header: the page title with its icon and a line of data under it, the page's own buttons at the end — `AppHeader.Title`, `AppHeader.Description`, `AppHeader.Actions`. |
|
|
168
|
-
| [breadcrumbs.tsx](examples/breadcrumbs.tsx) | A nested record: the path up, a separator and the record as the page title, the record's buttons at the end — `AppHeader.Separator`, `AppHeader.Actions`. |
|
|
169
|
-
| [page-title.tsx](examples/page-title.tsx) | The header carries the page: the title is the page heading with a line of data, the page tools (sections, the period, the primary action) are its second row and lay themselves out from its width — `AppHeader.Title`, `AppHeader.Tools`. |
|
|
170
|
-
| [in-app-shell.tsx](examples/in-app-shell.tsx) | The header in the app frame: one row with the Sidebar brand across the two planes, sticky over main — `AppShell`, `Sidebar.Brand`. |
|
|
171
|
-
| [narrow.tsx](examples/narrow.tsx) | On a phone the header leads with the menu button that opens the navigation by itself, the title and its line of data truncate and the page's action keeps its icon — `AppShell`, `offCanvas`. |
|
|
172
|
-
|
|
173
|
-
## Mistakes
|
|
174
|
-
- A border or shadow under the header → it sits on the panel surface; the fill is the boundary.
|
|
175
|
-
- `AppHeader.Title` while main also has `PageContent.Title` → two titles; an app page titles itself in the header, only a document page keeps `PageContent.Header` (and then the header has no title).
|
|
176
|
-
- No title at all on an app page → the page has no `<h1>`.
|
|
177
|
-
- A description that describes the page («Все заказы магазина») → a line of data («128 в работе · 6 ждут оплаты») or nothing.
|
|
178
|
-
- Page tools crammed into `AppHeader.Actions` → `AppHeader.Tools` with a PageToolbar: it wraps under the title instead of squeezing it.
|
|
179
|
-
- A global search, notifications or app-wide buttons in the header → the row is per page; the app's own places live in the Sidebar.
|
|
180
|
-
- A heading element of your own inside `AppHeader.Title` → the title's name is already the `<h1>`; a second heading nests inside it.
|
|
181
|
-
- A hand-made menu button with a media query or hand-wired `aria-expanded` → the header draws the menu button itself from the shell's Sidebar; `AppHeader.MenuButton` only moves it.
|
|
182
|
-
- A page header that misses the phone menu → render the page's `AppHeader.Root` inside the `AppShell` (not in a frame of its own): it then joins the shell's header row and gets the menu button.
|
|
183
|
-
- `ghost` icon buttons in the header → `variant="soft" tone="neutral"`: a light fill gives each button a shape on the bar.
|
|
184
|
-
|
|
185
|
-
## Related
|
|
186
|
-
- **Built from:** [Button](../../components/button/COMPONENT.md), [Divider](../../components/divider/COMPONENT.md), Icon (`nav.menu`), [AppShell](../app-shell/COMPONENT.md) (its header row and navigation)
|
|
187
|
-
- **See also:** [AppShell](../app-shell/COMPONENT.md), [Sidebar](../sidebar/COMPONENT.md), [PageContent](../../components/page-content/COMPONENT.md), [PageToolbar](../../components/page-toolbar/COMPONENT.md) (inside `AppHeader.Tools`), [Breadcrumb](../../components/breadcrumb/COMPONENT.md)
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/** A nested record: the path up, a separator and the record as the page title, the record's buttons at the end — `AppHeader.Separator`, `AppHeader.Actions`. */
|
|
2
|
-
import { AppHeader, Breadcrumb, Button, Icon } from "prime-ui-kit";
|
|
3
|
-
|
|
4
|
-
import styles from "./examples.module.css";
|
|
5
|
-
|
|
6
|
-
export default function AppHeaderBreadcrumbsExample() {
|
|
7
|
-
return (
|
|
8
|
-
<div className={styles.window}>
|
|
9
|
-
<AppHeader.Root>
|
|
10
|
-
<AppHeader.Start>
|
|
11
|
-
<Breadcrumb.Root>
|
|
12
|
-
<Breadcrumb.Item href="#crm">CRM</Breadcrumb.Item>
|
|
13
|
-
<Breadcrumb.Item href="#clients">Клиенты</Breadcrumb.Item>
|
|
14
|
-
</Breadcrumb.Root>
|
|
15
|
-
<AppHeader.Separator />
|
|
16
|
-
<AppHeader.Title>
|
|
17
|
-
ООО «Север»
|
|
18
|
-
<AppHeader.Description>Клиент с 2021 года · 4 сделки</AppHeader.Description>
|
|
19
|
-
</AppHeader.Title>
|
|
20
|
-
</AppHeader.Start>
|
|
21
|
-
<AppHeader.Actions>
|
|
22
|
-
<Button.Root variant="soft" tone="neutral">
|
|
23
|
-
<Button.Icon>
|
|
24
|
-
<Icon name="action.send" />
|
|
25
|
-
</Button.Icon>
|
|
26
|
-
Написать
|
|
27
|
-
</Button.Root>
|
|
28
|
-
<Button.Root variant="soft" tone="neutral" aria-label="Ещё действия">
|
|
29
|
-
<Button.Icon>
|
|
30
|
-
<Icon name="action.more" />
|
|
31
|
-
</Button.Icon>
|
|
32
|
-
</Button.Root>
|
|
33
|
-
</AppHeader.Actions>
|
|
34
|
-
</AppHeader.Root>
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/* Layout of the AppHeader scenarios: app windows and a phone-wide screen. The preview stage is the page; a window only sizes and clips. Semantic tokens only. */
|
|
2
|
-
|
|
3
|
-
/* The top of an app window: the page with the header on it. */
|
|
4
|
-
.window {
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
width: 100%;
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/* narrow.tsx: an app window, phone-wide, so the title and its line of data truncate. */
|
|
11
|
-
.phone {
|
|
12
|
-
width: min(100%, var(--prime-layout-narrow-width));
|
|
13
|
-
margin-inline: auto;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/* in-app-shell.tsx: a whole app window with the rail on the page. */
|
|
17
|
-
.stage {
|
|
18
|
-
box-sizing: border-box;
|
|
19
|
-
display: flex;
|
|
20
|
-
width: 100%;
|
|
21
|
-
height: calc(var(--prime-space-24) * 4);
|
|
22
|
-
overflow: hidden;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* The shell fills the window frame instead of the viewport. */
|
|
26
|
-
.shell {
|
|
27
|
-
height: 100%;
|
|
28
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/** The header in the app frame: one row with the Sidebar brand across the two planes, sticky over main — `AppShell`, `Sidebar.Brand`. */
|
|
2
|
-
import { AppHeader, AppShell, Icon, PageContent, Sidebar, Typography } from "prime-ui-kit";
|
|
3
|
-
|
|
4
|
-
import styles from "./examples.module.css";
|
|
5
|
-
|
|
6
|
-
const ORDERS = [
|
|
7
|
-
"№ 4821 · ООО «Север» · 84 000 ₽",
|
|
8
|
-
"№ 4820 · ИП Котов · 12 500 ₽",
|
|
9
|
-
"№ 4819 · ООО «Вектор» · 230 000 ₽",
|
|
10
|
-
"№ 4818 · АО «Меридиан» · 47 900 ₽",
|
|
11
|
-
"№ 4817 · ООО «Полюс» · 9 800 ₽",
|
|
12
|
-
"№ 4816 · ИП Белова · 156 000 ₽",
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
export default function AppHeaderInAppShellExample() {
|
|
16
|
-
return (
|
|
17
|
-
<div className={styles.stage}>
|
|
18
|
-
<AppShell.Root fillViewport className={styles.shell}>
|
|
19
|
-
<AppShell.Nav>
|
|
20
|
-
<Sidebar.Root offCanvas="never">
|
|
21
|
-
<Sidebar.Header>
|
|
22
|
-
<Sidebar.Brand href="#home" description="Отдел продаж">
|
|
23
|
-
<Sidebar.BrandLogo>
|
|
24
|
-
<Icon name="nav.layoutGrid" />
|
|
25
|
-
</Sidebar.BrandLogo>
|
|
26
|
-
Acme CRM
|
|
27
|
-
</Sidebar.Brand>
|
|
28
|
-
</Sidebar.Header>
|
|
29
|
-
<Sidebar.Content>
|
|
30
|
-
<Sidebar.Item>
|
|
31
|
-
<Sidebar.ItemIcon>
|
|
32
|
-
<Icon name="nav.home" />
|
|
33
|
-
</Sidebar.ItemIcon>
|
|
34
|
-
Обзор
|
|
35
|
-
</Sidebar.Item>
|
|
36
|
-
<Sidebar.Item current>
|
|
37
|
-
<Sidebar.ItemIcon>
|
|
38
|
-
<Icon name="object.package" />
|
|
39
|
-
</Sidebar.ItemIcon>
|
|
40
|
-
Заказы
|
|
41
|
-
</Sidebar.Item>
|
|
42
|
-
</Sidebar.Content>
|
|
43
|
-
</Sidebar.Root>
|
|
44
|
-
</AppShell.Nav>
|
|
45
|
-
<AppHeader.Root>
|
|
46
|
-
<AppHeader.Start>
|
|
47
|
-
<AppHeader.Title>
|
|
48
|
-
Заказы
|
|
49
|
-
<AppHeader.Description>128 в работе</AppHeader.Description>
|
|
50
|
-
</AppHeader.Title>
|
|
51
|
-
</AppHeader.Start>
|
|
52
|
-
</AppHeader.Root>
|
|
53
|
-
<AppShell.Main>
|
|
54
|
-
<PageContent.Root as="section">
|
|
55
|
-
<PageContent.Body>
|
|
56
|
-
{ORDERS.map((order) => (
|
|
57
|
-
<Typography key={order} variant="body-m">
|
|
58
|
-
{order}
|
|
59
|
-
</Typography>
|
|
60
|
-
))}
|
|
61
|
-
</PageContent.Body>
|
|
62
|
-
</PageContent.Root>
|
|
63
|
-
</AppShell.Main>
|
|
64
|
-
</AppShell.Root>
|
|
65
|
-
</div>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/** On a phone the header leads with the menu button that opens the navigation by itself, the title and its line of data truncate and the page's action keeps its icon — `AppShell`, `offCanvas`. */
|
|
2
|
-
import { AppHeader, AppShell, Button, Icon, PageContent, Sidebar, Typography } from "prime-ui-kit";
|
|
3
|
-
|
|
4
|
-
import styles from "./examples.module.css";
|
|
5
|
-
|
|
6
|
-
const ORDERS = [
|
|
7
|
-
"№ 4821 · ООО «Север» · 84 000 ₽",
|
|
8
|
-
"№ 4820 · ИП Котов · 12 500 ₽",
|
|
9
|
-
"№ 4819 · ООО «Вектор» · 230 000 ₽",
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
export default function AppHeaderNarrowExample() {
|
|
13
|
-
return (
|
|
14
|
-
<div className={`${styles.stage} ${styles.phone}`}>
|
|
15
|
-
<AppShell.Root fillViewport className={styles.shell}>
|
|
16
|
-
<AppShell.Nav>
|
|
17
|
-
{/* `always`: this window is phone-wide on any screen; in an app keep the default `auto`. */}
|
|
18
|
-
<Sidebar.Root offCanvas="always">
|
|
19
|
-
<Sidebar.Content>
|
|
20
|
-
<Sidebar.Item href="#overview">
|
|
21
|
-
<Sidebar.ItemIcon>
|
|
22
|
-
<Icon name="nav.home" />
|
|
23
|
-
</Sidebar.ItemIcon>
|
|
24
|
-
Обзор
|
|
25
|
-
</Sidebar.Item>
|
|
26
|
-
<Sidebar.Item href="#orders" current>
|
|
27
|
-
<Sidebar.ItemIcon>
|
|
28
|
-
<Icon name="object.package" />
|
|
29
|
-
</Sidebar.ItemIcon>
|
|
30
|
-
Заказы
|
|
31
|
-
</Sidebar.Item>
|
|
32
|
-
</Sidebar.Content>
|
|
33
|
-
</Sidebar.Root>
|
|
34
|
-
</AppShell.Nav>
|
|
35
|
-
<AppHeader.Root>
|
|
36
|
-
<AppHeader.Start>
|
|
37
|
-
<AppHeader.Title>
|
|
38
|
-
Заказы покупателей
|
|
39
|
-
<AppHeader.Description>
|
|
40
|
-
128 в работе · 6 ждут оплаты · 2 возврата
|
|
41
|
-
</AppHeader.Description>
|
|
42
|
-
</AppHeader.Title>
|
|
43
|
-
</AppHeader.Start>
|
|
44
|
-
<AppHeader.Actions>
|
|
45
|
-
<Button.Root aria-label="Новый заказ">
|
|
46
|
-
<Button.Icon>
|
|
47
|
-
<Icon name="action.add" />
|
|
48
|
-
</Button.Icon>
|
|
49
|
-
</Button.Root>
|
|
50
|
-
</AppHeader.Actions>
|
|
51
|
-
</AppHeader.Root>
|
|
52
|
-
<AppShell.Main>
|
|
53
|
-
<PageContent.Root as="section">
|
|
54
|
-
<PageContent.Body>
|
|
55
|
-
{ORDERS.map((order) => (
|
|
56
|
-
<Typography key={order} variant="body-m">
|
|
57
|
-
{order}
|
|
58
|
-
</Typography>
|
|
59
|
-
))}
|
|
60
|
-
</PageContent.Body>
|
|
61
|
-
</PageContent.Root>
|
|
62
|
-
</AppShell.Main>
|
|
63
|
-
</AppShell.Root>
|
|
64
|
-
</div>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/** The page's header: the page title with its icon and a line of data under it, the page's own buttons at the end — `AppHeader.Title`, `AppHeader.Description`, `AppHeader.Actions`. */
|
|
2
|
-
import { AppHeader, Button, Icon } from "prime-ui-kit";
|
|
3
|
-
|
|
4
|
-
import styles from "./examples.module.css";
|
|
5
|
-
|
|
6
|
-
export default function AppHeaderOverviewExample() {
|
|
7
|
-
return (
|
|
8
|
-
<div className={styles.window}>
|
|
9
|
-
<AppHeader.Root>
|
|
10
|
-
<AppHeader.Start>
|
|
11
|
-
<AppHeader.Title>
|
|
12
|
-
<AppHeader.Icon>
|
|
13
|
-
<Icon name="object.package" />
|
|
14
|
-
</AppHeader.Icon>
|
|
15
|
-
Заказы
|
|
16
|
-
<AppHeader.Description>128 в работе · 6 ждут оплаты</AppHeader.Description>
|
|
17
|
-
</AppHeader.Title>
|
|
18
|
-
</AppHeader.Start>
|
|
19
|
-
<AppHeader.Actions>
|
|
20
|
-
<Button.Root variant="soft" tone="neutral" aria-label="Экспорт в CSV">
|
|
21
|
-
<Button.Icon>
|
|
22
|
-
<Icon name="action.download" />
|
|
23
|
-
</Button.Icon>
|
|
24
|
-
</Button.Root>
|
|
25
|
-
<Button.Root variant="soft" tone="neutral" aria-label="Ещё действия">
|
|
26
|
-
<Button.Icon>
|
|
27
|
-
<Icon name="action.more" />
|
|
28
|
-
</Button.Icon>
|
|
29
|
-
</Button.Root>
|
|
30
|
-
</AppHeader.Actions>
|
|
31
|
-
</AppHeader.Root>
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/** The header carries the page: the title is the page heading with a line of data, the page tools (sections, the period, the primary action) are its second row and lay themselves out from its width — `AppHeader.Title`, `AppHeader.Tools`. */
|
|
2
|
-
import { AppHeader, Button, Icon, PageToolbar, SegmentedControl, Select } from "prime-ui-kit";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import styles from "./examples.module.css";
|
|
6
|
-
|
|
7
|
-
const SECTIONS = [
|
|
8
|
-
{ value: "all", label: "Все" },
|
|
9
|
-
{ value: "mine", label: "Мои" },
|
|
10
|
-
{ value: "overdue", label: "Просроченные" },
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
const PERIODS = [
|
|
14
|
-
{ value: "month", label: "Октябрь" },
|
|
15
|
-
{ value: "quarter", label: "IV квартал" },
|
|
16
|
-
{ value: "year", label: "2026 год" },
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
export default function AppHeaderPageTitleExample() {
|
|
20
|
-
const [section, setSection] = React.useState("all");
|
|
21
|
-
const [period, setPeriod] = React.useState("month");
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div className={styles.window}>
|
|
25
|
-
<AppHeader.Root>
|
|
26
|
-
<AppHeader.Start>
|
|
27
|
-
<AppHeader.Title>
|
|
28
|
-
Сделки
|
|
29
|
-
<AppHeader.Description>24 сделки в работе · 8,2 млн ₽</AppHeader.Description>
|
|
30
|
-
</AppHeader.Title>
|
|
31
|
-
</AppHeader.Start>
|
|
32
|
-
<AppHeader.Tools>
|
|
33
|
-
<PageToolbar.Root aria-label="Сделки">
|
|
34
|
-
<PageToolbar.Sections>
|
|
35
|
-
<SegmentedControl.Root
|
|
36
|
-
fullWidth
|
|
37
|
-
value={section}
|
|
38
|
-
onValueChange={setSection}
|
|
39
|
-
aria-label="Раздел"
|
|
40
|
-
>
|
|
41
|
-
{SECTIONS.map((item) => (
|
|
42
|
-
<SegmentedControl.Item key={item.value} value={item.value}>
|
|
43
|
-
{item.label}
|
|
44
|
-
</SegmentedControl.Item>
|
|
45
|
-
))}
|
|
46
|
-
</SegmentedControl.Root>
|
|
47
|
-
</PageToolbar.Sections>
|
|
48
|
-
<PageToolbar.View>
|
|
49
|
-
<Select.Root value={period} onValueChange={setPeriod}>
|
|
50
|
-
<Select.Trigger aria-label="Период">
|
|
51
|
-
<Select.TriggerIcon>
|
|
52
|
-
<Icon name="field.calendar" />
|
|
53
|
-
</Select.TriggerIcon>
|
|
54
|
-
<Select.Value />
|
|
55
|
-
</Select.Trigger>
|
|
56
|
-
<Select.Content>
|
|
57
|
-
{PERIODS.map((item) => (
|
|
58
|
-
<Select.Item key={item.value} value={item.value}>
|
|
59
|
-
{item.label}
|
|
60
|
-
</Select.Item>
|
|
61
|
-
))}
|
|
62
|
-
</Select.Content>
|
|
63
|
-
</Select.Root>
|
|
64
|
-
</PageToolbar.View>
|
|
65
|
-
<PageToolbar.Actions>
|
|
66
|
-
<Button.Root>
|
|
67
|
-
<Button.Icon>
|
|
68
|
-
<Icon name="action.add" />
|
|
69
|
-
</Button.Icon>
|
|
70
|
-
Новая сделка
|
|
71
|
-
</Button.Root>
|
|
72
|
-
</PageToolbar.Actions>
|
|
73
|
-
</PageToolbar.Root>
|
|
74
|
-
</AppHeader.Tools>
|
|
75
|
-
</AppHeader.Root>
|
|
76
|
-
</div>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/** A shell without navigation whose main column is centred and capped for long reads — `contentWidth`. */
|
|
2
|
-
import { AppShell, PageContent, Typography } from "prime-ui-kit";
|
|
3
|
-
|
|
4
|
-
import styles from "./examples.module.css";
|
|
5
|
-
|
|
6
|
-
export default function AppShellContainedExample() {
|
|
7
|
-
return (
|
|
8
|
-
<div className={styles.stage}>
|
|
9
|
-
<AppShell.Root fillViewport className={styles.shell}>
|
|
10
|
-
<AppShell.Main contentWidth="contained">
|
|
11
|
-
<PageContent.Root maxWidth="readable">
|
|
12
|
-
<PageContent.Header>
|
|
13
|
-
{/* In a real app this is PageContent.Title (the page h1). */}
|
|
14
|
-
<Typography as="h2" variant="heading-m">
|
|
15
|
-
Как подключить оплату
|
|
16
|
-
</Typography>
|
|
17
|
-
<PageContent.Description>Обновлено 1 октября 2026 года.</PageContent.Description>
|
|
18
|
-
</PageContent.Header>
|
|
19
|
-
<PageContent.Body>
|
|
20
|
-
<Typography as="p" variant="body-l">
|
|
21
|
-
Откройте раздел «Настройки», выберите «Оплата» и укажите реквизиты. После проверки
|
|
22
|
-
банк пришлёт подтверждение, и приём платежей включится автоматически.
|
|
23
|
-
</Typography>
|
|
24
|
-
</PageContent.Body>
|
|
25
|
-
</PageContent.Root>
|
|
26
|
-
</AppShell.Main>
|
|
27
|
-
</AppShell.Root>
|
|
28
|
-
</div>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
@@ -1747,9 +1747,8 @@ export {
|
|
|
1747
1747
|
useOptionalControlSize,
|
|
1748
1748
|
useControlSize,
|
|
1749
1749
|
useHostTier,
|
|
1750
|
-
cx,
|
|
1751
|
-
fieldTier_default,
|
|
1752
1750
|
TOKEN_DEFAULTS,
|
|
1751
|
+
cx,
|
|
1753
1752
|
motionToken,
|
|
1754
1753
|
readCssDurationMs,
|
|
1755
1754
|
readElementDurationMs,
|
|
@@ -1763,6 +1762,7 @@ export {
|
|
|
1763
1762
|
HOVER_QUERY,
|
|
1764
1763
|
prefersReducedMotion,
|
|
1765
1764
|
usePresence,
|
|
1765
|
+
fieldTier_default,
|
|
1766
1766
|
iconBox_default,
|
|
1767
1767
|
iconBoxClass,
|
|
1768
1768
|
iconSlotClass,
|