@retailcrm/embed-ui-v1-components 0.9.14 → 0.9.15
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 +126 -0
- package/README.md +24 -0
- package/assets/stylesheets/palette.less +11 -6
- package/bin/embed-ui-v1-components.mjs +209 -0
- package/bin/postinstall.mjs +37 -0
- package/dist/host.cjs +1899 -590
- package/dist/host.css +659 -6
- package/dist/host.d.ts +2374 -50
- package/dist/host.js +1900 -591
- package/dist/remote.cjs +610 -33
- package/dist/remote.d.ts +729 -48
- package/dist/remote.js +612 -35
- package/docs/AI.md +106 -0
- package/docs/COMPONENTS.md +96 -0
- package/docs/FORMAT.md +248 -0
- package/docs/PROFILES.md +64 -0
- package/docs/README.md +65 -0
- package/docs/STYLING.md +156 -0
- package/docs/profiles/UiAddButton.yml +45 -0
- package/docs/profiles/UiAlert.yml +36 -0
- package/docs/profiles/UiAvatar.yml +36 -0
- package/docs/profiles/UiAvatarList.yml +30 -0
- package/docs/profiles/UiButton.yml +221 -0
- package/docs/profiles/UiCalendar.yml +36 -0
- package/docs/profiles/UiCheckbox.yml +41 -0
- package/docs/profiles/UiCollapse.yml +28 -0
- package/docs/profiles/UiCollapseBox.yml +39 -0
- package/docs/profiles/UiCollapseGroup.yml +27 -0
- package/docs/profiles/UiCopyButton.yml +40 -0
- package/docs/profiles/UiDate.yml +26 -0
- package/docs/profiles/UiDatePicker.yml +47 -0
- package/docs/profiles/UiError.yml +20 -0
- package/docs/profiles/UiField.yml +229 -0
- package/docs/profiles/UiImage.yml +27 -0
- package/docs/profiles/UiInfobox.yml +33 -0
- package/docs/profiles/UiLink.yml +39 -0
- package/docs/profiles/UiLoader.yml +26 -0
- package/docs/profiles/UiMenuItem.yml +45 -0
- package/docs/profiles/UiMenuItemGroup.yml +38 -0
- package/docs/profiles/UiModalSidebar.yml +34 -0
- package/docs/profiles/UiModalWindow.yml +32 -0
- package/docs/profiles/UiModalWindowSurface.yml +29 -0
- package/docs/profiles/UiNumberStepper.yml +40 -0
- package/docs/profiles/UiPageHeader.yml +240 -0
- package/docs/profiles/UiPopper.yml +197 -0
- package/docs/profiles/UiPopperConnector.yml +109 -0
- package/docs/profiles/UiPopperTarget.yml +112 -0
- package/docs/profiles/UiRadio.yml +26 -0
- package/docs/profiles/UiRadioSwitch.yml +224 -0
- package/docs/profiles/UiRadioSwitchOption.yml +113 -0
- package/docs/profiles/UiScrollBox.yml +19 -0
- package/docs/profiles/UiSelect.yml +318 -0
- package/docs/profiles/UiSelectOption.yml +32 -0
- package/docs/profiles/UiSelectOptionGroup.yml +26 -0
- package/docs/profiles/UiSlider.yml +26 -0
- package/docs/profiles/UiSwitch.yml +25 -0
- package/docs/profiles/UiTab.yml +114 -0
- package/docs/profiles/UiTabGroup.yml +233 -0
- package/docs/profiles/UiTable.yml +148 -0
- package/docs/profiles/UiTableBodyCell.yml +35 -0
- package/docs/profiles/UiTableColumn.yml +38 -0
- package/docs/profiles/UiTableFooterButton.yml +32 -0
- package/docs/profiles/UiTableFooterSection.yml +26 -0
- package/docs/profiles/UiTableHeadCell.yml +32 -0
- package/docs/profiles/UiTableSorter.yml +33 -0
- package/docs/profiles/UiTag.yml +29 -0
- package/docs/profiles/UiTextbox.yml +388 -0
- package/docs/profiles/UiTimePicker.yml +34 -0
- package/docs/profiles/UiToolbarButton.yml +25 -0
- package/docs/profiles/UiToolbarLink.yml +20 -0
- package/docs/profiles/UiTooltip.yml +31 -0
- package/docs/profiles/UiTransition.yml +15 -0
- package/docs/profiles/UiYandexMap.yml +17 -0
- package/package.json +7 -2
package/docs/AI.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# AI Context For `@retailcrm/embed-ui-v1-components`
|
|
2
|
+
|
|
3
|
+
This file is intended for AI assistants and automations that use the installed
|
|
4
|
+
`@retailcrm/embed-ui-v1-components` package inside another project.
|
|
5
|
+
|
|
6
|
+
Only the public package contract is described below, without depending on the repository's internal structure.
|
|
7
|
+
|
|
8
|
+
## Package Identity
|
|
9
|
+
|
|
10
|
+
- Package name: `@retailcrm/embed-ui-v1-components`
|
|
11
|
+
- Purpose: UI components and UI helpers for RetailCRM JS extensions
|
|
12
|
+
- Framework: Vue 3
|
|
13
|
+
- Published Storybook: `https://retailcrm.github.io/embed-ui/v1-components/0.9.14/`
|
|
14
|
+
- Primary public entrypoints:
|
|
15
|
+
- `@retailcrm/embed-ui-v1-components/remote`
|
|
16
|
+
- `@retailcrm/embed-ui-v1-components/host`
|
|
17
|
+
- `@retailcrm/embed-ui-v1-components/assets/...`
|
|
18
|
+
|
|
19
|
+
## Safe Usage Rules
|
|
20
|
+
|
|
21
|
+
- Import only from documented public entrypoints.
|
|
22
|
+
- Do not import from package-internal files such as `dist/*` or repository-only paths.
|
|
23
|
+
- Treat `remote` as the default public surface for extension authors.
|
|
24
|
+
- Treat `host` as a specialized public surface for runtime-side integrations.
|
|
25
|
+
- If a requested capability is not present in public exports, say that directly instead of suggesting internal imports.
|
|
26
|
+
|
|
27
|
+
## Reading Strategy For AI
|
|
28
|
+
|
|
29
|
+
When generating UI code, use this order:
|
|
30
|
+
|
|
31
|
+
1. read [`COMPONENTS.md`](./COMPONENTS.md) to identify candidate components;
|
|
32
|
+
2. open a detailed profile from [`PROFILES.md`](./PROFILES.md) if one exists;
|
|
33
|
+
3. use [`FORMAT.md`](./FORMAT.md) as the schema for what information is considered reliable;
|
|
34
|
+
4. read [`STYLING.md`](./STYLING.md) when the task is about classes, variables, typography, or visual zones;
|
|
35
|
+
5. if no profile exists yet, fall back to [Storybook](https://retailcrm.github.io/embed-ui/v1-components/0.9.14/) docs and public type declarations, and state any inference explicitly.
|
|
36
|
+
|
|
37
|
+
## Default Recommendation For Common Forms
|
|
38
|
+
|
|
39
|
+
When building a basic form or settings screen, start from patterns like:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import {
|
|
43
|
+
UiButton,
|
|
44
|
+
UiField,
|
|
45
|
+
UiPageHeader,
|
|
46
|
+
UiSelect,
|
|
47
|
+
UiTextbox,
|
|
48
|
+
} from '@retailcrm/embed-ui-v1-components/remote'
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Typical compositions:
|
|
52
|
+
|
|
53
|
+
- `UiField` + `UiTextbox`
|
|
54
|
+
- `UiField` + `UiSelect`
|
|
55
|
+
- `UiPageHeader` + `UiButton`
|
|
56
|
+
- `UiSelect` + `UiSelectOption`
|
|
57
|
+
|
|
58
|
+
## What AI Needs In A Good Component Profile
|
|
59
|
+
|
|
60
|
+
The most useful format for AI is a component profile that explicitly answers:
|
|
61
|
+
|
|
62
|
+
- when to use the component and when not to use it;
|
|
63
|
+
- which imports are public and safe;
|
|
64
|
+
- which props, emits, slots, and `v-model` pairs actually matter in practice;
|
|
65
|
+
- what the rendered shape looks like conceptually;
|
|
66
|
+
- how the component behaves in disabled, readonly, invalid, empty, opened, and focused states;
|
|
67
|
+
- how it composes with neighboring components;
|
|
68
|
+
- which assumptions are safe, and which are merely current implementation details.
|
|
69
|
+
|
|
70
|
+
That schema is documented in [`FORMAT.md`](./FORMAT.md).
|
|
71
|
+
|
|
72
|
+
## Important Boundary About DOM And CSS
|
|
73
|
+
|
|
74
|
+
Profiles may describe current host DOM shape and root classes so that AI can reason about geometry,
|
|
75
|
+
states, and composition more accurately.
|
|
76
|
+
|
|
77
|
+
However, extension code should not rely on `.ui-v1-*` classes as a stable public styling contract unless
|
|
78
|
+
the package explicitly documents that contract.
|
|
79
|
+
|
|
80
|
+
The preferred styling signal is:
|
|
81
|
+
|
|
82
|
+
1. props such as `size`, `appearance`, `outlined`, or `variant`;
|
|
83
|
+
2. documented CSS variables from profile `styling.css_variables`;
|
|
84
|
+
3. descriptive classes only for debugging or narrow local integrations.
|
|
85
|
+
|
|
86
|
+
## Current High-Signal Profiles
|
|
87
|
+
|
|
88
|
+
- [`UiField`](./profiles/UiField.yml)
|
|
89
|
+
- [`UiTextbox`](./profiles/UiTextbox.yml)
|
|
90
|
+
- [`UiButton`](./profiles/UiButton.yml)
|
|
91
|
+
- [`UiPageHeader`](./profiles/UiPageHeader.yml)
|
|
92
|
+
- [`UiSelect`](./profiles/UiSelect.yml)
|
|
93
|
+
- [`UiRadioSwitch`](./profiles/UiRadioSwitch.yml)
|
|
94
|
+
- [`UiTabGroup`](./profiles/UiTabGroup.yml)
|
|
95
|
+
- [`UiTab`](./profiles/UiTab.yml)
|
|
96
|
+
- [`UiPopper`](./profiles/UiPopper.yml)
|
|
97
|
+
- [`UiPopperConnector`](./profiles/UiPopperConnector.yml)
|
|
98
|
+
- [`UiPopperTarget`](./profiles/UiPopperTarget.yml)
|
|
99
|
+
|
|
100
|
+
## Related Public Docs
|
|
101
|
+
|
|
102
|
+
- [`README.md`](./README.md)
|
|
103
|
+
- [`COMPONENTS.md`](./COMPONENTS.md)
|
|
104
|
+
- [`FORMAT.md`](./FORMAT.md)
|
|
105
|
+
- [`STYLING.md`](./STYLING.md)
|
|
106
|
+
- [`../AGENTS.md`](../AGENTS.md)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Public Components Catalog
|
|
2
|
+
|
|
3
|
+
This catalog describes the public components and helpers available to consumers of
|
|
4
|
+
`@retailcrm/embed-ui-v1-components`.
|
|
5
|
+
|
|
6
|
+
Unless stated otherwise, extension UI code should import these entities from
|
|
7
|
+
`@retailcrm/embed-ui-v1-components/remote`.
|
|
8
|
+
|
|
9
|
+
Detailed AI-friendly profiles are collected in [`PROFILES.md`](./PROFILES.md).
|
|
10
|
+
|
|
11
|
+
## Form And Input
|
|
12
|
+
|
|
13
|
+
- [`UiField`](./profiles/UiField.yml): field wrapper with label, hint, validation state, and slot props for ARIA wiring
|
|
14
|
+
- [`UiTextbox`](./profiles/UiTextbox.yml): text or numeric input with prefix, suffix, clear action, and multiline mode
|
|
15
|
+
- [`UiCheckbox`](./profiles/UiCheckbox.yml): boolean choice
|
|
16
|
+
- [`UiRadio`](./profiles/UiRadio.yml): single choice
|
|
17
|
+
- [`UiRadioSwitch`](./profiles/UiRadioSwitch.yml): segmented single-choice switch with inline or section-card appearance
|
|
18
|
+
- [`UiRadioSwitchOption`](./profiles/UiRadioSwitchOption.yml): rich option child for UiRadioSwitch
|
|
19
|
+
- [`UiSwitch`](./profiles/UiSwitch.yml): state toggle
|
|
20
|
+
- [`UiSlider`](./profiles/UiSlider.yml): ranged value selection
|
|
21
|
+
- [`UiSelect`](./profiles/UiSelect.yml): select container for single or multiple choice
|
|
22
|
+
- [`UiSelectOption`](./profiles/UiSelectOption.yml): select option
|
|
23
|
+
- [`UiSelectOptionGroup`](./profiles/UiSelectOptionGroup.yml): grouped options
|
|
24
|
+
- [`UiDatePicker`](./profiles/UiDatePicker.yml): date or date-range selection
|
|
25
|
+
- [`UiTimePicker`](./profiles/UiTimePicker.yml): time selection
|
|
26
|
+
- [`UiCalendar`](./profiles/UiCalendar.yml): calendar primitive
|
|
27
|
+
- [`UiNumberStepper`](./profiles/UiNumberStepper.yml): numeric input with increment and decrement controls
|
|
28
|
+
|
|
29
|
+
## Actions And Navigation
|
|
30
|
+
|
|
31
|
+
- [`UiButton`](./profiles/UiButton.yml): main action button that can render as a button or anchor
|
|
32
|
+
- [`UiAddButton`](./profiles/UiAddButton.yml): add action button
|
|
33
|
+
- [`UiCopyButton`](./profiles/UiCopyButton.yml): copy value action
|
|
34
|
+
- [`UiToolbarButton`](./profiles/UiToolbarButton.yml): toolbar button
|
|
35
|
+
- [`UiToolbarLink`](./profiles/UiToolbarLink.yml): toolbar link
|
|
36
|
+
- [`UiLink`](./profiles/UiLink.yml): text link
|
|
37
|
+
- [`UiMenuItem`](./profiles/UiMenuItem.yml): menu item
|
|
38
|
+
- [`UiMenuItemGroup`](./profiles/UiMenuItemGroup.yml): menu item group
|
|
39
|
+
- [`UiTabGroup`](./profiles/UiTabGroup.yml): tab navigation group with overflow handling and optional active panel
|
|
40
|
+
- [`UiTab`](./profiles/UiTab.yml): declarative tab child for UiTabGroup
|
|
41
|
+
|
|
42
|
+
## Layout And Structure
|
|
43
|
+
|
|
44
|
+
- [`UiPageHeader`](./profiles/UiPageHeader.yml): page or section header with an editable title and action zone
|
|
45
|
+
- [`UiCollapse`](./profiles/UiCollapse.yml): collapsible section
|
|
46
|
+
- [`UiCollapseBox`](./profiles/UiCollapseBox.yml): collapsible container
|
|
47
|
+
- [`UiCollapseGroup`](./profiles/UiCollapseGroup.yml): multiple collapse coordination
|
|
48
|
+
- [`UiScrollBox`](./profiles/UiScrollBox.yml): scrollable container
|
|
49
|
+
- [`UiTransition`](./profiles/UiTransition.yml): transition wrapper
|
|
50
|
+
|
|
51
|
+
## Feedback And Status
|
|
52
|
+
|
|
53
|
+
- [`UiAlert`](./profiles/UiAlert.yml): contextual alert or notification
|
|
54
|
+
- [`UiInfobox`](./profiles/UiInfobox.yml): highlighted explanatory block
|
|
55
|
+
- [`UiError`](./profiles/UiError.yml): compact error state
|
|
56
|
+
- [`UiLoader`](./profiles/UiLoader.yml): loading indicator
|
|
57
|
+
- [`UiTag`](./profiles/UiTag.yml): labels and statuses
|
|
58
|
+
|
|
59
|
+
## Overlays And Modal Patterns
|
|
60
|
+
|
|
61
|
+
- [`UiModalWindow`](./profiles/UiModalWindow.yml): modal window
|
|
62
|
+
- [`UiModalWindowSurface`](./profiles/UiModalWindowSurface.yml): modal surface
|
|
63
|
+
- [`UiModalSidebar`](./profiles/UiModalSidebar.yml): sidebar modal
|
|
64
|
+
- [`UiTooltip`](./profiles/UiTooltip.yml): tooltip
|
|
65
|
+
- [`UiPopper`](./profiles/UiPopper.yml): floating layer
|
|
66
|
+
- [`UiPopperTarget`](./profiles/UiPopperTarget.yml): popper target
|
|
67
|
+
- [`UiPopperConnector`](./profiles/UiPopperConnector.yml): target-to-floating connector
|
|
68
|
+
|
|
69
|
+
## Content And Data Display
|
|
70
|
+
|
|
71
|
+
- [`UiAvatar`](./profiles/UiAvatar.yml): avatar
|
|
72
|
+
- [`UiAvatarList`](./profiles/UiAvatarList.yml): avatar list
|
|
73
|
+
- [`UiDate`](./profiles/UiDate.yml): formatted date display
|
|
74
|
+
- [`UiImage`](./profiles/UiImage.yml): image display
|
|
75
|
+
- [`UiTable`](./profiles/UiTable.yml): table root
|
|
76
|
+
- [`UiTableColumn`](./profiles/UiTableColumn.yml): table column declaration
|
|
77
|
+
- [`UiTableHeadCell`](./profiles/UiTableHeadCell.yml): table head cell primitive
|
|
78
|
+
- [`UiTableBodyCell`](./profiles/UiTableBodyCell.yml): table body cell primitive
|
|
79
|
+
- [`UiTableFooterSection`](./profiles/UiTableFooterSection.yml): table footer section container
|
|
80
|
+
- [`UiTableFooterButton`](./profiles/UiTableFooterButton.yml): table footer action button
|
|
81
|
+
- [`UiTableSorter`](./profiles/UiTableSorter.yml): table sort control primitive
|
|
82
|
+
- [`UiYandexMap`](./profiles/UiYandexMap.yml): Yandex map component
|
|
83
|
+
|
|
84
|
+
## Helpers
|
|
85
|
+
|
|
86
|
+
- `usePreview`: image preview helper
|
|
87
|
+
- `ImageWorkersKey`: injection key for image workers
|
|
88
|
+
- `formatDate`: date formatter
|
|
89
|
+
- `formatDateTime`: date-time formatter
|
|
90
|
+
- `formatTime`: time formatter
|
|
91
|
+
|
|
92
|
+
## Public Entrypoint Rule
|
|
93
|
+
|
|
94
|
+
- For extension UI code, use `@retailcrm/embed-ui-v1-components/remote`.
|
|
95
|
+
- For assets, use `@retailcrm/embed-ui-v1-components/assets/...`.
|
|
96
|
+
- Use `@retailcrm/embed-ui-v1-components/host` only if your application is the runtime-side integration.
|
package/docs/FORMAT.md
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# AI-Friendly Component Profile Format
|
|
2
|
+
|
|
3
|
+
This document defines the YAML component profile format that AI assistants can use
|
|
4
|
+
to work with `v1-components` confidently.
|
|
5
|
+
|
|
6
|
+
The format is optimized for code generation, code review, and safe API selection rather than for marketing copy.
|
|
7
|
+
|
|
8
|
+
## Design Goals
|
|
9
|
+
|
|
10
|
+
A good profile should let an agent answer these questions without opening the source code:
|
|
11
|
+
|
|
12
|
+
- which component to choose for a task;
|
|
13
|
+
- how to import it and which neighbors it works with;
|
|
14
|
+
- which props, emits, slots, and `v-model` pairs actually affect behavior;
|
|
15
|
+
- how the component behaves in important states;
|
|
16
|
+
- where the public contract ends and implementation details begin.
|
|
17
|
+
|
|
18
|
+
## YAML Shape
|
|
19
|
+
|
|
20
|
+
Recommended filename: `<ComponentName>.yml`
|
|
21
|
+
|
|
22
|
+
Minimal shape:
|
|
23
|
+
|
|
24
|
+
```yml
|
|
25
|
+
component: UiComponent
|
|
26
|
+
summary: >
|
|
27
|
+
A short description of the component.
|
|
28
|
+
|
|
29
|
+
public_import:
|
|
30
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
31
|
+
named:
|
|
32
|
+
- UiComponent
|
|
33
|
+
|
|
34
|
+
use_when:
|
|
35
|
+
- scenario
|
|
36
|
+
|
|
37
|
+
avoid_when:
|
|
38
|
+
- scenario
|
|
39
|
+
|
|
40
|
+
api:
|
|
41
|
+
key_props:
|
|
42
|
+
- name: value
|
|
43
|
+
notes: high-signal behavior
|
|
44
|
+
props:
|
|
45
|
+
- name: value
|
|
46
|
+
notes: practical usage note
|
|
47
|
+
slots:
|
|
48
|
+
- name: default
|
|
49
|
+
zone: content
|
|
50
|
+
notes: role of the slot
|
|
51
|
+
emits:
|
|
52
|
+
- name: update:value
|
|
53
|
+
payload: unknown
|
|
54
|
+
|
|
55
|
+
styling:
|
|
56
|
+
root_classes:
|
|
57
|
+
- .ui-v1-component
|
|
58
|
+
css_variables:
|
|
59
|
+
public_theme_variables:
|
|
60
|
+
- name: --ui-v1-component-color
|
|
61
|
+
effect: theme or state color
|
|
62
|
+
typography:
|
|
63
|
+
default:
|
|
64
|
+
mixin: text-regular
|
|
65
|
+
size: 16px
|
|
66
|
+
line_height: 24px
|
|
67
|
+
weight: 400
|
|
68
|
+
|
|
69
|
+
examples:
|
|
70
|
+
- title: Basic example
|
|
71
|
+
goal: What the user or the agent is trying to build.
|
|
72
|
+
code: |
|
|
73
|
+
<UiComponent />
|
|
74
|
+
|
|
75
|
+
ai_notes:
|
|
76
|
+
do:
|
|
77
|
+
- rule
|
|
78
|
+
avoid:
|
|
79
|
+
- anti-pattern
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Required Sections
|
|
83
|
+
|
|
84
|
+
Each YAML profile should include the following conceptual sections.
|
|
85
|
+
|
|
86
|
+
## 1. `summary`
|
|
87
|
+
|
|
88
|
+
A short paragraph, usually 2 to 4 sentences:
|
|
89
|
+
|
|
90
|
+
- what the component is;
|
|
91
|
+
- which role it usually plays in the UI;
|
|
92
|
+
- which neighboring components it is commonly used with.
|
|
93
|
+
|
|
94
|
+
## 2. `use_when`
|
|
95
|
+
|
|
96
|
+
A list of concrete scenarios:
|
|
97
|
+
|
|
98
|
+
- when the component is a good default choice;
|
|
99
|
+
- which cases it covers better than neighboring components.
|
|
100
|
+
|
|
101
|
+
Keep the wording practical: "amount input", "page header", "filterable select".
|
|
102
|
+
|
|
103
|
+
## 3. `avoid_when`
|
|
104
|
+
|
|
105
|
+
A list of cases where the component should not be chosen:
|
|
106
|
+
|
|
107
|
+
- wrong semantics;
|
|
108
|
+
- composition limits;
|
|
109
|
+
- cases where a neighboring component is a better fit.
|
|
110
|
+
|
|
111
|
+
## 4. `public_import`
|
|
112
|
+
|
|
113
|
+
Include:
|
|
114
|
+
|
|
115
|
+
- the public entrypoint;
|
|
116
|
+
- the primary import;
|
|
117
|
+
- related public components, if they are needed for a complete scenario.
|
|
118
|
+
|
|
119
|
+
## 5. `api`
|
|
120
|
+
|
|
121
|
+
List only high-signal API:
|
|
122
|
+
|
|
123
|
+
- key props;
|
|
124
|
+
- key emits;
|
|
125
|
+
- important slots;
|
|
126
|
+
- exposed methods, if they affect usage patterns.
|
|
127
|
+
|
|
128
|
+
Do not copy the entire `.d.ts` verbatim if parts of the API do not affect component choice.
|
|
129
|
+
|
|
130
|
+
Inside `api`, it is useful to distinguish:
|
|
131
|
+
|
|
132
|
+
- `key_props`
|
|
133
|
+
- `props`
|
|
134
|
+
- `slots`
|
|
135
|
+
- `emits`
|
|
136
|
+
- `methods`
|
|
137
|
+
|
|
138
|
+
## 6. `rendered_structure`
|
|
139
|
+
|
|
140
|
+
Describe the actual rendered shape:
|
|
141
|
+
|
|
142
|
+
- the root container;
|
|
143
|
+
- the main internal zones;
|
|
144
|
+
- where label, control, action area, icon area, popper content, and similar parts live;
|
|
145
|
+
- current root classes and state classes, if they help reasoning.
|
|
146
|
+
|
|
147
|
+
Important:
|
|
148
|
+
|
|
149
|
+
- this section is descriptive, not normative;
|
|
150
|
+
- state explicitly that it exists for mental modeling and debugging;
|
|
151
|
+
- do not present internal classes as a stable public styling API unless that contract is documented separately.
|
|
152
|
+
|
|
153
|
+
## 7. `geometry`
|
|
154
|
+
|
|
155
|
+
Capture:
|
|
156
|
+
|
|
157
|
+
- whether the component is block-like or inline-like;
|
|
158
|
+
- what stretches to `width: 100%` and what stays content-sized;
|
|
159
|
+
- how the component behaves in a row, grid, header, or popper;
|
|
160
|
+
- which props affect dimensions: `size`, `multiline`, `autofit`, `popperFitTrigger`, and so on.
|
|
161
|
+
|
|
162
|
+
## 8. `styling`
|
|
163
|
+
|
|
164
|
+
Capture only the styling data that helps an agent make safe decisions:
|
|
165
|
+
|
|
166
|
+
- root classes, zone classes, and state classes for reasoning and debugging;
|
|
167
|
+
- CSS custom properties that change theme, spacing, size, or popper behavior;
|
|
168
|
+
- typography mixins or resulting size, line-height, and weight values;
|
|
169
|
+
- whether classes and variables are descriptive implementation details or safe override points.
|
|
170
|
+
|
|
171
|
+
Inside `styling`, it is useful to distinguish:
|
|
172
|
+
|
|
173
|
+
- `root_classes`
|
|
174
|
+
- `state_classes`
|
|
175
|
+
- `zones`
|
|
176
|
+
- `css_variables`
|
|
177
|
+
- `typography`
|
|
178
|
+
|
|
179
|
+
Important:
|
|
180
|
+
|
|
181
|
+
- prefer CSS variables and documented props over selector-based overrides;
|
|
182
|
+
- do not present internal `.ui-v1-*` selectors as a stable public contract unless that is documented explicitly;
|
|
183
|
+
- say when a variable is a documented theme hook versus an internal implementation token.
|
|
184
|
+
|
|
185
|
+
## 9. `behavior`
|
|
186
|
+
|
|
187
|
+
This is one of the most important sections for AI.
|
|
188
|
+
|
|
189
|
+
Describe:
|
|
190
|
+
|
|
191
|
+
- `disabled`, `readonly`, `invalid`, `active`, `expanded`, `multiple`, and other state props;
|
|
192
|
+
- when and how errors, placeholders, clear buttons, and tooltips appear;
|
|
193
|
+
- keyboard behavior when it matters for UX;
|
|
194
|
+
- interaction transitions such as click-to-edit or open-close flows.
|
|
195
|
+
|
|
196
|
+
## 10. `accessibility`
|
|
197
|
+
|
|
198
|
+
Capture:
|
|
199
|
+
|
|
200
|
+
- which ARIA relationships the component expects or creates;
|
|
201
|
+
- what happens to `aria-invalid`, `aria-labelledby`, `role`, `aria-expanded`, and similar attributes;
|
|
202
|
+
- which keys affect behavior, if that behavior is documented.
|
|
203
|
+
|
|
204
|
+
## 11. `examples` and `composition`
|
|
205
|
+
|
|
206
|
+
List:
|
|
207
|
+
|
|
208
|
+
- common combinations;
|
|
209
|
+
- required neighboring components;
|
|
210
|
+
- safe defaults for typical screens;
|
|
211
|
+
- goal-oriented examples such as "build a table", "build an editable header", or "build a field with a select";
|
|
212
|
+
- examples of correct and incorrect composition.
|
|
213
|
+
|
|
214
|
+
## 12. `ai_notes`
|
|
215
|
+
|
|
216
|
+
A short list of rules specifically for code generation:
|
|
217
|
+
|
|
218
|
+
- what to do almost every time;
|
|
219
|
+
- what not to do;
|
|
220
|
+
- where it is better to admit the docs are missing than to guess.
|
|
221
|
+
|
|
222
|
+
## Writing Rules
|
|
223
|
+
|
|
224
|
+
- Use short, concrete statements instead of vague praise.
|
|
225
|
+
- Use the exact names of props, emits, and slots.
|
|
226
|
+
- For slots, describe not only the name, but also what the slot does and which content restrictions exist.
|
|
227
|
+
- For styling, distinguish between safe CSS variables and descriptive class names.
|
|
228
|
+
- Do not mix "how the component looks right now" with "what is publicly guaranteed".
|
|
229
|
+
- If behavior is inferred from implementation rather than public API, say that explicitly.
|
|
230
|
+
- If information is missing, state the limitation rather than inventing details.
|
|
231
|
+
|
|
232
|
+
## What Can Be Automated
|
|
233
|
+
|
|
234
|
+
The following data can usually be obtained automatically or semi-automatically:
|
|
235
|
+
|
|
236
|
+
- the list of public exports;
|
|
237
|
+
- prop, emit, method, and enum names;
|
|
238
|
+
- whether Storybook stories and examples exist;
|
|
239
|
+
- the current root classes and layout zones from templates.
|
|
240
|
+
|
|
241
|
+
These sections almost always need manual writing:
|
|
242
|
+
|
|
243
|
+
- when to use the component;
|
|
244
|
+
- which neighbors it composes with best;
|
|
245
|
+
- which anti-patterns are most dangerous for AI;
|
|
246
|
+
- which part of the DOM or CSS shape is only a descriptive model.
|
|
247
|
+
|
|
248
|
+
That split should stay documented in maintainer-only repository notes, not in the published package docs.
|
package/docs/PROFILES.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Component Profiles
|
|
2
|
+
|
|
3
|
+
`PROFILES.md` is the entry point for machine-readable AI-friendly component profiles.
|
|
4
|
+
|
|
5
|
+
The current profile layer is structured like this:
|
|
6
|
+
|
|
7
|
+
- the index stays in markdown so both humans and agents can navigate it easily;
|
|
8
|
+
- the actual profiles live in `docs/profiles/*.yml`;
|
|
9
|
+
- YAML is the source of truth for structure, props, slots, emits, examples, and AI rules.
|
|
10
|
+
|
|
11
|
+
## Table Of Contents
|
|
12
|
+
|
|
13
|
+
- [Reading Order](#reading-order)
|
|
14
|
+
- [Current Coverage](#current-coverage)
|
|
15
|
+
- [What To Read First](#what-to-read-first)
|
|
16
|
+
- [Styling Reads](#styling-reads)
|
|
17
|
+
- [Notes](#notes)
|
|
18
|
+
|
|
19
|
+
## Reading Order
|
|
20
|
+
|
|
21
|
+
1. [`AI.md`](./AI.md)
|
|
22
|
+
2. this index
|
|
23
|
+
3. the relevant `.yml` profile
|
|
24
|
+
|
|
25
|
+
## Current Coverage
|
|
26
|
+
|
|
27
|
+
Coverage is now expanding across the public component catalog.
|
|
28
|
+
|
|
29
|
+
Use these entrypoints:
|
|
30
|
+
|
|
31
|
+
- [`COMPONENTS.md`](./COMPONENTS.md) for the full linked component index
|
|
32
|
+
- `docs/profiles/*.yml` for per-component machine-readable profiles
|
|
33
|
+
|
|
34
|
+
Current high-signal core profiles:
|
|
35
|
+
|
|
36
|
+
- [`UiField`](./profiles/UiField.yml)
|
|
37
|
+
- [`UiTextbox`](./profiles/UiTextbox.yml)
|
|
38
|
+
- [`UiButton`](./profiles/UiButton.yml)
|
|
39
|
+
- [`UiPageHeader`](./profiles/UiPageHeader.yml)
|
|
40
|
+
- [`UiSelect`](./profiles/UiSelect.yml)
|
|
41
|
+
- [`UiRadioSwitch`](./profiles/UiRadioSwitch.yml)
|
|
42
|
+
- [`UiTabGroup`](./profiles/UiTabGroup.yml)
|
|
43
|
+
- [`UiTab`](./profiles/UiTab.yml)
|
|
44
|
+
- [`UiPopper`](./profiles/UiPopper.yml)
|
|
45
|
+
- [`UiPopperConnector`](./profiles/UiPopperConnector.yml)
|
|
46
|
+
- [`UiPopperTarget`](./profiles/UiPopperTarget.yml)
|
|
47
|
+
|
|
48
|
+
## What To Read First
|
|
49
|
+
|
|
50
|
+
- `key_props` if you need to choose a component quickly.
|
|
51
|
+
- `props` if you need a broader practical API view.
|
|
52
|
+
- `slots` if the task is about markup, zones, and allowed content.
|
|
53
|
+
- `emits` if the component must be wired into screen logic.
|
|
54
|
+
- `examples` if you need a working usage pattern quickly.
|
|
55
|
+
- `ai_notes` if the agent needs safe defaults and anti-patterns.
|
|
56
|
+
|
|
57
|
+
## Styling Reads
|
|
58
|
+
|
|
59
|
+
- Read `styling` for root classes, state classes, CSS variables, and typography.
|
|
60
|
+
- Read [`STYLING.md`](./STYLING.md) when the task is specifically about classes, visual zones, theming, or type scale.
|
|
61
|
+
|
|
62
|
+
## Notes
|
|
63
|
+
|
|
64
|
+
- All new updates should be made in YAML profiles.
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Public API Docs For `@retailcrm/embed-ui-v1-components`
|
|
2
|
+
|
|
3
|
+
This directory contains consumer-facing and AI-friendly documentation for the public API of
|
|
4
|
+
`@retailcrm/embed-ui-v1-components`.
|
|
5
|
+
|
|
6
|
+
These docs are optimized for two main scenarios:
|
|
7
|
+
|
|
8
|
+
- a developer or AI assistant is writing extension UI code and wants to use public components safely;
|
|
9
|
+
- a library maintainer is extending the docs and wants to know which description format is the most useful for agents.
|
|
10
|
+
|
|
11
|
+
## Documentation Map
|
|
12
|
+
|
|
13
|
+
- [`AI.md`](./AI.md)
|
|
14
|
+
a compact quickstart for AI agents: which entrypoint to prefer, which reading order to use,
|
|
15
|
+
and which boundaries are safe by default.
|
|
16
|
+
- [`COMPONENTS.md`](./COMPONENTS.md)
|
|
17
|
+
a catalog of public components and helpers with links to detailed component profiles.
|
|
18
|
+
- [`FORMAT.md`](./FORMAT.md)
|
|
19
|
+
the target component profile format for AI assistants.
|
|
20
|
+
- [`STYLING.md`](./STYLING.md)
|
|
21
|
+
shared guidance for reading classes, CSS variables, and typography in profiles.
|
|
22
|
+
- [`PROFILES.md`](./PROFILES.md)
|
|
23
|
+
the index of YAML component profiles.
|
|
24
|
+
|
|
25
|
+
## Public Entrypoints
|
|
26
|
+
|
|
27
|
+
- `@retailcrm/embed-ui-v1-components/remote`
|
|
28
|
+
the primary entrypoint for extension UI code
|
|
29
|
+
- `@retailcrm/embed-ui-v1-components/host`
|
|
30
|
+
the entrypoint for runtime-side integrations
|
|
31
|
+
- `@retailcrm/embed-ui-v1-components/assets/...`
|
|
32
|
+
icons and other static package assets
|
|
33
|
+
|
|
34
|
+
If you are writing regular extension code, you almost always want `remote`.
|
|
35
|
+
|
|
36
|
+
## What These Docs Optimize For
|
|
37
|
+
|
|
38
|
+
- help choose the right component for a task, not just list exports;
|
|
39
|
+
- describe actual behavior, states, and composition patterns;
|
|
40
|
+
- separate the public contract from descriptive implementation notes;
|
|
41
|
+
- give AI agents enough context to avoid relying on internal package paths.
|
|
42
|
+
|
|
43
|
+
## Important Boundary
|
|
44
|
+
|
|
45
|
+
Component profiles may describe the current DOM shape, root classes, and host-side layout,
|
|
46
|
+
but that information is meant as a mental model and a debugging aid.
|
|
47
|
+
|
|
48
|
+
It should not be treated as a public styling API for extension code unless that contract is documented explicitly.
|
|
49
|
+
|
|
50
|
+
The same rule applies to `.ui-v1-*` selectors in profile `styling` sections.
|
|
51
|
+
|
|
52
|
+
## Suggested Reading Order
|
|
53
|
+
|
|
54
|
+
If you need to generate UI quickly:
|
|
55
|
+
|
|
56
|
+
1. [`AI.md`](./AI.md)
|
|
57
|
+
2. [`COMPONENTS.md`](./COMPONENTS.md)
|
|
58
|
+
3. the relevant profile from [`PROFILES.md`](./PROFILES.md)
|
|
59
|
+
4. [`STYLING.md`](./STYLING.md) if the task is about classes, variables, typography, or layout tuning
|
|
60
|
+
|
|
61
|
+
If you are extending the docs:
|
|
62
|
+
|
|
63
|
+
1. [`FORMAT.md`](./FORMAT.md)
|
|
64
|
+
2. [`STYLING.md`](./STYLING.md)
|
|
65
|
+
3. the existing profiles in [`PROFILES.md`](./PROFILES.md)
|