This repository was archived by the owner on Sep 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 14 files changed +103
-19
lines changed
_templates/generator/component Expand file tree Collapse file tree 14 files changed +103
-19
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ to: packages/<%=h.changeCase.paramCase(name)%>/package.json
20
20
"build": "concurrently yarn:build:*",
21
21
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts -d dist/esm --source-maps",
22
22
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts -d dist/cjs --source-maps",
23
- "build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types"
23
+ "build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
24
+ "watch": "concurrently yarn:watch:*",
25
+ "watch:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts -d dist/esm --source-maps --watch",
26
+ "watch:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts -d dist/cjs --source-maps --watch",
27
+ "watch:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch"
24
28
}
25
29
}
Original file line number Diff line number Diff line change 16
16
"playground:routes" : " ts-node ./scripts/parse-routes.ts" ,
17
17
"dev" : " yarn playground:routes && NODE_ENV=development vite serve playground --config ./vite.config.ts" ,
18
18
"playground:build" : " yarn install && yarn build && yarn playground:routes && NODE_ENV=production vite build playground" ,
19
+ "core" : " yarn workspace @chakra-ui/vue-next" ,
19
20
"c-alert" : " yarn workspace @chakra-ui/c-alert" ,
21
+ "c-theme-provider" : " yarn workspace @chakra-ui/c-theme-provider" ,
20
22
"c-box" : " yarn workspace @chakra-ui/c-box" ,
21
23
"c-button" : " yarn workspace @chakra-ui/c-button" ,
22
24
"system" : " yarn workspace @chakra-ui/system-vue" ,
Original file line number Diff line number Diff line change 3
3
font-weight =" bold"
4
4
px =" 4"
5
5
py =" 3"
6
- bg =" yellow.300"
6
+ : bg =" [' yellow.300', 'blue.200'] "
7
7
aria-role =" alert"
8
8
rounded =" md"
9
9
>
Original file line number Diff line number Diff line change @@ -13,10 +13,9 @@ const CAlert = defineComponent({
13
13
setup ( props , { slots, attrs } ) {
14
14
return ( ) =>
15
15
h (
16
- chakra [ props . as ] ,
16
+ chakra ( props . as , 'alert' ) ,
17
17
{
18
18
...attrs ,
19
- class : 'chakra-alert' ,
20
19
role : 'alert' ,
21
20
} ,
22
21
slots
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ export default defineComponent({
13
13
components: { CBox },
14
14
setup() {
15
15
const val = ref (' Hello box' )
16
- console .log (' Base box setup ' )
17
16
18
17
return { val }
19
18
},
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " @chakra-ui/c-theme-provider" ,
3
+ "version" : " 1.0.0" ,
4
+ "main" : " dist/cjs/index.js" ,
5
+ "module" : " dist/esm/index.js" ,
6
+ "types" : " dist/types/index.d.ts" ,
7
+ "typings" : " dist/types/index.d.ts" ,
8
+ "files" : [
9
+ " dist"
10
+ ],
11
+ "description" : " Chakra UI Vue | CThemeProvider component" ,
12
+ "repository" : " https://github.com/chakra-ui/chakra-ui-vue-next.git" ,
13
+ "author" :
" Jonathan Bakebwa [email protected] " ,
14
+ "license" : " MIT" ,
15
+ "scripts" : {
16
+ "build" : " concurrently yarn:build:*" ,
17
+ "build:esm" : " cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts -d dist/esm --source-maps" ,
18
+ "build:cjs" : " cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts -d dist/cjs --source-maps" ,
19
+ "build:types" : " tsc --emitDeclarationOnly --declaration --declarationDir dist/types" ,
20
+ "watch" : " concurrently yarn:watch:*" ,
21
+ "watch:esm" : " cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts -d dist/esm --source-maps --watch" ,
22
+ "watch:cjs" : " cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts -d dist/cjs --source-maps --watch" ,
23
+ "watch:types" : " tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch"
24
+ }
25
+ }
Original file line number Diff line number Diff line change
1
+ import {
2
+ h ,
3
+ defineComponent ,
4
+ Fragment ,
5
+ PropType ,
6
+ provide ,
7
+ inject ,
8
+ computed ,
9
+ } from 'vue'
10
+ import { ThemeProviderProps } from '@chakra-ui/vue-next'
11
+
12
+ const CThemeProvider = defineComponent ( {
13
+ name : 'CAlert' ,
14
+ props : {
15
+ value : {
16
+ type : [ Object ] as PropType < ThemeProviderProps > ,
17
+ default : ( ) => undefined ,
18
+ } ,
19
+ } ,
20
+ setup ( props , { slots } ) {
21
+ const pluginTheme = inject ( '$chakraTheme' )
22
+ const applicationTheme = computed ( ( ) => props . value || pluginTheme )
23
+ provide ( '$chakraTheme' , applicationTheme . value )
24
+ return ( ) => h ( Fragment , slots . default ?.( { $chakraTheme : props . value } ) )
25
+ } ,
26
+ } )
27
+
28
+ export default CThemeProvider
Original file line number Diff line number Diff line change
1
+ import { render } from '@chakra-ui/vue-test-utils'
2
+ import CThemeProvider from '../'
3
+
4
+ it ( 'should render properly' , ( ) => {
5
+ const { html } = render ( CThemeProvider )
6
+ expect ( html ( ) ) . toMatchSnapshot ( )
7
+ } )
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : " ../../tsconfig.json" ,
3
+ "include" : [" src" ]
4
+ }
Original file line number Diff line number Diff line change 16
16
"build" : " concurrently yarn:build:*" ,
17
17
"build:esm" : " cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts -d dist/esm --source-maps" ,
18
18
"build:cjs" : " cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts -d dist/cjs --source-maps" ,
19
- "build:types" : " tsc --emitDeclarationOnly --declaration --declarationDir dist/types"
19
+ "build:types" : " tsc --emitDeclarationOnly --declaration --declarationDir dist/types" ,
20
+ "watch" : " concurrently yarn:watch:*" ,
21
+ "watch:esm" : " cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts -d dist/esm --source-maps --watch" ,
22
+ "watch:cjs" : " cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts -d dist/cjs --source-maps --watch" ,
23
+ "watch:types" : " tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch"
20
24
}
21
25
}
You can’t perform that action at this time.
0 commit comments