@gearbox-protocol/permissionless-ui 1.6.1 → 1.7.1

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.
Files changed (31) hide show
  1. package/dist/cjs/components/block-sync.js +2 -2
  2. package/dist/cjs/components/buttons/button.js +3 -3
  3. package/dist/cjs/components/buttons/tab-button.js +1 -1
  4. package/dist/cjs/components/cards/card.js +7 -3
  5. package/dist/cjs/components/cards/expandable-card.js +3 -3
  6. package/dist/cjs/components/checkbox.js +1 -1
  7. package/dist/cjs/components/input.js +4 -4
  8. package/dist/cjs/components/label.js +3 -3
  9. package/dist/cjs/components/layout/layout.js +2 -2
  10. package/dist/cjs/components/search-bar.js +81 -12
  11. package/dist/cjs/components/stat-badge.js +1 -1
  12. package/dist/cjs/components/table/table.js +14 -4
  13. package/dist/esm/components/block-sync.js +2 -2
  14. package/dist/esm/components/buttons/button.js +3 -3
  15. package/dist/esm/components/buttons/tab-button.js +1 -1
  16. package/dist/esm/components/cards/card.js +7 -3
  17. package/dist/esm/components/cards/expandable-card.js +3 -3
  18. package/dist/esm/components/checkbox.js +1 -1
  19. package/dist/esm/components/input.js +4 -4
  20. package/dist/esm/components/label.js +3 -3
  21. package/dist/esm/components/layout/layout.js +2 -2
  22. package/dist/esm/components/search-bar.js +71 -12
  23. package/dist/esm/components/stat-badge.js +1 -1
  24. package/dist/esm/components/table/table.js +14 -4
  25. package/dist/globals.css +6 -13
  26. package/dist/types/components/cards/card.d.ts +1 -1
  27. package/dist/types/components/search-bar.d.ts +11 -4
  28. package/package.json +1 -1
  29. package/dist/cjs/components/card.js +0 -176
  30. package/dist/esm/components/card.js +0 -133
  31. package/dist/types/components/card.d.ts +0 -116
@@ -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
  {
@@ -47,7 +47,8 @@ const cardVariants = (0, import_class_variance_authority.cva)(
47
47
  variant: {
48
48
  default: "",
49
49
  interactive: "hover:bg-secondary transition-colors cursor-pointer",
50
- transparent: "bg-card/0"
50
+ transparent: "bg-transparent hover:bg-transparent",
51
+ nohover: "hover:bg-card hover:border-border"
51
52
  }
52
53
  },
53
54
  defaultVariants: {
@@ -70,7 +71,10 @@ const CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE
70
71
  "div",
71
72
  {
72
73
  ref,
73
- className: (0, import_utils.default)("flex items-center py-2 px-4 border-b", className),
74
+ className: (0, import_utils.default)(
75
+ "flex items-center py-2 px-4 border-b border-input",
76
+ className
77
+ ),
74
78
  ...props
75
79
  }
76
80
  ));
@@ -102,7 +106,7 @@ const CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE
102
106
  "div",
103
107
  {
104
108
  ref,
105
- className: (0, import_utils.default)("flex items-center p-4 border-t", className),
109
+ className: (0, import_utils.default)("flex items-center p-4 border-t border-input", className),
106
110
  ...props
107
111
  }
108
112
  ));
@@ -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
  {
@@ -9,7 +9,8 @@ const cardVariants = cva(
9
9
  variant: {
10
10
  default: "",
11
11
  interactive: "hover:bg-secondary transition-colors cursor-pointer",
12
- transparent: "bg-card/0"
12
+ transparent: "bg-transparent hover:bg-transparent",
13
+ nohover: "hover:bg-card hover:border-border"
13
14
  }
14
15
  },
15
16
  defaultVariants: {
@@ -32,7 +33,10 @@ const CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE
32
33
  "div",
33
34
  {
34
35
  ref,
35
- className: cn("flex items-center py-2 px-4 border-b", className),
36
+ className: cn(
37
+ "flex items-center py-2 px-4 border-b border-input",
38
+ className
39
+ ),
36
40
  ...props
37
41
  }
38
42
  ));
@@ -64,7 +68,7 @@ const CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE
64
68
  "div",
