@bridge-ui/vue 0.9.0 → 0.10.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 (26) hide show
  1. package/ai/skills/bridge-ui-forms/SKILL.md +1 -1
  2. package/dist/Actions/Dialog/BridgeDialogHost.vue_vue_type_script_setup_true_lang.js +16 -13
  3. package/dist/Actions/Dialog/useDialogAction.js +16 -15
  4. package/dist/Actions/Drawer/BridgeDrawerHost.vue_vue_type_script_setup_true_lang.js +19 -16
  5. package/dist/Actions/Drawer/useDrawerAction.js +16 -15
  6. package/dist/Actions/Modal/BridgeModalHost.vue_vue_type_script_setup_true_lang.js +19 -16
  7. package/dist/Actions/Modal/useModalAction.js +16 -15
  8. package/dist/Actions/Snackbar/BridgeSnackbarHost.vue_vue_type_script_setup_true_lang.js +35 -32
  9. package/dist/Actions/Snackbar/BridgeSnackbarItem.vue_vue_type_script_setup_true_lang.js +1 -2
  10. package/dist/Actions/Snackbar/useSnackbarAction.js +17 -16
  11. package/dist/Actions/actionHostRegistry.d.ts +13 -0
  12. package/dist/Actions/actionHostRegistry.js +10 -0
  13. package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +1 -0
  14. package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +2 -2
  15. package/dist/Components/ListItem/composables/useListItem.js +4 -5
  16. package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +38 -36
  17. package/dist/Components/Listbox/composables/useListbox.d.ts +1 -1
  18. package/dist/Components/Listbox/composables/useListbox.js +1 -0
  19. package/dist/Components/Listbox/listbox.types.d.ts +7 -0
  20. package/dist/Components/Select/composables/useSelect.d.ts +1 -0
  21. package/dist/Components/Snackbar/composables/useSnackbar.js +109 -108
  22. package/docs/components/Autocomplete.md +14 -0
  23. package/docs/components/BridgeUIProvider.md +13 -1
  24. package/docs/components/Menu.md +1 -0
  25. package/docs/components/Select.md +14 -0
  26. package/package.json +2 -2
@@ -45,4 +45,4 @@ Controlled fields: **`v-model` / `modelValue`**. Never React `value`/`onChange`.
45
45
  1. Map validation to `error`, `error-message`, `description`, `disabled`, `readOnly`.
46
46
  2. Native input attrs often go through `:custom-props` → `input` — see TextField docs.
47
47
  3. Use only documented option shapes for Select/Autocomplete.
48
- 4. Prefer public fields/controls in apps. `FormField`, `FormControl`, and `BaseField` are exported building blocks for advanced composition. Theme shared chrome via `components.FormField` / `FormControl` / `BaseField` (a public entry such as `components.TextField` still overrides `defaultProps`). Chrome tokens live on those shared keys. Dropdown tokens live on `components.Listbox`. Time overlay chrome: `components.TimePanel` (`TimePicker` / `TimeRangePicker` override). Shared form density: `global.formDefaults: { size, rounded }` (Radio/Switch/BaseField/FormControl ignore `rounded`).
48
+ 4. Prefer public fields/controls in apps. `FormField`, `FormControl`, and `BaseField` are exported building blocks for advanced composition. Theme shared chrome via `components.FormField` / `FormControl` / `BaseField` (a public entry such as `components.TextField` still overrides `defaultProps`). Chrome tokens live on those shared keys. Dropdown tokens live on `components.Listbox` (`defaultProps.matchWidth` matches the field). Time overlay chrome: `components.TimePanel` (`TimePicker` / `TimeRangePicker` override). Shared form density: `global.formDefaults: { size, rounded }` (Radio/Switch/BaseField/FormControl ignore `rounded`).
@@ -1,20 +1,23 @@
1
- import { BRIDGE_DIALOG_INJECTION_KEY as e } from "./bridgeDialogInjectionKey.js";
2
- import t from "./BridgeDialogItem.js";
3
- import { createBridgeDialogApi as n } from "./createBridgeDialogApi.js";
4
- import { Fragment as r, computed as i, createBlock as a, createElementBlock as o, defineComponent as s, inject as c, openBlock as l, provide as u, renderList as d, renderSlot as f, unref as p } from "vue";
1
+ import { dialogActionHosts as e, registerActionHost as t } from "../actionHostRegistry.js";
2
+ import { BRIDGE_DIALOG_INJECTION_KEY as n } from "./bridgeDialogInjectionKey.js";
3
+ import r from "./BridgeDialogItem.js";
4
+ import { createBridgeDialogApi as i } from "./createBridgeDialogApi.js";
5
+ import { Fragment as a, computed as o, createBlock as s, createElementBlock as c, defineComponent as l, inject as u, openBlock as d, provide as f, renderList as p, renderSlot as m, unref as h } from "vue";
5
6
  //#region src/Actions/Dialog/BridgeDialogHost.vue?vue&type=script&setup=true&lang.ts
