@one_deploy/sdk 1.0.6 → 1.0.7

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,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var react = require('react');
3
4
  var reactNative = require('react-native');
4
5
  var jsxRuntime = require('react/jsx-runtime');
5
6
 
@@ -1685,6 +1686,10 @@ var CHAIN_CONFIG = {
1685
1686
  zksync: { name: "zkSync", icon: "\u2B22", color: "#8C8DFC" },
1686
1687
  scroll: { name: "Scroll", icon: "\u25CE", color: "#FFEEDA" }
1687
1688
  };
1689
+ var isDesktop = () => {
1690
+ const { width } = reactNative.Dimensions.get("window");
1691
+ return reactNative.Platform.OS === "web" && width >= 768;
1692
+ };
1688
1693
  var OneChainSelector = ({
1689
1694
  supportedChains,
1690
1695
  selectedChains,
@@ -1694,9 +1699,12 @@ var OneChainSelector = ({
1694
1699
  title,
1695
1700
  subtitle,
1696
1701
  minSelections = 1,
1702
+ placeholder = "Select chains...",
1697
1703
  style,
1698
1704
  titleStyle
1699
1705
  }) => {
1706
+ const [isOpen, setIsOpen] = react.useState(false);
1707
+ const desktop = isDesktop();
1700
1708
  const handleSelect = (chain) => {
1701
1709
  if (multiSelect) {
1702
1710
  if (selectedChains.includes(chain) && selectedChains.length <= minSelections) {
@@ -1707,42 +1715,129 @@ var OneChainSelector = ({
1707
1715
  if (!selectedChains.includes(chain)) {
1708
1716
  onSelectChain(chain);
1709
1717
  }
1718
+ setIsOpen(false);
1710
1719
  }
1711
1720
  };
1721
+ if (desktop) {
1722
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles.container, style], children: [
1723
+ title && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles.title, titleStyle], children: title }),
1724
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles.subtitle, children: subtitle }),
1725
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles.desktopGrid, children: supportedChains.map((chain) => {
1726
+ const chainInfo = CHAIN_CONFIG[chain] || { name: chain, icon: "\u25CF", color: "#888" };
1727
+ const isSelected = selectedChains.includes(chain);
1728
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1729
+ reactNative.TouchableOpacity,
1730
+ {
1731
+ style: [
1732
+ styles.desktopChip,
1733
+ isSelected && styles.desktopChipSelected,
1734
+ isSelected && { borderColor: accentColor, backgroundColor: accentColor + "12" }
1735
+ ],
1736
+ onPress: () => handleSelect(chain),
1737
+ activeOpacity: 0.7,
1738
+ children: [
1739
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles.desktopIconBg, { backgroundColor: chainInfo.color + "20" }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles.desktopIcon, { color: chainInfo.color }], children: chainInfo.icon }) }),
1740
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
1741
+ styles.desktopChipText,
1742
+ isSelected && { color: accentColor, fontWeight: "600" }
1743
+ ], children: chainInfo.name }),
1744
+ isSelected && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles.desktopCheckbox, { backgroundColor: accentColor }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles.desktopCheckIcon, children: "\u2713" }) })
1745
+ ]
1746
+ },
1747
+ chain
1748
+ );
1749
+ }) }),
1750
+ multiSelect && selectedChains.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles.selectedCount, { color: accentColor }], children: [
1751
+ selectedChains.length,
1752
+ " chain",
1753
+ selectedChains.length > 1 ? "s" : "",
1754
+ " selected"
1755
+ ] })
1756
+ ] });
1757
+ }
1712
1758
  return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles.container, style], children: [
1713
1759
  title && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles.title, titleStyle], children: title }),
1714
1760
  subtitle && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles.subtitle, children: subtitle }),
