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

Commit 53992dc

Browse files
Merge pull request #14 from chakra-ui/feat/button-group
Feat/button group
2 parents 4138057 + afd07c1 commit 53992dc

File tree

26 files changed

+618
-464
lines changed

26 files changed

+618
-464
lines changed

nodemon.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"c-button": "yarn workspace @chakra-ui/c-button",
2626
"c-icon": "yarn workspace @chakra-ui/c-icon",
2727
"system": "yarn workspace @chakra-ui/vue-system",
28+
"utils": "yarn workspace @chakra-ui/vue-utils",
2829
"theme": "yarn workspace @chakra-ui/vue-theme",
2930
"nuxt": "yarn workspace @chakra-ui/nuxt-next",
3031
"test-utils": "yarn workspace @chakra-ui/vue-test-utils",
@@ -73,7 +74,6 @@
7374
"jest-transform-stub": "^2.0.0",
7475
"lerna": "^3.22.1",
7576
"lint-staged": "^10.5.3",
76-
"nodemon": "^2.0.7",
7777
"prettier": "^2.1.2",
7878
"pretty": "^2.0.0",
7979
"recursive-readdir": "^2.2.2",

packages/c-accordion/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ const CAccordion = defineComponent({
99
},
1010
},
1111
setup(props, { slots, attrs }) {
12-
return () => h(chakra(props.as), { ...attrs }, slots)
12+
return () =>
13+
h(chakra(props.as, { label: 'accordion' }), { ...attrs }, slots)
1314
},
1415
})
1516

packages/c-accordion/tests/__snapshots__/c-accordion.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
exports[`should render properly 1`] = `
44
<DocumentFragment>
55
<div
6-
class="css-0"
6+
class="chakra-accordion css-0"
77
/>
88
</DocumentFragment>
99
`;

packages/c-alert/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"dependencies": {
2727
"@chakra-ui/styled-system": "^1.4.1",
2828
"@chakra-ui/vue-system": "*",
29+
"@chakra-ui/vue-utils": "*",
2930
"@chakra-ui/c-icon": "*"
3031
}
3132
}

packages/c-alert/src/alert.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const CAlert = defineComponent({
9696

9797
return () =>
9898
h(
99-
chakra(props.as, 'alert'),
99+
chakra(props.as, { label: 'alert' }),
100100
{
101101
role: 'alert',
102102
...alertStyles,
@@ -119,7 +119,7 @@ export const CAlertTitle = defineComponent({
119119

120120
return () =>
121121
h(
122-
chakra('div', 'alert__title'),
122+
chakra('div', { label: 'alert__title' }),
123123
{
124124
...styles.title,
125125
...attrs,
@@ -141,7 +141,7 @@ export const CAlertDescription = defineComponent({
141141

142142
return () =>
143143
h(
144-
chakra('div', 'alert__description'),
144+
chakra('div', { label: 'alert__description' }),
145145
{
146146
...styles.description,
147147
...attrs,
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<c-button-group variant="outline" is-attached>
3+
<c-button color-scheme="blue">Save</c-button>
4+
<c-button>Cancel</c-button>
5+
</c-button-group>
6+
</template>
7+
8+
<script lang="ts">
9+
import { CButton, CButtonGroup } from '@chakra-ui/c-button/src'
10+
import { defineComponent } from 'vue'
11+
12+
export default defineComponent({
13+
components: { CButton, CButtonGroup },
14+
})
15+
</script>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<c-button-group variant="outline">
3+
<c-button color-scheme="blue">Save</c-button>
4+
<c-button>Cancel</c-button>
5+
</c-button-group>
6+
</template>
7+
8+
<script lang="ts">
9+
import { CButton, CButtonGroup } from '@chakra-ui/c-button/src'
10+
import { defineComponent } from 'vue'
11+
12+
export default defineComponent({
13+
components: { CButton, CButtonGroup },
14+
})
15+
</script>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<c-button mr="3" variant="solid" color-scheme="teal"> Solid </c-button>
3+
<c-button mr="3" variant="outline" color-scheme="teal"> Outline </c-button>
4+
<c-button mr="3" variant="ghost" color-scheme="teal"> Ghost </c-button>
5+
<c-button mr="3" variant="link" color-scheme="teal"> Link </c-button>
6+
</template>
7+
8+
<script lang="ts">
9+
import { CButton } from '@chakra-ui/c-button/src'
10+
import { defineComponent } from 'vue'
11+
12+
export default defineComponent({
13+
components: { CButton },
14+
})
15+
</script>

packages/c-button/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
},
2525
"dependencies": {
2626
"@chakra-ui/styled-system": "^1.4.1",
27-
"@chakra-ui/vue-system": "*"
27+
"@chakra-ui/vue-system": "*",
28+
"@chakra-ui/vue-utils": "*"
2829
}
2930
}

0 commit comments

Comments
 (0)