@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
@@ -0,0 +1,382 @@
1
+ import { useResolveMessage as e } from "../../../Adapters/I18n/useI18nAdapter.js";
2
+ import { hasNamedSlot as t } from "../../../Utils/slotOrProp.js";
3
+ import { mergePartBind as n, resolveFieldAdornmentIconSize as r, useBridgeUIComponent as ee, useBridgeUIMergedRegistryClasses as i } from "../../../Utils/index.js";
4
+ import { formFieldBridgeKeys as te, useFormField as ne } from "../../FormField/composables/useFormField.js";
5
+ import { useListboxNavigation as re } from "../../Listbox/composables/useListboxNavigation.js";
6
+ import { Comment as ie, Text as ae, computed as a, nextTick as o, onBeforeUnmount as oe, onMounted as se, ref as s, useAttrs as ce, useId as le, useSlots as ue, watch as c } from "vue";
7
+ import { adjustAutosizeTextareaHeight as de, cn as l, commitFreeSoloValue as fe, createSelectAsyncSearch as pe, filterListboxEntries as me, flattenListboxOptions as u, mergeBridgeUILayeredClasses as d, normalizeListboxEntries as f, normalizeSelectOptions as p, resolveSelectAsyncDebounce as he, resolveSelectAsyncOptions as ge, selectValuesEqual as m, splitComponentProps as _e } from "@bridge-ui/core";
8
+ import { get as h, isNil as ve, omit as ye } from "es-toolkit/compat";
9
+ import { colorProps as be, invalidatedProps as xe } from "@bridge-ui/core/Tokens/Listbox";
10
+ //#region src/Components/Autocomplete/composables/useAutocomplete.ts
11
+ var Se = [
12
+ "classes",
13
+ "loading",
14
+ "options",
15
+ "freeSolo",
16
+ "multiple",
17
+ "asyncData",
18
+ "clearable",
19
+ "maxHeight",
20
+ "searchable",
21
+ "flipOptions",
22
+ "optionLabel",
23
+ "optionValue",
24
+ "placeholder",
25
+ "defaultValue",
26
+ "emptyMessage",
27
+ "loadingMessage",
28
+ "disableMaxHeight",
29
+ "hideEmptyMessage",
30
+ "minItemsForSearch",
31
+ "optionDescription"
32
+ ];
33
+ function g(g, _, v, y, Ce) {
34
+ let we = ce(), b = ue(), x = le(), S = e(), C = s(!1), w = s(""), T = s(-1), E = s(null), D = s(!1), O = s([]), k = null, A = s([]), j = a(() => _e({
35
+ props: {
36
+ ...we,
37
+ ...g
38
+ },
39
+ bridgeKeys: Se
40
+ })), M = a(() => j.value.componentProps), Te = a(() => ({ classes: M.value.classes })), { components: Ee, entry: De } = ee({
41
+ componentName: "Autocomplete",
42
+ props: () => Te.value
43
+ }), N = i({
44
+ entry: De,
45
+ props: () => Te.value
46
+ }), P = a(() => !!M.value.multiple), F = a(() => ({
47
+ optionLabel: M.value.optionLabel ?? "label",
48
+ optionValue: M.value.optionValue ?? "value",
49
+ optionDescription: M.value.optionDescription ?? "description"
50
+ })), I = a(() => Ce.value.length > 0 ? Ce.value.map((e) => ({
51
+ option: e,
52
+ type: "option"
53
+ })) : f(M.value.options, F.value)), Oe = a(() => u(I.value)), L = s([]);
54
+ function ke(e) {
55
+ if (!e || typeof e != "object") return !1;
56
+ let t = e.type;
57
+ if (!t || typeof t != "object") return !1;
58
+ let n = t.name, r = t.__name;
59
+ return n === "AutocompleteOption" || r === "AutocompleteOption";
60
+ }
61
+ function Ae() {
62
+ return t(b, "default") ? (b.default?.({}) ?? []).some((e) => {
63
+ if (!e || typeof e != "object") return !1;
64
+ let t = e.type;
65
+ return t === ie || t === ae || t === void 0 || typeof t == "symbol" ? !1 : !ke(e);
66
+ }) : !1;
67
+ }
68
+ let R = a(() => Ae() && !M.value.options?.length), z = a(() => {
69
+ if (R.value) return [];
70
+ if (O.value.length > 0) {
71
+ let e = f(O.value, F.value);
72
+ return M.value.flipOptions ? [...e].reverse() : e;
73
+ }
74
+ return M.value.flipOptions ? [...I.value].reverse().map((e) => e.type === "section" ? {
75
+ ...e,
76
+ options: [...e.options].reverse()
77
+ } : e) : I.value;
78
+ }), je = a(() => R.value ? L.value : u(z.value)), B = a(() => {
79
+ let e = _.value;
80
+ return P.value ? Array.isArray(e) ? e : [] : !ve(e) && e !== "" ? [e] : [];
81
+ }), V = a(() => {
82
+ let e = /* @__PURE__ */ new Map();
83
+ for (let t of [...je.value, ...A.value]) e.set(t.value, t);
84
+ return B.value.map((t) => e.get(t) ?? {
85
+ value: t,
86
+ label: String(t)
87
+ });
88
+ }), Me = a(() => B.value.length > 0), Ne = a(() => M.value.clearable !== !1), H = a(() => !!M.value.asyncData), U = a(() => {
89
+ if (H.value || (M.value.searchable ?? !0)) return !0;
90
+ let e = M.value.minItemsForSearch ?? 11;
91
+ return Oe.value.length >= e;
92
+ }), W = a(() => C.value && U.value), Pe = a(() => !!M.value.loading || D.value), Fe = a(() => {
93
+ if (R.value) return [];
94
+ if (!W.value || !w.value.trim()) return z.value;
95
+ let e = w.value.trim().toLowerCase();
96
+ return me(z.value, (t) => t.label.toLowerCase().includes(e));
97
+ }), G = a(() => R.value ? L.value : u(Fe.value)), K = re(() => G.value, T, x), Ie = a(() => g.readonly || g.disabled ? !0 : !W.value), Le = a(() => W.value || P.value ? w.value : V.value[0]?.label ?? ""), Re = (e) => {
98
+ E.value = e instanceof HTMLElement ? e : null;
99
+ };
100
+ function ze(e) {
101
+ e.preventDefault();
102
+ }
103
+ function Be(e) {
104
+ if (g.disabled || g.readonly) return;
105
+ let t = e.target;
106
+ if (!t.closest("[data-autocomplete-clear]") && !(t.closest(".wrapper-start-slot") || t.closest(".wrapper-end-slot"))) {
107
+ if (!C.value) {
108
+ Q();
109
+ return;
110
+ }
111
+ W.value || ($(), v.value?.focus({ preventScroll: !0 }));
112
+ }
113
+ }
114
+ let Ve = a(() => {
115
+ let e = _e({
116
+ bridgeKeys: te,
117
+ props: ye(j.value.inheritedAttrs, ["class"])
118
+ }).componentProps, r = e.endIcon ?? (t(b, "end") ? void 0 : "chevronUpDown"), { listbox: ee, ...i } = e.customProps ?? {};
119
+ return {
120
+ ...e,
121
+ endIcon: r,
122
+ classes: N.value,
123
+ customProps: {
124
+ ...i,
125
+ container: n(i.container, {}, {
126
+ ref: Re,
127
+ onClick: Be,
128
+ class: l({ "cursor-pointer": !g.disabled && !g.readonly && !W.value })
129
+ })
130
+ }
131
+ };
132
+ }), He = a(() => g.customProps?.listbox), q = ne(() => Ve.value, {
133
+ size: "md",
134
+ rounded: "md",
135
+ color: "primary",
136
+ variant: "outline",
137
+ showErrorIcon: !0
138
+ }, {
139
+ likeInput: () => P.value,
140
+ control: () => P.value ? "textarea" : "input"
141
+ }), J = (e) => {
142
+ !e || !P.value || de(e);
143
+ };
144
+ function Y(e) {
145
+ return B.value.some((t) => m(t, e));
146
+ }
147
+ function X(e) {
148
+ _.value = e;
149
+ }
150
+ function Z(e) {
151
+ if (P.value) {
152
+ let t = Array.isArray(e) ? e : [];
153
+ y("update:modelValue", t), y("change", t);
154
+ return;
155
+ }
156
+ let t = e ?? "";
157
+ y("update:modelValue", t), y("change", t);
158
+ }
159
+ function Q() {
160
+ g.disabled || g.readonly || C.value || (C.value = !0, w.value = "", K.highlightCurrentSelection(Y), y("open"), H.value && M.value.asyncData && k?.searchImmediate(""));
161
+ }
162
+ function $(e) {
163
+ k?.cancel();
164
+ let t = C.value;
165
+ if (t && e?.commitFreeSolo && M.value.freeSolo !== !1) {
166
+ let e = fe(w.value, B.value, P.value);
167
+ e != null && (X(e), Z(e), P.value && o(() => {
168
+ J(v.value), v.value?.focus({ preventScroll: !0 });
169
+ }));
170
+ }
171
+ w.value = "", T.value = -1, t && (C.value = !1, y("close"));
172
+ }
173
+ function Ue(e) {
174
+ if (!e.disabled) {
175
+ if (P.value) {
176
+ let t = [...B.value], n = t.findIndex((t) => m(t, e.value));
177
+ n >= 0 ? (t.splice(n, 1), y("deselect", e)) : (t.push(e.value), y("select", e)), X(t), Z(t), w.value = "", T.value = -1, o(() => {
178
+ J(v.value), v.value?.focus({ preventScroll: !0 });
179
+ });
180
+ return;
181
+ }
182
+ X(e.value), Z(e.value), y("select", e), $();
183
+ }
184
+ }
185
+ function We() {
186
+ if (M.value.freeSolo === !1) return !1;
187
+ let e = fe(w.value, B.value, P.value);
188
+ return e == null ? !1 : (X(e), Z(e), w.value = "", T.value = -1, P.value ? (o(() => {
189
+ J(v.value), v.value?.focus({ preventScroll: !0 });
190
+ }), !0) : ($(), !0));
191
+ }
192
+ function Ge(e) {
193
+ e?.preventDefault(), e?.stopPropagation(), P.value ? (X([]), Z([])) : (X(null), Z(null)), y("clear"), $();
194
+ }
195
+ function Ke(e, t) {
196
+ if (t.preventDefault(), t.stopPropagation(), !P.value) return;
197
+ let n = B.value.filter((t) => !m(t, e.value));
198
+ X(n), Z(n), y("deselect", e), o(() => J(v.value));
199
+ }
200
+ function qe() {
201
+ let e = K.getHighlightedOption();
202
+ return e ? (Ue(e), !0) : !1;
203
+ }
204
+ function Je(e) {
205
+ w.value = e.target.value, y("search", w.value), C.value || Q(), K.resetHighlight(), H.value && k?.searchDebounced(w.value);
206
+ }
207
+ function Ye(e) {
208
+ if (!(g.disabled || g.readonly)) switch (e.key) {
209
+ case "ArrowDown":
210
+ e.preventDefault(), C.value ? K.moveHighlight(1) : Q();
211
+ break;
212
+ case "ArrowUp":
213
+ e.preventDefault(), C.value ? K.moveHighlight(-1) : Q();
214
+ break;
215
+ case "Enter":
216
+ e.preventDefault(), C.value ? qe() || We() : Q();
217
+ break;
218
+ case "Escape":
219
+ e.preventDefault(), $();
220
+ break;
221
+ case "Home":
222
+ C.value && (e.preventDefault(), K.highlightFirst());
223
+ break;
224
+ case "End":
225
+ C.value && (e.preventDefault(), K.highlightLast());
226
+ break;
227
+ case "Backspace":
228
+ if (P.value && !w.value && V.value.length > 0) {
229
+ e.preventDefault();
230
+ let t = V.value.at(-1);
231
+ t && Ke(t, e);
232
+ }
233
+ break;
234
+ case "Tab":
235
+ $({ commitFreeSolo: !0 });
236
+ break;
237
+ default: break;
238
+ }
239
+ }
240
+ async function Xe(e) {
241
+ let t = M.value.asyncData;
242
+ if (t) {
243
+ D.value = !0;
244
+ try {
245
+ let { options: n, resolvedSelected: r } = await ge(t, e, B.value, (e) => p(e, F.value));
246
+ r.length > 0 && (A.value = r), O.value = n;
247
+ } finally {
248
+ D.value = !1;
249
+ }
250
+ }
251
+ }
252
+ async function Ze() {
253
+ let e = M.value.asyncData;
254
+ !e?.resolve || B.value.length === 0 || (A.value = p(await e.resolve(B.value), F.value));
255
+ }
256
+ let Qe = a(() => {
257
+ let e = h(d(be, h(Ee.value, [
258
+ "Listbox",
259
+ "tokens",
260
+ "color"
261
+ ])), q.merged.value.color ?? "primary");
262
+ return q.invalidated.value ? d(xe, h(Ee.value, [
263
+ "Listbox",
264
+ "tokens",
265
+ "invalidated"
266
+ ])) : e;
267
+ }), $e = a(() => Qe.value?.value), et = a(() => {
268
+ let e = !g.disabled && !g.readonly && !W.value, t = !g.disabled && !g.readonly && W.value && U.value, r = Me.value && !P.value && !W.value;
269
+ return n({
270
+ role: "combobox",
271
+ value: Le.value,
272
+ "aria-controls": x,
273
+ "aria-expanded": C.value,
274
+ readonly: Ie.value,
275
+ onKeydown: Ye,
276
+ placeholder: M.value.placeholder,
277
+ "aria-autocomplete": U.value ? "list" : void 0,
278
+ "aria-activedescendant": C.value ? K.activeDescendantId.value : void 0,
279
+ ...P.value ? {
280
+ rows: 1,
281
+ onInput: (e) => {
282
+ Je(e), J(e.target);
283
+ }
284
+ } : { onInput: Je }
285
+ }, q.inputBind.value, l({
286
+ "cursor-text": t,
287
+ "cursor-pointer": e,
288
+ "resize-none overflow-hidden": P.value,
289
+ [l($e.value, N.value.value) ?? ""]: r
290
+ }));
291
+ });
292
+ c(() => [
293
+ C.value,
294
+ P.value,
295
+ v.value
296
+ ], () => {
297
+ J(v.value);
298
+ }, { immediate: !0 }), c(() => _.value, () => {
299
+ Ze();
300
+ }, { immediate: !0 }), c(() => M.value.asyncData, (e) => {
301
+ if (k?.cancel(), O.value = [], Ze(), !e) {
302
+ k = null;
303
+ return;
304
+ }
305
+ k = pe((e) => void Xe(e), he(e));
306
+ }, { immediate: !0 }), oe(() => {
307
+ k?.cancel();
308
+ }), se(() => {
309
+ J(v.value);
310
+ });
311
+ let tt = a(() => r(q.merged.value.size)), nt = a(() => n({}, {}, {
312
+ tabindex: 0,
313
+ role: "button",
314
+ "data-autocomplete-clear": !0,
315
+ onMousedown: ze,
316
+ class: l({
317
+ "inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors duration-150": !0,
318
+ [Qe.value?.clear ?? ""]: !0,
319
+ [N.value.clear ?? ""]: !0
320
+ })
321
+ })), rt = a(() => ({
322
+ listboxId: x,
323
+ isSelected: Y,
324
+ disableAutoFocus: !0,
325
+ loading: Pe.value,
326
+ multiple: P.value,
327
+ maxHeight: g.maxHeight,
328
+ entries: Fe.value,
329
+ options: G.value,
330
+ size: q.merged.value.size,
331
+ color: q.merged.value.color,
332
+ labelledBy: q.controlId.value,
333
+ rounded: q.merged.value.rounded,
334
+ invalidated: q.invalidated.value,
335
+ highlightedIndex: T.value,
336
+ disableMaxHeight: g.disableMaxHeight === !0,
337
+ hideEmptyMessage: M.value.hideEmptyMessage === !0,
338
+ emptyMessage: M.value.emptyMessage ?? S("No options"),
339
+ loadingMessage: M.value.loadingMessage ?? S("Loading..."),
340
+ ...He.value
341
+ }));
342
+ function it(e) {
343
+ let t = L.value;
344
+ t.length === e.length && t.every((t, n) => String(t.value) === String(e[n]?.value)) || (L.value = e);
345
+ }
346
+ return {
347
+ slots: b,
348
+ hasValue: Me,
349
+ multiple: P,
350
+ listboxId: x,
351
+ formField: q,
352
+ isLoading: Pe,
353
+ clearable: Ne,
354
+ clearBind: nt,
355
+ isSelected: Y,
356
+ clearValue: Ge,
357
+ removeChip: Ke,
358
+ triggerBind: et,
359
+ selectOption: Ue,
360
+ containerRef: E,
361
+ listboxProps: rt,
362
+ clearIconSize: tt,
363
+ mergedClasses: N,
364
+ visibleOptions: G,
365
+ isSearchActive: W,
366
+ open: a({
367
+ get: () => C.value,
368
+ set: (e) => {
369
+ e ? Q() : $({ commitFreeSolo: !0 });
370
+ }
371
+ }),
372
+ selectedOptions: V,
373
+ hasComposedList: R,
374
+ highlightedIndex: T,
375
+ handleRegisteredOptionsChange: it,
376
+ hideEmptyMessage: a(() => M.value.hideEmptyMessage === !0),
377
+ emptyMessage: a(() => M.value.emptyMessage ?? S("No options")),
378
+ loadingMessage: a(() => M.value.loadingMessage ?? S("Loading..."))
379
+ };
380
+ }
381
+ //#endregion
382
+ export { g as useAutocomplete };
@@ -0,0 +1,4 @@
1
+ export type { AutocompleteClasses, AutocompleteEmits, SelectOption as AutocompleteOptionData, AutocompleteOptionProps, AutocompleteProps, AutocompleteSlots, SelectAsyncData, SelectModel, SelectValue, } from './autocomplete.types';
2
+ export { default as Autocomplete } from './Autocomplete.vue';
3
+ export { default as AutocompleteOption } from './AutocompleteOption.vue';
4
+ export { useAutocomplete } from './composables/useAutocomplete';
@@ -0,0 +1,4 @@
1
+ import { useAutocomplete as e } from "./composables/useAutocomplete.js";
2
+ import t from "./Autocomplete.js";
3
+ import n from "./AutocompleteOption.js";
4
+ export { t as Autocomplete, n as AutocompleteOption, e as useAutocomplete };
@@ -1,8 +1,8 @@
1
1
  import { hasNamedSlot as e } from "../../../Utils/slotOrProp.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, isEmpty as c, isNil as l } from "es-toolkit/compat";
