Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homepage redesign #13528

Merged
merged 292 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
292 commits
Select commit Hold shift + click to select a range
25d3a56
style: add focus animation to SvgButtonLink
wackerow Aug 1, 2024
3efa41c
feat: implement calendar data
wackerow Aug 1, 2024
9947bbe
feat: Event fallback image, see all button
wackerow Aug 1, 2024
df69cc2
theme: add "lg" button size
wackerow Aug 1, 2024
40bf4b7
refactor: use button size "lg" on homepage
wackerow Aug 1, 2024
9a750cc
feat: add Join ethereum.org section
wackerow Aug 1, 2024
80ee005
build: yarn add -D xml2js @types/xml2js
wackerow Aug 3, 2024
fddb3dd
feat: add fetchRSSDisplay with types/constants
wackerow Aug 3, 2024
4af341d
init: RSS feed for homepage
wackerow Aug 3, 2024
9d224e9
theme: add sec/tert/quat color arrays
wackerow Aug 5, 2024
6bff04a
init: homepage bento box template
wackerow Aug 5, 2024
580570b
refactor: colors.css for foundational palettes
wackerow Aug 5, 2024
7a2a140
refactor: semantic-tokens.css for css theme tokens
wackerow Aug 5, 2024
16d0d6c
refactor: rm extracted colors/tokens, use import
wackerow Aug 5, 2024
fd2da24
refactor: tailwind color tokens
wackerow Aug 5, 2024
c4ea9cf
deprecate: switchBackground
wackerow Aug 5, 2024
a4768c6
feat: add `banner` gradient token
wackerow Aug 5, 2024
00728a8
refactor: fetchRSS
wackerow Aug 6, 2024
afdc668
create: rss helper functions
wackerow Aug 6, 2024
8acc906
chore: update constants, types, assets
wackerow Aug 6, 2024
559895e
refactor: use fetchRSS with helpers, switch HomeSection to h3
wackerow Aug 6, 2024
0a30d5b
Merge branch 'homepage-rss-branch' into homepage
wackerow Aug 6, 2024
abedbfc
feat: add Attestant blog for rss feeds
wackerow Aug 6, 2024
9923d73
feat: activate attestant blog, cache rss results
wackerow Aug 6, 2024
5dceb8d
fix: event fallback image
wackerow Aug 6, 2024
85a1084
Merge branch 'homepage-rss-branch' into homepage
wackerow Aug 6, 2024
9803d23
feat: add accent gradients
wackerow Aug 6, 2024
7cc230a
refactor: gradient-main naming, linting
wackerow Aug 6, 2024
2f8f944
refactor: upgrade css tokens to flexible pattern
wackerow Aug 7, 2024
d6bdad0
update: theming tokens
wackerow Aug 7, 2024
484ef2e
feat: extract BentoBox component
wackerow Aug 7, 2024
977f715
refactor: use BentoBox component, extract data
wackerow Aug 7, 2024
349f310
chore: add image assets
wackerow Aug 8, 2024
e97a311
feat: pure black bg in dark mode
wackerow Aug 8, 2024
bfb97b5
refactor: update color theme tokens and colors
wackerow Aug 8, 2024
2c93b06
refactor: upgrade all tokens to rgba format
wackerow Aug 8, 2024
0456e5f
revert: borderColor tokens
wackerow Aug 8, 2024
f33b098
update: BentoBox, add optional imgWidth prop
wackerow Aug 8, 2024
89e5964
update: BentoBox for desktop homepage
wackerow Aug 8, 2024
667e017
layout: BentoBox responsive design
wackerow Aug 9, 2024
f5e0e30
theme: update tailwind breakpoints
wackerow Aug 9, 2024
a67f002
fix: wrap R.G,B values in rgba()
wackerow Aug 9, 2024
a35a239
feat: add bg-gradient-hero to HomeHero
wackerow Aug 9, 2024
f57d5f1
update: SvgButtonLink hover/focus style
wackerow Aug 9, 2024
9325cb5
chore: add primary-action token
wackerow Aug 9, 2024
aae4293
refactor: mv global font import to global.css
wackerow Aug 9, 2024
c460cec
config: use `class` attribute for tracking theme
wackerow Aug 9, 2024
789b1e6
chore: rm unnecessary tokens
wackerow Aug 9, 2024
0e66abb
refactor: extract Box and Title components
wackerow Aug 9, 2024
9bb0015
refactor: extract BentoBoxes component
wackerow Aug 9, 2024
bbf02b8
refactor: H,S%,L% color formatting
wackerow Aug 10, 2024
8940479
config: use `.dark` class for theme setup
wackerow Aug 10, 2024
17d1856
fix: breakpoint usage
wackerow Aug 12, 2024
7b5abb5
update: Box to accept imgHeight?
wackerow Aug 13, 2024
615ffd5
init: simple mobile stacking design
wackerow Aug 13, 2024
35adbf3
fix: twitter icon
wackerow Aug 13, 2024
af06be7
config: yarn add swiper
wackerow Aug 13, 2024
3d62c6a
fix: bento boxes styling
wackerow Aug 13, 2024
ba99d53
feat: implement mobile swiper
wackerow Aug 13, 2024
7309f32
fix: add handling for invalid pubDates
wackerow Aug 13, 2024
505cb13
Merge branch 'dev' into homepage
wackerow Aug 13, 2024
96f2cbc
patch: merge amendments
wackerow Aug 14, 2024
2b26f12
refactor: use dark class for color mode management
wackerow Aug 14, 2024
0942da2
fix: sync color themes with system
wackerow Aug 16, 2024
d9e6b2b
Merge branch 'dev' into homepage
wackerow Aug 16, 2024
741acdc
Merge branch 'dark-class' into homepage
wackerow Aug 16, 2024
3408ebb
Merge branch 'dev' into homepage
wackerow Aug 19, 2024
04934b9
refactor: svg icons to 1em width/height
wackerow Aug 20, 2024
0e9e667
fix: event sorting/filtering
wackerow Aug 20, 2024
e82e822
fix: SvgButtonLink styling
wackerow Aug 20, 2024
6e3b55b
fix: homepage styling atches
wackerow Aug 20, 2024
003dca2
fix: rss links
wackerow Aug 20, 2024
273f7e7
fix: add hsla wrapper to color tokens
wackerow Aug 20, 2024
72ad778
styling: clean up news and events cards
wackerow Aug 20, 2024
2e7e30b
temp: rm section until designs completed
wackerow Aug 20, 2024
8aadb22
patch: wording
wackerow Aug 20, 2024
b5007fb
style: rm external arrow; use new calendar-add icon
wackerow Aug 20, 2024
9cb6819
Merge branch 'dev' into homepage
wackerow Aug 20, 2024
44f70b4
chore: auto-linter
wackerow Aug 20, 2024
127b2cc
refactor: extract EventPreviewCard component
wackerow Aug 21, 2024
990c65f
chore: extract reused cn's
wackerow Aug 21, 2024
9e0503a
fix: use hsla instead of rgba
wackerow Aug 21, 2024
5b7412d
chore: add purple color palette to tw config
wackerow Aug 21, 2024
7b9df84
fix: use solid and outline-primary variants
wackerow Aug 21, 2024
a0f5766
refactor: use tw gradients, rm custom tokens
wackerow Aug 21, 2024
aa5a928
fix: use BaseLink
wackerow Aug 21, 2024
4d83962
refactor: extract RssPreviewCard component
wackerow Aug 21, 2024
d941cb9
fix: event card filtering and tablet layout
wackerow Aug 21, 2024
ccaa18b
fix: mobile swiper overflowing
wackerow Aug 21, 2024
c054fee
chore: clean up patches
wackerow Aug 22, 2024
6f5431f
theme: add svg-button-link shadow tokens
wackerow Aug 22, 2024
177f45c
feat: hover and focus styling
wackerow Aug 22, 2024
fc00bb3
fix: rm repeated hsla wrapper
wackerow Aug 22, 2024
35973e4
chore: rm unused class styling
wackerow Aug 22, 2024
d690756
Merge branch 'dev' into homepage
wackerow Aug 22, 2024
8d0d057
refactor: accept size and variant as direct props
wackerow Aug 22, 2024
7cca606
theme: update solid button to primary-action
wackerow Aug 22, 2024
454ec43
refactor: use button size and variant props
wackerow Aug 22, 2024
2f62784
refactor: accept isSecondary as direct props
wackerow Aug 22, 2024
03ff3a3
refactor: extract SwiperCards, mv BentoBox
wackerow Aug 22, 2024
ce36d0c
chore: focus styling
wackerow Aug 22, 2024
673879f
fix: deprecate/rm `date`
wackerow Aug 22, 2024
af11812
fix: outline variant text color
wackerow Aug 22, 2024
25412fd
chore: clean up patches
wackerow Aug 22, 2024
e330d41
refactor: pass className to HomeHero
wackerow Aug 22, 2024
1d05798
style: update base `card` components and variants
wackerow Aug 22, 2024
006f18f
refactor: use reusable card components
wackerow Aug 22, 2024
735eae4
chore: up-res event-placeholder
wackerow Aug 22, 2024
99b67e9
refactor: mv attestant fetch to fetchPosts
wackerow Aug 22, 2024
e08f39e
feat: add solidity and panda ops rss feeds
wackerow Aug 22, 2024
150d954
chore(deps): bump swiper
wackerow Aug 23, 2024
dcd10b1
chore: remove unused class
wackerow Aug 23, 2024
1fdea29
refactor: extract PostPreviewCard
wackerow Aug 23, 2024
d22b0fd
feat: create PostsSwiper component
wackerow Aug 23, 2024
d42a116
feat: implement mobile PostsSwiper
wackerow Aug 23, 2024
65e8c1c
feat: add "read more" blogs
wackerow Aug 23, 2024
a3d7639
chore: dim gradient
wackerow Aug 23, 2024
cbc6fea
Merge branch 'dev' into homepage
wackerow Aug 23, 2024
78d6df7
chore: layout adjustments
wackerow Aug 23, 2024
32d22c3
style: add missing spacing
wackerow Aug 23, 2024
2b6da02
feat: add growthepie metrics
wackerow Aug 23, 2024
6acde0e
fix: swiper card width and overflow handling
wackerow Aug 24, 2024
7e0d7ad
feat: add variants to SvgButtonLink
wackerow Aug 24, 2024
c1106fc
fix: update all SvgButtonLink with variants
wackerow Aug 24, 2024
526fa25
chore: use updated Tooltip component
wackerow Aug 24, 2024
ac97f6b
fix: fragment key
wackerow Aug 26, 2024
bacc757
chore: update name
wackerow Aug 26, 2024
9cedf2b
chore: patch style
wackerow Aug 26, 2024
dc0c5c1
feat: add last updated date to metrics
wackerow Aug 26, 2024
4f9fef1
chore: image sizing and layout adjustment
wackerow Aug 26, 2024
4b3cccf
chore: apply suggestions from design review
wackerow Aug 26, 2024
7b38914
theme: sync color tokens with latest design system
wackerow Aug 26, 2024
1a42937
chore: remove time from last updated string
wackerow Aug 26, 2024
387b608
chore: remove bold from first item
wackerow Aug 26, 2024
8ba4ffd
feat: add EthStaker blog to RSS feeds
wackerow Aug 27, 2024
4650986
theme: sync chakra theme with new primary tokens
wackerow Aug 27, 2024
e0b2466
patch: spacing adjustment
wackerow Aug 27, 2024
a1bb94a
feat: improve fetchRSS logic error handling
wackerow Aug 27, 2024
eeda7cd
feat: add 0xParc rss feed and image asset
wackerow Aug 27, 2024
39a7534
chore: add fallback images for events
wackerow Aug 27, 2024
68386d9
chore: linting, small figma adjustments
wackerow Aug 27, 2024
a6f058b
style: apply suggestions from design review
wackerow Aug 27, 2024
59efed8
fix: phone-homescreen sizing
wackerow Aug 27, 2024
4af1a7f
chore: use vector banner for vitalik blog
wackerow Aug 27, 2024
10b16a8
feat: implement nav/pagination for swiper cards
wackerow Aug 27, 2024
96a9b6d
feat: add default bg-gradient to card banner
wackerow Aug 27, 2024
f347220
Merge branch 'dev' into homepage
wackerow Aug 28, 2024
ed1bb89
theme: add radial-a
wackerow Aug 28, 2024
7e65847
chore: rm accent-gradients
wackerow Aug 28, 2024
09948f3
fix: bg and border gradients for "join" card
wackerow Aug 28, 2024
bd307bd
chore: restyle and arrange title
wackerow Aug 28, 2024
02bbc63
chore: clean up feed naming, fix media pulls
wackerow Aug 28, 2024
cb2a257
feat: add pagination/nav to mobile PostsSwiper
wackerow Aug 28, 2024
77755b7
chore: rearrange title per design review
wackerow Aug 28, 2024
f485d02
patch: metric label
wackerow Aug 29, 2024
32821ab
chore: adjust date range formatting for events
wackerow Aug 29, 2024
7f11711
chore: upres event placeholder image
wackerow Aug 29, 2024
901bc0b
chore: extract homepage strings for intl
wackerow Aug 29, 2024
7496c35
chore: clean up unused
wackerow Aug 29, 2024
e8e9697
theme: update base color tokens
wackerow Aug 29, 2024
363a0bd
fix: accent color hover styling
wackerow Aug 29, 2024
8c2b3bb
theme: update shadow tokens
wackerow Aug 29, 2024
b326756
chore: font size and margin adjustments
wackerow Aug 29, 2024
f473ec5
fix: WindowBox shadow and spacing
wackerow Aug 29, 2024
971cb78
chore: apply outline variant (secondary action)
wackerow Aug 29, 2024
2a80454
fix: accent/primary hover styling
wackerow Aug 29, 2024
ca27208
feat: update RSS logic
wackerow Aug 29, 2024
d3580a0
patch: make cal event title into link
wackerow Aug 29, 2024
ee5cd8b
fix: accent hover styles
wackerow Aug 29, 2024
a0791fc
chore: adjust flex breakpoint
wackerow Aug 29, 2024
d3236d7
chore: make button primary action, update label
wackerow Aug 29, 2024
c8e37fa
chore: adjustments
wackerow Aug 29, 2024
cfc4329
style: use multi-line syntax for long tokens
wackerow Aug 29, 2024
3688f0b
fix: hydration warnings from useBentoBox
wackerow Aug 29, 2024
f35de90
refactor: unify card styling
wackerow Aug 29, 2024
58f580b
refactor: HomeSection props
wackerow Aug 30, 2024
030ce94
feat: create ui/section component
wackerow Aug 30, 2024
2ff97e3
refactor: use Stack with gap
wackerow Aug 30, 2024
eb63cd1
refactor: use ui/section within HomeSection
wackerow Aug 30, 2024
5b560cc
deprecate: HomeSection in lieu of reusable Section
wackerow Aug 30, 2024
aba8bb3
revert: refactor: use Stack with gap
wackerow Aug 30, 2024
6345221
performance: lazy load Codeblock and StatsBoxGrid
wackerow Aug 30, 2024
b0b809b
refactor: use capitalized component names
wackerow Aug 30, 2024
5330c49
refactor: CommunityBlog type, require feed OR name
wackerow Aug 30, 2024
bb81754
chore: cleanup
wackerow Aug 30, 2024
81ffc3c
chore: sync chakra theme; solid button and colors
wackerow Aug 30, 2024
b5df634
chore: general polishes and cleanup
wackerow Aug 30, 2024
1903544
chore: apply bg gradients to WindowBox
wackerow Aug 30, 2024
ed64296
feat: use TwImage over NextImage
wackerow Aug 30, 2024
4484598
deprecate: recently added linear gradient tokens
wackerow Aug 30, 2024
7e74dbf
chore: rm unnecessary placeholder div
wackerow Aug 30, 2024
e05abae
chore: punctuation patch
wackerow Aug 30, 2024
b3df372
Revert "chore: rm unnecessary placeholder div"
wackerow Aug 30, 2024
d1d24ca
Merge branch 'dev' into homepage
wackerow Aug 30, 2024
38c1cc8
chore: apply adjustments from review
wackerow Aug 30, 2024
2d5e079
theme: adjust hover tokens
wackerow Aug 30, 2024
341ed45
copy: adjustments
wackerow Aug 30, 2024
42cdff4
refactor: extract homepage logic to useHome
wackerow Aug 31, 2024
198f5e9
chore: patch event logic, show events today
wackerow Aug 31, 2024
02ec3cc
chore: rm unused imports, linting
wackerow Aug 31, 2024
877809a
refactor: title -> header
wackerow Aug 31, 2024
3fa2e7b
refactor: useBentoBox
wackerow Aug 31, 2024
6946817
feat: add screen util, BreakpointKey type
wackerow Sep 1, 2024
776db76
refactor: update useBentoBox organization
wackerow Sep 1, 2024
cc9306b
feat: implement PostsSwiper for desktop
wackerow Sep 1, 2024
d76f606
feat: create re-usable SlidingSwiper component
wackerow Sep 1, 2024
74146ab
style: rename and mv Swiper, mv useHome
wackerow Sep 2, 2024
233778f
refactor: use Slider component for sliders
wackerow Sep 2, 2024
c2769e6
deprecate: single-use swiper components
wackerow Sep 2, 2024
82b4999
theme: color and token adjustments
wackerow Sep 2, 2024
d77ac49
refactor: rm single-use bentobox and title,
wackerow Sep 2, 2024
0e137b9
refactor: BentoCard, ui/card
wackerow Sep 2, 2024
be6d996
style: move homepage related items to /Homepage
wackerow Sep 2, 2024
4da3525
theme: sync chakra primaryAction and solid Button
wackerow Sep 2, 2024
46537a5
fix: small patches and improvements
wackerow Sep 2, 2024
7b726b6
fix: bento box classes on homepage
wackerow Sep 2, 2024
df6f53e
fix: empty bento box on load
wackerow Sep 2, 2024
cb6f1ca
fix: hover and focus states for card `group/link`
wackerow Sep 2, 2024
281fda4
chore: patches
wackerow Sep 2, 2024
3962a0d
chore: adjust button container sizing
wackerow Sep 2, 2024
fa9f8b0
refactor: add variants to ui/section
wackerow Sep 2, 2024
8a1be75
feat: homepage sections to use ui/section
wackerow Sep 2, 2024
61aef20
Merge branch 'dev' into homepage
wackerow Sep 3, 2024
c117744
chore: adjustments, add todo
wackerow Sep 3, 2024
38acf90
refactor: MainArticle to tailwind
wackerow Sep 3, 2024
6d1dde6
add missing Suspense wrapper around lazy component
pettinarip Sep 4, 2024
38339fc
refactor: MainArticle for tailwind
wackerow Sep 3, 2024
f8828ba
Merge branch 'dev' into homepage
wackerow Sep 4, 2024
701648e
chore: apply review suggestions, resolve merge
wackerow Sep 4, 2024
f4c0ceb
feat: add ui/skeleton
wackerow Sep 4, 2024
f44c0a9
chore: adjust section scroll mt
wackerow Sep 4, 2024
25ccbe6
refactor: use ui/skeleton, and MainArticle
wackerow Sep 4, 2024
655433c
chore: adjust homepage layout spacing
wackerow Sep 4, 2024
5a624f5
feat: update Codeblock for tw, latest color theme
wackerow Sep 4, 2024
6d1f252
refactor: extract exported tailwind config
wackerow Sep 4, 2024
9671459
refactor: create tw rtl-reponsive next/prev icons
wackerow Sep 4, 2024
4a2fc64
fix: twFlipForRtl horizontal flip class
wackerow Sep 4, 2024
7b9b8b2
fix: use rtl responsive chevrons
wackerow Sep 4, 2024
2069fb8
fix: use rtl responsive text lignment
wackerow Sep 4, 2024
752a87f
Merge branch 'homepage' into homepage-codeblock
wackerow Sep 4, 2024
9e62895
refactor: use fetchGrowThePie for txCount
wackerow Sep 4, 2024
89654da
deprecate: unused data fetch utilities
wackerow Sep 4, 2024
c4da3b0
Merge branch 'homepage' of https://github.com/ethereum/ethereum-org-w…
nloureiro Sep 5, 2024
fc0c0ab
Merge branch 'dev' into homepage
wackerow Sep 5, 2024
2dec337
fix: remove createElements
wackerow Sep 5, 2024
6b1a628
feat: add support for atom feeds
wackerow Sep 5, 2024
52d08b1
feat: activate PSE and Josh Stark feeds
wackerow Sep 5, 2024
6e205c9
refactor: simplify types and getters
wackerow Sep 5, 2024
4d13857
Merge pull request #13806 from ethereum/homepage-atom-feed
pettinarip Sep 6, 2024
7cc5953
Merge pull request #13801 from ethereum/homepage-codeblock
pettinarip Sep 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"react-select": "5.8.0",
"reading-time": "^1.5.0",
"remark-gfm": "^3.0.1",
"swiper": "^11.1.10",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"usehooks-ts": "^3.1.0",
Expand All @@ -104,6 +105,8 @@
"@types/node": "^20.4.2",
"@types/react": "18.2.57",
"@types/react-dom": "18.2.19",
"@types/swiper": "^6.0.0",
"@types/xml2js": "^0.4.14",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"autoprefixer": "^10.4.19",
Expand Down Expand Up @@ -133,7 +136,8 @@
"tsconfig-paths-webpack-plugin": "4.1.0",
"typescript": "^5.5.2",
"unified": "^10.0.0",
"unist-util-visit": "^5.0.0"
"unist-util-visit": "^5.0.0",
"xml2js": "^0.6.2"
},
"resolutions": {
"jackspeak": "2.1.1",
Expand Down
10 changes: 10 additions & 0 deletions public/images/0xparc-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions public/images/attestant-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/events/event-placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/man-and-dog-playing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/man-baby-woman.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/panda-ops-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/robot-help-bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/solidity-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions public/images/vitalik-blog-banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/@chakra-ui/components/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ const baseStyle = defineStyle({
})

const variantSolid = defineStyle({
color: "background.base",
bg: "primary.base",
color: "white",
bg: "primary.action",
borderColor: "transparent",
_disabled: {
bg: "disabled",
color: "background.base",
},
_hover: {
color: "background.base",
bg: "primary.hover",
color: "white",
bg: "primary.actionHover",
boxShadow: "buttonHover",
},
_active: {
Expand Down
65 changes: 39 additions & 26 deletions src/@chakra-ui/foundations/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,54 @@ export type Colors = typeof colors

const colors = {
gray: {
100: "#F7F7F7",
150: "#F2F2F2",
200: "#E7E7E7",
300: "#C8C8C8",
50: "#f7f7f7",
100: "#eeeeee",
150: "#ececec",
200: "#cecece",
300: "#acacac",
400: "#8C8C8C",
500: "#616161",
600: "#333333",
700: "#222222",
800: "#1B1B1B",
900: "#141414",
800: "#1b1b1b",
900: "#121212",
950: "#0a0a0a",
},
blue: {
50: "#F6F6FF",
100: "#EBEBFF",
200: "#D6D6FF",
300: "#9999FF",
400: "#5555FF",
500: "#1C1CFF",
600: "#0000E0",
700: "#0000A3",
800: "#000066",
900: "#000029",
50: "#F8FBFF",
100: "#E8F1FF",
200: "#CADFFB",
300: "#88AAF1",
400: "#6995F7",
500: "#4473EF",
600: "#3C4CEB",
700: "#2B36A8",
800: "#232F71",
900: "#1B273A",
},
orange: {
50: "#FFF3ED",
100: "#FFE5D6",
200: "#FFCBAD",
300: "#FFB185",
400: "#FF985C",
500: "#FF7324",
550: "#DF5A0E",
600: "#B84300",
700: "#7A2D00",
800: "#521E00",
900: "#2F1000",
100: "#FFF0DB",
200: "#FFD7A7",
300: "#FEB077",
400: "#FD8640",
500: "#FB610E",
600: "#EC4A0A",
700: "#C4350A",
800: "#7D2711",
900: "#3A291D",
},
purple: {
50: "#F3ECFF",
100: "#EDE2FF",
200: "#DAC5FC",
300: "#CCAFFC",
400: "#B38DF0",
500: "#945AF4",
600: "#6C24DF",
700: "#561BB5",
800: "#41128B",
900: "#1E0546",
},
red: {
100: "#f7c8c8",
Expand Down
15 changes: 8 additions & 7 deletions src/@chakra-ui/semanticTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ const semanticTokens = {

// Main Set
primary: {
base: { _light: "blue.500", _dark: "orange.500" },
highContrast: { _light: "blue.800", _dark: "orange.100" },
lowContrast: { _light: "blue.100", _dark: "orange.800" },
hover: { _light: "blue.400", _dark: "orange.400" },
visited: { _light: "blue.700", _dark: "orange.550" },
base: { _light: "purple.600", _dark: "purple.400" },
highContrast: { _light: "purple.800", _dark: "purple.200" },
lowContrast: { _light: "purple.100", _dark: "purple.900" },
hover: { _light: "purple.500", _dark: "purple.500" },
visited: { _light: "purple.700", _dark: "purple.300" },
action: { _light: "purple.600", _dark: "purple.600" },
actionHover: { _light: "purple.500", _dark: "purple.500" },
// ! Deprecating primary.light
light: { _light: "blue.100", _dark: "orange.100" },
// ! Deprecating primary.dark
Expand All @@ -57,7 +59,7 @@ const semanticTokens = {
inverted: { _light: "gray.100", _dark: "gray.800" },
},
background: {
base: { _light: "white", _dark: "gray.800" },
base: { _light: "white", _dark: "gray.950" },
highlight: { _light: "gray.100", _dark: "gray.900" },
},
disabled: { _light: "gray.400", _dark: "gray.500" },
Expand Down Expand Up @@ -91,7 +93,6 @@ const semanticTokens = {
_light: "blackAlpha.400",
_dark: "whiteAlpha.400",
},
switchBackground: { _light: "gray.300", _dark: "whiteAlpha.400" },
hubHeroContentBg: {
_light: "rgba(255, 255, 255, 0.80)",
_dark: "rgba(34, 34, 34, 0.80)",
Expand Down
76 changes: 76 additions & 0 deletions src/components/BigNumber/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { type ReactNode } from "react"
import { useRouter } from "next/router"
import { useTranslation } from "next-i18next"
import { MdInfoOutline } from "react-icons/md"

import { cn } from "@/lib/utils/cn"
import { isValidDate } from "@/lib/utils/date"

import Tooltip from "../Tooltip"
import Link from "../ui/Link"

type BigNumberProps = {
children: ReactNode
value?: ReactNode
sourceName?: string
sourceUrl?: string
lastUpdated?: number | string
className?: string
}

const BigNumber = ({
children,
value,
sourceName,
sourceUrl,
lastUpdated,
className,
}: BigNumberProps) => {
const { t } = useTranslation("common")
const { locale } = useRouter()
const lastUpdatedDisplay =
lastUpdated && isValidDate(lastUpdated)
? new Intl.DateTimeFormat(locale, {
dateStyle: "medium",
}).format(new Date(lastUpdated))
: ""
return (
<div
className={cn(
"flex flex-1 shrink-0 flex-col self-stretch py-8",
className
)}
>
{value ? (
<>
<div className="text-5xl font-bold">{value}</div>
<div className="text-sm">
{children}
{sourceName && sourceUrl && (
<Tooltip
content={
<>
<p>
{t("data-provided-by")}{" "}
<Link href={sourceUrl}>{sourceName}</Link>
</p>
{lastUpdated && (
<p className="mt-2">
{t("last-updated")}: {lastUpdatedDisplay}
</p>
)}
</>
}
>
<MdInfoOutline className="mb-0.5 ms-2 inline align-text-bottom" />
</Tooltip>
)}
</div>
</>
) : (
<span className="text-3xl">{t("loading-error-refresh")}</span>
)}
</div>
)
}
export default BigNumber
73 changes: 73 additions & 0 deletions src/components/Buttons/SvgButtonLink.tsx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not blocking

IMO this component should not exist. Instead, we should use the ButtonTwoLines component or, add customization on top of it. Otherwise, we are fall into the same problem we had with creating new components for each specific implementation.

But....since the current ButtonTwoLines is not working really well after the migration and the api is not very flexible, I would lean towards leaving it. The ideal solution for me is to rebuild the ButtonTwoLines with a radix-type api:

<ButtonTwoLines variant="outline" asChild>
  <BaseLink ...>
    <ButtonTwoLines.Icon>
      <Svg />
    </ButtonTwoLines.Icon>

    <ButtonTwoLines.Content>
      ...
    </ButtonTwoLines.Content>
  </BaseLink>
</ButtonTwoLines>

Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { cva, VariantProps } from "class-variance-authority"
import type { FC, ReactNode, SVGProps } from "react"

import { cn } from "@/lib/utils/cn"

import { BaseLink } from "../ui/Link"

type SvgButtonLinkProps = {
Svg: FC<SVGProps<SVGElement>>
label?: string
children: ReactNode
href: string
className?: string
size?: number
}

const variants = cva("flex items-center gap-3.5", {
variants: {
variant: {
col: "flex-col text-center [&_.body]:text-center",
row: "flex-row text-start [&_.body]:text-start [&_.header]:self-start",
},
},
defaultVariants: {
variant: "row",
},
})

type Variants = VariantProps<typeof variants>

const SvgButtonLink = ({
label,
children,
Svg,
className,
variant,
...props
}: SvgButtonLinkProps & Variants) => (
<BaseLink
className={cn(
"group rounded-2xl no-underline focus:outline focus:outline-4 focus:outline-offset-8",
className
)}
hideArrow
{...props}
>
<div className={cn(variants({ variant }))}>
<div
className={cn(
"header",
"relative grid aspect-square size-[5em] shrink-0 place-items-center",
"rounded-2xl border shadow-svg-button-link transition-all duration-200",
"group-hover:shadow-svg-button-link-hover group-hover:transition-all group-hover:duration-200",
"group-focus:shadow-none group-focus:transition-all group-focus:duration-200"
)}
>
<Svg
className={cn(
"group-hover:rotate-3 group-hover:scale-110",
"group-focus:rotate-3 group-focus:scale-110",
"text-4xl duration-200 group-hover:duration-200 group-focus:rotate-3"
)}
/>
</div>
<div className="body">
{label && <p className="text-xl font-bold">{label}</p>}
{children}
</div>
</div>
</BaseLink>
)

export default SvgButtonLink
21 changes: 21 additions & 0 deletions src/components/Chevron/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { MdChevronLeft, MdChevronRight } from "react-icons/md"

import { cn } from "@/lib/utils/cn"

import { useRtlFlip } from "@/hooks/useRtlFlip"

export const ChevronNext = ({
className,
...props
}: React.HTMLAttributes<SVGElement>) => {
const { twFlipForRtl } = useRtlFlip()
return <MdChevronRight className={cn(className, twFlipForRtl)} {...props} />
}

export const ChevronPrev = ({
className,
...props
}: React.HTMLAttributes<SVGElement>) => {
const { twFlipForRtl } = useRtlFlip()
return <MdChevronLeft className={cn(className, twFlipForRtl)} {...props} />
}
Loading
Loading