@bridge-ui/vue 0.12.0 → 0.13.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/ai/skills/bridge-ui-components/SKILL.md +2 -1
- package/dist/Adapters/Examples/date-moment.js +31 -31
- package/dist/Adapters/Examples/i18n-dictionary.js +14 -0
- package/dist/Adapters/Examples/icon-fontawesome.js +23 -22
- package/dist/Adapters/Examples/icon-heroicons.js +46 -45
- package/dist/Adapters/Examples/icon-lucide.js +12 -11
- package/dist/Adapters/Examples/icon-phosphor.js +48 -47
- package/dist/Adapters/Examples/icon-tabler.js +12 -11
- package/dist/Components/BaseField/composables/useBaseField.d.ts +3 -3
- package/dist/Components/BaseField/composables/useBaseField.js +7 -7
- package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/Components/Carousel/Carousel.js +5 -0
- package/dist/Components/Carousel/Carousel.vue.d.ts +22 -0
- package/dist/Components/Carousel/Carousel.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/Components/Carousel/carousel.types.d.ts +236 -0
- package/dist/Components/Carousel/carouselInjectionKey.d.ts +48 -0
- package/dist/Components/Carousel/carouselInjectionKey.js +4 -0
- package/dist/Components/Carousel/composables/useCarousel.d.ts +91 -0
- package/dist/Components/Carousel/composables/useCarousel.js +331 -0
- package/dist/Components/Carousel/index.d.ts +4 -0
- package/dist/Components/Carousel/index.js +4 -0
- package/dist/Components/CarouselSlide/CarouselSlide.js +5 -0
- package/dist/Components/CarouselSlide/CarouselSlide.vue.d.ts +11 -0
- package/dist/Components/CarouselSlide/CarouselSlide.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/Components/CarouselSlide/carouselSlide.types.d.ts +40 -0
- package/dist/Components/CarouselSlide/composables/useCarouselSlide.d.ts +205 -0
- package/dist/Components/CarouselSlide/composables/useCarouselSlide.js +79 -0
- package/dist/Components/CarouselSlide/index.d.ts +3 -0
- package/dist/Components/CarouselSlide/index.js +3 -0
- package/dist/Components/FileUpload/FileUpload.vue.d.ts +22 -24
- package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +101 -92
- package/dist/Components/FileUpload/composables/useFileUpload.d.ts +66 -16
- package/dist/Components/FileUpload/composables/useFileUpload.js +182 -157
- package/dist/Components/FileUpload/fileUpload.types.d.ts +113 -23
- package/dist/Components/FileUpload/fileUploadInjectionKey.d.ts +61 -0
- package/dist/Components/FileUpload/fileUploadInjectionKey.js +4 -0
- package/dist/Components/FileUpload/index.d.ts +1 -1
- package/dist/Components/FileUploadItem/FileUploadItem.js +5 -0
- package/dist/Components/FileUploadItem/FileUploadItem.vue.d.ts +12 -0
- package/dist/Components/FileUploadItem/FileUploadItem.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/Components/FileUploadItem/composables/useFileUploadItem.d.ts +1153 -0
- package/dist/Components/FileUploadItem/composables/useFileUploadItem.js +94 -0
- package/dist/Components/FileUploadItem/fileUploadItem.types.d.ts +20 -0
- package/dist/Components/FileUploadItem/index.d.ts +3 -0
- package/dist/Components/FileUploadItem/index.js +3 -0
- package/dist/Components/Pagination/composables/usePagination.d.ts +1 -1
- package/dist/Components/Sidebar/composables/useSidebarTrigger.d.ts +1 -1
- package/dist/augments.d.ts +10 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +115 -109
- package/docs/README.md +1 -0
- package/docs/components/Carousel.md +113 -0
- package/docs/components/FileUpload.md +83 -8
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# FileUpload
|
|
2
2
|
|
|
3
|
-
File selection with an optional drag-and-drop surface (`variant="dropzone"`).
|
|
3
|
+
File selection with an optional drag-and-drop surface (`variant="dropzone"`). Without `multiple`, `v-model` is one item or `null`. With `multiple`, it is a list. Each item is a browser `File`, or `{ name, size?, type?, url?, file?, state?, progress?, description? }`. Bridge does not upload. Write `state` on the object when your app is uploading.
|
|
4
4
|
|
|
5
5
|
Selected files always render as the same attachment-style cards whether you pick one file or many — there is no FormField input shell for the single-file case. Optional `label` / `description` / `error` sit above or below as flat chrome.
|
|
6
6
|
|
|
@@ -8,6 +8,7 @@ Selected files always render as the same attachment-style cards whether you pick
|
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
10
|
import { FileUpload } from "@bridge-ui/vue/Components/FileUpload";
|
|
11
|
+
import { FileUploadItem } from "@bridge-ui/vue/Components/FileUploadItem";
|
|
11
12
|
```
|
|
12
13
|
|
|
13
14
|
## Examples
|
|
@@ -16,7 +17,7 @@ import { FileUpload } from "@bridge-ui/vue/Components/FileUpload";
|
|
|
16
17
|
|
|
17
18
|
```vue
|
|
18
19
|
<FileUpload
|
|
19
|
-
v-model="
|
|
20
|
+
v-model="file"
|
|
20
21
|
label="Attachments"
|
|
21
22
|
accept="image/*,.pdf"
|
|
22
23
|
description="PDF or images up to 5 MB."
|
|
@@ -28,11 +29,13 @@ import { FileUpload } from "@bridge-ui/vue/Components/FileUpload";
|
|
|
28
29
|
Once a file is chosen, the trigger hides and the selection shows as one attachment card (media, name, type · size, remove).
|
|
29
30
|
|
|
30
31
|
```vue
|
|
31
|
-
<FileUpload v-model="
|
|
32
|
+
<FileUpload v-model="file" />
|
|
32
33
|
```
|
|
33
34
|
|
|
34
35
|
### Color
|
|
35
36
|
|
|
37
|
+
`color` styles the trigger, the remove button, and the dropzone highlight while a file is dragged over it. A registry default applies when the prop is omitted.
|
|
38
|
+
|
|
36
39
|
```vue
|
|
37
40
|
<FileUpload color="secondary" label="Attachments" />
|
|
38
41
|
```
|
|
@@ -94,6 +97,75 @@ createBridgeUI({
|
|
|
94
97
|
/>
|
|
95
98
|
```
|
|
96
99
|
|
|
100
|
+
### Value
|
|
101
|
+
|
|
102
|
+
Without `multiple`, `v-model` is `null | FileUploadValue`. With `multiple`, it is `FileUploadValue[]`. `accept` and `maxSize` apply only to a `File` that was just picked or dropped. Remote items still count toward `maxFiles`. `remove` emits the item and its index.
|
|
103
|
+
|
|
104
|
+
```vue
|
|
105
|
+
<FileUpload multiple v-model="attachments" />
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### List slot
|
|
109
|
+
|
|
110
|
+
When the `list` slot is set, FileUpload does not render the default list. `items` follows the model order. Write the reordered array back to `v-model`. Use `FileUploadItem` to keep the default card. `start` sits before the file media (a drag handle). `end` replaces the remove button.
|
|
111
|
+
|
|
112
|
+
The `start` and `end` slots on `FileUpload` do the same thing for the default list.
|
|
113
|
+
|
|
114
|
+
```vue
|
|
115
|
+
<FileUpload multiple v-model="attachments">
|
|
116
|
+
<template #list="{ items }">
|
|
117
|
+
<ul>
|
|
118
|
+
<FileUploadItem v-for="item in items" v-bind="item" :key="item.index">
|
|
119
|
+
<template #start>
|
|
120
|
+
<span aria-hidden="true">⋮⋮</span>
|
|
121
|
+
</template>
|
|
122
|
+
|
|
123
|
+
<template #end>
|
|
124
|
+
<button type="button" v-on:click="item.remove">Remove</button>
|
|
125
|
+
</template>
|
|
126
|
+
</FileUploadItem>
|
|
127
|
+
</ul>
|
|
128
|
+
</template>
|
|
129
|
+
</FileUpload>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Size
|
|
133
|
+
|
|
134
|
+
`xs` hides the default type · size line. `sm`, `md`, and `lg` keep it and scale the card and the dropzone. `md` is the default.
|
|
135
|
+
|
|
136
|
+
```vue
|
|
137
|
+
<FileUpload size="xs" label="Attachments" />
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Orientation
|
|
141
|
+
|
|
142
|
+
`horizontal` places the media beside the name and stacks cards. `vertical` puts the media above the name and lays cards in a row. A card can override the field with its own `orientation` inside the `list` slot.
|
|
143
|
+
|
|
144
|
+
```vue
|
|
145
|
+
<FileUpload multiple v-model="files" orientation="vertical" />
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Upload state
|
|
149
|
+
|
|
150
|
+
Leave `state` unset for the type · size card. Set it on the attachment object while your app uploads. `description` on the attachment, or on `FileUploadItem`, replaces that line — including state copy such as "Uploading" or "Upload failed. Try again." `null` or `""` hides the line at every size, including `xs` while `state` is set. `progress` (0–100) is shown for `uploading`. Listen for `retry` to show a retry button when `state` is `error`.
|
|
151
|
+
|
|
152
|
+
| `state` | Meta line |
|
|
153
|
+
| ------------ | ------------------------- |
|
|
154
|
+
| `idle` | Ready to upload |
|
|
155
|
+
| `uploading` | Uploading · 64% |
|
|
156
|
+
| `processing` | Processing document |
|
|
157
|
+
| `error` | Upload failed. Try again. |
|
|
158
|
+
| `done` | Uploaded · 1.8 MB |
|
|
159
|
+
|
|
160
|
+
```vue
|
|
161
|
+
<FileUpload
|
|
162
|
+
v-on:retry="retryUpload"
|
|
163
|
+
:model-value="{ name: 'report.pdf', progress: 64, state: 'uploading' }"
|
|
164
|
+
/>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
A local `File` cannot carry `state`. Replace it with `{ file, name, size, type, state: "uploading", progress: 0 }` while the upload runs.
|
|
168
|
+
|
|
97
169
|
### customProps
|
|
98
170
|
|
|
99
171
|
```vue
|
|
@@ -111,11 +183,14 @@ createBridgeUI({
|
|
|
111
183
|
|
|
112
184
|
### v-model
|
|
113
185
|
|
|
114
|
-
| Prop / Event | Type
|
|
115
|
-
| ------------------- |
|
|
116
|
-
| `modelValue` | `
|
|
117
|
-
| `update:modelValue` | `(
|
|
118
|
-
| `remove` | `(
|
|
186
|
+
| Prop / Event | Type | Default | Description |
|
|
187
|
+
| ------------------- | ------------------------------------------------ | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
188
|
+
| `modelValue` | `null \| FileUploadValue` or `FileUploadValue[]` | — | One item when `multiple` is false, a list when it is true. A `File` or `{ name, size?, type?, url?, file?, state?, progress?, description? }`. |
|
|
189
|
+
| `update:modelValue` | `(value) => void` | — | Emitted when `v-model` should update. Listen with `v-on:update:model-value`. |
|
|
190
|
+
| `remove` | `(value, index) => void` | — | Emitted with the removed item and its index. |
|
|
191
|
+
| `retry` | `(value, index) => void` | — | Emitted from the retry button when `state` is `error`. |
|
|
192
|
+
| `orientation` | `"horizontal" \| "vertical"` | `horizontal` | Media beside the name, or stacked above it. |
|
|
193
|
+
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | `md` | `xs` hides the default type · size line. |
|
|
119
194
|
|
|
120
195
|
## Related components
|
|
121
196
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.13.0",
|
|
5
5
|
"author": "BridgeUI",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"name": "@bridge-ui/vue",
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
175
|
"dependencies": {
|
|
176
|
-
"@bridge-ui/core": "^0.
|
|
176
|
+
"@bridge-ui/core": "^0.13.0",
|
|
177
177
|
"@tailwindcss/typography": "^0.5.20",
|
|
178
178
|
"clsx": "^2.1.1",
|
|
179
179
|
"es-toolkit": "^1.52.0",
|