@velkymx/vibeui 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/VibeFileInput.vue.d.ts +19 -1
- package/dist/vibeui.css +1 -1
- package/dist/vibeui.es.js +1062 -1023
- package/dist/vibeui.umd.js +3 -3
- package/docs/forms/file-input.md +9 -3
- package/package.json +1 -1
package/docs/forms/file-input.md
CHANGED
|
@@ -15,6 +15,8 @@ File attachment input with optional drag-and-drop zone. `v-model` exposes the se
|
|
|
15
15
|
| `dragDrop` | `boolean` | `false` | Render a drag-and-drop zone instead of the native control. |
|
|
16
16
|
| `disabled` | `boolean` | `false` | Disable the input. |
|
|
17
17
|
| `size` | `'sm' \| 'lg'` | `undefined` | Control size (native control only). |
|
|
18
|
+
| `validationState` | `'valid' \| 'invalid' \| null` | `null` | Validation state; adds `is-valid`/`is-invalid` and renders the feedback text. In `dragDrop` mode, `'invalid'` also colors the drop-zone border. |
|
|
19
|
+
| `validationMessage` | `string` | `undefined` | Feedback text shown for the current validation state. Errors render with `role="alert"` so screen readers announce them (WCAG 4.1.3). |
|
|
18
20
|
| `helpText` | `string` | `undefined` | Help text below the input. |
|
|
19
21
|
| `dropzoneText` | `string` | `'Drag files here or click to browse'` | Text shown inside the drop zone. |
|
|
20
22
|
|
|
@@ -65,9 +67,10 @@ const files = ref<File[]>([])
|
|
|
65
67
|
<script setup lang="ts">
|
|
66
68
|
import { ref } from 'vue'
|
|
67
69
|
const files = ref<File[]>([])
|
|
70
|
+
const error = ref<string | null>(null)
|
|
68
71
|
|
|
69
72
|
const onInvalid = (rejected: File[]) => {
|
|
70
|
-
|
|
73
|
+
error.value = `Rejected: ${rejected.map((f) => f.name).join(', ')}`
|
|
71
74
|
}
|
|
72
75
|
</script>
|
|
73
76
|
|
|
@@ -78,7 +81,10 @@ const onInvalid = (rejected: File[]) => {
|
|
|
78
81
|
drag-drop
|
|
79
82
|
accept="image/*"
|
|
80
83
|
:max-size="2 * 1024 * 1024"
|
|
84
|
+
:validation-state="error ? 'invalid' : null"
|
|
85
|
+
:validation-message="error ?? undefined"
|
|
81
86
|
@invalid="onInvalid"
|
|
87
|
+
@change="error = null"
|
|
82
88
|
/>
|
|
83
89
|
</template>
|
|
84
90
|
```
|
|
@@ -91,7 +97,7 @@ const onInvalid = (rejected: File[]) => {
|
|
|
91
97
|
|
|
92
98
|
## Bootstrap CSS Classes
|
|
93
99
|
|
|
94
|
-
- `.form-control`, `.form-control-{sm|lg}`
|
|
95
|
-
- `.form-label`, `.form-text`
|
|
100
|
+
- `.form-control`, `.form-control-{sm|lg}`, `.is-valid`, `.is-invalid`
|
|
101
|
+
- `.form-label`, `.form-text`, `.valid-feedback`, `.invalid-feedback`
|
|
96
102
|
|
|
97
103
|
The drop zone uses VibeUI's own `.vibe-file-input-dropzone*` classes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velkymx/vibeui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "A lightweight Vue 3 component library for Bootstrap 5.3 with dual-mode support (shorthand props and composable slots)",
|
|
5
5
|
"main": "./dist/vibeui.umd.js",
|
|
6
6
|
"module": "./dist/vibeui.es.js",
|