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

Tailwind v4 #96

Merged
merged 127 commits into from
Feb 11, 2025
Merged
Changes from 1 commit
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
87bdaf0
Initial setup of Tailwind 3
corbanbrook Dec 22, 2024
5ac6d29
Import tailwind.css within the vanilla extract build for now
corbanbrook Dec 22, 2024
be9911e
Add color variants to tailwind.css
corbanbrook Dec 22, 2024
2992b68
Badge converted to tailwind
corbanbrook Dec 22, 2024
795e621
Modal converted to tailwind
corbanbrook Jan 5, 2025
89aa55b
Converting Progress to tailwind
corbanbrook Jan 6, 2025
b0c28cf
Tag converted to tailwind
corbanbrook Jan 6, 2025
ed989b3
Card converted to tailwind
corbanbrook Jan 6, 2025
d06206e
Toast converted to tailwind
corbanbrook Jan 6, 2025
4a0f777
Collapsible converted to tailwind
corbanbrook Jan 6, 2025
3128967
Spinner converted to tailwind
corbanbrook Jan 6, 2025
46ac413
Adding tailwind-merge
corbanbrook Jan 7, 2025
a081808
Adding shadcn cn util
corbanbrook Jan 7, 2025
5338bfd
Divider converted to tailwind
corbanbrook Jan 7, 2025
47d84a3
Breadcrumbs converted to tailwind
corbanbrook Jan 7, 2025
92b335f
Removing Box component from DropdownMenu
corbanbrook Jan 7, 2025
9ea078c
Image converted to tailwind
corbanbrook Jan 7, 2025
b99fa15
NetworkImage converted to tailwind
corbanbrook Jan 7, 2025
e7a11f0
TokenImage added to tailwind
corbanbrook Jan 7, 2025
84245b5
DropdownMenu converted to tailwind
corbanbrook Jan 9, 2025
e5a356d
Adjusting icon generation to use tailwind
corbanbrook Jan 9, 2025
d9303ed
Skeleton converted to tailwind
corbanbrook Jan 9, 2025
cc79e24
Scroll converted to tailwind
corbanbrook Jan 9, 2025
f25e11d
Modal and Card fixes
corbanbrook Jan 10, 2025
041e3b5
Tabs converted to tailwind
corbanbrook Jan 10, 2025
287d4e5
Tooltip converted to tailwind
corbanbrook Jan 10, 2025
8d8ad35
GradientAvatar converted to tailwind
corbanbrook Jan 10, 2025
5dace36
TabbedNav converted to tailwind
corbanbrook Jan 11, 2025
e11bd34
Checkbox converted to tailwind
corbanbrook Jan 13, 2025
0f63838
Switch converted to tailwind
corbanbrook Jan 13, 2025
312d6cc
Select converted to tailwind
corbanbrook Jan 14, 2025
a801dc6
TextInput converted to tailwind
corbanbrook Jan 14, 2025
c942d06
Fixing focus ring
corbanbrook Jan 14, 2025
e1ead26
Fixing focus ring on Select and Switch
corbanbrook Jan 14, 2025
621dbd3
RadioGroup and RadioOption converted to tailwidn
corbanbrook Jan 14, 2025
ff27400
TextArea converted to tailwind
corbanbrook Jan 14, 2025
3689347
PINCodeInput converted to tailwind
corbanbrook Jan 14, 2025
d0339da
SearchInput converted to tailwind
corbanbrook Jan 14, 2025
be69017
NumericInput converted to tailwind
corbanbrook Jan 15, 2025
c7d1d0f
FileInput converted to tailwind
corbanbrook Jan 16, 2025
0c86b26
Export digitText styles
corbanbrook Jan 16, 2025
0e629b5
Removing Box components from stories
corbanbrook Jan 16, 2025
ec4b56e
Field converted to tailwind
corbanbrook Jan 16, 2025
945c5a7
Text converted to tailwind
corbanbrook Jan 16, 2025
b53a53f
Button converted to tailwind
corbanbrook Jan 17, 2025
4272e30
Remove vanilla-extract styles.css.ts
corbanbrook Jan 17, 2025
827516e
Removing Box from GradientAvatar
corbanbrook Jan 17, 2025
c343965
Box removed from StopClickPropagation
corbanbrook Jan 17, 2025
7722dd7
Box removed from ControlledFileInput
corbanbrook Jan 17, 2025
14098f8
Remove Box component
corbanbrook Jan 17, 2025
2a27315
Removing vanilla-extract
corbanbrook Jan 17, 2025
dfdab6e
Fixing Button focus ring color
corbanbrook Jan 17, 2025
53116d1
Adding setThemeVars function to set theme overrides on ThemeProvider …
corbanbrook Jan 17, 2025
70bafa5
Ensuring all color vars are correct
corbanbrook Jan 17, 2025
8c7dfd2
Export tailwind preset and styles
corbanbrook Jan 17, 2025
ea90b8b
Import tailwind.css from storybook preview
corbanbrook Jan 17, 2025
141466b
Fixing Button feature variant
corbanbrook Jan 17, 2025
2ef0d28
tailwind config references its own components when included as a pres…
corbanbrook Jan 17, 2025
bfb6912
Updating dev deps
corbanbrook Jan 21, 2025
94a9190
Upadting eslint with new flat config
corbanbrook Jan 21, 2025
295e655
Updating typescript
corbanbrook Jan 21, 2025
2b52c9c
Updating dev deps
corbanbrook Jan 21, 2025
942a847
Updating radix deps
corbanbrook Jan 21, 2025
33e4772
Updating radix deps
corbanbrook Jan 22, 2025
6d1c2bd
Updating react-hook-form dep
corbanbrook Jan 22, 2025
fdeef0d
Updating happy-dom
corbanbrook Jan 22, 2025
9c58a47
Migrating Storybook from v7->v8
corbanbrook Jan 23, 2025
3e9aa53
Updating icons template so that they can merge classNames properly
corbanbrook Jan 23, 2025
883ed52
Migrating tailwindcss v3 -> v4
corbanbrook Jan 23, 2025
961aa01
Fixing autodoc styling
corbanbrook Jan 23, 2025
da4a2c2
Migrate to tailwind4 classes
corbanbrook Jan 24, 2025
6c9ce8b
Adding a jscodeshift transform to help convert design-system v1 proje…
corbanbrook Jan 27, 2025
6bdd9cc
codemod improvements
corbanbrook Jan 27, 2025
8c5270d
Adding atom helpers to convert from atom props to tailwind classes
corbanbrook Jan 27, 2025
9081685
Transform atom props to tailwind classnames
corbanbrook Jan 27, 2025
e26734b
Properly handle Text components and only convert atomic props
corbanbrook Jan 27, 2025
511525d
Adding transformAtomsFn
corbanbrook Jan 28, 2025
283b692
Adding className to Progress
corbanbrook Jan 29, 2025
bdd3ffe
Fixing nowrap variant on Text
corbanbrook Jan 30, 2025
089bf5f
Adding optional children prop to IconButton
corbanbrook Jan 30, 2025
77a4c23
Updating Text colors to primary, secondary, and muted
corbanbrook Jan 30, 2025
cd9ea58
Updating text color values to match new names
corbanbrook Jan 30, 2025
b76f742
Fixing tailwind text color config
corbanbrook Jan 30, 2025
e284047
More color naming fixes
corbanbrook Jan 30, 2025
adc78a3
Removing base colors which are already included in tailwind
corbanbrook Jan 30, 2025
f6eb130
ThemeProvider injects the theme vars onto rootEl
corbanbrook Jan 30, 2025
2a5efeb
Renaming color vars from --seq-colors to --seq-color
corbanbrook Jan 30, 2025
8143e82
Removing unused tokens
corbanbrook Jan 30, 2025
3b08276
Using text variants for Badge
corbanbrook Jan 30, 2025
77b7676
Renaming the storybook css file so it is not confused with the main c…
corbanbrook Jan 30, 2025
74f83ff
Fixing backdropFilter atom helper to correct backdrop-blur-md class
corbanbrook Jan 30, 2025
3875300
Removing unused tokens
corbanbrook Jan 30, 2025
70f3efd
Updating deps
corbanbrook Jan 30, 2025
3dbff41
Updating storybook
corbanbrook Jan 30, 2025
83d0764
Updating tailwind css config
corbanbrook Jan 30, 2025
56c5333
Adding @source to tailwind.css config
corbanbrook Jan 31, 2025
dce7102
Updating tailwindcss to v4.0.2
corbanbrook Jan 31, 2025
1a01607
Removing borderRadius variants for inputs
corbanbrook Feb 4, 2025
ea55462
Fixing ghost and text button variants
corbanbrook Feb 4, 2025
c2beec0
Collapsible should have the same rounding as a Card
corbanbrook Feb 4, 2025
34fdbf9
Adding block variant to Text
corbanbrook Feb 4, 2025
2569bef
Clean up Breadcrumbs rendering
corbanbrook Feb 4, 2025
7fd13a1
Removing breakpoints as we use tailwind defaults fixing useMediaQuery
corbanbrook Feb 4, 2025
8b68754
Upgrading framer-motion to motion
corbanbrook Feb 5, 2025
74ae12c
Migrating components from framer-motion to motion/react
corbanbrook Feb 5, 2025
f315338
Updating tailwindcss to v4.0.3
corbanbrook Feb 5, 2025
3c504b7
Updating deps
corbanbrook Feb 5, 2025
081b054
Fix external peerDependencies for motion/react
corbanbrook Feb 5, 2025
b567cb4
Fixes required for react 19
corbanbrook Feb 5, 2025
fdfde27
Upgrading to react19
corbanbrook Feb 5, 2025
a8823ba
Replacing ethers for ox in GradientAvatar story
corbanbrook Feb 5, 2025
4eb1236
Revert "Upgrading to react19"
corbanbrook Feb 5, 2025
73b9aa0
Updating pnpm-lock
corbanbrook Feb 5, 2025
583ce85
Ensure Modal always has translateZ(0) set to create a fixed container…
corbanbrook Feb 6, 2025
77c6fe6
Adding header and footer props to Modal
corbanbrook Feb 6, 2025
d3b9dc1
Updating deps
corbanbrook Feb 6, 2025
835b087
Renaming css file
corbanbrook Feb 6, 2025
5f7e591
Renaming exports to us js and cjs file extensions
corbanbrook Feb 6, 2025
ff3558d
Fix Modal positioning
corbanbrook Feb 7, 2025
5eade00
Adding tsup config
corbanbrook Feb 7, 2025
4a480aa
Remove build config from vite as we use tsup now
corbanbrook Feb 7, 2025
b1b7351
Removing build:vite script from package.json as we use tsup now
corbanbrook Feb 7, 2025
4ef122c
Modal stories do not open immediately
corbanbrook Feb 7, 2025
e05fc29
Fixing Modal Header Spacer logic
corbanbrook Feb 7, 2025
3a406cc
Export css preset
corbanbrook Feb 7, 2025
0b0d473
Updating motion dev dep
corbanbrook Feb 7, 2025
838947f
Describing tailwind and design system preset installation
corbanbrook Feb 10, 2025
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
Prev Previous commit
Next Next commit
NetworkImage converted to tailwind
corbanbrook committed Jan 9, 2025
commit b99fa15119c9069d6a9fce8ca1603323acba5a77
64 changes: 46 additions & 18 deletions src/components/NetworkImage/NetworkImage.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,74 @@
import { clsx } from 'clsx'
import { cva, VariantProps } from 'class-variance-authority'
import { memo } from 'react'

