Skip to content

Commit 8f29350

Browse files
committed
Merge branch 'dev' into refactor/md-components-to-shadcn
2 parents 50a336a + edd1283 commit 8f29350

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1211
-1274
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
"remark-gfm": "^3.0.1",
8585
"swiper": "^11.1.10",
8686
"tailwind-merge": "^2.3.0",
87+
"tailwind-variants": "^0.2.1",
8788
"tailwindcss-animate": "^1.0.7",
8889
"usehooks-ts": "^3.1.0",
8990
"yaml-loader": "^0.8.0"

src/@chakra-ui/components/Button.ts

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,40 @@ import { defineStyle, defineStyleConfig } from "@chakra-ui/react"
1111
const ICON_SELECTOR = "& svg"
1212

1313
const baseStyle = defineStyle({
14+
// Sizing and positioning classes:
1415
borderRadius: "base",
1516
border: "1px",
16-
color: "primary.base",
1717
fontWeight: "normal",
1818
lineHeight: "1.6",
1919
transitionProperty: "common",
2020
transitionDuration: "normal",
2121
whiteSpace: "normal",
2222
p: "unset",
23+
// Base default styling is "outline" pattern, primary color for text, border matches, no bg
24+
borderColor: "currentColor",
25+
color: "primary.base",
26+
// Hover: Default hover adds box-shadow, text (border) to --primary-hover
27+
_hover: {
28+
color: "primary.hover",
29+
boxShadow: "buttonHover",
30+
},
31+
// Focus: Add 4px outline to all buttons, --primary-hover
2332
_focusVisible: {
2433
outline: "4px solid",
2534
outlineColor: "primary.hover",
2635
outlineOffset: -1,
2736
},
37+
// Active: text (border) to --primary-hover instead of primary, hide shadow
38+
_active: {
39+
color: "primary.hover",
40+
boxShadow: "none",
41+
},
42+
// Disabled: Pointer events none, text (border) to --disabled
2843
_disabled: {
2944
color: "disabled",
3045
pointerEvents: "none",
3146
},
32-
_hover: {
33-
color: "primary.hover",
34-
},
47+
// isSecondary: Switch text (border) to --body instead of --primary
3548
"&[data-secondary='true']": {
3649
color: "body.base",
3750
},
@@ -41,42 +54,39 @@ const baseStyle = defineStyle({
4154
textDecoration: "none",
4255
},
4356
},
57+
[ICON_SELECTOR]: {
58+
flexShrink: 0,
59+
},
4460
})
4561

