@gearbox-protocol/ui-kit 4.0.0-next.2 → 4.0.0-next.4

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 (82) hide show
  1. package/dist/cjs/components/base/borrow-rate-block/borrow-rate-block.cjs +1 -1
  2. package/dist/cjs/components/base/detailed-page-title/detailed-page-title.cjs +1 -1
  3. package/dist/cjs/components/base/health-factor-block/health-factor-block.cjs +1 -1
  4. package/dist/cjs/components/base/index.cjs +1 -1
  5. package/dist/cjs/components/base/info-list/index.cjs +1 -1
  6. package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
  7. package/dist/cjs/components/base/leverage-input/leverage-input.cjs +1 -1
  8. package/dist/cjs/components/base/liquidation-price-block/liquidation-price-block.cjs +1 -1
  9. package/dist/cjs/components/base/manage-pane/constants.cjs +1 -1
  10. package/dist/cjs/components/base/manage-pane/manage-pane.cjs +1 -1
  11. package/dist/cjs/components/base/page-title/index.cjs +1 -1
  12. package/dist/cjs/components/base/page-title/page-title.cjs +1 -1
  13. package/dist/cjs/components/base/stat-badge/stat-badge.cjs +1 -1
  14. package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
  15. package/dist/cjs/components/base/time-to-liquidation-block/time-to-liquidation-block.cjs +1 -1
  16. package/dist/cjs/components/base/token-amount/token-amount.cjs +1 -1
  17. package/dist/cjs/components/base/values/constants.cjs +1 -1
  18. package/dist/cjs/components/base/values/index.cjs +1 -1
  19. package/dist/cjs/components/base/values/points-value.cjs +1 -0
  20. package/dist/cjs/components/base/values/scalars.cjs +1 -1
  21. package/dist/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -1
  22. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  23. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  24. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-row.cjs +1 -1
  25. package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +1 -1
  26. package/dist/cjs/components/graph/graph-view.cjs +1 -1
  27. package/dist/cjs/components/index.cjs +1 -1
  28. package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
  29. package/dist/cjs/index.cjs +1 -1
  30. package/dist/cjs/utils/format-leverage.cjs +1 -0
  31. package/dist/cjs/utils/index.cjs +1 -1
  32. package/dist/esm/components/base/borrow-rate-block/borrow-rate-block.js +31 -25
  33. package/dist/esm/components/base/detailed-page-title/detailed-page-title.js +26 -27
  34. package/dist/esm/components/base/health-factor-block/health-factor-block.js +25 -25
  35. package/dist/esm/components/base/index.js +141 -136
  36. package/dist/esm/components/base/info-list/index.js +5 -4
  37. package/dist/esm/components/base/info-list/info-list.js +52 -27
  38. package/dist/esm/components/base/leverage-input/leverage-input.js +17 -19
  39. package/dist/esm/components/base/liquidation-price-block/liquidation-price-block.js +33 -28
  40. package/dist/esm/components/base/manage-pane/constants.js +3 -2
  41. package/dist/esm/components/base/manage-pane/manage-pane.js +154 -113
  42. package/dist/esm/components/base/page-title/index.js +5 -4
  43. package/dist/esm/components/base/page-title/page-title.js +31 -23
  44. package/dist/esm/components/base/stat-badge/stat-badge.js +18 -9
  45. package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +3 -2
  46. package/dist/esm/components/base/time-to-liquidation-block/time-to-liquidation-block.js +31 -31
  47. package/dist/esm/components/base/token-amount/token-amount.js +17 -16
  48. package/dist/esm/components/base/values/constants.js +1 -0
  49. package/dist/esm/components/base/values/index.js +16 -13
  50. package/dist/esm/components/base/values/points-value.js +30 -0
  51. package/dist/esm/components/base/values/scalars.js +29 -27
  52. package/dist/esm/components/block-sync-pill/block-sync-pill.js +17 -16
  53. package/dist/esm/components/checkbox/checkbox-labeled.js +15 -14
  54. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +15 -14
  55. package/dist/esm/components/composites/pool-assets-table/pool-assets-table-row.js +17 -15
  56. package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +24 -23
  57. package/dist/esm/components/graph/graph-view.js +78 -95
  58. package/dist/esm/components/index.js +665 -660
  59. package/dist/esm/components/with-copy/with-copy.js +17 -16
  60. package/dist/esm/index.js +843 -836
  61. package/dist/esm/utils/format-leverage.js +6 -0
  62. package/dist/esm/utils/index.js +80 -78
  63. package/dist/globals.css +1 -1
  64. package/dist/types/components/base/borrow-rate-block/borrow-rate-block.d.ts +10 -5
  65. package/dist/types/components/base/detailed-page-title/detailed-page-title.d.ts +1 -3
  66. package/dist/types/components/base/health-factor-block/health-factor-block.d.ts +6 -6
  67. package/dist/types/components/base/info-list/info-list.d.ts +7 -0
  68. package/dist/types/components/base/liquidation-price-block/liquidation-price-block.d.ts +6 -4
  69. package/dist/types/components/base/manage-pane/constants.d.ts +1 -0
  70. package/dist/types/components/base/manage-pane/manage-pane.d.ts +3 -1
  71. package/dist/types/components/base/page-title/page-title.d.ts +12 -6
  72. package/dist/types/components/base/time-to-liquidation-block/time-to-liquidation-block.d.ts +5 -6
  73. package/dist/types/components/base/token-amount/token-amount.d.ts +8 -2
  74. package/dist/types/components/base/values/constants.d.ts +1 -0
  75. package/dist/types/components/base/values/index.d.ts +2 -1
  76. package/dist/types/components/base/values/points-value.d.ts +11 -0
  77. package/dist/types/components/base/values/position-short-label.d.ts +1 -1
  78. package/dist/types/components/base/values/scalars.d.ts +9 -0
  79. package/dist/types/components/composites/pool-assets-table/pool-assets-table-row.d.ts +1 -1
  80. package/dist/types/utils/format-leverage.d.ts +5 -0
  81. package/dist/types/utils/index.d.ts +1 -0
  82. package/package.json +2 -2
