admin-panel-ui-components 0.1.2 → 0.1.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/Button.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
- import "./index.css";
3
2
  interface ButtonProps {
4
3
  children: React.ReactNode;
5
4
  variant?: "primary" | "secondary";
6
5
  onClick?: () => void;
6
+ className?: string;
7
7
  }
8
8
  declare const Button: React.FC<ButtonProps>;
9
9
  export default Button;
package/dist/Button.js CHANGED
@@ -1,11 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import "./index.css";
2
+ import { twMerge } from "tailwind-merge";
3
3
  var Button = function (_a) {
4
- var children = _a.children, _b = _a.variant, variant = _b === void 0 ? "primary" : _b, onClick = _a.onClick;
5
- var variants = {
4
+ var children = _a.children, _b = _a.variant, variant = _b === void 0 ? "primary" : _b, onClick = _a.onClick, className = _a.className;
5
+ var baseClasses = "text-base font-semibold rounded-lg transition px-6 py-3";
6
+ var variantClasses = {
6
7
  primary: "bg-blue-600 text-white hover:bg-blue-700",
7
8
  secondary: "bg-gray-600 text-white hover:bg-gray-700",
8
9
  };
9
- return (_jsx("button", { className: "px-6 py-3 rounded-lg font-semibold transition ".concat(variants[variant]), onClick: onClick, children: children }));
10
+ var mergedClasses = twMerge(baseClasses, variantClasses[variant], className);
11
+ return (_jsx("button", { className: mergedClasses, onClick: onClick, children: children }));
10
12
  };
11
13
  export default Button;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "admin-panel-ui-components",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,5 +20,8 @@
20
20
  "react": "^19.2.3",
21
21
  "react-dom": "^19.2.3",
22
22
  "typescript": "^5.9.3"
23
+ },
24
+ "dependencies": {
25
+ "tailwind-merge": "^3.4.0"
23
26
  }
24
27
  }
package/src/Button.tsx CHANGED
@@ -1,20 +1,25 @@
1
1
  import React from "react";
2
- import "./index.css";
2
+ import { twMerge } from "tailwind-merge";
3
3
 
4
4
  interface ButtonProps {
5
5
  children: React.ReactNode;
6
6
  variant?: "primary" | "secondary";
7
7
  onClick?: () => void;
8
+ className?: string;
8
9
  }
9
10
 
10
- const Button: React.FC<ButtonProps> = ({ children, variant = "primary", onClick }) => {
11
- const variants = {
11
+ const Button: React.FC<ButtonProps> = ({ children, variant = "primary", onClick, className }) => {
12
+ const baseClasses = "text-base font-semibold rounded-lg transition px-6 py-3";
13
+
14
+ const variantClasses = {
12
15
  primary: "bg-blue-600 text-white hover:bg-blue-700",
13
16
  secondary: "bg-gray-600 text-white hover:bg-gray-700",
14
17
  };
15
18
 
19
+ const mergedClasses = twMerge(baseClasses, variantClasses[variant], className);
20
+
16
21
  return (
17
- <button className={`px-6 py-3 rounded-lg font-semibold transition ${variants[variant]}`} onClick={onClick}>
22
+ <button className={mergedClasses} onClick={onClick}>
18
23
  {children}
19
24
  </button>
20
25
  );