@bridge-ui/vue 0.16.0 → 0.17.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.
Files changed (55) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +2 -1
  2. package/dist/Actions/Snackbar/createBridgeSnackbarApi.js +1 -1
  3. package/dist/Actions/actionHostRegistry.d.ts +2 -1
  4. package/dist/Actions/actionHostRegistry.js +11 -7
  5. package/dist/Components/DataTable/DataTable.vue.d.ts +5 -3
  6. package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +138 -117
  7. package/dist/Components/DataTable/composables/useDataTable.d.ts +4 -2
  8. package/dist/Components/DataTable/composables/useDataTable.js +293 -273
  9. package/dist/Components/DataTable/dataTable.types.d.ts +35 -2
  10. package/dist/Components/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js +4 -3
  11. package/dist/Components/Drawer/composables/useDrawer.js +68 -67
  12. package/dist/Components/Menu/Menu.vue_vue_type_script_setup_true_lang.js +3 -5
  13. package/dist/Components/Modal/Modal.vue_vue_type_script_setup_true_lang.js +4 -3
  14. package/dist/Components/Modal/composables/useModal.js +129 -119
  15. package/dist/Components/Pagination/Pagination.vue.d.ts +6 -0
  16. package/dist/Components/Pagination/Pagination.vue_vue_type_script_setup_true_lang.js +23 -11
  17. package/dist/Components/Pagination/composables/usePagination.d.ts +3 -3
  18. package/dist/Components/Pagination/composables/usePagination.js +95 -84
  19. package/dist/Components/Pagination/pagination.types.d.ts +30 -2
  20. package/dist/Components/Resizable/Resizable.js +5 -0
  21. package/dist/Components/Resizable/Resizable.vue.d.ts +17 -0
  22. package/dist/Components/Resizable/Resizable.vue_vue_type_script_setup_true_lang.js +30 -0
  23. package/dist/Components/Resizable/composables/useResizable.d.ts +18 -0
  24. package/dist/Components/Resizable/composables/useResizable.js +195 -0
  25. package/dist/Components/Resizable/index.d.ts +4 -0
  26. package/dist/Components/Resizable/index.js +4 -0
  27. package/dist/Components/Resizable/resizable.types.d.ts +53 -0
  28. package/dist/Components/Resizable/resizableInjectionKey.d.ts +111 -0
  29. package/dist/Components/Resizable/resizableInjectionKey.js +4 -0
  30. package/dist/Components/ResizableHandle/ResizableHandle.js +5 -0
  31. package/dist/Components/ResizableHandle/ResizableHandle.vue.d.ts +14 -0
  32. package/dist/Components/ResizableHandle/ResizableHandle.vue_vue_type_script_setup_true_lang.js +31 -0
  33. package/dist/Components/ResizableHandle/composables/useResizableHandle.d.ts +35 -0
  34. package/dist/Components/ResizableHandle/composables/useResizableHandle.js +85 -0
  35. package/dist/Components/ResizableHandle/index.d.ts +3 -0
  36. package/dist/Components/ResizableHandle/index.js +3 -0
  37. package/dist/Components/ResizableHandle/resizableHandle.types.d.ts +58 -0
  38. package/dist/Components/ResizablePanel/ResizablePanel.js +5 -0
  39. package/dist/Components/ResizablePanel/ResizablePanel.vue.d.ts +24 -0
  40. package/dist/Components/ResizablePanel/ResizablePanel.vue_vue_type_script_setup_true_lang.js +39 -0
  41. package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +21 -0
  42. package/dist/Components/ResizablePanel/composables/useResizablePanel.js +87 -0
  43. package/dist/Components/ResizablePanel/index.d.ts +3 -0
  44. package/dist/Components/ResizablePanel/index.js +3 -0
  45. package/dist/Components/ResizablePanel/resizablePanel.types.d.ts +71 -0
  46. package/dist/Components/Snackbar/composables/useSnackbar.js +140 -146
  47. package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +4 -6
  48. package/dist/augments.d.ts +15 -0
  49. package/dist/index.d.ts +6 -0
  50. package/dist/index.js +70 -63
  51. package/docs/README.md +1 -0
  52. package/docs/components/DataTable.md +19 -0
  53. package/docs/components/Pagination.md +17 -5
  54. package/docs/components/Resizable.md +224 -0
  55. package/package.json +2 -2
@@ -133,6 +133,25 @@ When `page` and `page-count` (or `total-count`) are set, DataTable does not sort
133
133
  />
