Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Commit 544a279

Browse files
committed
chore: update chakra ui
1 parent 4cd9671 commit 544a279

File tree

5 files changed

+708
-323
lines changed

5 files changed

+708
-323
lines changed

Diff for: contentlayer.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ const Changelog = defineDocumentType(() => ({
126126
fields: {
127127
title: { type: 'string', required: true },
128128
description: { type: 'string', required: true },
129+
slug: { type: 'string' },
129130
},
130131
computedFields: {
131132
frontMatter: {

Diff for: next-env.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/// <reference types="next" />
2-
/// <reference types="next/types/global" />
32
/// <reference types="next/image-types/global" />
43

54
// NOTE: This file should not be edited

Diff for: package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@
2323
"@chakra-ui/cli": "1.6.0",
2424
"@chakra-ui/icons": "^1.1.1",
2525
"@chakra-ui/props-docs": "1.0.40",
26-
"@chakra-ui/react": "1.7.2",
26+
"@chakra-ui/react": "1.7.3",
2727
"@chakra-ui/skip-nav": "^1.2.1",
2828
"@chakra-ui/theme-tools": "1.3.1",
2929
"@chakra-ui/utils": "1.9.1",
3030
"@docsearch/react": "^1.0.0-alpha.27",
3131
"@docusaurus/utils": "^2.0.0-alpha.69",
32-
"@emotion/react": "^11.6.0",
32+
"@emotion/react": "^11.7.0",
3333
"@emotion/styled": "^11.6.0",
3434
"@octokit/rest": "^18.12.0",
35-
"contentlayer": "^0.0.32",
35+
"contentlayer": "^0.0.33",
3636
"date-fns": "^2.25.0",
3737
"docsearch.js": "^2.6.3",
3838
"focus-visible": "5.2.0",
@@ -44,11 +44,11 @@
4444
"markdown-toc": "^1.2.0",
4545
"match-sorter": "^6.3.1",
4646
"mdx-bundler": "^7.0.0",
47-
"next": "^12.0.4",
48-
"next-contentlayer": "^0.0.32",
47+
"next": "^12.0.7",
48+
"next-contentlayer": "^0.0.33",
4949
"next-seo": "^4.28.1",
5050
"octokit": "^1.7.1",
51-
"prism-react-renderer": "^1.1.1",
51+
"prism-react-renderer": "^1.2.1",
5252
"puppeteer": "^11.0.0",
5353
"react": "^17.0.2",
5454
"react-dom": "^17.0.2",
@@ -60,7 +60,7 @@
6060
"react-responsive-masonry": "^2.1.4",
6161
"react-spinners": "^0.11.0",
6262
"react-table": "^7.7.0",
63-
"remark": "^14.0.1",
63+
"remark": "^14.0.2",
6464
"remark-emoji": "^3.0.2",
6565
"remark-gfm": "^3.0.1",
6666
"remark-slug": "^7.0.1",
@@ -72,9 +72,9 @@
7272
},
7373
"devDependencies": {
7474
"@types/github-slugger": "^1.3.0",
75-
"@types/node": "^16.11.7",
75+
"@types/node": "^16.11.12",
7676
"@types/puppeteer": "^5.4.4",
77-
"@types/react": "^17.0.35",
77+
"@types/react": "^17.0.37",
7878
"@types/react-dom": "^17.0.11",
7979
"@types/sharp": "^0.29.4",
8080
"babel-plugin-superjson-next": "^0.4.2",

Diff for: pages/changelog/content.mdx

+163-30
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Changelog
33
description: The changelog for Chakra UI React
4+
slug: "/changelog"
45
---
56

67
The Changelog gives an overview of the meaningful changes we've made to Chakra
@@ -14,6 +15,138 @@ To better understand the changelog, here are some legends we use:
1415
- 🐛 Bug fix
1516
- 🛠 Refactor
1617

18+
19+
20+
## 09-12-2021
21+
22+
`@chakra-ui/[email protected]`
23+
24+
- Update storybook url configuration for `@chakra-ui/react` to
25+
[https://storybook.chakra-ui.com](https://storybook.chakra-ui.com)
26+
27+
**Layout** `v1.6.0`
28+
29+
- Add support for style props `gap`, `columnGap` and `rowGap`. Those CSS
30+
properties are valid in a grid or flex context
31+
32+
> For further information see
33+
> [MDN Docs](https://developer.mozilla.org/en-US/docs/Web/CSS/gap)
34+
35+
- Fix TS issue with Grid component due to the native `gap`, `rowGap` and
36+
`columnGap` we added to styled system.
37+
38+
**Styled System** `v1.15.0`
39+
40+
- Add support for style props `gap`, `columnGap` and `rowGap`. Those CSS
41+
properties are valid in a grid or flex context
42+
43+
> For further information see
44+
> [MDN Docs](https://developer.mozilla.org/en-US/docs/Web/CSS/gap)
45+
46+
- Fix issue where `bgGradient` parser doesn't work when a position is specified
47+
- Fix issue where tokens autocomplete don't show up anymore except user runs the
48+
cli command.
49+
- Fixed issue where multi-value `inset` property doesn't work.
50+
51+
**Menu** `v1.8.2`
52+
53+
- Fix issue where `enabled` TS type was exposed to popover and menu from
54+
`UsePopperProps`. This was resolved by omitting `enabled` from the type
55+
56+
**Popover** `v1.11.0`
57+
58+
- Fix issue where `enabled` TS type was exposed to popover and menu from
59+
`UsePopperProps`. This was resolved by omitting `enabled` from the type
60+
- Fix issue where `Popover` will be `display:none` when inner element focused.
61+
- Add `PopoverAnchor` component which allows you to set the `Popover` reference
62+
point without acting as a trigger.
63+
64+
```jsx live=false
65+
<Popover>
66+
{/* triggers the popover to open/close */}
67+
<PopoverTrigger>
68+
<button>Trigger</button>
69+
</PopoverTrigger>
70+
{/* popover will be positioned relative to this */}
71+
<PopoverAnchor>
72+
<Box width="40px" height="40px" />
73+
</PopoverAnchor>
74+
<PopoverContent>Hello World</PopoverContent>
75+
</Popover>
76+
```
77+
78+
**Input** `v1.3.2`
79+
80+
- Fixed an issue where `InputGroup` passes undefined `size` and `variant` props
81+
which overrides the ones defined by default in a custom `Input` component.
82+
83+
**System** `v1.8.3`
84+
85+
- Allow retrieving breakpoint tokens when using useToken
86+
87+
**Theme** `v1.12.2`
88+
89+
- Fix issue where tokens autocomplete don't show up anymore except user runs the
90+
cli command.
91+
92+
**Toast** `v1.5.0`
93+
94+
- The `toast` function now exposes a `containerStyle` property you can use to
95+
override the default styles for the toast container.
96+
97+
```jsx live=false
98+
function Example() {
99+
// Via instantiation
100+
const toast = useToast({
101+
position: "top",
102+
title: "Container style is customizable",
103+
containerStyle: {
104+
maxWidth: "100%",
105+
},
106+
})
107+
108+
// Or via trigger
109+
return (
110+
<Button
111+
onClick={() => {
112+
toast({
113+
containerStyle: {
114+
maxWidth: "100%",
115+
},
116+
})
117+
}}
118+
>
119+
Click me to show toast with custom container style.
120+
</Button>
121+
)
122+
}
123+
```
124+
125+
- Fix TS issue with toast placement utility
126+
127+
**Tooltip** `v1.4.2`
128+
129+
- Prevent `onKeyDown` callback from de/registering on every call of `useTooltip`
130+
131+
**Media Query** `v1.2.2`
132+
133+
- Improved performance and behavior of `useMediaQuery` hook.
134+
135+
**Transition** `v1.4.2`
136+
137+
- Fixed issue where the `ref` of `Slider` returns `null` due to prop override
138+
139+
**Icon** `v2.0.0`
140+
141+
- Auto assign `key` when passing array of paths to `createIcon`
142+
143+
```jsx live=false
144+
const HeartIcon = createIcon({
145+
displayName: "HeartIcon",
146+
path: [<path stroke="none" d="..." fill="none" />, <path d="..." />],
147+
})
148+
```
149+
17150
## 17-11-2021
18151

19152
**Props Docs** `v1.0.40`
@@ -76,10 +209,10 @@ Here's how to resolve it:
76209

77210
```jsx live=false
78211
// Won't work 🎇
79-
import { useOutsideClick } from '@chakra-ui/hooks/dist/use-outside-click'
212+
import { useOutsideClick } from "@chakra-ui/hooks/dist/use-outside-click"
80213

81214
// Works ✅
82-
import { useOutsideClick } from '@chakra-ui/hooks'
215+
import { useOutsideClick } from "@chakra-ui/hooks"
83216
```
84217

85218
If this affected your project, we recommend that you import hooks, functions or
@@ -489,10 +622,10 @@ theme but we promise to revisit the typings and API very soon.
489622
Creating a CSS variable in the theme
490623

491624
```jsx live=false
492-
import { cssVar, calc } from '@chakra-ui/theme-tools'
625+
import { cssVar, calc } from "@chakra-ui/theme-tools"
493626

494-
const $width = cssVar('slider-width')
495-
const $height = cssVar('slider-height')
627+
const $width = cssVar("slider-width")
628+
const $height = cssVar("slider-height")
496629

497630
const $diff = calc($width).subtract($height).toString()
498631

@@ -562,7 +695,7 @@ type-safe, multipart component styles.
562695
root FormControl element to be themed.
563696

564697
```jsx live=false
565-
import { extendTheme } from '@chakra-ui/react'
698+
import { extendTheme } from "@chakra-ui/react"
566699

567700
export const theme = extendTheme({
568701
components: {
@@ -572,8 +705,8 @@ export const theme = extendTheme({
572705
custom: {
573706
// style the root `FormControl` element
574707
container: {
575-
color: 'white',
576-
bg: 'blue.900',
708+
color: "white",
709+
bg: "blue.900",
577710
},
578711
},
579712
},
@@ -755,7 +888,7 @@ export or an export named `theme`.
755888

756889
```jsx live=false
757890
// chakra-theme-package/src/index.js
758-
import { extendTheme } from '@chakra-ui/react'
891+
import { extendTheme } from "@chakra-ui/react"
759892

760893
const theme = extendTheme({})
761894

@@ -887,7 +1020,7 @@ To use this API, you'll need to set `transform` to `auto` or `auto-gpu` (for the
8871020
GPU accelerated version).
8881021

8891022
```jsx live=false
890-
<Circle transform='auto' translateX='4' _hover={{ translateX: '8' }}>
1023+
<Circle transform="auto" translateX="4" _hover={{ translateX: "8" }}>
8911024
<CheckIcon />
8921025
</Circle>
8931026
```
@@ -1100,35 +1233,35 @@ import {
11001233
withDefaultSize,
11011234
withDefaultVariant,
11021235
withDefaultProps,
1103-
} from '@chakra-ui/react'
1236+
} from "@chakra-ui/react"
11041237

11051238
const customTheme = extendTheme(
11061239
{
11071240
colors: {
11081241
brand: {
11091242
// ...
1110-
500: '#b4d455',
1243+
500: "#b4d455",
11111244
// ...
11121245
},
11131246
},
11141247
},
1115-
withDefaultColorScheme({ colorScheme: 'brand' }),
1248+
withDefaultColorScheme({ colorScheme: "brand" }),
11161249
withDefaultSize({
1117-
size: 'lg',
1118-
components: ['Input', 'NumberInput', 'PinInput'],
1250+
size: "lg",
1251+
components: ["Input", "NumberInput", "PinInput"],
11191252
}),
11201253
withDefaultVariant({
1121-
variant: 'outline',
1122-
components: ['Input', 'NumberInput', 'PinInput'],
1254+
variant: "outline",
1255+
components: ["Input", "NumberInput", "PinInput"],
11231256
}),
11241257
// or all in one:
11251258
withDefaultProps({
11261259
defaultProps: {
1127-
colorScheme: 'brand',
1128-
variant: 'outline',
1129-
size: 'lg',
1260+
colorScheme: "brand",
1261+
variant: "outline",
1262+
size: "lg",
11301263
},
1131-
components: ['Input', 'NumberInput', 'PinInput'],
1264+
components: ["Input", "NumberInput", "PinInput"],
11321265
}),
11331266
// optional:
11341267
yourCustomBaseTheme, // defaults to our chakra default theme
@@ -1175,7 +1308,7 @@ const customTheme = extendTheme(
11751308
or `end`.
11761309

11771310
```jsx live=false
1178-
<Button isLoading spinnerPlacement='end'>
1311+
<Button isLoading spinnerPlacement="end">
11791312
Click me
11801313
</Button>
11811314
```
@@ -1437,7 +1570,7 @@ Popover
14371570
- 🐛 Use `--popover-bg` css property to control popover and arrow background.
14381571

14391572
```jsx live=false
1440-
<PopoverContent style={{ '--popover-bg': 'purple' }}>
1573+
<PopoverContent style={{ "--popover-bg": "purple" }}>
14411574
<PopoverArrow />
14421575
</PopoverContent>
14431576
```
@@ -1557,9 +1690,9 @@ Table
15571690
```jsx live=false
15581691
<Box
15591692
sx={{
1560-
'--banner-color': 'colors.red.200',
1561-
'& .banner': {
1562-
bg: 'var(--banner-color)',
1693+
"--banner-color": "colors.red.200",
1694+
"& .banner": {
1695+
bg: "var(--banner-color)",
15631696
},
15641697
}}
15651698
/>
@@ -1777,7 +1910,7 @@ Table
17771910
`extendTheme` function even further.
17781911

17791912
```jsx live=false
1780-
import { extendTheme } from '@chakra-ui/react'
1913+
import { extendTheme } from "@chakra-ui/react"
17811914

17821915
export const customTheme = extendTheme({
17831916
// here you get autocomplete for
@@ -1819,13 +1952,13 @@ You can get typesafe access to your custom theme like this:
18191952
const theme = {
18201953
textStyles: {
18211954
caps: {
1822-
fontWeight: 'bold',
1823-
fontSize: '24px',
1955+
fontWeight: "bold",
1956+
fontSize: "24px",
18241957
},
18251958
},
18261959
}
18271960

1828-
const styles = css({ textStyle: 'caps' })(theme)
1961+
const styles = css({ textStyle: "caps" })(theme)
18291962
```
18301963

18311964
This also works for the component theme as well.

0 commit comments

Comments
 (0)