@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
|
@@ -0,0 +1,223 @@
|
|
|
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
|
+
| `headerClass` | `String \| Array \| Object` | `undefined` | Extra class(es) for the `.card-header` wrapper (e.g. a variant-colored header) |
|
|
18
|
+
| `bodyClass` | `String \| Array \| Object` | `undefined` | Extra class(es) for the `.card-body` wrapper |
|
|
19
|
+
| `footerClass` | `String \| Array \| Object` | `undefined` | Extra class(es) for the `.card-footer` wrapper |
|
|
20
|
+
| `imgSrc` | `String` | `undefined` | Image URL |
|
|
21
|
+
| `imgAlt` | `String` | `''` | Image alt text |
|
|
22
|
+
| `imgTop` | `Boolean` | `false` | Display image at top |
|
|
23
|
+
| `imgBottom` | `Boolean` | `false` | Display image at bottom |
|
|
24
|
+
|
|
25
|
+
## Slots
|
|
26
|
+
|
|
27
|
+
| Slot | Description |
|
|
28
|
+
|------|-------------|
|
|
29
|
+
| `default` | Additional body content |
|
|
30
|
+
| `image` | A direct card child rendered **outside** `.card-body` (before the header) — for a card image with custom composition, e.g. a `card-img-top` with an absolutely-positioned overlay/badge |
|
|
31
|
+
| `header` | Custom header content |
|
|
32
|
+
| `title` | Custom title content |
|
|
33
|
+
| `body` | Custom body content |
|
|
34
|
+
| `footer` | Custom footer content |
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
### Basic Card
|
|
39
|
+
|
|
40
|
+
```vue
|
|
41
|
+
<template>
|
|
42
|
+
<VibeCard
|
|
43
|
+
title="Card Title"
|
|
44
|
+
body="This is the card body text. Quick and easy!"
|
|
45
|
+
/>
|
|
46
|
+
</template>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Card with Header and Footer
|
|
50
|
+
|
|
51
|
+
```vue
|
|
52
|
+
<template>
|
|
53
|
+
<VibeCard
|
|
54
|
+
header="Featured"
|
|
55
|
+
title="Special title treatment"
|
|
56
|
+
body="With supporting text below as a natural lead-in."
|
|
57
|
+
footer="2 days ago"
|
|
58
|
+
/>
|
|
59
|
+
</template>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Card with Image
|
|
63
|
+
|
|
64
|
+
```vue
|
|
65
|
+
<template>
|
|
66
|
+
<VibeCard
|
|
67
|
+
img-src="/path/to/image.jpg"
|
|
68
|
+
img-alt="Card image"
|
|
69
|
+
img-top
|
|
70
|
+
title="Card with Image"
|
|
71
|
+
body="This card has an image at the top."
|
|
72
|
+
/>
|
|
73
|
+
</template>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Colored Cards
|
|
77
|
+
|
|
78
|
+
```vue
|
|
79
|
+
<template>
|
|
80
|
+
<div>
|
|
81
|
+
<VibeCard
|
|
82
|
+
variant="primary"
|
|
83
|
+
text-variant="white"
|
|
84
|
+
title="Primary Card"
|
|
85
|
+
body="Card with primary background."
|
|
86
|
+
/>
|
|
87
|
+
|
|
88
|
+
<VibeCard
|
|
89
|
+
variant="success"
|
|
90
|
+
text-variant="white"
|
|
91
|
+
title="Success Card"
|
|
92
|
+
body="Card with success background."
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Border Variants
|
|
99
|
+
|
|
100
|
+
```vue
|
|
101
|
+
<template>
|
|
102
|
+
<div>
|
|
103
|
+
<VibeCard
|
|
104
|
+
border="primary"
|
|
105
|
+
title="Primary Border"
|
|
106
|
+
body="Card with primary border."
|
|
107
|
+
/>
|
|
108
|
+
|
|
109
|
+
<VibeCard
|
|
110
|
+
border="danger"
|
|
111
|
+
title="Danger Border"
|
|
112
|
+
body="Card with danger border."
|
|
113
|
+
/>
|
|
114
|
+
</div>
|
|
115
|
+
</template>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Custom Content with Slots
|
|
119
|
+
|
|
120
|
+
Use named slots for complex content:
|
|
121
|
+
|
|
122
|
+
```vue
|
|
123
|
+
<template>
|
|
124
|
+
<VibeCard>
|
|
125
|
+
<template #header>
|
|
126
|
+
<strong>Featured</strong>
|
|
127
|
+
</template>
|
|
128
|
+
|
|
129
|
+
<template #title>
|
|
130
|
+
Special Title Treatment
|
|
131
|
+
</template>
|
|
132
|
+
|
|
133
|
+
<template #body>
|
|
134
|
+
<p>With supporting text below as a natural lead-in.</p>
|
|
135
|
+
</template>
|
|
136
|
+
|
|
137
|
+
<!-- Additional body content via default slot -->
|
|
138
|
+
<VibeButton variant="primary">Go somewhere</VibeButton>
|
|
139
|
+
|
|
140
|
+
<template #footer>
|
|
141
|
+
<small class="text-muted">Last updated 3 mins ago</small>
|
|
142
|
+
</template>
|
|
143
|
+
</VibeCard>
|
|
144
|
+
</template>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Horizontal Card
|
|
148
|
+
|
|
149
|
+
Use the default slot with Bootstrap grid:
|
|
150
|
+
|
|
151
|
+
```vue
|
|
152
|
+
<template>
|
|
153
|
+
<VibeCard>
|
|
154
|
+
<div class="row g-0">
|
|
155
|
+
<div class="col-md-4">
|
|
156
|
+
<img src="/path/to/image.jpg" alt="..." class="card-img">
|
|
157
|
+
</div>
|
|
158
|
+
<div class="col-md-8">
|
|
159
|
+
<div class="card-body">
|
|
160
|
+
<h5 class="card-title">Horizontal Card</h5>
|
|
161
|
+
<p class="card-text">
|
|
162
|
+
This is a wider card with supporting text.
|
|
163
|
+
</p>
|
|
164
|
+
<p class="card-text">
|
|
165
|
+
<small class="text-muted">Last updated 3 mins ago</small>
|
|
166
|
+
</p>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</VibeCard>
|
|
171
|
+
</template>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Card Grid
|
|
175
|
+
|
|
176
|
+
```vue
|
|
177
|
+
<template>
|
|
178
|
+
<div class="row row-cols-1 row-cols-md-3 g-4">
|
|
179
|
+
<div class="col">
|
|
180
|
+
<VibeCard
|
|
181
|
+
img-src="/path/to/image1.jpg"
|
|
182
|
+
img-alt="Card 1"
|
|
183
|
+
img-top
|
|
184
|
+
title="Card 1"
|
|
185
|
+
body="Card content here."
|
|
186
|
+
/>
|
|
187
|
+
</div>
|
|
188
|
+
<div class="col">
|
|
189
|
+
<VibeCard
|
|
190
|
+
img-src="/path/to/image2.jpg"
|
|
191
|
+
img-alt="Card 2"
|
|
192
|
+
img-top
|
|
193
|
+
title="Card 2"
|
|
194
|
+
body="Card content here."
|
|
195
|
+
/>
|
|
196
|
+
</div>
|
|
197
|
+
<div class="col">
|
|
198
|
+
<VibeCard
|
|
199
|
+
img-src="/path/to/image3.jpg"
|
|
200
|
+
img-alt="Card 3"
|
|
201
|
+
img-top
|
|
202
|
+
title="Card 3"
|
|
203
|
+
body="Card content here."
|
|
204
|
+
/>
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
</template>
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Bootstrap CSS Classes
|
|
211
|
+
|
|
212
|
+
- `.card`
|
|
213
|
+
- `.card-header`
|
|
214
|
+
- `.card-body`
|
|
215
|
+
- `.card-footer`
|
|
216
|
+
- `.card-img-top`
|
|
217
|
+
- `.card-img-bottom`
|
|
218
|
+
- `.card-img`
|
|
219
|
+
- `.card-title`
|
|
220
|
+
- `.card-text`
|
|
221
|
+
- `.bg-{variant}`
|
|
222
|
+
- `.border-{variant}`
|
|
223
|
+
- `.text-{variant}`
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# VibeChartBar
|
|
2
|
+
|
|
3
|
+
Canvas-based bar chart with responsive sizing, interactive tooltips, stacked mode, and Bootstrap-aware color cycling.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
|------|------|---------|-------------|
|
|
9
|
+
| `data` | `ChartData` | Required | Chart data: labels array + datasets array |
|
|
10
|
+
| `legend` | `'top' \| 'bottom' \| 'none'` | `'bottom'` | Legend position |
|
|
11
|
+
| `height` | `Number \| String` | `'auto'` | Fixed height in px or CSS string. `'auto'` uses 16:9 aspect ratio |
|
|
12
|
+
| `showAxes` | `Boolean` | `true` | Render X and Y axes |
|
|
13
|
+
| `showGrid` | `Boolean` | `true` | Render horizontal grid lines |
|
|
14
|
+
| `stacked` | `Boolean` | `false` | Stack datasets on top of each other instead of grouping side-by-side |
|
|
15
|
+
|
|
16
|
+
## Data Shape
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
interface ChartData {
|
|
20
|
+
labels: string[] // X-axis category labels
|
|
21
|
+
datasets: ChartDataset[]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface ChartDataset {
|
|
25
|
+
label: string // Series name (shown in legend and tooltip)
|
|
26
|
+
data: number[] // One value per label
|
|
27
|
+
color?: string // CSS color string. Defaults to Bootstrap CSS variables cycling through
|
|
28
|
+
// --bs-primary, --bs-success, --bs-danger, --bs-warning, --bs-info, ...
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Import from `@velkymx/vibeui`:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import type { ChartData } from '@velkymx/vibeui'
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
### Basic Bar Chart
|
|
41
|
+
|
|
42
|
+
```vue
|
|
43
|
+
<script setup>
|
|
44
|
+
const data = {
|
|
45
|
+
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
|
|
46
|
+
datasets: [
|
|
47
|
+
{ label: 'Orders', data: [34, 52, 48, 61, 44] }
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
<VibeChartBar :data="data" />
|
|
54
|
+
</template>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Grouped Bars (Multiple Datasets)
|
|
58
|
+
|
|
59
|
+
```vue
|
|
60
|
+
<template>
|
|
61
|
+
<VibeChartBar :data="{
|
|
62
|
+
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
|
|
63
|
+
datasets: [
|
|
64
|
+
{ label: 'Product A', data: [120, 145, 132, 170] },
|
|
65
|
+
{ label: 'Product B', data: [ 80, 95, 88, 105] }
|
|
66
|
+
]
|
|
67
|
+
}" />
|
|
68
|
+
</template>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Stacked Bar Chart
|
|
72
|
+
|
|
73
|
+
```vue
|
|
74
|
+
<template>
|
|
75
|
+
<VibeChartBar :data="data" stacked />
|
|
76
|
+
</template>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Fixed Height, Legend at Top
|
|
80
|
+
|
|
81
|
+
```vue
|
|
82
|
+
<template>
|
|
83
|
+
<VibeChartBar :data="data" :height="250" legend="top" />
|
|
84
|
+
</template>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Custom Colors
|
|
88
|
+
|
|
89
|
+
```vue
|
|
90
|
+
<template>
|
|
91
|
+
<VibeChartBar :data="{
|
|
92
|
+
labels: ['A', 'B', 'C'],
|
|
93
|
+
datasets: [
|
|
94
|
+
{ label: 'Wins', data: [8, 5, 7], color: '#2ecc71' },
|
|
95
|
+
{ label: 'Losses', data: [2, 5, 3], color: '#e74c3c' }
|
|
96
|
+
]
|
|
97
|
+
}" />
|
|
98
|
+
</template>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Reactive Data
|
|
102
|
+
|
|
103
|
+
```vue
|
|
104
|
+
<script setup>
|
|
105
|
+
import { ref } from 'vue'
|
|
106
|
+
|
|
107
|
+
const data = ref({
|
|
108
|
+
labels: ['Jan', 'Feb'],
|
|
109
|
+
datasets: [{ label: 'Sales', data: [100, 150] }]
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
function addWeek() {
|
|
113
|
+
data.value.labels.push('Mar')
|
|
114
|
+
data.value.datasets[0].data.push(130)
|
|
115
|
+
}
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<template>
|
|
119
|
+
<VibeChartBar :data="data" />
|
|
120
|
+
<button @click="addWeek">Add Month</button>
|
|
121
|
+
</template>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Notes
|
|
125
|
+
|
|
126
|
+
- **No external dependency.** VibeChartBar draws directly on a `<canvas>` element — no Chart.js or other charting library required.
|
|
127
|
+
- **Color cycling.** When `color` is omitted on a dataset, colors cycle through Bootstrap's CSS variables (`--bs-primary`, `--bs-success`, `--bs-danger`, ...) resolved from the container's computed styles. Colors follow your Bootstrap theme and dark mode automatically.
|
|
128
|
+
- **Responsive.** The canvas resizes via `ResizeObserver` and redraws at device pixel ratio for crisp HiDPI output.
|
|
129
|
+
- **Tooltips.** Hover over any bar to see the category, series name, and value.
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# VibeChartLine
|
|
2
|
+
|
|
3
|
+
Canvas-based line chart with responsive sizing, interactive tooltips, and Bootstrap-aware color cycling.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
|------|------|---------|-------------|
|
|
9
|
+
| `data` | `ChartData` | Required | Chart data: labels array + datasets array |
|
|
10
|
+
| `legend` | `'top' \| 'bottom' \| 'none'` | `'bottom'` | Legend position |
|
|
11
|
+
| `height` | `Number \| String` | `'auto'` | Fixed height in px or CSS string. `'auto'` uses 16:9 aspect ratio |
|
|
12
|
+
| `showAxes` | `Boolean` | `true` | Render X and Y axes |
|
|
13
|
+
| `showGrid` | `Boolean` | `true` | Render horizontal grid lines |
|
|
14
|
+
| `smooth` | `Boolean` | `false` | Render lines as bezier curves instead of straight segments |
|
|
15
|
+
| `fill` | `Boolean` | `false` | Fill the area under each line |
|
|
16
|
+
|
|
17
|
+
## Data Shape
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
interface ChartData {
|
|
21
|
+
labels: string[] // X-axis labels
|
|
22
|
+
datasets: ChartDataset[]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface ChartDataset {
|
|
26
|
+
label: string // Series name (shown in legend and tooltip)
|
|
27
|
+
data: number[] // One value per label
|
|
28
|
+
color?: string // CSS color string. Defaults to Bootstrap CSS variables cycling through
|
|
29
|
+
// --bs-primary, --bs-success, --bs-danger, --bs-warning, --bs-info, ...
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Import from `@velkymx/vibeui`:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import type { ChartData } from '@velkymx/vibeui'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
### Basic Line Chart
|
|
42
|
+
|
|
43
|
+
```vue
|
|
44
|
+
<script setup>
|
|
45
|
+
import { ref } from 'vue'
|
|
46
|
+
|
|
47
|
+
const data = ref({
|
|
48
|
+
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
|
|
49
|
+
datasets: [
|
|
50
|
+
{ label: 'Revenue', data: [12000, 18000, 15000, 22000, 19000, 27000] }
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
<VibeChartLine :data="data" />
|
|
57
|
+
</template>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Multiple Series
|
|
61
|
+
|
|
62
|
+
```vue
|
|
63
|
+
<template>
|
|
64
|
+
<VibeChartLine :data="{
|
|
65
|
+
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
|
|
66
|
+
datasets: [
|
|
67
|
+
{ label: 'Sales', data: [45, 62, 58, 75] },
|
|
68
|
+
{ label: 'Costs', data: [30, 35, 32, 40] }
|
|
69
|
+
]
|
|
70
|
+
}" />
|
|
71
|
+
</template>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Smooth Filled Curves
|
|
75
|
+
|
|
76
|
+
```vue
|
|
77
|
+
<template>
|
|
78
|
+
<VibeChartLine :data="data" smooth fill />
|
|
79
|
+
</template>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Fixed Height, Legend at Top
|
|
83
|
+
|
|
84
|
+
```vue
|
|
85
|
+
<template>
|
|
86
|
+
<VibeChartLine :data="data" :height="300" legend="top" />
|
|
87
|
+
</template>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Custom Colors
|
|
91
|
+
|
|
92
|
+
Override per-dataset colors with any CSS color string:
|
|
93
|
+
|
|
94
|
+
```vue
|
|
95
|
+
<template>
|
|
96
|
+
<VibeChartLine :data="{
|
|
97
|
+
labels: ['A', 'B', 'C'],
|
|
98
|
+
datasets: [
|
|
99
|
+
{ label: 'Alpha', data: [1, 3, 2], color: '#e74c3c' },
|
|
100
|
+
{ label: 'Beta', data: [2, 1, 4], color: '#3498db' }
|
|
101
|
+
]
|
|
102
|
+
}" />
|
|
103
|
+
</template>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Reactive Data
|
|
107
|
+
|
|
108
|
+
The chart redraws whenever `data` changes:
|
|
109
|
+
|
|
110
|
+
```vue
|
|
111
|
+
<script setup>
|
|
112
|
+
import { ref } from 'vue'
|
|
113
|
+
|
|
114
|
+
const data = ref({
|
|
115
|
+
labels: ['Jan', 'Feb', 'Mar'],
|
|
116
|
+
datasets: [{ label: 'Visits', data: [100, 200, 150] }]
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
function addMonth() {
|
|
120
|
+
data.value.labels.push('Apr')
|
|
121
|
+
data.value.datasets[0].data.push(180)
|
|
122
|
+
}
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
<template>
|
|
126
|
+
<VibeChartLine :data="data" />
|
|
127
|
+
<button @click="addMonth">Add Month</button>
|
|
128
|
+
</template>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Notes
|
|
132
|
+
|
|
133
|
+
- **No external dependency.** VibeChartLine draws directly on a `<canvas>` element — no Chart.js or other charting library required.
|
|
134
|
+
- **Color cycling.** When `color` is omitted on a dataset, colors cycle through Bootstrap's CSS variables (`--bs-primary`, `--bs-success`, `--bs-danger`, ...) resolved from the computed styles of the container. Colors automatically follow your Bootstrap theme, including dark mode.
|
|
135
|
+
- **Responsive.** The canvas resizes via `ResizeObserver` on the container element and redraws at the device pixel ratio for crisp output on HiDPI screens.
|
|
136
|
+
- **Tooltips.** Hover over a data point to see the label and value. The chart redraws on each tooltip state change.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# VibeChartPie
|
|
2
|
+
|
|
3
|
+
Canvas-based pie chart with interactive tooltips, Bootstrap-aware color cycling, and responsive sizing.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
|------|------|---------|-------------|
|
|
9
|
+
| `data` | `ChartData` | Required | Chart data: labels array + single dataset |
|
|
10
|
+
| `legend` | `'top' \| 'bottom' \| 'none'` | `'bottom'` | Legend position |
|
|
11
|
+
| `height` | `Number \| String` | `'auto'` | Fixed height in px or CSS string. `'auto'` uses 1:1 aspect ratio |
|
|
12
|
+
|
|
13
|
+
## Data Shape
|
|
14
|
+
|
|
15
|
+
Pie charts use a single dataset. Each value in `data` corresponds to one slice, identified by the matching index in `labels`.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
interface ChartData {
|
|
19
|
+
labels: string[] // One label per slice
|
|
20
|
+
datasets: ChartDataset[] // Use one dataset for pie charts
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface ChartDataset {
|
|
24
|
+
label: string // Series name (used in tooltip prefix)
|
|
25
|
+
data: number[] // One value per slice (raw values; chart computes percentages)
|
|
26
|
+
color?: string // Not used for pie — slice colors are auto-cycled from Bootstrap
|
|
27
|
+
// CSS variables (--bs-primary, --bs-success, --bs-danger, ...)
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Slice colors are always auto-assigned from Bootstrap CSS variables in order — individual slice color overrides via `dataset.color` are not supported on pie charts.
|
|
32
|
+
|
|
33
|
+
Import from `@velkymx/vibeui`:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import type { ChartData } from '@velkymx/vibeui'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
### Basic Pie Chart
|
|
42
|
+
|
|
43
|
+
```vue
|
|
44
|
+
<script setup>
|
|
45
|
+
const data = {
|
|
46
|
+
labels: ['Direct', 'Organic', 'Referral', 'Social'],
|
|
47
|
+
datasets: [
|
|
48
|
+
{ label: 'Traffic', data: [40, 30, 20, 10] }
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<VibeChartPie :data="data" />
|
|
55
|
+
</template>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Fixed Height, Legend at Top
|
|
59
|
+
|
|
60
|
+
```vue
|
|
61
|
+
<template>
|
|
62
|
+
<VibeChartPie :data="data" :height="300" legend="top" />
|
|
63
|
+
</template>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### No Legend
|
|
67
|
+
|
|
68
|
+
```vue
|
|
69
|
+
<template>
|
|
70
|
+
<VibeChartPie :data="data" legend="none" />
|
|
71
|
+
</template>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Reactive Data
|
|
75
|
+
|
|
76
|
+
```vue
|
|
77
|
+
<script setup>
|
|
78
|
+
import { ref } from 'vue'
|
|
79
|
+
|
|
80
|
+
const data = ref({
|
|
81
|
+
labels: ['A', 'B', 'C'],
|
|
82
|
+
datasets: [{ label: 'Share', data: [50, 30, 20] }]
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
function refresh() {
|
|
86
|
+
data.value.datasets[0].data = [35, 45, 20]
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<template>
|
|
91
|
+
<VibeChartPie :data="data" />
|
|
92
|
+
<button @click="refresh">Refresh</button>
|
|
93
|
+
</template>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Notes
|
|
97
|
+
|
|
98
|
+
- **No external dependency.** VibeChartPie draws directly on a `<canvas>` element — no Chart.js or other charting library required.
|
|
99
|
+
- **Color cycling.** Slice colors cycle through Bootstrap CSS variables (`--bs-primary`, `--bs-success`, `--bs-danger`, `--bs-warning`, `--bs-info`, ...) resolved from the container's computed styles. Colors follow your Bootstrap theme and dark mode.
|
|
100
|
+
- **Responsive.** Defaults to a square 1:1 aspect ratio. The canvas resizes via `ResizeObserver` and redraws at device pixel ratio for crisp HiDPI output.
|
|
101
|
+
- **Tooltips.** Hover over a slice to see the label and value.
|
|
102
|
+
- **Single dataset.** Pass exactly one dataset. Multiple datasets are silently ignored.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# VibeAlert
|
|
2
|
+
|
|
3
|
+
Alert messages with Bootstrap styling, supporting variants, dismissible functionality, and v-model binding.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
|------|------|---------|-------------|
|
|
9
|
+
| `variant` | `Variant` | `'primary'` | Color variant |
|
|
10
|
+
| `subtle` | `Boolean` | `false` | Renders alert with subtle background and emphasis text |
|
|
11
|
+
| `modelValue` | `Boolean` | `true` | Controls visibility (v-model support) |
|
|
12
|
+
| `dismissible` | `Boolean` | `false` | Shows close button when true |
|
|
13
|
+
| `message` | `String` | `''` | Alert message text. Renders alongside default slot content; optional when the slot is used. |
|
|
14
|
+
| `fade` | `Boolean` | `true` | Use fade animation on dismissal |
|
|
15
|
+
|
|
16
|
+
## Events
|
|
17
|
+
|
|
18
|
+
| Event | Payload | Description |
|
|
19
|
+
|-------|---------|-------------|
|
|
20
|
+
| `update:modelValue` | `Boolean` | Emitted when alert is dismissed |
|
|
21
|
+
| `close` | - | Emitted when dismissal starts |
|
|
22
|
+
| `closed` | - | Emitted when dismissal completes |
|
|
23
|
+
|
|
24
|
+
## Slots
|
|
25
|
+
|
|
26
|
+
| Slot | Description |
|
|
27
|
+
|------|-------------|
|
|
28
|
+
| `default` | Additional alert content, appended after the `message` prop. When `message` is empty, slot is the sole content. |
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
### Basic Alert
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<template>
|
|
36
|
+
<VibeAlert variant="success" message="Operation completed successfully!" />
|
|
37
|
+
</template>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Dismissible Alert with v-model
|
|
41
|
+
|
|
42
|
+
```vue
|
|
43
|
+
<script setup>
|
|
44
|
+
import { ref } from 'vue'
|
|
45
|
+
const showAlert = ref(true)
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<VibeAlert
|
|
50
|
+
variant="warning"
|
|
51
|
+
dismissible
|
|
52
|
+
v-model="showAlert"
|
|
53
|
+
message="This alert can be dismissed"
|
|
54
|
+
/>
|
|
55
|
+
</template>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Rich Content via Default Slot
|
|
59
|
+
|
|
60
|
+
Use the default slot for inline buttons, links, icons, or rich VNode content. Slot content is appended after the `message` prop text — both render. Omit `message` when the slot is the sole content.
|
|
61
|
+
|
|
62
|
+
```vue
|
|
63
|
+
<template>
|
|
64
|
+
<!-- message prop + slot button coexist -->
|
|
65
|
+
<VibeAlert variant="success" message="Sprint locked. Planning is frozen.">
|
|
66
|
+
<div class="mt-2">
|
|
67
|
+
<VibeButton size="sm" variant="success" @click="goToBoard">Go to Sprint Board</VibeButton>
|
|
68
|
+
</div>
|
|
69
|
+
</VibeAlert>
|
|
70
|
+
|
|
71
|
+
<!-- slot as sole content -->
|
|
72
|
+
<VibeAlert variant="warning" dismissible>
|
|
73
|
+
<strong>Sprint locked.</strong>
|
|
74
|
+
Changes are frozen until release.
|
|
75
|
+
<VibeButton size="sm" variant="primary" @click="unlock">Unlock</VibeButton>
|
|
76
|
+
</VibeAlert>
|
|
77
|
+
</template>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Important Notes
|
|
81
|
+
|
|
82
|
+
**Automatic Initialization:** This component automatically initializes Bootstrap's Alert functionality when it is mounted, ensuring smooth dismissal animations.
|
|
83
|
+
|
|
84
|
+
**Dismissing:** Use `v-model` to show/dismiss the alert programmatically — there is no exposed Bootstrap instance to manage manually.
|
|
85
|
+
|
|
86
|
+
## Bootstrap CSS Classes
|
|
87
|
+
|
|
88
|
+
- `.alert`
|
|
89
|
+
- `.alert-{variant}`
|
|
90
|
+
- `.bg-{variant}-subtle` (when `subtle` is true)
|
|
91
|
+
- `.text-{variant}-emphasis` (when `subtle` is true)
|
|
92
|
+
- `.border-{variant}-subtle` (when `subtle` is true)
|
|
93
|
+
- `.alert-dismissible`
|
|
94
|
+
- `.fade`, `.show`
|