@@ -33,10 +33,11 @@ import "../../token-symbol/token-symbol.js";
33
33
  import "../../simple-accordion/simple-accordion.js";
34
34
  import "../../tip-card/tip-card.js";
35
35
  import "../../typography/typography.js";
36
- import "../../vertical-indicator/vertical-indicator.js";
37
36
  import "../../points-icon/points-icon.js";
38
37
  import "@fortawesome/free-solid-svg-icons";
39
38
  import "../../icons/fa-icon.js";
39
+ import "../../vertical-indicator/vertical-indicator.js";
40
+ import "../../base/page-title/page-title.js";
40
41
  import "../../detailed-page-title/detailed-page-title-copy-button.js";
41
42
  import "../../detailed-page-title/detailed-page-title-explorer-dropdown.js";
42
43
  import "../../base/details-view/detail-aside/detail-aside-scope.js";
@@ -60,6 +61,19 @@ import "../../with-title/with-title.js";
60
61
  import "../../status-elements/status-elements.js";
61
62
  import "react-router-dom";
62
63
  import "../styled-dialog-container/styled-dialog-container.js";
64
+ import "../../modal/modal.js";
65
+ import "@radix-ui/react-dialog";
66
+ import "../../dialog/dialog-container.js";
67
+ import "../../dialog/dialog-content.js";
68
+ import "../../dialog/dialog-description.js";
69
+ import "../../dialog/dialog-footer.js";
70
+ import "../../dialog/dialog-header.js";
71
+ import "../../dialog/dialog-title.js";
72
+ import "../../dialog/dialog-modal-container.js";
73
+ import "../../dialog/dialog-overlay.js";
74
+ import "viem";
75
+ import "../../input/input.js";
76
+ import "../../label/label.js";
63
77
  import "../../simple-dropdown/simple-dropdown.js";
