Skip to content

Commit f757e60

Browse files
committed
[MNY-237] SDK: Update theme colors, minor UI tweaks (#8305)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on updating theme colors and making minor UI tweaks across various React components in the `thirdweb` package. ### Detailed summary - Updated `weight` from `600` to `500` in multiple components' `Text`. - Adjusted `border` styles in `Container` components. - Modified padding and margin in several layout elements. - Enhanced UI elements with consistent `letterSpacing` and `fontSize`. - Added new theme stories for `darkThemeObj` and `lightThemeObj`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added Storybook theme showcase displaying color tokens and design system palette - **Bug Fixes** - Improved loading skeleton UI with better scrollable layout and visual consistency - **Style** - Refactored theme system with explicit color objects - Updated button styling with adjusted border radius and padding - Refined typography (font weights) across UI components - Adjusted layout spacing and padding throughout Bridge and wallet components - Increased QR code size for improved visibility - **Chores** - Added changeset documentation for patch release <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent d5d5939 commit f757e60

File tree

12 files changed

+404
-304
lines changed

12 files changed

+404
-304
lines changed

.changeset/wise-actors-attack.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Update theme colors and minor UI tweaks in React Components

packages/thirdweb/src/react/core/design-system/index.ts

Lines changed: 70 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,3 @@
1-
type ThemeColors = {
2-
base1: string;
3-
base2: string;
4-
base3: string;
5-
base4: string;
6-
primaryText: string;
7-
secondaryText: string;
8-
danger: string;
9-
success: string;
10-
overlay: string;
11-
accentText: string;
12-
accentBg: string;
13-
textOnAccent: string;
14-
};
15-
16-
const darkColors = {
17-
accentBg: "hsl(216 100% 50%)",
18-
accentText: "#3385FF",
19-
base1: "hsl(230 11.63% 8.43%)",
20-
base2: "hsl(230 11.63% 12%)",
21-
base3: "hsl(230 11.63% 15%)",
22-
base4: "hsl(230 11.63% 17%)",
23-
danger: "#e5484D",
24-
overlay: "rgba(0, 0, 0, 0.7)",
25-
primaryText: "#eeeef0",
26-
secondaryText: "#7c7a85",
27-
success: "#30A46C",
28-
textOnAccent: "#eeeef0",
29-
} as const satisfies ThemeColors;
30-
31-
const lightColors = {
32-
accentBg: "hsl(216 100% 50%)",
33-
accentText: "#3385FF",
34-
base1: "#fdfcfd",
35-
base2: "#f2eff3",
36-
base3: "#e3dfe6",
37-
base4: "#dbd8e0",
38-
danger: "#e5484D",
39-
overlay: "rgba(0, 0, 0, 0.7)",
40-
primaryText: "#211f26",
41-
secondaryText: "#6f6d78",
42-
success: "#30A46C",
43-
textOnAccent: "#fdfcfd",
44-
} as const satisfies ThemeColors;
45-
461
/**
472
* @theme
483
*/
@@ -95,64 +50,77 @@ export type Theme = {
9550
fontFamily: string;
9651
};
9752

98-
/**
99-
* @internal
100-
*/
101-
function createThemeObj(type: "dark" | "light", colors: ThemeColors): Theme {
102-
return {
103-
colors: {
104-
accentButtonBg: colors.accentBg,
105-
accentButtonText: colors.textOnAccent,
106-
accentText: colors.accentText,
107-
108-
borderColor: colors.base4,
109-
110-
connectedButtonBg: colors.base1,
111-
connectedButtonBgHover: colors.base2,
112-
113-
danger: colors.danger,
114-
115-
inputAutofillBg: colors.base1,
116-
117-
modalBg: colors.base1,
118-
119-
modalOverlayBg: colors.overlay,
120-
121-
primaryButtonBg: colors.primaryText,
122-
primaryButtonText: colors.base1,
123-
primaryText: colors.primaryText,
124-
scrollbarBg: colors.base2,
125-
126-
secondaryButtonBg: colors.base3,
127-
secondaryButtonHoverBg: colors.base4,
128-
secondaryButtonText: colors.primaryText,
129-
130-
secondaryIconColor: colors.secondaryText,
131-
secondaryIconHoverBg: colors.base3,
132-
secondaryIconHoverColor: colors.primaryText,
133-
secondaryText: colors.secondaryText,
134-
selectedTextBg: colors.primaryText,
135-
136-
selectedTextColor: colors.base1,
137-
138-
separatorLine: colors.base4,
139-
skeletonBg: colors.base4,
140-
success: colors.success,
141-
tertiaryBg: colors.base2,
142-
143-
tooltipBg: colors.primaryText,
144-
tooltipText: colors.base1,
145-
},
146-
fontFamily: "inherit",
147-
type,
148-
};
149-
}
53+
export const darkThemeObj: Theme = {
54+
type: "dark",
55+
colors: {
56+
accentButtonBg: "hsl(221 83% 54%)",
57+
accentButtonText: "hsl(0 0% 100%)",
58+
accentText: "hsl(209.61deg 100% 65.31%)",
59+
borderColor: "hsl(0 0% 15%)",
60+
connectedButtonBg: "hsl(0 0% 3.92%)",
61+
connectedButtonBgHover: "hsl(0 0% 11%)",
62+
danger: "hsl(360 72% 55%)",
63+
inputAutofillBg: "hsl(0 0% 11%)",
64+
modalBg: "hsl(0 0% 3.92%)",
65+
primaryButtonBg: "hsl(0 0% 100%)",
66+
primaryButtonText: "hsl(0 0% 0%)",
67+
primaryText: "hsl(0 0% 98%)",
68+
scrollbarBg: "hsl(0 0% 11%)",
69+
secondaryButtonBg: "hsl(0 0% 9%)",
70+
modalOverlayBg: "rgba(0, 0, 0, 0.7)",
71+
secondaryButtonHoverBg: "hsl(0 0% 9%/80%)",
72+
secondaryButtonText: "hsl(0 0% 98%)",
73+
secondaryIconColor: "hsl(0 0% 63%)",
74+
secondaryIconHoverBg: "hsl(0 0% 11%)",
75+
secondaryIconHoverColor: "hsl(0 0% 98%)",
76+
secondaryText: "hsl(0 0% 63%)",
77+
selectedTextBg: "hsl(0 0% 100%)",
78+
selectedTextColor: "hsl(0 0% 0%)",
79+
separatorLine: "hsl(0 0% 15%)",
80+
skeletonBg: "hsl(0 0% 12%)",
81+
success: "hsl(142 75% 50%)",
82+
tertiaryBg: "hsl(0 0% 11%/50%)",
83+
tooltipBg: "hsl(0 0% 11%)",
84+
tooltipText: "hsl(0 0% 98%)",
85+
},
86+
fontFamily: "inherit",
87+
};
15088

151-
export const darkThemeObj = /* @__PURE__ */ createThemeObj("dark", darkColors);
152-
export const lightThemeObj = /* @__PURE__ */ createThemeObj(
153-
"light",
154-
lightColors,
155-
);
89+
export const lightThemeObj: Theme = {
90+
type: "light",
91+
colors: {
92+
accentButtonBg: "hsl(221 83% 54%)",
93+
accentButtonText: "hsl(0 0% 100%)",
94+
accentText: "hsl(211.23deg 100% 44.47%)",
95+
borderColor: "hsl(0 0% 85%)",
96+
connectedButtonBg: "hsl(0 0% 100%)",
97+
connectedButtonBgHover: "hsl(0 0% 93%)",
98+
danger: "hsl(360 72% 60%)",
99+
inputAutofillBg: "hsl(0 0% 93%)",
100+
modalBg: "hsl(0 0% 100%)",
101+
primaryButtonBg: "hsl(0 0% 4%)",
102+
primaryButtonText: "hsl(0 0% 100%)",
103+
primaryText: "hsl(0 0% 4%)",
104+
scrollbarBg: "hsl(0 0% 93%)",
105+
secondaryButtonBg: "hsl(0 0% 93%)",
106+
modalOverlayBg: "rgba(0, 0, 0, 0.7)",
107+
secondaryButtonHoverBg: "hsl(0 0% 93%/80%)",
108+
secondaryButtonText: "hsl(0 0% 4%)",
109+
secondaryIconColor: "hsl(0 0% 40%)",
110+
secondaryIconHoverBg: "hsl(0 0% 93%)",
111+
secondaryIconHoverColor: "hsl(0 0% 4%)",
112+
secondaryText: "hsl(0 0% 40%)",
113+
selectedTextBg: "hsl(0 0% 4%)",
114+
selectedTextColor: "hsl(0 0% 100%)",
115+
separatorLine: "hsl(0 0% 85%)",
116+
skeletonBg: "hsl(0 0% 85%)",
117+
success: "hsl(142.09 70.56% 35.29%)",
118+
tertiaryBg: "hsl(0 0% 93%/70%)",
119+
tooltipBg: "hsl(0 0% 100%)",
120+
tooltipText: "hsl(0 0% 4%)",
121+
},
122+
fontFamily: "inherit",
123+
};
156124

157125
/**
158126
* @theme

packages/thirdweb/src/react/web/ui/Bridge/payment-selection/FiatProviderSelection.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type { SupportedFiatCurrency } from "../../../../../pay/convert/type.js";
55
import { checksumAddress } from "../../../../../utils/address.js";
66
import { formatNumber } from "../../../../../utils/formatNumber.js";
77
import { toTokens } from "../../../../../utils/units.js";
8-
import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js";
98
import {
109
iconSize,
1110
radius,
@@ -62,8 +61,6 @@ export function FiatProviderSelection({
6261
currency,
6362
country,
6463
}: FiatProviderSelectionProps) {
65-
const theme = useCustomTheme();
66-
6764
// Fetch quotes for all providers
6865
const quoteQueries = useBuyWithFiatQuotesForProviders({
6966
amount: toAmount || "0",
@@ -122,9 +119,9 @@ export function FiatProviderSelection({
122119
fullWidth
123120
onClick={() => onProviderSelected(provider.id)}
124121
style={{
125-
border: `1px solid ${theme.colors.borderColor}`,
126-
borderRadius: radius.md,
122+
borderRadius: radius.lg,
127123
textAlign: "left",
124+
padding: `${spacing.md}`,
128125
}}
129126
variant="secondary"
130127
>

packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export function PaymentSelection({
269269
}
270270

271271
return (
272-
<Container flex="column" px="md" pb="md" pt="md+">
272+
<Container flex="column" px="md" pt="md+">
273273
<ModalHeader onBack={getBackHandler()} title={getStepTitle()} />
274274
<Spacer y="lg" />
275275

0 commit comments

Comments
 (0)