@bridge-ui/vue 0.0.1-beta.5 → 0.0.1-beta.7
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/List/List.vue.d.ts +0 -1
- package/dist/Components/List/List.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/Components/List/composables/useList.d.ts +3 -9
- package/dist/Components/List/composables/useList.js +21 -25
- package/dist/Components/List/index.d.ts +1 -1
- package/dist/Components/List/list.types.d.ts +1 -8
- package/dist/Components/ListItem/ListItem.vue.d.ts +0 -1
- package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +3 -6
- package/dist/Components/ListItem/composables/useListItem.d.ts +12 -18
- package/dist/Components/ListItem/composables/useListItem.js +97 -75
- package/dist/Components/ListItem/index.d.ts +1 -1
- package/dist/Components/ListItem/listItem.types.d.ts +7 -8
- package/dist/Components/ListSection/composables/useListSection.d.ts +1 -3
- package/dist/Components/ListSection/composables/useListSection.js +6 -5
- package/dist/Components/Listbox/Listbox.vue.d.ts +5 -2
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +107 -56
- package/dist/Components/Listbox/composables/useListbox.d.ts +0 -5
- package/dist/Components/Listbox/composables/useListbox.js +10 -19
- package/dist/Components/Listbox/index.d.ts +2 -1
- package/dist/Components/Listbox/index.js +3 -2
- package/dist/Components/Listbox/listbox.types.d.ts +23 -6
- package/dist/Components/Listbox/listboxInjectionKey.d.ts +23 -0
- package/dist/Components/Listbox/listboxInjectionKey.js +4 -0
- package/dist/Components/Menu/Menu.vue.d.ts +2 -2
- package/dist/Components/Menu/composables/useMenu.d.ts +1 -3
- package/dist/Components/Menu/composables/useMenu.js +3 -3
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/Progress/Progress.js +5 -0
- package/dist/Components/Progress/Progress.vue.d.ts +4 -0
- package/dist/Components/Progress/Progress.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/Components/Progress/composables/useProgress.d.ts +29 -0
- package/dist/Components/Progress/composables/useProgress.js +75 -0
- package/dist/Components/Progress/index.d.ts +3 -0
- package/dist/Components/Progress/index.js +3 -0
- package/dist/Components/Progress/progress.types.d.ts +94 -0
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +68 -57
- package/dist/Components/Select/SelectOption.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/Select/composables/useSelect.d.ts +5 -1
- package/dist/Components/Select/composables/useSelect.js +187 -154
- package/dist/Components/Select/select.types.d.ts +12 -5
- package/dist/Components/Spinner/Spinner.js +5 -0
- package/dist/Components/Spinner/Spinner.vue.d.ts +4 -0
- package/dist/Components/Spinner/Spinner.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/Components/Spinner/composables/useSpinner.d.ts +58 -0
- package/dist/Components/Spinner/composables/useSpinner.js +97 -0
- package/dist/Components/Spinner/index.d.ts +3 -0
- package/dist/Components/Spinner/index.js +3 -0
- package/dist/Components/Spinner/spinner.types.d.ts +99 -0
- package/dist/augments.d.ts +12 -3
- package/dist/index.d.ts +6 -2
- package/dist/index.js +32 -28
- package/dist/theme.css +46 -3
- package/package.json +2 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ListOwnProps } from './list.types';
|
|
2
2
|
declare const __VLS_export: import('vue').DefineComponent<ListOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ListOwnProps> & Readonly<{}>, {
|
|
3
|
-
padding: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListPadding, import('./list.types').ListPaddingOverrides>;
|
|
4
3
|
as: "ol" | "ul" | "nav";
|
|
5
4
|
dense: boolean;
|
|
6
5
|
nested: boolean;
|
|
@@ -16,11 +16,10 @@ var f = /* @__PURE__ */ i({
|
|
|
16
16
|
nested: {
|
|
17
17
|
type: Boolean,
|
|
18
18
|
default: !1
|
|
19
|
-
}
|
|
20
|
-
padding: { default: "normal" }
|
|
19
|
+
}
|
|
21
20
|
},
|
|
22
21
|
setup(i) {
|
|
23
|
-
let f = u(), { merged: p, rootBind: m } = t(i
|
|
22
|
+
let f = u(), { merged: p, rootBind: m } = t(i), h = n(() => p.value.as ?? "ul");
|
|
24
23
|
return (t, n) => (s(), r(c(h.value), o(a(l(m))), {
|
|
25
24
|
default: d(() => [(s(), r(c(l(e)(l(f), "default"))))]),
|
|
26
25
|
_: 1
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
|
|
2
1
|
import { ListOwnProps, ListProps } from '../list.types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
merged: import('vue').ComputedRef<ListMerged>;
|
|
7
|
-
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
8
|
-
class: string;
|
|
9
|
-
}, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListProps, "classes" | "customProps" | "padding" | "as" | "dense" | "nested">, never>>>;
|
|
2
|
+
export declare function useList(props: ListOwnProps): {
|
|
3
|
+
merged: import('vue').ComputedRef<ListOwnProps>;
|
|
4
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListProps, "classes" | "customProps" | "as" | "dense" | "nested">, never>>>;
|
|
10
5
|
};
|
|
11
|
-
export {};
|
|
@@ -2,43 +2,39 @@ import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistr
|
|
|
2
2
|
import { LIST_INJECTION_KEY as r } from "../listInjectionKey.js";
|
|
3
3
|
import { computed as i, provide as a, useAttrs as o } from "vue";
|
|
4
4
|
import { get as s, omit as c } from "es-toolkit/compat";
|
|
5
|
-
import { cn as l,
|
|
6
|
-
import { paddingProps as f } from "@bridge-ui/core/Components/List";
|
|
5
|
+
import { cn as l, splitComponentProps as u } from "@bridge-ui/core";
|
|
7
6
|
//#region src/Components/List/composables/useList.ts
|
|
8
|
-
var
|
|
7
|
+
var d = [
|
|
9
8
|
"as",
|
|
10
9
|
"dense",
|
|
11
10
|
"nested",
|
|
12
11
|
"classes",
|
|
13
|
-
"padding",
|
|
14
12
|
"customProps"
|
|
15
13
|
];
|
|
16
|
-
function
|
|
17
|
-
let
|
|
18
|
-
bridgeKeys:
|
|
14
|
+
function f(f) {
|
|
15
|
+
let p = o(), m = i(() => u({
|
|
16
|
+
bridgeKeys: d,
|
|
19
17
|
props: {
|
|
20
|
-
...
|
|
21
|
-
...
|
|
18
|
+
...p,
|
|
19
|
+
...f
|
|
22
20
|
}
|
|
23
|
-
})), { merged:
|
|
24
|
-
libDefaults: h,
|
|
21
|
+
})), { merged: h, entry: g } = t({
|
|
25
22
|
componentName: "List",
|
|
26
|
-
props: () =>
|
|
27
|
-
}),
|
|
28
|
-
entry:
|
|
29
|
-
props: () =>
|
|
23
|
+
props: () => m.value.componentProps
|
|
24
|
+
}), _ = i(() => h.value.customProps), v = n({
|
|
25
|
+
entry: g,
|
|
26
|
+
props: () => m.value.componentProps
|
|
30
27
|
});
|
|
31
|
-
a(r, i(() => ({ dense:
|
|
32
|
-
let
|
|
28
|
+
a(r, i(() => ({ dense: h.value.dense === !0 })));
|
|
29
|
+
let y = i(() => c(m.value.inheritedAttrs, []));
|
|
33
30
|
return {
|
|
34
|
-
merged:
|
|
35
|
-
rootBind: i(() => e(
|
|
36
|
-
"m-0 list-none": !0,
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
}) }))
|
|
31
|
+
merged: h,
|
|
32
|
+
rootBind: i(() => e(_.value?.root, y.value, l({
|
|
33
|
+
"m-0 list-none py-2 text-dark-900 dark:text-dark-100": !0,
|
|
34
|
+
"pl-4": h.value.nested,
|
|
35
|
+
[s(v.value, "root") ?? ""]: !0
|
|
36
|
+
})))
|
|
41
37
|
};
|
|
42
38
|
}
|
|
43
39
|
//#endregion
|
|
44
|
-
export {
|
|
40
|
+
export { f as useList };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { useList } from './composables/useList';
|
|
2
|
-
export type { ListClasses, ListCustomProps, ListOwnProps,
|
|
2
|
+
export type { ListClasses, ListCustomProps, ListOwnProps, ListProps, } from './list.types';
|
|
3
3
|
export { default as List } from './List.vue';
|
|
4
4
|
export { LIST_INJECTION_KEY } from './listInjectionKey';
|
|
5
5
|
export type { ListContextValue } from './listInjectionKey';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
export interface ListPaddingOverrides {}
|
|
2
|
+
import { MergeHtmlProps } from '@bridge-ui/core';
|
|
4
3
|
export interface ListClasses {
|
|
5
4
|
/**
|
|
6
5
|
* The classes to apply to the root.
|
|
@@ -47,11 +46,5 @@ export interface ListOwnProps {
|
|
|
47
46
|
* @default false
|
|
48
47
|
*/
|
|
49
48
|
nested?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Root padding preset. Use `"none"` inside menus/cards (MUI `disablePadding`).
|
|
52
|
-
*
|
|
53
|
-
* @default "normal"
|
|
54
|
-
*/
|
|
55
|
-
padding?: MergeProps<ListPadding, ListPaddingOverrides>;
|
|
56
49
|
}
|
|
57
50
|
export type ListProps = MergeHtmlProps<ListOwnProps, HTMLAttributes>;
|
|
@@ -4,7 +4,6 @@ declare const __VLS_base: import('vue').DefineComponent<ListItemOwnProps, {}, {}
|
|
|
4
4
|
role: "button" | "option" | "menuitem";
|
|
5
5
|
as: "li" | "div";
|
|
6
6
|
disabled: boolean;
|
|
7
|
-
align: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListItemAlign, import('./listItem.types').ListItemAlignOverrides>;
|
|
8
7
|
divider: boolean;
|
|
9
8
|
interactive: boolean;
|
|
10
9
|
selected: boolean;
|
|
@@ -7,7 +7,6 @@ var x = /* @__PURE__ */ d({
|
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "ListItem",
|
|
9
9
|
props: {
|
|
10
|
-
align: { default: "center" },
|
|
11
10
|
as: { default: "li" },
|
|
12
11
|
classes: {},
|
|
13
12
|
customProps: {},
|
|
@@ -31,13 +30,11 @@ var x = /* @__PURE__ */ d({
|
|
|
31
30
|
type: Boolean,
|
|
32
31
|
default: !1
|
|
33
32
|
},
|
|
34
|
-
selectedIcon: {}
|
|
33
|
+
selectedIcon: {},
|
|
34
|
+
value: {}
|
|
35
35
|
},
|
|
36
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, {
|
|
38
|
-
role: "button",
|
|
39
|
-
align: "center"
|
|
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"));
|
|
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, { role: "button" }, 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
38
|
return (e, n) => (g(), s(_(R.value), h(f(v(E))), {
|
|
42
39
|
default: b(() => [v(F) ? (g(), l("div", h(p({ key: 0 }, v(F))), [u("div", { class: m(v(D)) }, [
|
|
43
40
|
v(O) ? (g(), l("div", h(p({ key: 0 }, v(k))), [(g(), s(_(v(t)(v(x), "start"))))], 16)) : c("", !0),
|
|
@@ -2,38 +2,32 @@ import { LucideIcon } from '@lucide/vue';
|
|
|
2
2
|
import { useSlots, Slot } from 'vue';
|
|
3
3
|
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
|
|
4
4
|
import { ListItemOwnProps, ListItemProps } from '../listItem.types';
|
|
5
|
-
type ListItemLibDefaults = LibDefaultsShape<ListItemOwnProps, "role"
|
|
5
|
+
type ListItemLibDefaults = LibDefaultsShape<ListItemOwnProps, "role">;
|
|
6
6
|
type ListItemMerged = MergeLibDefaults<ListItemOwnProps, ListItemLibDefaults>;
|
|
7
7
|
export declare function useListItem(props: ListItemOwnProps, libDefaults: ListItemLibDefaults, slots: ReturnType<typeof useSlots>): {
|
|
8
8
|
merged: import('vue').ComputedRef<ListItemMerged>;
|
|
9
9
|
hasEnd: import('vue').ComputedRef<boolean>;
|
|
10
|
-
endBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
11
|
-
class: string;
|
|
12
|
-
}, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
10
|
+
endBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
13
11
|
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
14
12
|
class: string;
|
|
15
|
-
|
|
13
|
+
id: string | undefined;
|
|
14
|
+
}, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListItemProps, "role" | "value" | "classes" | "customProps" | "primary" | "secondary" | "as" | "disabled" | "dense" | "divider" | "interactive" | "selected" | "selectedIcon">, never>>>;
|
|
16
15
|
rowClass: import('vue').ComputedRef<string>;
|
|
17
16
|
hasStart: import('vue').ComputedRef<boolean>;
|
|
18
|
-
startBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
19
|
-
class: string;
|
|
20
|
-
}, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
17
|
+
startBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
21
18
|
hasPrimary: import('vue').ComputedRef<boolean>;
|
|
22
|
-
contentBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
23
|
-
|
|
24
|
-
}, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
25
|
-
primaryBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
26
|
-
class: string;
|
|
27
|
-
}, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
19
|
+
contentBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
20
|
+
primaryBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
28
21
|
hasSecondary: import('vue').ComputedRef<boolean>;
|
|
29
|
-
secondaryBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
30
|
-
class: string;
|
|
31
|
-
}, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
22
|
+
secondaryBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
32
23
|
interactiveBind: import('vue').ComputedRef<({
|
|
24
|
+
"aria-disabled": boolean | undefined;
|
|
33
25
|
role: NonNullable<"button" | "option" | "menuitem" | undefined>;
|
|
34
26
|
tabindex: number;
|
|
35
|
-
"aria-disabled": boolean | undefined;
|
|
36
27
|
"data-selected": boolean | undefined;
|
|
28
|
+
"aria-selected": boolean | undefined;
|
|
29
|
+
onMousedown: ((event: MouseEvent) => void) | undefined;
|
|
30
|
+
onClick: (() => void) | undefined;
|
|
37
31
|
class: string;
|
|
38
32
|
} & object & Record<"class", string>) | null>;
|
|
39
33
|
selectedIconBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { hasNamedSlot as e, isPropPresent as t, resolveNamedSlot as n } from "../../../Utils/slotOrProp.js";
|
|
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
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { getListboxOptionId as s } from "../../Listbox/composables/useListboxNavigation.js";
|
|
5
|
+
import { LISTBOX_INJECTION_KEY as c } from "../../Listbox/listboxInjectionKey.js";
|
|
6
|
+
import { computed as l, getCurrentInstance as u, inject as d, onBeforeUnmount as f, toValue as p, useAttrs as m, watch as h } from "vue";
|
|
7
|
+
import { get as g, isNull as _, omit as v } from "es-toolkit/compat";
|
|
8
|
+
import { cn as y, splitComponentProps as b } from "@bridge-ui/core";
|
|
9
|
+
import { Check as x } from "@lucide/vue";
|
|
9
10
|
//#region src/Components/ListItem/composables/useListItem.ts
|
|
10
|
-
var
|
|
11
|
+
var S = [
|
|
11
12
|
"as",
|
|
12
13
|
"role",
|
|
13
|
-
"align",
|
|
14
14
|
"dense",
|
|
15
|
+
"value",
|
|
15
16
|
"classes",
|
|
16
17
|
"divider",
|
|
17
18
|
"primary",
|
|
@@ -22,88 +23,109 @@ var b = [
|
|
|
22
23
|
"interactive",
|
|
23
24
|
"selectedIcon"
|
|
24
25
|
];
|
|
25
|
-
function
|
|
26
|
-
let
|
|
26
|
+
function C(t, n, C) {
|
|
27
|
+
let w = m(), T = d(o, null), E = d(c, null), D = E != null, O = l(() => b({
|
|
27
28
|
props: {
|
|
28
|
-
...
|
|
29
|
+
...w,
|
|
29
30
|
...t
|
|
30
31
|
},
|
|
31
|
-
bridgeKeys:
|
|
32
|
-
})), { merged:
|
|
32
|
+
bridgeKeys: S
|
|
33
|
+
})), { merged: k, entry: A } = i({
|
|
33
34
|
libDefaults: n,
|
|
34
35
|
componentName: "ListItem",
|
|
35
|
-
props: () =>
|
|
36
|
-
}),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
props: () => O.value.componentProps
|
|
37
|
+
}), j = l(() => E ? p(E) : null), M = l(() => k.value.value == null || !D ? null : {
|
|
38
|
+
value: k.value.value,
|
|
39
|
+
description: k.value.secondary,
|
|
40
|
+
disabled: !!k.value.disabled,
|
|
41
|
+
label: k.value.primary ?? String(k.value.value)
|
|
42
|
+
}), N;
|
|
43
|
+
h(() => {
|
|
44
|
+
let e = M.value;
|
|
45
|
+
return e ? `${String(e.value)}:${e.label}:${e.disabled}:${e.description ?? ""}` : null;
|
|
46
|
+
}, () => {
|
|
47
|
+
N?.(), N = void 0;
|
|
48
|
+
let e = M.value;
|
|
49
|
+
!e || !E || (N = p(E).registerOption(e));
|
|
50
|
+
}, { immediate: !0 }), f(() => {
|
|
51
|
+
N?.();
|
|
52
|
+
});
|
|
53
|
+
let P = l(() => M.value != null), F = l(() => !M.value || !j.value ? !1 : j.value.isSelected(M.value.value)), I = l(() => !M.value || !j.value ? -1 : j.value.getOptionIndex(M.value.value)), L = l(() => !j.value || I.value < 0 ? !1 : j.value.highlightedIndex === I.value), R = l(() => k.value.customProps), z = a({
|
|
54
|
+
entry: A,
|
|
55
|
+
props: () => O.value.componentProps
|
|
56
|
+
}), B = l(() => "dense" in (u()?.vnode.props ?? {}) ? t.dense === !0 : t.dense === !0 ? !0 : T ? p(T).dense : !1), V = l(() => e(C, "primary") || e(C, "default") || !!k.value.primary), H = l(() => e(C, "secondary") || !!k.value.secondary), U = l(() => e(C, "start")), W = l(() => P.value ? !F.value || !j.value?.showCheckmark ? null : x : !k.value.selected || _(k.value.selectedIcon) ? null : k.value.selectedIcon ?? x), G = l(() => e(C, "end") || W.value != null), K = l(() => v(O.value.inheritedAttrs, [])), q = l(() => r(R.value?.root, K.value, {
|
|
57
|
+
class: y({
|
|
58
|
+
"list-none": !0,
|
|
59
|
+
"border-b border-black/10 last:border-b-0 dark:border-white/10": k.value.divider,
|
|
60
|
+
[g(z.value, "root") ?? ""]: !0
|
|
61
|
+
}),
|
|
62
|
+
id: P.value && j.value?.listboxId && I.value >= 0 ? s(j.value.listboxId, I.value) : void 0
|
|
63
|
+
})), J = l(() => k.value.interactive || P.value ? r(R.value?.interactive, {}, {
|
|
64
|
+
"aria-disabled": k.value.disabled ? !0 : void 0,
|
|
65
|
+
role: P.value ? "option" : k.value.role,
|
|
66
|
+
tabindex: k.value.disabled || P.value ? -1 : 0,
|
|
67
|
+
"data-selected": k.value.selected || F.value ? !0 : void 0,
|
|
68
|
+
"aria-selected": P.value ? F.value : void 0,
|
|
69
|
+
onMousedown: P.value ? (e) => {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
} : void 0,
|
|
72
|
+
onClick: P.value ? () => {
|
|
73
|
+
M.value && j.value?.onSelect(M.value);
|
|
74
|
+
} : void 0,
|
|
75
|
+
class: y({
|
|
76
|
+
"flex w-full min-w-0 items-center gap-x-3 text-left text-dark-900 outline-hidden transition-colors dark:text-dark-100": !0,
|
|
77
|
+
"cursor-pointer select-none": !k.value.disabled,
|
|
51
78
|
"px-4": !0,
|
|
52
|
-
"py-2": !
|
|
53
|
-
"py-1.5":
|
|
54
|
-
"hover:bg-black/5 focus-visible:bg-black/5": !
|
|
55
|
-
"bg-
|
|
56
|
-
|
|
57
|
-
[
|
|
58
|
-
[
|
|
79
|
+
"py-2": !B.value,
|
|
80
|
+
"py-1.5": B.value,
|
|
81
|
+
"hover:bg-black/5 focus-visible:bg-black/5 dark:hover:bg-white/10 dark:focus-visible:bg-white/10": !k.value.disabled && !P.value,
|
|
82
|
+
"bg-dark-100 font-medium text-dark-900 dark:bg-white/15 dark:text-white": k.value.selected && !P.value,
|
|
83
|
+
[j.value?.optionSelectedClass ?? ""]: P.value && F.value,
|
|
84
|
+
[j.value?.mergedClasses.optionSelected ?? ""]: P.value && F.value,
|
|
85
|
+
[j.value?.optionHighlightedClass ?? ""]: P.value && L.value && !F.value,
|
|
86
|
+
[j.value?.mergedClasses.optionHighlighted ?? ""]: P.value && L.value && !F.value,
|
|
87
|
+
"opacity-50 pointer-events-none": k.value.disabled,
|
|
88
|
+
[g(z.value, "interactive") ?? ""]: !0,
|
|
89
|
+
[j.value?.sizeClasses?.option ?? ""]: !0
|
|
59
90
|
})
|
|
60
|
-
}) : null),
|
|
91
|
+
}) : null), Y = l(() => y({
|
|
61
92
|
"flex w-full min-w-0 gap-x-3": !0,
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"py-
|
|
65
|
-
|
|
66
|
-
})),
|
|
67
|
-
"flex shrink-0": !0,
|
|
68
|
-
[
|
|
69
|
-
})
|
|
93
|
+
"items-center text-dark-900 dark:text-dark-100": !k.value.interactive,
|
|
94
|
+
"px-4": !k.value.interactive,
|
|
95
|
+
"py-2": !k.value.interactive && !B.value,
|
|
96
|
+
"py-1.5": !k.value.interactive && B.value
|
|
97
|
+
})), X = l(() => r(R.value?.start, {}, y({
|
|
98
|
+
"flex shrink-0 text-dark-600 dark:text-dark-300": !0,
|
|
99
|
+
[g(z.value, "start") ?? ""]: !0
|
|
100
|
+
}))), Z = l(() => r(R.value?.content, {}, y({
|
|
70
101
|
"min-w-0 flex-1": !0,
|
|
71
|
-
[
|
|
72
|
-
})
|
|
73
|
-
"block truncate text-sm font-medium": !0,
|
|
74
|
-
[f(O.value, "primary") ?? ""]: !0
|
|
75
|
-
}) })), U = s(() => r(D.value?.secondary, {}, { class: h({
|
|
76
|
-
"mt-0.5 block truncate text-xs text-dark-500": !0,
|
|
77
|
-
[f(O.value, "secondary") ?? ""]: !0
|
|
78
|
-
}) }));
|
|
102
|
+
[g(z.value, "content") ?? ""]: !0
|
|
103
|
+
}))), Q = l(() => r(R.value?.primary, {}, y("block truncate text-sm font-medium", j.value?.sizeClasses?.primary, g(z.value, "primary")))), $ = l(() => r(R.value?.secondary, {}, y("mt-0.5 block truncate text-xs text-dark-500 dark:text-dark-400", j.value?.sizeClasses?.secondary, g(z.value, "secondary"))));
|
|
79
104
|
return {
|
|
80
|
-
merged:
|
|
81
|
-
hasEnd:
|
|
82
|
-
endBind:
|
|
105
|
+
merged: k,
|
|
106
|
+
hasEnd: G,
|
|
107
|
+
endBind: l(() => r(R.value?.end, {}, y({
|
|
83
108
|
"ml-auto flex shrink-0 items-center": !0,
|
|
84
|
-
[
|
|
85
|
-
})
|
|
86
|
-
rootBind:
|
|
87
|
-
rowClass:
|
|
88
|
-
hasStart:
|
|
89
|
-
startBind:
|
|
90
|
-
hasPrimary:
|
|
91
|
-
contentBind:
|
|
92
|
-
primaryBind:
|
|
93
|
-
hasSecondary:
|
|
94
|
-
secondaryBind:
|
|
95
|
-
interactiveBind:
|
|
96
|
-
selectedIconBind:
|
|
109
|
+
[g(z.value, "end") ?? ""]: !0
|
|
110
|
+
}))),
|
|
111
|
+
rootBind: q,
|
|
112
|
+
rowClass: Y,
|
|
113
|
+
hasStart: U,
|
|
114
|
+
startBind: X,
|
|
115
|
+
hasPrimary: V,
|
|
116
|
+
contentBind: Z,
|
|
117
|
+
primaryBind: Q,
|
|
118
|
+
hasSecondary: H,
|
|
119
|
+
secondaryBind: $,
|
|
120
|
+
interactiveBind: J,
|
|
121
|
+
selectedIconBind: l(() => r(R.value?.selectedIcon, {}, {
|
|
97
122
|
size: "sm",
|
|
98
|
-
class:
|
|
99
|
-
"shrink-0": !0,
|
|
100
|
-
[f(O.value, "selectedIcon") ?? ""]: !0
|
|
101
|
-
})
|
|
123
|
+
class: y("shrink-0", j.value?.checkClass, g(z.value, "selectedIcon"))
|
|
102
124
|
})),
|
|
103
|
-
resolvedSelectedIcon:
|
|
125
|
+
resolvedSelectedIcon: W
|
|
104
126
|
};
|
|
105
127
|
}
|
|
106
|
-
function
|
|
128
|
+
function w(r, i) {
|
|
107
129
|
if (e(r, "primary")) return n(r, "primary");
|
|
108
130
|
if (e(r, "default")) return n(r, "default");
|
|
109
131
|
if (!t(i)) return () => null;
|
|
@@ -111,4 +133,4 @@ function S(r, i) {
|
|
|
111
133
|
return () => a;
|
|
112
134
|
}
|
|
113
135
|
//#endregion
|
|
114
|
-
export {
|
|
136
|
+
export { w as resolveListItemPrimary, C as useListItem };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { useListItem } from './composables/useListItem';
|
|
2
|
-
export type {
|
|
2
|
+
export type { ListItemClasses, ListItemCustomProps, ListItemOwnProps, ListItemProps, ListItemSlots, } from './listItem.types';
|
|
3
3
|
export { default as ListItem } from './ListItem.vue';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { LucideIcon } from '@lucide/vue';
|
|
2
2
|
import { HTMLAttributes, Slot, VNode } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { ListboxValue, MergeHtmlProps } from '@bridge-ui/core';
|
|
4
4
|
import { IconProps } from '../Icon';
|
|
5
|
-
export interface ListItemAlignOverrides {}
|
|
6
5
|
export interface ListItemClasses {
|
|
7
6
|
/**
|
|
8
7
|
* The classes to apply to the main content column.
|
|
@@ -75,12 +74,6 @@ export interface ListItemCustomProps {
|
|
|
75
74
|
* List row (MUI `ListItem` / `ListItemButton`-like).
|
|
76
75
|
*/
|
|
77
76
|
export interface ListItemOwnProps {
|
|
78
|
-
/**
|
|
79
|
-
* Vertical alignment of start/content/end slots.
|
|
80
|
-
*
|
|
81
|
-
* @default "center"
|
|
82
|
-
*/
|
|
83
|
-
align?: MergeProps<ListItemAlign, ListItemAlignOverrides>;
|
|
84
77
|
/**
|
|
85
78
|
* The element to render as.
|
|
86
79
|
*
|
|
@@ -154,6 +147,12 @@ export interface ListItemOwnProps {
|
|
|
154
147
|
* @default Check
|
|
155
148
|
*/
|
|
156
149
|
selectedIcon?: null | LucideIcon;
|
|
150
|
+
/**
|
|
151
|
+
* When set inside a `Listbox`, registers this row as a selectable option.
|
|
152
|
+
*
|
|
153
|
+
* @default undefined
|
|
154
|
+
*/
|
|
155
|
+
value?: ListboxValue;
|
|
157
156
|
}
|
|
158
157
|
export type ListItemPrimaryContent = VNode | string | VNode[] | undefined;
|
|
159
158
|
export interface ListItemSlots {
|
|
@@ -3,9 +3,7 @@ import { ListSectionOwnProps, ListSectionProps } from '../listSection.types';
|
|
|
3
3
|
export declare function useListSection(props: ListSectionOwnProps, slots: ReturnType<typeof useSlots>): {
|
|
4
4
|
label: import('vue').ComputedRef<import('vue').Slot | (() => null | import('vue').VNodeChild)>;
|
|
5
5
|
merged: import('vue').ComputedRef<ListSectionOwnProps>;
|
|
6
|
-
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<
|
|
7
|
-
class: string;
|
|
8
|
-
}, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListSectionProps, "classes" | "customProps" | "title" | "as" | "inset" | "sticky">, never>>>;
|
|
6
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListSectionProps, "classes" | "customProps" | "title" | "as" | "inset" | "sticky">, never>>>;
|
|
9
7
|
titleBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
10
8
|
role: string;
|
|
11
9
|
class: string;
|
|
@@ -26,19 +26,20 @@ function m(m, h) {
|
|
|
26
26
|
}), x = a(() => y.value.customProps), S = r({
|
|
27
27
|
entry: b,
|
|
28
28
|
props: () => v.value.componentProps
|
|
29
|
-
}), C = a(() => _ ? s(_).dense : !1), w = a(() => e(h, "default", y.value.title)), T = a(() => u(v.value.inheritedAttrs, []));
|
|
29
|
+
}), C = a(() => _ ? s(_).dense : !1), w = a(() => e(h, "default", y.value.title)), T = a(() => u(v.value.inheritedAttrs, [])), E = a(() => y.value.as === "div");
|
|
30
30
|
return {
|
|
31
31
|
label: w,
|
|
32
32
|
merged: y,
|
|
33
|
-
rootBind: a(() => t(x.value?.root, T.value,
|
|
33
|
+
rootBind: a(() => t(x.value?.root, T.value, d({
|
|
34
34
|
"list-none": !0,
|
|
35
|
+
"sticky top-0 z-10 bg-white dark:bg-dark-800": y.value.sticky && !E.value,
|
|
35
36
|
[l(S.value, "root") ?? ""]: !0
|
|
36
|
-
})
|
|
37
|
+
}))),
|
|
37
38
|
titleBind: a(() => t(x.value?.title, {}, {
|
|
38
39
|
role: "presentation",
|
|
39
40
|
class: d({
|
|
40
|
-
"bg-white px-4 text-xs font-semibold tracking-wide text-dark-500 uppercase": !0,
|
|
41
|
-
"sticky top-0 z-10": y.value.sticky,
|
|
41
|
+
"bg-white px-4 text-xs font-semibold tracking-wide text-dark-500 uppercase dark:bg-dark-800 dark:text-dark-300": !0,
|
|
42
|
+
"sticky top-0 z-10": y.value.sticky && E.value,
|
|
42
43
|
"py-2": !C.value,
|
|
43
44
|
"py-1.5": C.value,
|
|
44
45
|
"pl-14": y.value.inset,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ListboxOption
|
|
1
|
+
import { ListboxOption } from '@bridge-ui/core';
|
|
2
|
+
import { ListboxOwnProps, ListboxSlots } from './listbox.types';
|
|
2
3
|
type __VLS_Slots = ListboxSlots;
|
|
3
4
|
type __VLS_Props = ListboxOwnProps;
|
|
4
5
|
type __VLS_ModelProps = {
|
|
@@ -9,21 +10,23 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
9
10
|
select: (option: ListboxOption) => any;
|
|
10
11
|
"update:modelValue": (value: boolean) => any;
|
|
11
12
|
"show-change": (show: boolean) => any;
|
|
13
|
+
"registered-options-change": (options: ListboxOption[]) => any;
|
|
12
14
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
15
|
onSelect?: ((option: ListboxOption) => any) | undefined;
|
|
14
16
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
15
17
|
"onShow-change"?: ((show: boolean) => any) | undefined;
|
|
18
|
+
"onRegistered-options-change"?: ((options: ListboxOption[]) => any) | undefined;
|
|
16
19
|
}>, {
|
|
17
20
|
color: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListboxColor, import('./listbox.types').ListboxColorOverrides>;
|
|
18
21
|
size: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListboxSize, import('./listbox.types').ListboxSizeOverrides>;
|
|
19
22
|
loading: boolean;
|
|
20
23
|
multiple: boolean;
|
|
21
24
|
disableAutoFocus: boolean;
|
|
22
|
-
placement: import('@floating-ui/utils').Placement;
|
|
23
25
|
emptyMessage: string;
|
|
24
26
|
hideEmptyMessage: boolean;
|
|
25
27
|
highlightedIndex: number;
|
|
26
28
|
loadingMessage: string;
|
|
29
|
+
placement: import('@floating-ui/utils').Placement;
|
|
27
30
|
showCheckmark: boolean;
|
|
28
31
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
29
32
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|