@bridge-ui/vue 0.0.6 → 0.0.7

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 (110) hide show
  1. package/dist/Actions/Snackbar/BridgeSnackbarAction.vue_vue_type_script_setup_true_lang.js +8 -8
  2. package/dist/Actions/Snackbar/BridgeSnackbarHost.vue_vue_type_script_setup_true_lang.js +5 -5
  3. package/dist/Actions/Snackbar/createBridgeSnackbarApi.js +17 -17
  4. package/dist/Adapters/I18n/index.d.ts +1 -1
  5. package/dist/Adapters/I18n/index.js +2 -2
  6. package/dist/Adapters/I18n/useI18nAdapter.d.ts +7 -3
  7. package/dist/Adapters/I18n/useI18nAdapter.js +12 -7
  8. package/dist/Adapters/Icon/useIconAdapter.d.ts +1 -1
  9. package/dist/Adapters/index.d.ts +1 -1
  10. package/dist/Adapters/index.js +3 -3
  11. package/dist/Components/Alert/composables/useAlert.js +17 -17
  12. package/dist/Components/Autocomplete/Autocomplete.js +5 -0
  13. package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +40 -0
  14. package/dist/Components/Autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +197 -0
  15. package/dist/Components/Autocomplete/AutocompleteOption.js +5 -0
  16. package/dist/Components/Autocomplete/AutocompleteOption.vue.d.ts +4 -0
  17. package/dist/Components/Autocomplete/AutocompleteOption.vue_vue_type_script_setup_true_lang.js +32 -0
  18. package/dist/Components/Autocomplete/autocomplete.types.d.ts +285 -0
  19. package/dist/Components/Autocomplete/autocompleteInjectionKey.d.ts +7 -0
  20. package/dist/Components/Autocomplete/autocompleteInjectionKey.js +4 -0
  21. package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +762 -0
  22. package/dist/Components/Autocomplete/composables/useAutocomplete.js +382 -0
  23. package/dist/Components/Autocomplete/index.d.ts +4 -0
  24. package/dist/Components/Autocomplete/index.js +4 -0
  25. package/dist/Components/Avatar/composables/useAvatar.js +13 -13
  26. package/dist/Components/Badge/composables/useBadge.js +8 -8
  27. package/dist/Components/Button/composables/useButton.js +14 -14
  28. package/dist/Components/Card/composables/useCard.js +27 -27
  29. package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +2 -2
  30. package/dist/Components/Checkbox/composables/useCheckbox.d.ts +3 -3
  31. package/dist/Components/Checkbox/composables/useCheckbox.js +9 -9
  32. package/dist/Components/Chip/composables/useChip.js +6 -6
  33. package/dist/Components/Divider/composables/useDivider.js +5 -5
  34. package/dist/Components/Drawer/composables/useDrawer.js +23 -23
  35. package/dist/Components/FormControl/FormControl.vue_vue_type_script_setup_true_lang.js +1 -1
  36. package/dist/Components/FormControl/composables/useFormControl.d.ts +3 -3
  37. package/dist/Components/FormControl/composables/useFormControl.js +12 -12
  38. package/dist/Components/FormControl/formControl.types.d.ts +6 -6
  39. package/dist/Components/FormField/FilledFormField.vue_vue_type_script_setup_true_lang.js +2 -2
  40. package/dist/Components/FormField/NotchedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
  41. package/dist/Components/FormField/OutlinedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
  42. package/dist/Components/FormField/StackedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
  43. package/dist/Components/FormField/UnderlinedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
  44. package/dist/Components/FormField/composables/useFormField.d.ts +3 -3
  45. package/dist/Components/FormField/composables/useFormField.js +28 -28
  46. package/dist/Components/FormField/formField.types.d.ts +14 -14
  47. package/dist/Components/Icon/composables/useIcon.js +5 -5
  48. package/dist/Components/Label/composables/useLabel.js +5 -5
  49. package/dist/Components/Link/composables/useLink.js +9 -9
  50. package/dist/Components/List/composables/useList.js +6 -6
  51. package/dist/Components/ListItem/composables/useListItem.js +20 -20
  52. package/dist/Components/ListSection/composables/useListSection.js +8 -8
  53. package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +28 -28
  54. package/dist/Components/Listbox/composables/useListbox.js +7 -7
  55. package/dist/Components/Listbox/index.js +3 -3
  56. package/dist/Components/Menu/composables/useMenu.js +43 -43
  57. package/dist/Components/Modal/composables/useModal.js +18 -18
  58. package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +34 -34
  59. package/dist/Components/NumberField/composables/useNumberField.d.ts +4 -4
  60. package/dist/Components/NumberField/composables/useNumberField.js +9 -9
  61. package/dist/Components/OtpField/OtpField.js +5 -0
  62. package/dist/Components/OtpField/OtpField.vue.d.ts +31 -0
  63. package/dist/Components/OtpField/OtpField.vue_vue_type_script_setup_true_lang.js +80 -0
  64. package/dist/Components/OtpField/OtpFieldLabel.js +5 -0
  65. package/dist/Components/OtpField/OtpFieldLabel.vue.d.ts +7 -0
  66. package/dist/Components/OtpField/OtpFieldLabel.vue_vue_type_script_setup_true_lang.js +16 -0
  67. package/dist/Components/OtpField/composables/useOtpField.d.ts +460 -0
  68. package/dist/Components/OtpField/composables/useOtpField.js +212 -0
  69. package/dist/Components/OtpField/index.d.ts +4 -0
  70. package/dist/Components/OtpField/index.js +3 -0
  71. package/dist/Components/OtpField/otpField.types.d.ts +290 -0
  72. package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +23 -23
  73. package/dist/Components/PasswordField/composables/usePasswordField.d.ts +4 -4
  74. package/dist/Components/PasswordField/composables/usePasswordField.js +2 -2
  75. package/dist/Components/Progress/composables/useProgress.js +11 -11
  76. package/dist/Components/Radio/Radio.vue_vue_type_script_setup_true_lang.js +2 -2
  77. package/dist/Components/Radio/composables/useRadio.d.ts +3 -3
  78. package/dist/Components/Radio/composables/useRadio.js +9 -9
  79. package/dist/Components/Select/Select.vue.d.ts +1 -1
  80. package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +16 -13
  81. package/dist/Components/Select/composables/useSelect.d.ts +4 -4
  82. package/dist/Components/Select/composables/useSelect.js +161 -161
  83. package/dist/Components/Skeleton/composables/useSkeleton.js +5 -5
  84. package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +54 -54
  85. package/dist/Components/Snackbar/composables/useSnackbar.js +115 -115
  86. package/dist/Components/Spinner/composables/useSpinner.js +11 -11
  87. package/dist/Components/Switch/Switch.vue_vue_type_script_setup_true_lang.js +2 -2
  88. package/dist/Components/Switch/composables/useSwitch.d.ts +3 -3
  89. package/dist/Components/Switch/composables/useSwitch.js +9 -9
  90. package/dist/Components/Tab/composables/useTab.js +11 -11
  91. package/dist/Components/TabList/composables/useTabList.js +7 -7
  92. package/dist/Components/TabPanel/composables/useTabPanel.js +7 -7
  93. package/dist/Components/Tabs/composables/useTabs.js +22 -22
  94. package/dist/Components/TextField/TextField.vue.d.ts +1 -1
  95. package/dist/Components/TextField/TextField.vue_vue_type_script_setup_true_lang.js +6 -6
  96. package/dist/Components/TextField/composables/useTextField.d.ts +4 -4
  97. package/dist/Components/TextField/composables/useTextField.js +1 -1
  98. package/dist/Components/Textarea/Textarea.vue.d.ts +1 -1
  99. package/dist/Components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +6 -6
  100. package/dist/Components/Textarea/composables/useTextarea.d.ts +4 -4
  101. package/dist/Components/Textarea/composables/useTextarea.js +9 -9
  102. package/dist/Components/Tooltip/composables/useTooltip.js +17 -17
  103. package/dist/Provider/bridgeUITypes.d.ts +4 -1
  104. package/dist/Provider/createBridgeUIApi.js +13 -1
  105. package/dist/Utils/index.js +7 -7
  106. package/dist/Utils/useBreakpoint.js +7 -7
  107. package/dist/augments.d.ts +2 -2
  108. package/dist/index.d.ts +6 -2
  109. package/dist/index.js +84 -80
  110. package/package.json +3 -2
