@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.
- package/CHANGELOG.md +0 -0
- package/README.md +23 -16
- package/dist/index.cjs +4403 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +8757 -1
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +3689 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +4374 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +4405 -1
- package/dist/index.umd.js.map +1 -1
- package/index.js +1 -1
- package/package.json +17 -24
- package/src/common/amountUtils.js +423 -0
- package/src/common/errorUtils.js +27 -0
- package/src/common/fiatCurrenciesService.js +161 -0
- package/src/common/models/blockchain.js +10 -0
- package/src/common/models/coin.js +157 -0
- package/src/common/models/protocol.js +5 -0
- package/src/common/utils/cache.js +268 -0
- package/src/common/utils/emailAPI.js +18 -0
- package/src/common/utils/logging/logger.js +48 -0
- package/src/common/utils/logging/logsStorage.js +61 -0
- package/src/common/utils/safeStringify.js +50 -0
- package/src/components/atoms/AssetIcon/AssetIcon.jsx +55 -0
- package/src/components/atoms/AssetIcon/asset-icon.module.scss +42 -0
- package/{stories → src/components}/atoms/LoadingDots/LoadingDots.module.scss +1 -1
- package/src/components/atoms/SupportChat/SupportChat.jsx +40 -0
- package/{stories → src/components}/atoms/buttons/Button/Button.jsx +6 -6
- package/{stories → src/components}/atoms/buttons/Button/Button.module.scss +6 -1
- package/src/components/hooks/useCallHandlingErrors.js +26 -0
- package/src/components/hooks/useReferredState.js +24 -0
- package/src/index.js +33 -0
- package/src/swaps-lib/external-apis/swapProvider.js +169 -0
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +811 -0
- package/src/swaps-lib/models/baseSwapCreationInfo.js +40 -0
- package/src/swaps-lib/models/existingSwap.js +58 -0
- package/src/swaps-lib/models/existingSwapWithFiatData.js +115 -0
- package/src/swaps-lib/services/publicSwapService.js +602 -0
- package/src/swaps-lib/utils/swapUtils.js +209 -0
- package/stories/index.js +0 -2
- /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
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
12
|
+
* add top-level styles import
|
|
13
|
+
~~~javascript
|
|
14
|
+
import "@rabbitio/ui-kit/index.css";
|
|
14
15
|
~~~
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
22
|
+
* add "@rabbitio/ui-kit" to transpilePackages in next.config.js
|
|
23
|
+
~~~javascript
|
|
24
|
+
transpilePackages: ["@rabbitio/ui-kit"],
|
|
20
25
|
~~~
|
|
21
|
-
|
|
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
|
~~~
|