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

Commit d04bcaa

Browse files
Merge pull request #330 from chakra-ui/develop
chore: @chakra-ui/[email protected] and @chakra-ui/[email protected] 🎉
2 parents c27251a + 2377251 commit d04bcaa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2981
-228
lines changed

.all-contributorsrc

+22-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@
162162
"avatar_url": "https://avatars3.githubusercontent.com/u/15808?v=4",
163163
"profile": "https://github.com/freality",
164164
"contributions": [
165-
"code"
165+
"code",
166+
"test"
166167
]
167168
},
168169
{
@@ -173,6 +174,26 @@
173174
"contributions": [
174175
"code"
175176
]
177+
},
178+
{
179+
"login": "be-codified",
180+
"name": "Žiga Vukčevič",
181+
"avatar_url": "https://avatars1.githubusercontent.com/u/10107183?v=4",
182+
"profile": "http://www.be-codified.com",
183+
"contributions": [
184+
"doc"
185+
]
186+
},
187+
{
188+
"login": "carwack",
189+
"name": "Sybren W",
190+
"avatar_url": "https://avatars3.githubusercontent.com/u/16015740?v=4",
191+
"profile": "https://github.com/carwack",
192+
"contributions": [
193+
"doc",
194+
"content",
195+
"example"
196+
]
176197
}
177198
],
178199
"contributorsPerLine": 7,

