Skip to content

Commit 7a6711c

Browse files
committed
Refactor titles in icon files, remove unused title prop
1 parent ef1d300 commit 7a6711c

66 files changed

Lines changed: 392 additions & 98 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/components/Carousel/index.astro

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
import { Picture } from 'astro:assets'
66
import { getCollection } from 'astro:content'
7-
7+
import Icon from '@components/Icon/index.astro'
88
import {
99
type CarouselNavigationMode,
1010
type CarouselVariant,
@@ -174,21 +174,7 @@ const carouselId = `carousel-${type}-${variant}-${currentSlug ?? 'all'}`
174174
aria-label="Previous slide"
175175
data-carousel-prev
176176
>
177-
<svg
178-
class="w-6 h-6"
179-
fill="none"
180-
stroke="currentColor"
181-
viewBox="0 0 24 24"
182-
aria-hidden="true"
183-
focusable="false"
184-
>
185-
<path
186-
stroke-linecap="round"
187-
stroke-linejoin="round"
188-
stroke-width="2"
189-
d="M15 19l-7-7 7-7"
190-
/>
191-
</svg>
177+
<Icon icon="arrow-left" size={6} color="currentColor" />
192178
</button>
193179

194180
<button
@@ -207,21 +193,7 @@ const carouselId = `carousel-${type}-${variant}-${currentSlug ?? 'all'}`
207193
aria-label="Next slide"
208194
data-carousel-next
209195
>
210-
<svg
211-
class="w-6 h-6"
212-
fill="none"
213-
stroke="currentColor"
214-
viewBox="0 0 24 24"
215-
aria-hidden="true"
216-
focusable="false"
217-
>
218-
<path
219-
stroke-linecap="round"
220-
stroke-linejoin="round"
221-
stroke-width="2"
222-
d="M9 5l7 7-7 7"
223-
/>
224-
</svg>
196+
<Icon icon="arrow-right" size={6} color="currentColor" />
225197
</button>
226198

227199
{/* Dots Navigation */}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
export type Props = {
3+
color: string
4+
classes?: string
5+
size: number
6+
accessible: boolean
7+
focusable: boolean
8+
isListMarker?: boolean
9+
}
10+
11+
const { color, classes, size, accessible, focusable, isListMarker } = Astro.props
12+
---
13+
14+
<svg
15+
xmlns="http://www.w3.org/2000/svg"
16+
class:list={["shrink-0", `w-${size} h-${size}`, `text-${color}`, classes, isListMarker ? "mt-0.5" : ""]}
17+
fill="none"
18+
stroke="currentColor"
19+
viewBox="0 0 24 24"
20+
aria-hidden={accessible ? "false" : "true"}
21+
focusable={focusable ? "true" : "false"}
22+
>
23+
{accessible && <title>arrow-left icon</title>}
24+
<path
25+
stroke-linecap="round"
26+
stroke-linejoin="round"
27+
stroke-width="2"
28+
d="M15 19l-7-7 7-7"
29+
/>
30+
</svg>

src/components/Icon/icons/arrow-right.astro

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ const { color, classes, size, accessible, focusable, isListMarker } = Astro.prop
1414
<svg
1515
xmlns="http://www.w3.org/2000/svg"
1616
class:list={["shrink-0", `w-${size} h-${size}`, `text-${color}`, classes, isListMarker ? "mt-0.5" : ""]}
17-
fill="currentColor"
17+
fill="none"
1818
stroke="currentColor"
1919
viewBox="0 0 24 24"
2020
aria-hidden={accessible ? "false" : "true"}
2121
focusable={focusable ? "true" : "false"}
2222
>
2323
{accessible && <title>arrow-right icon</title>}
24-
<path d="M 13.05823,22.36681 C 12.417581,22.095911 11.999981,21.457811 11.999981,20.74996 V 16.500009 H 1.4999977 C 0.67157895,16.500009 0,15.828458 0,15.000007 V 9.0000053 C 0,8.171585 0.67156395,7.5000048 1.4999977,7.5000048 H 11.999981 V 3.2500532 c 0,-0.7078052 0.4176,-1.3459205 1.058249,-1.6167906 0.640649,-0.2708701 1.377897,-0.12114 1.868247,0.3793502 l 8.571436,8.7498932 c 0.669449,0.68355 0.669449,1.79145 0,2.475001 l -8.571436,8.749954 c -0.49035,0.500399 -1.227598,0.6501 -1.868247,0.379349 z" />
24+
<path
25+
stroke-linecap="round"
26+
stroke-linejoin="round"
27+
stroke-width="2"
28+
d="M9 5l7 7-7 7"
29+
/>
2530
</svg>

src/components/Icon/icons/chart.astro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ export type Props = {
66
accessible: boolean
77
focusable: boolean
88
isListMarker?: boolean
9-
title?: string
109
}
1110
12-
const { color, classes, size, accessible, focusable, isListMarker, title } = Astro.props
11+
const { color, classes, size, accessible, focusable, isListMarker } = Astro.props
1312
---
1413

1514
<svg
@@ -21,7 +20,7 @@ const { color, classes, size, accessible, focusable, isListMarker, title } = Ast
2120
aria-hidden={accessible ? "false" : "true"}
2221
focusable={focusable ? "true" : "false"}
2322
>
24-
{title && <title>{title}</title>}
23+
{accessible && <title>chart icon</title>}
2524
<path
2625
stroke-linecap="round"
2726
stroke-linejoin="round"

src/components/Icon/icons/check-circled.astro

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@ const { color, classes, size, accessible, focusable, isListMarker } = Astro.prop
1313

1414
<svg
1515
xmlns="http://www.w3.org/2000/svg"
16+
viewBox="0 0 24 24"
1617
class:list={["shrink-0", `w-${size} h-${size}`, `text-${color}`, classes, isListMarker ? "mt-0.5" : ""]}
17-
fill="none"
18+
fill="currentColor"
1819
stroke="currentColor"
19-
viewBox="0 0 24 24"
2020
aria-hidden={accessible ? "false" : "true"}
2121
focusable={focusable ? "true" : "false"}
2222
>
23-
{accessible && <title>User Avatar Icon</title>}
24-
<path
25-
stroke-linecap="round"
26-
stroke-linejoin="round"
27-
stroke-width="2"
28-
d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"
29-
></path>
23+
{accessible && <title>check mark circled icon</title>}
24+
<path fill="none" d="M9.999 13.587L7.7 11.292l-1.412 1.416 3.713 3.705 7.206-7.206-1.414-1.414z"/>
25+
<path d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm-1.999 14.413l-3.713-3.705L7.7 11.292l2.299 2.295 5.794-5.794 1.414 1.414-7.206 7.206z" />
3026
</svg>

src/components/Icon/icons/check-stylized.astro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ export type Props = {
66
accessible: boolean
77
focusable: boolean
88
isListMarker?: boolean
9-
title?: string
109
}
1110
12-
const { color, classes, size, accessible, focusable, isListMarker, title } = Astro.props
11+
const { color, classes, size, accessible, focusable, isListMarker } = Astro.props
1312
---
1413

1514
<svg
@@ -21,7 +20,7 @@ const { color, classes, size, accessible, focusable, isListMarker, title } = Ast
2120
aria-hidden={accessible ? "false" : "true"}
2221
focusable={focusable ? "true" : "false"}
2322
>
24-
{title && <title>{title}</title>}
23+
{accessible && <title>stylized check mark icon</title>}
2524
<path
2625
stroke-linecap="round"
2726
stroke-linejoin="round"

src/components/Icon/icons/check.astro

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ const { color, classes, size, accessible, focusable, isListMarker } = Astro.prop
1313

1414
<svg
1515
xmlns="http://www.w3.org/2000/svg"
16-
viewBox="0 0 24 24"
1716
class:list={["shrink-0", `w-${size} h-${size}`, `text-${color}`, classes, isListMarker ? "mt-0.5" : ""]}
18-
fill="currentColor"
17+
fill="none"
1918
stroke="currentColor"
19+
viewBox="0 0 24 24"
2020
aria-hidden={accessible ? "false" : "true"}
2121
focusable={focusable ? "true" : "false"}
2222
>
2323
{accessible && <title>check mark icon</title>}
24-
<path fill="none" d="M9.999 13.587L7.7 11.292l-1.412 1.416 3.713 3.705 7.206-7.206-1.414-1.414z"/>
25-
<path d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm-1.999 14.413l-3.713-3.705L7.7 11.292l2.299 2.295 5.794-5.794 1.414 1.414-7.206 7.206z" />
24+
<path
25+
stroke-linecap="round"
26+
stroke-linejoin="round"
27+
stroke-width="2"
28+
d="M5 13l4 4L19 7"
29+
></path>
2630
</svg>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
export type Props = {
3+
color: string
4+
classes?: string
5+
size: number
6+
accessible: boolean
7+
focusable: boolean
8+
isListMarker?: boolean
9+
}
10+
11+
const { color, classes, size, accessible, focusable, isListMarker } = Astro.props
12+
---
13+
14+
<svg
15+
xmlns="http://www.w3.org/2000/svg"
16+
class:list={["shrink-0", `w-${size} h-${size}`, `text-${color}`, classes, isListMarker ? "mt-0.5" : ""]}
17+
fill="none"
18+
stroke="currentColor"
19+
viewBox="0 0 24 24"
20+
aria-hidden={accessible ? "false" : "true"}
21+
focusable={focusable ? "true" : "false"}
22+
>
23+
{accessible && <title>checked clipboard icon</title>}
24+
<path
25+
stroke-linecap="round"
26+
stroke-linejoin="round"
27+
stroke-width="2"
28+
d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"
29+
></path>
30+
</svg>

src/components/Icon/icons/clipboard.astro

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ export type Props = {
66
accessible: boolean
77
focusable: boolean
88
isListMarker?: boolean
9-
title?: string
109
}
1110
12-
const { color, classes, size, accessible, focusable, isListMarker, title } = Astro.props
11+
const { color, classes, size, accessible, focusable, isListMarker } = Astro.props
1312
---
1413

1514
<svg
@@ -21,11 +20,11 @@ const { color, classes, size, accessible, focusable, isListMarker, title } = Ast
2120
aria-hidden={accessible ? "false" : "true"}
2221
focusable={focusable ? "true" : "false"}
2322
>
24-
{title && <title>{title}</title>}
23+
{accessible && <title>clipboard icon</title>}
2524
<path
2625
stroke-linecap="round"
2726
stroke-linejoin="round"
2827
stroke-width="2"
29-
d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"
28+
d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"
3029
></path>
3130
</svg>

src/components/Icon/icons/document.astro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ export type Props = {
66
accessible: boolean
77
focusable: boolean
88
isListMarker?: boolean
9-
title?: string
109
}
1110
12-
const { color, classes, size, accessible, focusable, isListMarker, title } = Astro.props
11+
const { color, classes, size, accessible, focusable, isListMarker } = Astro.props
1312
---
1413

1514
<svg
@@ -21,7 +20,7 @@ const { color, classes, size, accessible, focusable, isListMarker, title } = Ast
2120
aria-hidden={accessible ? "false" : "true"}
2221
focusable={focusable ? "true" : "false"}
2322
>
24-
{title && <title>{title}</title>}
23+
{accessible && <title>document icon</title>}
2524
<path
2625
stroke-linecap="round"
2726
stroke-linejoin="round"

0 commit comments

Comments
 (0)