@bridge-ui/vue 0.0.5 → 0.0.6

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 (77) hide show
  1. package/dist/Adapters/I18n/index.d.ts +1 -0
  2. package/dist/Adapters/I18n/index.js +2 -0
  3. package/dist/Adapters/I18n/useI18nAdapter.d.ts +12 -0
  4. package/dist/Adapters/I18n/useI18nAdapter.js +13 -0
  5. package/dist/Adapters/Icon/iconSource.types.d.ts +11 -0
  6. package/dist/Adapters/Icon/index.d.ts +2 -0
  7. package/dist/Adapters/Icon/index.js +2 -0
  8. package/dist/Adapters/Icon/useIconAdapter.d.ts +11 -0
  9. package/dist/Adapters/Icon/useIconAdapter.js +13 -0
  10. package/dist/Adapters/index.d.ts +3 -0
  11. package/dist/Adapters/index.js +3 -0
  12. package/dist/Components/Alert/Alert.vue_vue_type_script_setup_true_lang.js +1 -5
  13. package/dist/Components/Alert/alert.types.d.ts +2 -2
  14. package/dist/Components/Alert/alertDefaultIcons.d.ts +2 -2
  15. package/dist/Components/Alert/alertDefaultIcons.js +9 -10
  16. package/dist/Components/Alert/composables/useAlert.d.ts +2 -2
  17. package/dist/Components/Avatar/Avatar.vue_vue_type_script_setup_true_lang.js +1 -1
  18. package/dist/Components/Avatar/avatar.types.d.ts +2 -2
  19. package/dist/Components/Avatar/composables/useAvatar.d.ts +1 -1
  20. package/dist/Components/Avatar/composables/useAvatar.js +43 -44
  21. package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +24 -25
  22. package/dist/Components/Button/button.types.d.ts +4 -4
  23. package/dist/Components/Button/composables/useButton.d.ts +1 -1
  24. package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +25 -25
  25. package/dist/Components/Checkbox/composables/useCheckbox.d.ts +3 -3
  26. package/dist/Components/Chip/Chip.vue_vue_type_script_setup_true_lang.js +8 -9
  27. package/dist/Components/FormControl/composables/useFormControl.d.ts +1 -1
  28. package/dist/Components/FormField/composables/useFormField.d.ts +4 -4
  29. package/dist/Components/FormField/composables/useFormField.js +98 -99
  30. package/dist/Components/FormField/formField.types.d.ts +5 -5
  31. package/dist/Components/Icon/Icon.vue_vue_type_script_setup_true_lang.js +7 -7
  32. package/dist/Components/Icon/composables/useIcon.d.ts +2 -0
  33. package/dist/Components/Icon/composables/useIcon.js +20 -18
  34. package/dist/Components/Icon/icon.types.d.ts +3 -3
  35. package/dist/Components/Label/composables/useLabel.d.ts +1 -1
  36. package/dist/Components/Link/Link.vue_vue_type_script_setup_true_lang.js +2 -2
  37. package/dist/Components/Link/link.types.d.ts +3 -3
  38. package/dist/Components/ListItem/composables/useListItem.d.ts +2 -2
  39. package/dist/Components/ListItem/composables/useListItem.js +75 -76
  40. package/dist/Components/ListItem/listItem.types.d.ts +2 -2
  41. package/dist/Components/Listbox/Listbox.vue.d.ts +0 -2
  42. package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +73 -72
  43. package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +40 -40
  44. package/dist/Components/NumberField/composables/useNumberField.d.ts +6 -6
  45. package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +24 -24
  46. package/dist/Components/PasswordField/composables/usePasswordField.d.ts +6 -6
  47. package/dist/Components/Radio/composables/useRadio.d.ts +3 -3
  48. package/dist/Components/Select/Select.vue.d.ts +0 -1
  49. package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +62 -61
  50. package/dist/Components/Select/composables/useSelect.d.ts +8 -8
  51. package/dist/Components/Select/composables/useSelect.js +214 -214
  52. package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +81 -75
  53. package/dist/Components/Snackbar/composables/useSnackbar.d.ts +4 -4
  54. package/dist/Components/Snackbar/snackbar.types.d.ts +2 -2
  55. package/dist/Components/Snackbar/snackbarDefaultIcons.d.ts +3 -3
  56. package/dist/Components/Snackbar/snackbarDefaultIcons.js +9 -10
  57. package/dist/Components/Switch/composables/useSwitch.d.ts +3 -3
  58. package/dist/Components/Tab/Tab.vue_vue_type_script_setup_true_lang.js +2 -2
  59. package/dist/Components/Tab/tab.types.d.ts +3 -3
  60. package/dist/Components/TabItem/TabItem.vue_vue_type_script_setup_true_lang.js +2 -2
  61. package/dist/Components/TabItem/tabItem.types.d.ts +3 -3
  62. package/dist/Components/Tabs/composables/useTabs.d.ts +468 -4
  63. package/dist/Components/Tabs/tabsInjectionKey.d.ts +5 -5
  64. package/dist/Components/TextField/composables/useTextField.d.ts +6 -6
  65. package/dist/Components/Textarea/composables/useTextarea.d.ts +6 -6
  66. package/dist/Components/Tooltip/Tooltip.js +5 -0
  67. package/dist/Components/Tooltip/Tooltip.vue.d.ts +35 -0
  68. package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +73 -0
  69. package/dist/Components/Tooltip/composables/useTooltip.d.ts +50 -0
  70. package/dist/Components/Tooltip/composables/useTooltip.js +208 -0
  71. package/dist/Components/Tooltip/index.d.ts +4 -0
  72. package/dist/Components/Tooltip/index.js +3 -0
  73. package/dist/Components/Tooltip/tooltip.types.d.ts +166 -0
  74. package/dist/Provider/createBridgeUIApi.js +2 -1
  75. package/dist/index.d.ts +7 -1
  76. package/dist/index.js +80 -76
  77. package/package.json +20 -3
