@gearbox-protocol/permissionless-ui 1.6.1 → 1.7.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.
@@ -57,7 +57,7 @@ function BlockSync({
57
57
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
58
58
  "span",
59
59
  {
60
- className: (0, import_cn.cn)("text-xs", isError ? "text-red-500" : "text-green-500"),
60
+ className: (0, import_cn.cn)("text-xs", isError ? "text-destructive" : "text-success"),
61
61
  children: "Status"
62
62
  }
63
63
  ),
@@ -66,7 +66,7 @@ function BlockSync({
66
66
  {
67
67
  className: (0, import_cn.cn)(
68
68
  "w-2 h-2 rounded-full",
69
- isError ? "bg-red-500" : "bg-green-500"
69
+ isError ? "bg-destructive" : "bg-success"
70
70
  )
71
71
  }
72
72
  )
@@ -44,11 +44,11 @@ const buttonVariants = (0, import_class_variance_authority.cva)(
44
44
  variant: {
45
45
  default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
46
46
  destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
47
- outline: "border-border bg-background shadow-sm hover:bg-secondary hover:text-white text-white",
47
+ outline: "border-input bg-background shadow-sm hover:bg-secondary hover:text-white text-white",
48
48
  secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
49
- ghost: "hover:bg-accent hover:text-accent-foreground",
49
+ ghost: "hover:bg-secondary hover:text-accent-foreground",
50
50
  link: "text-primary underline-offset-4 hover:underline",
51
- text: "text-muted-foreground hover:text-white",
51
+ text: "text-muted-foreground hover:text-white hover:bg-transparent",
52
52
  pink: "bg-pink-700 hover:bg-pink-600 disabled:bg-pink-700 text-white",
53
53
  "pink-outline": "border-pink-700 hover:border-pink-600 disabled:border-pink-700 text-white",
54
54
  blue: "bg-blue-800 hover:bg-blue-700 disabled:bg-blue-700 text-white",
@@ -35,7 +35,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var React = __toESM(require("react"));
36
36
  var import_button = require('./button.js');
37
37
  const TabButton = React.forwardRef(
38
- ({ className, children, size = "sm", ...props }, ref) => {
38
+ ({ className, children, size, ...props }, ref) => {
39
39
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
40
40
  import_button.Button,
41
41
  {
@@ -46,8 +46,9 @@ const cardVariants = (0, import_class_variance_authority.cva)(
46
46
  variants: {
47
47
  variant: {
48
48
  default: "",
49
- interactive: "hover:bg-secondary transition-colors cursor-pointer",
50
- transparent: "bg-card/0"
49
+ interactive: "hover:bg-card transition-colors cursor-pointer",
50
+ transparent: "bg-card/0",
51
+ nohover: "hover:bg-card hover:border-border"
51
52
  }
52
53
  },
53
54
  defaultVariants: {
@@ -43,13 +43,13 @@ function ExpandableCard({
43
43
  alwaysExpanded = false
44
44
  }) {
45
45
  const [isExpanded, setIsExpanded] = React.useState(alwaysExpanded);
46
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.Card, { children: [
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.Card, { variant: "nohover", children: [
47
47
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
48
48
  "div",
49
49
  {
50
50
  className: (0, import_utils.default)(
51
51
  "flex items-center justify-between gap-4 p-4 rounded-t-xl",
52
- alwaysExpanded ? "" : "cursor-pointer hover:bg-secondary",
52
+ alwaysExpanded ? "" : "cursor-pointer",
53
53
  isExpanded ? "" : "rounded-b-xl"
54
54
  ),
55
55
  onClick: () => {
@@ -71,7 +71,7 @@ function ExpandableCard({
71
71
  ]
72
72
  }
73
73
  ),
74
- isExpanded && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_card.CardContent, { className: "border-t bg-gray-900/30", children })
74
+ isExpanded && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_card.CardContent, { className: "border-t border-input bg-gray-900/30", children })
75
75
  ] });
76
76
  }
77
77
  // Annotate the CommonJS export names for ESM import in node:
@@ -41,7 +41,7 @@ const Checkbox = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
41
41
  {
42
42
  ref,
43
43
  className: (0, import_utils.default)(
44
- "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
44
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
45
45
  className
46
46
  ),
47
47
  ...props,
@@ -36,7 +36,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_class_variance_authority = require("class-variance-authority");
37
37
  var import_utils = __toESM(require('../utils/index.js'));
38
38
  const inputVariants = (0, import_class_variance_authority.cva)(
39
- "flex w-full rounded-md border border-input px-3 py-1 shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm bg-[rgb(40,40,40)] text-white border-[rgb(100,100,100)] focus:bg-[rgb(40,40,40)] active:bg-[rgb(40,40,40)] [&:not(:placeholder-shown)]:bg-[rgb(40,40,40)] autofill:bg-[rgb(40,40,40)] [-webkit-autofill]:bg-[rgb(40,40,40)] [&:-webkit-autofill]:shadow-[0_0_0_1000px_rgb(40,40,40)_inset] [&:-webkit-autofill]:[text-fill-color:rgb(255,255,255)]",
39
+ "flex w-full rounded-md border border-input px-3 py-1 shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground/70 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm bg-[rgb(40,40,40)] text-white border-[rgb(100,100,100)] focus:bg-[rgb(40,40,40)] active:bg-[rgb(40,40,40)] [&:not(:placeholder-shown)]:bg-[rgb(40,40,40)] autofill:bg-[rgb(40,40,40)] [-webkit-autofill]:bg-[rgb(40,40,40)] [&:-webkit-autofill]:shadow-[0_0_0_1000px_rgb(40,40,40)_inset] [&:-webkit-autofill]:[text-fill-color:rgb(255,255,255)] outline-none",
40
40
  {
41
41
  variants: {
42
42
  size: {
@@ -46,8 +46,8 @@ const inputVariants = (0, import_class_variance_authority.cva)(
46
46
  },
47
47
  variant: {
48
48
  default: "",
49
- error: "border-red-500 focus-visible:ring-red-500",
50
- success: "border-green-500 focus-visible:ring-green-500"
49
+ error: "border-red-500",
50
+ success: "border-green-500"
51
51
  }
52
52
  },
53
53
  defaultVariants: {
@@ -81,7 +81,7 @@ function Input({
81
81
  onWheel: props.type === "number" ? (e) => e.currentTarget.blur() : void 0
82
82
  }
83
83
  ),
84
- hasError && value !== "" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-red-500 text-sm", children: errorMessage })
84
+ hasError && errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-destructive text-sm", children: errorMessage })
85
85
  ] });
86
86
  }
87
87
  // Annotate the CommonJS export names for ESM import in node:
@@ -38,16 +38,16 @@ var import_class_variance_authority = require("class-variance-authority");
38
38
  var React = __toESM(require("react"));
39
39
  var import_utils = __toESM(require('../utils//index.js'));
40
40
  const labelVariants = (0, import_class_variance_authority.cva)(
41
- "font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
41
+ "flex font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 mb-2 ",
42
42
  {
43
43
  variants: {
44
44
  size: {
45
45
  sm: "text-sm",
46
- default: "text-lg",
46
+ default: "text-md",
47
47
  lg: "text-xl"
48
48
  },
49
49
  variant: {
50
- default: "text-white",
50
+ default: "text-foreground",
51
51
  muted: "text-muted-foreground",
52
52
  error: "text-destructive",
53
53
  success: "text-green-500"
@@ -57,8 +57,8 @@ const Layout = import_react.default.forwardRef(
57
57
  className: "overflow-x-hidden py-6",
58
58
  style: {
59
59
  gridArea: "main",
60
- backgroundColor: "hsl(var(--main-background))",
61
- color: "hsl(var(--main-foreground))"
60
+ backgroundColor: "hsl(var(--background))",
61
+ color: "hsl(var(--foreground))"
62
62
  },
63
63
  children
64
64
  }
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  "use client";
3
+ var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
6
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
9
  var __export = (target, all) => {
8
10
  for (var name in all)
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
16
18
  }
17
19
  return to;
18
20
  };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
19
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
30
  var search_bar_exports = {};
21
31
  __export(search_bar_exports, {
@@ -23,39 +33,98 @@ __export(search_bar_exports, {
23
33
  });
24
34
  module.exports = __toCommonJS(search_bar_exports);
25
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_class_variance_authority = require("class-variance-authority");
26
37
  var import_lucide_react = require("lucide-react");
27
38
  var import_react = require("react");
39
+ var import_utils = __toESM(require('../utils/index.js'));
28
40
  var import_input = require('./input.js');
41
+ const searchBarVariants = (0, import_class_variance_authority.cva)("relative w-full transition-all duration-200", {
42
+ variants: {
43
+ size: {
44
+ sm: "max-w-xs",
45
+ default: "max-w-96",
46
+ lg: "max-w-lg",
47
+ full: "max-w-full"
48
+ }
49
+ },
50
+ defaultVariants: {
51
+ size: "default"
52
+ }
53
+ });
54
+ const searchBarInputVariants = (0, import_class_variance_authority.cva)("transition-all duration-200 pl-10", {
55
+ variants: {
56
+ active: {
57
+ true: "",
58
+ false: "bg-transparent border-input"
59
+ },
60
+ theme: {
61
+ light: "",
62
+ dark: ""
63
+ }
64
+ },
65
+ compoundVariants: [
66
+ {
67
+ active: true,
68
+ theme: "light",
69
+ className: "bg-card text-foreground"
70
+ },
71
+ {
72
+ active: true,
73
+ theme: "dark",
74
+ className: "bg-[rgb(40,40,40)] text-white"
75
+ },
76
+ {
77
+ active: false,
78
+ theme: "light",
79
+ className: "text-foreground placeholder:text-foreground"
80
+ },
81
+ {
82
+ active: false,
83
+ theme: "dark",
84
+ className: "text-white placeholder:text-white"
85
+ }
86
+ ],
87
+ defaultVariants: {
88
+ active: false,
89
+ theme: "light"
90
+ }
91
+ });
29
92
  function SearchBar({
30
93
  onChange,
31
94
  placeholder = "Search...",
32
- className = "w-64"
95
+ className,
96
+ size,
97
+ theme = "light"
33
98
  }) {
34
99
  const [searchQuery, setSearchQuery] = (0, import_react.useState)("");
100
+ const [focused, setFocused] = (0, import_react.useState)(false);
101
+ const active = searchQuery !== "" || focused;
35
102
  const handleSearch = (e) => {
36
103
  const query = e.target.value;
37
104
  setSearchQuery(query);
38
105
  onChange(query);
39
106
  };
40
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `relative ${className}`, children: [
107
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_utils.default)(searchBarVariants({ size }), className), children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
41
108
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
42
- import_input.Input,
109
+ import_lucide_react.Search,
43
110
  {
44
- type: "text",
45
- placeholder,
46
- value: searchQuery,
47
- onChange: handleSearch,
48
- className: "pl-10"
111
+ className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground pointer-events-none",
112
+ size: 18
49
113
  }
50
114
  ),
51
115
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
52
- import_lucide_react.Search,
116
+ import_input.Input,
53
117
  {
54
- className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground",
55
- size: 18
118
+ type: "search",
119
+ placeholder,
120
+ value: searchQuery,
121
+ onChange: handleSearch,
122
+ onFocus: () => setFocused(true),
123
+ onBlur: () => setFocused(false),
124
+ className: (0, import_utils.default)(searchBarInputVariants({ active, theme }))
56
125
  }
57
126
  )
58
- ] });
127
+ ] }) });
59
128
  }
60
129
  // Annotate the CommonJS export names for ESM import in node:
61
130
  0 && (module.exports = {
@@ -105,7 +105,7 @@ const StatBadge = React.forwardRef(
105
105
  className: (0, import_utils.default)(
106
106
  "inline-flex items-center gap-1 text-xs font-medium",
107
107
  isNegative && "text-destructive",
108
- isPositive && "text-green-600 dark:text-green-400"
108
+ isPositive && "text-success"
109
109
  ),
110
110
  children: [
111
111
  isPositive && (delta.positiveIcon || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.TrendingUp, { className: "h-3 w-3" })),
@@ -62,7 +62,7 @@ const tableVariants = (0, import_class_variance_authority.cva)("w-full caption-b
62
62
  }
63
63
  });
64
64
  const Table = React.forwardRef(
65
- ({ className, size, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
+ ({ className, size, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative w-full overflow-auto rounded-lg border border-input bg-card", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
66
66
  "table",
67
67
  {
68
68
  ref,
@@ -72,7 +72,17 @@ const Table = React.forwardRef(
72
72
  ) })
73
73
  );
74
74
  Table.displayName = "Table";
75
- const TableHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { ref, className: (0, import_utils.default)("[&_tr]:border-b ", className), ...props }));
75
+ const TableHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
76
+ "thead",
77
+ {
78
+ ref,
79
+ className: (0, import_utils.default)(
80
+ "[&_tr]:border-b border-input [&_tr]:hover:bg-transparent",
81
+ className
82
+ ),
83
+ ...props
84
+ }
85
+ ));
76
86
  TableHeader.displayName = "TableHeader";
77
87
  const TableBody = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
78
88
  "tbody",
@@ -100,7 +110,7 @@ const TableRow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
100
110
  {
101
111
  ref,
102
112
  className: (0, import_utils.default)(
103
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
113
+ "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted border-border",
104
114
  className
105
115
  ),
106
116
  ...props
@@ -108,7 +118,7 @@ const TableRow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
108
118
  ));
109
119
  TableRow.displayName = "TableRow";
110
120
  const tableHeadVariants = (0, import_class_variance_authority.cva)(
111
- "border-b bg-muted/50 text-left align-middle font-medium text-muted-foreground",
121
+ "border-b bg-muted/50 text-left align-middle font-medium text-muted-foreground border-input",
112
122
  {
113
123
  variants: {
114
124
  size: {
@@ -39,7 +39,7 @@ function BlockSync({
39
39
  /* @__PURE__ */ jsx(
40
40
  "span",
41
41
  {
42
- className: cn("text-xs", isError ? "text-red-500" : "text-green-500"),
42
+ className: cn("text-xs", isError ? "text-destructive" : "text-success"),
43
43
  children: "Status"
44
44
  }
45
45
  ),
@@ -48,7 +48,7 @@ function BlockSync({
48
48
  {
49
49
  className: cn(
50
50
  "w-2 h-2 rounded-full",
51
- isError ? "bg-red-500" : "bg-green-500"
51
+ isError ? "bg-destructive" : "bg-success"
52
52
  )
53
53
  }
54
54
  )
@@ -10,11 +10,11 @@ const buttonVariants = cva(
10
10
  variant: {
11
11
  default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
12
12
  destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
13
- outline: "border-border bg-background shadow-sm hover:bg-secondary hover:text-white text-white",
13
+ outline: "border-input bg-background shadow-sm hover:bg-secondary hover:text-white text-white",
14
14
  secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
15
- ghost: "hover:bg-accent hover:text-accent-foreground",
15
+ ghost: "hover:bg-secondary hover:text-accent-foreground",
16
16
  link: "text-primary underline-offset-4 hover:underline",
17
- text: "text-muted-foreground hover:text-white",
17
+ text: "text-muted-foreground hover:text-white hover:bg-transparent",
18
18
  pink: "bg-pink-700 hover:bg-pink-600 disabled:bg-pink-700 text-white",
19
19
  "pink-outline": "border-pink-700 hover:border-pink-600 disabled:border-pink-700 text-white",
20
20
  blue: "bg-blue-800 hover:bg-blue-700 disabled:bg-blue-700 text-white",
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { Button } from "./button.js";
4
4
  const TabButton = React.forwardRef(
5
- ({ className, children, size = "sm", ...props }, ref) => {
5
+ ({ className, children, size, ...props }, ref) => {
6
6
  return /* @__PURE__ */ jsx(
7
7
  Button,
8
8
  {
@@ -8,8 +8,9 @@ const cardVariants = cva(
8
8
  variants: {
9
9
  variant: {
10
10
  default: "",
11
- interactive: "hover:bg-secondary transition-colors cursor-pointer",
12
- transparent: "bg-card/0"
11
+ interactive: "hover:bg-card transition-colors cursor-pointer",
12
+ transparent: "bg-card/0",
13
+ nohover: "hover:bg-card hover:border-border"
13
14
  }
14
15
  },
15
16
  defaultVariants: {
@@ -10,13 +10,13 @@ function ExpandableCard({
10
10
  alwaysExpanded = false
11
11
  }) {
12
12
  const [isExpanded, setIsExpanded] = React.useState(alwaysExpanded);
13
- return /* @__PURE__ */ jsxs(Card, { children: [
13
+ return /* @__PURE__ */ jsxs(Card, { variant: "nohover", children: [
14
14
  /* @__PURE__ */ jsxs(
15
15
  "div",
16
16
  {
17
17
  className: cn(
18
18
  "flex items-center justify-between gap-4 p-4 rounded-t-xl",
19
- alwaysExpanded ? "" : "cursor-pointer hover:bg-secondary",
19
+ alwaysExpanded ? "" : "cursor-pointer",
20
20
  isExpanded ? "" : "rounded-b-xl"
21
21
  ),
22
22
  onClick: () => {
@@ -38,7 +38,7 @@ function ExpandableCard({
38
38
  ]
39
39
  }
40
40
  ),
41
- isExpanded && /* @__PURE__ */ jsx(CardContent, { className: "border-t bg-gray-900/30", children })
41
+ isExpanded && /* @__PURE__ */ jsx(CardContent, { className: "border-t border-input bg-gray-900/30", children })
42
42
  ] });
43
43
  }
44
44
  export {
@@ -8,7 +8,7 @@ const Checkbox = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
8
8
  {
9
9
  ref,
10
10
  className: cn(
11
- "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
11
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
12
12
  className
13
13
  ),
14
14
  ...props,
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { cva } from "class-variance-authority";
3
3
  import cn from "../utils/index.js";
4
4
  const inputVariants = cva(
5
- "flex w-full rounded-md border border-input px-3 py-1 shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm bg-[rgb(40,40,40)] text-white border-[rgb(100,100,100)] focus:bg-[rgb(40,40,40)] active:bg-[rgb(40,40,40)] [&:not(:placeholder-shown)]:bg-[rgb(40,40,40)] autofill:bg-[rgb(40,40,40)] [-webkit-autofill]:bg-[rgb(40,40,40)] [&:-webkit-autofill]:shadow-[0_0_0_1000px_rgb(40,40,40)_inset] [&:-webkit-autofill]:[text-fill-color:rgb(255,255,255)]",
5
+ "flex w-full rounded-md border border-input px-3 py-1 shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground/70 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm bg-[rgb(40,40,40)] text-white border-[rgb(100,100,100)] focus:bg-[rgb(40,40,40)] active:bg-[rgb(40,40,40)] [&:not(:placeholder-shown)]:bg-[rgb(40,40,40)] autofill:bg-[rgb(40,40,40)] [-webkit-autofill]:bg-[rgb(40,40,40)] [&:-webkit-autofill]:shadow-[0_0_0_1000px_rgb(40,40,40)_inset] [&:-webkit-autofill]:[text-fill-color:rgb(255,255,255)] outline-none",
6
6
  {
7
7
  variants: {
8
8
  size: {
@@ -12,8 +12,8 @@ const inputVariants = cva(
12
12
  },
13
13
  variant: {
14
14
  default: "",
15
- error: "border-red-500 focus-visible:ring-red-500",
16
- success: "border-green-500 focus-visible:ring-green-500"
15
+ error: "border-red-500",
16
+ success: "border-green-500"
17
17
  }
18
18
  },
19
19
  defaultVariants: {
@@ -47,7 +47,7 @@ function Input({
47
47
  onWheel: props.type === "number" ? (e) => e.currentTarget.blur() : void 0
48
48
  }
49
49
  ),
50
- hasError && value !== "" && /* @__PURE__ */ jsx("p", { className: "text-red-500 text-sm", children: errorMessage })
50
+ hasError && errorMessage && /* @__PURE__ */ jsx("p", { className: "text-destructive text-sm", children: errorMessage })
51
51
  ] });
52
52
  }
53
53
  export {
@@ -4,16 +4,16 @@ import { cva } from "class-variance-authority";
4
4
  import * as React from "react";
5
5
  import cn from "../utils//index.js";
6
6
  const labelVariants = cva(
7
- "font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
7
+ "flex font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 mb-2 ",
8
8
  {
9
9
  variants: {
10
10
  size: {
11
11
  sm: "text-sm",
12
- default: "text-lg",
12
+ default: "text-md",
13
13
  lg: "text-xl"
14
14
  },
15
15
  variant: {
16
- default: "text-white",
16
+ default: "text-foreground",
17
17
  muted: "text-muted-foreground",
18
18
  error: "text-destructive",
19
19
  success: "text-green-500"
@@ -24,8 +24,8 @@ const Layout = React.forwardRef(
24
24
  className: "overflow-x-hidden py-6",
25
25
  style: {
26
26
  gridArea: "main",
27
- backgroundColor: "hsl(var(--main-background))",
28
- color: "hsl(var(--main-foreground))"
27
+ backgroundColor: "hsl(var(--background))",
28
+ color: "hsl(var(--foreground))"
29
29
  },
30
30
  children
31
31
  }
@@ -1,38 +1,97 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { cva } from "class-variance-authority";
3
4
  import { Search } from "lucide-react";
4
5
  import { useState } from "react";
6
+ import cn from "../utils/index.js";
5
7
  import { Input } from "./input.js";
8
+ const searchBarVariants = cva("relative w-full transition-all duration-200", {
9
+ variants: {
10
+ size: {
11
+ sm: "max-w-xs",
12
+ default: "max-w-96",
13
+ lg: "max-w-lg",
14
+ full: "max-w-full"
15
+ }
16
+ },
17
+ defaultVariants: {
18
+ size: "default"
19
+ }
20
+ });
21
+ const searchBarInputVariants = cva("transition-all duration-200 pl-10", {
22
+ variants: {
23
+ active: {
24
+ true: "",
25
+ false: "bg-transparent border-input"
26
+ },
27
+ theme: {
28
+ light: "",
29
+ dark: ""
30
+ }
31
+ },
32
+ compoundVariants: [
33
+ {
34
+ active: true,
35
+ theme: "light",
36
+ className: "bg-card text-foreground"
37
+ },
38
+ {
39
+ active: true,
40
+ theme: "dark",
41
+ className: "bg-[rgb(40,40,40)] text-white"
42
+ },
43
+ {
44
+ active: false,
45
+ theme: "light",
46
+ className: "text-foreground placeholder:text-foreground"
47
+ },
48
+ {
49
+ active: false,
50
+ theme: "dark",
51
+ className: "text-white placeholder:text-white"
52
+ }
53
+ ],
54
+ defaultVariants: {
55
+ active: false,
56
+ theme: "light"
57
+ }
58
+ });
6
59
  function SearchBar({
7
60
  onChange,
8
61
  placeholder = "Search...",
9
- className = "w-64"
62
+ className,
63
+ size,
64
+ theme = "light"
10
65
  }) {
11
66
  const [searchQuery, setSearchQuery] = useState("");
67
+ const [focused, setFocused] = useState(false);
68
+ const active = searchQuery !== "" || focused;
12
69
  const handleSearch = (e) => {
13
70
  const query = e.target.value;
14
71
  setSearchQuery(query);
15
72
  onChange(query);
16
73
  };
17
- return /* @__PURE__ */ jsxs("div", { className: `relative ${className}`, children: [
74
+ return /* @__PURE__ */ jsx("div", { className: cn(searchBarVariants({ size }), className), children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
18
75
  /* @__PURE__ */ jsx(
19
- Input,
76
+ Search,
20
77
  {
21
- type: "text",
22
- placeholder,
23
- value: searchQuery,
24
- onChange: handleSearch,
25
- className: "pl-10"
78
+ className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground pointer-events-none",
79
+ size: 18
26
80
  }
27
81
  ),
28
82
  /* @__PURE__ */ jsx(
29
- Search,
83
+ Input,
30
84
  {
31
- className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground",
32
- size: 18
85
+ type: "search",
86
+ placeholder,
87
+ value: searchQuery,
88
+ onChange: handleSearch,
89
+ onFocus: () => setFocused(true),
90
+ onBlur: () => setFocused(false),
91
+ className: cn(searchBarInputVariants({ active, theme }))
33
92
  }
34
93
  )
35
- ] });
94
+ ] }) });
36
95
  }
37
96
  export {
38
97
  SearchBar
@@ -72,7 +72,7 @@ const StatBadge = React.forwardRef(
72
72
  className: cn(
73
73
  "inline-flex items-center gap-1 text-xs font-medium",
74
74
  isNegative && "text-destructive",
75
- isPositive && "text-green-600 dark:text-green-400"
75
+ isPositive && "text-success"
76
76
  ),
77
77
  children: [
78
78
  isPositive && (delta.positiveIcon || /* @__PURE__ */ jsx(TrendingUp, { className: "h-3 w-3" })),
@@ -23,7 +23,7 @@ const tableVariants = cva("w-full caption-bottom", {
23
23
  }
24
24
  });
25
25
  const Table = React.forwardRef(
26
- ({ className, size, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx(
26
+ ({ className, size, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto rounded-lg border border-input bg-card", children: /* @__PURE__ */ jsx(
27
27
  "table",
28
28
  {
29
29
  ref,
@@ -33,7 +33,17 @@ const Table = React.forwardRef(
33
33
  ) })
34
34
  );
35
35
  Table.displayName = "Table";
36
- const TableHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b ", className), ...props }));
36
+ const TableHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
37
+ "thead",
38
+ {
39
+ ref,
40
+ className: cn(
41
+ "[&_tr]:border-b border-input [&_tr]:hover:bg-transparent",
42
+ className
43
+ ),
44
+ ...props
45
+ }
46
+ ));
37
47
  TableHeader.displayName = "TableHeader";
38
48
  const TableBody = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
39
49
  "tbody",
@@ -61,7 +71,7 @@ const TableRow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
61
71
  {
62
72
  ref,
63
73
  className: cn(
64
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
74
+ "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted border-border",
65
75
  className
66
76
  ),
67
77
  ...props
@@ -69,7 +79,7 @@ const TableRow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
69
79
  ));
70
80
  TableRow.displayName = "TableRow";
71
81
  const tableHeadVariants = cva(
72
- "border-b bg-muted/50 text-left align-middle font-medium text-muted-foreground",
82
+ "border-b bg-muted/50 text-left align-middle font-medium text-muted-foreground border-input",
73
83
  {
74
84
  variants: {
75
85
  size: {
package/dist/globals.css CHANGED
@@ -32,20 +32,18 @@
32
32
  --white: 0 0% 100%;
33
33
  --black: 0 0% 0%;
34
34
  --border: 0 0% 89.8%;
35
- --main-background: 240 10% 3.9%;
36
- --main-foreground: 0 0% 98%;
37
35
  }
38
36
 
39
37
  .dark {
40
38
  color-scheme: dark;
41
39
 
42
- --background: 240 7% 7.5%;
40
+ --background: 240, 3%, 8%;
43
41
  --foreground: 0 0% 100%;
44
- --card: 240 7% 10%;
42
+ --card: 240, 4%, 10%;
45
43
  --card-foreground: 0 0% 100%;
46
44
  --popover: 240 6% 12%;
47
45
  --popover-foreground: 0 0% 100%;
48
- --primary: 330 98% 48%;
46
+ --primary: 328, 65%, 47%;
49
47
  --primary-foreground: 0 0% 100%;
50
48
  --secondary: 240 7% 17%;
51
49
  --secondary-foreground: 0 0% 100%;
@@ -55,7 +53,7 @@
55
53
  --accent-foreground: 0 0% 100%;
56
54
  --destructive: 0 100% 65%;
57
55
  --destructive-foreground: 0 0% 100%;
58
- --success: 143 100% 78%;
56
+ --success: 137, 100%, 79%;
59
57
  --warning: 44 100% 69%;
60
58
  --liquidation: 274 67% 58%;
61
59
  --input: 225 6% 19%;
@@ -75,17 +73,11 @@
75
73
  --dropdown-dark-button: 225 6% 19%;
76
74
  --white: 0 0% 100%;
77
75
  --black: 0 0% 0%;
78
- --border: 225 7% 22%;
79
- --main-background: 240 10% 3.9%;
80
- --main-foreground: 0 0% 98%;
76
+ --border: 0 0% 100% / 0.05;
81
77
  }
82
78
  }
83
79
 
84
80
  @layer base {
85
- * {
86
- border-color: hsl(var(--border));
87
- }
88
-
89
81
  body {
90
82
  margin: 0;
91
83
  padding: 0;
@@ -98,6 +90,7 @@
98
90
  line-height: 1.1875rem;
99
91
  background-color: hsl(var(--background));
100
92
  color: hsl(var(--foreground));
93
+ border-color: hsl(var(--border));
101
94
  -webkit-font-smoothing: antialiased;
102
95
  -moz-osx-font-smoothing: grayscale;
103
96
  -webkit-tap-highlight-color: transparent;
@@ -1,7 +1,7 @@
1
1
  import { type VariantProps } from "class-variance-authority";
2
2
  import * as React from "react";
3
3
  declare const cardVariants: (props?: ({
4
- variant?: "default" | "transparent" | "interactive" | null | undefined;
4
+ variant?: "default" | "transparent" | "interactive" | "nohover" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
7
7
  asChild?: boolean;
@@ -1,7 +1,12 @@
1
- interface SearchBarProps {
1
+ import { type VariantProps } from "class-variance-authority";
2
+ declare const searchBarVariants: (props?: ({
3
+ size?: "full" | "default" | "sm" | "lg" | null | undefined;
4
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
+ interface SearchBarProps extends VariantProps<typeof searchBarVariants> {
2
6
  onChange: (query: string) => void;
3
7
  placeholder?: string;
4
8
  className?: string;
9
+ theme?: "light" | "dark";
5
10
  }
6
11
  /**
7
12
  * SearchBar — search input component with icon.
@@ -13,14 +18,16 @@ interface SearchBarProps {
13
18
  * Props:
14
19
  * - `onChange` — callback function called when search query changes (required).
15
20
  * - `placeholder` — placeholder text (defaults to "Search...").
16
- * - `className` — additional CSS classes for styling (defaults to "w-64").
21
+ * - `className` — additional CSS classes for styling.
22
+ * - `size` — size variant: "sm", "default", "lg", "full" (defaults to "default").
23
+ * - `theme` — theme variant: "light" or "dark" (defaults to "light").
17
24
  *
18
25
  * Note: Includes search icon on the left side. Manages internal state for search query.
19
- * Calls onChange callback on every input change.
26
+ * Calls onChange callback on every input change. Includes animated states for active/focused.
20
27
  *
21
28
  * Do NOT use SearchBar:
22
29
  * - for simple text inputs (use Input component).
23
30
  * - when you don't need search icon (use Input component).
24
31
  */
25
- export declare function SearchBar({ onChange, placeholder, className, }: SearchBarProps): import("react/jsx-runtime").JSX.Element;
32
+ export declare function SearchBar({ onChange, placeholder, className, size, theme, }: SearchBarProps): import("react/jsx-runtime").JSX.Element;
26
33
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/permissionless-ui",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "Internal UI components",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/index.js",