@retailcrm/embed-ui-v1-components 0.9.24 → 0.9.25
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 +1 -0
- package/README.md +9 -0
- package/bin/embed-ui-v1-components.mjs +52 -3
- package/bin/postinstall.mjs +3 -0
- package/docs/AI.md +23 -1
- package/docs/FORMAT.md +1 -0
- package/docs/STYLING.md +37 -1
- package/docs/profiles/components/UiField.yml +64 -10
- package/docs/profiles/components/UiModalSidebar.yml +22 -6
- package/docs/profiles/components/UiSelect.yml +8 -0
- package/docs/profiles/components/UiSelectOption.yml +2 -0
- package/docs/profiles/components/UiSwitch.yml +68 -2
- package/docs/profiles/components/UiTable.yml +76 -0
- package/docs/profiles/components/UiTooltip.yml +1 -0
- package/docs/profiles/pages/CardSettingsPage.yml +3 -0
- package/docs/profiles/pages/EntityListPage.yml +6 -0
- package/docs/profiles/pages/ModalSidebar.yml +40 -12
- package/docs/profiles/pages/MultiColumnPage.yml +2 -0
- package/docs/profiles/pages/PageComposition.yml +3 -0
- package/package.json +3 -2
- package/templates/skills/embed-ui-v1-components-ui/SKILL.md.txt +46 -0
package/AGENTS.md
CHANGED
|
@@ -70,6 +70,7 @@ Commonly used exports from `remote` include:
|
|
|
70
70
|
- Prefer package public exports over reimplementing CRM-styled controls manually.
|
|
71
71
|
- Match component choice to semantics:
|
|
72
72
|
use `UiField` for labeled form controls, `UiAlert` for state messages, `UiPageHeader` for page-level headings.
|
|
73
|
+
- When a component uses only the default slot, prefer the `v-slot` directive on the component instead of `<template #default>`.
|
|
73
74
|
- For widget targets, keep inline UI compact: prefer `UiToolbarButton`, `UiToolbarLink`, short text, and icons.
|
|
74
75
|
- Move complex widget UI into `UiModalSidebar` or `UiModalWindow` instead of expanding the target slot.
|
|
75
76
|
- Keep imports on the public package boundary.
|
package/README.md
CHANGED
|
@@ -68,3 +68,12 @@ npx @retailcrm/embed-ui-v1-components init-agents
|
|
|
68
68
|
Если `AGENTS.md` уже существует, команда допишет в конец инструкции для
|
|
69
69
|
`@retailcrm/embed-ui-v1-components`, если такого блока там еще нет. С `--force`
|
|
70
70
|
можно обновить уже существующий блок пакета.
|
|
71
|
+
|
|
72
|
+
Для project-level skills можно создать `.agents/skills/embed-ui-v1-components-ui/SKILL.md`:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx @retailcrm/embed-ui-v1-components init-skills
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Skill описывает повторяемый workflow для выбора page pattern, чтения профилей компонентов,
|
|
79
|
+
проверки styling constraints и ревью table pagination/form/widget composition.
|
|
@@ -10,9 +10,12 @@ const DEFAULT_NEWLINE = '\n'
|
|
|
10
10
|
const AGENTS_SECTION_HEADER = '## @retailcrm/embed-ui-v1-components'
|
|
11
11
|
const AGENTS_SECTION_START = '<!-- embed-ui-agents:start -->'
|
|
12
12
|
const AGENTS_SECTION_END = '<!-- embed-ui-agents:end -->'
|
|
13
|
+
const SKILL_NAME = 'embed-ui-v1-components-ui'
|
|
14
|
+
const SKILL_TEMPLATE_PATH = `templates/skills/${SKILL_NAME}/SKILL.md.txt`
|
|
13
15
|
|
|
14
16
|
const HELP_TEXT = `Usage:
|
|
15
17
|
npx ${PACKAGE_NAME} init-agents [target] [options]
|
|
18
|
+
npx ${PACKAGE_NAME} init-skills [target] [options]
|
|
16
19
|
|
|
17
20
|
Options:
|
|
18
21
|
-f, --force Replace existing package section in AGENTS.md
|
|
@@ -20,6 +23,7 @@ Options:
|
|
|
20
23
|
|
|
21
24
|
Examples:
|
|
22
25
|
npx ${PACKAGE_NAME} init-agents
|
|
26
|
+
npx ${PACKAGE_NAME} init-skills
|
|
23
27
|
npx ${PACKAGE_NAME} init-agents ./my-project
|
|
24
28
|
npx ${PACKAGE_NAME} init-agents --force
|
|
25
29
|
`
|
|
@@ -250,6 +254,14 @@ ${AGENTS_SECTION_END}
|
|
|
250
254
|
`
|
|
251
255
|
}
|
|
252
256
|
|
|
257
|
+
const createSkill = (target, packageDocsPath) => {
|
|
258
|
+
const packageRoot = getCurrentPackageRoot() ?? findPackageRoot(target)
|
|
259
|
+
const templatePath = path.join(packageRoot, SKILL_TEMPLATE_PATH)
|
|
260
|
+
const template = fs.readFileSync(templatePath, 'utf8')
|
|
261
|
+
|
|
262
|
+
return template.replaceAll('__PACKAGE_DOCS_PATH__', packageDocsPath)
|
|
263
|
+
}
|
|
264
|
+
|
|
253
265
|
const findMarkedSectionRange = (content) => {
|
|
254
266
|
const start = content.indexOf(AGENTS_SECTION_START)
|
|
255
267
|
const end = content.indexOf(AGENTS_SECTION_END, start + AGENTS_SECTION_START.length)
|
|
@@ -381,15 +393,52 @@ const initAgents = (target, force) => {
|
|
|
381
393
|
console.log(`The ${PACKAGE_NAME} instructions were appended to the end of the file.`)
|
|
382
394
|
}
|
|
383
395
|
|
|
396
|
+
const initSkills = (target, force) => {
|
|
397
|
+
if (!fs.existsSync(target)) {
|
|
398
|
+
throw new Error(`Target path does not exist: ${target}`)
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
const stat = fs.statSync(target)
|
|
402
|
+
|
|
403
|
+
if (!stat.isDirectory()) {
|
|
404
|
+
throw new Error(`Target path is not a directory: ${target}`)
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const packageDocsPath = createPackageDocsPath(target)
|
|
408
|
+
const skillPath = path.join(target, '.agents', 'skills', SKILL_NAME, 'SKILL.md')
|
|
409
|
+
const fileExists = fs.existsSync(skillPath)
|
|
410
|
+
|
|
411
|
+
if (fileExists && !force) {
|
|
412
|
+
console.log(`${skillPath} already exists`)
|
|
413
|
+
console.log('Nothing was changed. Re-run with --force to refresh that skill.')
|
|
414
|
+
return
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
if (!fs.existsSync(path.dirname(skillPath))) {
|
|
418
|
+
fs.mkdirSync(path.dirname(skillPath), { recursive: true })
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
fs.writeFileSync(skillPath, createSkill(target, packageDocsPath), 'utf8')
|
|
422
|
+
|
|
423
|
+
const action = fileExists ? 'updated' : 'created'
|
|
424
|
+
console.log(`SKILL: ${action} ${skillPath}`)
|
|
425
|
+
}
|
|
426
|
+
|
|
384
427
|
const main = () => {
|
|
385
428
|
try {
|
|
386
429
|
const options = parseArgs(process.argv.slice(2))
|
|
387
430
|
|
|
388
|
-
if (options.command
|
|
389
|
-
|
|
431
|
+
if (options.command === 'init-agents') {
|
|
432
|
+
initAgents(options.target, options.force)
|
|
433
|
+
return
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
if (options.command === 'init-skills') {
|
|
437
|
+
initSkills(options.target, options.force)
|
|
438
|
+
return
|
|
390
439
|
}
|
|
391
440
|
|
|
392
|
-
|
|
441
|
+
throw new Error(`Unknown command: ${options.command}`)
|
|
393
442
|
} catch (error) {
|
|
394
443
|
console.error(error instanceof Error ? error.message : String(error))
|
|
395
444
|
console.error('')
|
package/bin/postinstall.mjs
CHANGED
|
@@ -33,6 +33,9 @@ console.log(`[${PACKAGE_NAME}] Component profiles live in docs/profiles/componen
|
|
|
33
33
|
if (!hasAgentsFile) {
|
|
34
34
|
console.log(`[${PACKAGE_NAME}] To scaffold AGENTS.md for this project, run:`)
|
|
35
35
|
console.log(` npx ${PACKAGE_NAME} init-agents`)
|
|
36
|
+
console.log(`[${PACKAGE_NAME}] To install project-level skills, run:`)
|
|
37
|
+
console.log(` npx ${PACKAGE_NAME} init-skills`)
|
|
36
38
|
} else {
|
|
37
39
|
console.log(`[${PACKAGE_NAME}] AGENTS.md already exists in this project, so no scaffold was created automatically`)
|
|
40
|
+
console.log(`[${PACKAGE_NAME}] Project-level skills can be installed with: npx ${PACKAGE_NAME} init-skills`)
|
|
38
41
|
}
|
package/docs/AI.md
CHANGED
|
@@ -91,12 +91,14 @@ Default screen rules:
|
|
|
91
91
|
- use `UiPageFooter` for page-level save/cancel/delete actions instead of recreating a local footer;
|
|
92
92
|
- use one `Success Primary` button for the strongest save/apply/create action that commits a result; use `Default Primary`
|
|
93
93
|
only for another important action with a different meaning;
|
|
94
|
+
- apply the 24px top and 32px side/bottom padding rule to white content surfaces, not to the page root wrapper;
|
|
94
95
|
- keep filters and controls near the content they affect;
|
|
95
96
|
- use `UiField` around labeled form controls;
|
|
96
97
|
- use `UiTable` for structured result lists;
|
|
97
98
|
- use `UiLink` for navigation and inline links, `UiButton` for commands;
|
|
98
99
|
- use `UiLoader` with `overlay: true` when loading should dim the covered page or module content;
|
|
99
100
|
- keep public imports on `@retailcrm/embed-ui-v1-components/remote`;
|
|
101
|
+
- when a component uses only the default slot, prefer `v-slot` on the component instead of `<template #default>`;
|
|
100
102
|
- avoid custom markup that recreates textbox, select, button, link, or table chrome.
|
|
101
103
|
|
|
102
104
|
## Default Recommendation For Table Screens
|
|
@@ -105,6 +107,8 @@ When building a registry, catalog, journal, search result, order list, customer
|
|
|
105
107
|
screen where users scan and refine datasets:
|
|
106
108
|
|
|
107
109
|
- put search and filters directly above `UiTable`;
|
|
110
|
+
- do not wrap `UiTable` in an extra white card or padded content surface;
|
|
111
|
+
- use a plain layout or scroll wrapper around `UiTable` only when width or overflow control is needed;
|
|
108
112
|
- use `UiTextbox` for free-text search and `UiSelect` or compact toggle controls for finite filters;
|
|
109
113
|
- keep filters, sorting, page, and page size in GET query parameters when the host app has routing;
|
|
110
114
|
- hydrate initial filter and pagination state from the current query;
|
|
@@ -116,7 +120,9 @@ screen where users scan and refine datasets:
|
|
|
116
120
|
- use chevron icon assets for table footer previous/next controls instead of text glyphs;
|
|
117
121
|
- add local CSS for table footer layout and states; use [`UiTable.yml`](./profiles/components/UiTable.yml)
|
|
118
122
|
for the reference table footer example;
|
|
119
|
-
- set `size="small"` on `UiLink` inside table cells so links match table body typography
|
|
123
|
+
- set `size="small"` on `UiLink` inside table cells so links match table body typography;
|
|
124
|
+
- prefer icon-only row action buttons inside dense table rows; keep the same action text in
|
|
125
|
+
`aria-label` and `UiTooltip`.
|
|
120
126
|
|
|
121
127
|
Suggested query names:
|
|
122
128
|
|
|
@@ -125,6 +131,22 @@ Suggested query names:
|
|
|
125
131
|
- `sort` and `direction` for sorting;
|
|
126
132
|
- `page` and `pageSize` for pagination.
|
|
127
133
|
|
|
134
|
+
## Default Recommendation For Forms
|
|
135
|
+
|
|
136
|
+
When building forms with remote controls:
|
|
137
|
+
|
|
138
|
+
- use `v-model:value` for value-bearing controls such as `UiTextbox`, `UiSelect`, `UiNumberStepper`,
|
|
139
|
+
and `UiSwitch`;
|
|
140
|
+
- if a field looks filled but backend validation receives an empty value, check the Network payload
|
|
141
|
+
before changing the component binding;
|
|
142
|
+
- use `UiField` for labeled text, select, date, and number controls;
|
|
143
|
+
- forward `UiField` slot props into the actual child control when it accepts `id`, especially
|
|
144
|
+
`UiTextbox`, `UiSelect`, and `UiNumberStepper`;
|
|
145
|
+
- when a component uses only the default slot, prefer `v-slot` on the component instead of
|
|
146
|
+
`<template #default>`;
|
|
147
|
+
- do not wrap `UiSwitch` in `UiField`; place the switch next to a visible label and optional hint,
|
|
148
|
+
and connect `UiSwitch :id` with `label :for`.
|
|
149
|
+
|
|
128
150
|
## Default Recommendation For Widgets
|
|
129
151
|
|
|
130
152
|
When building a widget mounted into a CRM target, keep the inline target UI compact and predictable:
|
package/docs/FORMAT.md
CHANGED
|
@@ -242,6 +242,7 @@ A short list of rules specifically for code generation:
|
|
|
242
242
|
- Use short, concrete statements instead of vague praise.
|
|
243
243
|
- Use the exact names of props, emits, and slots.
|
|
244
244
|
- For slots, describe not only the name, but also what the slot does and which content restrictions exist.
|
|
245
|
+
- In examples with only a default slot, prefer `v-slot` on the component instead of `<template #default>`.
|
|
245
246
|
- For styling, distinguish between safe CSS variables and descriptive class names.
|
|
246
247
|
- Keep runnable examples in YAML profiles when they clarify safe public usage.
|
|
247
248
|
- Do not mix "how the component looks right now" with "what is publicly guaranteed".
|
package/docs/STYLING.md
CHANGED
|
@@ -77,6 +77,13 @@ Base font family:
|
|
|
77
77
|
|
|
78
78
|
- `-apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Roboto", sans-serif`
|
|
79
79
|
|
|
80
|
+
Extension UI should normally not set `font-family` in local styles. Let the CRM host and Embed UI
|
|
81
|
+
components inherit the shared stack.
|
|
82
|
+
|
|
83
|
+
If a local style must set `font-family`, use the shared stack above exactly. Do not replace it with
|
|
84
|
+
Arial, Inter, Roboto-only, or another custom stack unless the task or project `AGENTS.md` records a
|
|
85
|
+
project-specific design requirement.
|
|
86
|
+
|
|
80
87
|
Main sizes:
|
|
81
88
|
|
|
82
89
|
- `h1`: `40px / 44px`
|
|
@@ -125,6 +132,21 @@ Profiles split CSS variables into practical groups:
|
|
|
125
132
|
- `internal_layout_variables`
|
|
126
133
|
useful for reasoning and debugging, but not recommended as external override points.
|
|
127
134
|
|
|
135
|
+
## State Styling
|
|
136
|
+
|
|
137
|
+
Interactive states should come from the component implementation, documented props, and documented
|
|
138
|
+
CSS variables.
|
|
139
|
+
|
|
140
|
+
For controls such as `UiSelect`, `UiTextbox`, and buttons:
|
|
141
|
+
|
|
142
|
+
- do not add custom selected, active, focused, pressed, or invalid outlines/borders just because a
|
|
143
|
+
state is visible in Figma or CRM;
|
|
144
|
+
- first check the component profile for the exact root/state classes, zones, CSS variables, and
|
|
145
|
+
notes about safe overrides;
|
|
146
|
+
- use documented variables or local wrapper styles only when the profile says that pattern is safe;
|
|
147
|
+
- if design review asks for a state that the profile does not document, treat it as a project-specific
|
|
148
|
+
requirement and record that requirement before changing CSS.
|
|
149
|
+
|
|
128
150
|
## Typical Safe Strategy
|
|
129
151
|
|
|
130
152
|
For style-sensitive generation:
|
|
@@ -132,7 +154,21 @@ For style-sensitive generation:
|
|
|
132
154
|
1. choose the correct component and size prop first;
|
|
133
155
|
2. use documented slots to create the right visual zones;
|
|
134
156
|
3. use documented CSS variables if a theme override is needed;
|
|
135
|
-
4. avoid relying on internal descendant selectors unless the profile says that is safe
|
|
157
|
+
4. avoid relying on internal descendant selectors unless the profile says that is safe;
|
|
158
|
+
5. state which styling source is being followed when the change was requested by design feedback.
|
|
159
|
+
|
|
160
|
+
## Design Feedback Triage
|
|
161
|
+
|
|
162
|
+
When design feedback does not match the current implementation, resolve the source before editing:
|
|
163
|
+
|
|
164
|
+
1. check public RetailCRM docs, local package docs, the component profile, the page profile, this
|
|
165
|
+
`STYLING.md`, Figma, and CRM computed styles when available;
|
|
166
|
+
2. if Embed UI docs describe the rule, follow the documented rule or update the component profile
|
|
167
|
+
before relying on source-code internals;
|
|
168
|
+
3. if Embed UI docs do not describe the requested rule, treat it as a project-specific design
|
|
169
|
+
requirement;
|
|
170
|
+
4. record project-specific values in the task text or project `AGENTS.md`;
|
|
171
|
+
5. when sources conflict, state the chosen source before changing markup or CSS.
|
|
136
172
|
|
|
137
173
|
## How To Mention Styles In Profiles
|
|
138
174
|
|
|
@@ -13,22 +13,21 @@ related_components:
|
|
|
13
13
|
- UiTextbox
|
|
14
14
|
- UiSelect
|
|
15
15
|
- UiCheckbox
|
|
16
|
+
- UiNumberStepper
|
|
16
17
|
- UiDatePicker
|
|
17
18
|
|
|
18
19
|
examples:
|
|
19
20
|
- title: Basic usage
|
|
20
21
|
code: |
|
|
21
22
|
<template>
|
|
22
|
-
<UiField id="name-field" label="Name" hint="At least 3 characters">
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/>
|
|
31
|
-
</template>
|
|
23
|
+
<UiField v-slot="field" id="name-field" label="Name" hint="At least 3 characters">
|
|
24
|
+
<UiTextbox
|
|
25
|
+
:id="field.id"
|
|
26
|
+
:input-attributes="{
|
|
27
|
+
'aria-labelledby': field.ariaLabelledby,
|
|
28
|
+
'aria-invalid': field.ariaInvalid,
|
|
29
|
+
}"
|
|
30
|
+
/>
|
|
32
31
|
</UiField>
|
|
33
32
|
</template>
|
|
34
33
|
|
|
@@ -61,6 +60,56 @@ examples:
|
|
|
61
60
|
<script lang="ts" setup>
|
|
62
61
|
import { UiField, UiTextbox } from '@retailcrm/embed-ui-v1-components/remote'
|
|
63
62
|
</script>
|
|
63
|
+
- title: Select inside a field
|
|
64
|
+
code: |
|
|
65
|
+
<template>
|
|
66
|
+
<UiField v-slot="field" id="manager-field" label="Manager">
|
|
67
|
+
<UiSelect
|
|
68
|
+
:id="field.id"
|
|
69
|
+
v-model:value="manager"
|
|
70
|
+
:invalid="field.ariaInvalid === 'true'"
|
|
71
|
+
placeholder="Select manager"
|
|
72
|
+
>
|
|
73
|
+
<UiSelectOption value="anna" label="Anna Smith" />
|
|
74
|
+
<UiSelectOption value="ilya" label="Ilya Johnson" />
|
|
75
|
+
</UiSelect>
|
|
76
|
+
</UiField>
|
|
77
|
+
</template>
|
|
78
|
+
|
|
79
|
+
<script lang="ts" setup>
|
|
80
|
+
import { ref } from 'vue'
|
|
81
|
+
|
|
82
|
+
import {
|
|
83
|
+
UiField,
|
|
84
|
+
UiSelect,
|
|
85
|
+
UiSelectOption,
|
|
86
|
+
} from '@retailcrm/embed-ui-v1-components/remote'
|
|
87
|
+
|
|
88
|
+
const manager = ref<string | null>(null)
|
|
89
|
+
</script>
|
|
90
|
+
- title: Number stepper inside a field
|
|
91
|
+
code: |
|
|
92
|
+
<template>
|
|
93
|
+
<UiField v-slot="field" id="duration-field" label="Duration, minutes">
|
|
94
|
+
<UiNumberStepper
|
|
95
|
+
:id="field.id"
|
|
96
|
+
v-model:value="duration"
|
|
97
|
+
:min="0"
|
|
98
|
+
:step="15"
|
|
99
|
+
/>
|
|
100
|
+
</UiField>
|
|
101
|
+
</template>
|
|
102
|
+
|
|
103
|
+
<script lang="ts" setup>
|
|
104
|
+
import { ref } from 'vue'
|
|
105
|
+
|
|
106
|
+
import {
|
|
107
|
+
UiField,
|
|
108
|
+
UiNumberStepper,
|
|
109
|
+
} from '@retailcrm/embed-ui-v1-components/remote'
|
|
110
|
+
|
|
111
|
+
const duration = ref(30)
|
|
112
|
+
</script>
|
|
64
113
|
use_when:
|
|
65
114
|
- You need a labeled form control with consistent field semantics.
|
|
66
115
|
- You need to pass id, aria-labelledby, and aria-invalid into an inner control.
|
|
@@ -109,6 +158,7 @@ api:
|
|
|
109
158
|
- one form control
|
|
110
159
|
- UiTextbox
|
|
111
160
|
- UiSelect
|
|
161
|
+
- UiNumberStepper
|
|
112
162
|
- UiDatePicker
|
|
113
163
|
avoid:
|
|
114
164
|
- several unrelated controls
|
|
@@ -248,6 +298,7 @@ composition:
|
|
|
248
298
|
works_well_with:
|
|
249
299
|
- UiTextbox
|
|
250
300
|
- UiSelect
|
|
301
|
+
- UiNumberStepper
|
|
251
302
|
- UiDatePicker
|
|
252
303
|
- UiTimePicker
|
|
253
304
|
patterns:
|
|
@@ -258,7 +309,10 @@ composition:
|
|
|
258
309
|
ai_notes:
|
|
259
310
|
do:
|
|
260
311
|
- Forward slot props into the actual control in most form scenarios.
|
|
312
|
+
- Pass field.id to child controls that accept id, including UiTextbox, UiSelect, and UiNumberStepper.
|
|
313
|
+
- Use v-slot on UiField when the field uses only the default slot.
|
|
261
314
|
- Use UiField as a semantic wrapper for a single control.
|
|
262
315
|
avoid:
|
|
263
316
|
- Do not use UiField as a generic visual container without control semantics.
|
|
317
|
+
- Do not use UiField for UiSwitch settings rows; pair UiSwitch with a visible label and hint text instead.
|
|
264
318
|
- Do not ignore id and ariaLabelledby when accessibility matters.
|
|
@@ -44,18 +44,30 @@ examples:
|
|
|
44
44
|
</div>
|
|
45
45
|
|
|
46
46
|
<template #footer>
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
<div style="display: flex; align-items: center; gap: 12px;">
|
|
48
|
+
<UiButton @click="modalSidebarInner = false">
|
|
49
|
+
Save
|
|
50
|
+
</UiButton>
|
|
51
|
+
|
|
52
|
+
<UiButton appearance="secondary" @click="modalSidebarInner = false">
|
|
53
|
+
Close
|
|
54
|
+
</UiButton>
|
|
55
|
+
</div>
|
|
50
56
|
</template>
|
|
51
57
|
</UiModalSidebar>
|
|
52
58
|
</div>
|
|
53
59
|
</div>
|
|
54
60
|
|
|
55
61
|
<template v-if="footer" #footer>
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
<div style="display: flex; align-items: center; gap: 12px;">
|
|
63
|
+
<UiButton @click="open = false">
|
|
64
|
+
Save
|
|
65
|
+
</UiButton>
|
|
66
|
+
|
|
67
|
+
<UiButton appearance="secondary" @click="open = false">
|
|
68
|
+
Close
|
|
69
|
+
</UiButton>
|
|
70
|
+
</div>
|
|
59
71
|
</template>
|
|
60
72
|
</UiModalSidebar>
|
|
61
73
|
</div>
|
|
@@ -125,6 +137,9 @@ ai_notes:
|
|
|
125
137
|
do:
|
|
126
138
|
- Use UiModalSidebar when page context should stay visually connected to the modal content.
|
|
127
139
|
- Use for inspect, edit, or secondary workflows that relate to the current list or page.
|
|
140
|
+
- Group several footer buttons in flex rows; 12px and 16px are the common gaps inside a group.
|
|
141
|
+
- Footer actions may be split into left and right groups when their meanings differ.
|
|
142
|
+
- Put destructive icon-only actions on the right and confirm them with UiPopconfirm okVariant="danger"; the confirmation button is primary by default.
|
|
128
143
|
avoid:
|
|
129
144
|
- Do not use for short confirmations; use UiModalWindow.
|
|
130
145
|
|
|
@@ -133,6 +148,7 @@ composition:
|
|
|
133
148
|
- UiTable
|
|
134
149
|
- UiField
|
|
135
150
|
- UiButton
|
|
151
|
+
- UiPopconfirm
|
|
136
152
|
patterns:
|
|
137
153
|
- title: Row detail side panel
|
|
138
154
|
notes: Open from a table row when the user should keep list context visible.
|
|
@@ -312,6 +312,10 @@ styling:
|
|
|
312
312
|
- The trigger reuses the textbox visual model.
|
|
313
313
|
- The dropdown reuses popper variables for padding, radius, and floating surface geometry.
|
|
314
314
|
- Classes are descriptive implementation hooks, not a stable external styling contract.
|
|
315
|
+
- Selected, active, focused, pressed, invalid, and disabled states should come from UiSelect and
|
|
316
|
+
UiSelectOption implementation styles or documented CSS variables.
|
|
317
|
+
- Do not add custom outlines or borders for selected options unless the task records a
|
|
318
|
+
project-specific design requirement.
|
|
315
319
|
root_classes:
|
|
316
320
|
- .ui-v1-select
|
|
317
321
|
- .ui-v1-select__trigger
|
|
@@ -375,6 +379,8 @@ behavior:
|
|
|
375
379
|
- In multiple mode values are toggled inside the array model.
|
|
376
380
|
- Filtering matches option labels and descriptions.
|
|
377
381
|
- If nothing matches, a no-result block is shown.
|
|
382
|
+
- Selected option styling is owned by the select option implementation; do not recreate it with
|
|
383
|
+
local borders or outline styles.
|
|
378
384
|
keyboard:
|
|
379
385
|
- Arrow keys move the active highlight.
|
|
380
386
|
- Escape closes the dropdown.
|
|
@@ -414,3 +420,5 @@ ai_notes:
|
|
|
414
420
|
- Do not place arbitrary div wrappers inside the option tree.
|
|
415
421
|
- Do not choose UiSelect when free text input is the real need.
|
|
416
422
|
- Do not assume the dropdown lives in normal document flow next to the trigger.
|
|
423
|
+
- Do not add custom selected-option outlines, borders, or active-state chrome unless a
|
|
424
|
+
project-specific design requirement explicitly asks for it.
|
|
@@ -70,5 +70,7 @@ styling:
|
|
|
70
70
|
notes:
|
|
71
71
|
- Use documented props and slots as the primary styling API.
|
|
72
72
|
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
73
|
+
- Selected, active, focused, pressed, and disabled option states are owned by UiSelect/UiSelectOption implementation styles.
|
|
74
|
+
- Do not add custom outlines or borders for selected options unless the task records a project-specific design requirement.
|
|
73
75
|
root_classes:
|
|
74
76
|
- .ui-v1-select-option
|
|
@@ -58,11 +58,72 @@ examples:
|
|
|
58
58
|
|
|
59
59
|
const enabled = ref(false)
|
|
60
60
|
</script>
|
|
61
|
+
- title: Settings row with label and hint
|
|
62
|
+
code: |
|
|
63
|
+
<template>
|
|
64
|
+
<div class="settings-switch-row">
|
|
65
|
+
<UiSwitch
|
|
66
|
+
:id="switchId"
|
|
67
|
+
v-model:value="enabled"
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
<div class="settings-switch-row__content">
|
|
71
|
+
<label
|
|
72
|
+
class="settings-switch-row__label"
|
|
73
|
+
:for="switchId"
|
|
74
|
+
>
|
|
75
|
+
Enable automatic assignment
|
|
76
|
+
</label>
|
|
77
|
+
|
|
78
|
+
<div class="settings-switch-row__hint">
|
|
79
|
+
New requests will be assigned to available managers.
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<script lang="ts" setup>
|
|
86
|
+
import { ref, useId } from 'vue'
|
|
87
|
+
|
|
88
|
+
import { UiSwitch } from '@retailcrm/embed-ui-v1-components/remote'
|
|
89
|
+
|
|
90
|
+
const enabled = ref(false)
|
|
91
|
+
const switchId = useId()
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<style lang="less" scoped>
|
|
95
|
+
@import (reference) '@retailcrm/embed-ui-v1-components/assets/stylesheets/layout.less';
|
|
96
|
+
@import (reference) '@retailcrm/embed-ui-v1-components/assets/stylesheets/palette.less';
|
|
97
|
+
@import (reference) '@retailcrm/embed-ui-v1-components/assets/stylesheets/typography.less';
|
|
98
|
+
|
|
99
|
+
.settings-switch-row {
|
|
100
|
+
display: flex;
|
|
101
|
+
align-items: flex-start;
|
|
102
|
+
gap: 3 * @spacing-unit;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.settings-switch-row__content {
|
|
106
|
+
display: grid;
|
|
107
|
+
gap: @spacing-xxs;
|
|
108
|
+
min-width: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.settings-switch-row__label {
|
|
112
|
+
color: @black-500;
|
|
113
|
+
.text-small-accent();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.settings-switch-row__hint {
|
|
117
|
+
color: @grey-800;
|
|
118
|
+
.text-small();
|
|
119
|
+
}
|
|
120
|
+
</style>
|
|
61
121
|
use_when:
|
|
62
122
|
- You need a compact on or off toggle.
|
|
63
123
|
|
|
64
124
|
avoid_when:
|
|
65
125
|
- You need checkbox-group semantics.
|
|
126
|
+
- You need a UiField-style labeled wrapper; pair UiSwitch with a visible label and hint text instead.
|
|
66
127
|
|
|
67
128
|
api:
|
|
68
129
|
key_props:
|
|
@@ -93,18 +154,23 @@ behavior:
|
|
|
93
154
|
|
|
94
155
|
composition:
|
|
95
156
|
works_well_with:
|
|
96
|
-
-
|
|
157
|
+
- visible label
|
|
158
|
+
- hint text
|
|
97
159
|
patterns:
|
|
98
160
|
- title: Settings row
|
|
99
|
-
notes:
|
|
161
|
+
notes: Place UiSwitch on the left, label and hint on the right, and connect UiSwitch id with label for.
|
|
100
162
|
avoid:
|
|
101
163
|
- Do not use without a nearby label; the switch alone does not explain what will change.
|
|
164
|
+
- Do not wrap UiSwitch in UiField.
|
|
102
165
|
|
|
103
166
|
ai_notes:
|
|
104
167
|
do:
|
|
105
168
|
- Use for compact feature toggles and enable or disable settings.
|
|
169
|
+
- Generate an id, pass it to UiSwitch, and connect the visible label with label for.
|
|
170
|
+
- Put helper text below the label in the settings row, not in UiField hint.
|
|
106
171
|
avoid:
|
|
107
172
|
- Do not use for multi-select lists or legal acknowledgements; use UiCheckbox.
|
|
173
|
+
- Do not use UiField around UiSwitch.
|
|
108
174
|
|
|
109
175
|
accessibility:
|
|
110
176
|
notes:
|
|
@@ -10,13 +10,16 @@ public_import:
|
|
|
10
10
|
|
|
11
11
|
related_components:
|
|
12
12
|
- UiAvatar
|
|
13
|
+
- UiButton
|
|
13
14
|
- UiCheckbox
|
|
14
15
|
- UiLink
|
|
16
|
+
- UiPopperConnector
|
|
15
17
|
- UiTableColumn
|
|
16
18
|
- UiTableFooterButton
|
|
17
19
|
- UiTableFooterSection
|
|
18
20
|
- UiTableSorter
|
|
19
21
|
- UiTag
|
|
22
|
+
- UiTooltip
|
|
20
23
|
|
|
21
24
|
examples:
|
|
22
25
|
- title: Basic table
|
|
@@ -64,6 +67,68 @@ examples:
|
|
|
64
67
|
Sent: '#1FA971',
|
|
65
68
|
}
|
|
66
69
|
</script>
|
|
70
|
+
- title: Icon-only row action with tooltip
|
|
71
|
+
notes:
|
|
72
|
+
- Use narrow action columns for row commands.
|
|
73
|
+
- Keep the visible control icon-only; put the action text in aria-label and UiTooltip.
|
|
74
|
+
code: |
|
|
75
|
+
<template>
|
|
76
|
+
<UiTable
|
|
77
|
+
bordered
|
|
78
|
+
:rows="rows"
|
|
79
|
+
row-key="id"
|
|
80
|
+
>
|
|
81
|
+
<UiTableColumn label="Name">
|
|
82
|
+
<template #cell="{ row }">
|
|
83
|
+
{{ row.name }}
|
|
84
|
+
</template>
|
|
85
|
+
</UiTableColumn>
|
|
86
|
+
|
|
87
|
+
<UiTableColumn :width="48" label="" trim>
|
|
88
|
+
<template #cell="{ row }">
|
|
89
|
+
<UiPopperConnector>
|
|
90
|
+
<UiButton
|
|
91
|
+
:aria-label="`Edit ${row.name}`"
|
|
92
|
+
appearance="tertiary"
|
|
93
|
+
size="sm"
|
|
94
|
+
@click="edit(row)"
|
|
95
|
+
>
|
|
96
|
+
<IconEdit aria-hidden="true" />
|
|
97
|
+
</UiButton>
|
|
98
|
+
|
|
99
|
+
<UiTooltip>
|
|
100
|
+
Edit {{ row.name }}
|
|
101
|
+
</UiTooltip>
|
|
102
|
+
</UiPopperConnector>
|
|
103
|
+
</template>
|
|
104
|
+
</UiTableColumn>
|
|
105
|
+
</UiTable>
|
|
106
|
+
</template>
|
|
107
|
+
|
|
108
|
+
<script lang="ts" setup>
|
|
109
|
+
import IconEdit from '@retailcrm/embed-ui-v1-components/assets/sprites/ui/edit.svg'
|
|
110
|
+
import {
|
|
111
|
+
UiButton,
|
|
112
|
+
UiPopperConnector,
|
|
113
|
+
UiTable,
|
|
114
|
+
UiTableColumn,
|
|
115
|
+
UiTooltip,
|
|
116
|
+
} from '@retailcrm/embed-ui-v1-components/remote'
|
|
117
|
+
|
|
118
|
+
type Row = {
|
|
119
|
+
id: number
|
|
120
|
+
name: string
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const rows: Row[] = [
|
|
124
|
+
{ id: 101, name: 'Anna Smith' },
|
|
125
|
+
{ id: 102, name: 'Ilya Johnson' },
|
|
126
|
+
]
|
|
127
|
+
|
|
128
|
+
const edit = (row: Row) => {
|
|
129
|
+
console.log(row)
|
|
130
|
+
}
|
|
131
|
+
</script>
|
|
67
132
|
- title: Expandable rows table
|
|
68
133
|
notes:
|
|
69
134
|
- Use the expand slot and cell toggle helper for expandable row details.
|
|
@@ -421,6 +486,7 @@ use_when:
|
|
|
421
486
|
|
|
422
487
|
avoid_when:
|
|
423
488
|
- You need a simple list or card layout.
|
|
489
|
+
- You need content inside a generic white card surface instead of a table.
|
|
424
490
|
|
|
425
491
|
api:
|
|
426
492
|
key_props:
|
|
@@ -491,6 +557,7 @@ geometry:
|
|
|
491
557
|
- Root fills available width.
|
|
492
558
|
- fixed=true switches table-layout from auto to fixed.
|
|
493
559
|
- bordered=true adds border and corner rounding through CSS variables.
|
|
560
|
+
- Do not wrap UiTable in an extra white content surface; use a plain layout or scroll wrapper only when needed.
|
|
494
561
|
- Filters and search controls should usually be placed above the table, not in the table root.
|
|
495
562
|
- Table-scoped pagination belongs in footer slots when custom controls are needed.
|
|
496
563
|
|
|
@@ -593,6 +660,12 @@ composition:
|
|
|
593
660
|
- Add scoped CSS for footer meta height, control-row background, pagination button size, active page state, arrow icon size, and vertical dividers.
|
|
594
661
|
- Persist page and page size in URL query parameters when routing is available.
|
|
595
662
|
- Reset page to 1 when filters or sorting change.
|
|
663
|
+
actions:
|
|
664
|
+
notes:
|
|
665
|
+
- Prefer narrow action columns with icon-only UiButton controls for row commands.
|
|
666
|
+
- Keep visible button text out of dense table rows; provide aria-label and matching UiTooltip text.
|
|
667
|
+
- Use package sprite icons and set aria-hidden on the icon itself.
|
|
668
|
+
- Wrap action buttons and UiTooltip in UiPopperConnector. Add UiPopperTarget only for custom non-component targets.
|
|
596
669
|
|
|
597
670
|
ai_notes:
|
|
598
671
|
do:
|
|
@@ -603,9 +676,12 @@ ai_notes:
|
|
|
603
676
|
- Compose footer controls with UiTableFooterSection and UiTableFooterButton.
|
|
604
677
|
- Copy the Entity list table footer example when building a realistic entity-list footer.
|
|
605
678
|
- Use UiTableSorter for sortable headers.
|
|
679
|
+
- Use icon-only row action buttons with aria-label and UiTooltip in action columns.
|
|
606
680
|
avoid:
|
|
607
681
|
- Do not hide table filters in page header actions.
|
|
682
|
+
- Do not wrap UiTable in an additional white card, panel, or content-surface container.
|
|
608
683
|
- Do not use UiButton inside table footer pagination.
|
|
684
|
+
- Do not put visible text buttons in dense table action columns.
|
|
609
685
|
- Do not put pagination only in local state when the screen has routable result sets.
|
|
610
686
|
- Do not import table internals from host or src paths.
|
|
611
687
|
|
|
@@ -60,6 +60,7 @@ ai_notes:
|
|
|
60
60
|
do:
|
|
61
61
|
- Use UiTooltip for tooltip semantics and UiPopper for lower-level floating behavior.
|
|
62
62
|
- Keep tooltip content short and non-essential.
|
|
63
|
+
- For icon-only controls, keep tooltip text aligned with the control aria-label.
|
|
63
64
|
avoid:
|
|
64
65
|
- Do not put forms, tables, or multi-step interactions in tooltips.
|
|
65
66
|
|
|
@@ -20,6 +20,8 @@ expected_structure:
|
|
|
20
20
|
- Header actions can be accompanied by text information or status labels.
|
|
21
21
|
- Optional top tabs.
|
|
22
22
|
- Main content sits on a white content surface.
|
|
23
|
+
- The white content surface owns the 24px top and 32px side/bottom padding.
|
|
24
|
+
- The page root wrapper should not repeat that padding.
|
|
23
25
|
- Content can include text, buttons, fields, checkboxes, radio groups, switches, and other form controls.
|
|
24
26
|
- A bottom save panel is optional.
|
|
25
27
|
- If a bottom save panel is used, its main save or apply action should be Success Primary.
|
|
@@ -58,3 +60,4 @@ ai_notes:
|
|
|
58
60
|
- Keep save/apply as the strongest footer action and move neighboring actions to secondary or tertiary appearances unless their variant has a distinct page-level meaning.
|
|
59
61
|
avoid:
|
|
60
62
|
- Do not create a decorative landing page for operational settings.
|
|
63
|
+
- Do not put content-surface padding on the root page wrapper.
|
|
@@ -24,6 +24,9 @@ expected_structure:
|
|
|
24
24
|
- Filter apply action uses a default secondary 36px text button.
|
|
25
25
|
- Filter reset action uses a danger secondary 36px icon button.
|
|
26
26
|
- Entity data is shown in a table.
|
|
27
|
+
- UiTable should not be wrapped in an extra white content surface.
|
|
28
|
+
- A wrapper around UiTable should only handle layout, width, or scrolling, without card chrome or content-surface padding.
|
|
29
|
+
- Row action columns should use icon-only buttons with aria-label and UiTooltip instead of visible text buttons.
|
|
27
30
|
- The table may scroll and may support export.
|
|
28
31
|
|
|
29
32
|
recommended_components:
|
|
@@ -61,6 +64,9 @@ ai_notes:
|
|
|
61
64
|
- Keep filters and table controls directly above the table.
|
|
62
65
|
- Persist filters, sorting, page, and page size in query parameters when routing is available.
|
|
63
66
|
- Reset page to 1 when filters or sorting change.
|
|
67
|
+
- Use narrow icon-only row action columns with matching aria-label and UiTooltip text.
|
|
64
68
|
avoid:
|
|
65
69
|
- Do not hide filters in page header actions.
|
|
66
70
|
- Do not put pagination only in local state when the result set is routable.
|
|
71
|
+
- Do not place UiTable inside an additional white card or padded content surface.
|
|
72
|
+
- Do not use visible text buttons for dense table row actions.
|
|
@@ -44,18 +44,30 @@ examples:
|
|
|
44
44
|
</UiButton>
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
<div class="modal-sidebar-footer__aside">
|
|
48
|
+
<UiPopconfirm
|
|
49
|
+
ok-variant="danger"
|
|
50
|
+
title="Delete item?"
|
|
51
|
+
@ok="deleteItem"
|
|
52
|
+
>
|
|
53
|
+
<template #trigger="{ open: popconfirmOpen }">
|
|
54
|
+
<UiButton
|
|
55
|
+
:active="popconfirmOpen"
|
|
56
|
+
aria-label="Delete"
|
|
57
|
+
appearance="tertiary"
|
|
58
|
+
class="modal-sidebar-footer__delete"
|
|
59
|
+
variant="danger"
|
|
60
|
+
>
|
|
61
|
+
<IconDelete
|
|
62
|
+
aria-hidden="true"
|
|
63
|
+
class="modal-sidebar-footer__delete-icon"
|
|
64
|
+
/>
|
|
65
|
+
</UiButton>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
This action cannot be undone.
|
|
69
|
+
</UiPopconfirm>
|
|
70
|
+
</div>
|
|
59
71
|
</div>
|
|
60
72
|
</template>
|
|
61
73
|
</UiModalSidebar>
|
|
@@ -69,6 +81,7 @@ examples:
|
|
|
69
81
|
import {
|
|
70
82
|
UiButton,
|
|
71
83
|
UiModalSidebar,
|
|
84
|
+
UiPopconfirm,
|
|
72
85
|
} from '@retailcrm/embed-ui-v1-components/remote'
|
|
73
86
|
|
|
74
87
|
const open = ref(false)
|
|
@@ -95,6 +108,12 @@ examples:
|
|
|
95
108
|
}
|
|
96
109
|
|
|
97
110
|
.modal-sidebar-footer__main {
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
gap: 12px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.modal-sidebar-footer__aside {
|
|
98
117
|
display: flex;
|
|
99
118
|
align-items: center;
|
|
100
119
|
gap: 16px;
|
|
@@ -127,6 +146,10 @@ expected_structure:
|
|
|
127
146
|
- Fixed footer at the bottom.
|
|
128
147
|
- Footer usually contains save, cancel or close, and delete actions.
|
|
129
148
|
- Footer can also contain a copy button or auxiliary text.
|
|
149
|
+
- Footer actions may be split into left and right groups.
|
|
150
|
+
- Footer action groups usually use a 12px or 16px gap between neighboring buttons.
|
|
151
|
+
- Destructive footer actions are often icon-only buttons aligned to the right edge.
|
|
152
|
+
- Destructive icon-only actions should usually open UiPopconfirm with okVariant="danger"; its confirmation button is primary by default.
|
|
130
153
|
- Content can be flexible, but should stay compact.
|
|
131
154
|
- Small tables can be placed in sidebars.
|
|
132
155
|
|
|
@@ -135,6 +158,8 @@ recommended_components:
|
|
|
135
158
|
profile: ../components/UiModalSidebar.yml
|
|
136
159
|
- name: UiButton
|
|
137
160
|
profile: ../components/UiButton.yml
|
|
161
|
+
- name: UiPopconfirm
|
|
162
|
+
profile: ../components/UiPopconfirm.yml
|
|
138
163
|
- name: UiTag
|
|
139
164
|
profile: ../components/UiTag.yml
|
|
140
165
|
- name: UiField
|
|
@@ -151,6 +176,9 @@ ai_notes:
|
|
|
151
176
|
do:
|
|
152
177
|
- Use for inspect, edit, or secondary workflows related to the current list or page.
|
|
153
178
|
- Keep the flow compact.
|
|
179
|
+
- Split footer actions into meaningful left and right groups when secondary or destructive actions need separation.
|
|
180
|
+
- Use 12px or 16px gaps inside each footer action group.
|
|
181
|
+
- Put destructive icon-only actions on the right and confirm them with UiPopconfirm okVariant="danger"; the confirmation button is primary by default.
|
|
154
182
|
avoid:
|
|
155
183
|
- Do not use for bulky or complex interfaces.
|
|
156
184
|
- Do not use collapse blocks inside sidebars.
|
|
@@ -14,6 +14,7 @@ examples_from_design:
|
|
|
14
14
|
layout_rules:
|
|
15
15
|
- Content is placed on surfaces.
|
|
16
16
|
- The most common surface spans the full screen width.
|
|
17
|
+
- Surface padding belongs to each content surface, not to the page root wrapper.
|
|
17
18
|
- Semantic blocks can be arranged vertically and horizontally.
|
|
18
19
|
- Distance between blocks is 24px.
|
|
19
20
|
- Allowed width distributions are 100%, 50% / 50%, and 30% / 70%.
|
|
@@ -25,3 +26,4 @@ ai_notes:
|
|
|
25
26
|
avoid:
|
|
26
27
|
- Do not use marketing-style layouts.
|
|
27
28
|
- Do not split content into columns when a single linear form is easier to complete.
|
|
29
|
+
- Do not duplicate content-surface padding on the page root wrapper.
|
|
@@ -29,6 +29,8 @@ shared_rules:
|
|
|
29
29
|
- Components inside pages and blocks should be spaced by values divisible by 4px.
|
|
30
30
|
- Common spacing values are 4, 8, 12, 16, 20, 24, 28, and 32px.
|
|
31
31
|
- Content blocks commonly use 32px left, right, and bottom padding and 24px top padding.
|
|
32
|
+
- The 24px top and 32px side/bottom padding rule belongs to white content surfaces, not to the page root wrapper.
|
|
33
|
+
- Do not duplicate content-surface padding on the page root; outer page spacing is controlled by the CRM host layout.
|
|
32
34
|
- Prefer public components from @retailcrm/embed-ui-v1-components/remote.
|
|
33
35
|
- Do not invent custom chrome for pages, forms, tables, tabs, buttons, modals, or sidebars when a documented component fits.
|
|
34
36
|
|
|
@@ -62,3 +64,4 @@ ai_notes:
|
|
|
62
64
|
- Do not turn internal CRM work screens into marketing-style layouts.
|
|
63
65
|
- Do not hide filters or primary workflow controls away from the content they affect.
|
|
64
66
|
- Do not place multiple Success Primary, Default Primary, or Danger Primary actions with the same variant in the page-level scope or inside one collapse-box scope.
|
|
67
|
+
- Do not add page-surface padding to both the page root and the white content surface.
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@retailcrm/embed-ui-v1-components",
|
|
3
3
|
"bin": "bin/embed-ui-v1-components.mjs",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.25",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "RetailDriverLLC <integration@retailcrm.ru>",
|
|
8
8
|
"repository": {
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"docs",
|
|
49
49
|
"index.cjs",
|
|
50
50
|
"index.js",
|
|
51
|
-
"README.md"
|
|
51
|
+
"README.md",
|
|
52
|
+
"templates"
|
|
52
53
|
],
|
|
53
54
|
"scripts": {
|
|
54
55
|
"build": "yarn build:host && yarn build:remote",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: embed-ui-v1-components-ui
|
|
3
|
+
description: Use when building, editing, or reviewing RetailCRM JS module UI with @retailcrm/embed-ui-v1-components. Covers page pattern selection, component profile lookup, styling constraints, table pagination fidelity, forms, widgets, and visual-review triage.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Embed UI v1 Components UI
|
|
7
|
+
|
|
8
|
+
Use this skill before changing frontend UI built with `@retailcrm/embed-ui-v1-components`.
|
|
9
|
+
|
|
10
|
+
## Reading order
|
|
11
|
+
|
|
12
|
+
1. Read project `AGENTS.md` if it exists.
|
|
13
|
+
2. Read `__PACKAGE_DOCS_PATH__/AGENTS.md`.
|
|
14
|
+
3. Read `__PACKAGE_DOCS_PATH__/docs/AI.md`.
|
|
15
|
+
4. Read `__PACKAGE_DOCS_PATH__/docs/PROFILES.md`.
|
|
16
|
+
5. Read `__PACKAGE_DOCS_PATH__/docs/STYLING.md` for typography, spacing, CSS variables, and selector boundaries.
|
|
17
|
+
6. Open the relevant component profiles from `__PACKAGE_DOCS_PATH__/docs/profiles/components/*.yml`.
|
|
18
|
+
7. For full screens, overlays, filters, tables, or settings layouts, open the relevant page profile from `__PACKAGE_DOCS_PATH__/docs/profiles/pages/*.yml`.
|
|
19
|
+
|
|
20
|
+
## Workflow
|
|
21
|
+
|
|
22
|
+
1. Choose the page pattern before writing code: `EntityListPage`, `CardSettingsPage`, `CollapseBlockPage`, `MultiColumnPage`, `ModalSidebar`, or `ModalWindow`.
|
|
23
|
+
2. List the component profiles you are using.
|
|
24
|
+
3. Use `@retailcrm/embed-ui-v1-components/remote` for extension UI components and `@retailcrm/embed-ui-v1-components/assets/...` for icons.
|
|
25
|
+
4. Do not import from `@retailcrm/embed-ui-v1-components/dist/*`, `@retailcrm/embed-ui-v1-components/host`, source files, or repository-only paths in extension frontend code.
|
|
26
|
+
5. Do not hand-roll buttons, inputs, selects, tables, or links when a documented Embed UI component exists.
|
|
27
|
+
6. Do not set arbitrary `font-family`; inherit the host/component stack unless a project-specific design requirement says otherwise.
|
|
28
|
+
7. Do not style internal `.ui-v1-*` selectors unless the profile or `STYLING.md` explicitly documents that override pattern.
|
|
29
|
+
|
|
30
|
+
## High-signal checks
|
|
31
|
+
|
|
32
|
+
- For entity lists, use `UiTable`, `UiTableColumn`, and table footer slots.
|
|
33
|
+
- For table pagination, follow the reference example in `UiTable.yml`: button sizes, active state, dividers, arrow assets, and scoped selector pattern.
|
|
34
|
+
- For form fields, use `UiField` with the matching control and forward slot props such as `id` when the control accepts them.
|
|
35
|
+
- For `UiSwitch`, use the documented switch + visible label + hint row instead of wrapping it in `UiField`.
|
|
36
|
+
- For widgets mounted into CRM targets, keep inline UI compact; move complex UI into `UiModalSidebar` or `UiModalWindow`.
|
|
37
|
+
- For sidebar footers, group related actions, use 12px or 16px gaps inside groups, and confirm destructive icon-only actions with `UiPopconfirm okVariant="danger"`.
|
|
38
|
+
|
|
39
|
+
## Design feedback triage
|
|
40
|
+
|
|
41
|
+
When design feedback does not match the package docs:
|
|
42
|
+
|
|
43
|
+
1. Check the component profile, page profile, `STYLING.md`, Figma, and CRM computed styles.
|
|
44
|
+
2. If Embed UI docs do not contain the requested rule, treat it as a project-specific design requirement.
|
|
45
|
+
3. State which source wins before editing.
|
|
46
|
+
4. Keep the selected values documented in the task or project `AGENTS.md`.
|