@bridge-ui/vue 0.0.1-beta.6 → 0.0.1
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/Actions/BridgeUIHosts.vue.d.ts +3 -2
- package/dist/Actions/BridgeUIHosts.vue_vue_type_script_setup_true_lang.js +15 -10
- package/dist/Actions/Drawer/BridgeDrawerHost.js +5 -0
- package/dist/Actions/Drawer/BridgeDrawerHost.vue.d.ts +14 -0
- package/dist/Actions/Drawer/BridgeDrawerHost.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/Actions/Drawer/bridgeDrawer.types.d.ts +44 -0
- package/dist/Actions/Drawer/bridgeDrawerInjectionKey.d.ts +3 -0
- package/dist/Actions/Drawer/bridgeDrawerInjectionKey.js +4 -0
- package/dist/Actions/Drawer/createBridgeDrawerApi.d.ts +2 -0
- package/dist/Actions/Drawer/createBridgeDrawerApi.js +49 -0
- package/dist/Actions/Drawer/index.d.ts +3 -0
- package/dist/Actions/Drawer/index.js +3 -0
- package/dist/Actions/Drawer/useDrawerAction.d.ts +5 -0
- package/dist/Actions/Drawer/useDrawerAction.js +26 -0
- package/dist/Actions/bridgeUIHosts.types.d.ts +5 -0
- package/dist/Actions/index.d.ts +2 -0
- package/dist/Actions/index.js +8 -6
- package/dist/Components/Badge/badge.types.d.ts +1 -1
- package/dist/Components/Chip/chip.types.d.ts +1 -1
- package/dist/Components/Drawer/Drawer.js +5 -0
- package/dist/Components/Drawer/Drawer.vue.d.ts +39 -0
- package/dist/Components/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/Components/Drawer/composables/useDrawer.d.ts +63 -0
- package/dist/Components/Drawer/composables/useDrawer.js +208 -0
- package/dist/Components/Drawer/drawer.types.d.ts +188 -0
- package/dist/Components/Drawer/index.d.ts +4 -0
- package/dist/Components/Drawer/index.js +3 -0
- package/dist/Components/FormControl/formControl.types.d.ts +6 -6
- package/dist/Components/FormField/formField.types.d.ts +7 -7
- package/dist/Components/Label/label.types.d.ts +1 -1
- package/dist/Components/Link/link.types.d.ts +3 -3
- package/dist/Components/List/composables/useList.js +1 -1
- package/dist/Components/List/list.types.d.ts +1 -1
- package/dist/Components/ListItem/composables/useListItem.js +7 -7
- package/dist/Components/ListItem/listItem.types.d.ts +1 -1
- package/dist/Components/ListSection/composables/useListSection.js +2 -2
- package/dist/Components/ListSection/listSection.types.d.ts +1 -1
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +73 -61
- package/dist/Components/Listbox/composables/useListbox.d.ts +0 -5
- package/dist/Components/Listbox/composables/useListbox.js +10 -19
- package/dist/Components/Listbox/listbox.types.d.ts +7 -7
- package/dist/Components/Menu/composables/useMenu.js +1 -1
- package/dist/Components/Menu/menu.types.d.ts +3 -3
- package/dist/Components/Modal/composables/useModal.js +0 -1
- package/dist/Components/Modal/modal.types.d.ts +3 -2
- 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.d.ts +2 -2
- package/dist/Components/Select/select.types.d.ts +5 -5
- package/dist/Components/Snackbar/composables/useSnackbar.js +1 -1
- package/dist/Components/Snackbar/snackbar.types.d.ts +7 -7
- 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/Components/Tab/Tab.js +5 -0
- package/dist/Components/Tab/Tab.vue.d.ts +11 -0
- package/dist/Components/Tab/Tab.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/Components/Tab/composables/useTab.d.ts +23 -0
- package/dist/Components/Tab/composables/useTab.js +88 -0
- package/dist/Components/Tab/index.d.ts +3 -0
- package/dist/Components/Tab/index.js +3 -0
- package/dist/Components/Tab/tab.types.d.ts +94 -0
- package/dist/Components/TabItem/TabItem.js +5 -0
- package/dist/Components/TabItem/TabItem.vue.d.ts +11 -0
- package/dist/Components/TabItem/TabItem.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/Components/TabItem/composables/useTabItem.d.ts +3 -0
- package/dist/Components/TabItem/composables/useTabItem.js +39 -0
- package/dist/Components/TabItem/index.d.ts +3 -0
- package/dist/Components/TabItem/index.js +3 -0
- package/dist/Components/TabItem/tabItem.types.d.ts +72 -0
- package/dist/Components/TabList/TabList.js +5 -0
- package/dist/Components/TabList/TabList.vue.d.ts +11 -0
- package/dist/Components/TabList/TabList.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/Components/TabList/composables/useTabList.d.ts +10 -0
- package/dist/Components/TabList/composables/useTabList.js +65 -0
- package/dist/Components/TabList/index.d.ts +3 -0
- package/dist/Components/TabList/index.js +3 -0
- package/dist/Components/TabList/tabList.types.d.ts +38 -0
- package/dist/Components/TabPanel/TabPanel.js +5 -0
- package/dist/Components/TabPanel/TabPanel.vue.d.ts +11 -0
- package/dist/Components/TabPanel/TabPanel.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/Components/TabPanel/composables/useTabPanel.d.ts +14 -0
- package/dist/Components/TabPanel/composables/useTabPanel.js +51 -0
- package/dist/Components/TabPanel/index.d.ts +3 -0
- package/dist/Components/TabPanel/index.js +3 -0
- package/dist/Components/TabPanel/tabPanel.types.d.ts +48 -0
- package/dist/Components/Tabs/Tabs.js +5 -0
- package/dist/Components/Tabs/Tabs.vue.d.ts +24 -0
- package/dist/Components/Tabs/Tabs.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/Components/Tabs/composables/useTabs.d.ts +39 -0
- package/dist/Components/Tabs/composables/useTabs.js +99 -0
- package/dist/Components/Tabs/index.d.ts +4 -0
- package/dist/Components/Tabs/index.js +4 -0
- package/dist/Components/Tabs/tabs.types.d.ts +93 -0
- package/dist/Components/Tabs/tabsInjectionKey.d.ts +121 -0
- package/dist/Components/Tabs/tabsInjectionKey.js +4 -0
- package/dist/Utils/index.d.ts +2 -0
- package/dist/Utils/index.js +20 -19
- package/dist/Utils/useBreakpoint.d.ts +19 -0
- package/dist/Utils/useBreakpoint.js +35 -0
- package/dist/augments.d.ts +10 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.js +76 -58
- package/dist/theme.css +55 -3
- package/package.json +2 -2
|
@@ -6,19 +6,19 @@ type __VLS_ModelProps = {
|
|
|
6
6
|
};
|
|
7
7
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
8
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
clear: () => any;
|
|
9
10
|
search: (query: string) => any;
|
|
10
11
|
select: (option: import('@bridge-ui/core').ListboxOption) => any;
|
|
11
12
|
"update:modelValue": (...args: unknown[]) => any;
|
|
12
|
-
clear: () => any;
|
|
13
13
|
change: (value: import('@bridge-ui/core').SelectModel) => any;
|
|
14
14
|
close: () => any;
|
|
15
15
|
open: () => any;
|
|
16
16
|
deselect: (option: import('@bridge-ui/core').ListboxOption) => any;
|
|
17
17
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
18
|
+
onClear?: (() => any) | undefined;
|
|
18
19
|
onSearch?: ((query: string) => any) | undefined;
|
|
19
20
|
onSelect?: ((option: import('@bridge-ui/core').ListboxOption) => any) | undefined;
|
|
20
21
|
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
21
|
-
onClear?: (() => any) | undefined;
|
|
22
22
|
onChange?: ((value: import('@bridge-ui/core').SelectModel) => any) | undefined;
|
|
23
23
|
onClose?: (() => any) | undefined;
|
|
24
24
|
onOpen?: (() => any) | undefined;
|
|
@@ -199,11 +199,11 @@ export interface SelectSlots extends FormFieldSlots {
|
|
|
199
199
|
/**
|
|
200
200
|
* Content below the trigger, above the option list.
|
|
201
201
|
*/
|
|
202
|
-
afterOptions?: Slot
|
|
202
|
+
afterOptions?: Slot<undefined>;
|
|
203
203
|
/**
|
|
204
204
|
* Content above the option list.
|
|
205
205
|
*/
|
|
206
|
-
beforeOptions?: Slot
|
|
206
|
+
beforeOptions?: Slot<undefined>;
|
|
207
207
|
/**
|
|
208
208
|
* Custom chip content (multiple mode).
|
|
209
209
|
*/
|
|
@@ -215,15 +215,15 @@ export interface SelectSlots extends FormFieldSlots {
|
|
|
215
215
|
* When set (and not using declarative `SelectOption` children), replaces
|
|
216
216
|
* mapped `options` inside the listbox.
|
|
217
217
|
*/
|
|
218
|
-
default?: Slot
|
|
218
|
+
default?: Slot<undefined>;
|
|
219
219
|
/**
|
|
220
220
|
* Custom empty-state content.
|
|
221
221
|
*/
|
|
222
|
-
empty?: Slot
|
|
222
|
+
empty?: Slot<undefined>;
|
|
223
223
|
/**
|
|
224
224
|
* Custom loading content.
|
|
225
225
|
*/
|
|
226
|
-
loading?: Slot
|
|
226
|
+
loading?: Slot<undefined>;
|
|
227
227
|
/**
|
|
228
228
|
* Custom option item content when rendering from the `options` prop.
|
|
229
229
|
*/
|
|
@@ -185,30 +185,30 @@ export interface SnackbarSlots {
|
|
|
185
185
|
/**
|
|
186
186
|
* Inline actions below the description.
|
|
187
187
|
*/
|
|
188
|
-
actions?: Slot
|
|
188
|
+
actions?: Slot<undefined>;
|
|
189
189
|
/**
|
|
190
190
|
* Content below the title/description.
|
|
191
191
|
*/
|
|
192
|
-
default?: Slot
|
|
192
|
+
default?: Slot<undefined>;
|
|
193
193
|
/**
|
|
194
194
|
* Custom description markup.
|
|
195
195
|
*/
|
|
196
|
-
description?: Slot
|
|
196
|
+
description?: Slot<undefined>;
|
|
197
197
|
/**
|
|
198
198
|
* Custom icon markup.
|
|
199
199
|
*/
|
|
200
|
-
icon?: Slot
|
|
200
|
+
icon?: Slot<undefined>;
|
|
201
201
|
/**
|
|
202
202
|
* Vertical action column on the right edge (WireUI `rightButtons` layout).
|
|
203
203
|
*/
|
|
204
|
-
right?: Slot
|
|
204
|
+
right?: Slot<undefined>;
|
|
205
205
|
/**
|
|
206
206
|
* Custom title markup.
|
|
207
207
|
*/
|
|
208
|
-
title?: Slot
|
|
208
|
+
title?: Slot<undefined>;
|
|
209
209
|
/**
|
|
210
210
|
* Content before the close button (e.g. compact accept action with `padding="small"`).
|
|
211
211
|
*/
|
|
212
|
-
trailing?: Slot
|
|
212
|
+
trailing?: Slot<undefined>;
|
|
213
213
|
}
|
|
214
214
|
export type SnackbarProps = MergeHtmlProps<SnackbarOwnProps, HTMLAttributes>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SpinnerOwnProps } from './spinner.types';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<SpinnerOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SpinnerOwnProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useSpinner as e } from "./composables/useSpinner.js";
|
|
2
|
+
import { createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, guardReactiveProps as a, mergeProps as o, normalizeProps as s, openBlock as c, unref as l } from "vue";
|
|
3
|
+
//#region src/Components/Spinner/Spinner.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var u = /* @__PURE__ */ i({
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "Spinner",
|
|
7
|
+
props: {
|
|
8
|
+
classes: {},
|
|
9
|
+
color: {},
|
|
10
|
+
customProps: {},
|
|
11
|
+
disableShrink: { type: Boolean },
|
|
12
|
+
enableTrack: { type: Boolean },
|
|
13
|
+
size: {},
|
|
14
|
+
thickness: {},
|
|
15
|
+
value: {},
|
|
16
|
+
variant: {}
|
|
17
|
+
},
|
|
18
|
+
setup(i) {
|
|
19
|
+
let { svgBind: u, rootBind: d, trackBind: f, circleBind: p, enableTrack: m } = e(i, {
|
|
20
|
+
size: "md",
|
|
21
|
+
thickness: 3.6,
|
|
22
|
+
color: "primary",
|
|
23
|
+
enableTrack: !1,
|
|
24
|
+
disableShrink: !1,
|
|
25
|
+
variant: "indeterminate"
|
|
26
|
+
});
|
|
27
|
+
return (e, i) => (c(), n("span", s(a(l(d))), [(c(), n("svg", s(a(l(u))), [l(m) && l(f) ? (c(), n("circle", s(o({ key: 0 }, l(f))), null, 16)) : t("", !0), r("circle", s(a(l(p))), null, 16)], 16))], 16));
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
//#endregion
|
|
31
|
+
export { u as default };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
|
|
2
|
+
import { SpinnerOwnProps, SpinnerProps } from '../spinner.types';
|
|
3
|
+
type SpinnerLibDefaults = LibDefaultsShape<SpinnerOwnProps, "size" | "color" | "variant" | "thickness" | "enableTrack" | "disableShrink">;
|
|
4
|
+
type SpinnerMerged = MergeLibDefaults<SpinnerOwnProps, SpinnerLibDefaults>;
|
|
5
|
+
export declare function useSpinner(props: SpinnerOwnProps, libDefaults: SpinnerLibDefaults): {
|
|
6
|
+
merged: import('vue').ComputedRef<SpinnerMerged>;
|
|
7
|
+
svgBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').SVGAttributes | undefined, {
|
|
8
|
+
viewBox: string;
|
|
9
|
+
}>>;
|
|
10
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
11
|
+
class: string;
|
|
12
|
+
"aria-valuemin"?: number | undefined;
|
|
13
|
+
"aria-valuemax"?: number | undefined;
|
|
14
|
+
"aria-valuenow"?: number | undefined;
|
|
15
|
+
role: string;
|
|
16
|
+
}, "class", import('vue').HTMLAttributes | undefined, Omit<SpinnerProps, "color" | "size" | "value" | "classes" | "customProps" | "variant" | "disableShrink" | "enableTrack" | "thickness">>>;
|
|
17
|
+
trackBind: import('vue').ComputedRef<(object & {
|
|
18
|
+
cx: number;
|
|
19
|
+
cy: number;
|
|
20
|
+
fill: string;
|
|
21
|
+
r: number;
|
|
22
|
+
"stroke-width": number;
|
|
23
|
+
} & Record<"class", string>) | null>;
|
|
24
|
+
circleBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').SVGAttributes | undefined, {
|
|
25
|
+
r: number;
|
|
26
|
+
cx: number;
|
|
27
|
+
cy: number;
|
|
28
|
+
fill: string;
|
|
29
|
+
"stroke-width": number;
|
|
30
|
+
style: {
|
|
31
|
+
strokeDashoffset: number;
|
|
32
|
+
strokeDasharray: string;
|
|
33
|
+
transformOrigin: string;
|
|
34
|
+
transform: string;
|
|
35
|
+
transition: string;
|
|
36
|
+
} | {
|
|
37
|
+
strokeDashoffset: number;
|
|
38
|
+
strokeDasharray: number;
|
|
39
|
+
transformOrigin: string;
|
|
40
|
+
transform: string;
|
|
41
|
+
transition: string;
|
|
42
|
+
} | {
|
|
43
|
+
strokeDashoffset: number;
|
|
44
|
+
strokeDasharray: string;
|
|
45
|
+
transformOrigin?: undefined;
|
|
46
|
+
transform?: undefined;
|
|
47
|
+
transition?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
strokeDashoffset?: undefined;
|
|
50
|
+
strokeDasharray?: undefined;
|
|
51
|
+
transformOrigin?: undefined;
|
|
52
|
+
transform?: undefined;
|
|
53
|
+
transition?: undefined;
|
|
54
|
+
};
|
|
55
|
+
}>>;
|
|
56
|
+
enableTrack: import('vue').ComputedRef<boolean>;
|
|
57
|
+
};
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
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, isNil as o } from "es-toolkit/compat";
|
|
4
|
+
import { DEFAULT_SPINNER_THICKNESS as s, SPINNER_VIEWBOX_SIZE as c, cn as l, getSpinnerCircleGeometry as u, mergeBridgeUILayeredClasses as d, splitComponentProps as f } from "@bridge-ui/core";
|
|
5
|
+
import { colorProps as p, sizeProps as m, variantProps as h } from "@bridge-ui/core/Components/Spinner";
|
|
6
|
+
//#region src/Components/Spinner/composables/useSpinner.ts
|
|
7
|
+
var g = [
|
|
8
|
+
"size",
|
|
9
|
+
"color",
|
|
10
|
+
"value",
|
|
11
|
+
"classes",
|
|
12
|
+
"variant",
|
|
13
|
+
"thickness",
|
|
14
|
+
"customProps",
|
|
15
|
+
"enableTrack",
|
|
16
|
+
"disableShrink"
|
|
17
|
+
];
|
|
18
|
+
function _(e) {
|
|
19
|
+
return o(e) || Number.isNaN(e) ? 0 : Math.min(100, Math.max(0, e));
|
|
20
|
+
}
|
|
21
|
+
function v(o, v) {
|
|
22
|
+
let y = i(), b = r(() => f({
|
|
23
|
+
props: {
|
|
24
|
+
...y,
|
|
25
|
+
...o
|
|
26
|
+
},
|
|
27
|
+
bridgeKeys: g
|
|
28
|
+
})), { merged: x, entry: S } = t({
|
|
29
|
+
libDefaults: v,
|
|
30
|
+
componentName: "Spinner",
|
|
31
|
+
props: () => b.value.componentProps
|
|
32
|
+
}), C = n({
|
|
33
|
+
entry: S,
|
|
34
|
+
props: () => b.value.componentProps
|
|
35
|
+
}), w = r(() => x.value.customProps), T = r(() => a(d(p, S.value?.customProps?.color), x.value.color)), E = r(() => a(d(m, S.value?.customProps?.size), x.value.size)), D = r(() => a(d(h, S.value?.customProps?.variant), x.value.variant)), O = r(() => x.value.thickness ?? s), k = r(() => u(O.value)), A = c / 2, j = r(() => _(x.value.value)), M = r(() => !!x.value.enableTrack), N = r(() => !!x.value.disableShrink), P = r(() => x.value.variant === "determinate"), F = r(() => x.value.variant === "indeterminate"), I = r(() => e(w.value?.root, b.value.inheritedAttrs, {
|
|
36
|
+
role: "progressbar",
|
|
37
|
+
...P.value ? {
|
|
38
|
+
"aria-valuemin": 0,
|
|
39
|
+
"aria-valuemax": 100,
|
|
40
|
+
"aria-valuenow": j.value
|
|
41
|
+
} : {},
|
|
42
|
+
class: l({
|
|
43
|
+
"inline-block": !0,
|
|
44
|
+
[E.value ?? ""]: !0,
|
|
45
|
+
[D.value ?? ""]: F.value,
|
|
46
|
+
[C.value.root ?? ""]: !0
|
|
47
|
+
})
|
|
48
|
+
}));
|
|
49
|
+
return {
|
|
50
|
+
merged: x,
|
|
51
|
+
svgBind: r(() => e(w.value?.svg, { viewBox: `0 0 ${c} ${c}` }, l({
|
|
52
|
+
"block size-full": !0,
|
|
53
|
+
[C.value.svg ?? ""]: !0
|
|
54
|
+
}))),
|
|
55
|
+
rootBind: I,
|
|
56
|
+
trackBind: r(() => M.value ? e(w.value?.track, {
|
|
57
|
+
cx: A,
|
|
58
|
+
cy: A,
|
|
59
|
+
fill: "none",
|
|
60
|
+
r: k.value.radius,
|
|
61
|
+
"stroke-width": O.value
|
|
62
|
+
}, l({
|
|
63
|
+
[T.value?.track ?? ""]: !0,
|
|
64
|
+
[C.value.track ?? ""]: !0
|
|
65
|
+
})) : null),
|
|
66
|
+
circleBind: r(() => {
|
|
67
|
+
let { radius: t, circumference: n } = k.value, r = P.value ? {
|
|
68
|
+
transformOrigin: "50% 50%",
|
|
69
|
+
transform: "rotate(-90deg)",
|
|
70
|
+
strokeDasharray: n,
|
|
71
|
+
transition: "stroke-dashoffset 200ms linear",
|
|
72
|
+
strokeDashoffset: (100 - j.value) / 100 * n
|
|
73
|
+
} : {}, i = F.value ? {
|
|
74
|
+
strokeDashoffset: 0,
|
|
75
|
+
strokeDasharray: N.value ? `${n * .8}px, ${n}px` : "80px, 200px"
|
|
76
|
+
} : {};
|
|
77
|
+
return e(w.value?.circle, {
|
|
78
|
+
r: t,
|
|
79
|
+
cx: A,
|
|
80
|
+
cy: A,
|
|
81
|
+
fill: "none",
|
|
82
|
+
"stroke-width": O.value,
|
|
83
|
+
style: {
|
|
84
|
+
...r,
|
|
85
|
+
...i
|
|
86
|
+
}
|
|
87
|
+
}, l({
|
|
88
|
+
[T.value?.circle ?? ""]: !0,
|
|
89
|
+
"animate-bridge-spinner-dash": F.value && !N.value,
|
|
90
|
+
[C.value.circle ?? ""]: !0
|
|
91
|
+
}));
|
|
92
|
+
}),
|
|
93
|
+
enableTrack: M
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { v as useSpinner };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { useSpinner } from './composables/useSpinner';
|
|
2
|
+
export type { SpinnerClasses, SpinnerColorOverrides, SpinnerCustomProps, SpinnerOwnProps, SpinnerProps, SpinnerSizeOverrides, SpinnerVariantOverrides, } from './spinner.types';
|
|
3
|
+
export { default as Spinner } from './Spinner.vue';
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { HTMLAttributes, SVGAttributes } from 'vue';
|
|
2
|
+
import { MergeHtmlProps, MergeProps, SpinnerColor, SpinnerSize, SpinnerVariant } from '@bridge-ui/core';
|
|
3
|
+
export interface SpinnerSizeOverrides {}
|
|
4
|
+
export interface SpinnerColorOverrides {}
|
|
5
|
+
export interface SpinnerVariantOverrides {}
|
|
6
|
+
export interface SpinnerClasses {
|
|
7
|
+
/**
|
|
8
|
+
* The classes to apply to the progress circle.
|
|
9
|
+
*/
|
|
10
|
+
circle?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The classes to apply to the root.
|
|
13
|
+
*/
|
|
14
|
+
root?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The classes to apply to the svg element.
|
|
17
|
+
*/
|
|
18
|
+
svg?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The classes to apply to the track circle.
|
|
21
|
+
*/
|
|
22
|
+
track?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface SpinnerCustomProps {
|
|
25
|
+
/**
|
|
26
|
+
* Props forwarded to the progress circle.
|
|
27
|
+
*/
|
|
28
|
+
circle?: SVGAttributes;
|
|
29
|
+
/**
|
|
30
|
+
* Props forwarded to the root element.
|
|
31
|
+
*/
|
|
32
|
+
root?: HTMLAttributes;
|
|
33
|
+
/**
|
|
34
|
+
* Props forwarded to the svg element.
|
|
35
|
+
*/
|
|
36
|
+
svg?: SVGAttributes;
|
|
37
|
+
/**
|
|
38
|
+
* Props forwarded to the track circle.
|
|
39
|
+
*/
|
|
40
|
+
track?: SVGAttributes;
|
|
41
|
+
}
|
|
42
|
+
export interface SpinnerOwnProps {
|
|
43
|
+
/**
|
|
44
|
+
* The classes to apply to spinner parts.
|
|
45
|
+
*
|
|
46
|
+
* @default undefined
|
|
47
|
+
*/
|
|
48
|
+
classes?: SpinnerClasses;
|
|
49
|
+
/**
|
|
50
|
+
* The color of the spinner.
|
|
51
|
+
*
|
|
52
|
+
* @default "primary"
|
|
53
|
+
*/
|
|
54
|
+
color?: MergeProps<SpinnerColor, SpinnerColorOverrides>;
|
|
55
|
+
/**
|
|
56
|
+
* Extra props for internal parts (`root`, `svg`, `circle`, `track`).
|
|
57
|
+
* Root HTML attributes stay on the component top level.
|
|
58
|
+
*
|
|
59
|
+
* @default undefined
|
|
60
|
+
*/
|
|
61
|
+
customProps?: SpinnerCustomProps;
|
|
62
|
+
/**
|
|
63
|
+
* Disables the indeterminate shrink animation on the circle.
|
|
64
|
+
*
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
disableShrink?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Renders a subtle track circle behind the progress arc.
|
|
70
|
+
*
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
enableTrack?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* The size of the spinner.
|
|
76
|
+
*
|
|
77
|
+
* @default "md"
|
|
78
|
+
*/
|
|
79
|
+
size?: MergeProps<SpinnerSize, SpinnerSizeOverrides>;
|
|
80
|
+
/**
|
|
81
|
+
* The stroke thickness of the circle.
|
|
82
|
+
*
|
|
83
|
+
* @default 3.6
|
|
84
|
+
*/
|
|
85
|
+
thickness?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Progress value from 0 to 100. Used by the `determinate` variant.
|
|
88
|
+
*
|
|
89
|
+
* @default undefined
|
|
90
|
+
*/
|
|
91
|
+
value?: number;
|
|
92
|
+
/**
|
|
93
|
+
* Visual variant of the spinner.
|
|
94
|
+
*
|
|
95
|
+
* @default "indeterminate"
|
|
96
|
+
*/
|
|
97
|
+
variant?: MergeProps<SpinnerVariant, SpinnerVariantOverrides>;
|
|
98
|
+
}
|
|
99
|
+
export type SpinnerProps = MergeHtmlProps<SpinnerOwnProps, HTMLAttributes>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TabOwnProps, TabSlots } from './tab.types';
|
|
2
|
+
type __VLS_Slots = TabSlots;
|
|
3
|
+
declare const __VLS_base: import('vue').DefineComponent<TabOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TabOwnProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
4
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
8
|
+
new (): {
|
|
9
|
+
$slots: S;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { hasNamedSlot as e, resolveNamedSlot as t } from "../../Utils/slotOrProp.js";
|
|
2
|
+
import n from "../Icon/Icon.js";
|
|
3
|
+
import { useTab as r } from "./composables/useTab.js";
|
|
4
|
+
import { createBlock as i, createCommentVNode as a, createElementBlock as o, defineComponent as s, guardReactiveProps as c, mergeProps as l, normalizeProps as u, openBlock as d, resolveDynamicComponent as f, unref as p, useSlots as m } from "vue";
|
|
5
|
+
//#region src/Components/Tab/Tab.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var h = /* @__PURE__ */ s({
|
|
7
|
+
inheritAttrs: !1,
|
|
8
|
+
__name: "Tab",
|
|
9
|
+
props: {
|
|
10
|
+
classes: {},
|
|
11
|
+
customProps: {},
|
|
12
|
+
disabled: { type: Boolean },
|
|
13
|
+
endIcon: { type: [Function, Object] },
|
|
14
|
+
startIcon: { type: [Function, Object] },
|
|
15
|
+
value: {}
|
|
16
|
+
},
|
|
17
|
+
setup(s) {
|
|
18
|
+
let h = m(), { merged: g, iconSize: _, rootBind: v, endIconBind: y, endSlotBind: b, startIconBind: x, startSlotBind: S } = r(s);
|
|
19
|
+
return (r, s) => (d(), o("button", u(c(p(v))), [
|
|
20
|
+
p(g).startIcon ? (d(), i(p(n), l({
|
|
21
|
+
key: 0,
|
|
22
|
+
size: p(_)
|
|
23
|
+
}, p(x), { icon: p(g).startIcon }), null, 16, ["size", "icon"])) : p(e)(p(h), "start") ? (d(), o("div", u(l({ key: 1 }, p(S))), [(d(), i(f(p(t)(p(h), "start"))))], 16)) : a("", !0),
|
|
24
|
+
(d(), i(f(p(t)(p(h), "default")))),
|
|
25
|
+
p(g).endIcon ? (d(), i(p(n), l({
|
|
26
|
+
key: 2,
|
|
27
|
+
size: p(_)
|
|
28
|
+
}, p(y), { icon: p(g).endIcon }), null, 16, ["size", "icon"])) : p(e)(p(h), "end") ? (d(), o("div", u(l({ key: 3 }, p(b))), [(d(), i(f(p(t)(p(h), "end"))))], 16)) : a("", !0)
|
|
29
|
+
], 16));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
33
|
+
export { h as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IconSize } from '@bridge-ui/core';
|
|
2
|
+
import { TabOwnProps, TabProps } from '../tab.types';
|
|
3
|
+
export declare function useTab(props: TabOwnProps): {
|
|
4
|
+
merged: import('vue').ComputedRef<TabOwnProps>;
|
|
5
|
+
iconSize: import('vue').ComputedRef<keyof IconSize>;
|
|
6
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
7
|
+
role: string;
|
|
8
|
+
type: string;
|
|
9
|
+
onClick: (event: PointerEvent) => void;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
12
|
+
"aria-selected": boolean;
|
|
13
|
+
tabindex: number;
|
|
14
|
+
id: string;
|
|
15
|
+
"aria-controls": string;
|
|
16
|
+
class: string;
|
|
17
|
+
}, "class", import('vue').ButtonHTMLAttributes | undefined, Omit<TabProps, "value" | "classes" | "customProps" | "disabled" | "endIcon" | "startIcon">>>;
|
|
18
|
+
selected: import('vue').ComputedRef<boolean>;
|
|
19
|
+
endIconBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
|
20
|
+
endSlotBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
21
|
+
startIconBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
|
22
|
+
startSlotBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
|
+
import { TABS_INJECTION_KEY as r } from "../../Tabs/tabsInjectionKey.js";
|
|
3
|
+
import { computed as i, inject as a, onBeforeUnmount as o, onMounted as s, useAttrs as c, watch as l } from "vue";
|
|
4
|
+
import { get as u } from "es-toolkit/compat";
|
|
5
|
+
import { cn as d, getTabId as f, getTabPanelId as p, splitComponentProps as m } from "@bridge-ui/core";
|
|
6
|
+
//#region src/Components/Tab/composables/useTab.ts
|
|
7
|
+
var h = [
|
|
8
|
+
"value",
|
|
9
|
+
"classes",
|
|
10
|
+
"endIcon",
|
|
11
|
+
"disabled",
|
|
12
|
+
"startIcon",
|
|
13
|
+
"customProps"
|
|
14
|
+
];
|
|
15
|
+
function g(g) {
|
|
16
|
+
let _ = c(), v = a(r, null);
|
|
17
|
+
if (!v) throw Error("Tab must be used within a Tabs provider");
|
|
18
|
+
let y = v, b = i(() => m({
|
|
19
|
+
bridgeKeys: h,
|
|
20
|
+
props: {
|
|
21
|
+
..._,
|
|
22
|
+
...g
|
|
23
|
+
}
|
|
24
|
+
})), { merged: x, entry: S } = t({
|
|
25
|
+
componentName: "Tab",
|
|
26
|
+
props: () => b.value.componentProps
|
|
27
|
+
}), C = i(() => x.value.value), w = i(() => x.value.disabled === !0), T = i(() => y.value.selected === C.value), E = null;
|
|
28
|
+
function D() {
|
|
29
|
+
E?.(), E = y.value.registerTab(C.value, w.value);
|
|
30
|
+
}
|
|
31
|
+
s(D), l([C, w], D), o(() => {
|
|
32
|
+
E?.(), E = null;
|
|
33
|
+
});
|
|
34
|
+
let O = n({
|
|
35
|
+
entry: S,
|
|
36
|
+
props: () => b.value.componentProps
|
|
37
|
+
});
|
|
38
|
+
function k(e) {
|
|
39
|
+
w.value || (y.value.setSelected(C.value), b.value.inheritedAttrs.onClick?.(e));
|
|
40
|
+
}
|
|
41
|
+
function A(e) {
|
|
42
|
+
let t = y.value;
|
|
43
|
+
t.activation === "manual" && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), w.value || t.setSelected(C.value)), b.value.inheritedAttrs.onKeydown?.(e);
|
|
44
|
+
}
|
|
45
|
+
let j = i(() => x.value.customProps);
|
|
46
|
+
return {
|
|
47
|
+
merged: x,
|
|
48
|
+
iconSize: i(() => y.value.tokenClasses.iconSize ?? "md"),
|
|
49
|
+
rootBind: i(() => {
|
|
50
|
+
let t = y.value;
|
|
51
|
+
return e(j.value?.root, b.value.inheritedAttrs, {
|
|
52
|
+
role: "tab",
|
|
53
|
+
type: "button",
|
|
54
|
+
onClick: k,
|
|
55
|
+
disabled: w.value,
|
|
56
|
+
onKeydown: A,
|
|
57
|
+
"aria-selected": T.value,
|
|
58
|
+
tabindex: T.value ? 0 : -1,
|
|
59
|
+
id: f(t.id, C.value),
|
|
60
|
+
"aria-controls": p(t.id, C.value),
|
|
61
|
+
class: d({
|
|
62
|
+
"inline-flex cursor-pointer items-center justify-center transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40 disabled:pointer-events-none disabled:opacity-50": !0,
|
|
63
|
+
[t.tokenClasses.iconGap ?? ""]: !0,
|
|
64
|
+
[t.tokenClasses.tabSize ?? ""]: !0,
|
|
65
|
+
[t.tokenClasses.tabVariant ?? ""]: !0,
|
|
66
|
+
[t.tokenClasses.tabOrientation ?? ""]: !0,
|
|
67
|
+
[t.tokenClasses.tabVariantSelected ?? ""]: T.value,
|
|
68
|
+
[t.tokenClasses.colorSelected ?? ""]: T.value,
|
|
69
|
+
[t.tokenClasses.colorSelectedSoft ?? ""]: T.value && t.tokenClasses.softFill === !0,
|
|
70
|
+
[u(O.value, "root") ?? ""]: !0
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
}),
|
|
74
|
+
selected: T,
|
|
75
|
+
endIconBind: i(() => e(j.value?.endIcon, {}, d({
|
|
76
|
+
"shrink-0": !0,
|
|
77
|
+
[u(O.value, "endIcon") ?? ""]: !0
|
|
78
|
+
}))),
|
|
79
|
+
endSlotBind: i(() => e(j.value?.end, {}, "inline-flex shrink-0 items-center")),
|
|
80
|
+
startIconBind: i(() => e(j.value?.startIcon, {}, d({
|
|
81
|
+
"shrink-0": !0,
|
|
82
|
+
[u(O.value, "startIcon") ?? ""]: !0
|
|
83
|
+
}))),
|
|
84
|
+
startSlotBind: i(() => e(j.value?.start, {}, "inline-flex shrink-0 items-center"))
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
export { g as useTab };
|