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

Commit ed8ed38

Browse files
Merge pull request #4 from chakra-ui/feature/styled-system
feature: system
2 parents 93e8918 + 7f7ce47 commit ed8ed38

36 files changed

+1306
-1285
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
node_modules
22
dist
3-
playground/src/.generated/*
3+
# playground/src/.generated/*
44
.vercel
5+
yarn-error.log
6+
test-vite-project

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ I'm excited to finally get this project out in the open. I love working on Chakr
3030

3131
I have the entire Chakra UI core team members and Vue community to thank for their support, and for every contributor who does so by opening issues, writing tests and fixing bugs. I'm generally reachable by email at `[email protected]` or on `@codebender828` on Twitter and on the Chakra UI Discord.
3232

33-
For now I'll be hacking away at these projects! Blessings!
33+
For now I'll be hacking away at this! Blessings!

_templates/generator/component/package.json.ejs.t

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ to: packages/<%=h.changeCase.paramCase(name)%>/package.json
2020
"build": "concurrently yarn:build:*",
2121
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts -d dist/esm --source-maps",
2222
"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"
2428
}
2529
}

lerna.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
{
2-
"packages": [
3-
"packages/*"
4-
],
5-
"version": "0.0.0"
6-
}
2+
"packages": ["packages/*", "website", "tooling/*"],
3+
"version": "independent",
4+
"npmClient": "yarn",
5+
"useWorkspaces": true,
6+
"registry": "https://registry.npmjs.org/",
7+
"command": {
8+
"version": { "exact": true },
9+
"publish": {
10+
"conventionalCommits": true,
11+
"message": "chore(release): publish",
12+
"ignoreChanges": ["**/stories/**", "**/tests/**"],
13+
"allowBranch": "master"
14+
}
15+
}
16+
}

package.json

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@
1414
"lint": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
1515
"scaffold": "hygen",
1616
"playground:routes": "ts-node ./scripts/parse-routes.ts",
17-
"dev": "yarn playground:routes && NODE_ENV=development vite serve playground",
18-
"playground:build": "yarn install && yarn build && yarn playground:routes && NODE_ENV=production vite build playground",
17+
"dev": "yarn playground:routes && NODE_ENV=development vite serve playground --config ./vite.config.ts",
18+
"playground:build": "yarn install && yarn build && yarn playground:routes && NODE_ENV=production vite build playground --config ./vite.config.ts",
19+
"core": "yarn workspace @chakra-ui/vue-next",
1920
"c-alert": "yarn workspace @chakra-ui/c-alert",
21+
"c-theme-provider": "yarn workspace @chakra-ui/c-theme-provider",
2022
"c-box": "yarn workspace @chakra-ui/c-box",
2123
"c-button": "yarn workspace @chakra-ui/c-button",
24+
"system": "yarn workspace @chakra-ui/system-vue",
2225
"nuxt": "yarn workspace @chakra-ui/nuxt-next"
2326
},
2427
"license": "MIT",
@@ -32,7 +35,11 @@
3235
"@types/recursive-readdir": "^2.2.0",
3336
"@typescript-eslint/eslint-plugin": "^2.34.0",
3437
"@typescript-eslint/parser": "4.0.1",
38+
"@vitejs/plugin-vue": "^1.0.6",
39+
"@vue/compiler-sfc": "^3.0.5",
3540
"@vue/eslint-config-typescript": "^5.1.0",
41+
"@vuedx/typecheck": "^0.4.1",
42+
"@vuedx/typescript-plugin-vue": "^0.4.1",
3643
"concurrently": "^5.3.0",
3744
"consola": "^2.15.0",
3845
"cross-env": "^7.0.2",
@@ -52,18 +59,26 @@
5259
"recursive-readdir": "^2.2.2",
5360
"ts-node": "^9.0.0",
5461
"typescript": "^4.1.2",
55-
"vite": "^1.0.0-rc.13",
56-
"vue": "^3",
62+
"vite": "^2.0.0-beta.44",
63+
"vue": "^3.0.5",
5764
"vue-router": "4.0.0-beta.10"
5865
},
5966
"dependencies": {
67+
"@chakra-ui/styled-system": "^1.4.1",
68+
"@emotion/css": "^11.1.3",
69+
"@emotion/server": "^11.0.0",
70+
"@types/lodash.camelcase": "^4.3.6",
71+
"@types/lodash.kebabcase": "^4.1.6",
6072
"@types/lodash.mergewith": "^4.6.6",
6173
"@types/tinycolor2": "^1.4.2",
6274
"change-case": "^4.1.1",
6375
"css-get-unit": "^1.0.1",
6476
"csstype": "^3.0.5",
77+
"lodash.camelcase": "^4.3.0",
78+
"lodash.kebabcase": "^4.1.1",
6579
"lodash.mergewith": "^4.6.2",
6680
"object-assign": "^4.1.1",
81+
"react": "^17.0.1",
6782
"tinycolor2": "^1.4.2"
6883
}
6984
}
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<template>
2-
<c-alert class="chakra-alert"> HELLO ALERT </c-alert>
2+
<c-alert
3+
font-weight="bold"
4+
px="4"
5+
py="3"
6+
:bg="['yellow.300', 'blue.200']"
7+
aria-role="alert"
8+
rounded="md"
9+
>
10+
HELLO ALERT
11+
</c-alert>
312
<p>Alert paragraph</p>
413
</template>
514

@@ -8,6 +17,7 @@ import CAlert from '@chakra-ui/c-alert/src'
817
import { defineComponent } from 'vue'
918
1019
export default defineComponent({
20+
name: 'BaseAlertExample',
1121
components: { CAlert },
1222
})
1323
</script>

packages/c-alert/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@
1616
"build": "concurrently yarn:build:*",
1717
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts -d dist/esm --source-maps",
1818
"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"
2024
},
2125
"dependencies": {
2226
"@chakra-ui/vue-styled-system": "1.0.0",
27+
"@chakra-ui/system-vue": "1.0.0",
2328
"@chakra-ui/vue-theme": "^1.0.0"
2429
}
2530
}

packages/c-alert/src/index.ts

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,25 @@
1-
import {
2-
h,
3-
defineComponent,
4-
VNodeProps,
5-
VNode,
6-
Component,
7-
Fragment,
8-
Teleport,
9-
Suspense,
10-
DefineComponent,
11-
onMounted,
12-
} from 'vue'
13-
14-
import { css } from '@chakra-ui/vue-styled-system'
15-
import theme from '@chakra-ui/vue-theme'
16-
17-
type Tag =
18-
| string
19-
| typeof Fragment
20-
| typeof Teleport
21-
| typeof Suspense
22-
| Component
1+
import { h, defineComponent, PropType } from 'vue'
2+
import { chakra } from '@chakra-ui/system-vue'
3+
import { DOMElements } from '@chakra-ui/system-vue/dist/types/system.utils'
234

245
const CAlert = defineComponent({
6+
name: 'CAlert',
257
props: {
268
as: {
27-
type: [String, Object],
9+
type: [String, Object] as PropType<DOMElements>,
2810
default: 'div',
2911
},
3012
},
31-
setup() {
32-
onMounted(() => {
33-
console.log(
34-
css({
35-
bg: 'blue.400',
36-
p: 4,
37-
color: 'white',
38-
})({ theme })
13+
setup(props, { slots, attrs }) {
14+
return () =>
15+
h(
16+
chakra(props.as, 'alert'),
17+
{
18+
...attrs,
19+
role: 'alert',
20+
},
21+
slots
3922
)
40-
})
41-
},
42-
render() {
43-
return h(
44-
this.as,
45-
{
46-
...this.$attrs,
47-
role: 'alert',
48-
},
49-
this.$slots.default && this.$slots.default()
50-
)
5123
},
5224
})
5325

packages/c-box/examples/base-box.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export default defineComponent({
1313
components: { CBox },
1414
setup() {
1515
const val = ref('Hello box')
16-
console.log('Base box setup ')
1716
1817
return { val }
1918
},
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
"dependencies": {
26+
"@chakra-ui/vue-next": "^1.0.0"
27+
}
28+
}

0 commit comments

Comments
 (0)