@rabbitio/ui-kit 1.0.0-beta.2 → 1.0.0-beta.20

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 (43) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/README.md +23 -16
  3. package/dist/index.cjs +4403 -1
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.css +8757 -1
  6. package/dist/index.css.map +1 -1
  7. package/dist/index.modern.js +3689 -1
  8. package/dist/index.modern.js.map +1 -1
  9. package/dist/index.module.js +4374 -1
  10. package/dist/index.module.js.map +1 -1
  11. package/dist/index.umd.js +4405 -1
  12. package/dist/index.umd.js.map +1 -1
  13. package/index.js +1 -1
  14. package/package.json +17 -24
  15. package/src/common/amountUtils.js +423 -0
  16. package/src/common/errorUtils.js +27 -0
  17. package/src/common/fiatCurrenciesService.js +161 -0
  18. package/src/common/models/blockchain.js +10 -0
  19. package/src/common/models/coin.js +157 -0
  20. package/src/common/models/protocol.js +5 -0
  21. package/src/common/utils/cache.js +268 -0
  22. package/src/common/utils/emailAPI.js +18 -0
  23. package/src/common/utils/logging/logger.js +48 -0
  24. package/src/common/utils/logging/logsStorage.js +61 -0
  25. package/src/common/utils/safeStringify.js +50 -0
  26. package/src/components/atoms/AssetIcon/AssetIcon.jsx +55 -0
  27. package/src/components/atoms/AssetIcon/asset-icon.module.scss +42 -0
  28. package/{stories → src/components}/atoms/LoadingDots/LoadingDots.module.scss +1 -1
  29. package/src/components/atoms/SupportChat/SupportChat.jsx +40 -0
  30. package/{stories → src/components}/atoms/buttons/Button/Button.jsx +6 -6
  31. package/{stories → src/components}/atoms/buttons/Button/Button.module.scss +6 -1
  32. package/src/components/hooks/useCallHandlingErrors.js +26 -0
  33. package/src/components/hooks/useReferredState.js +24 -0
  34. package/src/index.js +33 -0
  35. package/src/swaps-lib/external-apis/swapProvider.js +169 -0
  36. package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +811 -0
  37. package/src/swaps-lib/models/baseSwapCreationInfo.js +40 -0
  38. package/src/swaps-lib/models/existingSwap.js +58 -0
  39. package/src/swaps-lib/models/existingSwapWithFiatData.js +115 -0
  40. package/src/swaps-lib/services/publicSwapService.js +602 -0
  41. package/src/swaps-lib/utils/swapUtils.js +209 -0
  42. package/stories/index.js +0 -2
  43. /package/{stories → src/components}/atoms/LoadingDots/LoadingDots.jsx +0 -0
package/CHANGELOG.md ADDED
File without changes
package/README.md CHANGED
@@ -1,46 +1,53 @@
1
1
  # Installation
2
- ~~~
2
+ ~~~bash
3
3
  npm install --save @rabbitio/ui-kit
4
4
  ~~~
5
5
 
6
6
  # Using library
7
- 1. To use components for web import the following way:
8
- ~~~
9
- import { Button } from "@rabbitio/ui-kit/web";
10
- ~~~
11
- 2. To use components for node import the following way:
7
+ 1. To use components or base modules for web:
8
+ * import the following way
9
+ ~~~javascript
10
+ import { Button, AmountUtils } from "@rabbitio/ui-kit";
12
11
  ~~~
13
- import { Button } from "@rabbitio/ui-kit/node";
12
+ * add top-level styles import
13
+ ~~~javascript
14
+ import "@rabbitio/ui-kit/index.css";
14
15
  ~~~
15
- 3. To use components for next.js import the following way and add "@rabbitio/ui-kit" to transpilePackages inside your next.config.js:
16
- ~~~
17
- import { Button } from "@rabbitio/ui-kit";
16
+ 2. To use components or base modules for next.js import the following way and add "@rabbitio/ui-kit" to transpilePackages inside your next.config.js:
17
+
18
+ ~~~javascript
19
+ import { Button } from "@rabbitio/ui-kit/next";
20
+ import { AmountUtils } from "@rabbitio/ui-kit";
18
21
  ~~~
19
- 4. [In progress] Also, you can import base styles into your scss index file:
22
+ * add "@rabbitio/ui-kit" to transpilePackages in next.config.js
23
+ ~~~javascript
24
+ transpilePackages: ["@rabbitio/ui-kit"],
20
25
  ~~~
21
- @import "@rabbitio/ui-kit/styles/index";
26
+ * Import styles inside pages/_app.js
27
+ ~~~javascript
28
+ import "@rabbitio/ui-kit/index.css";
22
29
  ~~~
23
30
 
24
31
  # Adding new component
25
32
  1. Add a directory for component under the semantically corresponding subdirectory inside **./stories**
26
33
  2. Under the component directory implement 3 files: **<Component>.js**, **<Component>.module.scss**, **<Component>.stories.js**
27
34
  3. Add the implemented component import to barrel file **./stories/index.js**
28
- ~~~
35
+ ~~~javascript
29
36
  export { default as <Component> } from "./path/to/<Component>";
30
37
  ~~~
31
38
 
32
39
  # Running storybook
33
- ~~~
40
+ ~~~bash
34
41
  sudo docker build -t storybook-app .
35
42
  ~~~
36
- ~~~
43
+ ~~~bash
37
44
  sudo docker run -d -p 6006:6006 storybook-app
38
45
  ~~~
39
46
 
40
47
  # Publishing
41
48
  1. Increase version number and commit
42
49
  2. Run:
43
- ~~~
50
+ ~~~bash
44
51
  npm login
45
52
  npm publish --access public
46
53
  ~~~