5
- import { cn as u, mergeBridgeUILayeredClasses as d, splitComponentProps as f } from "@bridge-ui/core";
4
+ import { cn as s, mergeBridgeUILayeredClasses as c, splitComponentProps as l } from "@bridge-ui/core";
5
+ import { get as u, isEmpty as d, isNil as f } from "es-toolkit/compat";
6
6
  import { colorProps as p, iconSizeProps as m, roundedProps as h, sizeProps as g } from "@bridge-ui/core/Tokens/Avatar";
7
7
  //#region src/Components/Avatar/composables/useAvatar.ts
8
8
  var _ = [
@@ -17,7 +17,7 @@ var _ = [
17
17
  "customProps"
18
18
  ];
19
19
  function v(v, y) {
20
- let b = a(), x = o(), S = i(() => f({
20
+ let b = a(), x = o(), S = i(() => l({
21
21
  bridgeKeys: _,
22
22
  props: {
23
23
  ...b,
@@ -30,35 +30,35 @@ function v(v, y) {
30
30
  }), T = r({
31
31
  entry: w,
32
32
  props: () => S.value.componentProps
33
- }), E = i(() => e(x, "default")), D = i(() => !l(C.value.src) && !c(C.value.src)), O = i(() => e(x, "fallback")), k = i(() => !l(C.value.fallback) && !c(C.value.fallback)), A = i(() => C.value.icon ?? "user"), j = i(() => !D.value && !E.value), M = i(() => s(d(g, w.value?.tokens?.size), C.value.size)), N = i(() => s(d(p, w.value?.tokens?.color), C.value.color)), P = i(() => s(d(h, w.value?.tokens?.rounded), C.value.rounded)), F = i(() => s(d(m, w.value?.tokens?.iconSize), C.value.size)), I = i(() => C.value.customProps), L = i(() => t(I.value?.root, S.value.inheritedAttrs, u({
33
+ }), E = i(() => e(x, "default")), D = i(() => !f(C.value.src) && !d(C.value.src)), O = i(() => e(x, "fallback")), k = i(() => !f(C.value.fallback) && !d(C.value.fallback)), A = i(() => C.value.icon ?? "user"), j = i(() => !D.value && !E.value), M = i(() => u(c(g, w.value?.tokens?.size), C.value.size)), N = i(() => u(c(p, w.value?.tokens?.color), C.value.color)), P = i(() => u(c(h, w.value?.tokens?.rounded), C.value.rounded)), F = i(() => u(c(m, w.value?.tokens?.iconSize), C.value.size)), I = i(() => C.value.customProps), L = i(() => t(I.value?.root, S.value.inheritedAttrs, s({
34
34
  "inline-flex shrink-0 items-center justify-center overflow-hidden": !0,
35
35
  [T.value.root ?? ""]: !0,
36
36
  [P.value ?? ""]: !0,
37
37
  [M.value ?? ""]: j.value || E.value || D.value,
38
- [s(N.value, "background") ?? ""]: j.value,
39
- [s(N.value, "text") ?? ""]: j.value
38
+ [u(N.value, "background") ?? ""]: j.value,
39
+ [u(N.value, "text") ?? ""]: j.value
40
40
  }))), R = i(() => t(I.value?.image, {
41
41
  alt: C.value.alt,
42
42
  src: C.value.src
43
- }, u({
43
+ }, s({
44
44
  "shrink-0 object-cover object-center": !0,
45
45
  [M.value ?? ""]: !0,
46
46
  [P.value ?? ""]: !0,
47
47
  [T.value.image ?? ""]: !0
48
- }))), z = i(() => t(I.value?.fallback, {}, u({
48
+ }))), z = i(() => t(I.value?.fallback, {}, s({
49
49
  "font-medium": !0,
50
- [s(F.value, "label") ?? ""]: !0,
51
- [s(N.value, "text") ?? ""]: !0,
50
+ [u(F.value, "label") ?? ""]: !0,
51
+ [u(N.value, "text") ?? ""]: !0,
52
52
  [T.value.fallback ?? ""]: !0
53
53
  })));
54
54
  return {
55
55
  slots: x,
56
56
  merged: C,
57
57
  rootBind: L,
58
- iconBind: i(() => t(I.value?.icon, {}, u({
58
+ iconBind: i(() => t(I.value?.icon, {}, s({
59
59
  "shrink-0": !0,
60
- [s(F.value, "icon") ?? ""]: !0,
61
- [s(N.value, "text") ?? ""]: !0
60
+ [u(F.value, "icon") ?? ""]: !0,
61
+ [u(N.value, "text") ?? ""]: !0
62
62
  }))),
63
63
  hasImage: D,
64
64
  imageBind: R,
@@ -1,7 +1,7 @@
1
1
  import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
2
2
  import { computed as r, useAttrs as i } from "vue";
3
- import { get as a } from "es-toolkit/compat";
4
- import { cn as o, mergeBridgeUILayeredClasses as s, splitComponentProps as c } from "@bridge-ui/core";
3
+ import { cn as a, mergeBridgeUILayeredClasses as o, splitComponentProps as s } from "@bridge-ui/core";
4
+ import { get as c } from "es-toolkit/compat";
5
5
  import { densityProps as l, roundedProps as u, variantProps as d } from "@bridge-ui/core/Tokens/Badge";
6
6
  //#region src/Components/Badge/composables/useBadge.ts
7
7
  var f = [
@@ -14,7 +14,7 @@ var f = [
14
14
  "variant"
15
15
  ];
16
16
  function p(p, m) {
17
- let h = i(), g = r(() => c({
17
+ let h = i(), g = r(() => s({
18
18
  bridgeKeys: f,
19
19
  props: {
20
20
  ...h,
@@ -27,18 +27,18 @@ function p(p, m) {
27
27
  }), y = n({
28
28
  entry: v,
29
29
  props: () => g.value.componentProps
30
- }), b = r(() => _.value.density === "mini"), x = r(() => a(s(l, v.value?.tokens?.density), [_.value.density, _.value.size])), S = r(() => a(s(d, v.value?.tokens?.variant), [_.value.variant, _.value.color])), C = r(() => a(s(u, v.value?.tokens?.rounded), _.value.rounded));
30
+ }), b = r(() => _.value.density === "mini"), x = r(() => c(o(l, v.value?.tokens?.density), [_.value.density, _.value.size])), S = r(() => c(o(d, v.value?.tokens?.variant), [_.value.variant, _.value.color])), C = r(() => c(o(u, v.value?.tokens?.rounded), _.value.rounded));
31
31
  return {
32
32
  merged: _,
33
- rootBind: r(() => e({}, g.value.inheritedAttrs, o({
33
+ rootBind: r(() => e({}, g.value.inheritedAttrs, a({
34
34
  "inline-flex items-center justify-center font-medium whitespace-nowrap": !0,
35
35
  "w-full": !b.value && _.value.full,
36
36
  "w-fit": !b.value && !_.value.full,
37
37
  [x.value ?? ""]: !0,
38
38
  [C.value ?? ""]: !0,
39
- [a(S.value, "background") ?? ""]: !0,
40
- [a(S.value, "border") ?? ""]: !0,
41
- [a(S.value, "text") ?? ""]: !0,
39
+ [c(S.value, "background") ?? ""]: !0,
40
+ [c(S.value, "border") ?? ""]: !0,
41
+ [c(S.value, "text") ?? ""]: !0,
42
42
  [y.value.root ?? ""]: !0
43
43
  })))
44
44
  };
@@ -1,7 +1,7 @@
1
1
  import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
2
2
  import { computed as r, useAttrs as i } from "vue";
3
- import { get as a, includes as o, isNil as s } from "es-toolkit/compat";
4
- import { cn as c, mergeBridgeUILayeredClasses as l, splitComponentProps as u } from "@bridge-ui/core";
3
+ import { cn as a, mergeBridgeUILayeredClasses as o, splitComponentProps as s } from "@bridge-ui/core";
4
+ import { get as c, includes as l, isNil as u } from "es-toolkit/compat";
5
5
  import { densityProps as d, roundedProps as f, variantProps as p } from "@bridge-ui/core/Tokens/Button";
6
6
  //#region src/Components/Button/composables/useButton.ts
7
7
  var m = [
@@ -23,7 +23,7 @@ var m = [
23
23
  "customProps"
24
24
  ];
25
25
  function h(h, g) {
26
- let _ = i(), v = r(() => u({
26
+ let _ = i(), v = r(() => s({
27
27
  bridgeKeys: m,
28
28
  props: {
29
29
  ..._,
@@ -40,22 +40,22 @@ function h(h, g) {
40
40
  if (!(!w.value || D.value || !y.value.href)) return y.value.href;
41
41
  }), M = r(() => {
42
42
  if (!T.value) return;
43
- let e = a(v.value.inheritedAttrs, "type");
44
- return o([
43
+ let e = c(v.value.inheritedAttrs, "type");
44
+ return l([
45
45
  "submit",
46
46
  "reset",
47
47
  "button"
48
48
  ], e) ? e : "button";
49
- }), N = r(() => a(l(d, b.value?.tokens?.density), [y.value.density, y.value.size])), P = r(() => s(v.value.componentProps.variant) ? E.value ? "flat" : y.value.variant : v.value.componentProps.variant), F = r(() => a(l(p, b.value?.tokens?.variant), [P.value, y.value.color])), I = r(() => a(l(f, b.value?.tokens?.rounded), y.value.rounded));
49
+ }), N = r(() => c(o(d, b.value?.tokens?.density), [y.value.density, y.value.size])), P = r(() => u(v.value.componentProps.variant) ? E.value ? "flat" : y.value.variant : v.value.componentProps.variant), F = r(() => c(o(p, b.value?.tokens?.variant), [P.value, y.value.color])), I = r(() => c(o(f, b.value?.tokens?.rounded), y.value.rounded));
50
50
  return {
51
51
  tag: C,
52
52
  merged: y,
53
53
  isMini: E,
54
- iconBind: r(() => e(x.value?.icon, {}, c({
54
+ iconBind: r(() => e(x.value?.icon, {}, a({
55
55
  "shrink-0": !0,
56
56
  [S.value.icon ?? ""]: !0
57
57
  }))),
58
- rootBind: r(() => e(x.value?.root, v.value.inheritedAttrs, c({
58
+ rootBind: r(() => e(x.value?.root, v.value.inheritedAttrs, a({
59
59
  "inline-flex items-center justify-center": !0,
60
60
  "cursor-pointer outline-none outline-hidden": !0,
61
61
  "shrink-0": E.value,
@@ -64,9 +64,9 @@ function h(h, g) {
64
64
  "w-full": !E.value && y.value.full,
65
65
  "w-fit": !E.value && !y.value.full,
66
66
  "group hover:shadow-xs": !E.value,
67
- [a(F.value, "base") ?? ""]: !0,
68
- [a(F.value, "hover") ?? ""]: !0,
69
- [a(F.value, "focus") ?? ""]: !0,
67
+ [c(F.value, "base") ?? ""]: !0,
68
+ [c(F.value, "hover") ?? ""]: !0,
69
+ [c(F.value, "focus") ?? ""]: !0,
70
70
  "transition-all ease-in-out duration-200": !0,
71
71
  "focus:ring-2": !0,
72
72
  "focus:ring-offset-background-white dark:focus:ring-offset-background-dark": !0,
@@ -76,19 +76,19 @@ function h(h, g) {
76
76
  }))),
77
77
  rootHref: j,
78
78
  rootType: M,
79
- endIconBind: r(() => e(x.value?.endIcon, {}, c({
79
+ endIconBind: r(() => e(x.value?.endIcon, {}, a({
80
80
  "shrink-0": !0,
81
81
  [S.value.endIcon ?? ""]: !0
82
82
  }))),
83
83
  endSlotBind: r(() => e(x.value?.end, {}, "inline-flex shrink-0 items-center")),
84
84
  rootAriaBusy: k,
85
85
  rootDisabled: O,
86
- startIconBind: r(() => e(x.value?.startIcon, {}, c({
86
+ startIconBind: r(() => e(x.value?.startIcon, {}, a({
87
87
  "shrink-0": !0,
88
88
  [S.value.startIcon ?? ""]: !0
89
89
  }))),
90
90
  startSlotBind: r(() => e(x.value?.start, {}, "inline-flex shrink-0 items-center")),
91
- loadingIconBind: r(() => e(x.value?.loading, {}, c({
91
+ loadingIconBind: r(() => e(x.value?.loading, {}, a({
92
92
  "shrink-0 animate-spin": !0,
93
93
  [S.value.loading ?? ""]: !0
94
94
  }))),
@@ -1,8 +1,8 @@
1
1
  import { hasNamedSlot as e } from "../../../Utils/slotOrProp.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 } from "es-toolkit/compat";
5
- import { cn as c, mergeBridgeUILayeredClasses as l, splitComponentProps as u } from "@bridge-ui/core";
4
+ import { cn as s, mergeBridgeUILayeredClasses as c, splitComponentProps as l } from "@bridge-ui/core";
5
+ import { get as u } from "es-toolkit/compat";
6
6
  import { paddingProps as d, roundedProps as f, shadowProps as p, variantProps as m } from "@bridge-ui/core/Tokens/Card";
7
7
  //#region src/Components/Card/composables/useCard.ts
8
8
  var h = [
@@ -16,7 +16,7 @@ var h = [
16
16
  "customProps"
17
17
  ];
18
18
  function g(g, _) {
19
- let v = a(), y = o(), b = i(() => u({
19
+ let v = a(), y = o(), b = i(() => l({
20
20
  bridgeKeys: h,
21
21
  props: {
22
22
  ...v,
@@ -32,44 +32,44 @@ function g(g, _) {
32
32
  }), T = i(() => {
33
33
  let e = y.default?.();
34
34
  return !!(e && e.length > 0);
35
- }), E = i(() => e(y, "footer")), D = i(() => s(l(m, S.value?.tokens?.variant), x.value.variant)), O = i(() => x.value.borderless ? !1 : !!s(D.value, "border")), k = i(() => {
36
- if (x.value.variant === "elevated") return s(l(p, S.value?.tokens?.shadow), x.value.shadow);
37
- }), A = i(() => s(l(d, S.value?.tokens?.padding), x.value.padding)), j = i(() => s(l(f, S.value?.tokens?.rounded), x.value.rounded)), M = i(() => t(C.value?.body, {}, c({
35
+ }), E = i(() => e(y, "footer")), D = i(() => u(c(m, S.value?.tokens?.variant), x.value.variant)), O = i(() => x.value.borderless ? !1 : !!u(D.value, "border")), k = i(() => {
36
+ if (x.value.variant === "elevated") return u(c(p, S.value?.tokens?.shadow), x.value.shadow);
37
+ }), A = i(() => u(c(d, S.value?.tokens?.padding), x.value.padding)), j = i(() => u(c(f, S.value?.tokens?.rounded), x.value.rounded)), M = i(() => t(C.value?.body, {}, s({
38
38
  grow: !0,
39
- [s(A.value, "body") ?? ""]: !0,
40
- [s(D.value, "text") ?? ""]: !0,
41
- [s(w.value, "body") ?? ""]: !0
42
- }))), N = i(() => t(C.value?.footer, {}, c({
39
+ [u(A.value, "body") ?? ""]: !0,
40
+ [u(D.value, "text") ?? ""]: !0,
41
+ [u(w.value, "body") ?? ""]: !0
42
+ }))), N = i(() => t(C.value?.footer, {}, s({
43
43
  "border-t": O.value,
44
- [s(A.value, "footer") ?? ""]: !0,
45
- [s(D.value, "border") ?? ""]: O.value,
46
- [s(D.value, "footer") ?? ""]: !0,
47
- [s(j.value, "footer") ?? ""]: !0,
48
- [s(w.value, "footer") ?? ""]: !0
49
- }))), P = i(() => t(C.value?.header, {}, c({
44
+ [u(A.value, "footer") ?? ""]: !0,
45
+ [u(D.value, "border") ?? ""]: O.value,
46
+ [u(D.value, "footer") ?? ""]: !0,
47
+ [u(j.value, "footer") ?? ""]: !0,
48
+ [u(w.value, "footer") ?? ""]: !0
49
+ }))), P = i(() => t(C.value?.header, {}, s({
50
50
  "flex items-center justify-between": !0,
51
51
  "border-b": O.value,
52
- [s(A.value, "header") ?? ""]: !0,
53
- [s(D.value, "border") ?? ""]: O.value,
54
- [s(j.value, "header") ?? ""]: !0,
55
- [s(w.value, "header") ?? ""]: !0
52
+ [u(A.value, "header") ?? ""]: !0,
53
+ [u(D.value, "border") ?? ""]: O.value,
54
+ [u(j.value, "header") ?? ""]: !0,
55
+ [u(w.value, "header") ?? ""]: !0
56
56
  })));
57
57
  return {
58
58
  slots: y,
59
59
  merged: x,
60
60
  bodyBind: M,
61
- rootBind: i(() => t(C.value?.root, b.value.inheritedAttrs, c({
61
+ rootBind: i(() => t(C.value?.root, b.value.inheritedAttrs, s({
62
62
  "flex w-full flex-col": !0,
63
63
  [k.value ?? ""]: !0,
64
- [s(j.value, "root") ?? ""]: !0,
65
- [s(D.value, "root") ?? ""]: !0,
66
- [s(w.value, "root") ?? ""]: !0
64
+ [u(j.value, "root") ?? ""]: !0,
65
+ [u(D.value, "root") ?? ""]: !0,
66
+ [u(w.value, "root") ?? ""]: !0
67
67
  }))),
68
68
  hasFooter: E,
69
- titleBind: i(() => t(C.value?.title, {}, c({
69
+ titleBind: i(() => t(C.value?.title, {}, s({
70
70
  "text-base font-medium whitespace-normal": !0,
71
- [s(D.value, "text") ?? ""]: !0,
72
- [s(w.value, "title") ?? ""]: !0
71
+ [u(D.value, "text") ?? ""]: !0,
72
+ [u(w.value, "title") ?? ""]: !0
73
73
  }))),
74
74
  footerBind: N,
75
75
  headerBind: P,