64
78
  import "../../simple-dropdown/simple-dropdown-menu-item.js";
65
79
  import "../../help-tip/help-tip.js";
@@ -73,21 +87,8 @@ import "../../checkbox-item/checkbox-item.js";
73
87
  import "../styled-button/styled-button.js";
74
88
  import "../../composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js";
75
89
  import "../../composites/tx-preview/confirm/dialog/constants.js";
76
- import "../../modal/modal.js";
77
- import "../../dialog/dialog-container.js";
78
90
  import "../../spinner-loader/spinner-loader.js";
79
91
  import "../../detailed-apy/detailed-apy.js";
80
- import "@radix-ui/react-dialog";
81
- import "../../dialog/dialog-content.js";
82
- import "../../dialog/dialog-description.js";
83
- import "../../dialog/dialog-footer.js";
84
- import "../../dialog/dialog-header.js";
85
- import "../../dialog/dialog-title.js";
86
- import "../../dialog/dialog-modal-container.js";
87
- import "../../dialog/dialog-overlay.js";
88
- import "viem";
89
- import "../../input/input.js";
90
- import "../../label/label.js";
91
92
  import "../../dropdown-menu/dropdown-menu.js";
92
93
  import "../../dropdown-menu/dropdown-menu-checkbox-item.js";
93
94
  import "../../dropdown-menu/dropdown-menu-content.js";
@@ -1,32 +1,34 @@
1
1
  import { jsx as e, jsxs as t, Fragment as N } from "react/jsx-runtime";
2
2
  import "react";
3
- import "@gearbox-protocol/sdk/common-utils";
4
- import { useIsMobile as y, useIsDesktop as L } from "../../../hooks/use-media-query.js";
5
3
  import "@gearbox-protocol/sdk";
6
4
  import "clsx";
7
5
  import "tailwind-merge";
8
6
  import "sonner";
9
- import { percentageTemplate as S } from "../../../utils/format-money.js";
7
+ import "@gearbox-protocol/sdk/common-utils";
10
8
  import "luxon";
11
9
  import "../../../utils/z-index.js";
10
+ import "../../points-icon/points-icon.js";
11
+ import { bps as y } from "../../base/values/scalars.js";
12
+ import "../../badge/badge.js";
13
+ import { FormattedMessageTyped as o } from "../../typed-intl/index.js";
14
+ import { useIsMobile as L, useIsDesktop as S } from "../../../hooks/use-media-query.js";
12
15
  import { ShortString as c } from "../../short-string/short-string.js";
13
16
  import { GridTableRow as A, GridTableCell as s } from "../../table/grid-table.js";
14
17
  import { TableLineSm as k, TableCellSm as p } from "../../table/table-sm.js";
15
18
  import { TokenSymbol as v } from "../../token-symbol/token-symbol.js";
16
19
  import { TokenTemplate as d } from "../../token-template/token-template.js";
17
- import { FormattedMessageTyped as o } from "../../typed-intl/index.js";
18
20
  import { Typography as w } from "../../typography/typography.js";
