@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
@@ -1,43 +1,61 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { Stack as p } from "../stack/stack.js";
3
- import { useTitleText as r } from "../text/use-title-text.js";
4
- import { Typography as f } from "../../typography/typography.js";
5
- import { VerticalIndicator as l } from "../../vertical-indicator/vertical-indicator.js";
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Stack as c } from "../stack/stack.js";
3
+ import { useTitleText as n } from "../text/use-title-text.js";
4
+ import "react";
5
+ import { pointProgramsOf as f } from "../../../utils/apy-breakdown.js";
6
+ import "@gearbox-protocol/sdk";
7
+ import "clsx";
8
+ import "tailwind-merge";
9
+ import "sonner";
10
+ import "@gearbox-protocol/sdk/common-utils";
11
+ import "luxon";
12
+ import "../../../utils/z-index.js";
13
+ import { PointsValue as l } from "../values/points-value.js";
14
+ import "../../points-icon/points-icon.js";
15
+ import "../../token-icon/token-icon.js";
16
+ import "@fortawesome/free-solid-svg-icons";
17
+ import "../../icons/fa-icon.js";
18
+ import "../../tooltip/simple-tooltip.js";
19
+ import "../../tooltip/tooltip.js";
20
+ import "react-intl";
21
+ import "../../badge/badge.js";
22
+ import { Typography as u } from "../../typography/typography.js";
23
+ import { VerticalIndicator as d } from "../../vertical-indicator/vertical-indicator.js";
6
24
  import { InfoListTest as i } from "./constants.js";
