From d67896c52ec0fe165d1590d9a9f777718dbe6d7e Mon Sep 17 00:00:00 2001 From: DerekAgility Date: Mon, 23 Feb 2026 16:07:27 -0500 Subject: [PATCH] Added message prop for select --- package.json | 2 +- .../inputs/InputCounter/InputCounter.tsx | 2 +- .../inputs/InputLabel/InputLabel.tsx | 2 +- .../molecules/inputs/TextInput/TextInput.tsx | 2 +- .../inputs/select/Select.stories.tsx | 24 ++++++++++--------- stories/molecules/inputs/select/Select.tsx | 10 +++++++- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 0abc78d9..a82982ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@agility/plenum-ui", - "version": "2.2.4", + "version": "2.2.5", "license": "MIT", "main": "dist/index.js", "module": "dist/index.js", diff --git a/stories/molecules/inputs/InputCounter/InputCounter.tsx b/stories/molecules/inputs/InputCounter/InputCounter.tsx index 1eb6cfb4..920884ea 100644 --- a/stories/molecules/inputs/InputCounter/InputCounter.tsx +++ b/stories/molecules/inputs/InputCounter/InputCounter.tsx @@ -1,5 +1,5 @@ import { FC } from "react"; -import Paragraph from "../../../atoms/Typography/Paragraph/Paragraph"; +import Paragraph from "@/stories/atoms/Typography/Paragraph/Paragraph"; export interface IInputCounterProps { /** Counter limit */ diff --git a/stories/molecules/inputs/InputLabel/InputLabel.tsx b/stories/molecules/inputs/InputLabel/InputLabel.tsx index c89540f5..421eec87 100644 --- a/stories/molecules/inputs/InputLabel/InputLabel.tsx +++ b/stories/molecules/inputs/InputLabel/InputLabel.tsx @@ -3,7 +3,7 @@ //@ts-ignore import React, { FC } from "react"; import { default as cn } from "classnames"; -import Label from "../../../atoms/Typography/Label/Label"; +import Label from "@/stories/atoms/Typography/Label/Label"; export interface IInputLabelProps { /** Prop comment */ diff --git a/stories/molecules/inputs/TextInput/TextInput.tsx b/stories/molecules/inputs/TextInput/TextInput.tsx index 7aedb5c9..7022fc35 100644 --- a/stories/molecules/inputs/TextInput/TextInput.tsx +++ b/stories/molecules/inputs/TextInput/TextInput.tsx @@ -3,7 +3,7 @@ import { default as cn } from "classnames"; import InputLabel from "../InputLabel"; import InputField, { AcceptedInputTypes } from "../InputField"; import InputCounter from "../InputCounter"; -import Paragraph from "../../../atoms/Typography/Paragraph/Paragraph"; +import Paragraph from "@/stories/atoms/Typography/Paragraph/Paragraph"; export interface ITextInputProps { /** Input type*/ diff --git a/stories/molecules/inputs/select/Select.stories.tsx b/stories/molecules/inputs/select/Select.stories.tsx index d7e57c0e..f8e7cdd4 100644 --- a/stories/molecules/inputs/select/Select.stories.tsx +++ b/stories/molecules/inputs/select/Select.stories.tsx @@ -1,5 +1,5 @@ -import type { Meta, StoryObj } from "@storybook/react" -import Select from "./Select" +import type { Meta, StoryObj } from "@storybook/react"; +import Select from "./Select"; const meta: Meta = { title: "Design System/Molecules/Inputs/Select", @@ -13,15 +13,15 @@ const meta: Meta = {
- ) + ); } - return + return ; } ] -} +}; -export default meta -type TStory = StoryObj +export default meta; +type TStory = StoryObj; export const DefaultSelect: TStory = { args: { @@ -34,9 +34,10 @@ export const DefaultSelect: TStory = { ], isDisabled: false, isError: false, - isRequired: false + isRequired: false, + message: "Message" } -} +}; export const DefaultSelectDarkBG: TStory = { args: { label: "Label", @@ -48,6 +49,7 @@ export const DefaultSelectDarkBG: TStory = { ], isDisabled: false, isError: false, - isRequired: false + isRequired: false, + message: "Message" } -} +}; diff --git a/stories/molecules/inputs/select/Select.tsx b/stories/molecules/inputs/select/Select.tsx index 9b228d7a..c140315f 100644 --- a/stories/molecules/inputs/select/Select.tsx +++ b/stories/molecules/inputs/select/Select.tsx @@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react"; import InputLabel from "@/stories/molecules/inputs/InputLabel"; import { useId } from "@/utils/useId"; import { default as cn } from "classnames"; +import Paragraph from "@/stories/atoms/Typography/Paragraph/Paragraph"; export interface ISimpleSelectOptions { label: string; @@ -28,6 +29,7 @@ export interface ISelectProps { className?: string; onFocus?: () => void; onBlur?: () => void; + message?: string; } const Select: React.FC = ({ label, @@ -41,7 +43,8 @@ const Select: React.FC = ({ value, className, onFocus, - onBlur + onBlur, + message }) => { const [selectedOption, setSelectedOption] = useState(value || options[0].value); const uniqueID = useId(); @@ -87,6 +90,11 @@ const Select: React.FC = ({ ); })} + {message && ( + + {message} + + )} ); };