diff --git a/package.json b/package.json index 5695195..0e93327 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@inkonchain/ink-kit", - "version": "0.3.0", + "version": "0.3.2", "description": "", "main": "dist/index.cjs.js", "module": "dist/index.es.js", diff --git a/src/components/Input/Input.stories.tsx b/src/components/Input/Input.stories.tsx index 7a52eff..cc4e5f8 100644 --- a/src/components/Input/Input.stories.tsx +++ b/src/components/Input/Input.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from "@storybook/react"; import { Input, type InputProps } from "./index"; +import { InkIcon } from "../.."; const meta: Meta = { title: "Components/Input", @@ -17,3 +18,15 @@ type Story = StoryObj; export const Simple: Story = { args: {}, }; + +export const WithIconLeft: Story = { + args: { + iconLeft: , + }, +}; + +export const WithIconRight: Story = { + args: { + iconRight: , + }, +}; diff --git a/src/components/Input/Input.tsx b/src/components/Input/Input.tsx index 9212424..6c5227d 100644 --- a/src/components/Input/Input.tsx +++ b/src/components/Input/Input.tsx @@ -4,20 +4,32 @@ import { classNames } from "../../util/classes"; export interface InputProps extends React.InputHTMLAttributes { className?: string; + iconLeft?: React.ReactNode; + iconRight?: React.ReactNode; } export const Input = forwardRef( - ({ className, ...props }, ref) => { + ({ className, iconLeft, iconRight, ...props }, ref) => { + const iconClasses = + "ink:shrink-0 ink:size-3 ink:-my-1 ink:flex ink:items-center ink:justify-center ink:text-text-muted ink:group-focus-within:text-text-on-secondary ink:transition-colors ink:transition-default-animation"; return ( - + > + {iconLeft &&
{iconLeft}
} + + {iconRight &&
{iconRight}
} + ); } );