@bouko/react 3.0.1 → 3.0.3

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.
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from "react";
2
2
  import type { Component } from "../../core/types";
3
3
  export type ButtonProps = Component & {
4
- variant?: "primary" | "outline" | "ghost" | "secondary" | "error" | "future";
4
+ variant?: "accent" | "primary" | "outline" | "ghost" | "secondary" | "error" | "future";
5
5
  size?: "xs" | "sm" | "md" | "lg";
6
6
  icon?: ReactNode;
7
7
  action?: () => void;
@@ -13,29 +13,29 @@ export function Button({ size, variant, style, icon, action, disabled, children
13
13
  catch { }
14
14
  setLoading(false);
15
15
  };
16
- if (variant === "future")
17
- return (_jsxs("button", { className: "test-button", onClick: action, disabled: disabled || isLoading, children: [children, _jsx("div", { className: "test-button-border" })] }));
18
16
  return (_jsxs("button", { className: cn(styles({ variant, size }), style), onClick: submit, disabled: disabled || isLoading, children: [icon && isLoading
19
17
  ? _jsx(Spinner, { className: "animate-spin" })
20
- : icon, children] }));
18
+ : icon, children, variant === "future" && _jsx("div", { className: "test-button-border" })] }));
21
19
  }
22
20
  const styles = tv({
23
- base: "flex justify-center items-center gap-2 bg-accent border border-accent-darker rounded font-medium text-background-light duration-200 cursor-pointer disabled:cursor-not-allowed hover:brightness-110",
24
- defaultVariants: { size: "md" },
21
+ base: "relative flex justify-center items-center gap-2 border rounded font-medium duration-200 cursor-pointer disabled:cursor-not-allowed hover:brightness-110",
22
+ defaultVariants: { variant: "accent", size: "md" },
25
23
  variants: {
26
24
  variant: {
25
+ accent: "bg-accent border-accent-darker text-background-light",
27
26
  primary: "bg-primary border-primary-dark",
28
27
  outline: "bg-transparent border-accent hover:border-accent-dark text-primary",
29
28
  ghost: "bg-transparent border-transparent text-primary hover:brightness-110",
30
29
  secondary: "bg-background-dark dark:bg-background-light border-border-dark dark:border-border-light text-background-darker dark:text-primary",
31
- error: "bg-error border-error-dark"
30
+ error: "bg-error border-error-dark",
31
+ future: "rounded-lg text-primary border-transparent backdrop-blur-sm test-button"
32
32
  },
33
33
  size: {
34
- xs: "gap-1 px-2 py-1 text-xs font-medium",
34
+ xs: "gap-1 px-2 py-1 text-xs",
35
35
  circle: "px-2 py-2 text-xs rounded-full",
36
36
  sm: "px-3 py-2 text-xs sm:text-sm",
37
- md: "px-4 py-1 text-sm",
38
- lg: "px-5 py-3 text-lg"
37
+ md: "px-4 py-2 text-sm",
38
+ lg: "px-5 py-2 text-base"
39
39
  }
40
40
  }
41
41
  });
package/dist/styles.css CHANGED
@@ -2,6 +2,8 @@
2
2
  position: relative;
3
3
  box-sizing: border-box;
4
4
  display: flex;
5
+ gap: 0.5rem;
6
+ align-items: center;
5
7
  width: max-content;
6
8
  padding: 8px 16px;
7
9
  border-radius: 8px;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/react",
4
- "version": "3.0.1",
4
+ "version": "3.0.3",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",
@@ -17,6 +17,7 @@
17
17
  "react-router-dom": "^7.12.0"
18
18
  },
19
19
  "exports": {
20
+ ".": "./dist/index.js",
20
21
  "./styles.css": "./dist/styles.css"
21
22
  },
22
23
  "engines": {},