@bridge-ui/vue 0.11.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 +53 -40
- package/dist/Adapters/Examples/icon-heroicons.js +46 -33
- package/dist/Adapters/Examples/icon-lucide.js +47 -34
- package/dist/Adapters/Examples/icon-phosphor.js +48 -35
- package/dist/Adapters/Examples/icon-tabler.js +45 -32
- package/dist/Adapters/Examples/rich-text-tiptap.d.ts +5 -0
- package/dist/Adapters/Examples/rich-text-tiptap.js +138 -0
- package/dist/Adapters/RichText/index.d.ts +1 -0
- package/dist/Adapters/RichText/index.js +2 -0
- package/dist/Adapters/RichText/mockRichTextAdapter.d.ts +5 -0
- package/dist/Adapters/RichText/useRichTextAdapter.d.ts +12 -0
- package/dist/Adapters/RichText/useRichTextAdapter.js +13 -0
- package/dist/Adapters/index.d.ts +1 -0
- package/dist/Adapters/index.js +2 -1
- package/dist/Components/ActionFooter/composables/useActionFooter.d.ts +6 -6
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +2 -2
- package/dist/Components/BaseField/composables/useBaseField.d.ts +3 -3
- package/dist/Components/BaseField/composables/useBaseField.js +7 -7
- package/dist/Components/Breadcrumb/Breadcrumb.vue.d.ts +17 -10
- package/dist/Components/Breadcrumb/Breadcrumb.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/Components/Breadcrumb/breadcrumb.types.d.ts +22 -4
- package/dist/Components/Breadcrumb/breadcrumbInjectionKey.d.ts +5 -1
- package/dist/Components/Breadcrumb/composables/useBreadcrumb.d.ts +6 -5
- package/dist/Components/Breadcrumb/composables/useBreadcrumb.js +2 -0
- package/dist/Components/BreadcrumbItem/BreadcrumbItem.vue.d.ts +17 -11
- package/dist/Components/BreadcrumbItem/BreadcrumbItem.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/BreadcrumbItem/breadcrumbItem.types.d.ts +21 -3
- package/dist/Components/BreadcrumbItem/composables/useBreadcrumbItem.d.ts +10 -6
- package/dist/Components/BreadcrumbItem/composables/useBreadcrumbItem.js +65 -59
- package/dist/Components/Button/Button.vue.d.ts +17 -8
- package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +10 -10
- package/dist/Components/Button/button.types.d.ts +22 -5
- package/dist/Components/Button/composables/useButton.d.ts +198 -8
- package/dist/Components/Button/composables/useButton.js +101 -86
- 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/ColorPicker/composables/useColorPicker.js +1 -1
- package/dist/Components/DataTable/DataTable.vue.d.ts +1 -1
- package/dist/Components/DataTable/composables/useDataTable.d.ts +1 -1
- package/dist/Components/DataTable/composables/useDataTable.js +288 -282
- package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
- package/dist/Components/Drawer/composables/useDrawer.js +2 -2
- package/dist/Components/FileUpload/FileUpload.js +5 -0
- package/dist/Components/FileUpload/FileUpload.vue.d.ts +26 -0
- package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +141 -0
- package/dist/Components/FileUpload/composables/useFileUpload.d.ts +120 -0
- package/dist/Components/FileUpload/composables/useFileUpload.js +235 -0
- package/dist/Components/FileUpload/fileUpload.types.d.ts +396 -0
- package/dist/Components/FileUpload/fileUploadInjectionKey.d.ts +61 -0
- package/dist/Components/FileUpload/fileUploadInjectionKey.js +4 -0
- package/dist/Components/FileUpload/index.d.ts +3 -0
- package/dist/Components/FileUpload/index.js +3 -0
- 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/FormField/composables/useFormField.d.ts +1 -1
- package/dist/Components/Link/Link.vue.d.ts +17 -8
- package/dist/Components/Link/Link.vue_vue_type_script_setup_true_lang.js +30 -25
- package/dist/Components/Link/composables/useLink.d.ts +8 -6
- package/dist/Components/Link/composables/useLink.js +52 -45
- package/dist/Components/Link/link.types.d.ts +21 -4
- package/dist/Components/ListItem/ListItem.vue.d.ts +17 -15
- package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/ListItem/composables/useListItem.d.ts +7 -6
- package/dist/Components/ListItem/composables/useListItem.js +108 -105
- package/dist/Components/ListItem/listItem.types.d.ts +19 -3
- package/dist/Components/Listbox/composables/useListbox.d.ts +2 -2
- package/dist/Components/Menu/composables/useMenu.js +6 -6
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/Modal/composables/useModal.js +2 -2
- package/dist/Components/Pagination/composables/usePagination.d.ts +1 -1
- package/dist/Components/RichTextEditor/RichTextEditor.js +5 -0
- package/dist/Components/RichTextEditor/RichTextEditor.vue.d.ts +23 -0
- package/dist/Components/RichTextEditor/RichTextEditor.vue_vue_type_script_setup_true_lang.js +104 -0
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.d.ts +488 -0
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.js +226 -0
- package/dist/Components/RichTextEditor/index.d.ts +3 -0
- package/dist/Components/RichTextEditor/index.js +3 -0
- package/dist/Components/RichTextEditor/richTextEditor.types.d.ts +103 -0
- package/dist/Components/Select/composables/useSelect.js +2 -2
- package/dist/Components/Sidebar/SidebarListItem.vue.d.ts +17 -9
- package/dist/Components/Sidebar/SidebarListItem.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/Sidebar/composables/useSidebarListItem.js +1 -1
- package/dist/Components/Sidebar/composables/useSidebarTrigger.d.ts +1 -1
- package/dist/Components/Sidebar/sidebar.types.d.ts +2 -1
- package/dist/Components/Snackbar/composables/useSnackbar.js +1 -1
- package/dist/Components/Textarea/composables/useTextarea.js +1 -1
- package/dist/Components/Tooltip/composables/useTooltip.js +3 -3
- package/dist/Utils/linkAs.d.ts +29 -0
- package/dist/Utils/linkAs.js +18 -0
- package/dist/augments.d.ts +19 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +181 -170
- package/dist/theme.css +3 -0
- package/docs/README.md +4 -0
- package/docs/components/Breadcrumb.md +16 -0
- package/docs/components/BridgeUIProvider.md +18 -1
- package/docs/components/Button.md +31 -19
- package/docs/components/Carousel.md +113 -0
- package/docs/components/DataTable.md +1 -1
- package/docs/components/FileUpload.md +197 -0
- package/docs/components/Link.md +28 -12
- package/docs/components/List.md +21 -19
- package/docs/components/RichTextEditor.md +88 -0
- package/docs/components/Sidebar.md +1 -1
- package/package.json +54 -18
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Carousel
|
|
2
|
+
|
|
3
|
+
Slideshow region. Previous and next sit beside the viewport (above and below when vertical), with optional dot indicators, keyboard, and swipe. Slide content stays in the app (`CarouselSlide`).
|
|
4
|
+
|
|
5
|
+
One slide fills the viewport by default. `slidesPerView` shows more than one, including a fraction that peeks the next slide. `orientation` switches the scroll axis. `gap` is the space between slides, in px.
|
|
6
|
+
|
|
7
|
+
Auto-advance pauses while the pointer is over the carousel, while focus is inside it, and when the user prefers reduced motion.
|
|
8
|
+
|
|
9
|
+
## Import
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { Carousel } from "@bridge-ui/vue/Components/Carousel";
|
|
13
|
+
import { CarouselSlide } from "@bridge-ui/vue/Components/CarouselSlide";
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Examples
|
|
17
|
+
|
|
18
|
+
### Usage
|
|
19
|
+
|
|
20
|
+
```vue
|
|
21
|
+
<Carousel aria-label="Product photos">
|
|
22
|
+
<CarouselSlide>
|
|
23
|
+
<img alt="Front" src="/photos/1.jpg" />
|
|
24
|
+
</CarouselSlide>
|
|
25
|
+
<CarouselSlide>
|
|
26
|
+
<img alt="Side" src="/photos/2.jpg" />
|
|
27
|
+
</CarouselSlide>
|
|
28
|
+
</Carousel>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Controlled index
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<Carousel loop v-model:index="index" aria-label="Highlights">
|
|
35
|
+
<CarouselSlide v-for="slide in slides" :key="slide.id">
|
|
36
|
+
{{ slide.content }}
|
|
37
|
+
</CarouselSlide>
|
|
38
|
+
</Carousel>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Auto-play
|
|
42
|
+
|
|
43
|
+
`auto-play` accepts `true` (5 seconds) or an interval in milliseconds.
|
|
44
|
+
|
|
45
|
+
```vue
|
|
46
|
+
<Carousel loop :auto-play="4000" aria-label="Highlights">
|
|
47
|
+
<CarouselSlide>One</CarouselSlide>
|
|
48
|
+
<CarouselSlide>Two</CarouselSlide>
|
|
49
|
+
</Carousel>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Without indicators
|
|
53
|
+
|
|
54
|
+
```vue
|
|
55
|
+
<Carousel aria-label="Photos" :indicators="false">
|
|
56
|
+
<CarouselSlide>One</CarouselSlide>
|
|
57
|
+
<CarouselSlide>Two</CarouselSlide>
|
|
58
|
+
</Carousel>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Slots
|
|
62
|
+
|
|
63
|
+
```vue
|
|
64
|
+
<Carousel aria-label="Photos">
|
|
65
|
+
<CarouselSlide>One</CarouselSlide>
|
|
66
|
+
<CarouselSlide>Two</CarouselSlide>
|
|
67
|
+
|
|
68
|
+
<template #prev>Back</template>
|
|
69
|
+
<template #next>Forward</template>
|
|
70
|
+
</Carousel>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Several slides
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<Carousel :gap="16" :slides-per-view="3" aria-label="Products">
|
|
77
|
+
<CarouselSlide>One</CarouselSlide>
|
|
78
|
+
<CarouselSlide>Two</CarouselSlide>
|
|
79
|
+
<CarouselSlide>Three</CarouselSlide>
|
|
80
|
+
</Carousel>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Each dot is a snap, not a slide. Five slides with `:slides-per-view="3"` show three dots. When every slide fits, the dots stay hidden.
|
|
84
|
+
|
|
85
|
+
### Vertical
|
|
86
|
+
|
|
87
|
+
Set a height on the region when the slides should not use the default viewport height.
|
|
88
|
+
|
|
89
|
+
```vue
|
|
90
|
+
<Carousel class="h-96" aria-label="Stories" orientation="vertical">
|
|
91
|
+
<CarouselSlide>One</CarouselSlide>
|
|
92
|
+
<CarouselSlide>Two</CarouselSlide>
|
|
93
|
+
</Carousel>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Right to left
|
|
97
|
+
|
|
98
|
+
`dir="rtl"` flips the horizontal axis: arrow keys, swipe, and the track. The chevrons rotate with the direction.
|
|
99
|
+
|
|
100
|
+
```vue
|
|
101
|
+
<Carousel loop dir="rtl" aria-label="Photos">
|
|
102
|
+
<CarouselSlide>One</CarouselSlide>
|
|
103
|
+
<CarouselSlide>Two</CarouselSlide>
|
|
104
|
+
</Carousel>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Keyboard and touch
|
|
108
|
+
|
|
109
|
+
- Horizontal: `ArrowLeft` / `ArrowRight`. Vertical: `ArrowUp` / `ArrowDown`. `dir="rtl"` swaps the horizontal arrows
|
|
110
|
+
- `Home` / `End` jump to the first and last snap
|
|
111
|
+
- A swipe along the scroll axis moves one snap. The cross-axis is left to the page
|
|
112
|
+
- `loop` wraps the ends. Without it, the edge control is disabled
|
|
113
|
+
- With `slidesPerView` above `1`, next stops once the last slides fill the viewport
|
|
@@ -153,7 +153,7 @@ Empty rows render `EmptyState` at the table `size`, with the semantic `inbox` ic
|
|
|
153
153
|
/>
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
Install `@tanstack/vue-table` next to `@bridge-ui/vue` when you use `DataTable`. The public API stays `columns` / `rows` / `sorting` / `selection` / `filters` / `columnSearch` / `hiddenColumns` / `search` / `expanded` — the table engine is not exported.
|
|
156
|
+
Install `@tanstack/vue-table` v9 next to `@bridge-ui/vue` when you use `DataTable`. The public API stays `columns` / `rows` / `sorting` / `selection` / `filters` / `columnSearch` / `hiddenColumns` / `search` / `expanded` — the table engine is not exported.
|
|
157
157
|
|
|
158
158
|
### Columns
|
|
159
159
|
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# FileUpload
|
|
2
|
+
|
|
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
|
+
|
|
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
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { FileUpload } from "@bridge-ui/vue/Components/FileUpload";
|
|
11
|
+
import { FileUploadItem } from "@bridge-ui/vue/Components/FileUploadItem";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Examples
|
|
15
|
+
|
|
16
|
+
### Usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<FileUpload
|
|
20
|
+
v-model="file"
|
|
21
|
+
label="Attachments"
|
|
22
|
+
accept="image/*,.pdf"
|
|
23
|
+
description="PDF or images up to 5 MB."
|
|
24
|
+
/>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Single file card
|
|
28
|
+
|
|
29
|
+
Once a file is chosen, the trigger hides and the selection shows as one attachment card (media, name, type · size, remove).
|
|
30
|
+
|
|
31
|
+
```vue
|
|
32
|
+
<FileUpload v-model="file" />
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Color
|
|
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
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<FileUpload color="secondary" label="Attachments" />
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Theme default via registry:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
createBridgeUI({
|
|
47
|
+
components: {
|
|
48
|
+
FileUpload: {
|
|
49
|
+
defaultProps: { color: "secondary" },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Rounded
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<FileUpload rounded="xl" label="Attachments" />
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Shared with other form controls via `global.formDefaults`:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
createBridgeUI({
|
|
65
|
+
global: {
|
|
66
|
+
formDefaults: { size: "lg", rounded: "md" },
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Dropzone
|
|
72
|
+
|
|
73
|
+
```vue
|
|
74
|
+
<FileUpload
|
|
75
|
+
multiple
|
|
76
|
+
v-model="files"
|
|
77
|
+
accept="image/*"
|
|
78
|
+
variant="dropzone"
|
|
79
|
+
title="Drop images here"
|
|
80
|
+
description="or click to browse"
|
|
81
|
+
/>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Multiple
|
|
85
|
+
|
|
86
|
+
```vue
|
|
87
|
+
<FileUpload multiple v-model="files" :max-files="5" button-label="Add files" />
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Validation
|
|
91
|
+
|
|
92
|
+
```vue
|
|
93
|
+
<FileUpload
|
|
94
|
+
accept="image/*"
|
|
95
|
+
:max-size="5 * 1024 * 1024"
|
|
96
|
+
description="Images up to 5 MB."
|
|
97
|
+
/>
|
|
98
|
+
```
|
|
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
|
+
|
|
169
|
+
### customProps
|
|
170
|
+
|
|
171
|
+
```vue
|
|
172
|
+
<FileUpload
|
|
173
|
+
variant="dropzone"
|
|
174
|
+
title="Drop files"
|
|
175
|
+
:custom-props="{
|
|
176
|
+
list: { id: 'uploads' },
|
|
177
|
+
dropzone: { 'data-testid': 'dropzone' },
|
|
178
|
+
}"
|
|
179
|
+
/>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Props
|
|
183
|
+
|
|
184
|
+
### v-model
|
|
185
|
+
|
|
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. |
|
|
194
|
+
|
|
195
|
+
## Related components
|
|
196
|
+
|
|
197
|
+
Button, EmptyState
|
package/docs/components/Link.md
CHANGED
|
@@ -36,6 +36,20 @@ import { Link } from "@bridge-ui/vue/Components/Link";
|
|
|
36
36
|
</Link>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
### Router link
|
|
40
|
+
|
|
41
|
+
`link-as` replaces the `<a>`. `href` is forwarded, and when `link-as` is set it also accepts that component's `href`. `link-props` is checked against `link-as` and forwarded to it (`method`, `replace`, `prefetch`, and so on). The component handles the click.
|
|
42
|
+
|
|
43
|
+
```vue
|
|
44
|
+
<Link
|
|
45
|
+
href="/logout"
|
|
46
|
+
:link-as="AppLink"
|
|
47
|
+
:link-props="{ method: 'post', replace: true }"
|
|
48
|
+
>
|
|
49
|
+
Logout
|
|
50
|
+
</Link>
|
|
51
|
+
```
|
|
52
|
+
|
|
39
53
|
### customProps
|
|
40
54
|
|
|
41
55
|
```vue
|
|
@@ -53,18 +67,20 @@ import { Link } from "@bridge-ui/vue/Components/Link";
|
|
|
53
67
|
|
|
54
68
|
## Props
|
|
55
69
|
|
|
56
|
-
| Prop | Type
|
|
57
|
-
| ------------- |
|
|
58
|
-
| `classes` | `LinkClasses`
|
|
59
|
-
| `color` | `LinkColor`
|
|
60
|
-
| `customProps` | `LinkCustomProps`
|
|
61
|
-
| `disabled` | `boolean`
|
|
62
|
-
| `external` | `boolean`
|
|
63
|
-
| `href` | `string`
|
|
64
|
-
| `leftIcon` | `LucideIcon`
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
70
|
+
| Prop | Type | Default | Description |
|
|
71
|
+
| ------------- | --------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
72
|
+
| `classes` | `LinkClasses` | — | The classes to apply to the link. |
|
|
73
|
+
| `color` | `LinkColor` | "primary" | The color to apply to the link. |
|
|
74
|
+
| `customProps` | `LinkCustomProps` | — | Extra props for internal parts (`leftIcon`, `rightIcon`, etc.). Root HTML attributes stay on the component top level. |
|
|
75
|
+
| `disabled` | `boolean` | `false` | Whether the link is disabled. |
|
|
76
|
+
| `external` | `boolean` | `false` | Whether the link opens in a new tab. |
|
|
77
|
+
| `href` | `string` | — | The URL the link points to. When `linkAs` is set, this also accepts that component's `href`. |
|
|
78
|
+
| `leftIcon` | `LucideIcon` | — | The icon to display before the link text. |
|
|
79
|
+
| `linkAs` | `string \| Component` | — | Component rendered in place of the navigating `<a>`. Receives `href`, `linkProps`, and the anchor attributes. Ignored while disabled. |
|
|
80
|
+
| `linkProps` | props of `linkAs` | — | Props forwarded to `linkAs`. Checked against that component. Ignored while `linkAs` is not rendered. |
|
|
81
|
+
| `rightIcon` | `LucideIcon` | — | The icon to display after the link text. |
|
|
82
|
+
| `size` | `LinkSize` | "md" | The size of the link. |
|
|
83
|
+
| `underline` | `LinkUnderline` | "hover" | The underline behavior of the link. |
|
|
68
84
|
|
|
69
85
|
## Related components
|
|
70
86
|
|
package/docs/components/List.md
CHANGED
|
@@ -83,7 +83,7 @@ Selected rows show a check icon by default. Customize it with `selectedIcon` on
|
|
|
83
83
|
|
|
84
84
|
### Link
|
|
85
85
|
|
|
86
|
-
Set `href` to render the row as an anchor. The browser shows the URL on hover, and middle-click opens a new tab. `target` and `rel` are forwarded to that anchor. A disabled item keeps the styles but drops the URL.
|
|
86
|
+
Set `href` to render the row as an anchor. The browser shows the URL on hover, and middle-click opens a new tab. `target` and `rel` are forwarded to that anchor. `link-as` replaces that anchor. `link-props` is checked against `link-as` and forwarded to it. A disabled item keeps the styles but drops the URL.
|
|
87
87
|
|
|
88
88
|
```vue
|
|
89
89
|
<List>
|
|
@@ -147,24 +147,26 @@ With the default `as="li"`, sticky styles apply on the section root. The list (o
|
|
|
147
147
|
|
|
148
148
|
## Props (`ListItem`)
|
|
149
149
|
|
|
150
|
-
| Prop | Type | Default | Description
|
|
151
|
-
| -------------- | ------------------------------------ | -------- |
|
|
152
|
-
| `as` | `"div" \| "li"` | "li" | The element to render as.
|
|
153
|
-
| `classes` | `ListItemClasses` | — | The classes to apply to the item.
|
|
154
|
-
| `customProps` | `ListItemCustomProps` | — | Props forwarded to each item part.
|
|
155
|
-
| `dense` | `boolean` | — | Compact vertical padding. Inherits `dense` from parent `List` when omitted.
|
|
156
|
-
| `disabled` | `boolean` | `false` | When true, the item is not interactive and appears muted.
|
|
157
|
-
| `divider` | `boolean` | `false` | When true, renders a bottom divider on the item.
|
|
158
|
-
| `href` | `string` | — | URL for the interactive wrapper. Renders an anchor so hover shows the address and middle-click opens a new tab.
|
|
159
|
-
| `interactive` | `boolean` | `false` | When true, applies hover/focus styles and `tabIndex={0}` on the inner wrapper. Implied when `href` is set.
|
|
160
|
-
| `
|
|
161
|
-
| `
|
|
162
|
-
| `
|
|
163
|
-
| `
|
|
164
|
-
| `
|
|
165
|
-
| `
|
|
166
|
-
| `
|
|
167
|
-
| `
|
|
150
|
+
| Prop | Type | Default | Description |
|
|
151
|
+
| -------------- | ------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
152
|
+
| `as` | `"div" \| "li"` | "li" | The element to render as. |
|
|
153
|
+
| `classes` | `ListItemClasses` | — | The classes to apply to the item. |
|
|
154
|
+
| `customProps` | `ListItemCustomProps` | — | Props forwarded to each item part. |
|
|
155
|
+
| `dense` | `boolean` | — | Compact vertical padding. Inherits `dense` from parent `List` when omitted. |
|
|
156
|
+
| `disabled` | `boolean` | `false` | When true, the item is not interactive and appears muted. |
|
|
157
|
+
| `divider` | `boolean` | `false` | When true, renders a bottom divider on the item. |
|
|
158
|
+
| `href` | `string` | — | URL for the interactive wrapper. Renders an anchor so hover shows the address and middle-click opens a new tab. |
|
|
159
|
+
| `interactive` | `boolean` | `false` | When true, applies hover/focus styles and `tabIndex={0}` on the inner wrapper. Implied when `href` is set. |
|
|
160
|
+
| `linkAs` | `string \| Component` | — | Component rendered in place of the interactive `<a>`. The root stays `as` (`li` or `div`). Ignored while disabled. |
|
|
161
|
+
| `linkProps` | props of `linkAs` | — | Props forwarded to `linkAs`. Checked against that component. Ignored while `linkAs` is not rendered. |
|
|
162
|
+
| `primary` | `string` | — | Primary label text. |
|
|
163
|
+
| `rel` | `string` | — | Relationship of the linked URL. Forwarded to the anchor when `href` is set. |
|
|
164
|
+
| `role` | `"button" \| "menuitem" \| "option"` | "button" | ARIA role for the interactive wrapper. Omitted when `href` is set. |
|
|
165
|
+
| `secondary` | `string` | — | Secondary/description text below the primary line. |
|
|
166
|
+
| `selected` | `boolean` | `false` | When true, highlights the item as selected. |
|
|
167
|
+
| `selectedIcon` | `null \| LucideIcon` | `Check` | Icon shown when `selected` is true. Use `null` to hide it. Replaced by `#end`. |
|
|
168
|
+
| `target` | `string` | — | Where to open the URL. Forwarded to the anchor when `href` is set. |
|
|
169
|
+
| `value` | `ListboxValue` | — | When set inside a `Select` / `Listbox`, registers this row as a selectable option. |
|
|
168
170
|
|
|
169
171
|
## Props (`ListSection`)
|
|
170
172
|
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# RichTextEditor
|
|
2
|
+
|
|
3
|
+
Formatted text input with FormField chrome and a pluggable editing engine. Bridge owns the toolbar, tokens, and a11y; the document engine comes from `global.richText` (no native default).
|
|
4
|
+
|
|
5
|
+
Sanitize HTML before rendering it outside the editor — XSS prevention stays in the app.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { RichTextEditor } from "@bridge-ui/vue/Components/RichTextEditor";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Adapter
|
|
14
|
+
|
|
15
|
+
Provide `global.richText` on `BridgeUIProvider`. Ready adapter:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { BridgeUIProvider } from "@bridge-ui/vue";
|
|
19
|
+
import { createTiptapRichTextAdapter } from "@bridge-ui/vue/Adapters/Examples/rich-text-tiptap";
|
|
20
|
+
|
|
21
|
+
const richText = createTiptapRichTextAdapter();
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```vue
|
|
25
|
+
<BridgeUIProvider :global="{ richText }">
|
|
26
|
+
<App />
|
|
27
|
+
</BridgeUIProvider>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
| Adapter | Peer(s) | Notes |
|
|
31
|
+
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
|
|
32
|
+
| `Adapters/Examples/rich-text-tiptap` | `@tiptap/core`, `@tiptap/pm`, `@tiptap/starter-kit`, `@tiptap/extension-placeholder`, `@tiptap/extension-underline`, `@tiptap/extension-link` | Shipped example; ProseMirror JSON |
|
|
33
|
+
|
|
34
|
+
Custom engines can implement `RichTextEditorAdapter` and pass them via `global.richText`.
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
### Usage
|
|
39
|
+
|
|
40
|
+
```vue
|
|
41
|
+
<RichTextEditor
|
|
42
|
+
v-model="html"
|
|
43
|
+
label="Description"
|
|
44
|
+
placeholder="Write a short description…"
|
|
45
|
+
/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Limited tools
|
|
49
|
+
|
|
50
|
+
```vue
|
|
51
|
+
<RichTextEditor
|
|
52
|
+
v-model="html"
|
|
53
|
+
label="Comment"
|
|
54
|
+
:tools="['bold', 'italic', 'link', 'bulletList']"
|
|
55
|
+
/>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### JSON document
|
|
59
|
+
|
|
60
|
+
```vue
|
|
61
|
+
<RichTextEditor label="Body" format="json" v-model="doc" />
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`v-model` is a JSON object when `format="json"` (not a stringified blob).
|
|
65
|
+
|
|
66
|
+
### Read-only
|
|
67
|
+
|
|
68
|
+
```vue
|
|
69
|
+
<RichTextEditor read-only v-model="html" label="Preview" />
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Props
|
|
73
|
+
|
|
74
|
+
### RichTextEditor-specific
|
|
75
|
+
|
|
76
|
+
| Prop | Type | Default | Description |
|
|
77
|
+
| -------------- | --------------------------- | ----------------- | ------------------------------------------------------ |
|
|
78
|
+
| `format` | `"html" \| "json"` | `"html"` | Controlled value shape. |
|
|
79
|
+
| `defaultValue` | `string \| RichTextJSON` | — | Initial value when `v-model` is not bound. |
|
|
80
|
+
| `modelValue` | `string \| RichTextJSON` | — | Bound with `v-model`. |
|
|
81
|
+
| `placeholder` | `string` | — | Empty-state hint in the content area. |
|
|
82
|
+
| `readOnly` | `boolean` | `false` | View-only surface; hides the toolbar. |
|
|
83
|
+
| `tools` | `RichTextTool[]` | all default tools | Which toolbar actions to show. |
|
|
84
|
+
| `customProps` | `RichTextEditorCustomProps` | — | Extra props for `content`, `toolbar`, `toolbarButton`. |
|
|
85
|
+
|
|
86
|
+
### Inherited from FormField
|
|
87
|
+
|
|
88
|
+
Flat FormField props (`label`, `description`, `error`, `errorMessage`, `size`, `color`, `rounded`, `variant`, …).
|
|
@@ -260,7 +260,7 @@ Same as `List`, plus `icon-only`. Sets `icon-only` when the icon rail is collaps
|
|
|
260
260
|
|
|
261
261
|
## Props (`SidebarListItem`)
|
|
262
262
|
|
|
263
|
-
Same as `ListItem` (including `href`), plus `tooltip` / `tooltip-placement`. Applies compact nav chrome. Tooltips only show while the icon rail is collapsed (`primary`, or `tooltip` to override). A collapsed link keeps `href` on the anchor.
|
|
263
|
+
Same as `ListItem` (including `href`, `link-as`, and `link-props`), plus `tooltip` / `tooltip-placement`. Applies compact nav chrome. Tooltips only show while the icon rail is collapsed (`primary`, or `tooltip` to override). A collapsed link keeps `href` on the anchor. `link-as` replaces that anchor and leaves the row root as `li` or `div`.
|
|
264
264
|
|
|
265
265
|
## `useSidebar`
|
|
266
266
|
|
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",
|
|
@@ -54,6 +54,10 @@
|
|
|
54
54
|
"import": "./dist/Adapters/I18n/index.js",
|
|
55
55
|
"types": "./dist/Adapters/I18n/index.d.ts"
|
|
56
56
|
},
|
|
57
|
+
"./Adapters/RichText": {
|
|
58
|
+
"import": "./dist/Adapters/RichText/index.js",
|
|
59
|
+
"types": "./dist/Adapters/RichText/index.d.ts"
|
|
60
|
+
},
|
|
57
61
|
"./Adapters/Examples/*": {
|
|
58
62
|
"import": "./dist/Adapters/Examples/*.js",
|
|
59
63
|
"types": "./dist/Adapters/Examples/*.d.ts"
|
|
@@ -91,7 +95,13 @@
|
|
|
91
95
|
"@lucide/vue": "^0.400.0 || ^1.0.0",
|
|
92
96
|
"@phosphor-icons/vue": "^2.2.0",
|
|
93
97
|
"@tabler/icons-vue": "^3.0.0",
|
|
94
|
-
"@tanstack/vue-table": "^
|
|
98
|
+
"@tanstack/vue-table": "^9.2.0",
|
|
99
|
+
"@tiptap/core": "^3.0.0",
|
|
100
|
+
"@tiptap/extension-link": "^3.0.0",
|
|
101
|
+
"@tiptap/extension-placeholder": "^3.0.0",
|
|
102
|
+
"@tiptap/extension-underline": "^3.0.0",
|
|
103
|
+
"@tiptap/pm": "^3.0.0",
|
|
104
|
+
"@tiptap/starter-kit": "^3.0.0",
|
|
95
105
|
"date-fns": "^4.0.0",
|
|
96
106
|
"dayjs": "^1.11.0",
|
|
97
107
|
"luxon": "^3.0.0",
|
|
@@ -125,6 +135,24 @@
|
|
|
125
135
|
"@tanstack/vue-table": {
|
|
126
136
|
"optional": true
|
|
127
137
|
},
|
|
138
|
+
"@tiptap/core": {
|
|
139
|
+
"optional": true
|
|
140
|
+
},
|
|
141
|
+
"@tiptap/pm": {
|
|
142
|
+
"optional": true
|
|
143
|
+
},
|
|
144
|
+
"@tiptap/starter-kit": {
|
|
145
|
+
"optional": true
|
|
146
|
+
},
|
|
147
|
+
"@tiptap/extension-placeholder": {
|
|
148
|
+
"optional": true
|
|
149
|
+
},
|
|
150
|
+
"@tiptap/extension-underline": {
|
|
151
|
+
"optional": true
|
|
152
|
+
},
|
|
153
|
+
"@tiptap/extension-link": {
|
|
154
|
+
"optional": true
|
|
155
|
+
},
|
|
128
156
|
"date-fns": {
|
|
129
157
|
"optional": true
|
|
130
158
|
},
|
|
@@ -145,10 +173,11 @@
|
|
|
145
173
|
}
|
|
146
174
|
},
|
|
147
175
|
"dependencies": {
|
|
148
|
-
"@bridge-ui/core": "^0.
|
|
176
|
+
"@bridge-ui/core": "^0.13.0",
|
|
177
|
+
"@tailwindcss/typography": "^0.5.20",
|
|
149
178
|
"clsx": "^2.1.1",
|
|
150
|
-
"es-toolkit": "^1.
|
|
151
|
-
"tailwind-merge": "^3.
|
|
179
|
+
"es-toolkit": "^1.52.0",
|
|
180
|
+
"tailwind-merge": "^3.7.0"
|
|
152
181
|
},
|
|
153
182
|
"scripts": {
|
|
154
183
|
"build": "vite build && cp src/theme.css dist/theme.css",
|
|
@@ -164,25 +193,32 @@
|
|
|
164
193
|
"@fortawesome/free-solid-svg-icons": "^7.3.1",
|
|
165
194
|
"@fortawesome/vue-fontawesome": "^3.3.3",
|
|
166
195
|
"@heroicons/vue": "^2.2.0",
|
|
167
|
-
"@
|
|
196
|
+
"@inertiajs/vue3": "^3.7.1",
|
|
197
|
+
"@lucide/vue": "^1.48.0",
|
|
168
198
|
"@phosphor-icons/vue": "^2.2.1",
|
|
169
|
-
"@tabler/icons-vue": "^3.
|
|
199
|
+
"@tabler/icons-vue": "^3.48.0",
|
|
170
200
|
"@tailwindcss/cli": "^4.3.3",
|
|
171
201
|
"@tailwindcss/vite": "^4.3.3",
|
|
172
|
-
"@tanstack/vue-table": "^
|
|
173
|
-
"@
|
|
174
|
-
"@
|
|
175
|
-
"@
|
|
176
|
-
"@
|
|
202
|
+
"@tanstack/vue-table": "^9.2.4",
|
|
203
|
+
"@tiptap/core": "^3.31.3",
|
|
204
|
+
"@tiptap/extension-link": "^3.31.3",
|
|
205
|
+
"@tiptap/extension-placeholder": "^3.31.3",
|
|
206
|
+
"@tiptap/extension-underline": "^3.31.3",
|
|
207
|
+
"@tiptap/pm": "^3.31.3",
|
|
208
|
+
"@tiptap/starter-kit": "^3.31.3",
|
|
209
|
+
"@types/luxon": "^3.7.5",
|
|
210
|
+
"@types/node": "^26.6.2",
|
|
211
|
+
"@vue/language-core": "^3.3.11",
|
|
212
|
+
"@vue/test-utils": "^2.5.1",
|
|
177
213
|
"date-fns": "^4.4.0",
|
|
178
|
-
"dayjs": "^1.11.
|
|
214
|
+
"dayjs": "^1.11.23",
|
|
179
215
|
"luxon": "^3.7.2",
|
|
180
|
-
"moment": "^2.
|
|
181
|
-
"moment-timezone": "^0.6.
|
|
216
|
+
"moment": "^2.31.0",
|
|
217
|
+
"moment-timezone": "^0.6.4",
|
|
182
218
|
"tailwindcss": "^4.3.3",
|
|
183
219
|
"typescript": "^6.0.3",
|
|
184
|
-
"vue": "^3.5.
|
|
185
|
-
"vue-i18n": "^11.4.
|
|
186
|
-
"vue-tsc": "^3.3.
|
|
220
|
+
"vue": "^3.5.43",
|
|
221
|
+
"vue-i18n": "^11.4.12",
|
|
222
|
+
"vue-tsc": "^3.3.11"
|
|
187
223
|
}
|
|
188
224
|
}
|