-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e2ab2e6
commit 48df411
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { Input, InputProps } from "./Input"; | ||
|
||
const meta: Meta<InputProps> = { | ||
title: "Components/Input", | ||
component: Input, | ||
tags: ["autodocs"], | ||
args: { | ||
placeholder: "Placeholder", | ||
type: "text", | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Simple: Story = { | ||
args: {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React, { forwardRef } from "react"; | ||
import { classNames, resetClasses } from "../../util/classes"; | ||
|
||
export interface InputProps | ||
extends React.InputHTMLAttributes<HTMLInputElement> { | ||
className?: string; | ||
} | ||
|
||
export const Input = forwardRef<HTMLInputElement, InputProps>( | ||
({ className, ...props }, ref) => { | ||
return ( | ||
<input | ||
ref={ref} | ||
className={classNames( | ||
resetClasses, | ||
"ink-w-full ink-rounded-8 ink-bg-background-container ink-p-2 ink-text-body-2", | ||
"focus:ink-outline focus:ink-outline-1 ink-outline-text-on-secondary", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./Input"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters