@rango-dev/ui 0.17.1-next.8 → 0.18.0
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 +20 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/dist/translations/en.d.ts.map +1 -1
- package/dist/translations/es.d.ts.map +1 -1
- package/dist/translations/fr.d.ts.map +1 -1
- package/dist/translations/{jp.d.ts → ja.d.ts} +1 -1
- package/dist/translations/ja.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/English.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/English.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Flags.constants.d.ts +2 -0
- package/dist/widget/ui/src/components/Flags/Flags.constants.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Flags.types.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Flags.types.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/French.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/French.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Japanese.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Japanese.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Spanish.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Spanish.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/index.d.ts +7 -0
- package/dist/widget/ui/src/components/Flags/index.d.ts.map +1 -0
- package/dist/widget/ui/src/components/I18nManager/I18nManager.d.ts +2 -2
- package/dist/widget/ui/src/components/I18nManager/I18nManager.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetail/StepDetail.d.ts +2 -1
- package/dist/widget/ui/src/components/StepDetail/StepDetail.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SvgIcon/SvgIcon.style.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Typography/Typography.styles.d.ts +4 -4
- package/dist/widget/ui/src/components/Wallet/Content.d.ts +1 -1
- package/dist/widget/ui/src/components/Wallet/Content.d.ts.map +1 -1
- package/dist/widget/ui/src/components/index.d.ts +1 -0
- package/dist/widget/ui/src/components/index.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/Warnings/HighSlippageWarning.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/Warnings/MinRequiredSlippage.d.ts.map +1 -1
- package/package.json +6 -4
- package/src/components/Alert/Alert.styles.ts +2 -2
- package/src/components/BestRoute/BestRoute.tsx +1 -1
- package/src/components/BestRoute/BestRouteSkeleton.styles.ts +1 -1
- package/src/components/BottomLogo/BottomLogo.tsx +2 -2
- package/src/components/Button/Button.styles.tsx +6 -6
- package/src/components/Checkbox/Checkbox.styles.ts +1 -1
- package/src/components/Chip/Chip.tsx +1 -1
- package/src/components/Flags/English.tsx +35 -0
- package/src/components/Flags/Flags.constants.ts +1 -0
- package/src/components/Flags/Flags.types.ts +3 -0
- package/src/components/Flags/French.tsx +26 -0
- package/src/components/Flags/Japanese.tsx +25 -0
- package/src/components/Flags/Spanish.tsx +85 -0
- package/src/components/Flags/index.ts +8 -0
- package/src/components/I18nManager/I18nManager.tsx +18 -9
- package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +2 -2
- package/src/components/ListItem/ListItem.tsx +1 -1
- package/src/components/MessageBox/DefaultMessageBox.tsx +1 -1
- package/src/components/NotFound/NotFound.tsx +1 -1
- package/src/components/PriceImpact/PriceImpact.tsx +2 -2
- package/src/components/Radio/Radio.styles.tsx +1 -1
- package/src/components/RoutesOverview/RoutesOverview.tsx +1 -1
- package/src/components/StepDetail/StepDetail.tsx +7 -4
- package/src/components/StepDetails/StepDetails.tsx +3 -4
- package/src/components/SvgIcon/SvgIcon.style.ts +2 -6
- package/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.tsx +4 -5
- package/src/components/SwapListItem/SwapListItem.tsx +1 -1
- package/src/components/SwapListItem/SwapToken.tsx +3 -3
- package/src/components/Switch/Switch.styles.tsx +2 -2
- package/src/components/TextField/TextField.styles.ts +1 -1
- package/src/components/TokenAmount/TokenAmount.tsx +2 -2
- package/src/components/TokenList/TokenItem.tsx +1 -1
- package/src/components/TokenPreview/TokenPreview.tsx +2 -2
- package/src/components/Wallet/Content.tsx +5 -3
- package/src/components/Wallet/SelectableWallet.tsx +1 -1
- package/src/components/Wallet/Wallet.helpers.ts +2 -2
- package/src/components/index.ts +1 -0
- package/src/containers/SwapHistory/SwapHistory.tsx +4 -4
- package/src/containers/SwapInput/SwapInput.tsx +3 -3
- package/src/containers/SwapInput/TokenSection.styles.ts +2 -2
- package/src/containers/SwapInput/TokenSection.tsx +1 -1
- package/src/containers/TokenInfo/TokenInfo.tsx +4 -4
- package/src/containers/Warnings/BalanceErrors.tsx +1 -1
- package/src/containers/Warnings/HighSlippageWarning.tsx +7 -10
- package/src/containers/Warnings/MinRequiredSlippage.tsx +7 -10
- package/src/theme.ts +8 -8
- package/dist/translations/jp.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../translations/en.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../translations/en.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,KAAwgW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../../translations/es.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../../translations/es.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,KAAuyX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../../../translations/fr.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../../../translations/fr.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,KAAm9X,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const messages: any;
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=ja.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ja.d.ts","sourceRoot":"","sources":["../../../../translations/ja.ts"],"names":[],"mappings":"AAAkB,eAAO,MAAM,QAAQ,KAAyxS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"English.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Flags/English.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,aAAa,qBA4BnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flags.constants.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Flags/Flags.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flags.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Flags/Flags.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"French.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Flags/French.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,aAAa,qBAmBlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Japanese.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Flags/Japanese.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,aAAa,qBAkBpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spanish.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Flags/Spanish.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,aAAa,qBA8EnD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import English from './English';
|
|
2
|
+
import French from './French';
|
|
3
|
+
import Japanese from './Japanese';
|
|
4
|
+
import Spanish from './Spanish';
|
|
5
|
+
export type { FlagPropTypes } from './Flags.types';
|
|
6
|
+
export { English, Spanish, Japanese, French };
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Flags/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -3,12 +3,12 @@ import React from 'react';
|
|
|
3
3
|
declare const messages: {
|
|
4
4
|
en: any;
|
|
5
5
|
es: any;
|
|
6
|
-
|
|
6
|
+
ja: any;
|
|
7
7
|
fr: any;
|
|
8
8
|
};
|
|
9
9
|
export type Language = keyof typeof messages;
|
|
10
10
|
interface PropTypes {
|
|
11
|
-
language
|
|
11
|
+
language: Language;
|
|
12
12
|
}
|
|
13
13
|
declare function I18nManager(props: PropsWithChildren<PropTypes>): React.JSX.Element;
|
|
14
14
|
export { I18nManager };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"I18nManager.d.ts","sourceRoot":"","sources":["../../../../../../src/components/I18nManager/I18nManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/C,OAAO,
|
|
1
|
+
{"version":3,"file":"I18nManager.d.ts","sourceRoot":"","sources":["../../../../../../src/components/I18nManager/I18nManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/C,OAAO,KAAgC,MAAM,OAAO,CAAC;AAcrD,QAAA,MAAM,QAAQ;;;;;CAKb,CAAC;AAIF,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,QAAQ,CAAC;AAC7C,UAAU,SAAS;IACjB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,iBAAS,WAAW,CAAC,KAAK,EAAE,iBAAiB,CAAC,SAAS,CAAC,qBAgBvD;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepDetail.d.ts","sourceRoot":"","sources":["../../../../../../src/components/StepDetail/StepDetail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"StepDetail.d.ts","sourceRoot":"","sources":["../../../../../../src/components/StepDetail/StepDetail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAiF1B,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,iBAAiB,CAAC,SAAS,CAAC,qBAkD7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepDetails.d.ts","sourceRoot":"","sources":["../../../../../../src/components/StepDetails/StepDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,KAA8C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"StepDetails.d.ts","sourceRoot":"","sources":["../../../../../../src/components/StepDetails/StepDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,KAA8C,MAAM,OAAO,CAAC;AAqGnE,eAAO,MAAM,WAAW,oHAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgIcon.style.d.ts","sourceRoot":"","sources":["../../../../../../src/components/SvgIcon/SvgIcon.style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+
|
|
1
|
+
{"version":3,"file":"SvgIcon.style.d.ts","sourceRoot":"","sources":["../../../../../../src/components/SvgIcon/SvgIcon.style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAgCvB,CAAC"}
|
package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapDetailsPlaceholder.d.ts","sourceRoot":"","sources":["../../../../../../src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAM1B,CAAC;AAEH,UAAU,SAAS;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"SwapDetailsPlaceholder.d.ts","sourceRoot":"","sources":["../../../../../../src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAM1B,CAAC;AAEH,UAAU,SAAS;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,qBAyBtD"}
|
|
@@ -3,10 +3,10 @@ export declare const TypographyContainer: import("@stitches/react/types/styled-c
|
|
|
3
3
|
size?: "small" | "medium" | "large" | "xmedium" | "xsmall" | undefined;
|
|
4
4
|
align?: "center" | "left" | "right" | undefined;
|
|
5
5
|
noWrap?: boolean | "true" | undefined;
|
|
6
|
-
ml?: 12 | 4 | 8 |
|
|
7
|
-
mt?: 12 | 4 | 8 |
|
|
8
|
-
mr?: 12 | 4 | 8 |
|
|
9
|
-
mb?: 12 | 4 | 8 |
|
|
6
|
+
ml?: 2 | 12 | 4 | 8 | "4" | "8" | "12" | "2" | undefined;
|
|
7
|
+
mt?: 2 | 12 | 4 | 8 | "4" | "8" | "12" | "2" | undefined;
|
|
8
|
+
mr?: 2 | 12 | 4 | 8 | "4" | "8" | "12" | "2" | undefined;
|
|
9
|
+
mb?: 2 | 12 | 4 | 8 | "4" | "8" | "12" | "2" | undefined;
|
|
10
10
|
}, {
|
|
11
11
|
sm: string;
|
|
12
12
|
md: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Wallet/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Wallet/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,qBAuBnC;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HighSlippageWarning.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/Warnings/HighSlippageWarning.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"HighSlippageWarning.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/Warnings/HighSlippageWarning.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,SAAS;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,qBAiBnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinRequiredSlippage.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/Warnings/MinRequiredSlippage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MinRequiredSlippage.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/Warnings/MinRequiredSlippage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,SAAS;IACjB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAMD,wBAAgB,mBAAmB,CAAC,EAClC,mBAAmB,EACnB,cAAc,GACf,EAAE,SAAS,qBAWX"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
+
"@lingui/core": "4.2.1",
|
|
27
|
+
"@lingui/react": "4.2.1",
|
|
26
28
|
"@rango-dev/queue-manager-rango-preset": "*",
|
|
27
29
|
"react": ">=16"
|
|
28
30
|
},
|
|
@@ -31,6 +33,8 @@
|
|
|
31
33
|
"@babel/preset-env": "^7.21.4",
|
|
32
34
|
"@babel/preset-react": "^7.18.6",
|
|
33
35
|
"@babel/preset-typescript": "^7.21.4",
|
|
36
|
+
"@lingui/core": "4.2.1",
|
|
37
|
+
"@lingui/react": "4.2.1",
|
|
34
38
|
"@storybook/addon-essentials": "^7.1.1",
|
|
35
39
|
"@storybook/addon-info": "^5.3.21",
|
|
36
40
|
"@storybook/addon-links": "^7.1.1",
|
|
@@ -55,15 +59,13 @@
|
|
|
55
59
|
"typescript": "^4.8.4"
|
|
56
60
|
},
|
|
57
61
|
"dependencies": {
|
|
58
|
-
"@lingui/core": "4.2.1",
|
|
59
|
-
"@lingui/react": "4.2.1",
|
|
60
62
|
"@radix-ui/react-checkbox": "^1.0.1",
|
|
61
63
|
"@radix-ui/react-collapsible": "^1.0.3",
|
|
62
64
|
"@radix-ui/react-popover": "^1.0.6",
|
|
63
65
|
"@radix-ui/react-radio-group": "^1.1.1",
|
|
64
66
|
"@radix-ui/react-switch": "^1.0.1",
|
|
65
67
|
"@radix-ui/react-tooltip": "^1.0.2",
|
|
66
|
-
"@rango-dev/wallets-shared": "^0.
|
|
68
|
+
"@rango-dev/wallets-shared": "^0.18.0",
|
|
67
69
|
"@stitches/react": "^1.2.8",
|
|
68
70
|
"rango-sdk": "^0.1.35",
|
|
69
71
|
"react-virtualized-auto-sizer": "^1.0.7",
|
|
@@ -20,9 +20,9 @@ export const Container = styled('div', {
|
|
|
20
20
|
paddingLeft: '$24',
|
|
21
21
|
},
|
|
22
22
|
'.description': {
|
|
23
|
-
$$color: '$colors$
|
|
23
|
+
$$color: '$colors$neutral700',
|
|
24
24
|
[`.${darkTheme} &`]: {
|
|
25
|
-
$$color: '$colors$
|
|
25
|
+
$$color: '$colors$neutral600',
|
|
26
26
|
},
|
|
27
27
|
color: '$$color',
|
|
28
28
|
fontSize: '$10',
|
|
@@ -10,7 +10,7 @@ import { Container, StyledAnchor } from './BottomLogo.styles';
|
|
|
10
10
|
export function BottomLogo() {
|
|
11
11
|
return (
|
|
12
12
|
<Container>
|
|
13
|
-
<Typography variant="body" size="xsmall" color="$
|
|
13
|
+
<Typography variant="body" size="xsmall" color="$neutral700">
|
|
14
14
|
{i18n.t('Powered By')}
|
|
15
15
|
</Typography>
|
|
16
16
|
<Divider direction="horizontal" size={8} />
|
|
@@ -18,7 +18,7 @@ export function BottomLogo() {
|
|
|
18
18
|
<Logo size={16} color="gray" />
|
|
19
19
|
<Divider direction="horizontal" size={4} />
|
|
20
20
|
|
|
21
|
-
<Typography variant="body" size="xsmall" color="
|
|
21
|
+
<Typography variant="body" size="xsmall" color="neutral700">
|
|
22
22
|
RANGO
|
|
23
23
|
</Typography>
|
|
24
24
|
</StyledAnchor>
|
|
@@ -61,7 +61,7 @@ export const ButtonBase = styled('button', {
|
|
|
61
61
|
[`.${darkTheme} &`]: {
|
|
62
62
|
$$color: '$colors$foreground',
|
|
63
63
|
},
|
|
64
|
-
backgroundColor: '$
|
|
64
|
+
backgroundColor: '$neutral600',
|
|
65
65
|
color: '$$color',
|
|
66
66
|
pointerEvents: 'none',
|
|
67
67
|
},
|
|
@@ -80,16 +80,16 @@ export const ButtonBase = styled('button', {
|
|
|
80
80
|
outline: 0,
|
|
81
81
|
},
|
|
82
82
|
'&:disabled': {
|
|
83
|
-
borderColor: '$
|
|
84
|
-
color: '$
|
|
83
|
+
borderColor: '$neutral600',
|
|
84
|
+
color: '$neutral600',
|
|
85
85
|
pointerEvents: 'none',
|
|
86
86
|
},
|
|
87
87
|
},
|
|
88
88
|
ghost: {
|
|
89
89
|
backgroundColor: 'transparent',
|
|
90
|
-
color: '$
|
|
90
|
+
color: '$neutral700',
|
|
91
91
|
'&:disabled': {
|
|
92
|
-
color: '$
|
|
92
|
+
color: '$neutral600',
|
|
93
93
|
pointerEvents: 'none',
|
|
94
94
|
},
|
|
95
95
|
'&:focus-visible': {
|
|
@@ -140,7 +140,7 @@ export const ButtonBase = styled('button', {
|
|
|
140
140
|
[`.${darkTheme} &`]: {
|
|
141
141
|
$$color: '$colors$foreground',
|
|
142
142
|
},
|
|
143
|
-
background: '$
|
|
143
|
+
background: '$neutral600',
|
|
144
144
|
color: '$$color',
|
|
145
145
|
pointerEvents: 'none',
|
|
146
146
|
},
|
|
@@ -13,7 +13,7 @@ export const CheckboxRoot = styled(RadixCheckbox.Root, {
|
|
|
13
13
|
width: '1rem',
|
|
14
14
|
height: '1rem',
|
|
15
15
|
padding: 0,
|
|
16
|
-
border: '1px solid $
|
|
16
|
+
border: '1px solid $neutral600',
|
|
17
17
|
backgroundColor: 'transparent',
|
|
18
18
|
cursor: 'pointer',
|
|
19
19
|
'&[data-state="checked"]': {
|
|
@@ -12,7 +12,7 @@ export function Chip(props: PropTypes) {
|
|
|
12
12
|
<ChipContainer selected={selected} {...otherProps}>
|
|
13
13
|
{prefix || null}
|
|
14
14
|
<Typography
|
|
15
|
-
color={!selected ? '
|
|
15
|
+
color={!selected ? 'neutral700' : undefined}
|
|
16
16
|
variant="body"
|
|
17
17
|
size="medium">
|
|
18
18
|
{label}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { FlagPropTypes } from './Flags.types';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import { DEFAULT_SIZE } from './Flags.constants';
|
|
6
|
+
|
|
7
|
+
export default function English(props: FlagPropTypes) {
|
|
8
|
+
const { size = DEFAULT_SIZE } = props;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<svg
|
|
12
|
+
width={size}
|
|
13
|
+
height={size}
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
viewBox="0 0 512 512">
|
|
16
|
+
<mask id="a">
|
|
17
|
+
<circle cx="256" cy="256" r="256" fill="#fff" />
|
|
18
|
+
</mask>
|
|
19
|
+
<g mask="url(#a)">
|
|
20
|
+
<path
|
|
21
|
+
fill="#eee"
|
|
22
|
+
d="m0 0 8 22-8 23v23l32 54-32 54v32l32 48-32 48v32l32 54-32 54v68l22-8 23 8h23l54-32 54 32h32l48-32 48 32h32l54-32 54 32h68l-8-22 8-23v-23l-32-54 32-54v-32l-32-48 32-48v-32l-32-54 32-54V0l-22 8-23-8h-23l-54 32-54-32h-32l-48 32-48-32h-32l-54 32L68 0H0z"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
fill="#0052b4"
|
|
26
|
+
d="M336 0v108L444 0Zm176 68L404 176h108zM0 176h108L0 68ZM68 0l108 108V0Zm108 512V404L68 512ZM0 444l108-108H0Zm512-108H404l108 108Zm-68 176L336 404v108z"
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
fill="#d80027"
|
|
30
|
+
d="M0 0v45l131 131h45L0 0zm208 0v208H0v96h208v208h96V304h208v-96H304V0h-96zm259 0L336 131v45L512 0h-45zM176 336 0 512h45l131-131v-45zm160 0 176 176v-45L381 336h-45z"
|
|
31
|
+
/>
|
|
32
|
+
</g>
|
|
33
|
+
</svg>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DEFAULT_SIZE = '1em';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FlagPropTypes } from './Flags.types';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import { DEFAULT_SIZE } from './Flags.constants';
|
|
6
|
+
|
|
7
|
+
export default function French(props: FlagPropTypes) {
|
|
8
|
+
const { size = DEFAULT_SIZE } = props;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<svg
|
|
12
|
+
width={size}
|
|
13
|
+
height={size}
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
viewBox="0 0 512 512">
|
|
16
|
+
<mask id="a">
|
|
17
|
+
<circle cx="256" cy="256" r="256" fill="#fff" />
|
|
18
|
+
</mask>
|
|
19
|
+
<g mask="url(#a)">
|
|
20
|
+
<path fill="#eee" d="M167 0h178l25.9 252.3L345 512H167l-29.8-253.4z" />
|
|
21
|
+
<path fill="#0052b4" d="M0 0h167v512H0z" />
|
|
22
|
+
<path fill="#d80027" d="M345 0h167v512H345z" />
|
|
23
|
+
</g>
|
|
24
|
+
</svg>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { FlagPropTypes } from './Flags.types';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import { DEFAULT_SIZE } from './Flags.constants';
|
|
6
|
+
|
|
7
|
+
export default function Japanese(props: FlagPropTypes) {
|
|
8
|
+
const { size = DEFAULT_SIZE } = props;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<svg
|
|
12
|
+
width={size}
|
|
13
|
+
height={size}
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
viewBox="0 0 512 512">
|
|
16
|
+
<mask id="a">
|
|
17
|
+
<circle cx="256" cy="256" r="256" fill="#fff" />
|
|
18
|
+
</mask>
|
|
19
|
+
<g mask="url(#a)">
|
|
20
|
+
<path fill="#eee" d="M0 0h512v512H0z" />
|
|
21
|
+
<circle cx="256" cy="256" r="111.3" fill="#d80027" />
|
|
22
|
+
</g>
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { FlagPropTypes } from './Flags.types';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import { DEFAULT_SIZE } from './Flags.constants';
|
|
6
|
+
|
|
7
|
+
export default function Spanish(props: FlagPropTypes) {
|
|
8
|
+
const { size = DEFAULT_SIZE } = props;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<svg
|
|
12
|
+
width={size}
|
|
13
|
+
height={size}
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
viewBox="0 0 512 512">
|
|
16
|
+
<mask id="a">
|
|
17
|
+
<circle cx="256" cy="256" r="256" fill="#fff" />
|
|
18
|
+
</mask>
|
|
19
|
+
<g mask="url(#a)">
|
|
20
|
+
<path fill="#ffda44" d="m0 128 256-32 256 32v256l-256 32L0 384Z" />
|
|
21
|
+
<path fill="#d80027" d="M0 0h512v128H0zm0 384h512v128H0z" />
|
|
22
|
+
<g fill="#eee">
|
|
23
|
+
<path d="M144 304h-16v-80h16zm128 0h16v-80h-16z" />
|
|
24
|
+
<ellipse cx="208" cy="296" rx="48" ry="32" />
|
|
25
|
+
</g>
|
|
26
|
+
<g fill="#d80027">
|
|
27
|
+
<rect width="16" height="24" x="128" y="192" rx="8" />
|
|
28
|
+
<rect width="16" height="24" x="272" y="192" rx="8" />
|
|
29
|
+
<path d="M208 272v24a24 24 0 0 0 24 24 24 24 0 0 0 24-24v-24h-24z" />
|
|
30
|
+
</g>
|
|
31
|
+
<rect width="32" height="16" x="120" y="208" fill="#ff9811" ry="8" />
|
|
32
|
+
<rect width="32" height="16" x="264" y="208" fill="#ff9811" ry="8" />
|
|
33
|
+
<rect width="32" height="16" x="120" y="304" fill="#ff9811" rx="8" />
|
|
34
|
+
<rect width="32" height="16" x="264" y="304" fill="#ff9811" rx="8" />
|
|
35
|
+
<path
|
|
36
|
+
fill="#ff9811"
|
|
37
|
+
d="M160 272v24c0 8 4 14 9 19l5-6 5 10a21 21 0 0 0 10 0l5-10 5 6c6-5 9-11 9-19v-24h-9l-5 8-5-8h-10l-5 8-5-8z"
|
|
38
|
+
/>
|
|
39
|
+
<path d="M122 252h172m-172 24h28m116 0h28" />
|
|
40
|
+
<path
|
|
41
|
+
fill="#d80027"
|
|
42
|
+
d="M122 248a4 4 0 0 0-4 4 4 4 0 0 0 4 4h172a4 4 0 0 0 4-4 4 4 0 0 0-4-4zm0 24a4 4 0 0 0-4 4 4 4 0 0 0 4 4h28a4 4 0 0 0 4-4 4 4 0 0 0-4-4zm144 0a4 4 0 0 0-4 4 4 4 0 0 0 4 4h28a4 4 0 0 0 4-4 4 4 0 0 0-4-4z"
|
|
43
|
+
/>
|
|
44
|
+
<path
|
|
45
|
+
fill="#eee"
|
|
46
|
+
d="M196 168c-7 0-13 5-15 11l-5-1c-9 0-16 7-16 16s7 16 16 16c7 0 13-4 15-11a16 16 0 0 0 17-4 16 16 0 0 0 17 4 16 16 0 1 0 10-20 16 16 0 0 0-27-5c-3-4-7-6-12-6zm0 8c5 0 8 4 8 8 0 5-3 8-8 8-4 0-8-3-8-8 0-4 4-8 8-8zm24 0c5 0 8 4 8 8 0 5-3 8-8 8-4 0-8-3-8-8 0-4 4-8 8-8zm-44 10 4 1 4 8c0 4-4 7-8 7s-8-3-8-8c0-4 4-8 8-8zm64 0c5 0 8 4 8 8 0 5-3 8-8 8-4 0-8-3-8-7l4-8z"
|
|
47
|
+
/>
|
|
48
|
+
<path fill="none" d="M220 284v12c0 7 5 12 12 12s12-5 12-12v-12z" />
|
|
49
|
+
<path fill="#ff9811" d="M200 160h16v32h-16z" />
|
|
50
|
+
<path fill="#eee" d="M208 224h48v48h-48z" />
|
|
51
|
+
<path
|
|
52
|
+
fill="#d80027"
|
|
53
|
+
d="m248 208-8 8h-64l-8-8c0-13 18-24 40-24s40 11 40 24zm-88 16h48v48h-48z"
|
|
54
|
+
/>
|
|
55
|
+
<rect
|
|
56
|
+
width="20"
|
|
57
|
+
height="32"
|
|
58
|
+
x="222"
|
|
59
|
+
y="232"
|
|
60
|
+
fill="#d80027"
|
|
61
|
+
rx="10"
|
|
62
|
+
ry="10"
|
|
63
|
+
/>
|
|
64
|
+
<path
|
|
65
|
+
fill="#ff9811"
|
|
66
|
+
d="M168 232v8h8v16h-8v8h32v-8h-8v-16h8v-8zm8-16h64v8h-64z"
|
|
67
|
+
/>
|
|
68
|
+
<g fill="#ffda44">
|
|
69
|
+
<circle cx="186" cy="202" r="6" />
|
|
70
|
+
<circle cx="208" cy="202" r="6" />
|
|
71
|
+
<circle cx="230" cy="202" r="6" />
|
|
72
|
+
</g>
|
|
73
|
+
<path
|
|
74
|
+
fill="#d80027"
|
|
75
|
+
d="M169 272v43a24 24 0 0 0 10 4v-47h-10zm20 0v47a24 24 0 0 0 10-4v-43h-10z"
|
|
76
|
+
/>
|
|
77
|
+
<g fill="#338af3">
|
|
78
|
+
<circle cx="208" cy="272" r="16" />
|
|
79
|
+
<rect width="32" height="16" x="264" y="320" ry="8" />
|
|
80
|
+
<rect width="32" height="16" x="120" y="320" ry="8" />
|
|
81
|
+
</g>
|
|
82
|
+
</g>
|
|
83
|
+
</svg>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { PropsWithChildren } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
4
|
import { I18nProvider } from '@lingui/react';
|
|
5
|
-
import React, { useEffect } from 'react';
|
|
5
|
+
import React, { useEffect, useReducer } from 'react';
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
*Note: esbuild doesn't work properly with paths yet, so I couldn't use `paths` to make this path shorter.
|
|
@@ -14,13 +14,12 @@ import React, { useEffect } from 'react';
|
|
|
14
14
|
import { messages as enMessages } from '../../../../../translations/en';
|
|
15
15
|
import { messages as esMessages } from '../../../../../translations/es';
|
|
16
16
|
import { messages as frMessages } from '../../../../../translations/fr';
|
|
17
|
-
import { messages as
|
|
17
|
+
import { messages as jaMessages } from '../../../../../translations/ja';
|
|
18
18
|
|
|
19
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
20
19
|
const messages = {
|
|
21
20
|
en: enMessages,
|
|
22
21
|
es: esMessages,
|
|
23
|
-
|
|
22
|
+
ja: jaMessages,
|
|
24
23
|
fr: frMessages,
|
|
25
24
|
};
|
|
26
25
|
|
|
@@ -28,15 +27,25 @@ i18n.load(messages);
|
|
|
28
27
|
|
|
29
28
|
export type Language = keyof typeof messages;
|
|
30
29
|
interface PropTypes {
|
|
31
|
-
language
|
|
30
|
+
language: Language;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
function I18nManager(props: PropsWithChildren<PropTypes>) {
|
|
34
|
+
const [count, forceUpdate] = useReducer((x) => x + 1, 0);
|
|
35
35
|
useEffect(() => {
|
|
36
|
-
i18n.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
i18n.on('change', () => {
|
|
37
|
+
forceUpdate();
|
|
38
|
+
});
|
|
39
|
+
}, [i18n]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
i18n.activate(props.language);
|
|
42
|
+
}, [props.language]);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<I18nProvider i18n={i18n} key={count}>
|
|
46
|
+
{props.children}
|
|
47
|
+
</I18nProvider>
|
|
48
|
+
);
|
|
40
49
|
}
|
|
41
50
|
|
|
42
51
|
export { I18nManager };
|