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

Commit 59f55e3

Browse files
committed
fix(visuallyhidden): fix attrs resolytion
1 parent e4cd0ff commit 59f55e3

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { storiesOf } from '@storybook/vue'
2+
import { CSpinner, CStack } from '..'
3+
4+
const components = { CSpinner, CStack }
5+
6+
storiesOf('UI | Spinner', module)
7+
.add('Basic Usage', () => ({
8+
components,
9+
template: `
10+
<c-spinner />
11+
`
12+
}))
13+
.add('With color', () => ({
14+
components,
15+
template: `
16+
<c-spinner color="blue.500" />
17+
`
18+
}))
19+
.add('With size', () => ({
20+
components,
21+
template: `
22+
<c-stack is-inline :spacing="4">
23+
<c-spinner size="xs" />
24+
<c-spinner size="sm" />
25+
<c-spinner size="md" />
26+
<c-spinner size="lg" />
27+
<c-spinner size="xl" />
28+
</c-stack>
29+
`
30+
}))
31+
.add('With empty color area', () => ({
32+
components,
33+
template: `
34+
<c-spinner
35+
thickness="4px"
36+
speed="0.65s"
37+
empty-color="green.200"
38+
color="vue.500"
39+
size="xl"
40+
/>
41+
`
42+
}))

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ const CVisuallyHidden = {
2828
const className = css({
2929
border: '0px',
3030
clip: 'rect(0px, 0px, 0px, 0px)',
31-
height: `${attrs.w || '1px'}`,
32-
width: `${attrs.h || '1px'}`,
31+
height: `${(attrs && attrs.w) || '1px'}`,
32+
width: `${(attrs && attrs.h) || '1px'}`,
3333
margin: '-1px',
3434
padding: '0px',
3535
overflow: 'hidden',
3636
whiteSpace: 'nowrap',
37-
position: `${attrs.pos || 'absolute'}`
37+
position: `${(attrs && attrs.pos) || 'absolute'}`
3838
})
3939

4040
return h(props.as, {
4141
class: [className],
4242
attrs: {
43-
...attrs,
43+
...(attrs || {}),
4444
'data-chakra-component': 'CVisuallyHidden'
4545
},
4646
domProps,

0 commit comments

Comments
 (0)