@rango-dev/widget-embedded 0.1.16-next.4 → 0.1.16-next.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.
@@ -1 +1 @@
1
- {"version":3,"file":"TokenInfo.d.ts","sourceRoot":"","sources":["../src/components/TokenInfo.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIlD,OAAO,SAAS,MAAM,cAAc,CAAC;AAMrC,aAAK,SAAS,GAAG,CACb;IACE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C,GACD;IACE,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,EAAE,SAAS,GAAG,IAAI,CAAC;IAC/B,cAAc,EAAE,SAAS,GAAG,IAAI,CAAC;CAClC,CACJ,GAAG;IAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CAAE,CAAC;AA2F1D,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,eAwMzC"}
1
+ {"version":3,"file":"TokenInfo.d.ts","sourceRoot":"","sources":["../src/components/TokenInfo.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIlD,OAAO,SAAS,MAAM,cAAc,CAAC;AAMrC,aAAK,SAAS,GAAG,CACb;IACE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C,GACD;IACE,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,EAAE,SAAS,GAAG,IAAI,CAAC;IAC/B,cAAc,EAAE,SAAS,GAAG,IAAI,CAAC;CAClC,CACJ,GAAG;IAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CAAE,CAAC;AA4F1D,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,eAwMzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../src/hooks/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EAAE,WAAW,EACnB,UAAoB,EACpB,YAAgB,EAChB,IAAa,GACd,EAAE,WAAW;;EA6Hb"}
1
+ {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../src/hooks/useTheme.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EAAE,WAAW,EACnB,UAAoB,EACpB,YAAgB,EAChB,IAAa,GACd,EAAE,WAAW;;EA6Gb"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":";AAiCA,wBAAgB,eAAe,gBA+K9B"}
1
+ {"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":";AAiCA,wBAAgB,eAAe,gBAuL9B"}
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  interface PropTypes {
3
3
  supportedSwappers?: string[];
4
+ singleTheme?: boolean;
4
5
  }
5
- export declare function SettingsPage({ supportedSwappers }: PropTypes): JSX.Element;
6
+ export declare function SettingsPage({ supportedSwappers, singleTheme }: PropTypes): JSX.Element;
6
7
  export {};
7
8
  //# sourceMappingURL=SettingsPage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsPage.d.ts","sourceRoot":"","sources":["../src/pages/SettingsPage.tsx"],"names":[],"mappings":";AAaA,UAAU,SAAS;IACjB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AACD,wBAAgB,YAAY,CAAC,EAAE,iBAAiB,EAAE,EAAE,SAAS,eA0E5D"}
1
+ {"version":3,"file":"SettingsPage.d.ts","sourceRoot":"","sources":["../src/pages/SettingsPage.tsx"],"names":[],"mappings":";AAaA,UAAU,SAAS;IACjB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AACD,wBAAgB,YAAY,CAAC,EAAE,iBAAiB,EAAE,WAAW,EAAE,EAAE,SAAS,eA2EzE"}
@@ -8,6 +8,9 @@ import { WalletType } from '@rango-dev/wallets-shared';
8
8
  * @property {string} success
9
9
  * @property {string} error
10
10
  * @property {string} warning
11
+ * @property {string} surface
12
+ * @property {string} neutral
13
+
11
14
  */
12
15
  export declare type WidgetColors = {
13
16
  background?: string;
@@ -16,6 +19,8 @@ export declare type WidgetColors = {
16
19
  success?: string;
17
20
  error?: string;
18
21
  warning?: string;
22
+ surface?: string;
23
+ neutral?: string;
19
24
  };
20
25
  /**
21
26
  * The `WidgetTheme` defines the properties of a widget theme, including mode, font family, colors, border
@@ -31,14 +36,19 @@ export declare type WidgetColors = {
31
36
  * specifies the radius of the corners of a widget.
32
37
  * @property {number} width - The `width` property is a number that represents the width of the widget.
33
38
  * @property {number} height - The `height` property is a number that specifies the height of the widget.
39
+ * @property {boolean} singleTheme - The `singleTheme` property is a boolean that specifies the theme is support dark and light or only light.
34
40
  */
35
41
  export declare type WidgetTheme = {
36
42
  mode?: 'auto' | 'light' | 'dark';
37
43
  fontFamily?: string;
38
- colors?: WidgetColors;
44
+ colors?: {
45
+ light: WidgetColors;
46
+ dark: WidgetColors;
47
+ };
39
48
  borderRadius?: number;
40
49
  width?: number;
41
50
  height?: number;
51
+ singleTheme?: boolean;
42
52
  };
43
53
  /**
44
54
  * `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AAU,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,oBAAY,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,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,UAAU,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC"}
@@ -1,5 +1,4 @@
1
1
  export declare function removeDuplicateFrom<T>(array: T[]): T[];
2
2
  export declare function areEqual(array1: (number | string)[], array2: (number | string)[]): boolean;
3
- export declare function shadeColor(color: string, percent: number): string;
4
3
  export declare function debounce(fn: Function, time: number): (...args: any) => void;
5
4
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/utils/common.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAEtD;AAED,wBAAgB,QAAQ,CACtB,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAC3B,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,WAK5B;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAsBxD;AAED,wBAAgB,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAGvB,GAAG,UAS9B"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/utils/common.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAEtD;AAED,wBAAgB,QAAQ,CACtB,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAC3B,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,WAK5B;AAID,wBAAgB,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAGvB,GAAG,UAS9B"}
@@ -37,24 +37,6 @@ function removeDuplicateFrom(array) {
37
37
  function areEqual(array1, array2) {
38
38
  return array1.length === array2.length && array1.every((v, i) => v === array2[i]);
39
39
  }
40
- function shadeColor(color, percent) {
41
- var R = parseInt(color.substring(1, 3), 16);
42
- var G = parseInt(color.substring(3, 5), 16);
43
- var B = parseInt(color.substring(5, 7), 16);
44
- R = R * (100 + percent) / 100;
45
- G = G * (100 + percent) / 100;
46
- B = B * (100 + percent) / 100;
47
- R = R < 255 ? R : 255;
48
- G = G < 255 ? G : 255;
49
- B = B < 255 ? B : 255;
50
- R = Math.round(R);
51
- G = Math.round(G);
52
- B = Math.round(B);
53
- var RR = R.toString(16).length == 1 ? '0' + R.toString(16) : R.toString(16);
54
- var GG = G.toString(16).length == 1 ? '0' + G.toString(16) : G.toString(16);
55
- var BB = B.toString(16).length == 1 ? '0' + B.toString(16) : B.toString(16);
56
- return '#' + RR + GG + BB;
57
- }
58
40
  function debounce(fn, time) {
59
41
  let timeoutId;
60
42
  return wrapper;
@@ -1367,10 +1349,10 @@ const Container = /*#__PURE__*/ui.styled('div', {
1367
1349
  variants: {
1368
1350
  type: {
1369
1351
  filled: {
1370
- backgroundColor: '$neutrals300'
1352
+ backgroundColor: '$neutral100'
1371
1353
  },
1372
1354
  outlined: {
1373
- border: '1px solid $neutrals300'
1355
+ border: '1px solid $neutral100'
1374
1356
  }
1375
1357
  }
1376
1358
  },
@@ -1406,14 +1388,14 @@ const Container = /*#__PURE__*/ui.styled('div', {
1406
1388
  const ImagePlaceholder = /*#__PURE__*/ui.styled('span', {
1407
1389
  width: '24px',
1408
1390
  height: '24px',
1409
- backgroundColor: '$neutrals300',
1391
+ backgroundColor: '$neutral100',
1410
1392
  borderRadius: '99999px'
1411
1393
  });
1412
1394
  const OutputContainer = /*#__PURE__*/ui.styled('div', {
1413
1395
  windth: '100%',
1414
1396
  height: '$48',
1415
1397
  borderRadius: '$5',
1416
- backgroundColor: '$background',
1398
+ backgroundColor: '$surface',
1417
1399
  border: '1px solid transparent',
1418
1400
  position: 'relative',
1419
1401
  display: 'flex',
@@ -1447,10 +1429,10 @@ function TokenPreview(props) {
1447
1429
  className: "head"
1448
1430
  }, React__default.createElement(ui.Typography, {
1449
1431
  variant: "body2",
1450
- color: "neutrals800"
1432
+ color: "neutral800"
1451
1433
  }, props.label), React__default.createElement("div", null, percentageChange, props.usdValue && React__default.createElement(ui.Typography, {
1452
1434
  variant: "caption",
1453
- color: "neutrals600",
1435
+ color: "neutral600",
1454
1436
  className: "usd-value"
1455
1437
  }, `$${numberToString(props.usdValue)}`))), React__default.createElement("div", {
1456
1438
  className: "form"
@@ -1493,8 +1475,8 @@ const Container$1 = /*#__PURE__*/ui.styled('div', {
1493
1475
  justifyContent: 'space-between',
1494
1476
  padding: '$8',
1495
1477
  borderRadius: '$5',
1496
- backgroundColor: '$neutrals300',
1497
- color: '$neutrals800',
1478
+ backgroundColor: '$neutral100',
1479
+ color: '$neutral800',
1498
1480
  fontSize: '$12',
1499
1481
  '.routes': {
1500
1482
  display: 'flex',
@@ -1846,6 +1828,7 @@ function ConfirmSwapPage() {
1846
1828
  const inputUsdValue = useBestRouteStore.use.inputUsdValue();
1847
1829
  const outputUsdValue = useBestRouteStore.use.outputUsdValue();
1848
1830
  const setInputAmount = useBestRouteStore.use.setInputAmount();
1831
+ const [dbErrorMessage, setDbErrorMessage] = React.useState('');
1849
1832
  const bestRouteloadingStatus = getBestRouteStatus(fetchingBestRoute, !!fetchingBestRouteError);
1850
1833
  const {
1851
1834
  manager
@@ -1880,21 +1863,25 @@ function ConfirmSwapPage() {
1880
1863
  requiredWallets: getRequiredChains(bestRoute),
1881
1864
  selectableWallets: selectableWallets,
1882
1865
  onBack: navigateBackFrom.bind(null, navigationRoutes.confirmSwap),
1883
- onConfirm: () => {
1884
- confirmSwap?.().then(swap => {
1866
+ onConfirm: async () => {
1867
+ confirmSwap?.().then(async swap => {
1885
1868
  if (swap) {
1886
- manager?.create('swap', {
1887
- swapDetails: swap
1888
- }, {
1889
- id: swap.requestId
1890
- });
1891
- setSelectedSwap(swap.requestId);
1892
- navigate('/' + navigationRoutes.swaps + `/${swap.requestId}`, {
1893
- replace: true
1894
- });
1895
- setTimeout(() => {
1896
- setInputAmount('');
1897
- }, 0);
1869
+ try {
1870
+ await manager?.create('swap', {
1871
+ swapDetails: swap
1872
+ }, {
1873
+ id: swap.requestId
1874
+ });
1875
+ setSelectedSwap(swap.requestId);
1876
+ navigate('/' + navigationRoutes.swaps + `/${swap.requestId}`, {
1877
+ replace: true
1878
+ });
1879
+ setTimeout(() => {
1880
+ setInputAmount('');
1881
+ }, 0);
1882
+ } catch (e) {
1883
+ setDbErrorMessage('Error: ' + e?.message);
1884
+ }
1898
1885
  }
1899
1886
  });
1900
1887
  },
@@ -1941,7 +1928,7 @@ function ConfirmSwapPage() {
1941
1928
  totalFee: numberToString(totalFeeInUsd, 0, 2)
1942
1929
  }),
1943
1930
  loading: fetchingConfirmedRoute,
1944
- errors: ConfirmSwapErrors(errors),
1931
+ errors: dbErrorMessage ? [dbErrorMessage, ...ConfirmSwapErrors(errors)] : ConfirmSwapErrors(errors),
1945
1932
  warnings: ConfirmSwapWarnings(warnings),
1946
1933
  extraMessages: React__default.createElement(React__default.Fragment, null, loadingMetaStatus === 'failed' && React__default.createElement(ui.LoadingFailedAlert, null), loadingMetaStatus === 'failed' && showHighSlippageWarning && React__default.createElement(ui.Spacer, {
1947
1934
  direction: "vertical"
@@ -2035,10 +2022,11 @@ const Container$2 = /*#__PURE__*/ui.styled('div', {
2035
2022
  variants: {
2036
2023
  type: {
2037
2024
  filled: {
2038
- backgroundColor: '$neutrals300'
2025
+ backgroundColor: '$neutral100'
2039
2026
  },
2040
2027
  outlined: {
2041
- border: '1px solid $neutrals300'
2028
+ border: '1px solid $neutral100',
2029
+ backgroundColor: '$surface'
2042
2030
  }
2043
2031
  }
2044
2032
  },
@@ -2086,14 +2074,14 @@ const Options = /*#__PURE__*/ui.styled('div', {
2086
2074
  const ImagePlaceholder$1 = /*#__PURE__*/ui.styled('span', {
2087
2075
  width: '24px',
2088
2076
  height: '24px',
2089
- backgroundColor: '$neutrals300',
2077
+ backgroundColor: '$neutral100',
2090
2078
  borderRadius: '99999px'
2091
2079
  });
2092
2080
  const OutputContainer$1 = /*#__PURE__*/ui.styled('div', {
2093
2081
  windth: '100%',
2094
2082
  height: '$48',
2095
2083
  borderRadius: '$5',
2096
- backgroundColor: '$background',
2084
+ backgroundColor: '$surface',
2097
2085
  border: '1px solid transparent',
2098
2086
  position: 'relative',
2099
2087
  display: 'flex',
@@ -2139,7 +2127,7 @@ function TokenInfo(props) {
2139
2127
  className: "head"
2140
2128
  }, React__default.createElement(ui.Typography, {
2141
2129
  variant: "body2",
2142
- color: "neutrals800"
2130
+ color: "neutral800"
2143
2131
  }, t(type)), props.type === 'From' ? React__default.createElement(Options, null, React__default.createElement("div", {
2144
2132
  className: "balance",
2145
2133
  onClick: () => {
@@ -2147,7 +2135,7 @@ function TokenInfo(props) {
2147
2135
  }
2148
2136
  }, React__default.createElement(ui.Typography, {
2149
2137
  variant: "body3",
2150
- color: "neutrals600"
2138
+ color: "neutral600"
2151
2139
  }, `${t('Balance')}: ${tokenBalance} ${fromToken?.symbol || ''}`), React__default.createElement(ui.Spacer, {
2152
2140
  size: 4
2153
2141
  }), React__default.createElement(ui.Button, {
@@ -2161,7 +2149,7 @@ function TokenInfo(props) {
2161
2149
  outputUsdValue: props.outputUsdValue
2162
2150
  }), React__default.createElement("div", null, React__default.createElement(ui.Typography, {
2163
2151
  variant: "caption",
2164
- color: "neutrals600"
2152
+ color: "neutral600"
2165
2153
  }, `$${numberToString(props.outputUsdValue)}`)))), React__default.createElement("div", {
2166
2154
  className: "form"
2167
2155
  }, React__default.createElement(ui.Button, {
@@ -2217,7 +2205,7 @@ function TokenInfo(props) {
2217
2205
  }
2218
2206
  }, React__default.createElement(ui.Typography, {
2219
2207
  variant: "caption",
2220
- color: "neutrals800"
2208
+ color: "neutral800"
2221
2209
  }, `$${numberToString(inputUsdValue)}`)),
2222
2210
  value: props.inputAmount || '',
2223
2211
  min: 0,
@@ -2253,7 +2241,7 @@ function BottomLogo() {
2253
2241
  } = reactI18next.useTranslation();
2254
2242
  return React__default.createElement(Container$3, null, React__default.createElement(ui.Typography, {
2255
2243
  variant: "caption",
2256
- color: "$neutrals600"
2244
+ color: "$neutral600"
2257
2245
  }, t('Powered By')), React__default.createElement(StyledAnchor, {
2258
2246
  href: "https://rango.exchange",
2259
2247
  target: "_blank"
@@ -2571,7 +2559,8 @@ function SelectTokenPage(props) {
2571
2559
 
2572
2560
  function SettingsPage(_ref) {
2573
2561
  let {
2574
- supportedSwappers
2562
+ supportedSwappers,
2563
+ singleTheme
2575
2564
  } = _ref;
2576
2565
  const slippage = useSettingsStore.use.slippage();
2577
2566
  const setSlippage = useSettingsStore.use.setSlippage();
@@ -2613,6 +2602,7 @@ function SettingsPage(_ref) {
2613
2602
  onBack: navigateBackFrom.bind(null, navigationRoutes.settings),
2614
2603
  liquiditySources: supportedUniqueSwappersGroups,
2615
2604
  selectedLiquiditySources: supportedUniqueSwappersGroups.filter(s => s.selected),
2605
+ singleTheme: singleTheme,
2616
2606
  customSlippage: customSlippage || NaN,
2617
2607
  onCustomSlippageChange: setCustomSlippage,
2618
2608
  minSlippage: MIN_SLIPPGAE,
@@ -2924,6 +2914,7 @@ function AppRoutes(props) {
2924
2914
  }, {
2925
2915
  path: navigationRoutes.settings,
2926
2916
  element: React__default.createElement(SettingsPage, {
2917
+ singleTheme: config?.theme?.singleTheme,
2927
2918
  supportedSwappers: config?.liquiditySources
2928
2919
  })
2929
2920
  }, {
@@ -3071,89 +3062,66 @@ function useTheme(_ref) {
3071
3062
  const theme = useSettingsStore.use.theme();
3072
3063
  const fetchMeta = useMetaStore.use.fetchMeta();
3073
3064
  const setTheme = useSettingsStore.use.setTheme();
3074
- const primary = themeColors?.primary || '#5FA425',
3075
- background = themeColors?.background || '#fff',
3076
- foreground = themeColors?.foreground || '#000',
3077
- error = themeColors?.error || '#FF0000',
3078
- warning = themeColors?.warning || '#F5A623',
3079
- success = themeColors?.success || '#0070F3';
3080
- const colors = {
3081
- neutrals200: '#FAFAFA',
3082
- neutrals300: '#f2f2f2',
3083
- neutrals400: '#dedede',
3084
- neutrals500: '#cccccc',
3085
- neutrals600: '#acacac',
3086
- neutrals700: '#444444',
3087
- neutrals800: '#333333',
3088
- neutrals900: '#111111',
3089
- primary,
3090
- primary100: shadeColor(primary, 15),
3091
- primary200: shadeColor(primary, -10),
3092
- primary300: shadeColor(primary, -15),
3093
- primary400: shadeColor(primary, -20),
3094
- primary500: shadeColor(primary, -25),
3095
- primary600: shadeColor(primary, -30),
3096
- primary700: shadeColor(primary, -35),
3097
- primary800: shadeColor(primary, -40),
3098
- primary900: shadeColor(primary, -45),
3065
+ const light = themeColors?.light;
3066
+ const dark = themeColors?.dark;
3067
+ const neutral = light?.neutral || '#fafafa';
3068
+ const background = light?.background || '#fff';
3069
+ const foreground = light?.foreground || '#000';
3070
+ const darkColors = {
3071
+ ...ui.generateRangeColors('primary', 'dark', dark?.primary),
3072
+ ...ui.generateRangeColors('error', 'dark', dark?.error),
3073
+ ...ui.generateRangeColors('warning', 'dark', dark?.warning),
3074
+ ...ui.generateRangeColors('success', 'dark', dark?.success),
3075
+ ...ui.generateRangeColors('neutral', 'dark', dark?.neutral),
3076
+ surface: dark?.surface,
3077
+ background: dark?.background,
3078
+ foreground: dark?.foreground
3079
+ };
3080
+ const lightColors = {
3081
+ surface: light?.surface || '#fff',
3082
+ ...ui.generateRangeColors('primary', 'light', light?.primary || '#5FA425'),
3083
+ ...ui.generateRangeColors('error', 'light', light?.error || '#FF0000'),
3084
+ ...ui.generateRangeColors('warning', 'light', light?.warning || '#F5A623'),
3085
+ ...ui.generateRangeColors('success', 'light', light?.success || '#0070F3'),
3086
+ ...ui.generateRangeColors('neutral', 'light', neutral),
3099
3087
  background,
3100
- foreground,
3101
- error,
3102
- error100: shadeColor(error, 50),
3103
- error300: shadeColor(error, -10),
3104
- error500: shadeColor(error, -20),
3105
- error700: shadeColor(error, -30),
3106
- warning,
3107
- warning100: shadeColor(warning, 50),
3108
- warning300: shadeColor(warning, -10),
3109
- warning500: shadeColor(warning, -20),
3110
- warning700: shadeColor(warning, -30),
3111
- success,
3112
- success100: shadeColor(success, 50),
3113
- success300: shadeColor(success, -10),
3114
- success500: shadeColor(success, -20),
3115
- success700: shadeColor(success, -30)
3088
+ foreground
3116
3089
  };
3117
3090
  const customeLightTheme = ui.createTheme({
3118
- colors,
3091
+ colors: lightColors,
3119
3092
  radii: {
3120
3093
  5: `${borderRadius}px`
3121
3094
  },
3122
3095
  shadows: {
3123
- s: '0px 3px 5px 3px #f0f2f5, 0px 6px 10px 3px #f0f2f5, 0px 1px 18px 3px #f0f2f5'
3096
+ s: `0px 3px 5px 3px ${light?.neutral || '#f0f2f5'} ,0px 6px 10px 3px ${light?.neutral || '#f0f2f5'}, 0px 1px 18px 3px ${light?.neutral || '#f0f2f5'}`
3124
3097
  }
3125
3098
  });
3126
3099
  const customeDarkTheme = ui.createTheme({
3127
3100
  colors: {
3128
- ...colors,
3129
- neutrals200: '#111111',
3130
- neutrals300: '#333333',
3131
- neutrals400: '#444444',
3132
- neutrals500: '#acacac',
3133
- neutrals600: '#cccccc',
3134
- neutrals700: '#dedede',
3135
- neutrals800: '#f2f2f2',
3136
- neutrals900: '#FAFAFA',
3101
+ ...lightColors,
3102
+ ...ui.generateRangeColors('neutral', 'dark', '#111111'),
3137
3103
  foreground: background,
3138
- background: foreground
3104
+ background: foreground,
3105
+ surface: '#000',
3106
+ ...JSON.parse(JSON.stringify(darkColors))
3139
3107
  },
3140
3108
  radii: {
3141
3109
  5: `${borderRadius}px`
3142
3110
  },
3143
3111
  shadows: {
3144
- s: '0px 3px 5px 3px #222, 0px 6px 10px 3px #222, 0px 1px 18px 3px #222'
3112
+ s: `0px 3px 5px 3px ${dark?.neutral || '#222'}, 0px 6px 10px 3px ${dark?.neutral || '#222'}, 0px 1px 18px 3px ${dark?.neutral || '#222'}`
3145
3113
  }
3146
3114
  });
3147
- const [OSTheme, setOSTheme] = React.useState(customeLightTheme);
3115
+ const [OSTheme, setOSTheme] = React.useState('light');
3148
3116
  React.useEffect(() => {
3149
3117
  (async () => {
3150
3118
  await fetchMeta();
3151
3119
  })();
3152
3120
  const switchTheme = event => {
3153
- if (event.matches) setOSTheme(customeDarkTheme);else setOSTheme(customeLightTheme);
3121
+ if (event.matches) setOSTheme('dark');else setOSTheme('light');
3154
3122
  };
3155
3123
  if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
3156
- setOSTheme(customeDarkTheme);
3124
+ setOSTheme('dark');
3157
3125
  }
3158
3126
  window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', switchTheme);
3159
3127
  return () => {
@@ -3172,7 +3140,7 @@ function useTheme(_ref) {
3172
3140
  classList.add(`font_${fontFamily.replace(/ /g, '')}`);
3173
3141
  }, [fontFamily]);
3174
3142
  const getActiveTheme = () => {
3175
- if (theme === 'auto') return OSTheme;else return theme === 'dark' ? customeDarkTheme : customeLightTheme;
3143
+ if (theme === 'auto') return OSTheme === 'dark' ? customeDarkTheme : customeLightTheme;else return theme === 'dark' ? customeDarkTheme : customeLightTheme;
3176
3144
  };
3177
3145
  return {
3178
3146
  activeTheme: getActiveTheme()