1
1
---
2
2
title : Changelog
3
3
description : The changelog for Chakra UI React
4
+ slug : " /changelog"
4
5
---
5
6
6
7
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:
14
15
- 🐛 Bug fix
15
16
- 🛠 Refactor
16
17
18
+
19
+
20
+ ## 09-12-2021
21
+
22
+
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
+
17
150
## 17-11-2021
18
151
19
152
** Props Docs** ` v1.0.40 `
@@ -76,10 +209,10 @@ Here's how to resolve it:
76
209
77
210
``` jsx live=false
78
211
// 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"
80
213
81
214
// Works ✅
82
- import { useOutsideClick } from ' @chakra-ui/hooks'
215
+ import { useOutsideClick } from " @chakra-ui/hooks"
83
216
```
84
217
85
218
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.
489
622
Creating a CSS variable in the theme
490
623
491
624
``` jsx live=false
492
- import { cssVar , calc } from ' @chakra-ui/theme-tools'
625
+ import { cssVar , calc } from " @chakra-ui/theme-tools"
493
626
494
- const $width = cssVar (' slider-width' )
495
- const $height = cssVar (' slider-height' )
627
+ const $width = cssVar (" slider-width" )
628
+ const $height = cssVar (" slider-height" )
496
629
497
630
const $diff = calc ($width).subtract ($height).toString ()
498
631
@@ -562,7 +695,7 @@ type-safe, multipart component styles.
562
695
root FormControl element to be themed.
563
696
564
697
``` jsx live=false
565
- import { extendTheme } from ' @chakra-ui/react'
698
+ import { extendTheme } from " @chakra-ui/react"
566
699
567
700
export const theme = extendTheme ({
568
701
components: {
@@ -572,8 +705,8 @@ export const theme = extendTheme({
572
705
custom: {
573
706
// style the root `FormControl` element
574
707
container: {
575
- color: ' white' ,
576
- bg: ' blue.900' ,
708
+ color: " white" ,
709
+ bg: " blue.900" ,
577
710
},
578
711
},
579
712
},
@@ -755,7 +888,7 @@ export or an export named `theme`.
755
888
756
889
``` jsx live=false
757
890
// chakra-theme-package/src/index.js
758
- import { extendTheme } from ' @chakra-ui/react'
891
+ import { extendTheme } from " @chakra-ui/react"
759
892
760
893
const theme = extendTheme ({})
761
894
@@ -887,7 +1020,7 @@ To use this API, you'll need to set `transform` to `auto` or `auto-gpu` (for the
887
1020
GPU accelerated version).
888
1021
889
1022
``` jsx live=false
890
- < Circle transform= ' auto' translateX= ' 4 ' _hover= {{ translateX: ' 8 ' }}>
1023
+ < Circle transform= " auto" translateX= " 4 " _hover= {{ translateX: " 8 " }}>
891
1024
< CheckIcon / >
892
1025
< / Circle>
893
1026
```
@@ -1100,35 +1233,35 @@ import {
1100
1233
withDefaultSize ,
1101
1234
withDefaultVariant ,
1102
1235
withDefaultProps ,
1103
- } from ' @chakra-ui/react'
1236
+ } from " @chakra-ui/react"
1104
1237
1105
1238
const customTheme = extendTheme (
1106
1239
{
1107
1240
colors: {
1108
1241
brand: {
1109
1242
// ...
1110
- 500 : ' #b4d455' ,
1243
+ 500 : " #b4d455" ,
1111
1244
// ...
1112
1245
},
1113
1246
},
1114
1247
},
1115
- withDefaultColorScheme ({ colorScheme: ' brand' }),
1248
+ withDefaultColorScheme ({ colorScheme: " brand" }),
1116
1249
withDefaultSize ({
1117
- size: ' lg ' ,
1118
- components: [' Input' , ' NumberInput' , ' PinInput' ],
1250
+ size: " lg " ,
1251
+ components: [" Input" , " NumberInput" , " PinInput" ],
1119
1252
}),
1120
1253
withDefaultVariant ({
1121
- variant: ' outline' ,
1122
- components: [' Input' , ' NumberInput' , ' PinInput' ],
1254
+ variant: " outline" ,
1255
+ components: [" Input" , " NumberInput" , " PinInput" ],
1123
1256
}),
1124
1257
// or all in one:
1125
1258
withDefaultProps ({
1126
1259
defaultProps: {
1127
- colorScheme: ' brand' ,
1128
- variant: ' outline' ,
1129
- size: ' lg ' ,
1260
+ colorScheme: " brand" ,
1261
+ variant: " outline" ,
1262
+ size: " lg " ,
1130
1263
},
1131
- components: [' Input' , ' NumberInput' , ' PinInput' ],
1264
+ components: [" Input" , " NumberInput" , " PinInput" ],
1132
1265
}),
1133
1266
// optional:
1134
1267
yourCustomBaseTheme, // defaults to our chakra default theme
@@ -1175,7 +1308,7 @@ const customTheme = extendTheme(
1175
1308
or ` end ` .
1176
1309
1177
1310
``` jsx live=false
1178
- < Button isLoading spinnerPlacement= ' end' >
1311
+ < Button isLoading spinnerPlacement= " end" >
1179
1312
Click me
1180
1313
< / Button>
1181
1314
```
@@ -1437,7 +1570,7 @@ Popover
1437
1570
- 🐛 Use ` --popover-bg ` css property to control popover and arrow background.
1438
1571
1439
1572
``` jsx live=false
1440
- < PopoverContent style= {{ ' --popover-bg' : ' purple' }}>
1573
+ < PopoverContent style= {{ " --popover-bg" : " purple" }}>
1441
1574
< PopoverArrow / >
1442
1575
< / PopoverContent>
1443
1576
```
@@ -1557,9 +1690,9 @@ Table
1557
1690
``` jsx live=false
1558
1691
< Box
1559
1692
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)" ,
1563
1696
},
1564
1697
}}
1565
1698
/ >
@@ -1777,7 +1910,7 @@ Table
1777
1910
` extendTheme ` function even further.
1778
1911
1779
1912
``` jsx live=false
1780
- import { extendTheme } from ' @chakra-ui/react'
1913
+ import { extendTheme } from " @chakra-ui/react"
1781
1914
1782
1915
export const customTheme = extendTheme ({
1783
1916
// here you get autocomplete for
@@ -1819,13 +1952,13 @@ You can get typesafe access to your custom theme like this:
1819
1952
const theme = {
1820
1953
textStyles: {
1821
1954
caps: {
1822
- fontWeight: ' bold' ,
1823
- fontSize: ' 24px' ,
1955
+ fontWeight: " bold" ,
1956
+ fontSize: " 24px" ,
1824
1957
},
1825
1958
},
1826
1959
}
1827
1960
1828
- const styles = css ({ textStyle: ' caps' })(theme)
1961
+ const styles = css ({ textStyle: " caps" })(theme)
1829
1962
```
1830
1963
1831
1964
This also works for the component theme as well.
0 commit comments