134
134
  ```
135
135
 
136
+ ### Cursor pagination
137
+
138
+ For APIs that return `next_cursor` / `prev_cursor` instead of a page total, bind `v-model:cursor` (or pass `next-cursor` / `prev-cursor`). DataTable then does not sort, filter, or slice `rows` locally, and the footer shows a previous / next `Pagination` instead of the "Page X of Y" label. The per-page Select stays. A `null` cursor disables its control:
139
+
140
+ ```vue
141
+ <DataTable
142
+ :rows="audits"
143
+ :columns="columns"
144
+ v-model:cursor="cursor"
145
+ v-model:sorting="sorting"
146
+ v-model:filters="filters"
147
+ v-model:per-page="perPage"
148
+ :next-cursor="pagination.next_cursor"
149
+ :prev-cursor="pagination.prev_cursor"
150
+ />
151
+ ```
152
+
153
+ DataTable never resets the cursor. Set it back to `null` in the app when sorting, filters, or per-page change. `#pagination` also receives `cursor`, `nextCursor`, `prevCursor`, `hasNext`, `hasPrevious`, `onNext`, and `onPrevious`. `customProps.cursorPagination` forwards extra props to the built-in cursor pager. Do not combine cursor props with `page` + `page-count` / `total-count`: cursor paging wins and a warning is logged in development.
154
+
136
155
  ### Empty, loading, and footer
137
156
 
138
157
  Empty rows render `EmptyState` at the table `size`, with the semantic `inbox` icon and the i18n title `"No data"`. `#empty` replaces it. `loading` keeps the table visible. `loadingVariant="overlay"` (default) dims the table with a spin; `loadingVariant="bar"` dims the table and draws a progress line under the header. `#loading` replaces the indicator. `#footer` renders below the table, above the chrome footer:
@@ -51,15 +51,27 @@ Applies to `ghost` and `text` item corners and the `outlined` group / edge contr
51
51
 
52
52
  ### Simple (cursor / prev–next only)
53
53
 
54
- For APIs that do not expose a total page count:
54
+ For APIs that return `next_cursor` / `prev_cursor` instead of a page total. `v-model:cursor` is set to `next-cursor` or `prev-cursor` when the user navigates, and a `null` cursor disables its control:
55
55
 
56
56
  ```vue
57
57
  <Pagination
58
58
  mode="simple"
59
+ v-model:cursor="cursor"
59
60
  aria-label="Pagination"
60
- :has-next="Boolean(nextCursor)"
61
- v-on:next="fetchPage(nextCursor)"
62
- :has-previous="Boolean(prevCursor)"
63
- v-on:previous="fetchPage(prevCursor)"
61
+ :next-cursor="pagination.next_cursor"
62
+ :prev-cursor="pagination.prev_cursor"
63
+ />
64
+ ```
65
+
66
+ `has-next` / `has-previous` override the cursor defaults. `next` / `previous` still fire (after `update:cursor`), so prev/next without cursors keeps working:
67
+
68
+ ```vue
69
+ <Pagination
70
+ mode="simple"
71
+ :has-next="hasMore"
72
+ v-on:next="loadNext"
73
+ aria-label="Pagination"
74
+ :has-previous="page > 1"
75
+ v-on:previous="loadPrevious"
64
76
  />
65
77
  ```
