@bridge-ui/vue 0.0.1-beta.2 → 0.0.1-beta.3

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 (49) hide show
  1. package/dist/Components/Alert/alert.types.d.ts +1 -1
  2. package/dist/Components/Alert/alertDefaultIcons.d.ts +1 -1
  3. package/dist/Components/Alert/alertDefaultIcons.js +1 -1
  4. package/dist/Components/Alert/composables/useAlert.d.ts +1 -1
  5. package/dist/Components/Avatar/avatar.types.d.ts +1 -1
  6. package/dist/Components/Avatar/composables/useAvatar.d.ts +1 -1
  7. package/dist/Components/Avatar/composables/useAvatar.js +1 -1
  8. package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +1 -1
  9. package/dist/Components/Button/button.types.d.ts +1 -1
  10. package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +1 -1
  11. package/dist/Components/Chip/Chip.js +5 -0
  12. package/dist/Components/Chip/Chip.vue.d.ts +20 -0
  13. package/dist/Components/Chip/Chip.vue_vue_type_script_setup_true_lang.js +35 -0
  14. package/dist/Components/Chip/chip.types.d.ts +93 -0
  15. package/dist/Components/Chip/composables/useChip.d.ts +22 -0
  16. package/dist/Components/Chip/composables/useChip.js +66 -0
  17. package/dist/Components/Chip/index.d.ts +3 -0
  18. package/dist/Components/Chip/index.js +3 -0
  19. package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
  20. package/dist/Components/FormField/composables/useFormField.js +1 -1
  21. package/dist/Components/FormField/formField.types.d.ts +1 -1
  22. package/dist/Components/Icon/icon.types.d.ts +1 -1
  23. package/dist/Components/Link/link.types.d.ts +1 -1
  24. package/dist/Components/Listbox/Listbox.vue.d.ts +2 -0
  25. package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +53 -49
  26. package/dist/Components/Listbox/composables/useListbox.d.ts +11 -2
  27. package/dist/Components/Listbox/composables/useListbox.js +44 -28
  28. package/dist/Components/Listbox/listbox.types.d.ts +28 -3
  29. package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +1 -1
  30. package/dist/Components/NumberField/composables/useNumberField.d.ts +2 -2
  31. package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +1 -1
  32. package/dist/Components/PasswordField/composables/usePasswordField.d.ts +2 -2
  33. package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +69 -89
  34. package/dist/Components/Select/composables/useSelect.d.ts +27 -3
  35. package/dist/Components/Select/composables/useSelect.js +162 -140
  36. package/dist/Components/Select/select.types.d.ts +22 -1
  37. package/dist/Components/Snackbar/Snackbar.vue.d.ts +1 -1
  38. package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +1 -1
  39. package/dist/Components/Snackbar/composables/useSnackbar.d.ts +1 -1
  40. package/dist/Components/Snackbar/snackbar.types.d.ts +1 -1
  41. package/dist/Components/Snackbar/snackbarDefaultIcons.d.ts +1 -1
  42. package/dist/Components/Snackbar/snackbarDefaultIcons.js +1 -1
  43. package/dist/Components/TextField/composables/useTextField.d.ts +2 -2
  44. package/dist/Components/Textarea/composables/useTextarea.d.ts +2 -2
  45. package/dist/augments.d.ts +5 -0
  46. package/dist/index.d.ts +2 -0
  47. package/dist/index.js +39 -37
  48. package/dist/theme.css +14 -0
  49. package/package.json +4 -4
@@ -1,14 +1,14 @@
1
1
  import { hasNamedSlot as e } from "../../../Utils/slotOrProp.js";
2
2
  import { mergePartBind as t, resolveFieldAdornmentIconSize as n, useBridgeUIComponent as r, useBridgeUIMergedRegistryClasses as ee } from "../../../Utils/index.js";
