Skip to content

Commit 9aa36a4

Browse files
authored
fix(icons): match folder icon optical size to sibling resource icons (#6692)
The folder icon read visibly smaller than the table/database icons beside it in resource rows despite an identical size-[14px] class, because the class sets the SVG box and not the artwork inside it. The folder outline only spanned 15 units of the shared -1 -2 24 24 box against 17.5-18 for its siblings. Scale the outline to a 17-unit extent on the same .25 grid and quarter circle corner radii, keeping the body path byte-identical across Folder, FolderOpen and FolderCode so the sidebar expand/collapse toggle does not shift. FolderCode's brackets move with the body they are centred on.
1 parent fa394e5 commit 9aa36a4

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

packages/emcn/src/icons/folder-code.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import type { SVGProps } from 'react'
44
* FolderCode icon component - a {@link Folder} carrying code brackets
55
*
66
* Shares {@link Folder}'s body path verbatim so the folder family reads as one
7-
* silhouette at one weight. The brackets are centred on the body (x 9.125,
8-
* y 11.25) rather than on the viewBox, so they sit inside the folder rather
9-
* than drifting toward the flap.
7+
* silhouette at one weight. The brackets are centred on the body (x 9, y 11.5)
8+
* rather than on the viewBox, so they sit inside the folder rather than
9+
* drifting toward the flap.
1010
*
1111
* @param props - SVG properties including className, fill, etc.
1212
*/
@@ -25,9 +25,9 @@ export function FolderCode(props: SVGProps<SVGSVGElement>) {
2525
aria-hidden='true'
2626
{...props}
2727
>
28-
<path d='M3.75 17.25A2 2 0 0 1 1.75 15.25V4.25A2 2 0 0 1 3.75 2.25H7L9.5 5.25H14.5A2 2 0 0 1 16.5 7.25V15.25A2 2 0 0 1 14.5 17.25Z' />
29-
<path d='M7.75 9.5L6 11.25L7.75 13' />
30-
<path d='M10.5 9.5L12.25 11.25L10.5 13' />
28+
<path d='M3 18.25A2.25 2.25 0 0 1 0.75 16V3.5A2.25 2.25 0 0 1 3 1.25H6.5L9.5 4.75H15A2.25 2.25 0 0 1 17.25 7V16A2.25 2.25 0 0 1 15 18.25Z' />
29+
<path d='M7.5 9.5L5.5 11.5L7.5 13.5' />
30+
<path d='M10.5 9.5L12.5 11.5L10.5 13.5' />
3131
</svg>
3232
)
3333
}

packages/emcn/src/icons/folder-open.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import type { SVGProps } from 'react'
22

33
/**
44
* FolderOpen icon component - folder with its front panel tilted open
5+
*
6+
* The body outline is {@link Folder}'s path verbatim up to the flap join, so
7+
* the pair toggles in place without shifting. Keep the two in lockstep.
8+
*
59
* @param props - SVG properties including className, fill, etc.
610
*/
711
export function FolderOpen(props: SVGProps<SVGSVGElement>) {
@@ -19,8 +23,8 @@ export function FolderOpen(props: SVGProps<SVGSVGElement>) {
1923
aria-hidden='true'
2024
{...props}
2125
>
22-
<path d='M3.75 17.25A2 2 0 0 1 1.75 15.25V4.25A2 2 0 0 1 3.75 2.25H7L9.5 5.25H14.5A2 2 0 0 1 16.5 7.25V9.25' />
23-
<path d='M6.25 9.25H18.75L16.25 17.25H3.75Z' />
26+
<path d='M3 18.25A2.25 2.25 0 0 1 0.75 16V3.5A2.25 2.25 0 0 1 3 1.25H6.5L9.5 4.75H15A2.25 2.25 0 0 1 17.25 7V9.25' />
27+
<path d='M5.75 9.25H19.75L17 18.25H3Z' />
2428
</svg>
2529
)
2630
}

packages/emcn/src/icons/folder.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ import type { SVGProps } from 'react'
88
* place (sidebar folder rows), which makes any divergence read as the icon
99
* changing size on expand.
1010
*
11+
* The outline is drawn to the same optical extent as the sibling list icons
12+
* ({@link Table}, {@link Database}) — ~17 units tall inside the shared
13+
* `-1 -2 24 24` box. Drawn smaller it reads as a smaller icon in a resource
14+
* row even at an identical `size-*` class, since the class sets the box, not
15+
* the artwork. Any change here must be mirrored in {@link FolderOpen} and
16+
* {@link FolderCode}, which reuse this outline verbatim.
17+
*
1118
* @param props - SVG properties including className, fill, etc.
1219
*/
1320
export function Folder(props: SVGProps<SVGSVGElement>) {
@@ -25,7 +32,7 @@ export function Folder(props: SVGProps<SVGSVGElement>) {
2532
aria-hidden='true'
2633
{...props}
2734
>
28-
<path d='M3.75 17.25A2 2 0 0 1 1.75 15.25V4.25A2 2 0 0 1 3.75 2.25H7L9.5 5.25H14.5A2 2 0 0 1 16.5 7.25V15.25A2 2 0 0 1 14.5 17.25Z' />
35+
<path d='M3 18.25A2.25 2.25 0 0 1 0.75 16V3.5A2.25 2.25 0 0 1 3 1.25H6.5L9.5 4.75H15A2.25 2.25 0 0 1 17.25 7V16A2.25 2.25 0 0 1 15 18.25Z' />
2936
</svg>
3037
)
3138
}

0 commit comments

Comments
 (0)