@bridge-ui/vue 0.0.5 → 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 (152) 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 -0
  5. package/dist/Adapters/I18n/index.js +2 -0
  6. package/dist/Adapters/I18n/useI18nAdapter.d.ts +16 -0
  7. package/dist/Adapters/I18n/useI18nAdapter.js +18 -0
  8. package/dist/Adapters/Icon/iconSource.types.d.ts +11 -0
  9. package/dist/Adapters/Icon/index.d.ts +2 -0
  10. package/dist/Adapters/Icon/index.js +2 -0
  11. package/dist/Adapters/Icon/useIconAdapter.d.ts +11 -0
  12. package/dist/Adapters/Icon/useIconAdapter.js +13 -0
  13. package/dist/Adapters/index.d.ts +3 -0
  14. package/dist/Adapters/index.js +3 -0
  15. package/dist/Components/Alert/Alert.vue_vue_type_script_setup_true_lang.js +1 -5
  16. package/dist/Components/Alert/alert.types.d.ts +2 -2
  17. package/dist/Components/Alert/alertDefaultIcons.d.ts +2 -2
  18. package/dist/Components/Alert/alertDefaultIcons.js +9 -10
  19. package/dist/Components/Alert/composables/useAlert.d.ts +2 -2
  20. package/dist/Components/Alert/composables/useAlert.js +17 -17
  21. package/dist/Components/Autocomplete/Autocomplete.js +5 -0
  22. package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +40 -0
  23. package/dist/Components/Autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +197 -0
  24. package/dist/Components/Autocomplete/AutocompleteOption.js +5 -0
  25. package/dist/Components/Autocomplete/AutocompleteOption.vue.d.ts +4 -0
  26. package/dist/Components/Autocomplete/AutocompleteOption.vue_vue_type_script_setup_true_lang.js +32 -0
  27. package/dist/Components/Autocomplete/autocomplete.types.d.ts +285 -0
  28. package/dist/Components/Autocomplete/autocompleteInjectionKey.d.ts +7 -0
  29. package/dist/Components/Autocomplete/autocompleteInjectionKey.js +4 -0
  30. package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +762 -0
  31. package/dist/Components/Autocomplete/composables/useAutocomplete.js +382 -0
  32. package/dist/Components/Autocomplete/index.d.ts +4 -0
  33. package/dist/Components/Autocomplete/index.js +4 -0
  34. package/dist/Components/Avatar/Avatar.vue_vue_type_script_setup_true_lang.js +1 -1
  35. package/dist/Components/Avatar/avatar.types.d.ts +2 -2
  36. package/dist/Components/Avatar/composables/useAvatar.d.ts +1 -1
  37. package/dist/Components/Avatar/composables/useAvatar.js +46 -47
  38. package/dist/Components/Badge/composables/useBadge.js +8 -8
  39. package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +24 -25
  40. package/dist/Components/Button/button.types.d.ts +4 -4
  41. package/dist/Components/Button/composables/useButton.d.ts +1 -1
  42. package/dist/Components/Button/composables/useButton.js +14 -14
  43. package/dist/Components/Card/composables/useCard.js +27 -27
  44. package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +27 -27
  45. package/dist/Components/Checkbox/composables/useCheckbox.d.ts +4 -4
  46. package/dist/Components/Checkbox/composables/useCheckbox.js +9 -9
  47. package/dist/Components/Chip/Chip.vue_vue_type_script_setup_true_lang.js +8 -9
  48. package/dist/Components/Chip/composables/useChip.js +6 -6
  49. package/dist/Components/Divider/composables/useDivider.js +5 -5
  50. package/dist/Components/Drawer/composables/useDrawer.js +23 -23
  51. package/dist/Components/FormControl/FormControl.vue_vue_type_script_setup_true_lang.js +1 -1
  52. package/dist/Components/FormControl/composables/useFormControl.d.ts +3 -3
  53. package/dist/Components/FormControl/composables/useFormControl.js +12 -12
  54. package/dist/Components/FormControl/formControl.types.d.ts +6 -6
  55. package/dist/Components/FormField/FilledFormField.vue_vue_type_script_setup_true_lang.js +2 -2
  56. package/dist/Components/FormField/NotchedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
  57. package/dist/Components/FormField/OutlinedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
  58. package/dist/Components/FormField/StackedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
  59. package/dist/Components/FormField/UnderlinedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
  60. package/dist/Components/FormField/composables/useFormField.d.ts +6 -6
  61. package/dist/Components/FormField/composables/useFormField.js +108 -109
  62. package/dist/Components/FormField/formField.types.d.ts +19 -19
  63. package/dist/Components/Icon/Icon.vue_vue_type_script_setup_true_lang.js +7 -7
  64. package/dist/Components/Icon/composables/useIcon.d.ts +2 -0
  65. package/dist/Components/Icon/composables/useIcon.js +20 -18
  66. package/dist/Components/Icon/icon.types.d.ts +3 -3
  67. package/dist/Components/Label/composables/useLabel.d.ts +1 -1
  68. package/dist/Components/Label/composables/useLabel.js +5 -5
  69. package/dist/Components/Link/Link.vue_vue_type_script_setup_true_lang.js +2 -2
  70. package/dist/Components/Link/composables/useLink.js +9 -9
  71. package/dist/Components/Link/link.types.d.ts +3 -3
  72. package/dist/Components/List/composables/useList.js +6 -6
  73. package/dist/Components/ListItem/composables/useListItem.d.ts +2 -2
  74. package/dist/Components/ListItem/composables/useListItem.js +81 -82
  75. package/dist/Components/ListItem/listItem.types.d.ts +2 -2
  76. package/dist/Components/ListSection/composables/useListSection.js +8 -8
  77. package/dist/Components/Listbox/Listbox.vue.d.ts +0 -2
  78. package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +75 -74
  79. package/dist/Components/Listbox/composables/useListbox.js +7 -7
  80. package/dist/Components/Listbox/index.js +3 -3
  81. package/dist/Components/Menu/composables/useMenu.js +43 -43
  82. package/dist/Components/Modal/composables/useModal.js +18 -18
  83. package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +43 -43
  84. package/dist/Components/NumberField/composables/useNumberField.d.ts +8 -8
  85. package/dist/Components/NumberField/composables/useNumberField.js +9 -9
  86. package/dist/Components/OtpField/OtpField.js +5 -0
  87. package/dist/Components/OtpField/OtpField.vue.d.ts +31 -0
  88. package/dist/Components/OtpField/OtpField.vue_vue_type_script_setup_true_lang.js +80 -0
  89. package/dist/Components/OtpField/OtpFieldLabel.js +5 -0
  90. package/dist/Components/OtpField/OtpFieldLabel.vue.d.ts +7 -0
  91. package/dist/Components/OtpField/OtpFieldLabel.vue_vue_type_script_setup_true_lang.js +16 -0
  92. package/dist/Components/OtpField/composables/useOtpField.d.ts +460 -0
  93. package/dist/Components/OtpField/composables/useOtpField.js +212 -0
  94. package/dist/Components/OtpField/index.d.ts +4 -0
  95. package/dist/Components/OtpField/index.js +3 -0
  96. package/dist/Components/OtpField/otpField.types.d.ts +290 -0
  97. package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +27 -27
  98. package/dist/Components/PasswordField/composables/usePasswordField.d.ts +8 -8
  99. package/dist/Components/PasswordField/composables/usePasswordField.js +2 -2
  100. package/dist/Components/Progress/composables/useProgress.js +11 -11
  101. package/dist/Components/Radio/Radio.vue_vue_type_script_setup_true_lang.js +2 -2
  102. package/dist/Components/Radio/composables/useRadio.d.ts +4 -4
  103. package/dist/Components/Radio/composables/useRadio.js +9 -9
  104. package/dist/Components/Select/Select.vue.d.ts +1 -2
  105. package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +72 -68
  106. package/dist/Components/Select/composables/useSelect.d.ts +10 -10
  107. package/dist/Components/Select/composables/useSelect.js +193 -193
  108. package/dist/Components/Skeleton/composables/useSkeleton.js +5 -5
  109. package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +81 -75
  110. package/dist/Components/Snackbar/composables/useSnackbar.d.ts +4 -4
  111. package/dist/Components/Snackbar/composables/useSnackbar.js +115 -115
  112. package/dist/Components/Snackbar/snackbar.types.d.ts +2 -2
  113. package/dist/Components/Snackbar/snackbarDefaultIcons.d.ts +3 -3
  114. package/dist/Components/Snackbar/snackbarDefaultIcons.js +9 -10
  115. package/dist/Components/Spinner/composables/useSpinner.js +11 -11
  116. package/dist/Components/Switch/Switch.vue_vue_type_script_setup_true_lang.js +2 -2
  117. package/dist/Components/Switch/composables/useSwitch.d.ts +4 -4
  118. package/dist/Components/Switch/composables/useSwitch.js +9 -9
  119. package/dist/Components/Tab/Tab.vue_vue_type_script_setup_true_lang.js +2 -2
  120. package/dist/Components/Tab/composables/useTab.js +11 -11
  121. package/dist/Components/Tab/tab.types.d.ts +3 -3
  122. package/dist/Components/TabItem/TabItem.vue_vue_type_script_setup_true_lang.js +2 -2
  123. package/dist/Components/TabItem/tabItem.types.d.ts +3 -3
  124. package/dist/Components/TabList/composables/useTabList.js +7 -7
  125. package/dist/Components/TabPanel/composables/useTabPanel.js +7 -7
  126. package/dist/Components/Tabs/composables/useTabs.d.ts +468 -4
  127. package/dist/Components/Tabs/composables/useTabs.js +22 -22
  128. package/dist/Components/Tabs/tabsInjectionKey.d.ts +5 -5
  129. package/dist/Components/TextField/TextField.vue.d.ts +1 -1
  130. package/dist/Components/TextField/TextField.vue_vue_type_script_setup_true_lang.js +6 -6
  131. package/dist/Components/TextField/composables/useTextField.d.ts +8 -8
  132. package/dist/Components/TextField/composables/useTextField.js +1 -1
  133. package/dist/Components/Textarea/Textarea.vue.d.ts +1 -1
  134. package/dist/Components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +6 -6
  135. package/dist/Components/Textarea/composables/useTextarea.d.ts +8 -8
  136. package/dist/Components/Textarea/composables/useTextarea.js +9 -9
  137. package/dist/Components/Tooltip/Tooltip.js +5 -0
  138. package/dist/Components/Tooltip/Tooltip.vue.d.ts +35 -0
  139. package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +73 -0
  140. package/dist/Components/Tooltip/composables/useTooltip.d.ts +50 -0
  141. package/dist/Components/Tooltip/composables/useTooltip.js +208 -0
  142. package/dist/Components/Tooltip/index.d.ts +4 -0
  143. package/dist/Components/Tooltip/index.js +3 -0
  144. package/dist/Components/Tooltip/tooltip.types.d.ts +166 -0
  145. package/dist/Provider/bridgeUITypes.d.ts +4 -1
  146. package/dist/Provider/createBridgeUIApi.js +15 -2
  147. package/dist/Utils/index.js +7 -7
  148. package/dist/Utils/useBreakpoint.js +7 -7
  149. package/dist/augments.d.ts +2 -2
  150. package/dist/index.d.ts +11 -1
  151. package/dist/index.js +84 -76
  152. package/package.json +21 -3