1715
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles.chainsContainer, children: supportedChains.map((chain) => {
1716
- const chainInfo = CHAIN_CONFIG[chain] || { name: chain, icon: "\u25CF", color: "#888" };
1717
- const isSelected = selectedChains.includes(chain);
1718
- return /* @__PURE__ */ jsxRuntime.jsxs(
1719
- reactNative.TouchableOpacity,
1720
- {
1721
- style: [
1722
- styles.chainChip,
1723
- isSelected && styles.chainChipSelected,
1724
- isSelected && { borderColor: accentColor, backgroundColor: accentColor + "15" }
1725
- ],
1726
- onPress: () => handleSelect(chain),
1727
- activeOpacity: 0.7,
1728
- children: [
1729
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles.chainIconBg, { backgroundColor: chainInfo.color + "20" }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles.chainIcon, { color: chainInfo.color }], children: chainInfo.icon }) }),
1730
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
1731
- styles.chainText,
1732
- isSelected && { color: accentColor, fontWeight: "600" }
1733
- ], children: chainInfo.name }),
1734
- isSelected && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles.checkmark, { color: accentColor }], children: "\u2713" })
1735
- ]
1736
- },
1737
- chain
1738
- );
1739
- }) }),
1740
- multiSelect && selectedChains.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles.selectedInfo, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: styles.selectedText, children: [
1761
+ /* @__PURE__ */ jsxRuntime.jsxs(
1762
+ reactNative.TouchableOpacity,
1763
+ {
1764
+ style: [styles.dropdownTrigger, { borderColor: isOpen ? accentColor : "#e5e5e5" }],
1765
+ onPress: () => setIsOpen(true),
1766
+ activeOpacity: 0.7,
1767
+ children: [
1768
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles.selectedPreview, children: [
1769
+ selectedChains.slice(0, 3).map((chain) => {
1770
+ const chainInfo = CHAIN_CONFIG[chain] || { icon: "\u25CF", color: "#888" };
1771
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles.previewChip, { backgroundColor: chainInfo.color + "20" }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles.previewIcon, { color: chainInfo.color }], children: chainInfo.icon }) }, chain);
1772
+ }),
1773
+ selectedChains.length > 3 && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles.previewMore, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: styles.previewMoreText, children: [
1774
+ "+",
1775
+ selectedChains.length - 3
1776
+ ] }) }),
1777
+ selectedChains.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles.placeholderText, children: placeholder })
1778
+ ] }),
1779
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles.dropdownArrow, children: isOpen ? "\u25B2" : "\u25BC" })
1780
+ ]
1781
+ }
1782
+ ),
1783
+ multiSelect && selectedChains.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles.selectedCount, { color: accentColor }], children: [
1741
1784
  selectedChains.length,
1742
1785
  " chain",
1743
1786
  selectedChains.length > 1 ? "s" : "",
1744
1787
  " selected"
1745
- ] }) })
1788
+ ] }),
1789
+ /* @__PURE__ */ jsxRuntime.jsx(
1790
+ reactNative.Modal,
1791
+ {
1792
+ visible: isOpen,
1793
+ transparent: true,
1794
+ animationType: "fade",
1795
+ onRequestClose: () => setIsOpen(false),
1796
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles.modalOverlay, onPress: () => setIsOpen(false), children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles.modalContent, children: [
1797
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles.modalHeader, children: [
1798
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles.modalTitle, children: title || "Select Chains" }),
1799
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.TouchableOpacity, { onPress: () => setIsOpen(false), children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles.modalClose, children: "\u2715" }) })
1800
+ ] }),
1801
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { style: styles.optionsList, showsVerticalScrollIndicator: false, children: supportedChains.map((chain) => {
1802
+ const chainInfo = CHAIN_CONFIG[chain] || { name: chain, icon: "\u25CF", color: "#888" };
1803
+ const isSelected = selectedChains.includes(chain);
1804
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1805
+ reactNative.TouchableOpacity,
1806
+ {
1807
+ style: [
1808
+ styles.optionItem,
1809
+ isSelected && styles.optionItemSelected,
1810
+ isSelected && { backgroundColor: accentColor + "10", borderColor: accentColor }
1811
+ ],
1812
+ onPress: () => handleSelect(chain),
1813
+ activeOpacity: 0.7,
1814
+ children: [
1815
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles.optionIconBg, { backgroundColor: chainInfo.color + "20" }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles.optionIcon, { color: chainInfo.color }], children: chainInfo.icon }) }),
1816
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
1817
+ styles.optionText,
1818
+ isSelected && { color: accentColor, fontWeight: "600" }
1819
+ ], children: chainInfo.name }),
1820
+ isSelected ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles.checkbox, { backgroundColor: accentColor }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles.checkboxIcon, children: "\u2713" }) }) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles.checkboxEmpty })
1821
+ ]
1822
+ },
1823
+ chain
1824
+ );
1825
+ }) }),
1826
+ multiSelect && /* @__PURE__ */ jsxRuntime.jsx(
1827
+ reactNative.TouchableOpacity,
1828
+ {
1829
+ style: [styles.doneButton, { backgroundColor: accentColor }],
1830
+ onPress: () => setIsOpen(false),
1831
+ children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: styles.doneButtonText, children: [
1832
+ "Done (",
1833
+ selectedChains.length,
1834
+ ")"
1835
+ ] })
1836
+ }
1837
+ )
1838
+ ] }) })
1839
+ }
1840
+ )
1746
1841
  ] });
1747
1842
  };
