@bridge-ui/vue 0.0.1-beta.5 → 0.0.1-beta.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 (53) hide show
  1. package/dist/Components/List/List.vue.d.ts +0 -1
  2. package/dist/Components/List/List.vue_vue_type_script_setup_true_lang.js +2 -3
  3. package/dist/Components/List/composables/useList.d.ts +3 -9
  4. package/dist/Components/List/composables/useList.js +21 -25
  5. package/dist/Components/List/index.d.ts +1 -1
  6. package/dist/Components/List/list.types.d.ts +1 -8
  7. package/dist/Components/ListItem/ListItem.vue.d.ts +0 -1
  8. package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +3 -6
  9. package/dist/Components/ListItem/composables/useListItem.d.ts +12 -18
  10. package/dist/Components/ListItem/composables/useListItem.js +97 -75
  11. package/dist/Components/ListItem/index.d.ts +1 -1
  12. package/dist/Components/ListItem/listItem.types.d.ts +7 -8
  13. package/dist/Components/ListSection/composables/useListSection.d.ts +1 -3
  14. package/dist/Components/ListSection/composables/useListSection.js +6 -5
  15. package/dist/Components/Listbox/Listbox.vue.d.ts +5 -2
  16. package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +107 -56
  17. package/dist/Components/Listbox/composables/useListbox.d.ts +0 -5
  18. package/dist/Components/Listbox/composables/useListbox.js +10 -19
  19. package/dist/Components/Listbox/index.d.ts +2 -1
  20. package/dist/Components/Listbox/index.js +3 -2
  21. package/dist/Components/Listbox/listbox.types.d.ts +23 -6
  22. package/dist/Components/Listbox/listboxInjectionKey.d.ts +23 -0
  23. package/dist/Components/Listbox/listboxInjectionKey.js +4 -0
  24. package/dist/Components/Menu/Menu.vue.d.ts +2 -2
  25. package/dist/Components/Menu/composables/useMenu.d.ts +1 -3
  26. package/dist/Components/Menu/composables/useMenu.js +3 -3
  27. package/dist/Components/Modal/composables/useModal.d.ts +1 -1
  28. package/dist/Components/Progress/Progress.js +5 -0
  29. package/dist/Components/Progress/Progress.vue.d.ts +4 -0
  30. package/dist/Components/Progress/Progress.vue_vue_type_script_setup_true_lang.js +32 -0
  31. package/dist/Components/Progress/composables/useProgress.d.ts +29 -0
  32. package/dist/Components/Progress/composables/useProgress.js +75 -0
  33. package/dist/Components/Progress/index.d.ts +3 -0
  34. package/dist/Components/Progress/index.js +3 -0
  35. package/dist/Components/Progress/progress.types.d.ts +94 -0
  36. package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +68 -57
  37. package/dist/Components/Select/SelectOption.vue_vue_type_script_setup_true_lang.js +2 -0
  38. package/dist/Components/Select/composables/useSelect.d.ts +5 -1
  39. package/dist/Components/Select/composables/useSelect.js +187 -154
  40. package/dist/Components/Select/select.types.d.ts +12 -5
  41. package/dist/Components/Spinner/Spinner.js +5 -0
  42. package/dist/Components/Spinner/Spinner.vue.d.ts +4 -0
  43. package/dist/Components/Spinner/Spinner.vue_vue_type_script_setup_true_lang.js +31 -0
  44. package/dist/Components/Spinner/composables/useSpinner.d.ts +58 -0
  45. package/dist/Components/Spinner/composables/useSpinner.js +97 -0
  46. package/dist/Components/Spinner/index.d.ts +3 -0
  47. package/dist/Components/Spinner/index.js +3 -0
  48. package/dist/Components/Spinner/spinner.types.d.ts +99 -0
  49. package/dist/augments.d.ts +12 -3
  50. package/dist/index.d.ts +6 -2
  51. package/dist/index.js +32 -28
  52. package/dist/theme.css +46 -3
  53. package/package.json +2 -2
@@ -1,6 +1,5 @@
1
1
  import { ListOwnProps } from './list.types';
