@gearbox-protocol/permissionless-ui 1.7.5 → 1.9.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.
Files changed (79) hide show
  1. package/README.md +0 -4
  2. package/dist/cjs/_virtual/_commonjsHelpers.cjs +9 -0
  3. package/dist/cjs/_virtual/index.cjs +9 -0
  4. package/dist/cjs/components/alert-dialog/alert-dialog.cjs +1 -1
  5. package/dist/cjs/components/checkbox/checkbox.cjs +1 -1
  6. package/dist/cjs/components/error-message/error-message.cjs +5 -5
  7. package/dist/cjs/components/graph/graph-current-value.cjs +2 -2
  8. package/dist/cjs/components/graph/graph-tooltip.cjs +4 -4
  9. package/dist/cjs/components/graph/graph-view.cjs +9 -9
  10. package/dist/cjs/components/graph/graph.cjs +2 -2
  11. package/dist/cjs/components/label/label.cjs +1 -1
  12. package/dist/cjs/components/layout/app-logo/app-logo.cjs +8 -4
  13. package/dist/cjs/components/layout/footer/footer.cjs +1 -1
  14. package/dist/cjs/components/layout/grid/grid.cjs +7 -1
  15. package/dist/cjs/components/layout/header/header.cjs +16 -7
  16. package/dist/cjs/components/layout/page-layout/page-layout.cjs +2 -2
  17. package/dist/cjs/components/liquidation/liquidation-assets-table/liquidation-assets-table.cjs +23 -13
  18. package/dist/cjs/components/loader-guard/loader-guard.cjs +10 -6
  19. package/dist/cjs/components/navbar/navbar.cjs +5 -2
  20. package/dist/cjs/components/navitem/navitem.cjs +6 -6
  21. package/dist/cjs/components/page-title/page-title.cjs +2 -2
  22. package/dist/cjs/components/tab-control/tab-control.cjs +4 -3
  23. package/dist/cjs/components/tabs/tabs.cjs +2 -2
  24. package/dist/cjs/components/theme-toggle/theme-toggle.cjs +1 -1
  25. package/dist/cjs/components/token-icon/token-icon.cjs +2 -1
  26. package/dist/cjs/components/token-symbol/token-symbol.cjs +4 -4
  27. package/dist/cjs/components/trading-view/graph-dropdown.cjs +27 -3
  28. package/dist/cjs/components/trading-view/trading-view.cjs +15 -2
  29. package/dist/cjs/components/with-filter-button/with-filter-button.cjs +2 -2
  30. package/dist/cjs/configs/tailwind-preset.cjs +2 -1
  31. package/dist/cjs/node_modules/.pnpm/tailwind-scrollbar@4.0.2_react@19.2.0_tailwindcss@4.1.17/node_modules/tailwind-scrollbar/src/helpers.cjs +31 -0
  32. package/dist/cjs/node_modules/.pnpm/tailwind-scrollbar@4.0.2_react@19.2.0_tailwindcss@4.1.17/node_modules/tailwind-scrollbar/src/index.cjs +49 -0
  33. package/dist/cjs/node_modules/.pnpm/tailwind-scrollbar@4.0.2_react@19.2.0_tailwindcss@4.1.17/node_modules/tailwind-scrollbar/src/utilities.cjs +218 -0
  34. package/dist/cjs/node_modules/.pnpm/tailwind-scrollbar@4.0.2_react@19.2.0_tailwindcss@4.1.17/node_modules/tailwind-scrollbar/src/variants.cjs +44 -0
  35. package/dist/cjs/node_modules/.pnpm/tailwindcss@4.1.17/node_modules/tailwindcss/dist/flatten-color-palette.cjs +17 -0
  36. package/dist/cjs/node_modules/.pnpm/tailwindcss@4.1.17/node_modules/tailwindcss/dist/plugin.cjs +15 -0
  37. package/dist/esm/_virtual/_commonjsHelpers.js +5 -0
  38. package/dist/esm/_virtual/index.js +7 -0
  39. package/dist/esm/components/alert-dialog/alert-dialog.js +1 -1
  40. package/dist/esm/components/checkbox/checkbox.js +1 -1
  41. package/dist/esm/components/error-message/error-message.js +5 -5
  42. package/dist/esm/components/graph/graph-current-value.js +2 -2
  43. package/dist/esm/components/graph/graph-tooltip.js +4 -4
  44. package/dist/esm/components/graph/graph-view.js +9 -9
  45. package/dist/esm/components/graph/graph.js +2 -2
  46. package/dist/esm/components/label/label.js +1 -1
  47. package/dist/esm/components/layout/app-logo/app-logo.js +8 -4
  48. package/dist/esm/components/layout/footer/footer.js +1 -1
  49. package/dist/esm/components/layout/grid/grid.js +7 -1
  50. package/dist/esm/components/layout/header/header.js +16 -7
  51. package/dist/esm/components/layout/page-layout/page-layout.js +2 -2
  52. package/dist/esm/components/liquidation/liquidation-assets-table/liquidation-assets-table.js +23 -13
  53. package/dist/esm/components/loader-guard/loader-guard.js +10 -6
  54. package/dist/esm/components/navbar/navbar.js +5 -2
  55. package/dist/esm/components/navitem/navitem.js +6 -6
  56. package/dist/esm/components/page-title/page-title.js +2 -2
  57. package/dist/esm/components/tab-control/tab-control.js +4 -3
  58. package/dist/esm/components/tabs/tabs.js +2 -2
  59. package/dist/esm/components/theme-toggle/theme-toggle.js +1 -1
  60. package/dist/esm/components/token-icon/token-icon.js +2 -1
  61. package/dist/esm/components/token-symbol/token-symbol.js +4 -4
  62. package/dist/esm/components/trading-view/graph-dropdown.js +28 -4
  63. package/dist/esm/components/trading-view/trading-view.js +16 -3
  64. package/dist/esm/components/with-filter-button/with-filter-button.js +2 -2
  65. package/dist/esm/configs/tailwind-preset.js +2 -1
  66. package/dist/esm/node_modules/.pnpm/tailwind-scrollbar@4.0.2_react@19.2.0_tailwindcss@4.1.17/node_modules/tailwind-scrollbar/src/helpers.js +27 -0
  67. package/dist/esm/node_modules/.pnpm/tailwind-scrollbar@4.0.2_react@19.2.0_tailwindcss@4.1.17/node_modules/tailwind-scrollbar/src/index.js +45 -0
  68. package/dist/esm/node_modules/.pnpm/tailwind-scrollbar@4.0.2_react@19.2.0_tailwindcss@4.1.17/node_modules/tailwind-scrollbar/src/utilities.js +214 -0
  69. package/dist/esm/node_modules/.pnpm/tailwind-scrollbar@4.0.2_react@19.2.0_tailwindcss@4.1.17/node_modules/tailwind-scrollbar/src/variants.js +40 -0
  70. package/dist/esm/node_modules/.pnpm/tailwindcss@4.1.17/node_modules/tailwindcss/dist/flatten-color-palette.js +13 -0
  71. package/dist/esm/node_modules/.pnpm/tailwindcss@4.1.17/node_modules/tailwindcss/dist/plugin.js +11 -0
  72. package/dist/globals.css +50 -23
  73. package/dist/types/components/layout/col/col.d.ts +11 -1
  74. package/dist/types/components/layout/grid/grid.d.ts +2 -1
  75. package/dist/types/components/table/grid-table.d.ts +4 -0
  76. package/dist/types/components/trading-view/graph-dropdown.d.ts +7 -1
  77. package/dist/types/components/trading-view/trading-view.d.ts +7 -1
  78. package/dist/types/configs/tailwind-preset.d.ts +1 -3
  79. package/package.json +2 -1