19
- function O({
21
+ function W({
20
22
  poolName: h,
21
23
  token: l,
22
24
  currentQuota: g,
23
25
  underlyingToken: r,
24
26
  last: u
25
27
  }) {
26
- const { limit: f, totalQuoted: x, rate: T } = g, a = y(), b = L() ? 21 : a ? 40 : 16, i = () => /* @__PURE__ */ t("div", { className: "flex items-center flex-col-auto", children: [
28
+ const { limit: f, totalQuoted: b, rate: x } = g, i = L(), T = S() ? 21 : i ? 40 : 16, m = () => /* @__PURE__ */ t("div", { className: "flex items-center flex-col-auto", children: [
27
29
  /* @__PURE__ */ e(v, { token: l, size: 32 }),
28
30
  /* @__PURE__ */ t("span", { className: "ml-1.5 md:ml-2.5 text-left", children: [
29
- /* @__PURE__ */ e(c, { maxLength: b, children: l?.title }),
31
+ /* @__PURE__ */ e(c, { maxLength: T, children: l?.title }),
30
32
  /* @__PURE__ */ e(
31
33
  w,
32
34
  {
@@ -38,7 +40,7 @@ function O({
38
40
  }
39
41
  )
40
42
  ] })
41
- ] }), m = () => S(T), n = () => /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
43
+ ] }), a = () => y(Number(x)), n = () => /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
42
44
  o,
43
45
  {
44
46
  messageId: "components.poolAssetsTable.usage",
@@ -46,7 +48,7 @@ function O({
46
48
  amount: /* @__PURE__ */ e(
47
49
  d,
48
50
  {
49
- value: x,
51
+ value: b,
50
52
  token: r,
51
53
  decimalPartLength: 2,
52
54
  precision: 2,
@@ -77,19 +79,19 @@ function O({
77
79
  style: {
78
80
  minHeight: "75px"
79
81
  },
80
- children: a ? /* @__PURE__ */ e(s, { span: "full", size: "sm", className: "px-3 py-0!", children: /* @__PURE__ */ t(
82
+ children: i ? /* @__PURE__ */ e(s, { span: "full", size: "sm", className: "px-3 py-0!", children: /* @__PURE__ */ t(
81
83
  k,
82
84
  {
83
85
  columns: 2,
84
86
  columnsXs: 2,
85
- title: i(),
87
+ title: m(),
86
88
  className: "w-full",
87
89
  children: [
88
90
  /* @__PURE__ */ e(
89
91
  p,
90
92
  {
91
93
  title: /* @__PURE__ */ e(o, { messageId: "components.poolAssetsTable.rate" }),
92
- children: m()
94
+ children: a()
93
95
  }
94
96
  ),
95
97
  /* @__PURE__ */ e(
@@ -102,13 +104,13 @@ function O({
102
104
  ]
103
105
  }
104
106
  ) }) : /* @__PURE__ */ t(N, { children: [
105
- /* @__PURE__ */ e(s, { textAlign: "left", className: "pl-4", size: "sm", children: i() }),
106
- /* @__PURE__ */ e(s, { textAlign: "right", size: "sm", children: m() }),
107
+ /* @__PURE__ */ e(s, { textAlign: "left", className: "pl-4", size: "sm", children: m() }),
108
+ /* @__PURE__ */ e(s, { textAlign: "right", size: "sm", children: a() }),
107
109
  /* @__PURE__ */ e(s, { textAlign: "right", className: "pr-4", size: "sm", children: n() })
108
110
  ] })
109
111
  }
110
112
  );
111
113
  }
112
114
  export {
113
- O as PoolAssetsTableRow
115
+ W as PoolAssetsTableRow
114
116
  };
@@ -32,10 +32,11 @@ import "../../../../token-symbol/token-symbol.js";
32
32
  import "../../../../simple-accordion/simple-accordion.js";
33
33
  import "../../../../tip-card/tip-card.js";
34
34
  import "../../../../typography/typography.js";
35
- import "../../../../vertical-indicator/vertical-indicator.js";
36
35
  import "../../../../points-icon/points-icon.js";
37
36
  import "@fortawesome/free-solid-svg-icons";
38
37
  import "../../../../icons/fa-icon.js";
38
+ import "../../../../vertical-indicator/vertical-indicator.js";
39
+ import "../../../../base/page-title/page-title.js";
39
40
  import "../../../../detailed-page-title/detailed-page-title-copy-button.js";
40
41
  import "../../../../detailed-page-title/detailed-page-title-explorer-dropdown.js";
41
42
  import "../../../../base/details-view/detail-aside/detail-aside-scope.js";
@@ -59,6 +60,19 @@ import "../../../../with-title/with-title.js";
59
60
  import "../../../../status-elements/status-elements.js";
60
61
  import "react-router-dom";
61
62
  import { StyledDialogContainer as C } from "../../../../client-adapters/styled-dialog-container/styled-dialog-container.js";
63
+ import { Modal as u } from "../../../../modal/modal.js";
64
+ import "@radix-ui/react-dialog";
65
+ import "../../../../dialog/dialog-container.js";
66
+ import "../../../../dialog/dialog-content.js";
67
+ import "../../../../dialog/dialog-description.js";
68
+ import "../../../../dialog/dialog-footer.js";
69
+ import "../../../../dialog/dialog-header.js";
70
+ import "../../../../dialog/dialog-title.js";
71
+ import "../../../../dialog/dialog-modal-container.js";
72
+ import "../../../../dialog/dialog-overlay.js";
73
+ import "viem";
74
+ import "../../../../input/input.js";
75
+ import "../../../../label/label.js";
62
76
  import "../../../../simple-dropdown/simple-dropdown.js";
63
77
  import "../../../../simple-dropdown/simple-dropdown-menu-item.js";
64
78
  import "../../../../help-tip/help-tip.js";
@@ -72,23 +86,10 @@ import "../../../../checkbox-item/checkbox-item.js";
72
86
  import "../../../../client-adapters/styled-button/styled-button.js";
73
87
  import "../../../../client-adapters/styled-rounded-image/styled-rounded-image.js";
74
88
  import "../amounts/TransactionConfirmAmountField.js";
75
- import { TransactionConfirmDialogTest as u, transactionConfirmModalContainerVariants as M, transactionConfirmDialogShellVariants as T } from "./constants.js";
76
- import { TransactionConfirmShell as g } from "./TransactionConfirmShell.js";
89
+ import { TransactionConfirmDialogTest as M, transactionConfirmModalContainerVariants as T, transactionConfirmDialogShellVariants as g } from "./constants.js";
90
+ import { TransactionConfirmShell as h } from "./TransactionConfirmShell.js";
77
91
  import "../../../../spinner-loader/spinner-loader.js";
78
92
  import "../../../../detailed-apy/detailed-apy.js";
79
- import { Modal as h } from "../../../../modal/modal.js";
80
- import "@radix-ui/react-dialog";
81
- import "../../../../dialog/dialog-container.js";
82
- import "../../../../dialog/dialog-content.js";
83
- import "../../../../dialog/dialog-description.js";
84
- import "../../../../dialog/dialog-footer.js";
85
- import "../../../../dialog/dialog-header.js";
86
- import "../../../../dialog/dialog-title.js";
87
- import "../../../../dialog/dialog-modal-container.js";
88
- import "../../../../dialog/dialog-overlay.js";
89
- import "viem";
90
- import "../../../../input/input.js";
91
- import "../../../../label/label.js";
92
93
  import "../../../../dropdown-menu/dropdown-menu.js";
93
94
  import "../../../../dropdown-menu/dropdown-menu-checkbox-item.js";
94
95
  import "../../../../dropdown-menu/dropdown-menu-content.js";
@@ -130,7 +131,7 @@ import "../../../../split-list/split-list.js";
130
131
  import "../../../../status-dot/status-dot.js";
131
132
  import "../../../../textarea/textarea.js";
132
133
  import "../../../../theme-provider.js";
133
- function Po({
134
+ function Qo({
134
135
  open: i,
135
136
  onClose: t,
136
137
  title: m,
@@ -144,16 +145,16 @@ function Po({
144
145
  }) {
145
146
  if (!i) return null;
146
147
  const f = o !== "confirm" && o !== "awaiting_receipt" && n ? void 0 : p;
147
- return /* @__PURE__ */ r(h, { show: i, onClickOutside: t, zIndexLayer: "MODAL", children: /* @__PURE__ */ r(
148
+ return /* @__PURE__ */ r(u, { show: i, onClickOutside: t, zIndexLayer: "MODAL", children: /* @__PURE__ */ r(
148
149
  C,
149
150
  {
150
151
  className: c(
151
- T(),
152
- a ?? M()
152
+ g(),
153
+ a ?? T()
153
154
  ),
154
155
  "data-testid": e,
155
156
  children: /* @__PURE__ */ r(
156
- g,
157
+ h,
157
158
  {
158
159
  ...l,
159
160
  header: /* @__PURE__ */ r(
@@ -164,7 +165,7 @@ function Po({
164
165
  onClose: t
165
166
  }
166
167
  ),
167
- "data-testid": d ?? u.root,
168
+ "data-testid": d ?? M.root,
168
169
  phase: o
169
170
  }
170
171
  )
@@ -172,5 +173,5 @@ function Po({
172
173
  ) });
173
174
  }
174
175
  export {
175
- Po as TransactionConfirmModalView
176
+ Qo as TransactionConfirmModalView
176
177
  };
@@ -1,11 +1,12 @@
1
- import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
- import { cva as B } from "class-variance-authority";
3
- import * as D from "react";
4
- import { useMemo as M, useRef as b, useState as E, useEffect as I } from "react";
5
- import { SpinnerLoader as O } from "../spinner-loader/spinner-loader.js";
6
- import { cn as R } from "../../utils/cn.js";
7
- import { Graph as P } from "./graph.js";
8
- const q = B(
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import { IconInfo as L } from "@gearbox-protocol/static";
3
+ import { cva as D } from "class-variance-authority";
4
+ import * as B from "react";
5
+ import { useMemo as E, useRef as w, useState as O, useEffect as P } from "react";
6
+ import { SpinnerLoader as q } from "../spinner-loader/spinner-loader.js";
7
+ import { cn as j } from "../../utils/cn.js";
8
+ import { Graph as F } from "./graph.js";
9
+ const J = D(
9
10
  "relative w-full overflow-hidden rounded-lg border-border border bg-card text-card-foreground",
10
11
  {
11
12
  variants: {
@@ -35,64 +36,46 @@ const q = B(
35
36
  padding: "default"
36
37
  }
37
38
  }
38
- ), V = D.forwardRef(
39
+ ), k = B.forwardRef(
39
40
  ({
40
- className: n,
41
+ className: r,
41
42
  variant: t,
42
43
  size: l,
43
44
  padding: m,
44
- title: a,
45
- description: s,
46
- toolbar: r,
45
+ title: s,
46
+ description: a,
47
+ toolbar: n,
47
48
  loading: i = !1,
48
49
  emptyMessage: d,
49
50
  error: c,
50
- children: f,
51
+ children: h,
51
52
  ...x
52
53
  }, g) => {
53
- const u = a || s || r;
54
- return /* @__PURE__ */ h(
54
+ const u = s || a || n;
55
+ return /* @__PURE__ */ o(
55
56
  "div",
56
57
  {
57
58
  ref: g,
58
- className: R(
59
+ className: j(
59
60
  "flex flex-col",
60
- q({ variant: t, size: l, padding: m, className: n })
61
+ J({ variant: t, size: l, padding: m, className: r })
61
62
  ),
62
63
  ...x,
63
64
  children: [
64
- u && /* @__PURE__ */ h("div", { className: "mb-4 flex items-start justify-between gap-4 shrink-0", children: [
65
- (a || s) && /* @__PURE__ */ h("div", { className: "flex-1", children: [
66
- a && /* @__PURE__ */ e("h3", { className: "text-base sm:text-lg font-semibold leading-none tracking-tight", children: a }),
67
- s && /* @__PURE__ */ e("p", { className: "mt-1 text-xs sm:text-sm text-muted-foreground", children: s })
65
+ u && /* @__PURE__ */ o("div", { className: "mb-4 flex items-start justify-between gap-4 shrink-0", children: [
66
+ (s || a) && /* @__PURE__ */ o("div", { className: "flex-1", children: [
67
+ s && /* @__PURE__ */ e("h3", { className: "text-base sm:text-lg font-semibold leading-none tracking-tight", children: s }),
68
+ a && /* @__PURE__ */ e("p", { className: "mt-1 text-xs sm:text-sm text-muted-foreground", children: a })
68
69
  ] }),
69
- r && /* @__PURE__ */ e("div", { className: "shrink-0 w-full", children: r })
70
+ n && /* @__PURE__ */ e("div", { className: "shrink-0 w-full", children: n })
70
71
  ] }),
71
- /* @__PURE__ */ h("div", { className: "relative flex-1 w-full min-h-0", children: [
72
- i && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center opacity-0 animate-delayed-fade-in", children: /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2", children: /* @__PURE__ */ e(O, { size: 32, width: 3 }) }) }),
73
- c && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ h("div", { className: "flex flex-col items-center gap-2 text-destructive", children: [
74
- /* @__PURE__ */ e(
75
- "svg",
76
- {
77
- className: "h-12 w-12",
78
- fill: "none",
79
- viewBox: "0 0 24 24",
80
- stroke: "currentColor",
81
- "aria-hidden": "true",
82
- children: /* @__PURE__ */ e(
83
- "path",
84
- {
85
- strokeLinecap: "round",
86
- strokeLinejoin: "round",
87
- strokeWidth: 2,
88
- d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
89
- }
90
- )
91
- }
92
- ),
93
- /* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: c })
72
+ /* @__PURE__ */ o("div", { className: "relative flex-1 w-full min-h-0", children: [
73
+ i && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center opacity-0 animate-delayed-fade-in", children: /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2", children: /* @__PURE__ */ e(q, { size: 32, width: 3 }) }) }),
74
+ c && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
75
+ /* @__PURE__ */ e(L, { size: 48, className: "size-12" }),
76
+ /* @__PURE__ */ e("span", { className: "text-xs sm:text-sm", children: c })
94
77
  ] }) }),
95
- !c && !f && d && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ h("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
78
+ !c && !h && d && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
96
79
  /* @__PURE__ */ e(
97
80
  "svg",
98
81
  {
@@ -117,11 +100,11 @@ const q = B(
117
100
  /* @__PURE__ */ e(
118
101
  "div",
119
102
  {
120
- className: R(
103
+ className: j(
121
104
  "w-full h-full transition-[filter] duration-300 delay-300",
122
105
  i && "blur-sm pointer-events-none"
123
106
  ),
124
- children: !c && f
107
+ children: !c && h
125
108
  }
126
109
  )
127
110
  ] })
@@ -130,35 +113,35 @@ const q = B(
130
113
  );
131
114
  }
132
115
  );
133
- V.displayName = "GraphView";
134
- function Y({
135
- series: n,
116
+ k.displayName = "GraphView";
117
+ function _({
118
+ series: r,
136
119
  data: t,
137
120
  lineColor: l,
138
121
  color: m,
139
- topColor: a,
140
- bottomColor: s,
141
- graphId: r,
122
+ topColor: s,
123
+ bottomColor: a,
124
+ graphId: n,
142
125
  onUnselectSeries: i,
143
126
  loading: d,
144
127
  title: c,
145
- description: f,
128
+ description: h,
146
129
  toolbar: x,
147
130
  emptyMessage: g = "No data available",
148
131
  error: u,
149
- containerClassName: W,
150
- variant: z,
132
+ containerClassName: z,
133
+ variant: W,
151
134
  size: G,
152
- padding: L,
135
+ padding: S,
153
136
  yMeasureUnit: N,
154
- showCurrentValue: k,
155
- ...S
137
+ showCurrentValue: y,
138
+ ...H
156
139
  }) {
157
- const v = M(() => {
158
- if (n && n.length > 0)
159
- return n;
140
+ const v = E(() => {
141
+ if (r && r.length > 0)
142
+ return r;
160
143
  if (t && t.length > 0) {
161
- const o = l ?? m;
144
+ const f = l ?? m;
162
145
  return [
163
146
  {
164
147
  data: t.map((p) => ({
@@ -167,59 +150,59 @@ function Y({
167
150
  })),
168
151
  label: "Value",
169
152
  yMeasureUnit: N,
170
- ...o && { lineColor: o },
171
- ...a && { topColor: a },
172
- ...s && { bottomColor: s }
153
+ ...f && { lineColor: f },
154
+ ...s && { topColor: s },
155
+ ...a && { bottomColor: a }
173
156
  }
174
157
  ];
175
158
  }
176
159
  return [];
177
- }, [n, t, N, l, m, a, s]), w = v.some((o) => o.data.length > 0), H = !d && !w, y = b(v);
178
- w && (y.current = v);
179
- const j = d && !w ? y.current : v, A = j.some((o) => o.data.length > 0);
160
+ }, [r, t, N, l, m, s, a]), b = v.some((f) => f.data.length > 0), A = !d && !b, R = w(v);
161
+ b && (R.current = v);
162
+ const V = d && !b ? R.current : v, I = V.some((f) => f.data.length > 0);
180
163
  return /* @__PURE__ */ e(
181
- V,
164
+ k,
182
165
  {
183
- className: W,
184
- variant: z,
166
+ className: z,
167
+ variant: W,
185
168
  size: G,
186
- padding: L,
169
+ padding: S,
187
170
  title: c,
188
- description: f,
171
+ description: h,
189
172
  toolbar: x,
190
173
  loading: d,
191
174
  error: u,
192
- emptyMessage: H ? g : void 0,
193
- children: A && !u && /* @__PURE__ */ e(
194
- P,
175
+ emptyMessage: A ? g : void 0,
176
+ children: I && !u && /* @__PURE__ */ e(
177
+ F,
195
178
  {
196
- series: j,
179
+ series: V,
197
180
  yMeasureUnit: N,
198
181
  ...i ? { onUnselectSeries: i } : {},
199
- ...k !== void 0 ? { showCurrentValue: k } : {},
200
- ...S
182
+ ...y !== void 0 ? { showCurrentValue: y } : {},
183
+ ...H
201
184
  }
202
185
  )
203
186
  }
204
187
  );
205
188
  }
206
- function Z(n = 0) {
207
- const t = b(null), l = b(null), [m, a] = E(null);
208
- return I(() => {
209
- const s = () => {
189
+ function $(r = 0) {
190
+ const t = w(null), l = w(null), [m, s] = O(null);
191
+ return P(() => {
192
+ const a = () => {
210
193
  if (t.current && l.current) {
211
194
  const d = l.current.clientWidth, c = t.current.clientWidth;
212
- a(d - c - n);
195
+ s(d - c - r);
213
196
  }
214
- }, r = l.current, i = r ? new ResizeObserver(s) : null;
215
- return r && i?.observe(r), () => {
216
- r && i?.unobserve(r);
197
+ }, n = l.current, i = n ? new ResizeObserver(a) : null;
198
+ return n && i?.observe(n), () => {
199
+ n && i?.unobserve(n);
217
200
  };
218
- }, [n]), { graphWidth: m, parentRef: l, asideRef: t };
201
+ }, [r]), { graphWidth: m, parentRef: l, asideRef: t };
219
202
  }
220
203
  export {
221
- V as GraphView,
222
- Y as GraphViewWithData,
223
- q as graphViewVariants,
224
- Z as useGraphAside
204
+ k as GraphView,
205
+ _ as GraphViewWithData,
206
+ J as graphViewVariants,
207
+ $ as useGraphAside
225
208
  };