3
- import { formFieldBridgeKeys as te, useFormField as ne } from "../../FormField/composables/useFormField.js";
4
- import { useListboxNavigation as re } from "../../Listbox/composables/useListboxNavigation.js";
5
- import { computed as i, nextTick as a, onBeforeUnmount as ie, onMounted as ae, ref as o, useAttrs as oe, useId as se, useSlots as ce, watch as s } from "vue";
6
- import { get as c, isNil as le, omit as ue } from "es-toolkit/compat";
7
- import { adjustAutosizeTextareaHeight as de, cn as l, createSelectAsyncSearch as fe, mergeBridgeUILayeredClasses as u, normalizeSelectOptions as d, resolveSelectAsyncDebounce as pe, resolveSelectAsyncOptions as me, selectValuesEqual as f, splitComponentProps as p } from "@bridge-ui/core";
8
- import { ChevronsUpDown as he } from "lucide-vue-next";
9
- import { colorProps as ge, invalidatedProps as _e } from "@bridge-ui/core/Components/Listbox";
3
+ import { formFieldBridgeKeys as te, useFormField as i } from "../../FormField/composables/useFormField.js";
4
+ import { useListboxNavigation as ne } from "../../Listbox/composables/useListboxNavigation.js";
5
+ import { computed as a, nextTick as o, onBeforeUnmount as re, onMounted as ie, ref as s, useAttrs as ae, useId as oe, useSlots as se, watch as c } from "vue";
6
+ import { get as l, isNil as ce, omit as le } from "es-toolkit/compat";
7
+ import { adjustAutosizeTextareaHeight as ue, cn as u, createSelectAsyncSearch as de, mergeBridgeUILayeredClasses as d, normalizeSelectOptions as f, resolveSelectAsyncDebounce as fe, resolveSelectAsyncOptions as pe, selectValuesEqual as p, splitComponentProps as m } from "@bridge-ui/core";
8
+ import { ChevronsUpDown as me } from "@lucide/vue";
9
+ import { colorProps as he, invalidatedProps as ge } from "@bridge-ui/core/Components/Listbox";
10
10
  //#region src/Components/Select/composables/useSelect.ts
