File size: 1,456 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { BlitzFillIcon } from "@/components/site/icons"
import {
  HStack,
  Heading,
  HeadingProps,
  Highlight,
  StackProps,
  Text,
  TextProps,
  defineStyle,
} from "@chakra-ui/react"

const styles = defineStyle({
  color: { _light: "teal.600", _dark: "teal.500" },
  position: "relative",
  px: "2",
  display: "inline-block",
  _before: {
    position: "absolute",
    content: "''",
    w: "full",
    h: "full",
    bg: "teal.500/10",
    roundedStart: "md",
    pointerEvents: "none",
    bottom: "-0.5",
    insetInlineStart: "0",
    borderEndWidth: "2px",
    borderColor: "currentColor",
  },
})

interface HighlightHeadingProps extends HeadingProps {
  query: string
  children: string
}

export const HighlightHeading = (props: HighlightHeadingProps) => {
  const { query, children, ...rest } = props
  return (
    <Heading textStyle={{ base: "4xl", md: "5xl" }} {...rest}>
      <Highlight query={query} styles={styles}>
        {children}
      </Highlight>
    </Heading>
  )
}

export const Subheading = (props: TextProps) => (
  <Text textStyle="xl" color="fg.muted" maxW="2xl" {...props} />
)

interface BlitzHeadingProps extends StackProps {}

export const BlitzHeading = (props: BlitzHeadingProps) => {
  const { children, ...rest } = props
  return (
    <HStack gap="4" color={{ _light: "teal.600", _dark: "teal.500" }} {...rest}>
      <BlitzFillIcon />
      <Text fontWeight="semibold">{children}</Text>
    </HStack>
  )
}