@@ -16,10 +16,10 @@ const graphViewVariants = cva(
16
16
  ghost: "border-0 shadow-none"
17
17
  },
18
18
  size: {
19
- sm: "h-64",
20
- default: "h-96",
21
- lg: "h-[32rem]",
22
- xl: "h-[48rem]",
19
+ sm: "h-48 sm:h-64",
20
+ default: "h-64 sm:h-96",
21
+ lg: "h-96 sm:h-[32rem]",
22
+ xl: "h-[32rem] sm:h-[48rem]",
23
23
  full: "h-full"
24
24
  },
25
25
  padding: {
@@ -64,15 +64,15 @@ const GraphView = React.forwardRef(
64
64
  children: [
65
65
  hasHeader && /* @__PURE__ */ jsxs("div", { className: "mb-4 flex items-start justify-between gap-4 flex-shrink-0", children: [
66
66
  (title || description) && /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
67
- title && /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold leading-none tracking-tight", children: title }),
68
- description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
67
+ title && /* @__PURE__ */ jsx("h3", { className: "text-base sm:text-lg font-semibold leading-none tracking-tight", children: title }),
68
+ description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs sm:text-sm text-muted-foreground", children: description })
69
69
  ] }),
70
70
  toolbar && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-full", children: toolbar })
71
71
  ] }),
72
72
  /* @__PURE__ */ jsxs("div", { className: "relative flex-1 w-full min-h-0", children: [
73
73
  loading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-transparent backdrop-blur-sm", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2", children: [
74
74
  /* @__PURE__ */ jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" }),
75
- /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
75
+ /* @__PURE__ */ jsx("span", { className: "text-xs sm:text-sm text-muted-foreground", children: "Loading..." })
76
76
  ] }) }),
77
77
  error && /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2 text-destructive", children: [
78
78
  /* @__PURE__ */ jsx(
@@ -94,7 +94,7 @@ const GraphView = React.forwardRef(
94
94
  )
95
95
  }
96
96
  ),
97
- /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: error })
97
+ /* @__PURE__ */ jsx("span", { className: "text-xs sm:text-sm font-medium", children: error })
98
98
  ] }) }),
99
99
  !error && !children && emptyMessage && /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
100
100
  /* @__PURE__ */ jsx(
@@ -116,7 +116,7 @@ const GraphView = React.forwardRef(
116
116
  )
117
117
  }
