@velkymx/vibeui 0.9.0 → 1.1.0
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 +44 -0
- package/CLAUDE.md +48 -0
- package/README.md +222 -197
- package/dist/App.vue.d.ts +2 -1
- package/dist/components/HelloWorld.vue.d.ts +2 -1
- package/dist/components/VibeAccordion.vue.d.ts +39 -40
- package/dist/components/VibeAlert.vue.d.ts +21 -37
- package/dist/components/VibeAutocomplete.vue.d.ts +59 -31
- package/dist/components/VibeBadge.vue.d.ts +10 -18
- package/dist/components/VibeBreadcrumb.vue.d.ts +25 -21
- package/dist/components/VibeButton.vue.d.ts +13 -17
- package/dist/components/VibeButtonGroup.vue.d.ts +11 -19
- package/dist/components/VibeCard.vue.d.ts +51 -24
- package/dist/components/VibeCarousel.vue.d.ts +27 -49
- package/dist/components/VibeChartBar.vue.d.ts +61 -0
- package/dist/components/VibeChartLine.vue.d.ts +70 -0
- package/dist/components/VibeChartPie.vue.d.ts +34 -0
- package/dist/components/VibeCloseButton.vue.d.ts +9 -7
- package/dist/components/VibeCol.vue.d.ts +9 -17
- package/dist/components/VibeCollapse.vue.d.ts +24 -32
- package/dist/components/VibeContainer.vue.d.ts +9 -17
- package/dist/components/VibeDataTable.vue.d.ts +122 -63
- package/dist/components/VibeDatePicker.vue.d.ts +4 -6
- package/dist/components/VibeDraggable.vue.d.ts +9 -13
- package/dist/components/VibeDropdown.vue.d.ts +46 -43
- package/dist/components/VibeDroppable.vue.d.ts +9 -13
- package/dist/components/VibeFileInput.vue.d.ts +14 -20
- package/dist/components/VibeFormCheckbox.vue.d.ts +30 -22
- package/dist/components/VibeFormDatepicker.vue.d.ts +27 -30
- package/dist/components/VibeFormErrorSummary.vue.d.ts +17 -0
- package/dist/components/VibeFormGroup.vue.d.ts +10 -13
- package/dist/components/VibeFormInput.vue.d.ts +60 -25
- package/dist/components/VibeFormRadio.vue.d.ts +23 -24
- package/dist/components/VibeFormSelect.vue.d.ts +28 -34
- package/dist/components/VibeFormSpinbutton.vue.d.ts +31 -34
- package/dist/components/VibeFormSwitch.vue.d.ts +22 -23
- package/dist/components/VibeFormTextarea.vue.d.ts +24 -25
- package/dist/components/VibeFormWysiwyg.vue.d.ts +23 -22
- package/dist/components/VibeHero.vue.d.ts +117 -0
- package/dist/components/VibeIcon.vue.d.ts +27 -7
- package/dist/components/VibeInputGroup.vue.d.ts +12 -14
- package/dist/components/VibeLink.vue.d.ts +14 -18
- package/dist/components/VibeListGroup.vue.d.ts +26 -22
- package/dist/components/VibeModal.vue.d.ts +47 -45
- package/dist/components/VibeNav.vue.d.ts +40 -20
- package/dist/components/VibeNavbar.vue.d.ts +12 -19
- package/dist/components/VibeNavbarBrand.vue.d.ts +9 -17
- package/dist/components/VibeNavbarNav.vue.d.ts +52 -33
- package/dist/components/VibeNavbarToggle.vue.d.ts +7 -5
- package/dist/components/VibeOffcanvas.vue.d.ts +28 -43
- package/dist/components/VibePagination.vue.d.ts +38 -29
- package/dist/components/VibePlaceholder.vue.d.ts +9 -17
- package/dist/components/VibePopover.vue.d.ts +17 -40
- package/dist/components/VibeProgress.vue.d.ts +13 -21
- package/dist/components/VibeResizable.vue.d.ts +10 -14
- package/dist/components/VibeRow.vue.d.ts +9 -17
- package/dist/components/VibeScrollspy.vue.d.ts +37 -25
- package/dist/components/VibeSkeleton.vue.d.ts +2 -1
- package/dist/components/VibeSlider.vue.d.ts +4 -5
- package/dist/components/VibeSortable.vue.d.ts +37 -18
- package/dist/components/VibeSpinner.vue.d.ts +4 -7
- package/dist/components/VibeStepper.vue.d.ts +32 -31
- package/dist/components/VibeTab.vue.d.ts +7 -11
- package/dist/components/VibeTabContent.vue.d.ts +13 -31
- package/dist/components/VibeTabs.vue.d.ts +9 -13
- package/dist/components/VibeToast.vue.d.ts +31 -44
- package/dist/components/VibeToastHost.vue.d.ts +2 -1
- package/dist/components/VibeTooltip.vue.d.ts +16 -39
- package/dist/components/chart/chartColors.d.ts +3 -0
- package/dist/components/chart/chartResize.d.ts +2 -0
- package/dist/components/chart/chartTooltip.d.ts +2 -0
- package/dist/components/chart/chartTypes.d.ts +6 -0
- package/dist/components/chart/drawBar.d.ts +5 -0
- package/dist/components/chart/drawLine.d.ts +18 -0
- package/dist/components/chart/drawPie.d.ts +4 -0
- package/dist/components/dndStore.d.ts +1 -0
- package/dist/components/index.d.ts +6 -1
- package/dist/composables/useBreakpoints.d.ts +1 -0
- package/dist/composables/useColorMode.d.ts +1 -1
- package/dist/composables/useId.d.ts +1 -4
- package/dist/directives/vTooltip.d.ts +2 -3
- package/dist/injectionKeys.d.ts +34 -0
- package/dist/purify.es-eYghtX9j.mjs +735 -0
- package/dist/types.d.ts +23 -2
- package/dist/utils/routeKey.d.ts +11 -0
- package/dist/utils/safeCss.d.ts +16 -0
- package/dist/utils/safeHref.d.ts +7 -0
- package/dist/utils/sanitizeHtml.d.ts +13 -0
- package/dist/vibeui.css +2 -1
- package/dist/vibeui.es.js +8527 -5855
- package/dist/vibeui.umd.js +3 -1
- package/docs/README.md +225 -0
- package/docs/components/advanced/popover.md +125 -0
- package/docs/components/advanced/scrollspy.md +106 -0
- package/docs/components/advanced/tooltip.md +90 -0
- package/docs/components/card/card.md +223 -0
- package/docs/components/charts/chart-bar.md +129 -0
- package/docs/components/charts/chart-line.md +136 -0
- package/docs/components/charts/chart-pie.md +102 -0
- package/docs/components/core/alert.md +94 -0
- package/docs/components/core/badge.md +75 -0
- package/docs/components/core/button-group.md +99 -0
- package/docs/components/core/button.md +145 -0
- package/docs/components/core/close-button.md +82 -0
- package/docs/components/core/link.md +79 -0
- package/docs/components/core/placeholder.md +129 -0
- package/docs/components/core/skeleton.md +40 -0
- package/docs/components/core/spinner.md +103 -0
- package/docs/components/data/datatable.md +437 -0
- package/docs/components/hero/hero.md +65 -0
- package/docs/components/interactive/accordion.md +121 -0
- package/docs/components/interactive/carousel.md +112 -0
- package/docs/components/interactive/collapse.md +106 -0
- package/docs/components/interactive/date-picker.md +78 -0
- package/docs/components/interactive/draggable.md +91 -0
- package/docs/components/interactive/dropdown.md +129 -0
- package/docs/components/interactive/modal.md +151 -0
- package/docs/components/interactive/offcanvas.md +92 -0
- package/docs/components/interactive/resizable.md +73 -0
- package/docs/components/interactive/slider.md +57 -0
- package/docs/components/interactive/sortable.md +52 -0
- package/docs/components/interactive/stepper.md +83 -0
- package/docs/components/interactive/tabs.md +66 -0
- package/docs/components/interactive/toast.md +177 -0
- package/docs/components/layout/col.md +117 -0
- package/docs/components/layout/container.md +53 -0
- package/docs/components/layout/row.md +107 -0
- package/docs/components/list/list-group.md +225 -0
- package/docs/components/navigation/breadcrumb.md +120 -0
- package/docs/components/navigation/nav.md +151 -0
- package/docs/components/navigation/navbar.md +114 -0
- package/docs/components/navigation/pagination.md +163 -0
- package/docs/components/progress/progress.md +188 -0
- package/docs/composables/back-button.md +28 -0
- package/docs/composables/breakpoints.md +54 -0
- package/docs/composables/color-mode.md +179 -0
- package/docs/composables/use-form.md +78 -0
- package/docs/composables/use-position.md +68 -0
- package/docs/composables/use-toast.md +91 -0
- package/docs/directives/v-tooltip.md +58 -0
- package/docs/forms/README.md +87 -0
- package/docs/forms/autocomplete.md +96 -0
- package/docs/forms/file-input.md +97 -0
- package/docs/forms/form-checkbox.md +100 -0
- package/docs/forms/form-datepicker.md +80 -0
- package/docs/forms/form-error-summary.md +96 -0
- package/docs/forms/form-group.md +118 -0
- package/docs/forms/form-input.md +140 -0
- package/docs/forms/form-radio.md +82 -0
- package/docs/forms/form-select.md +98 -0
- package/docs/forms/form-spinbutton.md +94 -0
- package/docs/forms/form-switch.md +75 -0
- package/docs/forms/form-textarea.md +82 -0
- package/docs/forms/form-wysiwyg.md +99 -0
- package/docs/forms/input-group.md +70 -0
- package/docs/forms/validation.md +213 -0
- package/docs/getting-started/starter-template.md +136 -0
- package/docs/superpowers/plans/2026-05-12-vibe-charts.md +1999 -0
- package/docs/superpowers/plans/2026-05-29-e2e-browser-testing.md +615 -0
- package/docs/superpowers/specs/2026-05-12-charting-design.md +185 -0
- package/docs/superpowers/specs/2026-05-29-e2e-browser-testing-design.md +168 -0
- package/docs/utilities/position.md +82 -0
- package/docs/versioning.md +57 -0
- package/examples/README.md +201 -0
- package/examples/album.html +262 -0
- package/examples/blog.html +166 -0
- package/examples/carousel.html +114 -0
- package/examples/checkout.html +275 -0
- package/examples/cover.html +89 -0
- package/examples/dashboard.html +156 -0
- package/examples/index.html +129 -0
- package/examples/jumbotron.html +56 -0
- package/examples/mobile-dashboard.html +138 -0
- package/examples/pricing.html +172 -0
- package/examples/product.html +145 -0
- package/examples/sidebars.html +166 -0
- package/examples/sign-in.html +119 -0
- package/examples/starter.html +314 -0
- package/examples/sticky-footer-navbar.html +70 -0
- package/examples/sticky-footer.html +60 -0
- package/examples/test-simple.html +91 -0
- package/llms.txt +801 -0
- package/package.json +44 -14
- package/dist/types/index.d.ts +0 -6
package/docs/README.md
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# VibeUI Documentation
|
|
2
|
+
|
|
3
|
+
Complete documentation for VibeUI - A modern Vue 3 UI component library built with Bootstrap 5.3.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
VibeUI is designed to be simple and lightweight, providing Vue 3 components that wrap Bootstrap 5.3 functionality with a clean, intuitive API.
|
|
8
|
+
|
|
9
|
+
> **New here?** See the [Starter Template](./getting-started/starter-template.md) for a complete, copy-pasteable minimal app.
|
|
10
|
+
|
|
11
|
+
### Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @velkymx/vibeui bootstrap
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
#### Optional peer dependencies
|
|
18
|
+
|
|
19
|
+
Install these only if you use the components that need them:
|
|
20
|
+
|
|
21
|
+
- `bootstrap-icons` — required by `VibeIcon`.
|
|
22
|
+
- `quill` + `dompurify` — required by `VibeFormWysiwyg`.
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install bootstrap-icons # for VibeIcon
|
|
26
|
+
npm install quill dompurify # for VibeFormWysiwyg
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Setup
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
import { createApp } from 'vue'
|
|
33
|
+
import App from './App.vue'
|
|
34
|
+
import VibeUI, { useColorMode } from '@velkymx/vibeui'
|
|
35
|
+
import 'bootstrap/dist/css/bootstrap.min.css'
|
|
36
|
+
|
|
37
|
+
// Restore saved color mode preference before mounting
|
|
38
|
+
const { initColorMode } = useColorMode()
|
|
39
|
+
initColorMode()
|
|
40
|
+
|
|
41
|
+
createApp(App).use(VibeUI).mount('#app')
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Bootstrap JavaScript
|
|
45
|
+
|
|
46
|
+
**Do NOT import Bootstrap JS — VibeUI manages it.** VibeUI is mobile-optimized and fully abstracts Bootstrap's JavaScript. You do not need to manually import or initialize Bootstrap JS for VibeUI components; importing it yourself can cause duplicate instances and event conflicts.
|
|
47
|
+
|
|
48
|
+
The library handles:
|
|
49
|
+
- **Dynamic Initialization:** Components initialize their own JS logic on mount.
|
|
50
|
+
- **Reactive Configuration:** Re-initializes automatically when props like `placement` or `delay` change.
|
|
51
|
+
- **Memory Cleanup:** Automatically disposes of Bootstrap instances on unmount.
|
|
52
|
+
- **State Integrity:** Synchronizes internal Vue state with native Bootstrap events.
|
|
53
|
+
|
|
54
|
+
## Components
|
|
55
|
+
|
|
56
|
+
### [Layout Components](./components/layout/)
|
|
57
|
+
- [VibeContainer](./components/layout/container.md)
|
|
58
|
+
- [VibeRow](./components/layout/row.md)
|
|
59
|
+
- [VibeCol](./components/layout/col.md)
|
|
60
|
+
|
|
61
|
+
### [Core Components](./components/core/)
|
|
62
|
+
- [VibeAlert](./components/core/alert.md)
|
|
63
|
+
- [VibeBadge](./components/core/badge.md)
|
|
64
|
+
- [VibeButton](./components/core/button.md)
|
|
65
|
+
- [VibeButtonGroup](./components/core/button-group.md)
|
|
66
|
+
- [VibeCloseButton](./components/core/close-button.md)
|
|
67
|
+
- [VibeLink](./components/core/link.md)
|
|
68
|
+
- [VibePlaceholder](./components/core/placeholder.md)
|
|
69
|
+
- [VibeSkeleton](./components/core/skeleton.md)
|
|
70
|
+
- [VibeSpinner](./components/core/spinner.md)
|
|
71
|
+
|
|
72
|
+
### [Interactive Components](./components/interactive/)
|
|
73
|
+
- [VibeAccordion](./components/interactive/accordion.md)
|
|
74
|
+
- [VibeCarousel](./components/interactive/carousel.md)
|
|
75
|
+
- [VibeCollapse](./components/interactive/collapse.md)
|
|
76
|
+
- [VibeDatePicker](./components/interactive/date-picker.md)
|
|
77
|
+
- [VibeDraggable / VibeDroppable](./components/interactive/draggable.md)
|
|
78
|
+
- [VibeDropdown](./components/interactive/dropdown.md)
|
|
79
|
+
- [VibeModal](./components/interactive/modal.md)
|
|
80
|
+
- [VibeOffcanvas](./components/interactive/offcanvas.md)
|
|
81
|
+
- [VibeResizable](./components/interactive/resizable.md)
|
|
82
|
+
- [VibeSlider](./components/interactive/slider.md)
|
|
83
|
+
- [VibeSortable](./components/interactive/sortable.md)
|
|
84
|
+
- [VibeStepper](./components/interactive/stepper.md)
|
|
85
|
+
- [VibeTabs / VibeTab](./components/interactive/tabs.md)
|
|
86
|
+
- [VibeToast](./components/interactive/toast.md)
|
|
87
|
+
|
|
88
|
+
### [Advanced Components](./components/advanced/)
|
|
89
|
+
- [VibePopover](./components/advanced/popover.md)
|
|
90
|
+
- [VibeScrollspy](./components/advanced/scrollspy.md)
|
|
91
|
+
- [VibeTooltip](./components/advanced/tooltip.md)
|
|
92
|
+
|
|
93
|
+
### [Card](./components/card/)
|
|
94
|
+
- [VibeCard](./components/card/card.md)
|
|
95
|
+
|
|
96
|
+
### [Hero](./components/hero/)
|
|
97
|
+
- [VibeHero](./components/hero/hero.md)
|
|
98
|
+
|
|
99
|
+
### [List](./components/list/)
|
|
100
|
+
- [VibeListGroup](./components/list/list-group.md)
|
|
101
|
+
|
|
102
|
+
### [Navigation](./components/navigation/)
|
|
103
|
+
- [VibeBreadcrumb](./components/navigation/breadcrumb.md)
|
|
104
|
+
- [VibeNav](./components/navigation/nav.md)
|
|
105
|
+
- [VibeNavbar](./components/navigation/navbar.md)
|
|
106
|
+
- [VibePagination](./components/navigation/pagination.md)
|
|
107
|
+
|
|
108
|
+
### [Data Components](./components/data/)
|
|
109
|
+
- [VibeDataTable](./components/data/datatable.md)
|
|
110
|
+
|
|
111
|
+
### [Charts](./components/charts/)
|
|
112
|
+
- [VibeChartBar](./components/charts/chart-bar.md)
|
|
113
|
+
- [VibeChartLine](./components/charts/chart-line.md)
|
|
114
|
+
- [VibeChartPie](./components/charts/chart-pie.md)
|
|
115
|
+
|
|
116
|
+
### [Progress](./components/progress/)
|
|
117
|
+
- [VibeProgress](./components/progress/progress.md)
|
|
118
|
+
|
|
119
|
+
### [Form Components](./forms/)
|
|
120
|
+
- [VibeAutocomplete](./forms/autocomplete.md)
|
|
121
|
+
- [VibeFileInput](./forms/file-input.md)
|
|
122
|
+
- [VibeFormCheckbox](./forms/form-checkbox.md)
|
|
123
|
+
- [VibeFormDatepicker](./forms/form-datepicker.md) (native input)
|
|
124
|
+
- [VibeFormGroup](./forms/form-group.md) - Automated layout & accessibility
|
|
125
|
+
- [VibeFormInput](./forms/form-input.md)
|
|
126
|
+
- [VibeFormRadio](./forms/form-radio.md)
|
|
127
|
+
- [VibeFormSelect](./forms/form-select.md)
|
|
128
|
+
- [VibeFormSpinbutton](./forms/form-spinbutton.md)
|
|
129
|
+
- [VibeFormSwitch](./forms/form-switch.md)
|
|
130
|
+
- [VibeFormTextarea](./forms/form-textarea.md)
|
|
131
|
+
- [VibeFormWysiwyg](./forms/form-wysiwyg.md)
|
|
132
|
+
- [VibeInputGroup](./forms/input-group.md)
|
|
133
|
+
- [Validation rules](./forms/validation.md)
|
|
134
|
+
|
|
135
|
+
## Composables
|
|
136
|
+
|
|
137
|
+
Standalone utilities that can be used independently of any component.
|
|
138
|
+
|
|
139
|
+
- [useBackButton](./composables/back-button.md) - Android hardware back button handling
|
|
140
|
+
- [useBreakpoints](./composables/breakpoints.md) - Programmatic breakpoint detection
|
|
141
|
+
- [useColorMode](./composables/color-mode.md) - Bootstrap light/dark/auto color modes
|
|
142
|
+
- [useForm](./composables/use-form.md) - Multi-field form state with validation
|
|
143
|
+
- [usePosition](./composables/use-position.md) - Floating-UI based anchor positioning
|
|
144
|
+
- [useToast](./composables/use-toast.md) - Global toast service
|
|
145
|
+
|
|
146
|
+
## Directives
|
|
147
|
+
|
|
148
|
+
- [v-vibe-tooltip](./directives/v-tooltip.md) - Inline tooltip directive
|
|
149
|
+
|
|
150
|
+
## Utilities
|
|
151
|
+
|
|
152
|
+
- [Position utility classes](./utilities/position.md) - Bootstrap position-* / top-* / translate-middle reference
|
|
153
|
+
|
|
154
|
+
## Versioning & Stability
|
|
155
|
+
|
|
156
|
+
- [Versioning & Stability Policy](./versioning.md) - SemVer commitment, what's covered by the public API, deprecation and peer-dependency policy
|
|
157
|
+
|
|
158
|
+
## Design Philosophy
|
|
159
|
+
|
|
160
|
+
1. **Full Abstraction** - No "reach-around" required; the library manages the framework engine.
|
|
161
|
+
2. **Zero-Boilerplate** - Automatic IDs, Teleportation, and state syncing.
|
|
162
|
+
3. **Smart Forms** - Context-aware form groups automate accessibility.
|
|
163
|
+
4. **TypeScript First** - Comprehensive type definitions for all props and events.
|
|
164
|
+
|
|
165
|
+
## Common Patterns
|
|
166
|
+
|
|
167
|
+
### v-model Support
|
|
168
|
+
Most interactive and form components support `v-model` for two-way state synchronization.
|
|
169
|
+
|
|
170
|
+
```vue
|
|
171
|
+
<VibeModal v-model="show" title="Hello" />
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Instance Exposure (escape hatch)
|
|
175
|
+
|
|
176
|
+
The underlying Bootstrap instance is exposed as `_unsafe_bsInstance` for rare cases the props/`v-model` API doesn't cover.
|
|
177
|
+
|
|
178
|
+
> **This is an escape hatch, not part of the stable API.** Calling Bootstrap lifecycle methods directly will desync VibeUI's internal state and can break the component. The `_unsafe_` prefix is intentional — prefer props and `v-model` whenever possible.
|
|
179
|
+
|
|
180
|
+
```vue
|
|
181
|
+
<template>
|
|
182
|
+
<VibeModal ref="myModal" />
|
|
183
|
+
</template>
|
|
184
|
+
|
|
185
|
+
<script setup lang="ts">
|
|
186
|
+
import { useTemplateRef, onMounted } from 'vue'
|
|
187
|
+
const modal = useTemplateRef('myModal')
|
|
188
|
+
|
|
189
|
+
onMounted(() => {
|
|
190
|
+
// Escape hatch — only when no prop/v-model covers your case
|
|
191
|
+
modal.value?._unsafe_bsInstance?.handleUpdate()
|
|
192
|
+
})
|
|
193
|
+
</script>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Mobile & Hybrid App Support
|
|
197
|
+
|
|
198
|
+
VibeUI is optimized for mobile-first development and hybrid environments like **Capacitor**.
|
|
199
|
+
|
|
200
|
+
### Programmatic Breakpoints
|
|
201
|
+
Use the `useBreakpoints` composable to adapt your UI based on the viewport size.
|
|
202
|
+
|
|
203
|
+
```javascript
|
|
204
|
+
import { useBreakpoints } from '@velkymx/vibeui'
|
|
205
|
+
const { isMobile, isTablet, isLg } = useBreakpoints()
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Safe Areas
|
|
209
|
+
Components like `VibeNavbar`, `VibeOffcanvas`, and `VibeModal` automatically respect device safe areas (notches) when your app is configured with `viewport-fit=cover`.
|
|
210
|
+
|
|
211
|
+
### Hybrid Navigation
|
|
212
|
+
Use `useBackButton` to ensure Android hardware back button events correctly close active UI layers like modals and sidebars.
|
|
213
|
+
|
|
214
|
+
```javascript
|
|
215
|
+
import { useBackButton } from '@velkymx/vibeui'
|
|
216
|
+
// Registered automatically inside VibeModal and VibeOffcanvas
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Contributing
|
|
220
|
+
...
|
|
221
|
+
Contributions are welcome! Please visit the [GitHub repository](https://github.com/velkymx/vibeui) to report issues or submit pull requests.
|
|
222
|
+
|
|
223
|
+
## License
|
|
224
|
+
|
|
225
|
+
MIT License - See LICENSE file for details.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# VibePopover
|
|
2
|
+
|
|
3
|
+
Popovers for displaying contextual content overlays. Bootstrap's popover JS is initialized automatically when the component mounts.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
|------|------|---------|-------------|
|
|
9
|
+
| `text` | `String` | `undefined` | Popover body content (preferred) |
|
|
10
|
+
| `content` | `String` | `undefined` | Alias for `text` |
|
|
11
|
+
| `title` | `String` | `undefined` | Popover title |
|
|
12
|
+
| `placement` | `TooltipPlacement` | `'top'` | Popover position: `'top'`, `'bottom'`, `'start'`, `'end'` |
|
|
13
|
+
| `trigger` | `String` | `'click'` | Trigger events (space-separated): `'click'`, `'hover'`, `'focus'` |
|
|
14
|
+
|
|
15
|
+
Provide either `text` or `content` (they are interchangeable). Content is always rendered as plain text — HTML is not supported (this is intentional, to avoid XSS).
|
|
16
|
+
|
|
17
|
+
## Events
|
|
18
|
+
|
|
19
|
+
| Event | Payload | Description |
|
|
20
|
+
|-------|---------|-------------|
|
|
21
|
+
| `component-error` | `ComponentError` | Emitted if Bootstrap JS is unavailable at mount |
|
|
22
|
+
|
|
23
|
+
## Slots
|
|
24
|
+
|
|
25
|
+
| Slot | Description |
|
|
26
|
+
|------|-------------|
|
|
27
|
+
| `default` | Element that triggers the popover |
|
|
28
|
+
|
|
29
|
+
## Exposed
|
|
30
|
+
|
|
31
|
+
> **Escape hatch:** `_unsafe_bsInstance` (the underlying Bootstrap `Popover` instance) is exposed via a template ref. It is **not** part of the stable API — calling `dispose()` or other lifecycle methods on it directly WILL break the component.
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
### Basic Popover
|
|
36
|
+
|
|
37
|
+
```vue
|
|
38
|
+
<template>
|
|
39
|
+
<VibePopover
|
|
40
|
+
title="Popover Title"
|
|
41
|
+
text="This is the popover content"
|
|
42
|
+
>
|
|
43
|
+
<VibeButton variant="danger">Click me</VibeButton>
|
|
44
|
+
</VibePopover>
|
|
45
|
+
</template>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Placement Options
|
|
49
|
+
|
|
50
|
+
```vue
|
|
51
|
+
<template>
|
|
52
|
+
<div>
|
|
53
|
+
<VibePopover
|
|
54
|
+
title="Top Popover"
|
|
55
|
+
text="Popover on top"
|
|
56
|
+
placement="top"
|
|
57
|
+
>
|
|
58
|
+
<VibeButton variant="secondary">Top</VibeButton>
|
|
59
|
+
</VibePopover>
|
|
60
|
+
|
|
61
|
+
<VibePopover
|
|
62
|
+
title="End Popover"
|
|
63
|
+
text="Popover on right"
|
|
64
|
+
placement="end"
|
|
65
|
+
>
|
|
66
|
+
<VibeButton variant="secondary">End</VibeButton>
|
|
67
|
+
</VibePopover>
|
|
68
|
+
|
|
69
|
+
<VibePopover
|
|
70
|
+
title="Bottom Popover"
|
|
71
|
+
text="Popover on bottom"
|
|
72
|
+
placement="bottom"
|
|
73
|
+
>
|
|
74
|
+
<VibeButton variant="secondary">Bottom</VibeButton>
|
|
75
|
+
</VibePopover>
|
|
76
|
+
|
|
77
|
+
<VibePopover
|
|
78
|
+
title="Start Popover"
|
|
79
|
+
text="Popover on left"
|
|
80
|
+
placement="start"
|
|
81
|
+
>
|
|
82
|
+
<VibeButton variant="secondary">Start</VibeButton>
|
|
83
|
+
</VibePopover>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Hover Trigger
|
|
89
|
+
|
|
90
|
+
```vue
|
|
91
|
+
<template>
|
|
92
|
+
<VibePopover
|
|
93
|
+
title="Hover Popover"
|
|
94
|
+
text="This appears on hover"
|
|
95
|
+
trigger="hover focus"
|
|
96
|
+
>
|
|
97
|
+
<VibeButton variant="info">Hover me</VibeButton>
|
|
98
|
+
</VibePopover>
|
|
99
|
+
</template>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### No Title
|
|
103
|
+
|
|
104
|
+
```vue
|
|
105
|
+
<template>
|
|
106
|
+
<VibePopover text="Just content, no title">
|
|
107
|
+
<VibeButton variant="success">No Title</VibeButton>
|
|
108
|
+
</VibePopover>
|
|
109
|
+
</template>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Important Notes
|
|
113
|
+
|
|
114
|
+
**Automatic Initialization:** This component initializes Bootstrap's Popover for you when it mounts. Bootstrap's JS is loaded internally — do not import or initialize Bootstrap JS yourself.
|
|
115
|
+
|
|
116
|
+
**Touch Optimization:** On touch devices, if the trigger is `hover focus`, it automatically switches to `click` for reliable behavior on mobile screens. Initialization is SSR-safe.
|
|
117
|
+
|
|
118
|
+
**Reactive content:** Updating `text`/`content`/`title` updates the live popover without a re-init.
|
|
119
|
+
|
|
120
|
+
## Bootstrap CSS Classes
|
|
121
|
+
|
|
122
|
+
- `.popover`
|
|
123
|
+
- `.popover-arrow`
|
|
124
|
+
- `.popover-header`
|
|
125
|
+
- `.popover-body`
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# VibeScrollspy
|
|
2
|
+
|
|
3
|
+
Automatically update navigation based on scroll position.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
|------|------|---------|-------------|
|
|
9
|
+
| `target` | `String` | Required | CSS selector of navigation element to update |
|
|
10
|
+
| `rootMargin` | `String` | `'0px 0px -25%'` | Intersection margin for triggering activation. Format: `'top right bottom left'` in CSS units |
|
|
11
|
+
| `offset` | `Number` | `undefined` | **Deprecated.** Use `rootMargin` instead. Ignored in Bootstrap 5.2+. |
|
|
12
|
+
| `method` | `String` | `'auto'` | Scroll detection method: `'auto'`, `'offset'`, or `'position'`. Note: `'offset'` is deprecated in Bootstrap 5.2+ (IntersectionObserver-based detection supersedes it); prefer `'auto'` or `'position'`. |
|
|
13
|
+
| `smoothScroll` | `Boolean` | `false` | Enable smooth scrolling |
|
|
14
|
+
| `tag` | `String` | `'div'` | HTML tag to render |
|
|
15
|
+
| `height` | `String` | `'100%'` | CSS height of the scrollable container. Validated as a CSS length; invalid values fall back to `'100%'` |
|
|
16
|
+
|
|
17
|
+
## Events
|
|
18
|
+
|
|
19
|
+
| Event | Payload | Description |
|
|
20
|
+
|-------|---------|-------------|
|
|
21
|
+
| `activate` | `event` | Emitted when a new nav item is activated |
|
|
22
|
+
| `component-error` | `ComponentError` | Emitted if Bootstrap JS is unavailable |
|
|
23
|
+
|
|
24
|
+
## Slots
|
|
25
|
+
|
|
26
|
+
| Slot | Description |
|
|
27
|
+
|------|-------------|
|
|
28
|
+
| `default` | Scrollable content with target sections |
|
|
29
|
+
|
|
30
|
+
## Exposed Methods
|
|
31
|
+
|
|
32
|
+
| Method | Description |
|
|
33
|
+
|--------|-------------|
|
|
34
|
+
| `refresh()` | Recalculates section positions. Call after dynamic content changes. |
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
### Basic Scrollspy
|
|
39
|
+
|
|
40
|
+
```vue
|
|
41
|
+
<template>
|
|
42
|
+
<div class="row">
|
|
43
|
+
<div class="col-4">
|
|
44
|
+
<VibeNav id="navbar-example" vertical pills :items="navItems" />
|
|
45
|
+
</div>
|
|
46
|
+
<div class="col-8">
|
|
47
|
+
<VibeScrollspy target="#navbar-example" :height="'300px'" smooth-scroll>
|
|
48
|
+
<h4 id="item-1">Item 1</h4>
|
|
49
|
+
<p>Content for item 1...</p>
|
|
50
|
+
<h4 id="item-2">Item 2</h4>
|
|
51
|
+
<p>Content for item 2...</p>
|
|
52
|
+
</VibeScrollspy>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script setup>
|
|
58
|
+
const navItems = [
|
|
59
|
+
{ text: 'Item 1', href: '#item-1' },
|
|
60
|
+
{ text: 'Item 2', href: '#item-2' }
|
|
61
|
+
]
|
|
62
|
+
</script>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Adjusting the Activation Margin
|
|
66
|
+
|
|
67
|
+
`rootMargin` controls how early a section is activated relative to the scrollable viewport. The default `'0px 0px -25%'` activates a section when it enters the top 75% of the container.
|
|
68
|
+
|
|
69
|
+
```vue
|
|
70
|
+
<!-- Activate earlier — section activates when it crosses the midpoint -->
|
|
71
|
+
<VibeScrollspy target="#nav" root-margin="0px 0px -50%">
|
|
72
|
+
...
|
|
73
|
+
</VibeScrollspy>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Refreshing After Dynamic Content
|
|
77
|
+
|
|
78
|
+
```vue
|
|
79
|
+
<script setup>
|
|
80
|
+
import { ref } from 'vue'
|
|
81
|
+
|
|
82
|
+
const scrollspy = ref(null)
|
|
83
|
+
|
|
84
|
+
async function loadMore() {
|
|
85
|
+
// ... add content
|
|
86
|
+
await nextTick()
|
|
87
|
+
scrollspy.value.refresh()
|
|
88
|
+
}
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<template>
|
|
92
|
+
<VibeScrollspy ref="scrollspy" target="#nav">
|
|
93
|
+
...
|
|
94
|
+
</VibeScrollspy>
|
|
95
|
+
</template>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Important Notes
|
|
99
|
+
|
|
100
|
+
**Automatic Initialization:** This component automatically initializes Bootstrap's ScrollSpy functionality when mounted, provided Bootstrap JavaScript is available.
|
|
101
|
+
|
|
102
|
+
**`rootMargin` replaces `offset`:** Bootstrap 5.2 replaced the `offset` integer with `rootMargin` (an IntersectionObserver-compatible margin string). The `offset` prop is deprecated and logs a console warning. Use `rootMargin` for all new usage.
|
|
103
|
+
|
|
104
|
+
**KeepAlive support:** Positions are recalculated when the component is reactivated inside `<KeepAlive>`.
|
|
105
|
+
|
|
106
|
+
**Validated height:** The `height` prop is validated as a CSS length string before being applied. Invalid values silently fall back to `'100%'` (CSS injection defense).
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# VibeTooltip
|
|
2
|
+
|
|
3
|
+
Tooltips for displaying contextual information. Bootstrap's tooltip JS is initialized automatically when the component mounts.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
|------|------|---------|-------------|
|
|
9
|
+
| `text` | `String` | `undefined` | Tooltip text content (preferred) |
|
|
10
|
+
| `content` | `String` | `undefined` | **Deprecated.** Use `text` instead |
|
|
11
|
+
| `placement` | `TooltipPlacement` | `'top'` | Tooltip position: `'top'`, `'bottom'`, `'start'`, `'end'` |
|
|
12
|
+
| `trigger` | `String` | `'hover focus'` | Trigger events (space-separated): `'hover'`, `'focus'`, `'click'` |
|
|
13
|
+
|
|
14
|
+
Content is always rendered as plain text — HTML is not supported (this is intentional, to avoid XSS).
|
|
15
|
+
|
|
16
|
+
## Events
|
|
17
|
+
|
|
18
|
+
| Event | Payload | Description |
|
|
19
|
+
|-------|---------|-------------|
|
|
20
|
+
| `component-error` | `ComponentError` | Emitted if Bootstrap JS is unavailable at mount |
|
|
21
|
+
|
|
22
|
+
## Slots
|
|
23
|
+
|
|
24
|
+
| Slot | Description |
|
|
25
|
+
|------|-------------|
|
|
26
|
+
| `default` | Element that triggers the tooltip |
|
|
27
|
+
|
|
28
|
+
## Exposed
|
|
29
|
+
|
|
30
|
+
> **Escape hatch:** `_unsafe_bsInstance` (the underlying Bootstrap `Tooltip` instance) is exposed via a template ref. It is **not** part of the stable API — calling `dispose()` or other lifecycle methods on it directly WILL break the component.
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
### Basic Tooltip
|
|
35
|
+
|
|
36
|
+
```vue
|
|
37
|
+
<template>
|
|
38
|
+
<VibeTooltip text="Tooltip text">
|
|
39
|
+
<VibeButton variant="secondary">Hover me</VibeButton>
|
|
40
|
+
</VibeTooltip>
|
|
41
|
+
</template>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Placement Options
|
|
45
|
+
|
|
46
|
+
```vue
|
|
47
|
+
<template>
|
|
48
|
+
<div>
|
|
49
|
+
<VibeTooltip text="Tooltip on top" placement="top">
|
|
50
|
+
<VibeButton variant="secondary">Top</VibeButton>
|
|
51
|
+
</VibeTooltip>
|
|
52
|
+
|
|
53
|
+
<VibeTooltip text="Tooltip on right" placement="end">
|
|
54
|
+
<VibeButton variant="secondary">End</VibeButton>
|
|
55
|
+
</VibeTooltip>
|
|
56
|
+
|
|
57
|
+
<VibeTooltip text="Tooltip on bottom" placement="bottom">
|
|
58
|
+
<VibeButton variant="secondary">Bottom</VibeButton>
|
|
59
|
+
</VibeTooltip>
|
|
60
|
+
|
|
61
|
+
<VibeTooltip text="Tooltip on left" placement="start">
|
|
62
|
+
<VibeButton variant="secondary">Start</VibeButton>
|
|
63
|
+
</VibeTooltip>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Custom Trigger
|
|
69
|
+
|
|
70
|
+
```vue
|
|
71
|
+
<template>
|
|
72
|
+
<VibeTooltip text="Click to see tooltip" trigger="click">
|
|
73
|
+
<VibeButton variant="primary">Click me</VibeButton>
|
|
74
|
+
</VibeTooltip>
|
|
75
|
+
</template>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Important Notes
|
|
79
|
+
|
|
80
|
+
**Automatic Initialization:** This component initializes Bootstrap's Tooltip for you when it mounts. Bootstrap's JS is loaded internally — do not import or initialize Bootstrap JS yourself.
|
|
81
|
+
|
|
82
|
+
**Touch Optimization:** On touch devices, when the trigger is `hover focus` it automatically switches to `click` for reliable behavior on mobile screens. Initialization is SSR-safe.
|
|
83
|
+
|
|
84
|
+
**Reactive content:** Updating `text` (or the deprecated `content`) updates the live tooltip without a re-init.
|
|
85
|
+
|
|
86
|
+
## Bootstrap CSS Classes
|
|
87
|
+
|
|
88
|
+
- `.tooltip`
|
|
89
|
+
- `.tooltip-arrow`
|
|
90
|
+
- `.tooltip-inner`
|