@gearbox-protocol/permissionless-ui 1.22.0-next.34 → 1.22.0-next.36

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 (57) 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/complex-input/index.cjs +1 -1
  6. package/dist/cjs/components/formatted-number/formatted-number.cjs +1 -1
  7. package/dist/cjs/components/index.cjs +1 -1
  8. package/dist/cjs/components/input/input.cjs +1 -1
  9. package/dist/cjs/components/input/use-icon-slot-widths.cjs +1 -0
  10. package/dist/cjs/components/short-string/short-string.cjs +1 -1
  11. package/dist/cjs/components/status-elements/index.cjs +1 -0
  12. package/dist/cjs/components/status-elements/status-elements.cjs +1 -0
  13. package/dist/cjs/components/tip-card/tip-card.cjs +1 -1
  14. package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
  15. package/dist/cjs/components/token-template/token-template.cjs +1 -1
  16. package/dist/cjs/components/tooltip/simple-tooltip.cjs +1 -1
  17. package/dist/cjs/components/with-title/with-title.cjs +1 -1
  18. package/dist/cjs/index.cjs +1 -1
  19. package/dist/cjs/locale/en.json.cjs +1 -0
  20. package/dist/cjs/locale/index.cjs +1 -0
  21. package/dist/esm/components/block-sync/block-sync.js +34 -36
  22. package/dist/esm/components/checkbox/checkbox-labeled.js +2 -1
  23. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +2 -1
  24. package/dist/esm/components/complex-input/complex-input.js +211 -55
  25. package/dist/esm/components/complex-input/index.js +3 -2
  26. package/dist/esm/components/formatted-number/formatted-number.js +41 -8
  27. package/dist/esm/components/index.js +456 -452
  28. package/dist/esm/components/input/input.js +28 -22
  29. package/dist/esm/components/input/use-icon-slot-widths.js +41 -0
  30. package/dist/esm/components/short-string/short-string.js +10 -14
  31. package/dist/esm/components/status-elements/index.js +5 -0
  32. package/dist/esm/components/status-elements/status-elements.js +48 -0
  33. package/dist/esm/components/tip-card/tip-card.js +5 -5
  34. package/dist/esm/components/token-symbol/token-symbol.js +34 -38
  35. package/dist/esm/components/token-template/token-template.js +24 -16
  36. package/dist/esm/components/tooltip/simple-tooltip.js +12 -11
  37. package/dist/esm/components/with-title/with-title.js +27 -14
  38. package/dist/esm/index.js +594 -588
  39. package/dist/esm/locale/en.json.js +54 -0
  40. package/dist/esm/locale/index.js +4 -0
  41. package/dist/globals.css +1 -1
  42. package/dist/types/components/complex-input/complex-input.d.ts +10 -14
  43. package/dist/types/components/compound-apy/compound-apy.d.ts +1 -1
  44. package/dist/types/components/formatted-number/formatted-number.d.ts +14 -4
  45. package/dist/types/components/index.d.ts +1 -0
  46. package/dist/types/components/input/use-icon-slot-widths.d.ts +12 -0
  47. package/dist/types/components/status-elements/index.d.ts +1 -0
  48. package/dist/types/components/status-elements/status-elements.d.ts +16 -0
  49. package/dist/types/components/text-button/text-button.d.ts +1 -1
  50. package/dist/types/components/token-template/token-template.d.ts +7 -28
  51. package/dist/types/components/typed-intl/index.d.ts +1 -1
  52. package/dist/types/components/with-title/with-title.d.ts +6 -6
  53. package/dist/types/index.d.ts +5 -0
  54. package/dist/types/locale/en.json.d.ts +68 -0
  55. package/dist/types/locale/index.d.ts +10 -0
  56. package/package.json +3 -3
  57. package/src/styles/base.css +1 -1
@@ -1,9 +1,11 @@
1
1
  import { TokenData } from '@gearbox-protocol/sdk';
2
+ import { InputProps } from '../input';
2
3
  import { WithTitleProps } from '../with-title';
3
4
  import type * as React from "react";
