@onepercentio/one-ui 0.2.4 → 0.2.8
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/dist/__test__/utils.d.ts +0 -1
- package/dist/__test__/utils.js +3 -35
- package/dist/__test__/utils.js.map +1 -1
- package/dist/components/AdaptiveButton/AdaptiveButton.js +8 -2
- package/dist/components/AdaptiveButton/AdaptiveButton.js.map +1 -1
- package/dist/components/AdaptiveButton/AdaptiveButton.module.scss +2 -1
- package/dist/components/AdaptiveButton/AdaptiveButton.stories.js +1 -1
- package/dist/components/AdaptiveButton/AdaptiveButton.stories.js.map +1 -1
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.module.scss +1 -1
- package/dist/components/EmailInput/EmailInput.d.ts +4 -2
- package/dist/components/EmailInput/EmailInput.stories.d.ts +4 -2
- package/dist/components/Form/Form.d.ts +14 -8
- package/dist/components/Form/Form.js +11 -1
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/Input/Input.d.ts +7 -3
- package/dist/components/Input/Input.js +2 -1
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/Input.module.scss +1 -0
- package/dist/components/Input/Input.stories.d.ts +3 -1
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.module.scss +5 -2
- package/dist/components/PasswordInput/PasswordInput.d.ts +3 -1
- package/dist/components/Select/Select.stories.d.ts +6 -2
- package/dist/components/Text/Text.js +1 -1
- package/dist/components/Text/Text.js.map +1 -1
- package/dist/components/Transition/Transition.d.ts +3 -2
- package/dist/components/Transition/Transition.js +19 -3
- package/dist/components/Transition/Transition.js.map +1 -1
- package/dist/components/Transition/Transition.module.scss +58 -5
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.d.ts +1 -0
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.js +42 -1
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.js.map +1 -1
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.module.scss +4 -0
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js +0 -2
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js.map +1 -1
- package/dist/context/OneUIProvider.d.ts +5 -3
- package/dist/context/OneUIProvider.js +35 -46
- package/dist/context/OneUIProvider.js.map +1 -1
- package/dist/hooks/shims/ObjectWatchShim.js +9 -12
- package/dist/hooks/shims/ObjectWatchShim.js.map +1 -1
- package/dist/hooks/useForm.d.ts +14 -0
- package/dist/hooks/useForm.js +24 -0
- package/dist/hooks/useForm.js.map +1 -0
- package/dist/hooks/useObserve.js +3 -1
- package/dist/hooks/useObserve.js.map +1 -1
- package/dist/hooks/useShortIntl.d.ts +1 -0
- package/dist/hooks/useShortIntl.js +5 -2
- package/dist/hooks/useShortIntl.js.map +1 -1
- package/package.json +8 -3
- package/scripts/start-emulator.js +46 -0
|
@@ -4,10 +4,13 @@ exports.isolateMessages = void 0;
|
|
|
4
4
|
const react_intl_1 = require("react-intl");
|
|
5
5
|
function useShortIntl() {
|
|
6
6
|
const intl = (0, react_intl_1.useIntl)();
|
|
7
|
-
const { formatMessage } = intl;
|
|
7
|
+
const { formatMessage, formatNumber } = intl;
|
|
8
8
|
return Object.assign(Object.assign({}, intl), { txt: (id, params) => {
|
|
9
9
|
return formatMessage({ id }, params);
|
|
10
|
-
},
|
|
10
|
+
}, formatToDoubleDecimal(val, options = {}) {
|
|
11
|
+
return formatNumber(val, Object.assign({ minimumFractionDigits: 2, maximumFractionDigits: 2 }, options));
|
|
12
|
+
},
|
|
13
|
+
formatBigNumber(bigNumber, options) {
|
|
11
14
|
const { decimalSeparator } = intl
|
|
12
15
|
.formatNumberToParts(1000.1)
|
|
13
16
|
.reduce((r, a) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShortIntl.js","sourceRoot":"","sources":["../../src/hooks/useShortIntl.ts"],"names":[],"mappings":";;;AAAA,2CAAgE;AAGhE,SAAwB,YAAY;
|
|
1
|
+
{"version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,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,qBAAqB,KAAI,SAAS,CAAC,aAAa,EAAE,EAC3D,CAAC,CACF;iBACA,QAAQ,EAAE;iBACV,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACrB,OAAO,GAAG,OAAO,GAAG,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,gBAAgB,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC,EACxE,EAAE,CAAC;QACP,CAAC,IACD;AACJ,CAAC;AAhDD,+BAgDC;AAUD,SAAgB,eAAe,CAC7B,OAAU,EACV,OAAU;IAEV,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CACnC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iCACV,CAAC,KACJ,CAAC,GAAG,OAAO,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,IACtB,EACF,EAA4C,CAC7C,CAAC;AACJ,CAAC;AAXD,0CAWC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onepercentio/one-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "A set of reusable components created through the development of Onepercent projects",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"WebpackConfigs",
|
|
8
8
|
"cypress/support"
|
|
9
9
|
],
|
|
10
|
+
"bin": {
|
|
11
|
+
"start-emulator": "scripts/start-emulator.js"
|
|
12
|
+
},
|
|
10
13
|
"repository": "git@github.com:onepercentio/one-ui.git",
|
|
11
14
|
"author": "Murilo Oliveira de Araujo <muritavo@outlook.com>",
|
|
12
15
|
"license": "MIT",
|
|
@@ -42,6 +45,7 @@
|
|
|
42
45
|
"https-browserify": "^1.0.0",
|
|
43
46
|
"inquirer": "^8.2.4",
|
|
44
47
|
"jest": "^27.3.1",
|
|
48
|
+
"node-fetch": "^2",
|
|
45
49
|
"node-sass": "^6.0.1",
|
|
46
50
|
"os-browserify": "^0.3.0",
|
|
47
51
|
"react": "^18.0.0",
|
|
@@ -54,9 +58,10 @@
|
|
|
54
58
|
"stream-http": "^3.2.0",
|
|
55
59
|
"style-loader": "^2",
|
|
56
60
|
"ts-jest": "^27.0.7",
|
|
61
|
+
"type-fest": "^2.13.1",
|
|
57
62
|
"typescript": "^4.5.2",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
63
|
+
"url": "^0.11.0",
|
|
64
|
+
"use-wallet": "0.13.5"
|
|
60
65
|
},
|
|
61
66
|
"dependencies": {
|
|
62
67
|
"@types/chroma-js": "^2.1.3",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const fetch = require("node-fetch");
|
|
2
|
+
const { spawn } = require("child_process");
|
|
3
|
+
function WaitTimeout(ml = 200) {
|
|
4
|
+
return new Promise((r) => {
|
|
5
|
+
setTimeout(() => {
|
|
6
|
+
r();
|
|
7
|
+
}, ml);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
const [, , projectId, databaseToImport] = process.argv;
|
|
11
|
+
|
|
12
|
+
if (!projectId) {
|
|
13
|
+
console.error("You need to provide a project id");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
spawn(
|
|
17
|
+
`firebase emulators:start -P ${projectId} ${
|
|
18
|
+
databaseToImport ? `--import ${databaseToImport}` : ""
|
|
19
|
+
}`,
|
|
20
|
+
{
|
|
21
|
+
cwd: undefined,
|
|
22
|
+
env: process.env,
|
|
23
|
+
shell: true,
|
|
24
|
+
detached: true,
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
(async function () {
|
|
29
|
+
let breakLoop = false;
|
|
30
|
+
const timeout = setTimeout(() => {
|
|
31
|
+
breakLoop = true;
|
|
32
|
+
console.error("Could not receive ok from firebase emulator");
|
|
33
|
+
clearTimeout(timeout);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}, 60000);
|
|
36
|
+
while (!breakLoop) {
|
|
37
|
+
try {
|
|
38
|
+
await fetch(`http://localhost:4000`);
|
|
39
|
+
console.log("Emulator restarted");
|
|
40
|
+
clearTimeout(timeout);
|
|
41
|
+
process.exit(0);
|
|
42
|
+
} catch (e) {}
|
|
43
|
+
await WaitTimeout(1000);
|
|
44
|
+
}
|
|
45
|
+
await new Promise((r) => {});
|
|
46
|
+
})();
|