prime-ui-kit 0.18.0 → 0.20.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 +1 -1
- package/dist/chunks/{chunk-OAXJWF3L.js → chunk-3PY52JP3.js} +1764 -1764
- package/dist/chunks/{chunk-X3JT5CLR.js → chunk-4KONMO7Z.js} +1 -1
- package/dist/chunks/{chunk-MB4CXSLL.js → chunk-W6EGTNG6.js} +3772 -2888
- package/dist/color-picker.js +2 -2
- package/dist/components/data-table/ColumnsMenu.d.ts +39 -17
- package/dist/components/data-table/DataTable.d.ts +41 -12
- package/dist/components/data-table/DataTableColumnsMenu.d.ts +45 -0
- package/dist/components/data-table/Head.d.ts +18 -5
- package/dist/components/data-table/Row.d.ts +10 -4
- package/dist/components/data-table/StateRows.d.ts +5 -3
- package/dist/components/data-table/columnOrder.d.ts +14 -0
- package/dist/components/data-table/reorder.d.ts +15 -5
- package/dist/components/data-table/types.d.ts +5 -0
- package/dist/components/data-table/useFrozenColumns.d.ts +6 -2
- package/dist/components/datepicker/DatepickerPanel.d.ts +1 -1
- package/dist/components/dnd/Dnd.d.ts +9 -5
- package/dist/components/dnd/inPlaceRow.d.ts +7 -0
- package/dist/components/dnd/useDragSource.d.ts +2 -0
- package/dist/components/dnd/useSortableList.d.ts +5 -0
- package/dist/components/field-list/FieldList.d.ts +37 -15
- package/dist/components/gantt/Gantt.d.ts +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/kanban/Kanban.d.ts +4 -0
- package/dist/components/list/List.d.ts +9 -4
- package/dist/components/scroll-container/ScrollContainer.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +4 -2
- package/dist/internal/ToolRow.d.ts +23 -0
- package/dist/internal/leaveGuard.d.ts +6 -0
- package/dist/internal/overlay/DialogGuard.d.ts +3 -2
- package/dist/internal/overlay/DialogParts.d.ts +14 -5
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/page/Page.d.ts +8 -14
- package/dist/skill/anti-slop.md +55 -1
- package/dist/skill/api-contract.md +2 -2
- package/dist/skill/cheatsheet.md +12 -4
- package/dist/skill/checklist.md +7 -0
- package/dist/skill/choosing.md +1 -0
- package/dist/skill/components.md +1 -1
- package/dist/skill/composition.md +196 -21
- package/dist/skill/layouts.md +1 -1
- package/dist/skill/reference/components/confirm-dialog/COMPONENT.md +1 -1
- package/dist/skill/reference/components/data-table/COMPONENT.md +110 -49
- package/dist/skill/reference/components/data-table/examples/actions-column.tsx +154 -0
- package/dist/skill/reference/components/data-table/examples/column-order.tsx +152 -0
- package/dist/skill/reference/components/data-table/examples/columns-visibility.tsx +18 -18
- package/dist/skill/reference/components/data-table/examples/controlled.tsx +32 -17
- package/dist/skill/reference/components/data-table/examples/examples.module.css +14 -36
- package/dist/skill/reference/components/data-table/examples/narrow.tsx +25 -19
- package/dist/skill/reference/components/data-table/examples/reorder.tsx +24 -2
- package/dist/skill/reference/components/data-table/examples/row-link.tsx +18 -22
- package/dist/skill/reference/components/data-table/examples/screen.tsx +12 -1
- package/dist/skill/reference/components/data-table/examples/selection.tsx +13 -18
- package/dist/skill/reference/components/data-table/examples/server.tsx +45 -31
- package/dist/skill/reference/components/data-table/examples/toolbar.tsx +22 -35
- package/dist/skill/reference/components/datepicker/COMPONENT.md +2 -2
- package/dist/skill/reference/components/dnd/COMPONENT.md +13 -7
- package/dist/skill/reference/components/dnd/examples/examples.module.css +4 -3
- package/dist/skill/reference/components/dnd/examples/handle.tsx +5 -5
- package/dist/skill/reference/components/dnd/examples/locked.tsx +1 -1
- package/dist/skill/reference/components/dnd/examples/table-columns.tsx +75 -0
- package/dist/skill/reference/components/dnd/examples/table.tsx +6 -6
- package/dist/skill/reference/components/drawer/COMPONENT.md +26 -10
- package/dist/skill/reference/components/drawer/examples/header-actions.tsx +1 -1
- package/dist/skill/reference/components/drawer/examples/loading.tsx +58 -0
- package/dist/skill/reference/components/field-list/COMPONENT.md +78 -47
- package/dist/skill/reference/components/field-list/examples/base-row.tsx +2 -1
- package/dist/skill/reference/components/field-list/examples/locked.tsx +11 -11
- package/dist/skill/reference/components/field-list/examples/narrow.tsx +108 -33
- package/dist/skill/reference/components/field-list/examples/reorder.tsx +1 -1
- package/dist/skill/reference/components/field-list/examples/row-menu.tsx +71 -0
- package/dist/skill/reference/components/field-list/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/field-list/examples/screen.tsx +169 -162
- package/dist/skill/reference/components/field-list/examples/totals.tsx +9 -8
- package/dist/skill/reference/components/field-list/examples/variants.tsx +51 -0
- package/dist/skill/reference/components/gantt/COMPONENT.md +4 -4
- package/dist/skill/reference/components/kanban/COMPONENT.md +6 -2
- package/dist/skill/reference/components/kanban/examples/states.tsx +7 -5
- package/dist/skill/reference/components/list/COMPONENT.md +21 -11
- package/dist/skill/reference/components/list/examples/reorder.tsx +42 -7
- package/dist/skill/reference/components/modal/COMPONENT.md +23 -10
- package/dist/skill/reference/components/scroll-container/COMPONENT.md +1 -1
- package/dist/skill/reference/components/segmented-control/COMPONENT.md +3 -2
- package/dist/skill/reference/components/sheet/COMPONENT.md +18 -7
- package/dist/skill/reference/components/smart-filter/COMPONENT.md +2 -2
- package/dist/skill/reference/layout/page/COMPONENT.md +13 -17
- package/dist/skill/reference/layout/page/examples/screen.module.css +1 -1
- package/dist/skill/reference/layout/page/examples/screen.tsx +93 -104
- package/dist/skill/reference/layout/page/examples/sections.tsx +2 -15
- package/dist/skill/responsive.md +14 -10
- package/dist/tokens/semantic.d.ts +2 -2
- package/dist/tokens/themes/dark.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/confirm-dialog/COMPONENT.md +1 -1
- package/src/components/data-table/COMPONENT.md +110 -49
- package/src/components/data-table/examples/actions-column.tsx +154 -0
- package/src/components/data-table/examples/column-order.tsx +152 -0
- package/src/components/data-table/examples/columns-visibility.tsx +18 -18
- package/src/components/data-table/examples/controlled.tsx +32 -17
- package/src/components/data-table/examples/examples.module.css +14 -36
- package/src/components/data-table/examples/narrow.tsx +25 -19
- package/src/components/data-table/examples/reorder.tsx +24 -2
- package/src/components/data-table/examples/row-link.tsx +18 -22
- package/src/components/data-table/examples/screen.tsx +12 -1
- package/src/components/data-table/examples/selection.tsx +13 -18
- package/src/components/data-table/examples/server.tsx +45 -31
- package/src/components/data-table/examples/toolbar.tsx +22 -35
- package/src/components/datepicker/COMPONENT.md +2 -2
- package/src/components/dnd/COMPONENT.md +13 -7
- package/src/components/dnd/examples/examples.module.css +4 -3
- package/src/components/dnd/examples/handle.tsx +5 -5
- package/src/components/dnd/examples/locked.tsx +1 -1
- package/src/components/dnd/examples/table-columns.tsx +75 -0
- package/src/components/dnd/examples/table.tsx +6 -6
- package/src/components/drawer/COMPONENT.md +26 -10
- package/src/components/drawer/examples/header-actions.tsx +1 -1
- package/src/components/drawer/examples/loading.tsx +58 -0
- package/src/components/field-list/COMPONENT.md +78 -47
- package/src/components/field-list/examples/base-row.tsx +2 -1
- package/src/components/field-list/examples/locked.tsx +11 -11
- package/src/components/field-list/examples/narrow.tsx +108 -33
- package/src/components/field-list/examples/reorder.tsx +1 -1
- package/src/components/field-list/examples/row-menu.tsx +71 -0
- package/src/components/field-list/examples/screen.module.css +1 -1
- package/src/components/field-list/examples/screen.tsx +169 -162
- package/src/components/field-list/examples/totals.tsx +9 -8
- package/src/components/field-list/examples/variants.tsx +51 -0
- package/src/components/gantt/COMPONENT.md +4 -4
- package/src/components/kanban/COMPONENT.md +6 -2
- package/src/components/kanban/examples/states.tsx +7 -5
- package/src/components/list/COMPONENT.md +21 -11
- package/src/components/list/examples/reorder.tsx +42 -7
- package/src/components/modal/COMPONENT.md +23 -10
- package/src/components/scroll-container/COMPONENT.md +1 -1
- package/src/components/segmented-control/COMPONENT.md +3 -2
- package/src/components/sheet/COMPONENT.md +18 -7
- package/src/components/smart-filter/COMPONENT.md +2 -2
- package/src/layout/page/COMPONENT.md +13 -17
- package/src/layout/page/examples/screen.module.css +1 -1
- package/src/layout/page/examples/screen.tsx +93 -104
- package/src/layout/page/examples/sections.tsx +2 -15
- package/src/styles/theme-dark.css +1 -1
- package/src/styles/theme-light.css +1 -1
- package/dist/components/data-table/context.d.ts +0 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** A settings page as a document: the path in the top bar that repeats the title once it scrolls away, the large title in the flow,
|
|
1
|
+
/** A settings page as a document: the path in the top bar that repeats the title once it scrolls away, the large title in the flow, each section a card with its own heading, a form saved by its own button, switches that apply at once and a danger zone with a confirm — `collapse`, `maxWidth`, `Card.Header`. */
|
|
2
2
|
import {
|
|
3
3
|
Breadcrumb,
|
|
4
4
|
Button,
|
|
@@ -88,118 +88,107 @@ export default function PageScreenExample() {
|
|
|
88
88
|
</Page.Heading>
|
|
89
89
|
</Page.Header>
|
|
90
90
|
<Page.Body>
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
<Card.
|
|
98
|
-
<
|
|
99
|
-
<
|
|
100
|
-
<Input.
|
|
91
|
+
<form noValidate onSubmit={save} onReset={() => setInnError(undefined)}>
|
|
92
|
+
<Card.Root variant="panel">
|
|
93
|
+
<Card.Header>
|
|
94
|
+
<Card.Title as="h2">Компания</Card.Title>
|
|
95
|
+
<Card.Description>Попадают в счета, акты и письма клиентам.</Card.Description>
|
|
96
|
+
</Card.Header>
|
|
97
|
+
<Card.Body>
|
|
98
|
+
<Fieldset disabled={saving}>
|
|
99
|
+
<Input.Root label="Название">
|
|
100
|
+
<Input.Wrapper>
|
|
101
|
+
<Input.Field name="name" defaultValue="ООО «Прайм Софт»" />
|
|
102
|
+
</Input.Wrapper>
|
|
103
|
+
</Input.Root>
|
|
104
|
+
<div className={styles.pair}>
|
|
105
|
+
<Input.Root label="ИНН" error={innError} hint="10 или 12 цифр" reserveSupportRow>
|
|
101
106
|
<Input.Wrapper>
|
|
102
|
-
<Input.Field name="
|
|
107
|
+
<Input.Field name="inn" inputMode="numeric" defaultValue="7704512908" />
|
|
103
108
|
</Input.Wrapper>
|
|
104
109
|
</Input.Root>
|
|
105
|
-
<
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
</
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
))}
|
|
126
|
-
</Select.Content>
|
|
127
|
-
</Select.Root>
|
|
128
|
-
</div>
|
|
129
|
-
<Textarea.Root
|
|
130
|
-
name="address"
|
|
131
|
-
label="Юридический адрес"
|
|
132
|
-
optional
|
|
133
|
-
rows={2}
|
|
134
|
-
defaultValue="125009, Москва, ул. Тверская, д. 7, офис 412"
|
|
135
|
-
/>
|
|
136
|
-
</Fieldset>
|
|
137
|
-
</Card.Body>
|
|
138
|
-
<Card.Footer>
|
|
139
|
-
<Button.Root type="reset" variant="ghost" tone="neutral" disabled={saving}>
|
|
140
|
-
Отменить изменения
|
|
141
|
-
</Button.Root>
|
|
142
|
-
<Button.Root type="submit" loading={saving}>
|
|
143
|
-
{saved ? "Сохранено" : "Сохранить"}
|
|
144
|
-
</Button.Root>
|
|
145
|
-
</Card.Footer>
|
|
146
|
-
</Card.Root>
|
|
147
|
-
</form>
|
|
148
|
-
</Page.Section>
|
|
149
|
-
|
|
150
|
-
<Page.Section
|
|
151
|
-
layout="aside"
|
|
152
|
-
label="Уведомления"
|
|
153
|
-
description="Включаются сразу, без сохранения."
|
|
154
|
-
>
|
|
155
|
-
<Card.Root variant="panel">
|
|
156
|
-
<Card.Body>
|
|
157
|
-
<Fieldset aria-label="Уведомления">
|
|
158
|
-
{ALERTS.map((alert) => (
|
|
159
|
-
<Switch.Root
|
|
160
|
-
key={alert.name}
|
|
161
|
-
name={alert.name}
|
|
162
|
-
defaultChecked={alert.defaultChecked}
|
|
163
|
-
hint={alert.hint}
|
|
164
|
-
>
|
|
165
|
-
<Switch.Label>{alert.label}</Switch.Label>
|
|
166
|
-
</Switch.Root>
|
|
167
|
-
))}
|
|
110
|
+
<Select.Root label="Часовой пояс" defaultValue="Europe/Moscow">
|
|
111
|
+
<Select.Trigger>
|
|
112
|
+
<Select.Value />
|
|
113
|
+
</Select.Trigger>
|
|
114
|
+
<Select.Content searchable>
|
|
115
|
+
{TIMEZONES.map((zone) => (
|
|
116
|
+
<Select.Item key={zone.value} value={zone.value}>
|
|
117
|
+
{zone.label}
|
|
118
|
+
</Select.Item>
|
|
119
|
+
))}
|
|
120
|
+
</Select.Content>
|
|
121
|
+
</Select.Root>
|
|
122
|
+
</div>
|
|
123
|
+
<Textarea.Root
|
|
124
|
+
name="address"
|
|
125
|
+
label="Юридический адрес"
|
|
126
|
+
optional
|
|
127
|
+
rows={2}
|
|
128
|
+
defaultValue="125009, Москва, ул. Тверская, д. 7, офис 412"
|
|
129
|
+
/>
|
|
168
130
|
</Fieldset>
|
|
169
131
|
</Card.Body>
|
|
132
|
+
<Card.Footer>
|
|
133
|
+
<Button.Root type="reset" variant="ghost" tone="neutral" disabled={saving}>
|
|
134
|
+
Отменить изменения
|
|
135
|
+
</Button.Root>
|
|
136
|
+
<Button.Root type="submit" loading={saving}>
|
|
137
|
+
{saved ? "Сохранено" : "Сохранить"}
|
|
138
|
+
</Button.Root>
|
|
139
|
+
</Card.Footer>
|
|
170
140
|
</Card.Root>
|
|
171
|
-
</
|
|
141
|
+
</form>
|
|
172
142
|
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
<Card.
|
|
179
|
-
<
|
|
180
|
-
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
</div>
|
|
187
|
-
<ConfirmDialog.Root
|
|
188
|
-
title="Удалить «Прайм Софт»?"
|
|
189
|
-
description="312 счетов, 48 клиентов и вся история удалятся без возможности восстановления."
|
|
190
|
-
confirmLabel="Удалить пространство"
|
|
191
|
-
onConfirm={removeWorkspace}
|
|
143
|
+
<Card.Root variant="panel">
|
|
144
|
+
<Card.Header>
|
|
145
|
+
<Card.Title as="h2">Уведомления</Card.Title>
|
|
146
|
+
<Card.Description>Включаются сразу, без сохранения.</Card.Description>
|
|
147
|
+
</Card.Header>
|
|
148
|
+
<Card.Body>
|
|
149
|
+
<Fieldset aria-label="Уведомления">
|
|
150
|
+
{ALERTS.map((alert) => (
|
|
151
|
+
<Switch.Root
|
|
152
|
+
key={alert.name}
|
|
153
|
+
name={alert.name}
|
|
154
|
+
defaultChecked={alert.defaultChecked}
|
|
155
|
+
hint={alert.hint}
|
|
192
156
|
>
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
157
|
+
<Switch.Label>{alert.label}</Switch.Label>
|
|
158
|
+
</Switch.Root>
|
|
159
|
+
))}
|
|
160
|
+
</Fieldset>
|
|
161
|
+
</Card.Body>
|
|
162
|
+
</Card.Root>
|
|
163
|
+
|
|
164
|
+
<Card.Root variant="panel">
|
|
165
|
+
<Card.Header>
|
|
166
|
+
<Card.Title as="h2">Рабочее пространство</Card.Title>
|
|
167
|
+
<Card.Description>Действия, которые нельзя отменить.</Card.Description>
|
|
168
|
+
</Card.Header>
|
|
169
|
+
<Card.Body>
|
|
170
|
+
<div className={styles.danger}>
|
|
171
|
+
<div className={styles.dangerText}>
|
|
172
|
+
<Typography variant="title-s">Удалить пространство</Typography>
|
|
173
|
+
<Typography variant="body-s" tone="secondary">
|
|
174
|
+
Счета, клиенты и история будут удалены для всех участников.
|
|
175
|
+
</Typography>
|
|
199
176
|
</div>
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
177
|
+
<ConfirmDialog.Root
|
|
178
|
+
title="Удалить «Прайм Софт»?"
|
|
179
|
+
description="312 счетов, 48 клиентов и вся история удалятся без возможности восстановления."
|
|
180
|
+
confirmLabel="Удалить пространство"
|
|
181
|
+
onConfirm={removeWorkspace}
|
|
182
|
+
>
|
|
183
|
+
<ConfirmDialog.Trigger>
|
|
184
|
+
<Button.Root variant="outline" tone="danger">
|
|
185
|
+
Удалить
|
|
186
|
+
</Button.Root>
|
|
187
|
+
</ConfirmDialog.Trigger>
|
|
188
|
+
</ConfirmDialog.Root>
|
|
189
|
+
</div>
|
|
190
|
+
</Card.Body>
|
|
191
|
+
</Card.Root>
|
|
203
192
|
</Page.Body>
|
|
204
193
|
</Page.Root>
|
|
205
194
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** 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
|
|
2
|
-
import { Card, DataTable, type DataTableColumn, LinkButton, Page
|
|
1
|
+
/** 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`. */
|
|
2
|
+
import { Card, DataTable, type DataTableColumn, LinkButton, Page } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
5
5
|
|
|
@@ -55,19 +55,6 @@ export default function PageSectionsExample() {
|
|
|
55
55
|
</Page.Actions>
|
|
56
56
|
<DataTable columns={COLUMNS} rows={INVOICES} getRowKey={(row) => row.id} paging="none" />
|
|
57
57
|
</Page.Section>
|
|
58
|
-
<Page.Section
|
|
59
|
-
layout="aside"
|
|
60
|
-
label="Реквизиты в счетах"
|
|
61
|
-
description="Попадают в каждый новый счёт."
|
|
62
|
-
>
|
|
63
|
-
<Card.Root variant="panel">
|
|
64
|
-
<Card.Body>
|
|
65
|
-
<Typography variant="body-m" tone="secondary">
|
|
66
|
-
ООО «Прайм Софт», ИНН 7701234567, р/с в Т-Банке.
|
|
67
|
-
</Typography>
|
|
68
|
-
</Card.Body>
|
|
69
|
-
</Card.Root>
|
|
70
|
-
</Page.Section>
|
|
71
58
|
</Page.Body>
|
|
72
59
|
</div>
|
|
73
60
|
);
|
package/dist/skill/responsive.md
CHANGED
|
@@ -66,7 +66,7 @@ Use these as they are; never wrap them in your own breakpoints.
|
|
|
66
66
|
| app navigation | Sidebar: on-canvas from 768px, an off-canvas panel below (`offCanvas="auto"`) opened by the menu button `Page.TopBar` draws by itself while the Sidebar is off-canvas; `BottomNav` in `AppShell.Footer` for 2–6 app sections on phones — flat or a floating glass capsule (`floating`) with an optional round `BottomNav.Action`, icons with or without labels (`iconOnly`); the shell hides it by itself while the Sidebar rail is on screen (from 768px with `offCanvas="auto"`) |
|
|
67
67
|
| page top bar | `Page.TopBar` lays out its groups from their natural widths: one line while they fit, then the tools on a line of their own, then icon-only buttons, then «⋯», and the heading gives last ([below](#the-pages-top-bar--pagetopbar)). `Page.Header` in the flow: actions wrap under the title |
|
|
68
68
|
| switchers | [Switchers](#switchers) never wrap or truncate: they scroll inside themselves |
|
|
69
|
-
| tables | DataTable scrolls inside itself, edge shadows show hidden columns, `stickyFirstColumn
|
|
69
|
+
| tables | DataTable scrolls inside itself, edge shadows show hidden columns, `stickyFirstColumn` and `stickyLastColumn` (row actions), a column chooser (`columnsMenu` over the row actions, else `DataTableColumnsMenu` beside the table's search), the `toolbar` lays out as `Page.Tools` — the search on a line of its own and a switcher filling its line below a 36rem table, sticky head off on short screens |
|
|
70
70
|
| floating layers | Popover (opened from a Trigger), Dropdown, Select (and Datepicker, ColorPresets) never wider than the viewport − 16, 8 from the edges, flip when out of room; below 640 they open as a bottom sheet — scrim, grab handle, swipe down to close, page scroll locked; Tooltip and TagSelect stay anchored |
|
|
71
71
|
| dialogs | Modal is a bottom sheet with a handle below 640 (swipe down closes it while `closeOnOutsideClick` allows); footer actions stack on phones and in a dialog narrower than 360px; `Sheet` is a bottom sheet for a short task at every width (centred at 560 on a tablet or desktop) and closes with a swipe down from its handle or header; a Drawer has no swipe — buttons, Escape and the scrim close it |
|
|
72
72
|
| date picking | Datepicker shows two months and side presets only when they fit; otherwise one month and presets above |
|
|
@@ -85,9 +85,11 @@ by one plan chosen from their natural widths. As the width runs out it gives way
|
|
|
85
85
|
in this order, and nothing ever overflows:
|
|
86
86
|
|
|
87
87
|
1. **One line** — `Page.Heading`, `Page.Tools` and `Page.Actions` side by side while they fit.
|
|
88
|
-
2. **Tools below** — the tools take a line of their own under the first one
|
|
89
|
-
|
|
90
|
-
(`Datepicker.Root`)
|
|
88
|
+
2. **Tools below** — the tools take a line of their own under the first one: a search
|
|
89
|
+
(`SmartFilter.Toolbar`, `Input.Root`) takes the free room, the switchers, a period
|
|
90
|
+
(`Datepicker.Root`) and buttons keep their width at the end; under 36rem of the line the search
|
|
91
|
+
takes a line of its own and a switcher fills the next. The DataTable `toolbar` is the same tool
|
|
92
|
+
row and lays out the same way from the table's width. Beside a search that
|
|
91
93
|
would get too little room the SmartFilter button shows only its icon and count, on the same row.
|
|
92
94
|
The actions stay on the first line beside the heading at every width.
|
|
93
95
|
3. **Icons** — every Button with an icon shows only the icon, the secondary ones first, then the
|
|
@@ -187,7 +189,7 @@ export function OrdersPage() {
|
|
|
187
189
|
inside takes that tier.
|
|
188
190
|
- A Button without an icon keeps its label at every step and leaves the bar less room before it
|
|
189
191
|
folds: give each one a `Button.Icon`.
|
|
190
|
-
- A SegmentedControl or a Datepicker in `Page.Tools` needs no `fullWidth`: the
|
|
192
|
+
- A SegmentedControl or a Datepicker in `Page.Tools` or a DataTable `toolbar` needs no `fullWidth`: the tool row sets it.
|
|
191
193
|
- The primary action is on screen at every width — as its icon at the narrowest; it never folds and
|
|
192
194
|
never disappears.
|
|
193
195
|
- Section totals go into `SegmentedControl.Count`, not into stat cards above the table.
|
|
@@ -198,14 +200,16 @@ export function OrdersPage() {
|
|
|
198
200
|
## Switchers
|
|
199
201
|
|
|
200
202
|
- **Three width modes:** by content (`fullWidth` off), full width (`fullWidth`), full width only on
|
|
201
|
-
a line
|
|
203
|
+
a short line (a SegmentedControl in `Page.Tools` or a DataTable `toolbar` — the tool row decides).
|
|
202
204
|
- Sections of a page → SegmentedControl in `Page.Tools`; panels inside a card or a section →
|
|
203
205
|
Tabs (the folder look belongs to its panel).
|
|
204
206
|
- Every switcher — Tabs, SegmentedControl, a horizontal ButtonGroup and BottomNav — scrolls inside
|
|
205
207
|
itself when its items do not fit: never a second line, never a truncated item. Its hidden edges
|
|
206
208
|
fade, a vertical mouse wheel scrolls it sideways, touch pans it, the current item is scrolled into
|
|
207
|
-
view, and the indicator moves only after a person's choice. A SegmentedControl
|
|
208
|
-
icons collapses to icons (each named by its
|
|
209
|
+
view, and the indicator moves only after a person's choice. A SegmentedControl first tightens its
|
|
210
|
+
segments' padding, and one whose items all have icons then collapses to icons (each named by its
|
|
211
|
+
tooltip) before it scrolls. On a 320px phone two sections with counts fit a line of their own;
|
|
212
|
+
more, or long labels, scroll — keep the section a person needs first at the start.
|
|
209
213
|
- Your duty as its host: give the switcher a bounded width. A flex or grid child that holds one sets
|
|
210
214
|
`min-width: 0`, otherwise the switcher grows the row instead of scrolling
|
|
211
215
|
([foundation §9](reference/foundation.md#9-layout-and-responsiveness)).
|
|
@@ -223,8 +227,8 @@ export function OrdersPage() {
|
|
|
223
227
|
|
|
224
228
|
## Components on narrow widths — what you still decide
|
|
225
229
|
|
|
226
|
-
**Tables.** Let DataTable scroll inside itself; offer a column chooser (`
|
|
227
|
-
`
|
|
230
|
+
**Tables.** Let DataTable scroll inside itself; offer a column chooser (`columnsMenu` or
|
|
231
|
+
`DataTableColumnsMenu`; the key column `hideable: false`); `stickyFirstColumn` for the name. On phones a table / cards switch in `Page.Tools` is fine — silently dropping columns
|
|
228
232
|
by breakpoint is not. Never ask to rotate the phone.
|
|
229
233
|
|
|
230
234
|
**Card grids.** [Intrinsic grids](#intrinsic-grids), never a breakpoint. Tiles of a row share one
|
|
@@ -22,7 +22,7 @@ export declare const semanticTokens: {
|
|
|
22
22
|
readonly inverse: "{color.gray.925}";
|
|
23
23
|
readonly scrim: "color-mix(in srgb, {color.gray.925} 44%, transparent)";
|
|
24
24
|
/** Soft shade over an edge that hides scrolled content (DataTable columns). */
|
|
25
|
-
readonly edgeShadow: "color-mix(in srgb, {color.gray.925}
|
|
25
|
+
readonly edgeShadow: "color-mix(in srgb, {color.gray.925} 8%, transparent)";
|
|
26
26
|
/**
|
|
27
27
|
* Translucent glass over content (floating BottomNav), always with a strong backdrop blur
|
|
28
28
|
* (`--prime-glass-saturation` lifts the colors under it): dense, as the iOS tab bar — the
|
|
@@ -484,7 +484,7 @@ export declare const semanticTokens: {
|
|
|
484
484
|
* `above`, `top`, `cover` and `front` for each part laid over the last: a hover wash or a handle
|
|
485
485
|
* is `raised`; the marks over a picture (play, duration, check) are `top`; a control spread over
|
|
486
486
|
* those marks is `cover`; a transfer in front of a whole tile is `front`. A component with sticky
|
|
487
|
-
* parts names them from the same steps (DataTable:
|
|
487
|
+
* parts names them from the same steps (DataTable: pinned columns, group row, head, corner).
|
|
488
488
|
*/
|
|
489
489
|
readonly z: {
|
|
490
490
|
readonly below: "{zIndex.below}";
|
|
@@ -11,7 +11,7 @@ export declare const darkThemeOverrides: {
|
|
|
11
11
|
readonly inverse: "{color.gray.100}";
|
|
12
12
|
readonly scrim: "color-mix(in srgb, {color.black} 60%, transparent)";
|
|
13
13
|
/** Darker than the scrim's share: a shade on a 900 surface needs more ink to read. */
|
|
14
|
-
readonly edgeShadow: "color-mix(in srgb, {color.black}
|
|
14
|
+
readonly edgeShadow: "color-mix(in srgb, {color.black} 28%, transparent)";
|
|
15
15
|
readonly glass: "color-mix(in srgb, {color.gray.875} 76%, transparent)";
|
|
16
16
|
readonly glassEdge: "color-mix(in srgb, {color.white} 28%, transparent)";
|
|
17
17
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prime-ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
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": {
|
|
@@ -134,5 +134,5 @@ The dialog is a Modal `s` with the floating surface, a header and a footer; ther
|
|
|
134
134
|
- `tone="accent"` for a delete → destructive is always `danger`.
|
|
135
135
|
|
|
136
136
|
## Related
|
|
137
|
-
- **Built from:** the dialog Modal stands on (`internal/overlay/ModalDialog` at `s`, the header, body and footer of `internal/overlay/DialogParts`), [ScrollContainer](../scroll-container/COMPONENT.md) (the body), [Avatar](../avatar/COMPONENT.md) and [Thumbnail](../thumbnail/COMPONENT.md) (pictures the shared icon slot recognises), [Button](../button/COMPONENT.md) (Cancel, the confirm with `loading`), [Banner](../banner/COMPONENT.md) (the failure message), `Icon` (`status.danger` in the Banner)
|
|
137
|
+
- **Built from:** the dialog Modal stands on (`internal/overlay/ModalDialog` at `s`, the header, body and footer of `internal/overlay/DialogParts`), [ScrollContainer](../scroll-container/COMPONENT.md) (the body), [Avatar](../avatar/COMPONENT.md) and [Thumbnail](../thumbnail/COMPONENT.md) (pictures the shared icon slot recognises), [Skeleton](../skeleton/COMPONENT.md) (the shared description's loading line), [Button](../button/COMPONENT.md) (Cancel, the confirm with `loading`), [Banner](../banner/COMPONENT.md) (the failure message), `Icon` (`status.danger` in the Banner)
|
|
138
138
|
- **See also:** [Modal](../modal/COMPONENT.md), [Drawer](../drawer/COMPONENT.md), [Notification](../notification/COMPONENT.md)
|