@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,82 @@
|
|
|
1
|
+
component: UiSkeleton
|
|
2
|
+
summary: >
|
|
3
|
+
UiSkeleton displays a placeholder block for loading content. It supports text,
|
|
4
|
+
rectangle and circle appearances with pulse or shimmer animation.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiSkeleton
|
|
10
|
+
|
|
11
|
+
examples:
|
|
12
|
+
- title: Example
|
|
13
|
+
code: |
|
|
14
|
+
<template>
|
|
15
|
+
<UiSkeleton />
|
|
16
|
+
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script lang="ts" setup>
|
|
20
|
+
import { UiSkeleton } from '@retailcrm/embed-ui-v1-components/remote'
|
|
21
|
+
</script>
|
|
22
|
+
use_when:
|
|
23
|
+
- You need a content placeholder before actual data is loaded.
|
|
24
|
+
- You need line, card or avatar-like loading placeholders.
|
|
25
|
+
|
|
26
|
+
avoid_when:
|
|
27
|
+
- You need a spinner-like indicator instead of a content-shaped placeholder.
|
|
28
|
+
|
|
29
|
+
api:
|
|
30
|
+
key_props:
|
|
31
|
+
- name: appearance
|
|
32
|
+
- name: size
|
|
33
|
+
- name: animation
|
|
34
|
+
- name: width
|
|
35
|
+
- name: height
|
|
36
|
+
|
|
37
|
+
rendered_structure:
|
|
38
|
+
descriptive_only: true
|
|
39
|
+
root:
|
|
40
|
+
shape: div.ui-v1-skeleton
|
|
41
|
+
tag: div
|
|
42
|
+
|
|
43
|
+
geometry:
|
|
44
|
+
layout: inline block or block placeholder
|
|
45
|
+
root_display: inline-block
|
|
46
|
+
width_behavior: preset width by appearance and size, overridable via width prop
|
|
47
|
+
|
|
48
|
+
ai_notes:
|
|
49
|
+
do:
|
|
50
|
+
- Use text appearance for line placeholders.
|
|
51
|
+
- Use circle appearance for avatar placeholders.
|
|
52
|
+
- Override width or height only when the preset size is not enough.
|
|
53
|
+
avoid:
|
|
54
|
+
- Do not use for errors or empty states; skeletons mean content is still expected.
|
|
55
|
+
|
|
56
|
+
behavior:
|
|
57
|
+
notes:
|
|
58
|
+
- appearance should approximate the eventual content shape.
|
|
59
|
+
- animation communicates loading; avoid excessive animated skeletons in dense screens.
|
|
60
|
+
|
|
61
|
+
composition:
|
|
62
|
+
works_well_with:
|
|
63
|
+
- UiAvatar
|
|
64
|
+
- UiTable
|
|
65
|
+
- UiLoader
|
|
66
|
+
patterns:
|
|
67
|
+
- title: Loading rows
|
|
68
|
+
notes: Use text or rectangle skeletons where table or list rows will appear.
|
|
69
|
+
- title: Loading identity
|
|
70
|
+
notes: Use circle skeletons where avatars will appear.
|
|
71
|
+
|
|
72
|
+
accessibility:
|
|
73
|
+
notes:
|
|
74
|
+
- Keep rendered text concise and meaningful for screen-reader users.
|
|
75
|
+
- Do not use this component as the only carrier of critical state if the state also needs form-level validation or focus management.
|
|
76
|
+
|
|
77
|
+
styling:
|
|
78
|
+
notes:
|
|
79
|
+
- Use documented props and slots as the primary styling API.
|
|
80
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
81
|
+
root_classes:
|
|
82
|
+
- .ui-v1-skeleton
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
component: UiSlider
|
|
2
|
+
summary: >
|
|
3
|
+
UiSlider is a range-selection control for single values or ranges on a numeric track.
|
|
4
|
+
It supports single-handle and range-handle modes.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiSlider
|
|
10
|
+
|
|
11
|
+
examples:
|
|
12
|
+
- title: Basic slider
|
|
13
|
+
code: |
|
|
14
|
+
<template>
|
|
15
|
+
<UiSlider v-model:value="value" />
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import { ref } from 'vue'
|
|
20
|
+
import { UiSlider } from '@retailcrm/embed-ui-v1-components/remote'
|
|
21
|
+
|
|
22
|
+
const value = ref(20)
|
|
23
|
+
</script>
|
|
24
|
+
- title: Range slider
|
|
25
|
+
code: |
|
|
26
|
+
<template>
|
|
27
|
+
<UiSlider
|
|
28
|
+
v-model:value="value"
|
|
29
|
+
type="range"
|
|
30
|
+
/>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script lang="ts" setup>
|
|
34
|
+
import { ref } from 'vue'
|
|
35
|
+
import { UiSlider } from '@retailcrm/embed-ui-v1-components/remote'
|
|
36
|
+
|
|
37
|
+
const value = ref<number[]>([20, 80])
|
|
38
|
+
</script>
|
|
39
|
+
- title: Bounded range slider
|
|
40
|
+
code: |
|
|
41
|
+
<template>
|
|
42
|
+
<UiSlider
|
|
43
|
+
v-model:value="value"
|
|
44
|
+
type="range"
|
|
45
|
+
:min="10"
|
|
46
|
+
:max="60"
|
|
47
|
+
/>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script lang="ts" setup>
|
|
51
|
+
import { ref } from 'vue'
|
|
52
|
+
import { UiSlider } from '@retailcrm/embed-ui-v1-components/remote'
|
|
53
|
+
|
|
54
|
+
const value = ref<number[]>([20, 80])
|
|
55
|
+
</script>
|
|
56
|
+
- title: Labelled range slider
|
|
57
|
+
code: |
|
|
58
|
+
<template>
|
|
59
|
+
<UiSlider
|
|
60
|
+
v-model:value="value"
|
|
61
|
+
type="range"
|
|
62
|
+
labelled
|
|
63
|
+
>
|
|
64
|
+
<template #label="{ boundary }">
|
|
65
|
+
{{ boundary }}%
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<template #handle="{ boundary }">
|
|
69
|
+
{{ boundary }}%
|
|
70
|
+
</template>
|
|
71
|
+
</UiSlider>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<script lang="ts" setup>
|
|
75
|
+
import { ref } from 'vue'
|
|
76
|
+
import { UiSlider } from '@retailcrm/embed-ui-v1-components/remote'
|
|
77
|
+
|
|
78
|
+
const value = ref<number[]>([20, 80])
|
|
79
|
+
</script>
|
|
80
|
+
- title: Controlled slider
|
|
81
|
+
code: |
|
|
82
|
+
<template>
|
|
83
|
+
<UiSlider
|
|
84
|
+
:value="value"
|
|
85
|
+
@update:value="value = $event"
|
|
86
|
+
/>
|
|
87
|
+
|
|
88
|
+
</template>
|
|
89
|
+
|
|
90
|
+
<script lang="ts" setup>
|
|
91
|
+
import { ref } from 'vue'
|
|
92
|
+
import { UiSlider } from '@retailcrm/embed-ui-v1-components/remote'
|
|
93
|
+
|
|
94
|
+
const value = ref(20)
|
|
95
|
+
</script>
|
|
96
|
+
use_when:
|
|
97
|
+
- You need compact ranged numeric selection.
|
|
98
|
+
- You need one or two draggable handles on a track.
|
|
99
|
+
|
|
100
|
+
avoid_when:
|
|
101
|
+
- You need precise text entry.
|
|
102
|
+
|
|
103
|
+
api:
|
|
104
|
+
key_props:
|
|
105
|
+
- name: type
|
|
106
|
+
- name: value
|
|
107
|
+
- name: min
|
|
108
|
+
- name: max
|
|
109
|
+
- name: labelled
|
|
110
|
+
emits:
|
|
111
|
+
- name: update:value
|
|
112
|
+
|
|
113
|
+
rendered_structure:
|
|
114
|
+
descriptive_only: true
|
|
115
|
+
root:
|
|
116
|
+
shape: div.ui-v1-slider
|
|
117
|
+
tag: div
|
|
118
|
+
notes: The root contains labels, track, filler, and draggable handle nodes.
|
|
119
|
+
|
|
120
|
+
geometry:
|
|
121
|
+
layout: horizontal slider track
|
|
122
|
+
root_display: flex
|
|
123
|
+
width_behavior: stretches to container width by default
|
|
124
|
+
|
|
125
|
+
behavior:
|
|
126
|
+
notes:
|
|
127
|
+
- Use when approximate adjustment is acceptable.
|
|
128
|
+
- For exact numeric input, prefer UiTextbox with numeric inputmode or UiNumberStepper.
|
|
129
|
+
|
|
130
|
+
composition:
|
|
131
|
+
works_well_with:
|
|
132
|
+
- UiField
|
|
133
|
+
- UiNumberStepper
|
|
134
|
+
patterns:
|
|
135
|
+
- title: Bounded adjustment
|
|
136
|
+
notes: Wrap in UiField and show min, max, or current value nearby when precision matters.
|
|
137
|
+
- title: Slider plus exact value
|
|
138
|
+
notes: Pair with UiNumberStepper when users need both quick dragging and exact entry.
|
|
139
|
+
|
|
140
|
+
ai_notes:
|
|
141
|
+
do:
|
|
142
|
+
- Use only for bounded numeric ranges.
|
|
143
|
+
- Make the current value visible when the slider affects important settings.
|
|
144
|
+
avoid:
|
|
145
|
+
- Do not use for open-ended numbers, money amounts, or identifiers.
|
|
146
|
+
|
|
147
|
+
accessibility:
|
|
148
|
+
notes:
|
|
149
|
+
- Prefer visible text labels for interactive controls.
|
|
150
|
+
- For icon-only or custom visual content, provide an accessible name through the supported label, title, or ARIA attributes exposed by the component.
|
|
151
|
+
- Preserve native keyboard semantics by using the component root instead of recreating the control with arbitrary markup.
|
|
152
|
+
keyboard:
|
|
153
|
+
- Tab moves focus to the control when it is focusable.
|
|
154
|
+
- Enter or Space activates native button-like controls when the host implementation renders a button.
|
|
155
|
+
|
|
156
|
+
styling:
|
|
157
|
+
notes:
|
|
158
|
+
- Use documented props and slots as the primary styling API.
|
|
159
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
160
|
+
root_classes:
|
|
161
|
+
- .ui-v1-slider
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
component: UiSwitch
|
|
2
|
+
summary: >
|
|
3
|
+
UiSwitch is a compact boolean toggle control. It is the most concise choice for on or off state
|
|
4
|
+
when checkbox semantics would feel visually heavy.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiSwitch
|
|
10
|
+
|
|
11
|
+
examples:
|
|
12
|
+
- title: Basic switch
|
|
13
|
+
code: |
|
|
14
|
+
<template>
|
|
15
|
+
<UiSwitch v-model:value="enabled" />
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import { ref } from 'vue'
|
|
20
|
+
import { UiSwitch } from '@retailcrm/embed-ui-v1-components/remote'
|
|
21
|
+
|
|
22
|
+
const enabled = ref(false)
|
|
23
|
+
</script>
|
|
24
|
+
- title: Controlled switch
|
|
25
|
+
code: |
|
|
26
|
+
<template>
|
|
27
|
+
<UiSwitch
|
|
28
|
+
:value="enabled"
|
|
29
|
+
@update:value="enabled = $event"
|
|
30
|
+
/>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script lang="ts" setup>
|
|
34
|
+
import { ref } from 'vue'
|
|
35
|
+
import { UiSwitch } from '@retailcrm/embed-ui-v1-components/remote'
|
|
36
|
+
|
|
37
|
+
const enabled = ref(false)
|
|
38
|
+
</script>
|
|
39
|
+
- title: Disabled
|
|
40
|
+
code: |
|
|
41
|
+
<template>
|
|
42
|
+
<UiSwitch :value="true" disabled />
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script lang="ts" setup>
|
|
46
|
+
import { UiSwitch } from '@retailcrm/embed-ui-v1-components/remote'
|
|
47
|
+
</script>
|
|
48
|
+
- title: Square
|
|
49
|
+
code: |
|
|
50
|
+
<template>
|
|
51
|
+
<UiSwitch v-model:value="enabled" square />
|
|
52
|
+
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script lang="ts" setup>
|
|
56
|
+
import { ref } from 'vue'
|
|
57
|
+
import { UiSwitch } from '@retailcrm/embed-ui-v1-components/remote'
|
|
58
|
+
|
|
59
|
+
const enabled = ref(false)
|
|
60
|
+
</script>
|
|
61
|
+
use_when:
|
|
62
|
+
- You need a compact on or off toggle.
|
|
63
|
+
|
|
64
|
+
avoid_when:
|
|
65
|
+
- You need checkbox-group semantics.
|
|
66
|
+
|
|
67
|
+
api:
|
|
68
|
+
key_props:
|
|
69
|
+
- name: value
|
|
70
|
+
- name: square
|
|
71
|
+
- name: disabled
|
|
72
|
+
methods:
|
|
73
|
+
- name: click
|
|
74
|
+
- name: focus
|
|
75
|
+
- name: blur
|
|
76
|
+
|
|
77
|
+
rendered_structure:
|
|
78
|
+
descriptive_only: true
|
|
79
|
+
root:
|
|
80
|
+
shape: span.ui-v1-switch
|
|
81
|
+
tag: span
|
|
82
|
+
notes: The root is one compact inline switch control.
|
|
83
|
+
|
|
84
|
+
geometry:
|
|
85
|
+
layout: inline switch control
|
|
86
|
+
root_display: inline-block
|
|
87
|
+
width_behavior: content-sized by default
|
|
88
|
+
|
|
89
|
+
behavior:
|
|
90
|
+
notes:
|
|
91
|
+
- Best for immediate boolean settings, not for long-form confirmation choices.
|
|
92
|
+
- Disabled blocks interaction while preserving the current state visually.
|
|
93
|
+
|
|
94
|
+
composition:
|
|
95
|
+
works_well_with:
|
|
96
|
+
- UiField
|
|
97
|
+
patterns:
|
|
98
|
+
- title: Settings row
|
|
99
|
+
notes: Pair with a visible label and optional description so the on or off state is unambiguous.
|
|
100
|
+
avoid:
|
|
101
|
+
- Do not use without a nearby label; the switch alone does not explain what will change.
|
|
102
|
+
|
|
103
|
+
ai_notes:
|
|
104
|
+
do:
|
|
105
|
+
- Use for compact feature toggles and enable or disable settings.
|
|
106
|
+
avoid:
|
|
107
|
+
- Do not use for multi-select lists or legal acknowledgements; use UiCheckbox.
|
|
108
|
+
|
|
109
|
+
accessibility:
|
|
110
|
+
notes:
|
|
111
|
+
- Prefer visible text labels for interactive controls.
|
|
112
|
+
- For icon-only or custom visual content, provide an accessible name through the supported label, title, or ARIA attributes exposed by the component.
|
|
113
|
+
- Preserve native keyboard semantics by using the component root instead of recreating the control with arbitrary markup.
|
|
114
|
+
keyboard:
|
|
115
|
+
- Tab moves focus to the control when it is focusable.
|
|
116
|
+
- Enter or Space activates native button-like controls when the host implementation renders a button.
|
|
117
|
+
|
|
118
|
+
styling:
|
|
119
|
+
notes:
|
|
120
|
+
- Use documented props and slots as the primary styling API.
|
|
121
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
122
|
+
root_classes:
|
|
123
|
+
- .ui-v1-switch
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
component: UiTab
|
|
2
|
+
summary: >
|
|
3
|
+
UiTab is a declarative child node for UiTabGroup. It does not render meaningful
|
|
4
|
+
standalone UI by itself; instead, UiTabGroup consumes its props and slots to build
|
|
5
|
+
tab buttons, overflow menu items, and optional tab panel content.
|
|
6
|
+
|
|
7
|
+
public_import:
|
|
8
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
9
|
+
named:
|
|
10
|
+
- UiTab
|
|
11
|
+
- UiTabGroup
|
|
12
|
+
|
|
13
|
+
related_components:
|
|
14
|
+
- UiTabGroup
|
|
15
|
+
|
|
16
|
+
examples:
|
|
17
|
+
- title: Tabs through `items`
|
|
18
|
+
code: |
|
|
19
|
+
<template>
|
|
20
|
+
<UiTabGroup
|
|
21
|
+
v-model:active-id="activeId"
|
|
22
|
+
:items="items"
|
|
23
|
+
overflowing
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script lang="ts" setup>
|
|
28
|
+
import { ref } from 'vue'
|
|
29
|
+
import { UiTabGroup } from '@retailcrm/embed-ui-v1-components/remote'
|
|
30
|
+
|
|
31
|
+
const activeId = ref('overview')
|
|
32
|
+
|
|
33
|
+
const items = [
|
|
34
|
+
{ id: 'overview', label: 'Overview', counter: '8' },
|
|
35
|
+
{ id: 'orders', label: 'Orders', counter: '12' },
|
|
36
|
+
{ id: 'files', label: 'Files', counter: '3' },
|
|
37
|
+
]
|
|
38
|
+
</script>
|
|
39
|
+
- title: Tabs through `UiTab`, slot icons, and panel content
|
|
40
|
+
code: |
|
|
41
|
+
<template>
|
|
42
|
+
<UiTabGroup
|
|
43
|
+
v-model:active-id="activeId"
|
|
44
|
+
overflowing
|
|
45
|
+
>
|
|
46
|
+
<UiTab
|
|
47
|
+
v-for="item in items"
|
|
48
|
+
:key="item.id"
|
|
49
|
+
:id="item.id"
|
|
50
|
+
:label="item.label"
|
|
51
|
+
:counter="item.counter"
|
|
52
|
+
:disabled="item.disabled"
|
|
53
|
+
>
|
|
54
|
+
<template #icon>
|
|
55
|
+
<IconStar />
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<template #content>
|
|
59
|
+
<section>
|
|
60
|
+
<h4>{{ item.label }}</h4>
|
|
61
|
+
<p>Active panel content for the tab {{ item.label }}</p>
|
|
62
|
+
</section>
|
|
63
|
+
</template>
|
|
64
|
+
</UiTab>
|
|
65
|
+
</UiTabGroup>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script lang="ts" setup>
|
|
69
|
+
import { ref } from 'vue'
|
|
70
|
+
import IconStar from '@retailcrm/embed-ui-v1-components/assets/sprites/actions/star.svg'
|
|
71
|
+
import {
|
|
72
|
+
UiTab,
|
|
73
|
+
UiTabGroup,
|
|
74
|
+
} from '@retailcrm/embed-ui-v1-components/remote'
|
|
75
|
+
|
|
76
|
+
const activeId = ref('overview')
|
|
77
|
+
|
|
78
|
+
const items = [
|
|
79
|
+
{ id: 'overview', label: 'Overview', counter: '8' },
|
|
80
|
+
{ id: 'orders', label: 'Orders', counter: '12' },
|
|
81
|
+
{ id: 'files', label: 'Files', counter: '3' },
|
|
82
|
+
]
|
|
83
|
+
</script>
|
|
84
|
+
- title: Filled tabs
|
|
85
|
+
code: |
|
|
86
|
+
<template>
|
|
87
|
+
<UiTabGroup
|
|
88
|
+
v-model:active-id="activeId"
|
|
89
|
+
appearance="filled"
|
|
90
|
+
>
|
|
91
|
+
<UiTab
|
|
92
|
+
v-for="item in items"
|
|
93
|
+
:key="item.id"
|
|
94
|
+
:id="item.id"
|
|
95
|
+
:label="item.label"
|
|
96
|
+
:counter="item.counter"
|
|
97
|
+
>
|
|
98
|
+
<template #icon>
|
|
99
|
+
<IconStar />
|
|
100
|
+
</template>
|
|
101
|
+
</UiTab>
|
|
102
|
+
</UiTabGroup>
|
|
103
|
+
</template>
|
|
104
|
+
|
|
105
|
+
<script lang="ts" setup>
|
|
106
|
+
import { ref } from 'vue'
|
|
107
|
+
import IconStar from '@retailcrm/embed-ui-v1-components/assets/sprites/actions/star.svg'
|
|
108
|
+
import { UiTab, UiTabGroup } from '@retailcrm/embed-ui-v1-components/remote'
|
|
109
|
+
|
|
110
|
+
const activeId = ref('overview')
|
|
111
|
+
|
|
112
|
+
const items = [
|
|
113
|
+
{ id: 'overview', label: 'Overview', counter: '8' },
|
|
114
|
+
{ id: 'orders', label: 'Orders', counter: '12' },
|
|
115
|
+
{ id: 'files', label: 'Files', counter: '3' },
|
|
116
|
+
]
|
|
117
|
+
</script>
|
|
118
|
+
- title: Overflow menu
|
|
119
|
+
code: |
|
|
120
|
+
<template>
|
|
121
|
+
<div style="width: 320px;">
|
|
122
|
+
<UiTabGroup
|
|
123
|
+
v-model:active-id="activeId"
|
|
124
|
+
:items="items"
|
|
125
|
+
overflowing
|
|
126
|
+
/>
|
|
127
|
+
</div>
|
|
128
|
+
</template>
|
|
129
|
+
|
|
130
|
+
<script lang="ts" setup>
|
|
131
|
+
import { ref } from 'vue'
|
|
132
|
+
import { UiTabGroup } from '@retailcrm/embed-ui-v1-components/remote'
|
|
133
|
+
|
|
134
|
+
const activeId = ref('overview')
|
|
135
|
+
|
|
136
|
+
const items = [
|
|
137
|
+
{ id: 'overview', label: 'Overview', counter: '8' },
|
|
138
|
+
{ id: 'orders', label: 'Orders', counter: '12' },
|
|
139
|
+
{ id: 'files', label: 'Files', counter: '3' },
|
|
140
|
+
]
|
|
141
|
+
</script>
|
|
142
|
+
use_when:
|
|
143
|
+
- You need custom icon, label, counter, or content inside UiTabGroup.
|
|
144
|
+
- You want each tab declaration to keep its header and panel content together.
|
|
145
|
+
|
|
146
|
+
avoid_when:
|
|
147
|
+
- You need a standalone button or link.
|
|
148
|
+
- A plain items array on UiTabGroup is enough for the screen.
|
|
149
|
+
- You need non-string tab identity, because UiTabGroup uses string id.
|
|
150
|
+
|
|
151
|
+
api:
|
|
152
|
+
key_props:
|
|
153
|
+
- name: id
|
|
154
|
+
notes: Required string identifier used by UiTabGroup as activeId.
|
|
155
|
+
- name: label
|
|
156
|
+
notes: Fallback plain-text header label.
|
|
157
|
+
- name: counter
|
|
158
|
+
notes: Optional badge-like counter.
|
|
159
|
+
- name: disabled
|
|
160
|
+
notes: Marks the tab as non-interactive.
|
|
161
|
+
props:
|
|
162
|
+
- name: id
|
|
163
|
+
notes: Must be unique within one UiTabGroup.
|
|
164
|
+
- name: label
|
|
165
|
+
notes: Optional when label slot is used.
|
|
166
|
+
- name: counter
|
|
167
|
+
notes: Optional when counter slot is used.
|
|
168
|
+
- name: disabled
|
|
169
|
+
notes: Excluded from selection and keyboard navigation.
|
|
170
|
+
slots:
|
|
171
|
+
- name: icon
|
|
172
|
+
zone: tab leading icon
|
|
173
|
+
notes: Used both in the visible tab button and in the overflow menu item.
|
|
174
|
+
- name: label
|
|
175
|
+
zone: tab label
|
|
176
|
+
notes: Overrides plain label prop for the header.
|
|
177
|
+
- name: counter
|
|
178
|
+
zone: tab counter
|
|
179
|
+
notes: Overrides plain counter prop for the header.
|
|
180
|
+
- name: content
|
|
181
|
+
zone: active tab panel
|
|
182
|
+
notes: Rendered only for the active tab by UiTabGroup.
|
|
183
|
+
|
|
184
|
+
rendered_structure:
|
|
185
|
+
descriptive_only: true
|
|
186
|
+
root:
|
|
187
|
+
shape: no standalone DOM root
|
|
188
|
+
tag: none
|
|
189
|
+
notes: >
|
|
190
|
+
UiTab is a structural declaration rather than a standalone DOM component. The
|
|
191
|
+
parent UiTabGroup resolves UiTab children and renders the actual tab buttons,
|
|
192
|
+
menu items, and optional tabpanel.
|
|
193
|
+
|
|
194
|
+
geometry:
|
|
195
|
+
layout: no standalone layout, interpreted by UiTabGroup
|
|
196
|
+
root_display: none
|
|
197
|
+
width_behavior: no standalone width behavior of its own
|
|
198
|
+
notes:
|
|
199
|
+
- UiTab itself should not be used outside UiTabGroup.
|
|
200
|
+
- Icon-only tabs are inferred when icon exists but label and counter do not.
|
|
201
|
+
|
|
202
|
+
behavior:
|
|
203
|
+
states:
|
|
204
|
+
- name: disabled
|
|
205
|
+
notes: The parent group keeps it visible but non-interactive.
|
|
206
|
+
notes:
|
|
207
|
+
- content slot is mounted only for the active tab.
|
|
208
|
+
- icon, label, and counter are also used when the tab moves into overflow menu.
|
|
209
|
+
|
|
210
|
+
accessibility:
|
|
211
|
+
notes:
|
|
212
|
+
- UiTab does not create tab semantics by itself.
|
|
213
|
+
- UiTabGroup applies role=tab, aria-selected, aria-controls, and tabpanel relationships.
|
|
214
|
+
|
|
215
|
+
composition:
|
|
216
|
+
works_well_with:
|
|
217
|
+
- UiTabGroup
|
|
218
|
+
patterns:
|
|
219
|
+
- title: Rich tab declaration
|
|
220
|
+
notes: Keep icon, counter, and content close to the tab declaration inside UiTabGroup.
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
ai_notes:
|
|
224
|
+
do:
|
|
225
|
+
- Use UiTab only inside UiTabGroup.
|
|
226
|
+
- Prefer label and counter props for simple cases, and slots for richer markup.
|
|
227
|
+
avoid:
|
|
228
|
+
- Do not expect UiTab to render useful DOM outside a group.
|
|
229
|
+
- Do not rely on an undocumented default slot for header rendering.
|
|
230
|
+
|
|
231
|
+
styling:
|
|
232
|
+
notes:
|
|
233
|
+
- Use documented props and slots as the primary styling API.
|
|
234
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
@@ -197,36 +197,6 @@ composition:
|
|
|
197
197
|
- title: Rich tabs from UiTab
|
|
198
198
|
notes: Use UiTab children when tabs need icon, custom label, counter, or tabpanel content.
|
|
199
199
|
|
|
200
|
-
examples:
|
|
201
|
-
- title: Data-driven tabs
|
|
202
|
-
goal: Render a compact tab header from plain items.
|
|
203
|
-
code: |
|
|
204
|
-
<UiTabGroup
|
|
205
|
-
v-model:active-id="activeId"
|
|
206
|
-
:items="[
|
|
207
|
-
{ id: 'overview', label: 'Overview', counter: '8' },
|
|
208
|
-
{ id: 'orders', label: 'Orders', counter: '12' },
|
|
209
|
-
]"
|
|
210
|
-
overflowing
|
|
211
|
-
/>
|
|
212
|
-
- title: Tabs with panel content
|
|
213
|
-
goal: Render active tabpanel content from UiTab child declarations.
|
|
214
|
-
code: |
|
|
215
|
-
<UiTabGroup
|
|
216
|
-
v-model:active-id="activeId"
|
|
217
|
-
overflowing
|
|
218
|
-
>
|
|
219
|
-
<UiTab id="overview" label="Overview">
|
|
220
|
-
<template #content>
|
|
221
|
-
<section>
|
|
222
|
-
<h4>Overview</h4>
|
|
223
|
-
<p>Visible only when this tab is active.</p>
|
|
224
|
-
</section>
|
|
225
|
-
</template>
|
|
226
|
-
</UiTab>
|
|
227
|
-
|
|
228
|
-
<UiTab id="orders" label="Orders" />
|
|
229
|
-
</UiTabGroup>
|
|
230
200
|
|
|
231
201
|
ai_notes:
|
|
232
202
|
do:
|