@rabbitio/ui-kit 1.0.0-beta.42 → 1.0.0-beta.45

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 (67) hide show
  1. package/.gitlab-ci.yml +29 -0
  2. package/.husky/commit-msg +8 -0
  3. package/.husky/pre-push +1 -0
  4. package/README.md +13 -4
  5. package/dist/index.cjs +1545 -148
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.css +23630 -0
  8. package/dist/index.css.map +1 -1
  9. package/dist/index.modern.js +1318 -103
  10. package/dist/index.modern.js.map +1 -1
  11. package/dist/index.module.js +1534 -149
  12. package/dist/index.module.js.map +1 -1
  13. package/dist/index.umd.js +1544 -152
  14. package/dist/index.umd.js.map +1 -1
  15. package/package.json +16 -3
  16. package/src/assets/image/icons/arrow-tosca.svg +3 -0
  17. package/src/assets/image/icons/arrow-white.svg +14 -0
  18. package/src/assets/image/icons/failed-validation-icon.svg +15 -0
  19. package/src/assets/image/icons/successful-validation-icon.svg +10 -0
  20. package/src/common/amountUtils.js +4 -2
  21. package/src/common/tests/integration/external-apis/ipAddressProviders/getClientIpAddress.test.js +14 -0
  22. package/src/common/utils/cache.js +4 -4
  23. package/src/components/atoms/BackgroundTitle/BackgroundTitle.jsx +44 -0
  24. package/src/components/atoms/BackgroundTitle/background-title.module.scss +52 -0
  25. package/src/components/atoms/Validation/Validation.jsx +130 -0
  26. package/src/components/atoms/Validation/validation.module.scss +15 -0
  27. package/src/components/atoms/buttons/Close/Close.jsx +64 -0
  28. package/src/components/atoms/buttons/Close/close.module.scss +75 -0
  29. package/src/components/atoms/buttons/LinkButton/LinkButton.jsx +121 -0
  30. package/src/components/atoms/buttons/LinkButton/link-button.module.scss +45 -0
  31. package/src/components/organisms/Dialog/Dialog.jsx +515 -0
  32. package/src/components/organisms/Dialog/DialogButtons/DialogButtons.jsx +122 -0
  33. package/src/components/organisms/Dialog/DialogButtons/dialog-buttons.module.scss +25 -0
  34. package/src/components/organisms/Dialog/DialogStep/DialogStep.jsx +664 -0
  35. package/src/components/organisms/Dialog/DialogStep/dialog-step.module.scss +362 -0
  36. package/src/components/organisms/Dialog/dialog.module.scss +223 -0
  37. package/src/components/tests/utils/inputValueProviders/provideFormatOfFloatValueByInputString.test.js +139 -0
  38. package/src/components/tests/utils/urlQueryUtils/getQueryParameterValues.test.js +71 -0
  39. package/src/components/tests/utils/urlQueryUtils/saveQueryParameterAndValues.test.js +144 -0
  40. package/src/components/utils/inputValueProviders.js +58 -0
  41. package/src/constants/organisms/dialog/DialogStep/dialogStep.js +1 -0
  42. package/src/constants/organisms/dialog/dialog.js +29 -0
  43. package/src/index.js +11 -0
  44. package/src/robustExteranlApiCallerService/robustExternalAPICallerService.js +3 -1
  45. package/src/robustExteranlApiCallerService/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/_performCallAttempt.test.js +787 -0
  46. package/src/robustExteranlApiCallerService/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/callExternalAPI.test.js +745 -0
  47. package/src/robustExteranlApiCallerService/tests/robustExternalAPICallerService/robustExternalAPICallerService/constructor.test.js +31 -0
  48. package/src/swaps-lib/external-apis/swapProvider.js +17 -4
  49. package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +91 -30
  50. package/src/swaps-lib/models/baseSwapCreationInfo.js +4 -1
  51. package/src/swaps-lib/models/existingSwap.js +3 -0
  52. package/src/swaps-lib/models/existingSwapWithFiatData.js +4 -0
  53. package/src/swaps-lib/services/publicSwapService.js +32 -4
  54. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +506 -0
  55. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/createSwap.test.js +1311 -0
  56. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getAllSupportedCurrencies.test.js +76 -0
  57. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getDepositCurrencies.test.js +82 -0
  58. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getSwapInfo.test.js +1892 -0
  59. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getWithdrawalCurrencies.test.js +111 -0
  60. package/src/swaps-lib/test/utils/swapUtils/safeHandleRequestsLimitExceeding.test.js +88 -0
  61. package/stories/stubs/exampleContent.jsx +20 -0
  62. package/styles/fonts/NunitoSans-Bold.ttf +0 -0
  63. package/styles/fonts/NunitoSans-ExtraBold.ttf +0 -0
  64. package/styles/fonts/NunitoSans-Light.ttf +0 -0
  65. package/styles/fonts/NunitoSans-Regular.ttf +0 -0
  66. package/styles/fonts/NunitoSans-SemiBold.ttf +0 -0
  67. package/styles/index.scss +14 -13
