thirdweb 5.110.1 → 5.110.2-nightly-630edadcec2c777cfd4bfef4871aff396e98291e-20251024000336

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.
Files changed (73) hide show
  1. package/dist/cjs/contract/deployment/utils/create-2-factory.js +1 -0
  2. package/dist/cjs/contract/deployment/utils/create-2-factory.js.map +1 -1
  3. package/dist/cjs/react/core/design-system/index.js +68 -68
  4. package/dist/cjs/react/core/design-system/index.js.map +1 -1
  5. package/dist/cjs/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js +2 -4
  6. package/dist/cjs/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js.map +1 -1
  7. package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js +1 -1
  8. package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
  9. package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js +25 -22
  10. package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
  11. package/dist/cjs/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js +22 -30
  12. package/dist/cjs/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js.map +1 -1
  13. package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js +1 -1
  14. package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +2 -2
  15. package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
  16. package/dist/cjs/react/web/ui/ConnectWallet/screens/ReceiveFunds.js +1 -1
  17. package/dist/cjs/react/web/ui/ConnectWallet/screens/ReceiveFunds.js.map +1 -1
  18. package/dist/cjs/react/web/ui/components/modalElements.js +2 -1
  19. package/dist/cjs/react/web/ui/components/modalElements.js.map +1 -1
  20. package/dist/cjs/react/web/wallets/shared/ConnectingScreen.js +1 -1
  21. package/dist/cjs/stories/theme.stories.js +59 -0
  22. package/dist/cjs/stories/theme.stories.js.map +1 -0
  23. package/dist/cjs/version.js +1 -1
  24. package/dist/cjs/version.js.map +1 -1
  25. package/dist/esm/contract/deployment/utils/create-2-factory.js +1 -0
  26. package/dist/esm/contract/deployment/utils/create-2-factory.js.map +1 -1
  27. package/dist/esm/react/core/design-system/index.js +68 -68
  28. package/dist/esm/react/core/design-system/index.js.map +1 -1
  29. package/dist/esm/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js +2 -4
  30. package/dist/esm/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js.map +1 -1
  31. package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js +1 -1
  32. package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
  33. package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js +26 -23
  34. package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
  35. package/dist/esm/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js +24 -32
  36. package/dist/esm/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js.map +1 -1
  37. package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js +1 -1
  38. package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +2 -2
  39. package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
  40. package/dist/esm/react/web/ui/ConnectWallet/screens/ReceiveFunds.js +1 -1
  41. package/dist/esm/react/web/ui/ConnectWallet/screens/ReceiveFunds.js.map +1 -1
  42. package/dist/esm/react/web/ui/components/modalElements.js +2 -1
  43. package/dist/esm/react/web/ui/components/modalElements.js.map +1 -1
  44. package/dist/esm/react/web/wallets/shared/ConnectingScreen.js +1 -1
  45. package/dist/esm/stories/theme.stories.js +55 -0
  46. package/dist/esm/stories/theme.stories.js.map +1 -0
  47. package/dist/esm/version.js +1 -1
  48. package/dist/esm/version.js.map +1 -1
  49. package/dist/scripts/bridge-widget.js +78 -78
  50. package/dist/types/react/core/design-system/index.d.ts.map +1 -1
  51. package/dist/types/react/web/ui/Bridge/payment-selection/FiatProviderSelection.d.ts.map +1 -1
  52. package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts.map +1 -1
  53. package/dist/types/react/web/ui/Bridge/payment-selection/WalletFiatSelection.d.ts.map +1 -1
  54. package/dist/types/react/web/ui/ConnectWallet/screens/ReceiveFunds.d.ts.map +1 -1
  55. package/dist/types/react/web/ui/components/modalElements.d.ts.map +1 -1
  56. package/dist/types/stories/theme.stories.d.ts +6 -0
  57. package/dist/types/stories/theme.stories.d.ts.map +1 -0
  58. package/dist/types/version.d.ts +1 -1
  59. package/dist/types/version.d.ts.map +1 -1
  60. package/package.json +1 -1
  61. package/src/contract/deployment/utils/create-2-factory.ts +1 -0
  62. package/src/react/core/design-system/index.ts +70 -102
  63. package/src/react/web/ui/Bridge/payment-selection/FiatProviderSelection.tsx +2 -5
  64. package/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx +1 -1
  65. package/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx +85 -89
  66. package/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx +67 -100
  67. package/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx +1 -1
  68. package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +2 -2
  69. package/src/react/web/ui/ConnectWallet/screens/ReceiveFunds.tsx +3 -2
  70. package/src/react/web/ui/components/modalElements.tsx +2 -1
  71. package/src/react/web/wallets/shared/ConnectingScreen.tsx +1 -1
  72. package/src/stories/theme.stories.tsx +165 -0
  73. package/src/version.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { ChevronRightIcon, PlusIcon } from "@radix-ui/react-icons";