.storybook/components/Canvas.vue

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import {
4848
CBox,
4949
CIconButton,
5050
CColorModeProvider } from '../../packages/chakra-ui-core/src'
51+
5152
export default {
5253
name: 'Canvas',
5354
components: {

.storybook/config.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import { configure, addDecorator, addParameters } from '@storybook/vue';
22
import Vue from 'vue'
33
import VueLive from 'vue-live'
44
import Lorem from 'vue-lorem-ipsum'
5-
import Chakra, { CThemeProvider, CColorModeProvider, CReset } from '../packages/chakra-ui-core/src'
5+
import Chakra from '../packages/chakra-ui-core/src'
66
import Canvas from './components/Canvas.vue'
7-
import theme from '../packages/chakra-ui-core/src/lib/theme'
87
import storyBookTheme from './theme'
98

109
import {
@@ -75,16 +74,11 @@ addParameters({
7574

7675
addDecorator(() => ({
7776
template: `
78-
<Canvas :theme="theme">
77+
<Canvas>
7978
<story/>
8079
</Canvas>
8180
`,
82-
data() {
83-
return {
84-
theme,
85-
}
86-
},
87-
components: { CThemeProvider, CColorModeProvider, CReset, Canvas }
81+
components: { Canvas }
8882
}));
8983

9084
// For playground

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
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>
213213
<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>
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> <a href="https://github.com/chakra-ui/chakra-ui-vue/commits?author=freality" title="Tests">⚠️</a></td>
215215
<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>
216+
<td align="center"><a href="http://www.be-codified.com"><img src="https://avatars1.githubusercontent.com/u/10107183?v=4" 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>
217+
<td align="center"><a href="https://github.com/carwack"><img src="https://avatars3.githubusercontent.com/u/16015740?v=4" 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></td>
216218
</tr>
217219
</table>
218220

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"babelrc-rollup": "^3.0.0",
9494
"breadstick": "^0.2.14",
9595
"can-use-dom": "^0.1.0",
96+
"chakra-loader": "latest",
9697
"color": "^3.1.2",
9798
"copy-to-clipboard": "^3.3.1",
9899
"core-js": "^3.6.4",

packages/chakra-ui-core/CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Change Log
22

3+
## 0.6.6
4+
5+
### Patch Changes
6+
7+
**🌟 New features**
8+
- feat: include all known css properties #319
9+
- feat(CStack): allow stack html elements #324
10+
11+
**🛠 Bug fixes**
12+
- fix(creset): include font-family to global styles #323
13+
- fix(inputgroup): default inputgroup z-index to containing element zindex #325
14+
- Documentation fixes #329, #328, #321
15+
316
## 0.6.5
417

518
### Patch Changes

packages/chakra-ui-core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@chakra-ui/vue",
3-
"version": "0.6.5",
3+
"version": "0.6.6",
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/CInputGroup/CInputGroup.js

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ const CInputGroup = {
8787
attrs: {
8888
display: 'flex',
8989
position: 'relative',
90+
zIndex: 0,
9091
...data.attrs,
9192
'data-chakra-component': 'CInputGroup'
9293
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { CInputGroup, CInputLeftElement, CInputRightElement, CInput, CIcon } from '../..'
2+
import { render } from '@/tests/test-utils'
3+
4+
const renderComponent = (props) => {
5+
const base = {
6+
data: () => ({ text: 'hello' }),
7+
components: { CInputGroup, CInputLeftElement, CInputRightElement, CInput, CIcon },
8+
template: `
9+
<c-input-group>
10+
<c-input-left-element color="gray.300" fontSize="1.2em">¥</c-input-left-element>
11+
<c-input placeholder="Enter amount" />
12+
<c-input-right-element><c-icon name="check" color="green.500" /></c-input-right-element>
13+
</c-input-group>
14+
`,
15+
...props
16+
}
17+
return render(base)
18+
}
19+
20+
test('should render correctly', () => {
21+
const { asFragment } = renderComponent()
22+
expect(asFragment()).toMatchSnapshot()
23+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`should render correctly 1`] = `
4+
<DocumentFragment>
5+
<div
6+
class="css-15frdhg"
7+
data-chakra-component="CInputGroup"
8+
>
9+
<div
10+
class="css-rbouvx"
11+
color="gray.300"
12+
data-chakra-component="CInputLeftElement"
13+
fontsize="1.2em"
14+
>
15+
¥
16+
</div>
17+
<input
18+
class="css-lr9hjy"
19+
data-chakra-component="CInput"
20+
placeholder="Enter amount"
21+
/>
22+
<div
23+
class="css-wqp70x"
24+
data-chakra-component="CInputRightElement"
25+
>
26+
<svg
27+
class="css-12j51pv css-3vopgu css-7w9hf9"
28+
data-chakra-component="CIcon"
29+
role="presentation"
30+
viewBox="0 0 14 14"
31+
>
32+
33+
34+
<g
35+
fill="currentColor"
36+
>
37+
38+
39+
<polygon
40+
points="5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"
41+
/>
42+
43+
44+
</g>
45+
46+
47+
</svg>
48+
</div>
49+
</div>
50+
</DocumentFragment>
51+
`;

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

+13-5
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ const defaultConfig = theme => ({
1515
color: theme.colors.gray[800],
1616
bg: undefined,
1717
borderColor: theme.colors.gray[200],
18-
placeholderColor: theme.colors.gray[400]
18+
placeholderColor: theme.colors.gray[400],
19+
fontFamily: theme.fonts.body
1920
},
2021
dark: {
2122
color: theme.colors.whiteAlpha[900],
2223
bg: theme.colors.gray[800],
2324
borderColor: theme.colors.whiteAlpha[300],
24-
placeholderColor: theme.colors.whiteAlpha[400]
25+
placeholderColor: theme.colors.whiteAlpha[400],
26+
fontFamily: theme.fonts.body
2527
}
2628
})
2729

@@ -51,16 +53,22 @@ const CReset = {
5153
}
5254
},
5355
props: {
54-
config: Function
56+
config: {
57+
type: Function,
58+
validator (value) {
59+
return typeof value === 'function'
60+
}
61+
}
5562
},
5663
created () {
57-
const { color, bg, borderColor, placeholderColor } = this.styleConfig[this.colorMode]
64+
const { color, bg, borderColor, placeholderColor, fontFamily } = this.styleConfig[this.colorMode]
5865
useTailwindPreflight(this.theme)
5966
injectGlobal({
6067
html: {
6168
lineHeight: 1.5,
6269
color,
63-
backgroundColor: bg
70+
backgroundColor: bg,
71+
fontFamily
6472
},
6573

6674
'*, *::before, *::after': {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import CReset from '../'
2+
import { render } from '@/tests/test-utils'
3+
4+
const renderComponent = (props) => {
5+
const inlineAttrs = (props && props.inlineAttrs) || ''
6+
const base = {
7+
components: { CReset },
8+
template: `<CReset data-testid="reset" ${inlineAttrs} />`,
9+
...props
10+
}
11+
return render(base)
12+
}
13+
14+
describe('CReset.vue', () => {
15+
it('should render correctly', () => {
16+
const { asFragment } = renderComponent()
17+
18+
expect(asFragment()).toMatchSnapshot()
19+
})
20+
21+
it('should inject global styles', () => {
22+
renderComponent()
23+
24+
expect(document.head).toMatchSnapshot()
25+
})
26+
27+
it('should accept config prop', () => {
28+
const inlineAttrs = ':config="cssResetConfig"'
29+
const cssResetConfig = (_, defaults) => {
30+
const { light } = defaults
31+
return {
32+
...defaults, light: { ...light, bg: 'pink', color: 'indigo', fontFamily: "'Comic Sans MS'" }
33+
}
34+
}
35+
36+
renderComponent({ inlineAttrs, methods: { cssResetConfig } })
37+
38+
expect(document.head).toMatchSnapshot()
39+
})
40+
})

0 commit comments

Comments
 (0)