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

Commit 45885ea

Browse files
committed
chore: add global types
1 parent d5c368d commit 45885ea

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

global.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
declare global {
2+
namespace JSX {
3+
interface IntrinsicAttributes {
4+
as?: string
5+
label?: string
6+
}
7+
}
8+
}

packages/c-button/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"license": "MIT",
1515
"scripts": {
1616
"build": "concurrently yarn:build:*",
17-
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .tsx -d dist/esm --source-maps",
18-
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .tsx -d dist/cjs --source-maps",
17+
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions '.ts, .tsx' -d dist/esm --source-maps",
18+
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions '.ts, .tsx' -d dist/cjs --source-maps",
1919
"build:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
2020
"watch": "concurrently yarn:watch:*",
21-
"watch:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .tsx -d dist/esm --source-maps --watch",
22-
"watch:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .tsx -d dist/cjs --source-maps --watch",
21+
"watch:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions '.ts, .tsx' -d dist/esm --source-maps --watch",
22+
"watch:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions '.ts, .tsx' -d dist/cjs --source-maps --watch",
2323
"watch:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch"
2424
},
2525
"dependencies": {

packages/c-button/src/button.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ const CButtonIcon = defineComponent({
149149
: children?.[0]
150150

151151
return () =>
152-
<chakra.span label="button__icon" {...attrs}>
152+
// @ts-ignore JSX props error
153+
<chakra.span as="button__icon" {...attrs}>
153154
{_children}
154155
</chakra.span>
155156
},

packages/system/src/chakra.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const chakraProps = {
6060
layerStyle: String as PropType<StyleResolverProps['layerStyle']>,
6161
textStyle: String as PropType<StyleResolverProps['textStyle']>,
6262
apply: String as PropType<StyleResolverProps['apply']>,
63+
label: String as PropType<StyleResolverOptions['label']>,
6364
}
6465

6566
export type ChakraBaseComponentProps = typeof chakraProps

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
1717
"skipLibCheck": true, /* Skip type checking of declaration files. */
1818
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
19-
19+
"typeRoots": ["./node_modules/@types", "./jsx.d.ts"]
2020
},
2121
"include": [
2222
"packages",

0 commit comments

Comments
 (0)