11
- var ve = [
11
+ var _e = [
12
12
  "classes",
13
13
  "loading",
14
14
  "options",
@@ -23,146 +23,147 @@ var ve = [
23
23
  "placeholder",
24
24
  "defaultValue",
25
25
  "emptyMessage",
26
+ "loadingMessage",
26
27
  "disableMaxHeight",
27
28
  "hideEmptyMessage",
28
29
  "minItemsForSearch",
29
30
  "optionDescription"
30
31
  ];
31
- function m(m, h, g, _, v) {
32
- let ye = oe(), y = ce(), b = se(), x = o(!1), S = o(""), C = o(-1), w = o(null), T = o(!1), E = o([]), D = null, O = o([]), k = i(() => p({
33
- bridgeKeys: ve,
32
+ function h(h, g, _, v, y) {
33
+ let ve = ae(), ye = se(), b = oe(), x = s(!1), S = s(""), C = s(-1), be = s(null), w = s(!1), T = s([]), E = null, D = s([]), O = a(() => m({
34
+ bridgeKeys: _e,
34
35
  props: {
35
- ...ye,
36
- ...m
36
+ ...ve,
37
+ ...h
37
38
  }
38
- })), A = i(() => k.value.componentProps), j = i(() => ({ classes: A.value.classes })), { components: M, entry: be } = r({
39
+ })), k = a(() => O.value.componentProps), A = a(() => ({ classes: k.value.classes })), { components: j, entry: xe } = r({
39
40
  componentName: "Select",
40
- props: () => j.value
41
- }), N = ee({
42
- entry: be,
43
- props: () => j.value
44
- }), P = i(() => !!A.value.multiple), F = i(() => ({
45
- optionLabel: A.value.optionLabel ?? "label",
46
- optionValue: A.value.optionValue ?? "value",
47
- optionDescription: A.value.optionDescription ?? "description"
48
- })), I = i(() => v.value.length > 0 ? v.value : d(A.value.options, F.value)), L = i(() => {
49
- let e = E.value.length > 0 ? E.value : I.value;
50
- return A.value.flipOptions ? [...e].reverse() : e;
51
- }), R = i(() => {
52
- let e = h.value;
53
- return P.value ? Array.isArray(e) ? e : [] : !le(e) && e !== "" ? [e] : [];
54
- }), z = i(() => {
41
+ props: () => A.value
42
+ }), M = ee({
43
+ entry: xe,
44
+ props: () => A.value
45
+ }), N = a(() => !!k.value.multiple), P = a(() => ({
46
+ optionLabel: k.value.optionLabel ?? "label",
47
+ optionValue: k.value.optionValue ?? "value",
48
+ optionDescription: k.value.optionDescription ?? "description"
49
+ })), F = a(() => y.value.length > 0 ? y.value : f(k.value.options, P.value)), I = a(() => {
50
+ let e = T.value.length > 0 ? T.value : F.value;
51
+ return k.value.flipOptions ? [...e].reverse() : e;
52
+ }), L = a(() => {
53
+ let e = g.value;
54
+ return N.value ? Array.isArray(e) ? e : [] : !ce(e) && e !== "" ? [e] : [];
55
+ }), R = a(() => {
55
56
  let e = /* @__PURE__ */ new Map();
56
- for (let t of [...L.value, ...O.value]) e.set(t.value, t);
57
- return R.value.map((t) => e.get(t) ?? {
57
+ for (let t of [...I.value, ...D.value]) e.set(t.value, t);
58
+ return L.value.map((t) => e.get(t) ?? {
58
59
  value: t,
59
60
  label: String(t)
60
61
  });
61
- }), B = i(() => R.value.length > 0), xe = i(() => A.value.clearable !== !1), V = i(() => !!A.value.asyncData), H = i(() => {
62
- if (V.value || A.value.searchable) return !0;
63
- let e = A.value.minItemsForSearch ?? 11;
64
- return I.value.length >= e;
65
- }), U = i(() => x.value && H.value), Se = i(() => !!A.value.loading || T.value), W = i(() => {
66
- if (!U.value || !S.value.trim()) return L.value;
62
+ }), z = a(() => L.value.length > 0), Se = a(() => k.value.clearable !== !1), B = a(() => !!k.value.asyncData), V = a(() => {
63
+ if (B.value || k.value.searchable) return !0;
64
+ let e = k.value.minItemsForSearch ?? 11;
65
+ return F.value.length >= e;
66
+ }), H = a(() => x.value && V.value), U = a(() => !!k.value.loading || w.value), W = a(() => {
67
+ if (!H.value || !S.value.trim()) return I.value;
67
68
  let e = S.value.trim().toLowerCase();
68
- return L.value.filter((t) => t.label.toLowerCase().includes(e));
69
- }), G = re(() => W.value, C, b), Ce = i(() => m.readonly || m.disabled ? !0 : !U.value), we = i(() => U.value || P.value ? S.value : z.value[0]?.label ?? ""), Te = (e) => {
70
- w.value = e instanceof HTMLElement ? e : null;
69
+ return I.value.filter((t) => t.label.toLowerCase().includes(e));
70
+ }), G = ne(() => W.value, C, b), Ce = a(() => h.readonly || h.disabled ? !0 : !H.value), we = a(() => H.value || N.value ? S.value : R.value[0]?.label ?? ""), Te = (e) => {
71
+ be.value = e instanceof HTMLElement ? e : null;
71
72
  };
72
73
  function Ee(e) {
73
74
  e.preventDefault();
74
75
  }
75
76
  function De(e) {
76
- if (m.disabled || m.readonly) return;
77
+ if (h.disabled || h.readonly) return;
77
78
  let t = e.target;
78
79
  if (!t.closest("[data-select-clear]") && !(t.closest(".wrapper-start-slot") || t.closest(".wrapper-end-slot"))) {
79
80
  if (!x.value) {
80
81
  Z();
81
82
  return;
82
83
  }
83
- U.value || (Q(), g.value?.focus({ preventScroll: !0 }));
84
+ H.value || (Q(), _.value?.focus({ preventScroll: !0 }));
84
85
  }
85
86
  }
86
- let Oe = i(() => {
87
- let n = p({
87
+ let Oe = a(() => {
88
+ let n = m({
88
89
  bridgeKeys: te,
89
- props: ue(k.value.inheritedAttrs, ["class"])
90
- }).componentProps, r = n.endIcon ?? (e(y, "end") ? void 0 : he);
90
+ props: le(O.value.inheritedAttrs, ["class"])
91
+ }).componentProps, r = n.endIcon ?? (e(ye, "end") ? void 0 : me), { listbox: ee, ...i } = n.customProps ?? {};
91
92
  return {
92
93
  ...n,
93
94
  endIcon: r,
94
- classes: N.value,
95
+ classes: M.value,
95
96
  customProps: {
96
- ...n.customProps,
97
- container: t(n.customProps?.container, {}, {
97
+ ...i,
98
+ container: t(i.container, {}, {
98
99
  ref: Te,
99
100
  onClick: De,
100
- class: l({ "cursor-pointer": !m.disabled && !m.readonly && !U.value })
101
+ class: u({ "cursor-pointer": !h.disabled && !h.readonly && !H.value })
101
102
  })
102
103
  }
103
104
  };
104
- }), K = ne(() => Oe.value, {
105
+ }), ke = a(() => h.customProps?.listbox), K = i(() => Oe.value, {
105
106
  size: "md",
106
107
  rounded: "md",
107
108
  color: "primary",
108
109
  variant: "outline",
109
110
  withErrorIcon: !0
110
111
  }, {
111
- likeInput: () => P.value,
112
- control: () => P.value ? "textarea" : "input"
112
+ likeInput: () => N.value,
113
+ control: () => N.value ? "textarea" : "input"
113
114
  }), q = (e) => {
114
- !e || !P.value || de(e);
115
+ !e || !N.value || ue(e);
115
116
  };
116
117
  function J(e) {
117
- return R.value.some((t) => f(t, e));
118
+ return L.value.some((t) => p(t, e));
118
119
  }
119
120
  function Y(e) {
120
- h.value = e;
121
+ g.value = e;
121
122
  }
122
123
  function X(e) {
123
- if (P.value) {
124
+ if (N.value) {
124
125
  let t = Array.isArray(e) ? e : [];
125
- _("update:modelValue", t), _("change", t);
126
+ v("update:modelValue", t), v("change", t);
126
127
  return;
127
128
  }
128
129
  let t = e ?? "";
129
- _("update:modelValue", t), _("change", t);
130
+ v("update:modelValue", t), v("change", t);
130
131
  }
131
132
  function Z() {
132
- m.disabled || m.readonly || x.value || (x.value = !0, S.value = "", G.highlightCurrentSelection(J), _("open"), V.value && A.value.asyncData && D?.searchImmediate(""));
133
+ h.disabled || h.readonly || x.value || (x.value = !0, S.value = "", G.highlightCurrentSelection(J), v("open"), B.value && k.value.asyncData && E?.searchImmediate(""));
133
134
  }
134
135
  function Q() {
135
- D?.cancel(), x.value && (x.value = !1, S.value = "", C.value = -1, _("close"));
136
+ E?.cancel(), x.value && (x.value = !1, S.value = "", C.value = -1, v("close"));
136
137
  }
137
- function ke(e) {
138
+ function Ae(e) {
138
139
  if (!e.disabled) {
139
- if (P.value) {
140
- let t = [...R.value], n = t.findIndex((t) => f(t, e.value));
141
- n >= 0 ? (t.splice(n, 1), _("deselect", e)) : (t.push(e.value), _("select", e)), Y(t), X(t), S.value = "", C.value = -1, a(() => {
142
- q(g.value), g.value?.focus({ preventScroll: !0 });
140
+ if (N.value) {
141
+ let t = [...L.value], n = t.findIndex((t) => p(t, e.value));
142
+ n >= 0 ? (t.splice(n, 1), v("deselect", e)) : (t.push(e.value), v("select", e)), Y(t), X(t), S.value = "", C.value = -1, o(() => {
143
+ q(_.value), _.value?.focus({ preventScroll: !0 });
143
144
  });
144
145
  return;
145
146
  }
146
- Y(e.value), X(e.value), _("select", e), Q();
147
+ Y(e.value), X(e.value), v("select", e), Q();
147
148
  }
148
149
  }
149
- function Ae(e) {
150
- e?.preventDefault(), e?.stopPropagation(), P.value ? (Y([]), X([])) : (Y(null), X(null)), _("clear"), Q();
150
+ function je(e) {
151
+ e?.preventDefault(), e?.stopPropagation(), N.value ? (Y([]), X([])) : (Y(null), X(null)), v("clear"), Q();
151
152
  }
152
- function je(e, t) {
153
- if (t.preventDefault(), t.stopPropagation(), !P.value) return;
154
- let n = R.value.filter((t) => !f(t, e.value));
155
- Y(n), X(n), _("deselect", e), a(() => q(g.value));
153
+ function Me(e, t) {
154
+ if (t.preventDefault(), t.stopPropagation(), !N.value) return;
155
+ let n = L.value.filter((t) => !p(t, e.value));
156
+ Y(n), X(n), v("deselect", e), o(() => q(_.value));
156
157
  }
157
- function Me() {
158
+ function Ne() {
158
159
  let e = G.getHighlightedOption();
159
- e && ke(e);
160
- }
161
- function Ne(e) {
162
- S.value = e.target.value, _("search", S.value), x.value || Z(), G.resetHighlight(), V.value && D?.searchDebounced(S.value);
160
+ e && Ae(e);
163
161
  }
164
162
  function Pe(e) {
165
- if (!(m.disabled || m.readonly)) switch (e.key) {
163
+ S.value = e.target.value, v("search", S.value), x.value || Z(), G.resetHighlight(), B.value && E?.searchDebounced(S.value);
164
+ }
165
+ function Fe(e) {
166
+ if (!(h.disabled || h.readonly)) switch (e.key) {
166
167
  case "ArrowDown":
167
168
  e.preventDefault(), x.value ? G.moveHighlight(1) : Z();
168
169
  break;
@@ -170,7 +171,7 @@ function m(m, h, g, _, v) {
170
171
  e.preventDefault(), x.value ? G.moveHighlight(-1) : Z();
171
172
  break;
172
173
  case "Enter":
173
- e.preventDefault(), x.value ? Me() : Z();
174
+ e.preventDefault(), x.value ? Ne() : Z();
174
175
  break;
175
176
  case "Escape":
176
177
  e.preventDefault(), Q();
@@ -182,10 +183,10 @@ function m(m, h, g, _, v) {
182
183
  x.value && (e.preventDefault(), G.highlightLast());
183
184
  break;
184
185
  case "Backspace":
185
- if (P.value && !S.value && z.value.length > 0) {
186
+ if (N.value && !S.value && R.value.length > 0) {
186
187
  e.preventDefault();
187
- let t = z.value.at(-1);
188
- t && je(t, e);
188
+ let t = R.value.at(-1);
189
+ t && Me(t, e);
189
190
  }
190
191
  break;
191
192
  case "Tab":
@@ -194,112 +195,133 @@ function m(m, h, g, _, v) {
194
195
  default: break;
195
196
  }
196
197
  }
197
- async function Fe(e) {
198
- let t = A.value.asyncData;
198
+ async function Ie(e) {
199
+ let t = k.value.asyncData;
199
200
  if (t) {
200
- T.value = !0;
201
+ w.value = !0;
201
202
  try {
202
- let { options: n, resolvedSelected: r } = await me(t, e, R.value, (e) => d(e, F.value));
203
- r.length > 0 && (O.value = r), E.value = n;
203
+ let { options: n, resolvedSelected: r } = await pe(t, e, L.value, (e) => f(e, P.value));
204
+ r.length > 0 && (D.value = r), T.value = n;
204
205
  } finally {
205
- T.value = !1;
206
+ w.value = !1;
206
207
  }
207
208
  }
208
209
  }
209
- async function Ie() {
210
- let e = A.value.asyncData;
211
- !e?.resolve || R.value.length === 0 || (O.value = d(await e.resolve(R.value), F.value));
210
+ async function Le() {
211
+ let e = k.value.asyncData;
212
+ !e?.resolve || L.value.length === 0 || (D.value = f(await e.resolve(L.value), P.value));
212
213
  }
213
- let $ = i(() => {
214
- let e = c(u(ge, c(M.value, [
214
+ let $ = a(() => {
215
+ let e = l(d(he, l(j.value, [
215
216
  "Listbox",
216
217
  "customProps",
217
218
  "color"
218
219
  ])), K.merged.value.color ?? "primary");
219
- return K.invalidated.value ? u(_e, c(M.value, [
220
+ return K.invalidated.value ? d(ge, l(j.value, [
220
221
  "Listbox",
221
222
  "customProps",
222
223
  "invalidated"
223
224
  ])) : e;
224
- }), Le = i(() => $.value?.value), Re = i(() => {
225
- let e = !m.disabled && !m.readonly && !U.value, n = !m.disabled && !m.readonly && U.value && H.value, r = B.value && !P.value && !U.value;
225
+ }), Re = a(() => $.value?.value), ze = a(() => {
226
+ let e = !h.disabled && !h.readonly && !H.value, n = !h.disabled && !h.readonly && H.value && V.value, r = z.value && !N.value && !H.value;
226
227
  return t({
227
228
  role: "combobox",
228
229
  value: we.value,
229
230
  "aria-controls": b,
230
231
  "aria-expanded": x.value,
231
232
  readonly: Ce.value,
232
- onKeydown: Pe,
233
- placeholder: A.value.placeholder,
234
- "aria-autocomplete": H.value ? "list" : void 0,
233
+ onKeydown: Fe,
234
+ placeholder: k.value.placeholder,
235
+ "aria-autocomplete": V.value ? "list" : void 0,
235
236
  "aria-activedescendant": x.value ? G.activeDescendantId.value : void 0,
236
- ...P.value ? {
237
+ ...N.value ? {
237
238
  rows: 1,
238
239
  onInput: (e) => {
239
- Ne(e), q(e.target);
240
+ Pe(e), q(e.target);
240
241
  }
241
- } : { onInput: Ne }
242
- }, K.inputBind.value, l({
242
+ } : { onInput: Pe }
243
+ }, K.inputBind.value, u({
243
244
  "cursor-text": n,
244
245
  "cursor-pointer": e,
245
- "resize-none overflow-hidden": P.value,
246
- [l(Le.value, N.value.value) ?? ""]: r
246
+ "resize-none overflow-hidden": N.value,
247
+ [u(Re.value, M.value.value) ?? ""]: r
247
248
  }));
248
249
  });
249
- s(() => [
250
+ c(() => [
250
251
  x.value,
251
- P.value,
252
- g.value
252
+ N.value,
253
+ _.value
253
254
  ], () => {
254
- q(g.value);
255
- }, { immediate: !0 }), s(() => h.value, () => {
256
- Ie();
257
- }, { immediate: !0 }), s(() => A.value.asyncData, (e) => {
258
- if (D?.cancel(), E.value = [], Ie(), !e) {
259
- D = null;
255
+ q(_.value);
256
+ }, { immediate: !0 }), c(() => g.value, () => {
257
+ Le();
258
+ }, { immediate: !0 }), c(() => k.value.asyncData, (e) => {
259
+ if (E?.cancel(), T.value = [], Le(), !e) {
260
+ E = null;
260
261
  return;
261
262
  }
262
- D = fe((e) => void Fe(e), pe(e));
263
- }, { immediate: !0 }), ie(() => {
264
- D?.cancel();
265
- }), ae(() => {
266
- q(g.value);
263
+ E = de((e) => void Ie(e), fe(e));
264
+ }, { immediate: !0 }), re(() => {
265
+ E?.cancel();
266
+ }), ie(() => {
267
+ q(_.value);
267
268
  });
268
- let ze = i(() => n(K.merged.value.size));
269
+ let Be = a(() => n(K.merged.value.size));
269
270
  return {
270
271
  open: x,
271
- slots: y,
272
- hasValue: B,
273
- multiple: P,
272
+ slots: ye,
273
+ hasValue: z,
274
+ multiple: N,
274
275
  listboxId: b,
275
276
  formField: K,
276
- isLoading: Se,
277
- clearable: xe,
278
- clearBind: i(() => t({}, {}, {
277
+ isLoading: U,
278
+ clearable: Se,
279
+ clearBind: a(() => t({}, {}, {
279
280
  tabindex: 0,
280
281
  role: "button",
281
282
  "data-select-clear": !0,
282
283
  onMousedown: Ee,
283
- class: l({
284
+ class: u({
284
285
  "inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors duration-150": !0,
285
286
  [$.value?.clear ?? ""]: !0,
286
- [N.value.clear ?? ""]: !0
287
+ [M.value.clear ?? ""]: !0
287
288
  })
288
289
  })),
289
290
  isSelected: J,
290
- clearValue: Ae,
291
- removeChip: je,
292
- triggerBind: Re,
293
- selectOption: ke,
294
- containerRef: w,
295
- clearIconSize: ze,
291
+ clearValue: je,
292
+ removeChip: Me,
293
+ triggerBind: ze,
294
+ selectOption: Ae,
295
+ containerRef: be,
296
+ listboxProps: a(() => ({
297
+ disableAutoFocus: !0,
298
+ maxHeight: h.maxHeight,
299
+ size: K.merged.value.size,
300
+ color: K.merged.value.color,
301
+ disableMaxHeight: h.disableMaxHeight === !0,
302
+ emptyMessage: k.value.emptyMessage ?? "No options",
303
+ hideEmptyMessage: k.value.hideEmptyMessage === !0,
304
+ loadingMessage: k.value.loadingMessage ?? "Loading...",
305
+ ...ke.value,
306
+ listboxId: b,
307
+ isSelected: J,
308
+ loading: U.value,
309
+ multiple: N.value,
310
+ options: W.value,
311
+ labelledBy: K.controlId.value,
312
+ highlightedIndex: C.value,
313
+ invalidated: K.invalidated.value
314
+ })),
315
+ clearIconSize: Be,
316
+ mergedClasses: M,
296
317
  visibleOptions: W,
297
- isSearchActive: U,
298
- selectedOptions: z,
318
+ isSearchActive: H,
319
+ selectedOptions: R,
299
320
  highlightedIndex: C,
300
- emptyMessage: i(() => A.value.emptyMessage ?? "No options"),
301
- hideEmptyMessage: i(() => A.value.hideEmptyMessage === !0)
321
+ emptyMessage: a(() => k.value.emptyMessage ?? "No options"),
322
+ hideEmptyMessage: a(() => k.value.hideEmptyMessage === !0),
323
+ loadingMessage: a(() => k.value.loadingMessage ?? "Loading...")
302
324
  };
303
325
  }
304
326
  //#endregion
305
- export { m as useSelect };
327
+ export { h as useSelect };
@@ -1,6 +1,7 @@
1
1
  import { InputHTMLAttributes, Slot, TextareaHTMLAttributes } from 'vue';
2
2
  import { MergeHtmlProps, SelectAsyncData, SelectModel, SelectOption, SelectOptionInput, SelectValue } from '@bridge-ui/core';
3
3
  import { FormFieldClasses, FormFieldCustomProps, FormFieldOwnProps, FormFieldSlots } from '../FormField/formField.types';
4
+ import { ListboxOwnProps } from '../Listbox/listbox.types';
4
5
  export type { SelectAsyncData, SelectModel, SelectOption, SelectOptionInput, SelectOptionLike, SelectValue, } from '@bridge-ui/core';
5
6
  export interface SelectClasses extends FormFieldClasses {
6
7
  /**
@@ -24,7 +25,15 @@ export interface SelectClasses extends FormFieldClasses {
24
25
  */
25
26
  value?: string;
26
27
  }
27
- export interface SelectCustomProps extends FormFieldCustomProps {}
28
+ export interface SelectCustomProps extends FormFieldCustomProps {
29
+ /**
30
+ * Props forwarded to the internal `Listbox`.
31
+ * Open state, options, and selection handlers stay owned by `Select`.
32
+ *
33
+ * @default undefined
34
+ */
35
+ listbox?: Partial<Omit<ListboxOwnProps, "options" | "anchorEl" | "listboxId" | "isSelected" | "highlightedIndex">>;
36
+ }
28
37
  export interface SelectEmits {
29
38
  /**
30
39
  * Emitted when the selection changes.
@@ -88,6 +97,12 @@ export interface SelectOwnProps extends Omit<FormFieldOwnProps, "field"> {
88
97
  * @default true
89
98
  */
90
99
  clearable?: boolean;
100
+ /**
101
+ * Extra props for FormField parts and the internal `Listbox`.
102
+ *
103
+ * @default undefined
104
+ */
105
+ customProps?: SelectCustomProps;
91
106
  /**
92
107
  * Initial value when uncontrolled.
93
108
  */
@@ -121,6 +136,12 @@ export interface SelectOwnProps extends Omit<FormFieldOwnProps, "field"> {
121
136
  * External or async loading state.
122
137
  */
123
138
  loading?: boolean;
139
+ /**
140
+ * Message shown in the dropdown while loading.
141
+ *
142
+ * @default "Loading..."
143
+ */
144
+ loadingMessage?: string;
124
145
  /**
125
146
  * Tailwind max-height class for the dropdown options area.
126
147
  * Forwarded to the internal `Listbox`.
@@ -17,10 +17,10 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
17
17
  "onLeave-complete"?: (() => any) | undefined;
18
18
  }>, {
19
19
  teleportTo: false | string;
20
+ progressbar: boolean;
20
21
  closeButton: boolean;
21
22
  duration: false | number;
22
23
  position: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').SnackbarPosition, import('./snackbar.types').SnackbarPositionOverrides>;
23
- progressbar: boolean;
24
24
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
25
25
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
26
26
  declare const _default: typeof __VLS_export;
@@ -2,7 +2,7 @@ import e from "../Icon/Icon.js";
2
2
  import { useSnackbar as t } from "./composables/useSnackbar.js";
3
3
  import { Teleport as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, mergeModels as f, mergeProps as p, normalizeClass as m, normalizeProps as h, openBlock as g, renderSlot as _, toDisplayString as v, unref as y, useModel as b, useSlots as x } from "vue";
4
4
  import { cn as S } from "@bridge-ui/core";
5
- import { X as C } from "lucide-vue-next";
5
+ import { X as C } from "@lucide/vue";
6
6
  //#region src/Components/Snackbar/Snackbar.vue?vue&type=script&setup=true&lang.ts
7
7
  var w = { class: "w-full max-w-sm pointer-events-auto" }, T = ["src"], E = { class: "flex ml-4 shrink-0" }, D = ["src"], O = { class: "flex ml-4 shrink-0" }, k = /* @__PURE__ */ u({
8
8
  inheritAttrs: !1,
@@ -1,4 +1,4 @@
1
- import { LucideIcon } from 'lucide-vue-next';
1
+ import { LucideIcon } from '@lucide/vue';
2
2
  import { Ref } from 'vue';
3
3
  import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
4
4
  import { SnackbarOwnProps, SnackbarProps } from '../snackbar.types';
@@ -1,4 +1,4 @@
1
- import { LucideIcon } from 'lucide-vue-next';
1
+ import { LucideIcon } from '@lucide/vue';
2
2
  import { HTMLAttributes, Slot } from 'vue';
3
3
  import { MergeHtmlProps, MergeProps, SnackbarColor, SnackbarPadding, SnackbarPosition, SnackbarRounded, SnackbarTransition } from '@bridge-ui/core';
4
4
  import { IconProps } from '../Icon';
@@ -1,4 +1,4 @@
1
- import { LucideIcon } from 'lucide-vue-next';
1
+ import { LucideIcon } from '@lucide/vue';
2
2
  import { SnackbarColor } from '@bridge-ui/core';
3
3
  /** Library fallbacks when neither the `icon` prop nor theme `icon` is set. */
4
4
  export declare const snackbarDefaultIcons: Record<keyof SnackbarColor, LucideIcon>;
@@ -1,4 +1,4 @@
1
- import { Bell as e, CircleAlert as t, CircleCheck as n, CircleX as r, Info as i, TriangleAlert as a } from "lucide-vue-next";
1
+ import { Bell as e, CircleAlert as t, CircleCheck as n, CircleX as r, Info as i, TriangleAlert as a } from "@lucide/vue";
2
2
  //#region src/Components/Snackbar/snackbarDefaultIcons.ts
3
3
  var o = {
4
4
  dark: i,
@@ -9,7 +9,7 @@ export declare function useTextField(props: TextFieldOwnProps): {
9
9
  size: NonNullable<keyof import('@bridge-ui/core').FormFieldSize | undefined>;
10
10
  rounded: NonNullable<keyof import('@bridge-ui/core').FormFieldRounded | undefined>;
11
11
  variant: NonNullable<keyof import('@bridge-ui/core').FormFieldVariant | undefined>;
12
- errorIcon: import('lucide-vue-next').LucideIcon;
12
+ errorIcon: import('@lucide/vue').LucideIcon;
13
13
  withErrorIcon: NonNullable<boolean | undefined>;
14
14
  }>;
15
15
  control: import('vue').ComputedRef<string>;
@@ -205,7 +205,7 @@ export declare function useTextField(props: TextFieldOwnProps): {
205
205
  }>>;
206
206
  controlId: import('vue').ComputedRef<string>;
207
207
  errorBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
208
- errorIcon: import('vue').ComputedRef<import('lucide-vue-next').LucideIcon>;
208
+ errorIcon: import('vue').ComputedRef<import('@lucide/vue').LucideIcon>;
209
209
  inputBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {
210
210
  id: string;
211
211
  disabled: boolean;
@@ -10,7 +10,7 @@ export declare function useTextarea(props: TextareaOwnProps, textareaRef: Ref<nu
10
10
  size: NonNullable<keyof import('@bridge-ui/core').FormFieldSize | undefined>;
11
11
  rounded: NonNullable<keyof import('@bridge-ui/core').FormFieldRounded | undefined>;
12
12
  variant: NonNullable<keyof import('@bridge-ui/core').FormFieldVariant | undefined>;
13
- errorIcon: import('lucide-vue-next').LucideIcon;
13
+ errorIcon: import('@lucide/vue').LucideIcon;
14
14
  withErrorIcon: NonNullable<boolean | undefined>;
15
15
  }>;
16
16
  control: import('vue').ComputedRef<string>;
@@ -206,7 +206,7 @@ export declare function useTextarea(props: TextareaOwnProps, textareaRef: Ref<nu
206
206
  }>>;
207
207
  controlId: import('vue').ComputedRef<string>;
208
208
  errorBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
209
- errorIcon: import('vue').ComputedRef<import('lucide-vue-next').LucideIcon>;
209
+ errorIcon: import('vue').ComputedRef<import('@lucide/vue').LucideIcon>;
210
210
  inputBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {
211
211
  id: string;
212
212
  disabled: boolean;
@@ -4,6 +4,7 @@ import { BadgeClasses, BadgeProps } from './Components/Badge';
4
4
  import { ButtonClasses, ButtonProps } from './Components/Button';
5
5
  import { CardClasses, CardProps } from './Components/Card';
6
6
  import { CheckboxClasses, CheckboxProps } from './Components/Checkbox';
7
+ import { ChipClasses, ChipProps } from './Components/Chip';
7
8
  import { FormControlClasses, FormControlProps } from './Components/FormControl';
8
9
  import { FormFieldClasses, FormFieldProps } from './Components/FormField';
9
10
  import { IconProps } from './Components/Icon';
@@ -46,6 +47,10 @@ declare module "@bridge-ui/core" {
46
47
  classes: CheckboxClasses;
47
48
  defaultProps: Partial<Pick<CheckboxProps, "size" | "color" | "rounded">>;
48
49
  }
50
+ interface ChipConfigOverrides {
51
+ classes: ChipClasses;
52
+ defaultProps: Partial<Pick<ChipProps, "size">>;
53
+ }
49
54
  interface FormControlConfigOverrides {
50
55
  classes: FormControlClasses;
51
56
  defaultProps: Partial<Pick<FormControlProps, "size" | "error" | "withoutErrorMessage">>;
package/dist/index.d.ts CHANGED
@@ -10,6 +10,8 @@ export { Card, useCard } from './Components/Card';
10
10
  export type { CardClasses, CardCustomProps, CardOwnProps, CardPaddingOverrides, CardProps, CardRoundedOverrides, CardShadowOverrides, CardSlots, CardVariantOverrides, } from './Components/Card';
11
11
  export { Checkbox, useCheckbox } from './Components/Checkbox';
12
12
  export type { CheckboxClasses, CheckboxColorOverrides, CheckboxCustomProps, CheckboxOwnProps, CheckboxProps, CheckboxRoundedOverrides, CheckboxSizeOverrides, CheckboxSlots, } from './Components/Checkbox';
13
+ export { Chip, useChip } from './Components/Chip';
14
+ export type { ChipClasses, ChipCustomProps, ChipEmits, ChipOwnProps, ChipProps, ChipSizeOverrides, ChipSlots, } from './Components/Chip';
13
15
  export { FormControl, useFormControl } from './Components/FormControl';
14
16
  export type { FormControlClasses, FormControlCustomProps, FormControlOwnProps, FormControlProps, FormControlSizeOverrides, FormControlSlots, UseFormControlReturn, } from './Components/FormControl';
15
17
  export { FormField, useFormField } from './Components/FormField';