diff --git a/package.json b/package.json index 12e0929..fea6392 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@agility/plenum-ui", - "version": "2.3.1", + "version": "2.3.2", "license": "MIT", "main": "dist/index.js", "module": "dist/index.js", diff --git a/stories/atoms/icons/TablerIcon.tsx b/stories/atoms/icons/TablerIcon.tsx index 441bb6d..8997053 100644 --- a/stories/atoms/icons/TablerIcon.tsx +++ b/stories/atoms/icons/TablerIcon.tsx @@ -24,7 +24,8 @@ export interface ITablerIconProps extends React.DetailedHTMLProps = ({ icon, - className = "w-6 h-6 text-gray-600" + className = "w-6 h-6 text-gray-600", + ...rest }: ITablerIconProps): JSX.Element | null => { const [Icon, setIcon] = useState | null>( iconRegistry && icon ? (iconRegistry[icon] ?? null) : null @@ -38,7 +39,7 @@ const TablerIcon: React.FC = ({ if (!Icon) return null; return ( - + ); diff --git a/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx b/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx index 2f39dbc..88c3724 100644 --- a/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx +++ b/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from "@storybook/react"; -import FormInputWithAddons, { IFormInputWithAddonsProps } from "./FormInputWithAddons"; +import { action } from "@storybook/addon-actions"; +import FormInputWithAddons from "./FormInputWithAddons"; const meta: Meta = { title: "Design System/organisms/Form Input With Addons", @@ -27,6 +28,19 @@ export const DefaultFormInputWithAddons: Story = { trailIcon: { icon: "IconSearch" } } }; +export const TrailIconWithOnClick: Story = { + args: { + id: "appSearch", + name: "appSearch", + type: "text", + placeholder: "Search...", + trailIcon: { + icon: "IconX", + onClick: action("trailIcon clicked") + } + } +}; + export const FormInputWithAddonBTN: Story = { args: { id: "appSearch", diff --git a/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx b/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx index 522f599..bece1db 100644 --- a/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +++ b/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx @@ -121,27 +121,52 @@ const FormInputWithAddons: React.FC = ({ }} /> {(trailLabel || trailIcon) && ( - + trailIcon?.onClick ? ( + + ) : ( + + ) )} {addonBTN && (