@gearbox-protocol/permissionless-ui 1.22.0-next.40 → 1.22.0-next.41

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 (37) hide show
  1. package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
  2. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  3. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  4. package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
  5. package/dist/cjs/components/fadeout-loading/fadeout-loading.cjs +1 -1
  6. package/dist/cjs/components/health-factor/health-factor.cjs +1 -1
  7. package/dist/cjs/components/help-tip/help-tip.cjs +1 -1
  8. package/dist/cjs/components/index.cjs +1 -1
  9. package/dist/cjs/components/liquidation-price/index.cjs +1 -0
  10. package/dist/cjs/components/liquidation-price/liquidation-price.cjs +1 -0
  11. package/dist/cjs/components/status-elements/status-elements.cjs +1 -1
  12. package/dist/cjs/components/vertical-indicator/vertical-indicator.cjs +1 -1
  13. package/dist/cjs/index.cjs +1 -1
  14. package/dist/esm/components/block-sync/block-sync.js +4 -2
  15. package/dist/esm/components/checkbox/checkbox-labeled.js +2 -0
  16. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +2 -0
  17. package/dist/esm/components/complex-input/complex-input.js +4 -2
  18. package/dist/esm/components/fadeout-loading/fadeout-loading.js +12 -12
  19. package/dist/esm/components/health-factor/health-factor.js +53 -42
  20. package/dist/esm/components/help-tip/help-tip.js +113 -64
  21. package/dist/esm/components/index.js +241 -239
  22. package/dist/esm/components/liquidation-price/index.js +4 -0
  23. package/dist/esm/components/liquidation-price/liquidation-price.js +43 -0
  24. package/dist/esm/components/status-elements/status-elements.js +46 -28
  25. package/dist/esm/components/vertical-indicator/vertical-indicator.js +90 -90
  26. package/dist/esm/index.js +398 -396
  27. package/dist/globals.css +1 -1
  28. package/dist/types/components/fadeout-loading/fadeout-loading.d.ts +5 -13
  29. package/dist/types/components/health-factor/health-factor.d.ts +16 -35
  30. package/dist/types/components/help-tip/help-tip.d.ts +33 -44
  31. package/dist/types/components/index.d.ts +1 -0
  32. package/dist/types/components/liquidation-price/index.d.ts +1 -0
  33. package/dist/types/components/liquidation-price/liquidation-price.d.ts +41 -0
  34. package/dist/types/components/status-elements/status-elements.d.ts +11 -1
  35. package/dist/types/components/vertical-indicator/vertical-indicator.d.ts +24 -51
  36. package/dist/types/index.d.ts +1 -0
  37. package/package.json +1 -1
@@ -8,52 +8,33 @@ export declare const BAD_HF = 11000;
8
8
  * @returns The health factor zone or undefined
9
9
  */
10
10
  export declare const getHFZones: (hf: number | bigint | undefined) => HFZones | undefined;
