Skip to content

Commit

Permalink
Typefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminleonard committed Oct 4, 2023
1 parent d80a059 commit 0e6f9c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion components/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*
* Copyright Oxide Computer Company
*/
import cn from 'classnames'
import { createElement } from 'react'

const titleCase = (text: string): string => {
return text.replace(
Expand All @@ -20,7 +22,7 @@ const make =
// only one argument here means string interpolations are not allowed
(strings: TemplateStringsArray) => {
const Comp = ({ className, children, ...rest }: JSX.IntrinsicElements[T]) =>
React.createElement(tag, { className: cn(strings[0], className), ...rest }, children)
createElement(tag, { className: cn(strings[0], className), ...rest }, children)
Comp.displayName = `classed.${tag}`
return Comp
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"build:components": "tsup --dts",
"release": "auto shipit",
"lint": "eslint --ext .js,.ts,.tsx,.json .",
"fmt": "prettier --cache --write . && npm run lint -- --fix"
"fmt": "prettier --cache --write . && npm run lint -- --fix",
"tsc": "tsc"
},
"author": "Oxide Computer Company <[email protected]>",
"license": "MPL 2.0",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"paths": {
"~/*": ["./components/*"],
"@/*": ["./*"]
}
},
"allowImportingTsExtensions": true
},
"include": ["components/**/*.ts", "components/**/*.tsx"],
"references": [{ "path": "./tsconfig.node.json" }]
Expand Down

0 comments on commit 0e6f9c3

Please sign in to comment.