Skip to content

Commit b1e282e

Browse files
committed
chore: rabbit-review
1 parent d800732 commit b1e282e

File tree

5 files changed

+37
-20
lines changed

5 files changed

+37
-20
lines changed

src/lib/button/ButtonIcon.tsx

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,28 @@ const ButtonIcon: React.FC<
66
Pick<ButtonProps, "Icon" | "icon" | "isDisabled" | "isLoading" | "variant">
77
> = ({ Icon, icon, isDisabled, isLoading, variant }) => {
88
const isSecondary = variant === "secondary";
9-
return icon
10-
? !isLoading && icon
11-
: Icon && (
12-
<Icon
13-
className={cn(
14-
"button-svg",
15-
"mr-2 size-4",
16-
"fill-klerosUIComponentsWhiteBackground",
17-
isLoading && ["invisible"],
18-
isSecondary && ["fill-klerosUIComponentsPrimaryBlue"],
19-
isDisabled && ["fill-klerosUIComponentsStroke"],
20-
)}
21-
/>
22-
);
9+
return icon ? (
10+
isLoading ? (
11+
<span
12+
className={cn("button-svg", "mr-2 size-4", "invisible")}
13+
aria-hidden
14+
/>
15+
) : (
16+
icon
17+
)
18+
) : (
19+
Icon && (
20+
<Icon
21+
className={cn(
22+
"button-svg",
23+
"mr-2 size-4",
24+
"fill-klerosUIComponentsWhiteBackground",
25+
isLoading && ["invisible"],
26+
isSecondary && ["fill-klerosUIComponentsPrimaryBlue"],
27+
isDisabled && ["fill-klerosUIComponentsStroke"],
28+
)}
29+
/>
30+
)
31+
);
2332
};
2433
export default ButtonIcon;

src/lib/form/file-uploader.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from "react";
1+
import React, { useEffect, useState } from "react";
22
import UploadIcon from "../../assets/svgs/form/upload-icon.svg";
33
import SuccessIcon from "../../assets/svgs/status-icons/success.svg";
44
import ErrorIcon from "../../assets/svgs/status-icons/error.svg";
@@ -48,6 +48,10 @@ function FileUploader({
4848
selectedFile,
4949
);
5050

51+
useEffect(() => {
52+
setFileSelected(selectedFile);
53+
}, [selectedFile]);
54+
5155
return (
5256
<div className={cn("box-border h-fit w-50", className)}>
5357
<DropZone
@@ -81,7 +85,8 @@ function FileUploader({
8185
const file = await item.getFile();
8286
const validated = validationFunction?.(file) ?? true;
8387
if (!validated) return;
84-
setFileSelected(file);
88+
if (selectedFile === undefined) setFileSelected(file);
89+
8590
callback(file);
8691
}
8792
}}
@@ -94,7 +99,7 @@ function FileUploader({
9499
const file = e[0];
95100
const validated = validationFunction?.(file) ?? true;
96101
if (!validated) return;
97-
setFileSelected(file);
102+
if (selectedFile === undefined) setFileSelected(file);
98103
callback(file);
99104
}
100105
}}

src/lib/progress/timeline/custom.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from "react";
22
import Bullet, { StateProp, VariantProp } from "./bullet";
33
import { cn } from "../../../utils";
44

5-
interface TimelineItem extends VariantProp, StateProp {
5+
export interface TimelineItem extends VariantProp, StateProp {
66
title: string;
77
party: string | React.ReactElement;
88
subtitle: string;

src/lib/progress/timeline/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface TimelineItem extends SideProp, VariantProp {
1010
}
1111

1212
export interface TimelineProps {
13-
items: TimelineItem[];
13+
items: [TimelineItem, ...TimelineItem[]];
1414
className?: string;
1515
}
1616

src/lib/tooltip/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ function Tooltip({
4444
return (
4545
<TooltipTrigger {...{ delay }} {...props}>
4646
<Focusable>
47-
<div {...props.wrapperProps} role="button">
47+
<div
48+
{...props.wrapperProps}
49+
role={props?.wrapperProps?.role ?? "button"}
50+
>
4851
{children}
4952
</div>
5053
</Focusable>

0 commit comments

Comments
 (0)