@bridge-ui/vue 0.0.1-beta.2 → 0.0.1-beta.4
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 +3 -5
- package/dist/Components/Button/button.types.d.ts +1 -1
- package/dist/Components/Button/composables/useButton.js +52 -44
- 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/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/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 +51 -47
- package/dist/Components/Listbox/composables/useListbox.d.ts +10 -2
- package/dist/Components/Listbox/composables/useListbox.js +43 -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/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/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 +15 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +43 -37
- package/dist/theme.css +14 -0
- package/package.json +4 -4
|
@@ -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,
|
|
@@ -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,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';
|
|
@@ -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 };
|
|
@@ -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 };
|
|
@@ -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 border-solid": !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>;
|
|
@@ -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;
|