4662
const variantSolid = defineStyle({
4763
color: "white",
4864
bg: "primary.action",
49-
borderColor: "transparent",
50-
_disabled: {
51-
bg: "disabled",
52-
color: "background.base",
53-
},
65+
borderColor: "transparent !important",
5466
_hover: {
55-
color: "white",
67+
color: "white !important",
5668
bg: "primary.actionHover",
57-
boxShadow: "buttonHover",
5869
},
5970
_active: {
60-
boxShadow: "none",
61-
},
62-
})
63-
64-
const variantOutline = defineStyle({
65-
_hover: {
66-
boxShadow: "buttonHover",
71+
bg: "primary.actionHover",
6772
},
68-
_active: {
69-
boxShadow: "none",
73+
_disabled: {
74+
bg: "disabled",
75+
color: "background.base",
7076
},
7177
})
7278

79+
const variantOutline = defineStyle({}) // "outline" is base styling above
80+
7381
const variantGhost = {
7482
borderColor: "transparent",
83+
_hover: { shadow: "none" },
7584
}
7685

7786
const variantLink = defineStyle({
7887
borderColor: "transparent",
79-
fontWeight: 700,
88+
// fontWeight: 700, // TODO: Not in DS; confirm then remove
89+
_hover: { shadow: "none" },
8090
textDecor: "underline",
8191
py: 0,
8292
px: 1,

src/@chakra-ui/components/ReactSelect.ts

Lines changed: 0 additions & 135 deletions
This file was deleted.

src/@chakra-ui/components/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { Modal } from "./Modal"
2222
import { Popover } from "./Popover"
2323
import { Progress } from "./Progress"
2424
import { Radio } from "./Radio"
25-
import { ReactSelect } from "./ReactSelect"
2625
import { Switch } from "./Switch"
2726
import { Table } from "./Table"
2827
import { Tabs } from "./Tabs"
@@ -52,7 +51,6 @@ export default {
5251
Popover,
5352
Progress,
5453
Radio,
55-
ReactSelect,
5654
Spinner: spinnerDefaultTheme,
5755
Switch,
5856
Table,

src/@chakra-ui/foundations/shadows.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ const shadows = {
2020
gridBlueBowShadow: "8px 8px 0px 0px var(--eth-colors-gridBlue)",
2121

2222
// * Part of new DS
23-
// TODO: From current theme. Deprecate for 'buttonHover'
24-
primary: "4px 4px 0px 0px var(--eth-colors-primary-light)",
23+
// TODO: Deprecate buttonHover when all buttons migrated to tailwind
2524
buttonHover: "4px 4px 0 0 var(--eth-colors-primary-lowContrast)",
2625
tooltip: "0 0 16px var(--eth-colors-tooltipShadow)",
2726
}

src/@chakra-ui/semanticTokens.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const semanticTokens = {
4040
base: { _light: "purple.600", _dark: "purple.400" },
4141
highContrast: { _light: "purple.800", _dark: "purple.200" },
4242
lowContrast: { _light: "purple.100", _dark: "purple.900" },
43-
hover: { _light: "purple.500", _dark: "purple.500" },
43+
hover: { _light: "purple.500", _dark: "purple.300" },
4444
visited: { _light: "purple.700", _dark: "purple.300" },
4545
action: { _light: "purple.600", _dark: "purple.600" },
4646
actionHover: { _light: "purple.500", _dark: "purple.500" },
@@ -55,11 +55,9 @@ const semanticTokens = {
5555
base: { _light: "gray.800", _dark: "gray.100" },
5656
medium: { _light: "gray.500", _dark: "gray.400" },
5757
light: { _light: "gray.200", _dark: "gray.600" },
58-
// ! Deprecating body.inverted
59-
inverted: { _light: "gray.100", _dark: "gray.800" },
6058
},
6159
background: {
62-
base: { _light: "white", _dark: "gray.950" },
60+
base: { _light: "white", _dark: "black" },
6361
highlight: { _light: "gray.100", _dark: "gray.900" },
6462
},
6563
disabled: { _light: "gray.400", _dark: "gray.500" },

src/@chakra-ui/stories/Colors.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export const SemanticScheme: StoryObj = {
113113
] as const
114114
const deprecatedTokens: Record<(typeof tokenNames)[number], string[]> = {
115115
primary: ["light", "dark", "pressed"],
116-
body: ["inverted"],
116+
body: [],
117117
background: [],
118118
disabled: [],
119119
success: ["neutral", "outline"],

src/components/Banners/BannerNotification.tsx

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,26 @@
1-
import React from "react"
2-
import { Center, FlexProps, useMediaQuery } from "@chakra-ui/react"
1+
import { cn } from "@/lib/utils/cn"
32

4-
import { lightTheme as oldTheme } from "../../theme"
5-
6-
export type BannerNotificationProps = FlexProps & {
3+
export type BannerNotificationProps = React.HTMLAttributes<HTMLDivElement> & {
74
shouldShow?: boolean
85
}
96

107
const BannerNotification = ({
118
children,
12-
shouldShow = false,
9+
shouldShow,
10+
className,
1311
...props
1412
}: BannerNotificationProps) => {
15-
const [isLGScreen] = useMediaQuery(`min-width: ${oldTheme.breakpoints.l}`)
13+
if (!shouldShow) return <></>
1614
return (
17-
<>
18-
{shouldShow && (
19-
<Center
20-
as="aside"
21-
maxW={isLGScreen ? oldTheme.variables.maxPageWidth : "100%"}
22-
w="100%"
23-
py="4"
24-
px="8"
25-
bg="primary.base"
26-
color="background.base"
27-
sx={{
28-
a: {
29-
color: "background.base",
30-
},
31-
}}
32-
{...props}
33-
>
34-
{children}
35-
</Center>
15+
<aside
16+
className={cn(
17+
"flex items-center justify-center gap-2 bg-primary-action px-8 py-4 text-white [&_a]:text-white [&_a]:hover:text-white/80",
18+
className
3619
)}
37-
</>
20+
{...props}
21+
>
22+
{children}
23+
</aside>
3824
)
3925
}
4026

0 commit comments

Comments
 (0)