@bridge-ui/vue 0.0.1-beta.7 → 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.
Files changed (93) hide show
  1. package/dist/Actions/BridgeUIHosts.vue.d.ts +3 -2
  2. package/dist/Actions/BridgeUIHosts.vue_vue_type_script_setup_true_lang.js +15 -10
  3. package/dist/Actions/Drawer/BridgeDrawerHost.js +5 -0
  4. package/dist/Actions/Drawer/BridgeDrawerHost.vue.d.ts +14 -0
  5. package/dist/Actions/Drawer/BridgeDrawerHost.vue_vue_type_script_setup_true_lang.js +35 -0
  6. package/dist/Actions/Drawer/bridgeDrawer.types.d.ts +44 -0
  7. package/dist/Actions/Drawer/bridgeDrawerInjectionKey.d.ts +3 -0
  8. package/dist/Actions/Drawer/bridgeDrawerInjectionKey.js +4 -0
  9. package/dist/Actions/Drawer/createBridgeDrawerApi.d.ts +2 -0
  10. package/dist/Actions/Drawer/createBridgeDrawerApi.js +49 -0
  11. package/dist/Actions/Drawer/index.d.ts +3 -0
  12. package/dist/Actions/Drawer/index.js +3 -0
  13. package/dist/Actions/Drawer/useDrawerAction.d.ts +5 -0
  14. package/dist/Actions/Drawer/useDrawerAction.js +26 -0
  15. package/dist/Actions/bridgeUIHosts.types.d.ts +5 -0
  16. package/dist/Actions/index.d.ts +2 -0
  17. package/dist/Actions/index.js +8 -6
  18. package/dist/Components/Badge/badge.types.d.ts +1 -1
  19. package/dist/Components/Chip/chip.types.d.ts +1 -1
  20. package/dist/Components/Drawer/Drawer.js +5 -0
  21. package/dist/Components/Drawer/Drawer.vue.d.ts +39 -0
  22. package/dist/Components/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js +96 -0
  23. package/dist/Components/Drawer/composables/useDrawer.d.ts +63 -0
  24. package/dist/Components/Drawer/composables/useDrawer.js +208 -0
  25. package/dist/Components/Drawer/drawer.types.d.ts +188 -0
  26. package/dist/Components/Drawer/index.d.ts +4 -0
  27. package/dist/Components/Drawer/index.js +3 -0
  28. package/dist/Components/FormControl/formControl.types.d.ts +6 -6
  29. package/dist/Components/FormField/formField.types.d.ts +7 -7
  30. package/dist/Components/Label/label.types.d.ts +1 -1
  31. package/dist/Components/Link/link.types.d.ts +3 -3
  32. package/dist/Components/List/list.types.d.ts +1 -1
  33. package/dist/Components/ListItem/listItem.types.d.ts +1 -1
  34. package/dist/Components/ListSection/listSection.types.d.ts +1 -1
  35. package/dist/Components/Listbox/listbox.types.d.ts +5 -5
  36. package/dist/Components/Menu/menu.types.d.ts +3 -3
  37. package/dist/Components/Modal/composables/useModal.js +0 -1
  38. package/dist/Components/Modal/modal.types.d.ts +3 -2
  39. package/dist/Components/Select/Select.vue.d.ts +2 -2
  40. package/dist/Components/Select/select.types.d.ts +5 -5
  41. package/dist/Components/Snackbar/composables/useSnackbar.js +1 -1
  42. package/dist/Components/Snackbar/snackbar.types.d.ts +7 -7
  43. package/dist/Components/Spinner/composables/useSpinner.js +16 -16
  44. package/dist/Components/Tab/Tab.js +5 -0
  45. package/dist/Components/Tab/Tab.vue.d.ts +11 -0
  46. package/dist/Components/Tab/Tab.vue_vue_type_script_setup_true_lang.js +33 -0
  47. package/dist/Components/Tab/composables/useTab.d.ts +23 -0
  48. package/dist/Components/Tab/composables/useTab.js +88 -0
  49. package/dist/Components/Tab/index.d.ts +3 -0
  50. package/dist/Components/Tab/index.js +3 -0
  51. package/dist/Components/Tab/tab.types.d.ts +94 -0
  52. package/dist/Components/TabItem/TabItem.js +5 -0
  53. package/dist/Components/TabItem/TabItem.vue.d.ts +11 -0
  54. package/dist/Components/TabItem/TabItem.vue_vue_type_script_setup_true_lang.js +25 -0
  55. package/dist/Components/TabItem/composables/useTabItem.d.ts +3 -0
  56. package/dist/Components/TabItem/composables/useTabItem.js +39 -0
  57. package/dist/Components/TabItem/index.d.ts +3 -0
  58. package/dist/Components/TabItem/index.js +3 -0
  59. package/dist/Components/TabItem/tabItem.types.d.ts +72 -0
  60. package/dist/Components/TabList/TabList.js +5 -0
  61. package/dist/Components/TabList/TabList.vue.d.ts +11 -0
  62. package/dist/Components/TabList/TabList.vue_vue_type_script_setup_true_lang.js +18 -0
  63. package/dist/Components/TabList/composables/useTabList.d.ts +10 -0
  64. package/dist/Components/TabList/composables/useTabList.js +65 -0
  65. package/dist/Components/TabList/index.d.ts +3 -0
  66. package/dist/Components/TabList/index.js +3 -0
  67. package/dist/Components/TabList/tabList.types.d.ts +38 -0
  68. package/dist/Components/TabPanel/TabPanel.js +5 -0
  69. package/dist/Components/TabPanel/TabPanel.vue.d.ts +11 -0
  70. package/dist/Components/TabPanel/TabPanel.vue_vue_type_script_setup_true_lang.js +20 -0
  71. package/dist/Components/TabPanel/composables/useTabPanel.d.ts +14 -0
  72. package/dist/Components/TabPanel/composables/useTabPanel.js +51 -0
  73. package/dist/Components/TabPanel/index.d.ts +3 -0
  74. package/dist/Components/TabPanel/index.js +3 -0
  75. package/dist/Components/TabPanel/tabPanel.types.d.ts +48 -0
  76. package/dist/Components/Tabs/Tabs.js +5 -0
  77. package/dist/Components/Tabs/Tabs.vue.d.ts +24 -0
  78. package/dist/Components/Tabs/Tabs.vue_vue_type_script_setup_true_lang.js +73 -0
  79. package/dist/Components/Tabs/composables/useTabs.d.ts +39 -0
  80. package/dist/Components/Tabs/composables/useTabs.js +99 -0
  81. package/dist/Components/Tabs/index.d.ts +4 -0
  82. package/dist/Components/Tabs/index.js +4 -0
  83. package/dist/Components/Tabs/tabs.types.d.ts +93 -0
  84. package/dist/Components/Tabs/tabsInjectionKey.d.ts +121 -0
  85. package/dist/Components/Tabs/tabsInjectionKey.js +4 -0
  86. package/dist/Utils/index.d.ts +2 -0
  87. package/dist/Utils/index.js +20 -19
  88. package/dist/Utils/useBreakpoint.d.ts +19 -0
  89. package/dist/Utils/useBreakpoint.js +35 -0
  90. package/dist/index.d.ts +14 -1
  91. package/dist/index.js +76 -62
  92. package/dist/theme.css +9 -0
  93. package/package.json +2 -2
