@bridge-ui/vue 0.16.0 → 0.17.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.
Files changed (61) 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/Chart/Chart.vue_vue_type_script_setup_true_lang.js +7 -7
  6. package/dist/Components/Chart/composables/useChart.js +16 -14
  7. package/dist/Components/DataTable/DataTable.vue.d.ts +5 -3
  8. package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +114 -101
  9. package/dist/Components/DataTable/composables/useDataTable.d.ts +4 -2
  10. package/dist/Components/DataTable/composables/useDataTable.js +293 -273
  11. package/dist/Components/DataTable/dataTable.types.d.ts +35 -2
  12. package/dist/Components/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js +4 -3
  13. package/dist/Components/Drawer/composables/useDrawer.js +68 -67
  14. package/dist/Components/Menu/Menu.vue_vue_type_script_setup_true_lang.js +3 -5
  15. package/dist/Components/Modal/Modal.vue_vue_type_script_setup_true_lang.js +4 -3
  16. package/dist/Components/Modal/composables/useModal.js +129 -119
  17. package/dist/Components/Pagination/Pagination.vue.d.ts +6 -0
  18. package/dist/Components/Pagination/Pagination.vue_vue_type_script_setup_true_lang.js +23 -11
  19. package/dist/Components/Pagination/composables/usePagination.d.ts +3 -3
  20. package/dist/Components/Pagination/composables/usePagination.js +95 -84
  21. package/dist/Components/Pagination/pagination.types.d.ts +30 -2
  22. package/dist/Components/Resizable/Resizable.js +5 -0
  23. package/dist/Components/Resizable/Resizable.vue.d.ts +17 -0
  24. package/dist/Components/Resizable/Resizable.vue_vue_type_script_setup_true_lang.js +30 -0
  25. package/dist/Components/Resizable/composables/useResizable.d.ts +18 -0
  26. package/dist/Components/Resizable/composables/useResizable.js +195 -0
  27. package/dist/Components/Resizable/index.d.ts +4 -0
  28. package/dist/Components/Resizable/index.js +4 -0
  29. package/dist/Components/Resizable/resizable.types.d.ts +53 -0
  30. package/dist/Components/Resizable/resizableInjectionKey.d.ts +111 -0
  31. package/dist/Components/Resizable/resizableInjectionKey.js +4 -0
  32. package/dist/Components/ResizableHandle/ResizableHandle.js +5 -0
  33. package/dist/Components/ResizableHandle/ResizableHandle.vue.d.ts +14 -0
  34. package/dist/Components/ResizableHandle/ResizableHandle.vue_vue_type_script_setup_true_lang.js +31 -0
  35. package/dist/Components/ResizableHandle/composables/useResizableHandle.d.ts +35 -0
  36. package/dist/Components/ResizableHandle/composables/useResizableHandle.js +85 -0
  37. package/dist/Components/ResizableHandle/index.d.ts +3 -0
  38. package/dist/Components/ResizableHandle/index.js +3 -0
  39. package/dist/Components/ResizableHandle/resizableHandle.types.d.ts +58 -0
  40. package/dist/Components/ResizablePanel/ResizablePanel.js +5 -0
  41. package/dist/Components/ResizablePanel/ResizablePanel.vue.d.ts +24 -0
  42. package/dist/Components/ResizablePanel/ResizablePanel.vue_vue_type_script_setup_true_lang.js +39 -0
  43. package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +21 -0
  44. package/dist/Components/ResizablePanel/composables/useResizablePanel.js +87 -0
  45. package/dist/Components/ResizablePanel/index.d.ts +3 -0
  46. package/dist/Components/ResizablePanel/index.js +3 -0
  47. package/dist/Components/ResizablePanel/resizablePanel.types.d.ts +71 -0
  48. package/dist/Components/Snackbar/composables/useSnackbar.js +140 -146
  49. package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +4 -6
  50. package/dist/Utils/LoadingSpin.js +5 -0
  51. package/dist/Utils/LoadingSpin.vue.d.ts +3 -0
  52. package/dist/Utils/LoadingSpin.vue_vue_type_script_setup_true_lang.js +21 -0
  53. package/dist/augments.d.ts +15 -0
  54. package/dist/index.d.ts +6 -0
  55. package/dist/index.js +70 -63
  56. package/docs/README.md +1 -0
  57. package/docs/components/Chart.md +3 -1
  58. package/docs/components/DataTable.md +19 -0
  59. package/docs/components/Pagination.md +17 -5
  60. package/docs/components/Resizable.md +224 -0
  61. package/package.json +2 -2
