@bridge-ui/vue 0.0.1-beta.1 → 0.0.1-beta.3
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/Alert/alert.types.d.ts +1 -1
- package/dist/Components/Alert/alertDefaultIcons.d.ts +1 -1
- package/dist/Components/Alert/alertDefaultIcons.js +1 -1
- package/dist/Components/Alert/composables/useAlert.d.ts +1 -1
- package/dist/Components/Avatar/avatar.types.d.ts +1 -1
- package/dist/Components/Avatar/composables/useAvatar.d.ts +1 -1
- package/dist/Components/Avatar/composables/useAvatar.js +1 -1
- package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/Button/button.types.d.ts +1 -1
- package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/Chip/Chip.js +5 -0
- package/dist/Components/Chip/Chip.vue.d.ts +20 -0
- package/dist/Components/Chip/Chip.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/Components/Chip/chip.types.d.ts +93 -0
- package/dist/Components/Chip/composables/useChip.d.ts +22 -0
- package/dist/Components/Chip/composables/useChip.js +66 -0
- package/dist/Components/Chip/index.d.ts +3 -0
- package/dist/Components/Chip/index.js +3 -0
- package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
- package/dist/Components/FormField/composables/useFormField.js +1 -1
- package/dist/Components/FormField/formField.types.d.ts +1 -1
- package/dist/Components/Icon/icon.types.d.ts +1 -1
- package/dist/Components/Link/link.types.d.ts +1 -1
- package/dist/Components/Listbox/Listbox.vue.d.ts +2 -0
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +53 -49
- package/dist/Components/Listbox/composables/useListbox.d.ts +11 -2
- package/dist/Components/Listbox/composables/useListbox.js +44 -28
- package/dist/Components/Listbox/listbox.types.d.ts +28 -3
- package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/NumberField/composables/useNumberField.d.ts +2 -2
- package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +2 -2
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +69 -89
- package/dist/Components/Select/composables/useSelect.d.ts +27 -3
- package/dist/Components/Select/composables/useSelect.js +162 -140
- package/dist/Components/Select/select.types.d.ts +22 -1
- package/dist/Components/Snackbar/Snackbar.vue.d.ts +1 -1
- package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/Snackbar/composables/useSnackbar.d.ts +1 -1
- package/dist/Components/Snackbar/snackbar.types.d.ts +1 -1
- package/dist/Components/Snackbar/snackbarDefaultIcons.d.ts +1 -1
- package/dist/Components/Snackbar/snackbarDefaultIcons.js +1 -1
- package/dist/Components/TextField/composables/useTextField.d.ts +2 -2
- package/dist/Components/Textarea/composables/useTextarea.d.ts +2 -2
- package/dist/augments.d.ts +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -37
- package/dist/theme.css +15 -1
- package/package.json +9 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LucideIcon } from 'lucide
|
|
1
|
+
import { LucideIcon } from '@lucide/vue';
|
|
2
2
|
import { HTMLAttributes, Slot } from 'vue';
|
|
3
3
|
import { AlertColor, AlertPadding, AlertRounded, AlertShadow, AlertVariant, MergeHtmlProps, MergeProps } from '@bridge-ui/core';
|
|
4
4
|
import { IconProps } from '../Icon';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LucideIcon } from 'lucide
|
|
1
|
+
import { LucideIcon } from '@lucide/vue';
|
|
2
2
|
import { AlertColor } from '@bridge-ui/core/Components/Alert';
|
|
3
3
|
/** Library fallbacks when neither the `icon` prop nor theme `icon` is set. */
|
|
4
4
|
export declare const alertDefaultIcons: Record<keyof AlertColor, LucideIcon>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bell as e, CircleAlert as t, CircleCheck as n, CircleX as r, Info as i, TriangleAlert as a } from "lucide
|
|
1
|
+
import { Bell as e, CircleAlert as t, CircleCheck as n, CircleX as r, Info as i, TriangleAlert as a } from "@lucide/vue";
|
|
2
2
|
//#region src/Components/Alert/alertDefaultIcons.ts
|
|
3
3
|
var o = {
|
|
4
4
|
dark: i,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LucideIcon } from 'lucide
|
|
1
|
+
import { LucideIcon } from '@lucide/vue';
|
|
2
2
|
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
|
|
3
3
|
import { AlertOwnProps, AlertProps } from '..';
|
|
4
4
|
type AlertLibDefaults = LibDefaultsShape<AlertOwnProps, "color" | "shadow" | "padding" | "rounded" | "variant">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LucideIcon } from 'lucide
|
|
1
|
+
import { LucideIcon } from '@lucide/vue';
|
|
2
2
|
import { HTMLAttributes, Slot } from 'vue';
|
|
3
3
|
import { AvatarColor, AvatarRounded, AvatarSize, MergeHtmlProps, MergeProps } from '@bridge-ui/core';
|
|
4
4
|
export interface AvatarSizeOverrides {}
|
|
@@ -15,7 +15,7 @@ export declare function useAvatar(props: AvatarProps, libDefaults: AvatarLibDefa
|
|
|
15
15
|
src: string | undefined;
|
|
16
16
|
}>>;
|
|
17
17
|
fallbackBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {}, {}>>;
|
|
18
|
-
resolvedIcon: import('vue').ComputedRef<import('lucide
|
|
18
|
+
resolvedIcon: import('vue').ComputedRef<import('@lucide/vue').LucideIcon>;
|
|
19
19
|
hasFallbackSlot: import('vue').ComputedRef<boolean>;
|
|
20
20
|
hasFallbackText: import('vue').ComputedRef<boolean>;
|
|
21
21
|
hasCustomContent: import('vue').ComputedRef<boolean>;
|
|
@@ -3,7 +3,7 @@ import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistr
|
|
|
3
3
|
import { computed as i, useAttrs as a, useSlots as o } from "vue";
|
|
4
4
|
import { get as s, isEmpty as c, isNil as l } from "es-toolkit/compat";
|
|
5
5
|
import { cn as u, mergeBridgeUILayeredClasses as d, splitComponentProps as f } from "@bridge-ui/core";
|
|
6
|
-
import { User as p } from "lucide
|
|
6
|
+
import { User as p } from "@lucide/vue";
|
|
7
7
|
import { colorProps as m, iconSizeProps as h, roundedProps as g, sizeProps as _ } from "@bridge-ui/core/Components/Avatar";
|
|
8
8
|
//#region src/Components/Avatar/composables/useAvatar.ts
|
|
9
9
|
var v = [
|
|
@@ -2,7 +2,7 @@ import { hasNamedSlot as e, isPropPresent as t, resolveNamedSlot as n } from "..
|
|
|
2
2
|
import r from "../Icon/Icon.js";
|
|
3
3
|
import { useButton as i } from "./composables/useButton.js";
|
|
4
4
|
import { Fragment as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createTextVNode as l, defineComponent as u, mergeProps as d, normalizeProps as f, openBlock as p, resolveDynamicComponent as m, toDisplayString as h, unref as g, useSlots as _, withCtx as v } from "vue";
|
|
5
|
-
import { Loader2 as y } from "lucide
|
|
5
|
+
import { Loader2 as y } from "@lucide/vue";
|
|
6
6
|
//#region src/Components/Button/Button.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var b = /* @__PURE__ */ u({
|
|
8
8
|
inheritAttrs: !1,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LucideIcon } from 'lucide
|
|
1
|
+
import { LucideIcon } from '@lucide/vue';
|
|
2
2
|
import { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, Slot } from 'vue';
|
|
3
3
|
import { ButtonColor, ButtonDensity, ButtonRounded, ButtonSize, ButtonVariant, MergeHtmlProps, MergeProps } from '@bridge-ui/core';
|
|
4
4
|
import { IconProps } from '../Icon';
|
|
@@ -2,7 +2,7 @@ import e from "../FormControl/FormControl.js";
|
|
|
2
2
|
import { useCheckbox as t } from "./composables/useCheckbox.js";
|
|
3
3
|
import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, guardReactiveProps as c, mergeModels as l, mergeProps as u, normalizeClass as d, normalizeProps as f, openBlock as p, unref as m, useAttrs as h, useModel as g, withCtx as _ } from "vue";
|
|
4
4
|
import { cn as v } from "@bridge-ui/core";
|
|
5
|
-
import { Check as y } from "lucide
|
|
5
|
+
import { Check as y } from "@lucide/vue";
|
|
6
6
|
//#region src/Components/Checkbox/Checkbox.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var b = ["for"], x = ["checked"], S = {
|
|
8
8
|
key: 1,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ChipOwnProps, ChipSlots } from './chip.types';
|
|
2
|
+
type __VLS_Slots = ChipSlots;
|
|
3
|
+
declare const __VLS_base: import('vue').DefineComponent<ChipOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
|
+
dismiss: (event: MouseEvent | KeyboardEvent) => any;
|
|
5
|
+
}, string, import('vue').PublicProps, Readonly<ChipOwnProps> & Readonly<{
|
|
6
|
+
onDismiss?: ((event: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
7
|
+
}>, {
|
|
8
|
+
size: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ChipSize, import('./chip.types').ChipSizeOverrides>;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
clearLabel: string;
|
|
11
|
+
dismissible: boolean;
|
|
12
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { hasNamedSlot as e, resolveNamedSlot as t } from "../../Utils/slotOrProp.js";
|
|
2
|
+
import n from "../Icon/Icon.js";
|
|
3
|
+
import { useChip as r } from "./composables/useChip.js";
|
|
4
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createTextVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, mergeProps as p, normalizeProps as m, openBlock as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useSlots as y } from "vue";
|
|
5
|
+
import { X as b } from "@lucide/vue";
|
|
6
|
+
//#region src/Components/Chip/Chip.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var x = /* @__PURE__ */ d({
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "Chip",
|
|
10
|
+
props: {
|
|
11
|
+
classes: {},
|
|
12
|
+
clearLabel: { default: "Remove" },
|
|
13
|
+
customProps: {},
|
|
14
|
+
disabled: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !1
|
|
17
|
+
},
|
|
18
|
+
dismissible: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
label: {},
|
|
23
|
+
size: { default: "md" }
|
|
24
|
+
},
|
|
25
|
+
emits: ["dismiss"],
|
|
26
|
+
setup(d, { emit: x }) {
|
|
27
|
+
let S = y(), { merged: C, rootBind: w, labelBind: T, clearBind: E, clearIconSize: D, handleDismiss: O, handleClearKeyDown: k } = r(d, { size: "md" }, x), A = a(() => C.value.customProps?.clearIcon), j = a(() => D.value), M = a(() => e(S, "default") || !!C.value.label);
|
|
28
|
+
return (r, a) => (h(), c("span", m(f(v(w))), [M.value ? (h(), c("span", m(p({ key: 0 }, v(T))), [v(e)(v(S), "default") ? (h(), o(g(v(t)(v(S), "default")), { key: 0 })) : (h(), c(i, { key: 1 }, [l(_(d.label), 1)], 64))], 16)) : s("", !0), d.dismissible ? (h(), c("span", p({ key: 1 }, v(E), {
|
|
29
|
+
onClick: a[0] ||= (...e) => v(O) && v(O)(...e),
|
|
30
|
+
onKeydown: a[1] ||= (...e) => v(k) && v(k)(...e)
|
|
31
|
+
}), [u(v(n), p({ icon: v(b) }, A.value, { size: j.value }), null, 16, ["icon", "size"])], 16)) : s("", !0)], 16));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
//#endregion
|
|
35
|
+
export { x as default };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { HTMLAttributes, Slot } from 'vue';
|
|
2
|
+
import { ChipSize, MergeHtmlProps, MergeProps } from '@bridge-ui/core';
|
|
3
|
+
import { IconProps } from '../Icon';
|
|
4
|
+
export interface ChipSizeOverrides {}
|
|
5
|
+
export interface ChipClasses {
|
|
6
|
+
/**
|
|
7
|
+
* Classes merged onto the dismiss control.
|
|
8
|
+
*/
|
|
9
|
+
clear?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Classes merged onto the label.
|
|
12
|
+
*/
|
|
13
|
+
label?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Classes merged onto the root element.
|
|
16
|
+
*/
|
|
17
|
+
root?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ChipCustomProps {
|
|
20
|
+
/**
|
|
21
|
+
* Props forwarded to the dismiss control.
|
|
22
|
+
*/
|
|
23
|
+
clear?: HTMLAttributes;
|
|
24
|
+
/**
|
|
25
|
+
* Props forwarded to the dismiss `Icon` (`icon` is set by the chip).
|
|
26
|
+
*/
|
|
27
|
+
clearIcon?: Partial<Omit<IconProps, "icon">>;
|
|
28
|
+
/**
|
|
29
|
+
* Props forwarded to the label element.
|
|
30
|
+
*/
|
|
31
|
+
label?: HTMLAttributes;
|
|
32
|
+
/**
|
|
33
|
+
* Props forwarded to the root element.
|
|
34
|
+
*/
|
|
35
|
+
root?: HTMLAttributes;
|
|
36
|
+
}
|
|
37
|
+
export interface ChipEmits {
|
|
38
|
+
/**
|
|
39
|
+
* Emitted when the dismiss control is activated.
|
|
40
|
+
*/
|
|
41
|
+
dismiss: [event: MouseEvent | KeyboardEvent];
|
|
42
|
+
}
|
|
43
|
+
export interface ChipOwnProps {
|
|
44
|
+
/**
|
|
45
|
+
* Classes for chip parts.
|
|
46
|
+
*
|
|
47
|
+
* @default undefined
|
|
48
|
+
*/
|
|
49
|
+
classes?: ChipClasses;
|
|
50
|
+
/**
|
|
51
|
+
* Accessible name for the dismiss control.
|
|
52
|
+
*
|
|
53
|
+
* @default "Remove"
|
|
54
|
+
*/
|
|
55
|
+
clearLabel?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Extra props for internal parts (`root`, `label`, `clear`, …).
|
|
58
|
+
*
|
|
59
|
+
* @default undefined
|
|
60
|
+
*/
|
|
61
|
+
customProps?: ChipCustomProps;
|
|
62
|
+
/**
|
|
63
|
+
* Whether the chip is disabled.
|
|
64
|
+
*
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
disabled?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Shows a dismiss control that emits `dismiss`.
|
|
70
|
+
*
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
dismissible?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Chip label text. Prefer the default slot for custom content.
|
|
76
|
+
*
|
|
77
|
+
* @default undefined
|
|
78
|
+
*/
|
|
79
|
+
label?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Typography and padding scale, aligned with `FormField` / `Select`.
|
|
82
|
+
*
|
|
83
|
+
* @default "md"
|
|
84
|
+
*/
|
|
85
|
+
size?: MergeProps<ChipSize, ChipSizeOverrides>;
|
|
86
|
+
}
|
|
87
|
+
export interface ChipSlots {
|
|
88
|
+
/**
|
|
89
|
+
* Chip content. Falls back to `label` when omitted.
|
|
90
|
+
*/
|
|
91
|
+
default?: Slot;
|
|
92
|
+
}
|
|
93
|
+
export type ChipProps = MergeHtmlProps<ChipOwnProps, HTMLAttributes>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SetupContext } from 'vue';
|
|
2
|
+
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
|
|
3
|
+
import { ChipClasses, ChipEmits, ChipOwnProps, ChipProps } from '../chip.types';
|
|
4
|
+
export declare const chipBridgeKeys: readonly ["size", "label", "classes", "disabled", "clearLabel", "customProps", "dismissible"];
|
|
5
|
+
type ChipLibDefaults = LibDefaultsShape<ChipOwnProps, "size">;
|
|
6
|
+
type ChipMerged = MergeLibDefaults<ChipOwnProps, ChipLibDefaults>;
|
|
7
|
+
export declare function useChip(props: ChipOwnProps, libDefaults: ChipLibDefaults, emit: SetupContext<ChipEmits>["emit"]): {
|
|
8
|
+
merged: import('vue').ComputedRef<ChipMerged>;
|
|
9
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<ChipProps, "size" | "classes" | "customProps" | "label" | "disabled" | "clearLabel" | "dismissible">>>;
|
|
10
|
+
labelBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
11
|
+
clearBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
|
|
12
|
+
role: string;
|
|
13
|
+
tabindex: number;
|
|
14
|
+
"aria-label": string;
|
|
15
|
+
"aria-disabled": boolean | undefined;
|
|
16
|
+
}>>;
|
|
17
|
+
clearIconSize: import('vue').ComputedRef<string>;
|
|
18
|
+
mergedClasses: import('vue').ComputedRef<Partial<ChipClasses>>;
|
|
19
|
+
handleDismiss: (event: MouseEvent | KeyboardEvent) => void;
|
|
20
|
+
handleClearKeyDown: (event: KeyboardEvent) => void;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
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 { sizeProps as l } from "@bridge-ui/core/Components/Chip";
|
|
6
|
+
//#region src/Components/Chip/composables/useChip.ts
|
|
7
|
+
var u = [
|
|
8
|
+
"size",
|
|
9
|
+
"label",
|
|
10
|
+
"classes",
|
|
11
|
+
"disabled",
|
|
12
|
+
"clearLabel",
|
|
13
|
+
"customProps",
|
|
14
|
+
"dismissible"
|
|
15
|
+
];
|
|
16
|
+
function d(d, f, p) {
|
|
17
|
+
let m = i(), h = r(() => c({
|
|
18
|
+
bridgeKeys: u,
|
|
19
|
+
props: {
|
|
20
|
+
...m,
|
|
21
|
+
...d
|
|
22
|
+
}
|
|
23
|
+
})), { merged: g, entry: _ } = t({
|
|
24
|
+
libDefaults: f,
|
|
25
|
+
componentName: "Chip",
|
|
26
|
+
props: () => h.value.componentProps
|
|
27
|
+
}), v = n({
|
|
28
|
+
entry: _,
|
|
29
|
+
props: () => h.value.componentProps
|
|
30
|
+
}), y = r(() => g.value.customProps), b = r(() => a(s(l, _.value?.customProps?.size), g.value.size ?? "md")), x = r(() => b.value?.clear ?? "md"), S = r(() => e(y.value?.root, h.value.inheritedAttrs, o({
|
|
31
|
+
"inline-flex max-w-full items-center bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-100": !0,
|
|
32
|
+
"opacity-50 pointer-events-none": g.value.disabled === !0,
|
|
33
|
+
[b.value?.root ?? ""]: !0,
|
|
34
|
+
[v.value.root ?? ""]: !0
|
|
35
|
+
}))), C = r(() => e(y.value?.label, {}, o({
|
|
36
|
+
truncate: !0,
|
|
37
|
+
[b.value?.label ?? ""]: !0,
|
|
38
|
+
[v.value.label ?? ""]: !0
|
|
39
|
+
}))), w = r(() => e(y.value?.clear, {
|
|
40
|
+
role: "button",
|
|
41
|
+
tabindex: g.value.disabled ? -1 : 0,
|
|
42
|
+
"aria-label": g.value.clearLabel ?? "Remove",
|
|
43
|
+
"aria-disabled": g.value.disabled ? !0 : void 0
|
|
44
|
+
}, o({
|
|
45
|
+
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm text-gray-400 transition-colors duration-150 hover:text-gray-700 dark:text-gray-500 dark:hover:text-gray-200": !0,
|
|
46
|
+
[v.value.clear ?? ""]: !0
|
|
47
|
+
})));
|
|
48
|
+
function T(e) {
|
|
49
|
+
g.value.disabled || p("dismiss", e);
|
|
50
|
+
}
|
|
51
|
+
function E(e) {
|
|
52
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), T(e));
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
merged: g,
|
|
56
|
+
rootBind: S,
|
|
57
|
+
labelBind: C,
|
|
58
|
+
clearBind: w,
|
|
59
|
+
clearIconSize: x,
|
|
60
|
+
mergedClasses: v,
|
|
61
|
+
handleDismiss: T,
|
|
62
|
+
handleClearKeyDown: E
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { d as useChip };
|
|
@@ -220,7 +220,7 @@ export declare function useFormField(props: MaybeRefOrGetter<Omit<FormFieldOwnPr
|
|
|
220
220
|
}>>;
|
|
221
221
|
controlId: import('vue').ComputedRef<string>;
|
|
222
222
|
errorBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", HTMLAttributes | undefined, {}>>;
|
|
223
|
-
errorIcon: import('vue').ComputedRef<import('lucide
|
|
223
|
+
errorIcon: import('vue').ComputedRef<import('@lucide/vue').LucideIcon>;
|
|
224
224
|
inputBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {
|
|
225
225
|
id: string;
|
|
226
226
|
disabled: boolean;
|
|
@@ -3,7 +3,7 @@ import { mergePartBind as n, useBridgeUIComponent as r, useBridgeUIMergedRegistr
|
|
|
3
3
|
import { computed as a, toValue as o, useId as s, useSlots as c } from "vue";
|
|
4
4
|
import { get as l, omit as u } from "es-toolkit/compat";
|
|
5
5
|
import { cn as d, mergeBridgeUILayeredClasses as f, splitComponentProps as p } from "@bridge-ui/core";
|
|
6
|
-
import { CircleAlert as m } from "lucide
|
|
6
|
+
import { CircleAlert as m } from "@lucide/vue";
|
|
7
7
|
import { colorProps as h, invalidatedProps as g, roundedProps as _, sizeProps as v, variantProps as y } from "@bridge-ui/core/Components/FormField";
|
|
8
8
|
//#region src/Components/FormField/composables/useFormField.ts
|
|
9
9
|
var b = [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LucideIcon } from 'lucide
|
|
1
|
+
import { LucideIcon } from '@lucide/vue';
|
|
2
2
|
import { HTMLAttributes, InputHTMLAttributes, Slot } from 'vue';
|
|
3
3
|
import { FormFieldColor, FormFieldInvalidated, FormFieldRounded, FormFieldSize, FormFieldVariant, MergeHtmlProps, MergeProps } from '@bridge-ui/core';
|
|
4
4
|
import { UseFormFieldReturn } from './composables/useFormField';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LucideIcon } from 'lucide
|
|
1
|
+
import { LucideIcon } from '@lucide/vue';
|
|
2
2
|
import { AnchorHTMLAttributes, HTMLAttributes, Slot } from 'vue';
|
|
3
3
|
import { LinkColor, LinkSize, LinkUnderline, MergeHtmlProps, MergeProps } from '@bridge-ui/core';
|
|
4
4
|
import { IconProps } from '../Icon';
|
|
@@ -15,6 +15,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
15
15
|
"onShow-change"?: ((show: boolean) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
17
|
color: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListboxColor, import('./listbox.types').ListboxColorOverrides>;
|
|
18
|
+
size: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListboxSize, import('./listbox.types').ListboxSizeOverrides>;
|
|
18
19
|
loading: boolean;
|
|
19
20
|
multiple: boolean;
|
|
20
21
|
disableAutoFocus: boolean;
|
|
@@ -22,6 +23,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
22
23
|
emptyMessage: string;
|
|
23
24
|
hideEmptyMessage: boolean;
|
|
24
25
|
highlightedIndex: number;
|
|
26
|
+
loadingMessage: string;
|
|
25
27
|
showCheckmark: boolean;
|
|
26
28
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
27
29
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -3,19 +3,13 @@ import n from "../List/List.js";
|
|
|
3
3
|
import { useListbox as r } from "./composables/useListbox.js";
|
|
4
4
|
import i from "../ListItem/ListItem.js";
|
|
5
5
|
import a from "../Menu/Menu.js";
|
|
6
|
-
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u,
|
|
7
|
-
import { cn as
|
|
8
|
-
import { Check as
|
|
6
|
+
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as f, createVNode as p, defineComponent as m, guardReactiveProps as h, mergeModels as g, mergeProps as _, normalizeClass as v, normalizeProps as y, openBlock as b, renderList as x, renderSlot as S, resolveDynamicComponent as C, toDisplayString as w, unref as T, useModel as E, useSlots as D, watch as O, withCtx as k } from "vue";
|
|
7
|
+
import { cn as A } from "@bridge-ui/core";
|
|
8
|
+
import { Check as j } from "@lucide/vue";
|
|
9
9
|
//#region src/Components/Listbox/Listbox.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
11
|
-
key: 1,
|
|
12
|
-
class: "px-4 py-3 text-sm text-gray-500"
|
|
13
|
-
}, j = { key: 1 }, M = {
|
|
14
|
-
key: 3,
|
|
15
|
-
class: "px-4 py-3 text-sm text-gray-500"
|
|
16
|
-
}, N = /* @__PURE__ */ p({
|
|
10
|
+
var M = { key: 1 }, N = /* @__PURE__ */ m({
|
|
17
11
|
__name: "Listbox",
|
|
18
|
-
props: /* @__PURE__ */
|
|
12
|
+
props: /* @__PURE__ */ g({
|
|
19
13
|
anchorEl: {},
|
|
20
14
|
classes: {},
|
|
21
15
|
color: { default: "primary" },
|
|
@@ -39,6 +33,7 @@ var A = {
|
|
|
39
33
|
type: Boolean,
|
|
40
34
|
default: !1
|
|
41
35
|
},
|
|
36
|
+
loadingMessage: { default: "Loading..." },
|
|
42
37
|
maxHeight: {},
|
|
43
38
|
multiple: {
|
|
44
39
|
type: Boolean,
|
|
@@ -49,7 +44,8 @@ var A = {
|
|
|
49
44
|
showCheckmark: {
|
|
50
45
|
type: Boolean,
|
|
51
46
|
default: !0
|
|
52
|
-
}
|
|
47
|
+
},
|
|
48
|
+
size: { default: "md" }
|
|
53
49
|
}, {
|
|
54
50
|
modelValue: {
|
|
55
51
|
type: Boolean,
|
|
@@ -57,52 +53,60 @@ var A = {
|
|
|
57
53
|
},
|
|
58
54
|
modelModifiers: {}
|
|
59
55
|
}),
|
|
60
|
-
emits: /* @__PURE__ */
|
|
61
|
-
setup(
|
|
62
|
-
let N =
|
|
63
|
-
|
|
56
|
+
emits: /* @__PURE__ */ g(["select", "show-change"], ["update:modelValue"]),
|
|
57
|
+
setup(m, { emit: g }) {
|
|
58
|
+
let N = D(), P = g, F = E(m, "modelValue");
|
|
59
|
+
O(F, (e) => {
|
|
64
60
|
P("show-change", e);
|
|
65
61
|
});
|
|
66
|
-
let I =
|
|
67
|
-
|
|
62
|
+
let I = m, { checkClass: L, scrollBind: R, contentBind: z, messageBind: B, loadingBind: V, sizeClasses: H, mergedClasses: U, loadingTrackBind: W, optionSelectedClass: G, optionHighlightedClass: K } = r(I, {
|
|
63
|
+
size: "md",
|
|
64
|
+
color: "primary"
|
|
65
|
+
}), q = s(() => ({ content: z.value })), J = s(() => !I.loading && I.options.length === 0 && I.hideEmptyMessage !== !0), Y = s(() => A(L.value, U.value.check));
|
|
66
|
+
function X(e) {
|
|
68
67
|
return I.isSelected?.(e) ?? !1;
|
|
69
68
|
}
|
|
70
|
-
function
|
|
69
|
+
function Z(e) {
|
|
71
70
|
return I.highlightedIndex === e;
|
|
72
71
|
}
|
|
73
|
-
function
|
|
72
|
+
function Q(e) {
|
|
74
73
|
e.preventDefault();
|
|
75
74
|
}
|
|
76
|
-
function
|
|
75
|
+
function $(e, t) {
|
|
77
76
|
let n = {
|
|
78
77
|
tabindex: -1,
|
|
79
|
-
onMousedown:
|
|
78
|
+
onMousedown: Q,
|
|
79
|
+
class: A(H.value?.option)
|
|
80
|
+
};
|
|
81
|
+
return X(e.value) ? n.class = A(n.class, G.value, U.value.optionSelected) : Z(t) && (n.class = A(n.class, K.value, U.value.optionHighlighted)), {
|
|
82
|
+
interactive: n,
|
|
83
|
+
primary: { class: H.value?.primary },
|
|
84
|
+
secondary: { class: H.value?.secondary }
|
|
80
85
|
};
|
|
81
|
-
return G(e.value) ? n.class = O(V.value, B.value.optionSelected) : K(t) && (n.class = O(H.value, B.value.optionHighlighted)), { interactive: n };
|
|
82
86
|
}
|
|
83
|
-
function
|
|
87
|
+
function ee(e) {
|
|
84
88
|
e.disabled || P("select", e);
|
|
85
89
|
}
|
|
86
|
-
return (r, s) => (
|
|
90
|
+
return (r, s) => (b(), c(T(a), {
|
|
87
91
|
modelValue: F.value,
|
|
88
92
|
"onUpdate:modelValue": s[0] ||= (e) => F.value = e,
|
|
89
|
-
"anchor-el":
|
|
90
|
-
placement:
|
|
93
|
+
"anchor-el": m.anchorEl,
|
|
94
|
+
placement: m.placement,
|
|
91
95
|
"close-on-click-away": !0,
|
|
92
|
-
"
|
|
93
|
-
"
|
|
96
|
+
"custom-props": q.value,
|
|
97
|
+
"disable-auto-focus": m.disableAutoFocus
|
|
94
98
|
}, {
|
|
95
|
-
default:
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
default: k(() => [
|
|
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(R))), [p(T(n), {
|
|
98
102
|
dense: "",
|
|
99
103
|
role: "listbox",
|
|
100
104
|
padding: "none",
|
|
101
|
-
id:
|
|
102
|
-
"aria-labelledby":
|
|
103
|
-
"aria-multiselectable":
|
|
105
|
+
id: m.listboxId,
|
|
106
|
+
"aria-labelledby": m.labelledBy,
|
|
107
|
+
"aria-multiselectable": m.multiple || void 0
|
|
104
108
|
}, {
|
|
105
|
-
default:
|
|
109
|
+
default: k(() => [(b(!0), u(o, null, x(m.options, (t, n) => (b(), c(T(i), {
|
|
106
110
|
interactive: "",
|
|
107
111
|
role: "option",
|
|
108
112
|
selected: !1,
|
|
@@ -110,20 +114,20 @@ var A = {
|
|
|
110
114
|
key: String(t.value),
|
|
111
115
|
disabled: t.disabled,
|
|
112
116
|
secondary: t.description,
|
|
113
|
-
onClick: (e) =>
|
|
114
|
-
id: `${
|
|
115
|
-
"aria-selected":
|
|
116
|
-
"custom-props":
|
|
117
|
-
},
|
|
117
|
+
onClick: (e) => ee(t),
|
|
118
|
+
id: `${m.listboxId}-option-${n}`,
|
|
119
|
+
"aria-selected": X(t.value),
|
|
120
|
+
"custom-props": $(t, n)
|
|
121
|
+
}, f({ _: 2 }, [T(e)(T(N), "option") ? {
|
|
118
122
|
name: "default",
|
|
119
|
-
fn:
|
|
123
|
+
fn: k(() => [S(r.$slots, "option", {
|
|
120
124
|
option: t,
|
|
121
|
-
selected:
|
|
125
|
+
selected: X(t.value)
|
|
122
126
|
})]),
|
|
123
127
|
key: "0"
|
|
124
|
-
} : void 0,
|
|
128
|
+
} : void 0, m.showCheckmark && X(t.value) ? {
|
|
125
129
|
name: "end",
|
|
126
|
-
fn:
|
|
130
|
+
fn: k(() => [p(T(j), { class: v(Y.value) }, null, 8, ["class"])]),
|
|
127
131
|
key: "1"
|
|
128
132
|
} : void 0]), 1032, [
|
|
129
133
|
"primary",
|
|
@@ -140,16 +144,16 @@ var A = {
|
|
|
140
144
|
"aria-labelledby",
|
|
141
145
|
"aria-multiselectable"
|
|
142
146
|
])], 16)),
|
|
143
|
-
|
|
144
|
-
|
|
147
|
+
J.value && !T(e)(T(N), "empty") ? (b(), u("div", y(_({ key: 3 }, T(B))), w(m.emptyMessage), 17)) : J.value && T(e)(T(N), "empty") ? (b(), c(C(T(t)(T(N), "empty")), { key: 4 })) : l("", !0),
|
|
148
|
+
T(e)(T(N), "afterOptions") ? (b(), c(C(T(t)(T(N), "afterOptions")), { key: 5 })) : l("", !0)
|
|
145
149
|
]),
|
|
146
150
|
_: 3
|
|
147
151
|
}, 8, [
|
|
148
152
|
"modelValue",
|
|
149
153
|
"anchor-el",
|
|
150
154
|
"placement",
|
|
151
|
-
"
|
|
152
|
-
"
|
|
155
|
+
"custom-props",
|
|
156
|
+
"disable-auto-focus"
|
|
153
157
|
]));
|
|
154
158
|
}
|
|
155
159
|
});
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
|
|
2
2
|
import { ListboxClasses, ListboxOwnProps } from '../listbox.types';
|
|
3
|
-
|
|
3
|
+
export declare const listboxBridgeKeys: readonly ["size", "color", "classes", "maxHeight", "customProps", "invalidated", "disableMaxHeight"];
|
|
4
|
+
type ListboxLibDefaults = LibDefaultsShape<ListboxOwnProps, "size" | "color">;
|
|
4
5
|
type ListboxMerged = MergeLibDefaults<ListboxOwnProps, ListboxLibDefaults>;
|
|
5
6
|
export declare function useListbox(props: ListboxOwnProps, libDefaults: ListboxLibDefaults): {
|
|
6
7
|
merged: import('vue').ComputedRef<ListboxMerged>;
|
|
7
|
-
checkClass: import('vue').ComputedRef<string
|
|
8
|
+
checkClass: import('vue').ComputedRef<string>;
|
|
8
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
|
+
messageBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {}, {}>>;
|
|
12
|
+
loadingBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
13
|
+
sizeClasses: import('vue').ComputedRef<import('@bridge-ui/core').ListboxSizeItem | undefined>;
|
|
9
14
|
mergedClasses: import('vue').ComputedRef<Partial<ListboxClasses>>;
|
|
15
|
+
loadingTrackBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {}, {
|
|
16
|
+
role: string;
|
|
17
|
+
"aria-hidden": boolean;
|
|
18
|
+
}>>;
|
|
10
19
|
optionSelectedClass: import('vue').ComputedRef<string | undefined>;
|
|
11
20
|
optionHighlightedClass: import('vue').ComputedRef<string | undefined>;
|
|
12
21
|
};
|