@ton/appkit-react 1.0.0-alpha.0 → 1.0.0-alpha.2

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 (128) hide show
  1. package/README.md +7 -6
  2. package/dist/esm/components/shared/amount-preview/amount-preview.js +17 -0
  3. package/dist/esm/components/shared/amount-preview/amount-preview.js.map +1 -0
  4. package/dist/esm/components/shared/amount-preview/amount-preview.module.css +40 -0
  5. package/dist/esm/{features/balances/components/balance-badge → components/shared/amount-preview}/index.js +1 -1
  6. package/dist/esm/components/shared/amount-preview/index.js.map +1 -0
  7. package/dist/esm/components/shared/flow-preview/flow-preview.js +24 -0
  8. package/dist/esm/components/shared/flow-preview/flow-preview.js.map +1 -0
  9. package/dist/esm/components/shared/flow-preview/flow-preview.module.css +37 -0
  10. package/dist/esm/components/shared/flow-preview/index.js +9 -0
  11. package/dist/esm/components/shared/flow-preview/index.js.map +1 -0
  12. package/dist/esm/components/shared/settings-button/settings-button.js +1 -1
  13. package/dist/esm/components/shared/settings-button/settings-button.js.map +1 -1
  14. package/dist/esm/components/ui/button/button.module.css +1 -1
  15. package/dist/esm/components/ui/logo/logo.module.css +1 -3
  16. package/dist/esm/components/ui/modal/modal.module.css +1 -1
  17. package/dist/esm/components/ui/tabs/tabs.module.css +1 -1
  18. package/dist/esm/features/balances/components/send-jetton-button/send-jetton-button.js +3 -3
  19. package/dist/esm/features/balances/components/send-jetton-button/send-jetton-button.js.map +1 -1
  20. package/dist/esm/features/balances/index.js +0 -1
  21. package/dist/esm/features/balances/index.js.map +1 -1
  22. package/dist/esm/features/staking/components/select-unstake-mode/select-unstake-mode.js +2 -1
  23. package/dist/esm/features/staking/components/select-unstake-mode/select-unstake-mode.js.map +1 -1
  24. package/dist/esm/features/staking/components/select-unstake-mode/select-unstake-mode.module.css +2 -6
  25. package/dist/esm/features/staking/components/staking-confirm-modal/index.js +9 -0
  26. package/dist/esm/features/staking/components/staking-confirm-modal/index.js.map +1 -0
  27. package/dist/esm/features/staking/components/staking-confirm-modal/staking-confirm-modal.js +46 -0
  28. package/dist/esm/features/staking/components/staking-confirm-modal/staking-confirm-modal.js.map +1 -0
  29. package/dist/esm/features/staking/components/staking-confirm-modal/staking-confirm-modal.module.css +11 -0
  30. package/dist/esm/features/staking/components/staking-widget-provider/staking-widget-provider.js +27 -4
  31. package/dist/esm/features/staking/components/staking-widget-provider/staking-widget-provider.js.map +1 -1
  32. package/dist/esm/features/staking/components/staking-widget-provider/use-staking-validation.js +12 -3
  33. package/dist/esm/features/staking/components/staking-widget-provider/use-staking-validation.js.map +1 -1
  34. package/dist/esm/features/staking/components/staking-widget-ui/staking-widget-ui.js +16 -4
  35. package/dist/esm/features/staking/components/staking-widget-ui/staking-widget-ui.js.map +1 -1
  36. package/dist/esm/features/staking/components/staking-widget-ui/staking-widget-ui.module.css +4 -0
  37. package/dist/esm/features/staking/hooks/use-build-stake-transaction.js +2 -2
  38. package/dist/esm/features/staking/hooks/use-build-stake-transaction.js.map +1 -1
  39. package/dist/esm/features/staking/utils/map-staking-error.js +6 -4
  40. package/dist/esm/features/staking/utils/map-staking-error.js.map +1 -1
  41. package/dist/esm/features/swap/components/swap-confirm-modal/index.js +9 -0
  42. package/dist/esm/features/swap/components/swap-confirm-modal/index.js.map +1 -0
  43. package/dist/esm/features/swap/components/swap-confirm-modal/swap-confirm-modal.js +12 -0
  44. package/dist/esm/features/swap/components/swap-confirm-modal/swap-confirm-modal.js.map +1 -0
  45. package/dist/esm/features/swap/components/swap-confirm-modal/swap-confirm-modal.module.css +7 -0
  46. package/dist/esm/features/swap/components/swap-widget-provider/swap-widget-provider.js +28 -6
  47. package/dist/esm/features/swap/components/swap-widget-provider/swap-widget-provider.js.map +1 -1
  48. package/dist/esm/features/swap/components/swap-widget-provider/use-swap-validation.js +12 -3
  49. package/dist/esm/features/swap/components/swap-widget-provider/use-swap-validation.js.map +1 -1
  50. package/dist/esm/features/swap/components/swap-widget-ui/swap-widget-ui.js +16 -4
  51. package/dist/esm/features/swap/components/swap-widget-ui/swap-widget-ui.js.map +1 -1
  52. package/dist/esm/features/swap/utils/map-swap-error.js +10 -8
  53. package/dist/esm/features/swap/utils/map-swap-error.js.map +1 -1
  54. package/dist/esm/locales/en.js +9 -0
  55. package/dist/esm/locales/en.js.map +1 -1
  56. package/dist/esm/styles/index.css +3 -3
  57. package/dist/esm/utils/map-defi-error.js +7 -7
  58. package/dist/esm/utils/map-defi-error.js.map +1 -1
  59. package/dist/types/components/shared/amount-preview/amount-preview.d.ts +24 -0
  60. package/dist/types/components/shared/amount-preview/amount-preview.d.ts.map +1 -0
  61. package/dist/types/{features/balances/components/balance-badge → components/shared/amount-preview}/index.d.ts +1 -1
  62. package/dist/types/components/shared/amount-preview/index.d.ts.map +1 -0
  63. package/dist/types/components/shared/flow-preview/flow-preview.d.ts +18 -0
  64. package/dist/types/components/shared/flow-preview/flow-preview.d.ts.map +1 -0
  65. package/dist/types/components/shared/flow-preview/index.d.ts +9 -0
  66. package/dist/types/components/shared/flow-preview/index.d.ts.map +1 -0
  67. package/dist/types/features/balances/index.d.ts +0 -1
  68. package/dist/types/features/balances/index.d.ts.map +1 -1
  69. package/dist/types/features/staking/components/select-unstake-mode/select-unstake-mode.d.ts.map +1 -1
  70. package/dist/types/features/staking/components/staking-confirm-modal/index.d.ts +9 -0
  71. package/dist/types/features/staking/components/staking-confirm-modal/index.d.ts.map +1 -0
  72. package/dist/types/features/staking/components/staking-confirm-modal/staking-confirm-modal.d.ts +23 -0
  73. package/dist/types/features/staking/components/staking-confirm-modal/staking-confirm-modal.d.ts.map +1 -0
  74. package/dist/types/features/staking/components/staking-widget-provider/staking-widget-provider.d.ts.map +1 -1
  75. package/dist/types/features/staking/components/staking-widget-provider/use-staking-validation.d.ts +3 -1
  76. package/dist/types/features/staking/components/staking-widget-provider/use-staking-validation.d.ts.map +1 -1
  77. package/dist/types/features/staking/components/staking-widget-ui/staking-widget-ui.d.ts.map +1 -1
  78. package/dist/types/features/staking/hooks/use-build-stake-transaction.d.ts +3 -2
  79. package/dist/types/features/staking/hooks/use-build-stake-transaction.d.ts.map +1 -1
  80. package/dist/types/features/staking/utils/map-staking-error.d.ts +5 -3
  81. package/dist/types/features/staking/utils/map-staking-error.d.ts.map +1 -1
  82. package/dist/types/features/swap/components/swap-confirm-modal/index.d.ts +9 -0
  83. package/dist/types/features/swap/components/swap-confirm-modal/index.d.ts.map +1 -0
  84. package/dist/types/features/swap/components/swap-confirm-modal/swap-confirm-modal.d.ts +26 -0
  85. package/dist/types/features/swap/components/swap-confirm-modal/swap-confirm-modal.d.ts.map +1 -0
  86. package/dist/types/features/swap/components/swap-widget-provider/swap-widget-provider.d.ts.map +1 -1
  87. package/dist/types/features/swap/components/swap-widget-provider/use-swap-validation.d.ts +4 -1
  88. package/dist/types/features/swap/components/swap-widget-provider/use-swap-validation.d.ts.map +1 -1
  89. package/dist/types/features/swap/components/swap-widget-ui/swap-widget-ui.d.ts.map +1 -1
  90. package/dist/types/features/swap/utils/map-swap-error.d.ts +4 -2
  91. package/dist/types/features/swap/utils/map-swap-error.d.ts.map +1 -1
  92. package/dist/types/libs/i18n.d.ts +9 -0
  93. package/dist/types/libs/i18n.d.ts.map +1 -1
  94. package/dist/types/locales/en.d.ts +9 -0
  95. package/dist/types/locales/en.d.ts.map +1 -1
  96. package/package.json +12 -12
  97. package/src/components/shared/amount-preview/amount-preview.tsx +74 -0
  98. package/src/{features/balances/components/balance-badge → components/shared/amount-preview}/index.ts +1 -1
  99. package/src/components/shared/flow-preview/flow-preview.tsx +64 -0
  100. package/src/components/shared/flow-preview/index.ts +9 -0
  101. package/src/components/shared/settings-button/settings-button.tsx +1 -1
  102. package/src/features/balances/components/send-jetton-button/send-jetton-button.tsx +3 -3
  103. package/src/features/balances/index.ts +0 -1
  104. package/src/features/staking/components/select-unstake-mode/select-unstake-mode.tsx +12 -4
  105. package/src/features/staking/components/staking-confirm-modal/index.ts +9 -0
  106. package/src/features/staking/components/staking-confirm-modal/staking-confirm-modal.tsx +121 -0
  107. package/src/features/staking/components/staking-widget-provider/staking-widget-provider.tsx +39 -4
  108. package/src/features/staking/components/staking-widget-provider/use-staking-validation.ts +14 -2
  109. package/src/features/staking/components/staking-widget-ui/staking-widget-ui.tsx +39 -13
  110. package/src/features/staking/hooks/use-build-stake-transaction.ts +7 -2
  111. package/src/features/staking/utils/map-staking-error.ts +6 -4
  112. package/src/features/swap/components/swap-confirm-modal/index.ts +9 -0
  113. package/src/features/swap/components/swap-confirm-modal/swap-confirm-modal.tsx +75 -0
  114. package/src/features/swap/components/swap-widget-provider/swap-widget-provider.tsx +40 -6
  115. package/src/features/swap/components/swap-widget-provider/use-swap-validation.ts +17 -2
  116. package/src/features/swap/components/swap-widget-ui/swap-widget-ui.tsx +30 -3
  117. package/src/features/swap/utils/map-swap-error.ts +10 -8
  118. package/src/locales/en.ts +9 -0
  119. package/src/utils/map-defi-error.ts +7 -7
  120. package/dist/esm/features/balances/components/balance-badge/balance-badge.js +0 -33
  121. package/dist/esm/features/balances/components/balance-badge/balance-badge.js.map +0 -1
  122. package/dist/esm/features/balances/components/balance-badge/balance-badge.module.css +0 -21
  123. package/dist/esm/features/balances/components/balance-badge/index.js.map +0 -1
  124. package/dist/esm/tsconfig.build.tsbuildinfo +0 -1
  125. package/dist/types/features/balances/components/balance-badge/balance-badge.d.ts +0 -21
  126. package/dist/types/features/balances/components/balance-badge/balance-badge.d.ts.map +0 -1
  127. package/dist/types/features/balances/components/balance-badge/index.d.ts.map +0 -1
  128. package/src/features/balances/components/balance-badge/balance-badge.tsx +0 -47
