@dream-big/ghatak-core-components 1.0.0 → 1.1.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.
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +23 -5
- package/dist/index.mjs +23 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
|
|
3
4
|
interface ButtonProps {
|
|
4
|
-
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
variant?: "primary" | "secondary";
|
|
7
|
+
size?: "sm" | "md" | "lg";
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onClick?: () => void;
|
|
5
10
|
}
|
|
6
|
-
declare function Button({
|
|
11
|
+
declare function Button({ children, variant, size, disabled, onClick, }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
7
12
|
|
|
8
13
|
export { Button, type ButtonProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
|
|
3
4
|
interface ButtonProps {
|
|
4
|
-
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
variant?: "primary" | "secondary";
|
|
7
|
+
size?: "sm" | "md" | "lg";
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onClick?: () => void;
|
|
5
10
|
}
|
|
6
|
-
declare function Button({
|
|
11
|
+
declare function Button({ children, variant, size, disabled, onClick, }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
7
12
|
|
|
8
13
|
export { Button, type ButtonProps };
|
package/dist/index.js
CHANGED
|
@@ -26,19 +26,37 @@ module.exports = __toCommonJS(index_exports);
|
|
|
26
26
|
|
|
27
27
|
// src/Button.tsx
|
|
28
28
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
-
function Button({
|
|
29
|
+
function Button({
|
|
30
|
+
children,
|
|
31
|
+
variant = "primary",
|
|
32
|
+
size = "md",
|
|
33
|
+
disabled = false,
|
|
34
|
+
onClick
|
|
35
|
+
}) {
|
|
36
|
+
const colors = {
|
|
37
|
+
primary: "#1976d2",
|
|
38
|
+
secondary: "#9c27b0"
|
|
39
|
+
};
|
|
40
|
+
const paddings = {
|
|
41
|
+
sm: "6px 12px",
|
|
42
|
+
md: "10px 16px",
|
|
43
|
+
lg: "14px 20px"
|
|
44
|
+
};
|
|
30
45
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
31
46
|
"button",
|
|
32
47
|
{
|
|
33
48
|
style: {
|
|
34
|
-
padding:
|
|
49
|
+
padding: paddings[size],
|
|
35
50
|
borderRadius: "6px",
|
|
36
51
|
border: "none",
|
|
37
|
-
backgroundColor:
|
|
52
|
+
backgroundColor: colors[variant],
|
|
38
53
|
color: "white",
|
|
39
|
-
cursor: "pointer"
|
|
54
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
55
|
+
opacity: disabled ? 0.6 : 1
|
|
40
56
|
},
|
|
41
|
-
|
|
57
|
+
disabled,
|
|
58
|
+
onClick,
|
|
59
|
+
children
|
|
42
60
|
}
|
|
43
61
|
);
|
|
44
62
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
// src/Button.tsx
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
function Button({
|
|
3
|
+
function Button({
|
|
4
|
+
children,
|
|
5
|
+
variant = "primary",
|
|
6
|
+
size = "md",
|
|
7
|
+
disabled = false,
|
|
8
|
+
onClick
|
|
9
|
+
}) {
|
|
10
|
+
const colors = {
|
|
11
|
+
primary: "#1976d2",
|
|
12
|
+
secondary: "#9c27b0"
|
|
13
|
+
};
|
|
14
|
+
const paddings = {
|
|
15
|
+
sm: "6px 12px",
|
|
16
|
+
md: "10px 16px",
|
|
17
|
+
lg: "14px 20px"
|
|
18
|
+
};
|
|
4
19
|
return /* @__PURE__ */ jsx(
|
|
5
20
|
"button",
|
|
6
21
|
{
|
|
7
22
|
style: {
|
|
8
|
-
padding:
|
|
23
|
+
padding: paddings[size],
|
|
9
24
|
borderRadius: "6px",
|
|
10
25
|
border: "none",
|
|
11
|
-
backgroundColor:
|
|
26
|
+
backgroundColor: colors[variant],
|
|
12
27
|
color: "white",
|
|
13
|
-
cursor: "pointer"
|
|
28
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
29
|
+
opacity: disabled ? 0.6 : 1
|
|
14
30
|
},
|
|
15
|
-
|
|
31
|
+
disabled,
|
|
32
|
+
onClick,
|
|
33
|
+
children
|
|
16
34
|
}
|
|
17
35
|
);
|
|
18
36
|
}
|