@retailcrm/embed-ui-v1-components 0.9.13 → 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 +1900 -590
- package/dist/host.css +659 -6
- package/dist/host.d.ts +2374 -50
- package/dist/host.js +1901 -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 +11 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
component: UiNumberStepper
|
|
2
|
+
summary: >
|
|
3
|
+
UiNumberStepper is a numeric input with increase and decrease controls. It is built for
|
|
4
|
+
constrained numeric entry where arrowing and step-based changes matter.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiNumberStepper
|
|
10
|
+
|
|
11
|
+
related_components:
|
|
12
|
+
- UiTextbox
|
|
13
|
+
|
|
14
|
+
use_when:
|
|
15
|
+
- You need numeric input with explicit step controls.
|
|
16
|
+
- You need range constraints and nullable numeric state.
|
|
17
|
+
|
|
18
|
+
avoid_when:
|
|
19
|
+
- You need plain text or decimal input without stepper controls.
|
|
20
|
+
|
|
21
|
+
api:
|
|
22
|
+
key_props:
|
|
23
|
+
- name: value
|
|
24
|
+
- name: min
|
|
25
|
+
- name: max
|
|
26
|
+
- name: step
|
|
27
|
+
- name: decimals
|
|
28
|
+
- name: clamp
|
|
29
|
+
- name: nullable
|
|
30
|
+
- name: direction
|
|
31
|
+
methods:
|
|
32
|
+
- name: focus
|
|
33
|
+
- name: blur
|
|
34
|
+
- name: increase
|
|
35
|
+
- name: decrease
|
|
36
|
+
|
|
37
|
+
behavior:
|
|
38
|
+
notes:
|
|
39
|
+
- Can clamp values into range.
|
|
40
|
+
- Supports horizontal and vertical direction.
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
component: UiPageHeader
|
|
2
|
+
summary: >
|
|
3
|
+
UiPageHeader is a page or major section header with an optional inline addon next to the title
|
|
4
|
+
and an optional actions area on the right. In display state it renders the title as a semantic h1;
|
|
5
|
+
in edit state it switches to UiTextbox.
|
|
6
|
+
|
|
7
|
+
public_import:
|
|
8
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
9
|
+
named:
|
|
10
|
+
- UiPageHeader
|
|
11
|
+
|
|
12
|
+
related_components:
|
|
13
|
+
- UiButton
|
|
14
|
+
- UiLink
|
|
15
|
+
- UiTextbox
|
|
16
|
+
- UiPopperConnector
|
|
17
|
+
- UiPopperTarget
|
|
18
|
+
|
|
19
|
+
use_when:
|
|
20
|
+
- You need the main title of an extension page.
|
|
21
|
+
- You need inline title editing.
|
|
22
|
+
- You need a small inline addon near the title, such as UiLink.
|
|
23
|
+
- You need compact right-aligned actions.
|
|
24
|
+
|
|
25
|
+
avoid_when:
|
|
26
|
+
- You need a regular form label.
|
|
27
|
+
- You need a small section title without page-header semantics.
|
|
28
|
+
- You need a multi-line editor rather than inline title editing.
|
|
29
|
+
|
|
30
|
+
api:
|
|
31
|
+
key_props:
|
|
32
|
+
- name: value
|
|
33
|
+
notes: Main title text.
|
|
34
|
+
- name: placeholder
|
|
35
|
+
notes: Placeholder for empty editable state.
|
|
36
|
+
- name: editable
|
|
37
|
+
notes: Enables the h1 -> UiTextbox -> h1 cycle.
|
|
38
|
+
- name: invalid
|
|
39
|
+
notes: Used for error styling and the empty-title tooltip scenario.
|
|
40
|
+
- name: error
|
|
41
|
+
notes: Required for the tooltip in remote mode when invalid and empty.
|
|
42
|
+
props:
|
|
43
|
+
- name: autofocus
|
|
44
|
+
notes: Focuses edit state after mount.
|
|
45
|
+
- name: autoselect
|
|
46
|
+
notes: Selects the current value inside the textbox on focus.
|
|
47
|
+
- name: readonly
|
|
48
|
+
notes: Blocks entering edit mode.
|
|
49
|
+
- name: disabled
|
|
50
|
+
notes: Blocks interaction completely.
|
|
51
|
+
slots:
|
|
52
|
+
- name: addon
|
|
53
|
+
zone: inline sibling near title
|
|
54
|
+
creates: An inline addon area next to the title.
|
|
55
|
+
accepts:
|
|
56
|
+
recommended:
|
|
57
|
+
- UiLink
|
|
58
|
+
- short text
|
|
59
|
+
- compact inline status
|
|
60
|
+
avoid:
|
|
61
|
+
- full form layout
|
|
62
|
+
- wide content blocks
|
|
63
|
+
- content that should belong to the tooltip target
|
|
64
|
+
layout_effect: Renders as a sibling next to the title inside the main area.
|
|
65
|
+
notes: >
|
|
66
|
+
Inline content near the title, for example UiLink. This slot lives as a sibling next to the
|
|
67
|
+
title and should not be placed inside the tooltip target.
|
|
68
|
+
- name: actions
|
|
69
|
+
zone: right-side actions
|
|
70
|
+
creates: A compact right-aligned actions area.
|
|
71
|
+
accepts:
|
|
72
|
+
recommended:
|
|
73
|
+
- UiButton
|
|
74
|
+
- UiToolbarButton
|
|
75
|
+
- UiToolbarLink
|
|
76
|
+
- one or two compact actions
|
|
77
|
+
avoid:
|
|
78
|
+
- full form groups
|
|
79
|
+
- wide content blocks
|
|
80
|
+
- large multi-row layouts
|
|
81
|
+
layout_effect: Stays in the right-side action zone and should remain compact.
|
|
82
|
+
notes: Compact actions on the right, usually UiButton or toolbar-like actions.
|
|
83
|
+
emits:
|
|
84
|
+
- name: update:value
|
|
85
|
+
payload: string
|
|
86
|
+
notes: Main title update channel.
|
|
87
|
+
- name: focus
|
|
88
|
+
payload: FocusEvent
|
|
89
|
+
notes: Forwarded from the inner textbox.
|
|
90
|
+
- name: blur
|
|
91
|
+
payload: FocusEvent
|
|
92
|
+
notes: Forwarded from the inner textbox.
|
|
93
|
+
- name: change
|
|
94
|
+
payload: Event
|
|
95
|
+
notes: Forwarded from the inner textbox.
|
|
96
|
+
- name: keydown
|
|
97
|
+
payload: KeyboardEvent
|
|
98
|
+
notes: Forwarded from the inner textbox.
|
|
99
|
+
methods:
|
|
100
|
+
- name: focus
|
|
101
|
+
notes: Enters edit state and focuses the textbox.
|
|
102
|
+
- name: blur
|
|
103
|
+
notes: Blurs the textbox.
|
|
104
|
+
|
|
105
|
+
rendered_structure:
|
|
106
|
+
descriptive_only: true
|
|
107
|
+
notes: >
|
|
108
|
+
This structure is useful for reasoning and debugging, not as a public styling API.
|
|
109
|
+
root: .ui-v1-page-header
|
|
110
|
+
zones:
|
|
111
|
+
- .ui-v1-page-header__main
|
|
112
|
+
- .ui-v1-page-header__title
|
|
113
|
+
- .ui-v1-page-header__addon
|
|
114
|
+
- .ui-v1-page-header__actions
|
|
115
|
+
- h1.ui-v1-page-header__trigger in display state
|
|
116
|
+
- UiTextbox.ui-v1-page-header__textbox in edit state
|
|
117
|
+
remote_overlay_notes:
|
|
118
|
+
- The tooltip is anchored to the title area through UiPopperConnector and UiPopperTarget.
|
|
119
|
+
- The addon renders as a sibling next to the title, not inside the tooltip target.
|
|
120
|
+
|
|
121
|
+
geometry:
|
|
122
|
+
layout: flex
|
|
123
|
+
notes:
|
|
124
|
+
- Root uses justify-content space-between and can wrap.
|
|
125
|
+
- The main area contains title and optional addon.
|
|
126
|
+
- The actions area stays compact on the right.
|
|
127
|
+
- The display-state title draws an underline aligned with the underline textbox style.
|
|
128
|
+
- In edit state, the textbox uses size=xl, autofit, and outlined=false.
|
|
129
|
+
|
|
130
|
+
styling:
|
|
131
|
+
notes:
|
|
132
|
+
- UiPageHeader styling is split between the page-header root and the inner UiTextbox used during edit state.
|
|
133
|
+
- Prefer editable, invalid, disabled, and slot composition before custom CSS.
|
|
134
|
+
- Classes below are descriptive hooks, not a stable public selector API.
|
|
135
|
+
root_classes:
|
|
136
|
+
- .ui-v1-page-header
|
|
137
|
+
state_classes:
|
|
138
|
+
- .ui-v1-page-header_disabled
|
|
139
|
+
- .ui-v1-page-header_invalid
|
|
140
|
+
- .ui-v1-page-header__trigger_editable
|
|
141
|
+
- .ui-v1-page-header__trigger_empty
|
|
142
|
+
zones:
|
|
143
|
+
- .ui-v1-page-header__main
|
|
144
|
+
- .ui-v1-page-header__title
|
|
145
|
+
- .ui-v1-page-header__addon
|
|
146
|
+
- .ui-v1-page-header__actions
|
|
147
|
+
- .ui-v1-page-header__trigger
|
|
148
|
+
- .ui-v1-page-header__textbox
|
|
149
|
+
css_variables:
|
|
150
|
+
public_theme_variables:
|
|
151
|
+
- name: --ui-v1-page-header-danger-color
|
|
152
|
+
effect: Invalid title color and underline color.
|
|
153
|
+
- name: --ui-v1-page-header-danger-shadow-color
|
|
154
|
+
effect: Invalid shadow color for the editing textbox.
|
|
155
|
+
internal_layout_variables:
|
|
156
|
+
- name: --ui-v1-page-header-primary-color
|
|
157
|
+
effect: Derived active title color, often provided through invalid or focus flow.
|
|
158
|
+
- name: --ui-v1-page-header-primary-shadow-color
|
|
159
|
+
effect: Derived active shadow color for the editing textbox.
|
|
160
|
+
- name: --border-color
|
|
161
|
+
effect: Display-state underline color on the editable trigger.
|
|
162
|
+
typography:
|
|
163
|
+
title:
|
|
164
|
+
mixin: h2-accent
|
|
165
|
+
size: 24px
|
|
166
|
+
line_height: 32px
|
|
167
|
+
weight: 500
|
|
168
|
+
notes:
|
|
169
|
+
- The display h1 and the edit-state textbox share the same title typography.
|
|
170
|
+
- Addon and actions keep their own component typography and should not be forced into the title scale.
|
|
171
|
+
|
|
172
|
+
behavior:
|
|
173
|
+
states:
|
|
174
|
+
- name: editable
|
|
175
|
+
notes: Enables the h1 -> UiTextbox -> h1 cycle.
|
|
176
|
+
- name: non-editable
|
|
177
|
+
notes: Leaves the title as a regular h1 and should not break native text selection.
|
|
178
|
+
- name: readonly
|
|
179
|
+
notes: Blocks entering edit state.
|
|
180
|
+
- name: disabled
|
|
181
|
+
notes: Blocks interaction completely.
|
|
182
|
+
- name: invalid
|
|
183
|
+
notes: Is visually meaningful only when the value is empty.
|
|
184
|
+
notes:
|
|
185
|
+
- Click, Enter, and Space enter edit state when editable is true.
|
|
186
|
+
- Enter finishes editing and returns to display state unless a blocking error state is active.
|
|
187
|
+
- Placeholder is shown when value is empty.
|
|
188
|
+
- If invalid=true, value is empty, and error is present, remote mode shows a tooltip.
|
|
189
|
+
- While invalid + empty + error is active, the component stays in edit state on blur and Enter.
|
|
190
|
+
|
|
191
|
+
accessibility:
|
|
192
|
+
notes:
|
|
193
|
+
- In display state, an editable title gets role=button and tabindex=0.
|
|
194
|
+
- In display state, a non-editable title stays a plain h1.
|
|
195
|
+
- The inner textbox gets aria-label based on placeholder or current value.
|
|
196
|
+
- Keyboard completion for inline editing is centered on Enter.
|
|
197
|
+
|
|
198
|
+
composition:
|
|
199
|
+
works_well_with:
|
|
200
|
+
- UiButton
|
|
201
|
+
- UiLink
|
|
202
|
+
patterns:
|
|
203
|
+
- title: Inline filter link
|
|
204
|
+
notes: Use addon for a neighboring link such as Collapse filter.
|
|
205
|
+
- title: Compact actions
|
|
206
|
+
notes: Keep only one or two compact actions on the right.
|
|
207
|
+
|
|
208
|
+
examples:
|
|
209
|
+
- title: Editable header with addon and actions
|
|
210
|
+
goal: Build a page header with inline validation and a link near the title.
|
|
211
|
+
code: |
|
|
212
|
+
<UiPageHeader
|
|
213
|
+
v-model:value="title"
|
|
214
|
+
:invalid="!title"
|
|
215
|
+
:error="title ? '' : 'Title is required'"
|
|
216
|
+
editable
|
|
217
|
+
placeholder="Enter a title"
|
|
218
|
+
>
|
|
219
|
+
<template #addon>
|
|
220
|
+
<UiLink>
|
|
221
|
+
Collapse filter
|
|
222
|
+
</UiLink>
|
|
223
|
+
</template>
|
|
224
|
+
|
|
225
|
+
<template #actions>
|
|
226
|
+
<UiButton appearance="tertiary">
|
|
227
|
+
Actions
|
|
228
|
+
</UiButton>
|
|
229
|
+
</template>
|
|
230
|
+
</UiPageHeader>
|
|
231
|
+
|
|
232
|
+
ai_notes:
|
|
233
|
+
do:
|
|
234
|
+
- Use UiPageHeader as a page-level title, not as a replacement for UiField.
|
|
235
|
+
- Set placeholder explicitly for editable scenarios.
|
|
236
|
+
- Pass both invalid and a clear error message if empty-title validation matters.
|
|
237
|
+
- Use addon for inline neighbors next to the title.
|
|
238
|
+
avoid:
|
|
239
|
+
- Do not assume the tooltip is anchored to the entire main area.
|
|
240
|
+
- Do not overload the actions area with full form layout.
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
component: UiPopper
|
|
2
|
+
summary: >
|
|
3
|
+
UiPopper is the low-level floating layer used for tooltips, dropdowns, and popups.
|
|
4
|
+
It controls visibility, teleport container, positioning, and trigger logic, but is usually
|
|
5
|
+
consumed as part of a higher-level component rather than as a standalone content wrapper.
|
|
6
|
+
|
|
7
|
+
public_import:
|
|
8
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
9
|
+
named:
|
|
10
|
+
- UiPopper
|
|
11
|
+
|
|
12
|
+
related_components:
|
|
13
|
+
- UiPopperConnector
|
|
14
|
+
- UiPopperTarget
|
|
15
|
+
- UiSelect
|
|
16
|
+
- UiTooltip
|
|
17
|
+
|
|
18
|
+
use_when:
|
|
19
|
+
- You need a floating layer anchored to a target element.
|
|
20
|
+
- You need separate show and hide triggers for target and popper.
|
|
21
|
+
- You need a dropdown, tooltip, or contextual popup with placement control.
|
|
22
|
+
|
|
23
|
+
avoid_when:
|
|
24
|
+
- You need a regular block in normal document flow.
|
|
25
|
+
- You need a high-level dropdown or tooltip and do not need low-level control.
|
|
26
|
+
|
|
27
|
+
api:
|
|
28
|
+
key_props:
|
|
29
|
+
- name: visible
|
|
30
|
+
notes: Controls open state.
|
|
31
|
+
- name: target
|
|
32
|
+
notes: DOM target used for positioning.
|
|
33
|
+
- name: placement
|
|
34
|
+
notes: Controls side and alignment.
|
|
35
|
+
- name: targetTriggers
|
|
36
|
+
notes: Target-side trigger rules.
|
|
37
|
+
- name: popperTriggers
|
|
38
|
+
notes: Popper-side trigger rules.
|
|
39
|
+
- name: globalTriggers
|
|
40
|
+
notes: Global trigger rules such as outside click or escape.
|
|
41
|
+
- name: withArrow
|
|
42
|
+
notes: Adds an arrow element.
|
|
43
|
+
props:
|
|
44
|
+
- name: strategy
|
|
45
|
+
notes: Floating strategy such as absolute or fixed.
|
|
46
|
+
- name: container
|
|
47
|
+
notes: Teleport target, often body.
|
|
48
|
+
- name: disabled
|
|
49
|
+
notes: Disables floating behavior.
|
|
50
|
+
- name: delay
|
|
51
|
+
notes: Show or hide delay.
|
|
52
|
+
- name: detachTimeout
|
|
53
|
+
notes: Delay before detaching the layer.
|
|
54
|
+
- name: offset
|
|
55
|
+
notes: Floating layer offset.
|
|
56
|
+
slots:
|
|
57
|
+
- name: default
|
|
58
|
+
zone: floating content
|
|
59
|
+
creates: The floating content body rendered inside the popper layer.
|
|
60
|
+
accepts:
|
|
61
|
+
recommended:
|
|
62
|
+
- tooltip body
|
|
63
|
+
- menu or list content
|
|
64
|
+
- dropdown surface
|
|
65
|
+
- compact popup layout
|
|
66
|
+
avoid:
|
|
67
|
+
- full page layout
|
|
68
|
+
- content that relies on normal document flow
|
|
69
|
+
- unrelated anchor markup
|
|
70
|
+
layout_effect: Content is teleported into the floating layer and positioned relative to the active anchor.
|
|
71
|
+
notes: Content rendered inside the popper layer.
|
|
72
|
+
emits:
|
|
73
|
+
- name: update:visible
|
|
74
|
+
payload: boolean
|
|
75
|
+
notes: Main open-state update channel.
|
|
76
|
+
- name: show
|
|
77
|
+
payload: undefined
|
|
78
|
+
notes: Fired when the popper starts opening.
|
|
79
|
+
- name: shown
|
|
80
|
+
payload: undefined
|
|
81
|
+
notes: Fired when the popper is open.
|
|
82
|
+
- name: hide
|
|
83
|
+
payload: undefined
|
|
84
|
+
notes: Fired when the popper starts closing.
|
|
85
|
+
- name: hidden
|
|
86
|
+
payload: undefined
|
|
87
|
+
notes: Fired when the popper is closed.
|
|
88
|
+
- name: dispose
|
|
89
|
+
payload: undefined
|
|
90
|
+
notes: Fired when the layer is disposed.
|
|
91
|
+
- name: attached
|
|
92
|
+
payload: undefined
|
|
93
|
+
notes: Fired when the layer is attached to the DOM.
|
|
94
|
+
|
|
95
|
+
rendered_structure:
|
|
96
|
+
descriptive_only: true
|
|
97
|
+
root: .ui-v1-popper
|
|
98
|
+
zones:
|
|
99
|
+
- .ui-v1-popper__arrow when withArrow=true
|
|
100
|
+
- .ui-v1-popper__content
|
|
101
|
+
notes: The popper is teleported into a container and lives outside the original layout tree.
|
|
102
|
+
|
|
103
|
+
geometry:
|
|
104
|
+
layout: floating layer outside normal document flow
|
|
105
|
+
notes:
|
|
106
|
+
- Position is calculated relative to the target element.
|
|
107
|
+
- Container controls where the DOM node is teleported.
|
|
108
|
+
- Placement and floating options control side, alignment, and adaptation.
|
|
109
|
+
|
|
110
|
+
styling:
|
|
111
|
+
notes:
|
|
112
|
+
- UiPopper is one of the main CSS-variable-driven primitives in the library.
|
|
113
|
+
- Prefer documented CSS variables over descendant selector overrides.
|
|
114
|
+
- Classes are mostly useful for debugging and understanding the floating surface structure.
|
|
115
|
+
root_classes:
|
|
116
|
+
- .ui-v1-popper
|
|
117
|
+
state_classes:
|
|
118
|
+
- .ui-v1-popper_hidden
|
|
119
|
+
- .ui-v1-popper_shown
|
|
120
|
+
zones:
|
|
121
|
+
- .ui-v1-popper__arrow
|
|
122
|
+
- .ui-v1-popper__content
|
|
123
|
+
css_variables:
|
|
124
|
+
public_theme_variables:
|
|
125
|
+
- name: --ui-v1-popper-background
|
|
126
|
+
effect: Surface and arrow background color.
|
|
127
|
+
- name: --ui-v1-popper-roundings
|
|
128
|
+
effect: Surface corner radius.
|
|
129
|
+
- name: --ui-v1-popper-arrow-roundings
|
|
130
|
+
effect: Arrow corner radius.
|
|
131
|
+
- name: --ui-v1-popper-arrow-size
|
|
132
|
+
effect: Arrow square size before rotation.
|
|
133
|
+
- name: --ui-v1-popper-width
|
|
134
|
+
effect: Content width.
|
|
135
|
+
- name: --ui-v1-popper-width-min
|
|
136
|
+
effect: Minimum content width.
|
|
137
|
+
- name: --ui-v1-popper-width-max
|
|
138
|
+
effect: Maximum content width.
|
|
139
|
+
- name: --ui-v1-popper-height
|
|
140
|
+
effect: Content height.
|
|
141
|
+
- name: --ui-v1-popper-height-min
|
|
142
|
+
effect: Minimum content height.
|
|
143
|
+
- name: --ui-v1-popper-height-max
|
|
144
|
+
effect: Maximum content height.
|
|
145
|
+
- name: --ui-v1-popper-padding
|
|
146
|
+
effect: Inner content padding.
|
|
147
|
+
- name: --ui-v1-popper-z-index
|
|
148
|
+
effect: Layer stacking level.
|
|
149
|
+
typography:
|
|
150
|
+
default:
|
|
151
|
+
mixin: text-small
|
|
152
|
+
size: 14px
|
|
153
|
+
line_height: 20px
|
|
154
|
+
weight: 400
|
|
155
|
+
|
|
156
|
+
behavior:
|
|
157
|
+
notes:
|
|
158
|
+
- Target-side and popper-side triggers are configured separately.
|
|
159
|
+
- The layer may remain open across hover or focus when configured that way.
|
|
160
|
+
- Outside interactions are handled through global trigger rules.
|
|
161
|
+
|
|
162
|
+
accessibility:
|
|
163
|
+
notes:
|
|
164
|
+
- UiPopper itself does not define semantic role for its content.
|
|
165
|
+
- ARIA semantics should come from the higher-level component using it.
|
|
166
|
+
|
|
167
|
+
composition:
|
|
168
|
+
works_well_with:
|
|
169
|
+
- UiPopperConnector
|
|
170
|
+
- UiPopperTarget
|
|
171
|
+
- UiTooltip
|
|
172
|
+
- UiSelect
|
|
173
|
+
patterns:
|
|
174
|
+
- title: Shared target context
|
|
175
|
+
notes: The target ref usually comes through UiPopperConnector and UiPopperTarget.
|
|
176
|
+
|
|
177
|
+
examples:
|
|
178
|
+
- title: Mental model
|
|
179
|
+
goal: Understand the basic target plus floating content pattern.
|
|
180
|
+
code: |
|
|
181
|
+
<UiPopperConnector>
|
|
182
|
+
<UiPopperTarget>
|
|
183
|
+
<button type="button">Open</button>
|
|
184
|
+
</UiPopperTarget>
|
|
185
|
+
|
|
186
|
+
<UiPopper :visible="open">
|
|
187
|
+
Popup content
|
|
188
|
+
</UiPopper>
|
|
189
|
+
</UiPopperConnector>
|
|
190
|
+
|
|
191
|
+
ai_notes:
|
|
192
|
+
do:
|
|
193
|
+
- Use UiPopper as low-level floating mechanics when higher-level components are not enough.
|
|
194
|
+
- Think in terms of target, triggers, and floating content as separate parts.
|
|
195
|
+
avoid:
|
|
196
|
+
- Do not treat UiPopper as a regular inline wrapper.
|
|
197
|
+
- Do not forget that it lives outside normal document flow.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
component: UiPopperConnector
|
|
2
|
+
summary: >
|
|
3
|
+
UiPopperConnector is a lightweight wrapper that gives target-side and popper-side parts
|
|
4
|
+
a shared target context. It has almost no UI meaning on its own, but is often required
|
|
5
|
+
for correct target-driven floating behavior.
|
|
6
|
+
|
|
7
|
+
public_import:
|
|
8
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
9
|
+
named:
|
|
10
|
+
- UiPopperConnector
|
|
11
|
+
|
|
12
|
+
related_components:
|
|
13
|
+
- UiPopper
|
|
14
|
+
- UiPopperTarget
|
|
15
|
+
- UiSelect
|
|
16
|
+
- UiTooltip
|
|
17
|
+
|
|
18
|
+
use_when:
|
|
19
|
+
- You need UiPopper and UiPopperTarget to share the same target context.
|
|
20
|
+
- You need the standard target-driven composition for a dropdown or tooltip.
|
|
21
|
+
- Your trigger already exposes its root element into connector context, for example UiButton.
|
|
22
|
+
|
|
23
|
+
avoid_when:
|
|
24
|
+
- You need a generic visual wrapper without popper mechanics.
|
|
25
|
+
- Target is passed manually and the shared connector model is not used.
|
|
26
|
+
|
|
27
|
+
api:
|
|
28
|
+
slots:
|
|
29
|
+
- name: default
|
|
30
|
+
zone: shared popper composition
|
|
31
|
+
creates: Shared target context for target-side and popper-side children.
|
|
32
|
+
accepts:
|
|
33
|
+
recommended:
|
|
34
|
+
- UiPopperTarget plus UiPopper
|
|
35
|
+
- implicit anchor trigger plus UiPopper
|
|
36
|
+
- tooltip-like target and floating content pairs
|
|
37
|
+
avoid:
|
|
38
|
+
- styling-only wrappers
|
|
39
|
+
- unrelated layout content
|
|
40
|
+
- children that do not participate in target or popper flow
|
|
41
|
+
layout_effect: Usually no direct layout effect; mainly establishes shared anchor context.
|
|
42
|
+
notes: Place target and popper-related children here so they share one context.
|
|
43
|
+
|
|
44
|
+
rendered_structure:
|
|
45
|
+
descriptive_only: true
|
|
46
|
+
notes: >
|
|
47
|
+
The connector exists mainly to provide target context. It is not a styled layout primitive.
|
|
48
|
+
|
|
49
|
+
geometry:
|
|
50
|
+
notes:
|
|
51
|
+
- It usually has no meaningful layout behavior on its own.
|
|
52
|
+
- Treat it as a context wrapper, not as a visual block.
|
|
53
|
+
|
|
54
|
+
behavior:
|
|
55
|
+
notes:
|
|
56
|
+
- Stores or forwards the shared target element reference.
|
|
57
|
+
- Lets UiPopperTarget and UiPopper use the same anchor context.
|
|
58
|
+
- If a child component already exposes its root element into connector context, explicit UiPopperTarget may be unnecessary.
|
|
59
|
+
- UiButton is a practical example: inside UiPopperConnector it can act as the anchor without an extra UiPopperTarget wrapper.
|
|
60
|
+
|
|
61
|
+
accessibility:
|
|
62
|
+
notes:
|
|
63
|
+
- Does not create ARIA semantics by itself.
|
|
64
|
+
|
|
65
|
+
composition:
|
|
66
|
+
works_well_with:
|
|
67
|
+
- UiPopperTarget
|
|
68
|
+
- UiPopper
|
|
69
|
+
- UiTooltip
|
|
70
|
+
- UiSelect
|
|
71
|
+
patterns:
|
|
72
|
+
- title: Implicit anchor
|
|
73
|
+
notes: Connector alone is enough when the trigger already provides a stable root element.
|
|
74
|
+
- title: Explicit anchor
|
|
75
|
+
notes: Add UiPopperTarget only when the anchor must be limited to a specific wrapper or sub-area.
|
|
76
|
+
|
|
77
|
+
examples:
|
|
78
|
+
- title: Shared target context
|
|
79
|
+
goal: Connect target and popper through one shared wrapper.
|
|
80
|
+
code: |
|
|
81
|
+
<UiPopperConnector>
|
|
82
|
+
<UiPopperTarget>
|
|
83
|
+
<button type="button">Open</button>
|
|
84
|
+
</UiPopperTarget>
|
|
85
|
+
|
|
86
|
+
<UiPopper :visible="open">
|
|
87
|
+
Content
|
|
88
|
+
</UiPopper>
|
|
89
|
+
</UiPopperConnector>
|
|
90
|
+
- title: Connector without explicit target
|
|
91
|
+
goal: Use a button as the implicit anchor.
|
|
92
|
+
code: |
|
|
93
|
+
<UiPopperConnector>
|
|
94
|
+
<UiButton appearance="secondary">
|
|
95
|
+
Open
|
|
96
|
+
</UiButton>
|
|
97
|
+
|
|
98
|
+
<UiPopper :visible="open">
|
|
99
|
+
Content
|
|
100
|
+
</UiPopper>
|
|
101
|
+
</UiPopperConnector>
|
|
102
|
+
|
|
103
|
+
ai_notes:
|
|
104
|
+
do:
|
|
105
|
+
- Use UiPopperConnector when a higher-level component expects shared target context.
|
|
106
|
+
- Prefer connector-only composition when the trigger already exposes the correct root element.
|
|
107
|
+
avoid:
|
|
108
|
+
- Do not use it as a styling wrapper.
|
|
109
|
+
- Do not add UiPopperTarget automatically around every trigger.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
component: UiPopperTarget
|
|
2
|
+
summary: >
|
|
3
|
+
UiPopperTarget is the target-side wrapper that registers a DOM element in popper context.
|
|
4
|
+
A good mental model is "this node is the anchor", not "this is a visual layout wrapper".
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiPopperTarget
|
|
10
|
+
|
|
11
|
+
related_components:
|
|
12
|
+
- UiPopper
|
|
13
|
+
- UiPopperConnector
|
|
14
|
+
- UiSelect
|
|
15
|
+
- UiTooltip
|
|
16
|
+
|
|
17
|
+
use_when:
|
|
18
|
+
- You need to explicitly mark the anchor element for UiPopper or a tooltip.
|
|
19
|
+
- You need to wrap a trigger and register it as the anchor in shared popper context.
|
|
20
|
+
- You need the floating layer to anchor to only part of a larger layout.
|
|
21
|
+
|
|
22
|
+
avoid_when:
|
|
23
|
+
- You need a styling-only wrapper.
|
|
24
|
+
- Target ref is already passed manually and the connector model is not used.
|
|
25
|
+
- The trigger already exposes a suitable root element through UiPopperConnector, for example UiButton.
|
|
26
|
+
|
|
27
|
+
api:
|
|
28
|
+
props:
|
|
29
|
+
- name: tag
|
|
30
|
+
notes: Wrapper tag name. Default is div.
|
|
31
|
+
slots:
|
|
32
|
+
- name: default
|
|
33
|
+
zone: target content
|
|
34
|
+
creates: The explicit anchor wrapper for the floating layer.
|
|
35
|
+
accepts:
|
|
36
|
+
recommended:
|
|
37
|
+
- one trigger node
|
|
38
|
+
- one title wrapper
|
|
39
|
+
- one compact anchor area
|
|
40
|
+
avoid:
|
|
41
|
+
- large unrelated layout trees
|
|
42
|
+
- content that should not define the anchor bounds
|
|
43
|
+
- multiple disconnected anchor areas
|
|
44
|
+
layout_effect: The wrapper becomes the anchor bounds used by popper positioning.
|
|
45
|
+
notes: Put the trigger or anchor node inside this slot.
|
|
46
|
+
|
|
47
|
+
rendered_structure:
|
|
48
|
+
descriptive_only: true
|
|
49
|
+
notes: >
|
|
50
|
+
The component renders a configurable wrapper tag and stores its element ref in popper context.
|
|
51
|
+
It does not add complex UI logic on its own.
|
|
52
|
+
|
|
53
|
+
geometry:
|
|
54
|
+
notes:
|
|
55
|
+
- Layout depends on the chosen tag and its children.
|
|
56
|
+
- Its main purpose is to provide the correct anchor ref for the popper.
|
|
57
|
+
|
|
58
|
+
behavior:
|
|
59
|
+
notes:
|
|
60
|
+
- On mount and update, it forwards the current element ref into popper context.
|
|
61
|
+
- It is the target-side part of the UiPopperConnector + UiPopperTarget + UiPopper pattern.
|
|
62
|
+
- It is optional, not mandatory.
|
|
63
|
+
- Use it when you need an explicit wrapper as the anchor; skip it when connector already receives the right element.
|
|
64
|
+
|
|
65
|
+
accessibility:
|
|
66
|
+
notes:
|
|
67
|
+
- It does not create ARIA semantics. Those should come from the inner trigger.
|
|
68
|
+
|
|
69
|
+
composition:
|
|
70
|
+
works_well_with:
|
|
71
|
+
- UiPopperConnector
|
|
72
|
+
- UiPopper
|
|
73
|
+
- UiTooltip
|
|
74
|
+
patterns:
|
|
75
|
+
- title: Dedicated anchor wrapper
|
|
76
|
+
notes: Use a separate target wrapper when the floating layer should anchor to only part of a layout.
|
|
77
|
+
- title: Not always needed
|
|
78
|
+
notes: Connector-only composition is enough when the trigger already exposes its root element.
|
|
79
|
+
|
|
80
|
+
examples:
|
|
81
|
+
- title: Tooltip anchor
|
|
82
|
+
goal: Anchor a floating layer to a specific title or button wrapper.
|
|
83
|
+
code: |
|
|
84
|
+
<UiPopperConnector>
|
|
85
|
+
<UiPopperTarget tag="span">
|
|
86
|
+
<span>Title</span>
|
|
87
|
+
</UiPopperTarget>
|
|
88
|
+
|
|
89
|
+
<UiPopper :visible="open">
|
|
90
|
+
Tooltip
|
|
91
|
+
</UiPopper>
|
|
92
|
+
</UiPopperConnector>
|
|
93
|
+
- title: Explicit title-only anchor
|
|
94
|
+
goal: Bind the floating layer to a title wrapper instead of the whole row.
|
|
95
|
+
code: |
|
|
96
|
+
<UiPopperConnector>
|
|
97
|
+
<UiPopperTarget tag="span">
|
|
98
|
+
<span class="header-title">Title</span>
|
|
99
|
+
</UiPopperTarget>
|
|
100
|
+
|
|
101
|
+
<UiPopper :visible="open">
|
|
102
|
+
Tooltip
|
|
103
|
+
</UiPopper>
|
|
104
|
+
</UiPopperConnector>
|
|
105
|
+
|
|
106
|
+
ai_notes:
|
|
107
|
+
do:
|
|
108
|
+
- Use UiPopperTarget when the anchor should be limited to a specific part of the layout.
|
|
109
|
+
- Use it intentionally, not by default.
|
|
110
|
+
avoid:
|
|
111
|
+
- Do not treat the wrapper as decorative only; it affects what the floating layer anchors to.
|
|
112
|
+
- Do not wrap every UiButton or similar trigger with UiPopperTarget if connector already gives the correct anchor.
|