7
- function h({
25
+ function G({
8
26
  children: t
9
27
  }) {
10
- return /* @__PURE__ */ e(p, { gap: "sm", "data-testid": i.root, children: t });
28
+ return /* @__PURE__ */ r(c, { gap: "sm", "data-testid": i.root, children: t });
11
29
  }
12
- function y({
30
+ function g({
13
31
  title: t,
14
32
  value: o,
15
- tip: n,
16
- valueDescription: a,
17
- valueTo: s,
18
- testId: c
33
+ tip: e,
34
+ valueDescription: m,
35
+ valueTo: p,
36
+ testId: s
19
37
  }) {
20
- const m = r();
21
- return /* @__PURE__ */ e(
22
- l,
38
+ const a = n();
39
+ return /* @__PURE__ */ r(
40
+ d,
23
41
  {
24
- label: m(t),
25
- tip: n,
42
+ label: a(t),
43
+ tip: e,
26
44
  value: o,
27
- valueTo: s,
28
- valueDescription: a,
45
+ valueTo: p,
46
+ valueDescription: m,
29
47
  size: "sm",
30
48
  align: "center",
31
- "data-testid": c ?? i.line
49
+ "data-testid": s ?? i.line
32
50
  }
33
51
  );
34
52
  }
35
- function L({
53
+ function H({
36
54
  title: t
37
55
  }) {
38
- const o = r();
39
- return /* @__PURE__ */ e(
40
- f,
56
+ const o = n();
57
+ return /* @__PURE__ */ r(
58
+ u,
41
59
  {
42
60
  as: "span",
43
61
  color: "secondary",
@@ -49,9 +67,16 @@ function L({
49
67
  }
50
68
  );
51
69
  }
70
+ function J({
71
+ data: t,
72
+ title: o = "components.yieldBreakdown.points"
73
+ }) {
74
+ return !t || f(t).length === 0 ? null : /* @__PURE__ */ r(g, { title: o, value: /* @__PURE__ */ r(l, { data: t }) });
75
+ }
52
76
  export {
53
- y as InfoLine,
54
- h as InfoList,
77
+ g as InfoLine,
78
+ G as InfoList,
55
79
  i as InfoListTest,
56
- L as InfoSectionTitle
80
+ H as InfoSectionTitle,
81
+ J as PointsInfoLine
57
82
  };
@@ -2,20 +2,21 @@ import { jsx as t, jsxs as m } from "react/jsx-runtime";
2
2
  import { useState as I } from "react";
3
3
  import { Stack as x } from "../stack/stack.js";
4
4
  import { useTitleText as y } from "../text/use-title-text.js";
5
- import { EditInput as F } from "../../edit-input/edit-input.js";
6
- import { Slider as j } from "../../slider/slider.js";
5
+ import { EditInput as j } from "../../edit-input/edit-input.js";
6
+ import { Slider as F } from "../../slider/slider.js";
7
7
  import "../../slider/slider-context.js";
8
8
  import { TextButton as O } from "../../text-button/text-button.js";
9
9
  import { SimpleTooltip as R } from "../../tooltip/simple-tooltip.js";
10
10
  import "../../tooltip/tooltip.js";
11
11
  import { useIntlTyped as B, FormattedMessageTyped as T } from "../../typed-intl/index.js";
12
12
  import { WithTitle as D } from "../../with-title/with-title.js";
13
+ import { formatLeverage as b } from "../../../utils/format-leverage.js";
13
14
  import { LeverageInputTest as i } from "./constants.js";
14
15
  const o = 100, P = 10;
15
- function Z({
16
- value: r,
16
+ function ee({
17
+ value: n,
17
18
  onChange: s,
18
- max: n,
19
+ max: r,
19
20
  min: l = 1,
20
21
  title: c,
21
22
  hint: d,
@@ -25,11 +26,11 @@ function Z({
25
26
  size: S = "sm"
26
27
  }) {
27
28
  const E = B(), C = y(), p = w ?? [
28
- { start: l, end: n, color: "additionalSuccess" }
29
+ { start: l, end: r, color: "additionalSuccess" }
29
30
  ], L = N ?? (p.length > 0 ? E.formatMessage({
30
31
  messageId: "components.leverageInput.available"
31
- }) : void 0), [M, u] = I(void 0), [f, g] = I(""), h = M ?? r, v = (e) => {
32
- s(_(e, l, n)), u(void 0);
32
+ }) : void 0), [M, u] = I(void 0), [f, g] = I(""), h = M ?? n, v = (e) => {
33
+ s(_(e, l, r)), u(void 0);
33
34
  }, k = () => {
34
35
  const e = Number.parseFloat(f.replace(",", "."));
35
36
  Number.isFinite(e) && v(e);
@@ -49,7 +50,7 @@ function Z({
49
50
  ] }),
50
51
  /* @__PURE__ */ m(x, { direction: "row", align: "center", gap: "sm", children: [
51
52
  /* @__PURE__ */ t("div", { className: "flex w-[90px] flex-row flex-nowrap items-center", children: /* @__PURE__ */ t(
52
- F,
53
+ j,
53
54
  {
54
55
  value: f,
55
56
  placeholder: "0",
@@ -59,7 +60,7 @@ function Z({
59
60
  },
60
61
  "data-testid": i.value,
61
62
  onEditModeChange: (e) => {
62
- e && g(b(r));
63
+ e && g(b(n));
63
64
  },
64
65
  onChange: (e) => g(e.target.value),
65
66
  onSubmit: k
@@ -88,15 +89,15 @@ function Z({
88
89
  ] })
89
90
  ] }),
90
91
  children: /* @__PURE__ */ t(
91
- j,
92
+ F,
92
93
  {
93
94
  from: l * o,
94
- to: n * o,
95
+ to: r * o,
95
96
  precision: o,
96
97
  value: h * o,
97
98
  colorIntervals: V,
98
99
  colorIntervalLabel: L,
99
- markerStep: n > P ? 200 : 100,
100
+ markerStep: r > P ? 200 : 100,
100
101
  "data-testid": i.slider,
101
102
  onChangeValue: (e) => u(e / o),
102
103
  onSubmitValue: (e) => v(e / o)
@@ -105,13 +106,10 @@ function Z({
105
106
  }
106
107
  ) });
107
108
  }
108
- function _(r, s, n) {
109
- return Math.min(Math.max(r, s), n);
110
- }
111
- function b(r) {
112
- return (Math.round(r * 100) / 100).toFixed(2);
109
+ function _(n, s, r) {
110
+ return Math.min(Math.max(n, s), r);
113
111
  }
114
112
  export {
115
- Z as LeverageInput,
113
+ ee as LeverageInput,
116
114
  i as LeverageInputTest
117
115
  };
@@ -1,40 +1,45 @@
1
- import { jsx as e, jsxs as v } from "react/jsx-runtime";
2
- import { useTitleText as g } from "../text/use-title-text.js";
3
- import { FadeoutLoading as m } from "../../fadeout-loading/fadeout-loading.js";
4
- import { FormattedNumberString as P } from "../../formatted-number/formatted-number.js";
5
- import { HealthDot as T } from "../../status-elements/status-elements.js";
6
- import { FormattedMessageTyped as s } from "../../typed-intl/index.js";
1
+ import { jsx as i, jsxs as P } from "react/jsx-runtime";
2
+ import { useTitleText as b } from "../text/use-title-text.js";
3
+ import { FadeoutLoading as s } from "../../fadeout-loading/fadeout-loading.js";
4
+ import { FormattedNumberString as T } from "../../formatted-number/formatted-number.js";
5
+ import { HealthDot as g } from "../../status-elements/status-elements.js";
6
+ import { FormattedMessageTyped as d } from "../../typed-intl/index.js";
7
7
  import { VerticalIndicator as h } from "../../vertical-indicator/vertical-indicator.js";
8
8
  import { bnToLiquidationPriceView as x } from "../../../utils/parse-input-to-bn.js";
9
9
  import { LiquidationPriceBlockTest as r } from "./constants.js";
10
- function j({
11
- price: i,
10
+ function q(e, o) {
11
+ if (!(!e || !o))
12
+ return `${e.symbol} / ${o.symbol}`;
13
+ }
14
+ function D({
15
+ price: e,
12
16
  priceTo: o,
13
- pricePair: t,
17
+ collateral: t,
18
+ underlying: u,
14
19
  zone: l,
15
- isLoading: a,
16
- title: n,
17
- tip: u,
18
- testId: p
20
+ isLoading: n,
21
+ title: a,
22
+ tip: p,
23
+ testId: f
19
24
  }) {
20
- const f = g(), d = o !== void 0;
21
- return /* @__PURE__ */ e(
25
+ const v = b(), m = o !== void 0;
26
+ return /* @__PURE__ */ i(
22
27
  h,
23
28
  {
24
29
  align: "center",
25
30
  dimPreviousValue: !1,
26
- "data-testid": p ?? r.root,
27
- label: n !== void 0 ? f(n) : /* @__PURE__ */ e(s, { messageId: "components.liquidationPriceBlock.label" }),
28
- tip: u ?? /* @__PURE__ */ e(s, { messageId: "components.liquidationPriceBlock.tip" }),
29
- value: /* @__PURE__ */ e(m, { loading: a, children: /* @__PURE__ */ e(
31
+ "data-testid": f ?? r.root,
32
+ label: a !== void 0 ? v(a) : /* @__PURE__ */ i(d, { messageId: "components.liquidationPriceBlock.label" }),
33
+ tip: p ?? /* @__PURE__ */ i(d, { messageId: "components.liquidationPriceBlock.tip" }),
34
+ value: /* @__PURE__ */ i(s, { loading: n, children: /* @__PURE__ */ i(
30
35
  c,
31
36
  {
32
- price: i,
33
- zone: d ? void 0 : l,
37
+ price: e,
38
+ zone: m ? void 0 : l,
34
39
  testId: r.value
35
40
  }
36
41
  ) }),
37
- valueTo: d ? /* @__PURE__ */ e(m, { loading: a, children: /* @__PURE__ */ e(
42
+ valueTo: m ? /* @__PURE__ */ i(s, { loading: n, children: /* @__PURE__ */ i(
38
43
  c,
39
44
  {
40
45
  price: o ?? null,
@@ -42,21 +47,21 @@ function j({
42
47
  testId: r.valueTo
43
48
  }
44
49
  ) }) : void 0,
45
- valueDescription: t
50
+ valueDescription: q(t, u)
46
51
  }
47
52
  );
48
53
  }
49
54
  function c({
50
- price: i,
55
+ price: e,
51
56
  zone: o,
52
57
  testId: t
53
58
  }) {
54
- return /* @__PURE__ */ v("span", { className: "inline-flex items-center", "data-testid": t, children: [
55
- i === void 0 ? "—" : i === null || i === 0n ? "N/A" : /* @__PURE__ */ e(P, { value: x(i) }),
56
- o ? /* @__PURE__ */ e("span", { className: "ml-1.5", children: /* @__PURE__ */ e(T, { zone: o }) }) : null
59
+ return /* @__PURE__ */ P("span", { className: "inline-flex items-center", "data-testid": t, children: [
60
+ e === void 0 ? "—" : e === null || e === 0n ? "N/A" : /* @__PURE__ */ i(T, { value: x(e) }),
61
+ o ? /* @__PURE__ */ i("span", { className: "ml-1.5", children: /* @__PURE__ */ i(g, { zone: o }) }) : null
57
62
  ] });
58
63
  }
59
64
  export {
60
- j as LiquidationPriceBlock,
65
+ D as LiquidationPriceBlock,
61
66
  r as LiquidationPriceBlockTest
62
67
  };
@@ -1,11 +1,12 @@
1
- class t {
1
+ class e {
2
2
  static root = "manage-pane-root";
3
3
  static tabs = "manage-pane-tabs";
4
4
  static dropdown = "manage-pane-dropdown";
5
5
  static body = "manage-pane-body";
6
6
  static message = "manage-pane-message";
7
+ static actionDialog = "manage-pane-action-dialog";
7
8
  static tab = (a) => `manage-pane-tab-${a}`;
8
9
  }
9
10
  export {
10
- t as ManagePaneTest
11
+ e as ManagePaneTest
11
12
  };
@@ -1,140 +1,181 @@
1
- import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
- import { faEllipsis as C } from "@fortawesome/free-solid-svg-icons";
3
- import { Children as A, isValidElement as m } from "react";
4
- import { InfoPortalProvider as _, InfoPortalOut as D } from "../info-portal/info-portal.js";
5
- import { SegmentedTabs as E, SEGMENTED_TABS_INACTIVE_BUTTON_CLASS as N } from "../segmented-tabs/segmented-tabs.js";
6
- import { Stack as r } from "../stack/stack.js";
7
- import { useTitleText as x } from "../text/use-title-text.js";
8
- import { Button as v } from "../../buttons/button/button.js";
9
- import { StyledDialogContainer as B } from "../../client-adapters/styled-dialog-container/styled-dialog-container.js";
10
- import { FaIcon as j } from "../../icons/fa-icon.js";
11
- import { SimpleDropdown as k } from "../../simple-dropdown/simple-dropdown.js";
12
- import { SimpleDropdownMenuItem as z } from "../../simple-dropdown/simple-dropdown-menu-item.js";
13
- import { ManagePaneTest as o } from "./constants.js";
14
- function O(n) {
1
+ import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
+ import { faEllipsis as x } from "@fortawesome/free-solid-svg-icons";
3
+ import { useState as E, Children as N, isValidElement as f } from "react";
4
+ import { InfoPortalProvider as v, InfoPortalOut as O } from "../info-portal/info-portal.js";
5
+ import { SegmentedTabs as k, SEGMENTED_TABS_INACTIVE_BUTTON_CLASS as B } from "../segmented-tabs/segmented-tabs.js";
6
+ import { Stack as e } from "../stack/stack.js";
7
+ import { useTitleText as j } from "../text/use-title-text.js";
8
+ import { Button as z } from "../../buttons/button/button.js";
9
+ import { StyledDialogContainer as V } from "../../client-adapters/styled-dialog-container/styled-dialog-container.js";
10
+ import { ConfirmMenu as F } from "../../confirm-menu/confirm-menu.js";
11
+ import "../../modal/modal.js";
12
+ import "@radix-ui/react-dialog";
13
+ import "../../dialog/dialog-container.js";
14
+ import "../../dialog/dialog-content.js";
15
+ import "../../dialog/dialog-description.js";
16
+ import "../../dialog/dialog-footer.js";
17
+ import "@gearbox-protocol/sdk";
18
+ import "clsx";
19
+ import "tailwind-merge";
20
+ import "sonner";
21
+ import "@gearbox-protocol/sdk/common-utils";
22
+ import "luxon";
23
+ import "../../../utils/z-index.js";
24
+ import "../../dialog/dialog-header.js";
25
+ import "../../dialog/dialog-title.js";
26
+ import { DialogModalContainer as G } from "../../dialog/dialog-modal-container.js";
27
+ import "../../dialog/dialog-overlay.js";
28
+ import "viem";
29
+ import "../../input/input.js";
30
+ import "../../label/label.js";
31
+ import { FaIcon as L } from "../../icons/fa-icon.js";
32
+ import { SimpleDropdown as U } from "../../simple-dropdown/simple-dropdown.js";
33
+ import { SimpleDropdownMenuItem as q } from "../../simple-dropdown/simple-dropdown-menu-item.js";
34
+ import { ManagePaneTest as i } from "./constants.js";
35
+ function H(o) {
15
36
  return null;
16
37
  }
17
- function V(n) {
38
+ function J(o) {
18
39
  return null;
19
40
  }
20
- function F(n) {
41
+ function K(o) {
21
42
  return null;
22
43
  }
23
- function G(n) {
24
- return m(n) && n.type === O;
44
+ function Q(o) {
45
+ return f(o) && o.type === H;
25
46
  }
26
- function L(n) {
27
- return m(n) && n.type === V;
47
+ function R(o) {
48
+ return f(o) && o.type === J;
28
49
  }
29
- function U(n) {
30
- return m(n) && n.type === F;
50
+ function W(o) {
51
+ return f(o) && o.type === K;
31
52
  }
32
- function et({
33
- children: n,
34
- activeTab: c,
35
- onTabChange: h,
36
- header: T,
37
- footer: b,
38
- actions: s,
39
- testId: M
53
+ function Et({
54
+ children: o,
55
+ activeTab: g,
56
+ onTabChange: M,
57
+ header: I,
58
+ footer: S,
59
+ actions: l,
60
+ testId: C
40
61
  }) {
41
- const f = x(), p = A.toArray(n), u = p.filter(G), I = p.find(L), l = p.filter(U), P = u.filter((t) => !t.props.hidden), S = u.find((t) => t.props.id === c)?.props.children, i = I?.props.items ?? [], w = new Set(l.map((t) => t.props.id)), d = [
42
- ...P.map((t) => ({
62
+ const d = j(), [P, h] = E(null), m = N.toArray(o), T = m.filter(Q), w = m.find(R), p = m.filter(W), A = T.filter((t) => !t.props.hidden), D = T.find((t) => t.props.id === g)?.props.children, a = w?.props.items ?? [], y = new Set(p.map((t) => t.props.id)), c = p.find((t) => t.props.id === P), b = () => h(null), u = [
63
+ ...A.map((t) => ({
43
64
  id: t.props.id,
44
- item: f(t.props.title),
65
+ item: d(t.props.title),
45
66
  disabled: t.props.disabled,
46
- testId: o.tab(t.props.id)
67
+ testId: i.tab(t.props.id)
47
68
  })),
48
- ...l.map((t) => ({
69
+ ...p.map((t) => ({
49
70
  id: t.props.id,
50
- item: f(t.props.title),
51
- testId: o.tab(t.props.id)
71
+ item: d(t.props.title),
72
+ testId: i.tab(t.props.id)
52
73
  }))
53
74
  ];
54
- return /* @__PURE__ */ e(_, { children: /* @__PURE__ */ a(r, { gap: "md", "data-testid": M ?? o.root, children: [
55
- T,
56
- d.length > 0 || i.length > 0 || s ? /* @__PURE__ */ a(r, { direction: "row", align: "center", gap: "sm", children: [
57
- d.length > 0 ? /* @__PURE__ */ e(
58
- E,
59
- {
60
- items: d,
61
- activeTab: c,
62
- onTabChange: (t) => {
63
- const g = l.find((y) => y.props.id === t);
64
- if (g) {
65
- g.props.onClick();
66
- return;
67
- }
68
- w.has(t) || h(t);
69
- },
70
- testId: o.tabs
71
- }
72
- ) : null,
73
- i.length > 0 || s ? /* @__PURE__ */ a(
74
- r,
75
+ return /* @__PURE__ */ r(v, { children: [
76
+ /* @__PURE__ */ r(e, { gap: "md", "data-testid": C ?? i.root, children: [
77
+ I,
78
+ u.length > 0 || a.length > 0 || l ? /* @__PURE__ */ r(e, { direction: "row", align: "center", gap: "sm", children: [
79
+ u.length > 0 ? /* @__PURE__ */ n(
80
+ k,
81
+ {
82
+ items: u,
83
+ activeTab: g,
84
+ onTabChange: (t) => {
85
+ const s = p.find((_) => _.props.id === t);
86
+ if (s) {
87
+ s.props.children != null && h(s.props.id), s.props.onClick?.();
88
+ return;
89
+ }
90
+ y.has(t) || M(t);
91
+ },
92
+ testId: i.tabs
93
+ }
94
+ ) : null,
95
+ a.length > 0 || l ? /* @__PURE__ */ r(
96
+ e,
97
+ {
98
+ direction: "row",
99
+ align: "center",
100
+ gap: "sm",
101
+ className: "ml-auto",
102
+ children: [
103
+ a.length > 0 ? /* @__PURE__ */ n(
104
+ U,
105
+ {
106
+ title: /* @__PURE__ */ n(
107
+ z,
108
+ {
109
+ type: "button",
110
+ variant: "ghost",
111
+ size: "md",
112
+ className: B,
113
+ "aria-label": "More actions",
114
+ "data-testid": i.dropdown,
115
+ children: /* @__PURE__ */ n(L, { icon: x, className: "size-4" })
116
+ }
117
+ ),
118
+ asChild: !0,
119
+ placement: "bottom",
120
+ align: "end",
121
+ children: a.map((t) => /* @__PURE__ */ n(
122
+ q,
123
+ {
124
+ onSelect: t.onSelect,
125
+ children: t.title
126
+ },
127
+ t.id
128
+ ))
129
+ }
130
+ ) : null,
131
+ l
132
+ ]
133
+ }
134
+ ) : null
135
+ ] }) : null,
136
+ /* @__PURE__ */ r(
137
+ V,
75
138
  {
76
- direction: "row",
77
- align: "center",
78
- gap: "sm",
79
- className: "ml-auto",
139
+ "data-testid": i.body,
140
+ "data-aside-form-top": !0,
80
141
  children: [
81
- i.length > 0 ? /* @__PURE__ */ e(
82
- k,
83
- {
84
- title: /* @__PURE__ */ e(
85
- v,
86
- {
87
- type: "button",
88
- variant: "ghost",
89
- size: "md",
90
- className: N,
91
- "aria-label": "More actions",
92
- "data-testid": o.dropdown,
93
- children: /* @__PURE__ */ e(j, { icon: C, className: "size-4" })
94
- }
95
- ),
96
- asChild: !0,
97
- placement: "bottom",
98
- align: "end",
99
- children: i.map((t) => /* @__PURE__ */ e(
100
- z,
101
- {
102
- onSelect: t.onSelect,
103
- children: t.title
104
- },
105
- t.id
106
- ))
107
- }
108
- ) : null,
109
- s
142
+ /* @__PURE__ */ n(e, { children: /* @__PURE__ */ n(O, {}) }),
143
+ D
110
144
  ]
111
145
  }
112
- ) : null
113
- ] }) : null,
114
- /* @__PURE__ */ a(
115
- B,
146
+ ),
147
+ S
148
+ ] }),
149
+ c?.props.children != null ? /* @__PURE__ */ n(
150
+ G,
116
151
  {
117
- "data-testid": o.body,
118
- "data-aside-form-top": !0,
119
- children: [
120
- /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(D, {}) }),
121
- S
122
- ]
152
+ show: !0,
153
+ onClickOutside: b,
154
+ dialog: { padding: "xl" },
155
+ children: /* @__PURE__ */ r("div", { "data-testid": i.actionDialog, children: [
156
+ /* @__PURE__ */ n(
157
+ F,
158
+ {
159
+ onClose: b,
160
+ title: d(c.props.title)
161
+ }
162
+ ),
163
+ c.props.children
164
+ ] })
123
165
  }
124
- ),
125
- b
126
- ] }) });
166
+ ) : null
167
+ ] });
127
168
  }
128
- function ot({
129
- children: n
169
+ function Nt({
170
+ children: o
130
171
  }) {
131
- return /* @__PURE__ */ e(r, { gap: "sm", "data-testid": o.message, children: n });
172
+ return /* @__PURE__ */ n(e, { gap: "sm", "data-testid": i.message, children: o });
132
173
  }
133
174
  export {
134
- et as ManagePane,
135
- F as ManagePaneActionTab,
136
- ot as ManagePaneMessage,
137
- O as ManagePaneTab,
138
- V as ManagePaneTabDropdown,
139
- o as ManagePaneTest
175
+ Et as ManagePane,
176
+ K as ManagePaneActionTab,
177
+ Nt as ManagePaneMessage,
178
+ H as ManagePaneTab,
179
+ J as ManagePaneTabDropdown,
180
+ i as ManagePaneTest
140
181
  };
@@ -1,6 +1,7 @@
1
- import { PageTitle as o } from "./page-title.js";
2
- import { PageTitleTest as T } from "./constants.js";
1
+ import { PageHeadProvider as o, PageTitle as t } from "./page-title.js";
2
+ import { PageTitleTest as P } from "./constants.js";
3
3
  export {
4
- o as PageTitle,
5
- T as PageTitleTest
4
+ o as PageHeadProvider,
5
+ t as PageTitle,
6
+ P as PageTitleTest
6
7
  };