@mekari/pixel3-radio 0.0.5 → 0.0.6-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-XSYT67DT.mjs → chunk-NU4BEO3I.mjs} +4 -3
- package/dist/index.js +4 -3
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/radio.js +4 -3
- package/dist/radio.mjs +1 -1
- package/package.json +5 -6
|
@@ -8,6 +8,7 @@ import { isVNode as _isVNode, createVNode as _createVNode, mergeProps as _mergeP
|
|
|
8
8
|
import { defineComponent } from "vue";
|
|
9
9
|
import { useFormControlContext } from "@mekari/pixel3-form-control";
|
|
10
10
|
import { MpText } from "@mekari/pixel3-text";
|
|
11
|
+
import { useId } from "@mekari/pixel3-utils";
|
|
11
12
|
import { radioSlotRecipe, sharedSlotRecipe } from "@mekari/pixel3-styled-system/recipes";
|
|
12
13
|
function _isSlot(s) {
|
|
13
14
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !_isVNode(s);
|
|
@@ -26,6 +27,7 @@ var MpRadio = defineComponent({
|
|
|
26
27
|
const classes = radioSlotRecipe();
|
|
27
28
|
const sharedClasses = sharedSlotRecipe();
|
|
28
29
|
const formControlProp = useFormControlContext();
|
|
30
|
+
const getId = props.id || `mp-radio-${useId()}`;
|
|
29
31
|
const handleChecked = /* @__PURE__ */ __name(() => {
|
|
30
32
|
if (props.modelValue) {
|
|
31
33
|
return props.modelValue === props.value;
|
|
@@ -46,7 +48,6 @@ var MpRadio = defineComponent({
|
|
|
46
48
|
const children = slots.default && slots.default();
|
|
47
49
|
const description = slots.description && slots.description();
|
|
48
50
|
const {
|
|
49
|
-
id,
|
|
50
51
|
name,
|
|
51
52
|
value,
|
|
52
53
|
isDisabled,
|
|
@@ -54,7 +55,7 @@ var MpRadio = defineComponent({
|
|
|
54
55
|
isReadOnly
|
|
55
56
|
} = props;
|
|
56
57
|
return _createVNode("label", {
|
|
57
|
-
"for":
|
|
58
|
+
"for": getId,
|
|
58
59
|
"role": "radio",
|
|
59
60
|
"class": classes.root,
|
|
60
61
|
"data-pixel-component": "MpRadio",
|
|
@@ -64,7 +65,7 @@ var MpRadio = defineComponent({
|
|
|
64
65
|
"aria-invalid": (formControlProp == null ? void 0 : formControlProp.value.isInvalid) || isInvalid,
|
|
65
66
|
"aria-readonly": (formControlProp == null ? void 0 : formControlProp.value.isReadOnly) || isReadOnly
|
|
66
67
|
}, [_createVNode("input", _mergeProps({
|
|
67
|
-
"id":
|
|
68
|
+
"id": getId,
|
|
68
69
|
"class": sharedClasses.hidden,
|
|
69
70
|
"type": "radio",
|
|
70
71
|
"name": name,
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ var import_vue = require("vue");
|
|
|
30
30
|
var import_vue2 = require("vue");
|
|
31
31
|
var import_pixel3_form_control = require("@mekari/pixel3-form-control");
|
|
32
32
|
var import_pixel3_text = require("@mekari/pixel3-text");
|
|
33
|
+
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
33
34
|
var import_recipes = require("@mekari/pixel3-styled-system/recipes");
|
|
34
35
|
|
|
35
36
|
// src/modules/radio.props.ts
|
|
@@ -79,6 +80,7 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
79
80
|
const classes = (0, import_recipes.radioSlotRecipe)();
|
|
80
81
|
const sharedClasses = (0, import_recipes.sharedSlotRecipe)();
|
|
81
82
|
const formControlProp = (0, import_pixel3_form_control.useFormControlContext)();
|
|
83
|
+
const getId = props.id || `mp-radio-${(0, import_pixel3_utils.useId)()}`;
|
|
82
84
|
const handleChecked = /* @__PURE__ */ __name(() => {
|
|
83
85
|
if (props.modelValue) {
|
|
84
86
|
return props.modelValue === props.value;
|
|
@@ -99,7 +101,6 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
99
101
|
const children = slots.default && slots.default();
|
|
100
102
|
const description = slots.description && slots.description();
|
|
101
103
|
const {
|
|
102
|
-
id,
|
|
103
104
|
name,
|
|
104
105
|
value,
|
|
105
106
|
isDisabled,
|
|
@@ -107,7 +108,7 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
107
108
|
isReadOnly
|
|
108
109
|
} = props;
|
|
109
110
|
return (0, import_vue.createVNode)("label", {
|
|
110
|
-
"for":
|
|
111
|
+
"for": getId,
|
|
111
112
|
"role": "radio",
|
|
112
113
|
"class": classes.root,
|
|
113
114
|
"data-pixel-component": "MpRadio",
|
|
@@ -117,7 +118,7 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
117
118
|
"aria-invalid": (formControlProp == null ? void 0 : formControlProp.value.isInvalid) || isInvalid,
|
|
118
119
|
"aria-readonly": (formControlProp == null ? void 0 : formControlProp.value.isReadOnly) || isReadOnly
|
|
119
120
|
}, [(0, import_vue.createVNode)("input", (0, import_vue.mergeProps)({
|
|
120
|
-
"id":
|
|
121
|
+
"id": getId,
|
|
121
122
|
"class": sharedClasses.hidden,
|
|
122
123
|
"type": "radio",
|
|
123
124
|
"name": name,
|
package/dist/index.mjs
CHANGED
package/dist/metafile-cjs.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/modules/radio.props.ts":{"bytes":434,"imports":[],"format":"esm"},"src/radio.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/modules/radio.props.ts":{"bytes":434,"imports":[],"format":"esm"},"src/radio.tsx":{"bytes":3461,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-form-control","kind":"import-statement","external":true},{"path":"@mekari/pixel3-text","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":"src/modules/radio.props.ts","kind":"import-statement","original":"./modules/radio.props"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":119,"imports":[{"path":"src/radio.tsx","kind":"import-statement","original":"./radio"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"vue","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-form-control","kind":"require-call","external":true},{"path":"@mekari/pixel3-text","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}],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":119},"src/radio.tsx":{"bytesInOutput":3847},"src/modules/radio.props.ts":{"bytesInOutput":325}},"bytes":5365},"dist/radio.js":{"imports":[{"path":"vue","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-form-control","kind":"require-call","external":true},{"path":"@mekari/pixel3-text","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}],"exports":[],"entryPoint":"src/radio.tsx","inputs":{"src/radio.tsx":{"bytesInOutput":3972},"src/modules/radio.props.ts":{"bytesInOutput":325}},"bytes":5354},"dist/modules/radio.props.js":{"imports":[],"exports":[],"entryPoint":"src/modules/radio.props.ts","inputs":{"src/modules/radio.props.ts":{"bytesInOutput":474}},"bytes":1408}}}
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/modules/radio.props.ts":{"bytes":434,"imports":[],"format":"esm"},"src/radio.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/modules/radio.props.ts":{"bytes":434,"imports":[],"format":"esm"},"src/radio.tsx":{"bytes":3461,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-form-control","kind":"import-statement","external":true},{"path":"@mekari/pixel3-text","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":"src/modules/radio.props.ts","kind":"import-statement","original":"./modules/radio.props"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":119,"imports":[{"path":"src/radio.tsx","kind":"import-statement","original":"./radio"}],"format":"esm"}},"outputs":{"dist/index.mjs":{"imports":[{"path":"dist/chunk-NU4BEO3I.mjs","kind":"import-statement"},{"path":"dist/chunk-PXWY2WNA.mjs","kind":"import-statement"}],"exports":["MpRadio"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":103},"dist/radio.mjs":{"imports":[{"path":"dist/chunk-NU4BEO3I.mjs","kind":"import-statement"},{"path":"dist/chunk-PXWY2WNA.mjs","kind":"import-statement"}],"exports":["MpRadio"],"entryPoint":"src/radio.tsx","inputs":{},"bytes":103},"dist/chunk-NU4BEO3I.mjs":{"imports":[{"path":"dist/chunk-PXWY2WNA.mjs","kind":"import-statement"},{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-form-control","kind":"import-statement","external":true},{"path":"@mekari/pixel3-text","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}],"exports":["MpRadio"],"inputs":{"src/radio.tsx":{"bytesInOutput":3623}},"bytes":3727},"dist/modules/radio.props.mjs":{"imports":[{"path":"dist/chunk-PXWY2WNA.mjs","kind":"import-statement"}],"exports":["radioProps"],"entryPoint":"src/modules/radio.props.ts","inputs":{},"bytes":79},"dist/chunk-PXWY2WNA.mjs":{"imports":[],"exports":["__name","radioProps"],"inputs":{"src/modules/radio.props.ts":{"bytesInOutput":325}},"bytes":521}}}
|
package/dist/radio.js
CHANGED
|
@@ -28,6 +28,7 @@ var import_vue = require("vue");
|
|
|
28
28
|
var import_vue2 = require("vue");
|
|
29
29
|
var import_pixel3_form_control = require("@mekari/pixel3-form-control");
|
|
30
30
|
var import_pixel3_text = require("@mekari/pixel3-text");
|
|
31
|
+
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
31
32
|
var import_recipes = require("@mekari/pixel3-styled-system/recipes");
|
|
32
33
|
|
|
33
34
|
// src/modules/radio.props.ts
|
|
@@ -77,6 +78,7 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
77
78
|
const classes = (0, import_recipes.radioSlotRecipe)();
|
|
78
79
|
const sharedClasses = (0, import_recipes.sharedSlotRecipe)();
|
|
79
80
|
const formControlProp = (0, import_pixel3_form_control.useFormControlContext)();
|
|
81
|
+
const getId = props.id || `mp-radio-${(0, import_pixel3_utils.useId)()}`;
|
|
80
82
|
const handleChecked = /* @__PURE__ */ __name(() => {
|
|
81
83
|
if (props.modelValue) {
|
|
82
84
|
return props.modelValue === props.value;
|
|
@@ -97,7 +99,6 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
97
99
|
const children = slots.default && slots.default();
|
|
98
100
|
const description = slots.description && slots.description();
|
|
99
101
|
const {
|
|
100
|
-
id,
|
|
101
102
|
name,
|
|
102
103
|
value,
|
|
103
104
|
isDisabled,
|
|
@@ -105,7 +106,7 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
105
106
|
isReadOnly
|
|
106
107
|
} = props;
|
|
107
108
|
return (0, import_vue.createVNode)("label", {
|
|
108
|
-
"for":
|
|
109
|
+
"for": getId,
|
|
109
110
|
"role": "radio",
|
|
110
111
|
"class": classes.root,
|
|
111
112
|
"data-pixel-component": "MpRadio",
|
|
@@ -115,7 +116,7 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
115
116
|
"aria-invalid": (formControlProp == null ? void 0 : formControlProp.value.isInvalid) || isInvalid,
|
|
116
117
|
"aria-readonly": (formControlProp == null ? void 0 : formControlProp.value.isReadOnly) || isReadOnly
|
|
117
118
|
}, [(0, import_vue.createVNode)("input", (0, import_vue.mergeProps)({
|
|
118
|
-
"id":
|
|
119
|
+
"id": getId,
|
|
119
120
|
"class": sharedClasses.hidden,
|
|
120
121
|
"type": "radio",
|
|
121
122
|
"name": name,
|
package/dist/radio.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mekari/pixel3-radio",
|
|
3
3
|
"description": "Radio component for mekari pixel 3",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.6-dev.1",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@mekari/pixel3-form-control": "0.0.
|
|
12
|
-
"@mekari/pixel3-text": "0.0.
|
|
13
|
-
"@mekari/pixel3-
|
|
14
|
-
"@mekari/pixel3-
|
|
11
|
+
"@mekari/pixel3-form-control": "0.0.6-dev.1",
|
|
12
|
+
"@mekari/pixel3-text": "0.0.6-dev.1",
|
|
13
|
+
"@mekari/pixel3-utils": "0.0.4",
|
|
14
|
+
"@mekari/pixel3-styled-system": "0.0.4-dev.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"vue": "^3.4.9"
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"build": "tsup && pnpm build:types",
|
|
37
37
|
"build:fast": "tsup",
|
|
38
38
|
"build:types": "tsup src --dts-only",
|
|
39
|
-
"build:external": "tsup src/index.tsx --external",
|
|
40
39
|
"types:check": "tsc --noEmit",
|
|
41
40
|
"replace-config": "clean-package",
|
|
42
41
|
"restore-config": "clean-package restore"
|