@bridge-ui/vue 0.11.0 → 0.12.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 (94) hide show
  1. package/dist/Adapters/Examples/icon-fontawesome.js +52 -40
  2. package/dist/Adapters/Examples/icon-heroicons.js +43 -31
  3. package/dist/Adapters/Examples/icon-lucide.js +46 -34
  4. package/dist/Adapters/Examples/icon-phosphor.js +36 -24
  5. package/dist/Adapters/Examples/icon-tabler.js +44 -32
  6. package/dist/Adapters/Examples/rich-text-tiptap.d.ts +5 -0
  7. package/dist/Adapters/Examples/rich-text-tiptap.js +138 -0
  8. package/dist/Adapters/RichText/index.d.ts +1 -0
  9. package/dist/Adapters/RichText/index.js +2 -0
  10. package/dist/Adapters/RichText/mockRichTextAdapter.d.ts +5 -0
  11. package/dist/Adapters/RichText/useRichTextAdapter.d.ts +12 -0
  12. package/dist/Adapters/RichText/useRichTextAdapter.js +13 -0
  13. package/dist/Adapters/index.d.ts +1 -0
  14. package/dist/Adapters/index.js +2 -1
  15. package/dist/Components/ActionFooter/composables/useActionFooter.d.ts +6 -6
  16. package/dist/Components/Autocomplete/composables/useAutocomplete.js +2 -2
  17. package/dist/Components/Breadcrumb/Breadcrumb.vue.d.ts +17 -10
  18. package/dist/Components/Breadcrumb/Breadcrumb.vue_vue_type_script_setup_true_lang.js +7 -2
  19. package/dist/Components/Breadcrumb/breadcrumb.types.d.ts +22 -4
  20. package/dist/Components/Breadcrumb/breadcrumbInjectionKey.d.ts +5 -1
  21. package/dist/Components/Breadcrumb/composables/useBreadcrumb.d.ts +6 -5
  22. package/dist/Components/Breadcrumb/composables/useBreadcrumb.js +2 -0
  23. package/dist/Components/BreadcrumbItem/BreadcrumbItem.vue.d.ts +17 -11
  24. package/dist/Components/BreadcrumbItem/BreadcrumbItem.vue_vue_type_script_setup_true_lang.js +2 -0
  25. package/dist/Components/BreadcrumbItem/breadcrumbItem.types.d.ts +21 -3
  26. package/dist/Components/BreadcrumbItem/composables/useBreadcrumbItem.d.ts +10 -6
  27. package/dist/Components/BreadcrumbItem/composables/useBreadcrumbItem.js +65 -59
  28. package/dist/Components/Button/Button.vue.d.ts +17 -8
  29. package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +10 -10
  30. package/dist/Components/Button/button.types.d.ts +22 -5
  31. package/dist/Components/Button/composables/useButton.d.ts +198 -8
  32. package/dist/Components/Button/composables/useButton.js +101 -86
  33. package/dist/Components/ColorPicker/composables/useColorPicker.js +1 -1
  34. package/dist/Components/DataTable/DataTable.vue.d.ts +1 -1
  35. package/dist/Components/DataTable/composables/useDataTable.d.ts +1 -1
  36. package/dist/Components/DataTable/composables/useDataTable.js +288 -282
  37. package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
  38. package/dist/Components/Drawer/composables/useDrawer.js +2 -2
  39. package/dist/Components/FileUpload/FileUpload.js +5 -0
  40. package/dist/Components/FileUpload/FileUpload.vue.d.ts +28 -0
  41. package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +132 -0
  42. package/dist/Components/FileUpload/composables/useFileUpload.d.ts +70 -0
  43. package/dist/Components/FileUpload/composables/useFileUpload.js +210 -0
  44. package/dist/Components/FileUpload/fileUpload.types.d.ts +306 -0
  45. package/dist/Components/FileUpload/index.d.ts +3 -0
  46. package/dist/Components/FileUpload/index.js +3 -0
  47. package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
  48. package/dist/Components/Link/Link.vue.d.ts +17 -8
  49. package/dist/Components/Link/Link.vue_vue_type_script_setup_true_lang.js +30 -25
  50. package/dist/Components/Link/composables/useLink.d.ts +8 -6
  51. package/dist/Components/Link/composables/useLink.js +52 -45
  52. package/dist/Components/Link/link.types.d.ts +21 -4
  53. package/dist/Components/ListItem/ListItem.vue.d.ts +17 -15
  54. package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +2 -0
  55. package/dist/Components/ListItem/composables/useListItem.d.ts +7 -6
  56. package/dist/Components/ListItem/composables/useListItem.js +108 -105
  57. package/dist/Components/ListItem/listItem.types.d.ts +19 -3
  58. package/dist/Components/Listbox/composables/useListbox.d.ts +2 -2
  59. package/dist/Components/Menu/composables/useMenu.js +6 -6
  60. package/dist/Components/Modal/composables/useModal.d.ts +1 -1
  61. package/dist/Components/Modal/composables/useModal.js +2 -2
  62. package/dist/Components/RichTextEditor/RichTextEditor.js +5 -0
  63. package/dist/Components/RichTextEditor/RichTextEditor.vue.d.ts +23 -0
  64. package/dist/Components/RichTextEditor/RichTextEditor.vue_vue_type_script_setup_true_lang.js +104 -0
  65. package/dist/Components/RichTextEditor/composables/useRichTextEditor.d.ts +488 -0
  66. package/dist/Components/RichTextEditor/composables/useRichTextEditor.js +226 -0
  67. package/dist/Components/RichTextEditor/index.d.ts +3 -0
  68. package/dist/Components/RichTextEditor/index.js +3 -0
  69. package/dist/Components/RichTextEditor/richTextEditor.types.d.ts +103 -0
  70. package/dist/Components/Select/composables/useSelect.js +2 -2
  71. package/dist/Components/Sidebar/SidebarListItem.vue.d.ts +17 -9
  72. package/dist/Components/Sidebar/SidebarListItem.vue_vue_type_script_setup_true_lang.js +2 -0
  73. package/dist/Components/Sidebar/composables/useSidebarListItem.js +1 -1
  74. package/dist/Components/Sidebar/sidebar.types.d.ts +2 -1
  75. package/dist/Components/Snackbar/composables/useSnackbar.js +1 -1
  76. package/dist/Components/Textarea/composables/useTextarea.js +1 -1
  77. package/dist/Components/Tooltip/composables/useTooltip.js +3 -3
  78. package/dist/Utils/linkAs.d.ts +29 -0
  79. package/dist/Utils/linkAs.js +18 -0
  80. package/dist/augments.d.ts +10 -0
  81. package/dist/index.d.ts +5 -0
  82. package/dist/index.js +175 -170
  83. package/dist/theme.css +3 -0
  84. package/docs/README.md +3 -0
  85. package/docs/components/Breadcrumb.md +16 -0
  86. package/docs/components/BridgeUIProvider.md +18 -1
  87. package/docs/components/Button.md +31 -19
  88. package/docs/components/DataTable.md +1 -1
  89. package/docs/components/FileUpload.md +122 -0
  90. package/docs/components/Link.md +28 -12
  91. package/docs/components/List.md +21 -19
  92. package/docs/components/RichTextEditor.md +88 -0
  93. package/docs/components/Sidebar.md +1 -1
  94. package/package.json +54 -18