11
- export interface HealthFactorProps extends React.HTMLAttributes<HTMLDivElement> {
12
- /**
13
- * The health factor value in basis points
14
- * For example: 15000 for health factor 1.5, 500 for health factor 0.05
15
- * (SDK always returns health factor in basis points: 10000 = 1.0)
16
- */
11
+ export interface HealthFactorProps extends React.HTMLAttributes<HTMLSpanElement> {
12
+ /** Health factor value in basis points (e.g. 15000 = 1.5, 10000 = 1.0). */
17
13
  value: number | bigint;
18
- /**
19
- * Debt amount in base units (bigint)
20
- * If debt is 0, component will display "N/A"
21
- */
14
+ /** Debt in base units; when 0n, display shows "N/A". */
22
15
  debt?: bigint;
23
- /**
24
- * Number of decimal places to show
25
- * @default 3
26
- */
16
+ /** Decimal places for the displayed value. @default 3 */
27
17
  decimals?: number;
28
- /**
29
- * Pre-computed zone (optional). If not provided, will be calculated from value
30
- */
18
+ /** Pre-computed zone; if not set, derived from value. */
31
19
  zone?: HFZones | null;
32
20
  /**
33
- * Show color indicator based on health factor zone
34
- * @default true
21
+ * How to indicate zone: "color" (text color only) or "bars" (StatusBars before value).
22
+ * @default "color"
35
23
  */
36
- showColor?: boolean;
24
+ zoneType?: "color" | "bars";
37
25
  }
38
26
  /**
39
- * HealthFactor component for displaying health factor values with zone-based color coding
27
+ * HealthFactor displays health factor value with optional zone color or StatusBars.
40
28
  *
41
- * Health factor zones:
42
- * - good: >= 1.5 (15000 basis points) - Green
43
- * - medium: 1.1 - 1.5 (11000-15000) - Yellow
44
- * - bad: 1.05 - 1.1 (10500-11000) - Orange
45
- * - critical: 1.0 - 1.05 (10000-10500) - Red
46
- * - liquidation: < 1.0 (< 10000) - Red
29
+ * @usage
30
+ * Use for account/collateral health: value in basis points, zero debt shows "N/A".
31
+ * zoneType "color" colors the text; zoneType "bars" shows StatusBars (and optional color).
47
32
  *
48
33
  * @example
49
34
  * ```tsx
50
- * // Health factor in basis points (SDK format)
51
- * <HealthFactor value={15000} debt={1000000n} /> // Shows "1.500" in green
52
- * <HealthFactor value={12000} debt={1000000n} decimals={2} /> // Shows "1.20" in yellow
53
- * <HealthFactor value={500} debt={1000000n} /> // Shows "0.050" in red
54
- *
55
- * // Zero debt shows N/A
56
- * <HealthFactor value={15000} debt={0n} /> // Shows "N/A"
35
+ * <HealthFactor value={15000} debt={1000000n} />
36
+ * <HealthFactor value={12000} debt={1000000n} zoneType="bars" zone="medium" />
37
+ * <HealthFactor value={15000} debt={0n} /> // "N/A"
57
38
  * ```
58
39
  */
59
- export declare function HealthFactor({ value, debt, decimals, zone, showColor, className, ...props }: HealthFactorProps): import("react/jsx-runtime").JSX.Element;
40
+ export declare function HealthFactor({ value, debt, decimals, zone, zoneType, className, ...props }: HealthFactorProps): import("react/jsx-runtime").JSX.Element;
@@ -1,48 +1,36 @@
1
+ import { VariantProps } from 'class-variance-authority';
1
2
  import * as React from "react";
2
- export interface HelpTipProps extends React.HTMLAttributes<HTMLSpanElement> {
3
- /**
4
- * Tooltip content (children)
5
- */
3
+ declare const iconColorVariants: (props?: ({
4
+ iconColor?: "muted" | "gray-10" | "gray-20" | "gray-30" | "gray-40" | "gray-50" | "gray-60" | "gray-70" | "gray-80" | "gray-90" | "gray-100" | "gray-110" | "foreground" | null | undefined;
5
+ iconHoverColor?: "muted" | "gray-10" | "gray-20" | "gray-30" | "gray-40" | "gray-50" | "gray-60" | "gray-70" | "gray-80" | "gray-90" | "gray-100" | "gray-110" | "foreground" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ export interface HelpTipProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "title"> {
8
+ /** Tooltip popup content (what appears when hovering the icon). */
6
9
  children: React.ReactNode;
7
- /**
8
- * Max width of the tooltip
9
- */
10
+ /** Maximum width of the tooltip panel. */
10
11
  maxWidth?: string;
11
- /**
12
- * Min width of the tooltip
13
- */
12
+ /** Minimum width of the tooltip panel. */
14
13
  minWidth?: string;
15
- /**
16
- * Delay before showing tooltip (ms)
17
- * @default 200
18
- */
14
+ /** Delay before showing tooltip (ms). @default 200 */
19
15
  delayShow?: number;
20
- /**
21
- * Delay before hiding tooltip (ms)
22
- * @default 150
23
- */
24
- delayHide?: number;
25
- /**
26
- * Tooltip placement
27
- * @default "bottom"
28
- */
29
- side?: "top" | "right" | "bottom" | "left";
30
- /**
31
- * Size of the help icon
32
- * @default 14
33
- */
16
+ /** Tooltip placement relative to the icon. @default "bottom" */
17
+ placement?: "top" | "right" | "bottom" | "left";
18
+ /** Size of the help icon in pixels. @default 14 */
34
19
  iconSize?: number;
35
- /**
36
- * Side offset of the tooltip
37
- * @default 4
38
- */
39
- sideOffset?: number;
20
+ /** Icon color variant (default gray-90). Theme-aware: dark → gray-40, light → gray-80. */
21
+ iconColor?: "gray-10" | "gray-20" | "gray-30" | "gray-40" | "gray-50" | "gray-60" | "gray-70" | "gray-80" | "gray-90" | "gray-100" | "gray-110" | "muted" | "foreground";
22
+ /** Icon color on hover (default gray-110). Theme-aware: dark → gray-70, light → gray-100. */
23
+ iconHoverColor?: "gray-10" | "gray-20" | "gray-30" | "gray-40" | "gray-50" | "gray-60" | "gray-70" | "gray-80" | "gray-90" | "gray-100" | "gray-110" | "muted" | "foreground";
24
+ /** Icon type: question circle or info. @default "question" */
25
+ iconVariant?: "question" | "info";
26
+ /** Called when the icon (trigger) is hovered. */
27
+ onPointerEnter?: React.PointerEventHandler<HTMLSpanElement>;
40
28
  }
41
29
  /**
42
- * HelpTip — tooltip with help icon for displaying contextual help
30
+ * HelpTip — contextual help trigger: icon opens a tooltip with explanation text.
43
31
  *
44
32
  * @usage
45
- * Use HelpTip to provide additional context or explanations:
33
+ * Use next to labels or terms to show extra context on hover:
46
34
  * field hints, term definitions, feature explanations.
47
35
  *
48
36
  * @example
@@ -57,19 +45,20 @@ export interface HelpTipProps extends React.HTMLAttributes<HTMLSpanElement> {
57
45
  * ```
58
46
  */
59
47
  declare const HelpTip: React.ForwardRefExoticComponent<HelpTipProps & React.RefAttributes<HTMLSpanElement>>;
60
- /**
61
- * HelpTipIcon standalone help icon without tooltip (use with custom tooltip)
62
- */
63
- export interface HelpTipIconProps extends React.HTMLAttributes<HTMLSpanElement> {
64
- /**
65
- * Size of the icon
66
- * @default 14
67
- */
48
+ export interface HelpTipIconProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "color">, VariantProps<typeof iconColorVariants> {
49
+ /** Size of the icon in pixels. @default 14 */
68
50
  iconSize?: number;
51
+ /** Icon type: question circle or info. @default "question" */
52
+ iconVariant?: "question" | "info";
69
53
  }
54
+ /**
55
+ * HelpTipIcon — standalone help icon (gray-90 default, gray-110 on hover).
56
+ * Use with a custom tooltip or when you only need the icon.
57
+ */
70
58
  declare const HelpTipIcon: React.ForwardRefExoticComponent<HelpTipIconProps & React.RefAttributes<HTMLSpanElement>>;
71
59
  /**
72
- * TipWrap — wrapper for positioning help tips inline with text
60
+ * TipWrap — wrapper for spacing the help tip inline with text (e.g. after a label).
61
+ * Matches A: margin-left 6px, inline-block, line-height 0.
73
62
  */
74
63
  declare const TipWrap: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
75
64
  export { HelpTip, HelpTipIcon, TipWrap };
@@ -62,6 +62,7 @@ export * from './label';
62
62
  export * from './layout';
63
63
  export * from './legal-agreement';
64
64
  export * from './liquidation';
65
+ export * from './liquidation-price';
65
66
  export * from './loader-guard';
66
67
  export * from './markdown-viewer';
67
68
  export * from './modal';
@@ -0,0 +1 @@
1
+ export * from './liquidation-price';
@@ -0,0 +1,41 @@
1
+ import { HFZones } from '..';
2
+ import type * as React from "react";
3
+ export type LiquidationPriceType = {
4
+ type: "text";
5
+ } | {
6
+ type: "redirect";
7
+ to: string;
8
+ } | {
9
+ type: "graph";
10
+ props: {
11
+ onShow: () => void;
12
+ };
13
+ };
14
+ export interface LiquidationPriceProps {
15
+ /**
16
+ * Liquidation price (bigint or number)
17
+ */
18
+ liquidationPrice?: bigint | number;
19
+ /**
20
+ * How to render when price is 0 / N/A: text, redirect link, or button that opens graph
21
+ */
22
+ type?: LiquidationPriceType;
23
+ /**
24
+ * Health factor zone for optional dot or bars indicator
25
+ */
26
+ hfZone?: HFZones;
27
+ /**
28
+ * Indicator style when hfZone is set: dot (right) or bars (left)
29
+ */
30
+ zoneType?: "dot" | "bars";
31
+ /**
32
+ * Label for "check" link/button when type is redirect or graph (e.g. i18n "Check")
33
+ */
34
+ checkLabel?: React.ReactNode;
35
+ className?: string;
36
+ }
37
+ /**
38
+ * LiquidationPrice — displays liquidation price with optional HF zone indicator.
39
+ * Matches interface LiquidationPrice structure.
40
+ */
41
+ export declare function LiquidationPrice({ liquidationPrice, type, hfZone, zoneType, checkLabel, className, }: LiquidationPriceProps): import("react/jsx-runtime").JSX.Element;
@@ -8,9 +8,19 @@ export interface AccountHealthDotProps {
8
8
  */
9
9
  export declare function HealthDot({ zone, size }: AccountHealthDotProps): import("react/jsx-runtime").JSX.Element;
10
10
  export interface StatusBarsProps {
11
+ /** Health factor zone; determines how many bars are filled (1–3) and their color. */
11
12
  zone: HFZones;
12
13
  }
13
14
  /**
14
- * StatusBars — row of bars indicating health factor zone (1–3 filled).
15
+ * StatusBars — row of 3 small bars indicating health factor zone (1–3 filled, rest gray).
16
+ *
17
+ * @usage
18
+ * Use next to health factor or TTL to show zone at a glance.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * <StatusBars zone="good" />
23
+ * <StatusBars zone="bad" />
24
+ * ```
15
25
  */
16
26
  export declare function StatusBars({ zone }: StatusBarsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,70 +1,43 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
- declare const verticalIndicatorVariants: (props?: ({
4
- align?: "center" | "start" | "end" | null | undefined;
3
+ declare const rootVariants: (props?: ({
4
+ align?: "center" | "start" | "end" | "baseline" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
- export interface VerticalIndicatorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">, VariantProps<typeof verticalIndicatorVariants> {
7
- /**
8
- * Label text
9
- */
6
+ declare const labelVariants: (props?: ({
7
+ size?: "default" | "xs" | "sm" | "unset" | null | undefined;
8
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
9
+ declare const valueVariants: (props?: ({
10
+ size?: "default" | "xs" | "sm" | "unset" | null | undefined;
11
+ weight?: "medium" | "normal" | "unset" | null | undefined;
12
+ color?: "default" | "muted" | "success" | "warning" | "primary" | "alert" | "secondary" | null | undefined;
13
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
14
+ export interface VerticalIndicatorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">, VariantProps<typeof rootVariants>, VariantProps<typeof labelVariants>, VariantProps<typeof valueVariants> {
15
+ /** Label text shown on the left */
10
16
  label?: React.ReactNode;
11
- /**
12
- * Description under the label
13
- */
17
+ /** Description under the label (left-aligned) */
14
18
  description?: React.ReactNode;
15
- /**
16
- * Value description under the value
17
- */
19
+ /** Description under the value (right-aligned) */
18
20
  valueDescription?: React.ReactNode;
19
- /**
20
- * Tooltip content for help tip
21
- */
21
+ /** Tooltip content for the help tip icon next to the label */
22
22
  tip?: React.ReactNode;
23
- /**
24
- * Current value
25
- */
23
+ /** Current value displayed on the right */
26
24
  value?: React.ReactNode;
27
- /**
28
- * New value (shows arrow transition from value to valueTo)
29
- */
25
+ /** New value shown after an arrow (value → valueTo); the first value is shown with line-through */
30
26
  valueTo?: React.ReactNode;
31
- /**
32
- * Font size variant
33
- */
34
- size?: "xs" | "sm" | "default" | "unset";
35
- /**
36
- * Font weight for value
37
- */
38
- weight?: "normal" | "medium" | "unset";
39
- /**
40
- * Color variant for value
41
- */
42
- color?: "default" | "muted" | "success" | "warning" | "alert" | "primary";
43
- /**
44
- * Callback when tip is hovered
45
- */
27
+ /** Called when the tip icon is hovered */
46
28
  onPointerEnterTip?: () => void;
47
29
  }
48
30
  /**
49
- * VerticalIndicator — component for displaying labeled values with optional transitions
31
+ * VerticalIndicator — labeled value display with optional description and value transition
50
32
  *
51
33
  * @usage
52
- * Use VerticalIndicator to display key-value pairs:
53
- * financial metrics, statistics, form field indicators, comparison values.
54
- *
55
- * Features:
56
- * - Label with optional description
57
- * - Value with optional value description
58
- * - Value transition display (value → valueTo)
59
- * - Help tip tooltip
34
+ * Use for key-value rows: metrics, form indicators, before/after values.
35
+ * Supports label + description, value + valueDescription, optional help tip,
36
+ * and value → valueTo transition (first value shown with line-through).
60
37
  *
61
38
  * @example
62
39
  * ```tsx
63
- * <VerticalIndicator
64
- * label="Total Value"
65
- * value="$10,000"
66
- * />
67
- *
40
+ * <VerticalIndicator label="Total Value" value="$10,000" />
68
41
  * <VerticalIndicator
69
42
  * label="Health Factor"
70
43
  * description="Account health"
@@ -76,4 +49,4 @@ export interface VerticalIndicatorProps extends Omit<React.HTMLAttributes<HTMLDi
76
49
  * ```
77
50
  */
78
51
  declare const VerticalIndicator: React.ForwardRefExoticComponent<VerticalIndicatorProps & React.RefAttributes<HTMLDivElement>>;
79
- export { VerticalIndicator, verticalIndicatorVariants };
52
+ export { VerticalIndicator, rootVariants as verticalIndicatorVariants };
@@ -59,6 +59,7 @@ export * from './components/label';
59
59
  export * from './components/layout';
60
60
  export * from './components/legal-agreement';
61
61
  export * from './components/liquidation';
62
+ export * from './components/liquidation-price';
62
63
  export * from './components/loader-guard';
63
64
  export * from './components/markdown-viewer';
64
65
  export * from './components/modal';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/permissionless-ui",
3
- "version": "1.22.0-next.40",
3
+ "version": "1.22.0-next.41",
4
4
  "description": "Internal UI components",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/index.js",