import { cn } from '~/utils'
import { replaceSize, networkImageUrl } from '~/utils/assets'

import { Box, BoxProps } from '../Box'
import { Image } from '../Image'

import * as styles from './styles.css'

type NetworkImageProps = BoxProps &
styles.RootVariants & {
chainId: number
src?: string
disableAnimation?: boolean
const networkImageVariants = cva(
[
'flex',
'items-center',
'justify-center',
'overflow-hidden',
'flex-shrink-0',
],
{
variants: {
size: {
xs: 'w-3 h-3',
sm: 'w-5 h-5',
md: 'w-8 h-8',
lg: 'w-10 h-10',
xl: 'w-16 h-16',
},
borderRadius: {
circle: 'rounded-full',
lg: 'rounded-lg',
md: 'rounded-md',
sm: 'rounded-sm',
},
},
defaultVariants: {
borderRadius: 'circle',
},
}
)

interface NetworkImageProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof networkImageVariants> {
chainId: number
src?: string
disableAnimation?: boolean
}

export const NetworkImage = memo((props: NetworkImageProps) => {
const {
chainId,
borderRadius = 'circle',
borderRadius,
className,
disableAnimation = false,
style,
src,
size = 'md',
...boxProps
...rest
} = props

const logoURI = src || replaceSize(networkImageUrl(chainId), size)
const logoURI = src || replaceSize(networkImageUrl(chainId), size!)

return (
<Box
className={clsx(className, styles.root({ borderRadius, size }))}
<div
className={cn(networkImageVariants({ size, borderRadius }), className)}
style={style}
flexShrink="0"
{...boxProps}
{...rest}
>
<Image
className={styles.img}
className="max-w-full max-h-full object-cover w-full"
disableAnimation={disableAnimation}
src={logoURI}
/>
</Box>
</div>
)
})