2
+ import { PlusIcon } from "@radix-ui/react-icons";
3
3
  import type { ThirdwebClient } from "../../../../../client/client.js";
4
4
  import type { Wallet } from "../../../../../wallets/interfaces/wallet.js";
5
5
  import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js";
@@ -12,7 +12,6 @@ import { CreditCardIcon } from "../../ConnectWallet/icons/CreditCardIcon.js";
12
12
  import { WalletRow } from "../../ConnectWallet/screens/Buy/swap/WalletRow.js";
13
13
  import { Container } from "../../components/basic.js";
14
14
  import { Button } from "../../components/buttons.js";
15
- import { Spacer } from "../../components/Spacer.js";
16
15
  import { Text } from "../../components/text.js";
17
16
 
18
17
  interface WalletFiatSelectionProps {
@@ -35,56 +34,39 @@ export function WalletFiatSelection({
35
34
  const theme = useCustomTheme();
36
35
 
37
36
  return (
38
- <>
37
+ <Container flex="column" gap="xs">
39
38
  {paymentMethods.includes("crypto") && (
40
39
  <>
41
- {paymentMethods.length > 1 && (
42
- <>
43
- <Text color="primaryText" size="sm" weight={500}>
44
- Pay with Crypto
45
- </Text>
46
- <Spacer y="sm" />
47
- </>
48
- )}
49
-
50
40
  {/* Connected Wallets */}
51
41
  {connectedWallets.length > 0 && (
52
- <>
53
- <Container flex="column" gap="sm">
54
- {connectedWallets.map((wallet) => {
55
- const account = wallet.getAccount();
56
- if (!account?.address) {
57
- return null;
58
- }
59
- return (
60
- <Button
61
- fullWidth
62
- key={wallet.id}
63
- onClick={() => onWalletSelected(wallet)}
64
- style={{
65
- backgroundColor: theme.colors.tertiaryBg,
66
- border: `1px solid ${theme.colors.borderColor}`,
67
- borderRadius: radius.md,
68
- justifyContent: "space-between",
69
- padding: `${spacing.sm} ${spacing.md}`,
70
- }}
71
- variant="secondary"
72
- >
73
- <WalletRow
74
- address={account?.address}
75
- client={client}
76
- iconSize="lg"
77
- textSize="sm"
78
- />
79
- <ChevronRightIcon
80
- style={{ height: iconSize.md, width: iconSize.md }}
81
- />
82
- </Button>
83
- );
84
- })}
85
- </Container>
86
- <Spacer y="sm" />
87
- </>
42
+ <Container flex="column" gap="sm">
43
+ {connectedWallets.map((wallet) => {
44
+ const account = wallet.getAccount();
45
+ if (!account?.address) {
46
+ return null;
47
+ }
48
+ return (
49
+ <Button
50
+ fullWidth
51
+ key={`${wallet.id}-${account.address}`}
52
+ onClick={() => onWalletSelected(wallet)}
53
+ style={{
54
+ borderRadius: radius.md,
55
+ justifyContent: "space-between",
56
+ padding: `${spacing.md} ${spacing.md}`,
57
+ }}
58
+ variant="secondary"
59
+ >
60
+ <WalletRow
61
+ address={account?.address}
62
+ client={client}
63
+ iconSize="lg"
64
+ textSize="sm"
65
+ />
66
+ </Button>
67
+ );
68
+ })}
69
+ </Container>
88
70
  )}
89
71
 
90
72
  {/* Connect Another Wallet */}
@@ -92,11 +74,9 @@ export function WalletFiatSelection({
92
74
  fullWidth
93
75
  onClick={onConnectWallet}
94
76
  style={{
95
- backgroundColor: theme.colors.tertiaryBg,
96
- border: `1px solid ${theme.colors.borderColor}`,
97
77
  borderRadius: radius.md,
98
78
  height: "auto",
99
- padding: `${spacing.sm} ${spacing.md}`,
79
+ padding: `${spacing.md} ${spacing.md}`,
100
80
  textAlign: "left",
101
81
  }}
102
82
  variant="secondary"
@@ -109,23 +89,22 @@ export function WalletFiatSelection({
109
89
  <Container
110
90
  style={{
111
91
  alignItems: "center",
112
- border: `1px dashed ${theme.colors.secondaryIconColor}`,
113
- borderRadius: radius.sm,
92
+ border: `1px dashed ${theme.colors.secondaryText}`,
93
+ borderRadius: radius.full,
114
94
  display: "flex",
115
- height: iconSize.lg,
95
+ height: `${iconSize.lg}px`,
116
96
  justifyContent: "center",
117
- padding: spacing["4xs"],
118
- width: iconSize.lg,
97
+ width: `${iconSize.lg}px`,
119
98
  }}
120
99
  >
121
100
  <PlusIcon
122
101
  color={theme.colors.secondaryText}
123
- height={iconSize.md}
124
- width={iconSize.md}
102
+ height={iconSize["sm+"]}
103
+ width={iconSize["sm+"]}
125
104
  />
126
105
  </Container>
127
106
  <Container flex="column" gap="3xs" style={{ flex: 1 }}>
128
- <Text color="primaryText" size="sm" style={{ fontWeight: 600 }}>
107
+ <Text color="primaryText" size="sm">
129
108
  Connect a Wallet
130
109
  </Text>
131
110
  <Text color="secondaryText" size="xs">
@@ -138,49 +117,37 @@ export function WalletFiatSelection({
138
117
  )}
139
118
 
140
119
  {paymentMethods.includes("card") && (
141
- <>
142
- <Spacer y="lg" />
143
-
144
- <Text color="primaryText" size="sm" weight={500}>
145
- Pay with Card
146
- </Text>
147
-
148
- <Spacer y="sm" />
149
-
150
- <Button
151
- fullWidth
152
- onClick={onFiatSelected}
153
- style={{
154
- backgroundColor: theme.colors.tertiaryBg,
155
- border: `1px solid ${theme.colors.borderColor}`,
156
- borderRadius: radius.md,
157
- height: "auto",
158
- padding: `${spacing.sm} ${spacing.md}`,
159
- textAlign: "left",
160
- }}
161
- variant="secondary"
120
+ <Button
121
+ fullWidth
122
+ onClick={onFiatSelected}
123
+ style={{
124
+ borderRadius: radius.md,
125
+ height: "auto",
126
+ padding: `${spacing.md} ${spacing.md}`,
127
+ textAlign: "left",
128
+ }}
129
+ variant="secondary"
130
+ >
131
+ <Container
132
+ flex="row"
133
+ gap="md"
134
+ style={{ alignItems: "center", width: "100%" }}
162
135
  >
163
- <Container
164
- flex="row"
165
- gap="md"
166
- style={{ alignItems: "center", width: "100%" }}
167
- >
168
- <CreditCardIcon
169
- color={theme.colors.secondaryIconColor}
170
- size={iconSize.lg}
171
- />
172
- <Container flex="column" gap="3xs" style={{ flex: 1 }}>
173
- <Text color="primaryText" size="sm" style={{ fontWeight: 600 }}>
174
- Pay with Card
175
- </Text>
176
- <Text color="secondaryText" size="xs">
177
- Onramp and pay in one step
178
- </Text>
179
- </Container>
136
+ <CreditCardIcon
137
+ color={theme.colors.secondaryText}
138
+ size={iconSize.lg}
139
+ />
140
+ <Container flex="column" gap="3xs" style={{ flex: 1 }}>
141
+ <Text color="primaryText" size="sm">
142
+ Pay with Card
143
+ </Text>
144
+ <Text color="secondaryText" size="xs">
145
+ Onramp and pay in one step
146
+ </Text>
180
147
  </Container>
181
- </Button>
182
- </>
148
+ </Container>
149
+ </Button>
183
150
  )}
184
- </>
151
+ </Container>
185
152
  );
186
153
  }
@@ -76,7 +76,7 @@ export function WalletEntryButton(props: {
76
76
 
77
77
  <Container expand flex="column" gap="xxs">
78
78
  {nameOverride ? (
79
- <Text color="primaryText" weight={600}>
79
+ <Text color="primaryText" weight={500}>
80
80
  {nameOverride}
81
81
  </Text>
82
82
  ) : (
@@ -320,7 +320,7 @@ const WalletSelectorInner: React.FC<WalletSelectorProps> = (props) => {
320
320
  bottomSection = (
321
321
  <>
322
322
  <Line />
323
- <Container flex="column" gap="md" p="md">
323
+ <Container flex="column" gap="md" px="lg" py="md+">
324
324
  {newToWallets}
325
325
  {continueAsGuest}
326
326
  </Container>
@@ -705,7 +705,7 @@ const ShowAllWalletsIcon = /* @__PURE__ */ StyledDiv(() => {
705
705
  },
706
706
  alignItems: "center",
707
707
  backgroundColor: theme.colors.tertiaryBg,
708
- border: `2px solid ${theme.colors.borderColor}`,
708
+ border: `1px solid ${theme.colors.borderColor}`,
709
709
  borderRadius: radius.md,
710
710
  display: "grid",
711
711
  gap: spacing["4xs"],
@@ -52,7 +52,7 @@ export function ReceiveFunds(props: {
52
52
  )
53
53
  }
54
54
  qrCodeUri={address}
55
- size={310}
55
+ size={350}
56
56
  />
57
57
  </Container>
58
58
  <Spacer y="xl" />
@@ -62,7 +62,7 @@ export function ReceiveFunds(props: {
62
62
  className="tw-copy-address-button"
63
63
  >
64
64
  <Text color="primaryText" size="md">
65
- {shortenString(address || "")}
65
+ {shortenString(address || "", false)}
66
66
  </Text>
67
67
  <CopyIcon
68
68
  hasCopied={hasCopied}
@@ -76,6 +76,7 @@ export function ReceiveFunds(props: {
76
76
  <Text
77
77
  balance
78
78
  center
79
+ size="sm"
79
80
  className="receive_fund_screen_instruction"
80
81
  multiline
81
82
  >
@@ -10,9 +10,10 @@ export const ModalTitle = /* @__PURE__ */ StyledH2((_) => {
10
10
  return {
11
11
  color: theme.colors.primaryText,
12
12
  fontSize: fontSize.lg,
13
- fontWeight: 600,
13
+ fontWeight: 500,
14
14
  lineHeight: 1.3,
15
15
  margin: 0,
16
+ letterSpacing: "-0.025em",
16
17
  textAlign: "left",
17
18
  };
18
19
  });
@@ -74,7 +74,7 @@ export const ConnectingScreen: React.FC<{
74
74
  center
75
75
  color="primaryText"
76
76
  size="lg"
77
- weight={600}
77
+ weight={500}
78
78
  className="tw-screen-title"
79
79
  data-status={props.errorConnecting ? "failed" : "in-progress"}
80
80
  >
@@ -0,0 +1,165 @@
1
+ import type { Meta } from "@storybook/react-vite";
2
+ import {
3
+ darkThemeObj,
4
+ lightThemeObj,
5
+ type Theme,
6
+ } from "../react/core/design-system/index.js";
7
+ import { StyledDiv } from "../react/web/ui/design-system/elements.js";
8
+
9
+ const meta: Meta = {
10
+ title: "theme",
11
+ };
12
+ export default meta;
13
+
14
+ export function Dark() {
15
+ return <Variant theme={darkThemeObj} />;
16
+ }
17
+
18
+ export function Light() {
19
+ return <Variant theme={lightThemeObj} />;
20
+ }
21
+
22
+ function Variant(props: { theme: Theme }) {
23
+ return (
24
+ <div
25
+ style={{
26
+ display: "flex",
27
+ flexDirection: "column",
28
+ gap: "10px",
29
+ maxWidth: "700px",
30
+ margin: "0 auto",
31
+ backgroundColor: props.theme.colors.modalBg,
32
+ padding: "14px",
33
+ lineHeight: "1.5",
34
+ borderRadius: "8px",
35
+ }}
36
+ >
37
+ <ColorPairTest theme={props.theme} text="primaryText" />
38
+ <ColorPairTest theme={props.theme} text="secondaryText" />
39
+ <ColorPairTest theme={props.theme} text="accentText" />
40
+ <ColorPairTest theme={props.theme} text="danger" />
41
+ <ColorPairTest theme={props.theme} text="success" />
42
+
43
+ <ColorPairTest theme={props.theme} bg="tooltipBg" text="tooltipText" />
44
+
45
+ <ColorPairTest
46
+ theme={props.theme}
47
+ bg="accentButtonBg"
48
+ text="accentButtonText"
49
+ />
50
+
51
+ <ColorPairTest
52
+ theme={props.theme}
53
+ bg="primaryButtonBg"
54
+ text="primaryButtonText"
55
+ />
56
+
57
+ <ColorPairTest
58
+ theme={props.theme}
59
+ bg="selectedTextBg"
60
+ text="selectedTextColor"
61
+ />
62
+
63
+ <ColorPairTest theme={props.theme} bg="skeletonBg" text="primaryText" />
64
+
65
+ <ColorPairTest theme={props.theme} bg="scrollbarBg" text="primaryText" />
66
+
67
+ <ColorPairTest
68
+ theme={props.theme}
69
+ bg="inputAutofillBg"
70
+ text="primaryText"
71
+ />
72
+
73
+ <ColorPairTest
74
+ theme={props.theme}
75
+ bg="tertiaryBg"
76
+ hoverBg="secondaryButtonHoverBg"
77
+ text="primaryText"
78
+ />
79
+
80
+ <ColorPairTest
81
+ theme={props.theme}
82
+ bg="secondaryButtonBg"
83
+ hoverBg="secondaryButtonHoverBg"
84
+ text="secondaryButtonText"
85
+ />
86
+
87
+ <ColorPairTest
88
+ theme={props.theme}
89
+ hoverBg="secondaryIconHoverBg"
90
+ text="secondaryIconColor"
91
+ hoverText="secondaryIconHoverColor"
92
+ />
93
+
94
+ <ColorPairTest
95
+ theme={props.theme}
96
+ bg="connectedButtonBg"
97
+ text="primaryText"
98
+ hoverBg="connectedButtonBgHover"
99
+ />
100
+
101
+ <div
102
+ style={{
103
+ border: `1px solid ${props.theme.colors.borderColor}`,
104
+ padding: "20px",
105
+ borderRadius: "8px",
106
+ color: props.theme.colors.primaryText,
107
+ }}
108
+ >
109
+ border
110
+ </div>
111
+
112
+ <div
113
+ style={{
114
+ border: `1px solid ${props.theme.colors.separatorLine}`,
115
+ padding: "20px",
116
+ borderRadius: "8px",
117
+ color: props.theme.colors.primaryText,
118
+ }}
119
+ >
120
+ separatorLine
121
+ </div>
122
+ </div>
123
+ );
124
+ }
125
+
126
+ function ColorPairTest(props: {
127
+ theme: Theme;
128
+ bg?: keyof Theme["colors"];
129
+ text: keyof Theme["colors"];
130
+ hoverBg?: keyof Theme["colors"];
131
+ hoverText?: keyof Theme["colors"];
132
+ }) {
133
+ return (
134
+ <HoverBg
135
+ style={{ display: "flex", flexDirection: "column", gap: "10px" }}
136
+ bg={props.bg ? props.theme.colors[props.bg] : undefined}
137
+ hoverBg={props.hoverBg ? props.theme.colors[props.hoverBg] : undefined}
138
+ text={props.theme.colors[props.text]}
139
+ >
140
+ {[props.bg, props.hoverBg, props.text].filter(Boolean).join(", ")}
141
+ </HoverBg>
142
+ );
143
+ }
144
+ const HoverBg = StyledDiv(
145
+ (props: {
146
+ bg?: string;
147
+ hoverBg?: string;
148
+ text: string;
149
+ hoverText?: string;
150
+ }) => {
151
+ return {
152
+ backgroundColor: props.bg ?? "transparent",
153
+ padding: "20px",
154
+ borderRadius: "8px",
155
+ fontSize: "16px",
156
+ fontWeight: 400,
157
+ color: props.text,
158
+ "&:hover": props.hoverBg
159
+ ? {
160
+ backgroundColor: props.hoverBg,
161
+ }
162
+ : undefined,
163
+ };
164
+ },
165
+ );
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "5.110.1";
1
+ export const version = "5.110.2-nightly-630edadcec2c777cfd4bfef4871aff396e98291e-20251024000336";