@agility/plenum-ui 2.2.4 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tailwind.css CHANGED
@@ -1940,8 +1940,8 @@ select {
1940
1940
  min-height: 0px !important;
1941
1941
  }
1942
1942
 
1943
- .min-h-\[38px\] {
1944
- min-height: 38px;
1943
+ .min-h-\[20px\] {
1944
+ min-height: 20px;
1945
1945
  }
1946
1946
 
1947
1947
  .w-1 {
@@ -24,6 +24,7 @@ export interface ISelectProps {
24
24
  className?: string;
25
25
  onFocus?: () => void;
26
26
  onBlur?: () => void;
27
+ message?: string;
27
28
  }
28
29
  declare const Select: React.FC<ISelectProps>;
29
30
  export default Select;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agility/plenum-ui",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -1,5 +1,5 @@
1
1
  import { FC } from "react";
2
- import Paragraph from "../../../atoms/Typography/Paragraph/Paragraph";
2
+ import Paragraph from "@/stories/atoms/Typography/Paragraph/Paragraph";
3
3
 
4
4
  export interface IInputCounterProps {
5
5
  /** Counter limit */
@@ -3,7 +3,7 @@
3
3
  //@ts-ignore
4
4
  import React, { FC } from "react";
5
5
  import { default as cn } from "classnames";
6
- import Label from "../../../atoms/Typography/Label/Label";
6
+ import Label from "@/stories/atoms/Typography/Label/Label";
7
7
 
8
8
  export interface IInputLabelProps {
9
9
  /** Prop comment */
@@ -3,7 +3,7 @@ import { default as cn } from "classnames";
3
3
  import InputLabel from "../InputLabel";
4
4
  import InputField, { AcceptedInputTypes } from "../InputField";
5
5
  import InputCounter from "../InputCounter";
6
- import Paragraph from "../../../atoms/Typography/Paragraph/Paragraph";
6
+ import Paragraph from "@/stories/atoms/Typography/Paragraph/Paragraph";
7
7
 
8
8
  export interface ITextInputProps {
9
9
  /** Input type*/
@@ -57,7 +57,7 @@ const Checkbox: FC<ICheckboxProps> = ({
57
57
  { "border-red-500 shadow-none": isError }
58
58
  );
59
59
  const wrapperStyles = cn(
60
- "relative flex items-center min-h-[38px]",
60
+ "relative flex items-center min-h-[20px]",
61
61
  { "opacity-50": isDisabled },
62
62
  { "rounded-sm border border-1 px-3 border-gray-200": hasBorder },
63
63
  { "py-3": hasBorder && message },
@@ -1,5 +1,5 @@
1
- import type { Meta, StoryObj } from "@storybook/react"
2
- import Select from "./Select"
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import Select from "./Select";
3
3
 
4
4
  const meta: Meta<typeof Select> = {
5
5
  title: "Design System/Molecules/Inputs/Select",
@@ -13,15 +13,15 @@ const meta: Meta<typeof Select> = {
13
13
  <div className="bg-transparent-black-03 rounded p-6">
14
14
  <Story />
15
15
  </div>
16
- )
16
+ );
17
17
  }
18
- return <Story />
18
+ return <Story />;
19
19
  }
20
20
  ]
21
- }
21
+ };
22
22
 
23
- export default meta
24
- type TStory = StoryObj<typeof Select>
23
+ export default meta;
24
+ type TStory = StoryObj<typeof Select>;
25
25
 
26
26
  export const DefaultSelect: TStory = {
27
27
  args: {
@@ -34,9 +34,10 @@ export const DefaultSelect: TStory = {
34
34
  ],
35
35
  isDisabled: false,
36
36
  isError: false,
37
- isRequired: false
37
+ isRequired: false,
38
+ message: "Message"
38
39
  }
39
- }
40
+ };
40
41
  export const DefaultSelectDarkBG: TStory = {
41
42
  args: {
42
43
  label: "Label",
@@ -48,6 +49,7 @@ export const DefaultSelectDarkBG: TStory = {
48
49
  ],
49
50
  isDisabled: false,
50
51
  isError: false,
51
- isRequired: false
52
+ isRequired: false,
53
+ message: "Message"
52
54
  }
53
- }
55
+ };
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react";
2
2
  import InputLabel from "@/stories/molecules/inputs/InputLabel";
3
3
  import { useId } from "@/utils/useId";
4
4
  import { default as cn } from "classnames";
5
+ import Paragraph from "@/stories/atoms/Typography/Paragraph/Paragraph";
5
6
 
6
7
  export interface ISimpleSelectOptions {
7
8
  label: string;
@@ -28,6 +29,7 @@ export interface ISelectProps {
28
29
  className?: string;
29
30
  onFocus?: () => void;
30
31
  onBlur?: () => void;
32
+ message?: string;
31
33
  }
32
34
  const Select: React.FC<ISelectProps> = ({
33
35
  label,
@@ -41,7 +43,8 @@ const Select: React.FC<ISelectProps> = ({
41
43
  value,
42
44
  className,
43
45
  onFocus,
44
- onBlur
46
+ onBlur,
47
+ message
45
48
  }) => {
46
49
  const [selectedOption, setSelectedOption] = useState<string>(value || options[0].value);
47
50
  const uniqueID = useId();
@@ -87,6 +90,11 @@ const Select: React.FC<ISelectProps> = ({
87
90
  );
88
91
  })}
89
92
  </select>
93
+ {message && (
94
+ <Paragraph size="md" className={isError ? "text-red-600" : "text-gray-500"}>
95
+ {message}
96
+ </Paragraph>
97
+ )}
90
98
  </div>
91
99
  );
92
100
  };