From c20a494e0f87014a6d5c55fe09e1e8a83fa9fa96 Mon Sep 17 00:00:00 2001 From: Jon Rohan Date: Wed, 6 Nov 2024 21:56:10 +0000 Subject: [PATCH 01/14] Concat className with default --- lib/octicons_react/src/createIconComponent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/octicons_react/src/createIconComponent.js b/lib/octicons_react/src/createIconComponent.js index f895c43ec..9876590ba 100644 --- a/lib/octicons_react/src/createIconComponent.js +++ b/lib/octicons_react/src/createIconComponent.js @@ -16,7 +16,7 @@ export function createIconComponent(name, defaultClassName, getSVGData) { 'aria-label': ariaLabel, 'aria-labelledby': arialabelledby, tabIndex, - className = defaultClassName, + className = '', fill = 'currentColor', size = 16, verticalAlign = 'text-bottom', @@ -41,7 +41,7 @@ export function createIconComponent(name, defaultClassName, getSVGData) { focusable={tabIndex >= 0 ? 'true' : 'false'} aria-label={ariaLabel} aria-labelledby={arialabelledby} - className={className} + className={`${defaultClassName} ${className}`} role={role} viewBox={`0 0 ${naturalWidth} ${naturalHeight}`} width={width} From 78b6409d0f98a001d3e8db75379e92391b3ff1a3 Mon Sep 17 00:00:00 2001 From: Jon Rohan Date: Wed, 6 Nov 2024 21:57:51 +0000 Subject: [PATCH 02/14] join space --- lib/octicons_react/src/createIconComponent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/octicons_react/src/createIconComponent.js b/lib/octicons_react/src/createIconComponent.js index 9876590ba..351a6a482 100644 --- a/lib/octicons_react/src/createIconComponent.js +++ b/lib/octicons_react/src/createIconComponent.js @@ -16,7 +16,7 @@ export function createIconComponent(name, defaultClassName, getSVGData) { 'aria-label': ariaLabel, 'aria-labelledby': arialabelledby, tabIndex, - className = '', + className, fill = 'currentColor', size = 16, verticalAlign = 'text-bottom', @@ -41,7 +41,7 @@ export function createIconComponent(name, defaultClassName, getSVGData) { focusable={tabIndex >= 0 ? 'true' : 'false'} aria-label={ariaLabel} aria-labelledby={arialabelledby} - className={`${defaultClassName} ${className}`} + className={[defaultClassName, className].join(' ')} role={role} viewBox={`0 0 ${naturalWidth} ${naturalHeight}`} width={width} From d1fae9fdf62d28e7213a552c447d82ae90253226 Mon Sep 17 00:00:00 2001 From: Katie Langerman <18661030+langermank@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:09:37 +0000 Subject: [PATCH 03/14] update snap --- lib/octicons_react/__tests__/tree-shaking.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/octicons_react/__tests__/tree-shaking.test.js b/lib/octicons_react/__tests__/tree-shaking.test.js index a490c44bf..69c51376f 100644 --- a/lib/octicons_react/__tests__/tree-shaking.test.js +++ b/lib/octicons_react/__tests__/tree-shaking.test.js @@ -50,5 +50,5 @@ test('tree shaking single export', async () => { }) const bundleSize = Buffer.byteLength(output[0].code.trim()) / 1000 - expect(`${bundleSize}kB`).toMatchInlineSnapshot(`"3.563kB"`) + expect(`${bundleSize}kB`).toMatchInlineSnapshot(`"0.065kB"`) }) From a90732551585b544048176f0066b986e1133ca3b Mon Sep 17 00:00:00 2001 From: Katie Langerman <18661030+langermank@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:13:57 +0000 Subject: [PATCH 04/14] tests --- lib/octicons_react/__tests__/tree-shaking.test.js | 2 +- lib/octicons_react/src/__tests__/__snapshots__/octicon.js.snap | 2 +- lib/octicons_react/src/__tests__/octicon.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/octicons_react/__tests__/tree-shaking.test.js b/lib/octicons_react/__tests__/tree-shaking.test.js index 69c51376f..d3820f12d 100644 --- a/lib/octicons_react/__tests__/tree-shaking.test.js +++ b/lib/octicons_react/__tests__/tree-shaking.test.js @@ -50,5 +50,5 @@ test('tree shaking single export', async () => { }) const bundleSize = Buffer.byteLength(output[0].code.trim()) / 1000 - expect(`${bundleSize}kB`).toMatchInlineSnapshot(`"0.065kB"`) + expect(`${bundleSize}kB`).toMatchInlineSnapshot(`"3.505kB"`) }) diff --git a/lib/octicons_react/src/__tests__/__snapshots__/octicon.js.snap b/lib/octicons_react/src/__tests__/__snapshots__/octicon.js.snap index 2c1947a65..fccca3b42 100644 --- a/lib/octicons_react/src/__tests__/__snapshots__/octicon.js.snap +++ b/lib/octicons_react/src/__tests__/__snapshots__/octicon.js.snap @@ -3,7 +3,7 @@ exports[`An icon component matches snapshot 1`] = `