@velkymx/vibeui 0.8.1 → 0.8.2
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/CLAUDE.md +48 -0
- package/dist/vibeui.css +1 -1
- package/dist/vibeui.es.js +149 -148
- package/dist/vibeui.umd.js +1 -1
- package/docs/README.md +153 -0
- package/docs/components/advanced/popover.md +150 -0
- package/docs/components/advanced/scrollspy.md +64 -0
- package/docs/components/advanced/tooltip.md +111 -0
- package/docs/components/card/card.md +215 -0
- package/docs/components/core/alert.md +72 -0
- package/docs/components/core/badge.md +81 -0
- package/docs/components/core/button-group.md +105 -0
- package/docs/components/core/button.md +127 -0
- package/docs/components/core/close-button.md +82 -0
- package/docs/components/core/link.md +36 -0
- package/docs/components/core/placeholder.md +135 -0
- package/docs/components/core/spinner.md +109 -0
- package/docs/components/data/datatable.md +416 -0
- package/docs/components/interactive/accordion.md +92 -0
- package/docs/components/interactive/carousel.md +97 -0
- package/docs/components/interactive/collapse.md +105 -0
- package/docs/components/interactive/dropdown.md +93 -0
- package/docs/components/interactive/modal.md +148 -0
- package/docs/components/interactive/offcanvas.md +89 -0
- package/docs/components/interactive/toast.md +114 -0
- package/docs/components/layout/col.md +123 -0
- package/docs/components/layout/container.md +59 -0
- package/docs/components/layout/row.md +113 -0
- package/docs/components/list/list-group.md +221 -0
- package/docs/components/navigation/breadcrumb.md +116 -0
- package/docs/components/navigation/nav.md +88 -0
- package/docs/components/navigation/navbar.md +106 -0
- package/docs/components/navigation/pagination.md +146 -0
- package/docs/components/progress/progress.md +182 -0
- package/docs/composables/back-button.md +28 -0
- package/docs/composables/breakpoints.md +54 -0
- package/docs/composables/color-mode.md +141 -0
- package/docs/forms/README.md +88 -0
- package/docs/forms/form-checkbox.md +50 -0
- package/docs/forms/form-datepicker.md +50 -0
- package/docs/forms/form-group.md +80 -0
- package/docs/forms/form-input.md +55 -0
- package/docs/forms/form-radio.md +58 -0
- package/docs/forms/form-select.md +54 -0
- package/docs/forms/form-spinbutton.md +55 -0
- package/docs/forms/form-switch.md +47 -0
- package/docs/forms/form-textarea.md +51 -0
- package/docs/forms/form-wysiwyg.md +64 -0
- package/docs/forms/input-group.md +51 -0
- package/docs/forms/validation.md +599 -0
- package/llms.txt +422 -0
- package/package.json +5 -2
package/docs/README.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
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
|
+
### Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @velkymx/vibeui bootstrap
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Setup
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
import { createApp } from 'vue'
|
|
19
|
+
import App from './App.vue'
|
|
20
|
+
import VibeUI, { useColorMode } from '@velkymx/vibeui'
|
|
21
|
+
import 'bootstrap/dist/css/bootstrap.min.css'
|
|
22
|
+
|
|
23
|
+
// Restore saved color mode preference before mounting
|
|
24
|
+
const { initColorMode } = useColorMode()
|
|
25
|
+
initColorMode()
|
|
26
|
+
|
|
27
|
+
createApp(App).use(VibeUI).mount('#app')
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Bootstrap JavaScript
|
|
31
|
+
|
|
32
|
+
**VibeUI v0.8.0+ is mobile-optimized and fully abstracts Bootstrap's JavaScript.** You do not need to manually import or initialize Bootstrap JS for VibeUI components.
|
|
33
|
+
|
|
34
|
+
The library handles:
|
|
35
|
+
- **Dynamic Initialization:** Components initialize their own JS logic on mount.
|
|
36
|
+
- **Reactive Configuration:** Re-initializes automatically when props like `placement` or `delay` change.
|
|
37
|
+
- **Memory Cleanup:** Automatically disposes of Bootstrap instances on unmount.
|
|
38
|
+
- **State Integrity:** Synchronizes internal Vue state with native Bootstrap events.
|
|
39
|
+
|
|
40
|
+
## Components
|
|
41
|
+
|
|
42
|
+
### [Layout Components](./components/layout/)
|
|
43
|
+
- [VibeContainer](./components/layout/container.md)
|
|
44
|
+
- [VibeRow](./components/layout/row.md)
|
|
45
|
+
- [VibeCol](./components/layout/col.md)
|
|
46
|
+
|
|
47
|
+
### [Core Components](./components/core/)
|
|
48
|
+
- [VibeAlert](./components/core/alert.md)
|
|
49
|
+
- [VibeBadge](./components/core/badge.md)
|
|
50
|
+
- [VibeButton](./components/core/button.md)
|
|
51
|
+
- [VibeButtonGroup](./components/core/button-group.md)
|
|
52
|
+
- [VibeLink](./components/core/link.md)
|
|
53
|
+
- [VibeCloseButton](./components/core/close-button.md)
|
|
54
|
+
- [VibeSpinner](./components/core/spinner.md)
|
|
55
|
+
- [VibePlaceholder](./components/core/placeholder.md)
|
|
56
|
+
|
|
57
|
+
### [Interactive Components](./components/interactive/)
|
|
58
|
+
- [VibeAccordion](./components/interactive/accordion.md)
|
|
59
|
+
- [VibeCarousel](./components/interactive/carousel.md)
|
|
60
|
+
- [VibeCollapse](./components/interactive/collapse.md)
|
|
61
|
+
- [VibeDropdown](./components/interactive/dropdown.md)
|
|
62
|
+
- [VibeModal](./components/interactive/modal.md)
|
|
63
|
+
- [VibeOffcanvas](./components/interactive/offcanvas.md)
|
|
64
|
+
- [VibeToast](./components/interactive/toast.md)
|
|
65
|
+
|
|
66
|
+
### [Advanced Components](./components/advanced/)
|
|
67
|
+
- [VibeTooltip](./components/advanced/tooltip.md)
|
|
68
|
+
- [VibePopover](./components/advanced/popover.md)
|
|
69
|
+
- [VibeScrollspy](./components/advanced/scrollspy.md)
|
|
70
|
+
|
|
71
|
+
### [Data Components](./components/data/)
|
|
72
|
+
- [VibeDataTable](./components/data/datatable.md)
|
|
73
|
+
|
|
74
|
+
### [Form Components](./forms/)
|
|
75
|
+
- [VibeFormGroup](./forms/form-group.md) - Automated layout & accessibility
|
|
76
|
+
- [VibeFormInput](./forms/form-input.md)
|
|
77
|
+
- [VibeInputGroup](./forms/input-group.md)
|
|
78
|
+
- [VibeFormSelect](./forms/form-select.md)
|
|
79
|
+
- [VibeFormWysiwyg](./forms/form-wysiwyg.md)
|
|
80
|
+
|
|
81
|
+
## Composables
|
|
82
|
+
|
|
83
|
+
Standalone utilities that can be used independently of any component.
|
|
84
|
+
|
|
85
|
+
- [useColorMode](./composables/color-mode.md) - Manage Bootstrap light/dark/auto color modes
|
|
86
|
+
- `useBreakpoints` - Programmatic breakpoint detection (xs, sm, md, lg, xl, xxl)
|
|
87
|
+
- `useBackButton` - Handle Android hardware back button in hybrid mobile apps
|
|
88
|
+
|
|
89
|
+
## Design Philosophy
|
|
90
|
+
|
|
91
|
+
1. **Full Abstraction** - No "reach-around" required; the library manages the framework engine.
|
|
92
|
+
2. **Zero-Boilerplate** - Automatic IDs, Teleportation, and state syncing.
|
|
93
|
+
3. **Smart Forms** - Context-aware form groups automate accessibility.
|
|
94
|
+
4. **TypeScript First** - Comprehensive type definitions for all props and events.
|
|
95
|
+
|
|
96
|
+
## Common Patterns
|
|
97
|
+
|
|
98
|
+
### v-model Support
|
|
99
|
+
Most interactive and form components support `v-model` for two-way state synchronization.
|
|
100
|
+
|
|
101
|
+
```vue
|
|
102
|
+
<VibeModal v-model="show" title="Hello" />
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Instance Exposure
|
|
106
|
+
Advanced users can access the underlying Bootstrap instance via template refs:
|
|
107
|
+
|
|
108
|
+
```vue
|
|
109
|
+
<template>
|
|
110
|
+
<VibeModal ref="myModal" />
|
|
111
|
+
</template>
|
|
112
|
+
|
|
113
|
+
<script setup>
|
|
114
|
+
import { useTemplateRef, onMounted } from 'vue'
|
|
115
|
+
const modal = useTemplateRef('myModal')
|
|
116
|
+
|
|
117
|
+
onMounted(() => {
|
|
118
|
+
// Access native Bootstrap methods
|
|
119
|
+
modal.value.bsInstance.handleUpdate()
|
|
120
|
+
})
|
|
121
|
+
</script>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Mobile & Hybrid App Support
|
|
125
|
+
|
|
126
|
+
VibeUI is optimized for mobile-first development and hybrid environments like **Capacitor**.
|
|
127
|
+
|
|
128
|
+
### Programmatic Breakpoints
|
|
129
|
+
Use the `useBreakpoints` composable to adapt your UI based on the viewport size.
|
|
130
|
+
|
|
131
|
+
```javascript
|
|
132
|
+
import { useBreakpoints } from '@velkymx/vibeui'
|
|
133
|
+
const { isMobile, isTablet, isLg } = useBreakpoints()
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Safe Areas
|
|
137
|
+
Components like `VibeNavbar`, `VibeOffcanvas`, and `VibeModal` automatically respect device safe areas (notches) when your app is configured with `viewport-fit=cover`.
|
|
138
|
+
|
|
139
|
+
### Hybrid Navigation
|
|
140
|
+
Use `useBackButton` to ensure Android hardware back button events correctly close active UI layers like modals and sidebars.
|
|
141
|
+
|
|
142
|
+
```javascript
|
|
143
|
+
import { useBackButton } from '@velkymx/vibeui'
|
|
144
|
+
// Registered automatically inside VibeModal and VibeOffcanvas
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Contributing
|
|
148
|
+
...
|
|
149
|
+
Contributions are welcome! Please visit the [GitHub repository](https://github.com/velkymx/vibeui) to report issues or submit pull requests.
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
MIT License - See LICENSE file for details.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# VibePopover
|
|
2
|
+
|
|
3
|
+
Popovers for displaying rich content overlays. Requires Bootstrap JS and initialization.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
|------|------|---------|-------------|
|
|
9
|
+
| `title` | `String` | `undefined` | Popover title |
|
|
10
|
+
| `content` | `String` | Required | Popover content text |
|
|
11
|
+
| `placement` | `Placement` | `'top'` | Popover position: `'top'`, `'bottom'`, `'start'`, `'end'` |
|
|
12
|
+
| `trigger` | `String` | `'click'` | Trigger events (space-separated) |
|
|
13
|
+
| `html` | `Boolean` | `false` | Allow HTML content |
|
|
14
|
+
|
|
15
|
+
## Slots
|
|
16
|
+
|
|
17
|
+
| Slot | Description |
|
|
18
|
+
|------|-------------|
|
|
19
|
+
| `default` | Element that triggers the popover |
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
### Basic Popover
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<template>
|
|
27
|
+
<VibePopover
|
|
28
|
+
title="Popover Title"
|
|
29
|
+
content="This is the popover content"
|
|
30
|
+
>
|
|
31
|
+
<VibeButton variant="danger">Click me</VibeButton>
|
|
32
|
+
</VibePopover>
|
|
33
|
+
</template>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Placement Options
|
|
37
|
+
|
|
38
|
+
```vue
|
|
39
|
+
<template>
|
|
40
|
+
<div>
|
|
41
|
+
<VibePopover
|
|
42
|
+
title="Top Popover"
|
|
43
|
+
content="Popover on top"
|
|
44
|
+
placement="top"
|
|
45
|
+
>
|
|
46
|
+
<VibeButton variant="secondary">Top</VibeButton>
|
|
47
|
+
</VibePopover>
|
|
48
|
+
|
|
49
|
+
<VibePopover
|
|
50
|
+
title="End Popover"
|
|
51
|
+
content="Popover on right"
|
|
52
|
+
placement="end"
|
|
53
|
+
>
|
|
54
|
+
<VibeButton variant="secondary">End</VibeButton>
|
|
55
|
+
</VibePopover>
|
|
56
|
+
|
|
57
|
+
<VibePopover
|
|
58
|
+
title="Bottom Popover"
|
|
59
|
+
content="Popover on bottom"
|
|
60
|
+
placement="bottom"
|
|
61
|
+
>
|
|
62
|
+
<VibeButton variant="secondary">Bottom</VibeButton>
|
|
63
|
+
</VibePopover>
|
|
64
|
+
|
|
65
|
+
<VibePopover
|
|
66
|
+
title="Start Popover"
|
|
67
|
+
content="Popover on left"
|
|
68
|
+
placement="start"
|
|
69
|
+
>
|
|
70
|
+
<VibeButton variant="secondary">Start</VibeButton>
|
|
71
|
+
</VibePopover>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Hover Trigger
|
|
77
|
+
|
|
78
|
+
```vue
|
|
79
|
+
<template>
|
|
80
|
+
<VibePopover
|
|
81
|
+
title="Hover Popover"
|
|
82
|
+
content="This appears on hover"
|
|
83
|
+
trigger="hover focus"
|
|
84
|
+
>
|
|
85
|
+
<VibeButton variant="info">Hover me</VibeButton>
|
|
86
|
+
</VibePopover>
|
|
87
|
+
</template>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### HTML Content
|
|
91
|
+
|
|
92
|
+
```vue
|
|
93
|
+
<template>
|
|
94
|
+
<VibePopover
|
|
95
|
+
title="<strong>HTML Title</strong>"
|
|
96
|
+
content="<em>HTML</em> content with <a href='#'>link</a>"
|
|
97
|
+
html
|
|
98
|
+
>
|
|
99
|
+
<VibeButton variant="warning">HTML Popover</VibeButton>
|
|
100
|
+
</VibePopover>
|
|
101
|
+
</template>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### No Title
|
|
105
|
+
|
|
106
|
+
```vue
|
|
107
|
+
<template>
|
|
108
|
+
<VibePopover content="Just content, no title">
|
|
109
|
+
<VibeButton variant="success">No Title</VibeButton>
|
|
110
|
+
</VibePopover>
|
|
111
|
+
</template>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Important Notes
|
|
115
|
+
|
|
116
|
+
**Automatic Initialization:** This component automatically initializes Bootstrap's Popover functionality when it is mounted, provided that Bootstrap's JavaScript is available in your project.
|
|
117
|
+
|
|
118
|
+
**Touch Optimization:** On touch devices, if the trigger is set to `hover focus`, it automatically switches to `click` to ensure reliable behavior on mobile screens.
|
|
119
|
+
|
|
120
|
+
**Manual Initialization (Optional):** If you are not using the automatic initialization or need to initialize popovers on non-VibeUI elements:
|
|
121
|
+
|
|
122
|
+
```javascript
|
|
123
|
+
// Initialize all popovers
|
|
124
|
+
import { Popover } from 'bootstrap'
|
|
125
|
+
...
|
|
126
|
+
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]')
|
|
127
|
+
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new Popover(popoverTriggerEl))
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Or in Vue:
|
|
131
|
+
|
|
132
|
+
```vue
|
|
133
|
+
<script setup>
|
|
134
|
+
import { onMounted } from 'vue'
|
|
135
|
+
import { Popover } from 'bootstrap'
|
|
136
|
+
|
|
137
|
+
onMounted(() => {
|
|
138
|
+
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]')
|
|
139
|
+
const popoverList = [...popoverTriggerList].map(el => new Popover(el))
|
|
140
|
+
})
|
|
141
|
+
</script>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Bootstrap CSS Classes
|
|
145
|
+
|
|
146
|
+
- Uses Bootstrap's `data-bs-toggle="popover"` attributes
|
|
147
|
+
- `.popover`
|
|
148
|
+
- `.popover-arrow`
|
|
149
|
+
- `.popover-header`
|
|
150
|
+
- `.popover-body`
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
| `offset` | `Number` | `10` | Offset pixels from top when calculating position |
|
|
11
|
+
| `method` | `String` | `'auto'` | Scroll method: `'auto'`, `'offset'`, or `'position'` |
|
|
12
|
+
| `smoothScroll` | `Boolean` | `false` | Enable smooth scrolling |
|
|
13
|
+
| `tag` | `String` | `'div'` | HTML tag to render |
|
|
14
|
+
|
|
15
|
+
## Events
|
|
16
|
+
|
|
17
|
+
| Event | Payload | Description |
|
|
18
|
+
|-------|---------|-------------|
|
|
19
|
+
| `activate` | - | Emitted when a new item is activated |
|
|
20
|
+
|
|
21
|
+
## Slots
|
|
22
|
+
|
|
23
|
+
| Slot | Description |
|
|
24
|
+
|------|-------------|
|
|
25
|
+
| `default` | Scrollable content with target sections |
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Basic Scrollspy
|
|
30
|
+
|
|
31
|
+
```vue
|
|
32
|
+
<template>
|
|
33
|
+
<div class="row">
|
|
34
|
+
<div class="col-4">
|
|
35
|
+
<VibeNav id="navbar-example" vertical pills :items="navItems" />
|
|
36
|
+
</div>
|
|
37
|
+
<div class="col-8">
|
|
38
|
+
<VibeScrollspy
|
|
39
|
+
target="#navbar-example"
|
|
40
|
+
smooth-scroll
|
|
41
|
+
style="height: 300px; overflow-y: auto"
|
|
42
|
+
>
|
|
43
|
+
<h4 id="item-1">Item 1</h4>
|
|
44
|
+
<p>Content for item 1...</p>
|
|
45
|
+
<h4 id="item-2">Item 2</h4>
|
|
46
|
+
<p>Content for item 2...</p>
|
|
47
|
+
</VibeScrollspy>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Important Notes
|
|
54
|
+
|
|
55
|
+
**Automatic Initialization:** This component automatically initializes Bootstrap's ScrollSpy functionality when it is mounted, provided that Bootstrap's JavaScript is available in your project.
|
|
56
|
+
|
|
57
|
+
**Manual Refresh:** If you dynamically add or remove content inside the scrollspy, you may need to call the `refresh()` method on the component instance via template refs.
|
|
58
|
+
|
|
59
|
+
**Instance Exposure:** You can access the underlying Bootstrap instance via template ref using the `bsInstance` property.
|
|
60
|
+
|
|
61
|
+
## Bootstrap CSS Classes
|
|
62
|
+
|
|
63
|
+
- Uses Bootstrap's `data-bs-spy="scroll"` attributes
|
|
64
|
+
- Targets navigation items automatically
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# VibeTooltip
|
|
2
|
+
|
|
3
|
+
Tooltips for displaying contextual information. Requires Bootstrap JS and initialization.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
|------|------|---------|-------------|
|
|
9
|
+
| `content` | `String` | Required | Tooltip text content |
|
|
10
|
+
| `placement` | `Placement` | `'top'` | Tooltip position: `'top'`, `'bottom'`, `'start'`, `'end'` |
|
|
11
|
+
| `trigger` | `String` | `'hover focus'` | Trigger events (space-separated) |
|
|
12
|
+
| `html` | `Boolean` | `false` | Allow HTML content |
|
|
13
|
+
|
|
14
|
+
## Slots
|
|
15
|
+
|
|
16
|
+
| Slot | Description |
|
|
17
|
+
|------|-------------|
|
|
18
|
+
| `default` | Element that triggers the tooltip |
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Basic Tooltip
|
|
23
|
+
|
|
24
|
+
```vue
|
|
25
|
+
<template>
|
|
26
|
+
<VibeTooltip content="Tooltip text">
|
|
27
|
+
<VibeButton variant="secondary">Hover me</VibeButton>
|
|
28
|
+
</VibeTooltip>
|
|
29
|
+
</template>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Placement Options
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<template>
|
|
36
|
+
<div>
|
|
37
|
+
<VibeTooltip content="Tooltip on top" placement="top">
|
|
38
|
+
<VibeButton variant="secondary">Top</VibeButton>
|
|
39
|
+
</VibeTooltip>
|
|
40
|
+
|
|
41
|
+
<VibeTooltip content="Tooltip on right" placement="end">
|
|
42
|
+
<VibeButton variant="secondary">End</VibeButton>
|
|
43
|
+
</VibeTooltip>
|
|
44
|
+
|
|
45
|
+
<VibeTooltip content="Tooltip on bottom" placement="bottom">
|
|
46
|
+
<VibeButton variant="secondary">Bottom</VibeButton>
|
|
47
|
+
</VibeTooltip>
|
|
48
|
+
|
|
49
|
+
<VibeTooltip content="Tooltip on left" placement="start">
|
|
50
|
+
<VibeButton variant="secondary">Start</VibeButton>
|
|
51
|
+
</VibeTooltip>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Custom Trigger
|
|
57
|
+
|
|
58
|
+
```vue
|
|
59
|
+
<template>
|
|
60
|
+
<VibeTooltip content="Click to see tooltip" trigger="click">
|
|
61
|
+
<VibeButton variant="primary">Click me</VibeButton>
|
|
62
|
+
</VibeTooltip>
|
|
63
|
+
</template>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### HTML Content
|
|
67
|
+
|
|
68
|
+
```vue
|
|
69
|
+
<template>
|
|
70
|
+
<VibeTooltip content="<em>Tooltip</em> with <strong>HTML</strong>" html>
|
|
71
|
+
<VibeButton variant="info">HTML Tooltip</VibeButton>
|
|
72
|
+
</VibeTooltip>
|
|
73
|
+
</template>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Important Notes
|
|
77
|
+
|
|
78
|
+
**Automatic Initialization:** This component automatically initializes Bootstrap's Tooltip functionality when it is mounted, provided that Bootstrap's JavaScript is available in your project.
|
|
79
|
+
|
|
80
|
+
**Touch Optimization:** On touch devices, the tooltip automatically switches its trigger from `hover focus` to `click` to ensure reliable behavior on mobile screens.
|
|
81
|
+
|
|
82
|
+
**Manual Initialization (Optional):** If you are not using the automatic initialization or need to initialize tooltips on non-VibeUI elements:
|
|
83
|
+
|
|
84
|
+
```javascript
|
|
85
|
+
// Initialize all tooltips
|
|
86
|
+
import { Tooltip } from 'bootstrap'
|
|
87
|
+
...
|
|
88
|
+
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
|
|
89
|
+
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new Tooltip(tooltipTriggerEl))
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Or in Vue:
|
|
93
|
+
|
|
94
|
+
```vue
|
|
95
|
+
<script setup>
|
|
96
|
+
import { onMounted } from 'vue'
|
|
97
|
+
import { Tooltip } from 'bootstrap'
|
|
98
|
+
|
|
99
|
+
onMounted(() => {
|
|
100
|
+
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
|
|
101
|
+
const tooltipList = [...tooltipTriggerList].map(el => new Tooltip(el))
|
|
102
|
+
})
|
|
103
|
+
</script>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Bootstrap CSS Classes
|
|
107
|
+
|
|
108
|
+
- Uses Bootstrap's `data-bs-toggle="tooltip"` attributes
|
|
109
|
+
- `.tooltip`
|
|
110
|
+
- `.tooltip-arrow`
|
|
111
|
+
- `.tooltip-inner`
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# VibeCard
|
|
2
|
+
|
|
3
|
+
Flexible content container component for displaying headers, bodies, footers, and images.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
|------|------|---------|-------------|
|
|
9
|
+
| `variant` | `Variant` | `undefined` | Background color variant |
|
|
10
|
+
| `border` | `Variant` | `undefined` | Border color variant |
|
|
11
|
+
| `textVariant` | `Variant` | `undefined` | Text color variant |
|
|
12
|
+
| `tag` | `String` | `'div'` | HTML tag to render |
|
|
13
|
+
| `title` | `String` | `undefined` | Card title |
|
|
14
|
+
| `body` | `String` | `undefined` | Card body text |
|
|
15
|
+
| `header` | `String` | `undefined` | Card header text |
|
|
16
|
+
| `footer` | `String` | `undefined` | Card footer text |
|
|
17
|
+
| `imgSrc` | `String` | `undefined` | Image URL |
|
|
18
|
+
| `imgAlt` | `String` | `''` | Image alt text |
|
|
19
|
+
| `imgTop` | `Boolean` | `true` | Display image at top |
|
|
20
|
+
| `imgBottom` | `Boolean` | `false` | Display image at bottom |
|
|
21
|
+
|
|
22
|
+
## Slots
|
|
23
|
+
|
|
24
|
+
| Slot | Description |
|
|
25
|
+
|------|-------------|
|
|
26
|
+
| `default` | Additional body content |
|
|
27
|
+
| `header` | Custom header content |
|
|
28
|
+
| `title` | Custom title content |
|
|
29
|
+
| `body` | Custom body content |
|
|
30
|
+
| `footer` | Custom footer content |
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
### Basic Card
|
|
35
|
+
|
|
36
|
+
```vue
|
|
37
|
+
<template>
|
|
38
|
+
<VibeCard
|
|
39
|
+
title="Card Title"
|
|
40
|
+
body="This is the card body text. Quick and easy!"
|
|
41
|
+
/>
|
|
42
|
+
</template>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Card with Header and Footer
|
|
46
|
+
|
|
47
|
+
```vue
|
|
48
|
+
<template>
|
|
49
|
+
<VibeCard
|
|
50
|
+
header="Featured"
|
|
51
|
+
title="Special title treatment"
|
|
52
|
+
body="With supporting text below as a natural lead-in."
|
|
53
|
+
footer="2 days ago"
|
|
54
|
+
/>
|
|
55
|
+
</template>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Card with Image
|
|
59
|
+
|
|
60
|
+
```vue
|
|
61
|
+
<template>
|
|
62
|
+
<VibeCard
|
|
63
|
+
img-src="/path/to/image.jpg"
|
|
64
|
+
img-alt="Card image"
|
|
65
|
+
title="Card with Image"
|
|
66
|
+
body="This card has an image at the top."
|
|
67
|
+
/>
|
|
68
|
+
</template>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Colored Cards
|
|
72
|
+
|
|
73
|
+
```vue
|
|
74
|
+
<template>
|
|
75
|
+
<div>
|
|
76
|
+
<VibeCard
|
|
77
|
+
variant="primary"
|
|
78
|
+
text-variant="white"
|
|
79
|
+
title="Primary Card"
|
|
80
|
+
body="Card with primary background."
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
<VibeCard
|
|
84
|
+
variant="success"
|
|
85
|
+
text-variant="white"
|
|
86
|
+
title="Success Card"
|
|
87
|
+
body="Card with success background."
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
</template>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Border Variants
|
|
94
|
+
|
|
95
|
+
```vue
|
|
96
|
+
<template>
|
|
97
|
+
<div>
|
|
98
|
+
<VibeCard
|
|
99
|
+
border="primary"
|
|
100
|
+
title="Primary Border"
|
|
101
|
+
body="Card with primary border."
|
|
102
|
+
/>
|
|
103
|
+
|
|
104
|
+
<VibeCard
|
|
105
|
+
border="danger"
|
|
106
|
+
title="Danger Border"
|
|
107
|
+
body="Card with danger border."
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
110
|
+
</template>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Custom Content with Slots
|
|
114
|
+
|
|
115
|
+
Use named slots for complex content:
|
|
116
|
+
|
|
117
|
+
```vue
|
|
118
|
+
<template>
|
|
119
|
+
<VibeCard>
|
|
120
|
+
<template #header>
|
|
121
|
+
<strong>Featured</strong>
|
|
122
|
+
</template>
|
|
123
|
+
|
|
124
|
+
<template #title>
|
|
125
|
+
Special Title Treatment
|
|
126
|
+
</template>
|
|
127
|
+
|
|
128
|
+
<template #body>
|
|
129
|
+
<p>With supporting text below as a natural lead-in.</p>
|
|
130
|
+
</template>
|
|
131
|
+
|
|
132
|
+
<!-- Additional body content via default slot -->
|
|
133
|
+
<VibeButton variant="primary">Go somewhere</VibeButton>
|
|
134
|
+
|
|
135
|
+
<template #footer>
|
|
136
|
+
<small class="text-muted">Last updated 3 mins ago</small>
|
|
137
|
+
</template>
|
|
138
|
+
</VibeCard>
|
|
139
|
+
</template>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Horizontal Card
|
|
143
|
+
|
|
144
|
+
Use the default slot with Bootstrap grid:
|
|
145
|
+
|
|
146
|
+
```vue
|
|
147
|
+
<template>
|
|
148
|
+
<VibeCard>
|
|
149
|
+
<div class="row g-0">
|
|
150
|
+
<div class="col-md-4">
|
|
151
|
+
<img src="/path/to/image.jpg" alt="..." class="card-img">
|
|
152
|
+
</div>
|
|
153
|
+
<div class="col-md-8">
|
|
154
|
+
<div class="card-body">
|
|
155
|
+
<h5 class="card-title">Horizontal Card</h5>
|
|
156
|
+
<p class="card-text">
|
|
157
|
+
This is a wider card with supporting text.
|
|
158
|
+
</p>
|
|
159
|
+
<p class="card-text">
|
|
160
|
+
<small class="text-muted">Last updated 3 mins ago</small>
|
|
161
|
+
</p>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</VibeCard>
|
|
166
|
+
</template>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Card Grid
|
|
170
|
+
|
|
171
|
+
```vue
|
|
172
|
+
<template>
|
|
173
|
+
<div class="row row-cols-1 row-cols-md-3 g-4">
|
|
174
|
+
<div class="col">
|
|
175
|
+
<VibeCard
|
|
176
|
+
img-src="/path/to/image1.jpg"
|
|
177
|
+
img-alt="Card 1"
|
|
178
|
+
title="Card 1"
|
|
179
|
+
body="Card content here."
|
|
180
|
+
/>
|
|
181
|
+
</div>
|
|
182
|
+
<div class="col">
|
|
183
|
+
<VibeCard
|
|
184
|
+
img-src="/path/to/image2.jpg"
|
|
185
|
+
img-alt="Card 2"
|
|
186
|
+
title="Card 2"
|
|
187
|
+
body="Card content here."
|
|
188
|
+
/>
|
|
189
|
+
</div>
|
|
190
|
+
<div class="col">
|
|
191
|
+
<VibeCard
|
|
192
|
+
img-src="/path/to/image3.jpg"
|
|
193
|
+
img-alt="Card 3"
|
|
194
|
+
title="Card 3"
|
|
195
|
+
body="Card content here."
|
|
196
|
+
/>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
</template>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Bootstrap CSS Classes
|
|
203
|
+
|
|
204
|
+
- `.card`
|
|
205
|
+
- `.card-header`
|
|
206
|
+
- `.card-body`
|
|
207
|
+
- `.card-footer`
|
|
208
|
+
- `.card-img-top`
|
|
209
|
+
- `.card-img-bottom`
|
|
210
|
+
- `.card-img`
|
|
211
|
+
- `.card-title`
|
|
212
|
+
- `.card-text`
|
|
213
|
+
- `.bg-{variant}`
|
|
214
|
+
- `.border-{variant}`
|
|
215
|
+
- `.text-{variant}`
|