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

Commit 855dfe7

Browse files
Merge pull request #305 from chakra-ui/develop
chore: bug fixes and documentation improvements
2 parents 9390db3 + a3c1a19 commit 855dfe7

File tree

24 files changed

+203
-32
lines changed

24 files changed

+203
-32
lines changed

.all-contributorsrc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,33 @@
146146
"contributions": [
147147
"doc"
148148
]
149+
},
150+
{
151+
"login": "vishnumohanrk",
152+
"name": "Vishnumohan R K",
153+
"avatar_url": "https://avatars3.githubusercontent.com/u/51525368?v=4",
154+
"profile": "https://github.com/vishnumohanrk",
155+
"contributions": [
156+
"doc"
157+
]
158+
},
159+
{
160+
"login": "freality",
161+
"name": "Ken Love",
162+
"avatar_url": "https://avatars3.githubusercontent.com/u/15808?v=4",
163+
"profile": "https://github.com/freality",
164+
"contributions": [
165+
"code"
166+
]
167+
},
168+
{
169+
"login": "gbschalch",
170+
"name": "Guilherme Schalch",
171+
"avatar_url": "https://avatars3.githubusercontent.com/u/13435327?v=4",
172+
"profile": "http://www.linkedin.com/in/schalch",
173+
"contributions": [
174+
"code"
175+
]
149176
}
150177
],
151178
"contributorsPerLine": 7,

.github/semantic.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Always validate the PR title, and ignore the commits
2+
titleOnly: true
3+
4+
# Require at least one commit to be valid
5+
# this is only relevant when using commitsOnly: true or titleAndCommits: true,
6+
# which validate all commits by default
7+
anyCommit: true
8+
9+
# Allow use of Merge commits (eg on github: "Merge branch 'master' into feature/ride-unicorns")
10+
# this is only relevant when using commitsOnly: true (or titleAndCommits: true)
11+
allowMergeCommits: true
12+
13+
# Allow use of Revert commits (eg on github: "Revert "feat: ride unicorns"")
14+
# this is only relevant when using commitsOnly: true (or titleAndCommits: true)
15+
allowRevertCommits: true

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
210210
</tr>
211211
<tr>
212212
<td align="center"><a href="https://github.com/Anmol270900"><img src="https://avatars2.githubusercontent.com/u/43845658?v=4" width="50px;" alt=""/><br /><sub><b>Anmol</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=Anmol270900" title="Documentation">📖</a></td>
213+
<td align="center"><a href="https://github.com/vishnumohanrk"><img src="https://avatars3.githubusercontent.com/u/51525368?v=4" width="50px;" alt=""/><br /><sub><b>Vishnumohan R K</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=vishnumohanrk" title="Documentation">📖</a></td>
214+
<td align="center"><a href="https://github.com/freality"><img src="https://avatars3.githubusercontent.com/u/15808?v=4" width="50px;" alt=""/><br /><sub><b>Ken Love</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=freality" title="Code">💻</a></td>
215+
<td align="center"><a href="http://www.linkedin.com/in/schalch"><img src="https://avatars3.githubusercontent.com/u/13435327?v=4" width="50px;" alt=""/><br /><sub><b>Guilherme Schalch</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=gbschalch" title="Code">💻</a></td>
213216
</tr>
214217
</table>
215218

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"release": "lerna version patch && lerna publish from-package",
3434
"push": "git add -A && git commit -m \"chore(lerna): publishing package \" && lerna version --conventional-commits",
3535
"clean": "lerna run clean",
36-
"storybook": "STORYBOOK_VUE_DEV_TOOLS=1 start-storybook -p 9000",
36+
"storybook": "cross-env STORYBOOK_VUE_DEV_TOOLS=1 start-storybook -p 9000",
3737
"storybook:devtools": "vue-devtools",
3838
"build-storybook": "build-storybook --quiet",
3939
"deploy-storybook": "storybook-to-ghpages -- --out=.out",

packages/chakra-ui-core/CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Change Log
22

3+
## 0.6.3
4+
5+
### Patch Changes
6+
7+
- fix: includes missing style props for border-radius and flex-grow style declarations"
8+
9+
## 0.6.2
10+
11+
### Patch Changes
12+
13+
- 3533e00: Fix: CSwitch component v-model + @change event handler.
14+
15+
## 0.6.2-next.0
16+
17+
### Patch Changes
18+
19+
- Fix: CSwitch component v-model + @change event handler.
20+
321
## 0.6.1
422

