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/[email protected] | @chakra-ui/[email protected] 🎉
2 parents dc36164 + 3bee954 commit 38a873b

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 <[email protected]>"
@@ -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
})

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@ exports[`should render correctly 1`] = `
77
data-chakra-component="CAspectRatioBox"
88
data-testid="aspectRatioBox"
99
>
10-
<img
11-
alt="naruto"
12-
class="css-1mlkgdx"
10+
<div
11+
class="css-k57fb3"
1312
data-chakra-component="CBox"
14-
data-testid="image"
15-
src="https://bit.ly/naruto-sage"
16-
/>
13+
data-testid="child"
14+
>
15+
<img
16+
alt="naruto"
17+
class="css-ygtapu"
18+
data-chakra-component="CBox"
19+
data-testid="image"
20+
src="https://bit.ly/naruto-sage"
21+
/>
22+
</div>
1723
</div>
1824
</DocumentFragment>
1925
`;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ const CSwitch = {
125125
as: 'label'
126126
},
127127
attrs: {
128+
position: 'relative',
128129
display: 'inline-block',
129130
verticalAlign: 'middle',
130131
...data.attrs,

packages/chakra-ui-core/src/CSwitch/tests/__snapshots__/CSwitch.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
exports[`should render correctly 1`] = `
44
<DocumentFragment>
55
<label
6-
class="css-v7ibj3"
6+
class="css-lncjus"
77
data-chakra-component="CSwitch"
88
data-testid="switch"
99
>

packages/chakra-ui-core/src/CTransition/Transition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ const CAnimateHeight = {
486486
height: [this.initialHeight || 0, this.finalHeight || height],
487487
easing: this.enterEasing,
488488
duration: this.duration,
489-
complete
489+
complete: () => { el.style.height = this.finalHeight || 'auto' }
490490
})
491491
})
492492
},

packages/chakra-ui-core/src/Chakra/index.js

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,9 @@ import { createClientDirective } from '../directives'
66
import defaultTheme from '../../../chakra-ui-theme/src'
77
import useToast from '../CToast'
88

9-
/**
10-
* @typedef {Object} Theme Chakra UI Theme object
11-
* @property {Object} breakpoints
12-
* @property {Object} zIndices
13-
* @property {Object} radii
14-
* @property {Object} opacity
15-
* @property {Object} borders
16-
* @property {Object} colors
17-
* @property {Object} borderWidths
18-
* @property {Object} sizes
19-
* @property {Object} shadows
20-
* @property {Object} space
21-
* @property {Object} fontSizes
22-
* @property {Object} fonts
23-
* @property {Object} fontWeights
24-
* @property {Object} lineHeights
25-
* @property {Object} letterSpacings
26-
*/
27-
28-
/**
29-
* @typedef {Object} Options
30-
* @property {Theme} theme
31-
* @property {Theme} extendTheme
32-
* @property {Object} icons
33-
* @property {Object} icons.extend
34-
* @property {String} icons.iconPack
35-
* @property {Object} icons.iconSet
36-
*
37-
*/
38-
399
/**
4010
* Chakra-ui Component library plugin
41-
* @type {Chakra}
11+
* @type {import("../../types").default}
4212
*/
4313
const Chakra = {
4414
/**
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { PluginObject } from "vue"
2+
3+
export type Theme = {
4+
breakpoints: any
5+
zIndices: any
6+
radii: any
7+
opacity: any
8+
borders: any
9+
colors: any
10+
borderWidths: any
11+
sizes: any
12+
shadows: any
13+
space: any
14+
fontSizes: any
15+
fonts: any
16+
fontWeights: any
17+
lineHeights: any
18+
letterSpacings: any
19+
}
20+
21+
export type Options = {
22+
theme: Theme
23+
extendTheme: Theme
24+
icons: {
25+
extend: any
26+
iconPack: string
27+
iconSet: any
28+
}
29+
}
30+
31+
export type Chakra = PluginObject<Options>
32+
33+
declare let chakra: Chakra
34+
export default chakra

0 commit comments

Comments
 (0)