@bridge-ui/vue 0.11.0 → 0.13.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 (131) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +2 -1
  2. package/dist/Adapters/Examples/date-moment.js +31 -31
  3. package/dist/Adapters/Examples/i18n-dictionary.js +14 -0
  4. package/dist/Adapters/Examples/icon-fontawesome.js +53 -40
  5. package/dist/Adapters/Examples/icon-heroicons.js +46 -33
  6. package/dist/Adapters/Examples/icon-lucide.js +47 -34
  7. package/dist/Adapters/Examples/icon-phosphor.js +48 -35
  8. package/dist/Adapters/Examples/icon-tabler.js +45 -32
  9. package/dist/Adapters/Examples/rich-text-tiptap.d.ts +5 -0
  10. package/dist/Adapters/Examples/rich-text-tiptap.js +138 -0
  11. package/dist/Adapters/RichText/index.d.ts +1 -0
  12. package/dist/Adapters/RichText/index.js +2 -0
  13. package/dist/Adapters/RichText/mockRichTextAdapter.d.ts +5 -0
  14. package/dist/Adapters/RichText/useRichTextAdapter.d.ts +12 -0
  15. package/dist/Adapters/RichText/useRichTextAdapter.js +13 -0
  16. package/dist/Adapters/index.d.ts +1 -0
  17. package/dist/Adapters/index.js +2 -1
  18. package/dist/Components/ActionFooter/composables/useActionFooter.d.ts +6 -6
  19. package/dist/Components/Autocomplete/composables/useAutocomplete.js +2 -2
  20. package/dist/Components/BaseField/composables/useBaseField.d.ts +3 -3
  21. package/dist/Components/BaseField/composables/useBaseField.js +7 -7
  22. package/dist/Components/Breadcrumb/Breadcrumb.vue.d.ts +17 -10
  23. package/dist/Components/Breadcrumb/Breadcrumb.vue_vue_type_script_setup_true_lang.js +7 -2
  24. package/dist/Components/Breadcrumb/breadcrumb.types.d.ts +22 -4
  25. package/dist/Components/Breadcrumb/breadcrumbInjectionKey.d.ts +5 -1
  26. package/dist/Components/Breadcrumb/composables/useBreadcrumb.d.ts +6 -5
  27. package/dist/Components/Breadcrumb/composables/useBreadcrumb.js +2 -0
  28. package/dist/Components/BreadcrumbItem/BreadcrumbItem.vue.d.ts +17 -11
  29. package/dist/Components/BreadcrumbItem/BreadcrumbItem.vue_vue_type_script_setup_true_lang.js +2 -0
  30. package/dist/Components/BreadcrumbItem/breadcrumbItem.types.d.ts +21 -3
  31. package/dist/Components/BreadcrumbItem/composables/useBreadcrumbItem.d.ts +10 -6
  32. package/dist/Components/BreadcrumbItem/composables/useBreadcrumbItem.js +65 -59
  33. package/dist/Components/Button/Button.vue.d.ts +17 -8
  34. package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +10 -10
  35. package/dist/Components/Button/button.types.d.ts +22 -5
  36. package/dist/Components/Button/composables/useButton.d.ts +198 -8
  37. package/dist/Components/Button/composables/useButton.js +101 -86
  38. package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +8 -8
  39. package/dist/Components/Carousel/Carousel.js +5 -0
  40. package/dist/Components/Carousel/Carousel.vue.d.ts +22 -0
  41. package/dist/Components/Carousel/Carousel.vue_vue_type_script_setup_true_lang.js +49 -0
  42. package/dist/Components/Carousel/carousel.types.d.ts +236 -0
  43. package/dist/Components/Carousel/carouselInjectionKey.d.ts +48 -0
  44. package/dist/Components/Carousel/carouselInjectionKey.js +4 -0
  45. package/dist/Components/Carousel/composables/useCarousel.d.ts +91 -0
  46. package/dist/Components/Carousel/composables/useCarousel.js +331 -0
  47. package/dist/Components/Carousel/index.d.ts +4 -0
  48. package/dist/Components/Carousel/index.js +4 -0
  49. package/dist/Components/CarouselSlide/CarouselSlide.js +5 -0
  50. package/dist/Components/CarouselSlide/CarouselSlide.vue.d.ts +11 -0
  51. package/dist/Components/CarouselSlide/CarouselSlide.vue_vue_type_script_setup_true_lang.js +17 -0
  52. package/dist/Components/CarouselSlide/carouselSlide.types.d.ts +40 -0
  53. package/dist/Components/CarouselSlide/composables/useCarouselSlide.d.ts +205 -0
  54. package/dist/Components/CarouselSlide/composables/useCarouselSlide.js +79 -0
  55. package/dist/Components/CarouselSlide/index.d.ts +3 -0
  56. package/dist/Components/CarouselSlide/index.js +3 -0
  57. package/dist/Components/ColorPicker/composables/useColorPicker.js +1 -1
  58. package/dist/Components/DataTable/DataTable.vue.d.ts +1 -1
  59. package/dist/Components/DataTable/composables/useDataTable.d.ts +1 -1
  60. package/dist/Components/DataTable/composables/useDataTable.js +288 -282
  61. package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
  62. package/dist/Components/Drawer/composables/useDrawer.js +2 -2
  63. package/dist/Components/FileUpload/FileUpload.js +5 -0
  64. package/dist/Components/FileUpload/FileUpload.vue.d.ts +26 -0
  65. package/dist/Components/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +141 -0
  66. package/dist/Components/FileUpload/composables/useFileUpload.d.ts +120 -0
  67. package/dist/Components/FileUpload/composables/useFileUpload.js +235 -0
  68. package/dist/Components/FileUpload/fileUpload.types.d.ts +396 -0
  69. package/dist/Components/FileUpload/fileUploadInjectionKey.d.ts +61 -0
  70. package/dist/Components/FileUpload/fileUploadInjectionKey.js +4 -0
  71. package/dist/Components/FileUpload/index.d.ts +3 -0
  72. package/dist/Components/FileUpload/index.js +3 -0
  73. package/dist/Components/FileUploadItem/FileUploadItem.js +5 -0
  74. package/dist/Components/FileUploadItem/FileUploadItem.vue.d.ts +12 -0
  75. package/dist/Components/FileUploadItem/FileUploadItem.vue_vue_type_script_setup_true_lang.js +83 -0
  76. package/dist/Components/FileUploadItem/composables/useFileUploadItem.d.ts +1153 -0
  77. package/dist/Components/FileUploadItem/composables/useFileUploadItem.js +94 -0
  78. package/dist/Components/FileUploadItem/fileUploadItem.types.d.ts +20 -0
  79. package/dist/Components/FileUploadItem/index.d.ts +3 -0
  80. package/dist/Components/FileUploadItem/index.js +3 -0
  81. package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
  82. package/dist/Components/Link/Link.vue.d.ts +17 -8
  83. package/dist/Components/Link/Link.vue_vue_type_script_setup_true_lang.js +30 -25
  84. package/dist/Components/Link/composables/useLink.d.ts +8 -6
  85. package/dist/Components/Link/composables/useLink.js +52 -45
  86. package/dist/Components/Link/link.types.d.ts +21 -4
  87. package/dist/Components/ListItem/ListItem.vue.d.ts +17 -15
  88. package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +2 -0
  89. package/dist/Components/ListItem/composables/useListItem.d.ts +7 -6
  90. package/dist/Components/ListItem/composables/useListItem.js +108 -105
  91. package/dist/Components/ListItem/listItem.types.d.ts +19 -3
  92. package/dist/Components/Listbox/composables/useListbox.d.ts +2 -2
  93. package/dist/Components/Menu/composables/useMenu.js +6 -6
  94. package/dist/Components/Modal/composables/useModal.d.ts +1 -1
  95. package/dist/Components/Modal/composables/useModal.js +2 -2
  96. package/dist/Components/Pagination/composables/usePagination.d.ts +1 -1
  97. package/dist/Components/RichTextEditor/RichTextEditor.js +5 -0
  98. package/dist/Components/RichTextEditor/RichTextEditor.vue.d.ts +23 -0
  99. package/dist/Components/RichTextEditor/RichTextEditor.vue_vue_type_script_setup_true_lang.js +104 -0
  100. package/dist/Components/RichTextEditor/composables/useRichTextEditor.d.ts +488 -0
  101. package/dist/Components/RichTextEditor/composables/useRichTextEditor.js +226 -0
  102. package/dist/Components/RichTextEditor/index.d.ts +3 -0
  103. package/dist/Components/RichTextEditor/index.js +3 -0
  104. package/dist/Components/RichTextEditor/richTextEditor.types.d.ts +103 -0
  105. package/dist/Components/Select/composables/useSelect.js +2 -2
  106. package/dist/Components/Sidebar/SidebarListItem.vue.d.ts +17 -9
  107. package/dist/Components/Sidebar/SidebarListItem.vue_vue_type_script_setup_true_lang.js +2 -0
  108. package/dist/Components/Sidebar/composables/useSidebarListItem.js +1 -1
  109. package/dist/Components/Sidebar/composables/useSidebarTrigger.d.ts +1 -1
  110. package/dist/Components/Sidebar/sidebar.types.d.ts +2 -1
  111. package/dist/Components/Snackbar/composables/useSnackbar.js +1 -1
  112. package/dist/Components/Textarea/composables/useTextarea.js +1 -1
  113. package/dist/Components/Tooltip/composables/useTooltip.js +3 -3
  114. package/dist/Utils/linkAs.d.ts +29 -0
  115. package/dist/Utils/linkAs.js +18 -0
  116. package/dist/augments.d.ts +19 -0
  117. package/dist/index.d.ts +11 -0
  118. package/dist/index.js +181 -170
  119. package/dist/theme.css +3 -0
  120. package/docs/README.md +4 -0
  121. package/docs/components/Breadcrumb.md +16 -0
  122. package/docs/components/BridgeUIProvider.md +18 -1
  123. package/docs/components/Button.md +31 -19
  124. package/docs/components/Carousel.md +113 -0
  125. package/docs/components/DataTable.md +1 -1
  126. package/docs/components/FileUpload.md +197 -0
  127. package/docs/components/Link.md +28 -12
  128. package/docs/components/List.md +21 -19
  129. package/docs/components/RichTextEditor.md +88 -0
  130. package/docs/components/Sidebar.md +1 -1
  131. package/package.json +54 -18
