@mekari/pixel3-tabs 0.0.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.
Files changed (48) hide show
  1. package/dist/chunk-5R2IYROF.mjs +43 -0
  2. package/dist/chunk-BCRB3ASV.mjs +29 -0
  3. package/dist/chunk-DKZ3Z2UI.mjs +61 -0
  4. package/dist/chunk-JEXLKDPT.mjs +38 -0
  5. package/dist/chunk-JQQ5YTMJ.mjs +31 -0
  6. package/dist/chunk-LAMJMXQC.mjs +56 -0
  7. package/dist/chunk-QVDBBOCQ.mjs +146 -0
  8. package/dist/chunk-QZ7VFGWC.mjs +6 -0
  9. package/dist/chunk-S5AGDSR2.mjs +8 -0
  10. package/dist/index.d.mts +6 -0
  11. package/dist/index.d.ts +6 -0
  12. package/dist/index.js +379 -0
  13. package/dist/index.mjs +26 -0
  14. package/dist/metafile-cjs.json +1 -0
  15. package/dist/metafile-esm.json +1 -0
  16. package/dist/modules/tabs.context.d.mts +12 -0
  17. package/dist/modules/tabs.context.d.ts +12 -0
  18. package/dist/modules/tabs.context.js +33 -0
  19. package/dist/modules/tabs.context.mjs +9 -0
  20. package/dist/modules/tabs.hooks.d.mts +56 -0
  21. package/dist/modules/tabs.hooks.d.ts +56 -0
  22. package/dist/modules/tabs.hooks.js +174 -0
  23. package/dist/modules/tabs.hooks.mjs +16 -0
  24. package/dist/modules/tabs.props.d.mts +62 -0
  25. package/dist/modules/tabs.props.d.ts +62 -0
  26. package/dist/modules/tabs.props.js +88 -0
  27. package/dist/modules/tabs.props.mjs +13 -0
  28. package/dist/tab-list.d.mts +5 -0
  29. package/dist/tab-list.d.ts +5 -0
  30. package/dist/tab-list.js +114 -0
  31. package/dist/tab-list.mjs +9 -0
  32. package/dist/tab-panel.d.mts +29 -0
  33. package/dist/tab-panel.d.ts +29 -0
  34. package/dist/tab-panel.js +89 -0
  35. package/dist/tab-panel.mjs +10 -0
  36. package/dist/tab-panels.d.mts +5 -0
  37. package/dist/tab-panels.d.ts +5 -0
  38. package/dist/tab-panels.js +81 -0
  39. package/dist/tab-panels.mjs +9 -0
  40. package/dist/tab.d.mts +29 -0
  41. package/dist/tab.d.ts +29 -0
  42. package/dist/tab.js +134 -0
  43. package/dist/tab.mjs +10 -0
  44. package/dist/tabs.d.mts +56 -0
  45. package/dist/tabs.d.ts +56 -0
  46. package/dist/tabs.js +123 -0
  47. package/dist/tabs.mjs +10 -0
  48. package/package.json +41 -0
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/tab-panel.tsx
22
+ var tab_panel_exports = {};
23
+ __export(tab_panel_exports, {
24
+ MpTabPanel: () => MpTabPanel
25
+ });
26
+ module.exports = __toCommonJS(tab_panel_exports);
27
+ var import_vue2 = require("vue");
28
+ var import_vue3 = require("vue");
29
+
30
+ // src/modules/tabs.hooks.ts
31
+ var import_vue = require("vue");
32
+ var import_css = require("@mekari/pixel3-styled-system/css");
33
+ var import_recipes = require("@mekari/pixel3-styled-system/recipes");
34
+ var import_pixel3_utils2 = require("@mekari/pixel3-utils");
35
+
36
+ // src/modules/tabs.context.ts
37
+ var import_pixel3_utils = require("@mekari/pixel3-utils");
38
+ var [TabsProvider, useTabsContext] = (0, import_pixel3_utils.usePixelCreateContext)("TabsContext");
39
+
40
+ // src/modules/tabs.hooks.ts
41
+ function useTabPanel(props) {
42
+ const rootAttrs = (0, import_vue.computed)(() => {
43
+ return {
44
+ "data-pixel-component": "MpTabPanel",
45
+ style: {
46
+ display: props.isKeepAlive ? props.isSelected ? "unset" : "none" : ""
47
+ }
48
+ };
49
+ });
50
+ return {
51
+ rootAttrs
52
+ };
53
+ }
54
+ __name(useTabPanel, "useTabPanel");
55
+
56
+ // src/modules/tabs.props.ts
57
+ var tabPanelProps = {
58
+ isSelected: {
59
+ type: Boolean
60
+ },
61
+ value: {
62
+ type: String
63
+ },
64
+ isKeepAlive: {
65
+ type: Boolean,
66
+ default: true
67
+ }
68
+ };
69
+
70
+ // src/tab-panel.tsx
71
+ var MpTabPanel = (0, import_vue3.defineComponent)({
72
+ name: "MpTabPanel",
73
+ props: tabPanelProps,
74
+ setup(props, {
75
+ slots
76
+ }) {
77
+ const {
78
+ rootAttrs
79
+ } = useTabPanel(props);
80
+ return () => {
81
+ const renderNode = (0, import_vue2.createVNode)("div", rootAttrs.value, [(0, import_vue2.createTextVNode)(" "), slots.default(), (0, import_vue2.createTextVNode)(" ")]);
82
+ return props.isKeepAlive ? renderNode : props.isSelected ? renderNode : null;
83
+ };
84
+ }
85
+ });
86
+ // Annotate the CommonJS export names for ESM import in node:
87
+ 0 && (module.exports = {
88
+ MpTabPanel
89
+ });
@@ -0,0 +1,10 @@
1
+ import {
2
+ MpTabPanel
3
+ } from "./chunk-BCRB3ASV.mjs";
4
+ import "./chunk-DKZ3Z2UI.mjs";
5
+ import "./chunk-QVDBBOCQ.mjs";
6
+ import "./chunk-S5AGDSR2.mjs";
7
+ import "./chunk-QZ7VFGWC.mjs";
8
+ export {
9
+ MpTabPanel
10
+ };
@@ -0,0 +1,5 @@
1
+ import * as vue from 'vue';
2
+
3
+ declare const MpTabPanels: vue.DefineComponent<{}, () => JSX.Element, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{}>>, {}, {}>;
4
+
5
+ export { MpTabPanels };
@@ -0,0 +1,5 @@
1
+ import * as vue from 'vue';
2
+
3
+ declare const MpTabPanels: vue.DefineComponent<{}, () => JSX.Element, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{}>>, {}, {}>;
4
+
5
+ export { MpTabPanels };
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/tab-panels.tsx
22
+ var tab_panels_exports = {};
23
+ __export(tab_panels_exports, {
24
+ MpTabPanels: () => MpTabPanels
25
+ });
26
+ module.exports = __toCommonJS(tab_panels_exports);
27
+ var import_vue2 = require("vue");
28
+ var import_vue3 = require("vue");
29
+
30
+ // src/modules/tabs.hooks.ts
31
+ var import_vue = require("vue");
32
+ var import_css = require("@mekari/pixel3-styled-system/css");
33
+ var import_recipes = require("@mekari/pixel3-styled-system/recipes");
34
+ var import_pixel3_utils2 = require("@mekari/pixel3-utils");
35
+
36
+ // src/modules/tabs.context.ts
37
+ var import_pixel3_utils = require("@mekari/pixel3-utils");
38
+ var [TabsProvider, useTabsContext] = (0, import_pixel3_utils.usePixelCreateContext)("TabsContext");
39
+
40
+ // src/modules/tabs.hooks.ts
41
+ function useTabPanels() {
42
+ const {
43
+ selectedTab
44
+ } = useTabsContext();
45
+ const rootAttrs = (0, import_vue.computed)(() => {
46
+ return {
47
+ "data-pixel-component": "MpTabPanels"
48
+ };
49
+ });
50
+ return {
51
+ rootAttrs,
52
+ selectedTab
53
+ };
54
+ }
55
+ __name(useTabPanels, "useTabPanels");
56
+
57
+ // src/tab-panels.tsx
58
+ var MpTabPanels = (0, import_vue3.defineComponent)({
59
+ name: "MpTabPanels",
60
+ setup(props, {
61
+ slots
62
+ }) {
63
+ const {
64
+ rootAttrs,
65
+ selectedTab
66
+ } = useTabPanels();
67
+ return () => {
68
+ const clones = slots.default().map((vnode, index) => {
69
+ const clone = (0, import_vue3.cloneVNode)(vnode, {
70
+ isSelected: selectedTab.value === index
71
+ });
72
+ return clone;
73
+ });
74
+ return (0, import_vue2.createVNode)("div", rootAttrs.value, [clones]);
75
+ };
76
+ }
77
+ });
78
+ // Annotate the CommonJS export names for ESM import in node:
79
+ 0 && (module.exports = {
80
+ MpTabPanels
81
+ });
@@ -0,0 +1,9 @@
1
+ import {
2
+ MpTabPanels
3
+ } from "./chunk-JQQ5YTMJ.mjs";
4
+ import "./chunk-QVDBBOCQ.mjs";
5
+ import "./chunk-S5AGDSR2.mjs";
6
+ import "./chunk-QZ7VFGWC.mjs";
7
+ export {
8
+ MpTabPanels
9
+ };
package/dist/tab.d.mts ADDED
@@ -0,0 +1,29 @@
1
+ import * as vue from 'vue';
2
+
3
+ declare const MpTab: vue.DefineComponent<{
4
+ id: {
5
+ type: vue.PropType<string>;
6
+ };
7
+ isSelected: {
8
+ type: vue.PropType<boolean>;
9
+ default: boolean;
10
+ };
11
+ value: {
12
+ type: vue.PropType<string>;
13
+ };
14
+ }, () => JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
15
+ id: {
16
+ type: vue.PropType<string>;
17
+ };
18
+ isSelected: {
19
+ type: vue.PropType<boolean>;
20
+ default: boolean;
21
+ };
22
+ value: {
23
+ type: vue.PropType<string>;
24
+ };
25
+ }>>, {
26
+ isSelected: boolean;
27
+ }, {}>;
28
+
29
+ export { MpTab };
package/dist/tab.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ import * as vue from 'vue';
2
+
3
+ declare const MpTab: vue.DefineComponent<{
4
+ id: {
5
+ type: vue.PropType<string>;
6
+ };
7
+ isSelected: {
8
+ type: vue.PropType<boolean>;
9
+ default: boolean;
10
+ };
11
+ value: {
12
+ type: vue.PropType<string>;
13
+ };
14
+ }, () => JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
15
+ id: {
16
+ type: vue.PropType<string>;
17
+ };
18
+ isSelected: {
19
+ type: vue.PropType<boolean>;
20
+ default: boolean;
21
+ };
22
+ value: {
23
+ type: vue.PropType<string>;
24
+ };
25
+ }>>, {
26
+ isSelected: boolean;
27
+ }, {}>;
28
+
29
+ export { MpTab };
package/dist/tab.js ADDED
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/tab.tsx
22
+ var tab_exports = {};
23
+ __export(tab_exports, {
24
+ MpTab: () => MpTab
25
+ });
26
+ module.exports = __toCommonJS(tab_exports);
27
+ var import_vue2 = require("vue");
28
+ var import_vue3 = require("vue");
29
+ var import_recipes2 = require("@mekari/pixel3-styled-system/recipes");
30
+
31
+ // src/modules/tabs.props.ts
32
+ var tabProps = {
33
+ id: {
34
+ type: String
35
+ },
36
+ isSelected: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ value: {
41
+ type: String
42
+ }
43
+ };
44
+ var selectedBorderProps = {
45
+ isSelected: {
46
+ type: Boolean,
47
+ default: false
48
+ }
49
+ };
50
+
51
+ // src/modules/tabs.hooks.ts
52
+ var import_vue = require("vue");
53
+ var import_css = require("@mekari/pixel3-styled-system/css");
54
+ var import_recipes = require("@mekari/pixel3-styled-system/recipes");
55
+ var import_pixel3_utils2 = require("@mekari/pixel3-utils");
56
+
57
+ // src/modules/tabs.context.ts
58
+ var import_pixel3_utils = require("@mekari/pixel3-utils");
59
+ var [TabsProvider, useTabsContext] = (0, import_pixel3_utils.usePixelCreateContext)("TabsContext");
60
+
61
+ // src/modules/tabs.hooks.ts
62
+ function useTab(props, attrs) {
63
+ const {
64
+ rootProps,
65
+ id: tabsId
66
+ } = useTabsContext();
67
+ const {
68
+ variantColor
69
+ } = rootProps;
70
+ const rootAttrs = (0, import_vue.computed)(() => {
71
+ return {
72
+ role: "tab",
73
+ "data-pixel-component": "MpTab",
74
+ class: ["group", (0, import_recipes.tabRecipe)({
75
+ isSelected: props.isSelected,
76
+ variantColor: (0, import_vue.unref)(variantColor)
77
+ })],
78
+ id: props.id || `tab:${tabsId.value}-${attrs.index}`
79
+ };
80
+ });
81
+ const tabSelectedBorderAttrs = (0, import_vue.computed)(() => {
82
+ return {
83
+ isSelected: props.isSelected
84
+ };
85
+ });
86
+ return {
87
+ rootAttrs,
88
+ tabSelectedBorderAttrs
89
+ };
90
+ }
91
+ __name(useTab, "useTab");
92
+
93
+ // src/tab.tsx
94
+ var MpTab = (0, import_vue3.defineComponent)({
95
+ name: "MpTab",
96
+ props: tabProps,
97
+ setup(props, {
98
+ slots,
99
+ attrs
100
+ }) {
101
+ const {
102
+ rootAttrs,
103
+ tabSelectedBorderAttrs
104
+ } = useTab(props, attrs);
105
+ return () => {
106
+ return (0, import_vue2.createVNode)("button", rootAttrs.value, [slots.default(), (0, import_vue2.createVNode)(MpTabSelectedBorder, tabSelectedBorderAttrs.value, null)]);
107
+ };
108
+ }
109
+ });
110
+ var MpTabSelectedBorder = (0, import_vue3.defineComponent)({
111
+ name: "MpTabSelectedBorder",
112
+ props: selectedBorderProps,
113
+ setup(props) {
114
+ const {
115
+ rootProps
116
+ } = useTabsContext();
117
+ const {
118
+ variantColor
119
+ } = rootProps;
120
+ return () => {
121
+ return (0, import_vue2.createVNode)("div", {
122
+ "class": (0, import_recipes2.selectedBorderRecipe)({
123
+ isSelected: props.isSelected,
124
+ variantColor: (0, import_vue3.unref)(variantColor)
125
+ }),
126
+ "data-pixel-component": "MpTabSelectedBorder"
127
+ }, null);
128
+ };
129
+ }
130
+ });
131
+ // Annotate the CommonJS export names for ESM import in node:
132
+ 0 && (module.exports = {
133
+ MpTab
134
+ });
package/dist/tab.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import {
2
+ MpTab
3
+ } from "./chunk-LAMJMXQC.mjs";
4
+ import "./chunk-DKZ3Z2UI.mjs";
5
+ import "./chunk-QVDBBOCQ.mjs";
6
+ import "./chunk-S5AGDSR2.mjs";
7
+ import "./chunk-QZ7VFGWC.mjs";
8
+ export {
9
+ MpTab
10
+ };
@@ -0,0 +1,56 @@
1
+ import * as vue from 'vue';
2
+
3
+ declare const MpTabs: vue.DefineComponent<{
4
+ modelValue: {
5
+ type: vue.PropType<number>;
6
+ };
7
+ defaultValue: {
8
+ type: vue.PropType<number>;
9
+ default: number;
10
+ };
11
+ id: {
12
+ type: vue.PropType<string>;
13
+ };
14
+ isManual: {
15
+ type: vue.PropType<boolean>;
16
+ };
17
+ variantColor: {
18
+ type: vue.PropType<"blue" | "green" | "orange" | "red" | "gray">;
19
+ default: string;
20
+ };
21
+ isShowBorder: {
22
+ type: vue.PropType<boolean>;
23
+ default: boolean;
24
+ };
25
+ }, () => JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
26
+ modelValue: {
27
+ type: vue.PropType<number>;
28
+ };
29
+ defaultValue: {
30
+ type: vue.PropType<number>;
31
+ default: number;
32
+ };
33
+ id: {
34
+ type: vue.PropType<string>;
35
+ };
36
+ isManual: {
37
+ type: vue.PropType<boolean>;
38
+ };
39
+ variantColor: {
40
+ type: vue.PropType<"blue" | "green" | "orange" | "red" | "gray">;
41
+ default: string;
42
+ };
43
+ isShowBorder: {
44
+ type: vue.PropType<boolean>;
45
+ default: boolean;
46
+ };
47
+ }>> & {
48
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
49
+ onChange?: ((...args: any[]) => any) | undefined;
50
+ }, {
51
+ variantColor: "blue" | "green" | "orange" | "red" | "gray";
52
+ defaultValue: number;
53
+ isShowBorder: boolean;
54
+ }, {}>;
55
+
56
+ export { MpTabs };
package/dist/tabs.d.ts ADDED
@@ -0,0 +1,56 @@
1
+ import * as vue from 'vue';
2
+
3
+ declare const MpTabs: vue.DefineComponent<{
4
+ modelValue: {
5
+ type: vue.PropType<number>;
6
+ };
7
+ defaultValue: {
8
+ type: vue.PropType<number>;
9
+ default: number;
10
+ };
11
+ id: {
12
+ type: vue.PropType<string>;
13
+ };
14
+ isManual: {
15
+ type: vue.PropType<boolean>;
16
+ };
17
+ variantColor: {
18
+ type: vue.PropType<"blue" | "green" | "orange" | "red" | "gray">;
19
+ default: string;
20
+ };
21
+ isShowBorder: {
22
+ type: vue.PropType<boolean>;
23
+ default: boolean;
24
+ };
25
+ }, () => JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
26
+ modelValue: {
27
+ type: vue.PropType<number>;
28
+ };
29
+ defaultValue: {
30
+ type: vue.PropType<number>;
31
+ default: number;
32
+ };
33
+ id: {
34
+ type: vue.PropType<string>;
35
+ };
36
+ isManual: {
37
+ type: vue.PropType<boolean>;
38
+ };
39
+ variantColor: {
40
+ type: vue.PropType<"blue" | "green" | "orange" | "red" | "gray">;
41
+ default: string;
42
+ };
43
+ isShowBorder: {
44
+ type: vue.PropType<boolean>;
45
+ default: boolean;
46
+ };
47
+ }>> & {
48
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
49
+ onChange?: ((...args: any[]) => any) | undefined;
50
+ }, {
51
+ variantColor: "blue" | "green" | "orange" | "red" | "gray";
52
+ defaultValue: number;
53
+ isShowBorder: boolean;
54
+ }, {}>;
55
+
56
+ export { MpTabs };
package/dist/tabs.js ADDED
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/tabs.tsx
22
+ var tabs_exports = {};
23
+ __export(tabs_exports, {
24
+ MpTabs: () => MpTabs
25
+ });
26
+ module.exports = __toCommonJS(tabs_exports);
27
+ var import_vue2 = require("vue");
28
+ var import_vue3 = require("vue");
29
+ var import_vue4 = require("vue");
30
+
31
+ // src/modules/tabs.props.ts
32
+ var tabsProps = {
33
+ modelValue: {
34
+ type: Number
35
+ },
36
+ defaultValue: {
37
+ type: Number,
38
+ default: 0
39
+ },
40
+ id: {
41
+ type: String
42
+ },
43
+ isManual: {
44
+ type: Boolean
45
+ },
46
+ variantColor: {
47
+ type: String,
48
+ default: "blue"
49
+ },
50
+ isShowBorder: {
51
+ type: Boolean,
52
+ default: true
53
+ }
54
+ };
55
+
56
+ // src/modules/tabs.hooks.ts
57
+ var import_vue = require("vue");
58
+ var import_css = require("@mekari/pixel3-styled-system/css");
59
+ var import_recipes = require("@mekari/pixel3-styled-system/recipes");
60
+ var import_pixel3_utils2 = require("@mekari/pixel3-utils");
61
+
62
+ // src/modules/tabs.context.ts
63
+ var import_pixel3_utils = require("@mekari/pixel3-utils");
64
+ var [TabsProvider, useTabsContext] = (0, import_pixel3_utils.usePixelCreateContext)("TabsContext");
65
+
66
+ // src/modules/tabs.hooks.ts
67
+ function useTabs(props, emit) {
68
+ const selectedTab = (0, import_vue.ref)(props.defaultValue);
69
+ const selected = props.isManual ? (0, import_vue.computed)(() => props.modelValue) : selectedTab;
70
+ const id = (0, import_vue.computed)(() => props.id || `tabs-${(0, import_pixel3_utils2.useId)(4)}`);
71
+ const rootAttrs = (0, import_vue.computed)(() => {
72
+ return {
73
+ "data-pixel-component": "MpTabs",
74
+ id: id.value
75
+ };
76
+ });
77
+ function onChangeTab(value) {
78
+ if (!props.isManual) {
79
+ selectedTab.value = value;
80
+ }
81
+ emit("change", value);
82
+ emit("update:modelValue", value);
83
+ }
84
+ __name(onChangeTab, "onChangeTab");
85
+ return {
86
+ selectedTab: selected,
87
+ onChangeTab,
88
+ rootAttrs,
89
+ id
90
+ };
91
+ }
92
+ __name(useTabs, "useTabs");
93
+
94
+ // src/tabs.tsx
95
+ var MpTabs = (0, import_vue3.defineComponent)({
96
+ name: "MpTabs",
97
+ props: tabsProps,
98
+ emits: ["change", "update:modelValue"],
99
+ setup(props, {
100
+ slots,
101
+ emit
102
+ }) {
103
+ const {
104
+ rootAttrs,
105
+ selectedTab,
106
+ onChangeTab,
107
+ id
108
+ } = useTabs(props, emit);
109
+ TabsProvider({
110
+ selectedTab,
111
+ onChangeTab,
112
+ rootProps: (0, import_vue4.toRefs)(props),
113
+ id
114
+ });
115
+ return () => {
116
+ return (0, import_vue2.createVNode)("div", rootAttrs.value, [slots.default()]);
117
+ };
118
+ }
119
+ });
120
+ // Annotate the CommonJS export names for ESM import in node:
121
+ 0 && (module.exports = {
122
+ MpTabs
123
+ });
package/dist/tabs.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import {
2
+ MpTabs
3
+ } from "./chunk-5R2IYROF.mjs";
4
+ import "./chunk-DKZ3Z2UI.mjs";
5
+ import "./chunk-QVDBBOCQ.mjs";
6
+ import "./chunk-S5AGDSR2.mjs";
7
+ import "./chunk-QZ7VFGWC.mjs";
8
+ export {
9
+ MpTabs
10
+ };