1748
1843
  var styles = reactNative.StyleSheet.create({
@@ -1760,51 +1855,207 @@ var styles = reactNative.StyleSheet.create({
1760
1855
  color: "#666",
1761
1856
  marginBottom: 12
1762
1857
  },
1763
- chainsContainer: {
1858
+ // Desktop styles
1859
+ desktopGrid: {
1764
1860
  flexDirection: "row",
1765
1861
  flexWrap: "wrap",
1766
- gap: 8
1862
+ gap: 10
1767
1863
  },
1768
- chainChip: {
1864
+ desktopChip: {
1769
1865
  flexDirection: "row",
1770
1866
  alignItems: "center",
1771
- paddingHorizontal: 12,
1772
- paddingVertical: 8,
1867
+ paddingHorizontal: 14,
1868
+ paddingVertical: 10,
1869
+ backgroundColor: "#fff",
1870
+ borderRadius: 10,
1871
+ borderWidth: 2,
1872
+ borderColor: "#e8e8e8",
1873
+ gap: 10,
1874
+ cursor: "pointer"
1875
+ },
1876
+ desktopChipSelected: {
1877
+ borderWidth: 2
1878
+ },
1879
+ desktopIconBg: {
1880
+ width: 32,
1881
+ height: 32,
1882
+ borderRadius: 16,
1883
+ alignItems: "center",
1884
+ justifyContent: "center"
1885
+ },
1886
+ desktopIcon: {
1887
+ fontSize: 14,
1888
+ fontWeight: "700"
1889
+ },
1890
+ desktopChipText: {
1891
+ fontSize: 14,
1892
+ color: "#444"
1893
+ },
1894
+ desktopCheckbox: {
1895
+ width: 20,
1896
+ height: 20,
1897
+ borderRadius: 10,
1898
+ alignItems: "center",
1899
+ justifyContent: "center",
1900
+ marginLeft: 4
1901
+ },
1902
+ desktopCheckIcon: {
1903
+ fontSize: 12,
1904
+ color: "#fff",
1905
+ fontWeight: "700"
1906
+ },
1907
+ // Mobile dropdown styles
1908
+ dropdownTrigger: {
1909
+ flexDirection: "row",
1910
+ alignItems: "center",
1911
+ justifyContent: "space-between",
1912
+ paddingHorizontal: 14,
1913
+ paddingVertical: 12,
1773
1914
  backgroundColor: "#fff",
1774
1915
  borderRadius: 12,
1775
1916
  borderWidth: 2,
1776
1917
  borderColor: "#e5e5e5",
1777
- gap: 8
1918
+ minHeight: 52
1778
1919
  },
1779
- chainChipSelected: {
1780
- borderWidth: 2
1920
+ selectedPreview: {
1921
+ flex: 1,
1922
+ flexDirection: "row",
1923
+ alignItems: "center",
1924
+ gap: 6
1781
1925
  },
1782
- chainIconBg: {
1783
- width: 28,
1784
- height: 28,
1785
- borderRadius: 14,
1926
+ previewChip: {
1927
+ width: 32,
1928
+ height: 32,
1929
+ borderRadius: 16,
1786
1930
  alignItems: "center",
1787
1931
  justifyContent: "center"
1788
1932
  },
1789
- chainIcon: {
1933
+ previewIcon: {
1790
1934
  fontSize: 14,
1791
1935
  fontWeight: "700"
1792
1936
  },
1793
- chainText: {
1937
+ previewMore: {
1938
+ paddingHorizontal: 8,
1939
+ paddingVertical: 4,
1940
+ backgroundColor: "#f0f0f0",
1941
+ borderRadius: 8
1942
+ },
1943
+ previewMoreText: {
1944
+ fontSize: 12,
1945
+ color: "#666",
1946
+ fontWeight: "600"
1947
+ },
1948
+ placeholderText: {
1794
1949
  fontSize: 14,
1795
- color: "#666"
1950
+ color: "#999"
1796
1951
  },
1797
- checkmark: {
1952
+ dropdownArrow: {
1953
+ fontSize: 12,
1954
+ color: "#888",
1955
+ marginLeft: 8
1956
+ },
1957
+ selectedCount: {
1958
+ fontSize: 12,
1959
+ marginTop: 6,
1960
+ fontWeight: "500"
1961
+ },
1962
+ // Modal styles
1963
+ modalOverlay: {
1964
+ flex: 1,
1965
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
1966
+ justifyContent: "center",
1967
+ alignItems: "center"
1968
+ },
1969
+ modalContent: {
1970
+ width: "85%",
1971
+ maxWidth: 340,
1972
+ maxHeight: "70%",
1973
+ backgroundColor: "#fff",
1974
+ borderRadius: 16,
1975
+ overflow: "hidden"
1976
+ },
1977
+ modalHeader: {
1978
+ flexDirection: "row",
1979
+ justifyContent: "space-between",
1980
+ alignItems: "center",
1981
+ paddingHorizontal: 16,
1982
+ paddingVertical: 14,
1983
+ borderBottomWidth: 1,
1984
+ borderBottomColor: "#f0f0f0"
1985
+ },
1986
+ modalTitle: {
1987
+ fontSize: 18,
1988
+ fontWeight: "700",
1989
+ color: "#1a1a1a"
1990
+ },
1991
+ modalClose: {
1992
+ fontSize: 20,
1993
+ color: "#888",
1994
+ padding: 4
1995
+ },
1996
+ optionsList: {
1997
+ padding: 8
1998
+ },
1999
+ optionItem: {
2000
+ flexDirection: "row",
2001
+ alignItems: "center",
2002
+ paddingHorizontal: 12,
2003
+ paddingVertical: 12,
2004
+ borderRadius: 10,
2005
+ borderWidth: 1,
2006
+ borderColor: "transparent",
2007
+ marginBottom: 6,
2008
+ gap: 12
2009
+ },
2010
+ optionItemSelected: {
2011
+ borderWidth: 1
2012
+ },
2013
+ optionIconBg: {
2014
+ width: 36,
2015
+ height: 36,
2016
+ borderRadius: 18,
2017
+ alignItems: "center",
2018
+ justifyContent: "center"
2019
+ },
2020
+ optionIcon: {
1798
2021
  fontSize: 16,
1799
2022
  fontWeight: "700"
1800
2023
  },
1801
- selectedInfo: {
1802
- marginTop: 8,
1803
- paddingVertical: 4
2024
+ optionText: {
2025
+ flex: 1,
2026
+ fontSize: 15,
2027
+ color: "#333"
1804
2028
  },
1805
- selectedText: {
1806
- fontSize: 12,
1807
- color: "#888"
2029
+ checkbox: {
2030
+ width: 24,
2031
+ height: 24,
2032
+ borderRadius: 12,
2033
+ alignItems: "center",
2034
+ justifyContent: "center"
2035
+ },
2036
+ checkboxIcon: {
2037
+ fontSize: 14,
2038
+ color: "#fff",
2039
+ fontWeight: "700"
2040
+ },
2041
+ checkboxEmpty: {
2042
+ width: 24,
2043
+ height: 24,
2044
+ borderRadius: 12,
2045
+ borderWidth: 2,
2046
+ borderColor: "#ddd"
2047
+ },
2048
+ doneButton: {
2049
+ marginHorizontal: 16,
2050
+ marginVertical: 12,
2051
+ paddingVertical: 14,
2052
+ borderRadius: 10,
2053
+ alignItems: "center"
2054
+ },
2055
+ doneButtonText: {
2056
+ fontSize: 16,
2057
+ fontWeight: "600",
2058
+ color: "#fff"
1808
2059
  }
1809
2060
  });
1810
2061
  var OneTierSelector = ({
@@ -2074,23 +2325,30 @@ var styles3 = reactNative.StyleSheet.create({
2074
2325
  textAlign: "center"
2075
2326
  }
2076
2327
  });
2077
- var PAIR_ICONS = {
2078
- "BTC/USDT": "\u20BF",
2079
- "ETH/USDT": "\u039E",
2080
- "SOL/USDT": "\u25CE",
2081
- "BNB/USDT": "\u25C6",
2082
- "XRP/USDT": "\u2715",
2083
- "DOGE/USDT": "\xD0",
2084
- "ADA/USDT": "\u25C8",
2085
- "AVAX/USDT": "\u25B2",
2086
- "DOT/USDT": "\u25CF",
2087
- "MATIC/USDT": "\u2B21",
2088
- "LINK/USDT": "\u25C7",
2089
- "UNI/USDT": "\u{1F984}",
2090
- "ATOM/USDT": "\u269B",
2091
- "LTC/USDT": "\u0141",
2092
- "ARB/USDT": "\u25C6",
2093
- "OP/USDT": "\u25C9"
2328
+ var PAIR_CONFIG = {
2329
+ "BTC": { symbol: "BTC/USDT", name: "Bitcoin", icon: "\u20BF", color: "#F7931A" },
2330
+ "ETH": { symbol: "ETH/USDT", name: "Ethereum", icon: "\u039E", color: "#627EEA" },
2331
+ "BNB": { symbol: "BNB/USDT", name: "BNB", icon: "\u25C6", color: "#F3BA2F" },
2332
+ "SOL": { symbol: "SOL/USDT", name: "Solana", icon: "\u25CE", color: "#9945FF" },
2333
+ "XRP": { symbol: "XRP/USDT", name: "Ripple", icon: "\u2715", color: "#23292F" },
2334
+ "DOGE": { symbol: "DOGE/USDT", name: "Dogecoin", icon: "\xD0", color: "#C2A633" },
2335
+ "ADA": { symbol: "ADA/USDT", name: "Cardano", icon: "\u20B3", color: "#0033AD" },
2336
+ "AVAX": { symbol: "AVAX/USDT", name: "Avalanche", icon: "\u25B2", color: "#E84142" },
2337
+ "DOT": { symbol: "DOT/USDT", name: "Polkadot", icon: "\u25CF", color: "#E6007A" },
2338
+ "MATIC": { symbol: "MATIC/USDT", name: "Polygon", icon: "\u2B21", color: "#8247E5" },
2339
+ "LINK": { symbol: "LINK/USDT", name: "Chainlink", icon: "\u25C7", color: "#375BD2" },
2340
+ "UNI": { symbol: "UNI/USDT", name: "Uniswap", icon: "\u{1F984}", color: "#FF007A" },
2341
+ "ATOM": { symbol: "ATOM/USDT", name: "Cosmos", icon: "\u269B", color: "#2E3148" },
2342
+ "LTC": { symbol: "LTC/USDT", name: "Litecoin", icon: "\u0141", color: "#345D9D" },
2343
+ "ARB": { symbol: "ARB/USDT", name: "Arbitrum", icon: "\u25C6", color: "#28A0F0" },
2344
+ "OP": { symbol: "OP/USDT", name: "Optimism", icon: "\u25C9", color: "#FF0420" }
2345
+ };
2346
+ var PAIR_ICONS = Object.fromEntries(
2347
+ Object.entries(PAIR_CONFIG).map(([key, value]) => [`${key}/USDT`, value.icon])
2348
+ );
2349
+ var isDesktop2 = () => {
2350
+ const { width } = reactNative.Dimensions.get("window");
2351
+ return reactNative.Platform.OS === "web" && width >= 768;
2094
2352
  };
2095
2353
  var OnePairSelector = ({
2096
2354
  supportedPairs,
@@ -2101,9 +2359,12 @@ var OnePairSelector = ({
2101
2359
  subtitle,
2102
2360
  minSelections = 1,
2103
2361
  maxSelections = 0,
2362
+ placeholder = "Select trading pairs...",
2104
2363
  style,
2105
2364
  titleStyle
2106
2365
  }) => {
2366
+ const [isOpen, setIsOpen] = react.useState(false);
2367
+ const desktop = isDesktop2();
2107
2368
  const handleToggle = (pair) => {
2108
2369
  const isSelected = selectedPairs.includes(pair);
2109
2370
  if (isSelected && selectedPairs.length <= minSelections) {
@@ -2114,43 +2375,155 @@ var OnePairSelector = ({
2114
2375
  }
2115
2376
  onTogglePair(pair);
2116
2377
  };
2378
+ const getPairInfo = (pair) => {
2379
+ return PAIR_CONFIG[pair] || { symbol: `${pair}/USDT`, name: pair, icon: "\u25CF", color: "#888" };
2380
+ };
2381
+ if (desktop) {
2382
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles4.container, style], children: [
2383
+ title && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles4.title, titleStyle], children: title }),
2384
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.subtitle, children: subtitle }),
2385
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles4.desktopGrid, children: supportedPairs.map((pair) => {
2386
+ const pairInfo = getPairInfo(pair);
2387
+ const isSelected = selectedPairs.includes(pair);
2388
+ const isDisabled = !isSelected && maxSelections > 0 && selectedPairs.length >= maxSelections;
2389
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2390
+ reactNative.TouchableOpacity,
2391
+ {
2392
+ style: [
2393
+ styles4.desktopChip,
2394
+ isSelected && styles4.desktopChipSelected,
2395
+ isSelected && { borderColor: accentColor, backgroundColor: accentColor + "12" },
2396
+ isDisabled && styles4.desktopChipDisabled
2397
+ ],
2398
+ onPress: () => handleToggle(pair),
2399
+ activeOpacity: isDisabled ? 1 : 0.7,
2400
+ children: [
2401
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles4.desktopIconBg, { backgroundColor: pairInfo.color + "20" }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles4.desktopIcon, { color: pairInfo.color }], children: pairInfo.icon }) }),
2402
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
2403
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
2404
+ styles4.desktopChipText,
2405
+ isSelected && { color: accentColor, fontWeight: "600" },
2406
+ isDisabled && styles4.desktopTextDisabled
2407
+ ], children: pair }),
2408
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles4.desktopChipSubtext, isDisabled && styles4.desktopTextDisabled], children: pairInfo.name })
2409
+ ] }),
2410
+ isSelected && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles4.desktopCheckbox, { backgroundColor: accentColor }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.desktopCheckIcon, children: "\u2713" }) })
2411
+ ]
2412
+ },
2413
+ pair
2414
+ );
2415
+ }) }),
2416
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles4.infoRow, children: [
2417
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles4.selectedCount, { color: accentColor }], children: [
2418
+ selectedPairs.length,
2419
+ " pair",
2420
+ selectedPairs.length !== 1 ? "s" : "",
2421
+ " selected"
2422
+ ] }),
2423
+ (minSelections > 0 || maxSelections > 0) && /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: styles4.limitText, children: [
2424
+ minSelections > 0 && `min: ${minSelections}`,
2425
+ minSelections > 0 && maxSelections > 0 && " / ",
2426
+ maxSelections > 0 && `max: ${maxSelections}`
2427
+ ] })
2428
+ ] })
2429
+ ] });
2430
+ }
2117
2431
  return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles4.container, style], children: [
2118
2432
  title && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles4.title, titleStyle], children: title }),
