@agility/plenum-ui 2.1.20-rc7 → 2.1.20

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.
@@ -10,6 +10,7 @@ export interface IInputLabelProps {
10
10
  isFocused?: boolean;
11
11
  label?: string;
12
12
  truncateLabel?: boolean;
13
+ fullWidthLabel?: boolean;
13
14
  }
14
15
  /** Comment */
15
16
  declare const InputLabel: FC<IInputLabelProps>;
@@ -24,6 +24,8 @@ export interface ICheckboxProps {
24
24
  className?: string;
25
25
  /** Truncate label */
26
26
  truncateLabel?: boolean;
27
+ /** Full width label */
28
+ fullWidthLabel?: boolean;
27
29
  }
28
30
  /** Comment */
29
31
  declare const Checkbox: FC<ICheckboxProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agility/plenum-ui",
3
- "version": "2.1.20-rc7",
3
+ "version": "2.1.20",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -15,6 +15,7 @@ export interface IInputLabelProps {
15
15
  isFocused?: boolean;
16
16
  label?: string;
17
17
  truncateLabel?: boolean;
18
+ fullWidthLabel?: boolean;
18
19
  }
19
20
 
20
21
  /** Comment */
@@ -26,7 +27,8 @@ const InputLabel: FC<IInputLabelProps> = ({
26
27
  isActive,
27
28
  isError,
28
29
  label,
29
- truncateLabel = false
30
+ truncateLabel = false,
31
+ fullWidthLabel = false
30
32
  }: IInputLabelProps) => {
31
33
  const labelStyles = cn(
32
34
  "z-[2] ",
@@ -36,12 +38,16 @@ const InputLabel: FC<IInputLabelProps> = ({
36
38
  { "text-xs text-red-500 px-1 top-[10px] bg-white": isPlaceholder && isError },
37
39
  { "text-red-500 bg-white": !isPlaceholder && isError },
38
40
  { "text-gray-500/[.5]": isDisabled },
39
- { "inline-block transition-all text-sm text-gray-700 mb-1": !isPlaceholder }
41
+ { "inline-block transition-all text-sm text-gray-700 mb-1": !isPlaceholder },
42
+ { "block w-full": fullWidthLabel }
40
43
  );
44
+
41
45
  if (!label) return null;
42
46
  return (
43
47
  <label htmlFor={id} className={labelStyles}>
44
- <div className={truncateLabel ? "break-all line-clamp-1" : ""}>{label}</div>
48
+ <div className={truncateLabel ? "break-all line-clamp-1" : ""} title={label}>
49
+ {label}
50
+ </div>
45
51
  {isRequired && <span className="text-red-500"> *</span>}
46
52
  </label>
47
53
  );
@@ -28,6 +28,8 @@ export interface ICheckboxProps {
28
28
  className?: string;
29
29
  /** Truncate label */
30
30
  truncateLabel?: boolean;
31
+ /** Full width label */
32
+ fullWidthLabel?: boolean;
31
33
  }
32
34
 
33
35
  /** Comment */
@@ -44,6 +46,7 @@ const Checkbox: FC<ICheckboxProps> = ({
44
46
  hasBorder,
45
47
  className,
46
48
  truncateLabel = false,
49
+ fullWidthLabel = false,
47
50
  ...props
48
51
  }: ICheckboxProps) => {
49
52
  const uniqueID = useId();
@@ -85,9 +88,15 @@ const Checkbox: FC<ICheckboxProps> = ({
85
88
  {...props}
86
89
  />
87
90
  </div>
88
- <div className="ml-3 text-sm flex items-center">
91
+ <div className="ml-3 text-sm flex items-center w-full">
89
92
  <>
90
- <InputLabel label={label} isRequired={isRequired} id={id} truncateLabel={truncateLabel} />
93
+ <InputLabel
94
+ label={label}
95
+ isRequired={isRequired}
96
+ id={id}
97
+ truncateLabel={truncateLabel}
98
+ fullWidthLabel={fullWidthLabel}
99
+ />
91
100
  </>
92
101
 
93
102
  {message && (
@@ -46,6 +46,7 @@ const DropdownWithMultiSelect = ({ label, options }: Props) => {
46
46
  onChange={option.onClick}
47
47
  className="!min-h-0"
48
48
  truncateLabel
49
+ fullWidthLabel
49
50
  />
50
51
  </div>
51
52
  );