@cocoar/vue-ui 3.1.0 → 3.2.0-beta.11
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/bin/cli.mjs +53 -0
- package/dist/components/checkbox/CoarCheckbox.vue.d.ts +1 -1
- package/dist/components/checkbox/CoarCheckbox.vue.d.ts.map +1 -1
- package/dist/components/code-block/CoarCodeBlock.vue.d.ts +1 -1
- package/dist/components/code-block/CoarCodeBlock.vue.d.ts.map +1 -1
- package/dist/components/data-list/CoarDataList.vue.d.ts +158 -0
- package/dist/components/data-list/CoarDataList.vue.d.ts.map +1 -0
- package/dist/components/data-list/CoarDataListToolbar.vue.d.ts +30 -0
- package/dist/components/data-list/CoarDataListToolbar.vue.d.ts.map +1 -0
- package/dist/components/data-list/data-list-builder.d.ts +288 -0
- package/dist/components/data-list/data-list-builder.d.ts.map +1 -0
- package/dist/components/data-list/index.d.ts +12 -0
- package/dist/components/data-list/index.d.ts.map +1 -0
- package/dist/components/data-list/internal/compare.d.ts +14 -0
- package/dist/components/data-list/internal/compare.d.ts.map +1 -0
- package/dist/components/data-list/internal/reorder-core.d.ts +46 -0
- package/dist/components/data-list/internal/reorder-core.d.ts.map +1 -0
- package/dist/components/data-list/internal/search.d.ts +16 -0
- package/dist/components/data-list/internal/search.d.ts.map +1 -0
- package/dist/components/data-list/internal/useDataListLines.d.ts +92 -0
- package/dist/components/data-list/internal/useDataListLines.d.ts.map +1 -0
- package/dist/components/data-list/internal/useDataListReorder.d.ts +68 -0
- package/dist/components/data-list/internal/useDataListReorder.d.ts.map +1 -0
- package/dist/components/data-list/internal/useSearchHighlight.d.ts +19 -0
- package/dist/components/data-list/internal/useSearchHighlight.d.ts.map +1 -0
- package/dist/components/data-list/types.d.ts +185 -0
- package/dist/components/data-list/types.d.ts.map +1 -0
- package/dist/components/data-list/useDataListModel.d.ts +79 -0
- package/dist/components/data-list/useDataListModel.d.ts.map +1 -0
- package/dist/components/date-time/_shared/maskito-config.d.ts +7 -2
- package/dist/components/date-time/_shared/maskito-config.d.ts.map +1 -1
- package/dist/components/date-time/_shared/time-helpers.d.ts +11 -4
- package/dist/components/date-time/_shared/time-helpers.d.ts.map +1 -1
- package/dist/components/date-time/_shared/use-date-picker-base.d.ts +1 -1
- package/dist/components/date-time/plain-date-picker/CoarPlainDatePicker.vue.d.ts +1 -1
- package/dist/components/date-time/plain-date-picker/CoarPlainDatePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/plain-date-time-picker/CoarPlainDateTimePicker.vue.d.ts +1 -1
- package/dist/components/date-time/plain-date-time-picker/CoarPlainDateTimePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePicker.vue.d.ts +1 -1
- package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePicker.vue.d.ts.map +1 -1
- package/dist/components/dual-listbox/CoarDualListbox.vue.d.ts +3 -0
- package/dist/components/dual-listbox/CoarDualListbox.vue.d.ts.map +1 -1
- package/dist/components/form-field/CoarFormField.vue.d.ts +1 -1
- package/dist/components/form-field/CoarFormField.vue.d.ts.map +1 -1
- package/dist/components/icon/CoarIcon.vue.d.ts +2 -2
- package/dist/components/icon/CoarIcon.vue.d.ts.map +1 -1
- package/dist/components/listbox/CoarListbox.vue.d.ts +7 -0
- package/dist/components/listbox/CoarListbox.vue.d.ts.map +1 -1
- package/dist/components/number-input/CoarNumberInput.vue.d.ts +1 -1
- package/dist/components/number-input/CoarNumberInput.vue.d.ts.map +1 -1
- package/dist/components/otp-input/CoarOtpInput.vue.d.ts +1 -1
- package/dist/components/otp-input/CoarOtpInput.vue.d.ts.map +1 -1
- package/dist/components/password-input/CoarPasswordInput.vue.d.ts +1 -1
- package/dist/components/password-input/CoarPasswordInput.vue.d.ts.map +1 -1
- package/dist/components/switch/CoarSwitch.vue.d.ts +1 -1
- package/dist/components/switch/CoarSwitch.vue.d.ts.map +1 -1
- package/dist/components/text-input/CoarTextInput.vue.d.ts +1 -1
- package/dist/components/text-input/CoarTextInput.vue.d.ts.map +1 -1
- package/dist/composables/dragRegistry.d.ts +12 -0
- package/dist/composables/dragRegistry.d.ts.map +1 -1
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/composables/useDragDrop.d.ts +62 -6
- package/dist/composables/useDragDrop.d.ts.map +1 -1
- package/dist/composables/useVirtualList.d.ts +21 -1
- package/dist/composables/useVirtualList.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4508 -2039
- package/package.json +9 -3
- package/skills/cocoar-vue-ui/SKILL.md +244 -0
- package/skills/cocoar-vue-ui/references/components/avatar.md +178 -0
- package/skills/cocoar-vue-ui/references/components/badge.md +290 -0
- package/skills/cocoar-vue-ui/references/components/breadcrumb.md +238 -0
- package/skills/cocoar-vue-ui/references/components/button.md +252 -0
- package/skills/cocoar-vue-ui/references/components/calendar/agenda-view.md +372 -0
- package/skills/cocoar-vue-ui/references/components/calendar/coar-calendar.md +1647 -0
- package/skills/cocoar-vue-ui/references/components/calendar/day-view.md +361 -0
- package/skills/cocoar-vue-ui/references/components/calendar/index.md +312 -0
- package/skills/cocoar-vue-ui/references/components/calendar/month-view.md +486 -0
- package/skills/cocoar-vue-ui/references/components/calendar/performance.md +186 -0
- package/skills/cocoar-vue-ui/references/components/calendar/timeline-view.md +301 -0
- package/skills/cocoar-vue-ui/references/components/calendar/week-view.md +382 -0
- package/skills/cocoar-vue-ui/references/components/calendar/work-week-view.md +145 -0
- package/skills/cocoar-vue-ui/references/components/calendar/year-view.md +63 -0
- package/skills/cocoar-vue-ui/references/components/card.md +151 -0
- package/skills/cocoar-vue-ui/references/components/checkbox-group.md +103 -0
- package/skills/cocoar-vue-ui/references/components/checkbox.md +279 -0
- package/skills/cocoar-vue-ui/references/components/code-block.md +241 -0
- package/skills/cocoar-vue-ui/references/components/context-menu.md +355 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/checkbox.md +213 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/date-columns.md +272 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/editing.md +236 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/multi-select.md +193 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/number.md +147 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/select.md +202 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/text.md +127 -0
- package/skills/cocoar-vue-ui/references/components/data-grid.md +1225 -0
- package/skills/cocoar-vue-ui/references/components/data-list.md +2121 -0
- package/skills/cocoar-vue-ui/references/components/date-or-time-picker.md +200 -0
- package/skills/cocoar-vue-ui/references/components/date-picker.md +203 -0
- package/skills/cocoar-vue-ui/references/components/date-time-picker.md +154 -0
- package/skills/cocoar-vue-ui/references/components/date-views.md +212 -0
- package/skills/cocoar-vue-ui/references/components/dialog.md +148 -0
- package/skills/cocoar-vue-ui/references/components/divider.md +157 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/annotations.md +400 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/coar-document-viewer.md +327 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/index.md +234 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/toolbar.md +221 -0
- package/skills/cocoar-vue-ui/references/components/drag-drop.md +267 -0
- package/skills/cocoar-vue-ui/references/components/dual-listbox.md +449 -0
- package/skills/cocoar-vue-ui/references/components/file-explorer/asset-store.md +327 -0
- package/skills/cocoar-vue-ui/references/components/file-explorer/in-memory-store.md +176 -0
- package/skills/cocoar-vue-ui/references/components/file-explorer/index.md +311 -0
- package/skills/cocoar-vue-ui/references/components/file-explorer/use-file-explorer.md +300 -0
- package/skills/cocoar-vue-ui/references/components/form-field.md +1025 -0
- package/skills/cocoar-vue-ui/references/components/fragment-parser.md +298 -0
- package/skills/cocoar-vue-ui/references/components/link.md +235 -0
- package/skills/cocoar-vue-ui/references/components/listbox.md +575 -0
- package/skills/cocoar-vue-ui/references/components/map/editor.md +448 -0
- package/skills/cocoar-vue-ui/references/components/map/index.md +351 -0
- package/skills/cocoar-vue-ui/references/components/markdown-diagrams.md +210 -0
- package/skills/cocoar-vue-ui/references/components/markdown-editor.md +1478 -0
- package/skills/cocoar-vue-ui/references/components/markdown-embeds.md +387 -0
- package/skills/cocoar-vue-ui/references/components/markdown-form.md +447 -0
- package/skills/cocoar-vue-ui/references/components/markdown.md +276 -0
- package/skills/cocoar-vue-ui/references/components/menu.md +380 -0
- package/skills/cocoar-vue-ui/references/components/mermaid.md +172 -0
- package/skills/cocoar-vue-ui/references/components/navbar.md +147 -0
- package/skills/cocoar-vue-ui/references/components/note.md +96 -0
- package/skills/cocoar-vue-ui/references/components/notice.md +131 -0
- package/skills/cocoar-vue-ui/references/components/number-input.md +215 -0
- package/skills/cocoar-vue-ui/references/components/otp-input.md +324 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/authoring-contract.md +271 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/coar-page-builder.md +476 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/coar-page-renderer.md +677 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/custom-elements.md +441 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/idp-integration.md +122 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/index.md +573 -0
- package/skills/cocoar-vue-ui/references/components/pagination.md +150 -0
- package/skills/cocoar-vue-ui/references/components/panel-layout.md +372 -0
- package/skills/cocoar-vue-ui/references/components/password-input.md +175 -0
- package/skills/cocoar-vue-ui/references/components/popconfirm.md +186 -0
- package/skills/cocoar-vue-ui/references/components/popover.md +173 -0
- package/skills/cocoar-vue-ui/references/components/progress-bar.md +178 -0
- package/skills/cocoar-vue-ui/references/components/radio-group.md +225 -0
- package/skills/cocoar-vue-ui/references/components/script-editor.md +1271 -0
- package/skills/cocoar-vue-ui/references/components/segmented-control.md +238 -0
- package/skills/cocoar-vue-ui/references/components/select.md +463 -0
- package/skills/cocoar-vue-ui/references/components/sidebar.md +421 -0
- package/skills/cocoar-vue-ui/references/components/spinner.md +132 -0
- package/skills/cocoar-vue-ui/references/components/switch.md +195 -0
- package/skills/cocoar-vue-ui/references/components/table.md +170 -0
- package/skills/cocoar-vue-ui/references/components/tabs.md +382 -0
- package/skills/cocoar-vue-ui/references/components/tag.md +178 -0
- package/skills/cocoar-vue-ui/references/components/text-input.md +256 -0
- package/skills/cocoar-vue-ui/references/components/toast.md +160 -0
- package/skills/cocoar-vue-ui/references/components/tooltip.md +121 -0
- package/skills/cocoar-vue-ui/references/components/transitions.md +193 -0
- package/skills/cocoar-vue-ui/references/components/tree.md +2388 -0
- package/skills/cocoar-vue-ui/references/components/virtual-list.md +212 -0
- package/skills/cocoar-vue-ui/references/components/wizard.md +251 -0
- package/skills/cocoar-vue-ui/references/components/zoned-date-time-picker.md +177 -0
- package/skills/cocoar-vue-ui/references/foundations/colors.md +708 -0
- package/skills/cocoar-vue-ui/references/foundations/design-principles.md +115 -0
- package/skills/cocoar-vue-ui/references/foundations/icons.md +381 -0
- package/skills/cocoar-vue-ui/references/foundations/localization/formatting.md +530 -0
- package/skills/cocoar-vue-ui/references/foundations/localization/setup.md +86 -0
- package/skills/cocoar-vue-ui/references/foundations/localization/timezones.md +182 -0
- package/skills/cocoar-vue-ui/references/foundations/localization/translations.md +305 -0
- package/skills/cocoar-vue-ui/references/foundations/motion.md +549 -0
- package/skills/cocoar-vue-ui/references/foundations/spacing.md +330 -0
- package/skills/cocoar-vue-ui/references/foundations/theming.md +140 -0
- package/skills/cocoar-vue-ui/references/foundations/typography.md +206 -0
- package/skills/cocoar-vue-ui/references/guide/error-handling.md +162 -0
- package/skills/cocoar-vue-ui/references/guide/getting-started.md +116 -0
- package/skills/cocoar-vue-ui/references/guide/migration-page-builder-3.md +207 -0
- package/skills/cocoar-vue-ui/references/guide/migration.md +140 -0
- package/skills/cocoar-vue-ui/references/guide/theming.md +98 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
<!-- Generated from apps/docs/components/popconfirm.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
|
|
2
|
+
|
|
3
|
+
# Popconfirm
|
|
4
|
+
|
|
5
|
+
A lightweight confirmation bubble that appears right next to the trigger element. Use it for quick "are you sure?" moments -- deleting a row, removing a team member, or publishing a change -- without pulling the user out of context with a full-screen modal dialog.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { CoarPopconfirm } from '@cocoar/vue-ui';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic Usage
|
|
12
|
+
|
|
13
|
+
Wrap any button (or other trigger) in `CoarPopconfirm`. When the trigger is clicked, a small confirmation panel appears nearby with confirm and cancel actions.
|
|
14
|
+
|
|
15
|
+
**Demo — `popconfirm/demos/PopconfirmBasic.vue`**
|
|
16
|
+
|
|
17
|
+
```vue
|
|
18
|
+
<template>
|
|
19
|
+
<div style="display: flex; flex-wrap: wrap; gap: 8px; align-items: center;">
|
|
20
|
+
<CoarPopconfirm
|
|
21
|
+
title="Delete item?"
|
|
22
|
+
message="This action cannot be undone."
|
|
23
|
+
@confirmed="lastAction = 'deleted'"
|
|
24
|
+
@cancelled="lastAction = 'cancelled'"
|
|
25
|
+
>
|
|
26
|
+
<CoarButton variant="danger" icon-start="trash-2">Delete</CoarButton>
|
|
27
|
+
</CoarPopconfirm>
|
|
28
|
+
</div>
|
|
29
|
+
<p style="margin-top: 8px; font-size: 13px; color: var(--coar-text-neutral-secondary);">
|
|
30
|
+
Last action: {{ lastAction || 'none' }}
|
|
31
|
+
</p>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { ref } from 'vue';
|
|
36
|
+
import { CoarButton, CoarPopconfirm } from '@cocoar/vue-ui';
|
|
37
|
+
|
|
38
|
+
const lastAction = ref('');
|
|
39
|
+
</script>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Variants
|
|
43
|
+
|
|
44
|
+
Use `confirmVariant="danger"` for destructive operations to make the risk visually clear. The `"primary"` variant (default) suits non-destructive confirmations like publishing or saving.
|
|
45
|
+
|
|
46
|
+
**Demo — `popconfirm/demos/PopconfirmVariants.vue`**
|
|
47
|
+
|
|
48
|
+
```vue
|
|
49
|
+
<template>
|
|
50
|
+
<div style="display: flex; flex-wrap: wrap; gap: 8px; align-items: center;">
|
|
51
|
+
<CoarPopconfirm
|
|
52
|
+
title="Are you sure?"
|
|
53
|
+
message="This is a destructive action."
|
|
54
|
+
confirmVariant="danger"
|
|
55
|
+
@confirmed="lastAction = 'danger-confirmed'"
|
|
56
|
+
>
|
|
57
|
+
<CoarButton variant="danger">Danger</CoarButton>
|
|
58
|
+
</CoarPopconfirm>
|
|
59
|
+
|
|
60
|
+
<CoarPopconfirm
|
|
61
|
+
title="Confirm action"
|
|
62
|
+
message="This will apply the changes."
|
|
63
|
+
confirmVariant="primary"
|
|
64
|
+
@confirmed="lastAction = 'primary-confirmed'"
|
|
65
|
+
>
|
|
66
|
+
<CoarButton variant="primary">Primary</CoarButton>
|
|
67
|
+
</CoarPopconfirm>
|
|
68
|
+
</div>
|
|
69
|
+
<p style="margin-top: 8px; font-size: 13px; color: var(--coar-text-neutral-secondary);">
|
|
70
|
+
Last action: {{ lastAction || 'none' }}
|
|
71
|
+
</p>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<script setup lang="ts">
|
|
75
|
+
import { ref } from 'vue';
|
|
76
|
+
import { CoarButton, CoarPopconfirm } from '@cocoar/vue-ui';
|
|
77
|
+
|
|
78
|
+
const lastAction = ref('');
|
|
79
|
+
</script>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Custom Labels
|
|
83
|
+
|
|
84
|
+
Replace the default "OK" / "Cancel" labels with language that describes the actual action. Specific labels like "Yes, remove" and "Keep member" help users make confident decisions.
|
|
85
|
+
|
|
86
|
+
**Demo — `popconfirm/demos/PopconfirmLabels.vue`**
|
|
87
|
+
|
|
88
|
+
```vue
|
|
89
|
+
<template>
|
|
90
|
+
<div style="display: flex; flex-wrap: wrap; gap: 8px; align-items: center;">
|
|
91
|
+
<CoarPopconfirm
|
|
92
|
+
title="Remove from team?"
|
|
93
|
+
message="The user will lose access immediately."
|
|
94
|
+
confirmText="Yes, remove"
|
|
95
|
+
cancelText="Keep member"
|
|
96
|
+
confirmVariant="danger"
|
|
97
|
+
@confirmed="lastAction = 'removed'"
|
|
98
|
+
>
|
|
99
|
+
<CoarButton variant="danger">Remove Member</CoarButton>
|
|
100
|
+
</CoarPopconfirm>
|
|
101
|
+
|
|
102
|
+
<CoarPopconfirm
|
|
103
|
+
title="Publish changes?"
|
|
104
|
+
message="This will be visible to all users."
|
|
105
|
+
confirmText="Publish now"
|
|
106
|
+
cancelText="Not yet"
|
|
107
|
+
@confirmed="lastAction = 'published'"
|
|
108
|
+
>
|
|
109
|
+
<CoarButton variant="primary">Publish</CoarButton>
|
|
110
|
+
</CoarPopconfirm>
|
|
111
|
+
</div>
|
|
112
|
+
<p style="margin-top: 8px; font-size: 13px; color: var(--coar-text-neutral-secondary);">
|
|
113
|
+
Last action: {{ lastAction || 'none' }}
|
|
114
|
+
</p>
|
|
115
|
+
</template>
|
|
116
|
+
|
|
117
|
+
<script setup lang="ts">
|
|
118
|
+
import { ref } from 'vue';
|
|
119
|
+
import { CoarButton, CoarPopconfirm } from '@cocoar/vue-ui';
|
|
120
|
+
|
|
121
|
+
const lastAction = ref('');
|
|
122
|
+
</script>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Placement
|
|
126
|
+
|
|
127
|
+
Control which side of the trigger the confirmation panel appears on. Pick the placement that best avoids clipping against viewport edges in your layout.
|
|
128
|
+
|
|
129
|
+
**Demo — `popconfirm/demos/PopconfirmPlacement.vue`**
|
|
130
|
+
|
|
131
|
+
```vue
|
|
132
|
+
<template>
|
|
133
|
+
<div style="display: flex; flex-wrap: wrap; gap: 8px; align-items: center;">
|
|
134
|
+
<CoarPopconfirm title="Top placement" message="Appears above the trigger." placement="top" @confirmed="lastAction = 'top'">
|
|
135
|
+
<CoarButton variant="secondary">Top</CoarButton>
|
|
136
|
+
</CoarPopconfirm>
|
|
137
|
+
<CoarPopconfirm title="Bottom placement" message="Appears below the trigger." placement="bottom" @confirmed="lastAction = 'bottom'">
|
|
138
|
+
<CoarButton variant="secondary">Bottom</CoarButton>
|
|
139
|
+
</CoarPopconfirm>
|
|
140
|
+
<CoarPopconfirm title="Right placement" message="Appears to the right." placement="right" @confirmed="lastAction = 'right'">
|
|
141
|
+
<CoarButton variant="secondary">Right</CoarButton>
|
|
142
|
+
</CoarPopconfirm>
|
|
143
|
+
</div>
|
|
144
|
+
<p style="margin-top: 8px; font-size: 13px; color: var(--coar-text-neutral-secondary);">
|
|
145
|
+
Last action: {{ lastAction || 'none' }}
|
|
146
|
+
</p>
|
|
147
|
+
</template>
|
|
148
|
+
|
|
149
|
+
<script setup lang="ts">
|
|
150
|
+
import { ref } from 'vue';
|
|
151
|
+
import { CoarButton, CoarPopconfirm } from '@cocoar/vue-ui';
|
|
152
|
+
|
|
153
|
+
const lastAction = ref('');
|
|
154
|
+
</script>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
> **Info: Popconfirm vs Dialog**
|
|
158
|
+
>
|
|
159
|
+
> Use **Popconfirm** for quick inline confirmations that keep the user in context. Use **Dialog** when the confirmation needs a longer explanation, additional form fields, or when the action affects multiple items.
|
|
160
|
+
|
|
161
|
+
## API
|
|
162
|
+
|
|
163
|
+
### Props
|
|
164
|
+
|
|
165
|
+
| Prop | Type | Default | Description |
|
|
166
|
+
|------|------|---------|-------------|
|
|
167
|
+
| `message` | `string` | required | Confirmation message body |
|
|
168
|
+
| `title` | `string` | `''` | Optional title above the message |
|
|
169
|
+
| `confirmText` | `string` | `'OK'` | Confirm button label |
|
|
170
|
+
| `cancelText` | `string` | `'Cancel'` | Cancel button label |
|
|
171
|
+
| `confirmVariant` | `'primary' \| 'danger'` | `'primary'` | Confirm button color variant |
|
|
172
|
+
| `placement` | `'top' \| 'bottom' \| 'left' \| 'right'` | `'top'` | Preferred placement |
|
|
173
|
+
| `disabled` | `boolean` | `false` | Disable the popconfirm trigger |
|
|
174
|
+
|
|
175
|
+
### Events
|
|
176
|
+
|
|
177
|
+
| Event | Description |
|
|
178
|
+
|-------|-------------|
|
|
179
|
+
| `confirmed` | Emitted when the confirm button is clicked |
|
|
180
|
+
| `cancelled` | Emitted when the cancel button is clicked or overlay is dismissed |
|
|
181
|
+
|
|
182
|
+
### Slots
|
|
183
|
+
|
|
184
|
+
| Slot | Description |
|
|
185
|
+
|------|-------------|
|
|
186
|
+
| `default` | The trigger element that opens the popconfirm |
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<!-- Generated from apps/docs/components/popover.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
|
|
2
|
+
|
|
3
|
+
# Popover
|
|
4
|
+
|
|
5
|
+
Popovers display rich, interactive content anchored to a trigger element. Unlike tooltips (which are text-only and non-interactive), popovers can hold forms, menus, formatted text, and action buttons. They stay open until the user clicks away or presses Escape, giving people time to interact with the content inside.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { CoarPopover } from '@cocoar/vue-ui';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic Popover (Click)
|
|
12
|
+
|
|
13
|
+
Set `mode="click"` to open the popover on click. This is the best mode for action menus and content that users need to interact with. Click outside the popover or press Escape to dismiss it.
|
|
14
|
+
|
|
15
|
+
**Demo — `popover/demos/PopoverBasic.vue`**
|
|
16
|
+
|
|
17
|
+
```vue
|
|
18
|
+
<template>
|
|
19
|
+
<div style="display: flex; flex-wrap: wrap; gap: 8px; align-items: center;">
|
|
20
|
+
<CoarPopover mode="click">
|
|
21
|
+
<CoarButton>Open Popover</CoarButton>
|
|
22
|
+
<template #content>
|
|
23
|
+
<div style="padding: 16px; max-width: 240px;">
|
|
24
|
+
<h4 style="margin: 0 0 4px;">Popover Title</h4>
|
|
25
|
+
<p style="margin: 0; font-size: 13px;">This is rich content inside a popover. It can contain forms, lists, and other interactive components.</p>
|
|
26
|
+
<CoarButton variant="primary" size="s" style="margin-top: 8px;">Action</CoarButton>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
</CoarPopover>
|
|
30
|
+
|
|
31
|
+
<CoarPopover mode="click">
|
|
32
|
+
<CoarButton variant="secondary">More options</CoarButton>
|
|
33
|
+
<template #content>
|
|
34
|
+
<div style="display: flex; flex-direction: column; padding: 4px; gap: 2px; min-width: 140px;">
|
|
35
|
+
<CoarButton variant="ghost" size="s">Edit</CoarButton>
|
|
36
|
+
<CoarButton variant="ghost" size="s">Duplicate</CoarButton>
|
|
37
|
+
<CoarButton variant="ghost" size="s">Archive</CoarButton>
|
|
38
|
+
<CoarButton variant="danger" size="s">Delete</CoarButton>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
</CoarPopover>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script setup lang="ts">
|
|
46
|
+
import { CoarButton, CoarPopover } from '@cocoar/vue-ui';
|
|
47
|
+
</script>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Hover Mode
|
|
51
|
+
|
|
52
|
+
The default `mode="hover"` opens the popover when the pointer enters the trigger. Use `mode="both"` to support both hover preview and click-to-pin behavior -- the popover opens on hover and stays pinned after a click.
|
|
53
|
+
|
|
54
|
+
**Demo — `popover/demos/PopoverHover.vue`**
|
|
55
|
+
|
|
56
|
+
```vue
|
|
57
|
+
<template>
|
|
58
|
+
<div style="display: flex; flex-wrap: wrap; gap: 8px; align-items: center;">
|
|
59
|
+
<CoarPopover mode="hover">
|
|
60
|
+
<CoarButton variant="ghost">Hover me</CoarButton>
|
|
61
|
+
<template #content>
|
|
62
|
+
<div style="padding: 16px; max-width: 240px;">
|
|
63
|
+
<p style="margin: 0; font-size: 13px;">This popover opens on hover. Great for supplementary information.</p>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
66
|
+
</CoarPopover>
|
|
67
|
+
|
|
68
|
+
<CoarPopover mode="both">
|
|
69
|
+
<CoarButton variant="secondary">Hover or click</CoarButton>
|
|
70
|
+
<template #content>
|
|
71
|
+
<div style="padding: 16px; max-width: 240px;">
|
|
72
|
+
<p style="margin: 0; font-size: 13px;">Opens on hover. Click to pin it open — then click again to close.</p>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
</CoarPopover>
|
|
76
|
+
</div>
|
|
77
|
+
</template>
|
|
78
|
+
|
|
79
|
+
<script setup lang="ts">
|
|
80
|
+
import { CoarButton, CoarPopover } from '@cocoar/vue-ui';
|
|
81
|
+
</script>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## User Menu
|
|
85
|
+
|
|
86
|
+
A classic application pattern: clicking an avatar reveals a small card with the user's identity and quick actions like profile, settings, and sign-out.
|
|
87
|
+
|
|
88
|
+
**Demo — `popover/demos/PopoverUserMenu.vue`**
|
|
89
|
+
|
|
90
|
+
```vue
|
|
91
|
+
<template>
|
|
92
|
+
<div style="display: flex; flex-wrap: wrap; gap: 8px; align-items: center;">
|
|
93
|
+
<CoarPopover mode="click">
|
|
94
|
+
<CoarAvatar name="John Doe" size="s" style="cursor: pointer" />
|
|
95
|
+
<template #content>
|
|
96
|
+
<div style="min-width: 180px;">
|
|
97
|
+
<div style="padding: 8px 16px; border-bottom: 1px solid var(--coar-border-neutral-secondary); margin-bottom: 4px;">
|
|
98
|
+
<p style="margin: 0; font-weight: 600; font-size: 13px;">John Doe</p>
|
|
99
|
+
<p style="margin: 0; font-size: 13px; color: var(--coar-text-neutral-secondary);">john@example.com</p>
|
|
100
|
+
</div>
|
|
101
|
+
<div style="display: flex; flex-direction: column; padding: 4px; gap: 2px;">
|
|
102
|
+
<CoarButton variant="ghost" size="s">Profile</CoarButton>
|
|
103
|
+
<CoarButton variant="ghost" size="s">Settings</CoarButton>
|
|
104
|
+
<CoarButton variant="danger" size="s">Sign Out</CoarButton>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</template>
|
|
108
|
+
</CoarPopover>
|
|
109
|
+
</div>
|
|
110
|
+
</template>
|
|
111
|
+
|
|
112
|
+
<script setup lang="ts">
|
|
113
|
+
import { CoarButton, CoarPopover, CoarAvatar } from '@cocoar/vue-ui';
|
|
114
|
+
</script>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Info Popover
|
|
118
|
+
|
|
119
|
+
Attach a hover popover to an icon button to provide contextual help without navigating the user away from their current task. This works well for explaining features, showing rate limits, or surfacing inline guidance.
|
|
120
|
+
|
|
121
|
+
**Demo — `popover/demos/PopoverInfo.vue`**
|
|
122
|
+
|
|
123
|
+
```vue
|
|
124
|
+
<template>
|
|
125
|
+
<div style="display: flex; flex-wrap: wrap; gap: 8px; align-items: center;">
|
|
126
|
+
<CoarPopover mode="hover">
|
|
127
|
+
<CoarButton variant="ghost" icon-start="circle-help" aria-label="More information" />
|
|
128
|
+
<template #content>
|
|
129
|
+
<div style="padding: 16px; max-width: 240px;">
|
|
130
|
+
<h4 style="margin: 0 0 4px;">How it works</h4>
|
|
131
|
+
<p style="margin: 0; font-size: 13px;">This feature uses your account's default timezone. You can change this in Settings → Preferences.</p>
|
|
132
|
+
</div>
|
|
133
|
+
</template>
|
|
134
|
+
</CoarPopover>
|
|
135
|
+
|
|
136
|
+
<CoarPopover mode="hover">
|
|
137
|
+
<CoarButton variant="ghost" icon-start="triangle-alert" aria-label="Warning details" />
|
|
138
|
+
<template #content>
|
|
139
|
+
<div style="padding: 16px; max-width: 240px;">
|
|
140
|
+
<h4 style="margin: 0 0 4px;">Rate limit approaching</h4>
|
|
141
|
+
<p style="margin: 0; font-size: 13px;">You've used 80% of your monthly API limit. Upgrade to increase your quota.</p>
|
|
142
|
+
</div>
|
|
143
|
+
</template>
|
|
144
|
+
</CoarPopover>
|
|
145
|
+
</div>
|
|
146
|
+
</template>
|
|
147
|
+
|
|
148
|
+
<script setup lang="ts">
|
|
149
|
+
import { CoarButton, CoarPopover } from '@cocoar/vue-ui';
|
|
150
|
+
</script>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
> **Info: Slot names**
|
|
154
|
+
>
|
|
155
|
+
> Place the trigger in the **default slot** and the content in **`#content`**. The popover auto-positions itself to stay within the viewport -- no placement prop needed.
|
|
156
|
+
|
|
157
|
+
## API
|
|
158
|
+
|
|
159
|
+
### Props
|
|
160
|
+
|
|
161
|
+
| Prop | Type | Default | Description |
|
|
162
|
+
|------|------|---------|-------------|
|
|
163
|
+
| `mode` | `'hover' \| 'click' \| 'both'` | `'hover'` | How the popover is triggered |
|
|
164
|
+
| `disabled` | `boolean` | `false` | Prevent the popover from opening |
|
|
165
|
+
| `interactive` | `boolean` | `true` | Whether the panel receives pointer events |
|
|
166
|
+
| `offset` | `number` | `6` | Gap in px between trigger and panel |
|
|
167
|
+
|
|
168
|
+
### Slots
|
|
169
|
+
|
|
170
|
+
| Slot | Description |
|
|
171
|
+
|------|-------------|
|
|
172
|
+
| `default` | The trigger element that opens the popover |
|
|
173
|
+
| `#content` | The popover panel content |
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
<!-- Generated from apps/docs/components/progress-bar.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
|
|
2
|
+
|
|
3
|
+
# Progress Bar
|
|
4
|
+
|
|
5
|
+
Progress bars keep users informed about ongoing operations -- file uploads, multi-step workflows, or background tasks. They reduce uncertainty by showing either a concrete completion percentage or an animated indicator when the duration is unknown.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { CoarProgressBar } from '@cocoar/vue-ui';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic Progress
|
|
12
|
+
|
|
13
|
+
Bind a numeric `value` (0--100) to show determinate progress. Ideal for file uploads, form completion, or any task where you can measure how much work remains.
|
|
14
|
+
|
|
15
|
+
**Demo — `progress-bar/demos/ProgressBarBasic.vue`**
|
|
16
|
+
|
|
17
|
+
```vue
|
|
18
|
+
<template>
|
|
19
|
+
<div style="display: flex; flex-direction: column; gap: 12px;">
|
|
20
|
+
<CoarProgressBar :value="progress" />
|
|
21
|
+
<div style="display: flex; gap: 8px; align-items: center;">
|
|
22
|
+
<button class="adj-btn" @click="progress = Math.max(0, progress - 10)">-10</button>
|
|
23
|
+
<span style="min-width: 40px; text-align: center; font-size: 14px;">{{ progress }}%</span>
|
|
24
|
+
<button class="adj-btn" @click="progress = Math.min(100, progress + 10)">+10</button>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script setup lang="ts">
|
|
30
|
+
import { ref } from 'vue';
|
|
31
|
+
import { CoarProgressBar } from '@cocoar/vue-ui';
|
|
32
|
+
|
|
33
|
+
const progress = ref(65);
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style scoped>
|
|
37
|
+
.adj-btn {
|
|
38
|
+
padding: 4px 12px;
|
|
39
|
+
border: 1px solid var(--coar-border-neutral-secondary);
|
|
40
|
+
border-radius: 6px;
|
|
41
|
+
background: var(--coar-background-neutral-secondary);
|
|
42
|
+
color: var(--coar-text-neutral-primary);
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
}
|
|
46
|
+
.adj-btn:hover {
|
|
47
|
+
background: var(--coar-background-neutral-tertiary);
|
|
48
|
+
}
|
|
49
|
+
</style>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Indeterminate
|
|
53
|
+
|
|
54
|
+
When you can't predict how long an operation will take -- network requests, server-side processing -- switch to indeterminate mode for a continuous animation that signals "working on it."
|
|
55
|
+
|
|
56
|
+
**Demo — `progress-bar/demos/ProgressBarIndeterminate.vue`**
|
|
57
|
+
|
|
58
|
+
```vue
|
|
59
|
+
<template>
|
|
60
|
+
<CoarProgressBar indeterminate />
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script setup lang="ts">
|
|
64
|
+
import { CoarProgressBar } from '@cocoar/vue-ui';
|
|
65
|
+
</script>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Color Variants
|
|
69
|
+
|
|
70
|
+
Match the bar color to its context: `accent` (default) for standard progress, `success` for completed uploads, `warning` for approaching limits, `error` for failed operations.
|
|
71
|
+
|
|
72
|
+
**Demo — `progress-bar/demos/ProgressBarVariants.vue`**
|
|
73
|
+
|
|
74
|
+
```vue
|
|
75
|
+
<template>
|
|
76
|
+
<div style="display: flex; flex-direction: column; gap: 12px;">
|
|
77
|
+
<div>
|
|
78
|
+
<span style="font-size: 13px; color: #64748b;">Accent (default)</span>
|
|
79
|
+
<CoarProgressBar :value="75" />
|
|
80
|
+
</div>
|
|
81
|
+
<div>
|
|
82
|
+
<span style="font-size: 13px; color: #64748b;">Success</span>
|
|
83
|
+
<CoarProgressBar :value="75" variant="success" />
|
|
84
|
+
</div>
|
|
85
|
+
<div>
|
|
86
|
+
<span style="font-size: 13px; color: #64748b;">Warning</span>
|
|
87
|
+
<CoarProgressBar :value="75" variant="warning" />
|
|
88
|
+
</div>
|
|
89
|
+
<div>
|
|
90
|
+
<span style="font-size: 13px; color: #64748b;">Error</span>
|
|
91
|
+
<CoarProgressBar :value="75" variant="error" />
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</template>
|
|
95
|
+
|
|
96
|
+
<script setup lang="ts">
|
|
97
|
+
import { CoarProgressBar } from '@cocoar/vue-ui';
|
|
98
|
+
</script>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Sizes
|
|
102
|
+
|
|
103
|
+
Three heights give you flexibility. Use `s` inside compact cards or table rows, `m` for standard layouts, and `l` when the progress bar is the focal point.
|
|
104
|
+
|
|
105
|
+
**Demo — `progress-bar/demos/ProgressBarSizes.vue`**
|
|
106
|
+
|
|
107
|
+
```vue
|
|
108
|
+
<template>
|
|
109
|
+
<div style="display: flex; flex-direction: column; gap: 12px;">
|
|
110
|
+
<div>
|
|
111
|
+
<span style="font-size: 13px; color: #64748b;">Small</span>
|
|
112
|
+
<CoarProgressBar :value="60" size="s" />
|
|
113
|
+
</div>
|
|
114
|
+
<div>
|
|
115
|
+
<span style="font-size: 13px; color: #64748b;">Medium (default)</span>
|
|
116
|
+
<CoarProgressBar :value="60" size="m" />
|
|
117
|
+
</div>
|
|
118
|
+
<div>
|
|
119
|
+
<span style="font-size: 13px; color: #64748b;">Large</span>
|
|
120
|
+
<CoarProgressBar :value="60" size="l" />
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</template>
|
|
124
|
+
|
|
125
|
+
<script setup lang="ts">
|
|
126
|
+
import { CoarProgressBar } from '@cocoar/vue-ui';
|
|
127
|
+
</script>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Live Progress
|
|
131
|
+
|
|
132
|
+
A continuously animating example that shows how the bar transitions smoothly as the value changes.
|
|
133
|
+
|
|
134
|
+
**Demo — `progress-bar/demos/ProgressBarAnimated.vue`**
|
|
135
|
+
|
|
136
|
+
```vue
|
|
137
|
+
<template>
|
|
138
|
+
<div>
|
|
139
|
+
<div style="display: flex; justify-content: space-between; margin-bottom: 4px;">
|
|
140
|
+
<span style="font-size: 14px;">Processing...</span>
|
|
141
|
+
<span style="font-size: 14px;">{{ animatedProgress }}%</span>
|
|
142
|
+
</div>
|
|
143
|
+
<CoarProgressBar :value="animatedProgress" variant="info" size="l" />
|
|
144
|
+
</div>
|
|
145
|
+
</template>
|
|
146
|
+
|
|
147
|
+
<script setup lang="ts">
|
|
148
|
+
import { ref, onMounted, onUnmounted } from 'vue';
|
|
149
|
+
import { CoarProgressBar } from '@cocoar/vue-ui';
|
|
150
|
+
|
|
151
|
+
const animatedProgress = ref(0);
|
|
152
|
+
let interval: ReturnType<typeof setInterval> | null = null;
|
|
153
|
+
|
|
154
|
+
onMounted(() => {
|
|
155
|
+
interval = setInterval(() => {
|
|
156
|
+
animatedProgress.value = (animatedProgress.value + 1) % 101;
|
|
157
|
+
}, 50);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
onUnmounted(() => {
|
|
161
|
+
if (interval) clearInterval(interval);
|
|
162
|
+
});
|
|
163
|
+
</script>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## API
|
|
167
|
+
|
|
168
|
+
### Props
|
|
169
|
+
|
|
170
|
+
| Prop | Type | Default | Description |
|
|
171
|
+
|------|------|---------|-------------|
|
|
172
|
+
| `value` | `number` | `0` | Current progress value |
|
|
173
|
+
| `max` | `number` | `100` | Maximum progress value |
|
|
174
|
+
| `indeterminate` | `boolean` | `false` | Show animated indeterminate state |
|
|
175
|
+
| `variant` | `'accent' \| 'success' \| 'warning' \| 'error'` | `'accent'` | Color variant |
|
|
176
|
+
| `size` | `'s' \| 'm' \| 'l'` | `'m'` | Bar height |
|
|
177
|
+
| `label` | `string` | `''` | Accessible label for screen readers |
|
|
178
|
+
| `showValue` | `boolean` | `false` | Display the percentage value next to the bar |
|