@retailcrm/embed-ui-v1-components 0.9.14 → 0.9.16

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.
Files changed (78) hide show
  1. package/AGENTS.md +126 -0
  2. package/README.md +24 -0
  3. package/assets/sprites/map-and-places/navigate.svg +3 -0
  4. package/assets/stylesheets/palette.less +11 -6
  5. package/bin/embed-ui-v1-components.mjs +209 -0
  6. package/bin/postinstall.mjs +37 -0
  7. package/dist/host.cjs +2443 -657
  8. package/dist/host.css +920 -6
  9. package/dist/host.d.ts +2440 -6
  10. package/dist/host.js +2444 -658
  11. package/dist/remote.cjs +1009 -46
  12. package/dist/remote.d.ts +1240 -67
  13. package/dist/remote.js +1011 -48
  14. package/docs/AI.md +106 -0
  15. package/docs/COMPONENTS.md +99 -0
  16. package/docs/FORMAT.md +267 -0
  17. package/docs/PROFILES.md +66 -0
  18. package/docs/README.md +65 -0
  19. package/docs/STYLING.md +156 -0
  20. package/docs/profiles/UiAddButton.yml +57 -0
  21. package/docs/profiles/UiAlert.yml +48 -0
  22. package/docs/profiles/UiAvatar.yml +48 -0
  23. package/docs/profiles/UiAvatarList.yml +42 -0
  24. package/docs/profiles/UiButton.yml +229 -0
  25. package/docs/profiles/UiCalendar.yml +48 -0
  26. package/docs/profiles/UiCheckbox.yml +53 -0
  27. package/docs/profiles/UiCollapse.yml +40 -0
  28. package/docs/profiles/UiCollapseBox.yml +51 -0
  29. package/docs/profiles/UiCollapseGroup.yml +39 -0
  30. package/docs/profiles/UiCopyButton.yml +52 -0
  31. package/docs/profiles/UiDate.yml +38 -0
  32. package/docs/profiles/UiDatePicker.yml +59 -0
  33. package/docs/profiles/UiError.yml +32 -0
  34. package/docs/profiles/UiField.yml +233 -0
  35. package/docs/profiles/UiImage.yml +39 -0
  36. package/docs/profiles/UiInfobox.yml +45 -0
  37. package/docs/profiles/UiLink.yml +51 -0
  38. package/docs/profiles/UiLoader.yml +38 -0
  39. package/docs/profiles/UiMenuItem.yml +57 -0
  40. package/docs/profiles/UiMenuItemGroup.yml +50 -0
  41. package/docs/profiles/UiModalSidebar.yml +46 -0
  42. package/docs/profiles/UiModalWindow.yml +44 -0
  43. package/docs/profiles/UiModalWindowSurface.yml +41 -0
  44. package/docs/profiles/UiNumberStepper.yml +52 -0
  45. package/docs/profiles/UiPageHeader.yml +244 -0
  46. package/docs/profiles/UiPopper.yml +201 -0
  47. package/docs/profiles/UiPopperConnector.yml +115 -0
  48. package/docs/profiles/UiPopperTarget.yml +118 -0
  49. package/docs/profiles/UiRadio.yml +38 -0
  50. package/docs/profiles/UiRadioSwitch.yml +231 -0
  51. package/docs/profiles/UiRadioSwitchOption.yml +121 -0
  52. package/docs/profiles/UiScrollBox.yml +31 -0
  53. package/docs/profiles/UiSelect.yml +327 -0
  54. package/docs/profiles/UiSelectOption.yml +44 -0
  55. package/docs/profiles/UiSelectOptionGroup.yml +38 -0
  56. package/docs/profiles/UiSlider.yml +38 -0
  57. package/docs/profiles/UiSwitch.yml +37 -0
  58. package/docs/profiles/UiTab.yml +119 -0
  59. package/docs/profiles/UiTabGroup.yml +238 -0
  60. package/docs/profiles/UiTable.yml +152 -0
  61. package/docs/profiles/UiTableBodyCell.yml +47 -0
  62. package/docs/profiles/UiTableColumn.yml +50 -0
  63. package/docs/profiles/UiTableFooterButton.yml +44 -0
  64. package/docs/profiles/UiTableFooterSection.yml +38 -0
  65. package/docs/profiles/UiTableHeadCell.yml +44 -0
  66. package/docs/profiles/UiTableSorter.yml +45 -0
  67. package/docs/profiles/UiTag.yml +41 -0
  68. package/docs/profiles/UiTextbox.yml +392 -0
  69. package/docs/profiles/UiTimePicker.yml +46 -0
  70. package/docs/profiles/UiToggleButton.yml +211 -0
  71. package/docs/profiles/UiToggleGroup.yml +211 -0
  72. package/docs/profiles/UiToggleGroupOption.yml +116 -0
  73. package/docs/profiles/UiToolbarButton.yml +37 -0
  74. package/docs/profiles/UiToolbarLink.yml +32 -0
  75. package/docs/profiles/UiTooltip.yml +43 -0
  76. package/docs/profiles/UiTransition.yml +27 -0
  77. package/docs/profiles/UiYandexMap.yml +29 -0
  78. package/package.json +8 -3
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,99 @@
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
+ - [`UiToggleGroup`](./profiles/UiToggleGroup.yml): segmented multi-select group built from toggle buttons
20
+ - [`UiToggleGroupOption`](./profiles/UiToggleGroupOption.yml): rich option child for UiToggleGroup
21
+ - [`UiSwitch`](./profiles/UiSwitch.yml): state toggle
22
+ - [`UiSlider`](./profiles/UiSlider.yml): ranged value selection
23
+ - [`UiSelect`](./profiles/UiSelect.yml): select container for single or multiple choice
24
+ - [`UiSelectOption`](./profiles/UiSelectOption.yml): select option
25
+ - [`UiSelectOptionGroup`](./profiles/UiSelectOptionGroup.yml): grouped options
26
+ - [`UiDatePicker`](./profiles/UiDatePicker.yml): date or date-range selection
27
+ - [`UiTimePicker`](./profiles/UiTimePicker.yml): time selection
28
+ - [`UiCalendar`](./profiles/UiCalendar.yml): calendar primitive
29
+ - [`UiNumberStepper`](./profiles/UiNumberStepper.yml): numeric input with increment and decrement controls
30
+
31
+ ## Actions And Navigation
32
+
33
+ - [`UiButton`](./profiles/UiButton.yml): main action button that can render as a button or anchor
34
+ - [`UiToggleButton`](./profiles/UiToggleButton.yml): stateful toggle button primitive for standalone or grouped use
35
+ - [`UiAddButton`](./profiles/UiAddButton.yml): add action button
36
+ - [`UiCopyButton`](./profiles/UiCopyButton.yml): copy value action
37
+ - [`UiToolbarButton`](./profiles/UiToolbarButton.yml): toolbar button
38
+ - [`UiToolbarLink`](./profiles/UiToolbarLink.yml): toolbar link
39
+ - [`UiLink`](./profiles/UiLink.yml): text link
40
+ - [`UiMenuItem`](./profiles/UiMenuItem.yml): menu item
41
+ - [`UiMenuItemGroup`](./profiles/UiMenuItemGroup.yml): menu item group
42
+ - [`UiTabGroup`](./profiles/UiTabGroup.yml): tab navigation group with overflow handling and optional active panel
43
+ - [`UiTab`](./profiles/UiTab.yml): declarative tab child for UiTabGroup
44
+
45
+ ## Layout And Structure
46
+
47
+ - [`UiPageHeader`](./profiles/UiPageHeader.yml): page or section header with an editable title and action zone
48
+ - [`UiCollapse`](./profiles/UiCollapse.yml): collapsible section
49
+ - [`UiCollapseBox`](./profiles/UiCollapseBox.yml): collapsible container
50
+ - [`UiCollapseGroup`](./profiles/UiCollapseGroup.yml): multiple collapse coordination
51
+ - [`UiScrollBox`](./profiles/UiScrollBox.yml): scrollable container
52
+ - [`UiTransition`](./profiles/UiTransition.yml): transition wrapper
53
+
54
+ ## Feedback And Status
55
+
56
+ - [`UiAlert`](./profiles/UiAlert.yml): contextual alert or notification
57
+ - [`UiInfobox`](./profiles/UiInfobox.yml): highlighted explanatory block
58
+ - [`UiError`](./profiles/UiError.yml): compact error state
59
+ - [`UiLoader`](./profiles/UiLoader.yml): loading indicator
60
+ - [`UiTag`](./profiles/UiTag.yml): labels and statuses
61
+
62
+ ## Overlays And Modal Patterns
63
+
64
+ - [`UiModalWindow`](./profiles/UiModalWindow.yml): modal window
65
+ - [`UiModalWindowSurface`](./profiles/UiModalWindowSurface.yml): modal surface
66
+ - [`UiModalSidebar`](./profiles/UiModalSidebar.yml): sidebar modal
67
+ - [`UiTooltip`](./profiles/UiTooltip.yml): tooltip
68
+ - [`UiPopper`](./profiles/UiPopper.yml): floating layer
69
+ - [`UiPopperTarget`](./profiles/UiPopperTarget.yml): popper target
70
+ - [`UiPopperConnector`](./profiles/UiPopperConnector.yml): target-to-floating connector
71
+
72
+ ## Content And Data Display
73
+
74
+ - [`UiAvatar`](./profiles/UiAvatar.yml): avatar
75
+ - [`UiAvatarList`](./profiles/UiAvatarList.yml): avatar list
76
+ - [`UiDate`](./profiles/UiDate.yml): formatted date display
77
+ - [`UiImage`](./profiles/UiImage.yml): image display
78
+ - [`UiTable`](./profiles/UiTable.yml): table root
79
+ - [`UiTableColumn`](./profiles/UiTableColumn.yml): table column declaration
80
+ - [`UiTableHeadCell`](./profiles/UiTableHeadCell.yml): table head cell primitive
81
+ - [`UiTableBodyCell`](./profiles/UiTableBodyCell.yml): table body cell primitive
82
+ - [`UiTableFooterSection`](./profiles/UiTableFooterSection.yml): table footer section container
83
+ - [`UiTableFooterButton`](./profiles/UiTableFooterButton.yml): table footer action button
84
+ - [`UiTableSorter`](./profiles/UiTableSorter.yml): table sort control primitive
85
+ - [`UiYandexMap`](./profiles/UiYandexMap.yml): Yandex map component
86
+
87
+ ## Helpers
88
+
89
+ - `usePreview`: image preview helper
90
+ - `ImageWorkersKey`: injection key for image workers
91
+ - `formatDate`: date formatter
92
+ - `formatDateTime`: date-time formatter
93
+ - `formatTime`: time formatter
94
+
95
+ ## Public Entrypoint Rule
96
+
97
+ - For extension UI code, use `@retailcrm/embed-ui-v1-components/remote`.
98
+ - For assets, use `@retailcrm/embed-ui-v1-components/assets/...`.
99
+ - Use `@retailcrm/embed-ui-v1-components/host` only if your application is the runtime-side integration.
package/docs/FORMAT.md ADDED
@@ -0,0 +1,267 @@
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
+ rendered_structure:
56
+ descriptive_only: true
57
+ root:
58
+ shape: div.ui-v1-component
59
+ tag: div
60
+
61
+ geometry:
62
+ layout: block-like root
63
+ root_display: block
64
+ width_behavior: stretches to container width by default
65
+
66
+ styling:
67
+ root_classes:
68
+ - .ui-v1-component
69
+ css_variables:
70
+ public_theme_variables:
71
+ - name: --ui-v1-component-color
72
+ effect: theme or state color
73
+ typography:
74
+ default:
75
+ mixin: text-regular
76
+ size: 16px
77
+ line_height: 24px
78
+ weight: 400
79
+
80
+ examples:
81
+ - title: Basic example
82
+ goal: What the user or the agent is trying to build.
83
+ code: |
84
+ <UiComponent />
85
+
86
+ ai_notes:
87
+ do:
88
+ - rule
89
+ avoid:
90
+ - anti-pattern
91
+ ```
92
+
93
+ ## Required Sections
94
+
95
+ Each YAML profile should include the following conceptual sections.
96
+
97
+ ## 1. `summary`
98
+
99
+ A short paragraph, usually 2 to 4 sentences:
100
+
101
+ - what the component is;
102
+ - which role it usually plays in the UI;
103
+ - which neighboring components it is commonly used with.
104
+
105
+ ## 2. `use_when`
106
+
107
+ A list of concrete scenarios:
108
+
109
+ - when the component is a good default choice;
110
+ - which cases it covers better than neighboring components.
111
+
112
+ Keep the wording practical: "amount input", "page header", "filterable select".
113
+
114
+ ## 3. `avoid_when`
115
+
116
+ A list of cases where the component should not be chosen:
117
+
118
+ - wrong semantics;
119
+ - composition limits;
120
+ - cases where a neighboring component is a better fit.
121
+
122
+ ## 4. `public_import`
123
+
124
+ Include:
125
+
126
+ - the public entrypoint;
127
+ - the primary import;
128
+ - related public components, if they are needed for a complete scenario.
129
+
130
+ ## 5. `api`
131
+
132
+ List only high-signal API:
133
+
134
+ - key props;
135
+ - key emits;
136
+ - important slots;
137
+ - exposed methods, if they affect usage patterns.
138
+
139
+ Do not copy the entire `.d.ts` verbatim if parts of the API do not affect component choice.
140
+
141
+ Inside `api`, it is useful to distinguish:
142
+
143
+ - `key_props`
144
+ - `props`
145
+ - `slots`
146
+ - `emits`
147
+ - `methods`
148
+
149
+ ## 6. `rendered_structure`
150
+
151
+ Describe the actual rendered shape:
152
+
153
+ - the root container;
154
+ - the actual root tag or tags when they matter, for example `button`, `a`, `div`, or `span`;
155
+ - the main internal zones;
156
+ - where label, control, action area, icon area, popper content, and similar parts live;
157
+ - current root classes and state classes, if they help reasoning.
158
+
159
+ Important:
160
+
161
+ - this section is descriptive, not normative;
162
+ - state explicitly that it exists for mental modeling and debugging;
163
+ - do not present internal classes as a stable public styling API unless that contract is documented separately.
164
+
165
+ ## 7. `geometry`
166
+
167
+ Capture:
168
+
169
+ - whether the component is block-like or inline-like;
170
+ - what the root behaves like in layout terms, for example `block`, `inline-block`, `inline-flex`, or `flex`;
171
+ - what stretches to `width: 100%` and what stays content-sized;
172
+ - how the component behaves in a row, grid, header, or popper;
173
+ - which props affect dimensions: `size`, `multiline`, `autofit`, `popperFitTrigger`, and so on.
174
+
175
+ Useful optional fields:
176
+
177
+ - `root_display` for the root display mode or the common display modes when the root changes by props;
178
+ - `width_behavior` for whether the component stretches, shrinks to content, or switches between those modes;
179
+ - `notes` for short practical remarks about how the root behaves in layout and composition.
180
+
181
+ ## 8. `styling`
182
+
183
+ Capture only the styling data that helps an agent make safe decisions:
184
+
185
+ - root classes, zone classes, and state classes for reasoning and debugging;
186
+ - CSS custom properties that change theme, spacing, size, or popper behavior;
187
+ - typography mixins or resulting size, line-height, and weight values;
188
+ - whether classes and variables are descriptive implementation details or safe override points.
189
+
190
+ Inside `styling`, it is useful to distinguish:
191
+
192
+ - `root_classes`
193
+ - `state_classes`
194
+ - `zones`
195
+ - `css_variables`
196
+ - `typography`
197
+
198
+ Important:
199
+
200
+ - prefer CSS variables and documented props over selector-based overrides;
201
+ - do not present internal `.ui-v1-*` selectors as a stable public contract unless that is documented explicitly;
202
+ - say when a variable is a documented theme hook versus an internal implementation token.
203
+
204
+ ## 9. `behavior`
205
+
206
+ This is one of the most important sections for AI.
207
+
208
+ Describe:
209
+
210
+ - `disabled`, `readonly`, `invalid`, `active`, `expanded`, `multiple`, and other state props;
211
+ - when and how errors, placeholders, clear buttons, and tooltips appear;
212
+ - keyboard behavior when it matters for UX;
213
+ - interaction transitions such as click-to-edit or open-close flows.
214
+
215
+ ## 10. `accessibility`
216
+
217
+ Capture:
218
+
219
+ - which ARIA relationships the component expects or creates;
220
+ - what happens to `aria-invalid`, `aria-labelledby`, `role`, `aria-expanded`, and similar attributes;
221
+ - which keys affect behavior, if that behavior is documented.
222
+
223
+ ## 11. `examples` and `composition`
224
+
225
+ List:
226
+
227
+ - common combinations;
228
+ - required neighboring components;
229
+ - safe defaults for typical screens;
230
+ - goal-oriented examples such as "build a table", "build an editable header", or "build a field with a select";
231
+ - examples of correct and incorrect composition.
232
+
233
+ ## 12. `ai_notes`
234
+
235
+ A short list of rules specifically for code generation:
236
+
237
+ - what to do almost every time;
238
+ - what not to do;
239
+ - where it is better to admit the docs are missing than to guess.
240
+
241
+ ## Writing Rules
242
+
243
+ - Use short, concrete statements instead of vague praise.
244
+ - Use the exact names of props, emits, and slots.
245
+ - For slots, describe not only the name, but also what the slot does and which content restrictions exist.
246
+ - For styling, distinguish between safe CSS variables and descriptive class names.
247
+ - Do not mix "how the component looks right now" with "what is publicly guaranteed".
248
+ - If behavior is inferred from implementation rather than public API, say that explicitly.
249
+ - If information is missing, state the limitation rather than inventing details.
250
+
251
+ ## What Can Be Automated
252
+
253
+ The following data can usually be obtained automatically or semi-automatically:
254
+
255
+ - the list of public exports;
256
+ - prop, emit, method, and enum names;
257
+ - whether Storybook stories and examples exist;
258
+ - the current root classes and layout zones from templates.
259
+
260
+ These sections almost always need manual writing:
261
+
262
+ - when to use the component;
263
+ - which neighbors it composes with best;
264
+ - which anti-patterns are most dangerous for AI;
265
+ - which part of the DOM or CSS shape is only a descriptive model.
266
+
267
+ That split should stay documented in maintainer-only repository notes, not in the published package docs.
@@ -0,0 +1,66 @@
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
+ - [`UiToggleButton`](./profiles/UiToggleButton.yml)
40
+ - [`UiToggleGroup`](./profiles/UiToggleGroup.yml)
41
+ - [`UiPageHeader`](./profiles/UiPageHeader.yml)
42
+ - [`UiSelect`](./profiles/UiSelect.yml)
43
+ - [`UiRadioSwitch`](./profiles/UiRadioSwitch.yml)
44
+ - [`UiTabGroup`](./profiles/UiTabGroup.yml)
45
+ - [`UiTab`](./profiles/UiTab.yml)
46
+ - [`UiPopper`](./profiles/UiPopper.yml)
47
+ - [`UiPopperConnector`](./profiles/UiPopperConnector.yml)
48
+ - [`UiPopperTarget`](./profiles/UiPopperTarget.yml)
49
+
50
+ ## What To Read First
51
+
52
+ - `key_props` if you need to choose a component quickly.
53
+ - `props` if you need a broader practical API view.
54
+ - `slots` if the task is about markup, zones, and allowed content.
55
+ - `emits` if the component must be wired into screen logic.
56
+ - `examples` if you need a working usage pattern quickly.
57
+ - `ai_notes` if the agent needs safe defaults and anti-patterns.
58
+
59
+ ## Styling Reads
60
+
61
+ - Read `styling` for root classes, state classes, CSS variables, and typography.
62
+ - Read [`STYLING.md`](./STYLING.md) when the task is specifically about classes, visual zones, theming, or type scale.
63
+
64
+ ## Notes
65
+
66
+ - 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)