@retailcrm/embed-ui-v1-components 0.9.19 → 0.9.21
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/AGENTS.md +8 -0
- package/README.md +5 -1
- package/bin/embed-ui-v1-components.mjs +32 -24
- package/bin/postinstall.mjs +2 -2
- package/dist/host.cjs +19 -13
- package/dist/host.css +8 -10
- package/dist/host.d.ts +52 -58
- package/dist/host.js +19 -13
- package/dist/remote.cjs +97 -94
- package/dist/remote.d.ts +20 -32
- package/dist/remote.js +97 -94
- package/docs/AGENT-DESIGN-GUIDELINES.md +463 -0
- package/docs/AI.md +89 -6
- package/docs/FORMAT.md +11 -9
- package/docs/PROFILES.md +9 -5
- package/docs/README.md +14 -5
- package/docs/assets/page-guidelines/card-settings-page.png +0 -0
- package/docs/assets/page-guidelines/collapse-block-page.png +0 -0
- package/docs/assets/page-guidelines/entity-list-page.png +0 -0
- package/docs/assets/page-guidelines/modal-sidebar.png +0 -0
- package/docs/assets/page-guidelines/modal-window.png +0 -0
- package/docs/assets/page-guidelines/multi-column-page.png +0 -0
- package/docs/profiles/UiAddButton.yml +30 -0
- package/docs/profiles/UiAlert.yml +27 -0
- package/docs/profiles/UiAvatar.yml +26 -0
- package/docs/profiles/UiAvatarList.yml +28 -0
- package/docs/profiles/UiButton.yml +1 -8
- package/docs/profiles/UiCalendar.yml +28 -0
- package/docs/profiles/UiCheckbox.yml +32 -0
- package/docs/profiles/UiCollapse.yml +34 -0
- package/docs/profiles/UiCollapseBox.yml +30 -0
- package/docs/profiles/UiCollapseGroup.yml +26 -0
- package/docs/profiles/UiCopyButton.yml +35 -0
- package/docs/profiles/UiDate.yml +28 -0
- package/docs/profiles/UiDatePicker.yml +30 -0
- package/docs/profiles/UiError.yml +45 -0
- package/docs/profiles/UiField.yml +1 -15
- package/docs/profiles/UiImage.yml +28 -0
- package/docs/profiles/UiInfobox.yml +33 -0
- package/docs/profiles/UiLink.yml +40 -0
- package/docs/profiles/UiLoader.yml +35 -0
- package/docs/profiles/UiMenuItem.yml +38 -0
- package/docs/profiles/UiMenuItemGroup.yml +27 -0
- package/docs/profiles/UiModalSidebar.yml +32 -0
- package/docs/profiles/UiModalWindow.yml +42 -0
- package/docs/profiles/UiModalWindowSurface.yml +32 -0
- package/docs/profiles/UiNumberStepper.yml +36 -0
- package/docs/profiles/UiPageHeader.yml +1 -23
- package/docs/profiles/UiPopper.yml +1 -13
- package/docs/profiles/UiPopperConnector.yml +7 -25
- package/docs/profiles/UiPopperTarget.yml +7 -25
- package/docs/profiles/UiRadio.yml +40 -0
- package/docs/profiles/UiRadioSwitch.yml +1 -32
- package/docs/profiles/UiRadioSwitchOption.yml +9 -13
- package/docs/profiles/UiScrollBox.yml +34 -0
- package/docs/profiles/UiSelect.yml +1 -44
- package/docs/profiles/UiSelectOption.yml +32 -0
- package/docs/profiles/UiSelectOptionGroup.yml +30 -0
- package/docs/profiles/UiSkeleton.yml +32 -0
- package/docs/profiles/UiSlider.yml +40 -0
- package/docs/profiles/UiSwitch.yml +38 -0
- package/docs/profiles/UiTab.yml +7 -16
- package/docs/profiles/UiTabGroup.yml +1 -30
- package/docs/profiles/UiTable.yml +148 -0
- package/docs/profiles/UiTableBodyCell.yml +28 -0
- package/docs/profiles/UiTableColumn.yml +39 -0
- package/docs/profiles/UiTableFooterButton.yml +43 -0
- package/docs/profiles/UiTableFooterSection.yml +37 -0
- package/docs/profiles/UiTableHeadCell.yml +28 -0
- package/docs/profiles/UiTableSorter.yml +29 -0
- package/docs/profiles/UiTag.yml +38 -0
- package/docs/profiles/UiTextbox.yml +1 -32
- package/docs/profiles/UiTimePicker.yml +40 -0
- package/docs/profiles/UiToggleButton.yml +1 -11
- package/docs/profiles/UiToggleGroup.yml +1 -13
- package/docs/profiles/UiToggleGroupOption.yml +9 -11
- package/docs/profiles/UiToolbarButton.yml +37 -0
- package/docs/profiles/UiToolbarLink.yml +37 -0
- package/docs/profiles/UiTooltip.yml +38 -0
- package/docs/profiles/UiTransition.yml +37 -0
- package/docs/profiles/UiYandexMap.yml +53 -0
- package/package.json +15 -15
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
# Agent Design Guidelines
|
|
2
|
+
|
|
3
|
+
These guidelines describe page construction rules for AI assistants that generate RetailCRM
|
|
4
|
+
extension screens with `@retailcrm/embed-ui-v1-components`.
|
|
5
|
+
|
|
6
|
+
## How Agents Should Use This File
|
|
7
|
+
|
|
8
|
+
- Use this file after `README.md`, `AGENTS.md`, `AI.md`, and the relevant component profiles.
|
|
9
|
+
- Treat it as page-composition guidance, not as a replacement for component API docs.
|
|
10
|
+
- Prefer public components from `@retailcrm/embed-ui-v1-components/remote`.
|
|
11
|
+
- Use Storybook and YAML profiles for exact component props and examples.
|
|
12
|
+
- Do not invent new chrome for pages, forms, tables, tabs, buttons, modals, or sidebars when a documented component exists.
|
|
13
|
+
|
|
14
|
+
## Shared Page Rules
|
|
15
|
+
|
|
16
|
+
- Page title uses the large accent text style: `Text large Accent 24`.
|
|
17
|
+
- Page-level actions sit to the right of the title.
|
|
18
|
+
- A page can have only one `Default Primary` button and one `Success Primary` button.
|
|
19
|
+
- Additional page actions can use secondary or tertiary variants in unlimited quantity when the task needs them.
|
|
20
|
+
- When a group has multiple buttons, the primary action should represent the main flow. Secondary actions should support or cancel that flow.
|
|
21
|
+
- Components inside pages and blocks should be spaced by values divisible by 4px: `4`, `8`, `12`, `16`, `20`, `24`, `28`, `32`, and so on.
|
|
22
|
+
- Content blocks commonly use 32px left, right, and bottom padding and 24px top padding.
|
|
23
|
+
|
|
24
|
+
## Entity List Page
|
|
25
|
+
|
|
26
|
+
Use this pattern for separate pages that list entities and allow filtering or creating a new entity.
|
|
27
|
+
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
Examples from the design:
|
|
31
|
+
|
|
32
|
+
- order list;
|
|
33
|
+
- customer list;
|
|
34
|
+
- mailing list;
|
|
35
|
+
- task list.
|
|
36
|
+
|
|
37
|
+
Expected structure:
|
|
38
|
+
|
|
39
|
+
- `UiPageHeader` with a page title.
|
|
40
|
+
- One or more 48px page buttons on the right side of the header.
|
|
41
|
+
- If there are multiple header buttons, one should be primary and the rest can be secondary or tertiary.
|
|
42
|
+
- The main primary button usually creates a new entity for the list.
|
|
43
|
+
- Filters above the table, built from controls such as select, textbox, and combobox-like selection components.
|
|
44
|
+
- Filter controls should run in rows of roughly 4-5 fields, then wrap to the next row.
|
|
45
|
+
- Filters can be collapsible.
|
|
46
|
+
- Filter apply action uses a default secondary 36px text button.
|
|
47
|
+
- Filter reset action uses a danger secondary 36px icon button.
|
|
48
|
+
- The entity data is shown in a table.
|
|
49
|
+
- The table may scroll and may support export.
|
|
50
|
+
|
|
51
|
+
Recommended components:
|
|
52
|
+
|
|
53
|
+
- `UiPageHeader`
|
|
54
|
+
- `UiButton`
|
|
55
|
+
- `UiField`
|
|
56
|
+
- `UiTextbox`
|
|
57
|
+
- `UiSelect`
|
|
58
|
+
- `UiTable`
|
|
59
|
+
- `UiTableColumn`
|
|
60
|
+
- `UiTableSorter`
|
|
61
|
+
- `UiTableFooterSection`
|
|
62
|
+
- `UiTableFooterButton`
|
|
63
|
+
|
|
64
|
+
Canonical table footer pattern:
|
|
65
|
+
|
|
66
|
+
```vue
|
|
67
|
+
<script lang="ts" setup>
|
|
68
|
+
import IconChevronLeft from '@retailcrm/embed-ui-v1-components/assets/sprites/arrows/chevron-left.svg'
|
|
69
|
+
import IconChevronRight from '@retailcrm/embed-ui-v1-components/assets/sprites/arrows/chevron-right.svg'
|
|
70
|
+
import {
|
|
71
|
+
UiTable,
|
|
72
|
+
UiTableColumn,
|
|
73
|
+
UiTableFooterButton,
|
|
74
|
+
UiTableFooterSection,
|
|
75
|
+
} from '@retailcrm/embed-ui-v1-components/remote'
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<template>
|
|
79
|
+
<UiTable
|
|
80
|
+
class="entity-list-table"
|
|
81
|
+
bordered
|
|
82
|
+
:rows="rows"
|
|
83
|
+
row-key="id"
|
|
84
|
+
>
|
|
85
|
+
<UiTableColumn label="Название">
|
|
86
|
+
<template #cell="{ row }">
|
|
87
|
+
{{ row.title }}
|
|
88
|
+
</template>
|
|
89
|
+
</UiTableColumn>
|
|
90
|
+
|
|
91
|
+
<template #footer-summary="{ rowsCount }">
|
|
92
|
+
<span>{{ rowsCount }} элементов</span>
|
|
93
|
+
</template>
|
|
94
|
+
|
|
95
|
+
<template #footer-page-size>
|
|
96
|
+
<UiTableFooterSection class="entity-list-table__page-size">
|
|
97
|
+
<span class="entity-list-table__footer-caption">Показывать:</span>
|
|
98
|
+
<UiTableFooterButton class="entity-list-table__footer-button entity-list-table__footer-button_passive">
|
|
99
|
+
по 20
|
|
100
|
+
</UiTableFooterButton>
|
|
101
|
+
<span class="entity-list-table__footer-delimiter">/</span>
|
|
102
|
+
<UiTableFooterButton class="entity-list-table__footer-button">
|
|
103
|
+
по 50
|
|
104
|
+
</UiTableFooterButton>
|
|
105
|
+
<span class="entity-list-table__footer-delimiter">/</span>
|
|
106
|
+
<UiTableFooterButton class="entity-list-table__footer-button">
|
|
107
|
+
по 100
|
|
108
|
+
</UiTableFooterButton>
|
|
109
|
+
</UiTableFooterSection>
|
|
110
|
+
</template>
|
|
111
|
+
|
|
112
|
+
<template #footer-pagination>
|
|
113
|
+
<UiTableFooterSection class="entity-list-table__pagination-section">
|
|
114
|
+
<div class="entity-list-table__pagination">
|
|
115
|
+
<UiTableFooterButton class="entity-list-table__pagination-button">
|
|
116
|
+
1
|
|
117
|
+
</UiTableFooterButton>
|
|
118
|
+
<UiTableFooterButton class="entity-list-table__pagination-button">
|
|
119
|
+
2
|
|
120
|
+
</UiTableFooterButton>
|
|
121
|
+
<UiTableFooterButton class="entity-list-table__pagination-button entity-list-table__pagination-button_current">
|
|
122
|
+
3
|
|
123
|
+
</UiTableFooterButton>
|
|
124
|
+
<span class="entity-list-table__pagination-divider" />
|
|
125
|
+
<UiTableFooterButton
|
|
126
|
+
aria-label="Предыдущая страница"
|
|
127
|
+
class="entity-list-table__pagination-arrow"
|
|
128
|
+
>
|
|
129
|
+
<IconChevronLeft
|
|
130
|
+
aria-hidden="true"
|
|
131
|
+
class="entity-list-table__pagination-arrow-icon"
|
|
132
|
+
/>
|
|
133
|
+
</UiTableFooterButton>
|
|
134
|
+
<span class="entity-list-table__pagination-divider" />
|
|
135
|
+
<UiTableFooterButton
|
|
136
|
+
aria-label="Следующая страница"
|
|
137
|
+
class="entity-list-table__pagination-arrow"
|
|
138
|
+
>
|
|
139
|
+
<IconChevronRight
|
|
140
|
+
aria-hidden="true"
|
|
141
|
+
class="entity-list-table__pagination-arrow-icon"
|
|
142
|
+
/>
|
|
143
|
+
</UiTableFooterButton>
|
|
144
|
+
</div>
|
|
145
|
+
</UiTableFooterSection>
|
|
146
|
+
</template>
|
|
147
|
+
</UiTable>
|
|
148
|
+
</template>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Footer CSS contract:
|
|
152
|
+
|
|
153
|
+
```css
|
|
154
|
+
.entity-list-table {
|
|
155
|
+
--ui-v1-table-cell-padding-x: 12px;
|
|
156
|
+
--ui-v1-table-cell-padding-y: 12px;
|
|
157
|
+
--ui-v1-table-padding-start: 16px;
|
|
158
|
+
--ui-v1-table-padding-end: 16px;
|
|
159
|
+
--ui-v1-table-rounding: 4px;
|
|
160
|
+
--ui-v1-table-head-cell-padding-block-start: 14px;
|
|
161
|
+
--ui-v1-table-head-cell-padding-block-end: 14px;
|
|
162
|
+
--ui-v1-table-body-cell-padding-block-start: 15px;
|
|
163
|
+
--ui-v1-table-body-cell-padding-block-end: 15px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.entity-list-table .ui-v1-table__head-cell {
|
|
167
|
+
height: 42px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.entity-list-table .ui-v1-table__footer-meta {
|
|
171
|
+
min-height: 40px;
|
|
172
|
+
font-weight: 400;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.entity-list-table .ui-v1-table__footer-controls {
|
|
176
|
+
min-height: 52px;
|
|
177
|
+
background: #f9fafb;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.entity-list-table .ui-v1-table__footer-section {
|
|
181
|
+
font-size: 14px;
|
|
182
|
+
line-height: 20px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.entity-list-table__page-size,
|
|
186
|
+
.entity-list-table__pagination-section {
|
|
187
|
+
color: #1e2248;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.entity-list-table__footer-caption {
|
|
191
|
+
display: inline-block;
|
|
192
|
+
margin-right: 4px;
|
|
193
|
+
vertical-align: baseline;
|
|
194
|
+
line-height: inherit;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.entity-list-table__footer-button {
|
|
198
|
+
color: #005eeb;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.entity-list-table__footer-button_passive {
|
|
202
|
+
color: #1e2248;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.entity-list-table__footer-delimiter {
|
|
206
|
+
display: inline-block;
|
|
207
|
+
padding: 0 5px;
|
|
208
|
+
color: #8a96a6;
|
|
209
|
+
vertical-align: baseline;
|
|
210
|
+
line-height: inherit;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.entity-list-table .ui-v1-table__footer-side > .entity-list-table__pagination-section {
|
|
214
|
+
padding-block: 8px;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.entity-list-table__pagination {
|
|
218
|
+
display: flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
gap: 8px;
|
|
221
|
+
height: 36px;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.entity-list-table__pagination-button,
|
|
225
|
+
.entity-list-table__pagination-arrow {
|
|
226
|
+
width: 36px;
|
|
227
|
+
height: 36px;
|
|
228
|
+
border-radius: 4px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.entity-list-table .ui-v1-table__footer-button.entity-list-table__pagination-button {
|
|
232
|
+
color: #1e2248;
|
|
233
|
+
font-size: 14px;
|
|
234
|
+
line-height: 20px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.entity-list-table .ui-v1-table__footer-button.entity-list-table__pagination-button_current {
|
|
238
|
+
color: #fff;
|
|
239
|
+
background: #005eeb;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.entity-list-table .ui-v1-table__footer-button.entity-list-table__pagination-arrow {
|
|
243
|
+
color: #afb9c3;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.entity-list-table__pagination-arrow-icon {
|
|
247
|
+
display: block;
|
|
248
|
+
width: 24px;
|
|
249
|
+
height: 24px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.entity-list-table__pagination-divider {
|
|
253
|
+
width: 1px;
|
|
254
|
+
height: 52px;
|
|
255
|
+
margin-block: -8px;
|
|
256
|
+
background: #dee2e6;
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Use `UiTableFooterSection` and `UiTableFooterButton` for table footer pagination. Do not replace them
|
|
261
|
+
with regular `UiButton`. Use chevron icon assets for arrow controls, not text glyphs. Keep footer
|
|
262
|
+
styling scoped to a local table root class, and override the internal footer button class together
|
|
263
|
+
with the local class when changing pagination text, active page, or arrow colors.
|
|
264
|
+
|
|
265
|
+
## Card Or Settings Page
|
|
266
|
+
|
|
267
|
+
Use this pattern for settings pages or entity cards made mostly from forms.
|
|
268
|
+
|
|
269
|
+

|
|
270
|
+
|
|
271
|
+
Examples from the design:
|
|
272
|
+
|
|
273
|
+
- tracked event page;
|
|
274
|
+
- sending limit settings;
|
|
275
|
+
- email template settings;
|
|
276
|
+
- trigger page.
|
|
277
|
+
|
|
278
|
+
Expected structure:
|
|
279
|
+
|
|
280
|
+
- `UiPageHeader` with a page title.
|
|
281
|
+
- The title can be editable via an inline-edit pattern when the product flow requires it.
|
|
282
|
+
- One or more 48px header buttons on the right.
|
|
283
|
+
- Header actions can be accompanied by text information or status labels.
|
|
284
|
+
- Optional top tabs.
|
|
285
|
+
- Main content sits on a white content surface.
|
|
286
|
+
- The content can include text, buttons, fields, checkboxes, radio groups, switches, and other form controls.
|
|
287
|
+
- A bottom save panel is optional.
|
|
288
|
+
|
|
289
|
+
Recommended components:
|
|
290
|
+
|
|
291
|
+
- `UiPageHeader`
|
|
292
|
+
- `UiButton`
|
|
293
|
+
- `UiField`
|
|
294
|
+
- `UiTextbox`
|
|
295
|
+
- `UiSelect`
|
|
296
|
+
- `UiCheckbox`
|
|
297
|
+
- `UiRadio`
|
|
298
|
+
- `UiRadioSwitch`
|
|
299
|
+
- `UiSwitch`
|
|
300
|
+
- `UiTabGroup`
|
|
301
|
+
- `UiTab`
|
|
302
|
+
- `UiTag`
|
|
303
|
+
|
|
304
|
+
## Multi-Column Page
|
|
305
|
+
|
|
306
|
+
Use this pattern when an entity card or detail page contains several semantic blocks that should be visible in parallel.
|
|
307
|
+
|
|
308
|
+

|
|
309
|
+
|
|
310
|
+
Examples from the design:
|
|
311
|
+
|
|
312
|
+
- order page;
|
|
313
|
+
- customer page;
|
|
314
|
+
- product view page.
|
|
315
|
+
|
|
316
|
+
Layout rules:
|
|
317
|
+
|
|
318
|
+
- Content is placed on surfaces.
|
|
319
|
+
- The most common surface spans the full screen width.
|
|
320
|
+
- Semantic blocks can be arranged vertically and horizontally.
|
|
321
|
+
- Distance between blocks is 24px.
|
|
322
|
+
- Allowed width distributions are:
|
|
323
|
+
- `100%`;
|
|
324
|
+
- `50% / 50%`;
|
|
325
|
+
- `30% / 70%`.
|
|
326
|
+
|
|
327
|
+
Keep the visual hierarchy operational and dense. Do not turn internal CRM work screens into marketing-style layouts.
|
|
328
|
+
|
|
329
|
+
## Collapse-Block Page
|
|
330
|
+
|
|
331
|
+
Use this pattern for settings split into semantic groups.
|
|
332
|
+
|
|
333
|
+

|
|
334
|
+
|
|
335
|
+
Examples from the design:
|
|
336
|
+
|
|
337
|
+
- product editing;
|
|
338
|
+
- mailing editing;
|
|
339
|
+
- Double Opt-In settings.
|
|
340
|
+
|
|
341
|
+
Expected structure:
|
|
342
|
+
|
|
343
|
+
- Multiple collapsible blocks with their own content and local actions.
|
|
344
|
+
- If the page contains only collapse blocks, the white page surface is not needed.
|
|
345
|
+
- If every collapse block has its own save action, the bottom save panel is not needed.
|
|
346
|
+
- Collapse blocks can contain text, buttons, fields, controls, and small tables.
|
|
347
|
+
|
|
348
|
+
Avoid inside collapse blocks:
|
|
349
|
+
|
|
350
|
+
- complex tables;
|
|
351
|
+
- nested collapse blocks;
|
|
352
|
+
- two-column content split across separate surfaces.
|
|
353
|
+
|
|
354
|
+
Recommended components:
|
|
355
|
+
|
|
356
|
+
- `UiCollapse`
|
|
357
|
+
- `UiCollapseBox`
|
|
358
|
+
- `UiCollapseGroup`
|
|
359
|
+
- `UiButton`
|
|
360
|
+
- `UiField`
|
|
361
|
+
- `UiTable` only for small, simple tables
|
|
362
|
+
|
|
363
|
+
## Modal Sidebar
|
|
364
|
+
|
|
365
|
+
Use this pattern for a small contextual form, local additional information, or a compact entity card with a limited number of fields and settings.
|
|
366
|
+
|
|
367
|
+

|
|
368
|
+
|
|
369
|
+
Examples from the design:
|
|
370
|
+
|
|
371
|
+
- task card;
|
|
372
|
+
- notifications;
|
|
373
|
+
- new ticket;
|
|
374
|
+
- scenario step editing.
|
|
375
|
+
|
|
376
|
+
Size rules:
|
|
377
|
+
|
|
378
|
+
- Sidebar can use two widths: `720px` and `416px`.
|
|
379
|
+
|
|
380
|
+
Expected structure:
|
|
381
|
+
|
|
382
|
+
- Fixed header at the top with title and close button.
|
|
383
|
+
- Header can also contain extra text, icon, button, or tag.
|
|
384
|
+
- If a sidebar opens from another sidebar, show a back arrow to return to the previous sidebar.
|
|
385
|
+
- Fixed footer at the bottom.
|
|
386
|
+
- Footer usually contains save, cancel/close, and delete actions.
|
|
387
|
+
- Footer can also contain a copy button or auxiliary text.
|
|
388
|
+
- Content can be flexible, but should stay compact.
|
|
389
|
+
- Small tables can be placed in sidebars.
|
|
390
|
+
|
|
391
|
+
Avoid in sidebars:
|
|
392
|
+
|
|
393
|
+
- collapse blocks;
|
|
394
|
+
- two-column content on separate surfaces;
|
|
395
|
+
- bulky or complex interfaces.
|
|
396
|
+
|
|
397
|
+
For bulky flows, use a full page or modal window instead.
|
|
398
|
+
|
|
399
|
+
Recommended components:
|
|
400
|
+
|
|
401
|
+
- `UiModalSidebar`
|
|
402
|
+
- `UiButton`
|
|
403
|
+
- `UiTag`
|
|
404
|
+
- `UiField`
|
|
405
|
+
- `UiTextbox`
|
|
406
|
+
- `UiSelect`
|
|
407
|
+
- `UiTable` only for small, simple tables
|
|
408
|
+
|
|
409
|
+
## Modal Window
|
|
410
|
+
|
|
411
|
+
Use this pattern for large contextual tables or additional local settings when a sidebar is not enough.
|
|
412
|
+
|
|
413
|
+

|
|
414
|
+
|
|
415
|
+
Examples from the design:
|
|
416
|
+
|
|
417
|
+
- adding products to an order;
|
|
418
|
+
- marking products in an order;
|
|
419
|
+
- viewing an email from the communication list;
|
|
420
|
+
- merging duplicates in the database cleanliness section.
|
|
421
|
+
|
|
422
|
+
Size rules:
|
|
423
|
+
|
|
424
|
+
- Modal can use two sizes:
|
|
425
|
+
- `960px`;
|
|
426
|
+
- full screen with side margins.
|
|
427
|
+
|
|
428
|
+
Expected structure:
|
|
429
|
+
|
|
430
|
+
- Fixed header at the top with title and close button.
|
|
431
|
+
- Header can include extra text, icon, button, or tag.
|
|
432
|
+
- Fixed footer at the bottom.
|
|
433
|
+
- Footer usually contains save, cancel/close, and delete actions.
|
|
434
|
+
- Footer can also contain a copy button or auxiliary text.
|
|
435
|
+
- Content can be flexible; tables are a common modal use case.
|
|
436
|
+
- If a modal contains a table, the table stretches across the modal width.
|
|
437
|
+
- If a modal is split into sections, use large tabs instead of a regular modal header.
|
|
438
|
+
|
|
439
|
+
Spacing rules:
|
|
440
|
+
|
|
441
|
+
- Left, right, and bottom margins: 32px.
|
|
442
|
+
- Top margin: 24px.
|
|
443
|
+
|
|
444
|
+
Recommended components:
|
|
445
|
+
|
|
446
|
+
- `UiModalWindow`
|
|
447
|
+
- `UiButton`
|
|
448
|
+
- `UiTabGroup`
|
|
449
|
+
- `UiTab`
|
|
450
|
+
- `UiTable`
|
|
451
|
+
- `UiTableColumn`
|
|
452
|
+
- `UiTableFooterSection`
|
|
453
|
+
|
|
454
|
+
## Quick Decision Guide
|
|
455
|
+
|
|
456
|
+
- Need a searchable, filterable registry: use an entity list page.
|
|
457
|
+
- Need to edit an entity or settings form: use a card/settings page.
|
|
458
|
+
- Need several semantic blocks visible together: use a multi-column page.
|
|
459
|
+
- Need grouped settings with independent sections: use a collapse-block page.
|
|
460
|
+
- Need a small contextual form or compact entity card: use a modal sidebar.
|
|
461
|
+
- Need a large local workflow, auxiliary table, or dense settings flow: use a modal window.
|
|
462
|
+
|
|
463
|
+
When uncertain between sidebar and modal, choose sidebar only if the flow is compact. If the content needs wide tables, several sections, or complex controls, choose modal or full page.
|
package/docs/AI.md
CHANGED
|
@@ -10,7 +10,7 @@ Only the public package contract is described below, without depending on the re
|
|
|
10
10
|
- Package name: `@retailcrm/embed-ui-v1-components`
|
|
11
11
|
- Purpose: UI components and UI helpers for RetailCRM JS extensions
|
|
12
12
|
- Framework: Vue 3
|
|
13
|
-
- Published Storybook: `https://retailcrm.github.io/embed-ui/v1-components/0.9.
|
|
13
|
+
- Published Storybook: `https://retailcrm.github.io/embed-ui/v1-components/0.9.18/`
|
|
14
14
|
- Primary public entrypoints:
|
|
15
15
|
- `@retailcrm/embed-ui-v1-components/remote`
|
|
16
16
|
- `@retailcrm/embed-ui-v1-components/host`
|
|
@@ -28,11 +28,33 @@ Only the public package contract is described below, without depending on the re
|
|
|
28
28
|
|
|
29
29
|
When generating UI code, use this order:
|
|
30
30
|
|
|
31
|
-
1. read [`
|
|
32
|
-
2.
|
|
33
|
-
3.
|
|
34
|
-
4.
|
|
35
|
-
5.
|
|
31
|
+
1. read [`../README.md`](../README.md) and [`../AGENTS.md`](../AGENTS.md) for package-level usage rules;
|
|
32
|
+
2. read [`COMPONENTS.md`](./COMPONENTS.md) to identify candidate components;
|
|
33
|
+
3. open a detailed profile from [`PROFILES.md`](./PROFILES.md) if one exists;
|
|
34
|
+
4. use the profile `usage` link for published Storybook examples and visual behavior;
|
|
35
|
+
5. read [`AGENT-DESIGN-GUIDELINES.md`](./AGENT-DESIGN-GUIDELINES.md) when the task is about complete
|
|
36
|
+
pages, modals, sidebars, filters, tables, or settings layouts;
|
|
37
|
+
6. use [`FORMAT.md`](./FORMAT.md) as the schema for what information is considered reliable;
|
|
38
|
+
7. read [`STYLING.md`](./STYLING.md) when the task is about classes, variables, typography, or visual zones;
|
|
39
|
+
8. if no profile exists yet, fall back to [Storybook](https://retailcrm.github.io/embed-ui/v1-components/0.9.18/) docs and public type declarations, and state any inference explicitly.
|
|
40
|
+
|
|
41
|
+
## Runtime Embedding References
|
|
42
|
+
|
|
43
|
+
When generating code for a CRM extension, separate UI component choice from runtime placement:
|
|
44
|
+
|
|
45
|
+
- [`targets` and contexts](../../v1-endpoint/docs/targets.md): explains that `target` is the CRM
|
|
46
|
+
embedding point, while `context` is the reactive CRM data available at that point.
|
|
47
|
+
- [`menu placements`](../../v1-endpoint/docs/menu-placements.md): explains how host/manifest menu
|
|
48
|
+
items map to remote page codes.
|
|
49
|
+
- [`page routes`](../../v1-endpoint/docs/page-routes.md): explains how page `code`, CRM route names,
|
|
50
|
+
and `definePageRunner` are connected.
|
|
51
|
+
- [`defineWidgetRunner`](../../v1-endpoint/docs/define-widget-runner.md): shows how a widget receives
|
|
52
|
+
the current `target` prop.
|
|
53
|
+
- [`definePageRunner`](../../v1-endpoint/docs/define-page-runner.md): shows how a page receives the
|
|
54
|
+
current `code` prop.
|
|
55
|
+
- [`context concept`](../../v1-contexts/docs/ru/CONCEPT.md): explains predefined CRM contexts such as
|
|
56
|
+
`order/card`, `customer/card`, `user/current`, and `settings`.
|
|
57
|
+
- [`custom context`](../../v1-contexts/docs/ru/CUSTOM.md): explains custom-field contexts.
|
|
36
58
|
|
|
37
59
|
## Default Recommendation For Common Forms
|
|
38
60
|
|
|
@@ -55,6 +77,64 @@ Typical compositions:
|
|
|
55
77
|
- `UiPageHeader` + `UiButton`
|
|
56
78
|
- `UiSelect` + `UiSelectOption`
|
|
57
79
|
|
|
80
|
+
## Default Recommendation For Full Screens
|
|
81
|
+
|
|
82
|
+
When building a complete extension screen, prioritize a working operational interface over a
|
|
83
|
+
decorative landing page.
|
|
84
|
+
|
|
85
|
+
Default screen rules:
|
|
86
|
+
|
|
87
|
+
- use [`AGENT-DESIGN-GUIDELINES.md`](./AGENT-DESIGN-GUIDELINES.md) to choose between an entity list,
|
|
88
|
+
card/settings page, multi-column page, collapse-block page, modal sidebar, or modal window;
|
|
89
|
+
- use `UiPageHeader` for page identity and top-level actions;
|
|
90
|
+
- keep filters and controls near the content they affect;
|
|
91
|
+
- use `UiField` around labeled form controls;
|
|
92
|
+
- use `UiTable` for structured result lists;
|
|
93
|
+
- use `UiLink` for navigation and inline links, `UiButton` for commands;
|
|
94
|
+
- use `UiLoader` with `overlay: true` when loading should dim the covered page or module content;
|
|
95
|
+
- keep public imports on `@retailcrm/embed-ui-v1-components/remote`;
|
|
96
|
+
- avoid custom markup that recreates textbox, select, button, link, or table chrome.
|
|
97
|
+
|
|
98
|
+
## Default Recommendation For Table Screens
|
|
99
|
+
|
|
100
|
+
When building a registry, catalog, journal, search result, order list, customer list, or any
|
|
101
|
+
screen where users scan and refine datasets:
|
|
102
|
+
|
|
103
|
+
- put search and filters directly above `UiTable`;
|
|
104
|
+
- use `UiTextbox` for free-text search and `UiSelect` or compact toggle controls for finite filters;
|
|
105
|
+
- keep filters, sorting, page, and page size in GET query parameters when the host app has routing;
|
|
106
|
+
- hydrate initial filter and pagination state from the current query;
|
|
107
|
+
- reset `page` to `1` when filters or sorting change;
|
|
108
|
+
- debounce free-text search before writing query or fetching data;
|
|
109
|
+
- use `UiTableSorter` for sortable headers;
|
|
110
|
+
- use `UiTable` footer slots for summary, page-size controls, export, and pagination;
|
|
111
|
+
- compose table footer controls with `UiTableFooterSection` and `UiTableFooterButton`, not regular `UiButton`;
|
|
112
|
+
- use chevron icon assets for table footer previous/next controls instead of text glyphs;
|
|
113
|
+
- add local CSS for table footer layout and states; use `AGENT-DESIGN-GUIDELINES.md` for the canonical footer CSS contract;
|
|
114
|
+
- set `size="small"` on `UiLink` inside table cells so links match table body typography.
|
|
115
|
+
|
|
116
|
+
Suggested query names:
|
|
117
|
+
|
|
118
|
+
- `q` for text search;
|
|
119
|
+
- `status`, `managerId`, `dateFrom`, `dateTo` for filters;
|
|
120
|
+
- `sort` and `direction` for sorting;
|
|
121
|
+
- `page` and `pageSize` for pagination.
|
|
122
|
+
|
|
123
|
+
## External Documentation Patterns
|
|
124
|
+
|
|
125
|
+
These references are useful when extending the profiles and examples in this package:
|
|
126
|
+
|
|
127
|
+
- [shadcn/ui Data Table source](https://github.com/shadcn-ui/ui/blob/main/apps/v4/content/docs/components/radix/data-table.mdx)
|
|
128
|
+
documents a scenario-first table build: base table, row actions, pagination, sorting,
|
|
129
|
+
filtering, visibility, row selection, and reusable table pieces.
|
|
130
|
+
- [Nuxt UI v4 Table source](https://github.com/nuxt/ui/blob/v4/docs/content/docs/2.components/table.md)
|
|
131
|
+
documents table state, sorting, pagination, loading, empty state, slots, and advanced flows.
|
|
132
|
+
- [Nuxt UI v2 Table source](https://github.com/nuxt/ui/blob/v2/docs/content/2.components/table.md)
|
|
133
|
+
is useful for explicit searchable, paginable, manual sorting, and reactive query examples.
|
|
134
|
+
- [PrimeVue DataTable docs](https://primevue.org/datatable/)
|
|
135
|
+
are useful for Vue table patterns around filtering, pagination, selection, lazy loading, empty,
|
|
136
|
+
loading, and accessibility.
|
|
137
|
+
|
|
58
138
|
## What AI Needs In A Good Component Profile
|
|
59
139
|
|
|
60
140
|
The most useful format for AI is a component profile that explicitly answers:
|
|
@@ -100,7 +180,10 @@ The preferred styling signal is:
|
|
|
100
180
|
## Related Public Docs
|
|
101
181
|
|
|
102
182
|
- [`README.md`](./README.md)
|
|
183
|
+
- [`../README.md`](../README.md)
|
|
184
|
+
- [`../AGENTS.md`](../AGENTS.md)
|
|
103
185
|
- [`COMPONENTS.md`](./COMPONENTS.md)
|
|
104
186
|
- [`FORMAT.md`](./FORMAT.md)
|
|
105
187
|
- [`STYLING.md`](./STYLING.md)
|
|
188
|
+
- [`AGENT-DESIGN-GUIDELINES.md`](./AGENT-DESIGN-GUIDELINES.md)
|
|
106
189
|
- [`../AGENTS.md`](../AGENTS.md)
|
package/docs/FORMAT.md
CHANGED
|
@@ -19,12 +19,17 @@ A good profile should let an agent answer these questions without opening the so
|
|
|
19
19
|
|
|
20
20
|
Recommended filename: `<ComponentName>.yml`
|
|
21
21
|
|
|
22
|
+
Top-level `usage` should point to the published Storybook docs page for version `0.9.18`.
|
|
23
|
+
If the component is a subcomponent without its own Storybook page, point `usage` to the nearest
|
|
24
|
+
parent or composition page that demonstrates it, for example table parts point to `UiTable`.
|
|
25
|
+
|
|
22
26
|
Minimal shape:
|
|
23
27
|
|
|
24
28
|
```yml
|
|
25
29
|
component: UiComponent
|
|
26
30
|
summary: >
|
|
27
31
|
A short description of the component.
|
|
32
|
+
usage: https://retailcrm.github.io/embed-ui/v1-components/0.9.18/?path=/docs/intro--docs
|
|
28
33
|
|
|
29
34
|
public_import:
|
|
30
35
|
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
@@ -77,12 +82,6 @@ styling:
|
|
|
77
82
|
line_height: 24px
|
|
78
83
|
weight: 400
|
|
79
84
|
|
|
80
|
-
examples:
|
|
81
|
-
- title: Basic example
|
|
82
|
-
goal: What the user or the agent is trying to build.
|
|
83
|
-
code: |
|
|
84
|
-
<UiComponent />
|
|
85
|
-
|
|
86
85
|
ai_notes:
|
|
87
86
|
do:
|
|
88
87
|
- rule
|
|
@@ -220,15 +219,17 @@ Capture:
|
|
|
220
219
|
- what happens to `aria-invalid`, `aria-labelledby`, `role`, `aria-expanded`, and similar attributes;
|
|
221
220
|
- which keys affect behavior, if that behavior is documented.
|
|
222
221
|
|
|
223
|
-
## 11. `
|
|
222
|
+
## 11. `composition`
|
|
224
223
|
|
|
225
224
|
List:
|
|
226
225
|
|
|
227
226
|
- common combinations;
|
|
228
227
|
- required neighboring components;
|
|
229
228
|
- safe defaults for typical screens;
|
|
230
|
-
-
|
|
231
|
-
|
|
229
|
+
- correct and incorrect composition patterns.
|
|
230
|
+
|
|
231
|
+
Do not duplicate Storybook examples in YAML profiles. The top-level `usage` link is the source for runnable
|
|
232
|
+
examples and visual behavior.
|
|
232
233
|
|
|
233
234
|
## 12. `ai_notes`
|
|
234
235
|
|
|
@@ -244,6 +245,7 @@ A short list of rules specifically for code generation:
|
|
|
244
245
|
- Use the exact names of props, emits, and slots.
|
|
245
246
|
- For slots, describe not only the name, but also what the slot does and which content restrictions exist.
|
|
246
247
|
- For styling, distinguish between safe CSS variables and descriptive class names.
|
|
248
|
+
- Keep runnable examples in Storybook; YAML profiles should link to Storybook through `usage`.
|
|
247
249
|
- Do not mix "how the component looks right now" with "what is publicly guaranteed".
|
|
248
250
|
- If behavior is inferred from implementation rather than public API, say that explicitly.
|
|
249
251
|
- If information is missing, state the limitation rather than inventing details.
|
package/docs/PROFILES.md
CHANGED
|
@@ -6,7 +6,7 @@ The current profile layer is structured like this:
|
|
|
6
6
|
|
|
7
7
|
- the index stays in markdown so both humans and agents can navigate it easily;
|
|
8
8
|
- the actual profiles live in `docs/profiles/*.yml`;
|
|
9
|
-
- YAML is the source of truth for structure, props, slots, emits,
|
|
9
|
+
- YAML is the source of truth for structure, props, slots, emits, composition, and AI rules.
|
|
10
10
|
|
|
11
11
|
## Table Of Contents
|
|
12
12
|
|
|
@@ -18,9 +18,11 @@ The current profile layer is structured like this:
|
|
|
18
18
|
|
|
19
19
|
## Reading Order
|
|
20
20
|
|
|
21
|
-
1. [
|
|
22
|
-
2.
|
|
23
|
-
3.
|
|
21
|
+
1. [`../README.md`](../README.md)
|
|
22
|
+
2. [`../AGENTS.md`](../AGENTS.md)
|
|
23
|
+
3. [`AI.md`](./AI.md)
|
|
24
|
+
4. this index
|
|
25
|
+
5. the relevant `.yml` profile
|
|
24
26
|
|
|
25
27
|
## Current Coverage
|
|
26
28
|
|
|
@@ -30,6 +32,7 @@ Use these entrypoints:
|
|
|
30
32
|
|
|
31
33
|
- [`COMPONENTS.md`](./COMPONENTS.md) for the full linked component index
|
|
32
34
|
- `docs/profiles/*.yml` for per-component machine-readable profiles
|
|
35
|
+
- each profile `usage` field for published Storybook 0.9.18 examples and visual behavior
|
|
33
36
|
|
|
34
37
|
Current high-signal core profiles:
|
|
35
38
|
|
|
@@ -53,7 +56,7 @@ Current high-signal core profiles:
|
|
|
53
56
|
- `props` if you need a broader practical API view.
|
|
54
57
|
- `slots` if the task is about markup, zones, and allowed content.
|
|
55
58
|
- `emits` if the component must be wired into screen logic.
|
|
56
|
-
- `
|
|
59
|
+
- `usage` if you need Storybook examples or visual behavior.
|
|
57
60
|
- `ai_notes` if the agent needs safe defaults and anti-patterns.
|
|
58
61
|
|
|
59
62
|
## Styling Reads
|
|
@@ -64,3 +67,4 @@ Current high-signal core profiles:
|
|
|
64
67
|
## Notes
|
|
65
68
|
|
|
66
69
|
- All new updates should be made in YAML profiles.
|
|
70
|
+
- Keep profile `usage` links on the Storybook 0.9.18 URL unless another version is required explicitly.
|