2
2
  declare const __VLS_export: import('vue').DefineComponent<ListOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ListOwnProps> & Readonly<{}>, {
3
- padding: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListPadding, import('./list.types').ListPaddingOverrides>;
4
3
  as: "ol" | "ul" | "nav";
5
4
  dense: boolean;
6
5
  nested: boolean;
@@ -16,11 +16,10 @@ var f = /* @__PURE__ */ i({
16
16
  nested: {
17
17
  type: Boolean,
18
18
  default: !1
19
- },
20
- padding: { default: "normal" }
19
+ }
21
20
  },
22
21
  setup(i) {
23
- let f = u(), { merged: p, rootBind: m } = t(i, { padding: "normal" }), h = n(() => p.value.as ?? "ul");
22
+ let f = u(), { merged: p, rootBind: m } = t(i), h = n(() => p.value.as ?? "ul");
24
23
  return (t, n) => (s(), r(c(h.value), o(a(l(m))), {
25
24
  default: d(() => [(s(), r(c(l(e)(l(f), "default"))))]),
26
25
  _: 1
@@ -1,11 +1,5 @@
1
- import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
2
1
  import { ListOwnProps, ListProps } from '../list.types';
3
- type ListLibDefaults = LibDefaultsShape<ListOwnProps, "padding">;
4
- type ListMerged = MergeLibDefaults<ListOwnProps, ListLibDefaults>;
5
- export declare function useList(props: ListOwnProps, libDefaults: ListLibDefaults): {
6
- merged: import('vue').ComputedRef<ListMerged>;
7
- rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
8
- class: string;
9
- }, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListProps, "classes" | "customProps" | "padding" | "as" | "dense" | "nested">, never>>>;
2
+ export declare function useList(props: ListOwnProps): {
3
+ merged: import('vue').ComputedRef<ListOwnProps>;
4
+ rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListProps, "classes" | "customProps" | "as" | "dense" | "nested">, never>>>;
10
5
  };
11
- export {};
@@ -2,43 +2,39 @@ import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistr
2
2
  import { LIST_INJECTION_KEY as r } from "../listInjectionKey.js";
3
3
  import { computed as i, provide as a, useAttrs as o } from "vue";
4
4
  import { get as s, omit as c } from "es-toolkit/compat";
5
- import { cn as l, mergeBridgeUILayeredClasses as u, splitComponentProps as d } from "@bridge-ui/core";
6
- import { paddingProps as f } from "@bridge-ui/core/Components/List";
5
+ import { cn as l, splitComponentProps as u } from "@bridge-ui/core";
7
6
  //#region src/Components/List/composables/useList.ts
8
- var p = [
7
+ var d = [
9
8
  "as",
10
9
  "dense",
11
10
  "nested",
12
11
  "classes",
13
- "padding",
14
12
  "customProps"
15
13
  ];
16
- function m(m, h) {
17
- let g = o(), _ = i(() => d({
18
- bridgeKeys: p,
14
+ function f(f) {
15
+ let p = o(), m = i(() => u({
16
+ bridgeKeys: d,
19
17
  props: {
20
- ...g,
21
- ...m
18
+ ...p,
19
+ ...f
22
20
  }
23
- })), { merged: v, entry: y } = t({
24
- libDefaults: h,
21
+ })), { merged: h, entry: g } = t({
25
22
  componentName: "List",
26
- props: () => _.value.componentProps
27
- }), b = i(() => v.value.customProps), x = n({
28
- entry: y,
29
- props: () => _.value.componentProps
23
+ props: () => m.value.componentProps
24
+ }), _ = i(() => h.value.customProps), v = n({
25
+ entry: g,
26
+ props: () => m.value.componentProps
30
27
  });
31
- a(r, i(() => ({ dense: v.value.dense === !0 })));
32
- let S = i(() => s(u(f, y.value?.customProps?.padding), v.value.padding)), C = i(() => c(_.value.inheritedAttrs, []));
28
+ a(r, i(() => ({ dense: h.value.dense === !0 })));
29
+ let y = i(() => c(m.value.inheritedAttrs, []));
33
30
  return {
34
- merged: v,
35
- rootBind: i(() => e(b.value?.root, C.value, { class: l({
36
- "m-0 list-none": !0,
37
- [S.value ?? ""]: !0,
38
- "pl-4": v.value.nested,
39
- [s(x.value, "root") ?? ""]: !0
40
- }) }))
31
+ merged: h,
32
+ rootBind: i(() => e(_.value?.root, y.value, l({
33
+ "m-0 list-none py-2 text-dark-900 dark:text-dark-100": !0,
34
+ "pl-4": h.value.nested,
35
+ [s(v.value, "root") ?? ""]: !0
36
+ })))
41
37
  };
42
38
  }
43
39
  //#endregion
44
- export { m as useList };
40
+ export { f as useList };
@@ -1,5 +1,5 @@
1
1
  export { useList } from './composables/useList';
2
- export type { ListClasses, ListCustomProps, ListOwnProps, ListPaddingOverrides, ListProps, } from './list.types';
2
+ export type { ListClasses, ListCustomProps, ListOwnProps, ListProps, } from './list.types';
3
3
  export { default as List } from './List.vue';
4
4
  export { LIST_INJECTION_KEY } from './listInjectionKey';
5
5
  export type { ListContextValue } from './listInjectionKey';
@@ -1,6 +1,5 @@
1
1
  import { HTMLAttributes } from 'vue';
2
- import { ListPadding, MergeHtmlProps, MergeProps } from '@bridge-ui/core';
3
- export interface ListPaddingOverrides {}
2
+ import { MergeHtmlProps } from '@bridge-ui/core';
4
3
  export interface ListClasses {
5
4
  /**
6
5
  * The classes to apply to the root.
@@ -47,11 +46,5 @@ export interface ListOwnProps {
47
46
  * @default false
48
47
  */
49
48
  nested?: boolean;
50
- /**
51
- * Root padding preset. Use `"none"` inside menus/cards (MUI `disablePadding`).
52
- *
53
- * @default "normal"
54
- */
55
- padding?: MergeProps<ListPadding, ListPaddingOverrides>;
56
49
  }
57
50
  export type ListProps = MergeHtmlProps<ListOwnProps, HTMLAttributes>;
@@ -4,7 +4,6 @@ declare const __VLS_base: import('vue').DefineComponent<ListItemOwnProps, {}, {}
4
4
  role: "button" | "option" | "menuitem";
5
5
  as: "li" | "div";
6
6
  disabled: boolean;
7
- align: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListItemAlign, import('./listItem.types').ListItemAlignOverrides>;
8
7
  divider: boolean;
9
8
  interactive: boolean;
10
9
  selected: boolean;
@@ -7,7 +7,6 @@ var x = /* @__PURE__ */ d({
7
7
  inheritAttrs: !1,
8
8
  __name: "ListItem",
9
9
  props: {
10
- align: { default: "center" },
11
10
  as: { default: "li" },
12
11
  classes: {},
13
12
  customProps: {},
@@ -31,13 +30,11 @@ var x = /* @__PURE__ */ d({
31
30
  type: Boolean,
32
31
  default: !1
33
32
  },
34
- selectedIcon: {}
33
+ selectedIcon: {},
34
+ value: {}
35
35
  },
36
36
  setup(d) {
37
- let x = y(), S = d, { merged: C, hasEnd: w, endBind: T, rootBind: E, rowClass: D, hasStart: O, startBind: k, hasPrimary: A, contentBind: j, primaryBind: M, hasSecondary: N, secondaryBind: P, interactiveBind: F, selectedIconBind: I, resolvedSelectedIcon: L } = a(S, {
38
- role: "button",
39
- align: "center"
40
- }, x), R = o(() => C.value.as ?? "li"), z = o(() => i(x, S.primary)), B = o(() => n(x, "secondary", S.secondary)), V = o(() => e(x, "end"));
37
+ let x = y(), S = d, { merged: C, hasEnd: w, endBind: T, rootBind: E, rowClass: D, hasStart: O, startBind: k, hasPrimary: A, contentBind: j, primaryBind: M, hasSecondary: N, secondaryBind: P, interactiveBind: F, selectedIconBind: I, resolvedSelectedIcon: L } = a(S, { role: "button" }, x), R = o(() => C.value.as ?? "li"), z = o(() => i(x, S.primary)), B = o(() => n(x, "secondary", S.secondary)), V = o(() => e(x, "end"));
41
38
  return (e, n) => (g(), s(_(R.value), h(f(v(E))), {
42
39
  default: b(() => [v(F) ? (g(), l("div", h(p({ key: 0 }, v(F))), [u("div", { class: m(v(D)) }, [
43
40
  v(O) ? (g(), l("div", h(p({ key: 0 }, v(k))), [(g(), s(_(v(t)(v(x), "start"))))], 16)) : c("", !0),
@@ -2,38 +2,32 @@ import { LucideIcon } from '@lucide/vue';
2
2
  import { useSlots, Slot } from 'vue';
3
3
  import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
4
4
  import { ListItemOwnProps, ListItemProps } from '../listItem.types';
5
- type ListItemLibDefaults = LibDefaultsShape<ListItemOwnProps, "role" | "align">;
5
+ type ListItemLibDefaults = LibDefaultsShape<ListItemOwnProps, "role">;
6
6
  type ListItemMerged = MergeLibDefaults<ListItemOwnProps, ListItemLibDefaults>;
7
7
  export declare function useListItem(props: ListItemOwnProps, libDefaults: ListItemLibDefaults, slots: ReturnType<typeof useSlots>): {
8
8
  merged: import('vue').ComputedRef<ListItemMerged>;
9
9
  hasEnd: import('vue').ComputedRef<boolean>;
10
- endBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
11
- class: string;
12
- }, "class", import('vue').HTMLAttributes | undefined, {}>>;
10
+ endBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
13
11
  rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
14
12
  class: string;
15
- }, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListItemProps, "role" | "classes" | "customProps" | "primary" | "secondary" | "as" | "disabled" | "dense" | "align" | "divider" | "interactive" | "selected" | "selectedIcon">, never>>>;
13
+ id: string | undefined;
14
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListItemProps, "role" | "value" | "classes" | "customProps" | "primary" | "secondary" | "as" | "disabled" | "dense" | "divider" | "interactive" | "selected" | "selectedIcon">, never>>>;
16
15
  rowClass: import('vue').ComputedRef<string>;
17
16
  hasStart: import('vue').ComputedRef<boolean>;
18
- startBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
19
- class: string;
20
- }, "class", import('vue').HTMLAttributes | undefined, {}>>;
17
+ startBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
21
18
  hasPrimary: import('vue').ComputedRef<boolean>;
22
- contentBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
23
- class: string;
24
- }, "class", import('vue').HTMLAttributes | undefined, {}>>;
25
- primaryBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
26
- class: string;
27
- }, "class", import('vue').HTMLAttributes | undefined, {}>>;
19
+ contentBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
20
+ primaryBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
28
21
  hasSecondary: import('vue').ComputedRef<boolean>;
29
- secondaryBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
30
- class: string;
31
- }, "class", import('vue').HTMLAttributes | undefined, {}>>;
22
+ secondaryBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
32
23
  interactiveBind: import('vue').ComputedRef<({
24
+ "aria-disabled": boolean | undefined;
33
25
  role: NonNullable<"button" | "option" | "menuitem" | undefined>;
34
26
  tabindex: number;
35
- "aria-disabled": boolean | undefined;
36
27
  "data-selected": boolean | undefined;
28
+ "aria-selected": boolean | undefined;
29
+ onMousedown: ((event: MouseEvent) => void) | undefined;
30
+ onClick: (() => void) | undefined;
37
31
  class: string;
38
32
  } & object & Record<"class", string>) | null>;
39
33
  selectedIconBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
@@ -1,17 +1,18 @@
1
1
  import { hasNamedSlot as e, isPropPresent as t, resolveNamedSlot as n } from "../../../Utils/slotOrProp.js";
2
2
  import { mergePartBind as r, useBridgeUIComponent as i, useBridgeUIMergedRegistryClasses as a } from "../../../Utils/index.js";
3
3
  import { LIST_INJECTION_KEY as o } from "../../List/listInjectionKey.js";
4
- import { computed as s, getCurrentInstance as c, inject as l, toValue as u, useAttrs as d } from "vue";
5
- import { get as f, isNull as p, omit as m } from "es-toolkit/compat";
6
- import { cn as h, mergeBridgeUILayeredClasses as g, splitComponentProps as _ } from "@bridge-ui/core";
7
- import { Check as v } from "@lucide/vue";
8
- import { alignProps as y } from "@bridge-ui/core/Components/ListItem";
4
+ import { getListboxOptionId as s } from "../../Listbox/composables/useListboxNavigation.js";
5
+ import { LISTBOX_INJECTION_KEY as c } from "../../Listbox/listboxInjectionKey.js";
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
+ import { get as g, isNull as _, omit as v } from "es-toolkit/compat";
8
+ import { cn as y, splitComponentProps as b } from "@bridge-ui/core";
9
+ import { Check as x } from "@lucide/vue";
9
10
  //#region src/Components/ListItem/composables/useListItem.ts
10
- var b = [
11
+ var S = [
11
12
  "as",
12
13
  "role",
13
- "align",
14
14
  "dense",
15
+ "value",
15
16
  "classes",
16
17
  "divider",
17
18
  "primary",
@@ -22,88 +23,109 @@ var b = [
22
23
  "interactive",
23
24
  "selectedIcon"
24
25
  ];
25
- function x(t, n, x) {
26
- let S = d(), C = l(o, null), w = s(() => _({
26
+ function C(t, n, C) {
27
+ let w = m(), T = d(o, null), E = d(c, null), D = E != null, O = l(() => b({
27
28
  props: {
28
- ...S,
29
+ ...w,
29
30
  ...t
30
31
  },
31
- bridgeKeys: b
32
- })), { merged: T, entry: E } = i({
32
+ bridgeKeys: S
33
+ })), { merged: k, entry: A } = i({
33
34
  libDefaults: n,
34
35
  componentName: "ListItem",
35
- props: () => w.value.componentProps
36
- }), D = s(() => T.value.customProps), O = a({
37
- entry: E,
38
- props: () => w.value.componentProps
39
- }), k = s(() => "dense" in (c()?.vnode.props ?? {}) ? t.dense === !0 : t.dense === !0 ? !0 : C ? u(C).dense : !1), A = s(() => f(g(y, E.value?.customProps?.align), T.value.align)), j = s(() => e(x, "primary") || e(x, "default") || !!T.value.primary), M = s(() => e(x, "secondary") || !!T.value.secondary), N = s(() => e(x, "start")), P = s(() => !T.value.selected || p(T.value.selectedIcon) ? null : T.value.selectedIcon ?? v), F = s(() => e(x, "end") || P.value != null), I = s(() => m(w.value.inheritedAttrs, [])), L = s(() => r(D.value?.root, I.value, { class: h({
40
- "list-none": !0,
41
- "border-b border-black/10 last:border-b-0": T.value.divider,
42
- [f(O.value, "root") ?? ""]: !0
43
- }) })), R = s(() => T.value.interactive ? r(D.value?.interactive, {}, {
44
- role: T.value.role,
45
- tabindex: T.value.disabled ? -1 : 0,
46
- "aria-disabled": T.value.disabled ? !0 : void 0,
47
- "data-selected": T.value.selected ? !0 : void 0,
48
- class: h({
49
- "flex w-full min-w-0 gap-x-3 text-left outline-hidden transition-colors": !0,
50
- "cursor-pointer select-none": !T.value.disabled,
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;
43
+ h(() => {
44
+ let e = M.value;
45
+ return e ? `${String(e.value)}:${e.label}:${e.disabled}:${e.description ?? ""}` : null;
46
+ }, () => {
47
+ N?.(), N = void 0;
48
+ let e = M.value;
49
+ !e || !E || (N = p(E).registerOption(e));
50
+ }, { immediate: !0 }), f(() => {
51
+ N?.();
52
+ });
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, {
57
+ class: y({
58
+ "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
61
+ }),
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) => {
70
+ e.preventDefault();
71
+ } : void 0,
72
+ onClick: P.value ? () => {
73
+ M.value && j.value?.onSelect(M.value);
74
+ } : void 0,
75
+ class: y({
76
+ "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,
51
78
  "px-4": !0,
52
- "py-2": !k.value,
53
- "py-1.5": k.value,
54
- "hover:bg-black/5 focus-visible:bg-black/5": !T.value.disabled,
55
- "bg-primary-50 text-primary-700": T.value.selected,
56
- "opacity-50 pointer-events-none": T.value.disabled,
57
- [A.value ?? ""]: !0,
58
- [f(O.value, "interactive") ?? ""]: !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
59
90
  })
60
- }) : null), z = s(() => h({
91
+ }) : null), Y = l(() => y({
61
92
  "flex w-full min-w-0 gap-x-3": !0,
62
- "px-4": !T.value.interactive,
63
- "py-2": !T.value.interactive && !k.value,
64
- "py-1.5": !T.value.interactive && k.value,
65
- [A.value ?? ""]: !T.value.interactive
66
- })), B = s(() => r(D.value?.start, {}, { class: h({
67
- "flex shrink-0": !0,
68
- [f(O.value, "start") ?? ""]: !0
69
- }) })), V = s(() => r(D.value?.content, {}, { class: h({
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({
98
+ "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({
70
101
  "min-w-0 flex-1": !0,
71
- [f(O.value, "content") ?? ""]: !0
72
- }) })), H = s(() => r(D.value?.primary, {}, { class: h({
73
- "block truncate text-sm font-medium": !0,
74
- [f(O.value, "primary") ?? ""]: !0
75
- }) })), U = s(() => r(D.value?.secondary, {}, { class: h({
76
- "mt-0.5 block truncate text-xs text-dark-500": !0,
77
- [f(O.value, "secondary") ?? ""]: !0
78
- }) }));
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"))));
79
104
  return {
80
- merged: T,
81
- hasEnd: F,
82
- endBind: s(() => r(D.value?.end, {}, { class: h({
105
+ merged: k,
106
+ hasEnd: G,
107
+ endBind: l(() => r(R.value?.end, {}, y({
83
108
  "ml-auto flex shrink-0 items-center": !0,
84
- [f(O.value, "end") ?? ""]: !0
85
- }) })),
86
- rootBind: L,
87
- rowClass: z,
88
- hasStart: N,
89
- startBind: B,
90
- hasPrimary: j,
91
- contentBind: V,
92
- primaryBind: H,
93
- hasSecondary: M,
94
- secondaryBind: U,
95
- interactiveBind: R,
96
- selectedIconBind: s(() => r(D.value?.selectedIcon, {}, {
109
+ [g(z.value, "end") ?? ""]: !0
110
+ }))),
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, {}, {
97
122
  size: "sm",
98
- class: h({
99
- "shrink-0": !0,
100
- [f(O.value, "selectedIcon") ?? ""]: !0
101
- })
123
+ class: y("shrink-0", j.value?.checkClass, g(z.value, "selectedIcon"))
102
124
  })),
103
- resolvedSelectedIcon: P
125
+ resolvedSelectedIcon: W
104
126
  };
105
127
  }
106
- function S(r, i) {
128
+ function w(r, i) {
107
129
  if (e(r, "primary")) return n(r, "primary");
108
130
  if (e(r, "default")) return n(r, "default");
109
131
  if (!t(i)) return () => null;
@@ -111,4 +133,4 @@ function S(r, i) {
111
133
  return () => a;
112
134
  }
113
135
  //#endregion
114
- export { S as resolveListItemPrimary, x as useListItem };
136
+ export { w as resolveListItemPrimary, C as useListItem };
@@ -1,3 +1,3 @@
1
1
  export { useListItem } from './composables/useListItem';
2
- export type { ListItemAlignOverrides, ListItemClasses, ListItemCustomProps, ListItemOwnProps, ListItemProps, ListItemSlots, } from './listItem.types';
2
+ export type { ListItemClasses, ListItemCustomProps, ListItemOwnProps, ListItemProps, ListItemSlots, } from './listItem.types';
3
3
  export { default as ListItem } from './ListItem.vue';
@@ -1,8 +1,7 @@
1
1
  import { LucideIcon } from '@lucide/vue';
2
2
  import { HTMLAttributes, Slot, VNode } from 'vue';
3
- import { ListItemAlign, MergeHtmlProps, MergeProps } from '@bridge-ui/core';
3
+ import { ListboxValue, MergeHtmlProps } from '@bridge-ui/core';
4
4
  import { IconProps } from '../Icon';
5
- export interface ListItemAlignOverrides {}
6
5
  export interface ListItemClasses {
7
6
  /**
8
7
  * The classes to apply to the main content column.
@@ -75,12 +74,6 @@ export interface ListItemCustomProps {
75
74
  * List row (MUI `ListItem` / `ListItemButton`-like).
76
75
  */
77
76
  export interface ListItemOwnProps {
78
- /**
79
- * Vertical alignment of start/content/end slots.
80
- *
81
- * @default "center"
82
- */
83
- align?: MergeProps<ListItemAlign, ListItemAlignOverrides>;
84
77
  /**
85
78
  * The element to render as.
86
79
  *
@@ -154,6 +147,12 @@ export interface ListItemOwnProps {
154
147
  * @default Check
155
148
  */
156
149
  selectedIcon?: null | LucideIcon;
150
+ /**
151
+ * When set inside a `Listbox`, registers this row as a selectable option.
152
+ *
153
+ * @default undefined
154
+ */
155
+ value?: ListboxValue;
157
156
  }
158
157
  export type ListItemPrimaryContent = VNode | string | VNode[] | undefined;
159
158
  export interface ListItemSlots {
@@ -3,9 +3,7 @@ import { ListSectionOwnProps, ListSectionProps } from '../listSection.types';
3
3
  export declare function useListSection(props: ListSectionOwnProps, slots: ReturnType<typeof useSlots>): {
4
4
  label: import('vue').ComputedRef<import('vue').Slot | (() => null | import('vue').VNodeChild)>;
5
5
  merged: import('vue').ComputedRef<ListSectionOwnProps>;
6
- rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
7
- class: string;
8
- }, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListSectionProps, "classes" | "customProps" | "title" | "as" | "inset" | "sticky">, never>>>;
6
+ rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListSectionProps, "classes" | "customProps" | "title" | "as" | "inset" | "sticky">, never>>>;
9
7
  titleBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
10
8
  role: string;
11
9
  class: string;
@@ -26,19 +26,20 @@ function m(m, h) {
26
26
  }), x = a(() => y.value.customProps), S = r({
27
27
  entry: b,
28
28
  props: () => v.value.componentProps
29
- }), C = a(() => _ ? s(_).dense : !1), w = a(() => e(h, "default", y.value.title)), T = a(() => u(v.value.inheritedAttrs, []));
29
+ }), C = a(() => _ ? s(_).dense : !1), w = a(() => e(h, "default", y.value.title)), T = a(() => u(v.value.inheritedAttrs, [])), E = a(() => y.value.as === "div");
30
30
  return {
31
31
  label: w,
32
32
  merged: y,
33
- rootBind: a(() => t(x.value?.root, T.value, { class: d({
33
+ rootBind: a(() => t(x.value?.root, T.value, d({
34
34
  "list-none": !0,
35
+ "sticky top-0 z-10 bg-white dark:bg-dark-800": y.value.sticky && !E.value,
35
36
  [l(S.value, "root") ?? ""]: !0
36
- }) })),
37
+ }))),
37
38
  titleBind: a(() => t(x.value?.title, {}, {
38
39
  role: "presentation",
39
40
  class: d({
40
- "bg-white px-4 text-xs font-semibold tracking-wide text-dark-500 uppercase": !0,
41
- "sticky top-0 z-10": y.value.sticky,
41
+ "bg-white px-4 text-xs font-semibold tracking-wide text-dark-500 uppercase dark:bg-dark-800 dark:text-dark-300": !0,
42
+ "sticky top-0 z-10": y.value.sticky && E.value,
42
43
  "py-2": !C.value,
43
44
  "py-1.5": C.value,
44
45
  "pl-14": y.value.inset,
@@ -1,4 +1,5 @@
1
- import { ListboxOption, ListboxOwnProps, ListboxSlots } from './listbox.types';
1
+ import { ListboxOption } from '@bridge-ui/core';
2
+ import { ListboxOwnProps, ListboxSlots } from './listbox.types';
2
3
  type __VLS_Slots = ListboxSlots;
3
4
  type __VLS_Props = ListboxOwnProps;
4
5
  type __VLS_ModelProps = {
@@ -9,21 +10,23 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
9
10
  select: (option: ListboxOption) => any;
10
11
  "update:modelValue": (value: boolean) => any;
11
12
  "show-change": (show: boolean) => any;
13
+ "registered-options-change": (options: ListboxOption[]) => any;
12
14
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
15
  onSelect?: ((option: ListboxOption) => any) | undefined;
14
16
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
15
17
  "onShow-change"?: ((show: boolean) => any) | undefined;
18
+ "onRegistered-options-change"?: ((options: ListboxOption[]) => any) | undefined;
16
19
  }>, {
17
20
  color: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListboxColor, import('./listbox.types').ListboxColorOverrides>;
18
21
  size: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListboxSize, import('./listbox.types').ListboxSizeOverrides>;
19
22
  loading: boolean;
20
23
  multiple: boolean;
21
24
  disableAutoFocus: boolean;
22
- placement: import('@floating-ui/utils').Placement;
23
25
  emptyMessage: string;
24
26
  hideEmptyMessage: boolean;
25
27
  highlightedIndex: number;
26
28
  loadingMessage: string;
29
+ placement: import('@floating-ui/utils').Placement;
27
30
  showCheckmark: boolean;
28
31
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
29
32
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;