File size: 776 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
import type {
  HTMLChakraProps,
  RecipeVariantProps,
  UnstyledProp,
} from "@chakra-ui/react"
import { createRecipeContext, defineRecipe } from "@chakra-ui/react"

const buttonRecipe = defineRecipe({
  className: "button",
  base: {
    padding: "10px",
    borderRadius: "4px",
    backgroundColor: "red",
    color: "white",
  },
  variants: {
    bold: {
      true: {
        fontWeight: "bold",
      },
    },
  },
})

const { withContext } = createRecipeContext({
  recipe: buttonRecipe,
})

interface ButtonProps
  extends HTMLChakraProps<"button", RecipeVariantProps<typeof buttonRecipe>>,
    UnstyledProp {}

const Button = withContext<HTMLButtonElement, ButtonProps>("button")

export const SystemInlineRecipe = () => {
  return <Button bold>Welcome</Button>
}