@@ -0,0 +1,224 @@
1
+ # Resizable
2
+
3
+ Panels the user can resize by dragging the handle between them or with the keyboard. `Resizable` is the group, `ResizablePanel` is each panel, and `ResizableHandle` sits between two panels.
4
+
5
+ Sizes are percentages of the group. Panels without `default-size` share the space left. Panel order follows the DOM, so panels and handles can be wrapped or rendered with `v-if`.
6
+
7
+ The group fills its parent (`h-full w-full`). Give the parent, or the group through `class`, a height when the panels stack or when the page does not set one.
8
+
9
+ ## Import
10
+
11
+ ```ts
12
+ import { Resizable } from "@bridge-ui/vue/Components/Resizable";
13
+ import { ResizableHandle } from "@bridge-ui/vue/Components/ResizableHandle";
14
+ import { ResizablePanel } from "@bridge-ui/vue/Components/ResizablePanel";
15
+ ```
16
+
17
+ ## Examples
18
+
19
+ ### Usage
20
+
21
+ ```vue
22
+ <Resizable class="h-64 rounded-lg border">
23
+ <ResizablePanel :default-size="25">Sidebar</ResizablePanel>
24
+ <ResizableHandle />
25
+ <ResizablePanel>Content</ResizablePanel>
26
+ </Resizable>
27
+ ```
28
+
29
+ ### Vertical
30
+
31
+ ```vue
32
+ <Resizable class="h-96" orientation="vertical">
33
+ <ResizablePanel>Editor</ResizablePanel>
34
+ <ResizableHandle />
35
+ <ResizablePanel :default-size="30">Console</ResizablePanel>
36
+ </Resizable>
37
+ ```
38
+
39
+ ### Without a grip
40
+
41
+ Each handle shows a grip by default. `hide-grip` leaves only the line.
42
+
43
+ ```vue
44
+ <Resizable class="h-64">
45
+ <ResizablePanel>One</ResizablePanel>
46
+ <ResizableHandle hide-grip />
47
+ <ResizablePanel>Two</ResizablePanel>
48
+ </Resizable>
49
+ ```
50
+
51
+ ### Size limits
52
+
53
+ `min-size` and `max-size` bound a panel while dragging and with the keyboard. Once the panel shrinking next to the handle reaches its `min-size`, the drag goes on to shrink the panels beyond it.
54
+
55
+ ```vue
56
+ <Resizable class="h-64">
57
+ <ResizablePanel :min-size="15" :max-size="40" :default-size="25">
58
+ Sidebar
59
+ </ResizablePanel>
60
+ <ResizableHandle />
61
+ <ResizablePanel :min-size="30">Content</ResizablePanel>
62
+ </Resizable>
63
+ ```
64
+
65
+ ### Nested groups
66
+
67
+ ```vue
68
+ <Resizable class="h-96">
69
+ <ResizablePanel :default-size="25">Files</ResizablePanel>
70
+ <ResizableHandle />
71
+ <ResizablePanel>
72
+ <Resizable orientation="vertical">
73
+ <ResizablePanel>Editor</ResizablePanel>
74
+ <ResizableHandle />
75
+ <ResizablePanel :default-size="30">Terminal</ResizablePanel>
76
+ </Resizable>
77
+ </ResizablePanel>
78
+ </Resizable>
79
+ ```
80
+
81
+ ### Collapsible panel
82
+
83
+ A `collapsible` panel collapses to `collapsed-size` (default `0`) once it is dragged past half of `min-size`. `Enter` on the handle collapses it and expands it back to its last size. Bind `v-model:collapsed` to collapse or expand it from outside.
84
+
85
+ ```vue
86
+ <Button @click="collapsed = !collapsed">Toggle sidebar</Button>
87
+
88
+ <Resizable class="h-64">
89
+ <ResizablePanel
90
+ collapsible
91
+ :min-size="15"
92
+ :default-size="25"
93
+ v-model:collapsed="collapsed"
94
+ >
95
+ Sidebar
96
+ </ResizablePanel>
97
+ <ResizableHandle />
98
+ <ResizablePanel>Content</ResizablePanel>
99
+ </Resizable>
100
+ ```
101
+
102
+ `collapsed-size` keeps a strip visible, for example for an icon rail:
103
+
104
+ ```vue
105
+ <ResizablePanel collapsible :min-size="20" :collapsed-size="5">
106
+ Sidebar
107
+ </ResizablePanel>
108
+ ```
109
+
110
+ ### Saving the layout
111
+
112
+ `@layout-change` receives every panel size, in order. Feed saved sizes back through `default-size`.
113
+
114
+ ```vue
115
+ <script setup lang="ts">
116
+ const saved = JSON.parse(localStorage.getItem("layout") ?? "[30, 70]");
117
+
118
+ function save(layout: number[]) {
119
+ localStorage.setItem("layout", JSON.stringify(layout));
120
+ }
121
+ </script>
122
+
123
+ <template>
124
+ <Resizable class="h-64" @layout-change="save">
125
+ <ResizablePanel :default-size="saved[0]">Sidebar</ResizablePanel>
126
+ <ResizableHandle />
127
+ <ResizablePanel :default-size="saved[1]">Content</ResizablePanel>
128
+ </Resizable>
129
+ </template>
130
+ ```
131
+
132
+ `ResizablePanel` also emits `resize` with its own size.
133
+
134
+ ### Disabled
135
+
136
+ `disabled` on the group locks every handle. On a handle, it locks only that handle.
137
+
138
+ ```vue
139
+ <Resizable disabled class="h-64">
140
+ <ResizablePanel>One</ResizablePanel>
141
+ <ResizableHandle />
142
+ <ResizablePanel>Two</ResizablePanel>
143
+ </Resizable>
144
+ ```
145
+
146
+ ### Right to left
147
+
148
+ `dir="rtl"` flips the horizontal drag and arrow keys, so the panel on the right is the first one.
149
+
150
+ ```vue
151
+ <Resizable dir="rtl" class="h-64">
152
+ <ResizablePanel :default-size="25">Sidebar</ResizablePanel>
153
+ <ResizableHandle />
154
+ <ResizablePanel>Content</ResizablePanel>
155
+ </Resizable>
156
+ ```
157
+
158
+ ### Classes and grip slot
159
+
160
+ ```vue
161
+ <ResizableHandle
162
+ :classes="{
163
+ root: 'bg-primary-200',
164
+ grip: 'flex h-5 w-3 items-center justify-center text-xs',
165
+ }"
166
+ >
167
+ <template #grip>⋮</template>
168
+ </ResizableHandle>
169
+ ```
170
+
171
+ ## Keyboard
172
+
173
+ - Each handle is a focusable `separator`. Its value is the size of the panel before it
174
+ - Horizontal: `ArrowLeft` / `ArrowRight`. Vertical: `ArrowUp` / `ArrowDown`. `dir="rtl"` swaps the horizontal arrows
175
+ - Arrow keys move by `keyboard-step` (default `10`)
176
+ - `Home` shrinks the panel before the handle to its `min-size` (or collapses it when `collapsible`). `End` grows it to its `max-size`
177
+ - `Enter` collapses or expands a `collapsible` panel before the handle
178
+
179
+ ## Props
180
+
181
+ ### Resizable
182
+
183
+ | Prop | Type | Default | Description |
184
+ | -------------- | ---------------------------- | -------------- | -------------------------------------------- |
185
+ | `classes` | `ResizableClasses` | — | Classes for the group root. |
186
+ | `disabled` | `boolean` | `false` | Lock every handle in the group. |
187
+ | `keyboardStep` | `number` | `10` | Percent an arrow key moves a focused handle. |
188
+ | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Axis the panels are laid out on. |
189
+
190
+ | Event | Payload | Description |
191
+ | -------------- | ------------------ | ----------------------------------------------------- |
192
+ | `layoutChange` | `layout: number[]` | Every panel size (percent), in order, after a change. |
193
+
194
+ ### ResizablePanel
195
+
196
+ | Prop | Type | Default | Description |
197
+ | --------------- | ----------------------- | ------- | --------------------------------------------------------------------- |
198
+ | `classes` | `ResizablePanelClasses` | — | Classes for the panel. |
199
+ | `collapsed` | `boolean` | — | Collapsed state, bound with `v-model:collapsed`. Needs `collapsible`. |
200
+ | `collapsedSize` | `number` | `0` | Size while collapsed, in percent. |
201
+ | `collapsible` | `boolean` | `false` | Let the panel collapse past half of `minSize`. |
202
+ | `defaultSize` | `number` | — | Initial size, in percent. Panels without one share the rest. |
203
+ | `maxSize` | `number` | `100` | Largest size, in percent. |
204
+ | `minSize` | `number` | `0` | Smallest size while expanded, in percent. |
205
+
206
+ | Event | Payload | Description |
207
+ | ------------------ | -------------------- | --------------------------------- |
208
+ | `resize` | `size: number` | The panel size changed (percent). |
209
+ | `update:collapsed` | `collapsed: boolean` | The panel collapsed or expanded. |
210
+
211
+ ### ResizableHandle
212
+
213
+ | Prop | Type | Default | Description |
214
+ | ------------- | ---------------------------- | ------- | ------------------------------------- |
215
+ | `classes` | `ResizableHandleClasses` | — | Classes for `root` and `grip`. |
216
+ | `customProps` | `ResizableHandleCustomProps` | — | Extra props for the `grip`. |
217
+ | `disabled` | `boolean` | `false` | Lock this handle. |
218
+ | `hideGrip` | `boolean` | `false` | Hide the grip and show only the line. |
219
+
220
+ Slot `grip`: content inside the grip.
221
+
222
+ ## Related components
223
+
224
+ Sidebar, Divider
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "license": "MIT",
4
- "version": "0.16.0",
4
+ "version": "0.17.0",
5
5
  "author": "BridgeUI",
6
6
  "sideEffects": false,
7
7
  "name": "@bridge-ui/vue",
@@ -109,7 +109,7 @@
109
109
  }
110
110
  },
111
111
  "dependencies": {
112
- "@bridge-ui/core": "^0.16.0",
112
+ "@bridge-ui/core": "^0.17.0",
113
113
  "@tailwindcss/typography": "^0.5.20",
114
114
  "clsx": "^2.1.1",
115
115
  "es-toolkit": "^1.52.0",