@mekari/pixel3-rating 0.0.1-dev.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,138 @@
1
+ import {
2
+ __name
3
+ } from "./chunk-QZ7VFGWC.mjs";
4
+
5
+ // src/modules/rating.hooks.ts
6
+ import { toRefs, computed, ref, watch } from "vue";
7
+ import { getUniqueId } from "@mekari/pixel3-utils";
8
+ import { ratingSlotRecipe } from "@mekari/pixel3-styled-system/recipes";
9
+ import { token } from "@mekari/pixel3-styled-system/tokens";
10
+ var ICON_STAR_PATH = "M11.9977 1.25C13.0469 1.25 13.8734 2.04226 14.4011 3.11146L16.1635 6.66513C16.217 6.77509 16.3436 6.92995 16.5341 7.07161C16.7243 7.21313 16.9106 7.2912 17.0332 7.3118L20.2232 7.84612C21.3754 8.03972 22.3412 8.60445 22.6548 9.58788C22.968 10.5705 22.5091 11.5915 21.6805 12.4216L21.6796 12.4225L19.2014 14.9209C19.1032 15.0199 18.9932 15.2065 18.9242 15.4495C18.8556 15.6908 18.8496 15.9106 18.8806 16.0527L19.5901 19.1454C19.8841 20.4318 19.7867 21.7073 18.8794 22.3742C17.969 23.0433 16.7249 22.7467 15.5946 22.0736L12.6043 20.289C12.4787 20.214 12.263 20.1532 12.0027 20.1532C11.7444 20.1532 11.5242 20.2132 11.3904 20.2909L8.40401 22.0732C7.27505 22.7487 6.03249 23.04 5.12202 22.3702C4.21532 21.7032 4.11294 20.43 4.40795 19.1447L5.11725 16.0527C5.14833 15.9107 5.14225 15.6908 5.07371 15.4495C5.00471 15.2065 4.89469 15.0199 4.79646 14.9209L2.31646 12.4207C1.49318 11.5907 1.03566 10.5704 1.34645 9.58923C1.65814 8.60521 2.62207 8.03979 3.77504 7.84606L6.96334 7.31202C7.08022 7.29177 7.26382 7.21456 7.45365 7.07266C7.64381 6.93051 7.77081 6.77532 7.82434 6.66513L9.58704 3.11094L9.58773 3.10954C10.1205 2.04102 10.9496 1.25 11.9977 1.25Z";
11
+ var ICON_HEART_PATH = "M7.56 2.25C4.06443 2.25 1.25 5.12533 1.25 8.65281C1.25 12.4387 2.98665 15.4297 5.06285 17.5808C7.12835 19.7209 9.57334 21.078 11.132 21.6168C11.4072 21.7143 11.7221 21.75 12 21.75C12.2779 21.75 12.5928 21.7143 12.868 21.6168C14.4267 21.078 16.8716 19.7209 18.9371 17.5808C21.0133 15.4297 22.75 12.4387 22.75 8.65281C22.75 5.12533 19.9356 2.25 16.44 2.25C15.2736 2.25 14.2461 2.85744 13.4328 3.55225C12.8969 4.01011 12.4142 4.54017 12.0004 5.04802C11.5876 4.54051 11.1064 4.01049 10.5714 3.55265C9.75846 2.85694 8.73097 2.25 7.56 2.25Z";
12
+ function useRating(props, emit) {
13
+ const {
14
+ id,
15
+ color,
16
+ modelValue,
17
+ maxValue,
18
+ variant,
19
+ isReadOnly
20
+ } = toRefs(props);
21
+ const getId = id.value || getUniqueId("", "rating").value;
22
+ const iconWidth = ref("0%");
23
+ const rating = ref(0);
24
+ const rootAttrs = computed(() => {
25
+ return {
26
+ "data-pixel-component": "MpRating",
27
+ id: getId,
28
+ class: ratingSlotRecipe().root,
29
+ style: {
30
+ cursor: isReadOnly.value ? "default" : "pointer"
31
+ },
32
+ onMouseleave: handleMouseLeave
33
+ };
34
+ });
35
+ const wrapperAttrs = computed(() => {
36
+ return {
37
+ class: ratingSlotRecipe().wrapper
38
+ };
39
+ });
40
+ const valueAttrs = computed(() => {
41
+ return {
42
+ class: ratingSlotRecipe().value
43
+ };
44
+ });
45
+ const backgroundIconWrapperAttrs = computed(() => {
46
+ return {
47
+ id: `${getId}--background-icon-wrapper`,
48
+ class: ratingSlotRecipe().backgroundIconWrapper
49
+ };
50
+ });
51
+ const activeIconWrapperAttrs = computed(() => {
52
+ return {
53
+ id: `${getId}--active-icon-wrapper`,
54
+ class: ratingSlotRecipe().activeIconWrapper,
55
+ style: {
56
+ width: iconWidth.value
57
+ }
58
+ };
59
+ });
60
+ const iconAttrs = /* @__PURE__ */ __name((i) => {
61
+ const propColor = token(`colors.${color.value}`) || color.value;
62
+ return {
63
+ id: `${getId}--icon-${i}`,
64
+ key: `icon-${i}`,
65
+ xmlns: "http://www.w3.org/2000/svg",
66
+ viewBox: "0 0 24 24",
67
+ innerHTML: `<path d="${getVariant.value}" fill="currentColor" />`,
68
+ "data-variant": variant.value,
69
+ style: {
70
+ color: propColor
71
+ },
72
+ onClick: () => handleClick(i),
73
+ onMouseenter: () => handleMMouseEnter(i)
74
+ };
75
+ }, "iconAttrs");
76
+ const getVariant = computed(() => {
77
+ if (variant.value === "heart") {
78
+ return ICON_HEART_PATH;
79
+ }
80
+ return ICON_STAR_PATH;
81
+ });
82
+ function handleWidth(value) {
83
+ const result = value / maxValue.value * 100;
84
+ if (value > maxValue.value) {
85
+ iconWidth.value = "100%";
86
+ } else if (value < 0) {
87
+ iconWidth.value = "0%";
88
+ } else {
89
+ iconWidth.value = `${result}%`;
90
+ }
91
+ }
92
+ __name(handleWidth, "handleWidth");
93
+ function handleClick(i) {
94
+ if (isReadOnly.value) {
95
+ return;
96
+ }
97
+ rating.value = i + 1;
98
+ emit("click-rating", rating.value);
99
+ emit("update:modelValue", rating.value);
100
+ }
101
+ __name(handleClick, "handleClick");
102
+ function handleMMouseEnter(i) {
103
+ if (isReadOnly.value) {
104
+ return;
105
+ }
106
+ rating.value = i + 1;
107
+ handleWidth(rating.value);
108
+ emit("hover-rating", rating.value);
109
+ }
110
+ __name(handleMMouseEnter, "handleMMouseEnter");
111
+ function handleMouseLeave() {
112
+ if (isReadOnly.value) {
113
+ return;
114
+ }
115
+ rating.value = modelValue.value;
116
+ handleWidth(rating.value);
117
+ emit("hover-rating", rating.value);
118
+ }
119
+ __name(handleMouseLeave, "handleMouseLeave");
120
+ watch(() => modelValue.value, (newValue) => {
121
+ handleWidth(newValue);
122
+ }, {
123
+ immediate: true
124
+ });
125
+ return {
126
+ rootAttrs,
127
+ wrapperAttrs,
128
+ valueAttrs,
129
+ backgroundIconWrapperAttrs,
130
+ activeIconWrapperAttrs,
131
+ iconAttrs
132
+ };
133
+ }
134
+ __name(useRating, "useRating");
135
+
136
+ export {
137
+ useRating
138
+ };
File without changes
@@ -0,0 +1,37 @@
1
+ // src/modules/rating.props.ts
2
+ var ratingProps = {
3
+ id: {
4
+ type: String,
5
+ default: ""
6
+ },
7
+ modelValue: {
8
+ type: Number,
9
+ default: 2
10
+ },
11
+ maxValue: {
12
+ type: Number,
13
+ default: 5
14
+ },
15
+ variant: {
16
+ type: String,
17
+ default: "star"
18
+ },
19
+ color: {
20
+ type: String,
21
+ default: ""
22
+ },
23
+ isShowValue: {
24
+ type: Boolean,
25
+ default: false
26
+ },
27
+ isReadOnly: {
28
+ type: Boolean,
29
+ default: false
30
+ }
31
+ };
32
+ var ratingEmit = ["click-rating", "hover-rating", "update:modelValue"];
33
+
34
+ export {
35
+ ratingProps,
36
+ ratingEmit
37
+ };
@@ -0,0 +1,6 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ export {
5
+ __name
6
+ };
@@ -0,0 +1,69 @@
1
+ import {
2
+ useRating
3
+ } from "./chunk-5G32PRK5.mjs";
4
+ import {
5
+ ratingEmit,
6
+ ratingProps
7
+ } from "./chunk-KTMGMPBN.mjs";
8
+ import {
9
+ __name
10
+ } from "./chunk-QZ7VFGWC.mjs";
11
+
12
+ // src/rating.tsx
13
+ import { isVNode as _isVNode, createTextVNode as _createTextVNode, Fragment as _Fragment, createVNode as _createVNode } from "vue";
14
+ import { defineComponent, h } from "vue";
15
+ import { MpText } from "@mekari/pixel3-text";
16
+ import { usePixelTheme } from "@mekari/pixel3-utils";
17
+ function _isSlot(s) {
18
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !_isVNode(s);
19
+ }
20
+ __name(_isSlot, "_isSlot");
21
+ var MpRating = defineComponent({
22
+ name: "MpRating",
23
+ props: ratingProps,
24
+ emit: ratingEmit,
25
+ setup(props, {
26
+ slots,
27
+ emit
28
+ }) {
29
+ const {
30
+ rootAttrs,
31
+ wrapperAttrs,
32
+ valueAttrs,
33
+ backgroundIconWrapperAttrs,
34
+ activeIconWrapperAttrs,
35
+ iconAttrs
36
+ } = useRating(props, emit);
37
+ return () => {
38
+ const children = slots.default && slots.default();
39
+ const {
40
+ modelValue,
41
+ maxValue,
42
+ isShowValue
43
+ } = props;
44
+ const {
45
+ isNextTheme
46
+ } = usePixelTheme();
47
+ const icon = [];
48
+ for (let i = 0; i < maxValue; i++) {
49
+ icon.push(h("svg", {
50
+ ...iconAttrs(i)
51
+ }));
52
+ }
53
+ return _createVNode("div", rootAttrs.value, [_createVNode("div", wrapperAttrs.value, [_createVNode("div", backgroundIconWrapperAttrs.value, [icon.map((icon2) => icon2)]), _createVNode("div", activeIconWrapperAttrs.value, [icon.map((icon2) => icon2)])]), isShowValue && _createVNode("div", valueAttrs.value, [children || _createVNode(_Fragment, null, [_createVNode(MpText, {
54
+ "weight": "semiBold"
55
+ }, {
56
+ default: () => [`${modelValue} /`, _createTextVNode("\xA0")]
57
+ }), _createVNode(MpText, {
58
+ "weight": "semiBold",
59
+ "color": isNextTheme ? "text.disabled" : "gray.400"
60
+ }, _isSlot(maxValue) ? maxValue : {
61
+ default: () => [maxValue]
62
+ })])])]);
63
+ };
64
+ }
65
+ });
66
+
67
+ export {
68
+ MpRating
69
+ };
@@ -0,0 +1,6 @@
1
+ export { MpRating } from './rating.mjs';
2
+ export { RatingVariant } from './modules/rating.types.mjs';
3
+ import 'vue/jsx-runtime';
4
+ import '@mekari/pixel3-utils';
5
+ import '@mekari/pixel3-styled-system/tokens';
6
+ import 'vue';
@@ -0,0 +1,6 @@
1
+ export { MpRating } from './rating.js';
2
+ export { RatingVariant } from './modules/rating.types.js';
3
+ import 'vue/jsx-runtime';
4
+ import '@mekari/pixel3-utils';
5
+ import '@mekari/pixel3-styled-system/tokens';
6
+ import 'vue';
package/dist/index.js ADDED
@@ -0,0 +1,253 @@
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.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ MpRating: () => MpRating
25
+ });
26
+ module.exports = __toCommonJS(src_exports);
27
+
28
+ // src/rating.tsx
29
+ var import_vue2 = require("vue");
30
+ var import_vue3 = require("vue");
31
+ var import_pixel3_text = require("@mekari/pixel3-text");
32
+
33
+ // src/modules/rating.hooks.ts
34
+ var import_vue = require("vue");
35
+ var import_pixel3_utils = require("@mekari/pixel3-utils");
36
+ var import_recipes = require("@mekari/pixel3-styled-system/recipes");
37
+ var import_tokens = require("@mekari/pixel3-styled-system/tokens");
38
+ var ICON_STAR_PATH = "M11.9977 1.25C13.0469 1.25 13.8734 2.04226 14.4011 3.11146L16.1635 6.66513C16.217 6.77509 16.3436 6.92995 16.5341 7.07161C16.7243 7.21313 16.9106 7.2912 17.0332 7.3118L20.2232 7.84612C21.3754 8.03972 22.3412 8.60445 22.6548 9.58788C22.968 10.5705 22.5091 11.5915 21.6805 12.4216L21.6796 12.4225L19.2014 14.9209C19.1032 15.0199 18.9932 15.2065 18.9242 15.4495C18.8556 15.6908 18.8496 15.9106 18.8806 16.0527L19.5901 19.1454C19.8841 20.4318 19.7867 21.7073 18.8794 22.3742C17.969 23.0433 16.7249 22.7467 15.5946 22.0736L12.6043 20.289C12.4787 20.214 12.263 20.1532 12.0027 20.1532C11.7444 20.1532 11.5242 20.2132 11.3904 20.2909L8.40401 22.0732C7.27505 22.7487 6.03249 23.04 5.12202 22.3702C4.21532 21.7032 4.11294 20.43 4.40795 19.1447L5.11725 16.0527C5.14833 15.9107 5.14225 15.6908 5.07371 15.4495C5.00471 15.2065 4.89469 15.0199 4.79646 14.9209L2.31646 12.4207C1.49318 11.5907 1.03566 10.5704 1.34645 9.58923C1.65814 8.60521 2.62207 8.03979 3.77504 7.84606L6.96334 7.31202C7.08022 7.29177 7.26382 7.21456 7.45365 7.07266C7.64381 6.93051 7.77081 6.77532 7.82434 6.66513L9.58704 3.11094L9.58773 3.10954C10.1205 2.04102 10.9496 1.25 11.9977 1.25Z";
39
+ var ICON_HEART_PATH = "M7.56 2.25C4.06443 2.25 1.25 5.12533 1.25 8.65281C1.25 12.4387 2.98665 15.4297 5.06285 17.5808C7.12835 19.7209 9.57334 21.078 11.132 21.6168C11.4072 21.7143 11.7221 21.75 12 21.75C12.2779 21.75 12.5928 21.7143 12.868 21.6168C14.4267 21.078 16.8716 19.7209 18.9371 17.5808C21.0133 15.4297 22.75 12.4387 22.75 8.65281C22.75 5.12533 19.9356 2.25 16.44 2.25C15.2736 2.25 14.2461 2.85744 13.4328 3.55225C12.8969 4.01011 12.4142 4.54017 12.0004 5.04802C11.5876 4.54051 11.1064 4.01049 10.5714 3.55265C9.75846 2.85694 8.73097 2.25 7.56 2.25Z";
40
+ function useRating(props, emit) {
41
+ const {
42
+ id,
43
+ color,
44
+ modelValue,
45
+ maxValue,
46
+ variant,
47
+ isReadOnly
48
+ } = (0, import_vue.toRefs)(props);
49
+ const getId = id.value || (0, import_pixel3_utils.getUniqueId)("", "rating").value;
50
+ const iconWidth = (0, import_vue.ref)("0%");
51
+ const rating = (0, import_vue.ref)(0);
52
+ const rootAttrs = (0, import_vue.computed)(() => {
53
+ return {
54
+ "data-pixel-component": "MpRating",
55
+ id: getId,
56
+ class: (0, import_recipes.ratingSlotRecipe)().root,
57
+ style: {
58
+ cursor: isReadOnly.value ? "default" : "pointer"
59
+ },
60
+ onMouseleave: handleMouseLeave
61
+ };
62
+ });
63
+ const wrapperAttrs = (0, import_vue.computed)(() => {
64
+ return {
65
+ class: (0, import_recipes.ratingSlotRecipe)().wrapper
66
+ };
67
+ });
68
+ const valueAttrs = (0, import_vue.computed)(() => {
69
+ return {
70
+ class: (0, import_recipes.ratingSlotRecipe)().value
71
+ };
72
+ });
73
+ const backgroundIconWrapperAttrs = (0, import_vue.computed)(() => {
74
+ return {
75
+ id: `${getId}--background-icon-wrapper`,
76
+ class: (0, import_recipes.ratingSlotRecipe)().backgroundIconWrapper
77
+ };
78
+ });
79
+ const activeIconWrapperAttrs = (0, import_vue.computed)(() => {
80
+ return {
81
+ id: `${getId}--active-icon-wrapper`,
82
+ class: (0, import_recipes.ratingSlotRecipe)().activeIconWrapper,
83
+ style: {
84
+ width: iconWidth.value
85
+ }
86
+ };
87
+ });
88
+ const iconAttrs = /* @__PURE__ */ __name((i) => {
89
+ const propColor = (0, import_tokens.token)(`colors.${color.value}`) || color.value;
90
+ return {
91
+ id: `${getId}--icon-${i}`,
92
+ key: `icon-${i}`,
93
+ xmlns: "http://www.w3.org/2000/svg",
94
+ viewBox: "0 0 24 24",
95
+ innerHTML: `<path d="${getVariant.value}" fill="currentColor" />`,
96
+ "data-variant": variant.value,
97
+ style: {
98
+ color: propColor
99
+ },
100
+ onClick: () => handleClick(i),
101
+ onMouseenter: () => handleMMouseEnter(i)
102
+ };
103
+ }, "iconAttrs");
104
+ const getVariant = (0, import_vue.computed)(() => {
105
+ if (variant.value === "heart") {
106
+ return ICON_HEART_PATH;
107
+ }
108
+ return ICON_STAR_PATH;
109
+ });
110
+ function handleWidth(value) {
111
+ const result = value / maxValue.value * 100;
112
+ if (value > maxValue.value) {
113
+ iconWidth.value = "100%";
114
+ } else if (value < 0) {
115
+ iconWidth.value = "0%";
116
+ } else {
117
+ iconWidth.value = `${result}%`;
118
+ }
119
+ }
120
+ __name(handleWidth, "handleWidth");
121
+ function handleClick(i) {
122
+ if (isReadOnly.value) {
123
+ return;
124
+ }
125
+ rating.value = i + 1;
126
+ emit("click-rating", rating.value);
127
+ emit("update:modelValue", rating.value);
128
+ }
129
+ __name(handleClick, "handleClick");
130
+ function handleMMouseEnter(i) {
131
+ if (isReadOnly.value) {
132
+ return;
133
+ }
134
+ rating.value = i + 1;
135
+ handleWidth(rating.value);
136
+ emit("hover-rating", rating.value);
137
+ }
138
+ __name(handleMMouseEnter, "handleMMouseEnter");
139
+ function handleMouseLeave() {
140
+ if (isReadOnly.value) {
141
+ return;
142
+ }
143
+ rating.value = modelValue.value;
144
+ handleWidth(rating.value);
145
+ emit("hover-rating", rating.value);
146
+ }
147
+ __name(handleMouseLeave, "handleMouseLeave");
148
+ (0, import_vue.watch)(() => modelValue.value, (newValue) => {
149
+ handleWidth(newValue);
150
+ }, {
151
+ immediate: true
152
+ });
153
+ return {
154
+ rootAttrs,
155
+ wrapperAttrs,
156
+ valueAttrs,
157
+ backgroundIconWrapperAttrs,
158
+ activeIconWrapperAttrs,
159
+ iconAttrs
160
+ };
161
+ }
162
+ __name(useRating, "useRating");
163
+
164
+ // src/rating.tsx
165
+ var import_pixel3_utils2 = require("@mekari/pixel3-utils");
166
+
167
+ // src/modules/rating.props.ts
168
+ var ratingProps = {
169
+ id: {
170
+ type: String,
171
+ default: ""
172
+ },
173
+ modelValue: {
174
+ type: Number,
175
+ default: 2
176
+ },
177
+ maxValue: {
178
+ type: Number,
179
+ default: 5
180
+ },
181
+ variant: {
182
+ type: String,
183
+ default: "star"
184
+ },
185
+ color: {
186
+ type: String,
187
+ default: ""
188
+ },
189
+ isShowValue: {
190
+ type: Boolean,
191
+ default: false
192
+ },
193
+ isReadOnly: {
194
+ type: Boolean,
195
+ default: false
196
+ }
197
+ };
198
+ var ratingEmit = ["click-rating", "hover-rating", "update:modelValue"];
199
+
200
+ // src/rating.tsx
201
+ function _isSlot(s) {
202
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, import_vue2.isVNode)(s);
203
+ }
204
+ __name(_isSlot, "_isSlot");
205
+ var MpRating = (0, import_vue3.defineComponent)({
206
+ name: "MpRating",
207
+ props: ratingProps,
208
+ emit: ratingEmit,
209
+ setup(props, {
210
+ slots,
211
+ emit
212
+ }) {
213
+ const {
214
+ rootAttrs,
215
+ wrapperAttrs,
216
+ valueAttrs,
217
+ backgroundIconWrapperAttrs,
218
+ activeIconWrapperAttrs,
219
+ iconAttrs
220
+ } = useRating(props, emit);
221
+ return () => {
222
+ const children = slots.default && slots.default();
223
+ const {
224
+ modelValue,
225
+ maxValue,
226
+ isShowValue
227
+ } = props;
228
+ const {
229
+ isNextTheme
230
+ } = (0, import_pixel3_utils2.usePixelTheme)();
231
+ const icon = [];
232
+ for (let i = 0; i < maxValue; i++) {
233
+ icon.push((0, import_vue3.h)("svg", {
234
+ ...iconAttrs(i)
235
+ }));
236
+ }
237
+ return (0, import_vue2.createVNode)("div", rootAttrs.value, [(0, import_vue2.createVNode)("div", wrapperAttrs.value, [(0, import_vue2.createVNode)("div", backgroundIconWrapperAttrs.value, [icon.map((icon2) => icon2)]), (0, import_vue2.createVNode)("div", activeIconWrapperAttrs.value, [icon.map((icon2) => icon2)])]), isShowValue && (0, import_vue2.createVNode)("div", valueAttrs.value, [children || (0, import_vue2.createVNode)(import_vue2.Fragment, null, [(0, import_vue2.createVNode)(import_pixel3_text.MpText, {
238
+ "weight": "semiBold"
239
+ }, {
240
+ default: () => [`${modelValue} /`, (0, import_vue2.createTextVNode)("\xA0")]
241
+ }), (0, import_vue2.createVNode)(import_pixel3_text.MpText, {
242
+ "weight": "semiBold",
243
+ "color": isNextTheme ? "text.disabled" : "gray.400"
244
+ }, _isSlot(maxValue) ? maxValue : {
245
+ default: () => [maxValue]
246
+ })])])]);
247
+ };
248
+ }
249
+ });
250
+ // Annotate the CommonJS export names for ESM import in node:
251
+ 0 && (module.exports = {
252
+ MpRating
253
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import {
2
+ MpRating
3
+ } from "./chunk-TMJBERQJ.mjs";
4
+ import "./chunk-5G32PRK5.mjs";
5
+ import "./chunk-KTMGMPBN.mjs";
6
+ import "./chunk-QZ7VFGWC.mjs";
7
+ import "./chunk-BCGH7ZIH.mjs";
8
+ export {
9
+ MpRating
10
+ };
@@ -0,0 +1 @@
1
+ {"inputs":{"src/modules/rating.hooks.ts":{"bytes":5303,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/tokens","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/modules/rating.props.ts":{"bytes":1133,"imports":[],"format":"esm"},"src/rating.tsx":{"bytes":2015,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-text","kind":"import-statement","external":true},{"path":"src/modules/rating.hooks.ts","kind":"import-statement","original":"./modules/rating.hooks"},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"src/modules/rating.props.ts","kind":"import-statement","original":"./modules/rating.props"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/modules/rating.types.ts":{"bytes":130,"imports":[],"format":"esm"},"src/index.ts":{"bytes":161,"imports":[{"path":"src/rating.tsx","kind":"import-statement","original":"./rating"},{"path":"src/modules/rating.types.ts","kind":"import-statement","original":"./modules/rating.types"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"vue","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-text","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-utils","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/tokens","kind":"require-call","external":true},{"path":"@mekari/pixel3-utils","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":121},"src/rating.tsx":{"bytesInOutput":2020},"src/modules/rating.hooks.ts":{"bytesInOutput":5376},"src/modules/rating.props.ts":{"bytesInOutput":472}},"bytes":9118},"dist/rating.js":{"imports":[{"path":"vue","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-text","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-utils","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/tokens","kind":"require-call","external":true},{"path":"@mekari/pixel3-utils","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/rating.tsx","inputs":{"src/rating.tsx":{"bytesInOutput":2150},"src/modules/rating.hooks.ts":{"bytesInOutput":5376},"src/modules/rating.props.ts":{"bytesInOutput":472}},"bytes":9110},"dist/modules/rating.hooks.js":{"imports":[{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-utils","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/tokens","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/modules/rating.hooks.ts","inputs":{"src/modules/rating.hooks.ts":{"bytesInOutput":5526}},"bytes":6550},"dist/modules/rating.props.js":{"imports":[],"exports":[],"entryPoint":"src/modules/rating.props.ts","inputs":{"src/modules/rating.props.ts":{"bytesInOutput":658}},"bytes":1608},"dist/modules/rating.types.js":{"imports":[],"exports":[],"entryPoint":"src/modules/rating.types.ts","inputs":{"src/modules/rating.types.ts":{"bytesInOutput":84}},"bytes":787}}}
@@ -0,0 +1 @@
1
+ {"inputs":{"src/modules/rating.hooks.ts":{"bytes":5303,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/tokens","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/modules/rating.props.ts":{"bytes":1133,"imports":[],"format":"esm"},"src/rating.tsx":{"bytes":2015,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-text","kind":"import-statement","external":true},{"path":"src/modules/rating.hooks.ts","kind":"import-statement","original":"./modules/rating.hooks"},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"src/modules/rating.props.ts","kind":"import-statement","original":"./modules/rating.props"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/modules/rating.types.ts":{"bytes":130,"imports":[],"format":"esm"},"src/index.ts":{"bytes":161,"imports":[{"path":"src/rating.tsx","kind":"import-statement","original":"./rating"},{"path":"src/modules/rating.types.ts","kind":"import-statement","original":"./modules/rating.types"}],"format":"esm"}},"outputs":{"dist/index.mjs":{"imports":[{"path":"dist/chunk-TMJBERQJ.mjs","kind":"import-statement"},{"path":"dist/chunk-5G32PRK5.mjs","kind":"import-statement"},{"path":"dist/chunk-KTMGMPBN.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"},{"path":"dist/chunk-BCGH7ZIH.mjs","kind":"import-statement"}],"exports":["MpRating"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":198},"dist/rating.mjs":{"imports":[{"path":"dist/chunk-TMJBERQJ.mjs","kind":"import-statement"},{"path":"dist/chunk-5G32PRK5.mjs","kind":"import-statement"},{"path":"dist/chunk-KTMGMPBN.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["MpRating"],"entryPoint":"src/rating.tsx","inputs":{},"bytes":167},"dist/chunk-TMJBERQJ.mjs":{"imports":[{"path":"dist/chunk-5G32PRK5.mjs","kind":"import-statement"},{"path":"dist/chunk-KTMGMPBN.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"},{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-text","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true}],"exports":["MpRating"],"inputs":{"src/rating.tsx":{"bytesInOutput":1840}},"bytes":2052},"dist/modules/rating.hooks.mjs":{"imports":[{"path":"dist/chunk-5G32PRK5.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["useRating"],"entryPoint":"src/modules/rating.hooks.ts","inputs":{},"bytes":109},"dist/chunk-5G32PRK5.mjs":{"imports":[{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/tokens","kind":"import-statement","external":true}],"exports":["useRating"],"inputs":{"src/modules/rating.hooks.ts":{"bytesInOutput":5080}},"bytes":5186},"dist/modules/rating.props.mjs":{"imports":[{"path":"dist/chunk-KTMGMPBN.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["ratingEmit","ratingProps"],"entryPoint":"src/modules/rating.props.ts","inputs":{},"bytes":141},"dist/chunk-KTMGMPBN.mjs":{"imports":[],"exports":["ratingEmit","ratingProps"],"inputs":{"src/modules/rating.props.ts":{"bytesInOutput":472}},"bytes":544},"dist/chunk-QZ7VFGWC.mjs":{"imports":[],"exports":["__name"],"inputs":{},"bytes":151},"dist/modules/rating.types.mjs":{"imports":[{"path":"dist/chunk-BCGH7ZIH.mjs","kind":"import-statement"}],"exports":[],"entryPoint":"src/modules/rating.types.ts","inputs":{},"bytes":32},"dist/chunk-BCGH7ZIH.mjs":{"imports":[],"exports":[],"inputs":{"src/modules/rating.types.ts":{"bytesInOutput":0}},"bytes":0}}}
@@ -0,0 +1,29 @@
1
+ import { RatingVariant } from './rating.types.mjs';
2
+ import * as vue from 'vue';
3
+ import { HTMLAttributes } from 'vue';
4
+ import { RatingProps, RatingEmits } from './rating.props.mjs';
5
+ import '@mekari/pixel3-styled-system/tokens';
6
+ import '@mekari/pixel3-utils';
7
+
8
+ declare function useRating(props: RatingProps, emit: RatingEmits): {
9
+ rootAttrs: vue.ComputedRef<HTMLAttributes>;
10
+ wrapperAttrs: vue.ComputedRef<HTMLAttributes>;
11
+ valueAttrs: vue.ComputedRef<HTMLAttributes>;
12
+ backgroundIconWrapperAttrs: vue.ComputedRef<HTMLAttributes>;
13
+ activeIconWrapperAttrs: vue.ComputedRef<HTMLAttributes>;
14
+ iconAttrs: (i: number) => {
15
+ id: string;
16
+ key: string;
17
+ xmlns: string;
18
+ viewBox: string;
19
+ innerHTML: string;
20
+ 'data-variant': RatingVariant;
21
+ style: {
22
+ color: string;
23
+ };
24
+ onClick: () => void;
25
+ onMouseenter: () => void;
26
+ };
27
+ };
28
+
29
+ export { useRating };
@@ -0,0 +1,29 @@
1
+ import { RatingVariant } from './rating.types.js';
2
+ import * as vue from 'vue';
3
+ import { HTMLAttributes } from 'vue';
4
+ import { RatingProps, RatingEmits } from './rating.props.js';
5
+ import '@mekari/pixel3-styled-system/tokens';
6
+ import '@mekari/pixel3-utils';
7
+
8
+ declare function useRating(props: RatingProps, emit: RatingEmits): {
9
+ rootAttrs: vue.ComputedRef<HTMLAttributes>;
10
+ wrapperAttrs: vue.ComputedRef<HTMLAttributes>;
11
+ valueAttrs: vue.ComputedRef<HTMLAttributes>;
12
+ backgroundIconWrapperAttrs: vue.ComputedRef<HTMLAttributes>;
13
+ activeIconWrapperAttrs: vue.ComputedRef<HTMLAttributes>;
14
+ iconAttrs: (i: number) => {
15
+ id: string;
16
+ key: string;
17
+ xmlns: string;
18
+ viewBox: string;
19
+ innerHTML: string;
20
+ 'data-variant': RatingVariant;
21
+ style: {
22
+ color: string;
23
+ };
24
+ onClick: () => void;
25
+ onMouseenter: () => void;
26
+ };
27
+ };
28
+
29
+ export { useRating };