@@ -1,42 +1,55 @@
1
1
  import { get as e } from "es-toolkit/compat";
2
- import { IconAlertCircle as t, IconAlertTriangle as n, IconBell as r, IconCalendarMonth as i, IconCheck as a, IconChevronDown as o, IconChevronLeft as s, IconChevronRight as c, IconChevronUp as l, IconChevronsLeft as u, IconChevronsRight as d, IconCircleCheck as f, IconCircleX as p, IconClock as m, IconColumns3 as h, IconDownload as g, IconEye as _, IconEyeOff as v, IconFilter as y, IconInbox as b, IconInfoCircle as x, IconLayoutSidebar as S, IconLoader2 as C, IconMinus as w, IconPalette as T, IconPlus as E, IconSearch as D, IconSelector as O, IconUser as k, IconX as A } from "@tabler/icons-vue";
2
+ import { IconAlertCircle as t, IconAlertTriangle as n, IconBell as r, IconBold as i, IconCalendarMonth as a, IconCheck as o, IconChevronDown as s, IconChevronLeft as c, IconChevronRight as l, IconChevronUp as u, IconChevronsLeft as d, IconChevronsRight as f, IconCircleCheck as p, IconCircleX as m, IconClock as h, IconCode as g, IconColumns3 as _, IconDownload as v, IconEye as y, IconEyeOff as b, IconFilter as x, IconH1 as S, IconH2 as C, IconH3 as w, IconInbox as T, IconInfoCircle as E, IconItalic as D, IconLayoutSidebar as O, IconLink as k, IconList as A, IconListNumbers as j, IconLoader2 as M, IconMinus as N, IconPalette as P, IconPlus as F, IconQuote as I, IconReload as L, IconSearch as R, IconSelector as z, IconStrikethrough as B, IconUnderline as V, IconUser as H, IconX as U } from "@tabler/icons-vue";
3
3
  //#region src/Adapters/Examples/icon-tabler.ts
