admin-panel-ui-components 0.1.3 → 0.1.5

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