@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
@@ -0,0 +1,156 @@
1
+ # Styling Notes For AI
2
+
3
+ This document explains how to read styling information in `v1-components` profiles.
4
+
5
+ It exists to help AI agents reason about geometry, theming, and typography without treating
6
+ internal selectors as a guaranteed public styling API.
7
+
8
+ ## Boundary
9
+
10
+ - `.ui-v1-*` classes in profiles are primarily descriptive.
11
+ - Use them for mental modeling, debugging, and understanding layout zones.
12
+ - Prefer props and documented CSS custom properties over selector-based overrides.
13
+ - If a profile marks a variable as internal, do not treat it as a stable extension theming hook.
14
+
15
+ ## Shared Stylesheet Map
16
+
17
+ Most host component styles are built from the shared LESS files in
18
+ [`assets/stylesheets`](../assets/stylesheets/).
19
+
20
+ Use this map when a profile references shared tokens or mixins:
21
+
22
+ - [`typography.less`](../assets/stylesheets/typography.less)
23
+ primary source for font family, type scale, and typography mixins such as `h2-accent`,
24
+ `text-regular`, `text-small-accent`, and `text-tiny`.
25
+ - [`palette.less`](../assets/stylesheets/palette.less)
26
+ primary source for semantic color families such as `@blue-500`, `@grey-700`,
27
+ `@red-transparent`, and similar tokens.
28
+ - [`geometry.less`](../assets/stylesheets/geometry.less)
29
+ primary source for radius tokens and reusable geometry mixins such as
30
+ `reset-box-sizing`, `square`, `circle`, `border-radius-start`, and `border-radius-end`.
31
+ - [`variables.less`](../assets/stylesheets/variables.less)
32
+ primary source for shared spacing, drop shadows, and the common transition token used by
33
+ many components.
34
+ - [`motion.less`](../assets/stylesheets/motion.less)
35
+ narrow motion helper that currently repeats the shared transition token shape.
36
+ - [`layout.less`](../assets/stylesheets/layout.less)
37
+ legacy or narrow layout spacing aliases. Use with care and prefer `variables.less` when a
38
+ component already imports that file.
39
+
40
+ ## Component-Local Stylesheets
41
+
42
+ Some components also have local `variables.less` files next to the component styles.
43
+ Those files live in the source repository and are not part of the published package.
44
+
45
+ Typical examples include button, link, and modal component tokens.
46
+
47
+ These files usually define component-scale dimensions, icon sizes, or z-index-like local tokens.
48
+
49
+ Guideline:
50
+
51
+ - treat shared stylesheets as the primary design token layer;
52
+ - treat component-local `variables.less` as component-specific implementation tokens;
53
+ - mention local variables in a profile when they materially affect layout or generated markup decisions.
54
+
55
+ ## What To Read In A Profile
56
+
57
+ When a task is about styling or layout, read the `styling` section of the component profile:
58
+
59
+ - `root_classes`
60
+ - `state_classes`
61
+ - `zones`
62
+ - `css_variables`
63
+ - `typography`
64
+
65
+ This is the fastest path for questions like:
66
+
67
+ - which element actually owns the underline or border;
68
+ - which CSS variable changes popper padding or textbox active color;
69
+ - which typography scale is used by a given size variant;
70
+ - whether a slot creates a separate visual segment or just inline content.
71
+
72
+ ## Typography Scale
73
+
74
+ The shared type scale comes from [`../assets/stylesheets/typography.less`](../assets/stylesheets/typography.less).
75
+
76
+ Base font family:
77
+
78
+ - `-apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Roboto", sans-serif`
79
+
80
+ Main sizes:
81
+
82
+ - `h1`: `40px / 44px`
83
+ - `h2`: `24px / 32px`
84
+ - `h3`: `20px / 32px`
85
+ - `h4`: `18px / 28px`
86
+ - `text-regular`: `16px / 24px`
87
+ - `text-small`: `14px / 20px`
88
+ - `text-tiny`: `12px / 14px`
89
+
90
+ Common weights:
91
+
92
+ - normal: `400`
93
+ - accent: `500`
94
+
95
+ Notes:
96
+
97
+ - some accent heading mixins use stronger weights than the shared `@font-weight-accent` token;
98
+ - profiles should prefer recording the actual applied weight when it matters;
99
+ - size props often switch both geometry and typography together.
100
+
101
+ ## Spacing, Radius, And Motion Tokens
102
+
103
+ High-signal shared tokens:
104
+
105
+ - spacing from [`variables.less`](../assets/stylesheets/variables.less):
106
+ `@spacing-xxs`, `@spacing-xs`, `@spacing-s`, `@spacing-m`, `@spacing-l`, `@spacing-xl`, `@spacing-xxl`
107
+ - radius from [`geometry.less`](../assets/stylesheets/geometry.less):
108
+ `@border-radius-sm`, `@border-radius-md`, `@border-radius-lg`
109
+ - transition from [`variables.less`](../assets/stylesheets/variables.less) and [`motion.less`](../assets/stylesheets/motion.less):
110
+ `@transition`
111
+
112
+ When documenting a component profile:
113
+
114
+ - mention these tokens when they directly shape slot zones, paddings, or component sizes;
115
+ - avoid dumping every imported token if it does not affect component choice or layout reasoning.
116
+
117
+ ## CSS Variable Guidance
118
+
119
+ Profiles split CSS variables into practical groups:
120
+
121
+ - `public_theme_variables`
122
+ use these first when you need color, spacing, or popper-level theming.
123
+ - `inherited_component_variables`
124
+ variables reused from neighboring components, such as `UiSelect` reusing textbox color variables.
125
+ - `internal_layout_variables`
126
+ useful for reasoning and debugging, but not recommended as external override points.
127
+
128
+ ## Typical Safe Strategy
129
+
130
+ For style-sensitive generation:
131
+
132
+ 1. choose the correct component and size prop first;
133
+ 2. use documented slots to create the right visual zones;
134
+ 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.
136
+
137
+ ## How To Mention Styles In Profiles
138
+
139
+ A good `styling` section should answer:
140
+
141
+ - which shared stylesheet family the component mostly depends on;
142
+ - which root and state classes are useful for debugging;
143
+ - which CSS variables are realistic override points;
144
+ - which typography mixin or resulting type scale is active;
145
+ - whether local component variables materially affect size or geometry.
146
+
147
+ Do not try to mirror every imported token from LESS files. Keep only decision-making signal.
148
+
149
+ ## Reference Surface
150
+
151
+ - `assets/stylesheets/typography.less`
152
+ - `assets/stylesheets/palette.less`
153
+ - `assets/stylesheets/geometry.less`
154
+ - `assets/stylesheets/variables.less`
155
+ - `assets/stylesheets/layout.less`
156
+ - `assets/stylesheets/motion.less`
@@ -0,0 +1,57 @@
1
+ component: UiAddButton
2
+ summary: >
3
+ UiAddButton is an action-first button for add or create flows. It is close to UiButton,
4
+ but tuned for "create another item" scenarios and supports small descriptive additions.
5
+
6
+ public_import:
7
+ from: '@retailcrm/embed-ui-v1-components/remote'
8
+ named:
9
+ - UiAddButton
10
+
11
+ related_components:
12
+ - UiButton
13
+ - UiToolbarButton
14
+
15
+ use_when:
16
+ - You need a dedicated create or add action.
17
+ - You need a compact add CTA with optional extra description.
18
+
19
+ avoid_when:
20
+ - You need a regular text link.
21
+ - You need a generic button without add semantics.
22
+
23
+ api:
24
+ key_props:
25
+ - name: color
26
+ - name: small
27
+ - name: disabled
28
+ - name: height
29
+ slots:
30
+ - name: icon
31
+ zone: leading-icon
32
+ creates: Leading icon area for the add action.
33
+ - name: description
34
+ zone: secondary-copy
35
+ creates: Optional secondary description near the main label.
36
+
37
+ rendered_structure:
38
+ descriptive_only: true
39
+ root:
40
+ shape: button.ui-v1-add-button
41
+ tag: button
42
+ notes: Current root is a single action button with optional icon and description zones.
43
+
44
+ geometry:
45
+ layout: button-like action root
46
+ root_display: flex
47
+ width_behavior: content-sized by default
48
+
49
+ behavior:
50
+ notes:
51
+ - Behaves like a clickable add action with standard button focus and click semantics.
52
+
53
+ ai_notes:
54
+ do:
55
+ - Use for create and add flows rather than generic submit actions.
56
+ avoid:
57
+ - Do not replace a plain UiButton unless the add semantics are intentional.
@@ -0,0 +1,48 @@
1
+ component: UiAlert
2
+ summary: >
3
+ UiAlert is a compact contextual message block for status, warning, success, and danger feedback.
4
+ It can be shown inline in normal page flow and can be closable.
5
+
6
+ public_import:
7
+ from: '@retailcrm/embed-ui-v1-components/remote'
8
+ named:
9
+ - UiAlert
10
+
11
+ use_when:
12
+ - You need inline status feedback.
13
+ - You need dismissible page-level or section-level notice content.
14
+
15
+ avoid_when:
16
+ - You need a blocking modal message.
17
+ - You need a tiny field-level validation hint.
18
+
19
+ api:
20
+ key_props:
21
+ - name: variant
22
+ - name: text
23
+ - name: shown
24
+ - name: closable
25
+ - name: fluid
26
+
27
+ rendered_structure:
28
+ descriptive_only: true
29
+ root:
30
+ shape: div.ui-v1-alert
31
+ tag: div
32
+ notes: Current alert body is wrapped in UiTransition and uses one flex row for icon, content, and optional closer.
33
+
34
+ geometry:
35
+ layout: block-like feedback row
36
+ root_display: flex
37
+ width_behavior: stretches to container width by default
38
+
39
+ behavior:
40
+ notes:
41
+ - shown controls visibility.
42
+ - closable enables user dismissal.
43
+
44
+ ai_notes:
45
+ do:
46
+ - Use UiAlert for inline feedback that should stay in normal layout flow.
47
+ avoid:
48
+ - Do not use it as a replacement for modal confirmation.
@@ -0,0 +1,48 @@
1
+ component: UiAvatar
2
+ summary: >
3
+ UiAvatar renders a user or entity avatar with optional name, status, and link semantics.
4
+ It is meant for compact identity display rather than generic image rendering.
5
+
6
+ public_import:
7
+ from: '@retailcrm/embed-ui-v1-components/remote'
8
+ named:
9
+ - UiAvatar
10
+
11
+ use_when:
12
+ - You need a compact identity marker for a user or contact.
13
+ - You need avatar display with optional status.
14
+
15
+ avoid_when:
16
+ - You need a generic content image.
17
+ - You need a large media block.
18
+
19
+ api:
20
+ key_props:
21
+ - name: src
22
+ - name: name
23
+ - name: status
24
+ - name: size
25
+ - name: href
26
+
27
+ rendered_structure:
28
+ descriptive_only: true
29
+ root:
30
+ shape: div.ui-v1-avatar or a.ui-v1-avatar
31
+ tag: div or a
32
+ notes: The root switches to anchor when href is provided.
33
+
34
+ geometry:
35
+ layout: avatar frame
36
+ root_display: inline-block
37
+ width_behavior: content-sized by size
38
+
39
+ behavior:
40
+ notes:
41
+ - Can render linked avatar behavior when href is provided.
42
+ - Name is useful as fallback identity information.
43
+
44
+ ai_notes:
45
+ do:
46
+ - Use UiAvatar for identity display, not for general media.
47
+ avoid:
48
+ - Do not use it where UiImage is the better semantic fit.
@@ -0,0 +1,42 @@
1
+ component: UiAvatarList
2
+ summary: >
3
+ UiAvatarList renders a compact list of avatars with consistent sizing. It is useful for showing
4
+ several users or actors in a narrow area.
5
+
6
+ public_import:
7
+ from: '@retailcrm/embed-ui-v1-components/remote'
8
+ named:
9
+ - UiAvatarList
10
+
11
+ related_components:
12
+ - UiAvatar
13
+
14
+ use_when:
15
+ - You need a short list of user avatars.
16
+ - You need a compact representation of several people.
17
+
18
+ avoid_when:
19
+ - You need full profile cards or detailed user rows.
20
+
21
+ api:
22
+ key_props:
23
+ - name: avatars
24
+ - name: size
25
+
26
+ rendered_structure:
27
+ descriptive_only: true
28
+ root:
29
+ shape: div.ui-v1-avatar-list
30
+ tag: div
31
+ notes: Renders one wrapper around a compact row of avatars.
32
+
33
+ geometry:
34
+ layout: inline avatar row
35
+ root_display: flex
36
+ width_behavior: content-sized by default
37
+
38
+ ai_notes:
39
+ do:
40
+ - Use for compact grouped identity display.
41
+ avoid:
42
+ - Do not use it as a replacement for a full people list.
@@ -0,0 +1,229 @@
1
+ component: UiButton
2
+ summary: >
3
+ UiButton is the main action component in the library. It covers primary, secondary,
4
+ tertiary, and outlined use cases, can render as either a button or an anchor,
5
+ and adapts well to text-plus-icon and icon-only content.
6
+
7
+ public_import:
8
+ from: '@retailcrm/embed-ui-v1-components/remote'
9
+ named:
10
+ - UiButton
11
+
12
+ use_when:
13
+ - You need a primary or secondary action in a form or screen.
14
+ - You need an inline action in a header, modal, infobox, or toolbar-like area.
15
+ - You need a clickable element that follows the standard visual language.
16
+ - You need a link that should read visually as a button.
17
+
18
+ avoid_when:
19
+ - You need an inline text link in copy, use UiLink instead.
20
+ - You need toolbar-specific semantics, use UiToolbarButton or UiToolbarLink instead.
21
+ - You need a toggle with its own state model, not a simple action.
22
+
23
+ api:
24
+ key_props:
25
+ - name: appearance
26
+ values:
27
+ - primary
28
+ - secondary
29
+ - tertiary
30
+ - outlined
31
+ notes: Defines visual priority.
32
+ - name: variant
33
+ values:
34
+ - default
35
+ - success
36
+ - danger
37
+ notes: Defines semantic color treatment.
38
+ - name: size
39
+ values:
40
+ - lg
41
+ - md
42
+ - sm
43
+ - xs
44
+ notes: Affects height and paddings.
45
+ - name: href
46
+ notes: If present, the root renders as an anchor.
47
+ - name: disabled
48
+ notes: Disables interaction and enables disabled styling.
49
+ props:
50
+ - name: type
51
+ notes: Native button type for button shape.
52
+ - name: active
53
+ notes: Enables pressed-like visual state.
54
+ - name: locked
55
+ notes: Separate locked state distinct from disabled.
56
+ slots:
57
+ - name: default
58
+ zone: content
59
+ creates: The full inner content of the button.
60
+ accepts:
61
+ recommended:
62
+ - text
63
+ - text plus one icon
64
+ - icon component
65
+ - svg
66
+ avoid:
67
+ - block layout containers
68
+ - nested buttons or links
69
+ - long rich markup trees
70
+ layout_effect: Text and icon nodes are normalized into inner spans; icon-only content can produce a square button.
71
+ notes: Main button content, usually text plus optional icons.
72
+ methods:
73
+ - name: click
74
+ notes: Triggers a click programmatically.
75
+ - name: focus
76
+ notes: Focuses the button or anchor root.
77
+ - name: blur
78
+ notes: Removes focus.
79
+
80
+ rendered_structure:
81
+ descriptive_only: true
82
+ notes: >
83
+ This internal DOM description is useful for reasoning, not for styling against implementation details.
84
+ root:
85
+ button_shape: button.ui-v1-button
86
+ button_tag: button
87
+ link_shape: a.ui-v1-button
88
+ link_tag: a
89
+ zones:
90
+ - .ui-v1-button__content
91
+ - text span
92
+ - icon span(s)
93
+ state_classes:
94
+ - .ui-v1-button_active
95
+ - .ui-v1-button_disabled
96
+ - .ui-v1-button_locked
97
+
98
+ geometry:
99
+ layout: inline-block
100
+ root_display:
101
+ default_button: inline-block
102
+ default_link: inline-block
103
+ width_behavior: content-sized by default
104
+ notes:
105
+ - Fits naturally into inline rows and action strips.
106
+ - Does not behave like a full-width block unless constrained by the parent layout.
107
+ - Size controls dimensions and internal paddings.
108
+ - Icon-only content leads to a square-like layout through state classes.
109
+ - The component fits naturally into inline rows, header actions, and compact action zones.
110
+
111
+ styling:
112
+ notes:
113
+ - Props like appearance, variant, size, active, locked, and disabled are the primary styling API.
114
+ - Internal classes are useful for reasoning and debugging, not a guaranteed selector contract.
115
+ - The component uses local CSS variables internally, but no dedicated external theme variable set is documented for consumers.
116
+ root_classes:
117
+ - .ui-v1-button
118
+ state_classes:
119
+ - .ui-v1-button_primary
120
+ - .ui-v1-button_secondary
121
+ - .ui-v1-button_tertiary
122
+ - .ui-v1-button_outlined
123
+ - .ui-v1-button_success
124
+ - .ui-v1-button_danger
125
+ - .ui-v1-button_active
126
+ - .ui-v1-button_disabled
127
+ - .ui-v1-button_locked
128
+ - .ui-v1-button_filled
129
+ - .ui-v1-button_square
130
+ - .ui-v1-button_has-leading-icon
131
+ - .ui-v1-button_has-trailing-icon
132
+ - .ui-v1-button_lg
133
+ - .ui-v1-button_md
134
+ - .ui-v1-button_sm
135
+ - .ui-v1-button_xs
136
+ zones:
137
+ - .ui-v1-button__content
138
+ - .ui-v1-button__icon
139
+ - .ui-v1-button__text
140
+ css_variables:
141
+ internal_layout_variables:
142
+ - name: --text-color
143
+ effect: Current text and icon color.
144
+ - name: --background-color
145
+ effect: Current background color for appearance variants.
146
+ - name: --background-color-active
147
+ effect: Active background color for variants that use it.
148
+ - name: --background-color-disabled
149
+ effect: Disabled background color for variants that use it.
150
+ - name: --background-image
151
+ effect: Gradient background for appearances that use it.
152
+ - name: --border-color-active
153
+ effect: Active border color in tertiary mode.
154
+ - name: --border-color-hover
155
+ effect: Hover border color in tertiary mode.
156
+ - name: --outlined-color-main
157
+ effect: Main outline and hover-fill color in outlined mode.
158
+ - name: --outlined-color-reverse
159
+ effect: Text color after outlined hover or active inversion.
160
+ typography:
161
+ size_variants:
162
+ - name: lg
163
+ mixin: h4-accent
164
+ size: 18px
165
+ line_height: 28px
166
+ weight: 500
167
+ - name: md
168
+ mixin: text-regular-accent
169
+ size: 16px
170
+ line_height: 24px
171
+ weight: 500
172
+ - name: sm
173
+ mixin: text-small-accent
174
+ size: 14px
175
+ line_height: 20px
176
+ weight: 500
177
+ - name: xs
178
+ mixin: text-tiny-accent
179
+ size: 12px
180
+ line_height: 14px
181
+ weight: 500
182
+ notes:
183
+ - Primary buttons explicitly use medium-like weight.
184
+ - Outlined buttons raise weight further for stronger label contrast.
185
+
186
+ behavior:
187
+ states:
188
+ - name: appearance
189
+ notes: Selects the base visual priority.
190
+ - name: variant
191
+ notes: Changes semantic color without changing component type.
192
+ - name: active
193
+ notes: Enables pressed-like styling.
194
+ - name: disabled
195
+ notes: Disables interaction and native button behavior.
196
+ - name: locked
197
+ notes: Enables the separate locked state.
198
+ notes:
199
+ - If href is present, the component becomes a link-shaped action.
200
+
201
+ accessibility:
202
+ notes:
203
+ - Button shape uses native button semantics.
204
+ - Anchor shape uses native anchor semantics.
205
+ - If icons are present, text labeling should remain understandable.
206
+
207
+ composition:
208
+ works_well_with:
209
+ - UiPageHeader actions
210
+ - UiField
211
+ - UiInfobox
212
+ - modal actions
213
+
214
+ examples:
215
+ - title: Dangerous secondary action
216
+ goal: Build a secondary destructive action.
217
+ code: |
218
+ <UiButton appearance="secondary" variant="danger">
219
+ <IconDelete aria-hidden="true" />
220
+ Delete
221
+ </UiButton>
222
+
223
+ ai_notes:
224
+ do:
225
+ - Start with appearance=primary for the main CTA.
226
+ - Use secondary or tertiary for neighboring actions near titles.
227
+ avoid:
228
+ - Do not replace UiButton with UiLink when the action should read as a button.
229
+ - Do not use UiButton for regular inline text navigation.
@@ -0,0 +1,48 @@
1
+ component: UiCalendar
2
+ summary: >
3
+ UiCalendar is the date selection primitive behind date and date-range flows. It supports
4
+ single and range selection, multiple visual appearances, and locale-sensitive behavior.
5
+
6
+ public_import:
7
+ from: '@retailcrm/embed-ui-v1-components/remote'
8
+ named:
9
+ - UiCalendar
10
+
11
+ use_when:
12
+ - You need inline date selection.
13
+ - You need single-date or date-range picking without a textbox wrapper.
14
+
15
+ avoid_when:
16
+ - You need the full textbox-plus-popper date picker flow.
17
+
18
+ api:
19
+ key_props:
20
+ - name: value
21
+ - name: type
22
+ - name: appearance
23
+ - name: minDate
24
+ - name: maxDate
25
+ - name: locale
26
+
27
+ rendered_structure:
28
+ descriptive_only: true
29
+ root:
30
+ shape: div.ui-v1-calendar
31
+ tag: div
32
+ notes: The root contains header controls, weekday labels, and the date grid.
33
+
34
+ geometry:
35
+ layout: block-like calendar panel
36
+ root_display: flex
37
+ width_behavior: stretches to container width by default
38
+
39
+ behavior:
40
+ notes:
41
+ - Supports single and range selection.
42
+ - minDate and maxDate constrain selection.
43
+
44
+ ai_notes:
45
+ do:
46
+ - Use UiCalendar when inline calendar selection is the actual UI.
47
+ avoid:
48
+ - Use UiDatePicker instead if users expect textbox plus popup behavior.
@@ -0,0 +1,53 @@
1
+ component: UiCheckbox
2
+ summary: >
3
+ UiCheckbox is a boolean or set-membership control. It supports single boolean-like usage
4
+ as well as model-plus-value patterns for checkbox groups.
5
+
6
+ public_import:
7
+ from: '@retailcrm/embed-ui-v1-components/remote'
8
+ named:
9
+ - UiCheckbox
10
+
11
+ use_when:
12
+ - You need a yes or no control.
13
+ - You need one value inside a checkbox group model.
14
+
15
+ avoid_when:
16
+ - You need exclusive single choice, use UiRadio instead.
17
+ - You need a more compact toggle-like control, use UiSwitch instead.
18
+
19
+ api:
20
+ key_props:
21
+ - name: model
22
+ - name: value
23
+ - name: indeterminate
24
+ - name: valueOfTruthy
25
+ - name: valueOfFalsy
26
+ - name: disabled
27
+ methods:
28
+ - name: click
29
+ - name: focus
30
+ - name: blur
31
+
32
+ rendered_structure:
33
+ descriptive_only: true
34
+ root:
35
+ shape: span.ui-v1-checkbox
36
+ tag: span
37
+ notes: One inline wrapper around the visual checkbox control and label content.
38
+
39
+ geometry:
40
+ layout: inline checkbox control
41
+ root_display: inline-flex
42
+ width_behavior: content-sized by default
43
+
44
+ behavior:
45
+ notes:
46
+ - model plus value supports group-style selection.
47
+ - indeterminate is useful for partial selection states.
48
+
49
+ ai_notes:
50
+ do:
51
+ - Use for boolean choice or checkbox-group membership.
52
+ avoid:
53
+ - Do not use for mutually exclusive options.