118
118
  ),
119
- /* @__PURE__ */ jsx("span", { className: "text-sm", children: emptyMessage })
119
+ /* @__PURE__ */ jsx("span", { className: "text-xs sm:text-sm", children: emptyMessage })
120
120
  ] }) }),
121
121
  !error && children
122
122
  ] })
@@ -566,7 +566,7 @@ function GraphLegend({
566
566
  style: { backgroundColor: lineColor }
567
567
  }
568
568
  ),
569
- /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-foreground", children: s.label }),
569
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] sm:text-xs font-medium text-foreground", children: s.label }),
570
570
  onUnselect && /* @__PURE__ */ jsx(
571
571
  "button",
572
572
  {
@@ -575,7 +575,7 @@ function GraphLegend({
575
575
  e.stopPropagation();
576
576
  onUnselect(s.label);
577
577
  },
578
- className: "ml-1 flex items-center justify-center w-4 h-4 rounded-sm hover:bg-muted transition-colors",
578
+ className: "ml-1 flex items-center justify-center w-4 h-4 rounded-sm hover:bg-muted transition-colors cursor-pointer",
579
579
  "aria-label": `Remove ${s.label}`,
580
580
  children: /* @__PURE__ */ jsxs(
581
581
  "svg",
@@ -7,7 +7,7 @@ import 'sonner';
7
7
  import '@gearbox-protocol/sdk';
8
8
 
9
9
  const labelVariants = cva(
10
- "flex font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
10
+ "flex leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
11
11
  {
12
12
  variants: {
13
13
  size: {
@@ -10,8 +10,8 @@ function AppLogo({
10
10
  "div",
11
11
  {
12
12
  className: cn(
13
- "text-foreground flex items-center gap-2",
14
- size === "default" ? "text-xl" : "text-md"
13
+ "text-foreground flex items-center gap-1 sm:gap-2",
14
+ size === "default" ? "text-base sm:text-lg md:text-xl" : "text-sm sm:text-base md:text-md"
15
15
  ),
16
16
  children: [
17
17
  /* @__PURE__ */ jsx(
@@ -21,10 +21,14 @@ function AppLogo({
21
21
  alt: "Gearbox Protocol",
22
22
  width: size === "default" ? 120 : 100,
23
23
  height: size === "default" ? 24 : 20,
24
- loading: "eager"
24
+ loading: "eager",
25
+ className: cn(
26
+ "h-auto",
27
+ size === "default" ? "w-20 sm:w-24 md:w-[120px]" : "w-16 sm:w-20 md:w-[100px]"
28
+ )
25
29
  }
26
30
  ),
27
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: appName })
31
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground truncate", children: appName })
28
32
  ]
29
33
  }
30
34
  );
@@ -108,7 +108,7 @@ function GearboxFooter({
108
108
  ),
109
109
  children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 items-top py-6 w-full px-4 max-w-[1440px]", children: [
110
110
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 h-full justify-between", children: [
111
- /* @__PURE__ */ jsx(AppLogo, { appName, size: "small" }),
111
+ /* @__PURE__ */ jsx(AppLogo, { appName }),
112
112
  /* @__PURE__ */ jsx(LegalDisclaimer, { hrefs: legalReferences })
113
113
  ] }),
114
114
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 h-full justify-between", children: [
@@ -125,6 +125,9 @@ const GAP_Y_CLASSES = {
125
125
  };
126
126
  const getGridColsClass = (cols, breakpoint) => {
127
127
  if (!cols) return "";
128
+ if (typeof cols === "string") {
129
+ return "";
130
+ }
128
131
  if (typeof cols === "number") {
129
132
  if (breakpoint === "sm") return GRID_COLS_SM_CLASSES[cols] || "";
130
133
  if (breakpoint === "md") return GRID_COLS_MD_CLASSES[cols] || "";
@@ -155,7 +158,10 @@ const Grid = React__default.forwardRef(
155
158
  children,
156
159
  ...props
157
160
  }, ref) => {
158
- const customStyle = typeof cols === "string" ? { ...style, gridTemplateColumns: cols } : style;
161
+ const customStyle = typeof cols === "string" ? {
162
+ ...style,
163
+ gridTemplateColumns: cols === "auto" ? "repeat(auto-fit, minmax(0, auto))" : cols
164
+ } : style;
159
165
  return /* @__PURE__ */ jsx(
160
166
  "div",
161
167
  {
@@ -43,19 +43,19 @@ const Header = React__default.forwardRef(
43
43
  "div",
44
44
  {
45
45
  className: cn(
46
- "w-full h-full flex items-stretch justify-between mx-auto px-4 max-w-[1440px]",
46
+ "w-full h-full flex items-stretch justify-between mx-auto px-4 sm:px-6 lg:px-8 max-w-[1440px]",
47
47
  containerClassName
48
48
  ),
49
49
  children: [
50
50
  logo && /* @__PURE__ */ jsx("div", { className: "flex items-center", children: logo }),
51
51
  navigation && /* @__PURE__ */ jsx("div", { className: "hidden md:flex items-center", children: navigation }),
52
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
52
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 sm:gap-2", children: [
53
53
  actions && /* @__PURE__ */ jsx("div", { className: "hidden md:flex items-center gap-2", children: actions }),
54
- (navigation || mobileMenuContent) && /* @__PURE__ */ jsx(
54
+ (navigation || mobileMenuContent || actions) && /* @__PURE__ */ jsx(
55
55
  "button",
56
56
  {
57
57
  type: "button",
58
- className: "md:hidden flex items-center justify-center p-2 rounded-md hover:bg-accent hover:text-accent-foreground focus:outline-none",
58
+ className: "md:hidden flex items-center justify-center p-2 rounded-md hover:bg-secondary hover:text-accent-foreground focus:outline-none cursor-pointer",
59
59
  onClick: () => setMobileMenuOpen(!mobileMenuOpen),
60
60
  "aria-label": mobileMenuOpen ? "Close menu" : "Open menu",
61
61
  children: mobileMenuOpen ? /* @__PURE__ */ jsx(X, { className: "h-6 w-6" }) : /* @__PURE__ */ jsx(Menu, { className: "h-6 w-6" })
@@ -65,13 +65,22 @@ const Header = React__default.forwardRef(
65
65
  ]
66
66
  }
67
67
  ),
68
- mobileMenuOpen && (navigation || mobileMenuContent) && /* @__PURE__ */ jsx(
68
+ mobileMenuOpen && (navigation || mobileMenuContent || actions) && /* @__PURE__ */ jsx(
69
69
  MobileMenuContext.Provider,
70
70
  {
71
71
  value: { closeMobileMenu: () => setMobileMenuOpen(false) },
72
- children: /* @__PURE__ */ jsx("div", { className: "absolute top-full left-0 right-0 bg-background border-b border-border md:hidden z-40 shadow-lg", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col px-4 py-4 space-y-2", children: [
72
+ children: /* @__PURE__ */ jsx("div", { className: "absolute top-full left-0 right-0 bg-background border-b border-border md:hidden z-40 shadow-lg", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col px-4 sm:px-6 py-4 space-y-2", children: [
73
73
  mobileMenuContent || navigation,
74
- actions && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 pt-4 border-t border-border mt-4", children: actions })
74
+ actions && /* @__PURE__ */ jsx(
75
+ "div",
76
+ {
77
+ className: cn(
78
+ "flex flex-col gap-2",
79
+ (mobileMenuContent || navigation) && "pt-4 border-t border-border mt-4"
80
+ ),
81
+ children: actions
82
+ }
83
+ )
75
84
  ] }) })
76
85
  }
77
86
  )
@@ -25,8 +25,8 @@ function PageLayout({
25
25
  icon,
26
26
  /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
27
27
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center w-full", children: [
28
- /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold", children: title }),
29
- actionButton
28
+ /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold max-w-64 md:max-w-128 truncate", children: title }),
29
+ actionButton && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: actionButton })
30
30
  ] }),
31
31
  description
32
32
  ] })
@@ -3,8 +3,9 @@ import { AssetUtils, PRICE_DECIMALS } from '@gearbox-protocol/sdk';
3
3
  import { useMemo } from 'react';
4
4
  import { TokenSymbol } from '../../token-symbol/token-symbol.js';
5
5
  import { FormattedMessageTyped } from '../../typed-intl/index.js';
6
+ import { useIsMobile } from '../../../hooks/use-media-query.js';
7
+ import { cn } from '../../../utils/cn.js';
6
8
 
7
- const lineHeight = 51;
8
9
  function LiquidationModellingAssetsTable({
9
10
  tokensList,
10
11
  graphParams,
@@ -16,16 +17,21 @@ function LiquidationModellingAssetsTable({
16
17
  const fixedBalancesRecord = useMemo(() => {
17
18
  return AssetUtils.constructAssetRecord(fixedBalances);
18
19
  }, [fixedBalances]);
20
+ const isMobile = useIsMobile();
19
21
  return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
20
22
  /* @__PURE__ */ jsxs(
21
23
  "div",
22
24
  {
23
- className: "grid w-full px-4 gap-2 items-center h-[30px] relative after:absolute after:bottom-0 after:left-2 after:right-2 after:h-px after:border-b after:border-border",
25
+ className: cn(
26
+ "grid w-full px-3 sm:px-4 gap-1 sm:gap-2 items-center",
27
+ "h-7 sm:h-8 md:h-[30px]",
28
+ "relative after:absolute after:bottom-0 after:left-2 sm:after:left-3 after:right-2 sm:after:right-3 after:h-px after:border-b after:border-border"
29
+ ),
24
30
  style: { gridTemplateColumns: "1fr 1fr 1fr" },
25
31
  children: [
26
- /* @__PURE__ */ jsx("div", { className: "text-left text-sm font-medium text-muted-foreground", children: /* @__PURE__ */ jsx(FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.table.asset" }) }),
27
- /* @__PURE__ */ jsx("div", { className: "text-right text-sm font-medium text-muted-foreground", children: /* @__PURE__ */ jsx(FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.table.currentPrice" }) }),
28
- /* @__PURE__ */ jsx("div", { className: "text-right text-sm font-medium text-muted-foreground", children: /* @__PURE__ */ jsx(FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.table.modelPrice" }) })
32
+ /* @__PURE__ */ jsx("div", { className: "text-left text-xs sm:text-sm font-medium text-muted-foreground truncate", children: /* @__PURE__ */ jsx(FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.table.asset" }) }),
33
+ /* @__PURE__ */ jsx("div", { className: "text-right text-xs sm:text-sm font-medium text-muted-foreground truncate", children: /* @__PURE__ */ jsx(FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.table.currentPrice" }) }),
34
+ /* @__PURE__ */ jsx("div", { className: "text-right text-xs sm:text-sm font-medium text-muted-foreground truncate", children: /* @__PURE__ */ jsx(FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.table.modelPrice" }) })
29
35
  ]
30
36
  }
31
37
  ),
@@ -34,26 +40,30 @@ function LiquidationModellingAssetsTable({
34
40
  return /* @__PURE__ */ jsxs(
35
41
  "div",
36
42
  {
37
- className: `grid w-full px-4 gap-2 items-center relative ${isLast ? "" : "after:absolute after:bottom-0 after:left-2 after:right-2 after:h-px after:border-b after:border-border"}`,
43
+ className: cn(
44
+ "grid w-full px-3 sm:px-4 gap-1 sm:gap-2 items-center relative",
45
+ "h-12 sm:h-14 md:h-[51px]",
46
+ !isLast && "after:absolute after:bottom-0 after:left-2 sm:after:left-3 after:right-2 sm:after:right-3 after:h-px after:border-b after:border-border"
47
+ ),
38
48
  style: {
39
- gridTemplateColumns: "1fr 1fr 1fr",
40
- height: `${lineHeight}px`
49
+ gridTemplateColumns: "1fr 1fr 1fr"
41
50
  },
42
51
  children: [
43
- /* @__PURE__ */ jsx("div", { className: "text-left", children: /* @__PURE__ */ jsx(
52
+ /* @__PURE__ */ jsx("div", { className: "text-left min-w-0", children: /* @__PURE__ */ jsx(
44
53
  TokenSymbol,
45
54
  {
46
- size: 24,
55
+ size: isMobile ? 18 : 24,
47
56
  token: tokensList[c.token],
48
57
  showSymbol: true,
49
- maxLength: 8
58
+ maxLength: 6,
59
+ className: "gap-1.5 sm:gap-2"
50
60
  }
51
61
  ) }),
52
- /* @__PURE__ */ jsxs("div", { className: "text-right", children: [
62
+ /* @__PURE__ */ jsxs("div", { className: "text-right text-xs sm:text-sm md:text-base truncate", children: [
53
63
  "$",
54
64
  formatPrice(prices[c.token])
55
65
  ] }),
56
- /* @__PURE__ */ jsx("div", { className: "text-right", children: fixedBalancesRecord[c.token] ? /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ jsx(FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.table.seeGraph" }) }) : /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
66
+ /* @__PURE__ */ jsx("div", { className: "text-right min-w-0", children: fixedBalancesRecord[c.token] ? /* @__PURE__ */ jsx("span", { className: "text-xs sm:text-sm text-muted-foreground truncate", children: /* @__PURE__ */ jsx(FormattedMessageTyped, { messageId: "components.creditSessionDetailedLiquidation.table.seeGraph" }) }) : /* @__PURE__ */ jsxs("span", { className: "text-xs sm:text-sm md:text-base text-muted-foreground truncate", children: [
57
67
  "$",
58
68
  formatPrice(editedPrices[c.token] || prices[c.token])
59
69
  ] }) })
@@ -17,12 +17,16 @@ function LoaderGuard({
17
17
  children,
18
18
  loader
19
19
  }) {
20
- const defaultLoader = /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 p-4", children: [
21
- /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-64" }),
22
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
23
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" }),
24
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" }),
25
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-3/4" })
20
+ const defaultLoader = /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 p-4 sm:p-6 w-full", children: [
21
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-6 sm:h-8 w-48 sm:w-64" }),
22
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2 mb-4", children: [
23
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 sm:h-4 w-full" }),
24
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 sm:h-4 w-full" }),
25
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 sm:h-4 w-3/4" })
26
+ ] }),
27
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-4 md:flex-row flex-col w-full", children: [
28
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-48 sm:h-64 md:h-72 md:w-2/3 w-full" }),
29
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-48 sm:h-64 md:h-72 md:w-1/3 w-full" })
26
30
  ] })
27
31
  ] }) });
28
32
  const showGuard = show;
@@ -37,7 +37,10 @@ const NavbarContent = ({ containerClassName, children }) => {
37
37
  {
38
38
  ref: indicatorContext?.containerRef,
39
39
  className: cn(
40
- "flex items-center gap-2 flex-1 justify-center overflow-x-auto h-full relative",
40
+ "flex items-center gap-2 flex-1 h-full relative overflow-x-auto overflow-y-hidden",
41
+ "md:justify-center md:overflow-x-visible",
42
+ "px-1 pb-1 md:px-0 md:pb-0",
43
+ "navbar-scrollbar",
41
44
  containerClassName
42
45
  ),
43
46
  children: [
@@ -85,7 +88,7 @@ const NavbarNav = React.forwardRef(({ className, children, ...props }, ref) => /
85
88
  "div",
86
89
  {
87
90
  ref,
88
- className: cn("flex items-center gap-1", className),
91
+ className: cn("flex items-center gap-1 min-w-max", className),
89
92
  ...props,
90
93
  children
91
94
  }
@@ -12,12 +12,12 @@ const navitemVariants = cva(
12
12
  {
13
13
  variants: {
14
14
  variant: {
15
- default: "text-decoration-none text-foreground hover:text-foreground hover:bg-secondary data-[active=true]:bg-secondary md:data-[active=true]:bg-transparent data-[active=true]:text-foreground",
16
- active: "text-foreground bg-secondary",
17
- ghost: "text-decoration-none text-muted-foreground hover:text-foreground hover:bg-secondary data-[active=true]:bg-secondary md:data-[active=true]:bg-transparent data-[active=true]:text-foreground",
18
- link: "text-decoration-none text-muted-foreground hover:text-foreground underline-offset-4 hover:underline data-[active=true]:text-foreground data-[active=true]:underline",
19
- pill: "text-decoration-none text-muted-foreground hover:text-foreground hover:bg-accent rounded-full data-[active=true]:bg-accent data-[active=true]:text-foreground",
20
- tab: "text-decoration-none text-muted-foreground hover:text-foreground border-b-2 border-transparent hover:border-border data-[active=true]:border-primary data-[active=true]:text-foreground rounded-none"
15
+ default: "text-decoration-none text-foreground hover:text-foreground hover:bg-secondary data-[active=true]:bg-transparent md:data-[active=true]:bg-transparent data-[active=true]:text-foreground active:bg-transparent focus:bg-transparent md:focus:bg-secondary",
16
+ active: "text-foreground bg-transparent md:bg-secondary active:bg-transparent focus:bg-transparent md:active:bg-secondary md:focus:bg-secondary",
17
+ ghost: "text-decoration-none text-muted-foreground hover:text-foreground hover:bg-secondary data-[active=true]:bg-transparent md:data-[active=true]:bg-transparent data-[active=true]:text-foreground active:bg-transparent focus:bg-transparent md:focus:bg-secondary",
18
+ link: "text-decoration-none text-muted-foreground hover:text-foreground underline-offset-4 hover:underline data-[active=true]:text-foreground data-[active=true]:underline active:bg-transparent focus:bg-transparent",
19
+ pill: "text-decoration-none text-muted-foreground hover:text-foreground hover:bg-accent rounded-full data-[active=true]:bg-transparent md:data-[active=true]:bg-accent data-[active=true]:text-foreground active:bg-transparent focus:bg-transparent md:focus:bg-accent",
20
+ tab: "text-decoration-none text-muted-foreground hover:text-foreground border-b-2 border-transparent hover:border-border data-[active=true]:border-primary data-[active=true]:text-foreground rounded-none active:bg-transparent focus:bg-transparent"
21
21
  },
22
22
  size: {
23
23
  sm: "h-8 px-3 text-xs",
@@ -56,7 +56,7 @@ const PageTitle = React.forwardRef(
56
56
  }, ref) => {
57
57
  return /* @__PURE__ */ jsx("div", { ref, className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: cn(pageTitleRootVariants({ spacing })), children: [
58
58
  backButton && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: backButton }),
59
- /* @__PURE__ */ jsxs("div", { className: "flex-1 flex items-center gap-4", children: [
59
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col md:flex-row md:items-center gap-4", children: [
60
60
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
61
61
  icon && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: icon }),
62
62
  /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
@@ -70,7 +70,7 @@ const PageTitle = React.forwardRef(
70
70
  subtitle && /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground mt-1", children: subtitle })
71
71
  ] })
72
72
  ] }),
73
- actions && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 flex items-center gap-2", children: actions })
73
+ actions && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 flex items-center gap-2 md:ml-auto", children: actions })
74
74
  ] })
75
75
  ] }) });
76
76
  }
@@ -82,7 +82,8 @@ function TabControl({
82
82
  {
83
83
  ref: wrapRef,
84
84
  className: cn(
85
- "relative bottom-[-1px] flex items-stretch gap-3",
85
+ "relative bottom-[-1px] flex items-stretch gap-3 overflow-x-auto overflow-y-hidden w-full",
86
+ "navbar-scrollbar",
86
87
  showBorder && "border-b border-border"
87
88
  ),
88
89
  children: tabs.map((t, index, arr) => {
@@ -98,9 +99,9 @@ function TabControl({
98
99
  onClick: t.disabled ? void 0 : handleTabSelect(t.id, index),
99
100
  disabled: t.disabled,
100
101
  className: cn(
101
- "flex items-center bg-transparent border-none",
102
+ "flex items-center bg-transparent border-none shrink-0",
102
103
  tabItemWrapPadding || "pb-3.5",
103
- variant === "equal" ? "flex-1 justify-center" : !isLast && "mr-10 sm:mr-8",
104
+ variant === "equal" ? "flex-1 justify-center min-w-0" : !isLast && "mr-10 sm:mr-8",
104
105
  s || t.disabled ? "cursor-default" : "cursor-pointer",
105
106
  !t.disabled && "hover:text-foreground"
106
107
  ),
@@ -11,7 +11,7 @@ const TabsList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
11
11
  {
12
12
  ref,
13
13
  className: cn(
14
- "inline-flex h-fit items-center justify-start rounded-lg bg-muted p-1 text-muted-foreground bg-transparent p-0 space-x-6",
14
+ "inline-flex h-fit items-center justify-start rounded-lg bg-muted p-1 text-muted-foreground bg-transparent p-0 space-x-6 overflow-x-auto overflow-y-hidden navbar-scrollbar min-w-max",
15
15
  className
16
16
  ),
17
17
  ...props
@@ -23,7 +23,7 @@ const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
23
23
  {
24
24
  ref,
25
25
  className: cn(
26
- "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow rounded-none border-b-2 border-transparent px-2 py-2 text-gray-400 hover:text-foreground data-[state=active]:border-foreground data-[state=active]:bg-transparent data-[state=active]:text-foreground focus:outline-none cursor-pointer",
26
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow rounded-none border-b-2 border-transparent px-2 py-2 text-gray-400 hover:text-foreground data-[state=active]:border-foreground data-[state=active]:bg-transparent data-[state=active]:text-foreground focus:outline-none cursor-pointer shrink-0",
27
27
  className
28
28
  ),
29
29
  ...props
@@ -8,7 +8,7 @@ function ThemeToggle() {
8
8
  {
9
9
  type: "button",
10
10
  onClick: () => setTheme(actualTheme === "dark" ? "light" : "dark"),
11
- className: "rounded-md p-2 hover:bg-accent cursor-pointer",
11
+ className: "rounded-md p-2 hover:bg-secondary cursor-pointer",
12
12
  "aria-label": "Toggle theme",
13
13
  children: actualTheme === "dark" ? /* @__PURE__ */ jsxs(
14
14
  "svg",
@@ -1,6 +1,7 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useState } from 'react';
3
3
  import { Image } from '../image/image.js';
4
+ import { cn } from '../../utils/cn.js';
4
5
 
5
6
  function TokenIcon({
6
7
  symbol,
@@ -57,7 +58,7 @@ function TokenIcon({
57
58
  alt: "",
58
59
  width: size,
59
60
  height: size,
60
- className,
61
+ className: cn("w-full h-full object-contain block", className),
61
62
  onError: () => setSrc(defaultSrc),
62
63
  onLoad: () => setIsLoading(false)
63
64
  }
@@ -36,12 +36,12 @@ function TokenSymbol({
36
36
  {
37
37
  symbol,
38
38
  size,
39
- className: "rounded-full border-0"
39
+ className: "rounded-full border-0 shrink-0 self-center"
40
40
  }
41
41
  ),
42
- showSymbol && tokenTitle && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
43
- /* @__PURE__ */ jsx("div", { className: "font-medium", children: tokenTitle }),
44
- comment && /* @__PURE__ */ jsxs("div", { className: "text-md text-muted-foreground", children: [
42
+ showSymbol && tokenTitle && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 self-center", children: [
43
+ /* @__PURE__ */ jsx("div", { className: "text-xs sm:text-sm md:text-base font-medium truncate whitespace-pre-wrap leading-tight", children: tokenTitle }),
44
+ comment && /* @__PURE__ */ jsxs("div", { className: "text-md text-muted-foreground leading-tight", children: [
45
45
  "(",
46
46
  comment,
47
47
  ")"
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { Check } from 'lucide-react';
2
+ import { Check, Loader2 } from 'lucide-react';
3
3
  import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
4
4
  import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '../select/select.js';
5
5
 
@@ -7,7 +7,10 @@ function GraphDropdown({
7
7
  items,
8
8
  defaultItem,
9
9
  onSelected,
10
- multiple = false
10
+ multiple = false,
11
+ graphsWithNoData,
12
+ loadingGraphs,
13
+ onNoDataSelected
11
14
  }) {
12
15
  const getInitialValue = () => {
13
16
  if (multiple) {
@@ -59,6 +62,15 @@ function GraphDropdown({
59
62
  (newValue) => {
60
63
  const item = items.find((i) => String(i.value) === newValue);
61
64
  if (!item) return;
65
+ if (loadingGraphs?.has(item.value)) {
66
+ return;
67
+ }
68
+ if (graphsWithNoData?.has(item.value)) {
69
+ if (onNoDataSelected) {
70
+ onNoDataSelected(item.value, item.label);
71
+ }
72
+ return;
73
+ }
62
74
  if (multiple) {
63
75
  isSelectingRef.current = true;
64
76
  setSelectedItems((prev) => {
@@ -79,7 +91,14 @@ function GraphDropdown({
79
91
  onSelected(item.value);
80
92
  }
81
93
  },
82
- [multiple, onSelected, items]
94
+ [
95
+ multiple,
96
+ onSelected,
97
+ items,
98
+ graphsWithNoData,
99
+ loadingGraphs,
100
+ onNoDataSelected
101
+ ]
83
102
  );
84
103
  const title = useMemo(() => {
85
104
  if (!multiple) {
@@ -132,16 +151,20 @@ function GraphDropdown({
132
151
  ),
133
152
  items.map((item, index) => {
134
153
  const isChecked = multiple && selectedItems.has(item.value);
154
+ const isLoading = loadingGraphs?.has(item.value);
155
+ const isDisabled = isLoading;
135
156
  return /* @__PURE__ */ jsx(
136
157
  SelectItem,
137
158
  {
138
159
  value: String(item.value),
160
+ disabled: isDisabled,
139
161
  onSelect: (e) => {
140
162
  if (multiple) {
141
163
  e.preventDefault();
142
164
  }
143
165
  handleValueChange(String(item.value));
144
166
  },
167
+ className: isDisabled ? "opacity-50 cursor-not-allowed" : "",
145
168
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
146
169
  multiple && /* @__PURE__ */ jsx(
147
170
  "span",
@@ -150,7 +173,8 @@ function GraphDropdown({
150
173
  children: isChecked && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" })
151
174
  }
152
175
  ),
153
- item.label
176
+ item.label,
177
+ isLoading && /* @__PURE__ */ jsx(Loader2, { className: "ml-1 h-4 w-4 animate-spin text-muted-foreground" })
154
178
  ] })
155
179
  },
156
180
  `graph-item-${index}-${String(item.value)}`
@@ -1,5 +1,6 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { useMemo, useRef } from 'react';
2
+ import { useMemo, useCallback, useRef } from 'react';
3
+ import { toast } from 'sonner';
3
4
  import { useIsMobile } from '../../hooks/use-media-query.js';
4
5
  import { RangeButtons } from '../buttons/range-buttons/range-buttons.js';
5
6
  import { DEFAULT_SERIES_COLORS } from '../graph/graph.js';
@@ -55,7 +56,10 @@ function TradingView({
55
56
  setRange,
56
57
  onGraphExpanded,
57
58
  isGraphExpanded,
58
- onUnselectSeries
59
+ onUnselectSeries,
60
+ graphsWithNoData,
61
+ loadingGraphs,
62
+ noDataMessage = "No data available for this graph"
59
63
  }) {
60
64
  const dataArray = useMemo(() => {
61
65
  return Array.isArray(data) ? data : data ? [data] : [];
@@ -64,6 +68,12 @@ function TradingView({
64
68
  return Array.isArray(data) && data.length > 1;
65
69
  }, [data]);
66
70
  const isMobile = useIsMobile();
71
+ const handleNoDataSelected = useCallback(
72
+ (_graphValue, _graphLabel) => {
73
+ toast.error(noDataMessage);
74
+ },
75
+ [noDataMessage]
76
+ );
67
77
  const yMeasureUnitSingle = useMemo(() => {
68
78
  if (!yMeasureUnit) return void 0;
69
79
  return Array.isArray(yMeasureUnit) ? yMeasureUnit[0] : yMeasureUnit;
@@ -75,7 +85,10 @@ function TradingView({
75
85
  onSelected: onGraphSelected,
76
86
  items: graphs,
77
87
  defaultItem: defaultGraph,
78
- multiple: isMultipleSelect
88
+ multiple: isMultipleSelect,
89
+ graphsWithNoData,
90
+ loadingGraphs,
91
+ onNoDataSelected: handleNoDataSelected
79
92
  }
80
93
  ) }),
81
94
  /* @__PURE__ */ jsxs("div", { className: "flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1", children: [
@@ -23,12 +23,12 @@ const WithFilterButton = React.forwardRef(
23
23
  {
24
24
  ref,
25
25
  className: cn(
26
- "w-full flex items-center justify-between gap-4",
26
+ "w-full flex items-start md:items-center justify-between gap-4 flex-col md:flex-row",
27
27
  className
28
28
  ),
29
29
  children: [
30
30
  /* @__PURE__ */ jsx("div", { className: "flex-1", children }),
31
- /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
31
+ /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-row-reverse md:flex-row", children: [
32
32
  onClearAll && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "default", onClick: onClearAll, children: "Clear all" }),
33
33
  /* @__PURE__ */ jsx(
34
34
  FilterButton,
@@ -1,3 +1,4 @@
1
+ import tailwindScrollbar from '../_virtual/index.js';
1
2
  import tailwindAnimate from 'tailwindcss-animate';
2
3
 
3
4
  const preset = {
@@ -120,7 +121,7 @@ const preset = {
120
121
  }
121
122
  }
122
123
  },
123
- plugins: [tailwindAnimate]
124
+ plugins: [tailwindAnimate, tailwindScrollbar({ nocompatible: true })]
124
125
  };
125
126
 
126
127
  export { preset as default, preset };