aboutsummaryrefslogtreecommitdiff
path: root/components/Input/index.tsx
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2023-08-28 21:33:44 -0500
committerFurkan Sahin <furkan-dev@proton.me>2023-08-28 21:33:44 -0500
commit2a308fb5bec47aac0f59e074d793cec6e95db1c3 (patch)
treee8d8026ab7074ae1c273c819e049eb211309e04f /components/Input/index.tsx
parenta0e64e73ef07c1cc3623d2712c483bf45884d350 (diff)
Add wg2nd
Diffstat (limited to 'components/Input/index.tsx')
-rw-r--r--components/Input/index.tsx22
1 files changed, 22 insertions, 0 deletions
diff --git a/components/Input/index.tsx b/components/Input/index.tsx
new file mode 100644
index 0000000..69f64fa
--- /dev/null
+++ b/components/Input/index.tsx
@@ -0,0 +1,22 @@
+import React, { TextareaHTMLAttributes, ForwardRefRenderFunction } from 'react';
+import { getSystemStyle, SystemProps } from '../utils/systemProps';
+import inputElStyle from '../utils/inputElementStyle';
+
+interface InputProps
+ extends React.InputHTMLAttributes<HTMLInputElement>,
+ SystemProps
+{ }
+
+const Input: ForwardRefRenderFunction<HTMLInputElement, InputProps> =
+ ({ style, ...props }, ref) => {
+ style = {
+ ...inputElStyle,
+ ...style,
+ };
+
+ const systemStyle = getSystemStyle(props, style);
+
+ return <input ref={ref} style={systemStyle} {...props} />;
+ };
+
+export default React.forwardRef(Input);