moldekit-react 0.0.2 → 0.0.4
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/index.cjs +6 -5
- package/dist/index.js +6 -5
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -16,7 +16,7 @@ function MkButton({
|
|
|
16
16
|
children,
|
|
17
17
|
...props
|
|
18
18
|
}) {
|
|
19
|
-
const baseStyles = "flex items-center justify-center text-center rounded-[7px] uppercase focus:outline-none transition-colors duration-
|
|
19
|
+
const baseStyles = "flex items-center justify-center text-center rounded-[7px] uppercase focus:outline-none transition-colors duration-300 disabled:pointer-events-none disabled:cursor-not-allowed";
|
|
20
20
|
const variantStyles = {
|
|
21
21
|
filled: "font-medium rounded-[7px] uppercase focus:outline-none transition-colors duration-300 disabled:pointer-events-none disabled:cursor-not-allowed",
|
|
22
22
|
outlined: "font-medium rounded-[7px] uppercase border focus:outline-none transition-colors duration-300 disabled:pointer-events-none disabled:cursor-not-allowed",
|
|
@@ -52,16 +52,17 @@ function MkButton({
|
|
|
52
52
|
medium: "px-4 py-2 text-base",
|
|
53
53
|
large: "px-6 py-3 text-lg"
|
|
54
54
|
};
|
|
55
|
-
const variantStyleClass = variantStyles[variant];
|
|
56
|
-
const
|
|
57
|
-
const
|
|
55
|
+
const variantStyleClass = variantStyles[variant] ?? "";
|
|
56
|
+
const variantColorMap = colorStyles[variant] ?? {};
|
|
57
|
+
const colorStyleClass = variantColorMap[color] ?? "";
|
|
58
|
+
const sizeStyleClass = variant === "iconOnly" ? "p-2 w-10 h-10" : sizeStyles[size] ?? "";
|
|
58
59
|
const fullWidthClass = fullWidth ? "w-full" : "";
|
|
59
60
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
60
61
|
"button",
|
|
61
62
|
{
|
|
62
63
|
type: "button",
|
|
63
64
|
disabled,
|
|
64
|
-
className: `${baseStyles}
|
|
65
|
+
className: `${baseStyles}
|
|
65
66
|
${variantStyleClass}
|
|
66
67
|
${colorStyleClass}
|
|
67
68
|
${sizeStyleClass}
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ function MkButton({
|
|
|
12
12
|
children,
|
|
13
13
|
...props
|
|
14
14
|
}) {
|
|
15
|
-
const baseStyles = "flex items-center justify-center text-center rounded-[7px] uppercase focus:outline-none transition-colors duration-
|
|
15
|
+
const baseStyles = "flex items-center justify-center text-center rounded-[7px] uppercase focus:outline-none transition-colors duration-300 disabled:pointer-events-none disabled:cursor-not-allowed";
|
|
16
16
|
const variantStyles = {
|
|
17
17
|
filled: "font-medium rounded-[7px] uppercase focus:outline-none transition-colors duration-300 disabled:pointer-events-none disabled:cursor-not-allowed",
|
|
18
18
|
outlined: "font-medium rounded-[7px] uppercase border focus:outline-none transition-colors duration-300 disabled:pointer-events-none disabled:cursor-not-allowed",
|
|
@@ -48,16 +48,17 @@ function MkButton({
|
|
|
48
48
|
medium: "px-4 py-2 text-base",
|
|
49
49
|
large: "px-6 py-3 text-lg"
|
|
50
50
|
};
|
|
51
|
-
const variantStyleClass = variantStyles[variant];
|
|
52
|
-
const
|
|
53
|
-
const
|
|
51
|
+
const variantStyleClass = variantStyles[variant] ?? "";
|
|
52
|
+
const variantColorMap = colorStyles[variant] ?? {};
|
|
53
|
+
const colorStyleClass = variantColorMap[color] ?? "";
|
|
54
|
+
const sizeStyleClass = variant === "iconOnly" ? "p-2 w-10 h-10" : sizeStyles[size] ?? "";
|
|
54
55
|
const fullWidthClass = fullWidth ? "w-full" : "";
|
|
55
56
|
return /* @__PURE__ */ jsxs(
|
|
56
57
|
"button",
|
|
57
58
|
{
|
|
58
59
|
type: "button",
|
|
59
60
|
disabled,
|
|
60
|
-
className: `${baseStyles}
|
|
61
|
+
className: `${baseStyles}
|
|
61
62
|
${variantStyleClass}
|
|
62
63
|
${colorStyleClass}
|
|
63
64
|
${sizeStyleClass}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moldekit-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"license": "GPL-3.0-only",
|
|
5
5
|
"author": "Anderson Nieves",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"lint": "eslint .",
|
|
28
28
|
"dev": "storybook dev -p 6006",
|
|
29
29
|
"test": "vitest",
|
|
30
|
-
"build:lib": "tsc && vite build",
|
|
30
|
+
"build:lib": "tsc -p tsconfig.build.json && vite build",
|
|
31
31
|
"build:storybook": "storybook build"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|