@@ -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 };
@@ -12,7 +12,7 @@ var p = /* @__PURE__ */ a({
12
12
  color: {},
13
13
  customProps: {},
14
14
  fallback: {},
15
- icon: { type: [Function, Object] },
15
+ icon: {},
16
16
  rounded: {},
17
17
  size: {},
18
18
  src: {}
@@ -1,6 +1,6 @@
1
- import { LucideIcon } from '@lucide/vue';
2
1
  import { HTMLAttributes, ImgHTMLAttributes, Slot } from 'vue';
3
2
  import { AvatarColor, AvatarRounded, AvatarSize, MergeHtmlProps, MergeProps } from '@bridge-ui/core';
3
+ import { IconSource } from '../../Adapters/Icon';
4
4
  import { IconProps } from '../Icon';
5
5
  export interface AvatarSizeOverrides {}
6
6
  export interface AvatarColorOverrides {}
@@ -81,7 +81,7 @@ export interface AvatarOwnProps {
81
81
  *
82
82
  * @default undefined
83
83
  */
84
- icon?: LucideIcon;
84
+ icon?: IconSource;
85
85
  /**
86
86
  * The roundedness of the avatar.
87
87
  *
@@ -15,7 +15,7 @@ export declare function useAvatar(props: AvatarProps, libDefaults: AvatarLibDefa
15
15
  src: string | undefined;
16
16
  }>>;
17
17
  fallbackBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
18
- resolvedIcon: import('vue').ComputedRef<import('@lucide/vue').LucideIcon>;
18
+ resolvedIcon: import('vue').ComputedRef<import('../../..').IconSource>;
19
19
  hasFallbackSlot: import('vue').ComputedRef<boolean>;
20
20
  hasFallbackText: import('vue').ComputedRef<boolean>;
21
21
  hasCustomContent: import('vue').ComputedRef<boolean>;
@@ -1,12 +1,11 @@
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";
6
- import { User as p } from "@lucide/vue";
7
- import { colorProps as m, iconSizeProps as h, roundedProps as g, sizeProps as _ } from "@bridge-ui/core/Tokens/Avatar";
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
+ import { colorProps as p, iconSizeProps as m, roundedProps as h, sizeProps as g } from "@bridge-ui/core/Tokens/Avatar";
8
7
  //#region src/Components/Avatar/composables/useAvatar.ts
9
- var v = [
8
+ var _ = [
10
9
  "alt",
11
10
  "src",
12
11
  "icon",
@@ -17,58 +16,58 @@ var v = [
17
16
  "fallback",
18
17
  "customProps"
19
18
  ];
20
- function y(y, b) {
21
- let x = a(), S = o(), C = i(() => f({
22
- bridgeKeys: v,
19
+ function v(v, y) {
20
+ let b = a(), x = o(), S = i(() => l({
21
+ bridgeKeys: _,
23
22
  props: {
24
- ...x,
25
- ...y
23
+ ...b,
24
+ ...v
26
25
  }
27
- })), { merged: w, entry: T } = n({
28
- libDefaults: b,
26
+ })), { merged: C, entry: w } = n({
27
+ libDefaults: y,
29
28
  componentName: "Avatar",
30
- props: () => C.value.componentProps
31
- }), E = r({
32
- entry: T,
33
- props: () => C.value.componentProps
34
- }), D = i(() => e(S, "default")), O = i(() => !l(w.value.src) && !c(w.value.src)), k = i(() => e(S, "fallback")), A = i(() => !l(w.value.fallback) && !c(w.value.fallback)), j = i(() => w.value.icon ?? p), M = i(() => !O.value && !D.value), N = i(() => s(d(_, T.value?.tokens?.size), w.value.size)), P = i(() => s(d(m, T.value?.tokens?.color), w.value.color)), F = i(() => s(d(g, T.value?.tokens?.rounded), w.value.rounded)), I = i(() => s(d(h, T.value?.tokens?.iconSize), w.value.size)), L = i(() => w.value.customProps), R = i(() => t(L.value?.root, C.value.inheritedAttrs, u({
29
+ props: () => S.value.componentProps
30
+ }), T = r({
31
+ entry: w,
32
+ props: () => S.value.componentProps
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({
35
34
  "inline-flex shrink-0 items-center justify-center overflow-hidden": !0,
36
- [E.value.root ?? ""]: !0,
37
- [F.value ?? ""]: !0,
38
- [N.value ?? ""]: M.value || D.value || O.value,
39
- [s(P.value, "background") ?? ""]: M.value,
40
- [s(P.value, "text") ?? ""]: M.value
41
- }))), z = i(() => t(L.value?.image, {
42
- alt: w.value.alt,
43
- src: w.value.src
44
- }, u({
35
+ [T.value.root ?? ""]: !0,
36
+ [P.value ?? ""]: !0,
37
+ [M.value ?? ""]: j.value || E.value || D.value,
38
+ [u(N.value, "background") ?? ""]: j.value,
39
+ [u(N.value, "text") ?? ""]: j.value
40
+ }))), R = i(() => t(I.value?.image, {
41
+ alt: C.value.alt,
42
+ src: C.value.src
43
+ }, s({
45
44
  "shrink-0 object-cover object-center": !0,
46
- [N.value ?? ""]: !0,
47
- [F.value ?? ""]: !0,
48
- [E.value.image ?? ""]: !0
49
- }))), B = i(() => t(L.value?.fallback, {}, u({
45
+ [M.value ?? ""]: !0,
46
+ [P.value ?? ""]: !0,
47
+ [T.value.image ?? ""]: !0
48
+ }))), z = i(() => t(I.value?.fallback, {}, s({
50
49
  "font-medium": !0,
51
- [s(I.value, "label") ?? ""]: !0,
52
- [s(P.value, "text") ?? ""]: !0,
53
- [E.value.fallback ?? ""]: !0
50
+ [u(F.value, "label") ?? ""]: !0,
51
+ [u(N.value, "text") ?? ""]: !0,
52
+ [T.value.fallback ?? ""]: !0
54
53
  })));
55
54
  return {
56
- slots: S,
57
- merged: w,
58
- rootBind: R,
59
- iconBind: i(() => t(L.value?.icon, {}, u({
55
+ slots: x,
56
+ merged: C,
57
+ rootBind: L,
58
+ iconBind: i(() => t(I.value?.icon, {}, s({
60
59
  "shrink-0": !0,
61
- [s(I.value, "icon") ?? ""]: !0,
62
- [s(P.value, "text") ?? ""]: !0
60
+ [u(F.value, "icon") ?? ""]: !0,
61
+ [u(N.value, "text") ?? ""]: !0
63
62
  }))),
64
- hasImage: O,
65
- imageBind: z,
66
- fallbackBind: B,
67
- resolvedIcon: j,
68
- hasFallbackSlot: k,
69
- hasFallbackText: A,
70
- hasCustomContent: D
63
+ hasImage: D,
64
+ imageBind: R,
65
+ fallbackBind: z,
66
+ resolvedIcon: A,
67
+ hasFallbackSlot: O,
68
+ hasFallbackText: k,
69
+ hasCustomContent: E
71
70
  };
72
71
  }
73
72
  //#endregion
74
- export { y as useAvatar };
73
+ export { v as useAvatar };
@@ -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
  };