UNPKG

@yamada-ui/react

Version:

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

1 lines 2.03 kB
{"version":3,"file":"input.cjs","names":["createComponent","inputStyle","useFieldProps","useInputBorder"],"sources":["../../../../src/components/input/input.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { FieldProps } from \"../field\"\nimport type { InputStyle } from \"./input.style\"\nimport type { UseInputBorderProps } from \"./use-input-border\"\nimport { createComponent } from \"../../core\"\nimport { useFieldProps } from \"../field\"\nimport { inputStyle } from \"./input.style\"\nimport { useInputBorder } from \"./use-input-border\"\n\nexport interface InputProps\n extends Omit<HTMLStyledProps<\"input\">, \"size\">,\n ThemeProps<InputStyle>,\n UseInputBorderProps,\n FieldProps {\n /**\n * The native HTML `size` attribute to be passed to the `input`.\n */\n htmlSize?: number\n}\n\nconst {\n PropsContext: InputPropsContext,\n usePropsContext: useInputPropsContext,\n withContext,\n} = createComponent<InputProps, InputStyle>(\"input\", inputStyle)\n\nexport { InputPropsContext, useInputPropsContext }\n\n/**\n * `Input` is a component used to obtain text input from the user.\n *\n * @see https://yamada-ui.com/docs/components/input\n */\nexport const Input = withContext(\"input\")(undefined, (props) => {\n const {\n props: { errorBorderColor, focusBorderColor, htmlSize, ...rest },\n ariaProps,\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n\n return {\n size: htmlSize,\n ...ariaProps,\n ...dataProps,\n ...eventProps,\n ...varProps,\n ...rest,\n }\n})\n"],"mappings":";;;;;;;;;AAsBA,MAAM,EACJ,cAAc,mBACd,iBAAiB,sBACjB,gBACEA,yCAAwC,SAASC,+BAAW;;;;;;AAShE,MAAa,QAAQ,YAAY,QAAQ,CAAC,SAAY,UAAU;CAC9D,MAAM,EACJ,OAAO,EAAE,kBAAkB,kBAAkB,SAAU,GAAG,QAC1D,WACA,WACA,eACEC,sCAAc,MAAM;CACxB,MAAM,WAAWC,wCAAe;EAAE;EAAkB;EAAkB,CAAC;AAEvE,QAAO;EACL,MAAM;EACN,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACJ;EACD"}