@@ -2,8 +2,8 @@ import { mergeNestedComponentProps as e } from "../../Utils/index.js";
2
2
  import t from "../../Components/Button/Button.js";
3
3
  import n from "../../Components/Link/Link.js";
4
4
  import { computed as r, createBlock as i, createTextVNode as a, defineComponent as o, mergeProps as s, openBlock as c, toDisplayString as l, unref as u, withCtx as d } from "vue";
5
- import { get as f } from "es-toolkit/compat";
6
- import { cn as p, snackbarRoundedProps as m } from "@bridge-ui/core";
5
+ import { cn as f, snackbarRoundedProps as p } from "@bridge-ui/core";
6
+ import { get as m } from "es-toolkit/compat";
7
7
  //#region src/Actions/Snackbar/BridgeSnackbarAction.vue?vue&type=script&setup=true&lang.ts
8
8
  var h = /* @__PURE__ */ o({
9
9
  __name: "BridgeSnackbarAction",
@@ -23,24 +23,24 @@ var h = /* @__PURE__ */ o({
23
23
  let { onClick: e, ...t } = g.action.link;
24
24
  return t;
25
25
  }), x = r(() => {
26
- let e = f(m, g.snackbarRounded ?? "lg"), t = f(e, "tr"), n = f(e, "br");
27
- return f({
26
+ let e = m(p, g.snackbarRounded ?? "lg"), t = m(e, "tr"), n = m(e, "br");
27
+ return m({
28
28
  trailing: "mr-4 shrink-0",
29
- "right-accept": p({
29
+ "right-accept": f({
30
30
  "w-full rounded-none": !0,
31
31
  [t ?? ""]: !0,
32
32
  [n ?? ""]: !g.hasReject
33
33
  }),
34
- "right-reject": p({
34
+ "right-reject": f({
35
35
  "w-full rounded-none": !0,
36
36
  [n ?? ""]: !0,
37
37
  [t ?? ""]: !g.hasAccept
38
38
  })
39
39
  }, g.layout, "");
40
- }), S = r(() => p({
40
+ }), S = r(() => f({
41
41
  [x.value]: !0,
42
42
  [g.action.className ?? ""]: !0
43
- })), C = r(() => e(b.value, { classes: { root: S.value } })), w = r(() => e(g.action.button, { classes: { root: p({
43
+ })), C = r(() => e(b.value, { classes: { root: S.value } })), w = r(() => e(g.action.button, { classes: { root: f({
44
44
  [S.value]: !0,
45
45
  "w-full": g.layout === "right-accept" || g.layout === "right-reject"
46
46
  }) } }));
@@ -3,8 +3,8 @@ import { BRIDGE_SNACKBAR_INJECTION_KEY as t } from "./bridgeSnackbarInjectionKey
3
3
  import n from "./BridgeSnackbarItem.js";
4
4
  import { createBridgeSnackbarApi as r } from "./createBridgeSnackbarApi.js";
5
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 { cn as y, mergeBridgeUILayeredClasses as b, snackbarPositionProps as x } from "@bridge-ui/core";
6
+ import { cn as v, mergeBridgeUILayeredClasses as y, snackbarPositionProps as b } from "@bridge-ui/core";
7
+ import { get as x } from "es-toolkit/compat";
8
8
  //#region src/Actions/Snackbar/BridgeSnackbarHost.vue?vue&type=script&setup=true&lang.ts
9
9
  var S = "[Bridge UI] Nested <BridgeSnackbarHost /> detected. useSnackbarAction() will target the nearest host only. Remove the extra host.", C = /* @__PURE__ */ u({
10
10
  __name: "BridgeSnackbarHost",
@@ -26,17 +26,17 @@ var S = "[Bridge UI] Nested <BridgeSnackbarHost /> detected. useSnackbarAction()
26
26
  timeout: C.timeout
27
27
  }), T = e();
28
28
  m(t, w);
29
- let E = o(() => w.entries.value), D = o(() => T?.components.value.Snackbar), O = o(() => C.position ?? D.value?.defaultProps?.position ?? "bottom-center"), k = o(() => v(b(x, D.value?.tokens?.position), O.value)), A = o(() => C.teleportTo === !1), j = o(() => C.teleportTo === !1 ? "body" : C.teleportTo), M = o(() => O.value.startsWith("top") ? "flex-col" : "flex-col-reverse");
29
+ let E = o(() => w.entries.value), D = o(() => T?.components.value.Snackbar), O = o(() => C.position ?? D.value?.defaultProps?.position ?? "bottom-center"), k = o(() => x(y(b, D.value?.tokens?.position), O.value)), A = o(() => C.teleportTo === !1), j = o(() => C.teleportTo === !1 ? "body" : C.teleportTo), M = o(() => O.value.startsWith("top") ? "flex-col" : "flex-col-reverse");
30
30
  return (e, t) => (p(), c(i, null, [g(e.$slots, "default"), (p(), s(a, {
31
31
  to: j.value,
32
32
  disabled: A.value
33
33
  }, [l("div", {
34
34
  "data-snackbar-host": "",
35
- class: f(_(y)({
35
+ class: f(_(v)({
36
36
  "fixed inset-0 z-40 flex pointer-events-none px-4 py-6 sm:p-5 sm:pt-4": !0,
37
37
  [k.value ?? ""]: !0
38
38
  }))
39
- }, [l("div", { class: f(_(y)({
39
+ }, [l("div", { class: f(_(v)({
40
40
  "flex w-full max-w-sm gap-y-2 pointer-events-auto": !0,
41
41
  [M.value]: !0
42
42
  })) }, [(p(!0), c(i, null, h(E.value, (e) => (p(), s(n, {
@@ -1,47 +1,47 @@
1
1
  import { shallowRef as e } from "vue";
2
- import { isNil as t } from "es-toolkit/compat";
3
- import { closeAllLayers as n, closeLayer as r, closeTopLayer as i, createLayerId as a, createOpenLayerEntry as o, isLayerMounted as s, removeLayer as c, syncLayerShow as l, trimLayersToMax as u, updateLayerMerged as d } from "@bridge-ui/core";
2
+ import { closeAllLayers as t, closeLayer as n, closeTopLayer as r, createLayerId as i, createOpenLayerEntry as a, isLayerMounted as o, removeLayer as s, syncLayerShow as c, trimLayersToMax as l, updateLayerMerged as u } from "@bridge-ui/core";
3
+ import { isNil as d } from "es-toolkit/compat";
4
4
  //#region src/Actions/Snackbar/createBridgeSnackbarApi.ts
5
5
  function f(e, t) {
6
6
  let { onClose: n, onClosed: r, ...i } = t;
7
- return o(e, {
7
+ return a(e, {
8
8
  props: i,
9
9
  onClose: n,
10
10
  onClosed: r
11
11
  });
12
12
  }
13
- function p(e, n) {
14
- return !t(e.duration) || t(n) ? e : {
13
+ function p(e, t) {
14
+ return !d(e.duration) || d(t) ? e : {
15
15
  ...e,
16
- duration: n
16
+ duration: t
17
17
  };
18
18
  }
19
- function m(t = {}) {
20
- let { max: o, timeout: m = 5e3 } = t, h = e([]);
19
+ function m(a = {}) {
20
+ let { max: d, timeout: m = 5e3 } = a, h = e([]);
21
21
  function g(e) {
22
- let t = a(), n = h.value;
23
- return o != null && o > 0 && (n = u(n, o)), h.value = [...n, f(t, p(e, m))], t;
22
+ let t = i(), n = h.value;
23
+ return d != null && d > 0 && (n = l(n, d)), h.value = [...n, f(t, p(e, m))], t;
24
24
  }
25
25
  function _(e) {
26
- h.value = r(h.value, e);
26
+ h.value = n(h.value, e);
27
27
  }
28
28
  function v() {
29
- h.value = i(h.value);
29
+ h.value = r(h.value);
30
30
  }
31
31
  function y() {
32
- h.value = n(h.value);
32
+ h.value = t(h.value);
33
33
  }
34
34
  function b(e) {
35
- return s(h.value, e);
35
+ return o(h.value, e);
36
36
  }
37
37
  function x(e) {
38
- h.value = c(h.value, e);
38
+ h.value = s(h.value, e);
39
39
  }
40
40
  function S(e, t) {
41
- h.value = d(h.value, e, t, ["props"]);
41
+ h.value = u(h.value, e, t, ["props"]);
42
42
  }
43
43
  function C(e, t) {
44
- h.value = l(h.value, e, t);
44
+ h.value = c(h.value, e, t);
45
45
  }
46
46
  return {
47
47
  open: g,
@@ -1 +1 @@
1
- export { setI18nAdapterForTests, useI18nAdapter, } from './useI18nAdapter';
1
+ export { setI18nAdapterForTests, useI18nAdapter, useResolveMessage, } from './useI18nAdapter';
@@ -1,2 +1,2 @@
1
- import { setI18nAdapterForTests as e, useI18nAdapter as t } from "./useI18nAdapter.js";
2
- export { e as setI18nAdapterForTests, t as useI18nAdapter };
1
+ import { setI18nAdapterForTests as e, useI18nAdapter as t, useResolveMessage as n } from "./useI18nAdapter.js";
2
+ export { e as setI18nAdapterForTests, t as useI18nAdapter, n as useResolveMessage };
@@ -1,12 +1,16 @@
1
1
  import { ComputedRef } from 'vue';
2
- import { I18nAdapter } from '@bridge-ui/core';
2
+ import { I18nAdapter, MessageParams } from '@bridge-ui/core';
3
3
  /**
4
4
  * Sets a process-wide i18n adapter fallback. For tests only.
5
5
  */
6
6
  export declare function setI18nAdapterForTests(adapter: undefined | I18nAdapter): void;
7
7
  /**
8
8
  * Returns the active i18n adapter from {@link BridgeUIProvider}.
9
- * When unset, `resolveMessage` returns the English source string
10
- * (see `examples/adapters/vue`).
9
+ * When unset, {@link useResolveMessage} returns the English source string
10
+ * (see `packages/vue/examples`).
11
11
  */
12
12
  export declare function useI18nAdapter(): ComputedRef<undefined | I18nAdapter>;
13
+ /**
14
+ * Resolves Bridge chrome strings through the active i18n adapter.
15
+ */
16
+ export declare function useResolveMessage(): (message: string, params?: MessageParams) => string;
@@ -1,13 +1,18 @@
1
1
  import { useBridgeUI as e } from "../../Provider/useBridgeUI.js";
2
2
  import { computed as t } from "vue";
3
+ import { resolveMessage as n } from "@bridge-ui/core";
3
4
  //#region src/Adapters/I18n/useI18nAdapter.ts
4
- var n;
5
- function r(e) {
6
- n = e;
5
+ var r;
6
+ function i(e) {
7
+ r = e;
7
8
  }
8
- function i() {
9
- let r = e();
10
- return t(() => r?.global.value.i18n ?? n);
9
+ function a() {
10
+ let n = e();
11
+ return t(() => n?.global.value.i18n ?? r);
12
+ }
13
+ function o() {
14
+ let e = a();
15
+ return (t, r) => n(t, e.value, r);
11
16
  }
12
17
  //#endregion
13
- export { r as setI18nAdapterForTests, i as useI18nAdapter };
18
+ export { i as setI18nAdapterForTests, a as useI18nAdapter, o as useResolveMessage };
@@ -6,6 +6,6 @@ import { IconAdapter } from '@bridge-ui/core';
6
6
  export declare function setIconAdapterForTests(adapter: undefined | IconAdapter): void;
7
7
  /**
8
8
  * Returns the active icon adapter from {@link BridgeUIProvider}.
9
- * Semantic icon names require `global.icons` (see `examples/adapters/vue`).
9
+ * Semantic icon names require `global.icons` (see `packages/vue/examples`).
10
10
  */
11
11
  export declare function useIconAdapter(): ComputedRef<undefined | IconAdapter>;
@@ -1,3 +1,3 @@
1
- export { setI18nAdapterForTests, useI18nAdapter } from './I18n';
1
+ export { setI18nAdapterForTests, useI18nAdapter, useResolveMessage, } from './I18n';
2
2
  export { setIconAdapterForTests, useIconAdapter } from './Icon';
3
3
  export type { IconElement, IconSource, IconSourceValueOverrides, SemanticIconName, } from './Icon';
@@ -1,3 +1,3 @@
1
- import { setI18nAdapterForTests as e, useI18nAdapter as t } from "./I18n/useI18nAdapter.js";
2
- import { setIconAdapterForTests as n, useIconAdapter as r } from "./Icon/useIconAdapter.js";
3
- export { e as setI18nAdapterForTests, n as setIconAdapterForTests, t as useI18nAdapter, r as useIconAdapter };
1
+ import { setI18nAdapterForTests as e, useI18nAdapter as t, useResolveMessage as n } from "./I18n/useI18nAdapter.js";
2
+ import { setIconAdapterForTests as r, useIconAdapter as i } from "./Icon/useIconAdapter.js";
3
+ export { e as setI18nAdapterForTests, r as setIconAdapterForTests, t as useI18nAdapter, i as useIconAdapter, n as useResolveMessage };
@@ -1,8 +1,8 @@
1
1
  import { alertDefaultIcons as e } from "../alertDefaultIcons.js";
2
2
  import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
3
3
  import { computed as i, useAttrs as a, useSlots as o } from "vue";
4
- import { get as s, isNull as c } from "es-toolkit/compat";
5
- import { cn as l, mergeBridgeUILayeredClasses as u, splitComponentProps as d } from "@bridge-ui/core";
4
+ import { cn as s, mergeBridgeUILayeredClasses as c, splitComponentProps as l } from "@bridge-ui/core";
5
+ import { get as u, isNull as d } from "es-toolkit/compat";
6
6
  import { paddingProps as f, roundedProps as p, shadowProps as m, variantProps as h } from "@bridge-ui/core/Tokens/Alert";
7
7
  //#region src/Components/Alert/composables/useAlert.ts
8
8
  var g = [
@@ -17,7 +17,7 @@ var g = [
17
17
  "customProps"
18
18
  ];
19
19
  function _(_, v) {
20
- let y = a(), b = o(), x = i(() => d({
20
+ let y = a(), b = o(), x = i(() => l({
21
21
  bridgeKeys: g,
22
22
  props: {
23
23
  ...y,
@@ -33,35 +33,35 @@ function _(_, v) {
33
33
  }), E = i(() => {
34
34
  let e = b.default?.();
35
35
  return !!(e && e.length > 0);
36
- }), D = i(() => s(u(h, C.value?.tokens?.variant), [S.value.variant, S.value.color])), O = i(() => s(u(m, C.value?.tokens?.shadow), S.value.shadow)), k = i(() => s(u(f, C.value?.tokens?.padding), S.value.padding)), A = i(() => s(u(p, C.value?.tokens?.rounded), S.value.rounded)), j = i(() => c(S.value.icon) ? null : S.value.icon ? S.value.icon : s(D.value, "icon") ?? s(e, S.value.color));
36
+ }), D = i(() => u(c(h, C.value?.tokens?.variant), [S.value.variant, S.value.color])), O = i(() => u(c(m, C.value?.tokens?.shadow), S.value.shadow)), k = i(() => u(c(f, C.value?.tokens?.padding), S.value.padding)), A = i(() => u(c(p, C.value?.tokens?.rounded), S.value.rounded)), j = i(() => d(S.value.icon) ? null : S.value.icon ? S.value.icon : u(D.value, "icon") ?? u(e, S.value.color));
37
37
  return {
38
38
  slots: b,
39
39
  merged: S,
40
- bodyBind: i(() => t(w.value?.body, {}, l({
40
+ bodyBind: i(() => t(w.value?.body, {}, s({
41
41
  "grow text-sm text-start": !0,
42
42
  [k.value ?? ""]: !0,
43
- [s(D.value, "text") ?? ""]: !0,
44
- [s(T.value, "body") ?? ""]: !0
43
+ [u(D.value, "text") ?? ""]: !0,
44
+ [u(T.value, "body") ?? ""]: !0
45
45
  }))),
46
- iconBind: i(() => t(w.value?.icon, {}, l({
46
+ iconBind: i(() => t(w.value?.icon, {}, s({
47
47
  "w-5 h-5 shrink-0": !0,
48
- [s(D.value, "iconColor") ?? ""]: !0,
49
- [s(T.value, "icon") ?? ""]: !0
48
+ [u(D.value, "iconColor") ?? ""]: !0,
49
+ [u(T.value, "icon") ?? ""]: !0
50
50
  }))),
51
- rootBind: i(() => t(w.value?.root, x.value.inheritedAttrs, l({
51
+ rootBind: i(() => t(w.value?.root, x.value.inheritedAttrs, s({
52
52
  "w-full flex flex-col p-4": !0,
53
53
  [O.value ?? ""]: !0,
54
54
  [A.value ?? ""]: !0,
55
- [s(D.value, "border") ?? ""]: !0,
56
- [s(D.value, "background") ?? ""]: !0,
57
- [s(T.value, "root") ?? ""]: !0
55
+ [u(D.value, "border") ?? ""]: !0,
56
+ [u(D.value, "background") ?? ""]: !0,
57
+ [u(T.value, "root") ?? ""]: !0
58
58
  }))),
59
- titleBind: i(() => t(w.value?.title, {}, l({
59
+ titleBind: i(() => t(w.value?.title, {}, s({
60
60
  "text-start text-sm whitespace-normal": !0,
61
61
  "font-normal": !E.value,
62
62
  "font-semibold": E.value,
63
- [s(D.value, "text") ?? ""]: !0,
64
- [s(T.value, "title") ?? ""]: !0
63
+ [u(D.value, "text") ?? ""]: !0,
64
+ [u(T.value, "title") ?? ""]: !0
65
65
  }))),
66
66
  resolvedIcon: j,
67
67
  hasDefaultBody: E
@@ -0,0 +1,5 @@
1
+ import e from "./Autocomplete.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/Components/Autocomplete/Autocomplete.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,40 @@
1
+ import { AutocompleteOwnProps, AutocompleteSlots, SelectValue } from './autocomplete.types';
2
+ type __VLS_Slots = AutocompleteSlots;
3
+ type __VLS_Props = AutocompleteOwnProps;
4
+ type __VLS_ModelProps = {
5
+ modelValue?: null | SelectValue | SelectValue[];
6
+ };
7
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
+ clear: () => any;
10
+ search: (query: string) => any;
11
+ select: (option: import('@bridge-ui/core').ListboxOption) => any;
12
+ "update:modelValue": (...args: unknown[]) => any;
13
+ change: (value: import('@bridge-ui/core').SelectModel) => any;
14
+ close: () => any;
15
+ open: () => any;
16
+ deselect: (option: import('@bridge-ui/core').ListboxOption) => any;
17
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
18
+ onClear?: (() => any) | undefined;
19
+ onSearch?: ((query: string) => any) | undefined;
20
+ onSelect?: ((option: import('@bridge-ui/core').ListboxOption) => any) | undefined;
21
+ "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
22
+ onChange?: ((value: import('@bridge-ui/core').SelectModel) => any) | undefined;
23
+ onClose?: (() => any) | undefined;
24
+ onOpen?: (() => any) | undefined;
25
+ onDeselect?: ((option: import('@bridge-ui/core').ListboxOption) => any) | undefined;
26
+ }>, {
27
+ showErrorIcon: boolean;
28
+ clearable: boolean;
29
+ minItemsForSearch: number;
30
+ searchable: boolean;
31
+ freeSolo: boolean;
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
33
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
34
+ declare const _default: typeof __VLS_export;
35
+ export default _default;
36
+ type __VLS_WithSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -0,0 +1,197 @@
1
+ import { useResolveMessage as e } from "../../Adapters/I18n/useI18nAdapter.js";
2
+ import { hasNamedSlot as t, resolveNamedSlot as n } from "../../Utils/slotOrProp.js";
3
+ import { mergeNestedComponentProps as r } from "../../Utils/index.js";
4
+ import i from "../Icon/Icon.js";
5
+ import { AUTOCOMPLETE_OPTION_KEY as a } from "./autocompleteInjectionKey.js";
6
+ import { useAutocomplete as o } from "./composables/useAutocomplete.js";
7
+ import ee from "../Chip/Chip.js";
8
+ import te from "../FormField/FormField.js";
9
+ import s from "../Listbox/Listbox.js";
10
+ import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as ne, createTextVNode as re, createVNode as m, defineComponent as h, guardReactiveProps as g, isRef as _, mergeModels as v, mergeProps as y, normalizeProps as b, openBlock as x, provide as S, ref as C, renderList as ie, renderSlot as w, resolveDynamicComponent as T, toDisplayString as ae, unref as E, useModel as D, useTemplateRef as O, withCtx as k, withKeys as A, withModifiers as j } from "vue";
11
+ import { cn as M } from "@bridge-ui/core";
12
+ import { isUndefined as N } from "es-toolkit/compat";
13
+ //#region src/Components/Autocomplete/Autocomplete.vue?vue&type=script&setup=true&lang.ts
14
+ var P = {
15
+ key: 0,
16
+ class: "flex min-w-0 flex-1 flex-wrap items-center gap-0.5"
17
+ }, F = {
18
+ key: 1,
19
+ class: "flex min-w-0 flex-1 items-center gap-1"
20
+ }, I = ["aria-label"], L = {
21
+ key: 0,
22
+ hidden: "",
23
+ "aria-hidden": "true"
24
+ }, R = /* @__PURE__ */ h({
25
+ inheritAttrs: !1,
26
+ __name: "Autocomplete",
27
+ props: /* @__PURE__ */ v({
28
+ asyncData: {},
29
+ clearable: {
30
+ type: Boolean,
31
+ default: !0
32
+ },
33
+ customProps: {},
34
+ defaultValue: {},
35
+ disableMaxHeight: { type: Boolean },
36
+ emptyMessage: {},
37
+ flipOptions: { type: Boolean },
38
+ freeSolo: {
39
+ type: Boolean,
40
+ default: !0
41
+ },
42
+ hideEmptyMessage: { type: Boolean },
43
+ loading: { type: Boolean },
44
+ loadingMessage: {},
45
+ maxHeight: {},
46
+ minItemsForSearch: { default: 11 },
47
+ multiple: { type: Boolean },
48
+ optionDescription: {},
49
+ optionLabel: {},
50
+ options: {},
51
+ optionValue: {},
52
+ placeholder: {},
53
+ searchable: {
54
+ type: Boolean,
55
+ default: !0
56
+ },
57
+ classes: {},
58
+ color: {},
59
+ controlId: {},
60
+ corner: {},
61
+ description: {},
62
+ disabled: { type: Boolean },
63
+ end: {},
64
+ endIcon: {},
65
+ error: { type: Boolean },
66
+ errorIcon: {},
67
+ errorMessage: {},
68
+ hideErrorMessage: { type: Boolean },
69
+ label: {},
70
+ readonly: { type: Boolean },
71
+ required: { type: Boolean },
72
+ rounded: {},
73
+ showErrorIcon: {
74
+ type: Boolean,
75
+ default: !0
76
+ },
77
+ size: {},
78
+ slots: {},
79
+ start: {},
80
+ startIcon: {},
81
+ variant: {}
82
+ }, {
83
+ modelValue: {},
84
+ modelModifiers: {}
85
+ }),
86
+ emits: /* @__PURE__ */ v([
87
+ "change",
88
+ "clear",
89
+ "close",
90
+ "deselect",
91
+ "open",
92
+ "search",
93
+ "select",
94
+ "update:modelValue"
95
+ ], ["update:modelValue"]),
96
+ setup(h, { emit: v }) {
97
+ let R = D(h, "modelValue"), z = h, B = e(), V = v, H = C(z.defaultValue), oe = l({
98
+ set: (e) => {
99
+ R.value = e, H.value = e;
100
+ },
101
+ get: () => N(R.value) ? H.value : R.value
102
+ }), U = O("trigger"), W = C([]);
103
+ S(a, {
104
+ unregister(e) {
105
+ W.value = W.value.filter((t) => String(t.value) !== String(e));
106
+ },
107
+ register(e) {
108
+ W.value.some((t) => String(t.value) === String(e.value)) || (W.value = [...W.value, e]);
109
+ }
110
+ });
111
+ let { open: G, slots: K, hasValue: q, multiple: se, formField: J, clearable: ce, clearBind: Y, clearValue: X, removeChip: le, triggerBind: Z, selectOption: ue, containerRef: Q, listboxProps: de, clearIconSize: fe, mergedClasses: pe, selectedOptions: me, hasComposedList: $, handleRegisteredOptionsChange: he } = o(z, oe, U, V, W);
112
+ return (e, a) => (x(), f(c, null, [
113
+ m(E(te), { field: E(J) }, {
114
+ default: k(() => [E(se) ? (x(), f("div", P, [(x(!0), f(c, null, ie(E(me), (t) => (x(), u(E(ee), y({
115
+ dismissible: "",
116
+ key: String(t.value),
117
+ size: E(J).merged.value.size,
118
+ disabled: E(J).isDisabled.value,
119
+ "clear-label": `Remove ${t.label}`,
120
+ onDismiss: (e) => E(le)(t, e)
121
+ }, { ref_for: !0 }, E(r)(z.customProps?.chip, {
122
+ customProps: { clear: E(Y) },
123
+ classes: { root: E(M)({
124
+ "bg-white ring-1 ring-inset ring-gray-200 dark:bg-gray-700 dark:ring-gray-600": !0,
125
+ [E(pe).chip ?? ""]: !0
126
+ }) }
127
+ })), {
128
+ default: k(() => [w(e.$slots, "chip", { option: t }, () => [re(ae(t.label), 1)])]),
129
+ _: 2
130
+ }, 1040, [
131
+ "size",
132
+ "disabled",
133
+ "clear-label",
134
+ "onDismiss"
135
+ ]))), 128)), p("textarea", y({ ref: "trigger" }, E(Z)), null, 16)])) : (x(), f("div", F, [p("input", y({
136
+ ref: "trigger",
137
+ class: "min-w-0 flex-1"
138
+ }, E(Z)), null, 16), E(ce) && E(q) && !E(J).isDisabled.value ? (x(), f("span", y({ key: 0 }, E(Y), {
139
+ onClick: a[0] ||= (...e) => E(X) && E(X)(...e),
140
+ onKeydown: [a[1] ||= A(j((...e) => E(X) && E(X)(...e), ["prevent"]), ["enter"]), a[2] ||= A(j((...e) => E(X) && E(X)(...e), ["prevent"]), ["space"])],
141
+ "aria-label": E(B)("Clear selection")
142
+ }), [m(E(i), y({
143
+ icon: "clear",
144
+ size: E(fe)
145
+ }, z.customProps?.clearIcon), null, 16, ["size"])], 16, I)) : d("", !0)]))]),
146
+ _: 3
147
+ }, 8, ["field"]),
148
+ m(E(s), y({
149
+ modelValue: E(G),
150
+ "onUpdate:modelValue": a[3] ||= (e) => _(G) ? G.value = e : null
151
+ }, E(de), {
152
+ "anchor-el": E(Q),
153
+ onSelect: E(ue),
154
+ onRegisteredOptionsChange: E(he)
155
+ }), ne({ _: 2 }, [
156
+ E($) ? {
157
+ name: "default",
158
+ fn: k(() => [w(e.$slots, "default")]),
159
+ key: "0"
160
+ } : void 0,
161
+ E(t)(E(K), "beforeOptions") ? {
162
+ name: "beforeOptions",
163
+ fn: k(() => [(x(), u(T(E(n)(E(K), "beforeOptions"))))]),
164
+ key: "1"
165
+ } : void 0,
166
+ E(t)(E(K), "loading") ? {
167
+ name: "loading",
168
+ fn: k(() => [(x(), u(T(E(n)(E(K), "loading"))))]),
169
+ key: "2"
170
+ } : void 0,
171
+ E(t)(E(K), "option") ? {
172
+ name: "option",
173
+ fn: k((t) => [w(e.$slots, "option", b(g(t)))]),
174
+ key: "3"
175
+ } : void 0,
176
+ E(t)(E(K), "empty") ? {
177
+ name: "empty",
178
+ fn: k(() => [(x(), u(T(E(n)(E(K), "empty"))))]),
179
+ key: "4"
180
+ } : void 0,
181
+ E(t)(E(K), "afterOptions") ? {
182
+ name: "afterOptions",
183
+ fn: k(() => [(x(), u(T(E(n)(E(K), "afterOptions"))))]),
184
+ key: "5"
185
+ } : void 0
186
+ ]), 1040, [
187
+ "modelValue",
188
+ "anchor-el",
189
+ "onSelect",
190
+ "onRegisteredOptionsChange"
191
+ ]),
192
+ E($) ? d("", !0) : (x(), f("div", L, [w(e.$slots, "default")]))
193
+ ], 64));
194
+ }
195
+ });
196
+ //#endregion
197
+ export { R as default };
@@ -0,0 +1,5 @@
1
+ import e from "./AutocompleteOption.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/Components/Autocomplete/AutocompleteOption.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,4 @@
1
+ import { AutocompleteOptionProps } from './autocomplete.types';
2
+ declare const __VLS_export: import('vue').DefineComponent<AutocompleteOptionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<AutocompleteOptionProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
@@ -0,0 +1,32 @@
1
+ import { AUTOCOMPLETE_OPTION_KEY as e } from "./autocompleteInjectionKey.js";
2
+ import { createElementBlock as t, defineComponent as n, inject as r, onBeforeUnmount as i, onMounted as a, openBlock as o } from "vue";
3
+ //#region src/Components/Autocomplete/AutocompleteOption.vue?vue&type=script&setup=true&lang.ts
4
+ var s = {
5
+ hidden: "",
6
+ "aria-hidden": "true"
7
+ }, c = /* @__PURE__ */ n({
8
+ inheritAttrs: !1,
9
+ name: "AutocompleteOption",
10
+ __name: "AutocompleteOption",
11
+ props: {
12
+ description: {},
13
+ disabled: { type: Boolean },
14
+ label: {},
15
+ value: {}
16
+ },
17
+ setup(n) {
18
+ let c = n, l = r(e, null);
19
+ return a(() => {
20
+ l?.register({
21
+ label: c.label,
22
+ value: c.value,
23
+ disabled: c.disabled,
24
+ description: c.description
25
+ });
26
+ }), i(() => {
27
+ l?.unregister(c.value);
28
+ }), (e, n) => (o(), t("span", s));
29
+ }
30
+ });
31
+ //#endregion
32
+ export { c as default };