523
### Patch Changes

packages/chakra-ui-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@chakra-ui/vue",
3-
"version": "0.6.1",
3+
"version": "0.6.3",
44
"description": "Build Accessible and Responsive Vue.js websites and applications with speed ⚡️",
55
"main": "dist/cjs/index.js",
66
"module": "dist/esm/index.js",

packages/chakra-ui-core/src/CFlex/CFlex.stories.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,19 @@ storiesOf('UI | Flex', module)
2222
</CFlex>
2323
`
2424
}))
25+
.add('Flex grow', () => ({
26+
components: { CFlex, CBox, CText },
27+
template: `
28+
<CFlex w="600px" align="center">
29+
<CBox flex-grow="2" w="10" mr="3" h="10" bg="blue.100">1</CBox>
30+
<CBox rounded-top="lg" w="10" mr="3" h="10" bg="blue.100">1</CBox>
31+
<CBox rounded-right="lg" w="10" mr="3" h="10" bg="blue.100">2</CBox>
32+
<CBox rounded-bottom="lg" w="10" mr="3" h="10" bg="blue.100">3</CBox>
33+
<CBox rounded-right="lg" w="10" mr="3" h="10" bg="blue.100">4</CBox>
34+
<CBox border-top-right-radius="lg" w="10" mr="3" h="10" bg="blue.100">5</CBox>
35+
<CBox border-top-left-radius="lg" w="10" mr="3" h="10" bg="blue.100">6</CBox>
36+
<CBox border-bottom-right-radius="lg" w="10" mr="3" h="10" bg="blue.100">7</CBox>
37+
<CBox border-bottom-left-radius="lg" w="10" h="10" bg="blue.100">8</CBox>
38+
</CFlex>
39+
`
40+
}))

packages/chakra-ui-core/src/CRadio/CRadio.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const CRadio = {
3232
props: {
3333
id: String,
3434
name: String,
35-
value: String,
35+
value: [String, Number],
3636
ariaLabel: String,
3737
ariaLabelledBy: String,
3838
variantColor: {

packages/chakra-ui-core/src/CReset/CReset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const CReset = {
5151
}
5252
},
5353
props: {
54-
config: Object
54+
config: Function
5555
},
5656
created () {
5757
const { color, bg, borderColor, placeholderColor } = this.styleConfig[this.colorMode]

packages/chakra-ui-core/src/CSwitch/CSwitch.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @see Source https://github.com/chakra-ui/chakra-ui-vue/blob/master/packages/chakra-ui-core/src/CSwitch/CSwitch.js
99
*/
1010

11-
import { forwardProps, extractListeners } from '../utils'
11+
import { forwardProps } from '../utils'
1212

1313
import CBox from '../CBox'
1414
import CVisuallyHidden from '../CVisuallyHidden'
@@ -29,6 +29,15 @@ const switchSizes = {
2929
}
3030
}
3131

32+
/** Emits events for functional components */
33+
const emitFunctionalEvent = (fn, ...args) => {
34+
if (fn && typeof fn === 'function') {
35+
fn(...args)
36+
} else if (Array.isArray(fn)) {
37+
fn.forEach(handler => typeof handler === 'function' && handler(...args))
38+
}
39+
}
40+
3241
/**
3342
* CSwitch component
3443
*
@@ -101,18 +110,14 @@ const CSwitch = {
101110
}
102111
}
103112

104-
// Events
105-
const nonNativeEvents = {
113+
const eventListeners = {
114+
...listeners,
106115
change: (e) => {
107-
const emitChange = listeners.change
108-
if (emitChange && typeof emitChange === 'function') {
109-
emitChange(!props.isChecked)
110-
}
116+
const newValue = !props.isChecked
117+
emitFunctionalEvent(listeners.change, newValue, e)
111118
}
112119
}
113120

114-
const { native, nonNative } = extractListeners({ listeners }, nonNativeEvents)
115-
116121
return h(CBox, {
117122
...rest,
118123
props: {
@@ -142,8 +147,7 @@ const CSwitch = {
142147
checked: props.isChecked,
143148
disabled: props.isDisabled
144149
},
145-
on: nonNative,
146-
nativeOn: native
150+
on: eventListeners
147151
}),
148152
h(CControlBox, {
149153
attrs: styleProps

0 commit comments

Comments
 (0)