@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,143 @@
|
|
|
1
|
+
component: UiCollapseBox
|
|
2
|
+
summary: >
|
|
3
|
+
UiCollapseBox is a structured expandable container with built-in header, state handling,
|
|
4
|
+
and visual treatment. It is a higher-level companion to UiCollapse.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiCollapseBox
|
|
10
|
+
|
|
11
|
+
related_components:
|
|
12
|
+
- UiCollapse
|
|
13
|
+
- UiCollapseGroup
|
|
14
|
+
|
|
15
|
+
examples:
|
|
16
|
+
- title: Basic collapse box
|
|
17
|
+
code: |
|
|
18
|
+
<template>
|
|
19
|
+
<UiCollapseBox v-model:expanded="expanded">
|
|
20
|
+
<template #title>Section title</template>
|
|
21
|
+
<template #body-content>Section content</template>
|
|
22
|
+
</UiCollapseBox>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script lang="ts" setup>
|
|
26
|
+
import { ref } from 'vue'
|
|
27
|
+
import { UiCollapseBox } from '@retailcrm/embed-ui-v1-components/remote'
|
|
28
|
+
|
|
29
|
+
const expanded = ref(false)
|
|
30
|
+
</script>
|
|
31
|
+
- title: Grouped collapse boxes
|
|
32
|
+
code: |
|
|
33
|
+
<template>
|
|
34
|
+
<UiCollapseGroup v-model:activeBoxId="activeBoxId">
|
|
35
|
+
<UiCollapseBox id="one">
|
|
36
|
+
<template #title>One</template>
|
|
37
|
+
<template #body-content>...</template>
|
|
38
|
+
</UiCollapseBox>
|
|
39
|
+
|
|
40
|
+
<UiCollapseBox id="two">
|
|
41
|
+
<template #title>Two</template>
|
|
42
|
+
<template #body-content>...</template>
|
|
43
|
+
</UiCollapseBox>
|
|
44
|
+
</UiCollapseGroup>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script lang="ts" setup>
|
|
48
|
+
import { ref } from 'vue'
|
|
49
|
+
import { UiCollapseBox, UiCollapseGroup } from '@retailcrm/embed-ui-v1-components/remote'
|
|
50
|
+
|
|
51
|
+
const activeBoxId = ref('one')
|
|
52
|
+
</script>
|
|
53
|
+
- title: Disabled
|
|
54
|
+
code: |
|
|
55
|
+
<template>
|
|
56
|
+
<UiCollapseBox disabled>
|
|
57
|
+
<template #title>Disabled section</template>
|
|
58
|
+
</UiCollapseBox>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script lang="ts" setup>
|
|
62
|
+
import { UiCollapseBox } from '@retailcrm/embed-ui-v1-components/remote'
|
|
63
|
+
</script>
|
|
64
|
+
- title: Custom icon through a slot
|
|
65
|
+
code: |
|
|
66
|
+
<template>
|
|
67
|
+
<UiCollapseBox>
|
|
68
|
+
<template #icon>
|
|
69
|
+
<MyCustomIcon />
|
|
70
|
+
</template>
|
|
71
|
+
</UiCollapseBox>
|
|
72
|
+
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<script lang="ts" setup>
|
|
76
|
+
import MyCustomIcon from '@retailcrm/embed-ui-v1-components/assets/sprites/actions/info.svg'
|
|
77
|
+
import { UiCollapseBox } from '@retailcrm/embed-ui-v1-components/remote'
|
|
78
|
+
</script>
|
|
79
|
+
use_when:
|
|
80
|
+
- You need a ready-to-use collapsible box.
|
|
81
|
+
- You need grouped expandable sections with consistent visuals.
|
|
82
|
+
|
|
83
|
+
avoid_when:
|
|
84
|
+
- You need a bare collapse primitive without box chrome.
|
|
85
|
+
|
|
86
|
+
api:
|
|
87
|
+
key_props:
|
|
88
|
+
- name: expanded
|
|
89
|
+
- name: expandable
|
|
90
|
+
- name: collapsible
|
|
91
|
+
- name: toggleable
|
|
92
|
+
- name: disabled
|
|
93
|
+
- name: color
|
|
94
|
+
|
|
95
|
+
rendered_structure:
|
|
96
|
+
descriptive_only: true
|
|
97
|
+
root:
|
|
98
|
+
shape: section.ui-v1-collapse-box
|
|
99
|
+
tag: section
|
|
100
|
+
notes: Renders one section root with a header button and a collapsible body region.
|
|
101
|
+
|
|
102
|
+
geometry:
|
|
103
|
+
layout: block-like collapsible section
|
|
104
|
+
root_display: flex
|
|
105
|
+
width_behavior: stretches to container width by default
|
|
106
|
+
|
|
107
|
+
behavior:
|
|
108
|
+
notes:
|
|
109
|
+
- Supports controlled expanded state and grouped interaction.
|
|
110
|
+
|
|
111
|
+
ai_notes:
|
|
112
|
+
do:
|
|
113
|
+
- Use UiCollapseBox for structured disclosure UI.
|
|
114
|
+
- Put the summary in the header and details in the body; avoid hiding critical required fields.
|
|
115
|
+
avoid:
|
|
116
|
+
- Do not rebuild collapse header UI manually when this component already fits.
|
|
117
|
+
|
|
118
|
+
composition:
|
|
119
|
+
works_well_with:
|
|
120
|
+
- UiCollapse
|
|
121
|
+
- UiCollapseGroup
|
|
122
|
+
- UiInfobox
|
|
123
|
+
patterns:
|
|
124
|
+
- title: Settings section
|
|
125
|
+
notes: Use for optional or advanced settings groups.
|
|
126
|
+
- title: Grouped disclosures
|
|
127
|
+
notes: Use inside UiCollapseGroup when multiple boxes should coordinate active state.
|
|
128
|
+
|
|
129
|
+
accessibility:
|
|
130
|
+
notes:
|
|
131
|
+
- Prefer visible text labels for interactive controls.
|
|
132
|
+
- For icon-only or custom visual content, provide an accessible name through the supported label, title, or ARIA attributes exposed by the component.
|
|
133
|
+
- Preserve native keyboard semantics by using the component root instead of recreating the control with arbitrary markup.
|
|
134
|
+
keyboard:
|
|
135
|
+
- Tab moves focus to the control when it is focusable.
|
|
136
|
+
- Enter or Space activates native button-like controls when the host implementation renders a button.
|
|
137
|
+
|
|
138
|
+
styling:
|
|
139
|
+
notes:
|
|
140
|
+
- Use documented props and slots as the primary styling API.
|
|
141
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
142
|
+
root_classes:
|
|
143
|
+
- .ui-v1-collapse-box
|
|
@@ -37,3 +37,27 @@ geometry:
|
|
|
37
37
|
ai_notes:
|
|
38
38
|
do:
|
|
39
39
|
- Use with UiCollapseBox when grouped expansion matters.
|
|
40
|
+
avoid:
|
|
41
|
+
- Do not introduce a group for a single collapsible section.
|
|
42
|
+
|
|
43
|
+
behavior:
|
|
44
|
+
notes:
|
|
45
|
+
- activeBoxId tracks which child section is active.
|
|
46
|
+
- The component is mostly coordination logic rather than a visual container.
|
|
47
|
+
|
|
48
|
+
composition:
|
|
49
|
+
works_well_with:
|
|
50
|
+
- UiCollapseBox
|
|
51
|
+
patterns:
|
|
52
|
+
- title: Accordion-like settings
|
|
53
|
+
notes: Use when users should move between several related expandable sections.
|
|
54
|
+
|
|
55
|
+
accessibility:
|
|
56
|
+
notes:
|
|
57
|
+
- Keep visible labels and slot content meaningful.
|
|
58
|
+
- Prefer documented props and slots over custom DOM replacements so host-side accessibility behavior is preserved.
|
|
59
|
+
|
|
60
|
+
styling:
|
|
61
|
+
notes:
|
|
62
|
+
- Use documented props and slots as the primary styling API.
|
|
63
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
component: UiCopyButton
|
|
2
|
+
summary: >
|
|
3
|
+
UiCopyButton is an action component for copying text values with tooltip feedback.
|
|
4
|
+
It wraps copy behavior and copied-state hinting into one compact UI.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiCopyButton
|
|
10
|
+
|
|
11
|
+
related_components:
|
|
12
|
+
- UiTooltip
|
|
13
|
+
- UiButton
|
|
14
|
+
|
|
15
|
+
examples:
|
|
16
|
+
- title: Example
|
|
17
|
+
code: |
|
|
18
|
+
<template>
|
|
19
|
+
<UiCopyButton text="Text to copy" size="sm">
|
|
20
|
+
<template #hint>
|
|
21
|
+
Copy
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<template #hint-copied>
|
|
25
|
+
Copied
|
|
26
|
+
</template>
|
|
27
|
+
</UiCopyButton>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script lang="ts" setup>
|
|
31
|
+
import { UiCopyButton } from '@retailcrm/embed-ui-v1-components/remote'
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
use_when:
|
|
35
|
+
- You need a copy-to-clipboard action for a value.
|
|
36
|
+
- You need built-in hint and copied-state tooltip text.
|
|
37
|
+
|
|
38
|
+
avoid_when:
|
|
39
|
+
- You need a generic button with no copy semantics.
|
|
40
|
+
|
|
41
|
+
api:
|
|
42
|
+
key_props:
|
|
43
|
+
- name: text
|
|
44
|
+
- name: size
|
|
45
|
+
- name: tooltipOptions
|
|
46
|
+
slots:
|
|
47
|
+
- name: trigger
|
|
48
|
+
zone: trigger
|
|
49
|
+
creates: Visible trigger content.
|
|
50
|
+
- name: hint
|
|
51
|
+
zone: tooltip
|
|
52
|
+
creates: Default tooltip content.
|
|
53
|
+
- name: hint-copied
|
|
54
|
+
zone: tooltip
|
|
55
|
+
creates: Tooltip content after copy succeeds.
|
|
56
|
+
|
|
57
|
+
rendered_structure:
|
|
58
|
+
descriptive_only: true
|
|
59
|
+
root:
|
|
60
|
+
shape: div.ui-v1-copy-button
|
|
61
|
+
tag: div
|
|
62
|
+
notes: The root wraps the trigger, tooltip, and fallback input for clipboard support.
|
|
63
|
+
|
|
64
|
+
geometry:
|
|
65
|
+
layout: inline trigger wrapper
|
|
66
|
+
root_display: inline-block
|
|
67
|
+
width_behavior: content-sized by default
|
|
68
|
+
|
|
69
|
+
ai_notes:
|
|
70
|
+
do:
|
|
71
|
+
- Use for copy-specific flows instead of recreating copy state manually.
|
|
72
|
+
- Provide the exact text prop that should be copied.
|
|
73
|
+
avoid:
|
|
74
|
+
- Do not use for actions whose primary purpose is not copying.
|
|
75
|
+
|
|
76
|
+
behavior:
|
|
77
|
+
notes:
|
|
78
|
+
- Shows normal hint content before copy and copied-state hint after successful copy.
|
|
79
|
+
- tooltipOptions customizes the hint surface.
|
|
80
|
+
|
|
81
|
+
composition:
|
|
82
|
+
works_well_with:
|
|
83
|
+
- UiTooltip
|
|
84
|
+
- UiButton
|
|
85
|
+
- UiTable
|
|
86
|
+
patterns:
|
|
87
|
+
- title: Copy value in a table
|
|
88
|
+
notes: Use for IDs, tokens, phones, or links where copying is a repeated row action.
|
|
89
|
+
|
|
90
|
+
accessibility:
|
|
91
|
+
notes:
|
|
92
|
+
- Prefer visible text labels for interactive controls.
|
|
93
|
+
- For icon-only or custom visual content, provide an accessible name through the supported label, title, or ARIA attributes exposed by the component.
|
|
94
|
+
- Preserve native keyboard semantics by using the component root instead of recreating the control with arbitrary markup.
|
|
95
|
+
keyboard:
|
|
96
|
+
- Tab moves focus to the control when it is focusable.
|
|
97
|
+
- Enter or Space activates native button-like controls when the host implementation renders a button.
|
|
98
|
+
|
|
99
|
+
styling:
|
|
100
|
+
notes:
|
|
101
|
+
- Use documented props and slots as the primary styling API.
|
|
102
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
103
|
+
root_classes:
|
|
104
|
+
- .ui-v1-copy-button
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
component: UiDate
|
|
2
|
+
summary: >
|
|
3
|
+
UiDate is a display component for formatted date or date-time output. It is for presenting
|
|
4
|
+
date values, not for editing them.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiDate
|
|
10
|
+
|
|
11
|
+
examples:
|
|
12
|
+
- title: Standard usage
|
|
13
|
+
code: |
|
|
14
|
+
<template>
|
|
15
|
+
<UiDate :date="new Date()" locale="en-GB" />
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup>
|
|
19
|
+
import { UiDate } from '@retailcrm/embed-ui-v1-components/remote'
|
|
20
|
+
</script>
|
|
21
|
+
- title: With time display
|
|
22
|
+
code: |
|
|
23
|
+
<template>
|
|
24
|
+
<UiDate :date="new Date()" locale="en-GB" with-time />
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup>
|
|
28
|
+
import { UiDate } from '@retailcrm/embed-ui-v1-components/remote'
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
use_when:
|
|
32
|
+
- You need to display a date value.
|
|
33
|
+
- You need optional time display with locale-aware formatting.
|
|
34
|
+
|
|
35
|
+
avoid_when:
|
|
36
|
+
- You need editable date input.
|
|
37
|
+
|
|
38
|
+
api:
|
|
39
|
+
key_props:
|
|
40
|
+
- name: date
|
|
41
|
+
- name: withTime
|
|
42
|
+
- name: locale
|
|
43
|
+
|
|
44
|
+
rendered_structure:
|
|
45
|
+
descriptive_only: true
|
|
46
|
+
root:
|
|
47
|
+
shape: time
|
|
48
|
+
tag: time
|
|
49
|
+
notes: Renders one semantic time element with formatted date text.
|
|
50
|
+
|
|
51
|
+
geometry:
|
|
52
|
+
layout: inline date text
|
|
53
|
+
root_display: inline
|
|
54
|
+
width_behavior: content-sized by content
|
|
55
|
+
|
|
56
|
+
ai_notes:
|
|
57
|
+
do:
|
|
58
|
+
- Use UiDate for formatted output and UiDatePicker for input.
|
|
59
|
+
- Use withTime only when the time changes user interpretation.
|
|
60
|
+
avoid:
|
|
61
|
+
- Do not use for editable date fields or filter controls.
|
|
62
|
+
|
|
63
|
+
behavior:
|
|
64
|
+
notes:
|
|
65
|
+
- Renders semantic time output for display.
|
|
66
|
+
- locale should be explicit when the surrounding screen uses a specific locale.
|
|
67
|
+
|
|
68
|
+
composition:
|
|
69
|
+
works_well_with:
|
|
70
|
+
- UiTable
|
|
71
|
+
- UiDatePicker
|
|
72
|
+
patterns:
|
|
73
|
+
- title: Table date
|
|
74
|
+
notes: Use plain formatted output in tables; split date and time into separate lines only for compact scanning.
|
|
75
|
+
|
|
76
|
+
accessibility:
|
|
77
|
+
notes:
|
|
78
|
+
- Keep rendered text concise and meaningful for screen-reader users.
|
|
79
|
+
- Do not use this component as the only carrier of critical state if the state also needs form-level validation or focus management.
|
|
80
|
+
|
|
81
|
+
styling:
|
|
82
|
+
notes:
|
|
83
|
+
- Use documented props and slots as the primary styling API.
|
|
84
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
component: UiDatePicker
|
|
2
|
+
summary: >
|
|
3
|
+
UiDatePicker combines textbox-like date display, popper behavior, and calendar selection.
|
|
4
|
+
It supports single-date and range flows, constraints, and quick options.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiDatePicker
|
|
10
|
+
|
|
11
|
+
related_components:
|
|
12
|
+
- UiCalendar
|
|
13
|
+
- UiTextbox
|
|
14
|
+
- UiPopper
|
|
15
|
+
|
|
16
|
+
examples:
|
|
17
|
+
- title: Example
|
|
18
|
+
code: |
|
|
19
|
+
<template>
|
|
20
|
+
<UiDatePicker v-model:value="value" />
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script lang="ts" setup>
|
|
24
|
+
import { ref } from 'vue'
|
|
25
|
+
import { UiDatePicker } from '@retailcrm/embed-ui-v1-components/remote'
|
|
26
|
+
|
|
27
|
+
const value = ref<Date | null>(new Date())
|
|
28
|
+
</script>
|
|
29
|
+
- title: Range selection
|
|
30
|
+
code: |
|
|
31
|
+
<template>
|
|
32
|
+
<UiDatePicker
|
|
33
|
+
v-model:value="value"
|
|
34
|
+
type="range"
|
|
35
|
+
/>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script lang="ts" setup>
|
|
39
|
+
import { ref } from 'vue'
|
|
40
|
+
import { UiDatePicker } from '@retailcrm/embed-ui-v1-components/remote'
|
|
41
|
+
|
|
42
|
+
const value = ref<Date[]>([
|
|
43
|
+
new Date('2024-11-10'),
|
|
44
|
+
new Date('2024-11-19'),
|
|
45
|
+
])
|
|
46
|
+
</script>
|
|
47
|
+
- title: Quick presets (`quickOptions`)
|
|
48
|
+
code: |
|
|
49
|
+
<template>
|
|
50
|
+
<UiDatePicker
|
|
51
|
+
v-model:value="value"
|
|
52
|
+
synchronization="confirmed"
|
|
53
|
+
:quick-options="[
|
|
54
|
+
{ label: 'Today', value: new Date() },
|
|
55
|
+
{ label: 'This week', value: [new Date('2024-11-18'), new Date('2024-11-24')] },
|
|
56
|
+
]"
|
|
57
|
+
/>
|
|
58
|
+
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script lang="ts" setup>
|
|
62
|
+
import { ref } from 'vue'
|
|
63
|
+
import { UiDatePicker } from '@retailcrm/embed-ui-v1-components/remote'
|
|
64
|
+
|
|
65
|
+
const value = ref<Date | null>(new Date())
|
|
66
|
+
</script>
|
|
67
|
+
use_when:
|
|
68
|
+
- You need editable date input.
|
|
69
|
+
- You need date-range selection through a textbox-plus-popup flow.
|
|
70
|
+
|
|
71
|
+
avoid_when:
|
|
72
|
+
- You need always-visible inline calendar selection only.
|
|
73
|
+
|
|
74
|
+
api:
|
|
75
|
+
key_props:
|
|
76
|
+
- name: value
|
|
77
|
+
- name: type
|
|
78
|
+
- name: minDate
|
|
79
|
+
- name: maxDate
|
|
80
|
+
- name: nullable
|
|
81
|
+
- name: synchronization
|
|
82
|
+
- name: quickOptions
|
|
83
|
+
- name: textboxOptions
|
|
84
|
+
methods:
|
|
85
|
+
- name: open
|
|
86
|
+
- name: close
|
|
87
|
+
- name: toggle
|
|
88
|
+
|
|
89
|
+
rendered_structure:
|
|
90
|
+
descriptive_only: true
|
|
91
|
+
root:
|
|
92
|
+
shape: span.ui-v1-date-picker
|
|
93
|
+
tag: span
|
|
94
|
+
notes: The visible trigger behaves like an inline date control that opens a floating calendar.
|
|
95
|
+
|
|
96
|
+
geometry:
|
|
97
|
+
layout: inline date input trigger
|
|
98
|
+
root_display: inline-block
|
|
99
|
+
width_behavior: content-sized by default
|
|
100
|
+
|
|
101
|
+
behavior:
|
|
102
|
+
notes:
|
|
103
|
+
- Supports single-date and range flows.
|
|
104
|
+
- synchronization controls instant versus confirmed behavior.
|
|
105
|
+
|
|
106
|
+
ai_notes:
|
|
107
|
+
do:
|
|
108
|
+
- Prefer UiDatePicker for typed or popup date input.
|
|
109
|
+
- Use textboxOptions for trigger sizing and placeholder behavior instead of custom trigger markup.
|
|
110
|
+
avoid:
|
|
111
|
+
- Do not use UiCalendar directly if a textbox trigger is expected.
|
|
112
|
+
|
|
113
|
+
composition:
|
|
114
|
+
works_well_with:
|
|
115
|
+
- UiField
|
|
116
|
+
- UiTable
|
|
117
|
+
- UiCalendar
|
|
118
|
+
patterns:
|
|
119
|
+
- title: Date filter
|
|
120
|
+
notes: Use in the filter area above UiTable for date and date-range filters; persist selected values in URL query parameters when routing exists.
|
|
121
|
+
- title: Form date input
|
|
122
|
+
notes: Wrap in UiField so label, hint, and validation are preserved.
|
|
123
|
+
|
|
124
|
+
accessibility:
|
|
125
|
+
notes:
|
|
126
|
+
- Prefer visible text labels for interactive controls.
|
|
127
|
+
- For icon-only or custom visual content, provide an accessible name through the supported label, title, or ARIA attributes exposed by the component.
|
|
128
|
+
- Preserve native keyboard semantics by using the component root instead of recreating the control with arbitrary markup.
|
|
129
|
+
keyboard:
|
|
130
|
+
- Tab moves focus to the control when it is focusable.
|
|
131
|
+
- Enter or Space activates native button-like controls when the host implementation renders a button.
|
|
132
|
+
|
|
133
|
+
styling:
|
|
134
|
+
notes:
|
|
135
|
+
- Use documented props and slots as the primary styling API.
|
|
136
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
137
|
+
root_classes:
|
|
138
|
+
- .ui-v1-date-picker
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
component: UiError
|
|
2
|
+
summary: >
|
|
3
|
+
UiError is a compact error-state component for short error messages or fallback states.
|
|
4
|
+
It is intended for concise inline error display rather than large alert copy.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiError
|
|
10
|
+
|
|
11
|
+
examples:
|
|
12
|
+
- title: Example
|
|
13
|
+
code: |
|
|
14
|
+
<template>
|
|
15
|
+
<UiError v-bind="$attrs" :class="$style['container']">
|
|
16
|
+
<template v-if="useSlot">
|
|
17
|
+
<div :class="$style['content']">
|
|
18
|
+
<IconError :class="$style['icon']" />
|
|
19
|
+
Error message with icon
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
</UiError>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script lang="ts" setup>
|
|
26
|
+
import { UiError } from '@retailcrm/embed-ui-v1-components/remote'
|
|
27
|
+
|
|
28
|
+
import IconError from '@retailcrm/embed-ui-v1-components/assets/sprites/alerts/error.svg'
|
|
29
|
+
|
|
30
|
+
defineProps({
|
|
31
|
+
useSlot: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false,
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style lang="less" module>
|
|
39
|
+
|
|
40
|
+
.container {
|
|
41
|
+
padding: 8px;
|
|
42
|
+
background: #FFF;
|
|
43
|
+
border: 1px solid #dee2e6;
|
|
44
|
+
border-radius: 8px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.content {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
gap: 4px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.icon {
|
|
54
|
+
width: 16px;
|
|
55
|
+
height: 16px;
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
58
|
+
|
|
59
|
+
use_when:
|
|
60
|
+
- You need a compact error block.
|
|
61
|
+
- You need inline error text with standard styling.
|
|
62
|
+
|
|
63
|
+
avoid_when:
|
|
64
|
+
- You need a richer feedback block, use UiAlert or UiInfobox instead.
|
|
65
|
+
|
|
66
|
+
api:
|
|
67
|
+
key_props:
|
|
68
|
+
- name: message
|
|
69
|
+
notes: Fallback error text when default slot is not provided.
|
|
70
|
+
- name: align
|
|
71
|
+
notes: left or right text alignment.
|
|
72
|
+
- name: ellipsis
|
|
73
|
+
notes: Truncates long error text instead of wrapping.
|
|
74
|
+
slots:
|
|
75
|
+
- name: default
|
|
76
|
+
zone: error-content
|
|
77
|
+
creates: Error text or compact fallback content.
|
|
78
|
+
|
|
79
|
+
rendered_structure:
|
|
80
|
+
descriptive_only: true
|
|
81
|
+
root:
|
|
82
|
+
shape: div.ui-v1-error
|
|
83
|
+
tag: div
|
|
84
|
+
notes: Renders one text container for error content.
|
|
85
|
+
|
|
86
|
+
geometry:
|
|
87
|
+
layout: block-like error text container
|
|
88
|
+
root_display: block
|
|
89
|
+
width_behavior: stretches to container width by default
|
|
90
|
+
|
|
91
|
+
ai_notes:
|
|
92
|
+
do:
|
|
93
|
+
- Use for compact error presentation.
|
|
94
|
+
- Keep the message short and specific.
|
|
95
|
+
avoid:
|
|
96
|
+
- Do not use for multi-paragraph explanations or page-level failures.
|
|
97
|
+
|
|
98
|
+
composition:
|
|
99
|
+
works_well_with:
|
|
100
|
+
- UiField
|
|
101
|
+
- UiAlert
|
|
102
|
+
patterns:
|
|
103
|
+
- title: Field or section error
|
|
104
|
+
notes: Use where the user needs to see a concise local error message.
|
|
105
|
+
- title: Page-level failure
|
|
106
|
+
notes: Use UiAlert or UiInfobox instead when the error needs explanation and actions.
|
|
107
|
+
|
|
108
|
+
behavior:
|
|
109
|
+
notes:
|
|
110
|
+
- Read key_props first to identify supported states and variants.
|
|
111
|
+
- Prefer controlled props and documented emits when synchronizing component state with screen logic.
|
|
112
|
+
|
|
113
|
+
accessibility:
|
|
114
|
+
notes:
|
|
115
|
+
- Keep rendered text concise and meaningful for screen-reader users.
|
|
116
|
+
- Do not use this component as the only carrier of critical state if the state also needs form-level validation or focus management.
|
|
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-error
|
|
@@ -15,6 +15,52 @@ related_components:
|
|
|
15
15
|
- UiCheckbox
|
|
16
16
|
- UiDatePicker
|
|
17
17
|
|
|
18
|
+
examples:
|
|
19
|
+
- title: Basic usage
|
|
20
|
+
code: |
|
|
21
|
+
<template>
|
|
22
|
+
<UiField id="name-field" label="Name" hint="At least 3 characters">
|
|
23
|
+
<template #default="field">
|
|
24
|
+
<UiTextbox
|
|
25
|
+
:id="field.id"
|
|
26
|
+
:input-attributes="{
|
|
27
|
+
'aria-labelledby': field.ariaLabelledby,
|
|
28
|
+
'aria-invalid': field.ariaInvalid,
|
|
29
|
+
}"
|
|
30
|
+
/>
|
|
31
|
+
</template>
|
|
32
|
+
</UiField>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script lang="ts" setup>
|
|
36
|
+
import {
|
|
37
|
+
UiField,
|
|
38
|
+
UiTextbox,
|
|
39
|
+
} from '@retailcrm/embed-ui-v1-components/remote'
|
|
40
|
+
</script>
|
|
41
|
+
- title: Addon next to label
|
|
42
|
+
code: |
|
|
43
|
+
<template>
|
|
44
|
+
<UiField id="name-field" label="Name">
|
|
45
|
+
<template #addon>
|
|
46
|
+
Up to 32 characters
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<template #default="field">
|
|
50
|
+
<UiTextbox
|
|
51
|
+
:id="field.id"
|
|
52
|
+
:input-attributes="{
|
|
53
|
+
'aria-labelledby': field.ariaLabelledby,
|
|
54
|
+
'aria-invalid': field.ariaInvalid,
|
|
55
|
+
}"
|
|
56
|
+
/>
|
|
57
|
+
</template>
|
|
58
|
+
</UiField>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script lang="ts" setup>
|
|
62
|
+
import { UiField, UiTextbox } from '@retailcrm/embed-ui-v1-components/remote'
|
|
63
|
+
</script>
|
|
18
64
|
use_when:
|
|
19
65
|
- You need a labeled form control with consistent field semantics.
|
|
20
66
|
- You need to pass id, aria-labelledby, and aria-invalid into an inner control.
|
|
@@ -208,21 +254,6 @@ composition:
|
|
|
208
254
|
- title: Safe field wiring
|
|
209
255
|
notes: Use slot props for semantics, not just for visual wrapping.
|
|
210
256
|
|
|
211
|
-
examples:
|
|
212
|
-
- title: Text field with propagated semantics
|
|
213
|
-
goal: Build a text field with correct ARIA wiring.
|
|
214
|
-
code: |
|
|
215
|
-
<UiField id="comment" label="Comment" hint="Visible to managers">
|
|
216
|
-
<template #default="field">
|
|
217
|
-
<UiTextbox
|
|
218
|
-
:id="field.id"
|
|
219
|
-
:input-attributes="{
|
|
220
|
-
'aria-labelledby': field.ariaLabelledby,
|
|
221
|
-
'aria-invalid': field.ariaInvalid,
|
|
222
|
-
}"
|
|
223
|
-
/>
|
|
224
|
-
</template>
|
|
225
|
-
</UiField>
|
|
226
257
|
|
|
227
258
|
ai_notes:
|
|
228
259
|
do:
|