solariskit 1.3.0 → 1.4.0

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.
@@ -259,26 +259,19 @@ declare namespace ConnectButtonRenderer {
259
259
  //#endregion
260
260
  //#region src/components/ConnectButton/ConnectButton.d.ts
261
261
  type AccountStatus = "full" | "avatar" | "address";
262
- type ChainStatus = "full" | "icon" | "name" | "none";
263
262
  interface ConnectButtonProps {
264
263
  accountStatus?: ResponsiveValue<AccountStatus>;
265
264
  showBalance?: ResponsiveValue<boolean>;
266
- chainStatus?: ResponsiveValue<ChainStatus>;
267
265
  label?: string;
268
266
  }
269
267
  declare function ConnectButton({
270
268
  accountStatus,
271
- chainStatus,
272
269
  label,
273
270
  showBalance
274
271
  }: ConnectButtonProps): React.JSX.Element | null;
275
272
  declare namespace ConnectButton {
276
273
  var __defaultProps: {
277
274
  readonly accountStatus: "full";
278
- readonly chainStatus: {
279
- readonly largeScreen: "full";
280
- readonly smallScreen: "icon";
281
- };
282
275
  readonly label: "Connect Wallet";
283
276
  readonly showBalance: {
284
277
  readonly largeScreen: true;
@@ -288,6 +281,25 @@ declare namespace ConnectButton {
288
281
  var Custom: typeof ConnectButtonRenderer;
289
282
  }
290
283
  //#endregion
284
+ //#region src/components/ChainSelectButton/ChainSelectButton.d.ts
285
+ type ChainStatus = "full" | "icon" | "name" | "none";
286
+ interface ChainSelectButtonProps {
287
+ chainStatus?: ResponsiveValue<ChainStatus>;
288
+ fullWidth?: boolean;
289
+ }
290
+ declare function ChainSelectButton({
291
+ chainStatus,
292
+ fullWidth
293
+ }: ChainSelectButtonProps): React.JSX.Element | null;
294
+ declare namespace ChainSelectButton {
295
+ var __defaultProps: {
296
+ readonly chainStatus: {
297
+ readonly largeScreen: "full";
298
+ readonly smallScreen: "icon";
299
+ };
300
+ };
301
+ }
302
+ //#endregion
291
303
  //#region src/wallets/useWalletConnectors.d.ts
292
304
  interface WalletConnector extends WalletInstance {
293
305
  ready?: boolean;
@@ -322,4 +334,4 @@ declare const WalletButton: {
322
334
  Custom: (props: WalletButtonRendererProps) => ReactNode;
323
335
  };
324
336
  //#endregion
325
- export { ConnectButtonProps as a, RainbowKitAuthenticationProvider as c, RainbowKitProviderProps as d, Theme as f, ThemeVars as g, DisclaimerComponent as h, ConnectButton as i, createAuthenticationAdapter as l, AvatarComponentProps as m, WalletButtonProps as n, AuthenticationConfig as o, AvatarComponent as p, WalletButtonRendererProps as r, AuthenticationStatus as s, WalletButton as t, RainbowKitProvider as u };
337
+ export { AvatarComponentProps as _, ChainSelectButtonProps as a, ConnectButtonProps as c, RainbowKitAuthenticationProvider as d, createAuthenticationAdapter as f, AvatarComponent as g, Theme as h, ChainSelectButton as i, AuthenticationConfig as l, RainbowKitProviderProps as m, WalletButtonProps as n, ChainStatus as o, RainbowKitProvider as p, WalletButtonRendererProps as r, ConnectButton as s, WalletButton as t, AuthenticationStatus as u, DisclaimerComponent as v, ThemeVars as y };
@@ -1530,100 +1530,6 @@ const Box = React.forwardRef(({ as = "div", className, testId, ...props }, ref)
1530
1530
  });
1531
1531
  Box.displayName = "Box";
1532
1532
 
1533
- //#endregion
1534
- //#region src/components/AsyncImage/useAsyncImage.ts
1535
- const cachedUrls = /* @__PURE__ */ new Map();
1536
- const cachedRequestPromises = /* @__PURE__ */ new Map();
1537
- async function loadAsyncImage(asyncImage) {
1538
- const cachedRequestPromise = cachedRequestPromises.get(asyncImage);
1539
- if (cachedRequestPromise) return cachedRequestPromise;
1540
- const load = async () => asyncImage().then(async (url) => {
1541
- cachedUrls.set(asyncImage, url);
1542
- return url;
1543
- });
1544
- const requestPromise = load().catch((_err) => {
1545
- return load().catch((_err) => {
1546
- cachedRequestPromises.delete(asyncImage);
1547
- });
1548
- });
1549
- cachedRequestPromises.set(asyncImage, requestPromise);
1550
- return requestPromise;
1551
- }
1552
- async function loadImages(...urls) {
1553
- return await Promise.all(urls.map((url) => typeof url === "function" ? loadAsyncImage(url) : url));
1554
- }
1555
- function useForceUpdate() {
1556
- const [, forceUpdate] = useReducer((x) => x + 1, 0);
1557
- return forceUpdate;
1558
- }
1559
- function useAsyncImage(url) {
1560
- const cachedUrl = typeof url === "function" ? cachedUrls.get(url) : void 0;
1561
- const forceUpdate = useForceUpdate();
1562
- useEffect(() => {
1563
- if (typeof url === "function" && !cachedUrl) loadAsyncImage(url).then(forceUpdate);
1564
- }, [
1565
- url,
1566
- cachedUrl,
1567
- forceUpdate
1568
- ]);
1569
- return typeof url === "function" ? cachedUrl : url;
1570
- }
1571
-
1572
- //#endregion
1573
- //#region src/components/AsyncImage/AsyncImage.tsx
1574
- function AsyncImage({ alt, background, borderColor, borderRadius, useAsImage, boxShadow, height, src: srcProp, width, testId }) {
1575
- const ios = isIOS();
1576
- const src = useAsyncImage(srcProp);
1577
- const isRemoteImage = src && src.startsWith("http");
1578
- const [isRemoteImageLoaded, setRemoteImageLoaded] = useReducer(() => true, false);
1579
- return /* @__PURE__ */ jsxs(Box, {
1580
- "aria-label": alt,
1581
- borderRadius,
1582
- boxShadow,
1583
- height: typeof height === "string" ? height : void 0,
1584
- overflow: "hidden",
1585
- position: "relative",
1586
- role: "img",
1587
- style: {
1588
- background,
1589
- height: typeof height === "number" ? height : void 0,
1590
- width: typeof width === "number" ? width : void 0
1591
- },
1592
- width: typeof width === "string" ? width : void 0,
1593
- testId,
1594
- children: [/* @__PURE__ */ jsx(Box, {
1595
- ...src ? isRemoteImage ? {
1596
- "aria-hidden": true,
1597
- as: "img",
1598
- onLoad: setRemoteImageLoaded,
1599
- src
1600
- } : {
1601
- "aria-hidden": true,
1602
- as: "img",
1603
- src
1604
- } : { "aria-hidden": true },
1605
- height: "full",
1606
- position: "absolute",
1607
- ...ios ? { WebkitUserSelect: "none" } : {},
1608
- style: {
1609
- WebkitTouchCallout: "none",
1610
- transition: "opacity .15s linear",
1611
- userSelect: "none",
1612
- ...!useAsImage && isRemoteImage ? { opacity: isRemoteImageLoaded ? 1 : 0 } : {}
1613
- },
1614
- width: "full"
1615
- }), borderColor ? /* @__PURE__ */ jsx(Box, {
1616
- ...typeof borderColor === "object" && "custom" in borderColor ? { style: { borderColor: borderColor.custom } } : { borderColor },
1617
- borderRadius,
1618
- borderStyle: "solid",
1619
- borderWidth: "1",
1620
- height: "full",
1621
- position: "relative",
1622
- width: "full"
1623
- }) : null]
1624
- });
1625
- }
1626
-
1627
1533
  //#endregion
1628
1534
  //#region src/components/Icons/Icons.css.ts
1629
1535
  var SpinnerIconClassName = "_1kl0wmk2";
@@ -1777,6 +1683,37 @@ const DropdownIcon = () => /* @__PURE__ */ jsxs("svg", {
1777
1683
  })]
1778
1684
  });
1779
1685
 
1686
+ //#endregion
1687
+ //#region src/components/RainbowKitProvider/ShowBalanceContext.tsx
1688
+ const ShowBalanceContext = createContext({
1689
+ showBalance: void 0,
1690
+ setShowBalance: () => {}
1691
+ });
1692
+ function ShowBalanceProvider({ children }) {
1693
+ const [showBalance, setShowBalance] = useState();
1694
+ return /* @__PURE__ */ jsx(ShowBalanceContext.Provider, {
1695
+ value: {
1696
+ showBalance,
1697
+ setShowBalance
1698
+ },
1699
+ children
1700
+ });
1701
+ }
1702
+ const useShowBalance = () => useContext(ShowBalanceContext);
1703
+
1704
+ //#endregion
1705
+ //#region src/hooks/useIsMounted.ts
1706
+ function useIsMounted() {
1707
+ const [isMounted, setIsMounted] = useState(false);
1708
+ useEffect(() => {
1709
+ setIsMounted(true);
1710
+ return () => {
1711
+ setIsMounted(false);
1712
+ };
1713
+ }, []);
1714
+ return useCallback(() => isMounted, [isMounted]);
1715
+ }
1716
+
1780
1717
  //#endregion
1781
1718
  //#region src/utils/isChainIdSupported.ts
1782
1719
  function isChainIdSupported(chains, chainId) {
@@ -1842,37 +1779,6 @@ const useRainbowKitChainsById = () => {
1842
1779
  }, [rainbowkitChains]);
1843
1780
  };
