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

Commit fbf7d87

Browse files
Merge pull request #269 from chakra-ui/feat/explicitImports
feat(exports): explicit exports from vue next
2 parents c951902 + e30f347 commit fbf7d87

File tree

5 files changed

+460
-38
lines changed

5 files changed

+460
-38
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { h, defineComponent, computed, toRefs } from "vue"
2+
import { chakra, useMultiStyleConfig } from "@chakra-ui/vue-system"
3+
import { omitThemingProps } from "@chakra-ui/styled-system"
4+
import { useFormControl } from "@chakra-ui/c-form-control"
5+
import { vueThemingProps } from "@chakra-ui/vue-utils"
6+
7+
export const CInput = defineComponent({
8+
props: vueThemingProps,
9+
setup(props, { attrs }) {
10+
const styles = useMultiStyleConfig("Input", props)
11+
const _props = computed(() => toRefs(omitThemingProps(props)))
12+
const inputProps = useFormControl(_props.value)
13+
console.log(JSON.stringify(styles.value, null, 2))
14+
return () => (
15+
<chakra.input
16+
{...attrs}
17+
__css={styles.value.field}
18+
{...inputProps.value}
19+
/>
20+
)
21+
},
22+
})

packages/c-form-control/tests/c-form-control.cy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
useFormControl,
1111
} from "../src"
1212
import * as Examples from "../examples"
13-
import { CInput } from "../examples/components"
13+
import { CInput } from "@chakra-ui/c-input"
1414

1515
describe("FormControl Examples", () => {
1616
Object.entries(Examples).map(([name, example]) => {

packages/c-form-control/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"extends": "../../tsconfig.json",
3-
"include": ["src", "./index.tsx", "./index.ts"],
4-
"exclude": ["examples"]
3+
"include": ["src", "./index.tsx", "./index.ts", "examples"],
54
}

packages/c-input/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
},
3232
"dependencies": {
3333
"@chakra-ui/styled-system": "2.5.1",
34-
"@chakra-ui/c-form-control": "workspace:*",
3534
"@chakra-ui/utils": "2.0.15",
3635
"@chakra-ui/vue-system": "workspace:*",
37-
"@chakra-ui/vue-utils": "workspace:*"
36+
"@chakra-ui/vue-utils": "workspace:*",
37+
"@chakra-ui/c-form-control": "workspace:*"
3838
},
3939
"devDependencies": {
4040
"vue": "3.2.47"

0 commit comments

Comments
 (0)