1
Fork 0
mirror of https://github.com/Steffo99/unisteffo.git synced 2024-11-22 07:54:22 +00:00
triennale-appunti-steffo/components/compat1.tsx

132 lines
2.8 KiB
TypeScript
Raw Normal View History

2022-02-03 03:26:51 +00:00
import * as Bluelib from "@steffo/bluelib-react"
import TeX from "@matejmazur/react-katex"
export const Split = ({title = undefined, children}) => {
return (
<Bluelib.Chapter>
{title ?
<Bluelib.Heading level={3}>
{title}
</Bluelib.Heading>
: null}
{children}
</Bluelib.Chapter>
)
}
2022-02-03 04:00:06 +00:00
export const Section = Split
2022-02-03 03:26:51 +00:00
2022-02-03 16:43:43 +00:00
export const Box = ({title = undefined, children, color = undefined}) => {
2022-02-03 03:26:51 +00:00
return (
2022-02-03 16:43:43 +00:00
<Bluelib.Box builtinColor={color}>
2022-02-03 03:26:51 +00:00
{title ?
<Bluelib.Heading level={4}>
{title}
</Bluelib.Heading>
: null}
{children}
</Bluelib.Box>
)
}
2022-02-03 04:00:06 +00:00
export const Example = (props) => {
return (
<Bluelib.Panel builtinColor="magenta" style={{minWidth: "auto"}} {...props}/>
)
}
2022-02-03 03:26:51 +00:00
export const Plus = (props) => {
return (
<Bluelib.BaseElement builtinColor={"red"} kind="span" {...props}/>
)
}
export const Minus = (props) => {
return (
<Bluelib.BaseElement builtinColor={"blue"} kind="span" {...props}/>
)
}
export const Color = ({builtin, ...props}) => {
return (
<Bluelib.BaseElement builtinColor={builtin} kind="span" {...props}/>
)
}
export const LatexMath = ({children, ...props}) => {
return (
<TeX math={children} {...props}/>
)
}
2022-02-03 04:00:06 +00:00
export const ILatex = (props) => {
2022-02-03 03:26:51 +00:00
return (
2022-02-03 04:00:06 +00:00
<LatexMath block={false} {...props}/>
)
}
export const BLatex = (props) => {
return (
<LatexMath block={true} {...props}/>
)
}
export const PLatex = (props) => {
return (
<p>
<BLatex {...props}/>
</p>
2022-02-03 03:26:51 +00:00
)
}
2022-02-03 04:00:06 +00:00
export const P = (props) => {
2022-02-03 03:26:51 +00:00
return (
2022-02-03 04:00:06 +00:00
<p {...props}/>
2022-02-03 03:26:51 +00:00
)
}
export const Todo = (props) => {
return (
2022-02-03 16:43:43 +00:00
<Bluelib.BaseElement builtinColor={"orange"} kind={"span"} {...props}/>
2022-02-03 03:26:51 +00:00
)
}
2022-02-03 04:00:06 +00:00
export const Help = ({text, ...props}) => {
return (
<Bluelib.BaseElement title={text} bluelibClassNames={"semantic-abbr"} kind={"span"} {...props}/>
)
}
2022-02-03 16:43:43 +00:00
export const TablePanel = ({children, ...props}) => {
return (
<Bluelib.Box>
<table>
{children}
</table>
</Bluelib.Box>
)
}
export const Code = (props) => {
return (
<pre>
<Bluelib.Code {...props}/>
</pre>
)
}
export const Image = (props) => {
return (
<Bluelib.Image limit="quarter" {...props}/>
)
}
2022-02-03 04:00:06 +00:00
export const Latex = LatexMath
2022-02-03 15:27:46 +00:00
export const Panel = Box
2022-02-03 04:00:06 +00:00
export const B = Bluelib.BringAttention
export const I = Bluelib.Idiomatic
export const LI = Bluelib.ListUnordered.Item
2022-02-03 03:26:51 +00:00
export const Anchor = Bluelib.Anchor
2022-02-03 16:43:43 +00:00
export const Link = Bluelib.Anchor
export const BaseLink = Bluelib.Anchor
2022-02-03 03:26:51 +00:00
export const r = String.raw