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