Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion stories/molecules/inputs/InputCounter/InputCounter.tsx
Original file line number Diff line number Diff line change
@@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion stories/molecules/inputs/InputLabel/InputLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion stories/molecules/inputs/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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*/
Expand Down
24 changes: 13 additions & 11 deletions stories/molecules/inputs/select/Select.stories.tsx
Original file line number Diff line number Diff line change
@@ -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<typeof Select> = {
title: "Design System/Molecules/Inputs/Select",
Expand All @@ -13,15 +13,15 @@ const meta: Meta<typeof Select> = {
<div className="bg-transparent-black-03 rounded p-6">
<Story />
</div>
)
);
}
return <Story />
return <Story />;
}
]
}
};

export default meta
type TStory = StoryObj<typeof Select>
export default meta;
type TStory = StoryObj<typeof Select>;

export const DefaultSelect: TStory = {
args: {
Expand All @@ -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",
Expand All @@ -48,6 +49,7 @@ export const DefaultSelectDarkBG: TStory = {
],
isDisabled: false,
isError: false,
isRequired: false
isRequired: false,
message: "Message"
}
}
};
10 changes: 9 additions & 1 deletion stories/molecules/inputs/select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,6 +29,7 @@ export interface ISelectProps {
className?: string;
onFocus?: () => void;
onBlur?: () => void;
message?: string;
}
const Select: React.FC<ISelectProps> = ({
label,
Expand All @@ -41,7 +43,8 @@ const Select: React.FC<ISelectProps> = ({
value,
className,
onFocus,
onBlur
onBlur,
message
}) => {
const [selectedOption, setSelectedOption] = useState<string>(value || options[0].value);
const uniqueID = useId();
Expand Down Expand Up @@ -87,6 +90,11 @@ const Select: React.FC<ISelectProps> = ({
);
})}
</select>
{message && (
<Paragraph size="md" className={isError ? "text-red-600" : "text-gray-500"}>
{message}
</Paragraph>
)}
</div>
);
};
Expand Down