UNPKG

@chakra-ui/react

Version:

Responsive and accessible React UI components built with React and Emotion

35 lines (32 loc) • 1.01 kB
"use strict"; "use client"; import { jsx } from 'react/jsx-runtime'; import { forwardRef, useMemo } from 'react'; import { createRecipeContext } from '../../styled-system/create-recipe-context.js'; import { chakra } from '../../styled-system/factory.js'; import { useRecipe } from '../../styled-system/use-recipe.js'; const { withContext, PropsProvider } = createRecipeContext({ key: "kbd" }); const Kbd = withContext("kbd"); const KbdPropsProvider = PropsProvider; const KbdGroup = forwardRef( function KbdGroup2(props, ref) { const recipe = useRecipe({ key: "kbd" }); const [variantProps, localProps] = useMemo( () => recipe.splitVariantProps(props), [props, recipe] ); return /* @__PURE__ */ jsx(PropsProvider, { value: variantProps, children: /* @__PURE__ */ jsx( chakra.kbd, { ref, display: "inline-flex", alignItems: "center", gap: "1", ...localProps } ) }); } ); export { Kbd, KbdGroup, KbdPropsProvider };