@@ -6,9 +6,8 @@ import { LISTBOX_INJECTION_KEY as c } from "../../Listbox/listboxInjectionKey.js
6
6
  import { computed as l, getCurrentInstance as u, inject as d, onBeforeUnmount as f, toValue as p, useAttrs as m, watch as h } from "vue";
7
7
  import { get as g, isNull as _, omit as v } from "es-toolkit/compat";
8
8
  import { cn as y, splitComponentProps as b } from "@bridge-ui/core";
9
- import { Check as x } from "@lucide/vue";
10
9
  //#region src/Components/ListItem/composables/useListItem.ts
11
- var S = [
10
+ var x = [
12
11
  "as",
13
12
  "role",
14
13
  "dense",
@@ -23,109 +22,109 @@ var S = [
23
22
  "interactive",
24
23
  "selectedIcon"
25
24
  ];
26
- function C(t, n, C) {
27
- let w = m(), T = d(o, null), E = d(c, null), D = E != null, O = l(() => b({
25
+ function S(t, n, S) {
26
+ let C = m(), w = d(o, null), T = d(c, null), E = T != null, D = l(() => b({
28
27
  props: {
29
- ...w,
28
+ ...C,
30
29
  ...t
31
30
  },
32
- bridgeKeys: S
33
- })), { merged: k, entry: A } = i({
31
+ bridgeKeys: x
32
+ })), { merged: O, entry: k } = i({
34
33
  libDefaults: n,
35
34
  componentName: "ListItem",
36
- props: () => O.value.componentProps
37
- }), j = l(() => E ? p(E) : null), M = l(() => k.value.value == null || !D ? null : {
38
- value: k.value.value,
39
- description: k.value.secondary,
40
- disabled: !!k.value.disabled,
41
- label: k.value.primary ?? String(k.value.value)
42
- }), N;
35
+ props: () => D.value.componentProps
36
+ }), A = l(() => T ? p(T) : null), j = l(() => O.value.value == null || !E ? null : {
37
+ value: O.value.value,
38
+ description: O.value.secondary,
39
+ disabled: !!O.value.disabled,
40
+ label: O.value.primary ?? String(O.value.value)
41
+ }), M;
43
42
  h(() => {
44
- let e = M.value;
43
+ let e = j.value;
45
44
  return e ? `${String(e.value)}:${e.label}:${e.disabled}:${e.description ?? ""}` : null;
46
45
  }, () => {
47
- N?.(), N = void 0;
48
- let e = M.value;
49
- !e || !E || (N = p(E).registerOption(e));
46
+ M?.(), M = void 0;
47
+ let e = j.value;
48
+ !e || !T || (M = p(T).registerOption(e));
50
49
  }, { immediate: !0 }), f(() => {
51
- N?.();
50
+ M?.();
52
51
  });
53
- let P = l(() => M.value != null), F = l(() => !M.value || !j.value ? !1 : j.value.isSelected(M.value.value)), I = l(() => !M.value || !j.value ? -1 : j.value.getOptionIndex(M.value.value)), L = l(() => !j.value || I.value < 0 ? !1 : j.value.highlightedIndex === I.value), R = l(() => k.value.customProps), z = a({
54
- entry: A,
55
- props: () => O.value.componentProps
56
- }), B = l(() => "dense" in (u()?.vnode.props ?? {}) ? t.dense === !0 : t.dense === !0 ? !0 : T ? p(T).dense : !1), V = l(() => e(C, "primary") || e(C, "default") || !!k.value.primary), H = l(() => e(C, "secondary") || !!k.value.secondary), U = l(() => e(C, "start")), W = l(() => P.value ? !F.value || !j.value?.showCheckmark ? null : x : !k.value.selected || _(k.value.selectedIcon) ? null : k.value.selectedIcon ?? x), G = l(() => e(C, "end") || W.value != null), K = l(() => v(O.value.inheritedAttrs, [])), q = l(() => r(R.value?.root, K.value, {
52
+ let N = l(() => j.value != null), P = l(() => !j.value || !A.value ? !1 : A.value.isSelected(j.value.value)), F = l(() => !j.value || !A.value ? -1 : A.value.getOptionIndex(j.value.value)), I = l(() => !A.value || F.value < 0 ? !1 : A.value.highlightedIndex === F.value), L = l(() => O.value.customProps), R = a({
53
+ entry: k,
54
+ props: () => D.value.componentProps
55
+ }), z = l(() => "dense" in (u()?.vnode.props ?? {}) ? t.dense === !0 : t.dense === !0 ? !0 : w ? p(w).dense : !1), B = l(() => e(S, "primary") || e(S, "default") || !!O.value.primary), V = l(() => e(S, "secondary") || !!O.value.secondary), H = l(() => e(S, "start")), U = l(() => N.value ? !P.value || !A.value?.showCheckmark ? null : "check" : !O.value.selected || _(O.value.selectedIcon) ? null : O.value.selectedIcon ?? "check"), W = l(() => e(S, "end") || U.value != null), G = l(() => v(D.value.inheritedAttrs, [])), K = l(() => r(L.value?.root, G.value, {
57
56
  class: y({
58
57
  "list-none": !0,
59
- "border-b border-black/10 last:border-b-0 dark:border-white/10": k.value.divider,
60
- [g(z.value, "root") ?? ""]: !0
58
+ "border-b border-black/10 last:border-b-0 dark:border-white/10": O.value.divider,
59
+ [g(R.value, "root") ?? ""]: !0
61
60
  }),
62
- id: P.value && j.value?.listboxId && I.value >= 0 ? s(j.value.listboxId, I.value) : void 0
63
- })), J = l(() => k.value.interactive || P.value ? r(R.value?.interactive, {}, {
64
- "aria-disabled": k.value.disabled ? !0 : void 0,
65
- role: P.value ? "option" : k.value.role,
66
- tabindex: k.value.disabled || P.value ? -1 : 0,
67
- "data-selected": k.value.selected || F.value ? !0 : void 0,
68
- "aria-selected": P.value ? F.value : void 0,
69
- onMousedown: P.value ? (e) => {
61
+ id: N.value && A.value?.listboxId && F.value >= 0 ? s(A.value.listboxId, F.value) : void 0
62
+ })), q = l(() => O.value.interactive || N.value ? r(L.value?.interactive, {}, {
63
+ "aria-disabled": O.value.disabled ? !0 : void 0,
64
+ role: N.value ? "option" : O.value.role,
65
+ tabindex: O.value.disabled || N.value ? -1 : 0,
66
+ "data-selected": O.value.selected || P.value ? !0 : void 0,
67
+ "aria-selected": N.value ? P.value : void 0,
68
+ onMousedown: N.value ? (e) => {
70
69
  e.preventDefault();
71
70
  } : void 0,
72
- onClick: P.value ? () => {
73
- M.value && j.value?.onSelect(M.value);
71
+ onClick: N.value ? () => {
72
+ j.value && A.value?.onSelect(j.value);
74
73
  } : void 0,
75
74
  class: y({
76
75
  "flex w-full min-w-0 items-center gap-x-3 text-left text-dark-900 outline-hidden transition-colors dark:text-dark-100": !0,
77
- "cursor-pointer select-none": !k.value.disabled,
76
+ "cursor-pointer select-none": !O.value.disabled,
78
77
  "px-4": !0,
79
- "py-2": !B.value,
80
- "py-1.5": B.value,
81
- "hover:bg-black/5 focus-visible:bg-black/5 dark:hover:bg-white/10 dark:focus-visible:bg-white/10": !k.value.disabled && !P.value,
82
- "bg-dark-100 font-medium text-dark-900 dark:bg-white/15 dark:text-white": k.value.selected && !P.value,
83
- [j.value?.optionSelectedClass ?? ""]: P.value && F.value,
84
- [j.value?.mergedClasses.optionSelected ?? ""]: P.value && F.value,
85
- [j.value?.optionHighlightedClass ?? ""]: P.value && L.value && !F.value,
86
- [j.value?.mergedClasses.optionHighlighted ?? ""]: P.value && L.value && !F.value,
87
- "opacity-50 pointer-events-none": k.value.disabled,
88
- [g(z.value, "interactive") ?? ""]: !0,
89
- [j.value?.sizeClasses?.option ?? ""]: !0
78
+ "py-2": !z.value,
79
+ "py-1.5": z.value,
80
+ "hover:bg-black/5 focus-visible:bg-black/5 dark:hover:bg-white/10 dark:focus-visible:bg-white/10": !O.value.disabled && !N.value,
81
+ "bg-dark-100 font-medium text-dark-900 dark:bg-white/15 dark:text-white": O.value.selected && !N.value,
82
+ [A.value?.optionSelectedClass ?? ""]: N.value && P.value,
83
+ [A.value?.mergedClasses.optionSelected ?? ""]: N.value && P.value,
84
+ [A.value?.optionHighlightedClass ?? ""]: N.value && I.value && !P.value,
85
+ [A.value?.mergedClasses.optionHighlighted ?? ""]: N.value && I.value && !P.value,
86
+ "opacity-50 pointer-events-none": O.value.disabled,
87
+ [g(R.value, "interactive") ?? ""]: !0,
88
+ [A.value?.sizeClasses?.option ?? ""]: !0
90
89
  })
91
- }) : null), Y = l(() => y({
90
+ }) : null), J = l(() => y({
92
91
  "flex w-full min-w-0 gap-x-3": !0,
93
- "items-center text-dark-900 dark:text-dark-100": !k.value.interactive,
94
- "px-4": !k.value.interactive,
95
- "py-2": !k.value.interactive && !B.value,
96
- "py-1.5": !k.value.interactive && B.value
97
- })), X = l(() => r(R.value?.start, {}, y({
92
+ "items-center text-dark-900 dark:text-dark-100": !O.value.interactive,
93
+ "px-4": !O.value.interactive,
94
+ "py-2": !O.value.interactive && !z.value,
95
+ "py-1.5": !O.value.interactive && z.value
96
+ })), Y = l(() => r(L.value?.start, {}, y({
98
97
  "flex shrink-0 text-dark-600 dark:text-dark-300": !0,
99
- [g(z.value, "start") ?? ""]: !0
100
- }))), Z = l(() => r(R.value?.content, {}, y({
98
+ [g(R.value, "start") ?? ""]: !0
99
+ }))), X = l(() => r(L.value?.content, {}, y({
101
100
  "min-w-0 flex-1": !0,
102
- [g(z.value, "content") ?? ""]: !0
103
- }))), Q = l(() => r(R.value?.primary, {}, y("block truncate text-sm font-medium", j.value?.sizeClasses?.primary, g(z.value, "primary")))), $ = l(() => r(R.value?.secondary, {}, y("mt-0.5 block truncate text-xs text-dark-500 dark:text-dark-400", j.value?.sizeClasses?.secondary, g(z.value, "secondary"))));
101
+ [g(R.value, "content") ?? ""]: !0
102
+ }))), Z = l(() => r(L.value?.primary, {}, y("block truncate text-sm font-medium", A.value?.sizeClasses?.primary, g(R.value, "primary")))), Q = l(() => r(L.value?.secondary, {}, y("mt-0.5 block truncate text-xs text-dark-500 dark:text-dark-400", A.value?.sizeClasses?.secondary, g(R.value, "secondary"))));
104
103
  return {
105
- merged: k,
106
- hasEnd: G,
107
- endBind: l(() => r(R.value?.end, {}, y({
104
+ merged: O,
105
+ hasEnd: W,
106
+ endBind: l(() => r(L.value?.end, {}, y({
108
107
  "ml-auto flex shrink-0 items-center": !0,
109
- [g(z.value, "end") ?? ""]: !0
108
+ [g(R.value, "end") ?? ""]: !0
110
109
  }))),
111
- rootBind: q,
112
- rowClass: Y,
113
- hasStart: U,
114
- startBind: X,
115
- hasPrimary: V,
116
- contentBind: Z,
117
- primaryBind: Q,
118
- hasSecondary: H,
119
- secondaryBind: $,
120
- interactiveBind: J,
121
- selectedIconBind: l(() => r(R.value?.selectedIcon, {}, {
110
+ rootBind: K,
111
+ rowClass: J,
112
+ hasStart: H,
113
+ startBind: Y,
114
+ hasPrimary: B,
115
+ contentBind: X,
116
+ primaryBind: Z,
117
+ hasSecondary: V,
118
+ secondaryBind: Q,
119
+ interactiveBind: q,
120
+ selectedIconBind: l(() => r(L.value?.selectedIcon, {}, {
122
121
  size: "sm",
123
- class: y("shrink-0", j.value?.checkClass, g(z.value, "selectedIcon"))
122
+ class: y("shrink-0", A.value?.checkClass, g(R.value, "selectedIcon"))
124
123
  })),
125
- resolvedSelectedIcon: W
124
+ resolvedSelectedIcon: U
126
125
  };
127
126
  }
128
- function w(r, i) {
127
+ function C(r, i) {
129
128
  if (e(r, "primary")) return n(r, "primary");
130
129
  if (e(r, "default")) return n(r, "default");
131
130
  if (!t(i)) return () => null;
@@ -133,4 +132,4 @@ function w(r, i) {
133
132
  return () => a;
134
133
  }
135
134
  //#endregion
136
- export { w as resolveListItemPrimary, C as useListItem };
135
+ export { C as resolveListItemPrimary, S as useListItem };
@@ -1,6 +1,6 @@
1
- import { LucideIcon } from '@lucide/vue';
2
1
  import { HTMLAttributes, Slot, VNode } from 'vue';
3
2
  import { ListboxValue, MergeHtmlProps } from '@bridge-ui/core';
3
+ import { IconSource } from '../../Adapters/Icon';
4
4
  import { IconProps } from '../Icon';
5
5
  export interface ListItemClasses {
6
6
  /**
@@ -146,7 +146,7 @@ export interface ListItemOwnProps {
146
146
  *
147
147
  * @default Check
148
148
  */
149
- selectedIcon?: null | LucideIcon;
149
+ selectedIcon?: null | IconSource;
150
150
  /**
151
151
  * When set inside a `Listbox`, registers this row as a selectable option.
152
152
  *
@@ -23,10 +23,8 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
23
23
  multiple: boolean;
24
24
  disableAutoFocus: boolean;
25
25
  placement: import('@floating-ui/utils').Placement;
26
- emptyMessage: string;
27
26
  hideEmptyMessage: boolean;
28
27
  highlightedIndex: number;
29
- loadingMessage: string;
30
28
  showCheckmark: boolean;
31
29
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
32
30
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,19 +1,20 @@
1
- import { hasNamedSlot as e, resolveNamedSlot as t } from "../../Utils/slotOrProp.js";
2
- import { mergeNestedComponentProps as n } from "../../Utils/index.js";
3
- import r from "../List/List.js";
4
- import { useListbox as i } from "./composables/useListbox.js";
5
- import { LISTBOX_INJECTION_KEY as ee } from "./listboxInjectionKey.js";
6
- import te from "../ListItem/ListItem.js";
7
- import ne from "../ListSection/ListSection.js";
8
- import a from "../Menu/Menu.js";
9
- import o from "../Progress/Progress.js";
10
- import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as p, createVNode as m, defineComponent as h, guardReactiveProps as g, mergeModels as _, mergeProps as v, normalizeProps as y, openBlock as b, provide as x, ref as S, renderList as C, renderSlot as w, resolveDynamicComponent as T, toDisplayString as E, unref as D, useModel as re, useSlots as ie, watch as O, withCtx as k } from "vue";
1
+ import { useI18nAdapter as e } from "../../Adapters/I18n/useI18nAdapter.js";
2
+ import { hasNamedSlot as t, resolveNamedSlot as n } from "../../Utils/slotOrProp.js";
3
+ import { mergeNestedComponentProps as r } from "../../Utils/index.js";
4
+ import ee from "../List/List.js";
5
+ import { useListbox as te } from "./composables/useListbox.js";
6
+ import { LISTBOX_INJECTION_KEY as i } from "./listboxInjectionKey.js";
7
+ import a from "../ListItem/ListItem.js";
8
+ import o from "../ListSection/ListSection.js";
9
+ import s from "../Menu/Menu.js";
10
+ import ne from "../Progress/Progress.js";
11
+ import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as m, createVNode as h, defineComponent as g, guardReactiveProps as _, mergeModels as v, mergeProps as y, normalizeProps as b, openBlock as x, provide as S, ref as C, renderList as w, renderSlot as T, resolveDynamicComponent as E, toDisplayString as D, unref as O, useModel as re, useSlots as ie, watch as k, withCtx as A } from "vue";
11
12
  import { isNil as ae } from "es-toolkit/compat";
12
- import { cn as A, entriesFromListboxOptions as j, flattenListboxOptions as M, mapListboxEntriesToRows as N } from "@bridge-ui/core";
13
+ import { cn as oe, entriesFromListboxOptions as se, flattenListboxOptions as j, mapListboxEntriesToRows as M, resolveMessage as N } from "@bridge-ui/core";
13
14
  //#region src/Components/Listbox/Listbox.vue?vue&type=script&setup=true&lang.ts
14
- var P = { key: 1 }, F = /* @__PURE__ */ h({
15
+ var P = { key: 1 }, F = /* @__PURE__ */ g({
15
16
  __name: "Listbox",
16
- props: /* @__PURE__ */ _({
17
+ props: /* @__PURE__ */ v({
17
18
  anchorEl: {},
18
19
  classes: {},
19
20
  color: { default: "primary" },
@@ -23,7 +24,7 @@ var P = { key: 1 }, F = /* @__PURE__ */ h({
23
24
  default: !1
24
25
  },
25
26
  disableMaxHeight: { type: Boolean },
26
- emptyMessage: { default: "No options" },
27
+ emptyMessage: {},
27
28
  entries: {},
28
29
  hideEmptyMessage: {
29
30
  type: Boolean,
@@ -38,7 +39,7 @@ var P = { key: 1 }, F = /* @__PURE__ */ h({
38
39
  type: Boolean,
39
40
  default: !1
40
41
  },
41
- loadingMessage: { default: "Loading..." },
42
+ loadingMessage: {},
42
43
  maxHeight: {},
43
44
  multiple: {
44
45
  type: Boolean,
@@ -59,99 +60,99 @@ var P = { key: 1 }, F = /* @__PURE__ */ h({
59
60
  },
60
61
  modelModifiers: {}
61
62
  }),
62
- emits: /* @__PURE__ */ _([
63
+ emits: /* @__PURE__ */ v([
63
64
  "registered-options-change",
64
65
  "select",
65
66
  "show-change"
66
67
  ], ["update:modelValue"]),
67
- setup(h, { emit: _ }) {
68
- let F = ie(), I = _, L = re(h, "modelValue");
69
- O(L, (e) => {
68
+ setup(g, { emit: v }) {
69
+ let F = ie(), I = v, L = re(g, "modelValue");
70
+ k(L, (e) => {
70
71
  I("show-change", e);
71
72
  });
72
- let R = h, { merged: z, checkClass: B, scrollBind: V, messageBind: H, sizeClasses: U, mergedClasses: W, optionSelectedClass: G, optionHighlightedClass: oe } = i(R, {
73
+ let R = g, z = e(), B = l(() => R.emptyMessage ?? N("No options", z.value)), V = l(() => R.loadingMessage ?? N("Loading...", z.value)), { merged: H, checkClass: U, scrollBind: W, messageBind: G, sizeClasses: K, mergedClasses: q, optionSelectedClass: ce, optionHighlightedClass: le } = te(R, {
73
74
  size: "md",
74
75
  color: "primary"
75
- }), K = c(() => R.options ?? []), q = c(() => R.entries ? R.entries : j(K.value)), J = c(() => M(q.value)), Y = c(() => e(F, "default")), X = c(() => !R.loading && !Y.value && J.value.length === 0 && R.hideEmptyMessage !== !0), se = c(() => A(B.value, W.value.check)), Z = S([]);
76
- function Q(e) {
76
+ }), ue = l(() => R.options ?? []), J = l(() => R.entries ? R.entries : se(ue.value)), Y = l(() => j(J.value)), X = l(() => t(F, "default")), Z = l(() => !R.loading && !X.value && Y.value.length === 0 && R.hideEmptyMessage !== !0), de = l(() => oe(U.value, q.value.check)), Q = C([]);
77
+ function $(e) {
77
78
  return R.isSelected?.(e) ?? !1;
78
79
  }
79
- function ce(e) {
80
+ function fe(e) {
80
81
  e.disabled || I("select", e);
81
82
  }
82
- function le(e) {
83
- return Z.value.some((t) => String(t.value) === String(e.value)) || (Z.value = [...Z.value, e]), () => {
84
- Z.value = Z.value.filter((t) => String(t.value) !== String(e.value));
83
+ function pe(e) {
84
+ return Q.value.some((t) => String(t.value) === String(e.value)) || (Q.value = [...Q.value, e]), () => {
85
+ Q.value = Q.value.filter((t) => String(t.value) !== String(e.value));
85
86
  };
86
87
  }
87
- function ue(e) {
88
- return (Y.value ? Z.value : J.value).findIndex((t) => String(t.value) === String(e));
88
+ function me(e) {
89
+ return (X.value ? Q.value : Y.value).findIndex((t) => String(t.value) === String(e));
89
90
  }
90
- O(Z, (e) => {
91
- Y.value && I("registered-options-change", e);
92
- }, { deep: !0 }), x(ee, c(() => ({
93
- getOptionIndex: ue,
94
- registerOption: le,
95
- onSelect: ce,
91
+ k(Q, (e) => {
92
+ X.value && I("registered-options-change", e);
93
+ }, { deep: !0 }), S(i, l(() => ({
94
+ getOptionIndex: me,
95
+ registerOption: pe,
96
+ onSelect: fe,
96
97
  listboxId: R.listboxId,
97
- isSelected: Q,
98
- sizeClasses: U.value,
98
+ isSelected: $,
99
+ sizeClasses: K.value,
99
100
  showCheckmark: R.showCheckmark,
100
- checkClass: se.value,
101
+ checkClass: de.value,
101
102
  highlightedIndex: R.highlightedIndex,
102
- optionSelectedClass: G.value,
103
- optionHighlightedClass: oe.value,
103
+ optionSelectedClass: ce.value,
104
+ optionHighlightedClass: le.value,
104
105
  mergedClasses: {
105
- optionSelected: W.value.optionSelected,
106
- optionHighlighted: W.value.optionHighlighted
106
+ optionSelected: q.value.optionSelected,
107
+ optionHighlighted: q.value.optionHighlighted
107
108
  }
108
109
  })));
109
- let de = c(() => N(q.value, Q)), fe = c(() => z.value.customProps?.menu), pe = c(() => z.value.customProps?.list), $ = c(() => z.value.customProps?.listItem), me = c(() => z.value.customProps?.progress), he = c(() => z.value.customProps?.listSection), ge = c(() => ({
110
+ let he = l(() => M(J.value, $)), ge = l(() => H.value.customProps?.menu), _e = l(() => H.value.customProps?.list), ve = l(() => H.value.customProps?.listItem), ye = l(() => H.value.customProps?.progress), be = l(() => H.value.customProps?.listSection), xe = l(() => ({
110
111
  ...ae(R.rounded) ? {} : { rounded: R.rounded },
111
- ...fe.value
112
- })), _e = c(() => ({
112
+ ...ge.value
113
+ })), Se = l(() => ({
113
114
  size: "xs",
114
115
  "aria-hidden": !0,
115
- color: z.value.color,
116
- ...n(me.value, {
116
+ color: H.value.color,
117
+ ...r(ye.value, {
117
118
  class: "shrink-0",
118
- classes: { bar: W.value.loading }
119
+ classes: { bar: q.value.loading }
119
120
  })
120
- })), ve = c(() => ({
121
+ })), Ce = l(() => ({
121
122
  dense: !0,
122
123
  role: "listbox",
123
124
  id: R.listboxId,
124
125
  "aria-labelledby": R.labelledBy,
125
126
  "aria-multiselectable": R.multiple || void 0,
126
- ...n(pe.value, { class: "p-0" })
127
+ ...r(_e.value, { class: "p-0" })
127
128
  }));
128
- return (n, i) => (b(), l(D(a), v({
129
+ return (e, r) => (x(), u(O(s), y({
129
130
  modelValue: L.value,
130
- "onUpdate:modelValue": i[0] ||= (e) => L.value = e,
131
- "anchor-el": h.anchorEl,
132
- placement: h.placement,
131
+ "onUpdate:modelValue": r[0] ||= (e) => L.value = e,
132
+ "anchor-el": g.anchorEl,
133
+ placement: g.placement,
133
134
  "close-on-click-away": !0,
134
- "disable-auto-focus": h.disableAutoFocus
135
- }, ge.value), {
136
- default: k(() => [
137
- D(e)(D(F), "beforeOptions") ? (b(), l(T(D(t)(D(F), "beforeOptions")), { key: 0 })) : u("", !0),
138
- h.loading ? (b(), d(s, { key: 1 }, [m(D(o), y(g(_e.value)), null, 16), f("div", y(g(D(H))), [D(e)(D(F), "loading") ? (b(), l(T(D(t)(D(F), "loading")), { key: 0 })) : (b(), d("span", P, E(h.loadingMessage), 1))], 16)], 64)) : (b(), d("div", y(v({ key: 2 }, D(V))), [m(D(r), y(g(ve.value)), {
139
- default: k(() => [Y.value ? w(n.$slots, "default", { key: 0 }) : (b(!0), d(s, { key: 1 }, C(de.value, (t) => (b(), d(s, { key: t.key }, [t.kind === "section" ? (b(), l(D(ne), v({
135
+ "disable-auto-focus": g.disableAutoFocus
136
+ }, xe.value), {
137
+ default: A(() => [
138
+ O(t)(O(F), "beforeOptions") ? (x(), u(E(O(n)(O(F), "beforeOptions")), { key: 0 })) : d("", !0),
139
+ g.loading ? (x(), f(c, { key: 1 }, [h(O(ne), b(_(Se.value)), null, 16), p("div", b(_(O(G))), [O(t)(O(F), "loading") ? (x(), u(E(O(n)(O(F), "loading")), { key: 0 })) : (x(), f("span", P, D(V.value), 1))], 16)], 64)) : (x(), f("div", b(y({ key: 2 }, O(W))), [h(O(ee), b(_(Ce.value)), {
140
+ default: A(() => [X.value ? T(e.$slots, "default", { key: 0 }) : (x(!0), f(c, { key: 1 }, w(he.value, (n) => (x(), f(c, { key: n.key }, [n.kind === "section" ? (x(), u(O(o), y({
140
141
  key: 0,
141
- title: t.title,
142
- sticky: t.sticky
143
- }, { ref_for: !0 }, he.value), null, 16, ["title", "sticky"])) : (b(), l(D(te), v({
142
+ title: n.title,
143
+ sticky: n.sticky
144
+ }, { ref_for: !0 }, be.value), null, 16, ["title", "sticky"])) : (x(), u(O(a), y({
144
145
  key: 1,
145
146
  interactive: "",
146
- value: t.option.value,
147
- disabled: t.option.disabled,
148
- secondary: t.option.description,
149
- primary: D(e)(D(F), "option") ? void 0 : t.option.label
150
- }, { ref_for: !0 }, $.value), p({ _: 2 }, [D(e)(D(F), "option") ? {
147
+ value: n.option.value,
148
+ disabled: n.option.disabled,
149
+ secondary: n.option.description,
150
+ primary: O(t)(O(F), "option") ? void 0 : n.option.label
151
+ }, { ref_for: !0 }, ve.value), m({ _: 2 }, [O(t)(O(F), "option") ? {
151
152
  name: "default",
152
- fn: k(() => [w(n.$slots, "option", {
153
- option: t.option,
154
- selected: t.selected
153
+ fn: A(() => [T(e.$slots, "option", {
154
+ option: n.option,
155
+ selected: n.selected
155
156
  })]),
156
157
  key: "0"
157
158
  } : void 0]), 1040, [
@@ -162,8 +163,8 @@ var P = { key: 1 }, F = /* @__PURE__ */ h({
162
163
  ]))], 64))), 128))]),
163
164
  _: 3
164
165
  }, 16)], 16)),
165
- X.value && !D(e)(D(F), "empty") ? (b(), d("div", y(v({ key: 3 }, D(H))), E(h.emptyMessage), 17)) : X.value && D(e)(D(F), "empty") ? (b(), l(T(D(t)(D(F), "empty")), { key: 4 })) : u("", !0),
166
- D(e)(D(F), "afterOptions") ? (b(), l(T(D(t)(D(F), "afterOptions")), { key: 5 })) : u("", !0)
166
+ Z.value && !O(t)(O(F), "empty") ? (x(), f("div", b(y({ key: 3 }, O(G))), D(B.value), 17)) : Z.value && O(t)(O(F), "empty") ? (x(), u(E(O(n)(O(F), "empty")), { key: 4 })) : d("", !0),
167
+ O(t)(O(F), "afterOptions") ? (x(), u(E(O(n)(O(F), "afterOptions")), { key: 5 })) : d("", !0)
167
168
  ]),
168
169
  _: 3
169
170
  }, 16, [
@@ -1,17 +1,17 @@
1
- import { useHoldRepeat as e } from "../../Utils/useHoldRepeat.js";
2
- import { mergePartBind as t, resolveFieldAdornmentIconSize as n } from "../../Utils/index.js";
3
- import r from "../Icon/Icon.js";
4
- import i from "../FormField/FormField.js";
5
- import { useNumberField as a } from "./composables/useNumberField.js";
6
- import { computed as o, createBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, isRef as f, mergeModels as p, mergeProps as m, normalizeProps as h, openBlock as g, ref as _, unref as v, useModel as y, vModelDynamic as b, withCtx as x, withDirectives as S } from "vue";
7
- import { isUndefined as C } from "es-toolkit/compat";
8
- import { cn as w } from "@bridge-ui/core";
9
- import { ChevronDown as T, ChevronUp as E } from "@lucide/vue";
1
+ import { useI18nAdapter as e } from "../../Adapters/I18n/useI18nAdapter.js";
2
+ import { useHoldRepeat as t } from "../../Utils/useHoldRepeat.js";
3
+ import { mergePartBind as n, resolveFieldAdornmentIconSize as r } from "../../Utils/index.js";
4
+ import i from "../Icon/Icon.js";
5
+ import a from "../FormField/FormField.js";
6
+ import { useNumberField as o } from "./composables/useNumberField.js";
7
+ import { computed as s, createBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, isRef as p, mergeModels as m, mergeProps as h, normalizeProps as g, openBlock as _, ref as v, unref as y, useModel as b, vModelDynamic as x, withCtx as S, withDirectives as C } from "vue";
8
+ import { isUndefined as w } from "es-toolkit/compat";
9
+ import { cn as T, resolveMessage as E } from "@bridge-ui/core";
10
10
  //#region src/Components/NumberField/NumberField.vue?vue&type=script&setup=true&lang.ts
11
- var D = { class: "bridge-end-adornment flex h-full min-w-9 flex-col gap-px overflow-hidden" }, O = /* @__PURE__ */ u({
11
+ var D = { class: "bridge-end-adornment flex h-full min-w-9 flex-col gap-px overflow-hidden" }, O = /* @__PURE__ */ d({
12
12
  inheritAttrs: !1,
13
13
  __name: "NumberField",
14
- props: /* @__PURE__ */ p({
14
+ props: /* @__PURE__ */ m({
15
15
  classes: {},
16
16
  customProps: {},
17
17
  defaultValue: {},
@@ -41,45 +41,45 @@ var D = { class: "bridge-end-adornment flex h-full min-w-9 flex-col gap-px overf
41
41
  modelValue: {},
42
42
  modelModifiers: {}
43
43
  }),
44
- emits: /* @__PURE__ */ p(["change", "update:modelValue"], ["update:modelValue"]),
45
- setup(u, { emit: p }) {
46
- let O = p, k = y(u, "modelValue"), A = u, j = _(A.defaultValue), { decrement: M, formField: N, increment: P, inputBind: F, stringModel: I, mergedClasses: L } = a(A, o({
44
+ emits: /* @__PURE__ */ m(["change", "update:modelValue"], ["update:modelValue"]),
45
+ setup(d, { emit: m }) {
46
+ let O = m, k = b(d, "modelValue"), A = d, j = v(A.defaultValue), M = s({
47
47
  set: (e) => {
48
48
  k.value = e, j.value = e;
49
49
  },
50
- get: () => C(k.value) ? j.value : k.value
51
- }), { onChange: (e) => O("change", e) }), R = e(() => P(), () => ({ disabled: A.disabled })), z = e(() => M(), () => ({ disabled: A.disabled })), B = o(() => n(A.size)), V = o(() => t(A.customProps?.increment, {
50
+ get: () => w(k.value) ? j.value : k.value
51
+ }), N = e(), { decrement: P, formField: F, increment: I, inputBind: L, stringModel: R, mergedClasses: z } = o(A, M, { onChange: (e) => O("change", e) }), B = t(() => I(), () => ({ disabled: A.disabled })), V = t(() => P(), () => ({ disabled: A.disabled })), H = s(() => r(A.size)), U = s(() => n(A.customProps?.increment, {
52
52
  type: "button",
53
53
  disabled: A.disabled,
54
- "aria-label": "Increment value",
55
- onClick: R.onPressClick,
56
- onPointerup: R.onPressPointerUp,
57
- onPointerdown: R.onPressPointerDown,
58
- onLostpointercapture: R.onPressLostPointerCapture
59
- }, w({
54
+ onClick: B.onPressClick,
55
+ onPointerup: B.onPressPointerUp,
56
+ onPointerdown: B.onPressPointerDown,
57
+ "aria-label": E("Increment value", N.value),
58
+ onLostpointercapture: B.onPressLostPointerCapture
59
+ }, T({
60
60
  "bridge-field-adornment-button inline-flex min-h-0 min-w-8 flex-1 items-center justify-center": !0,
61
- [L.value.increment ?? ""]: !0
62
- }))), H = o(() => t(A.customProps?.decrement, {
61
+ [z.value.increment ?? ""]: !0
62
+ }))), W = s(() => n(A.customProps?.decrement, {
63
63
  type: "button",
64
64
  disabled: A.disabled,
65
- "aria-label": "Decrement value",
66
- onClick: z.onPressClick,
67
- onPointerup: z.onPressPointerUp,
68
- onPointerdown: z.onPressPointerDown,
69
- onLostpointercapture: z.onPressLostPointerCapture
70
- }, w({
65
+ onClick: V.onPressClick,
66
+ onPointerup: V.onPressPointerUp,
67
+ onPointerdown: V.onPressPointerDown,
68
+ "aria-label": E("Decrement value", N.value),
69
+ onLostpointercapture: V.onPressLostPointerCapture
70
+ }, T({
71
71
  "bridge-field-adornment-button inline-flex min-h-0 min-w-8 flex-1 items-center justify-center": !0,
72
- [L.value.decrement ?? ""]: !0
72
+ [z.value.decrement ?? ""]: !0
73
73
  })));
74
- return (e, t) => (g(), s(v(i), { field: v(N) }, {
75
- end: x(() => [c("div", D, [c("button", h(d(V.value)), [l(v(r), m({
76
- icon: v(E),
77
- size: B.value
78
- }, A.customProps?.incrementIcon), null, 16, ["icon", "size"])], 16), c("button", h(d(H.value)), [l(v(r), m({
79
- icon: v(T),
80
- size: B.value
81
- }, A.customProps?.decrementIcon), null, 16, ["icon", "size"])], 16)])]),
82
- default: x(() => [S(c("input", m({ "onUpdate:modelValue": t[0] ||= (e) => f(I) ? I.value = e : null }, v(F)), null, 16), [[b, v(I)]])]),
74
+ return (e, t) => (_(), c(y(a), { field: y(F) }, {
75
+ end: S(() => [l("div", D, [l("button", g(f(U.value)), [u(y(i), h({
76
+ icon: "chevronUp",
77
+ size: H.value
78
+ }, A.customProps?.incrementIcon), null, 16, ["size"])], 16), l("button", g(f(W.value)), [u(y(i), h({
79
+ icon: "chevronDown",
80
+ size: H.value
81
+ }, A.customProps?.decrementIcon), null, 16, ["size"])], 16)])]),
82
+ default: S(() => [C(l("input", h({ "onUpdate:modelValue": t[0] ||= (e) => p(R) ? R.value = e : null }, y(L)), null, 16), [[x, y(R)]])]),
83
83
  _: 1
84
84
  }, 8, ["field"]));
85
85
  }
@@ -17,7 +17,7 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
17
17
  size: NonNullable<keyof import('@bridge-ui/core').FormFieldSize | undefined>;
18
18
  rounded: NonNullable<keyof import('@bridge-ui/core').FormFieldRounded | undefined>;
19
19
  variant: NonNullable<keyof import('@bridge-ui/core').FormFieldVariant | undefined>;
20
- errorIcon: import('@lucide/vue').LucideIcon;
20
+ errorIcon: NonNullable<import('../../..').IconSource | undefined>;
21
21
  withErrorIcon: NonNullable<boolean | undefined>;
22
22
  }>;
23
23
  control: import('vue').ComputedRef<string>;
@@ -173,13 +173,13 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
173
173
  'aria-valuenow'?: (string | number) | undefined;
174
174
  'aria-valuetext'?: string | undefined | undefined;
175
175
  accesskey?: string | undefined | undefined;
176
- contenteditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
176
+ contenteditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
177
177
  contextmenu?: string | undefined | undefined;
178
178
  dir?: string | undefined | undefined;
179
179
  draggable?: (boolean | "true" | "false") | undefined;
180
180
  enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
181
181
  enterKeyHint?: "done" | "enter" | "go" | "next" | "previous" | "search" | "send" | undefined;
182
- hidden?: "" | "until-found" | (boolean | "true" | "false") | "hidden" | undefined;
182
+ hidden?: "" | "until-found" | "hidden" | (boolean | "true" | "false") | undefined;
183
183
  inert?: (boolean | "true" | "false") | undefined;
184
184
  placeholder?: string | undefined | undefined;
185
185
  spellcheck?: (boolean | "true" | "false") | undefined;
@@ -213,7 +213,7 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
213
213
  }>>;
214
214
  controlId: import('vue').ComputedRef<string>;
215
215
  errorBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
216
- errorIcon: import('vue').ComputedRef<import('@lucide/vue').LucideIcon>;
216
+ errorIcon: import('vue').ComputedRef<NonNullable<import('../../..').IconSource | undefined>>;
217
217
  inputBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {
218
218
  id: string;
219
219
  disabled: boolean;
@@ -435,7 +435,7 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
435
435
  onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
436
436
  onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
437
437
  onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
438
- }, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "color" | "end" | "size" | "classes" | "customProps" | "error" | "rounded" | "variant" | "label" | "disabled" | "endIcon" | "startIcon" | "start" | "required" | "description" | "errorMessage" | "readonly" | "withoutErrorMessage" | "errorIcon" | "withErrorIcon" | "corner">>>>;
438
+ }, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "endIcon" | "startIcon" | "start" | "required" | "description" | "errorMessage" | "readonly" | "withoutErrorMessage" | "errorIcon" | "withErrorIcon" | "corner">>>>;
439
439
  isNotched: import('vue').ComputedRef<boolean>;
440
440
  isStacked: import('vue').ComputedRef<boolean>;
441
441
  startBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
@@ -684,7 +684,7 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
684
684
  onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
685
685
  onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
686
686
  onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
687
- }, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "color" | "end" | "size" | "classes" | "customProps" | "error" | "rounded" | "variant" | "label" | "disabled" | "endIcon" | "startIcon" | "start" | "required" | "description" | "errorMessage" | "readonly" | "withoutErrorMessage" | "errorIcon" | "withErrorIcon" | "corner">>>, {
687
+ }, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "endIcon" | "startIcon" | "start" | "required" | "description" | "errorMessage" | "readonly" | "withoutErrorMessage" | "errorIcon" | "withErrorIcon" | "corner">>>, {
688
688
  min: number | undefined;
689
689
  max: number | undefined;
690
690
  type: string;