@@ -1,18 +1,20 @@
1
1
  import { ListItemOwnProps, ListItemSlots } from './listItem.types';
2
- type __VLS_Slots = ListItemSlots;
3
- declare const __VLS_base: import('vue').DefineComponent<ListItemOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ListItemOwnProps> & Readonly<{}>, {
4
- role: "button" | "option" | "menuitem";
5
- as: "li" | "div";
6
- disabled: boolean;
7
- selected: boolean;
8
- divider: boolean;
9
- interactive: boolean;
10
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
2
+ import { LinkAsTag } from '../../Utils/linkAs';
3
+ declare const __VLS_export: <T extends LinkAsTag = "a">(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<ListItemOwnProps<T>> & (typeof globalThis extends {
5
+ __VLS_PROPS_FALLBACK: infer P;
6
+ } ? P : {});
7
+ expose: (exposed: {}) => void;
8
+ attrs: any;
9
+ slots: ListItemSlots;
10
+ emit: {};
11
+ }>) => import('vue').VNode & {
12
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
13
+ };
12
14
  declare const _default: typeof __VLS_export;
13
15
  export default _default;
14
- type __VLS_WithSlots<T, S> = T & {
15
- new (): {
16
- $slots: S;
17
- };
18
- };
16
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
17
+ [K in keyof T]: T[K];
18
+ } : {
19
+ [K in keyof T as K]: T[K];
20
+ }) & {};
@@ -24,6 +24,8 @@ var C = /*@__PURE__*/ d({
24
24
  type: Boolean,
25
25
  default: !1
26
26
  },
27
+ linkAs: {},
28
+ linkProps: {},
27
29
  primary: {},
28
30
  rel: {},
29
31
  role: { default: "button" },
@@ -2,16 +2,17 @@ import { useSlots } from 'vue';
2
2
  import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
3
3
  import { IconSource } from '../../../Adapters/Icon';
4
4
  import { ListItemOwnProps, ListItemProps } from '../listItem.types';
5
+ import { LinkAsTag } from '../../../Utils/linkAs';
5
6
  type ListItemLibDefaults = LibDefaultsShape<ListItemOwnProps, "role">;
6
- type ListItemMerged = MergeLibDefaults<ListItemOwnProps, ListItemLibDefaults>;
7
- export declare function useListItem(props: ListItemOwnProps, libDefaults: ListItemLibDefaults, slots: ReturnType<typeof useSlots>): {
8
- merged: import('vue').ComputedRef<ListItemMerged>;
7
+ type ListItemMerged<T extends LinkAsTag = "a"> = MergeLibDefaults<ListItemOwnProps<T>, ListItemLibDefaults>;
8
+ export declare function useListItem<T extends LinkAsTag = "a">(props: ListItemOwnProps<T>, libDefaults: ListItemLibDefaults, slots: ReturnType<typeof useSlots>): {
9
+ merged: import('vue').ComputedRef<ListItemMerged<T>>;
9
10
  hasEnd: import('vue').ComputedRef<boolean>;
10
11
  endBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
11
12
  rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
12
13
  class: string;
13
14
  id: string | undefined;
14
- }, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListItemProps, "target" | "role" | "href" | "value" | "classes" | "customProps" | "primary" | "secondary" | "as" | "disabled" | "selected" | "rel" | "dense" | "divider" | "interactive" | "selectedIcon">, never>>>;
15
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListItemProps<T>, "target" | "role" | "href" | "value" | "classes" | "customProps" | "primary" | "secondary" | "as" | "disabled" | "linkAs" | "linkProps" | "selected" | "rel" | "dense" | "divider" | "interactive" | "selectedIcon">, never>>>;
15
16
  rowClass: import('vue').ComputedRef<string>;
16
17
  startBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
17
18
  hasPrimary: import('vue').ComputedRef<boolean>;
@@ -19,13 +20,13 @@ export declare function useListItem(props: ListItemOwnProps, libDefaults: ListIt
19
20
  primaryBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
20
21
  hasSecondary: import('vue').ComputedRef<boolean>;
21
22
  secondaryBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
22
- interactiveTag: import('vue').ComputedRef<"a" | "div">;
23
+ interactiveTag: import('vue').ComputedRef<"a" | "div" | T>;
23
24
  interactiveBind: import('vue').ComputedRef<({
24
25
  "aria-disabled": boolean | undefined;
25
26
  rel: string | undefined;
26
27
  "data-selected": boolean | undefined;
27
28
  "aria-selected": boolean | undefined;
28
- href: string | undefined;
29
+ href: import('../../../Utils/linkAs').LinkHref<T, "a"> | undefined;
29
30
  target: string | undefined;
30
31
  role: NonNullable<"button" | "option" | "menuitem" | undefined> | undefined;
31
32
  onMousedown: ((event: MouseEvent) => void) | undefined;
@@ -1,160 +1,163 @@
1
1
  import { hasNamedSlot as e } from "../../../Utils/slotOrProp.js";
2
2
  import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
3
- import { getListboxOptionId as i } from "../../Listbox/composables/useListboxNavigation.js";
4
- import { LIST_INJECTION_KEY as a } from "../../List/listInjectionKey.js";
5
- import { LISTBOX_INJECTION_KEY as o } from "../../Listbox/listboxInjectionKey.js";
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
- import { get as m, isNil as h, isNull as g, omit as _ } from "es-toolkit/compat";
8
- import { listboxOptionFromComposedItem as v } from "@bridge-ui/core/Domain";
9
- import { cn as y, splitComponentProps as b } from "@bridge-ui/core/Utils";
3
+ import { resolveLinkAsProps as i } from "../../../Utils/linkAs.js";
4
+ import { getListboxOptionId as a } from "../../Listbox/composables/useListboxNavigation.js";
5
+ import { LIST_INJECTION_KEY as o } from "../../List/listInjectionKey.js";
6
+ import { LISTBOX_INJECTION_KEY as s } from "../../Listbox/listboxInjectionKey.js";
7
+ import { computed as c, getCurrentInstance as l, inject as u, onBeforeUnmount as d, toValue as f, useAttrs as p, watch as m } from "vue";
8
+ import { get as h, isNil as g, isNull as _, omit as v } from "es-toolkit/compat";
9
+ import { listboxOptionFromComposedItem as y } from "@bridge-ui/core/Domain";
10
+ import { cn as b, splitComponentProps as x } from "@bridge-ui/core/Utils";
10
11
  //#region src/Components/ListItem/composables/useListItem.ts
11
- var x = [
12
+ var S = [
12
13
  "as",
13
14
  "rel",
14
15
  "href",
15
16
  "role",
16
17
  "dense",
17
18
  "value",
19
+ "linkAs",
18
20
  "target",
19
21
  "classes",
20
22
  "divider",
21
23
  "primary",
22
24
  "disabled",
23
25
  "selected",
26
+ "linkProps",
24
27
  "secondary",
25
28
  "customProps",
26
29
  "interactive",
27
30
  "selectedIcon"
28
31
  ];
29
- function S(S, C, w) {
30
- let T = f(), E = l(a, null), D = l(o, null), O = !h(D), k = s(() => b({
32
+ function C(C, w, T) {
33
+ let E = p(), D = u(o, null), O = u(s, null), k = !g(O), A = c(() => x({
31
34
  props: {
32
- ...T,
33
- ...S
35
+ ...E,
36
+ ...C
34
37
  },
35
- bridgeKeys: x
36
- })), { merged: A, entry: j } = n({
37
- libDefaults: C,
38
+ bridgeKeys: S
39
+ })), { merged: j, entry: M } = n({
40
+ libDefaults: w,
38
41
  componentName: "ListItem",
39
- props: () => k.value.componentProps
40
- }), M = s(() => D ? d(D) : null), N = s(() => O ? v({
41
- value: A.value.value,
42
- primary: A.value.primary,
43
- disabled: A.value.disabled,
44
- secondary: A.value.secondary
45
- }) : null), P;
46
- p(() => {
47
- let e = N.value;
42
+ props: () => A.value.componentProps
43
+ }), N = c(() => O ? f(O) : null), P = c(() => k ? y({
44
+ value: j.value.value,
45
+ primary: j.value.primary,
46
+ disabled: j.value.disabled,
47
+ secondary: j.value.secondary
48
+ }) : null), F;
49
+ m(() => {
50
+ let e = P.value;
48
51
  return e ? `${String(e.value)}:${e.label}:${e.disabled}:${e.description ?? ""}` : null;
49
52
  }, () => {
50
- P?.(), P = void 0;
51
- let e = N.value;
52
- !e || !D || (P = d(D).registerOption(e));
53
- }, { immediate: !0 }), u(() => {
54
- P?.();
53
+ F?.(), F = void 0;
54
+ let e = P.value;
55
+ e && O && (F = f(O).registerOption(e));
56
+ }, { immediate: !0 }), d(() => {
57
+ F?.();
55
58
  });
56
- let F = s(() => !h(N.value)), I = s(() => !N.value || !M.value ? !1 : M.value.isSelected(N.value.value)), L = s(() => !N.value || !M.value ? -1 : M.value.getOptionIndex(N.value.value)), R = s(() => !M.value || L.value < 0 ? !1 : M.value.highlightedIndex === L.value), z = s(() => A.value.customProps), B = r({
57
- entry: j,
58
- props: () => k.value.componentProps
59
- }), V = s(() => "dense" in (c()?.vnode.props ?? {}) ? S.dense === !0 : S.dense === !0 ? !0 : E ? d(E).dense : !1), H = s(() => e(w, "primary") || e(w, "default") || !!A.value.primary), U = s(() => e(w, "secondary") || !!A.value.secondary), W = s(() => F.value ? !I.value || !M.value?.showCheckmark ? null : "check" : !A.value.selected || g(A.value.selectedIcon) ? null : A.value.selectedIcon ?? "check"), G = s(() => e(w, "end") || W.value != null), K = s(() => _(k.value.inheritedAttrs, [])), q = s(() => t(z.value?.root, K.value, {
60
- class: y({
59
+ let I = c(() => !g(P.value)), L = c(() => !P.value || !N.value ? !1 : N.value.isSelected(P.value.value)), R = c(() => !P.value || !N.value ? -1 : N.value.getOptionIndex(P.value.value)), z = c(() => !N.value || R.value < 0 ? !1 : N.value.highlightedIndex === R.value), B = c(() => j.value.customProps), V = r({
60
+ entry: M,
61
+ props: () => A.value.componentProps
62
+ }), H = c(() => "dense" in (l()?.vnode.props ?? {}) ? C.dense === !0 : C.dense === !0 ? !0 : D ? f(D).dense : !1), U = c(() => e(T, "primary") || e(T, "default") || !!j.value.primary), W = c(() => e(T, "secondary") || !!j.value.secondary), G = c(() => I.value ? !L.value || !N.value?.showCheckmark ? null : "check" : !j.value.selected || _(j.value.selectedIcon) ? null : j.value.selectedIcon ?? "check"), K = c(() => e(T, "end") || G.value != null), q = c(() => v(A.value.inheritedAttrs, [])), J = c(() => t(B.value?.root, q.value, {
63
+ class: b({
61
64
  "list-none": !0,
62
- "border-b border-black/10 last:border-b-0 dark:border-white/10": A.value.divider,
63
- [m(B.value, "root") ?? ""]: !0
65
+ "border-b border-black/10 last:border-b-0 dark:border-white/10": j.value.divider,
66
+ [h(V.value, "root") ?? ""]: !0
64
67
  }),
65
- id: F.value && M.value?.listboxId && L.value >= 0 ? i(M.value.listboxId, L.value) : void 0
66
- })), J = s(() => !!A.value.href && !F.value), Y = s(() => !!(A.value.interactive || F.value || J.value)), X = s(() => J.value ? "a" : "div"), Z = s(() => {
67
- if (!Y.value) return null;
68
- let e = t(z.value?.interactive, {}, {
69
- "aria-disabled": A.value.disabled ? !0 : void 0,
70
- rel: J.value && !A.value.disabled ? A.value.rel : void 0,
71
- "data-selected": A.value.selected || I.value ? !0 : void 0,
72
- "aria-selected": F.value ? I.value : void 0,
73
- href: J.value && !A.value.disabled ? A.value.href : void 0,
74
- target: J.value && !A.value.disabled ? A.value.target : void 0,
75
- role: F.value ? "option" : J.value ? void 0 : A.value.role,
76
- onMousedown: F.value ? (e) => {
68
+ id: I.value && N.value?.listboxId && R.value >= 0 ? a(N.value.listboxId, R.value) : void 0
69
+ })), Y = c(() => !!j.value.href && !I.value), X = c(() => !!(j.value.interactive || I.value || Y.value)), Z = c(() => Y.value ? j.value.disabled || j.value.linkAs == null ? "a" : j.value.linkAs : "div"), Q = c(() => {
70
+ if (!X.value) return null;
71
+ let e = t(B.value?.interactive, i(j.value.linkAs, j.value.linkProps, Z.value), {
72
+ "aria-disabled": j.value.disabled ? !0 : void 0,
73
+ rel: Y.value && !j.value.disabled ? j.value.rel : void 0,
74
+ "data-selected": j.value.selected || L.value ? !0 : void 0,
75
+ "aria-selected": I.value ? L.value : void 0,
76
+ href: Y.value && !j.value.disabled ? j.value.href : void 0,
77
+ target: Y.value && !j.value.disabled ? j.value.target : void 0,
78
+ role: I.value ? "option" : Y.value ? void 0 : j.value.role,
79
+ onMousedown: I.value ? (e) => {
77
80
  e.preventDefault();
78
81
  } : void 0,
79
- tabindex: A.value.disabled || F.value ? -1 : J.value ? void 0 : 0,
80
- onClick: F.value ? () => {
81
- N.value && M.value?.onSelect(N.value);
82
+ tabindex: j.value.disabled || I.value ? -1 : Y.value ? void 0 : 0,
83
+ onClick: I.value ? () => {
84
+ P.value && N.value?.onSelect(P.value);
82
85
  } : void 0,
83
- class: y({
86
+ class: b({
84
87
  "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,
85
- "no-underline": J.value,
86
- "cursor-pointer select-none": !A.value.disabled,
87
- "px-2": !F.value,
88
- "py-1.5": !F.value && !V.value,
89
- "py-1": !F.value && V.value,
90
- "hover:bg-black/5 focus-visible:bg-black/5 dark:hover:bg-white/10 dark:focus-visible:bg-white/10": !A.value.disabled && !F.value,
91
- "bg-dark-100 font-medium text-dark-900 dark:bg-white/15 dark:text-white": A.value.selected && !F.value,
92
- [M.value?.optionHoverClass ?? ""]: F.value && !A.value.disabled && !I.value,
93
- [M.value?.mergedClasses.optionHover ?? ""]: F.value && !A.value.disabled && !I.value,
94
- [M.value?.optionSelectedClass ?? ""]: F.value && I.value,
95
- [M.value?.mergedClasses.optionSelected ?? ""]: F.value && I.value,
96
- [M.value?.optionHighlightedClass ?? ""]: F.value && R.value && !I.value,
97
- [M.value?.mergedClasses.optionHighlighted ?? ""]: F.value && R.value && !I.value,
98
- "opacity-50 pointer-events-none": A.value.disabled,
99
- [m(B.value, "interactive") ?? ""]: !0,
100
- [M.value?.sizeClasses?.option ?? ""]: F.value
88
+ "no-underline": Y.value,
89
+ "cursor-pointer select-none": !j.value.disabled,
90
+ "px-2": !I.value,
91
+ "py-1.5": !I.value && !H.value,
92
+ "py-1": !I.value && H.value,
93
+ "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,
94
+ "bg-dark-100 font-medium text-dark-900 dark:bg-white/15 dark:text-white": j.value.selected && !I.value,
95
+ [N.value?.optionHoverClass ?? ""]: I.value && !j.value.disabled && !L.value,
96
+ [N.value?.mergedClasses.optionHover ?? ""]: I.value && !j.value.disabled && !L.value,
97
+ [N.value?.optionSelectedClass ?? ""]: I.value && L.value,
98
+ [N.value?.mergedClasses.optionSelected ?? ""]: I.value && L.value,
99
+ [N.value?.optionHighlightedClass ?? ""]: I.value && z.value && !L.value,
100
+ [N.value?.mergedClasses.optionHighlighted ?? ""]: I.value && z.value && !L.value,
101
+ "opacity-50 pointer-events-none": j.value.disabled,
102
+ [h(V.value, "interactive") ?? ""]: !0,
103
+ [N.value?.sizeClasses?.option ?? ""]: I.value
101
104
  })
102
105
  });
103
- return !J.value || !A.value.disabled ? e : {
106
+ return !Y.value || !j.value.disabled ? e : {
104
107
  ...e,
105
108
  rel: void 0,
106
109
  href: void 0,
107
110
  target: void 0
108
111
  };
109
- }), Q = s(() => y({
112
+ }), $ = c(() => b({
110
113
  "flex w-full min-w-0 items-center gap-x-2": !0,
111
- "rounded-md text-dark-900 dark:text-dark-100": !Y.value,
112
- "px-2": !Y.value,
113
- "py-1.5": !Y.value && !V.value,
114
- "py-1": !Y.value && V.value
115
- })), $ = s(() => t(z.value?.start, {}, y({
114
+ "rounded-md text-dark-900 dark:text-dark-100": !X.value,
115
+ "px-2": !X.value,
116
+ "py-1.5": !X.value && !H.value,
117
+ "py-1": !X.value && H.value
118
+ })), ee = c(() => t(B.value?.start, {}, b({
116
119
  "flex shrink-0 items-center text-dark-600 dark:text-dark-300": !0,
117
- [m(B.value, "start") ?? ""]: !0
118
- }))), ee = s(() => t(z.value?.content, {}, y({
120
+ [h(V.value, "start") ?? ""]: !0
121
+ }))), te = c(() => t(B.value?.content, {}, b({
119
122
  "min-w-0 flex-1": !0,
120
- [m(B.value, "content") ?? ""]: !0
121
- }))), te = s(() => t(z.value?.primary, {}, y({
123
+ [h(V.value, "content") ?? ""]: !0
124
+ }))), ne = c(() => t(B.value?.primary, {}, b({
122
125
  "block truncate text-sm font-medium": !0,
123
- [M.value?.sizeClasses?.primary ?? ""]: F.value,
124
- [m(B.value, "primary") ?? ""]: !0,
126
+ [N.value?.sizeClasses?.primary ?? ""]: I.value,
127
+ [h(V.value, "primary") ?? ""]: !0,
125
128
  "leading-normal": !0
126
- }))), ne = s(() => t(z.value?.secondary, {}, y({
129
+ }))), re = c(() => t(B.value?.secondary, {}, b({
127
130
  "mt-0.5 block truncate text-xs leading-normal text-dark-500 dark:text-dark-400": !0,
128
- [M.value?.sizeClasses?.secondary ?? ""]: F.value,
129
- [m(B.value, "secondary") ?? ""]: !0
131
+ [N.value?.sizeClasses?.secondary ?? ""]: I.value,
132
+ [h(V.value, "secondary") ?? ""]: !0
130
133
  })));
131
134
  return {
132
- merged: A,
133
- hasEnd: G,
134
- endBind: s(() => t(z.value?.end, {}, y({
135
+ merged: j,
136
+ hasEnd: K,
137
+ endBind: c(() => t(B.value?.end, {}, b({
135
138
  "ml-auto flex shrink-0 items-center": !0,
136
- [m(B.value, "end") ?? ""]: !0
139
+ [h(V.value, "end") ?? ""]: !0
137
140
  }))),
138
- rootBind: q,
139
- rowClass: Q,
140
- startBind: $,
141
- hasPrimary: H,
142
- contentBind: ee,
143
- primaryBind: te,
144
- hasSecondary: U,
145
- secondaryBind: ne,
146
- interactiveTag: X,
147
- interactiveBind: Z,
148
- selectedIconBind: s(() => t(z.value?.selectedIcon, {}, {
149
- ...F.value ? {} : { size: "sm" },
150
- class: y({
141
+ rootBind: J,
142
+ rowClass: $,
143
+ startBind: ee,
144
+ hasPrimary: U,
145
+ contentBind: te,
146
+ primaryBind: ne,
147
+ hasSecondary: W,
148
+ secondaryBind: re,
149
+ interactiveTag: Z,
150
+ interactiveBind: Q,
151
+ selectedIconBind: c(() => t(B.value?.selectedIcon, {}, {
152
+ ...I.value ? {} : { size: "sm" },
153
+ class: b({
151
154
  "block shrink-0": !0,
152
- [M.value?.checkClass ?? ""]: F.value,
153
- [m(B.value, "selectedIcon") ?? ""]: !0
155
+ [N.value?.checkClass ?? ""]: I.value,
156
+ [h(V.value, "selectedIcon") ?? ""]: !0
154
157
  })
155
158
  })),
156
- resolvedSelectedIcon: W
159
+ resolvedSelectedIcon: G
157
160
  };
158
161
  }
159
162
  //#endregion
160
- export { S as useListItem };
163
+ 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 { LinkAsTag, LinkHref, LinkPropsOf } from '../../Utils/linkAs';
6
7
  export interface ListItemClasses {
7
8
  /**
8
9
  * The classes to apply to the main content column.
@@ -75,7 +76,7 @@ export interface ListItemCustomProps {
75
76
  * List row. Set `interactive` for clickable rows, or `href` for a link.
76
77
  * Use `role="menuitem"` inside menus or `role="option"` in selects.
77
78
  */
78
- export interface ListItemOwnProps {
79
+ export interface ListItemOwnProps<T extends LinkAsTag = "a"> {
79
80
  /**
80
81
  * The element to render as.
81
82
  *
@@ -115,10 +116,11 @@ export interface ListItemOwnProps {
115
116
  /**
116
117
  * URL for the interactive wrapper. Renders an anchor so hover shows the
117
118
  * address and middle-click opens a new tab.
119
+ * When `linkAs` is set, this also accepts that component's `href`.
118
120
  *
119
121
  * @default undefined
120
122
  */
121
- href?: string;
123
+ href?: LinkHref<T, "a">;
122
124
  /**
123
125
  * When true, applies hover/focus styles and `tabIndex={0}` on the inner wrapper.
124
126
  * Implied when `href` is set.
@@ -126,6 +128,20 @@ export interface ListItemOwnProps {
126
128
  * @default false
127
129
  */
128
130
  interactive?: boolean;
131
+ /**
132
+ * Component rendered in place of the interactive `<a>`.
133
+ * The root stays `as` (`li` or `div`). Ignored while disabled.
134
+ *
135
+ * @default undefined
136
+ */
137
+ linkAs?: T;
138
+ /**
139
+ * Props forwarded to `linkAs` (`method`, `replace`, `prefetch`, and so on).
140
+ * Checked against that component. Ignored while `linkAs` is not rendered.
141
+ *
142
+ * @default undefined
143
+ */
144
+ linkProps?: LinkPropsOf<T, "a">;
129
145
  /**
130
146
  * Primary label text.
131
147
  *
@@ -199,4 +215,4 @@ export interface ListItemSlots {
199
215
  */
200
216
  start?: Slot<undefined>;
201
217
  }
202
- export type ListItemProps = MergeHtmlProps<ListItemOwnProps, HTMLAttributes>;
218
+ export type ListItemProps<T extends LinkAsTag = "a"> = MergeHtmlProps<ListItemOwnProps<T>, HTMLAttributes>;
@@ -13,9 +13,9 @@ export declare function useListbox(props: ListboxOwnProps, libDefaults: ListboxL
13
13
  surfaceBind: import('vue').ComputedRef<string>;
14
14
  sizeClasses: import('vue').ComputedRef<import('@bridge-ui/core/Tokens').ListboxSizeOverlayItem | undefined>;
15
15
  mergedClasses: import('vue').ComputedRef<Partial<ListboxClasses>>;
16
- applyButtonProps: import('vue').ComputedRef<Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<Omit<import('../../Button').ButtonOwnProps, "as">, import('vue').ButtonHTMLAttributes>> | undefined>;
16
+ applyButtonProps: import('vue').ComputedRef<Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<Omit<import('../../Button').ButtonOwnProps<"button">, "as">, import('vue').ButtonHTMLAttributes>> | undefined>;
17
17
  optionHoverClass: import('vue').ComputedRef<any>;
18
- cancelButtonProps: import('vue').ComputedRef<Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<Omit<import('../../Button').ButtonOwnProps, "as">, import('vue').ButtonHTMLAttributes>> | undefined>;
18
+ cancelButtonProps: import('vue').ComputedRef<Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<Omit<import('../../Button').ButtonOwnProps<"button">, "as">, import('vue').ButtonHTMLAttributes>> | undefined>;
19
19
  optionSelectedClass: import('vue').ComputedRef<any>;
20
20
  optionHighlightedClass: import('vue').ComputedRef<any>;
21
21
  };
@@ -61,7 +61,7 @@ function _(_, de, v = {}) {
61
61
  return !(e instanceof Element) || K(e) || w.value?.contains(e) ? !1 : !!e.closest("[aria-haspopup=\"menu\"], button, [role=\"button\"]");
62
62
  }
63
63
  function q() {
64
- !H.value || !N.value || P(!1);
64
+ H.value && N.value && P(!1);
65
65
  }
66
66
  function he() {
67
67
  I.value.persistent && N.value || P(!N.value);
@@ -95,7 +95,7 @@ function _(_, de, v = {}) {
95
95
  function Y() {
96
96
  J();
97
97
  let e = W(), t = w.value;
98
- !N.value || !e || !t || (O = ie({
98
+ N.value && e && t && (O = ie({
99
99
  floating: t,
100
100
  reference: e,
101
101
  offset: I.value.offset,
@@ -103,14 +103,14 @@ function _(_, de, v = {}) {
103
103
  placement: I.value.placement,
104
104
  matchWidth: I.value.matchWidth === !0,
105
105
  onReferenceHidden: () => {
106
- !j || !H.value || !N.value || q();
106
+ j && H.value && N.value && q();
107
107
  }
108
108
  }), O.start(), a(() => {
109
109
  j = !0;
110
110
  }));
111
111
  }
112
112
  function X() {
113
- !N.value || I.value.disableAutoFocus || !w.value || h(w.value).focusFirst();
113
+ N.value && !I.value.disableAutoFocus && w.value && h(w.value).focusFirst();
114
114
  }
115
115
  function ve() {
116
116
  if (k?.(), !N.value) {
@@ -119,7 +119,7 @@ function _(_, de, v = {}) {
119
119
  }
120
120
  function e(e) {
121
121
  let t = e.target;
122
- K(t) || w.value?.contains(t) || I.value.closeOnClickAway === !1 || !H.value || me(t) || q();
122
+ K(t) || w.value?.contains(t) || I.value.closeOnClickAway !== !1 && H.value && (me(t) || q());
123
123
  }
124
124
  document.addEventListener("pointerdown", e, !0), k = () => {
125
125
  document.removeEventListener("pointerdown", e, !0);
@@ -141,7 +141,7 @@ function _(_, de, v = {}) {
141
141
  }));
142
142
  }
143
143
  function xe() {
144
- !N.value || I.value.closeOnEscape === !1 || !H.value || (q(), G());
144
+ N.value && I.value.closeOnEscape !== !1 && H.value && (q(), G());
145
145
  }
146
146
  function Q() {
147
147
  let e = se(S.value);
@@ -34,7 +34,7 @@ export declare function useModal(props: ModalOwnProps, libDefaults: ModalLibDefa
34
34
  };
35
35
  "aria-hidden": boolean | undefined;
36
36
  class: string;
37
- }, "class", import('vue').HTMLAttributes | undefined, Omit<ModalProps, "size" | "classes" | "customProps" | "scroll" | "autoFocus" | "blur" | "closeOnEscape" | "closeOnOverlay" | "disableEnforceFocus" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "persistent" | "stackId" | "teleportTo" | "transition" | "align">>>;
37
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<ModalProps, "size" | "classes" | "customProps" | "transition" | "scroll" | "autoFocus" | "blur" | "closeOnEscape" | "closeOnOverlay" | "disableEnforceFocus" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "persistent" | "stackId" | "teleportTo" | "align">>>;
38
38
  panelBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
39
39
  "data-modal-part": string;
40
40
  "data-state": "open" | "closed";
@@ -146,13 +146,13 @@ function y(y, pe, b = {}) {
146
146
  }
147
147
  }
148
148
  function Z() {
149
- I.value.closeOnOverlay === !1 || !W.value || X();
149
+ I.value.closeOnOverlay !== !1 && W.value && X();
150
150
  }
151
151
  function Q(e) {
152
152
  le(e) && Z();
153
153
  }
154
154
  function De() {
155
- !N.value || I.value.closeOnEscape === !1 || !W.value || X();
155
+ N.value && I.value.closeOnEscape !== !1 && W.value && X();
156
156
  }
157
157
  o(N, (e) => {
158
158
  if (e) {
@@ -0,0 +1,5 @@
1
+ import e from "./RichTextEditor.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/Components/RichTextEditor/RichTextEditor.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,23 @@
1
+ import { RichTextValue } from '@bridge-ui/core/Adapters';
2
+ import { RichTextEditorOwnProps, RichTextEditorSlots } from './richTextEditor.types';
3
+ type __VLS_Slots = RichTextEditorSlots;
4
+ type __VLS_Props = RichTextEditorOwnProps;
5
+ type __VLS_ModelProps = {
6
+ modelValue?: RichTextValue;
7
+ };
8
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ "update:modelValue": (...args: unknown[]) => any;
11
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
+ "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
13
+ }>, {
14
+ showErrorIcon: boolean;
15
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
19
+ type __VLS_WithSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };