Skip to content

Commit a91ab87

Browse files
authored
Revert "Add PoweredBy component (#103029)" (#103261)
This reverts commit 89c45bd.
1 parent 88e761d commit a91ab87

File tree

9 files changed

+59
-396
lines changed

9 files changed

+59
-396
lines changed

packages/components/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ export { ExperienceControl } from './experience-control';
6363
export { default as SummaryButton } from './summary-button';
6464
export { default as CoreBadge } from './core-badge';
6565
export { default as Menu } from './menu';
66-
export { PoweredBy } from './powered-by';
6766
export { Tabs } from './tabs';
6867

6968
// Logos

packages/components/src/logos/jetpack-logo/index.tsx

Lines changed: 8 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ const PALETTE = colorStudio.colors;
88
const COLOR_JETPACK = PALETTE[ 'Jetpack Green 40' ];
99
const COLOR_WHITE = PALETTE[ 'White' ]; // eslint-disable-line dot-notation
1010

11-
export type JetpackLogoColorVariant = 'color' | 'black' | 'white';
12-
1311
type JetpackLogoProps = {
1412
/**
1513
* Whether to render the full logo.
@@ -26,46 +24,27 @@ type JetpackLogoProps = {
2624
* @default false
2725
*/
2826
monochrome?: boolean;
29-
/**
30-
* Color variant
31-
* @default 'color'
32-
*/
33-
colorVariant?: JetpackLogoColorVariant;
34-
className?: string;
3527
};
3628

37-
const getJetpackColors = ( colorVariant: JetpackLogoColorVariant ) => {
38-
switch ( colorVariant ) {
39-
case 'black':
40-
return { primary: 'black', secondary: 'white' };
41-
case 'white':
42-
return { primary: 'white', secondary: 'black' };
43-
case 'color':
44-
default:
45-
return { primary: COLOR_JETPACK, secondary: COLOR_WHITE };
46-
}
47-
};
29+
const LogoPathSize32 = ( { monochrome = false }: Pick< JetpackLogoProps, 'monochrome' > ) => {
30+
const primary = monochrome ? 'white' : COLOR_JETPACK;
31+
const secondary = monochrome ? 'black' : COLOR_WHITE;
4832

49-
const LogoPathSize32 = ( {
50-
colorVariant = 'color',
51-
monochrome = false,
52-
}: Pick< JetpackLogoProps, 'colorVariant' | 'monochrome' > ) => {
53-
const { primary, secondary } = getJetpackColors( colorVariant );
5433
return (
5534
<>
5635
<path
5736
className="jetpack-logo__icon-circle"
58-
fill={ monochrome ? 'white' : primary }
37+
fill={ primary }
5938
d="M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z"
6039
/>
6140
<polygon
6241
className="jetpack-logo__icon-triangle"
63-
fill={ monochrome ? 'black' : secondary }
42+
fill={ secondary }
6443
points="15,19 7,19 15,3 "
6544
/>
6645
<polygon
6746
className="jetpack-logo__icon-triangle"
68-
fill={ monochrome ? 'black' : secondary }
47+
fill={ secondary }
6948
points="17,29 17,13 25,13 "
7049
/>
7150
</>
@@ -85,40 +64,22 @@ const LogoPathSize32Monochrome = () => (
8564
</>
8665
);
8766

88-
/**
89-
* JetpackLogo component
90-
*
91-
* The 'colorVariant' prop controls the color scheme of the logo: 'color', 'black', or 'white'.
92-
* - 'color': Uses Jetpack green and white (default).
93-
* - 'black': Renders the logo in black and white.
94-
* - 'white': Renders the logo in white and black (for dark backgrounds).
95-
*
96-
* The 'monochrome' prop, when true, overrides the 'colorVariant' and renders the logo and text in a single color scheme:
97-
* - The icon is white, and the text and triangles are black, regardless of the 'colorVariant'.
98-
*/
9967
export const JetpackLogo = ( {
10068
full = false,
10169
monochrome = false,
10270
size = 32,
103-
colorVariant = 'color',
10471
className,
10572
...props
10673
}: JetpackLogoProps & React.SVGProps< SVGSVGElement > ) => {
10774
const classes = clsx( 'jetpack-logo', className );
10875

10976
if ( full === true ) {
110-
const textFill = colorVariant === 'white' && ! monochrome ? '#fff' : '#151E25';
11177
return (
11278
<svg height={ size } className={ classes } viewBox="0 0 118 32" { ...props }>
11379
<title>Jetpack</title>
114-
{ monochrome ? (
115-
<LogoPathSize32Monochrome />
116-
) : (
117-
<LogoPathSize32 colorVariant={ colorVariant } />
118-
) }
80+
{ monochrome ? <LogoPathSize32Monochrome /> : <LogoPathSize32 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.9-3.2 3.6 0 2.9 1.5 3.8 3.3 3.8.9 0 1.9-.2 3.2-.7V21.3zM110 15.2c.2-.3.2-.8 3.8-5.2h3.7l-4.6 5.7 5 6.3h-3.7l-4.2-5.8V22h-3V6h3V15.2z"
12384
/>
12485
</svg>
@@ -135,11 +96,7 @@ export const JetpackLogo = ( {
13596

13697
return (
13798
<svg className={ classes } height={ size } width={ size } viewBox="0 0 32 32" { ...props }>
138-
{ monochrome ? (
139-
<LogoPathSize32Monochrome />
140-
) : (
141-
<LogoPathSize32 colorVariant={ colorVariant } />
142-
) }
99+
{ monochrome ? <LogoPathSize32Monochrome /> : <LogoPathSize32 /> }
143100
</svg>
144101
);
145102
};

packages/components/src/logos/jetpack-logo/stories/index.stories.tsx

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,16 @@ export default meta;
99

1010
type Story = StoryObj< typeof JetpackLogo >;
1111

12-
export const Color: Story = {
13-
args: { colorVariant: 'color' },
14-
};
15-
16-
export const Black: Story = {
17-
args: { colorVariant: 'black' },
18-
};
19-
20-
export const White: Story = {
21-
args: { colorVariant: 'white' },
22-
decorators: [
23-
( Story ) => (
24-
<div style={ { background: '#000', padding: '20px' } }>
25-
<Story />
26-
</div>
27-
),
28-
],
29-
};
30-
31-
export const FullColor: Story = {
32-
args: { full: true, colorVariant: 'color' },
33-
};
34-
35-
export const FullBlack: Story = {
36-
args: { full: true, colorVariant: 'black' },
37-
};
12+
export const Default: Story = {};
3813

39-
export const FullWhite: Story = {
40-
args: { full: true, colorVariant: 'white' },
41-
decorators: [
42-
( Story ) => (
43-
<div style={ { background: '#000', padding: '20px' } }>
44-
<Story />
45-
</div>
46-
),
47-
],
14+
export const Full: Story = {
15+
args: {
16+
full: true,
17+
},
4818
};
4919

5020
export const Monochrome: Story = {
51-
args: { monochrome: true },
21+
args: {
22+
monochrome: true,
23+
},
5224
};
Lines changed: 42 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,42 @@
1-
import colorStudio from '@automattic/color-studio';
2-
3-
const PALETTE = colorStudio.colors;
4-
const COLOR_WOO_PURPLE = PALETTE[ 'WooCommerce Purple 40' ];
5-
6-
export type WooLogoColorVariant = 'color' | 'black' | 'white';
7-
8-
interface WooLogoProps extends React.SVGProps< SVGSVGElement > {
9-
colorVariant?: WooLogoColorVariant;
10-
height?: number;
11-
width?: number;
12-
}
13-
14-
export const WooLogo = ( {
15-
colorVariant = 'color',
16-
height = 19,
17-
width = 30,
18-
...props
19-
}: WooLogoProps ) => {
20-
let fill = COLOR_WOO_PURPLE;
21-
if ( colorVariant === 'white' ) {
22-
fill = '#fff';
23-
} else if ( colorVariant === 'black' ) {
24-
fill = '#000';
25-
}
26-
27-
return (
28-
<svg
29-
version="1.1"
30-
id="Layer_1"
31-
xmlns="http://www.w3.org/2000/svg"
32-
xmlnsXlink="http://www.w3.org/1999/xlink"
33-
x="0px"
34-
y="0px"
35-
width={ width }
36-
height={ height }
37-
viewBox="0 0 183.6 47.5"
38-
{ ...props }
39-
>
40-
<g>
41-
<path
42-
fill={ fill }
43-
d="M77.4,0c-4.3,0-7.1,1.4-9.6,6.1L56.4,27.6V8.5c0-5.7-2.7-8.5-7.7-8.5s-7.1,1.7-9.6,6.5L28.3,27.6V8.7
44-
c0-6.1-2.5-8.7-8.6-8.7H7.3C2.6,0,0,2.2,0,6.2s2.5,6.4,7.1,6.4h5.1v24.1c0,6.8,4.6,10.8,11.2,10.8s9.6-2.6,12.9-8.7l7.2-13.5v11.4
45-
c0,6.7,4.4,10.8,11.1,10.8s9.2-2.3,13-8.7l16.6-28C87.8,4.7,85.3,0,77.3,0C77.3,0,77.3,0,77.4,0z"
46-
/>
47-
<path
48-
fill={ fill }
49-
d="M108.6,0C95,0,84.7,10.1,84.7,23.8s10.4,23.7,23.9,23.7s23.8-10.1,23.9-23.7C132.5,10.1,122.1,0,108.6,0z
50-
M108.6,32.9c-5.1,0-8.6-3.8-8.6-9.1s3.5-9.2,8.6-9.2s8.6,3.9,8.6,9.2S113.8,32.9,108.6,32.9z"
51-
/>
52-
<path
53-
fill={ fill }
54-
d="M159.7,0c-13.5,0-23.9,10.1-23.9,23.8s10.4,23.7,23.9,23.7s23.9-10.1,23.9-23.7S173.2,0,159.7,0z M159.7,32.9
55-
c-5.2,0-8.5-3.8-8.5-9.1s3.4-9.2,8.5-9.2s8.6,3.9,8.6,9.2S164.9,32.9,159.7,32.9z"
56-
/>
57-
</g>
58-
</svg>
59-
);
60-
};
1+
export const WooLogo = ( props: React.SVGProps< SVGSVGElement > ) => (
2+
<svg
3+
version="1.1"
4+
id="Layer_1"
5+
xmlns="http://www.w3.org/2000/svg"
6+
xmlnsXlink="http://www.w3.org/1999/xlink"
7+
x="0px"
8+
y="0px"
9+
width="30"
10+
height="19"
11+
viewBox="0 0 183.6 47.5"
12+
{ ...props }
13+
>
14+
<style type="text/css">
15+
{ `
16+
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#873EFF;}
17+
.st1{fill-rule:evenodd;clip-rule:evenodd;}
18+
.st2{fill:#873EFF;}
19+
.st3{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
20+
.st4{fill:#FFFFFF;}
21+
` }
22+
</style>
23+
<g>
24+
<path
25+
className="st0"
26+
d="M77.4,0c-4.3,0-7.1,1.4-9.6,6.1L56.4,27.6V8.5c0-5.7-2.7-8.5-7.7-8.5s-7.1,1.7-9.6,6.5L28.3,27.6V8.7
27+
c0-6.1-2.5-8.7-8.6-8.7H7.3C2.6,0,0,2.2,0,6.2s2.5,6.4,7.1,6.4h5.1v24.1c0,6.8,4.6,10.8,11.2,10.8s9.6-2.6,12.9-8.7l7.2-13.5v11.4
28+
c0,6.7,4.4,10.8,11.1,10.8s9.2-2.3,13-8.7l16.6-28C87.8,4.7,85.3,0,77.3,0C77.3,0,77.3,0,77.4,0z"
29+
/>
30+
<path
31+
className="st0"
32+
d="M108.6,0C95,0,84.7,10.1,84.7,23.8s10.4,23.7,23.9,23.7s23.8-10.1,23.9-23.7C132.5,10.1,122.1,0,108.6,0z
33+
M108.6,32.9c-5.1,0-8.6-3.8-8.6-9.1s3.5-9.2,8.6-9.2s8.6,3.9,8.6,9.2S113.8,32.9,108.6,32.9z"
34+
/>
35+
<path
36+
className="st0"
37+
d="M159.7,0c-13.5,0-23.9,10.1-23.9,23.8s10.4,23.7,23.9,23.7s23.9-10.1,23.9-23.7S173.2,0,159.7,0z M159.7,32.9
38+
c-5.2,0-8.5-3.8-8.5-9.1s3.4-9.2,8.5-9.2s8.6,3.9,8.6,9.2S164.9,32.9,159.7,32.9z"
39+
/>
40+
</g>
41+
</svg>
42+
);

packages/components/src/logos/woo-logo/stories/index.stories.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,4 @@ export default meta;
99

1010
type Story = StoryObj< typeof WooLogo >;
1111

12-
export const Color: Story = {
13-
args: { colorVariant: 'color' },
14-
};
15-
16-
export const Black: Story = {
17-
args: { colorVariant: 'black' },
18-
};
19-
20-
export const White: Story = {
21-
args: { colorVariant: 'white' },
22-
decorators: [
23-
( Story ) => (
24-
<div style={ { background: '#000', padding: '20px' } }>
25-
<Story />
26-
</div>
27-
),
28-
],
29-
};
12+
export const Default: Story = {};

packages/components/src/powered-by/README.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)