@mekari/pixel3-radio 0.0.15 → 0.0.16-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-NU4BEO3I.mjs → chunk-3SXTN65K.mjs} +18 -5
- package/dist/index.js +17 -4
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/radio.js +17 -4
- package/dist/radio.mjs +1 -1
- package/package.json +7 -6
|
@@ -8,7 +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
|
+
import { useId, usePixelTheme } from "@mekari/pixel3-utils";
|
|
12
12
|
import { radioSlotRecipe, sharedSlotRecipe } from "@mekari/pixel3-styled-system/recipes";
|
|
13
13
|
function _isSlot(s) {
|
|
14
14
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !_isVNode(s);
|
|
@@ -24,6 +24,9 @@ var MpRadio = defineComponent({
|
|
|
24
24
|
emit,
|
|
25
25
|
attrs
|
|
26
26
|
}) {
|
|
27
|
+
const {
|
|
28
|
+
isNextTheme
|
|
29
|
+
} = usePixelTheme();
|
|
27
30
|
const classes = radioSlotRecipe();
|
|
28
31
|
const sharedClasses = sharedSlotRecipe();
|
|
29
32
|
const formControlProp = useFormControlContext();
|
|
@@ -54,6 +57,18 @@ var MpRadio = defineComponent({
|
|
|
54
57
|
isInvalid,
|
|
55
58
|
isReadOnly
|
|
56
59
|
} = props;
|
|
60
|
+
const isRadioDisabled = (formControlProp == null ? void 0 : formControlProp.value.isDisabled) || isDisabled;
|
|
61
|
+
const themeBasedColors = isNextTheme.value ? {
|
|
62
|
+
disabled: "text.disabled",
|
|
63
|
+
default: "text.default",
|
|
64
|
+
secondary: "text.secondary"
|
|
65
|
+
} : {
|
|
66
|
+
disabled: "gray.400",
|
|
67
|
+
default: "dark",
|
|
68
|
+
secondary: "gray.600"
|
|
69
|
+
};
|
|
70
|
+
const labelColor = isRadioDisabled ? themeBasedColors.disabled : themeBasedColors.default;
|
|
71
|
+
const captionColor = isRadioDisabled ? themeBasedColors.disabled : themeBasedColors.secondary;
|
|
57
72
|
return _createVNode("label", {
|
|
58
73
|
"for": getId,
|
|
59
74
|
"role": "radio",
|
|
@@ -83,13 +98,11 @@ var MpRadio = defineComponent({
|
|
|
83
98
|
}, null)]), _createVNode("div", {
|
|
84
99
|
"class": classes.label
|
|
85
100
|
}, [_createVNode(MpText, {
|
|
86
|
-
"
|
|
87
|
-
"size": "label",
|
|
88
|
-
"color": (formControlProp == null ? void 0 : formControlProp.value.isDisabled) || isDisabled ? "gray.400" : "dark"
|
|
101
|
+
"color": labelColor
|
|
89
102
|
}, _isSlot(children) ? children : {
|
|
90
103
|
default: () => [children]
|
|
91
104
|
}), description && _createVNode(MpText, {
|
|
92
|
-
"color":
|
|
105
|
+
"color": captionColor
|
|
93
106
|
}, _isSlot(description) ? description : {
|
|
94
107
|
default: () => [description]
|
|
95
108
|
})])]);
|
package/dist/index.js
CHANGED
|
@@ -77,6 +77,9 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
77
77
|
emit,
|
|
78
78
|
attrs
|
|
79
79
|
}) {
|
|
80
|
+
const {
|
|
81
|
+
isNextTheme
|
|
82
|
+
} = (0, import_pixel3_utils.usePixelTheme)();
|
|
80
83
|
const classes = (0, import_recipes.radioSlotRecipe)();
|
|
81
84
|
const sharedClasses = (0, import_recipes.sharedSlotRecipe)();
|
|
82
85
|
const formControlProp = (0, import_pixel3_form_control.useFormControlContext)();
|
|
@@ -107,6 +110,18 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
107
110
|
isInvalid,
|
|
108
111
|
isReadOnly
|
|
109
112
|
} = props;
|
|
113
|
+
const isRadioDisabled = (formControlProp == null ? void 0 : formControlProp.value.isDisabled) || isDisabled;
|
|
114
|
+
const themeBasedColors = isNextTheme.value ? {
|
|
115
|
+
disabled: "text.disabled",
|
|
116
|
+
default: "text.default",
|
|
117
|
+
secondary: "text.secondary"
|
|
118
|
+
} : {
|
|
119
|
+
disabled: "gray.400",
|
|
120
|
+
default: "dark",
|
|
121
|
+
secondary: "gray.600"
|
|
122
|
+
};
|
|
123
|
+
const labelColor = isRadioDisabled ? themeBasedColors.disabled : themeBasedColors.default;
|
|
124
|
+
const captionColor = isRadioDisabled ? themeBasedColors.disabled : themeBasedColors.secondary;
|
|
110
125
|
return (0, import_vue.createVNode)("label", {
|
|
111
126
|
"for": getId,
|
|
112
127
|
"role": "radio",
|
|
@@ -136,13 +151,11 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
136
151
|
}, null)]), (0, import_vue.createVNode)("div", {
|
|
137
152
|
"class": classes.label
|
|
138
153
|
}, [(0, import_vue.createVNode)(import_pixel3_text.MpText, {
|
|
139
|
-
"
|
|
140
|
-
"size": "label",
|
|
141
|
-
"color": (formControlProp == null ? void 0 : formControlProp.value.isDisabled) || isDisabled ? "gray.400" : "dark"
|
|
154
|
+
"color": labelColor
|
|
142
155
|
}, _isSlot(children) ? children : {
|
|
143
156
|
default: () => [children]
|
|
144
157
|
}), description && (0, import_vue.createVNode)(import_pixel3_text.MpText, {
|
|
145
|
-
"color":
|
|
158
|
+
"color": captionColor
|
|
146
159
|
}, _isSlot(description) ? description : {
|
|
147
160
|
default: () => [description]
|
|
148
161
|
})])]);
|
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":3904,"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":4264},"src/modules/radio.props.ts":{"bytesInOutput":325}},"bytes":5782},"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":4389},"src/modules/radio.props.ts":{"bytesInOutput":325}},"bytes":5771},"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":3904,"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-3SXTN65K.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-3SXTN65K.mjs","kind":"import-statement"},{"path":"dist/chunk-PXWY2WNA.mjs","kind":"import-statement"}],"exports":["MpRadio"],"entryPoint":"src/radio.tsx","inputs":{},"bytes":103},"dist/chunk-3SXTN65K.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":4030}},"bytes":4134},"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
|
@@ -75,6 +75,9 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
75
75
|
emit,
|
|
76
76
|
attrs
|
|
77
77
|
}) {
|
|
78
|
+
const {
|
|
79
|
+
isNextTheme
|
|
80
|
+
} = (0, import_pixel3_utils.usePixelTheme)();
|
|
78
81
|
const classes = (0, import_recipes.radioSlotRecipe)();
|
|
79
82
|
const sharedClasses = (0, import_recipes.sharedSlotRecipe)();
|
|
80
83
|
const formControlProp = (0, import_pixel3_form_control.useFormControlContext)();
|
|
@@ -105,6 +108,18 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
105
108
|
isInvalid,
|
|
106
109
|
isReadOnly
|
|
107
110
|
} = props;
|
|
111
|
+
const isRadioDisabled = (formControlProp == null ? void 0 : formControlProp.value.isDisabled) || isDisabled;
|
|
112
|
+
const themeBasedColors = isNextTheme.value ? {
|
|
113
|
+
disabled: "text.disabled",
|
|
114
|
+
default: "text.default",
|
|
115
|
+
secondary: "text.secondary"
|
|
116
|
+
} : {
|
|
117
|
+
disabled: "gray.400",
|
|
118
|
+
default: "dark",
|
|
119
|
+
secondary: "gray.600"
|
|
120
|
+
};
|
|
121
|
+
const labelColor = isRadioDisabled ? themeBasedColors.disabled : themeBasedColors.default;
|
|
122
|
+
const captionColor = isRadioDisabled ? themeBasedColors.disabled : themeBasedColors.secondary;
|
|
108
123
|
return (0, import_vue.createVNode)("label", {
|
|
109
124
|
"for": getId,
|
|
110
125
|
"role": "radio",
|
|
@@ -134,13 +149,11 @@ var MpRadio = (0, import_vue2.defineComponent)({
|
|
|
134
149
|
}, null)]), (0, import_vue.createVNode)("div", {
|
|
135
150
|
"class": classes.label
|
|
136
151
|
}, [(0, import_vue.createVNode)(import_pixel3_text.MpText, {
|
|
137
|
-
"
|
|
138
|
-
"size": "label",
|
|
139
|
-
"color": (formControlProp == null ? void 0 : formControlProp.value.isDisabled) || isDisabled ? "gray.400" : "dark"
|
|
152
|
+
"color": labelColor
|
|
140
153
|
}, _isSlot(children) ? children : {
|
|
141
154
|
default: () => [children]
|
|
142
155
|
}), description && (0, import_vue.createVNode)(import_pixel3_text.MpText, {
|
|
143
|
-
"color":
|
|
156
|
+
"color": captionColor
|
|
144
157
|
}, _isSlot(description) ? description : {
|
|
145
158
|
default: () => [description]
|
|
146
159
|
})])]);
|
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.16-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-styled-system": "0.1.1",
|
|
14
|
-
"@mekari/pixel3-utils": "0.0.
|
|
11
|
+
"@mekari/pixel3-form-control": "0.0.16-dev.1",
|
|
12
|
+
"@mekari/pixel3-text": "0.0.16-dev.1",
|
|
13
|
+
"@mekari/pixel3-styled-system": "0.1.2-dev.1",
|
|
14
|
+
"@mekari/pixel3-utils": "0.0.7-dev.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"vue": "^3.4.9"
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"build:types": "tsup src --dts-only",
|
|
39
39
|
"types:check": "tsc --noEmit",
|
|
40
40
|
"replace-config": "clean-package",
|
|
41
|
-
"restore-config": "clean-package restore"
|
|
41
|
+
"restore-config": "clean-package restore",
|
|
42
|
+
"types:vue": "vue-tsc --noEmit"
|
|
42
43
|
}
|
|
43
44
|
}
|