5
+ export type BalanceIndicatorSize = "sm" | "md";
4
6
  export interface BalanceIndicatorProps {
5
7
  /**
6
- * Title for max button
8
+ * Label before balance (e.g. "Balance")
7
9
  */
8
10
  title?: React.ReactNode;
9
11
  /**
@@ -15,39 +17,33 @@ export interface BalanceIndicatorProps {
15
17
  */
16
18
  token: TokenData | undefined;
17
19
  /**
18
- * Size variant
20
+ * Size variant (matches interface SmartNumberInputSize)
19
21
  */
20
- size?: "sm" | "md" | "lg";
22
+ size?: BalanceIndicatorSize;
21
23
  /**
22
24
  * Whether the indicator is disabled
23
25
  */
24
26
  disabled?: boolean;
25
27
  /**
26
- * Whether to show max button
28
+ * Whether to show max button / clickable amount
27
29
  */
28
30
  maxButton?: boolean;
29
31
  /**
30
- * Callback when max button is clicked
32
+ * Callback when max is clicked
31
33
  */
32
34
  onMaxButtonClick?: () => void;
33
35
  }
36
+ export declare function BalanceIndicator({ title, maxAmount, token, disabled, maxButton, onMaxButtonClick, size, }: BalanceIndicatorProps): import("react/jsx-runtime").JSX.Element;
34
37
  export interface ComplexInputProps {
35
38
  /**
36
39
  * Props for title wrapper
37
40
  */
38
41
  titleProps: WithTitleProps;
39
42
  /**
40
- * Props for input element
43
+ * Props for input element (matches interface: InputProps with onChange overridden)
41
44
  */
42
- inputProps: Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "size"> & {
43
- /**
44
- * Callback when value changes (receives bigint and string view)
45
- */
45
+ inputProps: Omit<InputProps, "onChange" | "endingIcon"> & {
46
46
  onChange?: (value: bigint, valueView: string) => void;
47
- /**
48
- * Input size variant
49
- */
50
- inputSize?: "sm" | "lg" | "default";
51
47
  };
52
48
  /**
53
49
  * Props for balance indicator
@@ -1,5 +1,5 @@
1
1
  import { TokenData } from '@gearbox-protocol/sdk';
2
- import { LocaleKeys } from '../typed-intl';
2
+ import { LocaleKeys } from '../../locale';
3
3
  export interface PoolBaseAPY {
4
4
  type: "supplyAPY" | "tokenYield";
5
5
  apy: number;
@@ -1,11 +1,21 @@
1
+ import { ParseSmallNumberResult } from '../../utils';
1
2
  import type * as React from "react";
2
3
  export interface FormattedNumberStringProps extends React.HTMLAttributes<HTMLSpanElement> {
3
4
  /**
4
- * The value to display
5
+ * Maximum length for decimal part in tooltip (trimmed)
5
6
  */
6
- value: string | number;
7
+ decimalPartLength?: number;
8
+ /**
9
+ * When repeat (leading zeros in decimal) exceeds this, show "0" + repeat count
10
+ */
11
+ hideZerosIfMore?: number;
12
+ /**
13
+ * The value to display (string, or parsed small number result)
14
+ */
15
+ value: string | ParseSmallNumberResult | undefined;
7
16
  }
8
17
  /**
9
- * FormattedNumberString — displays a number with tabular figures for alignment
18
+ * FormattedNumberString — displays a number with optional compact decimal (zeros as repeat count) and tooltip with full value.
19
+ * Matches interface FormattedNumber structure and styles.
10
20
  */
11
- export declare function FormattedNumberString({ value, className, ...props }: FormattedNumberStringProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function FormattedNumberString({ value, decimalPartLength, hideZerosIfMore, className, ...props }: FormattedNumberStringProps): import("react/jsx-runtime").JSX.Element;
@@ -98,6 +98,7 @@ export * from './spinner';
98
98
  export * from './split-list';
99
99
  export * from './stat-badge';
100
100
  export * from './status-dot';
101
+ export * from './status-elements';
101
102
  export * from './status-triangle';
102
103
  export * from './stepper';
103
104
  export * from './styled-dropdown';
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Returns callback refs and measured widths for two icon slot elements.
4
+ * Use the widths (with fallback) to set input padding so it matches the icon button width.
5
+ */
6
+ export declare function useIconSlotWidths(): {
7
+ startSlotWidth: number | null;
8
+ endSlotWidth: number | null;
9
+ setStartRef: (el: HTMLButtonElement | null) => void;
10
+ setEndRef: (el: HTMLButtonElement | null) => void;
11
+ inputPaddingStyle: (hasStart: boolean, hasEnd: boolean) => React.CSSProperties;
12
+ };
@@ -0,0 +1 @@
1
+ export * from './status-elements';
@@ -0,0 +1,16 @@
1
+ import { HFZones } from '..';
2
+ export interface AccountHealthDotProps {
3
+ zone: HFZones;
4
+ size?: number;
5
+ }
6
+ /**
7
+ * HealthDot — colored dot indicating health factor zone.
8
+ */
9
+ export declare function HealthDot({ zone, size }: AccountHealthDotProps): import("react/jsx-runtime").JSX.Element;
10
+ export interface StatusBarsProps {
11
+ zone: HFZones;
12
+ }
13
+ /**
14
+ * StatusBars — row of bars indicating health factor zone (1–3 filled).
15
+ */
16
+ export declare function StatusBars({ zone }: StatusBarsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const textColorVariants: (props?: ({
4
- buttonColor?: "empty" | "primaryDashed" | "secondaryDashed" | null | undefined;
4
+ buttonColor?: "primaryDashed" | "secondaryDashed" | "empty" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  declare const layoutVariants: (props?: ({
7
7
  size?: "default" | "sm" | "lg" | "md" | null | undefined;
@@ -1,40 +1,19 @@
1
1
  import { TokenData } from '@gearbox-protocol/sdk';
2
+ import { ParseSmallNumberResult } from '../../utils';
2
3
  import { negativeTokenTemplate, tokenTemplateString } from '../../utils/templates';
4
+ import { FormattedNumberStringProps } from '../formatted-number';
3
5
  import type * as React from "react";
4
6
  type PartialTokenData = Pick<TokenData, "title" | "decimals"> & {
5
7
  symbol?: string;
6
8
  };
7
- export interface TokenTemplateProps {
8
- /**
9
- * Token amount in base units (bigint, string, number, or undefined)
10
- */
9
+ export interface TokenTemplateProps extends Omit<FormattedNumberStringProps, "value"> {
11
10
  value: bigint | string | number | undefined;
12
- /**
13
- * Token data with title/symbol and decimals
14
- */
15
11
  token: PartialTokenData | undefined;
16
- /**
17
- * Number of decimal places to display
18
- */
19
12
  precision?: number;
20
- /**
21
- * Symbol to use between amount and token name
22
- * @default " "
23
- */
24
- spaceSymbol?: string;
25
- /**
26
- * Maximum length of the result string (truncates if exceeded)
27
- */
28
13
  maxLength?: number;
29
- /**
30
- * Allow displaying negative values with sign
31
- * @default false
32
- */
33
- allowNegative?: boolean;
34
- /**
35
- * Additional className for styling
36
- */
37
- className?: string;
14
+ formatter?: (amount: bigint | string | number | undefined, decimals: number, precision?: number) => string | ParseSmallNumberResult;
15
+ noFormattedAmountValue?: React.ReactNode;
16
+ showSymbol?: boolean;
38
17
  }
39
18
  /**
40
19
  * TokenTemplate — component for displaying token amounts with symbol.
@@ -72,5 +51,5 @@ export interface TokenTemplateProps {
72
51
  * // Output: "-1.5 ETH"
73
52
  * ```
74
53
  */
75
- export declare function TokenTemplate({ value, token, precision, spaceSymbol, maxLength, allowNegative, className, }: TokenTemplateProps): React.ReactElement;
54
+ export declare function TokenTemplate({ value, token, precision, formatter, noFormattedAmountValue, showSymbol, maxLength, ...rest }: TokenTemplateProps): import("react/jsx-runtime").JSX.Element;
76
55
  export { tokenTemplateString, negativeTokenTemplate };
@@ -1,9 +1,9 @@
1
1
  import { FormatXMLElementFn, PrimitiveType } from 'intl-messageformat';
2
2
  import { FormattedMessage } from 'react-intl';
3
+ import { LocaleKeys } from '../../locale';
3
4
  import type * as React from "react";
4
5
  type FormattedMessageProps = React.ComponentProps<typeof FormattedMessage>;
5
6
  export type Values = FormattedMessageProps["values"];
6
- export type LocaleKeys = string;
7
7
  export interface FormattedMessageTypedProps {
8
8
  messageId: LocaleKeys;
9
9
  values?: Values;
@@ -1,14 +1,13 @@
1
+ import { VariantProps } from 'class-variance-authority';
1
2
  import type * as React from "react";
2
- export type Sizes = "default" | "sm" | "lg";
3
- export interface WithTitleProps {
3
+ declare const withTitleVariants: (props?: ({
4
+ size?: "default" | "sm" | "lg" | "md" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ export interface WithTitleProps extends VariantProps<typeof withTitleVariants> {
4
7
  /**
5
8
  * Title text or element
6
9
  */
7
10
  title: string | React.ReactNode;
8
- /**
9
- * Size variant
10
- */
11
- size?: Sizes;
12
11
  /**
13
12
  * Children content
14
13
  */
@@ -29,3 +28,4 @@ export interface WithTitleProps {
29
28
  * ```
30
29
  */
31
30
  export declare function WithTitle({ title, children, size, className, }: WithTitleProps): import("react/jsx-runtime").JSX.Element;
31
+ export {};
@@ -1,3 +1,4 @@
1
+ import { default as EnglishLocale } from './locale/en.json';
1
2
  export * from './components/accordion';
2
3
  export * from './components/alert-badge';
3
4
  export * from './components/alert-dialog';
@@ -95,6 +96,7 @@ export * from './components/spinner';
95
96
  export * from './components/split-list';
96
97
  export * from './components/stat-badge';
97
98
  export * from './components/status-dot';
99
+ export * from './components/status-elements';
98
100
  export * from './components/status-triangle';
99
101
  export * from './components/stepper';
100
102
  export * from './components/styled-dropdown';
@@ -123,6 +125,9 @@ export * from './components/with-title';
123
125
  export * from './configs/design-tokens';
124
126
  export * from './configs/variants';
125
127
  export * from './hooks';
128
+ export type { LocaleKeys } from './locale';
129
+ export * from './locale';
130
+ export { EnglishLocale };
126
131
  export * from './utils';
127
132
  export * from './utils/a11y';
128
133
  export { cn } from './utils/cn';
@@ -0,0 +1,68 @@
1
+ declare const _default: {
2
+ "errors.networkError": "Network error. Can't fetch data",
3
+ "errors.incorrectAddressError": "Incorrect address. Please, check url",
4
+ "errors.noOpenedAccountsError": "You have no opened Credit Accounts. Perhaps, you have recently been liquidated? Check notification centre to see more.",
5
+ "errors.notFound": "Not found",
6
+ "errors.tooManyRequests": "Too many requests",
7
+ "errors.incorrectAddress": "Incorrect address",
8
+ "components.errorMessage.oops": "Oops...",
9
+
10
+ "components.alertModal.ok": "Ok",
11
+
12
+ "components.footer.privacy": "Privacy Notice",
13
+ "components.footer.terms": "Terms of Service",
14
+ "components.footer.disclosure": "Risk Disclosure Statement",
15
+ "components.footer.legalNotice": "Legal Notice",
16
+ "components.footer.legal": "Legal Info",
17
+ "components.footer.gearbox": "Copyright © Gearbox Foundation 2023-2026.",
18
+ "components.footer.built": "Built at ETHGlobal MarketMake hackathon.",
19
+ "components.footer.version": "Version {value}",
20
+
21
+ "components.liquidationPrice.check": "Check Area",
22
+
23
+ "components.loading.loading": "Loading",
24
+ "components.loading.wait": "Please wait...",
25
+
26
+ "components.smartNumberInput.balance": "Balance",
27
+ "components.smartNumberInput.inputTitle": "Token Amount",
28
+ "components.smartNumberInput.confirm.input": "Input",
29
+
30
+ "components.tipWindow.title": "Tip",
31
+
32
+ "components.healthFactor.low": "Extremely low! This HF may not cover possible oracle deviations.",
33
+
34
+ "components.headCell": "Sort by {value}",
35
+
36
+ "components.graphView.noData": "Can't get data for this graph",
37
+
38
+ "components.filterBlock.reset": "Reset All",
39
+
40
+ "components.APY.tip": "These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.",
41
+
42
+ "components.creditSessionDetailedLiquidation.graph.legend.point": "Current price",
43
+ "components.creditSessionDetailedLiquidation.graph.legend.area": "Liquidation Area",
44
+ "components.creditSessionDetailedLiquidation.graph.tip.hf": "Health Factor",
45
+ "components.creditSessionDetailedLiquidation.graph.tip.price": "Price",
46
+ "components.creditSessionDetailedLiquidation.table.seeGraph": "See graph",
47
+ "components.creditSessionDetailedLiquidation.table.asset": "Asset",
48
+ "components.creditSessionDetailedLiquidation.table.currentPrice": "Current price",
49
+ "components.creditSessionDetailedLiquidation.table.modelPrice": "Model price",
50
+
51
+ "components.apyParts.features.points": "Points",
52
+ "components.apyParts.features.incent": "Incent.",
53
+ "components.apyParts.supplyAPY": "Organic APY",
54
+ "components.apyParts.title": "APY type",
55
+ "components.apyParts.supplyAPY.tip": "Yield from lending funds",
56
+ "components.apyParts.tokenYield": "Intrinsic APY",
57
+ "components.apyParts.tokenYield.tip": "Yield from holding wstETH",
58
+ "components.apyParts.extraAPY": "{symbol} Incentive",
59
+ "components.apyParts.extraAPY.tip": "Calculated at the current rate",
60
+ "components.apyParts.totalAPY": "Overall APY",
61
+ "components.apyParts.points": "{symbol} Incentive",
62
+ "components.apyParts.points.condition.crossDeposit": "For cross-chain deposits made via Omni",
63
+
64
+ "components.openCopyButtons.copy": "Copy to clipboard"
65
+ }
66
+ ;
67
+
68
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { default as en } from './en.json';
2
+ type LocaleType = typeof en;
3
+ export interface LocaleRegistry {
4
+ base: LocaleType;
5
+ }
6
+ type RegistryKeys<T> = {
7
+ [K in keyof T]: keyof T[K];
8
+ }[keyof T];
9
+ export default en;
10
+ export type LocaleKeys = RegistryKeys<LocaleRegistry>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/permissionless-ui",
3
- "version": "1.22.0-next.34",
3
+ "version": "1.22.0-next.36",
4
4
  "description": "Internal UI components",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/index.js",
@@ -78,7 +78,7 @@
78
78
  "@fortawesome/fontawesome-svg-core": "^7.1.0",
79
79
  "@fortawesome/free-solid-svg-icons": "^7.1.0",
80
80
  "@fortawesome/react-fontawesome": "^3.1.1",
81
- "@gearbox-protocol/static": "^1.107.0",
81
+ "@gearbox-protocol/static": "^1.117.2",
82
82
  "lightweight-charts": "^4.1.3",
83
83
  "luxon": "^3.5.0",
84
84
  "react-infinite-scroll-component": "^6.1.0",
@@ -130,7 +130,7 @@
130
130
  "@commitlint/cli": "^20.1.0",
131
131
  "@commitlint/config-conventional": "^20.0.0",
132
132
  "@gearbox-protocol/biome-config": "^1.0.2",
133
- "@gearbox-protocol/sdk": "^12.6.7",
133
+ "@gearbox-protocol/sdk": "12.6.6",
134
134
  "@rollup/plugin-typescript": "^12.3.0",
135
135
  "@storybook/addon-a11y": "^10.0.8",
136
136
  "@storybook/addon-docs": "^10.0.8",
@@ -110,7 +110,7 @@ html.dark {
110
110
  --success-hover: 136.58 100% 85.1%;
111
111
  --destructive-foreground: 0 0% 100%;
112
112
  --warning: 43.12 100% 68.63%;
113
- --liquidation: 274 67% 58%;
113
+ --liquidation: 277.22 74.53% 58.43%;
114
114
  --input: 225 6% 19%;
115
115
  --ring: 330 100% 59%;
116
116
  --gray-10: 225 5.26% 14.9%;