Skip to content

Commit b4350c4

Browse files
committed
chore: sonar-cloud-review
1 parent 7c54160 commit b4350c4

File tree

14 files changed

+47
-46
lines changed

14 files changed

+47
-46
lines changed

src/lib/breadcrumb.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function Breadcrumb({
5252
{text}
5353
</Content>
5454
) : (
55-
<React.Fragment key={i}>
55+
<React.Fragment key={`${text}-${i}`}>
5656
<Button
5757
className={clsx(clickable ? "cursor-pointer" : "cursor-text")}
5858
onPress={() => (callback ? callback(value) : null)}

src/lib/dropdown/select/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ function DropdownSelect({
3838
(selectedKey: Key) => {
3939
const selectedItem = items.find((item) => item.id === selectedKey);
4040
if (selectedItem) callback(selectedItem);
41-
return;
4241
},
4342
[items, callback],
4443
);

src/lib/progress/linear/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function Linear({
6666
strokeLinecap="round"
6767
>
6868
<path d={linePath} className="stroke-klerosUIComponentsStroke" />
69-
{value && (
69+
{!isUndefined(value) && (
7070
<path
7171
className={clsx(
7272
"stroke-klerosUIComponentsSuccess",

src/lib/progress/steps/bullet-circle.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ const BulletCircle: React.FC<BulletCircleProps> = ({
1515
line,
1616
index,
1717
}) => (
18-
<div className="flex h-full flex-col items-center justify-start">
18+
<div
19+
className="flex h-full flex-col items-center justify-start"
20+
aria-hidden="true"
21+
>
1922
{completed ? (
2023
<SuccessIcon className="fill-klerosUIComponentsPrimaryBlue size-6 basis-auto" />
2124
) : (

src/lib/progress/steps/bullet.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const Bullet: React.FC<BulletProps> = ({
2222
line,
2323
className,
2424
}) => (
25-
<div
25+
<li
2626
className={cn("flex w-fit grow basis-0", className)}
2727
aria-label={title}
2828
role="listitem"
@@ -52,7 +52,7 @@ const Bullet: React.FC<BulletProps> = ({
5252
{subitems.map((item, i) => (
5353
<small
5454
className="text-klerosUIComponentsSecondaryText text-xs font-normal break-words"
55-
key={i}
55+
key={`${item}-${i}`}
5656
aria-label={item}
5757
aria-description={`subitem ${i + 1}`}
5858
>
@@ -62,7 +62,7 @@ const Bullet: React.FC<BulletProps> = ({
6262
</div>
6363
)}
6464
</div>
65-
</div>
65+
</li>
6666
);
6767

6868
export default Bullet;

src/lib/progress/steps/horizontal-bullet.tsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const HorizontalBullet: React.FC<HorizontalBulletProps> = ({
3030
const paddingBottom = height;
3131

3232
return (
33-
<div
33+
<li
3434
className={clsx(
3535
"relative flex h-fit items-start justify-center",
3636
"lg:!pb-0",
@@ -72,19 +72,20 @@ const HorizontalBullet: React.FC<HorizontalBulletProps> = ({
7272
>
7373
{title}
7474
</h2>
75-
{subitems &&
76-
subitems.map((item, i) => (
77-
<small
78-
className="text-klerosUIComponentsSecondaryText text-xs font-normal break-words"
79-
key={i}
80-
aria-label={item}
81-
aria-description={`subitem ${i + 1}`}
82-
>
83-
{item}
84-
</small>
85-
))}
75+
{subitems
76+
? subitems.map((item, i) => (
77+
<small
78+
className="text-klerosUIComponentsSecondaryText text-xs font-normal break-words"
79+
key={`${item}-${i}`}
80+
aria-label={item}
81+
aria-description={`subitem ${i + 1}`}
82+
>
83+
{item}
84+
</small>
85+
))
86+
: null}
8687
</div>
87-
</div>
88+
</li>
8889
);
8990
};
9091

src/lib/progress/steps/horizontal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ const HorizontalSteps: React.FC<StepsProps> = ({
99
className,
1010
...props
1111
}) => (
12-
<div
12+
<ol
1313
className={cn(
1414
"box-border flex w-62.5 items-start justify-center",
1515
className,
1616
)}
1717
{...props}
1818
aria-orientation="horizontal"
19-
role="list"
19+
role="listbox"
2020
aria-label="Horizontal progress steps"
2121
>
2222
{items.map((item, i) => (
@@ -26,10 +26,10 @@ const HorizontalSteps: React.FC<StepsProps> = ({
2626
active={i === currentItemIndex}
2727
last={i + 1 === items.length}
2828
index={i + 1}
29-
key={i}
29+
key={`${item.title}-${i}`}
3030
/>
3131
))}
32-
</div>
32+
</ol>
3333
);
3434

3535
export default HorizontalSteps;

src/lib/progress/steps/vertical.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ const Steps: React.FC<StepsProps> = ({
1010
}) => {
1111
const lastItem = items[items.length - 1];
1212
return (
13-
<div
13+
<ol
1414
className={cn("flex h-full flex-col", className)}
1515
aria-orientation="vertical"
16-
role="list"
16+
role="listbox"
1717
aria-label="Vertical progress steps"
1818
>
1919
<div className="flex h-auto grow flex-col">
@@ -24,7 +24,7 @@ const Steps: React.FC<StepsProps> = ({
2424
active={i === currentItemIndex}
2525
line={!(i + 1 === items.length)}
2626
index={i + 1}
27-
key={i}
27+
key={`${title}-${i}`}
2828
/>
2929
))}
3030
</div>
@@ -36,7 +36,7 @@ const Steps: React.FC<StepsProps> = ({
3636
index={items.length}
3737
className="grow-0 basis-auto"
3838
/>
39-
</div>
39+
</ol>
4040
);
4141
};
4242

src/lib/progress/timeline/bullet.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const Bullet: React.FC<BulletProps> = (props) => {
2828
const titleRef = useRef<HTMLHeadingElement>(null);
2929

3030
return (
31-
<div
31+
<li
3232
className={cn(
3333
"relative flex opacity-100",
3434
rightSided ? "justify-start" : "justify-end",
@@ -41,8 +41,6 @@ const Bullet: React.FC<BulletProps> = (props) => {
4141
aria-label={`Timeline item: ${title}`}
4242
role="listitem"
4343
aria-current={state === "active" ? "step" : undefined}
44-
aria-busy={state === "loading"}
45-
aria-disabled={state === "disabled"}
4644
>
4745
<Spine {...{ variant, line, Icon, titleRef }} />
4846
<div
@@ -115,7 +113,7 @@ const Bullet: React.FC<BulletProps> = (props) => {
115113
{subtitle}
116114
</small>
117115
</div>
118-
</div>
116+
</li>
119117
);
120118
};
121119

src/lib/progress/timeline/custom.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function CustomTimeline({
2222
}: Readonly<ICustomTimelineProps>) {
2323
const lastItem = items[items.length - 1];
2424
return (
25-
<div
25+
<ol
2626
className={cn("box-border flex flex-col", className)}
2727
{...props}
2828
aria-label="Timeline"
@@ -37,7 +37,7 @@ function CustomTimeline({
3737
{...lastItem}
3838
isLast={true}
3939
/>
40-
</div>
40+
</ol>
4141
);
4242
}
4343
export default CustomTimeline;

0 commit comments

Comments
 (0)