@bridge-ui/vue 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/skills/bridge-ui-components/SKILL.md +2 -2
- package/dist/Components/Alert/alertDefaultIcons.js +1 -0
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +1 -1
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +150 -145
- package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/Button/button.types.d.ts +6 -0
- package/dist/Components/Button/composables/useButton.d.ts +4 -1
- package/dist/Components/Button/composables/useButton.js +88 -69
- package/dist/Components/ButtonGroup/ButtonGroup.js +5 -0
- package/dist/Components/ButtonGroup/ButtonGroup.vue.d.ts +14 -0
- package/dist/Components/ButtonGroup/ButtonGroup.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/Components/ButtonGroup/buttonGroup.types.d.ts +93 -0
- package/dist/Components/ButtonGroup/buttonGroupInjectionKey.d.ts +7 -0
- package/dist/Components/ButtonGroup/buttonGroupInjectionKey.js +4 -0
- package/dist/Components/ButtonGroup/composables/useButtonGroup.d.ts +16 -0
- package/dist/Components/ButtonGroup/composables/useButtonGroup.js +66 -0
- package/dist/Components/ButtonGroup/index.d.ts +4 -0
- package/dist/Components/ButtonGroup/index.js +4 -0
- package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Checkbox/composables/useCheckbox.js +1 -1
- package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +89 -90
- package/dist/Components/DataTable/DataTableColumnsMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/DataTable/DataTableFilterMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/DataTable/DataTableFilterOptions.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/DataTable/DataTableSortButton.vue.d.ts +5 -11
- package/dist/Components/DataTable/DataTableSortButton.vue_vue_type_script_setup_true_lang.js +22 -26
- package/dist/Components/DataTable/composables/useDataTable.d.ts +0 -3
- package/dist/Components/DataTable/composables/useDataTable.js +199 -213
- package/dist/Components/FieldOverlay/composables/useFieldOverlay.js +4 -1
- package/dist/Components/List/composables/useList.js +1 -1
- package/dist/Components/ListItem/ListItem.vue.d.ts +1 -1
- package/dist/Components/ListItem/composables/useListItem.d.ts +2 -2
- package/dist/Components/ListItem/composables/useListItem.js +101 -86
- package/dist/Components/ListSection/composables/useListSection.js +34 -31
- package/dist/Components/ListSection/listSection.types.d.ts +2 -1
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +82 -82
- package/dist/Components/Listbox/collectComposedListboxOptions.d.ts +5 -0
- package/dist/Components/Listbox/collectComposedListboxOptions.js +27 -0
- package/dist/Components/Radio/composables/useRadio.js +2 -1
- package/dist/Components/Select/composables/useSelect.d.ts +1 -1
- package/dist/Components/Select/composables/useSelect.js +104 -99
- package/dist/Components/Sidebar/composables/useSidebarListItem.js +29 -28
- package/dist/Components/Sidebar/composables/useSidebarTrigger.js +14 -14
- package/dist/Components/Slider/composables/useSlider.js +53 -53
- package/dist/Components/Snackbar/snackbarDefaultIcons.js +1 -0
- package/dist/Components/Tabs/Tabs.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/Components/TimePanel/composables/useTimePanel.js +106 -106
- package/dist/augments.d.ts +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +150 -147
- package/docs/README.md +1 -0
- package/docs/components/Badge.md +2 -0
- package/docs/components/Button.md +5 -1
- package/docs/components/ButtonGroup.md +124 -0
- package/docs/components/DataTable.md +4 -0
- package/docs/components/Divider.md +1 -0
- package/docs/components/ToggleGroup.md +1 -1
- package/docs/examples/i18n-dictionary.ts +3 -0
- package/package.json +2 -2
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { BUTTON_GROUP_INJECTION_KEY as r } from "../../ButtonGroup/buttonGroupInjectionKey.js";
|
|
3
|
+
import { computed as i, inject as a, useAttrs as o } from "vue";
|
|
4
|
+
import { get as s, includes as c, isNil as l } from "es-toolkit/compat";
|
|
5
|
+
import { buttonDensityProps as u, buttonRoundedProps as d, buttonVariantProps as f } from "@bridge-ui/core/Tokens";
|
|
6
|
+
import { cn as p, mergeBridgeUILayeredClasses as m, splitComponentProps as h } from "@bridge-ui/core/Utils";
|
|
6
7
|
//#region src/Components/Button/composables/useButton.ts
|
|
7
|
-
var
|
|
8
|
+
var g = [
|
|
8
9
|
"as",
|
|
9
10
|
"full",
|
|
10
11
|
"href",
|
|
@@ -19,90 +20,108 @@ var m = [
|
|
|
19
20
|
"rounded",
|
|
20
21
|
"variant",
|
|
21
22
|
"disabled",
|
|
23
|
+
"selected",
|
|
22
24
|
"startIcon",
|
|
23
25
|
"customProps"
|
|
24
26
|
];
|
|
25
|
-
function
|
|
26
|
-
let
|
|
27
|
-
bridgeKeys:
|
|
27
|
+
function _(_, v) {
|
|
28
|
+
let y = o(), b = a(r, null), x = i(() => h({
|
|
29
|
+
bridgeKeys: g,
|
|
28
30
|
props: {
|
|
29
|
-
...
|
|
30
|
-
...
|
|
31
|
+
...y,
|
|
32
|
+
..._
|
|
31
33
|
}
|
|
32
|
-
})),
|
|
33
|
-
|
|
34
|
+
})), S = i(() => {
|
|
35
|
+
let e = x.value.componentProps, t = b?.value;
|
|
36
|
+
return {
|
|
37
|
+
...e,
|
|
38
|
+
size: e.size ?? t?.size,
|
|
39
|
+
color: e.color ?? t?.color,
|
|
40
|
+
density: e.density ?? t?.density,
|
|
41
|
+
rounded: e.rounded ?? t?.rounded,
|
|
42
|
+
variant: e.variant ?? t?.variant
|
|
43
|
+
};
|
|
44
|
+
}), { merged: C, entry: w } = t({
|
|
45
|
+
libDefaults: v,
|
|
34
46
|
componentName: "Button",
|
|
35
|
-
props: () =>
|
|
36
|
-
}),
|
|
37
|
-
entry:
|
|
38
|
-
props: () =>
|
|
39
|
-
}),
|
|
40
|
-
if (!(!
|
|
41
|
-
}),
|
|
42
|
-
if (!
|
|
43
|
-
let e =
|
|
44
|
-
return
|
|
47
|
+
props: () => S.value
|
|
48
|
+
}), T = i(() => C.value.customProps), E = n({
|
|
49
|
+
entry: w,
|
|
50
|
+
props: () => x.value.componentProps
|
|
51
|
+
}), D = i(() => C.value.as ?? "button"), O = i(() => D.value === "a"), k = i(() => D.value === "button"), A = i(() => C.value.density === "mini"), j = i(() => C.value.disabled || C.value.loading), M = i(() => k.value ? j.value : void 0), N = i(() => C.value.loading ? !0 : void 0), P = i(() => j.value && !k.value ? !0 : void 0), F = i(() => {
|
|
52
|
+
if (!(!O.value || j.value || !C.value.href)) return C.value.href;
|
|
53
|
+
}), I = i(() => {
|
|
54
|
+
if (!k.value) return;
|
|
55
|
+
let e = s(x.value.inheritedAttrs, "type");
|
|
56
|
+
return c([
|
|
45
57
|
"submit",
|
|
46
58
|
"reset",
|
|
47
59
|
"button"
|
|
48
60
|
], e) ? e : "button";
|
|
49
|
-
}),
|
|
50
|
-
let e =
|
|
51
|
-
return
|
|
52
|
-
}),
|
|
53
|
-
let e = f
|
|
54
|
-
return
|
|
55
|
-
}),
|
|
56
|
-
let e =
|
|
57
|
-
return
|
|
61
|
+
}), L = i(() => {
|
|
62
|
+
let e = m(u, w.value?.tokens?.density);
|
|
63
|
+
return s(e, [C.value.density, C.value.size]);
|
|
64
|
+
}), R = i(() => l(S.value.variant) ? l(b) && A.value ? "flat" : C.value.variant : S.value.variant), z = i(() => {
|
|
65
|
+
let e = m(f, w.value?.tokens?.variant);
|
|
66
|
+
return s(e, [R.value, C.value.color]);
|
|
67
|
+
}), B = i(() => {
|
|
68
|
+
let e = m(d, w.value?.tokens?.rounded);
|
|
69
|
+
return s(e, C.value.rounded);
|
|
58
70
|
});
|
|
59
71
|
return {
|
|
60
|
-
tag:
|
|
61
|
-
merged:
|
|
62
|
-
isMini:
|
|
63
|
-
iconBind:
|
|
72
|
+
tag: D,
|
|
73
|
+
merged: C,
|
|
74
|
+
isMini: A,
|
|
75
|
+
iconBind: i(() => e(T.value?.icon, {}, p({
|
|
64
76
|
"shrink-0": !0,
|
|
65
|
-
[
|
|
77
|
+
[E.value.icon ?? ""]: !0
|
|
66
78
|
}))),
|
|
67
|
-
rootBind:
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
79
|
+
rootBind: i(() => e(T.value?.root, x.value.inheritedAttrs, {
|
|
80
|
+
"aria-pressed": l(C.value.selected) ? void 0 : C.value.selected,
|
|
81
|
+
class: p({
|
|
82
|
+
"inline-flex items-center justify-center": !0,
|
|
83
|
+
"cursor-pointer outline-none outline-hidden": !0,
|
|
84
|
+
"shrink-0": A.value,
|
|
85
|
+
[L.value ?? ""]: !0,
|
|
86
|
+
[B.value ?? ""]: !0,
|
|
87
|
+
"h-auto": A.value && !l(b) && b.value?.density !== "mini",
|
|
88
|
+
"border border-transparent": !l(b) && R.value !== "outline",
|
|
89
|
+
"w-full": !A.value && C.value.full,
|
|
90
|
+
"w-fit": !A.value && !C.value.full,
|
|
91
|
+
"group hover:shadow-xs": !A.value,
|
|
92
|
+
[s(z.value, "base") ?? ""]: !0,
|
|
93
|
+
[s(z.value, "hover") ?? ""]: !0,
|
|
94
|
+
[s(z.value, "focus") ?? ""]: !0,
|
|
95
|
+
[s(z.value, "selected") ?? ""]: C.value.selected === !0,
|
|
96
|
+
"relative z-10": C.value.selected === !0,
|
|
97
|
+
"transition-all ease-in-out duration-200": !0,
|
|
98
|
+
"focus:ring-2": !0,
|
|
99
|
+
"focus:ring-offset-background-white dark:focus:ring-offset-background-dark": !0,
|
|
100
|
+
"disabled:opacity-80 disabled:cursor-not-allowed": !0,
|
|
101
|
+
"aria-disabled:opacity-80 aria-disabled:cursor-not-allowed aria-disabled:pointer-events-none": !0,
|
|
102
|
+
[E.value.root ?? ""]: !0
|
|
103
|
+
})
|
|
104
|
+
})),
|
|
105
|
+
rootHref: F,
|
|
106
|
+
rootType: I,
|
|
107
|
+
endIconBind: i(() => e(T.value?.endIcon, {}, p({
|
|
89
108
|
"shrink-0": !0,
|
|
90
|
-
[
|
|
109
|
+
[E.value.endIcon ?? ""]: !0
|
|
91
110
|
}))),
|
|
92
|
-
endSlotBind:
|
|
93
|
-
rootAriaBusy:
|
|
94
|
-
rootDisabled:
|
|
95
|
-
startIconBind:
|
|
111
|
+
endSlotBind: i(() => e(T.value?.end, {}, "inline-flex shrink-0 items-center")),
|
|
112
|
+
rootAriaBusy: N,
|
|
113
|
+
rootDisabled: M,
|
|
114
|
+
startIconBind: i(() => e(T.value?.startIcon, {}, p({
|
|
96
115
|
"shrink-0": !0,
|
|
97
|
-
[
|
|
116
|
+
[E.value.startIcon ?? ""]: !0
|
|
98
117
|
}))),
|
|
99
|
-
startSlotBind:
|
|
100
|
-
loadingIconBind:
|
|
118
|
+
startSlotBind: i(() => e(T.value?.start, {}, "inline-flex shrink-0 items-center")),
|
|
119
|
+
loadingIconBind: i(() => e(T.value?.loading, {}, p({
|
|
101
120
|
"shrink-0 animate-spin": !0,
|
|
102
|
-
[
|
|
121
|
+
[E.value.loading ?? ""]: !0
|
|
103
122
|
}))),
|
|
104
|
-
rootAriaDisabled:
|
|
123
|
+
rootAriaDisabled: P
|
|
105
124
|
};
|
|
106
125
|
}
|
|
107
126
|
//#endregion
|
|
108
|
-
export {
|
|
127
|
+
export { _ as useButton };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ButtonGroupOwnProps, ButtonGroupSlots } from './buttonGroup.types';
|
|
2
|
+
type __VLS_Slots = ButtonGroupSlots;
|
|
3
|
+
declare const __VLS_base: import('vue').DefineComponent<ButtonGroupOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ButtonGroupOwnProps> & Readonly<{}>, {
|
|
4
|
+
full: boolean;
|
|
5
|
+
separator: boolean;
|
|
6
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useButtonGroup as e } from "./composables/useButtonGroup.js";
|
|
2
|
+
import { createElementBlock as t, defineComponent as n, guardReactiveProps as r, normalizeProps as i, openBlock as a, renderSlot as o, unref as s } from "vue";
|
|
3
|
+
//#region src/Components/ButtonGroup/ButtonGroup.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var c = /*@__PURE__*/ n({
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "ButtonGroup",
|
|
7
|
+
props: {
|
|
8
|
+
classes: {},
|
|
9
|
+
color: {},
|
|
10
|
+
customProps: {},
|
|
11
|
+
density: {},
|
|
12
|
+
full: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: !1
|
|
15
|
+
},
|
|
16
|
+
orientation: {},
|
|
17
|
+
rounded: {},
|
|
18
|
+
separator: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !0
|
|
21
|
+
},
|
|
22
|
+
size: {},
|
|
23
|
+
variant: {}
|
|
24
|
+
},
|
|
25
|
+
setup(n) {
|
|
26
|
+
let { rootBind: c } = e(n, {
|
|
27
|
+
full: !1,
|
|
28
|
+
separator: !0,
|
|
29
|
+
color: "primary",
|
|
30
|
+
variant: "solid",
|
|
31
|
+
orientation: "horizontal"
|
|
32
|
+
});
|
|
33
|
+
return (e, n) => (a(), t("div", i(r(s(c))), [o(e.$slots, "default")], 16));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
//#endregion
|
|
37
|
+
export { c as default };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { HTMLAttributes, Slot } from 'vue';
|
|
2
|
+
import { ButtonColor, ButtonDensity, ButtonGroupOrientation, ButtonRounded, ButtonSize, ButtonVariant } from '@bridge-ui/core/Tokens';
|
|
3
|
+
import { MergeHtmlProps, MergeProps } from '@bridge-ui/core/Utils';
|
|
4
|
+
import { ButtonColorOverrides, ButtonDensityOverrides, ButtonRoundedOverrides, ButtonSizeOverrides, ButtonVariantOverrides } from '../Button/button.types';
|
|
5
|
+
export interface ButtonGroupOrientationOverrides {}
|
|
6
|
+
export interface ButtonGroupClasses {
|
|
7
|
+
/**
|
|
8
|
+
* Classes merged onto the root.
|
|
9
|
+
*/
|
|
10
|
+
root?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ButtonGroupCustomProps {
|
|
13
|
+
/**
|
|
14
|
+
* Props forwarded to the root element.
|
|
15
|
+
*
|
|
16
|
+
* @default undefined
|
|
17
|
+
*/
|
|
18
|
+
root?: HTMLAttributes;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Groups related action buttons in a joined strip.
|
|
22
|
+
* Compose with `Button`. Size, color, density, rounded, and variant
|
|
23
|
+
* cascade to nested buttons unless they override them.
|
|
24
|
+
*/
|
|
25
|
+
export interface ButtonGroupOwnProps {
|
|
26
|
+
/**
|
|
27
|
+
* Classes for button group parts.
|
|
28
|
+
*
|
|
29
|
+
* @default undefined
|
|
30
|
+
*/
|
|
31
|
+
classes?: ButtonGroupClasses;
|
|
32
|
+
/**
|
|
33
|
+
* Color applied to nested `Button` children when set. The divider follows the button text color.
|
|
34
|
+
*
|
|
35
|
+
* @default "primary"
|
|
36
|
+
*/
|
|
37
|
+
color?: MergeProps<ButtonColor, ButtonColorOverrides>;
|
|
38
|
+
/**
|
|
39
|
+
* Extra props for internal parts.
|
|
40
|
+
*
|
|
41
|
+
* @default undefined
|
|
42
|
+
*/
|
|
43
|
+
customProps?: ButtonGroupCustomProps;
|
|
44
|
+
/**
|
|
45
|
+
* Density applied to nested `Button` children unless they set `density`.
|
|
46
|
+
*
|
|
47
|
+
* @default undefined
|
|
48
|
+
*/
|
|
49
|
+
density?: MergeProps<ButtonDensity, ButtonDensityOverrides>;
|
|
50
|
+
/**
|
|
51
|
+
* Stretch the group to the container width.
|
|
52
|
+
*
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
full?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Layout orientation of the group.
|
|
58
|
+
*
|
|
59
|
+
* @default "horizontal"
|
|
60
|
+
*/
|
|
61
|
+
orientation?: MergeProps<ButtonGroupOrientation, ButtonGroupOrientationOverrides>;
|
|
62
|
+
/**
|
|
63
|
+
* Roundness applied to nested `Button` children unless they set `rounded`.
|
|
64
|
+
*
|
|
65
|
+
* @default undefined
|
|
66
|
+
*/
|
|
67
|
+
rounded?: MergeProps<ButtonRounded, ButtonRoundedOverrides>;
|
|
68
|
+
/**
|
|
69
|
+
* Draw a full-height divider between adjacent children. The fill matches the button text color.
|
|
70
|
+
*
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
separator?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Size applied to nested `Button` children unless they set `size`.
|
|
76
|
+
*
|
|
77
|
+
* @default undefined
|
|
78
|
+
*/
|
|
79
|
+
size?: MergeProps<ButtonSize, ButtonSizeOverrides>;
|
|
80
|
+
/**
|
|
81
|
+
* Variant applied to nested `Button` children unless they set `variant`.
|
|
82
|
+
*
|
|
83
|
+
* @default undefined
|
|
84
|
+
*/
|
|
85
|
+
variant?: MergeProps<ButtonVariant, ButtonVariantOverrides>;
|
|
86
|
+
}
|
|
87
|
+
export interface ButtonGroupSlots {
|
|
88
|
+
/**
|
|
89
|
+
* Grouped controls (`Button`, nested `ButtonGroup`).
|
|
90
|
+
*/
|
|
91
|
+
default?: Slot<undefined>;
|
|
92
|
+
}
|
|
93
|
+
export type ButtonGroupProps = MergeHtmlProps<ButtonGroupOwnProps, HTMLAttributes>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
import { ButtonGroupOwnProps } from './buttonGroup.types';
|
|
3
|
+
/**
|
|
4
|
+
* Button appearance cascaded to nested `Button` children.
|
|
5
|
+
*/
|
|
6
|
+
export type ButtonGroupContextValue = Pick<ButtonGroupOwnProps, "size" | "color" | "density" | "rounded" | "variant">;
|
|
7
|
+
export declare const BUTTON_GROUP_INJECTION_KEY: InjectionKey<ComputedRef<ButtonGroupContextValue>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
|
|
2
|
+
import { ButtonGroupOwnProps, ButtonGroupProps } from '../buttonGroup.types';
|
|
3
|
+
type ButtonGroupLibDefaults = LibDefaultsShape<ButtonGroupOwnProps, "full" | "color" | "variant" | "separator" | "orientation">;
|
|
4
|
+
type ButtonGroupMerged = MergeLibDefaults<ButtonGroupOwnProps, ButtonGroupLibDefaults>;
|
|
5
|
+
/**
|
|
6
|
+
* Builds bind props for a grouped set of action buttons.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useButtonGroup(props: ButtonGroupOwnProps, libDefaults: ButtonGroupLibDefaults): {
|
|
9
|
+
merged: import('vue').ComputedRef<ButtonGroupMerged>;
|
|
10
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
|
|
11
|
+
role: string;
|
|
12
|
+
"data-slot": string;
|
|
13
|
+
class: string;
|
|
14
|
+
}, "class", import('vue').HTMLAttributes | undefined, Omit<ButtonGroupProps, "color" | "orientation" | "size" | "classes" | "customProps" | "full" | "rounded" | "variant" | "density" | "separator">>>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
|
+
import { BUTTON_GROUP_INJECTION_KEY as r } from "../buttonGroupInjectionKey.js";
|
|
3
|
+
import { computed as i, inject as a, provide as o, useAttrs as s } from "vue";
|
|
4
|
+
import { get as c } from "es-toolkit/compat";
|
|
5
|
+
import { buttonGroupOrientationProps as l } from "@bridge-ui/core/Tokens";
|
|
6
|
+
import { cn as u, mergeBridgeUILayeredClasses as d, splitComponentProps as f } from "@bridge-ui/core/Utils";
|
|
7
|
+
//#region src/Components/ButtonGroup/composables/useButtonGroup.ts
|
|
8
|
+
var p = [
|
|
9
|
+
"full",
|
|
10
|
+
"size",
|
|
11
|
+
"color",
|
|
12
|
+
"classes",
|
|
13
|
+
"density",
|
|
14
|
+
"rounded",
|
|
15
|
+
"variant",
|
|
16
|
+
"separator",
|
|
17
|
+
"customProps",
|
|
18
|
+
"orientation"
|
|
19
|
+
];
|
|
20
|
+
function m(m, h) {
|
|
21
|
+
let g = s(), _ = a(r, null), v = i(() => f({
|
|
22
|
+
props: {
|
|
23
|
+
...g,
|
|
24
|
+
...m
|
|
25
|
+
},
|
|
26
|
+
bridgeKeys: p
|
|
27
|
+
})), { merged: y, entry: b } = t({
|
|
28
|
+
libDefaults: h,
|
|
29
|
+
componentName: "ButtonGroup",
|
|
30
|
+
props: () => v.value.componentProps
|
|
31
|
+
}), x = n({
|
|
32
|
+
entry: b,
|
|
33
|
+
props: () => v.value.componentProps
|
|
34
|
+
}), S = i(() => y.value.customProps), C = i(() => {
|
|
35
|
+
let e = d(l, b.value?.tokens?.orientation);
|
|
36
|
+
return c(e, y.value.orientation);
|
|
37
|
+
}), w = i(() => {
|
|
38
|
+
let e = v.value.componentProps, t = b.value?.defaultProps, n = _?.value;
|
|
39
|
+
return {
|
|
40
|
+
size: e.size ?? t?.size ?? n?.size,
|
|
41
|
+
color: e.color ?? t?.color ?? n?.color,
|
|
42
|
+
density: e.density ?? t?.density ?? n?.density,
|
|
43
|
+
rounded: e.rounded ?? t?.rounded ?? n?.rounded,
|
|
44
|
+
variant: e.variant ?? t?.variant ?? n?.variant
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
return o(r, w), {
|
|
48
|
+
merged: y,
|
|
49
|
+
rootBind: i(() => {
|
|
50
|
+
let t = y.value.separator === !0;
|
|
51
|
+
return e(S.value?.root, v.value.inheritedAttrs, {
|
|
52
|
+
role: "group",
|
|
53
|
+
"data-slot": "button-group",
|
|
54
|
+
class: u({
|
|
55
|
+
[c(C.value, "root") ?? ""]: !0,
|
|
56
|
+
[c(C.value, "join") ?? ""]: !t,
|
|
57
|
+
[c(C.value, "separator") ?? ""]: t,
|
|
58
|
+
[x.value.root ?? ""]: !0,
|
|
59
|
+
"w-full [&>*]:flex-1": y.value.full === !0
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
})
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { m as useButtonGroup };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { ButtonGroupClasses, ButtonGroupCustomProps, ButtonGroupOrientationOverrides, ButtonGroupOwnProps, ButtonGroupProps, ButtonGroupSlots, } from './buttonGroup.types';
|
|
2
|
+
export { default as ButtonGroup } from './ButtonGroup.vue';
|
|
3
|
+
export { BUTTON_GROUP_INJECTION_KEY, type ButtonGroupContextValue, } from './buttonGroupInjectionKey';
|
|
4
|
+
export { useButtonGroup } from './composables/useButtonGroup';
|
|
@@ -74,7 +74,7 @@ var ee = { class: "flex w-full min-w-0 items-center gap-x-2" }, C = {
|
|
|
74
74
|
size: "sm",
|
|
75
75
|
icon: "chevronLeft"
|
|
76
76
|
}, y(B)), null, 16)], 16),
|
|
77
|
-
c("button", m(f(y(K))), [...d[1] ||= [c("span", { class: "size-2 rounded-full bg-
|
|
77
|
+
c("button", m(f(y(K))), [...d[1] ||= [c("span", { class: "size-2 rounded-full bg-dark-600 dark:bg-dark-300" }, null, -1)]], 16),
|
|
78
78
|
c("button", m(f(y(G))), [u(y(e), p({
|
|
79
79
|
size: "sm",
|
|
80
80
|
icon: "chevronRight"
|
|
@@ -74,7 +74,7 @@ var ie = {
|
|
|
74
74
|
size: "sm",
|
|
75
75
|
icon: "chevronLeft"
|
|
76
76
|
}, v(R)), null, 16)], 16),
|
|
77
|
-
o("button", p(u(v(G))), [...l[0] ||= [o("span", { class: "size-2 rounded-full bg-
|
|
77
|
+
o("button", p(u(v(G))), [...l[0] ||= [o("span", { class: "size-2 rounded-full bg-dark-600 dark:bg-dark-300" }, null, -1)]], 16),
|
|
78
78
|
o("button", p(u(v(W))), [c(v(e), d({
|
|
79
79
|
size: "sm",
|
|
80
80
|
icon: "chevronRight"
|
|
@@ -94,7 +94,7 @@ var ie = {
|
|
|
94
94
|
size: "sm",
|
|
95
95
|
icon: "chevronLeft"
|
|
96
96
|
}, v(R)), null, 16)], 16),
|
|
97
|
-
o("button", p(u(v(G))), [...l[1] ||= [o("span", { class: "size-2 rounded-full bg-
|
|
97
|
+
o("button", p(u(v(G))), [...l[1] ||= [o("span", { class: "size-2 rounded-full bg-dark-600 dark:bg-dark-300" }, null, -1)]], 16),
|
|
98
98
|
o("button", p(u(v(W))), [c(v(e), d({
|
|
99
99
|
size: "sm",
|
|
100
100
|
icon: "chevronRight"
|