65
69
  {
66
70
  ref,
67
- className: cn("flex items-center p-4 border-t", className),
71
+ className: cn("flex items-center p-4 border-t border-input", className),
68
72
  ...props
69
73
  }
70
74
  ));
@@ -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.1",
4
4
  "description": "Internal UI components",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/index.js",
@@ -1,176 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var card_exports = {};
30
- __export(card_exports, {
31
- Card: () => Card,
32
- CardContent: () => CardContent,
33
- CardDescription: () => CardDescription,
34
- CardFooter: () => CardFooter,
35
- CardHeader: () => CardHeader,
36
- CardTitle: () => CardTitle,
37
- cardContentVariants: () => cardContentVariants,
38
- cardFooterVariants: () => cardFooterVariants,
39
- cardHeaderVariants: () => cardHeaderVariants,
40
- cardVariants: () => cardVariants
41
- });
42
- module.exports = __toCommonJS(card_exports);
43
- var import_jsx_runtime = require("react/jsx-runtime");
44
- var import_class_variance_authority = require("class-variance-authority");
45
- var React = __toESM(require("react"));
46
- var import_utils = __toESM(require('../utils/index.js'));
47
- const cardVariants = (0, import_class_variance_authority.cva)("rounded-xl bg-card text-card-foreground", {
48
- variants: {
49
- variant: {
50
- default: "border shadow",
51
- elevated: "shadow-lg",
52
- outlined: "border-2",
53
- ghost: "border-0 shadow-none"
54
- }
55
- },
56
- defaultVariants: {
57
- variant: "default"
58
- }
59
- });
60
- const Card = React.forwardRef(
61
- ({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
62
- "div",
63
- {
64
- ref,
65
- className: (0, import_utils.default)(cardVariants({ variant, className })),
66
- ...props
67
- }
68
- )
69
- );
70
- Card.displayName = "Card";
71
- const cardHeaderVariants = (0, import_class_variance_authority.cva)("flex flex-col space-y-1.5", {
72
- variants: {
73
- padding: {
74
- none: "p-0",
75
- sm: "p-4",
76
- default: "p-6",
77
- lg: "p-8"
78
- }
79
- },
80
- defaultVariants: {
81
- padding: "default"
82
- }
83
- });
84
- const CardHeader = React.forwardRef(
85
- ({ className, padding, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
- "div",
87
- {
88
- ref,
89
- className: (0, import_utils.default)(cardHeaderVariants({ padding, className })),
90
- ...props
91
- }
92
- )
93
- );
94
- CardHeader.displayName = "CardHeader";
95
- const CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
96
- "div",
97
- {
98
- ref,
99
- className: (0, import_utils.default)(
100
- "font-semibold leading-none tracking-tight text-2xl",
101
- className
102
- ),
103
- ...props
104
- }
105
- ));
106
- CardTitle.displayName = "CardTitle";
107
- const CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
108
- "div",
109
- {
110
- ref,
111
- className: (0, import_utils.default)("text-sm text-muted-foreground", className),
112
- ...props
113
- }
114
- ));
115
- CardDescription.displayName = "CardDescription";
116
- const cardContentVariants = (0, import_class_variance_authority.cva)("", {
117
- variants: {
118
- padding: {
119
- none: "p-0",
120
- sm: "p-4 pt-0",
121
- default: "p-6 pt-0",
122
- lg: "p-8 pt-0"
123
- }
124
- },
125
- defaultVariants: {
126
- padding: "default"
127
- }
128
- });
129
- const CardContent = React.forwardRef(
130
- ({ className, padding, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
131
- "div",
132
- {
133
- ref,
134
- className: (0, import_utils.default)(cardContentVariants({ padding, className })),
135
- ...props
136
- }
137
- )
138
- );
139
- CardContent.displayName = "CardContent";
140
- const cardFooterVariants = (0, import_class_variance_authority.cva)("flex items-center", {
141
- variants: {
142
- padding: {
143
- none: "p-0",
144
- sm: "p-4 pt-0",
145
- default: "p-6 pt-0",
146
- lg: "p-8 pt-0"
147
- }
148
- },
149
- defaultVariants: {
150
- padding: "default"
151
- }
152
- });
153
- const CardFooter = React.forwardRef(
154
- ({ className, padding, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
155
- "div",
156
- {
157
- ref,
158
- className: (0, import_utils.default)(cardFooterVariants({ padding, className })),
159
- ...props
160
- }
161
- )
162
- );
163
- CardFooter.displayName = "CardFooter";
164
- // Annotate the CommonJS export names for ESM import in node:
165
- 0 && (module.exports = {
166
- Card,
167
- CardContent,
168
- CardDescription,
169
- CardFooter,
170
- CardHeader,
171
- CardTitle,
172
- cardContentVariants,
173
- cardFooterVariants,
174
- cardHeaderVariants,
175
- cardVariants
176
- });
@@ -1,133 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { cva } from "class-variance-authority";
3
- import * as React from "react";
4
- import cn from "../utils/index.js";
5
- const cardVariants = cva("rounded-xl bg-card text-card-foreground", {
6
- variants: {
7
- variant: {
8
- default: "border shadow",
9
- elevated: "shadow-lg",
10
- outlined: "border-2",
11
- ghost: "border-0 shadow-none"
12
- }
13
- },
14
- defaultVariants: {
15
- variant: "default"
16
- }
17
- });
18
- const Card = React.forwardRef(
19
- ({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
20
- "div",
21
- {
22
- ref,
23
- className: cn(cardVariants({ variant, className })),
24
- ...props
25
- }
26
- )
27
- );
28
- Card.displayName = "Card";
29
- const cardHeaderVariants = cva("flex flex-col space-y-1.5", {
30
- variants: {
31
- padding: {
32
- none: "p-0",
33
- sm: "p-4",
34
- default: "p-6",
35
- lg: "p-8"
36
- }
37
- },
38
- defaultVariants: {
39
- padding: "default"
40
- }
41
- });
42
- const CardHeader = React.forwardRef(
43
- ({ className, padding, ...props }, ref) => /* @__PURE__ */ jsx(
44
- "div",
45
- {
46
- ref,
47
- className: cn(cardHeaderVariants({ padding, className })),
48
- ...props
49
- }
50
- )
51
- );
52
- CardHeader.displayName = "CardHeader";
53
- const CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
54
- "div",
55
- {
56
- ref,
57
- className: cn(
58
- "font-semibold leading-none tracking-tight text-2xl",
59
- className
60
- ),
61
- ...props
62
- }
63
- ));
64
- CardTitle.displayName = "CardTitle";
65
- const CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
66
- "div",
67
- {
68
- ref,
69
- className: cn("text-sm text-muted-foreground", className),
70
- ...props
71
- }
72
- ));
73
- CardDescription.displayName = "CardDescription";
74
- const cardContentVariants = cva("", {
75
- variants: {
76
- padding: {
77
- none: "p-0",
78
- sm: "p-4 pt-0",
79
- default: "p-6 pt-0",
80
- lg: "p-8 pt-0"
81
- }
82
- },
83
- defaultVariants: {
84
- padding: "default"
85
- }
86
- });
87
- const CardContent = React.forwardRef(
88
- ({ className, padding, ...props }, ref) => /* @__PURE__ */ jsx(
89
- "div",
90
- {
91
- ref,
92
- className: cn(cardContentVariants({ padding, className })),
93
- ...props
94
- }
95
- )
96
- );
97
- CardContent.displayName = "CardContent";
98
- const cardFooterVariants = cva("flex items-center", {
99
- variants: {
100
- padding: {
101
- none: "p-0",
102
- sm: "p-4 pt-0",
103
- default: "p-6 pt-0",
104
- lg: "p-8 pt-0"
105
- }
106
- },
107
- defaultVariants: {
108
- padding: "default"
109
- }
110
- });
111
- const CardFooter = React.forwardRef(
112
- ({ className, padding, ...props }, ref) => /* @__PURE__ */ jsx(
113
- "div",
114
- {
115
- ref,
116
- className: cn(cardFooterVariants({ padding, className })),
117
- ...props
118
- }
119
- )
120
- );
121
- CardFooter.displayName = "CardFooter";
122
- export {
123
- Card,
124
- CardContent,
125
- CardDescription,
126
- CardFooter,
127
- CardHeader,
128
- CardTitle,
129
- cardContentVariants,
130
- cardFooterVariants,
131
- cardHeaderVariants,
132
- cardVariants
133
- };
@@ -1,116 +0,0 @@
1
- import { type VariantProps } from "class-variance-authority";
2
- import * as React from "react";
3
- declare const cardVariants: (props?: ({
4
- variant?: "default" | "ghost" | "elevated" | "outlined" | null | undefined;
5
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- /**
7
- * CardProps — props for Card component.
8
- */
9
- interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
10
- }
11
- /**
12
- * Card — container component for grouped content.
13
- *
14
- * @usage
15
- * Use Card to group related content:
16
- * content cards, info panels, feature boxes, grouped sections.
17
- *
18
- * Props:
19
- * - `variant` — visual variant: "default", "elevated", "outlined", "ghost" (defaults to "default").
20
- *
21
- * Note: Supports different visual styles via variant prop.
22
- * Use with CardHeader, CardTitle, CardDescription, CardContent, and CardFooter for structured layout.
23
- *
24
- * @example
25
- * ```tsx
26
- * <Card>
27
- * <CardHeader>
28
- * <CardTitle>Card Title</CardTitle>
29
- * </CardHeader>
30
- * <CardContent>Content here</CardContent>
31
- * </Card>
32
- * ```
33
- */
34
- declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
35
- declare const cardHeaderVariants: (props?: ({
36
- padding?: "none" | "default" | "sm" | "lg" | null | undefined;
37
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
38
- /**
39
- * CardHeaderProps — props for CardHeader component.
40
- */
41
- interface CardHeaderProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardHeaderVariants> {
42
- }
43
- /**
44
- * CardHeader — header section of a Card.
45
- *
46
- * @usage
47
- * Use CardHeader to wrap card title and description:
48
- * card headers with title and optional description.
49
- *
50
- * Props:
51
- * - `padding` — padding size: "none", "sm", "default", "lg" (defaults to "default").
52
- */
53
- declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<HTMLDivElement>>;
54
- /**
55
- * CardTitle — title component for Card header.
56
- *
57
- * @usage
58
- * Use CardTitle to display card title:
59
- * card headlines, card headings.
60
- *
61
- * Note: Uses large semibold text (2xl) with tight tracking.
62
- */
63
- declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
64
- /**
65
- * CardDescription — description component for Card header.
66
- *
67
- * @usage
68
- * Use CardDescription to display card description or subtitle:
69
- * card subtitles, card descriptions, additional card information.
70
- *
71
- * Note: Uses small muted text color.
72
- */
73
- declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
74
- declare const cardContentVariants: (props?: ({
75
- padding?: "none" | "default" | "sm" | "lg" | null | undefined;
76
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
77
- /**
78
- * CardContentProps — props for CardContent component.
79
- */
80
- interface CardContentProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardContentVariants> {
81
- }
82
- /**
83
- * CardContent — main content section of a Card.
84
- *
85
- * @usage
86
- * Use CardContent to wrap card main content:
87
- * card body, card main text, card details.
88
- *
89
- * Props:
90
- * - `padding` — padding size: "none", "sm", "default", "lg" (defaults to "default").
91
- *
92
- * Note: Padding-top is always 0 to work seamlessly with CardHeader.
93
- */
94
- declare const CardContent: React.ForwardRefExoticComponent<CardContentProps & React.RefAttributes<HTMLDivElement>>;
95
- declare const cardFooterVariants: (props?: ({
96
- padding?: "none" | "default" | "sm" | "lg" | null | undefined;
97
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
98
- /**
99
- * CardFooterProps — props for CardFooter component.
100
- */
101
- interface CardFooterProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardFooterVariants> {
102
- }
103
- /**
104
- * CardFooter — footer section of a Card.
105
- *
106
- * @usage
107
- * Use CardFooter to wrap card actions or footer content:
108
- * action buttons, links, additional information at card bottom.
109
- *
110
- * Props:
111
- * - `padding` — padding size: "none", "sm", "default", "lg" (defaults to "default").
112
- *
113
- * Note: Uses flex layout to align items horizontally. Padding-top is always 0 to work seamlessly with CardContent.
114
- */
115
- declare const CardFooter: React.ForwardRefExoticComponent<CardFooterProps & React.RefAttributes<HTMLDivElement>>;
116
- export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants, cardHeaderVariants, cardContentVariants, cardFooterVariants, };