@bridge-ui/vue 0.25.0 → 0.26.0

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 (61) hide show
  1. package/dist/Components/ActionFooter/ActionFooter.vue.d.ts +2 -2
  2. package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +4 -4
  3. package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +62 -58
  4. package/dist/Components/Calendar/calendar.types.d.ts +8 -0
  5. package/dist/Components/Calendar/composables/useCalendar.d.ts +2 -1
  6. package/dist/Components/Calendar/composables/useCalendar.js +188 -177
  7. package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +96 -92
  8. package/dist/Components/CalendarRange/calendarRange.types.d.ts +8 -0
  9. package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +2 -1
  10. package/dist/Components/CalendarRange/composables/useCalendarRange.js +203 -220
  11. package/dist/Components/ColorField/ColorField.vue.d.ts +2 -2
  12. package/dist/Components/ColorPicker/ColorPicker.vue.d.ts +2 -2
  13. package/dist/Components/DateField/DateField.vue.d.ts +2 -2
  14. package/dist/Components/DatePicker/DatePicker.vue.d.ts +2 -2
  15. package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +1 -0
  16. package/dist/Components/DateRangeField/DateRangeField.vue.d.ts +2 -2
  17. package/dist/Components/DateRangePicker/DateRangePicker.vue.d.ts +2 -2
  18. package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +1 -0
  19. package/dist/Components/DateTimeField/DateTimeField.vue.d.ts +2 -2
  20. package/dist/Components/DateTimePicker/DateTimePicker.vue.d.ts +2 -2
  21. package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +1 -0
  22. package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue.d.ts +2 -2
  23. package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue.d.ts +2 -2
  24. package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +1 -0
  25. package/dist/Components/Drawer/Drawer.vue.d.ts +1 -1
  26. package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
  27. package/dist/Components/List/List.vue_vue_type_script_setup_true_lang.js +2 -1
  28. package/dist/Components/List/composables/useList.d.ts +1 -1
  29. package/dist/Components/List/composables/useList.js +5 -1
  30. package/dist/Components/List/index.d.ts +1 -1
  31. package/dist/Components/List/list.types.d.ts +10 -1
  32. package/dist/Components/List/listInjectionKey.d.ts +2 -0
  33. package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +1 -0
  34. package/dist/Components/ListItem/composables/useListItem.d.ts +1 -2
  35. package/dist/Components/ListItem/composables/useListItem.js +92 -86
  36. package/dist/Components/ListItem/listItem.types.d.ts +8 -0
  37. package/dist/Components/ListSection/composables/useListSection.js +31 -29
  38. package/dist/Components/Listbox/Listbox.vue.d.ts +2 -2
  39. package/dist/Components/Listbox/listbox.types.d.ts +2 -2
  40. package/dist/Components/Modal/Modal.vue.d.ts +1 -1
  41. package/dist/Components/Modal/composables/useModal.d.ts +1 -1
  42. package/dist/Components/Pagination/Pagination.vue.d.ts +2 -2
  43. package/dist/Components/Select/Select.vue.d.ts +4 -4
  44. package/dist/Components/Sidebar/SidebarList.vue_vue_type_script_setup_true_lang.js +1 -0
  45. package/dist/Components/Sidebar/SidebarListItem.vue_vue_type_script_setup_true_lang.js +1 -0
  46. package/dist/Components/Slider/composables/useSlider.d.ts +2 -2
  47. package/dist/Components/Snackbar/composables/useSnackbar.d.ts +1 -1
  48. package/dist/Components/TimeField/TimeField.vue.d.ts +2 -2
  49. package/dist/Components/TimePicker/TimePicker.vue.d.ts +2 -2
  50. package/dist/Components/TimeRangeField/TimeRangeField.vue.d.ts +2 -2
  51. package/dist/Components/TimeRangePicker/TimeRangePicker.vue.d.ts +2 -2
  52. package/dist/Utils/index.d.ts +2 -0
  53. package/dist/Utils/index.js +40 -39
  54. package/dist/Utils/useWheelNavigation.d.ts +11 -0
  55. package/dist/Utils/useWheelNavigation.js +20 -0
  56. package/dist/augments.d.ts +2 -1
  57. package/dist/index.d.ts +1 -1
  58. package/docs/components/Calendar.md +31 -30
  59. package/docs/components/CalendarRange.md +29 -28
  60. package/docs/components/List.md +43 -27
  61. package/package.json +2 -2
@@ -53,6 +53,7 @@ var b = /*@__PURE__*/ c({
53
53
  orientation: "horizontal"
54
54
  }, w, b);
