Comparing version 0.5.4 to 0.5.5
@@ -29,2 +29,3 @@ import React from 'react'; | ||
theme?: BrightTheme; | ||
title?: string; | ||
}; | ||
@@ -31,0 +32,0 @@ type CodeComponent = ((props: CodeProps) => Promise<JSX.Element>) & { |
@@ -150,3 +150,3 @@ "use strict"; | ||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
"span", | ||
"code", | ||
{ | ||
@@ -225,2 +225,3 @@ style: { | ||
unstyled, | ||
title, | ||
theme | ||
@@ -246,3 +247,4 @@ }) { | ||
theme: darkTheme, | ||
scheme: "dark" | ||
scheme: "dark", | ||
title | ||
} | ||
@@ -262,3 +264,4 @@ ), | ||
theme: lightTheme, | ||
scheme: "light" | ||
scheme: "light", | ||
title | ||
} | ||
@@ -279,3 +282,4 @@ ) | ||
unstyled, | ||
theme: finalTheme | ||
theme: finalTheme, | ||
title | ||
} | ||
@@ -282,0 +286,0 @@ ); |
{ | ||
"name": "bright", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/index.mjs", |
@@ -25,51 +25,4 @@ **work in progress** | ||
--- | ||
## License | ||
```jsx | ||
import { Code } from "bright" | ||
const myCode = ` | ||
let hello = "hello brightness" | ||
console.log(hello, "my old friend") | ||
`.trim() | ||
export default function Page() { | ||
return ( | ||
<Code lang="js" lineNumbers> | ||
{myCode} | ||
</Code> | ||
) | ||
} | ||
``` | ||
--- | ||
```jsx | ||
import { Code } from "bright" | ||
const myCode = ` | ||
let hello = "hello brightness" | ||
console.log(hello, "my old friend") | ||
`.trim() | ||
// you can set any prop globally | ||
Code.lineNumbers = true | ||
export default function Page() { | ||
return <Code lang="js">{myCode}</Code> | ||
} | ||
``` | ||
--- | ||
```jsx | ||
import { Code } from "bright" | ||
// there are some built in themes | ||
// typescript should autocomplete this | ||
Code.theme = "github-dark" | ||
export default function Page() { | ||
return <Code lang="py">print("hello brightness")</Code> | ||
} | ||
``` | ||
MIT |
Sorry, the diff of this file is not supported yet
579
17210
28