4
- var j = {
5
- eye: _,
6
- clear: A,
4
+ var W = {
5
+ eye: y,
6
+ clear: U,
7
7
  bell: r,
8
- user: k,
9
- plus: E,
10
- inbox: b,
11
- check: a,
12
- clock: m,
13
- minus: w,
14
- error: p,
15
- eyeOff: v,
16
- filter: y,
17
- search: D,
18
- loader: C,
19
- info: x,
20
- palette: T,
21
- columns: h,
8
+ bold: i,
9
+ code: g,
10
+ link: k,
11
+ list: A,
12
+ user: H,
13
+ plus: F,
14
+ inbox: T,
15
+ check: o,
16
+ clock: h,
17
+ minus: N,
18
+ quote: I,
19
+ heading1: S,
20
+ heading2: C,
21
+ heading3: w,
22
+ error: m,
23
+ eyeOff: b,
24
+ filter: x,
25
+ italic: D,
26
+ search: R,
27
+ loader: M,
28
+ refresh: L,
29
+ info: E,
30
+ palette: P,
31
+ columns: _,
22
32
  alert: t,
23
- download: g,
24
- success: f,
25
- chevronUp: l,
33
+ download: v,
34
+ success: p,
35
+ chevronUp: u,
36
+ underline: V,
26
37
  warning: n,
27
- chevronUpDown: O,
28
- calendar: i,
29
- panelLeft: S,
30
- chevronDown: o,
31
- chevronLeft: s,
32
- chevronRight: c,
33
- chevronsLeft: u,
34
- chevronsRight: d
38
+ chevronUpDown: z,
39
+ calendar: a,
40
+ panelLeft: O,
41
+ chevronDown: s,
42
+ chevronLeft: c,
43
+ listOrdered: j,
44
+ chevronRight: l,
45
+ chevronsLeft: d,
46
+ strikethrough: B,
47
+ chevronsRight: f
35
48
  };
36
- function M() {
49
+ function G() {
37
50
  return { resolve(t) {
38
- return e(j, t);
51
+ return e(W, t);
39
52
  } };
40
53
  }
41
54
  //#endregion
42
- export { M as createTablerIconAdapter };
55
+ export { G as createTablerIconAdapter };
@@ -0,0 +1,5 @@
1
+ import { RichTextEditorAdapter } from '@bridge-ui/core/Adapters';
2
+ /**
3
+ * Creates a TipTap-backed {@link RichTextEditorAdapter} for Bridge UI.
4
+ */
5
+ export declare function createTiptapRichTextAdapter(): RichTextEditorAdapter;
@@ -0,0 +1,138 @@
1
+ import { applyRichTextEditableA11y as e } from "@bridge-ui/core/Adapters";
2
+ import { get as t, isNil as n, isString as r } from "es-toolkit/compat";
3
+ import { Editor as i } from "@tiptap/core";
4
+ import a from "@tiptap/extension-link";
5
+ import o from "@tiptap/extension-placeholder";
6
+ import s from "@tiptap/extension-underline";
7
+ import c from "@tiptap/starter-kit";
8
+ //#region src/Adapters/Examples/rich-text-tiptap.ts
9
+ var l = [
10
+ "flex-1",
11
+ "outline-none",
12
+ "[&_p.is-editor-empty:first-child::before]:h-0",
13
+ "[&_p.is-editor-empty:first-child::before]:float-left",
14
+ "[&_p.is-editor-empty:first-child::before]:text-dark-400",
15
+ "[&_p.is-editor-empty:first-child::before]:pointer-events-none",
16
+ "[&_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]"
17
+ ].join(" ");
18
+ function u(e, t) {
19
+ return t === "json" ? e.getJSON() : e.getHTML();
20
+ }
21
+ function d(e, t) {
22
+ let r = e.extensionManager.extensions.find((e) => e.name === "placeholder");
23
+ n(r) || r.options.placeholder === t || (r.options.placeholder = t, e.view.dispatch(e.state.tr));
24
+ }
25
+ var f = {
26
+ bold: (e) => e.isActive("bold"),
27
+ link: (e) => e.isActive("link"),
28
+ italic: (e) => e.isActive("italic"),
29
+ strike: (e) => e.isActive("strike"),
30
+ codeBlock: (e) => e.isActive("codeBlock"),
31
+ underline: (e) => e.isActive("underline"),
32
+ blockquote: (e) => e.isActive("blockquote"),
33
+ bulletList: (e) => e.isActive("bulletList"),
34
+ orderedList: (e) => e.isActive("orderedList"),
35
+ heading1: (e) => e.isActive("heading", { level: 1 }),
36
+ heading2: (e) => e.isActive("heading", { level: 2 }),
37
+ heading3: (e) => e.isActive("heading", { level: 3 })
38
+ }, p = {
39
+ link: () => !0,
40
+ bold: (e) => e.can().toggleBold(),
41
+ italic: (e) => e.can().toggleItalic(),
42
+ strike: (e) => e.can().toggleStrike(),
43
+ codeBlock: (e) => e.can().toggleCodeBlock(),
44
+ underline: (e) => e.can().toggleUnderline(),
45
+ blockquote: (e) => e.can().toggleBlockquote(),
46
+ bulletList: (e) => e.can().toggleBulletList(),
47
+ orderedList: (e) => e.can().toggleOrderedList(),
48
+ heading1: (e) => e.can().toggleHeading({ level: 1 }),
49
+ heading2: (e) => e.can().toggleHeading({ level: 2 }),
50
+ heading3: (e) => e.can().toggleHeading({ level: 3 })
51
+ }, m = {
52
+ bold: (e) => e.chain().focus().toggleBold().run(),
53
+ italic: (e) => e.chain().focus().toggleItalic().run(),
54
+ strike: (e) => e.chain().focus().toggleStrike().run(),
55
+ codeBlock: (e) => e.chain().focus().toggleCodeBlock().run(),
56
+ underline: (e) => e.chain().focus().toggleUnderline().run(),
57
+ blockquote: (e) => e.chain().focus().toggleBlockquote().run(),
58
+ bulletList: (e) => e.chain().focus().toggleBulletList().run(),
59
+ orderedList: (e) => e.chain().focus().toggleOrderedList().run(),
60
+ heading1: (e) => e.chain().focus().toggleHeading({ level: 1 }).run(),
61
+ heading2: (e) => e.chain().focus().toggleHeading({ level: 2 }).run(),
62
+ heading3: (e) => e.chain().focus().toggleHeading({ level: 3 }).run(),
63
+ link: (e, t) => {
64
+ if (!n(t?.href) && t.href.length > 0) {
65
+ e.chain().focus().extendMarkRange("link").setLink({ href: t.href }).run();
66
+ return;
67
+ }
68
+ e.isActive("link") && e.chain().focus().unsetLink().run();
69
+ }
70
+ };
71
+ function h(e, n) {
72
+ return t(f, n, () => !1)(e);
73
+ }
74
+ function g(e, n) {
75
+ return t(p, n, () => !1)(e);
76
+ }
77
+ function _(e, n, r) {
78
+ t(m, n, () => void 0)(e, r);
79
+ }
80
+ function v() {
81
+ return { mount(t) {
82
+ let n = t.disabled === !0, f = t.readOnly === !0, p = !1, m = new i({
83
+ autofocus: !1,
84
+ element: t.element,
85
+ editable: !n && !f,
86
+ onSelectionUpdate: () => {
87
+ t.onSelectionChange?.();
88
+ },
89
+ editorProps: { attributes: { class: l } },
90
+ onUpdate: ({ editor: e }) => {
91
+ t.onChange(u(e, t.format));
92
+ },
93
+ content: t.value ?? (t.format === "json" ? {
94
+ type: "doc",
95
+ content: []
96
+ } : ""),
97
+ extensions: [
98
+ c,
99
+ s,
100
+ a.configure({ openOnClick: !1 }),
101
+ o.configure({ placeholder: t.placeholder ?? "" })
102
+ ]
103
+ });
104
+ return e(m.view.dom, t), {
105
+ getValue: () => u(m, t.format),
106
+ blur: () => {
107
+ p || m.commands.blur();
108
+ },
109
+ focus: () => {
110
+ p || m.commands.focus();
111
+ },
112
+ isActive: (e) => !p && h(m, e),
113
+ destroy: () => {
114
+ p || (p = !0, m.destroy());
115
+ },
116
+ can: (e) => p || n || f ? !1 : g(m, e),
117
+ setDisabled: (e) => {
118
+ p || (n = e, m.setEditable(!n && !f, !1));
119
+ },
120
+ setReadOnly: (e) => {
121
+ p || (f = e, m.setEditable(!n && !f, !1));
122
+ },
123
+ run: (e, t) => {
124
+ p || n || f || _(m, e, t);
125
+ },
126
+ setA11y: (t) => {
127
+ p || (e(m.view.dom, t), d(m, t.placeholder ?? ""));
128
+ },
129
+ setValue: (e) => {
130
+ if (p) return;
131
+ let n = t.format === "html" ? r(e) ? e : "" : e;
132
+ m.commands.setContent(n, { emitUpdate: !1 });
133
+ }
134
+ };
135
+ } };
136
+ }
137
+ //#endregion
138
+ export { v as createTiptapRichTextAdapter };
@@ -0,0 +1 @@
1
+ export { setRichTextAdapterForTests, useRichTextAdapter, } from './useRichTextAdapter';
@@ -0,0 +1,2 @@
1
+ import { setRichTextAdapterForTests as e, useRichTextAdapter as t } from "./useRichTextAdapter.js";
2
+ export { e as setRichTextAdapterForTests, t as useRichTextAdapter };
@@ -0,0 +1,5 @@
1
+ import { RichTextEditorAdapter } from '@bridge-ui/core/Adapters';
2
+ /**
3
+ * Creates a lightweight {@link RichTextEditorAdapter} for tests.
4
+ */
5
+ export declare function createMockRichTextAdapter(): RichTextEditorAdapter;
@@ -0,0 +1,12 @@
1
+ import { ComputedRef } from 'vue';
2
+ import { RichTextEditorAdapter } from '@bridge-ui/core/Adapters';
3
+ /**
4
+ * Sets a process-wide rich-text adapter fallback. For tests only.
5
+ */
6
+ export declare function setRichTextAdapterForTests(adapter: undefined | RichTextEditorAdapter): void;
7
+ /**
8
+ * Returns the active rich-text adapter from {@link BridgeUIProvider}.
9
+ * `RichTextEditor` requires `global.richText` (e.g.
10
+ * `@bridge-ui/vue/Adapters/Examples/rich-text-tiptap`).
11
+ */
12
+ export declare function useRichTextAdapter(): ComputedRef<undefined | RichTextEditorAdapter>;
@@ -0,0 +1,13 @@
1
+ import { useBridgeUI as e } from "../../Provider/useBridgeUI.js";
2
+ import { computed as t } from "vue";
3
+ //#region src/Adapters/RichText/useRichTextAdapter.ts
4
+ var n;
5
+ function r(e) {
6
+ n = e;
7
+ }
8
+ function i() {
9
+ let r = e();
10
+ return t(() => r?.global.value.richText ?? n);
11
+ }
12
+ //#endregion
13
+ export { r as setRichTextAdapterForTests, i as useRichTextAdapter };
@@ -2,3 +2,4 @@ export { setDateAdapterForTests, useDateAdapter } from './Date';
2
2
  export { setI18nAdapterForTests, useI18nAdapter, useResolveMessage, } from './I18n';
3
3
  export { setIconAdapterForTests, useIconAdapter } from './Icon';
4
4
  export type { IconElement, IconSource, IconSourceValueOverrides, SemanticIconName, } from './Icon';
5
+ export { setRichTextAdapterForTests, useRichTextAdapter, } from './RichText';
@@ -1,4 +1,5 @@
1
1
  import { setDateAdapterForTests as e, useDateAdapter as t } from "./Date/useDateAdapter.js";
2
2
  import { setI18nAdapterForTests as n, useI18nAdapter as r, useResolveMessage as i } from "./I18n/useI18nAdapter.js";
3
3
  import { setIconAdapterForTests as a, useIconAdapter as o } from "./Icon/useIconAdapter.js";
4
- export { e as setDateAdapterForTests, n as setI18nAdapterForTests, a as setIconAdapterForTests, t as useDateAdapter, r as useI18nAdapter, o as useIconAdapter, i as useResolveMessage };
4
+ import { setRichTextAdapterForTests as s, useRichTextAdapter as c } from "./RichText/useRichTextAdapter.js";
5
+ export { e as setDateAdapterForTests, n as setI18nAdapterForTests, a as setIconAdapterForTests, s as setRichTextAdapterForTests, t as useDateAdapter, r as useI18nAdapter, o as useIconAdapter, i as useResolveMessage, c as useRichTextAdapter };
@@ -9,22 +9,22 @@ export declare function useActionFooter(props: ActionFooterOwnProps, libDefaults
9
9
  applyLabel: import('vue').ComputedRef<string>;
10
10
  cancelLabel: import('vue').ComputedRef<string>;
11
11
  mergedClasses: import('vue').ComputedRef<Partial<ActionFooterClasses>>;
12
- applyButtonBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", (Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<import('../../Button').ButtonOwnProps & {
12
+ applyButtonBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", (Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<import('../../Button').ButtonOwnProps<"button"> & {
13
13
  as: "span";
14
- }, import('vue').HTMLAttributes>> | Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<import('../../Button').ButtonOwnProps & {
14
+ }, import('vue').HTMLAttributes>> | Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<import('../../Button').ButtonOwnProps<"button"> & {
15
15
  as: "a";
16
- }, import('vue').AnchorHTMLAttributes>> | Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<import('../../Button').ButtonOwnProps & {
16
+ }, import('vue').AnchorHTMLAttributes>> | Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<import('../../Button').ButtonOwnProps<"button"> & {
17
17
  as?: "button";
18
18
  }, import('vue').ButtonHTMLAttributes>>) | undefined, {
19
19
  onClick: () => void;
20
20
  color: NonNullable<keyof import('@bridge-ui/core/Tokens').ButtonColor | undefined>;
21
21
  variant: keyof import('@bridge-ui/core/Tokens').ButtonVariant | undefined;
22
22
  }>>;
23
- cancelButtonBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", (Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<import('../../Button').ButtonOwnProps & {
23
+ cancelButtonBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", (Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<import('../../Button').ButtonOwnProps<"button"> & {
24
24
  as: "span";
25
- }, import('vue').HTMLAttributes>> | Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<import('../../Button').ButtonOwnProps & {
25
+ }, import('vue').HTMLAttributes>> | Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<import('../../Button').ButtonOwnProps<"button"> & {
26
26
  as: "a";
27
- }, import('vue').AnchorHTMLAttributes>> | Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<import('../../Button').ButtonOwnProps & {
27
+ }, import('vue').AnchorHTMLAttributes>> | Partial<import('@bridge-ui/core/Utils').MergeHtmlProps<import('../../Button').ButtonOwnProps<"button"> & {
28
28
  as?: "button";
29
29
  }, import('vue').ButtonHTMLAttributes>>) | undefined, {
30
30
  onClick: () => void;
@@ -149,7 +149,7 @@ function m(m, h, g, _, Me) {
149
149
  likeInput: () => M.value,
150
150
  control: () => M.value ? "textarea" : "input"
151
151
  }), nt = a(() => V.value && Ke.value && !m.readonly && !q.isDisabled.value), J = (e) => {
152
- !e || !M.value || De(e);
152
+ e && M.value && De(e);
153
153
  };