@@ -2,7 +2,7 @@
2
2
  name: bridge-ui-components
3
3
  description: >-
4
4
  Use Bridge UI Vue components — Button, ButtonGroup, Avatar, Card, Alert, Accordion, ActionFooter, Badge, Icon,
5
- Link, List, Table, DataTable, Tabs, Spinner, Skeleton, EmptyState, Sidebar, Progress, Stepper, Carousel, Chart, Pagination, TextField, Select,
5
+ Link, List, Table, DataTable, Tabs, Spinner, Skeleton, EmptyState, Sidebar, Progress, Stepper, Carousel, Resizable, Chart, Pagination, TextField, Select,
6
6
  Autocomplete, DateField, DatePicker, DateRangeField, DateRangePicker,
7
7
  TimeField, TimePicker, DateTimeField, DateTimePicker, ColorField, ColorPicker,
8
8
  classes, customProps, slots. Use when building UI with Bridge components.
@@ -27,6 +27,7 @@ In templates, use kebab-case attrs (`start-icon`, `custom-props`, `error-message
27
27
  | Action footer | `.ai/docs/components/ActionFooter.md` |
28
28
  | Stepper | `.ai/docs/components/Stepper.md` |
29
29
  | Carousel | `.ai/docs/components/Carousel.md` |
30
+ | Resizable panels | `.ai/docs/components/Resizable.md` |
30
31
  | Chart | `.ai/docs/components/Chart.md` |
31
32
  | Icon | `.ai/docs/components/Icon.md` |
32
33
  | Lists | `.ai/docs/components/List.md` |
@@ -41,7 +41,7 @@ function m(t = {}) {
41
41
  h.value = d(h.value, e, t, ["props"]);
42
42
  }
43
43
  function C(e, t) {
44
- (!t || h.value.some((t) => t.id === e && t.show)) && (h.value = l(h.value, e, t));
44
+ h.value = l(h.value, e, t);
45
45
  }
46
46
  return {
47
47
  open: g,
@@ -8,6 +8,7 @@ export declare const drawerActionHosts: ActionHostRegistry<BridgeDrawerControlle
8
8
  export declare const modalActionHosts: ActionHostRegistry<BridgeModalController>;
9
9
  export declare const snackbarActionHosts: ActionHostRegistry<BridgeSnackbarController>;
10
10
  /**
11
- * Registers `api` until the current component unmounts.
11
+ * Registers `api` while the current component is mounted. Lifecycle hooks
12
+ * never run during SSR, so server renders don't leak hosts into the registry.
12
13
  */
13
14
  export declare function registerActionHost<T>(registry: ActionHostRegistry<T>, api: T): void;
@@ -1,10 +1,14 @@
1
- import { onUnmounted as e } from "vue";
2
- import { createActionHostRegistry as t } from "@bridge-ui/core/Layer";
1
+ import { onBeforeMount as e, onUnmounted as t } from "vue";
2
+ import { createActionHostRegistry as n } from "@bridge-ui/core/Layer";
3
3
  //#region src/Actions/actionHostRegistry.ts
4
- var n = t(), r = t(), i = t(), a = t();
5
- function o(t, n) {
6
- let r = t.register(n);
7
- e(r);
4
+ var r = n(), i = n(), a = n(), o = n();
5
+ function s(n, r) {
6
+ let i = null;
7
+ e(() => {
8
+ i = n.register(r);
9
+ }), t(() => {
10
+ i?.();
11
+ });
8
12
  }
9
13
  //#endregion
10
- export { n as dialogActionHosts, r as drawerActionHosts, i as modalActionHosts, o as registerActionHost, a as snackbarActionHosts };
14
+ export { r as dialogActionHosts, i as drawerActionHosts, a as modalActionHosts, s as registerActionHost, o as snackbarActionHosts };
@@ -1,5 +1,5 @@
1
- import e from "../Skeleton/Skeleton.js";
2
- import { useChart as t } from "./composables/useChart.js";
1
+ import { useChart as e } from "./composables/useChart.js";
2
+ import t from "../../Utils/LoadingSpin.js";
3
3
  import { Fragment as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, mergeProps as u, normalizeProps as d, openBlock as f, renderList as p, renderSlot as m, toDisplayString as h, unref as g, useTemplateRef as _ } from "vue";
4
4
  //#region src/Components/Chart/Chart.vue?vue&type=script&setup=true&lang.ts
5
5
  var v = { scope: "col" }, y = { scope: "row" }, b = /*@__PURE__*/ c({
@@ -24,7 +24,7 @@ var v = { scope: "col" }, y = { scope: "row" }, b = /*@__PURE__*/ c({
24
24
  width: {}
25
25
  },
26
26
  setup(c) {
27
- let b = c, x = _("root"), S = _("plot"), C = _("host"), { table: w, isEmpty: T, hostBind: E, plotBind: D, rootBind: O, liveBind: k, emptyBind: A, isLoading: j, tableBind: M, loadingBind: N, announcement: P, emptyMessage: F } = t(b, {
27
+ let b = c, x = _("root"), S = _("plot"), C = _("host"), { table: w, isEmpty: T, hostBind: E, plotBind: D, rootBind: O, liveBind: k, emptyBind: A, isLoading: j, tableBind: M, loadingBind: N, announcement: P, emptyMessage: F } = e(b, {
28
28
  size: "md",
29
29
  height: 280,
30
30
  animation: !0
@@ -33,13 +33,13 @@ var v = { scope: "col" }, y = { scope: "row" }, b = /*@__PURE__*/ c({
33
33
  plotRef: S,
34
34
  rootRef: x
35
35
  });
36
- return (t, c) => (f(), i("div", u({ ref: "root" }, g(O)), [
36
+ return (e, c) => (f(), i("div", u({ ref: "root" }, g(O)), [
37
37
  a("div", u({ ref: "plot" }, g(D)), [
38
38
  a("div", u({ ref: "host" }, g(E)), null, 16),
39
- g(j) ? (f(), i("div", d(u({ key: 0 }, g(N))), [m(t.$slots, "loading", {}, () => [s(g(e), { class: "size-full" })])], 16)) : r("", !0),
40
- g(T) ? (f(), i("div", d(u({ key: 1 }, g(A))), [m(t.$slots, "empty", {}, () => [o(h(g(F)), 1)])], 16)) : r("", !0)
39
+ g(j) ? (f(), i("div", d(u({ key: 0 }, g(N))), [m(e.$slots, "loading", {}, () => [s(t)])], 16)) : r("", !0),
40
+ g(T) ? (f(), i("div", d(u({ key: 1 }, g(A))), [m(e.$slots, "empty", {}, () => [o(h(g(F)), 1)])], 16)) : r("", !0)
41
41
  ], 16),
42
- m(t.$slots, "default"),
42
+ m(e.$slots, "default"),
43
43
  a("table", d(l(g(M))), [a("thead", null, [a("tr", null, [a("th", v, h(g(w).categoryLabel), 1), (f(!0), i(n, null, p(g(w).series, (e) => (f(), i("th", {
44
44
  scope: "col",
45
45
  key: e.id
@@ -184,7 +184,7 @@ function v(v, De, Oe) {
184
184
  }, { flush: "post" }), te(() => {
185
185
  q?.(), Q();
186
186
  });
187
- let $ = a(() => {
187
+ let Ke = a(() => {
188
188
  let e = N.value.index;
189
189
  return d(e) ? [] : he({
190
190
  index: e,
@@ -194,34 +194,34 @@ function v(v, De, Oe) {
194
194
  }))
195
195
  });
196
196
  });
197
- function Ke(e) {
197
+ function qe(e) {
198
198
  let t = w.value?.getCategoryAnchor(e), n = S.value;
199
199
  return d(t) || d(n) ? null : {
200
200
  y: t.y + n.offsetTop,
201
201
  x: t.x + n.offsetLeft
202
202
  };
203
203
  }
204
- function qe() {
204
+ function Je() {
205
205
  return {
206
206
  width: C.value?.clientWidth ?? 0,
207
207
  height: C.value?.clientHeight ?? 0
208
208
  };
209
209
  }
210
- let Je = a(() => ({
210
+ let Ye = a(() => ({
211
211
  setAxis: Re,
212
- getBounds: qe,
212
+ getBounds: Je,
213
213
  removeAxis: ze,
214
214
  id: y,
215
215
  removeSeries: Le,
216
216
  toggleSeries: Be,
217
217
  upsertSeries: Ie,
218
218
  highlightSeries: Ve,
219
- getTooltipAnchor: Ke,
219
+ getTooltipAnchor: qe,
220
220
  series: J.value,
221
221
  locale: V.value,
222
222
  categories: U.value,
223
223
  activeIndex: N.value.index,
224
- tooltipItems: $.value,
224
+ tooltipItems: Ke.value,
225
225
  tokenClasses: {
226
226
  legend: l(G.value, "legend"),
227
227
  swatch: l(G.value, "swatch"),
@@ -229,15 +229,15 @@ function v(v, De, Oe) {
229
229
  legendItem: l(G.value, "legendItem")
230
230
  }
231
231
  }));
232
- re(i, Je);
233
- let Ye = a(() => I.value.loading === !0), Xe = a(() => !Ye.value && p(k.value)), Ze = a(() => b("No data")), Qe = a(() => d(I.value.summary) ? p(k.value) ? Ze.value : b("Chart with {{count}} series ({{names}}) across {{categories}} categories, from {{first}} to {{last}}.", pe({
232
+ re(i, Ye);
233
+ let $ = a(() => I.value.loading === !0), Xe = a(() => !$.value && p(k.value)), Ze = a(() => b("No data")), Qe = a(() => d(I.value.summary) ? p(k.value) ? Ze.value : b("Chart with {{count}} series ({{names}}) across {{categories}} categories, from {{first}} to {{last}}.", pe({
234
234
  series: k.value,
235
235
  categories: U.value
236
236
  })) : I.value.summary), $e = a(() => {
237
237
  let e = N.value.index;
238
238
  return N.value.source !== "keyboard" || d(e) ? "" : ue({
239
239
  locale: V.value,
240
- items: $.value,
240
+ items: Ke.value,
241
241
  category: U.value[e] ?? ""
242
242
  });
243
243
  }), et = a(() => ({
@@ -274,6 +274,7 @@ function v(v, De, Oe) {
274
274
  }
275
275
  let rt = a(() => t(f(H.value?.root, ["style"]), f(F.value.inheritedAttrs, ["style"]), {
276
276
  role: "figure",
277
+ "aria-busy": $.value || void 0,
277
278
  style: [
278
279
  { width: m(I.value.width, "100%") },
279
280
  F.value.inheritedAttrs.style,
@@ -304,7 +305,8 @@ function v(v, De, Oe) {
304
305
  "aria-hidden": !0,
305
306
  class: "absolute inset-0"
306
307
  })), ot = a(() => ({ class: h({
307
- "absolute inset-0 z-10 flex": !0,
308
+ "absolute inset-0 z-10 flex items-center justify-center": !0,
309
+ "bg-white/50 dark:bg-dark-900/50": !0,
308
310
  [l(B.value, "loading") ?? ""]: !0
309
311
  }) })), st = a(() => ({ class: h({
310
312
  "absolute inset-0 z-10 flex items-center justify-center": !0,
@@ -313,7 +315,7 @@ function v(v, De, Oe) {
313
315
  }) })), ct = a(() => ({
314
316
  id: `${y}-table`,
315
317
  class: h({
316
- "sr-only": !0,
318
+ "sr-only block": !0,
317
319
  [l(B.value, "table") ?? ""]: !0
318
320
  })
319
321
  }));
@@ -332,11 +334,11 @@ function v(v, De, Oe) {
332
334
  "aria-live": "polite"
333
335
  })),
334
336
  emptyBind: st,
335
- isLoading: Ye,
337
+ isLoading: $,
336
338
  tableBind: ct,
337
339
  loadingBind: ot,
338
340
  announcement: $e,
339
- contextValue: Je,
341
+ contextValue: Ye,
340
342
  emptyMessage: Ze
341
343
  };
342
344
  }
@@ -1,18 +1,20 @@
1
1
  import { VNodeChild } from 'vue';
2
- import { DataTableColumnSearch, DataTableFilters } from '@bridge-ui/core/Domain';
2
+ import { DataTableColumnSearch, DataTableFilters, PaginationCursor } from '@bridge-ui/core/Domain';
3
3
  import { DataTableItemSlotProps, DataTableOwnProps, DataTableSlots, DataTableSorting } from './dataTable.types';
4
4
  declare const __VLS_export: <T extends Record<string, unknown>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
- props: import('vue').PublicProps & __VLS_PrettifyLocal<(Omit<DataTableOwnProps<T>, "search" | "page" | "filters" | "expanded" | "selection" | "columnSearch" | "hiddenColumns" | "perPage" | "sorting"> & {
5
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<(Omit<DataTableOwnProps<T>, "search" | "cursor" | "page" | "filters" | "expanded" | "selection" | "columnSearch" | "hiddenColumns" | "perPage" | "sorting"> & {
6
6
  page?: number;
7
7
  perPage?: number;
8
8
  search?: string;
9
9
  expanded?: string[];
10
10
  selection?: string[];
11
+ cursor?: PaginationCursor;
11
12
  filters?: DataTableFilters;
12
13
  sorting?: DataTableSorting;
13
14
  hiddenColumns?: string[];
14
15
  columnSearch?: DataTableColumnSearch;
15
16
  }) & {
17
+ "onUpdate:cursor"?: ((value: PaginationCursor | undefined) => any) | undefined;
16
18
  "onUpdate:page"?: ((value: number | undefined) => any) | undefined;
17
19
  "onUpdate:perPage"?: ((value: number | undefined) => any) | undefined;
18
20
  "onUpdate:search"?: ((value: string | undefined) => any) | undefined;
@@ -30,7 +32,7 @@ declare const __VLS_export: <T extends Record<string, unknown>>(__VLS_props: Non
30
32
  slots: DataTableSlots<T> & {
31
33
  [x: `item.${string}`]: ((props: DataTableItemSlotProps<T>) => VNodeChild) | undefined;
32
34
  };
33
- emit: ((event: "update:page", value: number | undefined) => void) & ((event: "update:perPage", value: number | undefined) => void) & ((event: "update:search", value: string | undefined) => void) & ((event: "update:expanded", value: string[] | undefined) => void) & ((event: "update:selection", value: string[] | undefined) => void) & ((event: "update:filters", value: DataTableFilters | undefined) => void) & ((event: "update:sorting", value: DataTableSorting | undefined) => void) & ((event: "update:hiddenColumns", value: string[] | undefined) => void) & ((event: "update:columnSearch", value: DataTableColumnSearch | undefined) => void);
35
+ emit: ((event: "update:cursor", value: PaginationCursor | undefined) => void) & ((event: "update:page", value: number | undefined) => void) & ((event: "update:perPage", value: number | undefined) => void) & ((event: "update:search", value: string | undefined) => void) & ((event: "update:expanded", value: string[] | undefined) => void) & ((event: "update:selection", value: string[] | undefined) => void) & ((event: "update:filters", value: DataTableFilters | undefined) => void) & ((event: "update:sorting", value: DataTableSorting | undefined) => void) & ((event: "update:hiddenColumns", value: string[] | undefined) => void) & ((event: "update:columnSearch", value: DataTableColumnSearch | undefined) => void);
34
36
  }>) => import('vue').VNode & {
35
37
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
36
38
  };