@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.
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/types/stories/molecules/inputs/InputLabel/InputLabel.d.ts +1 -0
- package/dist/types/stories/molecules/inputs/checkbox/Checkbox.d.ts +2 -0
- package/package.json +1 -1
- package/stories/molecules/inputs/InputLabel/InputLabel.tsx +9 -3
- package/stories/molecules/inputs/checkbox/Checkbox.tsx +11 -2
- package/stories/organisms/DropdownWithMultiSelect/DropdownWithMultiSelect.tsx +1 -0
package/package.json
CHANGED
|
@@ -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" : ""}
|
|
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
|
|
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 && (
|