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

Commit 38a873b

Browse files
Merge pull request #408 from chakra-ui/develop
chore: release @chakra-ui/vue@0.8.0 | @chakra-ui/nuxt@0.3.0 🎉
2 parents dc36164 + 3bee954 commit 38a873b

File tree

26 files changed

+467
-55
lines changed

26 files changed

+467
-55
lines changed

.all-contributorsrc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,36 @@
195195
"example",
196196
"code"
197197
]
198+
},
199+
{
200+
"login": "odanado",
201+
"name": "odanado",
202+
"avatar_url": "https://avatars.githubusercontent.com/u/6040962?v=4",
203+
"profile": "https://github.com/odanado",
204+
"contributions": [
205+
"code",
206+
"tool"
207+
]
208+
},
209+
{
210+
"login": "IHIutch",
211+
"name": "Jonathan Hutchison",
212+
"avatar_url": "https://avatars.githubusercontent.com/u/20825047?v=4",
213+
"profile": "https://github.com/IHIutch",
214+
"contributions": [
215+
"code",
216+
"bug",
217+
"ideas"
218+
]
219+
},
220+
{
221+
"login": "HoukasaurusRex",
222+
"name": "JT Houk",
223+
"avatar_url": "https://avatars.githubusercontent.com/u/23695312?v=4",
224+
"profile": "https://jt.houk.space/",
225+
"contributions": [
226+
"doc"
227+
]
198228
}
199229
],
200230
"contributorsPerLine": 7,

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
uses: changesets/action@master
5252
with:
5353
publish: yarn release
54+
title: "chore(release): version packages"
5455
commit: "chore(release): version packages"
5556
env:
5657
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
215215
<td align="center"><a href="http://www.linkedin.com/in/schalch"><img src="https://avatars3.githubusercontent.com/u/13435327?v=4?s=50" 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>
216216
<td align="center"><a href="http://www.be-codified.com"><img src="https://avatars1.githubusercontent.com/u/10107183?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Žiga Vukčevič</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=be-codified" title="Documentation">📖</a></td>
217217
<td align="center"><a href="https://github.com/carwack"><img src="https://avatars3.githubusercontent.com/u/16015740?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Sybren W</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=carwack" title="Documentation">📖</a> <a href="#content-carwack" title="Content">🖋</a> <a href="#example-carwack" title="Examples">💡</a> <a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=carwack" title="Code">💻</a></td>
218+
<td align="center"><a href="https://github.com/odanado"><img src="https://avatars.githubusercontent.com/u/6040962?v=4?s=50" width="50px;" alt=""/><br /><sub><b>odanado</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=odanado" title="Code">💻</a> <a href="#tool-odanado" title="Tools">🔧</a></td>
219+
</tr>
220+
<tr>
221+
<td align="center"><a href="https://jt.houk.space/"><img src="https://avatars.githubusercontent.com/u/23695312?v=4?s=50" width="50px;" alt=""/><br /><sub><b>JT Houk</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=HoukasaurusRex" title="Documentation">📖</a></td>
222+
<td align="center"><a href="https://github.com/IHIutch"><img src="https://avatars.githubusercontent.com/u/20825047?v=4?s=50" width="50px;" alt=""/><br /><sub><b>Jonathan Hutchison</b></sub></a><br /><a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=IHIutch" title="Code">💻</a> <a href="https://github.com/chakra-ui/chakra-ui-vue/issues?q=author%3AIHIutch" title="Bug reports">🐛</a> <a href="#ideas-IHIutch" title="Ideas, Planning, & Feedback">🤔</a></td>
218223
</tr>
219224
</table>
220225

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
"docs:lint": "yarn workspace chakra-ui-docs lint",
4242
"theme:dev": "yarn workspace @chakra-ui/theme-vue build",
4343
"docs-dev": "yarn workspace chakra-ui-docs dev",
44+
"docs-build": "yarn workspace chakra-ui-docs build",
45+
"docs-serve": "yarn workspace chakra-ui-docs nuxt start",
4446
"evalbundle": "bundlesize"
4547
},
4648
"dependencies": {

packages/chakra-ui-core/CHANGELOG.md

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

3+
## 0.8.0
4+
5+
### Minor Changes
6+
7+
- [`8af1c07`](https://github.com/chakra-ui/chakra-ui-vue/commit/8af1c07404d2cfa94bb338e4268c5e0869a50776) Thanks [@codebender828](https://github.com/codebender828)! - Adds type definitions, aspect-ratio-box fixes, switch fixes and collapse fixes
8+
- feat: add type definition of component #380 by @odanado
9+
- feat: CCollapse now renders with collapsed height if initially closed by @codebender828 . closes #269
10+
- fix: Set ccollapse height to auto on enter complete, unless finalHeight wa... #384 by @IHIutch
11+
- fix: Add position: relative to switch label #396 by @IHIutch
12+
- fix: Deeply nested aspect-ratio by @IHIutch
13+
314
## 0.7.4
415

516
### Patch Changes
617

718
- [`951906a`](https://github.com/chakra-ui/chakra-ui-vue/commit/951906a61deabdcf1d3f04b7f8f9fdeaad1f3841) [#375](https://github.com/chakra-ui/chakra-ui-vue/pull/375) Thanks [@codebender828](https://github.com/codebender828)! - Added support for Feather Icons to Nuxt.js
819

20+
* fix(nuxt): nuxt module icon parsing
21+
922
## 0.7.3
1023

1124
## 0.7.2

packages/chakra-ui-core/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "@chakra-ui/vue",
3-
"version": "0.7.4",
3+
"version": "0.8.0",
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",
7+
"types": "types/index.d.ts",
78
"sideEffects": false,
89
"maintainers": [
910
"Jonathan Bakebwa <jonas@akkadu-team.com>"
@@ -27,7 +28,8 @@
2728
},
2829
"files": [
2930
"dist",
30-
"src"
31+
"src",
32+
"types"
3133
],
3234
"bundle-phobia": {
3335
"max-size": "85KB",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ storiesOf('UI | Accordion', module)
3232
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
3333
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
3434
commodo consequat.
35+
</CAccordionPanel>
3536
</CAccordionItem>
3637
</CAccordion>
3738
`

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const CAspectRatioBox = {
6565
left: 0,
6666
...vnode.data.attrs
6767
}
68-
})
68+
}, vnode.componentOptions.children || [])
6969

7070
return h('div', {
7171
class: this.className,

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,23 @@ storiesOf('UI | AspectRatioBox', module)
2222
}
2323
}
2424
}))
25+
.add('Nested Elements', () => ({
26+
components: { CAspectRatioBox, CBox },
27+
template: `
28+
<div style="width: 100vh; height: 100vw;">
29+
<CAspectRatioBox maxW="560px" :ratio="16 / 9" bg="gray.200">
30+
<CFlex align="center" justify="center">
31+
<CBox text-align="center">
32+
<CHeading>See the Vue</CHeading>
33+
<CText mt="4">Vue makes front-end development a breeze.</CText>
34+
</CBox>
35+
</CFlex>
36+
</CAspectRatioBox>
37+
</div>
38+
`,
39+
data () {
40+
return {
41+
showCollapsed: true
42+
}
43+
}
44+
}))

packages/chakra-ui-core/src/CAspectRatioBox/tests/CAspectRatioBox.test.js

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ const renderComponent = (props) => {
66
components: { CAspectRatioBox, CBox },
77
template: `
88
<CAspectRatioBox maxW="400px" data-testid="aspectRatioBox" ${inlineAttrs}>
9-
<CBox as="img" src="https://bit.ly/naruto-sage" alt="naruto" objectFit="cover" data-testid="image" />
9+
<CBox data-testid="child">
10+
<CBox as="img" src="https://bit.ly/naruto-sage" alt="naruto" objectFit="cover" h="100%" w="100%" data-testid="image" />
11+
</CBox>
1012
</CAspectRatioBox>
1113
`,
1214
...props
@@ -22,35 +24,50 @@ it('should render correctly', () => {
2224
const [emotionClassName] = [...screen.getByTestId('aspectRatioBox').classList]
2325
const pseudoStyles = getElementStyles(`.${emotionClassName}:before`)
2426

25-
expect(pseudoStyles).toContain(`
27+
expect(pseudoStyles).toContain(
28+
`
2629
padding-bottom: 100%
27-
`.trim())
30+
`.trim()
31+
)
2832
})
2933

3034
it('should have correct styles', () => {
3135
const inlineAttrs = ':ratio="2"'
3236
renderComponent({ inlineAttrs })
3337
const image = screen.getByTestId('image')
3438
const aspectRatioBox = screen.getByTestId('aspectRatioBox')
39+
const child = screen.getByTestId('child')
3540

3641
const [emotionClassName] = [...aspectRatioBox.classList] // second className has the pseudo styles
3742
const pseudoStyles = getElementStyles(`.${emotionClassName}:before`)
3843

39-
expect(pseudoStyles).toContain(`
44+
expect(pseudoStyles).toContain(
45+
`
4046
padding-bottom: 50%
41-
`.trim())
47+
`.trim()
48+
)
4249

4350
expect(aspectRatioBox).toHaveStyle(`
4451
max-width: 400px;
4552
position: relative;
4653
`)
4754

48-
expect(image).toHaveStyle(`
49-
object-fit: cover;
55+
// aspectRatioBox should contain exactly 1 immediate child
56+
expect(aspectRatioBox.childElementCount).toEqual(1)
57+
58+
expect(child).toHaveStyle(`
5059
position: absolute;
5160
width: 100%;
5261
height: 100%;
5362
top: 0px;
5463
left: 0px;
5564
`)
65+
66+
expect(child).not.toBeEmpty()
67+
68+
expect(image).toHaveStyle(`
69+
object-fit: cover;
70+
width: 100%;
71+
height: 100%;
72+
`)
5673
})

0 commit comments

Comments
 (0)