@bridge-ui/vue 0.0.1-beta.3 → 0.0.1-beta.5
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.
- package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +2 -4
- package/dist/Components/Button/composables/useButton.js +52 -44
- package/dist/Components/Divider/Divider.js +5 -0
- package/dist/Components/Divider/Divider.vue.d.ts +4 -0
- package/dist/Components/Divider/Divider.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/Components/Divider/composables/useDivider.d.ts +13 -0
- package/dist/Components/Divider/composables/useDivider.js +42 -0
- package/dist/Components/Divider/divider.types.d.ts +31 -0
- package/dist/Components/Divider/index.d.ts +3 -0
- package/dist/Components/Divider/index.js +3 -0
- package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +21 -19
- package/dist/Components/ListItem/composables/useListItem.d.ts +7 -1
- package/dist/Components/ListItem/composables/useListItem.js +70 -60
- package/dist/Components/ListItem/listItem.types.d.ts +17 -0
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +21 -21
- package/dist/Components/Listbox/composables/useListbox.d.ts +0 -1
- package/dist/Components/Listbox/composables/useListbox.js +6 -7
- package/dist/Components/Skeleton/Skeleton.js +5 -0
- package/dist/Components/Skeleton/Skeleton.vue.d.ts +4 -0
- package/dist/Components/Skeleton/Skeleton.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/Components/Skeleton/composables/useSkeleton.d.ts +9 -0
- package/dist/Components/Skeleton/composables/useSkeleton.js +33 -0
- package/dist/Components/Skeleton/index.d.ts +3 -0
- package/dist/Components/Skeleton/index.js +3 -0
- package/dist/Components/Skeleton/skeleton.types.d.ts +24 -0
- package/dist/augments.d.ts +11 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +41 -37
- package/package.json +2 -2
|
@@ -34,10 +34,8 @@ var b = /* @__PURE__ */ u({
|
|
|
34
34
|
variant: "solid",
|
|
35
35
|
density: "default"
|
|
36
36
|
});
|
|
37
|
-
return (i, u) => (p(), o(m(g(S)), d({
|
|
37
|
+
return (i, u) => (p(), o(m(g(S)), d({ href: g(D) }, g(E), {
|
|
38
38
|
type: g(O),
|
|
39
|
-
href: g(D)
|
|
40
|
-
}, g(E), {
|
|
41
39
|
disabled: g(M),
|
|
42
40
|
"aria-busy": g(j),
|
|
43
41
|
"aria-disabled": g(I)
|
|
@@ -62,8 +60,8 @@ var b = /* @__PURE__ */ u({
|
|
|
62
60
|
], 64))]),
|
|
63
61
|
_: 1
|
|
64
62
|
}, 16, [
|
|
65
|
-
"type",
|
|
66
63
|
"href",
|
|
64
|
+
"type",
|
|
67
65
|
"disabled",
|
|
68
66
|
"aria-busy",
|
|
69
67
|
"aria-disabled"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
2
|
import { computed as r, useAttrs as i } from "vue";
|
|
3
|
-
import { get as a,
|
|
4
|
-
import { cn as
|
|
5
|
-
import { densityProps as
|
|
3
|
+
import { get as a, includes as o, isNil as s } from "es-toolkit/compat";
|
|
4
|
+
import { cn as c, mergeBridgeUILayeredClasses as l, splitComponentProps as u } from "@bridge-ui/core";
|
|
5
|
+
import { densityProps as d, roundedProps as f, variantProps as p } from "@bridge-ui/core/Components/Button";
|
|
6
6
|
//#region src/Components/Button/composables/useButton.ts
|
|
7
|
-
var
|
|
7
|
+
var m = [
|
|
8
8
|
"as",
|
|
9
9
|
"full",
|
|
10
10
|
"href",
|
|
@@ -22,70 +22,78 @@ var p = [
|
|
|
22
22
|
"startIcon",
|
|
23
23
|
"customProps"
|
|
24
24
|
];
|
|
25
|
-
function
|
|
26
|
-
let
|
|
27
|
-
bridgeKeys:
|
|
25
|
+
function h(h, g) {
|
|
26
|
+
let _ = i(), v = r(() => u({
|
|
27
|
+
bridgeKeys: m,
|
|
28
28
|
props: {
|
|
29
|
-
...
|
|
30
|
-
...
|
|
29
|
+
..._,
|
|
30
|
+
...h
|
|
31
31
|
}
|
|
32
|
-
})), { merged:
|
|
33
|
-
libDefaults:
|
|
32
|
+
})), { merged: y, entry: b } = t({
|
|
33
|
+
libDefaults: g,
|
|
34
34
|
componentName: "Button",
|
|
35
|
-
props: () =>
|
|
36
|
-
}),
|
|
37
|
-
entry:
|
|
38
|
-
props: () =>
|
|
39
|
-
}),
|
|
40
|
-
if (!(!
|
|
41
|
-
}), M = r(() =>
|
|
35
|
+
props: () => v.value.componentProps
|
|
36
|
+
}), x = r(() => y.value.customProps), S = n({
|
|
37
|
+
entry: b,
|
|
38
|
+
props: () => v.value.componentProps
|
|
39
|
+
}), C = r(() => y.value.as ?? "button"), w = r(() => C.value === "a"), T = r(() => C.value === "button"), E = r(() => y.value.density === "mini"), D = r(() => y.value.disabled || y.value.loading), O = r(() => T.value ? D.value : void 0), k = r(() => y.value.loading ? !0 : void 0), A = r(() => D.value && !T.value ? !0 : void 0), j = r(() => {
|
|
40
|
+
if (!(!w.value || D.value || !y.value.href)) return y.value.href;
|
|
41
|
+
}), M = r(() => {
|
|
42
|
+
if (!T.value) return;
|
|
43
|
+
let e = a(v.value.inheritedAttrs, "type");
|
|
44
|
+
return o([
|
|
45
|
+
"submit",
|
|
46
|
+
"reset",
|
|
47
|
+
"button"
|
|
48
|
+
], e) ? e : "button";
|
|
49
|
+
}), N = r(() => a(l(d, b.value?.customProps?.density), [y.value.density, y.value.size])), P = r(() => s(v.value.componentProps.variant) ? E.value ? "flat" : y.value.variant : v.value.componentProps.variant), F = r(() => a(l(p, b.value?.customProps?.variant), [P.value, y.value.color])), I = r(() => a(l(f, b.value?.customProps?.rounded), y.value.rounded));
|
|
42
50
|
return {
|
|
43
|
-
tag:
|
|
44
|
-
merged:
|
|
45
|
-
isMini:
|
|
46
|
-
iconBind: r(() => e(
|
|
51
|
+
tag: C,
|
|
52
|
+
merged: y,
|
|
53
|
+
isMini: E,
|
|
54
|
+
iconBind: r(() => e(x.value?.icon, {}, c({
|
|
47
55
|
"shrink-0": !0,
|
|
48
|
-
[
|
|
56
|
+
[S.value.icon ?? ""]: !0
|
|
49
57
|
}))),
|
|
50
|
-
rootBind: r(() => e(
|
|
58
|
+
rootBind: r(() => e(x.value?.root, v.value.inheritedAttrs, c({
|
|
51
59
|
"inline-flex items-center justify-center": !0,
|
|
52
60
|
"cursor-pointer outline-none outline-hidden": !0,
|
|
53
|
-
"shrink-0":
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
"w-full": !
|
|
57
|
-
"w-fit": !
|
|
58
|
-
"group hover:shadow-xs": !
|
|
59
|
-
[a(
|
|
60
|
-
[a(
|
|
61
|
-
[a(
|
|
61
|
+
"shrink-0": E.value,
|
|
62
|
+
[N.value ?? ""]: !0,
|
|
63
|
+
[I.value ?? ""]: !0,
|
|
64
|
+
"w-full": !E.value && y.value.full,
|
|
65
|
+
"w-fit": !E.value && !y.value.full,
|
|
66
|
+
"group hover:shadow-xs": !E.value,
|
|
67
|
+
[a(F.value, "base") ?? ""]: !0,
|
|
68
|
+
[a(F.value, "hover") ?? ""]: !0,
|
|
69
|
+
[a(F.value, "focus") ?? ""]: !0,
|
|
62
70
|
"transition-all ease-in-out duration-200": !0,
|
|
63
71
|
"focus:ring-2": !0,
|
|
64
72
|
"focus:ring-offset-background-white dark:focus:ring-offset-background-dark": !0,
|
|
65
73
|
"disabled:opacity-80 disabled:cursor-not-allowed": !0,
|
|
66
74
|
"aria-disabled:opacity-80 aria-disabled:cursor-not-allowed aria-disabled:pointer-events-none": !0,
|
|
67
|
-
[
|
|
75
|
+
[S.value.root ?? ""]: !0
|
|
68
76
|
}))),
|
|
69
77
|
rootHref: j,
|
|
70
|
-
rootType:
|
|
71
|
-
endIconBind: r(() => e(
|
|
78
|
+
rootType: M,
|
|
79
|
+
endIconBind: r(() => e(x.value?.endIcon, {}, c({
|
|
72
80
|
"shrink-0": !0,
|
|
73
|
-
[
|
|
81
|
+
[S.value.endIcon ?? ""]: !0
|
|
74
82
|
}))),
|
|
75
|
-
endSlotBind: r(() => e(
|
|
83
|
+
endSlotBind: r(() => e(x.value?.end, {}, "inline-flex shrink-0 items-center")),
|
|
76
84
|
rootAriaBusy: k,
|
|
77
85
|
rootDisabled: O,
|
|
78
|
-
startIconBind: r(() => e(
|
|
86
|
+
startIconBind: r(() => e(x.value?.startIcon, {}, c({
|
|
79
87
|
"shrink-0": !0,
|
|
80
|
-
[
|
|
88
|
+
[S.value.startIcon ?? ""]: !0
|
|
81
89
|
}))),
|
|
82
|
-
startSlotBind: r(() => e(
|
|
83
|
-
loadingIconBind: r(() => e(
|
|
90
|
+
startSlotBind: r(() => e(x.value?.start, {}, "inline-flex shrink-0 items-center")),
|
|
91
|
+
loadingIconBind: r(() => e(x.value?.loading, {}, c({
|
|
84
92
|
"shrink-0 animate-spin": !0,
|
|
85
|
-
[
|
|
93
|
+
[S.value.loading ?? ""]: !0
|
|
86
94
|
}))),
|
|
87
95
|
rootAriaDisabled: A
|
|
88
96
|
};
|
|
89
97
|
}
|
|
90
98
|
//#endregion
|
|
91
|
-
export {
|
|
99
|
+
export { h as useButton };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DividerOwnProps } from './divider.types';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<DividerOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<DividerOwnProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useDivider as e } from "./composables/useDivider.js";
|
|
2
|
+
import { createElementBlock as t, defineComponent as n, guardReactiveProps as r, normalizeProps as i, openBlock as a, unref as o } from "vue";
|
|
3
|
+
//#region src/Components/Divider/Divider.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var s = /* @__PURE__ */ n({
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "Divider",
|
|
7
|
+
props: {
|
|
8
|
+
classes: {},
|
|
9
|
+
color: {},
|
|
10
|
+
orientation: {}
|
|
11
|
+
},
|
|
12
|
+
setup(n) {
|
|
13
|
+
let { rootBind: s } = e(n, {
|
|
14
|
+
color: "dark",
|
|
15
|
+
orientation: "horizontal"
|
|
16
|
+
});
|
|
17
|
+
return (e, n) => (a(), t("hr", i(r(o(s))), null, 16));
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
export { s as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
|
|
2
|
+
import { DividerOwnProps, DividerProps } from '../divider.types';
|
|
3
|
+
type DividerLibDefaults = LibDefaultsShape<DividerOwnProps, "color" | "orientation">;
|
|
4
|
+
type DividerMerged = MergeLibDefaults<DividerOwnProps, DividerLibDefaults>;
|
|
5
|
+
export declare function useDivider(props: DividerOwnProps, libDefaults: DividerLibDefaults): {
|
|
6
|
+
merged: import('vue').ComputedRef<DividerMerged>;
|
|
7
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
8
|
+
role: string;
|
|
9
|
+
"aria-orientation": NonNullable<keyof import('@bridge-ui/core').DividerOrientation | undefined>;
|
|
10
|
+
class: string;
|
|
11
|
+
}, "class", {}, Omit<DividerProps, "color" | "orientation" | "classes">>>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
|
+
import { computed as r, useAttrs as i } from "vue";
|
|
3
|
+
import { get as a } from "es-toolkit/compat";
|
|
4
|
+
import { cn as o, mergeBridgeUILayeredClasses as s, splitComponentProps as c } from "@bridge-ui/core";
|
|
5
|
+
import { colorProps as l, orientationProps as u } from "@bridge-ui/core/Components/Divider";
|
|
6
|
+
//#region src/Components/Divider/composables/useDivider.ts
|
|
7
|
+
var d = [
|
|
8
|
+
"color",
|
|
9
|
+
"classes",
|
|
10
|
+
"orientation"
|
|
11
|
+
];
|
|
12
|
+
function f(f, p) {
|
|
13
|
+
let m = i(), h = r(() => c({
|
|
14
|
+
props: {
|
|
15
|
+
...m,
|
|
16
|
+
...f
|
|
17
|
+
},
|
|
18
|
+
bridgeKeys: d
|
|
19
|
+
})), { merged: g, entry: _ } = t({
|
|
20
|
+
libDefaults: p,
|
|
21
|
+
componentName: "Divider",
|
|
22
|
+
props: () => h.value.componentProps
|
|
23
|
+
}), v = n({
|
|
24
|
+
entry: _,
|
|
25
|
+
props: () => h.value.componentProps
|
|
26
|
+
}), y = r(() => a(s(l, _.value?.customProps?.color), g.value.color)), b = r(() => a(s(u, _.value?.customProps?.orientation), g.value.orientation));
|
|
27
|
+
return {
|
|
28
|
+
merged: g,
|
|
29
|
+
rootBind: r(() => e({}, h.value.inheritedAttrs, {
|
|
30
|
+
role: "separator",
|
|
31
|
+
"aria-orientation": g.value.orientation,
|
|
32
|
+
class: o({
|
|
33
|
+
"m-0 shrink-0 border-0": !0,
|
|
34
|
+
[y.value ?? ""]: !0,
|
|
35
|
+
[b.value ?? ""]: !0,
|
|
36
|
+
[v.value.root ?? ""]: !0
|
|
37
|
+
})
|
|
38
|
+
}))
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { f as useDivider };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { DividerColor, DividerOrientation, MergeHtmlProps, MergeProps } from '@bridge-ui/core';
|
|
3
|
+
export interface DividerColorOverrides {}
|
|
4
|
+
export interface DividerOrientationOverrides {}
|
|
5
|
+
export interface DividerClasses {
|
|
6
|
+
/**
|
|
7
|
+
* The classes to apply to the root.
|
|
8
|
+
*/
|
|
9
|
+
root?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface DividerOwnProps {
|
|
12
|
+
/**
|
|
13
|
+
* The classes to apply to the divider.
|
|
14
|
+
*
|
|
15
|
+
* @default undefined
|
|
16
|
+
*/
|
|
17
|
+
classes?: DividerClasses;
|
|
18
|
+
/**
|
|
19
|
+
* The color of the divider.
|
|
20
|
+
*
|
|
21
|
+
* @default "dark"
|
|
22
|
+
*/
|
|
23
|
+
color?: MergeProps<DividerColor, DividerColorOverrides>;
|
|
24
|
+
/**
|
|
25
|
+
* The orientation of the divider.
|
|
26
|
+
*
|
|
27
|
+
* @default "horizontal"
|
|
28
|
+
*/
|
|
29
|
+
orientation?: MergeProps<DividerOrientation, DividerOrientationOverrides>;
|
|
30
|
+
}
|
|
31
|
+
export type DividerProps = MergeHtmlProps<DividerOwnProps, HTMLAttributes>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { hasNamedSlot as e, resolveNamedSlot as t, resolveSlotOrProp as n } from "../../Utils/slotOrProp.js";
|
|
2
|
+
import r from "../Icon/Icon.js";
|
|
3
|
+
import { resolveListItemPrimary as i, useListItem as a } from "./composables/useListItem.js";
|
|
4
|
+
import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, defineComponent as d, guardReactiveProps as f, mergeProps as p, normalizeClass as m, normalizeProps as h, openBlock as g, resolveDynamicComponent as _, unref as v, useSlots as y, withCtx as b } from "vue";
|
|
4
5
|
//#region src/Components/ListItem/ListItem.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var x = /* @__PURE__ */ d({
|
|
6
7
|
inheritAttrs: !1,
|
|
7
8
|
__name: "ListItem",
|
|
8
9
|
props: {
|
|
@@ -29,29 +30,30 @@ var y = /* @__PURE__ */ l({
|
|
|
29
30
|
selected: {
|
|
30
31
|
type: Boolean,
|
|
31
32
|
default: !1
|
|
32
|
-
}
|
|
33
|
+
},
|
|
34
|
+
selectedIcon: {}
|
|
33
35
|
},
|
|
34
|
-
setup(
|
|
35
|
-
let
|
|
36
|
+
setup(d) {
|
|
37
|
+
let x = y(), S = d, { merged: C, hasEnd: w, endBind: T, rootBind: E, rowClass: D, hasStart: O, startBind: k, hasPrimary: A, contentBind: j, primaryBind: M, hasSecondary: N, secondaryBind: P, interactiveBind: F, selectedIconBind: I, resolvedSelectedIcon: L } = a(S, {
|
|
36
38
|
role: "button",
|
|
37
39
|
align: "center"
|
|
38
|
-
},
|
|
39
|
-
return (
|
|
40
|
-
default:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
], 2)], 16)) : (
|
|
40
|
+
}, x), R = o(() => C.value.as ?? "li"), z = o(() => i(x, S.primary)), B = o(() => n(x, "secondary", S.secondary)), V = o(() => e(x, "end"));
|
|
41
|
+
return (e, n) => (g(), s(_(R.value), h(f(v(E))), {
|
|
42
|
+
default: b(() => [v(F) ? (g(), l("div", h(p({ key: 0 }, v(F))), [u("div", { class: m(v(D)) }, [
|
|
43
|
+
v(O) ? (g(), l("div", h(p({ key: 0 }, v(k))), [(g(), s(_(v(t)(v(x), "start"))))], 16)) : c("", !0),
|
|
44
|
+
u("div", h(f(v(j))), [v(A) ? (g(), l("span", h(p({ key: 0 }, v(M))), [(g(), s(_(z.value)))], 16)) : c("", !0), v(N) ? (g(), l("span", h(p({ key: 1 }, v(P))), [(g(), s(_(B.value)))], 16)) : c("", !0)], 16),
|
|
45
|
+
v(w) ? (g(), l("div", h(p({ key: 1 }, v(T))), [V.value ? (g(), s(_(v(t)(v(x), "end")), { key: 0 })) : v(L) ? (g(), s(r, p({ key: 1 }, v(I), { icon: v(L) }), null, 16, ["icon"])) : c("", !0)], 16)) : c("", !0)
|
|
46
|
+
], 2)], 16)) : (g(), l("div", {
|
|
45
47
|
key: 1,
|
|
46
|
-
class:
|
|
48
|
+
class: m(v(D))
|
|
47
49
|
}, [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
v(O) ? (g(), l("div", h(p({ key: 0 }, v(k))), [(g(), s(_(v(t)(v(x), "start"))))], 16)) : c("", !0),
|
|
51
|
+
u("div", h(f(v(j))), [v(A) ? (g(), l("span", h(p({ key: 0 }, v(M))), [(g(), s(_(z.value)))], 16)) : c("", !0), v(N) ? (g(), l("span", h(p({ key: 1 }, v(P))), [(g(), s(_(B.value)))], 16)) : c("", !0)], 16),
|
|
52
|
+
v(w) ? (g(), l("div", h(p({ key: 1 }, v(T))), [V.value ? (g(), s(_(v(t)(v(x), "end")), { key: 0 })) : v(L) ? (g(), s(r, p({ key: 1 }, v(I), { icon: v(L) }), null, 16, ["icon"])) : c("", !0)], 16)) : c("", !0)
|
|
51
53
|
], 2))]),
|
|
52
54
|
_: 1
|
|
53
55
|
}, 16));
|
|
54
56
|
}
|
|
55
57
|
});
|
|
56
58
|
//#endregion
|
|
57
|
-
export {
|
|
59
|
+
export { x as default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LucideIcon } from '@lucide/vue';
|
|
1
2
|
import { useSlots, Slot } from 'vue';
|
|
2
3
|
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
|
|
3
4
|
import { ListItemOwnProps, ListItemProps } from '../listItem.types';
|
|
@@ -11,7 +12,7 @@ export declare function useListItem(props: ListItemOwnProps, libDefaults: ListIt
|
|
|
11
12
|
}, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
12
13
|
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
13
14
|
class: string;
|
|
14
|
-
}, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListItemProps, "role" | "classes" | "customProps" | "primary" | "secondary" | "as" | "disabled" | "dense" | "align" | "divider" | "interactive" | "selected">, never>>>;
|
|
15
|
+
}, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListItemProps, "role" | "classes" | "customProps" | "primary" | "secondary" | "as" | "disabled" | "dense" | "align" | "divider" | "interactive" | "selected" | "selectedIcon">, never>>>;
|
|
15
16
|
rowClass: import('vue').ComputedRef<string>;
|
|
16
17
|
hasStart: import('vue').ComputedRef<boolean>;
|
|
17
18
|
startBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
@@ -35,6 +36,11 @@ export declare function useListItem(props: ListItemOwnProps, libDefaults: ListIt
|
|
|
35
36
|
"data-selected": boolean | undefined;
|
|
36
37
|
class: string;
|
|
37
38
|
} & object & Record<"class", string>) | null>;
|
|
39
|
+
selectedIconBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
40
|
+
size: "sm";
|
|
41
|
+
class: string;
|
|
42
|
+
}, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
|
43
|
+
resolvedSelectedIcon: import('vue').ComputedRef<LucideIcon | null>;
|
|
38
44
|
};
|
|
39
45
|
export declare function resolveListItemPrimary(slots: ReturnType<typeof useSlots>, primary?: string): Slot | (() => null | string);
|
|
40
46
|
export {};
|
|
@@ -2,11 +2,12 @@ import { hasNamedSlot as e, isPropPresent as t, resolveNamedSlot as n } from "..
|
|
|
2
2
|
import { mergePartBind as r, useBridgeUIComponent as i, useBridgeUIMergedRegistryClasses as a } from "../../../Utils/index.js";
|
|
3
3
|
import { LIST_INJECTION_KEY as o } from "../../List/listInjectionKey.js";
|
|
4
4
|
import { computed as s, getCurrentInstance as c, inject as l, toValue as u, useAttrs as d } from "vue";
|
|
5
|
-
import { get as f,
|
|
6
|
-
import { cn as
|
|
7
|
-
import {
|
|
5
|
+
import { get as f, isNull as p, omit as m } from "es-toolkit/compat";
|
|
6
|
+
import { cn as h, mergeBridgeUILayeredClasses as g, splitComponentProps as _ } from "@bridge-ui/core";
|
|
7
|
+
import { Check as v } from "@lucide/vue";
|
|
8
|
+
import { alignProps as y } from "@bridge-ui/core/Components/ListItem";
|
|
8
9
|
//#region src/Components/ListItem/composables/useListItem.ts
|
|
9
|
-
var
|
|
10
|
+
var b = [
|
|
10
11
|
"as",
|
|
11
12
|
"role",
|
|
12
13
|
"align",
|
|
@@ -18,82 +19,91 @@ var v = [
|
|
|
18
19
|
"selected",
|
|
19
20
|
"secondary",
|
|
20
21
|
"customProps",
|
|
21
|
-
"interactive"
|
|
22
|
+
"interactive",
|
|
23
|
+
"selectedIcon"
|
|
22
24
|
];
|
|
23
|
-
function
|
|
24
|
-
let
|
|
25
|
+
function x(t, n, x) {
|
|
26
|
+
let S = d(), C = l(o, null), w = s(() => _({
|
|
25
27
|
props: {
|
|
26
|
-
...
|
|
28
|
+
...S,
|
|
27
29
|
...t
|
|
28
30
|
},
|
|
29
|
-
bridgeKeys:
|
|
30
|
-
})), { merged:
|
|
31
|
+
bridgeKeys: b
|
|
32
|
+
})), { merged: T, entry: E } = i({
|
|
31
33
|
libDefaults: n,
|
|
32
34
|
componentName: "ListItem",
|
|
33
|
-
props: () =>
|
|
34
|
-
}),
|
|
35
|
-
entry:
|
|
36
|
-
props: () =>
|
|
37
|
-
}),
|
|
35
|
+
props: () => w.value.componentProps
|
|
36
|
+
}), D = s(() => T.value.customProps), O = a({
|
|
37
|
+
entry: E,
|
|
38
|
+
props: () => w.value.componentProps
|
|
39
|
+
}), k = s(() => "dense" in (c()?.vnode.props ?? {}) ? t.dense === !0 : t.dense === !0 ? !0 : C ? u(C).dense : !1), A = s(() => f(g(y, E.value?.customProps?.align), T.value.align)), j = s(() => e(x, "primary") || e(x, "default") || !!T.value.primary), M = s(() => e(x, "secondary") || !!T.value.secondary), N = s(() => e(x, "start")), P = s(() => !T.value.selected || p(T.value.selectedIcon) ? null : T.value.selectedIcon ?? v), F = s(() => e(x, "end") || P.value != null), I = s(() => m(w.value.inheritedAttrs, [])), L = s(() => r(D.value?.root, I.value, { class: h({
|
|
38
40
|
"list-none": !0,
|
|
39
|
-
"border-b border-black/10 last:border-b-0":
|
|
40
|
-
[f(
|
|
41
|
-
}) })),
|
|
42
|
-
role:
|
|
43
|
-
tabindex:
|
|
44
|
-
"aria-disabled":
|
|
45
|
-
"data-selected":
|
|
46
|
-
class:
|
|
41
|
+
"border-b border-black/10 last:border-b-0": T.value.divider,
|
|
42
|
+
[f(O.value, "root") ?? ""]: !0
|
|
43
|
+
}) })), R = s(() => T.value.interactive ? r(D.value?.interactive, {}, {
|
|
44
|
+
role: T.value.role,
|
|
45
|
+
tabindex: T.value.disabled ? -1 : 0,
|
|
46
|
+
"aria-disabled": T.value.disabled ? !0 : void 0,
|
|
47
|
+
"data-selected": T.value.selected ? !0 : void 0,
|
|
48
|
+
class: h({
|
|
47
49
|
"flex w-full min-w-0 gap-x-3 text-left outline-hidden transition-colors": !0,
|
|
48
|
-
"cursor-pointer select-none": !
|
|
50
|
+
"cursor-pointer select-none": !T.value.disabled,
|
|
49
51
|
"px-4": !0,
|
|
50
|
-
"py-2": !
|
|
51
|
-
"py-1.5":
|
|
52
|
-
"hover:bg-black/5 focus-visible:bg-black/5": !
|
|
53
|
-
"bg-primary-50 text-primary-700":
|
|
54
|
-
"opacity-50 pointer-events-none":
|
|
55
|
-
[
|
|
56
|
-
[f(
|
|
52
|
+
"py-2": !k.value,
|
|
53
|
+
"py-1.5": k.value,
|
|
54
|
+
"hover:bg-black/5 focus-visible:bg-black/5": !T.value.disabled,
|
|
55
|
+
"bg-primary-50 text-primary-700": T.value.selected,
|
|
56
|
+
"opacity-50 pointer-events-none": T.value.disabled,
|
|
57
|
+
[A.value ?? ""]: !0,
|
|
58
|
+
[f(O.value, "interactive") ?? ""]: !0
|
|
57
59
|
})
|
|
58
|
-
}) : null),
|
|
60
|
+
}) : null), z = s(() => h({
|
|
59
61
|
"flex w-full min-w-0 gap-x-3": !0,
|
|
60
|
-
"px-4": !
|
|
61
|
-
"py-2": !
|
|
62
|
-
"py-1.5": !
|
|
63
|
-
[
|
|
64
|
-
})),
|
|
62
|
+
"px-4": !T.value.interactive,
|
|
63
|
+
"py-2": !T.value.interactive && !k.value,
|
|
64
|
+
"py-1.5": !T.value.interactive && k.value,
|
|
65
|
+
[A.value ?? ""]: !T.value.interactive
|
|
66
|
+
})), B = s(() => r(D.value?.start, {}, { class: h({
|
|
65
67
|
"flex shrink-0": !0,
|
|
66
|
-
[f(
|
|
67
|
-
}) })),
|
|
68
|
+
[f(O.value, "start") ?? ""]: !0
|
|
69
|
+
}) })), V = s(() => r(D.value?.content, {}, { class: h({
|
|
68
70
|
"min-w-0 flex-1": !0,
|
|
69
|
-
[f(
|
|
70
|
-
}) })),
|
|
71
|
+
[f(O.value, "content") ?? ""]: !0
|
|
72
|
+
}) })), H = s(() => r(D.value?.primary, {}, { class: h({
|
|
71
73
|
"block truncate text-sm font-medium": !0,
|
|
72
|
-
[f(
|
|
73
|
-
}) })),
|
|
74
|
+
[f(O.value, "primary") ?? ""]: !0
|
|
75
|
+
}) })), U = s(() => r(D.value?.secondary, {}, { class: h({
|
|
74
76
|
"mt-0.5 block truncate text-xs text-dark-500": !0,
|
|
75
|
-
[f(
|
|
77
|
+
[f(O.value, "secondary") ?? ""]: !0
|
|
76
78
|
}) }));
|
|
77
79
|
return {
|
|
78
|
-
merged:
|
|
79
|
-
hasEnd:
|
|
80
|
-
endBind: s(() => r(
|
|
80
|
+
merged: T,
|
|
81
|
+
hasEnd: F,
|
|
82
|
+
endBind: s(() => r(D.value?.end, {}, { class: h({
|
|
81
83
|
"ml-auto flex shrink-0 items-center": !0,
|
|
82
|
-
[f(
|
|
84
|
+
[f(O.value, "end") ?? ""]: !0
|
|
83
85
|
}) })),
|
|
84
|
-
rootBind:
|
|
85
|
-
rowClass:
|
|
86
|
-
hasStart:
|
|
87
|
-
startBind:
|
|
88
|
-
hasPrimary:
|
|
89
|
-
contentBind:
|
|
90
|
-
primaryBind:
|
|
91
|
-
hasSecondary:
|
|
92
|
-
secondaryBind:
|
|
93
|
-
interactiveBind:
|
|
86
|
+
rootBind: L,
|
|
87
|
+
rowClass: z,
|
|
88
|
+
hasStart: N,
|
|
89
|
+
startBind: B,
|
|
90
|
+
hasPrimary: j,
|
|
91
|
+
contentBind: V,
|
|
92
|
+
primaryBind: H,
|
|
93
|
+
hasSecondary: M,
|
|
94
|
+
secondaryBind: U,
|
|
95
|
+
interactiveBind: R,
|
|
96
|
+
selectedIconBind: s(() => r(D.value?.selectedIcon, {}, {
|
|
97
|
+
size: "sm",
|
|
98
|
+
class: h({
|
|
99
|
+
"shrink-0": !0,
|
|
100
|
+
[f(O.value, "selectedIcon") ?? ""]: !0
|
|
101
|
+
})
|
|
102
|
+
})),
|
|
103
|
+
resolvedSelectedIcon: P
|
|
94
104
|
};
|
|
95
105
|
}
|
|
96
|
-
function
|
|
106
|
+
function S(r, i) {
|
|
97
107
|
if (e(r, "primary")) return n(r, "primary");
|
|
98
108
|
if (e(r, "default")) return n(r, "default");
|
|
99
109
|
if (!t(i)) return () => null;
|
|
@@ -101,4 +111,4 @@ function b(r, i) {
|
|
|
101
111
|
return () => a;
|
|
102
112
|
}
|
|
103
113
|
//#endregion
|
|
104
|
-
export {
|
|
114
|
+
export { S as resolveListItemPrimary, x as useListItem };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { LucideIcon } from '@lucide/vue';
|
|
1
2
|
import { HTMLAttributes, Slot, VNode } from 'vue';
|
|
2
3
|
import { ListItemAlign, MergeHtmlProps, MergeProps } from '@bridge-ui/core';
|
|
4
|
+
import { IconProps } from '../Icon';
|
|
3
5
|
export interface ListItemAlignOverrides {}
|
|
4
6
|
export interface ListItemClasses {
|
|
5
7
|
/**
|
|
@@ -26,6 +28,10 @@ export interface ListItemClasses {
|
|
|
26
28
|
* The classes to apply to the secondary text.
|
|
27
29
|
*/
|
|
28
30
|
secondary?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The classes to apply to the selected icon.
|
|
33
|
+
*/
|
|
34
|
+
selectedIcon?: string;
|
|
29
35
|
/**
|
|
30
36
|
* The classes to apply to the leading slot.
|
|
31
37
|
*/
|
|
@@ -56,6 +62,10 @@ export interface ListItemCustomProps {
|
|
|
56
62
|
* Props forwarded to the secondary text.
|
|
57
63
|
*/
|
|
58
64
|
secondary?: HTMLAttributes;
|
|
65
|
+
/**
|
|
66
|
+
* Props forwarded to the default selected `Icon` (`icon` is set by the item).
|
|
67
|
+
*/
|
|
68
|
+
selectedIcon?: Partial<Omit<IconProps, "icon">>;
|
|
59
69
|
/**
|
|
60
70
|
* Props forwarded to the leading slot wrapper.
|
|
61
71
|
*/
|
|
@@ -137,6 +147,13 @@ export interface ListItemOwnProps {
|
|
|
137
147
|
* @default false
|
|
138
148
|
*/
|
|
139
149
|
selected?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* The icon shown when `selected` is true. Use `null` to hide it.
|
|
152
|
+
* The `end` slot replaces this icon when provided.
|
|
153
|
+
*
|
|
154
|
+
* @default Check
|
|
155
|
+
*/
|
|
156
|
+
selectedIcon?: null | LucideIcon;
|
|
140
157
|
}
|
|
141
158
|
export type ListItemPrimaryContent = VNode | string | VNode[] | undefined;
|
|
142
159
|
export interface ListItemSlots {
|
|
@@ -59,32 +59,32 @@ var M = { key: 1 }, N = /* @__PURE__ */ m({
|
|
|
59
59
|
O(F, (e) => {
|
|
60
60
|
P("show-change", e);
|
|
61
61
|
});
|
|
62
|
-
let I = m, {
|
|
62
|
+
let I = m, { merged: L, checkClass: R, scrollBind: z, messageBind: B, loadingBind: V, sizeClasses: H, mergedClasses: U, loadingTrackBind: W, optionSelectedClass: G, optionHighlightedClass: K } = r(I, {
|
|
63
63
|
size: "md",
|
|
64
64
|
color: "primary"
|
|
65
|
-
}), q = s(() =>
|
|
66
|
-
function
|
|
65
|
+
}), q = s(() => !I.loading && I.options.length === 0 && I.hideEmptyMessage !== !0), J = s(() => A(R.value, U.value.check));
|
|
66
|
+
function Y(e) {
|
|
67
67
|
return I.isSelected?.(e) ?? !1;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function X(e) {
|
|
70
70
|
return I.highlightedIndex === e;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Z(e) {
|
|
73
73
|
e.preventDefault();
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Q(e, t) {
|
|
76
76
|
let n = {
|
|
77
77
|
tabindex: -1,
|
|
78
|
-
onMousedown:
|
|
78
|
+
onMousedown: Z,
|
|
79
79
|
class: A(H.value?.option)
|
|
80
80
|
};
|
|
81
|
-
return
|
|
81
|
+
return Y(e.value) ? n.class = A(n.class, G.value, U.value.optionSelected) : X(t) && (n.class = A(n.class, K.value, U.value.optionHighlighted)), {
|
|
82
82
|
interactive: n,
|
|
83
83
|
primary: { class: H.value?.primary },
|
|
84
84
|
secondary: { class: H.value?.secondary }
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function $(e) {
|
|
88
88
|
e.disabled || P("select", e);
|
|
89
89
|
}
|
|
90
90
|
return (r, s) => (b(), c(T(a), {
|
|
@@ -93,12 +93,12 @@ var M = { key: 1 }, N = /* @__PURE__ */ m({
|
|
|
93
93
|
"anchor-el": m.anchorEl,
|
|
94
94
|
placement: m.placement,
|
|
95
95
|
"close-on-click-away": !0,
|
|
96
|
-
"
|
|
97
|
-
"
|
|
96
|
+
"disable-auto-focus": m.disableAutoFocus,
|
|
97
|
+
"custom-props": { content: T(L).customProps?.content }
|
|
98
98
|
}, {
|
|
99
99
|
default: k(() => [
|
|
100
100
|
T(e)(T(N), "beforeOptions") ? (b(), c(C(T(t)(T(N), "beforeOptions")), { key: 0 })) : l("", !0),
|
|
101
|
-
m.loading ? (b(), u(o, { key: 1 }, [d("div", y(h(T(W))), [d("div", y(h(T(V))), null, 16)], 16), d("div", y(h(T(B))), [T(e)(T(N), "loading") ? (b(), c(C(T(t)(T(N), "loading")), { key: 0 })) : (b(), u("span", M, w(m.loadingMessage), 1))], 16)], 64)) : (b(), u("div", y(_({ key: 2 }, T(
|
|
101
|
+
m.loading ? (b(), u(o, { key: 1 }, [d("div", y(h(T(W))), [d("div", y(h(T(V))), null, 16)], 16), d("div", y(h(T(B))), [T(e)(T(N), "loading") ? (b(), c(C(T(t)(T(N), "loading")), { key: 0 })) : (b(), u("span", M, w(m.loadingMessage), 1))], 16)], 64)) : (b(), u("div", y(_({ key: 2 }, T(z))), [p(T(n), {
|
|
102
102
|
dense: "",
|
|
103
103
|
role: "listbox",
|
|
104
104
|
padding: "none",
|
|
@@ -114,20 +114,20 @@ var M = { key: 1 }, N = /* @__PURE__ */ m({
|
|
|
114
114
|
key: String(t.value),
|
|
115
115
|
disabled: t.disabled,
|
|
116
116
|
secondary: t.description,
|
|
117
|
-
onClick: (e) =>
|
|
117
|
+
onClick: (e) => $(t),
|
|
118
118
|
id: `${m.listboxId}-option-${n}`,
|
|
119
|
-
"aria-selected":
|
|
120
|
-
"custom-props":
|
|
119
|
+
"aria-selected": Y(t.value),
|
|
120
|
+
"custom-props": Q(t, n)
|
|
121
121
|
}, f({ _: 2 }, [T(e)(T(N), "option") ? {
|
|
122
122
|
name: "default",
|
|
123
123
|
fn: k(() => [S(r.$slots, "option", {
|
|
124
124
|
option: t,
|
|
125
|
-
selected:
|
|
125
|
+
selected: Y(t.value)
|
|
126
126
|
})]),
|
|
127
127
|
key: "0"
|
|
128
|
-
} : void 0, m.showCheckmark &&
|
|
128
|
+
} : void 0, m.showCheckmark && Y(t.value) ? {
|
|
129
129
|
name: "end",
|
|
130
|
-
fn: k(() => [p(T(j), { class: v(
|
|
130
|
+
fn: k(() => [p(T(j), { class: v(J.value) }, null, 8, ["class"])]),
|
|
131
131
|
key: "1"
|
|
132
132
|
} : void 0]), 1032, [
|
|
133
133
|
"primary",
|
|
@@ -144,7 +144,7 @@ var M = { key: 1 }, N = /* @__PURE__ */ m({
|
|
|
144
144
|
"aria-labelledby",
|
|
145
145
|
"aria-multiselectable"
|
|
146
146
|
])], 16)),
|
|
147
|
-
|
|
147
|
+
q.value && !T(e)(T(N), "empty") ? (b(), u("div", y(_({ key: 3 }, T(B))), w(m.emptyMessage), 17)) : q.value && T(e)(T(N), "empty") ? (b(), c(C(T(t)(T(N), "empty")), { key: 4 })) : l("", !0),
|
|
148
148
|
T(e)(T(N), "afterOptions") ? (b(), c(C(T(t)(T(N), "afterOptions")), { key: 5 })) : l("", !0)
|
|
149
149
|
]),
|
|
150
150
|
_: 3
|
|
@@ -152,8 +152,8 @@ var M = { key: 1 }, N = /* @__PURE__ */ m({
|
|
|
152
152
|
"modelValue",
|
|
153
153
|
"anchor-el",
|
|
154
154
|
"placement",
|
|
155
|
-
"
|
|
156
|
-
"
|
|
155
|
+
"disable-auto-focus",
|
|
156
|
+
"custom-props"
|
|
157
157
|
]));
|
|
158
158
|
}
|
|
159
159
|
});
|
|
@@ -7,7 +7,6 @@ export declare function useListbox(props: ListboxOwnProps, libDefaults: ListboxL
|
|
|
7
7
|
merged: import('vue').ComputedRef<ListboxMerged>;
|
|
8
8
|
checkClass: import('vue').ComputedRef<string>;
|
|
9
9
|
scrollBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
10
|
-
contentBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
11
10
|
messageBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {}, {}>>;
|
|
12
11
|
loadingBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
13
12
|
sizeClasses: import('vue').ComputedRef<import('@bridge-ui/core').ListboxSizeItem | undefined>;
|
|
@@ -27,17 +27,17 @@ function p(p, m) {
|
|
|
27
27
|
}), y = n({
|
|
28
28
|
entry: v,
|
|
29
29
|
props: () => g.value.componentProps
|
|
30
|
-
}), b = r(() => a(s(l, v.value?.customProps?.color), _.value.color ?? "primary")), x = r(() => s(u, v.value?.customProps?.invalidated)), S = r(() => _.value.invalidated ? x.value : b.value), C = r(() => a(s(d, v.value?.customProps?.size), _.value.size ?? "md")), w = r(() => S.value?.selected), T = r(() => S.value?.highlighted), E = r(() => o(C.value?.check, S.value?.check)), D = r(() =>
|
|
30
|
+
}), b = r(() => a(s(l, v.value?.customProps?.color), _.value.color ?? "primary")), x = r(() => s(u, v.value?.customProps?.invalidated)), S = r(() => _.value.invalidated ? x.value : b.value), C = r(() => a(s(d, v.value?.customProps?.size), _.value.size ?? "md")), w = r(() => S.value?.selected), T = r(() => S.value?.highlighted), E = r(() => o(C.value?.check, S.value?.check)), D = r(() => {
|
|
31
31
|
let t = _.value.maxHeight ?? "max-h-60", n = _.value.disableMaxHeight === !0;
|
|
32
32
|
return e(_.value.customProps?.scroll, {}, o({
|
|
33
33
|
"overflow-y-auto overscroll-contain": !n,
|
|
34
34
|
[t]: !n,
|
|
35
35
|
[y.value.scroll ?? ""]: !0
|
|
36
36
|
}));
|
|
37
|
-
}),
|
|
37
|
+
}), O = r(() => e({}, {
|
|
38
38
|
role: "progressbar",
|
|
39
39
|
"aria-hidden": !0
|
|
40
|
-
}, o({ "h-0.5 w-full shrink-0 overflow-hidden": !0 }))),
|
|
40
|
+
}, o({ "h-0.5 w-full shrink-0 overflow-hidden": !0 }))), k = r(() => e(_.value.customProps?.loading, {}, o({
|
|
41
41
|
"h-full w-1/3 animate-bridge-listbox-indeterminate": !0,
|
|
42
42
|
[b.value?.progressColor ?? ""]: !0,
|
|
43
43
|
[y.value.loading ?? ""]: !0
|
|
@@ -45,16 +45,15 @@ function p(p, m) {
|
|
|
45
45
|
return {
|
|
46
46
|
merged: _,
|
|
47
47
|
checkClass: E,
|
|
48
|
-
scrollBind:
|
|
49
|
-
contentBind: D,
|
|
48
|
+
scrollBind: D,
|
|
50
49
|
messageBind: r(() => e({}, {}, o({
|
|
51
50
|
"text-gray-500": !0,
|
|
52
51
|
[C.value?.message ?? ""]: !0
|
|
53
52
|
}))),
|
|
54
|
-
loadingBind:
|
|
53
|
+
loadingBind: k,
|
|
55
54
|
sizeClasses: C,
|
|
56
55
|
mergedClasses: y,
|
|
57
|
-
loadingTrackBind:
|
|
56
|
+
loadingTrackBind: O,
|
|
58
57
|
optionSelectedClass: w,
|
|
59
58
|
optionHighlightedClass: T
|
|
60
59
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SkeletonOwnProps } from './skeleton.types';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<SkeletonOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SkeletonOwnProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useSkeleton as e } from "./composables/useSkeleton.js";
|
|
2
|
+
import { createElementBlock as t, defineComponent as n, guardReactiveProps as r, normalizeProps as i, openBlock as a, unref as o } from "vue";
|
|
3
|
+
//#region src/Components/Skeleton/Skeleton.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var s = /* @__PURE__ */ n({
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "Skeleton",
|
|
7
|
+
props: {
|
|
8
|
+
classes: {},
|
|
9
|
+
rounded: {}
|
|
10
|
+
},
|
|
11
|
+
setup(n) {
|
|
12
|
+
let { rootBind: s } = e(n, { rounded: "md" });
|
|
13
|
+
return (e, n) => (a(), t("div", i(r(o(s))), null, 16));
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { s as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
|
|
2
|
+
import { SkeletonOwnProps, SkeletonProps } from '../skeleton.types';
|
|
3
|
+
type SkeletonLibDefaults = LibDefaultsShape<SkeletonOwnProps, "rounded">;
|
|
4
|
+
type SkeletonMerged = MergeLibDefaults<SkeletonOwnProps, SkeletonLibDefaults>;
|
|
5
|
+
export declare function useSkeleton(props: SkeletonOwnProps, libDefaults: SkeletonLibDefaults): {
|
|
6
|
+
merged: import('vue').ComputedRef<SkeletonMerged>;
|
|
7
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {}, Omit<SkeletonProps, "classes" | "rounded">>>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
|
+
import { computed as r, useAttrs as i } from "vue";
|
|
3
|
+
import { get as a } from "es-toolkit/compat";
|
|
4
|
+
import { cn as o, mergeBridgeUILayeredClasses as s, splitComponentProps as c } from "@bridge-ui/core";
|
|
5
|
+
import { roundedProps as l } from "@bridge-ui/core/Components/Skeleton";
|
|
6
|
+
//#region src/Components/Skeleton/composables/useSkeleton.ts
|
|
7
|
+
var u = ["classes", "rounded"];
|
|
8
|
+
function d(d, f) {
|
|
9
|
+
let p = i(), m = r(() => c({
|
|
10
|
+
props: {
|
|
11
|
+
...p,
|
|
12
|
+
...d
|
|
13
|
+
},
|
|
14
|
+
bridgeKeys: u
|
|
15
|
+
})), { merged: h, entry: g } = t({
|
|
16
|
+
libDefaults: f,
|
|
17
|
+
componentName: "Skeleton",
|
|
18
|
+
props: () => m.value.componentProps
|
|
19
|
+
}), _ = n({
|
|
20
|
+
entry: g,
|
|
21
|
+
props: () => m.value.componentProps
|
|
22
|
+
}), v = r(() => a(s(l, g.value?.customProps?.rounded), h.value.rounded));
|
|
23
|
+
return {
|
|
24
|
+
merged: h,
|
|
25
|
+
rootBind: r(() => e({}, m.value.inheritedAttrs, o({
|
|
26
|
+
"block animate-pulse bg-gray-200 dark:bg-gray-700": !0,
|
|
27
|
+
[v.value ?? ""]: !0,
|
|
28
|
+
[_.value.root ?? ""]: !0
|
|
29
|
+
})))
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { d as useSkeleton };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { MergeHtmlProps, MergeProps, SkeletonRounded } from '@bridge-ui/core';
|
|
3
|
+
export interface SkeletonRoundedOverrides {}
|
|
4
|
+
export interface SkeletonClasses {
|
|
5
|
+
/**
|
|
6
|
+
* The classes to apply to the root.
|
|
7
|
+
*/
|
|
8
|
+
root?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SkeletonOwnProps {
|
|
11
|
+
/**
|
|
12
|
+
* The classes to apply to the skeleton.
|
|
13
|
+
*
|
|
14
|
+
* @default undefined
|
|
15
|
+
*/
|
|
16
|
+
classes?: SkeletonClasses;
|
|
17
|
+
/**
|
|
18
|
+
* The roundedness of the skeleton.
|
|
19
|
+
*
|
|
20
|
+
* @default "md"
|
|
21
|
+
*/
|
|
22
|
+
rounded?: MergeProps<SkeletonRounded, SkeletonRoundedOverrides>;
|
|
23
|
+
}
|
|
24
|
+
export type SkeletonProps = MergeHtmlProps<SkeletonOwnProps, HTMLAttributes>;
|
package/dist/augments.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { ButtonClasses, ButtonProps } from './Components/Button';
|
|
|
5
5
|
import { CardClasses, CardProps } from './Components/Card';
|
|
6
6
|
import { CheckboxClasses, CheckboxProps } from './Components/Checkbox';
|
|
7
7
|
import { ChipClasses, ChipProps } from './Components/Chip';
|
|
8
|
+
import { DividerClasses, DividerProps } from './Components/Divider';
|
|
8
9
|
import { FormControlClasses, FormControlProps } from './Components/FormControl';
|
|
9
10
|
import { FormFieldClasses, FormFieldProps } from './Components/FormField';
|
|
10
11
|
import { IconProps } from './Components/Icon';
|
|
@@ -19,6 +20,7 @@ import { NumberFieldClasses } from './Components/NumberField';
|
|
|
19
20
|
import { PasswordFieldClasses } from './Components/PasswordField';
|
|
20
21
|
import { RadioClasses, RadioProps } from './Components/Radio';
|
|
21
22
|
import { SelectClasses, SelectProps } from './Components/Select';
|
|
23
|
+
import { SkeletonClasses, SkeletonProps } from './Components/Skeleton';
|
|
22
24
|
import { SnackbarClasses, SnackbarProps } from './Components/Snackbar';
|
|
23
25
|
import { SwitchClasses, SwitchProps } from './Components/Switch';
|
|
24
26
|
import { TextareaClasses, TextareaProps } from './Components/Textarea';
|
|
@@ -51,6 +53,10 @@ declare module "@bridge-ui/core" {
|
|
|
51
53
|
classes: ChipClasses;
|
|
52
54
|
defaultProps: Partial<Pick<ChipProps, "size">>;
|
|
53
55
|
}
|
|
56
|
+
interface DividerConfigOverrides {
|
|
57
|
+
classes: DividerClasses;
|
|
58
|
+
defaultProps: Partial<Pick<DividerProps, "color" | "orientation">>;
|
|
59
|
+
}
|
|
54
60
|
interface FormControlConfigOverrides {
|
|
55
61
|
classes: FormControlClasses;
|
|
56
62
|
defaultProps: Partial<Pick<FormControlProps, "size" | "error" | "withoutErrorMessage">>;
|
|
@@ -76,7 +82,7 @@ declare module "@bridge-ui/core" {
|
|
|
76
82
|
}
|
|
77
83
|
interface ListItemConfigOverrides {
|
|
78
84
|
classes: ListItemClasses;
|
|
79
|
-
defaultProps: Partial<Pick<ListItemProps, "role" | "align">>;
|
|
85
|
+
defaultProps: Partial<Pick<ListItemProps, "role" | "align" | "selectedIcon">>;
|
|
80
86
|
}
|
|
81
87
|
interface ListSectionConfigOverrides {
|
|
82
88
|
classes: ListSectionClasses;
|
|
@@ -107,6 +113,10 @@ declare module "@bridge-ui/core" {
|
|
|
107
113
|
classes: SelectClasses;
|
|
108
114
|
defaultProps: Partial<Pick<SelectProps, "size" | "color" | "rounded" | "variant">>;
|
|
109
115
|
}
|
|
116
|
+
interface SkeletonConfigOverrides {
|
|
117
|
+
classes: SkeletonClasses;
|
|
118
|
+
defaultProps: Partial<Pick<SkeletonProps, "rounded">>;
|
|
119
|
+
}
|
|
110
120
|
interface SwitchConfigOverrides {
|
|
111
121
|
classes: SwitchClasses;
|
|
112
122
|
defaultProps: Partial<Pick<SwitchProps, "size" | "color" | "rounded">>;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export { Checkbox, useCheckbox } from './Components/Checkbox';
|
|
|
12
12
|
export type { CheckboxClasses, CheckboxColorOverrides, CheckboxCustomProps, CheckboxOwnProps, CheckboxProps, CheckboxRoundedOverrides, CheckboxSizeOverrides, CheckboxSlots, } from './Components/Checkbox';
|
|
13
13
|
export { Chip, useChip } from './Components/Chip';
|
|
14
14
|
export type { ChipClasses, ChipCustomProps, ChipEmits, ChipOwnProps, ChipProps, ChipSizeOverrides, ChipSlots, } from './Components/Chip';
|
|
15
|
+
export { Divider, useDivider } from './Components/Divider';
|
|
16
|
+
export type { DividerClasses, DividerColorOverrides, DividerOrientationOverrides, DividerOwnProps, DividerProps, } from './Components/Divider';
|
|
15
17
|
export { FormControl, useFormControl } from './Components/FormControl';
|
|
16
18
|
export type { FormControlClasses, FormControlCustomProps, FormControlOwnProps, FormControlProps, FormControlSizeOverrides, FormControlSlots, UseFormControlReturn, } from './Components/FormControl';
|
|
17
19
|
export { FormField, useFormField } from './Components/FormField';
|
|
@@ -42,6 +44,8 @@ export { Radio, useRadio } from './Components/Radio';
|
|
|
42
44
|
export type { RadioClasses, RadioColorOverrides, RadioCustomProps, RadioOwnProps, RadioProps, RadioRoundedOverrides, RadioSizeOverrides, RadioSlots, } from './Components/Radio';
|
|
43
45
|
export { Select, SelectOption } from './Components/Select';
|
|
44
46
|
export type { SelectAsyncData, SelectClasses, SelectEmits, SelectModel, SelectOptionData, SelectOptionProps, SelectProps, SelectSlots, SelectValue, } from './Components/Select';
|
|
47
|
+
export { Skeleton, useSkeleton } from './Components/Skeleton';
|
|
48
|
+
export type { SkeletonClasses, SkeletonOwnProps, SkeletonProps, SkeletonRoundedOverrides, } from './Components/Skeleton';
|
|
45
49
|
export { Snackbar, useSnackbar } from './Components/Snackbar';
|
|
46
50
|
export type { SnackbarClasses, SnackbarColorOverrides, SnackbarCustomProps, SnackbarEmits, SnackbarOwnProps, SnackbarPaddingOverrides, SnackbarProps, SnackbarSlots, SnackbarTransitionOverrides, } from './Components/Snackbar';
|
|
47
51
|
export { Switch, useSwitch } from './Components/Switch';
|
package/dist/index.js
CHANGED
|
@@ -16,40 +16,44 @@ import { useCheckbox as h } from "./Components/Checkbox/composables/useCheckbox.
|
|
|
16
16
|
import g from "./Components/Checkbox/Checkbox.js";
|
|
17
17
|
import { useChip as _ } from "./Components/Chip/composables/useChip.js";
|
|
18
18
|
import v from "./Components/Chip/Chip.js";
|
|
19
|
-
import {
|
|
20
|
-
import b from "./Components/
|
|
21
|
-
import {
|
|
22
|
-
import S from "./Components/
|
|
23
|
-
import {
|
|
24
|
-
import w from "./Components/
|
|
25
|
-
import {
|
|
26
|
-
import E from "./Components/
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import I from "./Components/
|
|
32
|
-
import L from "./Components/
|
|
33
|
-
import R from "./Components/
|
|
34
|
-
import
|
|
35
|
-
import B from "./Components/
|
|
36
|
-
import {
|
|
37
|
-
import H from "./Components/
|
|
38
|
-
import {
|
|
39
|
-
import W from "./Components/
|
|
40
|
-
import {
|
|
41
|
-
import K from "./Components/
|
|
42
|
-
import q from "./Components/
|
|
43
|
-
import J from "./Components/
|
|
44
|
-
import
|
|
45
|
-
import X from "./Components/
|
|
46
|
-
import {
|
|
47
|
-
import Q from "./Components/
|
|
48
|
-
import {
|
|
49
|
-
import ee from "./Components/
|
|
50
|
-
import {
|
|
51
|
-
import ne from "./Components/
|
|
52
|
-
import re from "./
|
|
53
|
-
import
|
|
54
|
-
import {
|
|
55
|
-
|
|
19
|
+
import { useDivider as y } from "./Components/Divider/composables/useDivider.js";
|
|
20
|
+
import b from "./Components/Divider/Divider.js";
|
|
21
|
+
import { useFormField as x } from "./Components/FormField/composables/useFormField.js";
|
|
22
|
+
import S from "./Components/FormField/FormField.js";
|
|
23
|
+
import { useLabel as C } from "./Components/Label/composables/useLabel.js";
|
|
24
|
+
import w from "./Components/Label/Label.js";
|
|
25
|
+
import { useLink as T } from "./Components/Link/composables/useLink.js";
|
|
26
|
+
import E from "./Components/Link/Link.js";
|
|
27
|
+
import { useList as D } from "./Components/List/composables/useList.js";
|
|
28
|
+
import O from "./Components/List/List.js";
|
|
29
|
+
import { useListbox as k } from "./Components/Listbox/composables/useListbox.js";
|
|
30
|
+
import { findFirstEnabledOptionIndex as A, findLastEnabledOptionIndex as j, getListboxActiveDescendantId as M, getListboxOptionId as N, moveListboxHighlight as P, useListboxNavigation as F } from "./Components/Listbox/composables/useListboxNavigation.js";
|
|
31
|
+
import I from "./Components/ListItem/ListItem.js";
|
|
32
|
+
import { useMenu as L } from "./Components/Menu/composables/useMenu.js";
|
|
33
|
+
import R from "./Components/Menu/Menu.js";
|
|
34
|
+
import z from "./Components/Listbox/Listbox.js";
|
|
35
|
+
import B from "./Components/ListSection/ListSection.js";
|
|
36
|
+
import { useModal as V } from "./Components/Modal/composables/useModal.js";
|
|
37
|
+
import H from "./Components/Modal/Modal.js";
|
|
38
|
+
import { useNumberField as U } from "./Components/NumberField/composables/useNumberField.js";
|
|
39
|
+
import W from "./Components/NumberField/NumberField.js";
|
|
40
|
+
import { usePasswordField as G } from "./Components/PasswordField/composables/usePasswordField.js";
|
|
41
|
+
import K from "./Components/PasswordField/PasswordField.js";
|
|
42
|
+
import { useRadio as q } from "./Components/Radio/composables/useRadio.js";
|
|
43
|
+
import J from "./Components/Radio/Radio.js";
|
|
44
|
+
import Y from "./Components/Select/Select.js";
|
|
45
|
+
import X from "./Components/Select/SelectOption.js";
|
|
46
|
+
import { useSkeleton as Z } from "./Components/Skeleton/composables/useSkeleton.js";
|
|
47
|
+
import Q from "./Components/Skeleton/Skeleton.js";
|
|
48
|
+
import { useSnackbar as $ } from "./Components/Snackbar/composables/useSnackbar.js";
|
|
49
|
+
import ee from "./Components/Snackbar/Snackbar.js";
|
|
50
|
+
import { useSwitch as te } from "./Components/Switch/composables/useSwitch.js";
|
|
51
|
+
import ne from "./Components/Switch/Switch.js";
|
|
52
|
+
import { useTextarea as re } from "./Components/Textarea/composables/useTextarea.js";
|
|
53
|
+
import ie from "./Components/Textarea/Textarea.js";
|
|
54
|
+
import { useTextField as ae } from "./Components/TextField/composables/useTextField.js";
|
|
55
|
+
import oe from "./Components/TextField/TextField.js";
|
|
56
|
+
import se from "./Provider/BridgeUIProvider.js";
|
|
57
|
+
import { createBridgeUI as ce } from "./Provider/createBridgeUI.js";
|
|
58
|
+
import { BRIDGE_UI_DEFAULT_GLOBAL as le, cn as ue, mergeBridgeUIComponents as de, mergeBridgeUIGlobal as fe, resolveBridgeUIOptions as pe } from "@bridge-ui/core";
|
|
59
|
+
export { a as Alert, o as Avatar, le as BRIDGE_UI_DEFAULT_GLOBAL, c as Badge, se as BridgeUIProvider, u as Button, f as Card, g as Checkbox, v as Chip, b as Divider, m as FormControl, S as FormField, i as Icon, w as Label, E as Link, O as List, I as ListItem, B as ListSection, z as Listbox, R as Menu, H as Modal, W as NumberField, K as PasswordField, J as Radio, Y as Select, X as SelectOption, Q as Skeleton, ee as Snackbar, ne as Switch, oe as TextField, ie as Textarea, ue as cn, ce as createBridgeUI, A as findFirstEnabledOptionIndex, j as findLastEnabledOptionIndex, M as getListboxActiveDescendantId, N as getListboxOptionId, de as mergeBridgeUIComponents, fe as mergeBridgeUIGlobal, P as moveListboxHighlight, pe as resolveBridgeUIOptions, r as useAlert, s as useBadge, e as useBridgeUI, t as useBridgeUIComponent, n as useBridgeUIMergedRegistryClasses, l as useButton, d as useCard, h as useCheckbox, _ as useChip, y as useDivider, p as useFormControl, x as useFormField, C as useLabel, T as useLink, D as useList, k as useListbox, F as useListboxNavigation, L as useMenu, V as useModal, U as useNumberField, G as usePasswordField, q as useRadio, Z as useSkeleton, $ as useSnackbar, te as useSwitch, ae as useTextField, re as useTextarea };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.0.1-beta.
|
|
4
|
+
"version": "0.0.1-beta.5",
|
|
5
5
|
"author": "BridgeUI",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"name": "@bridge-ui/vue",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"dist"
|
|
61
61
|
],
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@bridge-ui/core": "^0.0.1-beta.
|
|
63
|
+
"@bridge-ui/core": "^0.0.1-beta.5",
|
|
64
64
|
"@lucide/vue": ">=1.0.0",
|
|
65
65
|
"vue": "^3.4.0"
|
|
66
66
|
},
|