@rango-dev/widget-embedded 0.12.1-next.12 → 0.12.1-next.13
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/Widget.d.ts.map +1 -1
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts +12 -2
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -1
- package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts +6 -1
- package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +6 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +90 -15
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +18 -3
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +24 -4
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.styles.d.ts +18 -3
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +6 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
- package/dist/components/NoRoutes/NoRoutes.styles.d.ts +18 -3
- package/dist/components/NoRoutes/NoRoutes.styles.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts +24 -4
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -1
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts +24 -4
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +1 -1
- package/dist/components/SearchInput/SearchInput.styles.d.ts +6 -1
- package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts +18 -3
- package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts.map +1 -1
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +30 -5
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.styles.d.ts +24 -4
- package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +36 -6
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +6 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +6 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +24 -4
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts +60 -10
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts +24 -4
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -1
- package/dist/globalStyles.d.ts +1 -1
- package/dist/globalStyles.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts +3 -6
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/types/config.d.ts +3 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +2 -0
- package/dist/utils/configs.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/Widget.tsx +2 -1
- package/src/components/Layout/Layout.styles.ts +1 -2
- package/src/globalStyles.ts +1 -4
- package/src/hooks/useTheme.ts +37 -75
- package/src/types/config.ts +3 -0
- package/src/utils/configs.ts +3 -0
package/dist/types/config.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export type WidgetColors = {
|
|
|
36
36
|
* border color
|
|
37
37
|
* @property {number} borderRadius - `borderRadius` is a property of the `WidgetTheme` type that
|
|
38
38
|
* specifies the radius of the corners of a widget.
|
|
39
|
+
* @property {number} secondaryBorderRadius - `secondaryBorderRadius` is a property of the `WidgetTheme` type that
|
|
40
|
+
* specifies the radius of the buttons of a widget.
|
|
39
41
|
* @property {number} width - The `width` property is a number that represents the width of the widget.
|
|
40
42
|
* @property {number} height - The `height` property is a number that specifies the height of the widget.
|
|
41
43
|
* @property {boolean} singleTheme - The `singleTheme` property is a boolean that specifies the theme is support dark and light or only light.
|
|
@@ -48,6 +50,7 @@ export type WidgetTheme = {
|
|
|
48
50
|
dark: WidgetColors;
|
|
49
51
|
};
|
|
50
52
|
borderRadius?: number;
|
|
53
|
+
secondaryBorderRadius?: number;
|
|
51
54
|
width?: number;
|
|
52
55
|
height?: number;
|
|
53
56
|
singleTheme?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,YAAY,CAAC;QAAC,IAAI,EAAE,YAAY,CAAA;KAAE,CAAC;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACrC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,wBAAwB,CAAC;IAChC,EAAE,CAAC,EAAE,wBAAwB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,UAAU,GAAG,iBAAiB,CAAC,EAAE,CAAC;IAC7C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC;CACxB,CAAC"}
|
package/dist/utils/configs.d.ts
CHANGED
|
@@ -4,4 +4,6 @@ export interface Configs {
|
|
|
4
4
|
export declare function getConfig(name: keyof Configs): string;
|
|
5
5
|
export declare function setConfig(name: keyof Configs, value: any): any;
|
|
6
6
|
export declare function initConfig(nextConfigs: Configs): Configs;
|
|
7
|
+
export declare const DEFAULT_PRIMARY_RADIUS = 20;
|
|
8
|
+
export declare const DEFAULT_SECONDARY_RADIUS = 25;
|
|
7
9
|
//# sourceMappingURL=configs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../src/utils/configs.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAQD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,UAE5C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,EAAE,KAAK,EAAE,GAAG,OAIxD;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,OAAO,WAS9C"}
|
|
1
|
+
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../src/utils/configs.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAQD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,UAE5C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,EAAE,KAAK,EAAE,GAAG,OAIxD;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,OAAO,WAS9C;AAED,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,wBAAwB,KAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.12.1-next.
|
|
3
|
+
"version": "0.12.1-next.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@rango-dev/queue-manager-core": "^0.15.1-next.1",
|
|
24
24
|
"@rango-dev/queue-manager-rango-preset": "^0.15.1-next.5",
|
|
25
25
|
"@rango-dev/queue-manager-react": "^0.15.1-next.3",
|
|
26
|
-
"@rango-dev/ui": "^0.15.1-next.
|
|
26
|
+
"@rango-dev/ui": "^0.15.1-next.10",
|
|
27
27
|
"@rango-dev/wallets-react": "^0.1.1-next.5",
|
|
28
28
|
"@rango-dev/wallets-shared": "^0.15.1-next.3",
|
|
29
29
|
"bignumber.js": "^9.1.1",
|
package/src/Widget.tsx
CHANGED
|
@@ -21,6 +21,7 @@ const MainContainer = styled('div', {
|
|
|
21
21
|
display: 'flex',
|
|
22
22
|
justifyContent: 'center',
|
|
23
23
|
alignItems: 'center',
|
|
24
|
+
fontFamily: '$widget',
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
export type WidgetProps = {
|
|
@@ -29,7 +30,7 @@ export type WidgetProps = {
|
|
|
29
30
|
|
|
30
31
|
export function Main(props: PropsWithChildren<WidgetProps>) {
|
|
31
32
|
const { config } = props;
|
|
32
|
-
globalFont(
|
|
33
|
+
globalFont();
|
|
33
34
|
|
|
34
35
|
const { activeTheme } = useTheme(config?.theme || {});
|
|
35
36
|
const [lastConnectedWalletWithNetwork, setLastConnectedWalletWithNetwork] =
|
|
@@ -4,8 +4,7 @@ export const Container = styled('div', {
|
|
|
4
4
|
position: 'relative',
|
|
5
5
|
display: 'flex',
|
|
6
6
|
flexDirection: 'column',
|
|
7
|
-
|
|
8
|
-
borderRadius: '20px',
|
|
7
|
+
borderRadius: '$primary',
|
|
9
8
|
overflow: 'hidden !important',
|
|
10
9
|
boxShadow: '15px 15px 15px 0px rgba(0, 0, 0, 0.05)',
|
|
11
10
|
width: '95vw',
|
package/src/globalStyles.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { globalCss } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
|
-
export const globalFont = (
|
|
3
|
+
export const globalFont = () =>
|
|
4
4
|
globalCss({
|
|
5
5
|
'@import': [
|
|
6
6
|
"url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap')",
|
|
7
7
|
"url('https://fonts.cdnfonts.com/css/times-new-roman')",
|
|
8
8
|
],
|
|
9
|
-
body: {
|
|
10
|
-
fontFamily,
|
|
11
|
-
},
|
|
12
9
|
})();
|
package/src/hooks/useTheme.ts
CHANGED
|
@@ -1,87 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { WidgetTheme } from '../types';
|
|
2
|
+
|
|
3
|
+
import { createTheme, darkTheme, lightTheme } from '@rango-dev/ui';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
|
|
3
6
|
import { useMetaStore } from '../store/meta';
|
|
4
7
|
import { useSettingsStore } from '../store/settings';
|
|
5
|
-
import {
|
|
6
|
-
|
|
8
|
+
import {
|
|
9
|
+
DEFAULT_PRIMARY_RADIUS,
|
|
10
|
+
DEFAULT_SECONDARY_RADIUS,
|
|
11
|
+
} from '../utils/configs';
|
|
7
12
|
|
|
8
13
|
export function useTheme({
|
|
9
14
|
// colors,
|
|
10
15
|
fontFamily = 'Roboto',
|
|
11
|
-
|
|
16
|
+
borderRadius = DEFAULT_PRIMARY_RADIUS,
|
|
17
|
+
secondaryBorderRadius = DEFAULT_SECONDARY_RADIUS,
|
|
12
18
|
mode = 'auto',
|
|
13
19
|
}: WidgetTheme) {
|
|
14
20
|
const theme = useSettingsStore.use.theme();
|
|
15
21
|
const fetchMeta = useMetaStore.use.fetchMeta();
|
|
16
22
|
const setTheme = useSettingsStore.use.setTheme();
|
|
17
|
-
// const light = themeColors?.light;
|
|
18
|
-
// const dark = themeColors?.dark;
|
|
19
|
-
// const neutral = light?.neutral || '#fafafa';
|
|
20
|
-
// const background = light?.background || '#fff';
|
|
21
|
-
// const foreground = light?.foreground || '#000';
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// };
|
|
24
|
+
const customTheme = createTheme({
|
|
25
|
+
radii: {
|
|
26
|
+
primary: `${borderRadius}px`,
|
|
27
|
+
secondary: `${secondaryBorderRadius}px`,
|
|
28
|
+
},
|
|
29
|
+
fonts: {
|
|
30
|
+
widget: fontFamily,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// ...generateRangeColors('primary', 'light', light?.primary || '#5FA425'),
|
|
37
|
-
// ...generateRangeColors('error', 'light', light?.error || '#FF0000'),
|
|
38
|
-
// ...generateRangeColors('warning', 'light', light?.warning || '#F5A623'),
|
|
39
|
-
// ...generateRangeColors('success', 'light', light?.success || '#0070F3'),
|
|
40
|
-
// ...generateRangeColors('neutral', 'light', neutral),
|
|
41
|
-
// background,
|
|
42
|
-
// foreground,
|
|
43
|
-
// };
|
|
34
|
+
const lightClassName = `${customTheme.className} ${lightTheme.className}`;
|
|
35
|
+
const darkClassName = `${customTheme.className} ${darkTheme.className}`;
|
|
44
36
|
|
|
45
|
-
// const customLightTheme = createTheme({
|
|
46
|
-
// colors: lightColors,
|
|
47
|
-
// radii: {
|
|
48
|
-
// xs: `${borderRadius}px`,
|
|
49
|
-
// },
|
|
50
|
-
// shadows: {
|
|
51
|
-
// s: `0px 3px 5px 3px ${light?.neutral || '#f0f2f5'} ,0px 6px 10px 3px ${
|
|
52
|
-
// light?.neutral || '#f0f2f5'
|
|
53
|
-
// }, 0px 1px 18px 3px ${light?.neutral || '#f0f2f5'}`,
|
|
54
|
-
// },
|
|
55
|
-
// });
|
|
56
|
-
|
|
57
|
-
// const customDarkTheme = createTheme({
|
|
58
|
-
// colors: {
|
|
59
|
-
// ...lightColors,
|
|
60
|
-
// ...generateRangeColors('neutral', 'dark', '#111111'),
|
|
61
|
-
// foreground: background,
|
|
62
|
-
// background: foreground,
|
|
63
|
-
// surface: '#000',
|
|
64
|
-
// ...JSON.parse(JSON.stringify(darkColors)),
|
|
65
|
-
// },
|
|
66
|
-
// radii: {
|
|
67
|
-
// xs: `${borderRadius}px`,
|
|
68
|
-
// },
|
|
69
|
-
// shadows: {
|
|
70
|
-
// s: `0px 3px 5px 3px ${dark?.neutral || '#222'}, 0px 6px 10px 3px ${
|
|
71
|
-
// dark?.neutral || '#222'
|
|
72
|
-
// }, 0px 1px 18px 3px ${dark?.neutral || '#222'}`,
|
|
73
|
-
// },
|
|
74
|
-
// });
|
|
75
37
|
const [OSTheme, setOSTheme] = useState('light');
|
|
76
38
|
|
|
77
39
|
useEffect(() => {
|
|
78
|
-
|
|
40
|
+
const fetchData = async () => {
|
|
79
41
|
await fetchMeta();
|
|
80
|
-
}
|
|
42
|
+
};
|
|
43
|
+
void fetchData();
|
|
81
44
|
|
|
82
45
|
const switchTheme = (event: MediaQueryListEvent) => {
|
|
83
|
-
if (event.matches)
|
|
84
|
-
|
|
46
|
+
if (event.matches) {
|
|
47
|
+
setOSTheme('dark');
|
|
48
|
+
} else {
|
|
49
|
+
setOSTheme('light');
|
|
50
|
+
}
|
|
85
51
|
};
|
|
86
52
|
|
|
87
53
|
if (
|
|
@@ -101,20 +67,16 @@ export function useTheme({
|
|
|
101
67
|
};
|
|
102
68
|
}, []);
|
|
103
69
|
useEffect(() => {
|
|
104
|
-
if (mode !== 'auto')
|
|
70
|
+
if (mode !== 'auto') {
|
|
71
|
+
setTheme(mode);
|
|
72
|
+
}
|
|
105
73
|
}, [mode]);
|
|
106
|
-
const prevFont = usePrevious(fontFamily);
|
|
107
|
-
|
|
108
|
-
useLayoutEffect(() => {
|
|
109
|
-
const { classList } = document.body;
|
|
110
|
-
|
|
111
|
-
if (prevFont) classList.remove(`font_${prevFont.replace(/ /g, '')}`);
|
|
112
|
-
classList.add(`font_${fontFamily.replace(/ /g, '')}`);
|
|
113
|
-
}, [fontFamily]);
|
|
114
74
|
|
|
115
75
|
const getActiveTheme = () => {
|
|
116
|
-
if (theme === 'auto')
|
|
117
|
-
|
|
76
|
+
if (theme === 'auto') {
|
|
77
|
+
return OSTheme === 'dark' ? darkClassName : lightClassName;
|
|
78
|
+
}
|
|
79
|
+
return theme === 'dark' ? darkClassName : lightClassName;
|
|
118
80
|
};
|
|
119
81
|
|
|
120
82
|
return { activeTheme: getActiveTheme() };
|
package/src/types/config.ts
CHANGED
|
@@ -38,6 +38,8 @@ export type WidgetColors = {
|
|
|
38
38
|
* border color
|
|
39
39
|
* @property {number} borderRadius - `borderRadius` is a property of the `WidgetTheme` type that
|
|
40
40
|
* specifies the radius of the corners of a widget.
|
|
41
|
+
* @property {number} secondaryBorderRadius - `secondaryBorderRadius` is a property of the `WidgetTheme` type that
|
|
42
|
+
* specifies the radius of the buttons of a widget.
|
|
41
43
|
* @property {number} width - The `width` property is a number that represents the width of the widget.
|
|
42
44
|
* @property {number} height - The `height` property is a number that specifies the height of the widget.
|
|
43
45
|
* @property {boolean} singleTheme - The `singleTheme` property is a boolean that specifies the theme is support dark and light or only light.
|
|
@@ -47,6 +49,7 @@ export type WidgetTheme = {
|
|
|
47
49
|
fontFamily?: string;
|
|
48
50
|
colors?: { light: WidgetColors; dark: WidgetColors };
|
|
49
51
|
borderRadius?: number;
|
|
52
|
+
secondaryBorderRadius?: number;
|
|
50
53
|
width?: number;
|
|
51
54
|
height?: number;
|
|
52
55
|
singleTheme?: boolean;
|