@pushchain/ui-kit 2.0.6 → 2.0.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushchain/ui-kit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"homepage": "https://push.org",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pushchain",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@coral-xyz/anchor": "^0.31.1",
|
|
21
21
|
"@metamask/sdk": "^0.32.0",
|
|
22
|
-
"@pushchain/core": "2.0.
|
|
22
|
+
"@pushchain/core": "2.0.11",
|
|
23
23
|
"@solana/web3.js": "^1.98.2",
|
|
24
24
|
"@walletconnect/ethereum-provider": "^2.21.5",
|
|
25
25
|
"buffer": "^6.0.3",
|
|
@@ -10,22 +10,22 @@ const ConnectWalletButton_1 = require("./ConnectWalletButton");
|
|
|
10
10
|
const TogglePushWalletButton_1 = require("./TogglePushWalletButton");
|
|
11
11
|
const styled_components_1 = require("styled-components");
|
|
12
12
|
const theme_1 = require("../../utils/theme");
|
|
13
|
+
const GlobalStyle = (0, styled_components_1.createGlobalStyle) `
|
|
14
|
+
[data-pw-wrapper='${(props) => props.uid}']{
|
|
15
|
+
${(props) => {
|
|
16
|
+
var _a;
|
|
17
|
+
const { themeOverrides, themeMode } = props.theme;
|
|
18
|
+
const isLightMode = themeMode === 'light';
|
|
19
|
+
const { dark, light } = themeOverrides, globalOverrides = tslib_1.__rest(themeOverrides, ["dark", "light"]);
|
|
20
|
+
const newTokens = Object.assign(Object.assign({}, (0, theme_1.mapButtonCoreToInt)(globalOverrides)), (0, theme_1.mapButtonCoreToInt)((_a = (isLightMode ? light : dark)) !== null && _a !== void 0 ? _a : {}));
|
|
21
|
+
return Object.entries(newTokens)
|
|
22
|
+
.map(([key, value]) => `${key}: ${value};`)
|
|
23
|
+
.join('\n');
|
|
24
|
+
}}
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
13
27
|
const PushUniversalAccountButton = ({ uid = 'default', connectButtonText = 'Connect Account', loadingComponent, modalAppOverride, loginAppOverride, themeOverrides: ButtonThemeOverrides, }) => {
|
|
14
28
|
const { universalAccount, themeOverrides, themeMode, updateModalAppData, updateWalletAppData, } = (0, usePushWallet_1.usePushWalletContext)(uid);
|
|
15
|
-
const GlobalStyle = (0, styled_components_1.createGlobalStyle) `
|
|
16
|
-
[data-pw-wrapper='${(props) => props.uid}']{
|
|
17
|
-
${(props) => {
|
|
18
|
-
var _a;
|
|
19
|
-
const { themeOverrides, themeMode } = props.theme;
|
|
20
|
-
const isLightMode = themeMode === 'light';
|
|
21
|
-
const { dark, light } = themeOverrides, globalOverrides = tslib_1.__rest(themeOverrides, ["dark", "light"]);
|
|
22
|
-
const newTokens = Object.assign(Object.assign({}, (0, theme_1.mapButtonCoreToInt)(globalOverrides)), (0, theme_1.mapButtonCoreToInt)((_a = (isLightMode ? light : dark)) !== null && _a !== void 0 ? _a : {}));
|
|
23
|
-
return Object.entries(newTokens)
|
|
24
|
-
.map(([key, value]) => `${key}: ${value};`)
|
|
25
|
-
.join('\n');
|
|
26
|
-
}}
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
29
|
(0, react_1.useEffect)(() => {
|
|
30
30
|
if (modalAppOverride)
|
|
31
31
|
updateModalAppData(modalAppOverride);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/ui-kit/src/lib/components/PushUniversalAccountButton/index.tsx"],"names":[],"mappings":";;;;;AAAA,sDAAsD;AACtD,iCAAsD;AACtD,6DAAiE;AACjE,+DAA4D;AAC5D,qEAAkE;AAClE,yDAI2B;AAE3B,6CAAuD;AAiBvD,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../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CAAC;IAE9B,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,gBAAgB;YAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;QAC3D,IAAI,gBAAgB;YAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC9D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,SAAS,GAAG,GAAG,EAAE;QACrB,IAAI,gBAAgB,EAAE,CAAC;YACrB,mEAAmE;YACnE,MAAM,iBAAiB,GAAG;gBACxB,GAAG,EAAE,GAAG;gBACR,gBAAgB,EAAE,gBAAgB;aACnC,CAAC;YAEF,OAAO,uBAAC,+CAAsB,oBAAK,iBAAiB,EAAI,CAAC;QAC3D,CAAC;aAAM,CAAC;YACN,mEAAmE;YACnE,MAAM,kBAAkB,GAAG;gBACzB,GAAG,EAAE,GAAG;gBACR,iBAAiB;gBACjB,gBAAgB;aACjB,CAAC;YAEF,OAAO,uBAAC,yCAAmB,oBAAK,kBAAkB,EAAI,CAAC;QACzD,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,wBAAC,iCAAa,IACZ,KAAK,EAAE;YACL,SAAS;YACT,cAAc,kCAAO,cAAc,GAAK,oBAAoB,CAAE;SAC/D,aAED,uBAAC,WAAW,IAAC,GAAG,EAAE,GAAG,GAAI,EACzB,uBAAC,SAAS,KAAG,IACC,CACjB,CAAC;AACJ,CAAC,CAAC;AAEO,gEAA0B"}
|
|
@@ -26,27 +26,27 @@ const PushWalletConfigDefault = {
|
|
|
26
26
|
connectedLayout: constants_1.PushUI.CONSTANTS.CONNECTED.LAYOUT.HOVER,
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
|
+
const GlobalStyle = (0, styled_components_1.createGlobalStyle) `
|
|
30
|
+
[data-pw-wrapper='${(props) => props.uid}']{
|
|
31
|
+
#w3m-modal {
|
|
32
|
+
z-index: 9999 !important;
|
|
33
|
+
position: fixed !important;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
${(props) => {
|
|
37
|
+
var _a;
|
|
38
|
+
const { themeMode, themeOverrides } = props.theme;
|
|
39
|
+
const isLightMode = themeMode === constants_1.PushUI.CONSTANTS.THEME.LIGHT;
|
|
40
|
+
const { dark, light } = themeOverrides, globalOverrides = tslib_1.__rest(themeOverrides, ["dark", "light"]);
|
|
41
|
+
const newOverrides = Object.assign(Object.assign(Object.assign({}, Object.assign(Object.assign(Object.assign({}, token_1.themeDefault), token_1.buttonThemeDefault), (isLightMode ? token_1.lightThemeDefault : token_1.darkThemeDefault))), (0, theme_1.mapCoreToInt)(globalOverrides)), (0, theme_1.mapCoreToInt)((_a = (isLightMode ? light : dark)) !== null && _a !== void 0 ? _a : {}));
|
|
42
|
+
return Object.entries(newOverrides)
|
|
43
|
+
.map(([key, value]) => `${key}: ${value};`)
|
|
44
|
+
.join('\n');
|
|
45
|
+
}}
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
29
48
|
const PushUniversalWalletProvider = ({ config, app, themeMode = constants_1.PushUI.CONSTANTS.THEME.LIGHT, themeOverrides = {}, children, }) => {
|
|
30
49
|
var _a;
|
|
31
|
-
const GlobalStyle = (0, styled_components_1.createGlobalStyle) `
|
|
32
|
-
[data-pw-wrapper='${(props) => props.uid}']{
|
|
33
|
-
#w3m-modal {
|
|
34
|
-
z-index: 9999 !important;
|
|
35
|
-
position: fixed !important;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
${(props) => {
|
|
39
|
-
var _a;
|
|
40
|
-
const { themeMode, themeOverrides } = props.theme;
|
|
41
|
-
const isLightMode = themeMode === constants_1.PushUI.CONSTANTS.THEME.LIGHT;
|
|
42
|
-
const { dark, light } = themeOverrides, globalOverrides = tslib_1.__rest(themeOverrides, ["dark", "light"]);
|
|
43
|
-
const newOverrides = Object.assign(Object.assign(Object.assign({}, Object.assign(Object.assign(Object.assign({}, token_1.themeDefault), token_1.buttonThemeDefault), (isLightMode ? token_1.lightThemeDefault : token_1.darkThemeDefault))), (0, theme_1.mapCoreToInt)(globalOverrides)), (0, theme_1.mapCoreToInt)((_a = (isLightMode ? light : dark)) !== null && _a !== void 0 ? _a : {}));
|
|
44
|
-
return Object.entries(newOverrides)
|
|
45
|
-
.map(([key, value]) => `${key}: ${value};`)
|
|
46
|
-
.join('\n');
|
|
47
|
-
}}
|
|
48
|
-
}
|
|
49
|
-
`;
|
|
50
50
|
const mergedConfig = Object.assign(Object.assign(Object.assign({}, PushWalletConfigDefault), config), { login: Object.assign(Object.assign(Object.assign({}, loginDefaultConfig), ((config === null || config === void 0 ? void 0 : config.login) || {})), { wallet: Object.assign(Object.assign({}, loginDefaultConfig.wallet), (((_a = config === null || config === void 0 ? void 0 : config.login) === null || _a === void 0 ? void 0 : _a.wallet) || {})) }), modal: Object.assign(Object.assign({}, PushWalletConfigDefault.modal), config.modal) });
|
|
51
51
|
return ((0, jsx_runtime_1.jsxs)(styled_components_1.ThemeProvider, { theme: { themeMode, themeOverrides }, children: [(0, jsx_runtime_1.jsx)(GlobalStyle, { uid: mergedConfig.uid }), (0, jsx_runtime_1.jsx)("div", { "data-pw-wrapper": mergedConfig.uid, children: (0, jsx_runtime_1.jsx)(WalletContext_1.WalletContextProvider, { config: mergedConfig, app: app, themeMode: themeMode, themeOverrides: themeOverrides, children: children }) })] }));
|
|
52
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushWalletProvider.js","sourceRoot":"","sources":["../../../../../../packages/ui-kit/src/lib/providers/PushWalletProvider.tsx"],"names":[],"mappings":";;;;;AAGA,4DAAiE;AACjE,4CAAsC;AACtC,yDAI2B;AAC3B,2CAMyB;AACzB,0CAA8C;AAO9C,MAAM,kBAAkB,GAAG;IACzB,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE;QACN,OAAO,EAAE,IAAI;KACd;CACF,CAAC;AAEF,MAAM,uBAAuB,GAAwB;IACnD,GAAG,EAAE,SAAS;IACd,KAAK,EAAE,kBAAkB;IACzB,OAAO,EAAE,kBAAM,CAAC,SAAS,CAAC,YAAY,CAAC,aAAa;IACpD,KAAK,EAAE;QACL,WAAW,EAAE,kBAAM,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM;QACjD,UAAU,EAAE,KAAK;QACjB,oBAAoB,EAAE,kBAAM,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI;QACjE,eAAe,EAAE,kBAAM,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK;KACzD;CACF,CAAC;
|
|
1
|
+
{"version":3,"file":"PushWalletProvider.js","sourceRoot":"","sources":["../../../../../../packages/ui-kit/src/lib/providers/PushWalletProvider.tsx"],"names":[],"mappings":";;;;;AAGA,4DAAiE;AACjE,4CAAsC;AACtC,yDAI2B;AAC3B,2CAMyB;AACzB,0CAA8C;AAO9C,MAAM,kBAAkB,GAAG;IACzB,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE;QACN,OAAO,EAAE,IAAI;KACd;CACF,CAAC;AAEF,MAAM,uBAAuB,GAAwB;IACnD,GAAG,EAAE,SAAS;IACd,KAAK,EAAE,kBAAkB;IACzB,OAAO,EAAE,kBAAM,CAAC,SAAS,CAAC,YAAY,CAAC,aAAa;IACpD,KAAK,EAAE;QACL,WAAW,EAAE,kBAAM,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM;QACjD,UAAU,EAAE,KAAK;QACjB,oBAAoB,EAAE,kBAAM,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI;QACjE,eAAe,EAAE,kBAAM,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK;KACzD;CACF,CAAC;AAEF,MAAM,WAAW,GAAG,IAAA,qCAAiB,EAAiB;sBAChC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG;;;;;;MAMpC,CAAC,KAAK,EAAE,EAAE;;IACV,MAAM,EAAE,SAA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