@@ -0,0 +1,65 @@
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, useAttrs as o } from "vue";
4
+ import { get as s } from "es-toolkit/compat";
5
+ import { cn as c, getAdjacentTabValue as l, getTabId as u, splitComponentProps as d } from "@bridge-ui/core";
6
+ //#region src/Components/TabList/composables/useTabList.ts
7
+ var f = ["classes", "customProps"];
8
+ function p(p) {
9
+ let m = o(), h = a(r, null);
10
+ if (!h) throw Error("TabList must be used within a Tabs provider");
11
+ let g = h, _ = i(() => d({
12
+ bridgeKeys: f,
13
+ props: {
14
+ ...m,
15
+ ...p
16
+ }
17
+ })), { merged: v, entry: y } = t({
18
+ componentName: "TabList",
19
+ props: () => _.value.componentProps
20
+ }), b = n({
21
+ entry: y,
22
+ props: () => _.value.componentProps
23
+ });
24
+ function x(e) {
25
+ let t = g.value, n = t.orientation === "horizontal", r = n ? "ArrowRight" : "ArrowDown", i = n ? "ArrowLeft" : "ArrowUp", a = typeof document < "u" ? document.activeElement?.id : void 0, o = t.tabValues.find((e) => u(t.id, e) === a) ?? t.selected;
26
+ if (e.key === r || e.key === i) {
27
+ e.preventDefault();
28
+ let n = e.key === r ? 1 : -1, i = l(t.tabValues, o, n, new Set(t.disabledValues));
29
+ t.focusTab(i), t.activation === "automatic" && t.setSelected(i);
30
+ return;
31
+ }
32
+ if (e.key === "Home") {
33
+ e.preventDefault();
34
+ let n = t.tabValues.find((e) => !t.disabledValues.includes(e)) ?? t.selected;
35
+ t.focusTab(n), t.activation === "automatic" && t.setSelected(n);
36
+ return;
37
+ }
38
+ if (e.key === "End") {
39
+ e.preventDefault();
40
+ let n = [...t.tabValues].reverse().find((e) => !t.disabledValues.includes(e)) ?? t.selected;
41
+ t.focusTab(n), t.activation === "automatic" && t.setSelected(n);
42
+ }
43
+ }
44
+ let S = i(() => v.value.customProps);
45
+ return {
46
+ merged: v,
47
+ rootBind: i(() => {
48
+ let t = g.value;
49
+ return e(S.value?.root, _.value.inheritedAttrs, {
50
+ role: "tablist",
51
+ onKeydown: x,
52
+ "aria-orientation": t.orientation,
53
+ class: c({
54
+ flex: !0,
55
+ [t.tokenClasses.listOrientation ?? ""]: !0,
56
+ [t.tokenClasses.listSize ?? ""]: !0,
57
+ [t.tokenClasses.listVariant ?? ""]: !0,
58
+ [s(b.value, "root") ?? ""]: !0
59
+ })
60
+ });
61
+ })
62
+ };
63
+ }
64
+ //#endregion
65
+ export { p as useTabList };
@@ -0,0 +1,3 @@
1
+ export { useTabList } from './composables/useTabList';
2
+ export type { TabListClasses, TabListCustomProps, TabListOwnProps, TabListProps, TabListSlots, } from './tabList.types';
3
+ export { default as TabList } from './TabList.vue';
@@ -0,0 +1,3 @@
1
+ import { useTabList as e } from "./composables/useTabList.js";
2
+ import t from "./TabList.js";
3
+ export { t as TabList, e as useTabList };
@@ -0,0 +1,38 @@
1
+ import { HTMLAttributes, Slot } from 'vue';
2
+ import { MergeHtmlProps } from '@bridge-ui/core';
3
+ export interface TabListClasses {
4
+ /**
5
+ * Classes merged onto the tab list root.
6
+ */
7
+ root?: string;
8
+ }
9
+ export interface TabListCustomProps {
10
+ /**
11
+ * Props forwarded to the tab list root.
12
+ */
13
+ root?: HTMLAttributes;
14
+ }
15
+ /**
16
+ * Container for `Tab` triggers (`role="tablist"`). Must be used inside `Tabs`.
17
+ */
18
+ export interface TabListOwnProps {
19
+ /**
20
+ * Classes for tab list parts.
21
+ *
22
+ * @default undefined
23
+ */
24
+ classes?: TabListClasses;
25
+ /**
26
+ * Props forwarded to each tab list part.
27
+ *
28
+ * @default undefined
29
+ */
30
+ customProps?: TabListCustomProps;
31
+ }
32
+ export interface TabListSlots {
33
+ /**
34
+ * The tab triggers to render.
35
+ */
36
+ default?: Slot<undefined>;
37
+ }
38
+ export type TabListProps = MergeHtmlProps<TabListOwnProps, HTMLAttributes>;
@@ -0,0 +1,5 @@
1
+ import e from "./TabPanel.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/Components/TabPanel/TabPanel.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,11 @@
1
+ import { TabPanelOwnProps, TabPanelSlots } from './tabPanel.types';
2
+ type __VLS_Slots = TabPanelSlots;
3
+ declare const __VLS_base: import('vue').DefineComponent<TabPanelOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TabPanelOwnProps> & 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,20 @@
1
+ import { resolveNamedSlot as e } from "../../Utils/slotOrProp.js";
2
+ import { useTabPanel as t } from "./composables/useTabPanel.js";
3
+ import { createBlock as n, createCommentVNode as r, createElementBlock as i, defineComponent as a, mergeProps as o, normalizeProps as s, openBlock as c, resolveDynamicComponent as l, unref as u, useSlots as d } from "vue";
4
+ //#region src/Components/TabPanel/TabPanel.vue?vue&type=script&setup=true&lang.ts
5
+ var f = /* @__PURE__ */ a({
6
+ inheritAttrs: !1,
7
+ __name: "TabPanel",
8
+ props: {
9
+ classes: {},
10
+ customProps: {},
11
+ keepMounted: { type: Boolean },
12
+ value: {}
13
+ },
14
+ setup(a) {
15
+ let f = d(), { rootBind: p, selected: m, keepMounted: h } = t(a);
16
+ return (t, a) => u(m) || u(h) ? (c(), i("div", s(o({ key: 0 }, u(p))), [(c(), n(l(u(e)(u(f), "default"))))], 16)) : r("", !0);
17
+ }
18
+ });
19
+ //#endregion
20
+ export { f as default };
@@ -0,0 +1,14 @@
1
+ import { TabPanelOwnProps, TabPanelProps } from '../tabPanel.types';
2
+ export declare function useTabPanel(props: TabPanelOwnProps): {
3
+ merged: import('vue').ComputedRef<TabPanelOwnProps>;
4
+ rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
5
+ role: string;
6
+ hidden: boolean;
7
+ tabindex: number;
8
+ id: string;
9
+ "aria-labelledby": string;
10
+ class: string;
11
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<TabPanelProps, "value" | "classes" | "customProps" | "keepMounted">>>;
12
+ selected: import('vue').ComputedRef<boolean>;
13
+ keepMounted: import('vue').ComputedRef<boolean>;
14
+ };
@@ -0,0 +1,51 @@
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, getCurrentInstance as a, inject as o, useAttrs as s } from "vue";
4
+ import { get as c } from "es-toolkit/compat";
5
+ import { cn as l, getTabId as u, getTabPanelId as d, splitComponentProps as f } from "@bridge-ui/core";
6
+ //#region src/Components/TabPanel/composables/useTabPanel.ts
7
+ var p = [
8
+ "value",
9
+ "classes",
10
+ "customProps",
11
+ "keepMounted"
12
+ ];
13
+ function m(m) {
14
+ let h = s(), g = o(r, null);
15
+ if (!g) throw Error("TabPanel must be used within a Tabs provider");
16
+ let _ = g, v = i(() => f({
17
+ props: {
18
+ ...h,
19
+ ...m
20
+ },
21
+ bridgeKeys: p
22
+ })), { merged: y, entry: b } = t({
23
+ componentName: "TabPanel",
24
+ props: () => v.value.componentProps
25
+ }), x = i(() => y.value.value), S = i(() => _.value.selected === x.value), C = i(() => "keepMounted" in (a()?.vnode.props ?? {}) ? y.value.keepMounted === !0 : _.value.keepMounted), w = n({
26
+ entry: b,
27
+ props: () => v.value.componentProps
28
+ }), T = i(() => y.value.customProps);
29
+ return {
30
+ merged: y,
31
+ rootBind: i(() => {
32
+ let t = _.value;
33
+ return e(T.value?.root, v.value.inheritedAttrs, {
34
+ role: "tabpanel",
35
+ hidden: !S.value,
36
+ tabindex: S.value ? 0 : -1,
37
+ id: d(t.id, x.value),
38
+ "aria-labelledby": u(t.id, x.value),
39
+ class: l({
40
+ [t.tokenClasses.panelSize ?? ""]: !0,
41
+ [t.tokenClasses.panelOrientation ?? ""]: !0,
42
+ [c(w.value, "root") ?? ""]: !0
43
+ })
44
+ });
45
+ }),
46
+ selected: S,
47
+ keepMounted: C
48
+ };
49
+ }
50
+ //#endregion
51
+ export { m as useTabPanel };
@@ -0,0 +1,3 @@
1
+ export { useTabPanel } from './composables/useTabPanel';
2
+ export type { TabPanelClasses, TabPanelCustomProps, TabPanelOwnProps, TabPanelProps, TabPanelSlots, } from './tabPanel.types';
3
+ export { default as TabPanel } from './TabPanel.vue';
@@ -0,0 +1,3 @@
1
+ import { useTabPanel as e } from "./composables/useTabPanel.js";
2
+ import t from "./TabPanel.js";
3
+ export { t as TabPanel, e as useTabPanel };
@@ -0,0 +1,48 @@
1
+ import { HTMLAttributes, Slot } from 'vue';
2
+ import { MergeHtmlProps } from '@bridge-ui/core';
3
+ export interface TabPanelClasses {
4
+ /**
5
+ * Classes merged onto the panel root.
6
+ */
7
+ root?: string;
8
+ }
9
+ export interface TabPanelCustomProps {
10
+ /**
11
+ * Props forwarded to the panel root.
12
+ */
13
+ root?: HTMLAttributes;
14
+ }
15
+ /**
16
+ * Tab panel (`role="tabpanel"`). Visibility follows the matching `Tab` `value`.
17
+ */
18
+ export interface TabPanelOwnProps {
19
+ /**
20
+ * Classes for panel parts.
21
+ *
22
+ * @default undefined
23
+ */
24
+ classes?: TabPanelClasses;
25
+ /**
26
+ * Props forwarded to each panel part.
27
+ *
28
+ * @default undefined
29
+ */
30
+ customProps?: TabPanelCustomProps;
31
+ /**
32
+ * When set, overrides `Tabs` `keepMounted` for this panel.
33
+ *
34
+ * @default undefined
35
+ */
36
+ keepMounted?: boolean;
37
+ /**
38
+ * Stable value matching a `Tab`.
39
+ */
40
+ value: string;
41
+ }
42
+ export interface TabPanelSlots {
43
+ /**
44
+ * The panel content.
45
+ */
46
+ default?: Slot<undefined>;
47
+ }
48
+ export type TabPanelProps = MergeHtmlProps<TabPanelOwnProps, HTMLAttributes>;
@@ -0,0 +1,5 @@
1
+ import e from "./Tabs.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/Components/Tabs/Tabs.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,24 @@
1
+ import { TabsOwnProps, TabsSlots } from './tabs.types';
2
+ type __VLS_Slots = TabsSlots;
3
+ type __VLS_Props = TabsOwnProps;
4
+ type __VLS_ModelProps = {
5
+ modelValue?: string;
6
+ };
7
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
+ "update:modelValue": (...args: unknown[]) => any;
10
+ change: (value: string) => any;
11
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
+ "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
13
+ onChange?: ((value: string) => any) | undefined;
14
+ }>, {
15
+ keepMounted: boolean;
16
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,73 @@
1
+ import { resolveNamedSlot as e } from "../../Utils/slotOrProp.js";
2
+ import t from "../Tab/Tab.js";
3
+ import n from "../TabList/TabList.js";
4
+ import r from "../TabPanel/TabPanel.js";
5
+ import { useTabs as i } from "./composables/useTabs.js";
6
+ import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createSlots as u, createTextVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, mergeModels as h, normalizeProps as g, openBlock as _, renderList as v, resolveDynamicComponent as y, toDisplayString as b, unref as x, useModel as S, useSlots as C, withCtx as w } from "vue";
7
+ //#region src/Components/Tabs/Tabs.vue?vue&type=script&setup=true&lang.ts
8
+ var T = /* @__PURE__ */ p({
9
+ inheritAttrs: !1,
10
+ __name: "Tabs",
11
+ props: /* @__PURE__ */ h({
12
+ activation: {},
13
+ classes: {},
14
+ color: {},
15
+ customProps: {},
16
+ keepMounted: {
17
+ type: Boolean,
18
+ default: !0
19
+ },
20
+ orientation: {},
21
+ size: {},
22
+ variant: {}
23
+ }, {
24
+ modelValue: { default: "" },
25
+ modelModifiers: {}
26
+ }),
27
+ emits: /* @__PURE__ */ h(["change", "update:modelValue"], ["update:modelValue"]),
28
+ setup(p, { emit: h }) {
29
+ let T = C(), E = h, { rootBind: D, tabItems: O } = i(p, {
30
+ size: "md",
31
+ variant: "line",
32
+ color: "primary",
33
+ keepMounted: !0,
34
+ activation: "automatic",
35
+ orientation: "horizontal"
36
+ }, S(p, "modelValue"), E), k = o(() => O.value.length > 0);
37
+ return (i, o) => (_(), l("div", g(m(x(D))), [k.value ? (_(), l(a, { key: 0 }, [f(n, null, {
38
+ default: w(() => [(_(!0), l(a, null, v(x(O), (e) => (_(), s(t, {
39
+ key: e.value,
40
+ value: e.value,
41
+ "end-icon": e.endIcon,
42
+ disabled: e.disabled,
43
+ "start-icon": e.startIcon
44
+ }, u({
45
+ default: w(() => [typeof e.label == "string" ? (_(), l(a, { key: 0 }, [d(b(e.label), 1)], 64)) : (_(), s(y(e.label), { key: 1 }))]),
46
+ _: 2
47
+ }, [e.slots?.start ? {
48
+ name: "start",
49
+ fn: w(() => [(_(), s(y(e.slots.start)))]),
50
+ key: "0"
51
+ } : void 0, e.slots?.end ? {
52
+ name: "end",
53
+ fn: w(() => [(_(), s(y(e.slots.end)))]),
54
+ key: "1"
55
+ } : void 0]), 1032, [
56
+ "value",
57
+ "end-icon",
58
+ "disabled",
59
+ "start-icon"
60
+ ]))), 128))]),
61
+ _: 1
62
+ }), (_(!0), l(a, null, v(x(O), (e) => (_(), s(r, {
63
+ key: e.value,
64
+ value: e.value,
65
+ "keep-mounted": e.keepMounted
66
+ }, {
67
+ default: w(() => [(_(), s(y(e.panel)))]),
68
+ _: 2
69
+ }, 1032, ["value", "keep-mounted"]))), 128))], 64)) : c("", !0), (_(), s(y(x(e)(x(T), "default"))))], 16));
70
+ }
71
+ });
72
+ //#endregion
73
+ export { T as default };
@@ -0,0 +1,39 @@
1
+ import { Ref, SetupContext } from 'vue';
2
+ import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
3
+ import { TabsEmits, TabsOwnProps, TabsProps } from '../tabs.types';
4
+ import { TabsContextValue, TabsItemEntry } from '../tabsInjectionKey';
5
+ type TabsLibDefaults = LibDefaultsShape<TabsOwnProps, "size" | "color" | "variant" | "activation" | "keepMounted" | "orientation">;
6
+ type TabsMerged = MergeLibDefaults<TabsOwnProps, TabsLibDefaults>;
7
+ export declare function useTabs(props: TabsOwnProps, libDefaults: TabsLibDefaults, model: Ref<string | undefined>, emit: SetupContext<TabsEmits>["emit"]): {
8
+ merged: import('vue').ComputedRef<TabsMerged>;
9
+ rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
10
+ class: string;
11
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<TabsProps, "color" | "orientation" | "size" | "classes" | "customProps" | "variant" | "keepMounted" | "activation">>>;
12
+ tabItems: Ref<{
13
+ disabled?: boolean | undefined;
14
+ endIcon?: import('@lucide/vue').LucideIcon | undefined;
15
+ keepMounted?: boolean | undefined;
16
+ label: string | (() => import('vue').VNodeChild);
17
+ panel: () => import('vue').VNodeChild;
18
+ slots?: {
19
+ end?: (() => import('vue').VNodeChild) | undefined;
20
+ start?: (() => import('vue').VNodeChild) | undefined;
21
+ } | undefined;
22
+ startIcon?: import('@lucide/vue').LucideIcon | undefined;
23
+ value: string;
24
+ }[], TabsItemEntry[] | {
25
+ disabled?: boolean | undefined;
26
+ endIcon?: import('@lucide/vue').LucideIcon | undefined;
27
+ keepMounted?: boolean | undefined;
28
+ label: string | (() => import('vue').VNodeChild);
29
+ panel: () => import('vue').VNodeChild;
30
+ slots?: {
31
+ end?: (() => import('vue').VNodeChild) | undefined;
32
+ start?: (() => import('vue').VNodeChild) | undefined;
33
+ } | undefined;
34
+ startIcon?: import('@lucide/vue').LucideIcon | undefined;
35
+ value: string;
36
+ }[]>;
37
+ contextValue: import('vue').ComputedRef<TabsContextValue>;
38
+ };
39
+ export {};
@@ -0,0 +1,99 @@
1
+ import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
2
+ import { TABS_INJECTION_KEY as r } from "../tabsInjectionKey.js";
3
+ import { computed as i, provide as a, ref as o, useAttrs as s, useId as c } from "vue";
4
+ import { get as l } from "es-toolkit/compat";
5
+ import { cn as u, getTabId as d, mergeBridgeUILayeredClasses as f, splitComponentProps as p } from "@bridge-ui/core";
6
+ import { colorProps as m, orientationProps as h, sizeProps as g, variantProps as _ } from "@bridge-ui/core/Components/Tabs";
7
+ //#region src/Components/Tabs/composables/useTabs.ts
8
+ var v = [
9
+ "size",
10
+ "color",
11
+ "classes",
12
+ "variant",
13
+ "activation",
14
+ "customProps",
15
+ "keepMounted",
16
+ "orientation"
17
+ ];
18
+ function y(y, b, x, S) {
19
+ let C = c(), w = s(), T = `bridge-tabs${C}`, E = o([]), D = o([]), O = o([]), k = i(() => p({
20
+ bridgeKeys: v,
21
+ props: {
22
+ ...w,
23
+ ...y
24
+ }
25
+ })), { merged: A, entry: j } = t({
26
+ libDefaults: b,
27
+ componentName: "Tabs",
28
+ props: () => k.value.componentProps
29
+ }), M = i(() => x.value ?? "");
30
+ function N(e) {
31
+ D.value.includes(e) || (x.value = e, S("update:modelValue", e), S("change", e));
32
+ }
33
+ function P(e, t = !1) {
34
+ return E.value.includes(e) || (E.value = [...E.value, e]), t ? D.value.includes(e) || (D.value = [...D.value, e]) : D.value = D.value.filter((t) => t !== e), (x.value ?? "") === "" && !t && (x.value = e), () => {
35
+ E.value = E.value.filter((t) => t !== e), D.value = D.value.filter((t) => t !== e);
36
+ };
37
+ }
38
+ function F(e) {
39
+ document.getElementById(d(T, e))?.focus();
40
+ }
41
+ function I(e) {
42
+ let t = O.value.findIndex((t) => t.value === e.value);
43
+ if (t === -1) O.value = [...O.value, e];
44
+ else {
45
+ let n = [...O.value];
46
+ n[t] = e, O.value = n;
47
+ }
48
+ return (x.value ?? "") === "" && !e.disabled && (x.value = e.value), () => {
49
+ O.value = O.value.filter((t) => t.value !== e.value);
50
+ };
51
+ }
52
+ let L = n({
53
+ entry: j,
54
+ props: () => k.value.componentProps
55
+ }), R = i(() => f(g, j.value?.customProps?.size)), z = i(() => f(_, j.value?.customProps?.variant)), B = i(() => f(m, j.value?.customProps?.color)), V = i(() => f(h, j.value?.customProps?.orientation)), H = i(() => l(R.value, A.value.size)), U = i(() => l(z.value, A.value.variant)), W = i(() => l(B.value, A.value.color)), G = i(() => l(V.value, A.value.orientation)), K = i(() => ({
56
+ focusTab: F,
57
+ id: T,
58
+ setSelected: N,
59
+ registerTab: P,
60
+ registerTabItem: I,
61
+ selected: M.value,
62
+ tabItems: O.value,
63
+ tabValues: E.value,
64
+ disabledValues: D.value,
65
+ keepMounted: A.value.keepMounted !== !1,
66
+ activation: A.value.activation ?? "automatic",
67
+ orientation: A.value.orientation ?? "horizontal",
68
+ tokenClasses: {
69
+ tabSize: l(H.value, "tab"),
70
+ iconGap: l(H.value, "gap"),
71
+ iconSize: l(H.value, "icon"),
72
+ listSize: l(H.value, "list"),
73
+ panelSize: l(H.value, "panel"),
74
+ tabVariant: l(U.value, "tab"),
75
+ listVariant: l(U.value, "list"),
76
+ tabOrientation: l(G.value, "tab"),
77
+ colorSelected: l(W.value, "tabSelected"),
78
+ listOrientation: l(G.value, "list"),
79
+ rootOrientation: l(G.value, "root"),
80
+ panelOrientation: l(G.value, "panel"),
81
+ tabVariantSelected: l(U.value, "tabSelected"),
82
+ colorSelectedSoft: l(W.value, "tabSelectedSoft"),
83
+ softFill: A.value.variant === "pill" || A.value.variant === "solid"
84
+ }
85
+ }));
86
+ a(r, K);
87
+ let q = i(() => A.value.customProps);
88
+ return {
89
+ merged: A,
90
+ rootBind: i(() => e(q.value?.root, k.value.inheritedAttrs, { class: u({
91
+ [l(G.value, "root") ?? ""]: !0,
92
+ [l(L.value, "root") ?? ""]: !0
93
+ }) })),
94
+ tabItems: O,
95
+ contextValue: K
96
+ };
97
+ }
98
+ //#endregion
99
+ export { y as useTabs };
@@ -0,0 +1,4 @@
1
+ export { useTabs } from './composables/useTabs';
2
+ export type { TabsClasses, TabsColorOverrides, TabsCustomProps, TabsEmits, TabsOrientationOverrides, TabsOwnProps, TabsProps, TabsSizeOverrides, TabsSlots, TabsVariantOverrides, } from './tabs.types';
3
+ export { default as Tabs } from './Tabs.vue';
4
+ export { TABS_INJECTION_KEY, type TabsContextValue, type TabsItemEntry, type TabsTokenClasses, } from './tabsInjectionKey';
@@ -0,0 +1,4 @@
1
+ import { TABS_INJECTION_KEY as e } from "./tabsInjectionKey.js";
2
+ import { useTabs as t } from "./composables/useTabs.js";
3
+ import n from "./Tabs.js";
4
+ export { e as TABS_INJECTION_KEY, n as Tabs, t as useTabs };
@@ -0,0 +1,93 @@
1
+ import { HTMLAttributes, Slot } from 'vue';
2
+ import { MergeHtmlProps, MergeProps, TabsActivation, TabsColor, TabsOrientation, TabsSize, TabsVariant } from '@bridge-ui/core';
3
+ export interface TabsSizeOverrides {}
4
+ export interface TabsColorOverrides {}
5
+ export interface TabsVariantOverrides {}
6
+ export interface TabsOrientationOverrides {}
7
+ export interface TabsClasses {
8
+ /**
9
+ * Classes merged onto the root.
10
+ */
11
+ root?: string;
12
+ }
13
+ export interface TabsCustomProps {
14
+ /**
15
+ * Props forwarded to the root element.
16
+ */
17
+ root?: HTMLAttributes;
18
+ }
19
+ export interface TabsEmits {
20
+ /**
21
+ * Emitted when the selected tab changes.
22
+ */
23
+ change: [value: string];
24
+ /**
25
+ * Emitted when `v-model` should update.
26
+ */
27
+ "update:modelValue": [value: string];
28
+ }
29
+ /**
30
+ * Tabs context root. Compose with `TabList`, `Tab`, and `TabPanel`.
31
+ */
32
+ export interface TabsOwnProps {
33
+ /**
34
+ * Keyboard activation: `automatic` selects on arrow focus; `manual` needs Enter/Space.
35
+ *
36
+ * @default "automatic"
37
+ */
38
+ activation?: TabsActivation;
39
+ /**
40
+ * Classes for tabs parts.
41
+ *
42
+ * @default undefined
43
+ */
44
+ classes?: TabsClasses;
45
+ /**
46
+ * Accent color for the selected tab (`primary` or `dark`).
47
+ *
48
+ * @default "primary"
49
+ */
50
+ color?: MergeProps<TabsColor, TabsColorOverrides>;
51
+ /**
52
+ * Props forwarded to each tabs part.
53
+ *
54
+ * @default undefined
55
+ */
56
+ customProps?: TabsCustomProps;
57
+ /**
58
+ * When true, inactive panels stay mounted (hidden).
59
+ *
60
+ * @default true
61
+ */
62
+ keepMounted?: boolean;
63
+ /**
64
+ * Layout orientation of the tab list.
65
+ *
66
+ * @default "horizontal"
67
+ */
68
+ orientation?: MergeProps<TabsOrientation, TabsOrientationOverrides>;
69
+ /**
70
+ * Size of the tab list and triggers.
71
+ *
72
+ * @default "md"
73
+ */
74
+ size?: MergeProps<TabsSize, TabsSizeOverrides>;
75
+ /**
76
+ * Visual style of the tab list / selected tab.
77
+ *
78
+ * @default "line"
79
+ */
80
+ variant?: MergeProps<TabsVariant, TabsVariantOverrides>;
81
+ }
82
+ export interface TabsSlots {
83
+ /**
84
+ * The children to render (`TabList`, `TabPanel`, etc.).
85
+ */
86
+ default?: Slot<undefined>;
87
+ }
88
+ export type TabsProps = MergeHtmlProps<TabsOwnProps, HTMLAttributes> & {
89
+ /**
90
+ * Bound with `v-model` on the component (`defineModel` internally).
91
+ */
92
+ modelValue?: string;
93
+ };