@@ -1,21 +0,0 @@
1
- /**
2
- * Copyright (c) TonTech.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
- import type { FC } from 'react';
9
- export declare const BalanceBadge: {
10
- Container: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
11
- Icon: import("react").ForwardRefExoticComponent<import("../../../..").LogoProps & import("react").RefAttributes<HTMLSpanElement>>;
12
- BalanceBlock: FC<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
13
- Symbol: FC<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
14
- symbol: string;
15
- }>;
16
- Balance: FC<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
17
- balance: string;
18
- decimals: number;
19
- }>;
20
- };
21
- //# sourceMappingURL=balance-badge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"balance-badge.d.ts","sourceRoot":"","sources":["../../../../../../src/features/balances/components/balance-badge/balance-badge.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,EAAE,EAAkB,MAAM,OAAO,CAAC;AA+BhD,eAAO,MAAM,YAAY;;;;;gBARkC,MAAM;;;iBARX,MAAM;kBAAY,MAAM;;CAsB7E,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/balances/components/balance-badge/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,47 +0,0 @@
1
- /**
2
- * Copyright (c) TonTech.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import { formatUnits } from '@ton/appkit';
10
- import type { FC, ComponentProps } from 'react';
11
- import clsx from 'clsx';
12
-
13
- import { Block } from '../../../../components/ui/block';
14
- import styles from './balance-badge.module.css';
15
- import { Logo } from '../../../../components/ui/logo';
16
-
17
- const BalanceBadgeContainer: FC<ComponentProps<'div'>> = ({ className, ...props }) => {
18
- return <Block direction="row" className={clsx(styles.balance, className)} {...props} />;
19
- };
20
-
21
- const BalanceBlock: FC<ComponentProps<'div'>> = ({ className, ...props }) => {
22
- return <div className={clsx(styles.balanceContainer, className)} {...props} />;
23
- };
24
-
25
- const Balance: FC<ComponentProps<'span'> & { balance: string; decimals: number }> = ({
26
- balance,
27
- decimals,
28
- ...props
29
- }) => {
30
- return <span {...props}>{balance ? formatUnits(balance, decimals) : '0'}</span>;
31
- };
32
-
33
- const BalanceSymbol: FC<ComponentProps<'span'> & { symbol: string }> = ({ className, symbol, ...props }) => {
34
- return (
35
- <span className={clsx(styles.ticker, className)} {...props}>
36
- {symbol}
37
- </span>
38
- );
39
- };
40
-
41
- export const BalanceBadge = {
42
- Container: BalanceBadgeContainer,
43
- Icon: Logo,
44
- BalanceBlock: BalanceBlock,
45
- Symbol: BalanceSymbol,
46
- Balance: Balance,
47
- };