2119
2433
  subtitle && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.subtitle, children: subtitle }),
2120
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles4.pairsContainer, children: supportedPairs.map((pair) => {
2121
- const isSelected = selectedPairs.includes(pair);
2122
- const icon = PAIR_ICONS[pair] || "\u25CF";
2123
- const baseSymbol = pair.split("/")[0];
2124
- return /* @__PURE__ */ jsxRuntime.jsxs(
2125
- reactNative.TouchableOpacity,
2126
- {
2127
- style: [
2128
- styles4.pairChip,
2129
- isSelected && styles4.pairChipSelected,
2130
- isSelected && { backgroundColor: accentColor + "15", borderColor: accentColor }
2131
- ],
2132
- onPress: () => handleToggle(pair),
2133
- activeOpacity: 0.7,
2134
- children: [
2135
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.pairIcon, children: icon }),
2136
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
2137
- styles4.pairText,
2138
- isSelected && { color: accentColor, fontWeight: "600" }
2139
- ], children: baseSymbol }),
2140
- isSelected && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles4.checkmark, { color: accentColor }], children: "\u2713" })
2141
- ]
2142
- },
2143
- pair
2144
- );
2145
- }) }),
2146
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles4.selectedInfo, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: styles4.selectedText, children: [
2147
- selectedPairs.length,
2148
- " pair",
2149
- selectedPairs.length !== 1 ? "s" : "",
2150
- " selected",
2151
- minSelections > 0 && ` (min: ${minSelections})`,
2152
- maxSelections > 0 && ` (max: ${maxSelections})`
2153
- ] }) })
2434
+ /* @__PURE__ */ jsxRuntime.jsxs(
2435
+ reactNative.TouchableOpacity,
2436
+ {
2437
+ style: [styles4.dropdownTrigger, { borderColor: isOpen ? accentColor : "#e5e5e5" }],
2438
+ onPress: () => setIsOpen(true),
2439
+ activeOpacity: 0.7,
2440
+ children: [
2441
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles4.selectedPreview, children: [
2442
+ selectedPairs.slice(0, 4).map((pair) => {
2443
+ const pairInfo = getPairInfo(pair);
2444
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles4.previewChip, { backgroundColor: pairInfo.color + "20" }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles4.previewIcon, { color: pairInfo.color }], children: pairInfo.icon }) }, pair);
2445
+ }),
2446
+ selectedPairs.length > 4 && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles4.previewMore, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: styles4.previewMoreText, children: [
2447
+ "+",
2448
+ selectedPairs.length - 4
2449
+ ] }) }),
2450
+ selectedPairs.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.placeholderText, children: placeholder })
2451
+ ] }),
2452
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.dropdownArrow, children: isOpen ? "\u25B2" : "\u25BC" })
2453
+ ]
2454
+ }
2455
+ ),
2456
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles4.infoRow, children: [
2457
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [styles4.selectedCount, { color: accentColor }], children: [
2458
+ selectedPairs.length,
2459
+ " pair",
2460
+ selectedPairs.length !== 1 ? "s" : "",
2461
+ " selected"
2462
+ ] }),
2463
+ (minSelections > 0 || maxSelections > 0) && /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: styles4.limitText, children: [
2464
+ minSelections > 0 && `min: ${minSelections}`,
2465
+ minSelections > 0 && maxSelections > 0 && " / ",
2466
+ maxSelections > 0 && `max: ${maxSelections}`
2467
+ ] })
2468
+ ] }),
2469
+ /* @__PURE__ */ jsxRuntime.jsx(
2470
+ reactNative.Modal,
2471
+ {
2472
+ visible: isOpen,
2473
+ transparent: true,
2474
+ animationType: "fade",
2475
+ onRequestClose: () => setIsOpen(false),
2476
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles4.modalOverlay, onPress: () => setIsOpen(false), children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles4.modalContent, children: [
2477
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles4.modalHeader, children: [
2478
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.modalTitle, children: title || "Select Trading Pairs" }),
2479
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.TouchableOpacity, { onPress: () => setIsOpen(false), children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.modalClose, children: "\u2715" }) })
2480
+ ] }),
2481
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { style: styles4.optionsList, showsVerticalScrollIndicator: false, children: supportedPairs.map((pair) => {
2482
+ const pairInfo = getPairInfo(pair);
2483
+ const isSelected = selectedPairs.includes(pair);
2484
+ const isDisabled = !isSelected && maxSelections > 0 && selectedPairs.length >= maxSelections;
2485
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2486
+ reactNative.TouchableOpacity,
2487
+ {
2488
+ style: [
2489
+ styles4.optionItem,
2490
+ isSelected && styles4.optionItemSelected,
2491
+ isSelected && { backgroundColor: accentColor + "10", borderColor: accentColor },
2492
+ isDisabled && styles4.optionItemDisabled
2493
+ ],
2494
+ onPress: () => handleToggle(pair),
2495
+ activeOpacity: isDisabled ? 1 : 0.7,
2496
+ children: [
2497
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles4.optionIconBg, { backgroundColor: pairInfo.color + "20" }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles4.optionIcon, { color: pairInfo.color }], children: pairInfo.icon }) }),
2498
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles4.optionTextContainer, children: [
2499
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
2500
+ styles4.optionSymbol,
2501
+ isSelected && { color: accentColor, fontWeight: "600" },
2502
+ isDisabled && styles4.optionTextDisabled
2503
+ ], children: pair }),
2504
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles4.optionName, isDisabled && styles4.optionTextDisabled], children: pairInfo.name })
2505
+ ] }),
2506
+ isSelected ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles4.checkbox, { backgroundColor: accentColor }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.checkboxIcon, children: "\u2713" }) }) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles4.checkboxEmpty, isDisabled && styles4.checkboxDisabled] })
2507
+ ]
2508
+ },
2509
+ pair
2510
+ );
2511
+ }) }),
2512
+ /* @__PURE__ */ jsxRuntime.jsx(
2513
+ reactNative.TouchableOpacity,
2514
+ {
2515
+ style: [styles4.doneButton, { backgroundColor: accentColor }],
2516
+ onPress: () => setIsOpen(false),
2517
+ children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: styles4.doneButtonText, children: [
2518
+ "Done (",
2519
+ selectedPairs.length,
2520
+ ")"
2521
+ ] })
2522
+ }
2523
+ )
2524
+ ] }) })
2525
+ }
2526
+ )
2154
2527
  ] });
