@mekari/pixel3-text 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.
@@ -0,0 +1,38 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/modules/text.props.ts
5
+ var textProps = {
6
+ as: {
7
+ type: String,
8
+ default: "p"
9
+ },
10
+ size: {
11
+ type: String
12
+ },
13
+ weight: {
14
+ type: String
15
+ },
16
+ color: {
17
+ type: String,
18
+ default: "dark"
19
+ },
20
+ lineClamp: {
21
+ type: String,
22
+ default: "1"
23
+ },
24
+ isStrike: {
25
+ type: Boolean
26
+ },
27
+ isTextLink: {
28
+ type: Boolean
29
+ },
30
+ isTruncated: {
31
+ type: Boolean
32
+ }
33
+ };
34
+
35
+ export {
36
+ __name,
37
+ textProps
38
+ };
@@ -0,0 +1,59 @@
1
+ import {
2
+ __name,
3
+ textProps
4
+ } from "./chunk-5REAQYN3.mjs";
5
+
6
+ // src/text.tsx
7
+ import { createVNode as _createVNode, isVNode as _isVNode } from "vue";
8
+ import { defineComponent } from "vue";
9
+ import { token } from "@mekari/pixel3-styled-system/tokens";
10
+ import { textRecipe } from "@mekari/pixel3-styled-system/recipes";
11
+ function _isSlot(s) {
12
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !_isVNode(s);
13
+ }
14
+ __name(_isSlot, "_isSlot");
15
+ var MpText = defineComponent({
16
+ name: "MpText",
17
+ props: textProps,
18
+ setup(props, {
19
+ slots
20
+ }) {
21
+ const classes = textRecipe({
22
+ size: props.size,
23
+ weight: props.weight
24
+ });
25
+ const handleStyleTruncate = /* @__PURE__ */ __name(() => {
26
+ return props.isTruncated && {
27
+ overflow: "hidden",
28
+ display: "-webkit-box",
29
+ "-webkit-line-clamp": props.lineClamp,
30
+ "-webkit-box-orient": "vertical"
31
+ };
32
+ }, "handleStyleTruncate");
33
+ return () => {
34
+ const children = slots.default && slots.default();
35
+ const {
36
+ as: Component,
37
+ color,
38
+ isStrike,
39
+ isTextLink
40
+ } = props;
41
+ return _createVNode(Component, {
42
+ "class": classes,
43
+ "data-pixel-component": "MpText",
44
+ "data-text-strike": isStrike ? true : void 0,
45
+ "data-text-link": isTextLink ? true : void 0,
46
+ "style": {
47
+ "--mp-text-color": token(`colors.${color}`) || color,
48
+ ...handleStyleTruncate()
49
+ }
50
+ }, _isSlot(children) ? children : {
51
+ default: () => [children]
52
+ });
53
+ };
54
+ }
55
+ });
56
+
57
+ export {
58
+ MpText
59
+ };
@@ -0,0 +1,3 @@
1
+ export { MpText } from './text.mjs';
2
+ import './modules/text.type.mjs';
3
+ import 'vue';
@@ -0,0 +1,3 @@
1
+ export { MpText } from './text.js';
2
+ import './modules/text.type.js';
3
+ import 'vue';
package/dist/index.js ADDED
@@ -0,0 +1,114 @@
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/index.tsx
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ MpText: () => MpText
25
+ });
26
+ module.exports = __toCommonJS(src_exports);
27
+
28
+ // src/text.tsx
29
+ var import_vue = require("vue");
30
+ var import_vue2 = require("vue");
31
+ var import_tokens = require("@mekari/pixel3-styled-system/tokens");
32
+ var import_recipes = require("@mekari/pixel3-styled-system/recipes");
33
+
34
+ // src/modules/text.props.ts
35
+ var textProps = {
36
+ as: {
37
+ type: String,
38
+ default: "p"
39
+ },
40
+ size: {
41
+ type: String
42
+ },
43
+ weight: {
44
+ type: String
45
+ },
46
+ color: {
47
+ type: String,
48
+ default: "dark"
49
+ },
50
+ lineClamp: {
51
+ type: String,
52
+ default: "1"
53
+ },
54
+ isStrike: {
55
+ type: Boolean
56
+ },
57
+ isTextLink: {
58
+ type: Boolean
59
+ },
60
+ isTruncated: {
61
+ type: Boolean
62
+ }
63
+ };
64
+
65
+ // src/text.tsx
66
+ function _isSlot(s) {
67
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, import_vue.isVNode)(s);
68
+ }
69
+ __name(_isSlot, "_isSlot");
70
+ var MpText = (0, import_vue2.defineComponent)({
71
+ name: "MpText",
72
+ props: textProps,
73
+ setup(props, {
74
+ slots
75
+ }) {
76
+ const classes = (0, import_recipes.textRecipe)({
77
+ size: props.size,
78
+ weight: props.weight
79
+ });
80
+ const handleStyleTruncate = /* @__PURE__ */ __name(() => {
81
+ return props.isTruncated && {
82
+ overflow: "hidden",
83
+ display: "-webkit-box",
84
+ "-webkit-line-clamp": props.lineClamp,
85
+ "-webkit-box-orient": "vertical"
86
+ };
87
+ }, "handleStyleTruncate");
88
+ return () => {
89
+ const children = slots.default && slots.default();
90
+ const {
91
+ as: Component,
92
+ color,
93
+ isStrike,
94
+ isTextLink
95
+ } = props;
96
+ return (0, import_vue.createVNode)(Component, {
97
+ "class": classes,
98
+ "data-pixel-component": "MpText",
99
+ "data-text-strike": isStrike ? true : void 0,
100
+ "data-text-link": isTextLink ? true : void 0,
101
+ "style": {
102
+ "--mp-text-color": (0, import_tokens.token)(`colors.${color}`) || color,
103
+ ...handleStyleTruncate()
104
+ }
105
+ }, _isSlot(children) ? children : {
106
+ default: () => [children]
107
+ });
108
+ };
109
+ }
110
+ });
111
+ // Annotate the CommonJS export names for ESM import in node:
112
+ 0 && (module.exports = {
113
+ MpText
114
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,7 @@
1
+ import {
2
+ MpText
3
+ } from "./chunk-MUU2JOPN.mjs";
4
+ import "./chunk-5REAQYN3.mjs";
5
+ export {
6
+ MpText
7
+ };
@@ -0,0 +1 @@
1
+ {"inputs":{"src/modules/text.props.ts":{"bytes":749,"imports":[{"path":"../modules/text.type","kind":"import-statement","external":true}],"format":"esm"},"src/text.tsx":{"bytes":1669,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/tokens","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true},{"path":"src/modules/text.props.ts","kind":"import-statement","original":"./modules/text.props"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.tsx":{"bytes":117,"imports":[{"path":"src/text.tsx","kind":"import-statement","original":"./text"}],"format":"esm"},"src/modules/text.type.ts":{"bytes":239,"imports":[],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"vue","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/tokens","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/index.tsx","inputs":{"src/index.tsx":{"bytesInOutput":117},"src/text.tsx":{"bytesInOutput":1560},"src/modules/text.props.ts":{"bytesInOutput":359}},"bytes":3107},"dist/text.js":{"imports":[{"path":"vue","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/tokens","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/text.tsx","inputs":{"src/text.tsx":{"bytesInOutput":1680},"src/modules/text.props.ts":{"bytesInOutput":359}},"bytes":3092},"dist/modules/text.props.js":{"imports":[],"exports":[],"entryPoint":"src/modules/text.props.ts","inputs":{"src/modules/text.props.ts":{"bytesInOutput":503}},"bytes":1435},"dist/modules/text.type.js":{"imports":[],"exports":[],"entryPoint":"src/modules/text.type.ts","inputs":{"src/modules/text.type.ts":{"bytesInOutput":78}},"bytes":778}}}
@@ -0,0 +1 @@
1
+ {"inputs":{"src/modules/text.props.ts":{"bytes":749,"imports":[{"path":"../modules/text.type","kind":"import-statement","external":true}],"format":"esm"},"src/text.tsx":{"bytes":1669,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/tokens","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true},{"path":"src/modules/text.props.ts","kind":"import-statement","original":"./modules/text.props"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.tsx":{"bytes":117,"imports":[{"path":"src/text.tsx","kind":"import-statement","original":"./text"}],"format":"esm"},"src/modules/text.type.ts":{"bytes":239,"imports":[],"format":"esm"}},"outputs":{"dist/index.mjs":{"imports":[{"path":"dist/chunk-MUU2JOPN.mjs","kind":"import-statement"},{"path":"dist/chunk-5REAQYN3.mjs","kind":"import-statement"}],"exports":["MpText"],"entryPoint":"src/index.tsx","inputs":{"src/index.tsx":{"bytesInOutput":0}},"bytes":101},"dist/text.mjs":{"imports":[{"path":"dist/chunk-MUU2JOPN.mjs","kind":"import-statement"},{"path":"dist/chunk-5REAQYN3.mjs","kind":"import-statement"}],"exports":["MpText"],"entryPoint":"src/text.tsx","inputs":{},"bytes":101},"dist/chunk-MUU2JOPN.mjs":{"imports":[{"path":"dist/chunk-5REAQYN3.mjs","kind":"import-statement"},{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/tokens","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true}],"exports":["MpText"],"inputs":{"src/text.tsx":{"bytesInOutput":1508}},"bytes":1609},"dist/modules/text.props.mjs":{"imports":[{"path":"dist/chunk-5REAQYN3.mjs","kind":"import-statement"}],"exports":["textProps"],"entryPoint":"src/modules/text.props.ts","inputs":{},"bytes":77},"dist/chunk-5REAQYN3.mjs":{"imports":[],"exports":["__name","textProps"],"inputs":{"src/modules/text.props.ts":{"bytesInOutput":359}},"bytes":553},"dist/modules/text.type.mjs":{"imports":[],"exports":[],"entryPoint":"src/modules/text.type.ts","inputs":{"src/modules/text.type.ts":{"bytesInOutput":0}},"bytes":0}}}
@@ -0,0 +1,34 @@
1
+ import { PropType } from 'vue';
2
+ import { FontSize, FontWeight } from './text.type.mjs';
3
+
4
+ declare const textProps: {
5
+ as: {
6
+ type: PropType<keyof HTMLElementTagNameMap>;
7
+ default: string;
8
+ };
9
+ size: {
10
+ type: PropType<FontSize>;
11
+ };
12
+ weight: {
13
+ type: PropType<FontWeight>;
14
+ };
15
+ color: {
16
+ type: PropType<string>;
17
+ default: string;
18
+ };
19
+ lineClamp: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ isStrike: {
24
+ type: BooleanConstructor;
25
+ };
26
+ isTextLink: {
27
+ type: BooleanConstructor;
28
+ };
29
+ isTruncated: {
30
+ type: BooleanConstructor;
31
+ };
32
+ };
33
+
34
+ export { textProps };
@@ -0,0 +1,34 @@
1
+ import { PropType } from 'vue';
2
+ import { FontSize, FontWeight } from './text.type.js';
3
+
4
+ declare const textProps: {
5
+ as: {
6
+ type: PropType<keyof HTMLElementTagNameMap>;
7
+ default: string;
8
+ };
9
+ size: {
10
+ type: PropType<FontSize>;
11
+ };
12
+ weight: {
13
+ type: PropType<FontWeight>;
14
+ };
15
+ color: {
16
+ type: PropType<string>;
17
+ default: string;
18
+ };
19
+ lineClamp: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ isStrike: {
24
+ type: BooleanConstructor;
25
+ };
26
+ isTextLink: {
27
+ type: BooleanConstructor;
28
+ };
29
+ isTruncated: {
30
+ type: BooleanConstructor;
31
+ };
32
+ };
33
+
34
+ export { textProps };
@@ -0,0 +1,58 @@
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 __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/modules/text.props.ts
21
+ var text_props_exports = {};
22
+ __export(text_props_exports, {
23
+ textProps: () => textProps
24
+ });
25
+ module.exports = __toCommonJS(text_props_exports);
26
+ var textProps = {
27
+ as: {
28
+ type: String,
29
+ default: "p"
30
+ },
31
+ size: {
32
+ type: String
33
+ },
34
+ weight: {
35
+ type: String
36
+ },
37
+ color: {
38
+ type: String,
39
+ default: "dark"
40
+ },
41
+ lineClamp: {
42
+ type: String,
43
+ default: "1"
44
+ },
45
+ isStrike: {
46
+ type: Boolean
47
+ },
48
+ isTextLink: {
49
+ type: Boolean
50
+ },
51
+ isTruncated: {
52
+ type: Boolean
53
+ }
54
+ };
55
+ // Annotate the CommonJS export names for ESM import in node:
56
+ 0 && (module.exports = {
57
+ textProps
58
+ });
@@ -0,0 +1,6 @@
1
+ import {
2
+ textProps
3
+ } from "../chunk-5REAQYN3.mjs";
4
+ export {
5
+ textProps
6
+ };
@@ -0,0 +1,4 @@
1
+ type FontSize = 'h1' | 'h2' | 'h3' | 'body-small' | 'body' | 'label' | 'label-small' | 'overline';
2
+ type FontWeight = 'regular' | 'semiBold';
3
+
4
+ export { FontSize, FontWeight };
@@ -0,0 +1,4 @@
1
+ type FontSize = 'h1' | 'h2' | 'h3' | 'body-small' | 'body' | 'label' | 'label-small' | 'overline';
2
+ type FontWeight = 'regular' | 'semiBold';
3
+
4
+ export { FontSize, FontWeight };
@@ -0,0 +1,18 @@
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 __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/modules/text.type.ts
17
+ var text_type_exports = {};
18
+ module.exports = __toCommonJS(text_type_exports);
File without changes
@@ -0,0 +1,69 @@
1
+ import { FontSize, FontWeight } from './modules/text.type.mjs';
2
+ import * as vue from 'vue';
3
+
4
+ declare const MpText: vue.DefineComponent<{
5
+ as: {
6
+ type: vue.PropType<keyof HTMLElementTagNameMap>;
7
+ default: string;
8
+ };
9
+ size: {
10
+ type: vue.PropType<FontSize>;
11
+ };
12
+ weight: {
13
+ type: vue.PropType<FontWeight>;
14
+ };
15
+ color: {
16
+ type: vue.PropType<string>;
17
+ default: string;
18
+ };
19
+ lineClamp: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ isStrike: {
24
+ type: BooleanConstructor;
25
+ };
26
+ isTextLink: {
27
+ type: BooleanConstructor;
28
+ };
29
+ isTruncated: {
30
+ type: BooleanConstructor;
31
+ };
32
+ }, () => JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
33
+ as: {
34
+ type: vue.PropType<keyof HTMLElementTagNameMap>;
35
+ default: string;
36
+ };
37
+ size: {
38
+ type: vue.PropType<FontSize>;
39
+ };
40
+ weight: {
41
+ type: vue.PropType<FontWeight>;
42
+ };
43
+ color: {
44
+ type: vue.PropType<string>;
45
+ default: string;
46
+ };
47
+ lineClamp: {
48
+ type: StringConstructor;
49
+ default: string;
50
+ };
51
+ isStrike: {
52
+ type: BooleanConstructor;
53
+ };
54
+ isTextLink: {
55
+ type: BooleanConstructor;
56
+ };
57
+ isTruncated: {
58
+ type: BooleanConstructor;
59
+ };
60
+ }>>, {
61
+ as: keyof HTMLElementTagNameMap;
62
+ color: string;
63
+ lineClamp: string;
64
+ isStrike: boolean;
65
+ isTextLink: boolean;
66
+ isTruncated: boolean;
67
+ }, {}>;
68
+
69
+ export { MpText };
package/dist/text.d.ts ADDED
@@ -0,0 +1,69 @@
1
+ import { FontSize, FontWeight } from './modules/text.type.js';
2
+ import * as vue from 'vue';
3
+
4
+ declare const MpText: vue.DefineComponent<{
5
+ as: {
6
+ type: vue.PropType<keyof HTMLElementTagNameMap>;
7
+ default: string;
8
+ };
9
+ size: {
10
+ type: vue.PropType<FontSize>;
11
+ };
12
+ weight: {
13
+ type: vue.PropType<FontWeight>;
14
+ };
15
+ color: {
16
+ type: vue.PropType<string>;
17
+ default: string;
18
+ };
19
+ lineClamp: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ isStrike: {
24
+ type: BooleanConstructor;
25
+ };
26
+ isTextLink: {
27
+ type: BooleanConstructor;
28
+ };
29
+ isTruncated: {
30
+ type: BooleanConstructor;
31
+ };
32
+ }, () => JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
33
+ as: {
34
+ type: vue.PropType<keyof HTMLElementTagNameMap>;
35
+ default: string;
36
+ };
37
+ size: {
38
+ type: vue.PropType<FontSize>;
39
+ };
40
+ weight: {
41
+ type: vue.PropType<FontWeight>;
42
+ };
43
+ color: {
44
+ type: vue.PropType<string>;
45
+ default: string;
46
+ };
47
+ lineClamp: {
48
+ type: StringConstructor;
49
+ default: string;
50
+ };
51
+ isStrike: {
52
+ type: BooleanConstructor;
53
+ };
54
+ isTextLink: {
55
+ type: BooleanConstructor;
56
+ };
57
+ isTruncated: {
58
+ type: BooleanConstructor;
59
+ };
60
+ }>>, {
61
+ as: keyof HTMLElementTagNameMap;
62
+ color: string;
63
+ lineClamp: string;
64
+ isStrike: boolean;
65
+ isTextLink: boolean;
66
+ isTruncated: boolean;
67
+ }, {}>;
68
+
69
+ export { MpText };
package/dist/text.js ADDED
@@ -0,0 +1,112 @@
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/text.tsx
22
+ var text_exports = {};
23
+ __export(text_exports, {
24
+ MpText: () => MpText
25
+ });
26
+ module.exports = __toCommonJS(text_exports);
27
+ var import_vue = require("vue");
28
+ var import_vue2 = require("vue");
29
+ var import_tokens = require("@mekari/pixel3-styled-system/tokens");
30
+ var import_recipes = require("@mekari/pixel3-styled-system/recipes");
31
+
32
+ // src/modules/text.props.ts
33
+ var textProps = {
34
+ as: {
35
+ type: String,
36
+ default: "p"
37
+ },
38
+ size: {
39
+ type: String
40
+ },
41
+ weight: {
42
+ type: String
43
+ },
44
+ color: {
45
+ type: String,
46
+ default: "dark"
47
+ },
48
+ lineClamp: {
49
+ type: String,
50
+ default: "1"
51
+ },
52
+ isStrike: {
53
+ type: Boolean
54
+ },
55
+ isTextLink: {
56
+ type: Boolean
57
+ },
58
+ isTruncated: {
59
+ type: Boolean
60
+ }
61
+ };
62
+
63
+ // src/text.tsx
64
+ function _isSlot(s) {
65
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, import_vue.isVNode)(s);
66
+ }
67
+ __name(_isSlot, "_isSlot");
68
+ var MpText = (0, import_vue2.defineComponent)({
69
+ name: "MpText",
70
+ props: textProps,
71
+ setup(props, {
72
+ slots
73
+ }) {
74
+ const classes = (0, import_recipes.textRecipe)({
75
+ size: props.size,
76
+ weight: props.weight
77
+ });
78
+ const handleStyleTruncate = /* @__PURE__ */ __name(() => {
79
+ return props.isTruncated && {
80
+ overflow: "hidden",
81
+ display: "-webkit-box",
82
+ "-webkit-line-clamp": props.lineClamp,
83
+ "-webkit-box-orient": "vertical"
84
+ };
85
+ }, "handleStyleTruncate");
86
+ return () => {
87
+ const children = slots.default && slots.default();
88
+ const {
89
+ as: Component,
90
+ color,
91
+ isStrike,
92
+ isTextLink
93
+ } = props;
94
+ return (0, import_vue.createVNode)(Component, {
95
+ "class": classes,
96
+ "data-pixel-component": "MpText",
97
+ "data-text-strike": isStrike ? true : void 0,
98
+ "data-text-link": isTextLink ? true : void 0,
99
+ "style": {
100
+ "--mp-text-color": (0, import_tokens.token)(`colors.${color}`) || color,
101
+ ...handleStyleTruncate()
102
+ }
103
+ }, _isSlot(children) ? children : {
104
+ default: () => [children]
105
+ });
106
+ };
107
+ }
108
+ });
109
+ // Annotate the CommonJS export names for ESM import in node:
110
+ 0 && (module.exports = {
111
+ MpText
112
+ });
package/dist/text.mjs ADDED
@@ -0,0 +1,7 @@
1
+ import {
2
+ MpText
3
+ } from "./chunk-MUU2JOPN.mjs";
4
+ import "./chunk-5REAQYN3.mjs";
5
+ export {
6
+ MpText
7
+ };
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@mekari/pixel3-text",
3
+ "description": "Text component for mekari pixel 3",
4
+ "version": "0.0.0",
5
+ "main": "dist/index.js",
6
+ "license": "MIT",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "dependencies": {
11
+ "@mekari/pixel3-styled-system": "0.0.0"
12
+ },
13
+ "peerDependencies": {
14
+ "vue": "^3.3.7"
15
+ },
16
+ "devDependencies": {
17
+ "vue": "^3.3.7"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "module": "dist/index.mjs",
23
+ "types": "dist/index.d.ts",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "require": "./dist/index.js",
28
+ "default": "./dist/index.mjs"
29
+ }
30
+ },
31
+ "scripts": {
32
+ "clean": "rimraf dist .turbo",
33
+ "build": "tsup && pnpm build:types",
34
+ "build:fast": "tsup",
35
+ "build:types": "tsup src --dts-only",
36
+ "build:external": "tsup src/index.tsx --external",
37
+ "types:check": "tsc --noEmit",
38
+ "replace-config": "clean-package",
39
+ "restore-config": "clean-package restore"
40
+ }
41
+ }