1844
1781
 
1845
- //#endregion
1846
- //#region src/components/RainbowKitProvider/ShowBalanceContext.tsx
1847
- const ShowBalanceContext = createContext({
1848
- showBalance: void 0,
1849
- setShowBalance: () => {}
1850
- });
1851
- function ShowBalanceProvider({ children }) {
1852
- const [showBalance, setShowBalance] = useState();
1853
- return /* @__PURE__ */ jsx(ShowBalanceContext.Provider, {
1854
- value: {
1855
- showBalance,
1856
- setShowBalance
1857
- },
1858
- children
1859
- });
1860
- }
1861
- const useShowBalance = () => useContext(ShowBalanceContext);
1862
-
1863
- //#endregion
1864
- //#region src/hooks/useIsMounted.ts
1865
- function useIsMounted() {
1866
- const [isMounted, setIsMounted] = useState(false);
1867
- useEffect(() => {
1868
- setIsMounted(true);
1869
- return () => {
1870
- setIsMounted(false);
1871
- };
1872
- }, []);
1873
- return useCallback(() => isMounted, [isMounted]);
1874
- }
1875
-
1876
1782
  //#endregion
1877
1783
  //#region src/hooks/useIsMainnetConfigured.ts
1878
1784
  function useIsMainnetConfigured() {
@@ -2369,6 +2275,45 @@ function useRecentTransactions() {
2369
2275
  return transactions;
2370
2276
  }
2371
2277
 
2278
+ //#endregion
2279
+ //#region src/components/AsyncImage/useAsyncImage.ts
2280
+ const cachedUrls = /* @__PURE__ */ new Map();
2281
+ const cachedRequestPromises = /* @__PURE__ */ new Map();
2282
+ async function loadAsyncImage(asyncImage) {
2283
+ const cachedRequestPromise = cachedRequestPromises.get(asyncImage);
2284
+ if (cachedRequestPromise) return cachedRequestPromise;
2285
+ const load = async () => asyncImage().then(async (url) => {
2286
+ cachedUrls.set(asyncImage, url);
2287
+ return url;
2288
+ });
2289
+ const requestPromise = load().catch((_err) => {
2290
+ return load().catch((_err) => {
2291
+ cachedRequestPromises.delete(asyncImage);
2292
+ });
2293
+ });
2294
+ cachedRequestPromises.set(asyncImage, requestPromise);
2295
+ return requestPromise;
2296
+ }
2297
+ async function loadImages(...urls) {
2298
+ return await Promise.all(urls.map((url) => typeof url === "function" ? loadAsyncImage(url) : url));
2299
+ }
2300
+ function useForceUpdate() {
2301
+ const [, forceUpdate] = useReducer((x) => x + 1, 0);
2302
+ return forceUpdate;
2303
+ }
2304
+ function useAsyncImage(url) {
2305
+ const cachedUrl = typeof url === "function" ? cachedUrls.get(url) : void 0;
2306
+ const forceUpdate = useForceUpdate();
2307
+ useEffect(() => {
2308
+ if (typeof url === "function" && !cachedUrl) loadAsyncImage(url).then(forceUpdate);
2309
+ }, [
2310
+ url,
2311
+ cachedUrl,
2312
+ forceUpdate
2313
+ ]);
2314
+ return typeof url === "function" ? cachedUrl : url;
2315
+ }
2316
+
2372
2317
  //#endregion
2373
2318
  //#region src/css/cssObjectFromTheme.ts
2374
2319
  const resolveThemeVars = (theme) => typeof theme === "function" ? theme() : theme;
@@ -2608,7 +2553,7 @@ function setRainbowKitVersion({ version }) {
2608
2553
  }
2609
2554
  function useFingerprint() {
2610
2555
  const fingerprint = useCallback(() => {
2611
- setRainbowKitVersion({ version: "1.3.0" });
2556
+ setRainbowKitVersion({ version: "1.4.0" });
2612
2557
  }, []);
2613
2558
  useEffect(() => {
2614
2559
  fingerprint();
@@ -2785,6 +2730,61 @@ function useWalletConnectors(mergeEIP6963WithRkConnectors = false) {
2785
2730
  return walletConnectors;
2786
2731
  }
2787
2732
 
2733
+ //#endregion
2734
+ //#region src/components/AsyncImage/AsyncImage.tsx
2735
+ function AsyncImage({ alt, background, borderColor, borderRadius, useAsImage, boxShadow, height, src: srcProp, width, testId }) {
2736
+ const ios = isIOS();
2737
+ const src = useAsyncImage(srcProp);
2738
+ const isRemoteImage = src && src.startsWith("http");
2739
+ const [isRemoteImageLoaded, setRemoteImageLoaded] = useReducer(() => true, false);
2740
+ return /* @__PURE__ */ jsxs(Box, {
2741
+ "aria-label": alt,
2742
+ borderRadius,
2743
+ boxShadow,
2744
+ height: typeof height === "string" ? height : void 0,
2745
+ overflow: "hidden",
2746
+ position: "relative",
2747
+ role: "img",
2748
+ style: {
2749
+ background,
2750
+ height: typeof height === "number" ? height : void 0,
2751
+ width: typeof width === "number" ? width : void 0
2752
+ },
2753
+ width: typeof width === "string" ? width : void 0,
2754
+ testId,
2755
+ children: [/* @__PURE__ */ jsx(Box, {
2756
+ ...src ? isRemoteImage ? {
2757
+ "aria-hidden": true,
2758
+ as: "img",
2759
+ onLoad: setRemoteImageLoaded,
2760
+ src
2761
+ } : {
2762
+ "aria-hidden": true,
2763
+ as: "img",
2764
+ src
2765
+ } : { "aria-hidden": true },
2766
+ height: "full",
2767
+ position: "absolute",
2768
+ ...ios ? { WebkitUserSelect: "none" } : {},
2769
+ style: {
2770
+ WebkitTouchCallout: "none",
2771
+ transition: "opacity .15s linear",
2772
+ userSelect: "none",
2773
+ ...!useAsImage && isRemoteImage ? { opacity: isRemoteImageLoaded ? 1 : 0 } : {}
2774
+ },
2775
+ width: "full"
2776
+ }), borderColor ? /* @__PURE__ */ jsx(Box, {
2777
+ ...typeof borderColor === "object" && "custom" in borderColor ? { style: { borderColor: borderColor.custom } } : { borderColor },
2778
+ borderRadius,
2779
+ borderStyle: "solid",
2780
+ borderWidth: "1",
2781
+ height: "full",
2782
+ position: "relative",
2783
+ width: "full"
2784
+ }) : null]
2785
+ });
2786
+ }
2787
+
2788
2788
  //#endregion
2789
2789
  //#region src/components/Icons/Assets.tsx
2790
2790
  const src$1 = async () => (await import("./assets-DGFjAppz.js")).default;
@@ -5436,9 +5436,7 @@ function ModalProvider({ children }) {
5436
5436
  const { closeModal: closeChainModal, isModalOpen: chainModalOpen, openModal: openChainModal } = useModalStateValue();
5437
5437
  const [isWalletConnectModalOpen, setIsWalletConnectModalOpen] = useState(false);
5438
5438
  const connectionStatus = useConnectionStatus();
5439
- const { chainId } = useConnection();
5440
5439
  const { chains } = useConfig();
5441
- const isCurrentChainSupported = isChainIdSupported(chains, chainId);
5442
5440
  const closeModals = useCallback(({ keepConnectModalOpen = false } = {}) => {
5443
5441
  if (!keepConnectModalOpen) closeConnectModal();
5444
5442
  closeAccountModal();
@@ -5462,7 +5460,7 @@ function ModalProvider({ children }) {
5462
5460
  chainModalOpen,
5463
5461
  connectModalOpen,
5464
5462
  isWalletConnectModalOpen,
5465
- openAccountModal: isCurrentChainSupported && connectionStatus === "connected" ? openAccountModal : void 0,
5463
+ openAccountModal: connectionStatus === "connected" ? openAccountModal : void 0,
5466
5464
  openChainModal: chains.length > 0 ? openChainModal : void 0,
5467
5465
  openConnectModal: connectionStatus === "disconnected" || connectionStatus === "unauthenticated" ? openConnectModal : void 0,
5468
5466
  setIsWalletConnectModalOpen
@@ -5474,7 +5472,6 @@ function ModalProvider({ children }) {
5474
5472
  openAccountModal,
5475
5473
  openChainModal,
5476
5474
  openConnectModal,
5477
- isCurrentChainSupported,
5478
5475
  chains.length,
5479
5476
  isWalletConnectModalOpen
5480
5477
  ]),
@@ -5600,20 +5597,15 @@ ConnectButtonRenderer.displayName = "ConnectButton.Custom";
5600
5597
 
5601
5598
  //#endregion
5602
5599
  //#region src/components/ConnectButton/ConnectButton.tsx
5603
- const defaultProps = {
5600
+ const defaultProps$1 = {
5604
5601
  accountStatus: "full",
5605
- chainStatus: {
5606
- largeScreen: "full",
5607
- smallScreen: "icon"
5608
- },
5609
5602
  label: "Connect Wallet",
5610
5603
  showBalance: {
5611
5604
  largeScreen: true,
5612
5605
  smallScreen: false
5613
5606
  }
5614
5607
  };
5615
- function ConnectButton({ accountStatus = defaultProps.accountStatus, chainStatus = defaultProps.chainStatus, label = defaultProps.label, showBalance = defaultProps.showBalance }) {
5616
- const chains = useRainbowKitChains();
5608
+ function ConnectButton({ accountStatus = defaultProps$1.accountStatus, label = defaultProps$1.label, showBalance = defaultProps$1.showBalance }) {
5617
5609
  const connectionStatus = useConnectionStatus();
5618
5610
  const { setShowBalance } = useShowBalance();
5619
5611
  const [ready, setReady] = useState(false);
@@ -5625,65 +5617,10 @@ function ConnectButton({ accountStatus = defaultProps.accountStatus, chainStatus
5625
5617
  setShowBalance,
5626
5618
  showBalance
5627
5619
  ]);
5628
- return ready ? /* @__PURE__ */ jsx(ConnectButtonRenderer, { children: ({ account, chain, mounted, openAccountModal, openChainModal, openConnectModal }) => {
5620
+ return ready ? /* @__PURE__ */ jsx(ConnectButtonRenderer, { children: ({ account, mounted, openAccountModal, openConnectModal }) => {
5629
5621
  const ready = mounted && connectionStatus !== "loading";
5630
- const unsupportedChain = chain?.unsupported ?? false;
5631
- const chainButton = chain && (chains.length > 1 || unsupportedChain) ? /* @__PURE__ */ jsxs(Box, {
5632
- alignItems: "center",
5633
- "aria-label": "Chain Selector",
5634
- as: "button",
5635
- background: unsupportedChain ? "connectButtonBackgroundError" : "connectButtonBackground",
5636
- borderRadius: "connectButton",
5637
- boxShadow: "connectButton",
5638
- className: touchableStyles({
5639
- active: "shrink",
5640
- hover: "grow"
5641
- }),
5642
- color: unsupportedChain ? "connectButtonTextError" : "connectButtonText",
5643
- display: mapResponsiveValue(chainStatus, (value) => value === "none" ? "none" : "flex"),
5644
- fontFamily: "body",
5645
- fontWeight: "bold",
5646
- gap: "6",
5647
- onClick: openChainModal,
5648
- paddingX: "10",
5649
- paddingY: "8",
5650
- testId: unsupportedChain ? "wrong-network-button" : "chain-button",
5651
- transition: "default",
5652
- type: "button",
5653
- children: [unsupportedChain ? /* @__PURE__ */ jsx(Box, {
5654
- alignItems: "center",
5655
- display: "flex",
5656
- height: "24",
5657
- paddingX: "4",
5658
- children: t("connect_wallet.wrong_network.label")
5659
- }) : /* @__PURE__ */ jsxs(Box, {
5660
- alignItems: "center",
5661
- display: "flex",
5662
- gap: "6",
5663
- children: [chain.hasIcon ? /* @__PURE__ */ jsx(Box, {
5664
- display: mapResponsiveValue(chainStatus, (value) => value === "full" || value === "icon" ? "block" : "none"),
5665
- height: "24",
5666
- width: "24",
5667
- children: /* @__PURE__ */ jsx(AsyncImage, {
5668
- alt: chain.name ?? "Chain icon",
5669
- background: chain.iconBackground,
5670
- borderRadius: "full",
5671
- height: "24",
5672
- src: chain.iconUrl,
5673
- width: "24"
5674
- })
5675
- }) : null, /* @__PURE__ */ jsx(Box, {
5676
- display: mapResponsiveValue(chainStatus, (value) => {
5677
- if (value === "icon" && !chain.iconUrl) return "block";
5678
- return value === "full" || value === "name" ? "block" : "none";
5679
- }),
5680
- children: chain.name ?? chain.id
5681
- })]
5682
- }), /* @__PURE__ */ jsx(DropdownIcon, {})]
5683
- }, unsupportedChain ? "unsupported" : "supported") : null;
5684
5622
  return /* @__PURE__ */ jsx(Box, {
5685
5623
  display: "flex",
5686
- gap: "12",
5687
5624
  ...!ready && {
5688
5625
  "aria-hidden": true,
5689
5626
  style: {
@@ -5692,7 +5629,7 @@ function ConnectButton({ accountStatus = defaultProps.accountStatus, chainStatus
5692
5629
  userSelect: "none"
5693
5630
  }
5694
5631
  },
5695
- children: ready && account && connectionStatus === "connected" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [chainButton, !unsupportedChain && /* @__PURE__ */ jsxs(Box, {
5632
+ children: ready && account && connectionStatus === "connected" ? /* @__PURE__ */ jsxs(Box, {
5696
5633
  alignItems: "center",
5697
5634
  as: "button",
5698
5635
  background: "connectButtonBackground",
@@ -5751,7 +5688,7 @@ function ConnectButton({ accountStatus = defaultProps.accountStatus, chainStatus
5751
5688
  })]
5752
5689
  })
5753
5690
  })]
5754
- })] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [chainButton, /* @__PURE__ */ jsx(Box, {
5691
+ }) : /* @__PURE__ */ jsx(Box, {
5755
5692
  as: "button",
5756
5693
  background: "accentColor",
5757
5694
  borderRadius: "connectButton",
@@ -5770,13 +5707,114 @@ function ConnectButton({ accountStatus = defaultProps.accountStatus, chainStatus
5770
5707
  transition: "default",
5771
5708
  type: "button",
5772
5709
  children: mounted && label === "Connect Wallet" ? t("connect_wallet.label") : label
5773
- }, "connect")] })
5710
+ }, "connect")
5774
5711
  });
5775
5712
  } }) : null;
5776
5713
  }
5777
- ConnectButton.__defaultProps = defaultProps;
5714
+ ConnectButton.__defaultProps = defaultProps$1;
5778
5715
  ConnectButton.Custom = ConnectButtonRenderer;
5779
5716
 
5717
+ //#endregion
5718
+ //#region src/components/ChainSelectButton/ChainSelectButton.tsx
5719
+ const defaultProps = { chainStatus: {
5720
+ largeScreen: "full",
5721
+ smallScreen: "icon"
5722
+ } };
5723
+ function ChainSelectButton({ chainStatus = defaultProps.chainStatus, fullWidth = false }) {
5724
+ const chains = useRainbowKitChains();
5725
+ const chainsById = useRainbowKitChainsById();
5726
+ const connectionStatus = useConnectionStatus();
5727
+ const { openChainModal } = useChainModal();
5728
+ const { chainId: connectedChainId } = useConnection();
5729
+ const chainId = useSelectedChainId(connectedChainId);
5730
+ const { chains: wagmiChains } = useConfig();
5731
+ const isConnectedChainSupported = connectedChainId ? isChainIdSupported(wagmiChains, connectedChainId) : true;
5732
+ const isMounted = useIsMounted();
5733
+ const [ready, setReady] = useState(false);
5734
+ const chainMetadata = chainId ? chainsById[chainId] : void 0;
5735
+ const resolvedChainIconUrl = useAsyncImage(chainMetadata?.iconUrl ?? void 0);
5736
+ const chain = chainId ? {
5737
+ hasIcon: Boolean(chainMetadata?.iconUrl),
5738
+ iconBackground: chainMetadata?.iconBackground,
5739
+ iconUrl: resolvedChainIconUrl,
5740
+ id: chainId,
5741
+ name: chainMetadata?.name ?? void 0,
5742
+ unsupported: !isConnectedChainSupported
5743
+ } : void 0;
5744
+ useEffect(() => {
5745
+ if (!ready) setReady(true);
5746
+ }, [ready]);
5747
+ if (!ready) return null;
5748
+ const buttonReady = isMounted() && connectionStatus !== "loading";
5749
+ const unsupportedChain = chain?.unsupported ?? false;
5750
+ if (!chain || chains.length <= 1 && !unsupportedChain) return null;
5751
+ return /* @__PURE__ */ jsxs(Box, {
5752
+ alignItems: "center",
5753
+ "aria-label": "Chain Selector",
5754
+ as: "button",
5755
+ background: unsupportedChain ? "connectButtonBackgroundError" : "connectButtonBackground",
5756
+ borderRadius: "connectButton",
5757
+ boxShadow: "connectButton",
5758
+ className: touchableStyles({
5759
+ active: "shrink",
5760
+ hover: "grow"
5761
+ }),
5762
+ color: unsupportedChain ? "connectButtonTextError" : "connectButtonText",
5763
+ disabled: !buttonReady || !openChainModal,
5764
+ display: mapResponsiveValue(chainStatus, (value) => value === "none" ? "none" : "flex"),
5765
+ fontFamily: "body",
5766
+ fontWeight: "bold",
5767
+ gap: "6",
5768
+ justifyContent: fullWidth ? "space-between" : "center",
5769
+ onClick: buttonReady ? openChainModal : void 0,
5770
+ paddingX: "10",
5771
+ paddingY: "8",
5772
+ testId: unsupportedChain ? "wrong-network-button" : "chain-button",
5773
+ transition: "default",
5774
+ type: "button",
5775
+ width: fullWidth ? "full" : void 0,
5776
+ ...!buttonReady && {
5777
+ "aria-hidden": true,
5778
+ style: {
5779
+ opacity: 0,
5780
+ pointerEvents: "none",
5781
+ userSelect: "none"
5782
+ }
5783
+ },
5784
+ children: [unsupportedChain ? /* @__PURE__ */ jsx(Box, {
5785
+ alignItems: "center",
5786
+ display: "flex",
5787
+ height: "24",
5788
+ paddingX: "4",
5789
+ children: t("connect_wallet.wrong_network.label")
5790
+ }) : /* @__PURE__ */ jsxs(Box, {
5791
+ alignItems: "center",
5792
+ display: "flex",
5793
+ gap: "6",
5794
+ children: [chain.hasIcon ? /* @__PURE__ */ jsx(Box, {
5795
+ display: mapResponsiveValue(chainStatus, (value) => value === "full" || value === "icon" ? "block" : "none"),
5796
+ height: "24",
5797
+ width: "24",
5798
+ children: /* @__PURE__ */ jsx(AsyncImage, {
5799
+ alt: chain.name ?? "Chain icon",
5800
+ background: chain.iconBackground,
5801
+ borderRadius: "full",
5802
+ height: "24",
5803
+ src: chain.iconUrl,
5804
+ width: "24"
5805
+ })
5806
+ }) : null, /* @__PURE__ */ jsx(Box, {
5807
+ display: mapResponsiveValue(chainStatus, (value) => {
5808
+ if (value === "icon" && !chain.iconUrl) return "block";
5809
+ return value === "full" || value === "name" ? "block" : "none";
5810
+ }),
5811
+ children: chain.name ?? chain.id
5812
+ })]
5813
+ }), /* @__PURE__ */ jsx(DropdownIcon, {})]
5814
+ }, unsupportedChain ? "unsupported" : "supported");
5815
+ }
5816
+ ChainSelectButton.__defaultProps = defaultProps;
5817
+
5780
5818
  //#endregion
5781
5819
  //#region src/components/WalletButton/WalletButton.css.ts
5782
5820
  var border = "p2yi7o0";
@@ -5936,4 +5974,4 @@ const WalletButton = ({ wallet }) => {
5936
5974
  WalletButton.Custom = WalletButtonRenderer;
5937
5975
 
5938
5976
  //#endregion
5939
- export { createAuthenticationAdapter as S, useTransactionStore as _, useConnectModal as a, EmojiAvatar as b, ChainModal as c, dialogContentMobile as d, RainbowKitProvider as f, cssObjectFromTheme as g, cssStringFromTheme as h, useChainModal as i, AccountModal as l, baseTheme as m, ConnectButton as n, MobileOptions as o, lightTheme as p, useAccountModal as r, DesktopOptions as s, WalletButton as t, dialogContent as u, useChainId$1 as v, RainbowKitAuthenticationProvider as x, Avatar as y };
5977
+ export { createAuthenticationAdapter as C, RainbowKitAuthenticationProvider as S, cssObjectFromTheme as _, useChainModal as a, Avatar as b, DesktopOptions as c, dialogContent as d, dialogContentMobile as f, cssStringFromTheme as g, baseTheme as h, useAccountModal as i, ChainModal as l, lightTheme as m, ChainSelectButton as n, useConnectModal as o, RainbowKitProvider as p, ConnectButton as r, MobileOptions as s, WalletButton as t, AccountModal as u, useTransactionStore as v, EmojiAvatar as x, useChainId$1 as y };
@@ -1,5 +1,5 @@
1
1
 
2
- import { a as ConnectButtonProps, d as RainbowKitProviderProps, i as ConnectButton, m as AvatarComponentProps, n as WalletButtonProps, p as AvatarComponent, t as WalletButton, u as RainbowKitProvider } from "../WalletButton-B-bj9FNL.js";
2
+ import { _ as AvatarComponentProps, a as ChainSelectButtonProps, c as ConnectButtonProps, g as AvatarComponent, i as ChainSelectButton, m as RainbowKitProviderProps, n as WalletButtonProps, o as ChainStatus, p as RainbowKitProvider, s as ConnectButton, t as WalletButton } from "../WalletButton-BiMfdrFz.js";
3
3
  import React from "react";
4
4
 
5
5
  //#region src/components/Avatar/Avatar.d.ts
@@ -148,4 +148,4 @@ declare function ChainModal({
148
148
  open
149
149
  }: ChainModalProps): React.JSX.Element;
150
150
  //#endregion
151
- export { AccountModal, type AccountModalProps, Avatar, type AvatarProps, ChainModal, type ChainModalProps, ConnectButton, type ConnectButtonProps, EmojiAvatar, type AvatarComponentProps as EmojiAvatarProps, RainbowKitProvider, type RainbowKitProviderProps, WalletButton, type WalletButtonProps, emojiAvatarForAddress };
151
+ export { AccountModal, type AccountModalProps, Avatar, type AvatarProps, ChainModal, type ChainModalProps, ChainSelectButton, type ChainSelectButtonProps, type ChainStatus, ConnectButton, type ConnectButtonProps, EmojiAvatar, type AvatarComponentProps as EmojiAvatarProps, RainbowKitProvider, type RainbowKitProviderProps, WalletButton, type WalletButtonProps, emojiAvatarForAddress };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { b as EmojiAvatar, c as ChainModal, f as RainbowKitProvider, l as AccountModal, n as ConnectButton, t as WalletButton, y as Avatar } from "../WalletButton-DpDL4qfh.js";
2
+ import { b as Avatar, l as ChainModal, n as ChainSelectButton, p as RainbowKitProvider, r as ConnectButton, t as WalletButton, u as AccountModal, x as EmojiAvatar } from "../WalletButton-D8U16Q_4.js";
3
3
 
4
4
  //#region src/components/Avatar/emojiAvatarForAddress.ts
5
5
  const colors = [
@@ -184,4 +184,4 @@ function emojiAvatarForAddress(address) {
184
184
  }
185
185
 
186
186
  //#endregion
187
- export { AccountModal, Avatar, ChainModal, ConnectButton, EmojiAvatar, RainbowKitProvider, WalletButton, emojiAvatarForAddress };
187
+ export { AccountModal, Avatar, ChainModal, ChainSelectButton, ConnectButton, EmojiAvatar, RainbowKitProvider, WalletButton, emojiAvatarForAddress };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import { c as RainbowKitAuthenticationProvider, d as RainbowKitProviderProps, f as Theme, g as ThemeVars, h as DisclaimerComponent, i as ConnectButton, l as createAuthenticationAdapter, o as AuthenticationConfig, p as AvatarComponent, r as WalletButtonRendererProps, s as AuthenticationStatus, t as WalletButton, u as RainbowKitProvider } from "./WalletButton-B-bj9FNL.js";
2
+ import { a as ChainSelectButtonProps, d as RainbowKitAuthenticationProvider, f as createAuthenticationAdapter, g as AvatarComponent, h as Theme, i as ChainSelectButton, l as AuthenticationConfig, m as RainbowKitProviderProps, o as ChainStatus, p as RainbowKitProvider, r as WalletButtonRendererProps, s as ConnectButton, t as WalletButton, u as AuthenticationStatus, v as DisclaimerComponent, y as ThemeVars } from "./WalletButton-BiMfdrFz.js";
3
3
  import { a as WalletDetailsParams, i as Wallet, r as RainbowKitWalletConnectParameters, s as WalletList, t as CreateConnector } from "./Wallet-epUweMuA.js";
4
4
  import React, { ReactNode } from "react";
5
5
  import { CreateConfigParameters, CreateConnectorFn } from "wagmi";
@@ -350,4 +350,4 @@ declare const __private__: {
350
350
  MobileOptions: typeof MobileOptions;
351
351
  };
352
352
  //#endregion
353
- export { type AuthenticationConfig, type AuthenticationStatus, type AvatarComponent, type RainbowKitChain as Chain, ConnectButton, type DisclaimerComponent, RainbowKitAuthenticationProvider, RainbowKitProvider, type RainbowKitProviderProps, type RainbowKitWalletConnectParameters, type Theme, type Wallet, WalletButton, type WalletButtonRendererProps, type WalletDetailsParams, type WalletList, __private__, connectorsForWallets, createAuthenticationAdapter, cssObjectFromTheme, cssStringFromTheme, darkTheme, getDefaultConfig, getDefaultWallets, getWalletConnectConnector, lightTheme, midnightTheme, useAccountModal, useAddRecentTransaction, useChainModal, useConnectModal };
353
+ export { type AuthenticationConfig, type AuthenticationStatus, type AvatarComponent, type RainbowKitChain as Chain, ChainSelectButton, type ChainSelectButtonProps, type ChainStatus, ConnectButton, type DisclaimerComponent, RainbowKitAuthenticationProvider, RainbowKitProvider, type RainbowKitProviderProps, type RainbowKitWalletConnectParameters, type Theme, type Wallet, WalletButton, type WalletButtonRendererProps, type WalletDetailsParams, type WalletList, __private__, connectorsForWallets, createAuthenticationAdapter, cssObjectFromTheme, cssStringFromTheme, darkTheme, getDefaultConfig, getDefaultWallets, getWalletConnectConnector, lightTheme, midnightTheme, useAccountModal, useAddRecentTransaction, useChainModal, useConnectModal };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { S as createAuthenticationAdapter, _ as useTransactionStore, a as useConnectModal, d as dialogContentMobile, f as RainbowKitProvider, g as cssObjectFromTheme, h as cssStringFromTheme, i as useChainModal, m as baseTheme, n as ConnectButton, o as MobileOptions, p as lightTheme, r as useAccountModal, s as DesktopOptions, t as WalletButton, u as dialogContent, v as useChainId$1, x as RainbowKitAuthenticationProvider } from "./WalletButton-DpDL4qfh.js";
2
+ import { C as createAuthenticationAdapter, S as RainbowKitAuthenticationProvider, _ as cssObjectFromTheme, a as useChainModal, c as DesktopOptions, d as dialogContent, f as dialogContentMobile, g as cssStringFromTheme, h as baseTheme, i as useAccountModal, m as lightTheme, n as ChainSelectButton, o as useConnectModal, p as RainbowKitProvider, r as ConnectButton, s as MobileOptions, t as WalletButton, v as useTransactionStore, y as useChainId$1 } from "./WalletButton-D8U16Q_4.js";
3
3
  import { a as injectedWallet, i as getWalletConnectConnector, n as safeWallet, o as base, r as metaMaskWallet, t as walletConnectWallet } from "./walletConnectors-C02JPPxf.js";
4
4
  import { useCallback } from "react";
5
5
  import { createConfig, http, useConnection } from "wagmi";
@@ -337,4 +337,4 @@ const __private__ = {
337
337
  };
338
338
 
339
339
  //#endregion
340
- export { ConnectButton, RainbowKitAuthenticationProvider, RainbowKitProvider, WalletButton, __private__, connectorsForWallets, createAuthenticationAdapter, cssObjectFromTheme, cssStringFromTheme, darkTheme, getDefaultConfig, getDefaultWallets, getWalletConnectConnector, lightTheme, midnightTheme, useAccountModal, useAddRecentTransaction, useChainModal, useConnectModal };
340
+ export { ChainSelectButton, ConnectButton, RainbowKitAuthenticationProvider, RainbowKitProvider, WalletButton, __private__, connectorsForWallets, createAuthenticationAdapter, cssObjectFromTheme, cssStringFromTheme, darkTheme, getDefaultConfig, getDefaultWallets, getWalletConnectConnector, lightTheme, midnightTheme, useAccountModal, useAddRecentTransaction, useChainModal, useConnectModal };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solariskit",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "The best way to connect a wallet",
5
5
  "keywords": [
6
6
  "blockchain",
@@ -43,38 +43,38 @@
43
43
  "@akshatmittal/polycons": "1.1.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@base-org/account": "^2.5.6",
46
+ "@base-org/account": "^2.5.7",
47
47
  "@rollup/plugin-replace": "^6.0.3",
48
48
  "@safe-global/safe-apps-provider": "^0.18.6",
49
49
  "@safe-global/safe-apps-sdk": "^9.1.0",
50
- "@tanstack/react-query": "^5.100.14",
50
+ "@tanstack/react-query": "^5.101.2",
51
51
  "@testing-library/dom": "^10.4.1",
52
52
  "@testing-library/jest-dom": "^6.9.1",
53
53
  "@testing-library/react": "^16.3.2",
54
54
  "@testing-library/user-event": "^14.6.1",
55
- "@types/node": "^24.12.2",
55
+ "@types/node": "^24.13.2",
56
56
  "@types/postcss-prefix-selector": "^1.16.3",
57
- "@types/react": "^19.2.16",
57
+ "@types/react": "^19.2.17",
58
58
  "@types/react-dom": "^19.2.3",
59
59
  "@vanilla-extract/css-utils": "0.1.6",
60
60
  "@vanilla-extract/private": "1.0.9",
61
61
  "@vanilla-extract/rollup-plugin": "^1.5.3",
62
- "@vanilla-extract/vite-plugin": "^5.2.2",
63
- "@walletconnect/ethereum-provider": "^2.23.9",
64
- "autoprefixer": "^10.5.0",
62
+ "@vanilla-extract/vite-plugin": "^5.2.3",
63
+ "@walletconnect/ethereum-provider": "^2.23.10",
64
+ "autoprefixer": "^10.5.2",
65
65
  "jsdom": "^29.1.1",
66
66
  "msw": "^2.14.6",
67
- "nock": "^14.0.15",
68
- "postcss": "^8.5.15",
67
+ "nock": "^14.0.16",
68
+ "postcss": "^8.5.16",
69
69
  "postcss-prefix-selector": "^2.1.1",
70
70
  "react": "^19.2.7",
71
71
  "react-dom": "^19.2.7",
72
- "tsdown": "^0.22.1",
72
+ "tsdown": "^0.22.3",
73
73
  "typescript": "^6.0.3",
74
- "viem": "^2.52.0",
75
- "vite": "^8.0.16",
76
- "vitest": "^4.1.8",
77
- "wagmi": "^3.6.16",
74
+ "viem": "^2.53.1",
75
+ "vite": "^8.1.0",
76
+ "vitest": "^4.1.9",
77
+ "wagmi": "^3.6.21",
78
78
  "@workspace/typescript-config": "0.0.0"
79
79
  },
80
80
  "peerDependencies": {