UNPKG

@yamada-ui/react

Version:

React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion

1 lines 1.53 kB
{"version":3,"file":"input-element.cjs","names":["createComponent","inputElementStyle","useInputBorder"],"sources":["../../../../src/components/input/input-element.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { InputProps } from \"./input\"\nimport type { InputElementStyle } from \"./input-element.style\"\nimport { createComponent } from \"../../core\"\nimport { inputElementStyle } from \"./input-element.style\"\nimport { useInputBorder } from \"./use-input-border\"\n\nexport interface InputElementProps\n extends HTMLStyledProps,\n ThemeProps<InputElementStyle>,\n Pick<InputProps, \"errorBorderColor\" | \"focusBorderColor\"> {}\n\nconst {\n PropsContext: InputElementPropsContext,\n usePropsContext: useInputElementPropsContext,\n withContext,\n} = createComponent<InputElementProps, InputElementStyle>(\n \"input-element\",\n inputElementStyle,\n)\n\nexport { InputElementPropsContext, useInputElementPropsContext }\n\nexport const InputElement = withContext(\"div\")(\n { \"data-input-element\": \"\" },\n ({ errorBorderColor, focusBorderColor, ...rest }) => {\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n\n return { ...varProps, ...rest }\n },\n)\n"],"mappings":";;;;;;;;AAcA,MAAM,EACJ,cAAc,0BACd,iBAAiB,6BACjB,gBACEA,yCACF,iBACAC,8CACD;AAID,MAAa,eAAe,YAAY,MAAM,CAC5C,EAAE,sBAAsB,IAAI,GAC3B,EAAE,kBAAkB,iBAAkB,GAAG,WAAW;AAGnD,QAAO;EAAE,GAFQC,wCAAe;GAAE;GAAkB;GAAkB,CAAC;EAEjD,GAAG;EAAM;EAElC"}