2155
2528
  };
2156
2529
  var styles4 = reactNative.StyleSheet.create({
@@ -2168,43 +2541,246 @@ var styles4 = reactNative.StyleSheet.create({
2168
2541
  color: "#666",
2169
2542
  marginBottom: 12
2170
2543
  },
2171
- pairsContainer: {
2544
+ // Desktop styles
2545
+ desktopGrid: {
2172
2546
  flexDirection: "row",
2173
2547
  flexWrap: "wrap",
2174
- gap: 8
2548
+ gap: 10
2175
2549
  },
2176
- pairChip: {
2550
+ desktopChip: {
2177
2551
  flexDirection: "row",
2178
2552
  alignItems: "center",
2179
- paddingHorizontal: 12,
2180
- paddingVertical: 8,
2553
+ paddingHorizontal: 14,
2554
+ paddingVertical: 10,
2181
2555
  backgroundColor: "#fff",
2182
- borderRadius: 8,
2183
- borderWidth: 1,
2184
- borderColor: "#e5e5e5",
2185
- gap: 6
2556
+ borderRadius: 10,
2557
+ borderWidth: 2,
2558
+ borderColor: "#e8e8e8",
2559
+ gap: 10,
2560
+ cursor: "pointer",
2561
+ minWidth: 140
2186
2562
  },
2187
- pairChipSelected: {
2563
+ desktopChipSelected: {
2188
2564
  borderWidth: 2
2189
2565
  },
2190
- pairIcon: {
2191
- fontSize: 14
2566
+ desktopChipDisabled: {
2567
+ opacity: 0.5
2192
2568
  },
2193
- pairText: {
2569
+ desktopIconBg: {
2570
+ width: 36,
2571
+ height: 36,
2572
+ borderRadius: 18,
2573
+ alignItems: "center",
2574
+ justifyContent: "center"
2575
+ },
2576
+ desktopIcon: {
2577
+ fontSize: 16,
2578
+ fontWeight: "700"
2579
+ },
2580
+ desktopChipText: {
2194
2581
  fontSize: 14,
2195
- color: "#666"
2582
+ fontWeight: "500",
2583
+ color: "#333"
2196
2584
  },
2197
- checkmark: {
2585
+ desktopChipSubtext: {
2586
+ fontSize: 11,
2587
+ color: "#888",
2588
+ marginTop: 1
2589
+ },
2590
+ desktopTextDisabled: {
2591
+ color: "#bbb"
2592
+ },
2593
+ desktopCheckbox: {
2594
+ width: 20,
2595
+ height: 20,
2596
+ borderRadius: 10,
2597
+ alignItems: "center",
2598
+ justifyContent: "center",
2599
+ marginLeft: "auto"
2600
+ },
2601
+ desktopCheckIcon: {
2602
+ fontSize: 12,
2603
+ color: "#fff",
2604
+ fontWeight: "700"
2605
+ },
2606
+ // Mobile dropdown styles
2607
+ dropdownTrigger: {
2608
+ flexDirection: "row",
2609
+ alignItems: "center",
2610
+ justifyContent: "space-between",
2611
+ paddingHorizontal: 14,
2612
+ paddingVertical: 12,
2613
+ backgroundColor: "#fff",
2614
+ borderRadius: 12,
2615
+ borderWidth: 2,
2616
+ borderColor: "#e5e5e5",
2617
+ minHeight: 52
2618
+ },
2619
+ selectedPreview: {
2620
+ flex: 1,
2621
+ flexDirection: "row",
2622
+ alignItems: "center",
2623
+ gap: 6
2624
+ },
2625
+ previewChip: {
2626
+ width: 32,
2627
+ height: 32,
2628
+ borderRadius: 16,
2629
+ alignItems: "center",
2630
+ justifyContent: "center"
2631
+ },
2632
+ previewIcon: {
2198
2633
  fontSize: 14,
2199
2634
  fontWeight: "700"
2200
2635
  },
2201
- selectedInfo: {
2202
- marginTop: 8,
2203
- paddingVertical: 4
2636
+ previewMore: {
2637
+ paddingHorizontal: 8,
2638
+ paddingVertical: 4,
2639
+ backgroundColor: "#f0f0f0",
2640
+ borderRadius: 8
2641
+ },
2642
+ previewMoreText: {
2643
+ fontSize: 12,
2644
+ color: "#666",
2645
+ fontWeight: "600"
2646
+ },
2647
+ placeholderText: {
2648
+ fontSize: 14,
2649
+ color: "#999"
2650
+ },
2651
+ dropdownArrow: {
2652
+ fontSize: 12,
2653
+ color: "#888",
2654
+ marginLeft: 8
2655
+ },
2656
+ infoRow: {
2657
+ flexDirection: "row",
2658
+ justifyContent: "space-between",
2659
+ alignItems: "center",
2660
+ marginTop: 6
2204
2661
  },
2205
- selectedText: {
2662
+ selectedCount: {
2206
2663
  fontSize: 12,
2664
+ fontWeight: "500"
2665
+ },
2666
+ limitText: {
2667
+ fontSize: 11,
2207
2668
  color: "#888"
2669
+ },
2670
+ // Modal styles
2671
+ modalOverlay: {
2672
+ flex: 1,
2673
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
2674
+ justifyContent: "center",
2675
+ alignItems: "center"
2676
+ },
2677
+ modalContent: {
2678
+ width: "85%",
2679
+ maxWidth: 340,
2680
+ maxHeight: "75%",
2681
+ backgroundColor: "#fff",
2682
+ borderRadius: 16,
2683
+ overflow: "hidden"
2684
+ },
2685
+ modalHeader: {
2686
+ flexDirection: "row",
2687
+ justifyContent: "space-between",
2688
+ alignItems: "center",
2689
+ paddingHorizontal: 16,
2690
+ paddingVertical: 14,
2691
+ borderBottomWidth: 1,
2692
+ borderBottomColor: "#f0f0f0"
2693
+ },
2694
+ modalTitle: {
2695
+ fontSize: 18,
2696
+ fontWeight: "700",
2697
+ color: "#1a1a1a"
2698
+ },
2699
+ modalClose: {
2700
+ fontSize: 20,
2701
+ color: "#888",
2702
+ padding: 4
2703
+ },
2704
+ optionsList: {
2705
+ padding: 8
2706
+ },
2707
+ optionItem: {
2708
+ flexDirection: "row",
2709
+ alignItems: "center",
2710
+ paddingHorizontal: 12,
2711
+ paddingVertical: 12,
2712
+ borderRadius: 10,
2713
+ borderWidth: 1,
2714
+ borderColor: "transparent",
2715
+ marginBottom: 6,
2716
+ gap: 12
2717
+ },
2718
+ optionItemSelected: {
2719
+ borderWidth: 1
2720
+ },
2721
+ optionItemDisabled: {
2722
+ opacity: 0.5
2723
+ },
2724
+ optionIconBg: {
2725
+ width: 40,
2726
+ height: 40,
2727
+ borderRadius: 20,
2728
+ alignItems: "center",
2729
+ justifyContent: "center"
2730
+ },
2731
+ optionIcon: {
2732
+ fontSize: 18,
2733
+ fontWeight: "700"
2734
+ },
2735
+ optionTextContainer: {
2736
+ flex: 1
2737
+ },
2738
+ optionSymbol: {
2739
+ fontSize: 15,
2740
+ fontWeight: "500",
2741
+ color: "#333"
2742
+ },
2743
+ optionName: {
2744
+ fontSize: 12,
2745
+ color: "#888",
2746
+ marginTop: 1
2747
+ },
2748
+ optionTextDisabled: {
2749
+ color: "#bbb"
2750
+ },
2751
+ checkbox: {
2752
+ width: 24,
2753
+ height: 24,
2754
+ borderRadius: 12,
2755
+ alignItems: "center",
2756
+ justifyContent: "center"
2757
+ },
2758
+ checkboxIcon: {
2759
+ fontSize: 14,
2760
+ color: "#fff",
2761
+ fontWeight: "700"
2762
+ },
2763
+ checkboxEmpty: {
2764
+ width: 24,
2765
+ height: 24,
2766
+ borderRadius: 12,
2767
+ borderWidth: 2,
2768
+ borderColor: "#ddd"
2769
+ },
2770
+ checkboxDisabled: {
2771
+ borderColor: "#eee"
2772
+ },
2773
+ doneButton: {
2774
+ marginHorizontal: 16,
2775
+ marginVertical: 12,
2776
+ paddingVertical: 14,
2777
+ borderRadius: 10,
2778
+ alignItems: "center"
2779
+ },
2780
+ doneButtonText: {
2781
+ fontSize: 16,
2782
+ fontWeight: "600",
2783
+ color: "#fff"
2208
2784
  }
2209
2785
  });
2210
2786