6
- var m = "[Bridge UI] Nested <BridgeDialogHost /> detected. useDialogAction() will target the nearest host only. Remove the extra host.", h = /*@__PURE__*/ s({
7
+ var g = "[Bridge UI] Nested <BridgeDialogHost /> detected. useDialogAction() will target the nearest host only. Remove the extra host.", _ = /*@__PURE__*/ l({
7
8
  __name: "BridgeDialogHost",
8
9
  props: { modal: {} },
9
- setup(s) {
10
- let h = s;
11
- c(e, null) && process.env.NODE_ENV !== "production" && console.warn(m);
12
- let g = n(), _ = i(() => g.entries.value);
13
- return u(e, g), (e, n) => (l(), o(r, null, [f(e.$slots, "default"), (l(!0), o(r, null, d(_.value, (e) => (l(), a(t, {
14
- api: p(g),
10
+ setup(l) {
11
+ let _ = l;
12
+ u(n, null) && process.env.NODE_ENV !== "production" && console.warn(g);
13
+ let v = i();
14
+ t(e, v);
15
+ let y = o(() => v.entries.value);
16
+ return f(n, v), (e, t) => (d(), c(a, null, [m(e.$slots, "default"), (d(!0), c(a, null, p(y.value, (e) => (d(), s(r, {
17
+ api: h(v),
15
18
  entry: e,
16
19
  key: e.id,
17
- "host-modal": h.modal
20
+ "host-modal": _.modal
18
21
  }, null, 8, [
19
22
  "api",
20
23
  "entry",
@@ -23,4 +26,4 @@ var m = "[Bridge UI] Nested <BridgeDialogHost /> detected. useDialogAction() wil
23
26
  }
24
27
  });
25
28
  //#endregion
26
- export { h as default };
29
+ export { _ as default };
@@ -1,26 +1,27 @@
1
- import { BRIDGE_DIALOG_INJECTION_KEY as e } from "./bridgeDialogInjectionKey.js";
2
- import { computed as t, inject as n } from "vue";
3
- import { getLayerCount as r } from "@bridge-ui/core/Layer";
1
+ import { dialogActionHosts as e } from "../actionHostRegistry.js";
2
+ import { BRIDGE_DIALOG_INJECTION_KEY as t } from "./bridgeDialogInjectionKey.js";
3
+ import { computed as n, inject as r } from "vue";
4
+ import { getLayerCount as i } from "@bridge-ui/core/Layer";
4
5
  //#region src/Actions/Dialog/useDialogAction.ts
5
- var i = class extends Error {
6
+ var a = class extends Error {
6
7
  constructor() {
7
8
  super("useDialogAction() requires <BridgeDialogHost /> in the app tree."), this.name = "BridgeDialogHostMissingError";
8
9
  }
9
10
  };
10
- function a() {
11
- let a = n(e, null);
12
- if (!a) throw new i();
13
- let o = t(() => r(a.entries.value));
11
+ function o() {
12
+ let o = e.resolve(r(t, null));
13
+ if (!o) throw new a();
14
+ let s = n(() => i(o.entries.value));
14
15
  return {
15
- open: a.open,
16
- close: a.close,
17
- isOpen: a.isOpen,
18
- update: a.update,
19
- closeTop: a.closeTop,
16
+ open: o.open,
17
+ close: o.close,
18
+ isOpen: o.isOpen,
19
+ update: o.update,
20
+ closeTop: o.closeTop,
20
21
  get stackSize() {
21
- return o.value;
22
+ return s.value;
22
23
  }
23
24
  };
24
25
  }
25
26
  //#endregion
26
- export { i as BridgeDialogHostMissingError, a as useDialogAction };
27
+ export { a as BridgeDialogHostMissingError, o as useDialogAction };
@@ -1,26 +1,29 @@
1
1
  import e from "../../Components/Drawer/Drawer.js";
2
- import { BRIDGE_DRAWER_INJECTION_KEY as t } from "./bridgeDrawerInjectionKey.js";
3
- import { createBridgeDrawerApi as n } from "./createBridgeDrawerApi.js";
4
- import { Fragment as r, computed as i, createBlock as a, createElementBlock as o, defineComponent as s, inject as c, mergeProps as l, openBlock as u, provide as d, renderList as f, renderSlot as p, resolveDynamicComponent as m, unref as h, withCtx as g } from "vue";
5
- import { completeLayerHide as _, invokeLayerDismiss as v, mergeLayerShellProps as y } from "@bridge-ui/core/Layer";
2
+ import { drawerActionHosts as t, registerActionHost as n } from "../actionHostRegistry.js";
3
+ import { BRIDGE_DRAWER_INJECTION_KEY as r } from "./bridgeDrawerInjectionKey.js";
4
+ import { createBridgeDrawerApi as i } from "./createBridgeDrawerApi.js";
5
+ import { Fragment as a, computed as o, createBlock as s, createElementBlock as c, defineComponent as l, inject as u, mergeProps as d, openBlock as f, provide as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, unref as _, withCtx as v } from "vue";
6
+ import { completeLayerHide as y, invokeLayerDismiss as b, mergeLayerShellProps as x } from "@bridge-ui/core/Layer";
6
7
  //#region src/Actions/Drawer/BridgeDrawerHost.vue?vue&type=script&setup=true&lang.ts
7
- var b = "[Bridge UI] Nested <BridgeDrawerHost /> detected. useDrawerAction() will target the nearest host only. Remove the extra host.", x = /*@__PURE__*/ s({
8
+ var S = "[Bridge UI] Nested <BridgeDrawerHost /> detected. useDrawerAction() will target the nearest host only. Remove the extra host.", C = /*@__PURE__*/ l({
8
9
  __name: "BridgeDrawerHost",
9
10
  props: { drawer: {} },
10
- setup(s) {
11
- let x = s;
12
- c(t, null) && process.env.NODE_ENV !== "production" && console.warn(b);
13
- let S = n(), C = i(() => S.entries.value);
14
- return d(t, S), (t, n) => (u(), o(r, null, [p(t.$slots, "default"), (u(!0), o(r, null, f(C.value, (t) => (u(), a(h(e), l({
11
+ setup(l) {
12
+ let C = l;
13
+ u(r, null) && process.env.NODE_ENV !== "production" && console.warn(S);
14
+ let w = i();
15
+ n(t, w);
16
+ let T = o(() => w.entries.value);
17
+ return p(r, w), (t, n) => (f(), c(a, null, [h(t.$slots, "default"), (f(!0), c(a, null, m(T.value, (t) => (f(), s(_(e), d({
15
18
  key: t.id,
16
19
  "stack-id": t.id,
17
20
  "model-value": t.show,
18
- "onUpdate:modelValue": (e) => h(S).syncShow(t.id, e)
19
- }, { ref_for: !0 }, h(y)(x.drawer, t.drawer), {
20
- onClose: (e) => h(v)(h(S).entries.value, t.id),
21
- onShowChange: (e) => h(_)(h(S).entries.value, t.id, e, h(S).removeEntry)
21
+ "onUpdate:modelValue": (e) => _(w).syncShow(t.id, e)
22
+ }, { ref_for: !0 }, _(x)(C.drawer, t.drawer), {
23
+ onClose: (e) => _(b)(_(w).entries.value, t.id),
24
+ onShowChange: (e) => _(y)(_(w).entries.value, t.id, e, _(w).removeEntry)
22
25
  }), {
23
- default: g(() => [(u(), a(m(t.component), l({ ref_for: !0 }, t.props), null, 16))]),
26
+ default: v(() => [(f(), s(g(t.component), d({ ref_for: !0 }, t.props), null, 16))]),
24
27
  _: 2
25
28
  }, 1040, [
26
29
  "stack-id",
@@ -32,4 +35,4 @@ var b = "[Bridge UI] Nested <BridgeDrawerHost /> detected. useDrawerAction() wil
32
35
  }
33
36
  });
34
37
  //#endregion
35
- export { x as default };
38
+ export { C as default };
@@ -1,26 +1,27 @@
1
- import { BRIDGE_DRAWER_INJECTION_KEY as e } from "./bridgeDrawerInjectionKey.js";
2
- import { computed as t, inject as n } from "vue";
3
- import { getLayerCount as r } from "@bridge-ui/core/Layer";
1
+ import { drawerActionHosts as e } from "../actionHostRegistry.js";
2
+ import { BRIDGE_DRAWER_INJECTION_KEY as t } from "./bridgeDrawerInjectionKey.js";
3
+ import { computed as n, inject as r } from "vue";
4
+ import { getLayerCount as i } from "@bridge-ui/core/Layer";
4
5
  //#region src/Actions/Drawer/useDrawerAction.ts
5
- var i = class extends Error {
6
+ var a = class extends Error {
6
7
  constructor() {
7
8
  super("useDrawerAction() requires <BridgeDrawerHost /> in the app tree."), this.name = "BridgeDrawerHostMissingError";
8
9
  }
9
10
  };
10
- function a() {
11
- let a = n(e, null);
12
- if (!a) throw new i();
13
- let o = t(() => r(a.entries.value));
11
+ function o() {
12
+ let o = e.resolve(r(t, null));
13
+ if (!o) throw new a();
14
+ let s = n(() => i(o.entries.value));
14
15
  return {
15
- open: a.open,
16
- close: a.close,
17
- isOpen: a.isOpen,
18
- update: a.update,
19
- closeTop: a.closeTop,
16
+ open: o.open,
17
+ close: o.close,
18
+ isOpen: o.isOpen,
19
+ update: o.update,
20
+ closeTop: o.closeTop,
20
21
  get stackSize() {
21
- return o.value;
22
+ return s.value;
22
23
  }
23
24
  };
24
25
  }
25
26
  //#endregion
26
- export { i as BridgeDrawerHostMissingError, a as useDrawerAction };
27
+ export { a as BridgeDrawerHostMissingError, o as useDrawerAction };
@@ -1,26 +1,29 @@
1
1
  import e from "../../Components/Modal/Modal.js";
2
- import { BRIDGE_MODAL_INJECTION_KEY as t } from "./bridgeModalInjectionKey.js";
3
- import { createBridgeModalApi as n } from "./createBridgeModalApi.js";
4
- import { Fragment as r, computed as i, createBlock as a, createElementBlock as o, defineComponent as s, inject as c, mergeProps as l, openBlock as u, provide as d, renderList as f, renderSlot as p, resolveDynamicComponent as m, unref as h, withCtx as g } from "vue";
5
- import { completeLayerHide as _, invokeLayerDismiss as v, mergeLayerShellProps as y } from "@bridge-ui/core/Layer";
2
+ import { modalActionHosts as t, registerActionHost as n } from "../actionHostRegistry.js";
3
+ import { BRIDGE_MODAL_INJECTION_KEY as r } from "./bridgeModalInjectionKey.js";
4
+ import { createBridgeModalApi as i } from "./createBridgeModalApi.js";
5
+ import { Fragment as a, computed as o, createBlock as s, createElementBlock as c, defineComponent as l, inject as u, mergeProps as d, openBlock as f, provide as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, unref as _, withCtx as v } from "vue";
6
+ import { completeLayerHide as y, invokeLayerDismiss as b, mergeLayerShellProps as x } from "@bridge-ui/core/Layer";
6
7
  //#region src/Actions/Modal/BridgeModalHost.vue?vue&type=script&setup=true&lang.ts
7
- var b = "[Bridge UI] Nested <BridgeModalHost /> detected. useModalAction() will target the nearest host only. Remove the extra host.", x = /*@__PURE__*/ s({
8
+ var S = "[Bridge UI] Nested <BridgeModalHost /> detected. useModalAction() will target the nearest host only. Remove the extra host.", C = /*@__PURE__*/ l({
8
9
  __name: "BridgeModalHost",
9
10
  props: { modal: {} },
10
- setup(s) {
11
- let x = s;
12
- c(t, null) && process.env.NODE_ENV !== "production" && console.warn(b);
13
- let S = n(), C = i(() => S.entries.value);
14
- return d(t, S), (t, n) => (u(), o(r, null, [p(t.$slots, "default"), (u(!0), o(r, null, f(C.value, (t) => (u(), a(h(e), l({
11
+ setup(l) {
12
+ let C = l;
13
+ u(r, null) && process.env.NODE_ENV !== "production" && console.warn(S);
14
+ let w = i();
15
+ n(t, w);
16
+ let T = o(() => w.entries.value);
17
+ return p(r, w), (t, n) => (f(), c(a, null, [h(t.$slots, "default"), (f(!0), c(a, null, m(T.value, (t) => (f(), s(_(e), d({
15
18
  key: t.id,
16
19
  "stack-id": t.id,
17
20
  "model-value": t.show
18
- }, { ref_for: !0 }, h(y)(x.modal, t.modal), {
19
- "onUpdate:modelValue": (e) => h(S).syncShow(t.id, e),
20
- onClose: (e) => h(v)(h(S).entries.value, t.id),
21
- onShowChange: (e) => h(_)(h(S).entries.value, t.id, e, h(S).removeEntry)
21
+ }, { ref_for: !0 }, _(x)(C.modal, t.modal), {
22
+ "onUpdate:modelValue": (e) => _(w).syncShow(t.id, e),
23
+ onClose: (e) => _(b)(_(w).entries.value, t.id),
24
+ onShowChange: (e) => _(y)(_(w).entries.value, t.id, e, _(w).removeEntry)
22
25
  }), {
23
- default: g(() => [(u(), a(m(t.component), l({ ref_for: !0 }, t.props), null, 16))]),
26
+ default: v(() => [(f(), s(g(t.component), d({ ref_for: !0 }, t.props), null, 16))]),
24
27
  _: 2
25
28
  }, 1040, [
26
29
  "stack-id",
@@ -32,4 +35,4 @@ var b = "[Bridge UI] Nested <BridgeModalHost /> detected. useModalAction() will
32
35
  }
33
36
  });
34
37
  //#endregion
35
- export { x as default };
38
+ export { C as default };
@@ -1,26 +1,27 @@
1
- import { BRIDGE_MODAL_INJECTION_KEY as e } from "./bridgeModalInjectionKey.js";
2
- import { computed as t, inject as n } from "vue";
3
- import { getLayerCount as r } from "@bridge-ui/core/Layer";
1
+ import { modalActionHosts as e } from "../actionHostRegistry.js";
2
+ import { BRIDGE_MODAL_INJECTION_KEY as t } from "./bridgeModalInjectionKey.js";
3
+ import { computed as n, inject as r } from "vue";
4
+ import { getLayerCount as i } from "@bridge-ui/core/Layer";
4
5
  //#region src/Actions/Modal/useModalAction.ts
5
- var i = class extends Error {
6
+ var a = class extends Error {
6
7
  constructor() {
7
8
  super("useModalAction() requires <BridgeModalHost /> in the app tree."), this.name = "BridgeModalHostMissingError";
8
9
  }
9
10
  };
10
- function a() {
11
- let a = n(e, null);
12
- if (!a) throw new i();
13
- let o = t(() => r(a.entries.value));
11
+ function o() {
12
+ let o = e.resolve(r(t, null));
13
+ if (!o) throw new a();
14
+ let s = n(() => i(o.entries.value));
14
15
  return {
15
- open: a.open,
16
- close: a.close,
17
- isOpen: a.isOpen,
18
- update: a.update,
19
- closeTop: a.closeTop,
16
+ open: o.open,
17
+ close: o.close,
18
+ isOpen: o.isOpen,
19
+ update: o.update,
20
+ closeTop: o.closeTop,
20
21
  get stackSize() {
21
- return o.value;
22
+ return s.value;
22
23
  }
23
24
  };
24
25
  }
25
26
  //#endregion
26
- export { i as BridgeModalHostMissingError, a as useModalAction };
27
+ export { a as BridgeModalHostMissingError, o as useModalAction };
@@ -1,13 +1,14 @@
1
1
  import { useBridgeUI as e } from "../../Provider/useBridgeUI.js";
2
- import { BRIDGE_SNACKBAR_INJECTION_KEY as t } from "./bridgeSnackbarInjectionKey.js";
3
- import n from "./BridgeSnackbarItem.js";
4
- import { createBridgeSnackbarApi as r } from "./createBridgeSnackbarApi.js";
5
- import { Fragment as i, Teleport as a, computed as o, createBlock as s, createElementBlock as c, createElementVNode as l, defineComponent as u, inject as d, normalizeClass as f, openBlock as p, provide as m, renderList as h, renderSlot as g, unref as _ } from "vue";
6
- import { get as v } from "es-toolkit/compat";
7
- import { snackbarPositionProps as y } from "@bridge-ui/core/Tokens";
8
- import { cn as b, mergeBridgeUILayeredClasses as x } from "@bridge-ui/core/Utils";
2
+ import { registerActionHost as t, snackbarActionHosts as n } from "../actionHostRegistry.js";
3
+ import { BRIDGE_SNACKBAR_INJECTION_KEY as r } from "./bridgeSnackbarInjectionKey.js";
4
+ import i from "./BridgeSnackbarItem.js";
5
+ import { createBridgeSnackbarApi as a } from "./createBridgeSnackbarApi.js";
6
+ import { Fragment as o, Teleport as s, computed as c, createBlock as l, createElementBlock as u, createElementVNode as d, defineComponent as f, inject as p, normalizeClass as m, openBlock as h, provide as g, renderList as _, renderSlot as v, unref as y } from "vue";
7
+ import { get as b } from "es-toolkit/compat";
8
+ import { snackbarPositionProps as x } from "@bridge-ui/core/Tokens";
9
+ import { cn as S, mergeBridgeUILayeredClasses as C } from "@bridge-ui/core/Utils";
9
10
  //#region src/Actions/Snackbar/BridgeSnackbarHost.vue?vue&type=script&setup=true&lang.ts
10
- var S = "[Bridge UI] Nested <BridgeSnackbarHost /> detected. useSnackbarAction() will target the nearest host only. Remove the extra host.", C = /*@__PURE__*/ u({
11
+ var w = "[Bridge UI] Nested <BridgeSnackbarHost /> detected. useSnackbarAction() will target the nearest host only. Remove the extra host.", T = /*@__PURE__*/ f({
11
12
  __name: "BridgeSnackbarHost",
12
13
  props: {
13
14
  max: {},
@@ -19,35 +20,37 @@ var S = "[Bridge UI] Nested <BridgeSnackbarHost /> detected. useSnackbarAction()
19
20
  },
20
21
  timeout: { type: [Boolean, Number] }
21
22
  },
22
- setup(u) {
23
- let C = u;
24
- d(t, null) && process.env.NODE_ENV !== "production" && console.warn(S);
25
- let w = r({
26
- max: C.max,
27
- timeout: C.timeout
28
- }), T = e();
29
- m(t, w);
30
- let E = o(() => w.entries.value), D = o(() => T?.components.value.Snackbar), O = o(() => C.position ?? D.value?.defaultProps?.position ?? "bottom-center"), k = o(() => {
31
- let e = x(y, D.value?.tokens?.position);
32
- return v(e, O.value);
33
- }), A = o(() => C.teleportTo === !1), j = o(() => C.teleportTo === !1 ? "body" : C.teleportTo), M = o(() => O.value.startsWith("top") ? "flex-col" : "flex-col-reverse");
34
- return (e, t) => (p(), c(i, null, [g(e.$slots, "default"), (p(), s(a, {
35
- to: j.value,
36
- disabled: A.value
37
- }, [l("div", {
23
+ setup(f) {
24
+ let T = f;
25
+ p(r, null) && process.env.NODE_ENV !== "production" && console.warn(w);
26
+ let E = a({
27
+ max: T.max,
28
+ timeout: T.timeout
29
+ });
30
+ t(n, E);
31
+ let D = e();
32
+ g(r, E);
33
+ let O = c(() => E.entries.value), k = c(() => D?.components.value.Snackbar), A = c(() => T.position ?? k.value?.defaultProps?.position ?? "bottom-center"), j = c(() => {
34
+ let e = C(x, k.value?.tokens?.position);
35
+ return b(e, A.value);
36
+ }), M = c(() => T.teleportTo === !1), N = c(() => T.teleportTo === !1 ? "body" : T.teleportTo), P = c(() => A.value.startsWith("top") ? "flex-col" : "flex-col-reverse");
37
+ return (e, t) => (h(), u(o, null, [v(e.$slots, "default"), (h(), l(s, {
38
+ to: N.value,
39
+ disabled: M.value
40
+ }, [d("div", {
38
41
  "data-snackbar-host": "",
39
- class: f(_(b)({
42
+ class: m(y(S)({
40
43
  "fixed inset-0 z-40 flex pointer-events-none px-4 py-6 sm:p-5 sm:pt-4": !0,
41
- [k.value ?? ""]: !0
44
+ [j.value ?? ""]: !0
42
45
  }))
43
- }, [l("div", { class: f(_(b)({
46
+ }, [d("div", { class: m(y(S)({
44
47
  "flex w-full max-w-sm gap-y-2 pointer-events-auto": !0,
45
- [M.value]: !0
46
- })) }, [(p(!0), c(i, null, h(E.value, (e) => (p(), s(n, {
47
- api: _(w),
48
+ [P.value]: !0
49
+ })) }, [(h(!0), u(o, null, _(O.value, (e) => (h(), l(i, {
50
+ api: y(E),
48
51
  entry: e,
49
52
  key: e.id,
50
- "host-snackbar": C.snackbar
53
+ "host-snackbar": T.snackbar
51
54
  }, null, 8, [
52
55
  "api",
53
56
  "entry",
@@ -56,4 +59,4 @@ var S = "[Bridge UI] Nested <BridgeSnackbarHost /> detected. useSnackbarAction()
56
59
  }
57
60
  });
58
61
  //#endregion
59
- export { C as default };
62
+ export { T as default };
@@ -28,8 +28,7 @@ var y = { class: "flex flex-col border-l border-dark-200 dark:border-dark-700" }
28
28
  "model-value": l.entry.show,
29
29
  onClose: O,
30
30
  "onUpdate:modelValue": g[5] ||= (e) => l.api.syncShow(l.entry.id, e),
31
- onLeaveComplete: g[6] ||= () => p(h)(l.api.entries.value, l.entry.id, !1, l.api.removeEntry),
32
- onShowChange: g[7] ||= (e) => p(h)(l.api.entries.value, l.entry.id, e, l.api.removeEntry)
31
+ onLeaveComplete: g[6] ||= () => p(h)(l.api.entries.value, l.entry.id, !1, l.api.removeEntry)
33
32
  }), s({ _: 2 }, [
34
33
  M.value ? {
35
34
  name: "actions",
@@ -1,27 +1,28 @@
1
- import { BRIDGE_SNACKBAR_INJECTION_KEY as e } from "./bridgeSnackbarInjectionKey.js";
2
- import { computed as t, inject as n } from "vue";
3
- import { getLayerCount as r } from "@bridge-ui/core/Layer";
1
+ import { snackbarActionHosts as e } from "../actionHostRegistry.js";
2
+ import { BRIDGE_SNACKBAR_INJECTION_KEY as t } from "./bridgeSnackbarInjectionKey.js";
3
+ import { computed as n, inject as r } from "vue";
4
+ import { getLayerCount as i } from "@bridge-ui/core/Layer";
4
5
  //#region src/Actions/Snackbar/useSnackbarAction.ts
5
- var i = class extends Error {
6
+ var a = class extends Error {
6
7
  constructor() {
7
8
  super("useSnackbarAction() requires <BridgeSnackbarHost /> in the app tree."), this.name = "BridgeSnackbarHostMissingError";
8
9
  }
9
10
  };
10
- function a() {
11
- let a = n(e, null);
12
- if (!a) throw new i();
13
- let o = t(() => r(a.entries.value));
11
+ function o() {
12
+ let o = e.resolve(r(t, null));
13
+ if (!o) throw new a();
14
+ let s = n(() => i(o.entries.value));
14
15
  return {
15
- open: a.open,
16
- close: a.close,
17
- isOpen: a.isOpen,
18
- update: a.update,
19
- closeTop: a.closeTop,
20
- closeAll: a.closeAll,
16
+ open: o.open,
17
+ close: o.close,
18
+ isOpen: o.isOpen,
19
+ update: o.update,
20
+ closeTop: o.closeTop,
21
+ closeAll: o.closeAll,
21
22
  get stackSize() {
22
- return o.value;
23
+ return s.value;
23
24
  }
24
25
  };
25
26
  }
26
27
  //#endregion
27
- export { i as BridgeSnackbarHostMissingError, a as useSnackbarAction };
28
+ export { a as BridgeSnackbarHostMissingError, o as useSnackbarAction };
@@ -0,0 +1,13 @@
1
+ import { ActionHostRegistry } from '@bridge-ui/core/Layer';
2
+ import { BridgeDialogController } from './Dialog/bridgeDialog.types';
3
+ import { BridgeDrawerController } from './Drawer/bridgeDrawer.types';
4
+ import { BridgeModalController } from './Modal/bridgeModal.types';
5
+ import { BridgeSnackbarController } from './Snackbar/bridgeSnackbar.types';
6
+ export declare const dialogActionHosts: ActionHostRegistry<BridgeDialogController>;
7
+ export declare const drawerActionHosts: ActionHostRegistry<BridgeDrawerController>;
8
+ export declare const modalActionHosts: ActionHostRegistry<BridgeModalController>;
9
+ export declare const snackbarActionHosts: ActionHostRegistry<BridgeSnackbarController>;
10
+ /**
11
+ * Registers `api` until the current component unmounts.
12
+ */
13
+ export declare function registerActionHost<T>(registry: ActionHostRegistry<T>, api: T): void;
@@ -0,0 +1,10 @@
1
+ import { onUnmounted as e } from "vue";
2
+ import { createActionHostRegistry as t } from "@bridge-ui/core/Layer";
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);
8
+ }
9
+ //#endregion
10
+ export { n as dialogActionHosts, r as drawerActionHosts, i as modalActionHosts, o as registerActionHost, a as snackbarActionHosts };
@@ -744,6 +744,7 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
744
744
  listboxId: string;
745
745
  loading: boolean;
746
746
  loadingMessage: string;
747
+ matchWidth?: boolean;
747
748
  maxHeight: string;
748
749
  multiple: boolean;
749
750
  options: import('@bridge-ui/core/Domain').ListboxOption[];
@@ -27,8 +27,8 @@ var _e = { class: "min-w-0 flex-1" }, ve = { class: "flex shrink-0 items-center
27
27
  class: "inline-flex items-center rounded-lg border border-dark-200 bg-white p-0.5 dark:border-dark-700 dark:bg-dark-900"
28
28
  }, be = { class: "relative" }, xe = {
29
29
  key: 1,
30
- class: "flex w-full min-w-0 items-center gap-1.5 leading-none"
31
- }, O = { class: "min-w-0 truncate leading-none" }, k = [
30
+ class: "flex w-full min-w-0 items-center gap-1.5"
31
+ }, O = { class: "min-w-0 truncate leading-normal" }, k = [
32
32
  "aria-expanded",
33
33
  "aria-label",
34
34
  "onClick"
@@ -88,11 +88,10 @@ function S(S, C, w) {
88
88
  [M.value?.mergedClasses.optionHighlighted ?? ""]: F.value && R.value && !I.value,
89
89
  "opacity-50 pointer-events-none": A.value.disabled,
90
90
  [m(B.value, "interactive") ?? ""]: !0,
91
- [M.value?.sizeClasses?.option ?? ""]: F.value,
92
- "leading-none": !0
91
+ [M.value?.sizeClasses?.option ?? ""]: F.value
93
92
  })
94
93
  }) : null), X = s(() => y({
95
- "flex w-full min-w-0 items-center gap-x-2 leading-none": !0,
94
+ "flex w-full min-w-0 items-center gap-x-2": !0,
96
95
  "rounded-md text-dark-900 dark:text-dark-100": !J.value,
97
96
  "px-2": !J.value,
98
97
  "py-1.5": !J.value && !V.value,
@@ -107,9 +106,9 @@ function S(S, C, w) {
107
106
  "block truncate text-sm font-medium": !0,
108
107
  [M.value?.sizeClasses?.primary ?? ""]: F.value,
109
108
  [m(B.value, "primary") ?? ""]: !0,
110
- "leading-none": !0
109
+ "leading-normal": !0
111
110
  }))), ee = s(() => t(z.value?.secondary, {}, y({
112
- "mt-0.5 block truncate text-xs text-dark-500 dark:text-dark-400": !0,
111
+ "mt-0.5 block truncate text-xs leading-normal text-dark-500 dark:text-dark-400": !0,
113
112
  [M.value?.sizeClasses?.secondary ?? ""]: F.value,
114
113
  [m(B.value, "secondary") ?? ""]: !0
115
114
  })));
@@ -2,21 +2,21 @@ import { useResolveMessage as e } from "../../Adapters/I18n/useI18nAdapter.js";
2
2
  import { hasNamedSlot as t } from "../../Utils/slotOrProp.js";
3
3
  import { mergeNestedComponentProps as n } from "../../Utils/index.js";
4
4
  import ee from "../ActionFooter/ActionFooter.js";
5
- import { useListbox as r } from "./composables/useListbox.js";
6
- import i from "../FieldOverlay/FieldOverlay.js";
7
- import a from "../List/List.js";
8
- import { LISTBOX_INJECTION_KEY as o } from "./listboxInjectionKey.js";
9
- import te from "../ListItem/ListItem.js";
10
- import ne from "../ListSection/ListSection.js";
11
- import re from "../Progress/Progress.js";
12
- import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as ie, createVNode as p, defineComponent as m, guardReactiveProps as h, mergeModels as g, mergeProps as _, normalizeClass as v, normalizeProps as y, openBlock as b, provide as x, ref as S, renderList as ae, renderSlot as C, toDisplayString as w, unref as T, useModel as oe, useSlots as se, watch as E, withCtx as D } from "vue";
13
- import { isNil as ce } from "es-toolkit/compat";
14
- import { entriesFromListboxOptions as le, flattenListboxOptions as ue, mapListboxEntriesToRows as O, upsertListboxOption as k } from "@bridge-ui/core/Domain";
5
+ import { useListbox as te } from "./composables/useListbox.js";
6
+ import r from "../FieldOverlay/FieldOverlay.js";
7
+ import i from "../List/List.js";
8
+ import { LISTBOX_INJECTION_KEY as a } from "./listboxInjectionKey.js";
9
+ import ne from "../ListItem/ListItem.js";
10
+ import re from "../ListSection/ListSection.js";
11
+ import ie from "../Progress/Progress.js";
12
+ import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as ae, createVNode as f, defineComponent as p, guardReactiveProps as m, mergeModels as h, mergeProps as g, normalizeClass as _, normalizeProps as v, openBlock as y, provide as b, ref as x, renderList as S, renderSlot as C, toDisplayString as w, unref as T, useModel as oe, useSlots as se, watch as E, withCtx as D } from "vue";
13
+ import { isNil as O } from "es-toolkit/compat";
14
+ import { entriesFromListboxOptions as ce, flattenListboxOptions as le, mapListboxEntriesToRows as ue, upsertListboxOption as k } from "@bridge-ui/core/Domain";
15
15
  import { cn as A } from "@bridge-ui/core/Utils";
16
16
  //#region src/Components/Listbox/Listbox.vue?vue&type=script&setup=true&lang.ts
17
- var j = { key: 1 }, M = /*@__PURE__*/ m({
17
+ var j = { key: 1 }, M = /*@__PURE__*/ p({
18
18
  __name: "Listbox",
19
- props: /*@__PURE__*/ g({
19
+ props: /*@__PURE__*/ h({
20
20
  anchorEl: {},
21
21
  classes: {},
22
22
  color: { default: "primary" },
@@ -42,6 +42,7 @@ var j = { key: 1 }, M = /*@__PURE__*/ m({
42
42
  default: !1
43
43
  },
44
44
  loadingMessage: {},
45
+ matchWidth: { type: Boolean },
45
46
  maxHeight: {},
46
47
  multiple: {
47
48
  type: Boolean,
@@ -67,22 +68,22 @@ var j = { key: 1 }, M = /*@__PURE__*/ m({
67
68
  },
68
69
  modelModifiers: {}
69
70
  }),
70
- emits: /*@__PURE__*/ g([
71
+ emits: /*@__PURE__*/ h([
71
72
  "apply",
72
73
  "cancel",
73
74
  "registered-options-change",
74
75
  "select",
75
76
  "show-change"
76
77
  ], ["update:modelValue"]),
77
- setup(m, { emit: g }) {
78
- let M = se(), N = g, P = oe(m, "modelValue");
78
+ setup(p, { emit: h }) {
79
+ let M = se(), N = h, P = oe(p, "modelValue");
79
80
  E(P, (e) => {
80
81
  N("show-change", e);
81
82
  });
82
- let F = m, I = e(), L = c(() => F.emptyMessage ?? I("No options")), R = c(() => F.loadingMessage ?? I("Loading...")), { merged: z, checkClass: B, scrollBind: V, footerBind: H, showFooter: U, messageBind: W, surfaceBind: de, sizeClasses: fe, mergedClasses: G, applyButtonProps: pe, optionHoverClass: me, cancelButtonProps: he, optionSelectedClass: ge, optionHighlightedClass: _e } = r(F, {
83
+ let F = p, I = e(), L = s(() => F.emptyMessage ?? I("No options")), R = s(() => F.loadingMessage ?? I("Loading...")), { merged: z, checkClass: B, scrollBind: V, footerBind: H, showFooter: U, messageBind: W, surfaceBind: de, sizeClasses: fe, mergedClasses: G, applyButtonProps: pe, optionHoverClass: me, cancelButtonProps: he, optionSelectedClass: ge, optionHighlightedClass: _e } = te(F, {
83
84
  size: "md",
84
85
  color: "primary"
85
- }), ve = c(() => F.options ?? []), K = c(() => F.entries ? F.entries : le(ve.value)), q = c(() => ue(K.value)), J = c(() => t(M, "default")), Y = c(() => !F.loading && !J.value && q.value.length === 0 && F.hideEmptyMessage !== !0), ye = c(() => A(B.value, G.value.check)), X = S([]);
86
+ }), ve = s(() => F.options ?? []), K = s(() => F.entries ? F.entries : ce(ve.value)), q = s(() => le(K.value)), J = s(() => t(M, "default")), Y = s(() => !F.loading && !J.value && q.value.length === 0 && F.hideEmptyMessage !== !0), ye = s(() => A(B.value, G.value.check)), X = x([]);
86
87
  function Z(e) {
87
88
  return F.isSelected?.(e) ?? !1;
88
89
  }
@@ -101,7 +102,7 @@ var j = { key: 1 }, M = /*@__PURE__*/ m({
101
102
  E(X, (e) => {
102
103
  J.value && N("registered-options-change", e);
103
104
  }, { deep: !0 });
104
- let Ce = c(() => ({
105
+ let Ce = s(() => ({
105
106
  getOptionIndex: Se,
106
107
  registerOption: xe,
107
108
  onSelect: be,
@@ -120,18 +121,19 @@ var j = { key: 1 }, M = /*@__PURE__*/ m({
120
121
  optionHighlighted: G.value.optionHighlighted
121
122
  }
122
123
  }));
123
- x(o, Ce);
124
- let we = c(() => O(K.value, Z)), Te = c(() => z.value.customProps?.menu), Ee = c(() => z.value.customProps?.modal), De = c(() => z.value.customProps?.drawer), Oe = c(() => z.value.customProps?.list), ke = c(() => z.value.customProps?.listItem), Ae = c(() => z.value.customProps?.progress), je = c(() => z.value.customProps?.listSection), Me = c(() => ({
124
+ b(a, Ce);
125
+ let we = s(() => ue(K.value, Z)), Te = s(() => z.value.customProps?.menu), Ee = s(() => z.value.customProps?.modal), De = s(() => z.value.customProps?.drawer), Oe = s(() => z.value.customProps?.list), ke = s(() => z.value.customProps?.listItem), Ae = s(() => z.value.customProps?.progress), je = s(() => z.value.customProps?.listSection), Me = s(() => ({
125
126
  modal: Ee.value,
126
127
  drawer: De.value,
127
128
  menu: {
128
129
  anchorEl: F.anchorEl,
129
130
  placement: F.placement,
130
131
  disableAutoFocus: F.disableAutoFocus,
131
- ...ce(F.rounded) ? {} : { rounded: F.rounded },
132
+ ...O(F.rounded) ? {} : { rounded: F.rounded },
133
+ ...O(z.value.matchWidth) ? {} : { matchWidth: z.value.matchWidth },
132
134
  ...Te.value
133
135
  }
134
- })), Ne = c(() => ({
136
+ })), Ne = s(() => ({
135
137
  size: "xs",
136
138
  "aria-hidden": !0,
137
139
  color: z.value.color,
@@ -139,7 +141,7 @@ var j = { key: 1 }, M = /*@__PURE__*/ m({
139
141
  class: "shrink-0",
140
142
  classes: { bar: G.value.loading }
141
143
  })
142
- })), Pe = c(() => ({
144
+ })), Pe = s(() => ({
143
145
  role: "listbox",
144
146
  id: F.listboxId,
145
147
  "aria-labelledby": F.labelledBy,
@@ -152,27 +154,27 @@ var j = { key: 1 }, M = /*@__PURE__*/ m({
152
154
  function $() {
153
155
  N("cancel"), P.value = !1;
154
156
  }
155
- return (e, n) => (b(), l(T(i), {
157
+ return (e, n) => (y(), c(T(r), {
156
158
  modelValue: P.value,
157
159
  "onUpdate:modelValue": n[0] ||= (e) => P.value = e,
158
- overlay: m.overlay,
160
+ overlay: p.overlay,
159
161
  "custom-props": Me.value
160
162
  }, {
161
- default: D(() => [f("div", { class: v(T(de)) }, [
162
- T(t)(T(M), "beforeOptions") ? C(e.$slots, "beforeOptions", {}, void 0, void 0, 0) : u("", !0),
163
- m.loading ? (b(), d(s, { key: 1 }, [p(T(re), y(h(Ne.value)), null, 16), f("div", y(h(T(W))), [T(t)(T(M), "loading") ? C(e.$slots, "loading", {}, void 0, void 0, 0) : (b(), d("span", j, w(R.value), 1))], 16)], 64)) : (b(), d("div", y(_({ key: 2 }, T(V))), [p(T(a), y(h(Pe.value)), {
164
- default: D(() => [J.value ? C(e.$slots, "default", {}, void 0, void 0, 0) : (b(!0), d(s, { key: 1 }, ae(we.value, (n) => (b(), d(s, { key: n.key }, [n.kind === "section" ? (b(), l(T(ne), _({
163
+ default: D(() => [d("div", { class: _(T(de)) }, [
164
+ T(t)(T(M), "beforeOptions") ? C(e.$slots, "beforeOptions", {}, void 0, void 0, 0) : l("", !0),
165
+ p.loading ? (y(), u(o, { key: 1 }, [f(T(ie), v(m(Ne.value)), null, 16), d("div", v(m(T(W))), [T(t)(T(M), "loading") ? C(e.$slots, "loading", {}, void 0, void 0, 0) : (y(), u("span", j, w(R.value), 1))], 16)], 64)) : (y(), u("div", v(g({ key: 2 }, T(V))), [f(T(i), v(m(Pe.value)), {
166
+ default: D(() => [J.value ? C(e.$slots, "default", {}, void 0, void 0, 0) : (y(!0), u(o, { key: 1 }, S(we.value, (n) => (y(), u(o, { key: n.key }, [n.kind === "section" ? (y(), c(T(re), g({
165
167
  key: 0,
166
168
  title: n.title,
167
169
  sticky: n.sticky
168
- }, { ref_for: !0 }, je.value), null, 16, ["title", "sticky"])) : (b(), l(T(te), _({
170
+ }, { ref_for: !0 }, je.value), null, 16, ["title", "sticky"])) : (y(), c(T(ne), g({
169
171
  key: 1,
170
172
  interactive: "",
171
173
  value: n.option.value,
172
174
  disabled: n.option.disabled,
173
175
  secondary: n.option.description,
174
176
  primary: T(t)(T(M), "option") ? void 0 : n.option.label
175
- }, { ref_for: !0 }, ke.value), ie({ _: 2 }, [T(t)(T(M), "option") ? {
177
+ }, { ref_for: !0 }, ke.value), ae({ _: 2 }, [T(t)(T(M), "option") ? {
176
178
  name: "default",
177
179
  fn: D(() => [C(e.$slots, "option", {
178
180
  option: n.option,
@@ -187,19 +189,19 @@ var j = { key: 1 }, M = /*@__PURE__*/ m({
187
189
  ]))], 64))), 128))]),
188
190
  _: 3
189
191
  }, 16)], 16)),
190
- Y.value && !T(t)(T(M), "empty") ? (b(), d("div", y(_({ key: 3 }, T(W))), w(L.value), 17)) : Y.value && T(t)(T(M), "empty") ? C(e.$slots, "empty", {}, void 0, void 0, 4) : u("", !0),
191
- T(t)(T(M), "afterOptions") ? C(e.$slots, "afterOptions", {}, void 0, void 0, 5) : u("", !0),
192
- T(U) ? (b(), d("div", y(_({ key: 6 }, T(H))), [C(e.$slots, "footer", {
192
+ Y.value && !T(t)(T(M), "empty") ? (y(), u("div", v(g({ key: 3 }, T(W))), w(L.value), 17)) : Y.value && T(t)(T(M), "empty") ? C(e.$slots, "empty", {}, void 0, void 0, 4) : l("", !0),
193
+ T(t)(T(M), "afterOptions") ? C(e.$slots, "afterOptions", {}, void 0, void 0, 5) : l("", !0),
194
+ T(U) ? (y(), u("div", v(g({ key: 6 }, T(H))), [C(e.$slots, "footer", {
193
195
  apply: Q,
194
196
  cancel: $
195
- }, () => [p(T(ee), {
197
+ }, () => [f(T(ee), {
196
198
  onApply: Q,
197
199
  onCancel: $,
198
200
  "custom-props": {
199
201
  applyButton: T(pe),
200
202
  cancelButton: T(he)
201
203
  }
202
- }, null, 8, ["custom-props"])])], 16)) : u("", !0)
204
+ }, null, 8, ["custom-props"])])], 16)) : l("", !0)
203
205
  ], 2)]),
204
206
  _: 3
205
207
  }, 8, [
@@ -1,6 +1,6 @@
1
1
  import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
2
2
  import { ListboxClasses, ListboxOwnProps } from '../listbox.types';
3
- export declare const listboxBridgeKeys: readonly ["size", "color", "error", "classes", "maxHeight", "showFooter", "customProps", "disableMaxHeight"];
3
+ export declare const listboxBridgeKeys: readonly ["size", "color", "error", "classes", "maxHeight", "matchWidth", "showFooter", "customProps", "disableMaxHeight"];
4
4
  type ListboxLibDefaults = LibDefaultsShape<ListboxOwnProps, "size" | "color">;
5
5
  type ListboxMerged = MergeLibDefaults<ListboxOwnProps, ListboxLibDefaults>;
6
6
  export declare function useListbox(props: ListboxOwnProps, libDefaults: ListboxLibDefaults): {
@@ -12,6 +12,7 @@ var _ = [
12
12
  "error",
13
13
  "classes",
14
14
  "maxHeight",
15
+ "matchWidth",
15
16
  "showFooter",
16
17
  "customProps",
17
18
  "disableMaxHeight"
@@ -232,6 +232,13 @@ export interface ListboxOwnProps {
232
232
  * @default "Loading..."
233
233
  */
234
234
  loadingMessage?: string;
235
+ /**
236
+ * When true, the menu panel width matches the anchor (typically the field).
237
+ * Only applies when the overlay resolves to `menu`. Forwarded to `Menu`.
238
+ *
239
+ * @default false
240
+ */
241
+ matchWidth?: boolean;
235
242
  /**
236
243
  * Tailwind max-height class for the options scroll area (e.g. `max-h-80`).
237
244
  * Dialog overlays (`modal` / `drawer`) default to `max-h-[min(60dvh,28rem)]`
@@ -745,6 +745,7 @@ export declare function useSelect(props: SelectOwnProps, model: Ref<null | undef
745
745
  listboxId: string;
746
746
  loading: boolean;
747
747
  loadingMessage: string;
748
+ matchWidth?: boolean;
748
749
  maxHeight: string;
749
750
  multiple: boolean;
750
751
  options: import('@bridge-ui/core/Domain').ListboxOption[];
@@ -1,12 +1,12 @@
1
1
  import { mergePartBind as e, resolveVnodeRefElement as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as ee } from "../../../Utils/index.js";
2
2
  import { snackbarDefaultIcons as r } from "../snackbarDefaultIcons.js";
3
- import { computed as i, nextTick as a, onBeforeUnmount as te, ref as o, toValue as ne, useAttrs as re, watch as s } from "vue";
4
- import { get as c, isNil as ie, isNull as l, isObject as ae, omit as oe } from "es-toolkit/compat";
3
+ import { computed as i, nextTick as a, onBeforeUnmount as o, ref as s, toValue as te, useAttrs as ne, watch as c } from "vue";
4
+ import { get as l, isNil as re, isNull as ie, isObject as ae, omit as oe } from "es-toolkit/compat";
5
5
  import { snackbarColorProps as se, snackbarPaddingProps as ce, snackbarPositionProps as le, snackbarRoundedProps as ue, snackbarTransitionProps as de } from "@bridge-ui/core/Tokens";
6
- import { cn as u, mergeBridgeUILayeredClasses as d, splitComponentProps as f } from "@bridge-ui/core/Utils";
7
- import { LAYER_STACK_BASE_Z_INDEX as p, acquireLayerStackOrder as fe, getLayerStackEntry as pe, getSnackbarTransitionClass as me, hasSnackbarTransition as he, pushLayerStack as ge, subscribeLayerStack as _e } from "@bridge-ui/core/Layer";
6
+ import { cn as u, mergeBridgeUILayeredClasses as d, splitComponentProps as fe } from "@bridge-ui/core/Utils";
7
+ import { LAYER_STACK_BASE_Z_INDEX as f, SNACKBAR_LEAVE_FALLBACK_MS as pe, acquireLayerStackOrder as me, getLayerStackEntry as he, getSnackbarTransitionClass as ge, hasSnackbarTransition as _e, pushLayerStack as ve, resolveEffectiveSnackbarTransition as ye, subscribeLayerStack as p } from "@bridge-ui/core/Layer";
8
8
  //#region src/Components/Snackbar/composables/useSnackbar.ts
9
- var ve = [
9
+ var be = [
10
10
  "img",
11
11
  "icon",
12
12
  "color",
@@ -24,55 +24,60 @@ var ve = [
24
24
  "description",
25
25
  "progressbar"
26
26
  ];
27
- function m(m, ye, h = {}) {
28
- let be = re(), g = o(!1), _ = o(""), v = o(1), y = o(0), b = o(!1), x = o(!1), S = o(0), C = o(!1), w = o(0), T = o(null), E = o(p), D = o("closed"), O = o(null), k = null, A = null, j = null, M = i(() => f({
27
+ function m(m, xe, h = {}) {
28
+ let Se = ne(), g = s(!1), _ = s(""), v = s(1), y = s(0), b = s(!1), x = s(!1), S = s(0), C = s(!1), w = s(0), T = s(null), E = s(f), D = s("closed"), O = s(null), k = null, A = null, j = null, M = null, N = i(() => fe({
29
29
  props: {
30
- ...be,
30
+ ...Se,
31
31
  ...m
32
32
  },
33
- bridgeKeys: ve
34
- })), { merged: N, entry: P } = n({
35
- libDefaults: ye,
33
+ bridgeKeys: be
34
+ })), { merged: P, entry: F } = n({
35
+ libDefaults: xe,
36
36
  componentName: "Snackbar",
37
- props: () => M.value.componentProps
38
- }), F = i(() => N.value.customProps), I = i(() => oe(M.value.inheritedAttrs, ["onShowChange"])), L = ee({
39
- entry: P,
40
- props: () => M.value.componentProps
41
- }), R = i(() => !ie(h.show) && ne(h.show)), z = i(() => {
42
- let e = N.value.transition ?? "none";
43
- return e in de ? e : "none";
44
- }), B = i(() => he(z.value)), xe = i(() => me(z.value)), V = i(() => {
45
- let e = d(se, P.value?.tokens?.color);
46
- return c(e, N.value.color);
47
- }), H = i(() => {
48
- let e = d(ce, P.value?.tokens?.padding);
49
- return c(e, N.value.padding);
50
- }), Se = i(() => {
51
- let e = d(ue, P.value?.tokens?.rounded);
52
- return c(e, N.value.rounded);
53
- }), Ce = i(() => l(N.value.icon) ? null : N.value.icon ? N.value.icon : c(V.value, "icon") ?? c(r, N.value.color)), U = i(() => N.value.duration === !1 ? 0 : N.value.duration ?? 0), W = i(() => R.value && g.value && U.value > 0 && N.value.progressbar !== !1), G = i(() => N.value.teleportTo !== !1), K = i(() => {
54
- if (!G.value) return "";
55
- let e = d(le, P.value?.tokens?.position);
56
- return c(e, N.value.position ?? "bottom-center");
37
+ props: () => N.value.componentProps
38
+ }), I = i(() => P.value.customProps), L = i(() => oe(N.value.inheritedAttrs, ["onShowChange"])), R = ee({
39
+ entry: F,
40
+ props: () => N.value.componentProps
41
+ }), z = i(() => !re(h.show) && te(h.show)), B = i(() => {
42
+ let e = P.value.transition ?? "none", t = e in de ? e : "none";
43
+ return ye(t);
44
+ }), V = i(() => _e(B.value)), Ce = i(() => ge(B.value)), H = i(() => {
45
+ let e = d(se, F.value?.tokens?.color);
46
+ return l(e, P.value.color);
47
+ }), U = i(() => {
48
+ let e = d(ce, F.value?.tokens?.padding);
49
+ return l(e, P.value.padding);
50
+ }), we = i(() => {
51
+ let e = d(ue, F.value?.tokens?.rounded);
52
+ return l(e, P.value.rounded);
53
+ }), Te = i(() => ie(P.value.icon) ? null : P.value.icon ? P.value.icon : l(H.value, "icon") ?? l(r, P.value.color)), W = i(() => P.value.duration === !1 ? 0 : P.value.duration ?? 0), G = i(() => z.value && g.value && W.value > 0 && P.value.progressbar !== !1), K = i(() => P.value.teleportTo !== !1), Ee = i(() => {
54
+ if (!K.value) return "";
55
+ let e = d(le, F.value?.tokens?.position);
56
+ return l(e, P.value.position ?? "bottom-center");
57
57
  });
58
58
  function q() {
59
59
  O.value &&= (clearTimeout(O.value), null);
60
60
  }
61
- function J(e) {
62
- e || h.onClose?.(), ae(h.show) && "value" in h.show && (h.show.value = e), h.onShowChange?.(e);
61
+ function J() {
62
+ j !== null && (clearTimeout(j), j = null);
63
63
  }
64
- function Y() {
65
- x.value && (x.value = !1, D.value = "closed", q(), R.value ? J(!1) : h.onLeaveComplete?.(), g.value = !1);
64
+ function Y(e) {
65
+ e || h.onClose?.(), ae(h.show) && "value" in h.show && (h.show.value = e), h.onShowChange?.(e);
66
66
  }
67
67
  function X() {
68
- if (q(), x.value = !0, !B.value) {
69
- Y();
68
+ x.value && (x.value = !1, D.value = "closed", q(), J(), z.value ? Y(!1) : h.onLeaveComplete?.(), g.value = !1);
69
+ }
70
+ function De() {
71
+ if (q(), x.value = !0, !V.value) {
72
+ X();
70
73
  return;
71
74
  }
72
- D.value = "closed";
75
+ D.value = "closed", J(), j = setTimeout(() => {
76
+ j = null, X();
77
+ }, pe);
73
78
  }
74
- function we() {
75
- if (x.value = !1, !B.value) {
79
+ function Oe() {
80
+ if (x.value = !1, J(), !V.value) {
76
81
  D.value = "open";
77
82
  return;
78
83
  }
@@ -83,47 +88,43 @@ function m(m, ye, h = {}) {
83
88
  });
84
89
  }
85
90
  function Z() {
86
- if (!B.value) {
87
- J(!1);
88
- return;
89
- }
90
- g.value && X();
91
+ z.value && Y(!1);
91
92
  }
92
93
  function Q(e) {
93
94
  q(), y.value = e, S.value = Date.now(), w.value = e, O.value = setTimeout(() => {
94
95
  Z();
95
96
  }, e);
96
97
  }
97
- function Te() {
98
- !O.value || U.value <= 0 || (q(), y.value -= Date.now() - S.value, v.value = Math.max(y.value / U.value, 0), C.value = !1, b.value = !0);
98
+ function ke() {
99
+ !O.value || W.value <= 0 || (q(), y.value -= Date.now() - S.value, v.value = Math.max(y.value / W.value, 0), C.value = !1, b.value = !0);
99
100
  }
100
- function Ee() {
101
- if (U.value <= 0 || !b.value) return;
101
+ function Ae() {
102
+ if (W.value <= 0 || !b.value) return;
102
103
  let e = Math.max(y.value, 0);
103
104
  b.value = !1, C.value = !1, requestAnimationFrame(() => {
104
105
  C.value = !0;
105
106
  }), Q(e);
106
107
  }
107
- function De(e) {
108
- !g.value || D.value !== "closed" || e.target === e.currentTarget && e.propertyName !== "none" && e.elapsedTime !== 0 && Y();
108
+ function je(e) {
109
+ !x.value || !g.value || D.value !== "closed" || e.target === e.currentTarget && e.propertyName !== "none" && e.elapsedTime !== 0 && X();
109
110
  }
110
- s(R, (e) => {
111
+ c(z, (e) => {
111
112
  if (e) {
112
- g.value = !0, we();
113
+ g.value = !0, Oe();
113
114
  return;
114
115
  }
115
- g.value && X();
116
- }, { immediate: !0 }), s([
117
- R,
116
+ g.value && De();
117
+ }, { immediate: !0 }), c([
118
+ z,
118
119
  g,
119
- U
120
+ W
120
121
  ], ([e, t, n]) => {
121
122
  if (!e || !t || n <= 0) {
122
123
  q();
123
124
  return;
124
125
  }
125
126
  b.value = !1, Q(n);
126
- }, { immediate: !0 }), s([U, W], ([e]) => {
127
+ }, { immediate: !0 }), c([W, G], ([e]) => {
127
128
  if (!e) {
128
129
  C.value = !1, v.value = 1;
129
130
  return;
@@ -137,14 +138,14 @@ function m(m, ye, h = {}) {
137
138
  };
138
139
  }, { immediate: !0 });
139
140
  function $() {
140
- let e = pe(_.value);
141
+ let e = he(_.value);
141
142
  e && (E.value = e.zIndex);
142
143
  }
143
- function Oe(e) {
144
+ function Me(e) {
144
145
  T.value = t(e), A?.setContainer(T.value);
145
146
  }
146
- s([g, G], ([e, t]) => {
147
- t && (e ? (k = fe(), A = ge({
147
+ c([g, K], ([e, t]) => {
148
+ t && (e ? (k = me(), A = ve({
148
149
  order: k,
149
150
  lockScroll: !1,
150
151
  id: h.stackId,
@@ -152,80 +153,80 @@ function m(m, ye, h = {}) {
152
153
  onEscape: () => {
153
154
  Z();
154
155
  }
155
- }), _.value = A.id, E.value = A.zIndex, $(), j = _e($), a(() => {
156
+ }), _.value = A.id, E.value = A.zIndex, $(), M = p($), a(() => {
156
157
  A?.setContainer(T.value);
157
- })) : (j?.(), j = null, A?.release(), A = null, k = null, _.value = "", E.value = p));
158
- }, { immediate: !0 }), te(() => {
159
- q(), j?.(), j = null, A?.release(), A = null;
158
+ })) : (M?.(), M = null, A?.release(), A = null, k = null, _.value = "", E.value = f));
159
+ }, { immediate: !0 }), o(() => {
160
+ q(), J(), M?.(), M = null, A?.release(), A = null;
160
161
  });
161
- let ke = i(() => e(F.value?.portal, {
162
+ let Ne = i(() => e(I.value?.portal, {
162
163
  "data-snackbar-layer": !0,
163
164
  style: { zIndex: E.value }
164
165
  }, u({
165
166
  "fixed inset-0 flex pointer-events-none px-4 py-6 sm:p-5 sm:pt-4": !0,
166
- [K.value ?? ""]: !0,
167
- [c(L.value, "portal") ?? ""]: !0
168
- }))), Ae = i(() => e(F.value?.root, {
169
- ...I.value,
167
+ [Ee.value ?? ""]: !0,
168
+ [l(R.value, "portal") ?? ""]: !0
169
+ }))), Pe = i(() => e(I.value?.root, {
170
+ ...L.value,
170
171
  "data-snackbar-part": "panel",
171
- onMouseenter: Te,
172
- onMouseleave: Ee,
172
+ onMouseenter: ke,
173
+ onMouseleave: Ae,
173
174
  "data-state": D.value,
174
- onTransitionend: De,
175
- role: I.value.role ?? "status",
176
- "aria-live": I.value["aria-live"] ?? "polite"
175
+ onTransitionend: je,
176
+ role: L.value.role ?? "status",
177
+ "aria-live": L.value["aria-live"] ?? "polite"
177
178
  }, u({
178
179
  "relative w-full max-w-sm overflow-hidden pointer-events-auto": !0,
179
180
  "bg-white shadow-lg ring-1 ring-black/5": !0,
180
181
  "dark:bg-dark-800 dark:border dark:border-dark-700": !0,
181
- [c(Se.value, "base") ?? ""]: !0,
182
- [xe.value]: B.value,
183
- [c(L.value, "root") ?? ""]: !0
184
- }))), je = i(() => e(F.value?.icon, {}, u({
182
+ [l(we.value, "base") ?? ""]: !0,
183
+ [Ce.value]: V.value,
184
+ [l(R.value, "root") ?? ""]: !0
185
+ }))), Fe = i(() => e(I.value?.icon, {}, u({
185
186
  "w-6 h-6 shrink-0": !0,
186
- [c(V.value, "iconColor") ?? ""]: !0,
187
- [c(L.value, "icon") ?? ""]: !0
188
- }))), Me = i(() => e(F.value?.title, {}, u({
187
+ [l(H.value, "iconColor") ?? ""]: !0,
188
+ [l(R.value, "icon") ?? ""]: !0
189
+ }))), Ie = i(() => e(I.value?.title, {}, u({
189
190
  "text-sm font-medium": !0,
190
- [c(V.value, "titleColor") ?? ""]: !0,
191
- [c(L.value, "title") ?? ""]: !0
192
- }))), Ne = i(() => e(F.value?.description, {}, u({
191
+ [l(H.value, "titleColor") ?? ""]: !0,
192
+ [l(R.value, "title") ?? ""]: !0
193
+ }))), Le = i(() => e(I.value?.description, {}, u({
193
194
  "mt-1 text-sm text-dark-500 dark:text-dark-500": !0,
194
- [c(L.value, "description") ?? ""]: !0
195
- }))), Pe = i(() => e(F.value?.progress, {}, {
195
+ [l(R.value, "description") ?? ""]: !0
196
+ }))), Re = i(() => e(I.value?.progress, {}, {
196
197
  class: u({
197
198
  "absolute bottom-0 left-0 h-0.5 w-full rounded-full": !0,
198
- [c(V.value, "progressColor") ?? ""]: !0,
199
- [c(L.value, "progress") ?? ""]: !0
199
+ [l(H.value, "progressColor") ?? ""]: !0,
200
+ [l(R.value, "progress") ?? ""]: !0
200
201
  }),
201
- style: W.value ? {
202
+ style: G.value ? {
202
203
  transformOrigin: "left center",
203
204
  transform: `scaleX(${C.value && !b.value ? 0 : v.value})`,
204
205
  transition: C.value && !b.value ? `transform ${w.value}ms linear` : "none"
205
206
  } : void 0
206
207
  }));
207
- function Fe(t) {
208
- return e(F.value?.content, {}, u({
209
- [c(H.value, "contentRight") ?? ""]: t,
210
- [c(H.value, "content") ?? ""]: !t,
211
- [c(L.value, "content") ?? ""]: !0
208
+ function ze(t) {
209
+ return e(I.value?.content, {}, u({
210
+ [l(U.value, "contentRight") ?? ""]: t,
211
+ [l(U.value, "content") ?? ""]: !t,
212
+ [l(R.value, "content") ?? ""]: !0
212
213
  }));
213
214
  }
214
215
  return {
215
- merged: N,
216
- iconBind: je,
216
+ merged: P,
217
+ iconBind: Fe,
217
218
  rendered: g,
218
- panelBind: Ae,
219
- titleBind: Me,
220
- isPortaled: G,
221
- portalBind: ke,
222
- contentBind: Fe,
223
- setPanelRef: Oe,
224
- showProgress: W,
225
- progressBind: Pe,
219
+ panelBind: Pe,
220
+ titleBind: Ie,
221
+ isPortaled: K,
222
+ portalBind: Ne,
223
+ contentBind: ze,
224
+ setPanelRef: Me,
225
+ showProgress: G,
226
+ progressBind: Re,
226
227
  requestClose: Z,
227
- resolvedIcon: Ce,
228
- descriptionBind: Ne
228
+ resolvedIcon: Te,
229
+ descriptionBind: Le
229
230
  };
230
231
  }
231
232
  //#endregion
@@ -153,6 +153,20 @@ When unset, `showFooter` defaults to `true` for `modal` / `drawer` overlays (`fa
153
153
  />
154
154
  ```
155
155
 
156
+ ### Match field width
157
+
158
+ ```vue
159
+ <Autocomplete
160
+ label="Country"
161
+ :options="countries"
162
+ :custom-props="{
163
+ listbox: { matchWidth: true },
164
+ }"
165
+ />
166
+ ```
167
+
168
+ Set `components.Listbox.defaultProps.matchWidth` on `createBridgeUI` to apply this to every Select / Autocomplete menu.
169
+
156
170
  ## Props
157
171
 
158
172
  ### Autocomplete-specific
@@ -99,7 +99,7 @@ app.use(
99
99
 
100
100
  ### Shared chrome
101
101
 
102
- `FormField`, `FormControl`, `BaseField`, and `TimePanel` are registry keys. Set them once to theme a family; a public entry still overrides `defaultProps`. Chrome tokens live on the shared key (`components.FormField.tokens`, `components.BaseField.tokens`). Dropdown tokens live on `components.Listbox`. Cancel / Apply in pickers and listboxes live on `components.ActionFooter`.
102
+ `FormField`, `FormControl`, `BaseField`, and `TimePanel` are registry keys. Set them once to theme a family; a public entry still overrides `defaultProps`. Chrome tokens live on the shared key (`components.FormField.tokens`, `components.BaseField.tokens`). Dropdown tokens live on `components.Listbox`. Set `components.Listbox.defaultProps.matchWidth` so Select / Autocomplete menus match the field width. Cancel / Apply in pickers and listboxes live on `components.ActionFooter`.
103
103
 
104
104
  ```ts
105
105
  app.use(
@@ -146,6 +146,18 @@ app.use(
146
146
  );
147
147
  ```
148
148
 
149
+ ```ts
150
+ app.use(
151
+ createBridgeUI({
152
+ components: {
153
+ Listbox: {
154
+ defaultProps: { matchWidth: true },
155
+ },
156
+ },
157
+ }),
158
+ );
159
+ ```
160
+
149
161
  ```ts
150
162
  app.use(
151
163
  createBridgeUI({
@@ -70,6 +70,7 @@ import { Menu } from "@bridge-ui/vue/Components/Menu";
70
70
  | `disableAutoFocus` | `boolean` | `false` | When true, the menu does not auto-focus the first focusable item on open. |
71
71
  | `disableScrollLock` | `boolean` | `true` | When true, body scroll is not locked while the menu is open. |
72
72
  | `keepMounted` | `boolean` | `false` | When true, the menu stays mounted in the DOM after closing (hidden). |
73
+ | `matchWidth` | `boolean` | `false` | When true, the panel width matches the trigger / anchor. |
73
74
  | `offset` | `number` | 4 | Gap between the trigger and the menu panel (px). |
74
75
  | `onShowChange` | `(show: boolean) => void` | — | Called when `show` should change (controlled state without `v-model`). |
75
76
  | `persistent` | `boolean` | `false` | When true, escape and click-away do not close the menu. |
@@ -137,6 +137,20 @@ When unset, `showFooter` defaults to `true` for `modal` / `drawer` overlays (`fa
137
137
  />
138
138
  ```
139
139
 
140
+ ### Match field width
141
+
142
+ ```vue
143
+ <Select
144
+ label="Country"
145
+ :options="countries"
146
+ :custom-props="{
147
+ listbox: { matchWidth: true },
148
+ }"
149
+ />
150
+ ```
151
+
152
+ Set `components.Listbox.defaultProps.matchWidth` on `createBridgeUI` to apply this to every Select / Autocomplete menu.
153
+
140
154
  ## Props
141
155
 
142
156
  ### Select-specific
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "license": "MIT",
4
- "version": "0.9.0",
4
+ "version": "0.10.0",
5
5
  "author": "BridgeUI",
6
6
  "sideEffects": false,
7
7
  "name": "@bridge-ui/vue",
@@ -89,7 +89,7 @@
89
89
  }
90
90
  },
91
91
  "dependencies": {
92
- "@bridge-ui/core": "^0.9.0",
92
+ "@bridge-ui/core": "^0.10.0",
93
93
  "clsx": "^2.1.1",
94
94
  "es-toolkit": "^1.50.0",
95
95
  "tailwind-merge": "^3.6.0"