@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
@@ -17,6 +17,8 @@ var S = /*@__PURE__*/ d({
17
17
  full: { type: Boolean },
18
18
  href: {},
19
19
  icon: {},
20
+ linkAs: {},
21
+ linkProps: {},
20
22
  loading: { type: Boolean },
21
23
  rounded: {},
22
24
  selected: { type: Boolean },
@@ -26,7 +28,7 @@ var S = /*@__PURE__*/ d({
26
28
  variant: {}
27
29
  },
28
30
  setup(d) {
29
- let S = d, C = b(), { tag: w, merged: T, isMini: E, iconBind: D, rootBind: O, rootHref: k, rootType: A, endIconBind: j, contentBind: M, endSlotBind: N, rootAriaBusy: P, rootDisabled: F, startIconBind: I, startSlotBind: L, loadingIconBind: R, loadingWrapBind: z, rootAriaDisabled: B } = r(S, {
31
+ let S = d, C = b(), { tag: w, merged: T, isMini: E, iconBind: D, rootBind: O, rootHref: k, endIconBind: A, contentBind: j, endSlotBind: M, rootAriaBusy: N, rootDisabled: P, startIconBind: F, startSlotBind: I, loadingIconBind: L, loadingWrapBind: R, rootAriaDisabled: z } = r(S, {
30
32
  size: "md",
31
33
  as: "button",
32
34
  rounded: "md",
@@ -35,32 +37,30 @@ var S = /*@__PURE__*/ d({
35
37
  density: "default"
36
38
  });
37
39
  return (r, d) => (h(), a(_(y(w)), p({ href: y(k) }, y(O), {
38
- type: y(A),
39
- disabled: y(F),
40
- "aria-busy": y(P),
41
- "aria-disabled": y(B)
40
+ disabled: y(P),
41
+ "aria-busy": y(N),
42
+ "aria-disabled": y(z)
42
43
  }), {
43
- default: x(() => [y(T).loading ? (h(), s("span", m(p({ key: 0 }, y(z))), [u(y(n), p({
44
+ default: x(() => [y(T).loading ? (h(), s("span", m(p({ key: 0 }, y(R))), [u(y(n), p({
44
45
  icon: "loader",
45
46
  size: y(T).size
46
- }, y(R)), null, 16, ["size"])], 16)) : o("", !0), c("span", m(f(y(M))), [y(E) ? (h(), s(i, { key: 0 }, [y(e)(y(C), "default") ? g(r.$slots, "default", {}, void 0, void 0, 0) : y(T).icon ? (h(), a(y(n), p({ key: 1 }, y(D), {
47
+ }, y(L)), null, 16, ["size"])], 16)) : o("", !0), c("span", m(f(y(j))), [y(E) ? (h(), s(i, { key: 0 }, [y(e)(y(C), "default") ? g(r.$slots, "default", {}, void 0, void 0, 0) : y(T).icon ? (h(), a(y(n), p({ key: 1 }, y(D), {
47
48
  icon: y(T).icon,
48
49
  size: y(T).size
49
50
  }), null, 16, ["icon", "size"])) : o("", !0)], 64)) : (h(), s(i, { key: 1 }, [
50
51
  y(T).startIcon ? (h(), a(y(n), p({
51
52
  key: 0,
52
53
  size: y(T).size
53
- }, y(I), { icon: y(T).startIcon }), null, 16, ["size", "icon"])) : y(e)(y(C), "start") ? (h(), s("div", m(p({ key: 1 }, y(L))), [g(r.$slots, "start")], 16)) : o("", !0),
54
+ }, y(F), { icon: y(T).startIcon }), null, 16, ["size", "icon"])) : y(e)(y(C), "start") ? (h(), s("div", m(p({ key: 1 }, y(I))), [g(r.$slots, "start")], 16)) : o("", !0),
54
55
  y(t)(y(T).text) ? (h(), s(i, { key: 2 }, [l(v(y(T).text), 1)], 64)) : y(e)(y(C), "default") ? g(r.$slots, "default", {}, void 0, void 0, 3) : o("", !0),
55
56
  y(T).endIcon ? (h(), a(y(n), p({
56
57
  key: 4,
57
58
  size: y(T).size
58
- }, y(j), { icon: y(T).endIcon }), null, 16, ["size", "icon"])) : y(e)(y(C), "end") ? (h(), s("div", m(p({ key: 5 }, y(N))), [g(r.$slots, "end")], 16)) : o("", !0)
59
+ }, y(A), { icon: y(T).endIcon }), null, 16, ["size", "icon"])) : y(e)(y(C), "end") ? (h(), s("div", m(p({ key: 5 }, y(M))), [g(r.$slots, "end")], 16)) : o("", !0)
59
60
  ], 64))], 16)]),
60
61
  _: 3
61
62
  }, 16, [
62
63
  "href",
63
- "type",
64
64
  "disabled",
65
65
  "aria-busy",
66
66
  "aria-disabled"
@@ -3,6 +3,7 @@ import { ButtonColor, ButtonDensity, ButtonRounded, ButtonSize, ButtonVariant }
3
3
  import { MergeHtmlProps, MergeProps } 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 ButtonSizeOverrides {}
7
8
  export interface ButtonColorOverrides {}
8
9
  export interface ButtonDensityOverrides {}
@@ -60,7 +61,7 @@ export interface ButtonCustomProps {
60
61
  */
61
62
  startIcon?: Partial<Omit<IconProps, "icon">>;
62
63
  }
63
- export interface ButtonOwnProps {
64
+ export interface ButtonOwnProps<T extends LinkAsTag = "button"> {
64
65
  /**
65
66
  * The element to render as.
66
67
  *
@@ -112,16 +113,32 @@ export interface ButtonOwnProps {
112
113
  full?: boolean;
113
114
  /**
114
115
  * The href to apply to the button.
116
+ * When `linkAs` is set, this also accepts that component's `href`.
115
117
  *
116
118
  * @default undefined
117
119
  */
118
- href?: string;
120
+ href?: LinkHref<T, "button">;
119
121
  /**
120
122
  * Icon for mini density (replaces label and start/end icons).
121
123
  *
122
124
  * @default undefined
123
125
  */
124
126
  icon?: IconSource;
127
+ /**
128
+ * Component rendered in place of the navigating `<a>`.
129
+ * With `href` and no `as`, this renders a link. `as="button"` and `as="span"` ignore it.
130
+ * Ignored while disabled or loading.
131
+ *
132
+ * @default undefined
133
+ */
134
+ linkAs?: T;
135
+ /**
136
+ * Props forwarded to `linkAs` (`method`, `replace`, `prefetch`, and so on).
137
+ * Checked against that component. Ignored while `linkAs` is not rendered.
138
+ *
139
+ * @default undefined
140
+ */
141
+ linkProps?: LinkPropsOf<T, "button">;
125
142
  /**
126
143
  * Whether the button is loading.
127
144
  *
@@ -179,10 +196,10 @@ export interface ButtonSlots {
179
196
  */
180
197
  start?: Slot<undefined>;
181
198
  }
182
- export type ButtonProps = MergeHtmlProps<ButtonOwnProps & {
199
+ export type ButtonProps<T extends LinkAsTag = "button"> = MergeHtmlProps<ButtonOwnProps<T> & {
183
200
  as: "span";
184
- }, HTMLAttributes> | MergeHtmlProps<ButtonOwnProps & {
201
+ }, HTMLAttributes> | MergeHtmlProps<ButtonOwnProps<T> & {
185
202
  as: "a";
186
- }, AnchorHTMLAttributes> | MergeHtmlProps<ButtonOwnProps & {
203
+ }, AnchorHTMLAttributes> | MergeHtmlProps<ButtonOwnProps<T> & {
187
204
  as?: "button";
188
205
  }, ButtonHTMLAttributes>;
@@ -1,17 +1,207 @@
1
1
  import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
2
- import { ButtonOwnProps, ButtonProps } from '../button.types';
2
+ import { ButtonOwnProps } from '../button.types';
3
+ import { LinkAsTag } from '../../../Utils/linkAs';
3
4
  type ButtonLibDefaults = LibDefaultsShape<ButtonOwnProps, "as" | "size" | "color" | "density" | "rounded" | "variant">;
4
- type ButtonMerged = MergeLibDefaults<ButtonOwnProps, ButtonLibDefaults>;
5
- export declare function useButton(props: ButtonOwnProps, libDefaults: ButtonLibDefaults): {
6
- tag: import('vue').ComputedRef<NonNullable<"a" | "span" | "button" | undefined>>;
7
- merged: import('vue').ComputedRef<ButtonMerged>;
5
+ type ButtonMerged<T extends LinkAsTag = "button"> = MergeLibDefaults<ButtonOwnProps<T>, ButtonLibDefaults>;
6
+ export declare function useButton<T extends LinkAsTag = "button">(props: ButtonOwnProps<T>, libDefaults: ButtonLibDefaults): {
7
+ tag: import('vue').ComputedRef<NonNullable<"button" | "a" | "span" | undefined> | T>;
8
+ merged: import('vue').ComputedRef<ButtonMerged<T>>;
8
9
  isMini: import('vue').ComputedRef<boolean>;
9
10
  iconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
10
- rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
11
+ rootBind: import('vue').ComputedRef<({
11
12
  "aria-pressed": boolean | undefined;
12
13
  class: string;
13
- }, "class", import('vue').HTMLAttributes | undefined, Omit<ButtonProps, "color" | "href" | "icon" | "size" | "classes" | "customProps" | "full" | "as" | "density" | "disabled" | "endIcon" | "loading" | "rounded" | "selected" | "startIcon" | "text" | "variant">>>;
14
- rootHref: import('vue').ComputedRef<string | undefined>;
14
+ } & object & Record<"class", string>) | {
15
+ type: string;
16
+ "aria-pressed": boolean | undefined;
17
+ class: string & import('vue').ClassValue;
18
+ innerHTML?: string | undefined;
19
+ style?: import('vue').StyleValue | undefined;
20
+ accesskey?: string | undefined;
21
+ contenteditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
22
+ contextmenu?: string | undefined;
23
+ dir?: string | undefined;
24
+ draggable?: (boolean | "true" | "false") | undefined;
25
+ enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
26
+ enterKeyHint?: import('vue').HTMLAttributes["enterkeyhint"];
27
+ hidden?: (boolean | "true" | "false") | "" | "hidden" | "until-found" | undefined;
28
+ id?: string | undefined;
29
+ inert?: (boolean | "true" | "false") | undefined;
30
+ lang?: string | undefined;
31
+ placeholder?: string | undefined;
32
+ spellcheck?: (boolean | "true" | "false") | undefined;
33
+ tabindex?: (string | number) | undefined;
34
+ title?: string | undefined;
35
+ translate?: "yes" | "no" | undefined;
36
+ radiogroup?: string | undefined;
37
+ role?: string | undefined;
38
+ about?: string | undefined;
39
+ datatype?: string | undefined;
40
+ inlist?: any;
41
+ prefix?: string | undefined;
42
+ property?: string | undefined;
43
+ resource?: string | undefined;
44
+ typeof?: string | undefined;
45
+ vocab?: string | undefined;
46
+ autocapitalize?: string | undefined;
47
+ autocorrect?: string | undefined;
48
+ autosave?: string | undefined;
49
+ color?: string | undefined;
50
+ itemprop?: string | undefined;
51
+ itemscope?: (boolean | "true" | "false") | undefined;
52
+ itemtype?: string | undefined;
53
+ itemid?: string | undefined;
54
+ itemref?: string | undefined;
55
+ results?: (string | number) | undefined;
56
+ security?: string | undefined;
57
+ unselectable?: "on" | "off" | undefined;
58
+ inputmode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
59
+ is?: string | undefined;
60
+ exportparts?: string;
61
+ part?: string;
62
+ 'aria-activedescendant'?: string | undefined;
63
+ 'aria-atomic'?: (boolean | "true" | "false") | undefined;
64
+ 'aria-autocomplete'?: "none" | "inline" | "list" | "both" | undefined;
65
+ 'aria-busy'?: (boolean | "true" | "false") | undefined;
66
+ 'aria-checked'?: (boolean | "true" | "false") | "mixed" | undefined;
67
+ 'aria-colcount'?: (string | number) | undefined;
68
+ 'aria-colindex'?: (string | number) | undefined;
69
+ 'aria-colspan'?: (string | number) | undefined;
70
+ 'aria-controls'?: string | undefined;
71
+ 'aria-current'?: (boolean | "true" | "false") | "page" | "step" | "location" | "date" | "time" | undefined;
72
+ 'aria-describedby'?: string | undefined;
73
+ 'aria-details'?: string | undefined;
74
+ 'aria-disabled'?: (boolean | "true" | "false") | undefined;
75
+ 'aria-dropeffect'?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
76
+ 'aria-errormessage'?: string | undefined;
77
+ 'aria-expanded'?: (boolean | "true" | "false") | undefined;
78
+ 'aria-flowto'?: string | undefined;
79
+ 'aria-grabbed'?: (boolean | "true" | "false") | undefined;
80
+ 'aria-haspopup'?: (boolean | "true" | "false") | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
81
+ 'aria-hidden'?: (boolean | "true" | "false") | undefined;
82
+ 'aria-invalid'?: (boolean | "true" | "false") | "grammar" | "spelling" | undefined;
83
+ 'aria-keyshortcuts'?: string | undefined;
84
+ 'aria-label'?: string | undefined;
85
+ 'aria-labelledby'?: string | undefined;
86
+ 'aria-level'?: (string | number) | undefined;
87
+ 'aria-live'?: "off" | "assertive" | "polite" | undefined;
88
+ 'aria-modal'?: (boolean | "true" | "false") | undefined;
89
+ 'aria-multiline'?: (boolean | "true" | "false") | undefined;
90
+ 'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
91
+ 'aria-orientation'?: "horizontal" | "vertical" | undefined;
92
+ 'aria-owns'?: string | undefined;
93
+ 'aria-placeholder'?: string | undefined;
94
+ 'aria-posinset'?: (string | number) | undefined;
95
+ 'aria-readonly'?: (boolean | "true" | "false") | undefined;
96
+ 'aria-relevant'?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
97
+ 'aria-required'?: (boolean | "true" | "false") | undefined;
98
+ 'aria-roledescription'?: string | undefined;
99
+ 'aria-rowcount'?: (string | number) | undefined;
100
+ 'aria-rowindex'?: (string | number) | undefined;
101
+ 'aria-rowspan'?: (string | number) | undefined;
102
+ 'aria-selected'?: (boolean | "true" | "false") | undefined;
103
+ 'aria-setsize'?: (string | number) | undefined;
104
+ 'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
105
+ 'aria-valuemax'?: (string | number) | undefined;
106
+ 'aria-valuemin'?: (string | number) | undefined;
107
+ 'aria-valuenow'?: (string | number) | undefined;
108
+ 'aria-valuetext'?: string | undefined;
109
+ onCopy?: ((payload: ClipboardEvent) => void) | undefined;
110
+ onCut?: ((payload: ClipboardEvent) => void) | undefined;
111
+ onPaste?: ((payload: ClipboardEvent) => void) | undefined;
112
+ onCompositionend?: ((payload: CompositionEvent) => void) | undefined;
113
+ onCompositionstart?: ((payload: CompositionEvent) => void) | undefined;
114
+ onCompositionupdate?: ((payload: CompositionEvent) => void) | undefined;
115
+ onDrag?: ((payload: DragEvent) => void) | undefined;
116
+ onDragend?: ((payload: DragEvent) => void) | undefined;
117
+ onDragenter?: ((payload: DragEvent) => void) | undefined;
118
+ onDragexit?: ((payload: DragEvent) => void) | undefined;
119
+ onDragleave?: ((payload: DragEvent) => void) | undefined;
120
+ onDragover?: ((payload: DragEvent) => void) | undefined;
121
+ onDragstart?: ((payload: DragEvent) => void) | undefined;
122
+ onDrop?: ((payload: DragEvent) => void) | undefined;
123
+ onFocus?: ((payload: FocusEvent) => void) | undefined;
124
+ onFocusin?: ((payload: FocusEvent) => void) | undefined;
125
+ onFocusout?: ((payload: FocusEvent) => void) | undefined;
126
+ onBlur?: ((payload: FocusEvent) => void) | undefined;
127
+ onChange?: ((payload: Event) => void) | undefined;
128
+ onBeforeinput?: ((payload: InputEvent) => void) | undefined;
129
+ onFormdata?: ((payload: FormDataEvent) => void) | undefined;
130
+ onInput?: ((payload: InputEvent) => void) | undefined;
131
+ onReset?: ((payload: Event) => void) | undefined;
132
+ onSubmit?: ((payload: SubmitEvent) => void) | undefined;
133
+ onInvalid?: ((payload: Event) => void) | undefined;
134
+ onFullscreenchange?: ((payload: Event) => void) | undefined;
135
+ onFullscreenerror?: ((payload: Event) => void) | undefined;
136
+ onLoad?: ((payload: Event) => void) | undefined;
137
+ onError?: ((payload: Event) => void) | undefined;
138
+ onKeydown?: ((payload: KeyboardEvent) => void) | undefined;
139
+ onKeypress?: ((payload: KeyboardEvent) => void) | undefined;
140
+ onKeyup?: ((payload: KeyboardEvent) => void) | undefined;
141
+ onDblclick?: ((payload: MouseEvent) => void) | undefined;
142
+ onMousedown?: ((payload: MouseEvent) => void) | undefined;
143
+ onMouseenter?: ((payload: MouseEvent) => void) | undefined;
144
+ onMouseleave?: ((payload: MouseEvent) => void) | undefined;
145
+ onMousemove?: ((payload: MouseEvent) => void) | undefined;
146
+ onMouseout?: ((payload: MouseEvent) => void) | undefined;
147
+ onMouseover?: ((payload: MouseEvent) => void) | undefined;
148
+ onMouseup?: ((payload: MouseEvent) => void) | undefined;
149
+ onAbort?: ((payload: UIEvent) => void) | undefined;
150
+ onCanplay?: ((payload: Event) => void) | undefined;
151
+ onCanplaythrough?: ((payload: Event) => void) | undefined;
152
+ onDurationchange?: ((payload: Event) => void) | undefined;
153
+ onEmptied?: ((payload: Event) => void) | undefined;
154
+ onEncrypted?: ((payload: MediaEncryptedEvent) => void) | undefined;
155
+ onEnded?: ((payload: Event) => void) | undefined;
156
+ onLoadeddata?: ((payload: Event) => void) | undefined;
157
+ onLoadedmetadata?: ((payload: Event) => void) | undefined;
158
+ onLoadstart?: ((payload: Event) => void) | undefined;
159
+ onPause?: ((payload: Event) => void) | undefined;
160
+ onPlay?: ((payload: Event) => void) | undefined;
161
+ onPlaying?: ((payload: Event) => void) | undefined;
162
+ onProgress?: ((payload: ProgressEvent<EventTarget>) => void) | undefined;
163
+ onRatechange?: ((payload: Event) => void) | undefined;
164
+ onSeeked?: ((payload: Event) => void) | undefined;
165
+ onSeeking?: ((payload: Event) => void) | undefined;
166
+ onStalled?: ((payload: Event) => void) | undefined;
167
+ onSuspend?: ((payload: Event) => void) | undefined;
168
+ onTimeupdate?: ((payload: Event) => void) | undefined;
169
+ onVolumechange?: ((payload: Event) => void) | undefined;
170
+ onWaiting?: ((payload: Event) => void) | undefined;
171
+ onSelect?: ((payload: Event) => void) | undefined;
172
+ onScroll?: ((payload: Event) => void) | undefined;
173
+ onScrollend?: ((payload: Event) => void) | undefined;
174
+ onTouchcancel?: ((payload: TouchEvent) => void) | undefined;
175
+ onTouchend?: ((payload: TouchEvent) => void) | undefined;
176
+ onTouchmove?: ((payload: TouchEvent) => void) | undefined;
177
+ onTouchstart?: ((payload: TouchEvent) => void) | undefined;
178
+ onAuxclick?: ((payload: PointerEvent) => void) | undefined;
179
+ onClick?: ((payload: PointerEvent) => void) | undefined;
180
+ onContextmenu?: ((payload: PointerEvent) => void) | undefined;
181
+ onGotpointercapture?: ((payload: PointerEvent) => void) | undefined;
182
+ onLostpointercapture?: ((payload: PointerEvent) => void) | undefined;
183
+ onPointerdown?: ((payload: PointerEvent) => void) | undefined;
184
+ onPointermove?: ((payload: PointerEvent) => void) | undefined;
185
+ onPointerup?: ((payload: PointerEvent) => void) | undefined;
186
+ onPointercancel?: ((payload: PointerEvent) => void) | undefined;
187
+ onPointerenter?: ((payload: PointerEvent) => void) | undefined;
188
+ onPointerleave?: ((payload: PointerEvent) => void) | undefined;
189
+ onPointerover?: ((payload: PointerEvent) => void) | undefined;
190
+ onPointerout?: ((payload: PointerEvent) => void) | undefined;
191
+ onBeforetoggle?: ((payload: ToggleEvent) => void) | undefined;
192
+ onToggle?: ((payload: ToggleEvent) => void) | undefined;
193
+ onWheel?: ((payload: WheelEvent) => void) | undefined;
194
+ onAnimationcancel?: ((payload: AnimationEvent) => void) | undefined;
195
+ onAnimationstart?: ((payload: AnimationEvent) => void) | undefined;
196
+ onAnimationend?: ((payload: AnimationEvent) => void) | undefined;
197
+ onAnimationiteration?: ((payload: AnimationEvent) => void) | undefined;
198
+ onSecuritypolicyviolation?: ((payload: SecurityPolicyViolationEvent) => void) | undefined;
199
+ onTransitioncancel?: ((payload: TransitionEvent) => void) | undefined;
200
+ onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
201
+ onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
202
+ onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
203
+ }>;
204
+ rootHref: import('vue').ComputedRef<NonNullable<import('../../../Utils/linkAs').LinkHref<T, "button">> | undefined>;
15
205
  rootType: import('vue').ComputedRef<"button" | undefined>;
16
206
  endIconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
17
207
  contentBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, {}>>;
@@ -1,11 +1,12 @@
1
1
  import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
2
2
  import { BUTTON_GROUP_INJECTION_KEY as r } from "../../ButtonGroup/buttonGroupInjectionKey.js";
3
- import { computed as i, inject as a, useAttrs as o } from "vue";
4
- import { get as s, includes as c, isNil as l } from "es-toolkit/compat";
5
- import { buttonDensityProps as u, buttonRoundedProps as d, buttonVariantProps as f } from "@bridge-ui/core/Tokens";
6
- import { cn as p, mergeBridgeUILayeredClasses as m, splitComponentProps as h } from "@bridge-ui/core/Utils";
3
+ import { resolveLinkAsProps as i } from "../../../Utils/linkAs.js";
4
+ import { computed as a, inject as o, useAttrs as s } from "vue";
5
+ import { get as c, includes as l, isNil as u } from "es-toolkit/compat";
6
+ import { buttonDensityProps as d, buttonRoundedProps as f, buttonVariantProps as p } from "@bridge-ui/core/Tokens";
7
+ import { cn as m, mergeBridgeUILayeredClasses as h, splitComponentProps as g } from "@bridge-ui/core/Utils";
7
8
  //#region src/Components/Button/composables/useButton.ts
8
- var g = [
9
+ var _ = [
9
10
  "as",
10
11
  "full",
11
12
  "href",
@@ -13,6 +14,7 @@ var g = [
13
14
  "size",
14
15
  "text",
15
16
  "color",
17
+ "linkAs",
16
18
  "classes",
17
19
  "density",
18
20
  "endIcon",
@@ -21,18 +23,19 @@ var g = [
21
23
  "variant",
22
24
  "disabled",
23
25
  "selected",
26
+ "linkProps",
24
27
  "startIcon",
25
28
  "customProps"
26
29
  ];
27
- function _(_, v) {
28
- let y = o(), b = a(r, null), x = i(() => h({
29
- bridgeKeys: g,
30
+ function v(v, y) {
31
+ let b = s(), x = o(r, null), S = a(() => g({
32
+ bridgeKeys: _,
30
33
  props: {
31
- ...y,
32
- ..._
34
+ ...b,
35
+ ...v
33
36
  }
34
- })), S = i(() => {
35
- let e = x.value.componentProps, t = b?.value;
37
+ })), C = a(() => {
38
+ let e = S.value.componentProps, t = x?.value;
36
39
  return {
37
40
  ...e,
38
41
  size: e.size ?? t?.size,
@@ -41,93 +44,105 @@ function _(_, v) {
41
44
  rounded: e.rounded ?? t?.rounded,
42
45
  variant: e.variant ?? t?.variant
43
46
  };
44
- }), { merged: C, entry: w } = t({
45
- libDefaults: v,
47
+ }), { merged: w, entry: T } = t({
48
+ libDefaults: y,
46
49
  componentName: "Button",
47
- props: () => S.value
48
- }), T = i(() => C.value.customProps), E = n({
49
- entry: w,
50
- props: () => x.value.componentProps
51
- }), D = i(() => C.value.as ?? "button"), O = i(() => D.value === "a"), k = i(() => D.value === "button"), A = i(() => C.value.density === "mini"), j = i(() => C.value.disabled || C.value.loading), M = i(() => k.value ? j.value : void 0), N = i(() => C.value.loading ? !0 : void 0), P = i(() => j.value && !k.value ? !0 : void 0), F = i(() => {
52
- if (!(!O.value || j.value || !C.value.href)) return C.value.href;
53
- }), I = i(() => {
54
- if (!k.value) return;
55
- let e = s(x.value.inheritedAttrs, "type");
56
- return c([
50
+ props: () => C.value
51
+ }), E = a(() => w.value.customProps), D = n({
52
+ entry: T,
53
+ props: () => S.value.componentProps
54
+ }), O = a(() => {
55
+ let e = S.value.componentProps.as, t = w.value.linkAs, n = !!(w.value.disabled || w.value.loading);
56
+ return e === "button" || e === "span" ? e : e === "a" || e == null && (w.value.as === "a" || t && w.value.href) ? n || t == null ? "a" : t : w.value.as ?? "button";
57
+ }), k = a(() => O.value !== "button" && O.value !== "span"), A = a(() => O.value === "button"), j = a(() => w.value.density === "mini"), M = a(() => w.value.disabled || w.value.loading), N = a(() => A.value ? M.value : void 0), P = a(() => w.value.loading ? !0 : void 0), F = a(() => M.value && !A.value ? !0 : void 0), I = a(() => {
58
+ if (k.value && !M.value && w.value.href) return w.value.href;
59
+ }), L = a(() => {
60
+ if (!A.value) return;
61
+ let e = c(S.value.inheritedAttrs, "type");
62
+ return l([
57
63
  "submit",
58
64
  "reset",
59
65
  "button"
60
66
  ], e) ? e : "button";
61
- }), L = i(() => {
62
- let e = m(u, w.value?.tokens?.density);
63
- return s(e, [C.value.density, C.value.size]);
64
- }), R = i(() => l(S.value.variant) ? l(b) && A.value ? "flat" : C.value.variant : S.value.variant), z = i(() => {
65
- let e = m(f, w.value?.tokens?.variant);
66
- return s(e, [R.value, C.value.color]);
67
- }), B = i(() => {
68
- let e = m(d, w.value?.tokens?.rounded);
69
- return s(e, C.value.rounded);
70
- }), V = i(() => e(T.value?.icon, {}, p({
67
+ }), R = a(() => {
68
+ let e = h(d, T.value?.tokens?.density);
69
+ return c(e, [w.value.density, w.value.size]);
70
+ }), z = a(() => u(C.value.variant) ? u(x) && j.value ? "flat" : w.value.variant : C.value.variant), B = a(() => {
71
+ let e = h(p, T.value?.tokens?.variant);
72
+ return c(e, [z.value, w.value.color]);
73
+ }), V = a(() => {
74
+ let e = h(f, T.value?.tokens?.rounded);
75
+ return c(e, w.value.rounded);
76
+ }), H = a(() => e(E.value?.icon, {}, m({
71
77
  "shrink-0": !0,
72
- [E.value.icon ?? ""]: !0
73
- }))), H = i(() => e(T.value?.root, x.value.inheritedAttrs, {
74
- "aria-pressed": l(C.value.selected) ? void 0 : C.value.selected,
75
- class: p({
76
- "inline-flex items-center justify-center": !0,
77
- "cursor-pointer outline-none outline-hidden": !0,
78
- "shrink-0": A.value,
79
- [L.value ?? ""]: !0,
80
- [B.value ?? ""]: !0,
81
- "h-auto": A.value && !l(b) && b.value?.density !== "mini",
82
- "border border-transparent": !l(b) && R.value !== "outline",
83
- "w-full": !A.value && C.value.full,
84
- "w-fit": !A.value && !C.value.full,
85
- "group hover:shadow-xs": !A.value,
86
- [s(z.value, "base") ?? ""]: !0,
87
- [s(z.value, "hover") ?? ""]: !0,
88
- [s(z.value, "focus") ?? ""]: !0,
89
- [s(z.value, "selected") ?? ""]: C.value.selected === !0,
90
- relative: !0,
91
- "z-10": C.value.selected === !0,
92
- "transition-all ease-in-out duration-200": !0,
93
- "focus:ring-2": !0,
94
- "focus:ring-offset-background-white dark:focus:ring-offset-background-dark": !0,
95
- "disabled:opacity-80 disabled:cursor-not-allowed": !0,
96
- "aria-disabled:opacity-80 aria-disabled:cursor-not-allowed aria-disabled:pointer-events-none": !0,
97
- [E.value.root ?? ""]: !0
98
- })
99
- })), U = i(() => e(T.value?.endIcon, {}, p({
78
+ [D.value.icon ?? ""]: !0
79
+ }))), U = a(() => {
80
+ let t = e(E.value?.root, {
81
+ ...S.value.inheritedAttrs,
82
+ ...i(w.value.linkAs, w.value.linkProps, O.value)
83
+ }, {
84
+ "aria-pressed": u(w.value.selected) ? void 0 : w.value.selected,
85
+ class: m({
86
+ "inline-flex items-center justify-center": !0,
87
+ "cursor-pointer outline-none outline-hidden": !0,
88
+ "shrink-0": j.value,
89
+ [R.value ?? ""]: !0,
90
+ [V.value ?? ""]: !0,
91
+ "h-auto": j.value && !u(x) && x.value?.density !== "mini",
92
+ "border border-transparent": !u(x) && z.value !== "outline",
93
+ "w-full": !j.value && w.value.full,
94
+ "w-fit": !j.value && !w.value.full,
95
+ "group hover:shadow-xs": !j.value,
96
+ [c(B.value, "base") ?? ""]: !0,
97
+ [c(B.value, "hover") ?? ""]: !0,
98
+ [c(B.value, "focus") ?? ""]: !0,
99
+ [c(B.value, "selected") ?? ""]: w.value.selected === !0,
100
+ relative: !0,
101
+ "z-10": w.value.selected === !0,
102
+ "transition-all ease-in-out duration-200": !0,
103
+ "focus:ring-2": !0,
104
+ "focus:ring-offset-background-white dark:focus:ring-offset-background-dark": !0,
105
+ "disabled:opacity-80 disabled:cursor-not-allowed": !0,
106
+ "aria-disabled:opacity-80 aria-disabled:cursor-not-allowed aria-disabled:pointer-events-none": !0,
107
+ [D.value.root ?? ""]: !0
108
+ })
109
+ });
110
+ return L.value == null ? t : {
111
+ ...t,
112
+ type: L.value
113
+ };
114
+ }), W = a(() => e(E.value?.endIcon, {}, m({
100
115
  "shrink-0": !0,
101
- [E.value.endIcon ?? ""]: !0
102
- }))), W = i(() => e(T.value?.end, {}, "inline-flex shrink-0 items-center")), G = i(() => e(T.value?.startIcon, {}, p({
116
+ [D.value.endIcon ?? ""]: !0
117
+ }))), G = a(() => e(E.value?.end, {}, "inline-flex shrink-0 items-center")), K = a(() => e(E.value?.startIcon, {}, m({
103
118
  "shrink-0": !0,
104
- [E.value.startIcon ?? ""]: !0
105
- }))), K = i(() => e(T.value?.start, {}, "inline-flex shrink-0 items-center")), q = i(() => e({}, {}, "pointer-events-none absolute inset-0 flex items-center justify-center"));
119
+ [D.value.startIcon ?? ""]: !0
120
+ }))), q = a(() => e(E.value?.start, {}, "inline-flex shrink-0 items-center")), J = a(() => e({}, {}, "pointer-events-none absolute inset-0 flex items-center justify-center"));
106
121
  return {
107
- tag: D,
108
- merged: C,
109
- isMini: A,
110
- iconBind: V,
111
- rootBind: H,
112
- rootHref: F,
113
- rootType: I,
114
- endIconBind: U,
115
- contentBind: i(() => e({}, {}, p({
122
+ tag: O,
123
+ merged: w,
124
+ isMini: j,
125
+ iconBind: H,
126
+ rootBind: U,
127
+ rootHref: I,
128
+ rootType: L,
129
+ endIconBind: W,
130
+ contentBind: a(() => e({}, {}, m({
116
131
  contents: !0,
117
- invisible: C.value.loading
132
+ invisible: w.value.loading
118
133
  }))),
119
- endSlotBind: W,
120
- rootAriaBusy: N,
121
- rootDisabled: M,
122
- startIconBind: G,
123
- startSlotBind: K,
124
- loadingIconBind: i(() => e(T.value?.loading, {}, p({
134
+ endSlotBind: G,
135
+ rootAriaBusy: P,
136
+ rootDisabled: N,
137
+ startIconBind: K,
138
+ startSlotBind: q,
139
+ loadingIconBind: a(() => e(E.value?.loading, {}, m({
125
140
  "shrink-0 animate-spin": !0,
126
- [E.value.loading ?? ""]: !0
141
+ [D.value.loading ?? ""]: !0
127
142
  }))),
128
- loadingWrapBind: q,
129
- rootAriaDisabled: P
143
+ loadingWrapBind: J,
144
+ rootAriaDisabled: F
130
145
  };
131
146
  }
132
147
  //#endregion
133
- export { _ as useButton };
148
+ export { v as useButton };
@@ -73,7 +73,7 @@ function w(f, w, T) {
73
73
  });
74
74
  }, se = (e) => {
75
75
  let t = h(e);
76
- !t || !Y.value || Z(t);
76
+ t && Y.value && Z(t);
77
77
  }, ce = () => {
78
78
  X(m(z.value, R.value)), T("apply"), E.apply();
79
79
  }, le = () => {
@@ -1,7 +1,7 @@
1
1
  import { VNodeChild } from 'vue';
2
2
  import { DataTableColumnSearch, DataTableFilters } from '@bridge-ui/core/Domain';
3
3
  import { DataTableItemSlotProps, DataTableOwnProps, DataTableSlots, DataTableSorting } from './dataTable.types';
4
- declare const __VLS_export: <T>(__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
+ declare const __VLS_export: <T extends Record<string, unknown>>(__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<{
5
5
  props: import('vue').PublicProps & __VLS_PrettifyLocal<(Omit<DataTableOwnProps<T>, "search" | "page" | "filters" | "expanded" | "selection" | "columnSearch" | "hiddenColumns" | "perPage" | "sorting"> & {
6
6
  page?: number;
7
7
  perPage?: number;
@@ -67,7 +67,7 @@ export type DataTableModels = {
67
67
  selection: Ref<string[] | undefined>;
68
68
  sorting: Ref<undefined | DataTableSorting>;
69
69
  };
70
- export declare function useDataTable<T>(props: DataTableOwnProps<T>, libDefaults: DataTableLibDefaults, models: DataTableModels): {
70
+ export declare function useDataTable<T extends Record<string, unknown>>(props: DataTableOwnProps<T>, libDefaults: DataTableLibDefaults, models: DataTableModels): {
71
71
  merged: import('vue').ComputedRef<DataTableMerged<T>>;
72
72
  pageIds: import('vue').ComputedRef<string[]>;
73
73
  rowViews: import('vue').ComputedRef<DataTableRowView<T>[]>;