@retailcrm/embed-ui-v1-components 0.9.19 → 0.9.22-alpha.1
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 +9 -1
- package/README.md +5 -2
- package/assets/sprites/actions/add-square-outlined.svg +8 -0
- package/assets/sprites/actions/drag.svg +8 -0
- package/bin/embed-ui-v1-components.mjs +231 -46
- package/bin/postinstall.mjs +3 -2
- package/dist/host.cjs +1223 -501
- package/dist/host.css +637 -10
- package/dist/host.d.ts +152 -78
- package/dist/host.js +1224 -502
- package/dist/remote.cjs +1358 -298
- package/dist/remote.d.ts +805 -67
- package/dist/remote.js +1360 -300
- package/docs/AI.md +99 -17
- package/docs/COMPONENTS.md +58 -59
- package/docs/FORMAT.md +10 -10
- package/docs/PROFILES.md +39 -22
- package/docs/README.md +11 -5
- package/docs/profiles/components/UiAddButton.yml +134 -0
- package/docs/profiles/components/UiAlert.yml +105 -0
- package/docs/profiles/components/UiAvatar.yml +88 -0
- package/docs/profiles/{UiAvatarList.yml → components/UiAvatarList.yml} +26 -0
- package/docs/profiles/{UiButton.yml → components/UiButton.yml} +14 -8
- package/docs/profiles/components/UiCalendar.yml +190 -0
- package/docs/profiles/components/UiCheckbox.yml +111 -0
- package/docs/profiles/components/UiCollapse.yml +129 -0
- package/docs/profiles/components/UiCollapseBox.yml +143 -0
- package/docs/profiles/{UiCollapseGroup.yml → components/UiCollapseGroup.yml} +24 -0
- package/docs/profiles/components/UiCopyButton.yml +104 -0
- package/docs/profiles/components/UiDate.yml +84 -0
- package/docs/profiles/components/UiDatePicker.yml +138 -0
- package/docs/profiles/components/UiError.yml +123 -0
- package/docs/profiles/{UiField.yml → components/UiField.yml} +46 -15
- package/docs/profiles/components/UiInfobox.yml +130 -0
- package/docs/profiles/components/UiLink.yml +111 -0
- package/docs/profiles/components/UiLoader.yml +71 -0
- package/docs/profiles/components/UiMenuItem.yml +93 -0
- package/docs/profiles/{UiMenuItemGroup.yml → components/UiMenuItemGroup.yml} +25 -0
- package/docs/profiles/components/UiModalSidebar.yml +156 -0
- package/docs/profiles/components/UiModalWindow.yml +181 -0
- package/docs/profiles/{UiModalWindowSurface.yml → components/UiModalWindowSurface.yml} +30 -0
- package/docs/profiles/components/UiNumberStepper.yml +100 -0
- package/docs/profiles/{UiPageHeader.yml → components/UiPageHeader.yml} +39 -23
- package/docs/profiles/components/UiPopconfirm.yml +164 -0
- package/docs/profiles/{UiPopper.yml → components/UiPopper.yml} +66 -13
- package/docs/profiles/{UiPopperConnector.yml → components/UiPopperConnector.yml} +5 -25
- package/docs/profiles/{UiPopperTarget.yml → components/UiPopperTarget.yml} +5 -25
- package/docs/profiles/components/UiRadio.yml +91 -0
- package/docs/profiles/{UiRadioSwitch.yml → components/UiRadioSwitch.yml} +55 -32
- package/docs/profiles/{UiRadioSwitchOption.yml → components/UiRadioSwitchOption.yml} +7 -13
- package/docs/profiles/components/UiScrollBox.yml +108 -0
- package/docs/profiles/{UiSelect.yml → components/UiSelect.yml} +133 -44
- package/docs/profiles/components/UiSelectOption.yml +74 -0
- package/docs/profiles/components/UiSelectOptionGroup.yml +66 -0
- package/docs/profiles/components/UiSkeleton.yml +82 -0
- package/docs/profiles/components/UiSlider.yml +161 -0
- package/docs/profiles/components/UiSwitch.yml +123 -0
- package/docs/profiles/components/UiTab.yml +234 -0
- package/docs/profiles/{UiTabGroup.yml → components/UiTabGroup.yml} +0 -30
- package/docs/profiles/components/UiTable.yml +622 -0
- package/docs/profiles/{UiTableBodyCell.yml → components/UiTableBodyCell.yml} +26 -0
- package/docs/profiles/components/UiTableColumn.yml +87 -0
- package/docs/profiles/components/UiTableFooterButton.yml +85 -0
- package/docs/profiles/components/UiTableFooterSection.yml +73 -0
- package/docs/profiles/{UiTableHeadCell.yml → components/UiTableHeadCell.yml} +26 -0
- package/docs/profiles/{UiTableSorter.yml → components/UiTableSorter.yml} +27 -0
- package/docs/profiles/components/UiTag.yml +90 -0
- package/docs/profiles/{UiTextbox.yml → components/UiTextbox.yml} +20 -32
- package/docs/profiles/components/UiTimePicker.yml +144 -0
- package/docs/profiles/{UiToggleButton.yml → components/UiToggleButton.yml} +16 -11
- package/docs/profiles/{UiToggleGroup.yml → components/UiToggleGroup.yml} +25 -13
- package/docs/profiles/{UiToggleGroupOption.yml → components/UiToggleGroupOption.yml} +7 -11
- package/docs/profiles/components/UiToolbarButton.yml +87 -0
- package/docs/profiles/components/UiToolbarLink.yml +80 -0
- package/docs/profiles/components/UiTooltip.yml +97 -0
- package/docs/profiles/components/UiTransition.yml +62 -0
- package/docs/profiles/components/UiYandexMap.yml +104 -0
- package/docs/profiles/pages/CardSettingsPage.yml +58 -0
- package/docs/profiles/pages/CollapseBlockPage.yml +46 -0
- package/docs/profiles/pages/EntityListPage.yml +66 -0
- package/docs/profiles/pages/ModalSidebar.yml +158 -0
- package/docs/profiles/pages/ModalWindow.yml +55 -0
- package/docs/profiles/pages/MultiColumnPage.yml +27 -0
- package/docs/profiles/pages/PageComposition.yml +56 -0
- package/package.json +15 -15
- package/docs/profiles/UiAddButton.yml +0 -57
- package/docs/profiles/UiAlert.yml +0 -48
- package/docs/profiles/UiAvatar.yml +0 -48
- package/docs/profiles/UiCalendar.yml +0 -48
- package/docs/profiles/UiCheckbox.yml +0 -53
- package/docs/profiles/UiCollapse.yml +0 -40
- package/docs/profiles/UiCollapseBox.yml +0 -51
- package/docs/profiles/UiCopyButton.yml +0 -52
- package/docs/profiles/UiDate.yml +0 -38
- package/docs/profiles/UiDatePicker.yml +0 -59
- package/docs/profiles/UiError.yml +0 -32
- package/docs/profiles/UiImage.yml +0 -39
- package/docs/profiles/UiInfobox.yml +0 -45
- package/docs/profiles/UiLink.yml +0 -51
- package/docs/profiles/UiLoader.yml +0 -38
- package/docs/profiles/UiMenuItem.yml +0 -57
- package/docs/profiles/UiModalSidebar.yml +0 -46
- package/docs/profiles/UiModalWindow.yml +0 -44
- package/docs/profiles/UiNumberStepper.yml +0 -52
- package/docs/profiles/UiRadio.yml +0 -38
- package/docs/profiles/UiScrollBox.yml +0 -31
- package/docs/profiles/UiSelectOption.yml +0 -44
- package/docs/profiles/UiSelectOptionGroup.yml +0 -38
- package/docs/profiles/UiSkeleton.yml +0 -41
- package/docs/profiles/UiSlider.yml +0 -38
- package/docs/profiles/UiSwitch.yml +0 -37
- package/docs/profiles/UiTab.yml +0 -119
- package/docs/profiles/UiTable.yml +0 -152
- package/docs/profiles/UiTableColumn.yml +0 -50
- package/docs/profiles/UiTableFooterButton.yml +0 -44
- package/docs/profiles/UiTableFooterSection.yml +0 -38
- package/docs/profiles/UiTag.yml +0 -41
- package/docs/profiles/UiTimePicker.yml +0 -46
- package/docs/profiles/UiToolbarButton.yml +0 -37
- package/docs/profiles/UiToolbarLink.yml +0 -32
- package/docs/profiles/UiTooltip.yml +0 -43
- package/docs/profiles/UiTransition.yml +0 -27
- package/docs/profiles/UiYandexMap.yml +0 -29
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
examples:
|
|
12
|
+
- title: Basic alert
|
|
13
|
+
code: |
|
|
14
|
+
<template>
|
|
15
|
+
<UiAlert text="Basic alert" />
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import { UiAlert } from '@retailcrm/embed-ui-v1-components/remote'
|
|
20
|
+
</script>
|
|
21
|
+
- title: Warning alert
|
|
22
|
+
code: |
|
|
23
|
+
<template>
|
|
24
|
+
<UiAlert variant="warning" text="Warning alert" />
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script lang="ts" setup>
|
|
28
|
+
import { UiAlert } from '@retailcrm/embed-ui-v1-components/remote'
|
|
29
|
+
</script>
|
|
30
|
+
- title: Closable alert
|
|
31
|
+
code: |
|
|
32
|
+
<template>
|
|
33
|
+
<UiAlert
|
|
34
|
+
closable
|
|
35
|
+
text="You can close this alert manually"
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script lang="ts" setup>
|
|
41
|
+
import { UiAlert } from '@retailcrm/embed-ui-v1-components/remote'
|
|
42
|
+
</script>
|
|
43
|
+
use_when:
|
|
44
|
+
- You need inline status feedback.
|
|
45
|
+
- You need dismissible page-level or section-level notice content.
|
|
46
|
+
|
|
47
|
+
avoid_when:
|
|
48
|
+
- You need a blocking modal message.
|
|
49
|
+
- You need a tiny field-level validation hint.
|
|
50
|
+
|
|
51
|
+
api:
|
|
52
|
+
key_props:
|
|
53
|
+
- name: variant
|
|
54
|
+
- name: text
|
|
55
|
+
- name: shown
|
|
56
|
+
- name: closable
|
|
57
|
+
- name: fluid
|
|
58
|
+
|
|
59
|
+
rendered_structure:
|
|
60
|
+
descriptive_only: true
|
|
61
|
+
root:
|
|
62
|
+
shape: div.ui-v1-alert
|
|
63
|
+
tag: div
|
|
64
|
+
notes: Current alert body is wrapped in UiTransition and uses one flex row for icon, content, and optional closer.
|
|
65
|
+
|
|
66
|
+
geometry:
|
|
67
|
+
layout: block-like feedback row
|
|
68
|
+
root_display: flex
|
|
69
|
+
width_behavior: stretches to container width by default
|
|
70
|
+
|
|
71
|
+
behavior:
|
|
72
|
+
notes:
|
|
73
|
+
- shown controls visibility.
|
|
74
|
+
- closable enables user dismissal.
|
|
75
|
+
|
|
76
|
+
ai_notes:
|
|
77
|
+
do:
|
|
78
|
+
- Use UiAlert for inline feedback that should stay in normal layout flow.
|
|
79
|
+
- Keep the message close to the section or form it describes.
|
|
80
|
+
avoid:
|
|
81
|
+
- Do not use it as a replacement for modal confirmation.
|
|
82
|
+
- Do not use for field-level validation when UiField or UiError is more precise.
|
|
83
|
+
|
|
84
|
+
composition:
|
|
85
|
+
works_well_with:
|
|
86
|
+
- UiButton
|
|
87
|
+
- UiInfobox
|
|
88
|
+
- UiError
|
|
89
|
+
patterns:
|
|
90
|
+
- title: Section-level feedback
|
|
91
|
+
notes: Place above or inside the affected section, not at the page top by default.
|
|
92
|
+
- title: Recoverable error
|
|
93
|
+
notes: Pair with a retry or fix action when the user can recover immediately.
|
|
94
|
+
|
|
95
|
+
accessibility:
|
|
96
|
+
notes:
|
|
97
|
+
- Keep rendered text concise and meaningful for screen-reader users.
|
|
98
|
+
- Do not use this component as the only carrier of critical state if the state also needs form-level validation or focus management.
|
|
99
|
+
|
|
100
|
+
styling:
|
|
101
|
+
notes:
|
|
102
|
+
- Use documented props and slots as the primary styling API.
|
|
103
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
104
|
+
root_classes:
|
|
105
|
+
- .ui-v1-alert
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
examples:
|
|
12
|
+
- title: Basic avatar
|
|
13
|
+
code: |
|
|
14
|
+
<template>
|
|
15
|
+
<UiAvatar
|
|
16
|
+
name="Anna Smith"
|
|
17
|
+
src="https://example.com/avatar.jpg"
|
|
18
|
+
size="sm"
|
|
19
|
+
status="none"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script lang="ts" setup>
|
|
24
|
+
import { UiAvatar } from '@retailcrm/embed-ui-v1-components/remote'
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
use_when:
|
|
28
|
+
- You need a compact identity marker for a user or contact.
|
|
29
|
+
- You need avatar display with optional status.
|
|
30
|
+
|
|
31
|
+
avoid_when:
|
|
32
|
+
- You need a generic content image.
|
|
33
|
+
- You need a large media block.
|
|
34
|
+
|
|
35
|
+
api:
|
|
36
|
+
key_props:
|
|
37
|
+
- name: src
|
|
38
|
+
- name: name
|
|
39
|
+
- name: status
|
|
40
|
+
- name: size
|
|
41
|
+
- name: href
|
|
42
|
+
|
|
43
|
+
rendered_structure:
|
|
44
|
+
descriptive_only: true
|
|
45
|
+
root:
|
|
46
|
+
shape: div.ui-v1-avatar or a.ui-v1-avatar
|
|
47
|
+
tag: div or a
|
|
48
|
+
notes: The root switches to anchor when href is provided.
|
|
49
|
+
|
|
50
|
+
geometry:
|
|
51
|
+
layout: avatar frame
|
|
52
|
+
root_display: inline-block
|
|
53
|
+
width_behavior: content-sized by size
|
|
54
|
+
|
|
55
|
+
behavior:
|
|
56
|
+
notes:
|
|
57
|
+
- Can render linked avatar behavior when href is provided.
|
|
58
|
+
- Name is useful as fallback identity information.
|
|
59
|
+
|
|
60
|
+
ai_notes:
|
|
61
|
+
do:
|
|
62
|
+
- Use UiAvatar for identity display, not for general media.
|
|
63
|
+
- Provide name whenever possible so fallback identity stays meaningful.
|
|
64
|
+
avoid:
|
|
65
|
+
- Do not use it for generic content images or large media blocks.
|
|
66
|
+
|
|
67
|
+
composition:
|
|
68
|
+
works_well_with:
|
|
69
|
+
- UiAvatarList
|
|
70
|
+
- UiTable
|
|
71
|
+
- UiMenuItem
|
|
72
|
+
patterns:
|
|
73
|
+
- title: Table identity cell
|
|
74
|
+
notes: Pair with UiLink size="small" when an avatar appears next to a linked user or customer name.
|
|
75
|
+
- title: Menu identity row
|
|
76
|
+
notes: Use in UiMenuItem avatar slot for users, customers, or accounts.
|
|
77
|
+
|
|
78
|
+
accessibility:
|
|
79
|
+
notes:
|
|
80
|
+
- Keep rendered text concise and meaningful for screen-reader users.
|
|
81
|
+
- Do not use this component as the only carrier of critical state if the state also needs form-level validation or focus management.
|
|
82
|
+
|
|
83
|
+
styling:
|
|
84
|
+
notes:
|
|
85
|
+
- Use documented props and slots as the primary styling API.
|
|
86
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
87
|
+
root_classes:
|
|
88
|
+
- .ui-v1-avatar
|
|
@@ -38,5 +38,31 @@ geometry:
|
|
|
38
38
|
ai_notes:
|
|
39
39
|
do:
|
|
40
40
|
- Use for compact grouped identity display.
|
|
41
|
+
- Keep the list short enough to scan.
|
|
41
42
|
avoid:
|
|
42
43
|
- Do not use it as a replacement for a full people list.
|
|
44
|
+
|
|
45
|
+
behavior:
|
|
46
|
+
notes:
|
|
47
|
+
- avatars prop should contain concise identity data, not full profile records.
|
|
48
|
+
- size should match the density of the surrounding table, menu, or card.
|
|
49
|
+
|
|
50
|
+
composition:
|
|
51
|
+
works_well_with:
|
|
52
|
+
- UiAvatar
|
|
53
|
+
- UiTooltip
|
|
54
|
+
patterns:
|
|
55
|
+
- title: Compact collaborators
|
|
56
|
+
notes: Use when several actors must be shown in a narrow table or header area.
|
|
57
|
+
|
|
58
|
+
accessibility:
|
|
59
|
+
notes:
|
|
60
|
+
- Keep rendered text concise and meaningful for screen-reader users.
|
|
61
|
+
- Do not use this component as the only carrier of critical state if the state also needs form-level validation or focus management.
|
|
62
|
+
|
|
63
|
+
styling:
|
|
64
|
+
notes:
|
|
65
|
+
- Use documented props and slots as the primary styling API.
|
|
66
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
67
|
+
root_classes:
|
|
68
|
+
- .ui-v1-avatar-list
|
|
@@ -9,6 +9,20 @@ public_import:
|
|
|
9
9
|
named:
|
|
10
10
|
- UiButton
|
|
11
11
|
|
|
12
|
+
examples:
|
|
13
|
+
- title: States
|
|
14
|
+
code: |
|
|
15
|
+
<template>
|
|
16
|
+
<UiButton variant="danger">
|
|
17
|
+
<IconDelete /> Delete
|
|
18
|
+
</UiButton>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts" setup>
|
|
22
|
+
import IconDelete from '@retailcrm/embed-ui-v1-components/assets/sprites/ui/delete-outlined.svg'
|
|
23
|
+
import { UiButton } from '@retailcrm/embed-ui-v1-components/remote'
|
|
24
|
+
</script>
|
|
25
|
+
|
|
12
26
|
use_when:
|
|
13
27
|
- You need a primary or secondary action in a form or screen.
|
|
14
28
|
- You need an inline action in a header, modal, infobox, or toolbar-like area.
|
|
@@ -211,14 +225,6 @@ composition:
|
|
|
211
225
|
- UiInfobox
|
|
212
226
|
- modal actions
|
|
213
227
|
|
|
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
228
|
|
|
223
229
|
ai_notes:
|
|
224
230
|
do:
|
|
@@ -0,0 +1,190 @@
|
|
|
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
|
+
examples:
|
|
12
|
+
- title: Basic calendar
|
|
13
|
+
code: |
|
|
14
|
+
<template>
|
|
15
|
+
<UiCalendar v-model:value="value" />
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import { ref } from 'vue'
|
|
20
|
+
import { UiCalendar } from '@retailcrm/embed-ui-v1-components/remote'
|
|
21
|
+
|
|
22
|
+
const value = ref<Date | null>(new Date())
|
|
23
|
+
</script>
|
|
24
|
+
- title: Date range
|
|
25
|
+
code: |
|
|
26
|
+
<template>
|
|
27
|
+
<UiCalendar v-model:value="value" type="range" />
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script lang="ts" setup>
|
|
31
|
+
import { ref } from 'vue'
|
|
32
|
+
import { UiCalendar } from '@retailcrm/embed-ui-v1-components/remote'
|
|
33
|
+
|
|
34
|
+
const value = ref<Date[]>([
|
|
35
|
+
new Date('2024-11-10'),
|
|
36
|
+
new Date('2024-11-19'),
|
|
37
|
+
])
|
|
38
|
+
</script>
|
|
39
|
+
- title: Reset value (`nullable`)
|
|
40
|
+
code: |
|
|
41
|
+
<template>
|
|
42
|
+
<UiCalendar v-model:value="value" nullable />
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script lang="ts" setup>
|
|
46
|
+
import { ref } from 'vue'
|
|
47
|
+
import { UiCalendar } from '@retailcrm/embed-ui-v1-components/remote'
|
|
48
|
+
|
|
49
|
+
const value = ref<Date | null>(new Date())
|
|
50
|
+
</script>
|
|
51
|
+
- title: Two months at once (`appearance="double"`)
|
|
52
|
+
code: |
|
|
53
|
+
<template>
|
|
54
|
+
<UiCalendar
|
|
55
|
+
v-model:value="value"
|
|
56
|
+
type="range"
|
|
57
|
+
appearance="double"
|
|
58
|
+
/>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script lang="ts" setup>
|
|
62
|
+
import { ref } from 'vue'
|
|
63
|
+
import { UiCalendar } from '@retailcrm/embed-ui-v1-components/remote'
|
|
64
|
+
|
|
65
|
+
const value = ref<Date[]>([
|
|
66
|
+
new Date('2024-11-10'),
|
|
67
|
+
new Date('2024-11-19'),
|
|
68
|
+
])
|
|
69
|
+
</script>
|
|
70
|
+
- title: Available date limit
|
|
71
|
+
code: |
|
|
72
|
+
<template>
|
|
73
|
+
<UiCalendar
|
|
74
|
+
v-model:value="value"
|
|
75
|
+
type="range"
|
|
76
|
+
:min-date="new Date('2024-11-05')"
|
|
77
|
+
:max-date="new Date('2024-11-25')"
|
|
78
|
+
/>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<script lang="ts" setup>
|
|
82
|
+
import { ref } from 'vue'
|
|
83
|
+
import { UiCalendar } from '@retailcrm/embed-ui-v1-components/remote'
|
|
84
|
+
|
|
85
|
+
const value = ref<Date[]>([
|
|
86
|
+
new Date('2024-11-10'),
|
|
87
|
+
new Date('2024-11-19'),
|
|
88
|
+
])
|
|
89
|
+
</script>
|
|
90
|
+
- title: Locale and first day of week
|
|
91
|
+
code: |
|
|
92
|
+
<template>
|
|
93
|
+
<UiCalendar
|
|
94
|
+
v-model:value="value"
|
|
95
|
+
locale="en-GB"
|
|
96
|
+
:first-day-of-week="1"
|
|
97
|
+
/>
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<script lang="ts" setup>
|
|
101
|
+
import { ref } from 'vue'
|
|
102
|
+
import { UiCalendar } from '@retailcrm/embed-ui-v1-components/remote'
|
|
103
|
+
|
|
104
|
+
const value = ref<Date | null>(new Date())
|
|
105
|
+
</script>
|
|
106
|
+
- title: Controlled value and change event
|
|
107
|
+
code: |
|
|
108
|
+
<template>
|
|
109
|
+
<UiCalendar
|
|
110
|
+
:value="value"
|
|
111
|
+
@update:value="value = $event"
|
|
112
|
+
@change="onCalendarChange"
|
|
113
|
+
/>
|
|
114
|
+
|
|
115
|
+
</template>
|
|
116
|
+
|
|
117
|
+
<script lang="ts" setup>
|
|
118
|
+
import { ref } from 'vue'
|
|
119
|
+
import { UiCalendar } from '@retailcrm/embed-ui-v1-components/remote'
|
|
120
|
+
|
|
121
|
+
const value = ref<Date | null>(new Date())
|
|
122
|
+
|
|
123
|
+
const onCalendarChange = (nextValue: Date | null) => {
|
|
124
|
+
value.value = nextValue
|
|
125
|
+
}
|
|
126
|
+
</script>
|
|
127
|
+
use_when:
|
|
128
|
+
- You need inline date selection.
|
|
129
|
+
- You need single-date or date-range picking without a textbox wrapper.
|
|
130
|
+
|
|
131
|
+
avoid_when:
|
|
132
|
+
- You need the full textbox-plus-popper date picker flow.
|
|
133
|
+
|
|
134
|
+
api:
|
|
135
|
+
key_props:
|
|
136
|
+
- name: value
|
|
137
|
+
- name: type
|
|
138
|
+
- name: appearance
|
|
139
|
+
- name: minDate
|
|
140
|
+
- name: maxDate
|
|
141
|
+
- name: locale
|
|
142
|
+
|
|
143
|
+
rendered_structure:
|
|
144
|
+
descriptive_only: true
|
|
145
|
+
root:
|
|
146
|
+
shape: div.ui-v1-calendar
|
|
147
|
+
tag: div
|
|
148
|
+
notes: The root contains header controls, weekday labels, and the date grid.
|
|
149
|
+
|
|
150
|
+
geometry:
|
|
151
|
+
layout: block-like calendar panel
|
|
152
|
+
root_display: flex
|
|
153
|
+
width_behavior: stretches to container width by default
|
|
154
|
+
|
|
155
|
+
behavior:
|
|
156
|
+
notes:
|
|
157
|
+
- Supports single and range selection.
|
|
158
|
+
- minDate and maxDate constrain selection.
|
|
159
|
+
|
|
160
|
+
ai_notes:
|
|
161
|
+
do:
|
|
162
|
+
- Use UiCalendar when inline calendar selection is the actual UI.
|
|
163
|
+
avoid:
|
|
164
|
+
- Use UiDatePicker instead if users expect textbox plus popup behavior.
|
|
165
|
+
|
|
166
|
+
composition:
|
|
167
|
+
works_well_with:
|
|
168
|
+
- UiDatePicker
|
|
169
|
+
- UiField
|
|
170
|
+
patterns:
|
|
171
|
+
- title: Inline calendar panel
|
|
172
|
+
notes: Use in dashboards or popover content when the calendar itself should remain visible.
|
|
173
|
+
- title: Date input
|
|
174
|
+
notes: Prefer UiDatePicker for normal forms and filters because it provides the textbox trigger and popper behavior.
|
|
175
|
+
|
|
176
|
+
accessibility:
|
|
177
|
+
notes:
|
|
178
|
+
- Prefer visible text labels for interactive controls.
|
|
179
|
+
- For icon-only or custom visual content, provide an accessible name through the supported label, title, or ARIA attributes exposed by the component.
|
|
180
|
+
- Preserve native keyboard semantics by using the component root instead of recreating the control with arbitrary markup.
|
|
181
|
+
keyboard:
|
|
182
|
+
- Tab moves focus to the control when it is focusable.
|
|
183
|
+
- Enter or Space activates native button-like controls when the host implementation renders a button.
|
|
184
|
+
|
|
185
|
+
styling:
|
|
186
|
+
notes:
|
|
187
|
+
- Use documented props and slots as the primary styling API.
|
|
188
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
189
|
+
root_classes:
|
|
190
|
+
- .ui-v1-calendar
|
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
examples:
|
|
12
|
+
- title: Example
|
|
13
|
+
code: |
|
|
14
|
+
<template>
|
|
15
|
+
<UiCheckbox id="notifications" v-model:model="enabled" />
|
|
16
|
+
<label for="notifications">Notifications</label>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script lang="ts" setup>
|
|
20
|
+
import { ref } from 'vue'
|
|
21
|
+
import { UiCheckbox } from '@retailcrm/embed-ui-v1-components/remote'
|
|
22
|
+
|
|
23
|
+
const enabled = ref(false)
|
|
24
|
+
</script>
|
|
25
|
+
- title: Multiple selection
|
|
26
|
+
code: |
|
|
27
|
+
<template>
|
|
28
|
+
<UiCheckbox v-model:model="channels" value="email" />
|
|
29
|
+
<UiCheckbox v-model:model="channels" value="sms" />
|
|
30
|
+
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script lang="ts" setup>
|
|
34
|
+
import { ref } from 'vue'
|
|
35
|
+
import { UiCheckbox } from '@retailcrm/embed-ui-v1-components/remote'
|
|
36
|
+
|
|
37
|
+
const channels = ref<string[]>([])
|
|
38
|
+
</script>
|
|
39
|
+
use_when:
|
|
40
|
+
- You need a yes or no control.
|
|
41
|
+
- You need one value inside a checkbox group model.
|
|
42
|
+
|
|
43
|
+
avoid_when:
|
|
44
|
+
- You need exclusive single choice, use UiRadio instead.
|
|
45
|
+
- You need a more compact toggle-like control, use UiSwitch instead.
|
|
46
|
+
|
|
47
|
+
api:
|
|
48
|
+
key_props:
|
|
49
|
+
- name: model
|
|
50
|
+
- name: value
|
|
51
|
+
- name: indeterminate
|
|
52
|
+
- name: valueOfTruthy
|
|
53
|
+
- name: valueOfFalsy
|
|
54
|
+
- name: disabled
|
|
55
|
+
methods:
|
|
56
|
+
- name: click
|
|
57
|
+
- name: focus
|
|
58
|
+
- name: blur
|
|
59
|
+
|
|
60
|
+
rendered_structure:
|
|
61
|
+
descriptive_only: true
|
|
62
|
+
root:
|
|
63
|
+
shape: span.ui-v1-checkbox
|
|
64
|
+
tag: span
|
|
65
|
+
notes: One inline wrapper around the visual checkbox control and label content.
|
|
66
|
+
|
|
67
|
+
geometry:
|
|
68
|
+
layout: inline checkbox control
|
|
69
|
+
root_display: inline-flex
|
|
70
|
+
width_behavior: content-sized by default
|
|
71
|
+
|
|
72
|
+
behavior:
|
|
73
|
+
notes:
|
|
74
|
+
- model plus value supports group-style selection.
|
|
75
|
+
- indeterminate is useful for partial selection states.
|
|
76
|
+
|
|
77
|
+
ai_notes:
|
|
78
|
+
do:
|
|
79
|
+
- Use for boolean choice or checkbox-group membership.
|
|
80
|
+
- Use indeterminate for parent selection such as "select all visible rows".
|
|
81
|
+
avoid:
|
|
82
|
+
- Do not use for mutually exclusive options.
|
|
83
|
+
|
|
84
|
+
composition:
|
|
85
|
+
works_well_with:
|
|
86
|
+
- UiField
|
|
87
|
+
- UiTable
|
|
88
|
+
- UiTableColumn
|
|
89
|
+
patterns:
|
|
90
|
+
- title: Form boolean
|
|
91
|
+
notes: Wrap in UiField when the checkbox needs a persistent label, hint, or validation text.
|
|
92
|
+
- title: Table row selection
|
|
93
|
+
notes: Use in the first narrow UiTableColumn for row selection; use indeterminate in the header checkbox for partial selection.
|
|
94
|
+
avoid:
|
|
95
|
+
- Do not use as a visual switch replacement when the action is an immediate on or off setting.
|
|
96
|
+
|
|
97
|
+
accessibility:
|
|
98
|
+
notes:
|
|
99
|
+
- Prefer visible text labels for interactive controls.
|
|
100
|
+
- For icon-only or custom visual content, provide an accessible name through the supported label, title, or ARIA attributes exposed by the component.
|
|
101
|
+
- Preserve native keyboard semantics by using the component root instead of recreating the control with arbitrary markup.
|
|
102
|
+
keyboard:
|
|
103
|
+
- Tab moves focus to the control when it is focusable.
|
|
104
|
+
- Enter or Space activates native button-like controls when the host implementation renders a button.
|
|
105
|
+
|
|
106
|
+
styling:
|
|
107
|
+
notes:
|
|
108
|
+
- Use documented props and slots as the primary styling API.
|
|
109
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
110
|
+
root_classes:
|
|
111
|
+
- .ui-v1-checkbox
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
component: UiCollapse
|
|
2
|
+
summary: >
|
|
3
|
+
UiCollapse is a low-level show and hide container for expandable content. It controls
|
|
4
|
+
whether content is hidden or disposed and how the transition behaves.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiCollapse
|
|
10
|
+
|
|
11
|
+
examples:
|
|
12
|
+
- title: Basic collapse
|
|
13
|
+
code: |
|
|
14
|
+
<template>
|
|
15
|
+
<UiCollapse :expanded="opened">
|
|
16
|
+
<div>Collapsible content</div>
|
|
17
|
+
</UiCollapse>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts" setup>
|
|
21
|
+
import { ref } from 'vue'
|
|
22
|
+
import { UiCollapse } from '@retailcrm/embed-ui-v1-components/remote'
|
|
23
|
+
|
|
24
|
+
const opened = ref(false)
|
|
25
|
+
</script>
|
|
26
|
+
- title: Dispose collapsed content
|
|
27
|
+
code: |
|
|
28
|
+
<template>
|
|
29
|
+
<UiCollapse
|
|
30
|
+
:expanded="opened"
|
|
31
|
+
collapse-behaviour="dispose"
|
|
32
|
+
>
|
|
33
|
+
<div>Disposed content</div>
|
|
34
|
+
</UiCollapse>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script lang="ts" setup>
|
|
38
|
+
import { ref } from 'vue'
|
|
39
|
+
import { UiCollapse } from '@retailcrm/embed-ui-v1-components/remote'
|
|
40
|
+
|
|
41
|
+
const opened = ref(false)
|
|
42
|
+
</script>
|
|
43
|
+
- title: Transition events
|
|
44
|
+
code: |
|
|
45
|
+
<template>
|
|
46
|
+
<UiCollapse
|
|
47
|
+
:expanded="opened"
|
|
48
|
+
@expanded="onExpanded"
|
|
49
|
+
@collapsed="onCollapsed"
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script lang="ts" setup>
|
|
55
|
+
import { ref } from 'vue'
|
|
56
|
+
import { UiCollapse } from '@retailcrm/embed-ui-v1-components/remote'
|
|
57
|
+
|
|
58
|
+
const opened = ref(false)
|
|
59
|
+
|
|
60
|
+
const onExpanded = () => {
|
|
61
|
+
console.log('Expanded')
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const onCollapsed = () => {
|
|
65
|
+
console.log('Collapsed')
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
use_when:
|
|
69
|
+
- You need conditional expandable content.
|
|
70
|
+
- You need to choose between hidden and disposed collapsed states.
|
|
71
|
+
|
|
72
|
+
avoid_when:
|
|
73
|
+
- You need a ready-to-use disclosure box with header UI, use UiCollapseBox instead.
|
|
74
|
+
|
|
75
|
+
api:
|
|
76
|
+
key_props:
|
|
77
|
+
- name: expanded
|
|
78
|
+
- name: collapseBehaviour
|
|
79
|
+
- name: duration
|
|
80
|
+
|
|
81
|
+
rendered_structure:
|
|
82
|
+
descriptive_only: true
|
|
83
|
+
root:
|
|
84
|
+
shape: div.ui-v1-collapse
|
|
85
|
+
tag: div
|
|
86
|
+
notes: The animated container is wrapped in a native transition and exists only while shown or expanded.
|
|
87
|
+
|
|
88
|
+
geometry:
|
|
89
|
+
layout: block-like animated container
|
|
90
|
+
root_display: block
|
|
91
|
+
width_behavior: stretches to container width by default
|
|
92
|
+
|
|
93
|
+
ai_notes:
|
|
94
|
+
do:
|
|
95
|
+
- Use UiCollapse as a primitive for expandable content regions.
|
|
96
|
+
avoid:
|
|
97
|
+
- Do not use it when a full disclosure component is the actual need.
|
|
98
|
+
|
|
99
|
+
behavior:
|
|
100
|
+
notes:
|
|
101
|
+
- expanded controls visibility.
|
|
102
|
+
- collapseBehaviour controls whether collapsed content stays mounted or is disposed.
|
|
103
|
+
- duration controls transition timing.
|
|
104
|
+
|
|
105
|
+
composition:
|
|
106
|
+
works_well_with:
|
|
107
|
+
- UiCollapseBox
|
|
108
|
+
- UiCollapseGroup
|
|
109
|
+
patterns:
|
|
110
|
+
- title: Custom disclosure
|
|
111
|
+
notes: Use UiCollapse when the trigger and header are custom and only the body transition is needed.
|
|
112
|
+
- title: Standard disclosure box
|
|
113
|
+
notes: Use UiCollapseBox when the screen needs built-in header, icon, and box chrome.
|
|
114
|
+
|
|
115
|
+
accessibility:
|
|
116
|
+
notes:
|
|
117
|
+
- Prefer visible text labels for interactive controls.
|
|
118
|
+
- For icon-only or custom visual content, provide an accessible name through the supported label, title, or ARIA attributes exposed by the component.
|
|
119
|
+
- Preserve native keyboard semantics by using the component root instead of recreating the control with arbitrary markup.
|
|
120
|
+
keyboard:
|
|
121
|
+
- Tab moves focus to the control when it is focusable.
|
|
122
|
+
- Enter or Space activates native button-like controls when the host implementation renders a button.
|
|
123
|
+
|
|
124
|
+
styling:
|
|
125
|
+
notes:
|
|
126
|
+
- Use documented props and slots as the primary styling API.
|
|
127
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
128
|
+
root_classes:
|
|
129
|
+
- .ui-v1-collapse
|