package/.gitlab-ci.yml ADDED
@@ -0,0 +1,29 @@
1
+ stages:
2
+ - build
3
+ - test
4
+ # - release
5
+
6
+ test:
7
+ stage: test
8
+ image: node:iron
9
+ cache:
10
+ key: "$CI_COMMIT_REF_SLUG"
11
+ paths:
12
+ - node_modules/
13
+ variables:
14
+ GIT_STRATEGY: fetch
15
+ script:
16
+ - npm install --force --no-fund # --no-optional
17
+ - npm run test
18
+
19
+ build:
20
+ stage: build
21
+ image: node:iron
22
+ cache:
23
+ key: "$CI_COMMIT_REF_SLUG"
24
+ paths:
25
+ - node_modules/
26
+ script:
27
+ - HUSKY=true npm install --force --no-fund
28
+ # use "- unset CI" if needed to ignore warnings - dirty workaround due to React's way to fail builds having warnings
29
+ - npm run build
@@ -0,0 +1,8 @@
1
+ #!/bin/sh
2
+ # Hook script to ensure commit messages end with 'task_id=[a-zA-Z0-9]+'
3
+ COMMIT_REGEXP='task_id=[,a-zA-Z0-9]+$'
4
+
5
+ if ! grep -qE "$COMMIT_REGEXP" "$1"; then
6
+ echo "ERROR: Commit message doesn't end with task_id"
7
+ exit 1
8
+ fi
@@ -0,0 +1 @@
1
+ npm run build && git diff --quiet || (echo 'Uncommitted changes detected. Please commit or stash them. If you have no uncommitted changes this error is caused by running npm run build - you forget to do this. Please add build result to commit and retry.' && exit 1)
package/README.md CHANGED
@@ -29,8 +29,8 @@ import "@rabbitio/ui-kit/index.css";
29
29
  ~~~
30
30
 
31
31
  # Adding new component
32
- 1. Add a directory for component under the semantically corresponding subdirectory inside **./stories**
33
- 2. Under the component directory implement 3 files: **<Component>.js**, **<Component>.module.scss**, **<Component>.stories.js**
32
+ 1. Add a directory for component under the semantically corresponding subdirectory inside **./src/components** and add **<Component>.js**, **<Component>.module.scss** to this directory
33
+ 2. Under the **./stories** directory repeat the directories structure from **./src/components** and implement **<Component>.stories.js** there
34
34
  3. Add the implemented component import to barrel file **./stories/index.js**
35
35
  ~~~javascript
36
36
  export { default as <Component> } from "./path/to/<Component>";
@@ -45,9 +45,18 @@ sudo docker run -d -p 6006:6006 storybook-app
45
45
  ~~~
46
46
 
47
47
  # Publishing
48
- 1. Increase version number and commit
49
- 2. Run:
48
+ 1. Increase version number
49
+ 2. Run npm run build. Ensure that all the uncommitted changes are planned to be published as build command will build them all into the bundle.
50
+ 3. Commit and push changes
51
+ 4. Run:
50
52
  ~~~bash
51
53
  npm login
52
54
  npm publish --access public
53
55
  ~~~
56
+
57
+ # Dev details
58
+ 1. The repository uses husky to assure
59
+ 1. each commit message ends with task_id=<id>
60
+ 2. there is no uncommitted changes when pushing (to avoid pushing not built changes)
61
+ 2. The repository follows git-flow branching model
62
+ 3. There is a basic CI/CD setup