55
55
  return (n, r) => (p(), a("div", f(l(_(E))), [s(t, {
56
+ "wheel-navigation": "",
56
57
  fill: _(T).fill,
57
58
  color: _(T).color,
58
59
  error: _(T).error,
@@ -7,18 +7,18 @@ type __VLS_ModelProps = {
7
7
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
8
  declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
9
  clear: () => any;
10
- apply: () => any;
11
10
  cancel: () => any;
12
11
  change: (value: Date | null) => any;
13
12
  close: () => any;
13
+ apply: () => any;
14
14
  open: () => any;
15
15
  "update:modelValue": (value: Date | null | undefined) => any;
16
16
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
17
17
  onClear?: (() => any) | undefined;
18
- onApply?: (() => any) | undefined;
19
18
  onCancel?: (() => any) | undefined;
20
19
  onChange?: ((value: Date | null) => any) | undefined;
21
20
  onClose?: (() => any) | undefined;
21
+ onApply?: (() => any) | undefined;
22
22
  onOpen?: (() => any) | undefined;
23
23
  "onUpdate:modelValue"?: ((value: Date | null | undefined) => any) | undefined;
24
24
  }>, {
@@ -6,14 +6,14 @@ type __VLS_ModelProps = {
6
6
  };
7
7
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
8
  declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
- apply: () => any;
10
9
  cancel: () => any;
11
10
  change: (value: Date | null) => any;
11
+ apply: () => any;
12
12
  "update:modelValue": (...args: unknown[]) => any;
13
13
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
- onApply?: (() => any) | undefined;
15
14
  onCancel?: (() => any) | undefined;
16
15
  onChange?: ((value: Date | null) => any) | undefined;
16
+ onApply?: (() => any) | undefined;
17
17
  "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
18
18
  }>, {
19
19
  showFooter: boolean;
@@ -62,6 +62,7 @@ var w = /*@__PURE__*/ d({
62
62
  defaultView: "date"
63
63
  }, O, T);
64
64
  return (n, a) => (_(), s("div", g(f(x(A))), [c("div", { class: h(x(P)) }, [c("div", { class: h(x(L)) }, [u(t, {
65
+ "wheel-navigation": "",
65
66
  fill: x(k).fill,
66
67
  color: x(k).color,
67
68
  error: x(k).error,
@@ -8,18 +8,18 @@ type __VLS_ModelProps = {
8
8
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
9
  declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
10
  clear: () => any;
11
- apply: () => any;
12
11
  cancel: () => any;
13
12
  change: (value: DateRangeValue | null) => any;
14
13
  close: () => any;
14
+ apply: () => any;
15
15
  open: () => any;
16
16
  "update:modelValue": (value: DateRangeValue | null | undefined) => any;
17
17
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
18
18
  onClear?: (() => any) | undefined;
19
- onApply?: (() => any) | undefined;
20
19
  onCancel?: (() => any) | undefined;
21
20
  onChange?: ((value: DateRangeValue | null) => any) | undefined;
22
21
  onClose?: (() => any) | undefined;
22
+ onApply?: (() => any) | undefined;
23
23
  onOpen?: (() => any) | undefined;
24
24
  "onUpdate:modelValue"?: ((value: DateRangeValue | null | undefined) => any) | undefined;
25
25
  }>, {
@@ -7,14 +7,14 @@ type __VLS_ModelProps = {
7
7
  };
8
8
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
9
  declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
- apply: () => any;
11
10
  cancel: () => any;
12
11
  change: (value: DateRangeValue | null) => any;
12
+ apply: () => any;
13
13
  "update:modelValue": (...args: unknown[]) => any;
14
14
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
15
- onApply?: (() => any) | undefined;
16
15
  onCancel?: (() => any) | undefined;
17
16
  onChange?: ((value: DateRangeValue | null) => any) | undefined;
17
+ onApply?: (() => any) | undefined;
18
18
  "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
19
19
  }>, {
20
20
  showFooter: boolean;
@@ -62,6 +62,7 @@ var w = /*@__PURE__*/ d({
62
62
  orientation: "horizontal"
63
63
  }, O, T);
64
64
  return (n, a) => (_(), s("div", g(f(x(A))), [c("div", { class: h(x(F)) }, [c("div", { class: h(x(R)) }, [u(t, {
65
+ "wheel-navigation": "",
65
66
  fill: x(k).fill,
66
67
  color: x(k).color,
67
68
  error: x(k).error,
@@ -16,6 +16,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
16
16
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
17
17
  "onShow-change"?: ((show: boolean) => any) | undefined;
18
18
  }>, {
19
+ scroll: keyof import('@bridge-ui/core/Tokens').DrawerScroll;
19
20
  autoFocus: boolean;
20
21
  closeOnEscape: boolean;
21
22
  closeOnOverlay: boolean;
@@ -26,7 +27,6 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
26
27
  keepMounted: boolean;
27
28
  persistent: boolean;
28
29
  placement: keyof import('@bridge-ui/core/Tokens').DrawerPlacement;
29
- scroll: keyof import('@bridge-ui/core/Tokens').DrawerScroll;
30
30
  teleportTo: string | false;
31
31
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
32
32
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -34,7 +34,7 @@ export declare function useDrawer(props: DrawerOwnProps, libDefaults: DrawerLibD
34
34
  };
35
35
  "aria-hidden": boolean | undefined;
36
36
  class: string;
37
- }, "class", import('vue').HTMLAttributes | undefined, Omit<DrawerProps, "size" | "classes" | "customProps" | "transition" | "ariaLabel" | "ariaLabelledBy" | "autoFocus" | "blur" | "closeOnEscape" | "closeOnOverlay" | "disableEnforceFocus" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "persistent" | "placement" | "scroll" | "stackId" | "teleportTo">>>;
37
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<DrawerProps, "size" | "blur" | "scroll" | "classes" | "customProps" | "transition" | "ariaLabel" | "ariaLabelledBy" | "autoFocus" | "closeOnEscape" | "closeOnOverlay" | "disableEnforceFocus" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "persistent" | "placement" | "stackId" | "teleportTo">>>;
38
38
  panelBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
39
39
  "data-drawer-part": string;
40
40
  "data-state": "open" | "closed";
@@ -15,7 +15,8 @@ var d = /*@__PURE__*/ r({
15
15
  nested: {
16
16
  type: Boolean,
17
17
  default: !1
18
- }
18
+ },
19
+ size: {}
19
20
  },
20
21
  setup(r) {
21
22
  let { merged: d, rootBind: f } = e(r), p = t(() => d.value.as ?? "ul");
@@ -3,5 +3,5 @@ export declare function useList(props: ListOwnProps): {
3
3
  merged: import('vue').ComputedRef<ListOwnProps>;
4
4
  rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
5
5
  class: string;
6
- }, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListProps, "classes" | "customProps" | "as" | "dense" | "nested">, never>>>;
6
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListProps, "size" | "classes" | "customProps" | "as" | "dense" | "nested">, never>>>;
7
7
  };
@@ -6,6 +6,7 @@ import { cn as l, splitComponentProps as u } from "@bridge-ui/core/Utils";
6
6
  // src/Components/List/composables/useList.ts
7
7
  var d = [
8
8
  "as",
9
+ "size",
9
10
  "dense",
10
11
  "nested",
11
12
  "classes",
@@ -24,7 +25,10 @@ function f(f) {
24
25
  }), _ = i(() => h.value.customProps), v = r({
25
26
  entry: g,
26
27
  props: () => m.value.componentProps
27
- }), y = i(() => ({ dense: h.value.dense === !0 }));
28
+ }), y = i(() => ({
29
+ size: h.value.size,
30
+ dense: h.value.dense === !0
31
+ }));
28
32
  a(e, y);
29
33
  let b = i(() => c(m.value.inheritedAttrs, []));
30
34
  return {
@@ -1,5 +1,5 @@
1
1
  export { useList } from './composables/useList';
2
- export type { ListClasses, ListCustomProps, ListOwnProps, ListProps, } from './list.types';
2
+ export type { ListClasses, ListCustomProps, ListOwnProps, ListProps, ListSizeOverrides, } 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,5 +1,7 @@
1
1
  import { HTMLAttributes } from 'vue';
2
- import { MergeHtmlProps } from '@bridge-ui/core/Utils';
2
+ import { ListSize } from '@bridge-ui/core/Tokens';
3
+ import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
4
+ export interface ListSizeOverrides {}
3
5
  export interface ListClasses {
4
6
  /**
5
7
  * The classes to apply to the root.
@@ -46,5 +48,12 @@ export interface ListOwnProps {
46
48
  * @default false
47
49
  */
48
50
  nested?: boolean;
51
+ /**
52
+ * Typography scale for items (`ListItem`) and section titles
53
+ * (`ListSection`). Items can override it with their own `size`.
54
+ *
55
+ * @default "md"
56
+ */
57
+ size?: MergeProps<ListSize, ListSizeOverrides>;
49
58
  }
50
59
  export type ListProps = MergeHtmlProps<ListOwnProps, HTMLAttributes>;
@@ -1,5 +1,7 @@
1
1
  import { ComputedRef, InjectionKey } from 'vue';
2
+ import { ListOwnProps } from './list.types';
2
3
  export type ListContextValue = {
3
4
  dense: boolean;
5
+ size?: ListOwnProps["size"];
4
6
  };
5
7
  export declare const LIST_INJECTION_KEY: InjectionKey<ComputedRef<ListContextValue>>;
@@ -35,6 +35,7 @@ var C = /*@__PURE__*/ d({
35
35
  default: !1
36
36
  },
37
37
  selectedIcon: {},
38
+ size: {},
38
39
  target: {},
39
40
  value: {}
40
41
  },
@@ -12,7 +12,7 @@ export declare function useListItem<T extends LinkAsTag = "a">(props: ListItemOw
12
12
  rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
13
13
  class: string;
14
14
  id: string | undefined;
15
- }, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListItemProps<T>, "target" | "role" | "href" | "value" | "classes" | "primary" | "secondary" | "customProps" | "as" | "disabled" | "linkAs" | "linkProps" | "selected" | "rel" | "dense" | "divider" | "interactive" | "selectedIcon">, never>>>;
15
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListItemProps<T>, "target" | "role" | "href" | "size" | "value" | "classes" | "primary" | "secondary" | "customProps" | "as" | "disabled" | "linkAs" | "linkProps" | "selected" | "rel" | "dense" | "divider" | "interactive" | "selectedIcon">, never>>>;
16
16
  rowClass: import('vue').ComputedRef<string>;
17
17
  startBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
18
18
  hasPrimary: import('vue').ComputedRef<boolean>;
@@ -36,7 +36,6 @@ export declare function useListItem<T extends LinkAsTag = "a">(props: ListItemOw
36
36
  } & object & Record<"class", string>) | null>;
37
37
  selectedIconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
38
38
  class: string;
39
- size?: "sm" | undefined;
40
39
  }, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
41
40
  resolvedSelectedIcon: import('vue').ComputedRef<IconSource | null>;
42
41
  };
@@ -5,14 +5,15 @@ import { mergePartBind as r, useBridgeUIComponent as i, useBridgeUIMergedRegistr
5
5
  import { resolveLinkAsProps as o } from "../../../Utils/linkAs.js";
6
6
  import { computed as s, getCurrentInstance as c, inject as l, onBeforeUnmount as u, toValue as d, useAttrs as f, watch as p } from "vue";
7
7
  import { get as m, isNil as h, isNull as g, omit as _ } from "es-toolkit/compat";
8
- import { getListboxOptionId as v, listboxOptionFromComposedItem as y } from "@bridge-ui/core/Domain";
9
- import { cn as b, splitComponentProps as x } from "@bridge-ui/core/Utils";
8
+ import { getListboxOptionId as v, listboxOptionFromComposedItem as y, resolveListSizeClasses as b } from "@bridge-ui/core/Domain";
9
+ import { cn as x, splitComponentProps as ee } from "@bridge-ui/core/Utils";
10
10
  // src/Components/ListItem/composables/useListItem.ts
11
11
  var S = [
12
12
  "as",
13
13
  "rel",
14
14
  "href",
15
15
  "role",
16
+ "size",
16
17
  "dense",
17
18
  "value",
18
19
  "linkAs",
@@ -29,132 +30,137 @@ var S = [
29
30
  "selectedIcon"
30
31
  ];
31
32
  function C(C, w, T) {
32
- let E = f(), D = l(t, null), O = l(n, null), k = !h(O), A = s(() => x({
33
+ let E = f(), D = l(t, null), O = l(n, null), k = !h(O), A = s(() => ee({
33
34
  props: {
34
35
  ...E,
35
36
  ...C
36
37
  },
37
38
  bridgeKeys: S
38
- })), { merged: j, entry: M } = i({
39
+ })), { merged: j, components: M, entry: N } = i({
39
40
  libDefaults: w,
40
41
  componentName: "ListItem",
41
42
  props: () => A.value.componentProps
42
- }), N = s(() => O ? d(O) : null), P = s(() => k ? y({
43
+ }), P = s(() => O ? d(O) : null), F = s(() => k ? y({
43
44
  value: j.value.value,
44
45
  primary: j.value.primary,
45
46
  disabled: j.value.disabled,
46
47
  secondary: j.value.secondary
47
- }) : null), F;
48
+ }) : null), I;
48
49
  p(() => {
49
- let e = P.value;
50
+ let e = F.value;
50
51
  return e ? `${String(e.value)}:${e.label}:${e.disabled}:${e.description ?? ""}` : null;
51
52
  }, () => {
52
- F?.(), F = void 0;
53
- let e = P.value;
54
- e && O && (F = d(O).registerOption(e));
53
+ I?.(), I = void 0;
54
+ let e = F.value;
55
+ e && O && (I = d(O).registerOption(e));
55
56
  }, { immediate: !0 }), u(() => {
56
- F?.();
57
+ I?.();
57
58
  });
58
- let I = s(() => !h(P.value)), L = s(() => !P.value || !N.value ? !1 : N.value.isSelected(P.value.value)), R = s(() => !P.value || !N.value ? -1 : N.value.getOptionIndex(P.value.value)), z = s(() => !N.value || R.value < 0 ? !1 : N.value.highlightedIndex === R.value), B = s(() => j.value.customProps), V = a({
59
- entry: M,
59
+ let L = s(() => !h(F.value)), R = s(() => !F.value || !P.value ? !1 : P.value.isSelected(F.value.value)), z = s(() => !F.value || !P.value ? -1 : P.value.getOptionIndex(F.value.value)), B = s(() => !P.value || z.value < 0 ? !1 : P.value.highlightedIndex === z.value), V = s(() => j.value.customProps), H = a({
60
+ entry: N,
60
61
  props: () => A.value.componentProps
61
- }), H = s(() => "dense" in (c()?.vnode.props ?? {}) ? C.dense === !0 : C.dense === !0 ? !0 : D ? d(D).dense : !1), U = s(() => e(T, "primary") || e(T, "default") || !!j.value.primary), W = s(() => e(T, "secondary") || !!j.value.secondary), G = s(() => I.value ? !L.value || !N.value?.showCheckmark ? null : "check" : !j.value.selected || g(j.value.selectedIcon) ? null : j.value.selectedIcon ?? "check"), K = s(() => e(T, "end") || G.value != null), q = s(() => _(A.value.inheritedAttrs, [])), J = s(() => r(B.value?.root, q.value, {
62
- class: b({
62
+ }), U = s(() => "dense" in (c()?.vnode.props ?? {}) ? C.dense === !0 : C.dense === !0 ? !0 : D ? d(D).dense : !1), W = s(() => {
63
+ let e = k ? void 0 : j.value.size ?? (D ? d(D).size : void 0);
64
+ return b(M.value, e);
65
+ }), G = s(() => e(T, "primary") || e(T, "default") || !!j.value.primary), K = s(() => e(T, "secondary") || !!j.value.secondary), q = s(() => L.value ? !R.value || !P.value?.showCheckmark ? null : "check" : !j.value.selected || g(j.value.selectedIcon) ? null : j.value.selectedIcon ?? "check"), J = s(() => e(T, "end") || q.value != null), Y = s(() => _(A.value.inheritedAttrs, [])), X = s(() => r(V.value?.root, Y.value, {
66
+ class: x({
63
67
  "list-none": !0,
64
68
  "border-b border-black/10 last:border-b-0 dark:border-white/10": j.value.divider,
65
- [m(V.value, "root") ?? ""]: !0
69
+ [m(H.value, "root") ?? ""]: !0
66
70
  }),
67
- id: I.value && N.value?.listboxId && R.value >= 0 ? v(N.value.listboxId, R.value) : void 0
68
- })), Y = s(() => !!j.value.href && !I.value), X = s(() => !!(j.value.interactive || I.value || Y.value)), Z = s(() => Y.value ? j.value.disabled || j.value.linkAs == null ? "a" : j.value.linkAs : "div"), Q = s(() => {
69
- if (!X.value) return null;
70
- let e = r(B.value?.interactive, o(j.value.linkAs, j.value.linkProps, Z.value), {
71
+ id: L.value && P.value?.listboxId && z.value >= 0 ? v(P.value.listboxId, z.value) : void 0
72
+ })), Z = s(() => !!j.value.href && !L.value), Q = s(() => !!(j.value.interactive || L.value || Z.value)), $ = s(() => Z.value ? j.value.disabled || j.value.linkAs == null ? "a" : j.value.linkAs : "div"), te = s(() => {
73
+ if (!Q.value) return null;
74
+ let e = r(V.value?.interactive, o(j.value.linkAs, j.value.linkProps, $.value), {
71
75
  "aria-disabled": j.value.disabled ? !0 : void 0,
72
- rel: Y.value && !j.value.disabled ? j.value.rel : void 0,
73
- "data-selected": j.value.selected || L.value ? !0 : void 0,
74
- "aria-selected": I.value ? L.value : void 0,
75
- href: Y.value && !j.value.disabled ? j.value.href : void 0,
76
- target: Y.value && !j.value.disabled ? j.value.target : void 0,
77
- role: I.value ? "option" : Y.value ? void 0 : j.value.role,
78
- onMousedown: I.value ? (e) => {
76
+ rel: Z.value && !j.value.disabled ? j.value.rel : void 0,
77
+ "data-selected": j.value.selected || R.value ? !0 : void 0,
78
+ "aria-selected": L.value ? R.value : void 0,
79
+ href: Z.value && !j.value.disabled ? j.value.href : void 0,
80
+ target: Z.value && !j.value.disabled ? j.value.target : void 0,
81
+ role: L.value ? "option" : Z.value ? void 0 : j.value.role,
82
+ onMousedown: L.value ? (e) => {
79
83
  e.preventDefault();
80
84
  } : void 0,
81
- tabindex: j.value.disabled || I.value ? -1 : Y.value ? void 0 : 0,
82
- onClick: I.value ? () => {
83
- P.value && N.value?.onSelect(P.value);
85
+ tabindex: j.value.disabled || L.value ? -1 : Z.value ? void 0 : 0,
86
+ onClick: L.value ? () => {
87
+ F.value && P.value?.onSelect(F.value);
84
88
  } : void 0,
85
- class: b({
86
- "flex w-full min-w-0 items-center gap-x-2 rounded-md text-left text-sm text-dark-900 outline-hidden transition-colors dark:text-dark-100": !0,
87
- "no-underline": Y.value,
89
+ class: x({
90
+ "flex w-full min-w-0 items-center gap-x-2 rounded-md text-left text-dark-900 outline-hidden transition-colors dark:text-dark-100": !0,
91
+ [W.value.item]: !L.value,
92
+ "no-underline": Z.value,
88
93
  "cursor-pointer select-none": !j.value.disabled,
89
- "px-2": !I.value,
90
- "py-1.5": !I.value && !H.value,
91
- "py-1": !I.value && H.value,
92
- "hover:bg-black/5 focus-visible:bg-black/5 dark:hover:bg-white/10 dark:focus-visible:bg-white/10": !j.value.disabled && !I.value,
93
- "bg-dark-100 font-medium text-dark-900 dark:bg-white/15 dark:text-white": j.value.selected && !I.value,
94
- [N.value?.optionHoverClass ?? ""]: I.value && !j.value.disabled && !L.value,
95
- [N.value?.mergedClasses.optionHover ?? ""]: I.value && !j.value.disabled && !L.value,
96
- [N.value?.optionSelectedClass ?? ""]: I.value && L.value,
97
- [N.value?.mergedClasses.optionSelected ?? ""]: I.value && L.value,
98
- [N.value?.optionHighlightedClass ?? ""]: I.value && z.value && !L.value,
99
- [N.value?.mergedClasses.optionHighlighted ?? ""]: I.value && z.value && !L.value,
94
+ "px-2": !L.value,
95
+ "py-1.5": !L.value && !U.value,
96
+ "py-1": !L.value && U.value,
97
+ "hover:bg-black/5 focus-visible:bg-black/5 dark:hover:bg-white/10 dark:focus-visible:bg-white/10": !j.value.disabled && !L.value,
98
+ "bg-dark-100 font-medium text-dark-900 dark:bg-white/15 dark:text-white": j.value.selected && !L.value,
99
+ [P.value?.optionHoverClass ?? ""]: L.value && !j.value.disabled && !R.value,
100
+ [P.value?.mergedClasses.optionHover ?? ""]: L.value && !j.value.disabled && !R.value,
101
+ [P.value?.optionSelectedClass ?? ""]: L.value && R.value,
102
+ [P.value?.mergedClasses.optionSelected ?? ""]: L.value && R.value,
103
+ [P.value?.optionHighlightedClass ?? ""]: L.value && B.value && !R.value,
104
+ [P.value?.mergedClasses.optionHighlighted ?? ""]: L.value && B.value && !R.value,
100
105
  "opacity-50 pointer-events-none": j.value.disabled,
101
- [N.value?.sizeClasses?.option ?? ""]: I.value,
102
- [m(V.value, "interactive") ?? ""]: !0
106
+ [P.value?.sizeClasses?.option ?? ""]: L.value,
107
+ [m(H.value, "interactive") ?? ""]: !0
103
108
  })
104
109
  });
105
- return !Y.value || !j.value.disabled ? e : {
110
+ return !Z.value || !j.value.disabled ? e : {
106
111
  ...e,
107
112
  rel: void 0,
108
113
  href: void 0,
109
114
  target: void 0
110
115
  };
111
- }), $ = s(() => b({
116
+ }), ne = s(() => x({
112
117
  "flex w-full min-w-0 items-center gap-x-2": !0,
113
- "rounded-md text-dark-900 dark:text-dark-100": !X.value,
114
- "px-2": !X.value,
115
- "py-1.5": !X.value && !H.value,
116
- "py-1": !X.value && H.value
117
- })), ee = s(() => r(B.value?.start, {}, b({
118
+ "rounded-md text-dark-900 dark:text-dark-100": !Q.value,
119
+ [W.value.item]: !Q.value,
120
+ "px-2": !Q.value,
121
+ "py-1.5": !Q.value && !U.value,
122
+ "py-1": !Q.value && U.value
123
+ })), re = s(() => r(V.value?.start, {}, x({
118
124
  "flex shrink-0 items-center text-dark-600 dark:text-dark-300": !0,
119
- [m(V.value, "start") ?? ""]: !0
120
- }))), te = s(() => r(B.value?.content, {}, b({
125
+ [m(H.value, "start") ?? ""]: !0
126
+ }))), ie = s(() => r(V.value?.content, {}, x({
121
127
  "min-w-0 flex-1": !0,
122
- [m(V.value, "content") ?? ""]: !0
123
- }))), ne = s(() => r(B.value?.primary, {}, b({
124
- "block truncate text-sm leading-normal font-medium": !0,
125
- [N.value?.sizeClasses?.primary ?? ""]: I.value,
126
- [m(V.value, "primary") ?? ""]: !0
127
- }))), re = s(() => r(B.value?.secondary, {}, b({
128
- "mt-0.5 block truncate text-xs leading-normal text-dark-500 dark:text-dark-400": !0,
129
- [N.value?.sizeClasses?.secondary ?? ""]: I.value,
130
- [m(V.value, "secondary") ?? ""]: !0
128
+ [m(H.value, "content") ?? ""]: !0
129
+ }))), ae = s(() => r(V.value?.primary, {}, x({
130
+ "block truncate leading-normal font-medium": !0,
131
+ [W.value.primary]: !L.value,
132
+ [P.value?.sizeClasses?.primary ?? ""]: L.value,
133
+ [m(H.value, "primary") ?? ""]: !0
134
+ }))), oe = s(() => r(V.value?.secondary, {}, x({
135
+ "mt-0.5 block truncate leading-normal text-dark-500 dark:text-dark-400": !0,
136
+ [W.value.secondary]: !L.value,
137
+ [P.value?.sizeClasses?.secondary ?? ""]: L.value,
138
+ [m(H.value, "secondary") ?? ""]: !0
131
139
  })));
132
140
  return {
133
141
  merged: j,
134
- hasEnd: K,
135
- endBind: s(() => r(B.value?.end, {}, b({
142
+ hasEnd: J,
143
+ endBind: s(() => r(V.value?.end, {}, x({
136
144
  "ml-auto flex shrink-0 items-center": !0,
137
- [m(V.value, "end") ?? ""]: !0
145
+ [m(H.value, "end") ?? ""]: !0
138
146
  }))),
139
- rootBind: J,
140
- rowClass: $,
141
- startBind: ee,
142
- hasPrimary: U,
143
- contentBind: te,
144
- primaryBind: ne,
145
- hasSecondary: W,
146
- secondaryBind: re,
147
- interactiveTag: Z,
148
- interactiveBind: Q,
149
- selectedIconBind: s(() => r(B.value?.selectedIcon, {}, {
150
- ...I.value ? {} : { size: "sm" },
151
- class: b({
152
- "block shrink-0": !0,
153
- [N.value?.checkClass ?? ""]: I.value,
154
- [m(V.value, "selectedIcon") ?? ""]: !0
155
- })
156
- })),
157
- resolvedSelectedIcon: G
147
+ rootBind: X,
148
+ rowClass: ne,
149
+ startBind: re,
150
+ hasPrimary: G,
151
+ contentBind: ie,
152
+ primaryBind: ae,
153
+ hasSecondary: K,
154
+ secondaryBind: oe,
155
+ interactiveTag: $,
156
+ interactiveBind: te,
157
+ selectedIconBind: s(() => r(V.value?.selectedIcon, {}, { class: x({
158
+ "block shrink-0": !0,
159
+ [W.value.icon]: !L.value,
160
+ [P.value?.checkClass ?? ""]: L.value,
161
+ [m(H.value, "selectedIcon") ?? ""]: !0
162
+ }) })),
163
+ resolvedSelectedIcon: q
158
164
  };
159
165
  }
160
166
  export { C as useListItem };
@@ -3,6 +3,7 @@ import { ListboxValue } from '@bridge-ui/core/Domain';
3
3
  import { MergeHtmlProps } from '@bridge-ui/core/Utils';
4
4
  import { IconSource } from '../../Adapters/Icon';
5
5
  import { IconProps } from '../Icon';
6
+ import { ListOwnProps } from '../List/list.types';
6
7
  import { LinkAsTag, LinkHref, LinkPropsOf } from '../../Utils/linkAs';
7
8
  export interface ListItemClasses {
8
9
  /**
@@ -179,6 +180,13 @@ export interface ListItemOwnProps<T extends LinkAsTag = "a"> {
179
180
  * @default Check
180
181
  */
181
182
  selectedIcon?: null | IconSource;
183
+ /**
184
+ * Typography scale for the row. Inherits `size` from parent `List` when
185
+ * omitted. Ignored inside a `Listbox`, which applies its own size.
186
+ *
187
+ * @default undefined
188
+ */
189
+ size?: ListOwnProps["size"];
182
190
  /**
183
191
  * Where to open the URL. Forwarded to the anchor when `href` is set.
184
192
  *
@@ -4,9 +4,10 @@ import { LIST_SECTION_INJECTION_KEY as n } from "../listSectionInjectionKey.js";
4
4
  import { mergePartBind as r, useBridgeUIComponent as i, useBridgeUIMergedRegistryClasses as a } from "../../../Utils/index.js";
5
5
  import { computed as o, inject as s, toValue as c, useAttrs as l } from "vue";
6
6
  import { get as u, isNil as d, omit as f } from "es-toolkit/compat";
7
- import { cn as p, splitComponentProps as m } from "@bridge-ui/core/Utils";
7
+ import { resolveListSizeClasses as p } from "@bridge-ui/core/Domain";
8
+ import { cn as m, splitComponentProps as h } from "@bridge-ui/core/Utils";
8
9
  // src/Components/ListSection/composables/useListSection.ts
9
- var h = [
10
+ var g = [
10
11
  "as",
11
12
  "inset",
12
13
  "title",
@@ -14,41 +15,42 @@ var h = [
14
15
  "classes",
15
16
  "customProps"
16
17
  ];
17
- function g(g) {
18
- let _ = l(), v = s(e, null), y = s(n, null), b = s(t, null), x = o(() => b ? c(b) : null), S = o(() => m({
18
+ function _(_) {
19
+ let v = l(), y = s(e, null), b = s(n, null), x = s(t, null), S = o(() => x ? c(x) : null), C = o(() => h({
19
20
  props: {
20
- ..._,
21
- ...g
21
+ ...v,
22
+ ..._
22
23
  },
23
- bridgeKeys: h
24
- })), { merged: C, entry: w } = i({
24
+ bridgeKeys: g
25
+ })), { merged: w, components: T, entry: E } = i({
25
26
  componentName: "ListSection",
26
- props: () => S.value.componentProps
27
- }), T = o(() => C.value.customProps), E = a({
28
- entry: w,
29
- props: () => S.value.componentProps
30
- }), D = o(() => v ? c(v).dense : !1), O = o(() => y ? c(y).hidden : !1), k = o(() => f(S.value.inheritedAttrs, [])), A = o(() => C.value.as === "div");
27
+ props: () => C.value.componentProps
28
+ }), D = o(() => w.value.customProps), O = a({
29
+ entry: E,
30
+ props: () => C.value.componentProps
31
+ }), k = o(() => y ? c(y).dense : !1), A = o(() => p(T.value, y ? c(y).size : void 0)), j = o(() => b ? c(b).hidden : !1), M = o(() => f(C.value.inheritedAttrs, [])), N = o(() => w.value.as === "div");
31
32
  return {
32
- merged: C,
33
- rootBind: o(() => r(T.value?.root, k.value, p({
33
+ merged: w,
34
+ rootBind: o(() => r(D.value?.root, M.value, m({
34
35
  "mt-1 list-none first:mt-0": !0,
35
- "sticky top-0 z-10 bg-white dark:bg-dark-800": C.value.sticky && !A.value,
36
- [u(E.value, "root") ?? ""]: !0
36
+ "sticky top-0 z-10 bg-white dark:bg-dark-800": w.value.sticky && !N.value,
37
+ [u(O.value, "root") ?? ""]: !0
37
38
  }))),
38
- isHidden: O,
39
- titleBind: o(() => r(T.value?.title, {}, {
39
+ isHidden: j,
40
+ titleBind: o(() => r(D.value?.title, {}, {
40
41
  role: "presentation",
41
- class: p({
42
- "sticky top-0 z-10 bg-white dark:bg-dark-800": C.value.sticky && A.value,
43
- "px-2": d(b),
44
- "py-1": d(b) && D.value,
45
- "py-1.5": d(b) && !D.value,
46
- [x.value?.sizeClasses?.option ?? ""]: !d(b),
47
- "text-xs font-medium text-dark-500 dark:text-dark-400": !0,
48
- "pl-14": C.value.inset,
49
- [u(E.value, "title") ?? ""]: !0
42
+ class: m({
43
+ "sticky top-0 z-10 bg-white dark:bg-dark-800": w.value.sticky && N.value,
44
+ "px-2": d(x),
45
+ "py-1": d(x) && k.value,
46
+ "py-1.5": d(x) && !k.value,
47
+ [S.value?.sizeClasses?.option ?? ""]: !d(x),
48
+ "font-medium text-dark-500 dark:text-dark-400": !0,
49
+ [d(x) ? A.value.section : "text-xs"]: !0,
50
+ "pl-14": w.value.inset,
51
+ [u(O.value, "title") ?? ""]: !0
50
52
  })
51
53
  }))
52
54
  };
53
55
  }
54
- export { g as useListSection };
56
+ export { _ as useListSection };
@@ -7,16 +7,16 @@ type __VLS_ModelProps = {
7
7
  };
8
8
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
9
  declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
- apply: () => any;
11
10
  cancel: () => any;
12
11
  select: (option: ListboxOption) => any;
12
+ apply: () => any;
13
13
  "update:modelValue": (value: boolean) => any;
14
14
  "show-change": (show: boolean) => any;
15
15
  "registered-options-change": (options: ListboxOption[]) => any;
16
16
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
17
- onApply?: (() => any) | undefined;
18
17
  onCancel?: (() => any) | undefined;
19
18
  onSelect?: ((option: ListboxOption) => any) | undefined;
19
+ onApply?: (() => any) | undefined;
20
20
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
21
21
  "onShow-change"?: ((show: boolean) => any) | undefined;
22
22
  "onRegistered-options-change"?: ((options: ListboxOption[]) => any) | undefined;
@@ -78,14 +78,14 @@ export interface ListboxCustomProps {
78
78
  *
79
79
  * @default undefined
80
80
  */
81
- list?: Partial<ListOwnProps>;
81
+ list?: Partial<Omit<ListOwnProps, "size">>;
82
82
  /**
83
83
  * Props forwarded to each mapped `ListItem` option.
84
84
  * Merged last so they override Listbox defaults.
85
85
  *
86
86
  * @default undefined
87
87
  */
88
- listItem?: Partial<ListItemOwnProps>;
88
+ listItem?: Partial<Omit<ListItemOwnProps, "size">>;
89
89
  /**
90
90
  * Props forwarded to each mapped `ListSection`.
91
91
  *