154
154
  function rt(e) {
155
155
  return Ge.value.some((t) => f(t, e));
@@ -281,7 +281,7 @@ function m(m, h, g, _, Me) {
281
281
  }
282
282
  async function mt() {
283
283
  let e = k.value.asyncData;
284
- !e?.resolve || R.value.length === 0 || (D.value = Se(await e.resolve(R.value), N.value));
284
+ e?.resolve && R.value.length !== 0 && (D.value = Se(await e.resolve(R.value), N.value));
285
285
  }
286
286
  let $ = a(() => {
287
287
  let e = ke(Ee, me(Le.value, [
@@ -5,10 +5,10 @@ import { LabelProps } from '../../Label/label.types';
5
5
  export type BaseFieldOptions = {
6
6
  /**
7
7
  * Public registry key that owns BaseField chrome defaults/tokens.
8
- * Defaults to `BaseField`; Slider / OtpField pass their own key so chrome
9
- * cascades (`BaseField` → parent).
8
+ * Defaults to `BaseField`; Slider / OtpField / FileUpload pass their own key
9
+ * so chrome cascades (`BaseField` → parent).
10
10
  */
11
- componentName?: "Slider" | "OtpField" | "BaseField";
11
+ componentName?: "Slider" | "OtpField" | "BaseField" | "FileUpload";
12
12
  /**
13
13
  * Resolve `Label` `for` from `controlId`. Defaults to the control id itself.
14
14
  */
@@ -26,10 +26,10 @@ function _(_, v = {
26
26
  error: !1,
27
27
  hideErrorMessage: !1
28
28
  }, y = {}) {
29
- let b = s(), x = l(), S = c(), C = a(() => h({
29
+ let b = c(), x = s(), S = l(), C = a(() => h({
30
30
  bridgeKeys: g,
31
31
  props: {
32
- ...b,
32
+ ...x,
33
33
  ...o(_)
34
34
  }
35
35
  })), w = y.componentName ?? "BaseField", { merged: T, entry: E, chromeEntry: D } = r({
@@ -40,10 +40,10 @@ function _(_, v = {
40
40
  entry: E,
41
41
  chromeEntry: D,
42
42
  props: () => C.value.componentProps
43
- }), k = a(() => T.value.customProps), A = a(() => T.value.error === !0), j = a(() => !!T.value.disabled), M = a(() => !!T.value.readonly), N = a(() => T.value.controlId ?? C.value.inheritedAttrs.id ?? S), P = a(() => {
43
+ }), k = a(() => T.value.customProps), A = a(() => T.value.error === !0), j = a(() => !!T.value.disabled), M = a(() => !!T.value.readonly), N = a(() => T.value.controlId ?? C.value.inheritedAttrs.id ?? b), P = a(() => {
44
44
  let e = w !== "BaseField", t = m(f, u(D.value, ["tokens", "size"]), e ? void 0 : u(E.value, ["tokens", "size"]));
45
45
  return u(t, T.value.size ?? "md");
46
- }), F = a(() => !T.value.hideErrorMessage && !e(x, "description", T.value.description)), I = a(() => A.value && !T.value.hideErrorMessage && e(x, "errorMessage", T.value.errorMessage)), L = a(() => e(x, "description", T.value.description) ? !I.value || T.value.showDescriptionOnError === !0 : !1), R = a(() => I.value || F.value), z = a(() => {
46
+ }), F = a(() => !T.value.hideErrorMessage && !e(S, "description", T.value.description)), I = a(() => A.value && !T.value.hideErrorMessage && e(S, "errorMessage", T.value.errorMessage)), L = a(() => e(S, "description", T.value.description) ? !I.value || T.value.showDescriptionOnError === !0 : !1), R = a(() => I.value || F.value), z = a(() => {
47
47
  let e = [];
48
48
  return L.value && e.push(`${N.value}-description`), I.value && e.push(`${N.value}-error`), e.length > 0 ? e.join(" ") : void 0;
49
49
  }), B = a(() => n(k.value?.root, {
@@ -56,8 +56,8 @@ function _(_, v = {
56
56
  [O.value.root ?? ""]: !0
57
57
  }))), V = a(() => n(k.value?.header, {}, p({
58
58
  "flex w-full gap-x-2 mb-1.5": !0,
59
- "justify-between items-end": e(x, "label", T.value.label),
60
- "justify-end": !e(x, "label", T.value.label),
59
+ "justify-between items-end": e(S, "label", T.value.label),
60
+ "justify-end": !e(S, "label", T.value.label),
61
61
  [O.value.header ?? ""]: !0
62
62
  }))), H = a(() => {
63
63
  let e = y.labelHtmlFor ?? ((e) => e);
@@ -88,7 +88,7 @@ function _(_, v = {
88
88
  [O.value.description ?? ""]: !0
89
89
  })));
90
90
  return {
91
- slots: x,
91
+ slots: S,
92
92
  merged: T,
93
93
  rootBind: B,
94
94
  errorBind: a(() => n(k.value?.errorMessage, {}, p({
@@ -1,13 +1,20 @@
1
1
  import { BreadcrumbOwnProps, BreadcrumbSlots } from './breadcrumb.types';
2
- type __VLS_Slots = BreadcrumbSlots;
3
- declare const __VLS_base: import('vue').DefineComponent<BreadcrumbOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BreadcrumbOwnProps> & Readonly<{}>, {
4
- separator: import('../..').IconSource;
5
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
6
- 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<BreadcrumbOwnProps<T>> & (typeof globalThis extends {
5
+ __VLS_PROPS_FALLBACK: infer P;
6
+ } ? P : {});
7
+ expose: (exposed: {}) => void;
8
+ attrs: any;
9
+ slots: BreadcrumbSlots;
10
+ emit: {};
11
+ }>) => import('vue').VNode & {
12
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
13
+ };
7
14
  declare const _default: typeof __VLS_export;
8
15
  export default _default;
9
- type __VLS_WithSlots<T, S> = T & {
10
- new (): {
11
- $slots: S;
12
- };
13
- };
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
+ }) & {};
@@ -9,16 +9,17 @@ var _ = /*@__PURE__*/ c({
9
9
  classes: {},
10
10
  customProps: {},
11
11
  items: {},
12
+ linkAs: {},
12
13
  maxItems: {},
13
14
  separator: { default: "chevronRight" },
14
15
  size: {}
15
16
  },
16
17
  setup(c) {
17
- let { rootBind: _, listBind: v, collapsedItems: y, hasDefaultSlot: b } = e(c, {
18
+ let _ = c, { rootBind: v, listBind: y, collapsedItems: b, hasDefaultSlot: x } = e(_, {
18
19
  size: "md",
19
20
  separator: "chevronRight"
20
21
  });
21
- return (e, c) => (d(), a("nav", u(l(h(_))), [o("ol", u(l(h(v))), [!h(b) && h(y).length > 0 ? (d(!0), a(n, { key: 0 }, f(h(y), (e, i) => (d(), a(n, { key: e.type === "ellipsis" ? `ellipsis-${i}` : e.index }, [e.type === "ellipsis" ? (d(), r(h(t), {
22
+ return (e, c) => (d(), a("nav", u(l(h(v))), [o("ol", u(l(h(y))), [!h(x) && h(b).length > 0 ? (d(!0), a(n, { key: 0 }, f(h(b), (e, i) => (d(), a(n, { key: e.type === "ellipsis" ? `ellipsis-${i}` : e.index }, [e.type === "ellipsis" ? (d(), r(h(t), {
22
23
  key: 0,
23
24
  as: "span"
24
25
  }, {
@@ -28,9 +29,11 @@ var _ = /*@__PURE__*/ c({
28
29
  key: 1,
29
30
  as: e.item.as,
30
31
  href: e.item.href,
32
+ "link-as": _.linkAs,
31
33
  current: e.item.current,
32
34
  "end-icon": e.item.endIcon,
33
35
  disabled: e.item.disabled,
36
+ "link-props": e.item.linkProps,
34
37
  "start-icon": e.item.startIcon
35
38
  }, {
36
39
  default: g(() => [s(m(e.item.label), 1)]),
@@ -38,9 +41,11 @@ var _ = /*@__PURE__*/ c({
38
41
  }, 1032, [
39
42
  "as",
40
43
  "href",
44
+ "link-as",
41
45
  "current",
42
46
  "end-icon",
43
47
  "disabled",
48
+ "link-props",
44
49
  "start-icon"
45
50
  ]))], 64))), 128)) : i("", !0), p(e.$slots, "default")], 16)], 16));
46
51
  }
@@ -4,6 +4,7 @@ import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
4
4
  import { IconSource } from '../../Adapters/Icon';
5
5
  import { BreadcrumbItemOwnProps } from '../BreadcrumbItem/breadcrumbItem.types';
6
6
  import { IconProps } from '../Icon';
7
+ import { LinkAsTag, LinkHref, LinkPropsOf } from '../../Utils/linkAs';
7
8
  export interface BreadcrumbSizeOverrides {}
8
9
  export interface BreadcrumbClasses {
9
10
  /**
@@ -42,11 +43,19 @@ export interface BreadcrumbCustomProps {
42
43
  /**
43
44
  * Data-driven crumb for the `items` API on `Breadcrumb`.
44
45
  */
45
- export type BreadcrumbItemData = Pick<BreadcrumbItemOwnProps, "as" | "href" | "current" | "endIcon" | "disabled" | "startIcon"> & {
46
+ export type BreadcrumbItemData<T extends LinkAsTag = "a"> = Omit<Pick<BreadcrumbItemOwnProps, "as" | "href" | "current" | "endIcon" | "disabled" | "linkProps" | "startIcon">, "href" | "linkProps"> & {
47
+ /**
48
+ * Link target. When `linkAs` is set, this also accepts that component's `href`.
49
+ */
50
+ href?: LinkHref<T, "a">;
46
51
  /**
47
52
  * Accessible / visible crumb label.
48
53
  */
49
54
  label?: string;
55
+ /**
56
+ * Props forwarded to `linkAs`. Checked against the `Breadcrumb` `linkAs`.
57
+ */
58
+ linkProps?: LinkPropsOf<T, "a">;
50
59
  };
51
60
  export interface BreadcrumbSlots {
52
61
  /**
@@ -61,7 +70,7 @@ export interface BreadcrumbSlots {
61
70
  /**
62
71
  * Breadcrumb nav root. Compose with `BreadcrumbItem` or pass `items`.
63
72
  */
64
- export interface BreadcrumbOwnProps {
73
+ export interface BreadcrumbOwnProps<T extends LinkAsTag = "a"> {
65
74
  /**
66
75
  * Classes for breadcrumb parts.
67
76
  *
@@ -79,7 +88,16 @@ export interface BreadcrumbOwnProps {
79
88
  *
80
89
  * @default undefined
81
90
  */
82
- items?: BreadcrumbItemData[];
91
+ items?: BreadcrumbItemData<T>[];
92
+ /**
93
+ * Default component rendered in place of navigating crumb anchors.
94
+ * Applies to crumbs from `items` and to child `BreadcrumbItem`s that omit their own `linkAs`.
95
+ * The item's `linkAs` wins when both are set.
96
+ * `items[].linkProps` is checked against this component.
97
+ *
98
+ * @default undefined
99
+ */
100
+ linkAs?: T;
83
101
  /**
84
102
  * Collapse middle crumbs when the list exceeds this count (`items` API).
85
103
  *
@@ -99,4 +117,4 @@ export interface BreadcrumbOwnProps {
99
117
  */
100
118
  size?: MergeProps<BreadcrumbSize, BreadcrumbSizeOverrides>;
101
119
  }
102
- export type BreadcrumbProps = MergeHtmlProps<BreadcrumbOwnProps, HTMLAttributes>;
120
+ export type BreadcrumbProps<T extends LinkAsTag = "a"> = MergeHtmlProps<BreadcrumbOwnProps<T>, HTMLAttributes>;
@@ -1,10 +1,14 @@
1
- import { ComputedRef, InjectionKey, VNodeChild } from 'vue';
1
+ import { Component, ComputedRef, InjectionKey, VNodeChild } from 'vue';
2
2
  import { IconSource } from '../../Adapters/Icon';
3
3
  import { IconProps } from '../Icon';
4
4
  /**
5
5
  * Shared breadcrumb chrome for `BreadcrumbItem` descendants.
6
6
  */
7
7
  export type BreadcrumbContextValue = {
8
+ /**
9
+ * Default component for navigating crumbs. Item `linkAs` wins.
10
+ */
11
+ linkAs?: string | Component;
8
12
  /**
9
13
  * Separator icon when no custom separator slot is set.
10
14
  */
@@ -1,20 +1,21 @@
1
1
  import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
2
2
  import { BreadcrumbOwnProps, BreadcrumbProps } from '../breadcrumb.types';
3
3
  import { BreadcrumbContextValue } from '../breadcrumbInjectionKey';
4
+ import { LinkAsTag } from '../../../Utils/linkAs';
4
5
  type BreadcrumbLibDefaults = LibDefaultsShape<BreadcrumbOwnProps, "size" | "separator">;
5
- type BreadcrumbMerged = MergeLibDefaults<BreadcrumbOwnProps, BreadcrumbLibDefaults>;
6
- export declare function useBreadcrumb(props: BreadcrumbOwnProps, libDefaults: BreadcrumbLibDefaults): {
7
- merged: import('vue').ComputedRef<BreadcrumbMerged>;
6
+ type BreadcrumbMerged<T extends LinkAsTag = "a"> = MergeLibDefaults<BreadcrumbOwnProps<T>, BreadcrumbLibDefaults>;
7
+ export declare function useBreadcrumb<T extends LinkAsTag = "a">(props: BreadcrumbOwnProps<T>, libDefaults: BreadcrumbLibDefaults): {
8
+ merged: import('vue').ComputedRef<BreadcrumbMerged<T>>;
8
9
  rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
9
10
  "aria-label": string;
10
11
  class: string;
11
- }, "class", import('vue').HTMLAttributes | undefined, Omit<BreadcrumbProps, "size" | "classes" | "customProps" | "separator" | "items" | "maxItems">>>;
12
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<BreadcrumbProps<T>, "size" | "classes" | "customProps" | "linkAs" | "separator" | "items" | "maxItems">>>;
12
13
  listBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
13
14
  role: string;
14
15
  class: string;
15
16
  }, "class", import('vue').OlHTMLAttributes | undefined, {}>>;
16
17
  contextValue: import('vue').ComputedRef<BreadcrumbContextValue>;
17
- collapsedItems: import('vue').ComputedRef<import('@bridge-ui/core/Domain').CollapsedBreadcrumbEntry<import('../breadcrumb.types').BreadcrumbItemData>[]>;
18
+ collapsedItems: import('vue').ComputedRef<import('@bridge-ui/core/Domain').CollapsedBreadcrumbEntry<import('../breadcrumb.types').BreadcrumbItemData<T>>[]>;
18
19
  hasDefaultSlot: import('vue').ComputedRef<boolean>;
19
20
  };
20
21
  export {};
@@ -9,6 +9,7 @@ import { cn as d, mergeBridgeUILayeredClasses as f, splitComponentProps as p } f
9
9
  var m = [
10
10
  "size",
11
11
  "items",
12
+ "linkAs",
12
13
  "classes",
13
14
  "maxItems",
14
15
  "separator",
@@ -29,6 +30,7 @@ function h(h, g) {
29
30
  entry: x,
30
31
  props: () => y.value.componentProps
31
32
  }), T = i(() => f(u, x.value?.tokens?.size)), E = i(() => c(T.value, b.value.size)), D = i(() => ({
33
+ linkAs: b.value.linkAs,
32
34
  separator: b.value.separator,
33
35
  separatorIconProps: S.value?.separator,
34
36
  separatorClass: c(w.value, "separator"),
@@ -1,14 +1,20 @@
1
1
  import { BreadcrumbItemOwnProps, BreadcrumbItemSlots } from './breadcrumbItem.types';
2
- type __VLS_Slots = BreadcrumbItemSlots;
3
- declare const __VLS_base: import('vue').DefineComponent<BreadcrumbItemOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BreadcrumbItemOwnProps> & Readonly<{}>, {
4
- disabled: boolean;
5
- current: boolean;
6
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
7
- 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<BreadcrumbItemOwnProps<T>> & (typeof globalThis extends {
5
+ __VLS_PROPS_FALLBACK: infer P;
6
+ } ? P : {});
7
+ expose: (exposed: {}) => void;
8
+ attrs: any;
9
+ slots: BreadcrumbItemSlots;
10
+ emit: {};
11
+ }>) => import('vue').VNode & {
12
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
13
+ };
8
14
  declare const _default: typeof __VLS_export;
9
15
  export default _default;
10
- type __VLS_WithSlots<T, S> = T & {
11
- new (): {
12
- $slots: S;
13
- };
14
- };
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
+ }) & {};