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.
- package/README.md +2 -2
- package/THIRD_PARTY_NOTICES +13 -0
- package/dist/chunks/{chunk-6L7VWEY6.js → chunk-BAJRN3QN.js} +2 -2
- package/dist/chunks/{chunk-QFHE5GKW.js → chunk-HMLQCKRL.js} +605 -556
- package/dist/chunks/{chunk-S27VR4ON.js → chunk-JO7E6SZQ.js} +105 -40
- package/dist/chunks/{chunk-S4H2ZKWJ.js → chunk-R5LI5BO3.js} +2150 -1615
- package/dist/chunks/{chunk-IVS3J7AS.js → chunk-SUGCIPD7.js} +1 -1
- package/dist/color-picker.js +3 -3
- package/dist/components/chat-list/ChatList.d.ts +4 -3
- package/dist/components/command-menu/CommandMenu.d.ts +1 -4
- package/dist/components/composer/Composer.d.ts +1 -1
- package/dist/components/data-table/DataTable.d.ts +9 -7
- package/dist/components/data-table/Footer.d.ts +7 -3
- package/dist/components/datepicker/DatepickerPanel.d.ts +2 -2
- package/dist/components/dnd/labels.d.ts +2 -0
- package/dist/components/field-list/FieldList.d.ts +2 -4
- package/dist/components/file-upload/FileUpload.d.ts +1 -9
- package/dist/components/index.d.ts +2 -2
- package/dist/components/kanban/Kanban.d.ts +0 -2
- package/dist/components/list/List.d.ts +7 -1
- package/dist/components/message/Message.d.ts +7 -3
- package/dist/components/message/MessageParts.d.ts +7 -2
- package/dist/components/rich-text/RichText.d.ts +12 -4
- package/dist/components/scroll-container/ScrollContainer.d.ts +1 -1
- package/dist/components/select/selectContext.d.ts +0 -2
- package/dist/components/smart-filter/SmartFilter.d.ts +1 -5
- package/dist/components/sparkline/Sparkline.d.ts +50 -8
- package/dist/components/tag-select/TagSelect.d.ts +0 -2
- package/dist/components/textarea/Textarea.d.ts +1 -1
- package/dist/icon-set.d.ts +6 -1
- package/dist/icon-set.js +10 -2
- package/dist/icons/glyph.d.ts +12 -1
- package/dist/icons/glyphs/app-window.d.ts +2 -0
- package/dist/icons/glyphs/telegram.d.ts +2 -0
- package/dist/icons/glyphs/vk.d.ts +2 -0
- package/dist/icons/glyphs/whatsapp.d.ts +2 -0
- package/dist/icons/registry.d.ts +10 -1
- package/dist/index.css +1 -1
- package/dist/index.js +7 -3
- package/dist/internal/ToolRow.d.ts +3 -1
- package/dist/internal/barPlan.d.ts +7 -1
- package/dist/internal/blockStack.d.ts +7 -0
- package/dist/internal/overlay/DialogParts.d.ts +9 -7
- package/dist/internal/richText.d.ts +32 -1
- package/dist/internal/selectionIndicator.d.ts +9 -3
- package/dist/internal/textFormatting.d.ts +2 -2
- package/dist/layout/page/Page.d.ts +2 -1
- package/dist/skill/SKILL.md +3 -2
- package/dist/skill/api-contract.md +3 -2
- package/dist/skill/cheatsheet.md +1 -1
- package/dist/skill/checklist.md +6 -1
- package/dist/skill/choosing.md +76 -5
- package/dist/skill/components.md +2 -2
- package/dist/skill/composition.md +108 -20
- package/dist/skill/foundations.md +1 -1
- package/dist/skill/layouts.md +4 -4
- package/dist/skill/reference/components/card/COMPONENT.md +1 -1
- package/dist/skill/reference/components/card/examples/screen.tsx +9 -11
- package/dist/skill/reference/components/chat-list/COMPONENT.md +6 -5
- package/dist/skill/reference/components/chat-list/examples/structure.tsx +4 -4
- package/dist/skill/reference/components/command-menu/COMPONENT.md +1 -2
- package/dist/skill/reference/components/command-menu/examples/states.tsx +1 -1
- package/dist/skill/reference/components/composer/COMPONENT.md +5 -4
- package/dist/skill/reference/components/composer/examples/formatting.tsx +1 -1
- package/dist/skill/reference/components/data-table/COMPONENT.md +18 -16
- package/dist/skill/reference/components/data-table/examples/server.tsx +2 -1
- package/dist/skill/reference/components/datepicker/COMPONENT.md +2 -2
- package/dist/skill/reference/components/dnd/COMPONENT.md +2 -1
- package/dist/skill/reference/components/drawer/COMPONENT.md +9 -6
- package/dist/skill/reference/components/drawer/examples/tab-switcher.tsx +158 -0
- package/dist/skill/reference/components/field-list/COMPONENT.md +7 -7
- package/dist/skill/reference/components/field-list/examples/limits.tsx +2 -2
- package/dist/skill/reference/components/file-upload/COMPONENT.md +8 -12
- package/dist/skill/reference/components/file-upload/examples/gallery.tsx +2 -2
- package/dist/skill/reference/components/file-upload/examples/in-form.tsx +2 -4
- package/dist/skill/reference/components/file-upload/examples/narrow.tsx +1 -0
- package/dist/skill/reference/components/file-upload/examples/overview.tsx +1 -5
- package/dist/skill/reference/components/file-upload/examples/sizes.tsx +1 -1
- package/dist/skill/reference/components/file-upload/examples/states.tsx +4 -5
- package/dist/skill/reference/components/file-upload/examples/validation.tsx +2 -7
- package/dist/skill/reference/components/kanban/COMPONENT.md +1 -2
- package/dist/skill/reference/components/list/COMPONENT.md +11 -6
- package/dist/skill/reference/components/list/examples/reorder.tsx +30 -3
- package/dist/skill/reference/components/message/COMPONENT.md +17 -11
- package/dist/skill/reference/components/message/examples/bot-actions.tsx +6 -2
- package/dist/skill/reference/components/message/examples/status.tsx +2 -1
- package/dist/skill/reference/components/message/examples/text-formatting.tsx +13 -3
- package/dist/skill/reference/components/modal/COMPONENT.md +5 -4
- package/dist/skill/reference/components/rich-text/COMPONENT.md +45 -7
- package/dist/skill/reference/components/rich-text/examples/entities.tsx +20 -0
- package/dist/skill/reference/components/scroll-container/COMPONENT.md +5 -5
- package/dist/skill/reference/components/scroll-container/examples/overscroll.tsx +2 -2
- package/dist/skill/reference/components/select/COMPONENT.md +1 -2
- package/dist/skill/reference/components/sheet/COMPONENT.md +5 -4
- package/dist/skill/reference/components/smart-filter/COMPONENT.md +3 -5
- package/dist/skill/reference/components/sparkline/COMPONENT.md +40 -12
- package/dist/skill/reference/components/sparkline/examples/lower-is-better.tsx +46 -0
- package/dist/skill/reference/components/sparkline/examples/own-value.tsx +41 -0
- package/dist/skill/reference/components/sparkline/examples/reference.tsx +2 -1
- package/dist/skill/reference/components/tabs/COMPONENT.md +2 -2
- package/dist/skill/reference/components/tag-select/COMPONENT.md +0 -2
- package/dist/skill/reference/components/tag-select/examples/overview.tsx +0 -1
- package/dist/skill/reference/components/tag-select/examples/sizes.tsx +0 -1
- package/dist/skill/reference/components/textarea/COMPONENT.md +4 -3
- package/dist/skill/reference/icon-set.ts +6 -1
- package/dist/skill/reference/layout/app-shell/COMPONENT.md +1 -1
- package/dist/skill/reference/layout/page/COMPONENT.md +13 -12
- package/dist/skill/reference/layout/page/examples/collapse.tsx +45 -31
- package/dist/skill/reference/layout/page/examples/router.tsx +47 -14
- package/dist/skill/ux.md +79 -2
- package/package.json +1 -1
- package/src/components/card/COMPONENT.md +1 -1
- package/src/components/card/examples/screen.tsx +9 -11
- package/src/components/chat-list/COMPONENT.md +6 -5
- package/src/components/chat-list/examples/structure.tsx +4 -4
- package/src/components/command-menu/COMPONENT.md +1 -2
- package/src/components/command-menu/examples/states.tsx +1 -1
- package/src/components/composer/COMPONENT.md +5 -4
- package/src/components/composer/examples/formatting.tsx +1 -1
- package/src/components/data-table/COMPONENT.md +18 -16
- package/src/components/data-table/examples/server.tsx +2 -1
- package/src/components/datepicker/COMPONENT.md +2 -2
- package/src/components/dnd/COMPONENT.md +2 -1
- package/src/components/drawer/COMPONENT.md +9 -6
- package/src/components/drawer/examples/tab-switcher.tsx +158 -0
- package/src/components/field-list/COMPONENT.md +7 -7
- package/src/components/field-list/examples/limits.tsx +2 -2
- package/src/components/file-upload/COMPONENT.md +8 -12
- package/src/components/file-upload/examples/gallery.tsx +2 -2
- package/src/components/file-upload/examples/in-form.tsx +2 -4
- package/src/components/file-upload/examples/narrow.tsx +1 -0
- package/src/components/file-upload/examples/overview.tsx +1 -5
- package/src/components/file-upload/examples/sizes.tsx +1 -1
- package/src/components/file-upload/examples/states.tsx +4 -5
- package/src/components/file-upload/examples/validation.tsx +2 -7
- package/src/components/kanban/COMPONENT.md +1 -2
- package/src/components/list/COMPONENT.md +11 -6
- package/src/components/list/examples/reorder.tsx +30 -3
- package/src/components/message/COMPONENT.md +17 -11
- package/src/components/message/examples/bot-actions.tsx +6 -2
- package/src/components/message/examples/status.tsx +2 -1
- package/src/components/message/examples/text-formatting.tsx +13 -3
- package/src/components/modal/COMPONENT.md +5 -4
- package/src/components/rich-text/COMPONENT.md +45 -7
- package/src/components/rich-text/examples/entities.tsx +20 -0
- package/src/components/scroll-container/COMPONENT.md +5 -5
- package/src/components/scroll-container/examples/overscroll.tsx +2 -2
- package/src/components/select/COMPONENT.md +1 -2
- package/src/components/sheet/COMPONENT.md +5 -4
- package/src/components/smart-filter/COMPONENT.md +3 -5
- package/src/components/sparkline/COMPONENT.md +40 -12
- package/src/components/sparkline/examples/lower-is-better.tsx +46 -0
- package/src/components/sparkline/examples/own-value.tsx +41 -0
- package/src/components/sparkline/examples/reference.tsx +2 -1
- package/src/components/tabs/COMPONENT.md +2 -2
- package/src/components/tag-select/COMPONENT.md +0 -2
- package/src/components/tag-select/examples/overview.tsx +0 -1
- package/src/components/tag-select/examples/sizes.tsx +0 -1
- package/src/components/textarea/COMPONENT.md +4 -3
- package/src/layout/app-shell/COMPONENT.md +1 -1
- package/src/layout/page/COMPONENT.md +13 -12
- package/src/layout/page/examples/collapse.tsx +45 -31
- package/src/layout/page/examples/router.tsx +47 -14
|
@@ -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/
|
|
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)
|
|
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
|
-
|
|
68
|
-
<
|
|
69
|
-
<Button.
|
|
70
|
-
<Icon
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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={
|