@automattic/jetpack-components 1.9.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/build/components/admin-page/index.d.ts +0 -1
- package/build/components/admin-page/index.js +3 -10
- package/build/components/admin-page/style.module.scss +16 -3
- package/build/components/admin-page/types.d.ts +8 -0
- package/build/components/boost-score-bar/index.js +3 -3
- package/build/components/chip/style.module.scss +0 -4
- package/build/components/gravatar/index.d.ts +58 -0
- package/build/components/gravatar/index.js +68 -0
- package/build/components/gravatar/style.scss +7 -0
- package/build/components/icon-tooltip/index.js +3 -3
- package/build/components/icon-tooltip/types.d.ts +4 -3
- package/build/components/jetpack-footer/index.js +1 -1
- package/build/components/terms-of-service/index.js +10 -10
- package/build/components/testimonials/index.js +2 -2
- package/build/components/toggle-control/index.d.ts +2 -0
- package/build/components/toggle-control/index.js +2 -2
- package/build/index.d.ts +3 -1
- package/build/index.js +2 -1
- package/components/admin-page/index.tsx +12 -19
- package/components/admin-page/style.module.scss +16 -3
- package/components/admin-page/types.ts +9 -0
- package/components/boost-score-bar/index.tsx +3 -3
- package/components/chip/style.module.scss +0 -4
- package/components/gravatar/index.tsx +138 -0
- package/components/gravatar/style.scss +7 -0
- package/components/icon-tooltip/index.tsx +3 -3
- package/components/icon-tooltip/types.ts +4 -3
- package/components/jetpack-footer/index.tsx +2 -3
- package/components/terms-of-service/index.tsx +12 -12
- package/components/testimonials/index.tsx +3 -3
- package/components/toggle-control/index.tsx +5 -0
- package/index.ts +3 -1
- package/package.json +26 -8
- package/build/components/gridicon/index.d.ts +0 -14
- package/build/components/gridicon/index.js +0 -173
- package/build/components/gridicon/style.scss +0 -16
- package/build/components/gridicon/types.d.ts +0 -39
- package/build/components/gridicon/types.js +0 -1
- package/components/gridicon/index.tsx +0 -334
- package/components/gridicon/style.scss +0 -16
- package/components/gridicon/types.ts +0 -48
|
@@ -11,8 +11,4 @@
|
|
|
11
11
|
line-height: 20px;
|
|
12
12
|
font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
13
13
|
|
|
14
|
-
&.is-new {
|
|
15
|
-
background-color: var(--jp-green-5);
|
|
16
|
-
color: var(--jp-green-50);
|
|
17
|
-
}
|
|
18
14
|
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { Hovercards } from '@gravatar-com/hovercards';
|
|
5
|
+
import '@gravatar-com/hovercards/dist/style.css';
|
|
6
|
+
import { useEffect, useRef } from '@wordpress/element';
|
|
7
|
+
import { __ } from '@wordpress/i18n';
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
import { sha256 } from 'js-sha256';
|
|
10
|
+
import './style.scss';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Gravatar `defaultImage` styles, mirroring https://docs.gravatar.com/sdk/images/#default-image
|
|
14
|
+
*/
|
|
15
|
+
type DefaultImage =
|
|
16
|
+
| 'blank'
|
|
17
|
+
| 'color'
|
|
18
|
+
| 'identicon'
|
|
19
|
+
| 'initials'
|
|
20
|
+
| 'monsterid'
|
|
21
|
+
| 'mp'
|
|
22
|
+
| 'retro'
|
|
23
|
+
| 'robohash'
|
|
24
|
+
| 'wavatar';
|
|
25
|
+
|
|
26
|
+
export type GravatarProps = {
|
|
27
|
+
/**
|
|
28
|
+
* Style of the placeholder image when the email has no Gravatar profile.
|
|
29
|
+
* @default 'initials'
|
|
30
|
+
*/
|
|
31
|
+
defaultImage?: DefaultImage;
|
|
32
|
+
/**
|
|
33
|
+
* Display name for accessibility (used as `alt` text and the hovercard label).
|
|
34
|
+
*/
|
|
35
|
+
displayName?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Email address to look up on Gravatar.
|
|
38
|
+
*/
|
|
39
|
+
email: string;
|
|
40
|
+
/**
|
|
41
|
+
* Rendered avatar size in pixels.
|
|
42
|
+
* @default 48
|
|
43
|
+
*/
|
|
44
|
+
size?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Optional class name forwarded to the underlying `<img>` element. The
|
|
47
|
+
* default `jetpack-components-gravatar` class is always applied so consumers
|
|
48
|
+
* can target it directly.
|
|
49
|
+
*/
|
|
50
|
+
className?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Whether to attach a Gravatar profile hovercard to the avatar.
|
|
53
|
+
* @default true
|
|
54
|
+
*/
|
|
55
|
+
useHovercard?: boolean;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Renders a Gravatar profile image with an optional Gravatar profile hovercard.
|
|
60
|
+
*
|
|
61
|
+
* If the email has no Gravatar profile, the configured `defaultImage` style is
|
|
62
|
+
* used (initials by default).
|
|
63
|
+
*
|
|
64
|
+
* Long-term, this is the seam for switching to a core or Gravatar-shipped
|
|
65
|
+
* component (see https://github.com/WordPress/gutenberg/issues/76836); until
|
|
66
|
+
* then, Forms and Newsletter share this implementation.
|
|
67
|
+
*
|
|
68
|
+
* @param props - The component props.
|
|
69
|
+
* @param props.defaultImage - Style of the placeholder image when the email has no Gravatar.
|
|
70
|
+
* @param props.displayName - Display name used for `alt` text + hovercard label.
|
|
71
|
+
* @param props.email - Email address to look up on Gravatar.
|
|
72
|
+
* @param props.size - Rendered avatar size in pixels.
|
|
73
|
+
* @param props.className - Optional class name forwarded to the underlying `<img>`.
|
|
74
|
+
* @param props.useHovercard - Whether to attach the Gravatar profile hovercard.
|
|
75
|
+
* @return The Gravatar avatar `<img>`, or null when no email is available.
|
|
76
|
+
*/
|
|
77
|
+
export default function Gravatar( {
|
|
78
|
+
defaultImage = 'initials',
|
|
79
|
+
displayName,
|
|
80
|
+
email,
|
|
81
|
+
size = 48,
|
|
82
|
+
className,
|
|
83
|
+
useHovercard = true,
|
|
84
|
+
}: GravatarProps ): JSX.Element | null {
|
|
85
|
+
const profileImageRef = useRef< HTMLImageElement | null >( null );
|
|
86
|
+
const hovercardRef = useRef< Hovercards | null >( null );
|
|
87
|
+
|
|
88
|
+
useEffect( () => {
|
|
89
|
+
if ( ! useHovercard || ! profileImageRef.current ) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
hovercardRef.current = new Hovercards( {
|
|
93
|
+
// See https://github.com/Automattic/gravatar/tree/trunk/web/packages/hovercards#translations
|
|
94
|
+
i18n: {
|
|
95
|
+
'Edit your profile →': __( 'Edit your profile →', 'jetpack-components' ),
|
|
96
|
+
'View profile →': __( 'View profile →', 'jetpack-components' ),
|
|
97
|
+
Contact: __( 'Contact', 'jetpack-components' ),
|
|
98
|
+
'Send money': __( 'Send money', 'jetpack-components' ),
|
|
99
|
+
'Sorry, we are unable to load this Gravatar profile.': __(
|
|
100
|
+
'Sorry, we are unable to load this Gravatar profile.',
|
|
101
|
+
'jetpack-components'
|
|
102
|
+
),
|
|
103
|
+
'Gravatar not found.': __( 'Gravatar not found.', 'jetpack-components' ),
|
|
104
|
+
'This profile is private.': __( 'This profile is private.', 'jetpack-components' ),
|
|
105
|
+
'Too Many Requests.': __( 'Too many requests.', 'jetpack-components' ),
|
|
106
|
+
'Internal Server Error.': __( 'Internal server error.', 'jetpack-components' ),
|
|
107
|
+
'Is this you?': __( 'Is this you?', 'jetpack-components' ),
|
|
108
|
+
'Claim your free profile.': __( 'Claim your free profile.', 'jetpack-components' ),
|
|
109
|
+
Email: __( 'Email', 'jetpack-components' ),
|
|
110
|
+
'Home Phone': __( 'Home phone', 'jetpack-components' ),
|
|
111
|
+
'Work Phone': __( 'Work phone', 'jetpack-components' ),
|
|
112
|
+
'Cell Phone': __( 'Cell phone', 'jetpack-components' ),
|
|
113
|
+
'Contact Form': __( 'Contact form', 'jetpack-components' ),
|
|
114
|
+
Calendar: __( 'Calendar', 'jetpack-components' ),
|
|
115
|
+
},
|
|
116
|
+
} );
|
|
117
|
+
hovercardRef.current.attach( profileImageRef.current );
|
|
118
|
+
}, [ useHovercard ] );
|
|
119
|
+
|
|
120
|
+
if ( ! email ) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const hashedEmail = sha256( email );
|
|
125
|
+
const hovercardName = displayName ? `&name=${ encodeURIComponent( displayName ) }` : '';
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<img
|
|
129
|
+
ref={ profileImageRef }
|
|
130
|
+
className={ clsx( 'jetpack-components-gravatar', className ) }
|
|
131
|
+
alt={ displayName || '' }
|
|
132
|
+
src={ `https://secure.gravatar.com/avatar/${ hashedEmail }?d=${ defaultImage }${ hovercardName }` }
|
|
133
|
+
width={ size }
|
|
134
|
+
height={ size }
|
|
135
|
+
loading="lazy"
|
|
136
|
+
/>
|
|
137
|
+
);
|
|
138
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Popover } from '@wordpress/components';
|
|
2
|
+
import { Icon, info } from '@wordpress/icons';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import { useCallback, useState, ReactElement, FC } from 'react';
|
|
4
5
|
import Button from '../button/index.tsx';
|
|
5
|
-
import Gridicon from '../gridicon/index.tsx';
|
|
6
6
|
import { IconTooltipProps, Placement, Position } from './types.ts';
|
|
7
7
|
|
|
8
8
|
import './style.scss';
|
|
@@ -31,7 +31,7 @@ const IconTooltip: FC< IconTooltipProps > = ( {
|
|
|
31
31
|
iconClassName = '',
|
|
32
32
|
placement = 'bottom-end',
|
|
33
33
|
animate = true,
|
|
34
|
-
iconCode =
|
|
34
|
+
iconCode = info,
|
|
35
35
|
iconSize = 18,
|
|
36
36
|
offset = 10,
|
|
37
37
|
title,
|
|
@@ -109,7 +109,7 @@ const IconTooltip: FC< IconTooltipProps > = ( {
|
|
|
109
109
|
>
|
|
110
110
|
{ ! isAnchorWrapper && (
|
|
111
111
|
<Button variant="link" onMouseDown={ toggleTooltip }>
|
|
112
|
-
<
|
|
112
|
+
<Icon className={ iconClassName } icon={ iconCode } size={ iconSize } />
|
|
113
113
|
</Button>
|
|
114
114
|
) }
|
|
115
115
|
<div
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IconType } from '@wordpress/components';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
|
|
3
4
|
export type Placement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end';
|
|
@@ -17,7 +18,7 @@ export type IconTooltipProps = {
|
|
|
17
18
|
className?: string;
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
|
-
* The class name applied to
|
|
21
|
+
* The class name applied to the icon.
|
|
21
22
|
*/
|
|
22
23
|
iconClassName?: string;
|
|
23
24
|
|
|
@@ -37,9 +38,9 @@ export type IconTooltipProps = {
|
|
|
37
38
|
animate?: boolean;
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
|
-
* The icon
|
|
41
|
+
* The icon to display. Accepts icon components from `@wordpress/icons`.
|
|
41
42
|
*/
|
|
42
|
-
iconCode?:
|
|
43
|
+
iconCode?: IconType;
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
46
|
* The title of Popover.
|
|
@@ -69,12 +69,12 @@ const JetpackFooter: FC< JetpackFooterProps > = ( { className, menu, ...otherPro
|
|
|
69
69
|
return (
|
|
70
70
|
<li key={ item.label }>
|
|
71
71
|
<Text
|
|
72
|
-
variant="body-
|
|
72
|
+
variant="body-md"
|
|
73
73
|
className="jetpack-footer__menu-item"
|
|
74
74
|
render={
|
|
75
75
|
isButton ? (
|
|
76
76
|
<Link
|
|
77
|
-
render={ <
|
|
77
|
+
render={ <span /> }
|
|
78
78
|
tone="neutral"
|
|
79
79
|
variant="default"
|
|
80
80
|
role={ item.role }
|
|
@@ -84,7 +84,6 @@ const JetpackFooter: FC< JetpackFooterProps > = ( { className, menu, ...otherPro
|
|
|
84
84
|
/>
|
|
85
85
|
) : (
|
|
86
86
|
<Link
|
|
87
|
-
render={ <Text variant="body-md" render={ <a /> } /> }
|
|
88
87
|
tone="neutral"
|
|
89
88
|
variant="default"
|
|
90
89
|
href={ item.href || '' }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ExternalLink } from '@wordpress/components';
|
|
2
1
|
import { createInterpolateElement } from '@wordpress/element';
|
|
3
2
|
import { __, sprintf } from '@wordpress/i18n';
|
|
3
|
+
import { Link } from '@wordpress/ui';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { getRedirectUrl } from '../../index.ts';
|
|
6
6
|
import Text from '../text/index.tsx';
|
|
@@ -46,8 +46,8 @@ const MultipleButtonsText = ( { multipleButtonsLabels } ) => {
|
|
|
46
46
|
),
|
|
47
47
|
{
|
|
48
48
|
strong: <strong />,
|
|
49
|
-
tosLink: <
|
|
50
|
-
shareDetailsLink: <
|
|
49
|
+
tosLink: <TosLink slug="wpcom-tos" />,
|
|
50
|
+
shareDetailsLink: <TosLink slug="jetpack-support-what-data-does-jetpack-sync" />,
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
53
|
}
|
|
@@ -58,8 +58,8 @@ const MultipleButtonsText = ( { multipleButtonsLabels } ) => {
|
|
|
58
58
|
'jetpack-components'
|
|
59
59
|
),
|
|
60
60
|
{
|
|
61
|
-
tosLink: <
|
|
62
|
-
shareDetailsLink: <
|
|
61
|
+
tosLink: <TosLink slug="wpcom-tos" />,
|
|
62
|
+
shareDetailsLink: <TosLink slug="jetpack-support-what-data-does-jetpack-sync" />,
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
65
|
};
|
|
@@ -76,8 +76,8 @@ const SingleButtonText = ( { agreeButtonLabel } ) =>
|
|
|
76
76
|
),
|
|
77
77
|
{
|
|
78
78
|
strong: <strong />,
|
|
79
|
-
tosLink: <
|
|
80
|
-
shareDetailsLink: <
|
|
79
|
+
tosLink: <TosLink slug="wpcom-tos" />,
|
|
80
|
+
shareDetailsLink: <TosLink slug="jetpack-support-what-data-does-jetpack-sync" />,
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
83
|
|
|
@@ -88,15 +88,15 @@ const TermsOfServiceTextOnly = () =>
|
|
|
88
88
|
'jetpack-components'
|
|
89
89
|
),
|
|
90
90
|
{
|
|
91
|
-
tosLink: <
|
|
92
|
-
shareDetailsLink: <
|
|
91
|
+
tosLink: <TosLink slug="wpcom-tos" />,
|
|
92
|
+
shareDetailsLink: <TosLink slug="jetpack-support-what-data-does-jetpack-sync" />,
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
95
|
|
|
96
|
-
const
|
|
97
|
-
<
|
|
96
|
+
const TosLink: FC< { slug: string; children?: ReactNode } > = ( { slug, children } ) => (
|
|
97
|
+
<Link openInNewTab className="terms-of-service__link" href={ getRedirectUrl( slug ) }>
|
|
98
98
|
{ children }
|
|
99
|
-
</
|
|
99
|
+
</Link>
|
|
100
100
|
);
|
|
101
101
|
|
|
102
102
|
export default TermsOfService;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useCallback } from '@wordpress/element';
|
|
2
|
-
import
|
|
2
|
+
import { Icon, chevronLeft, chevronRight } from '@wordpress/icons';
|
|
3
3
|
import { Testimonial } from './testimonial.tsx';
|
|
4
4
|
import { TestimonialsType } from './types.ts';
|
|
5
5
|
|
|
@@ -30,7 +30,7 @@ const Testimonials: TestimonialsType = ( { testimonials } ) => {
|
|
|
30
30
|
className="testimonials__left-arrow"
|
|
31
31
|
onClick={ decrementTestimonial }
|
|
32
32
|
>
|
|
33
|
-
<
|
|
33
|
+
<Icon icon={ chevronLeft } size={ 48 } />
|
|
34
34
|
</button>
|
|
35
35
|
) }
|
|
36
36
|
|
|
@@ -48,7 +48,7 @@ const Testimonials: TestimonialsType = ( { testimonials } ) => {
|
|
|
48
48
|
className="testimonials__right-arrow"
|
|
49
49
|
onClick={ incrementTestimonial }
|
|
50
50
|
>
|
|
51
|
-
<
|
|
51
|
+
<Icon icon={ chevronRight } size={ 48 } />
|
|
52
52
|
</button>
|
|
53
53
|
) }
|
|
54
54
|
</div>
|
|
@@ -23,6 +23,9 @@ export interface ToggleControlProps {
|
|
|
23
23
|
/** The label for the toggle. */
|
|
24
24
|
label?: ReactNode;
|
|
25
25
|
|
|
26
|
+
/** Accessible name for the underlying checkbox. Use when no visible `label` is rendered. */
|
|
27
|
+
'aria-label'?: string;
|
|
28
|
+
|
|
26
29
|
/** The size of the toggle. */
|
|
27
30
|
size?: 'small' | 'normal';
|
|
28
31
|
|
|
@@ -37,6 +40,7 @@ const ToggleControl: FC< ToggleControlProps > = ( {
|
|
|
37
40
|
help,
|
|
38
41
|
toggling,
|
|
39
42
|
label,
|
|
43
|
+
'aria-label': ariaLabel,
|
|
40
44
|
size = 'normal',
|
|
41
45
|
onChange,
|
|
42
46
|
} ) => {
|
|
@@ -67,6 +71,7 @@ const ToggleControl: FC< ToggleControlProps > = ( {
|
|
|
67
71
|
disabled={ disabled }
|
|
68
72
|
help={ help }
|
|
69
73
|
label={ label }
|
|
74
|
+
aria-label={ ariaLabel }
|
|
70
75
|
onChange={ handleOnChange }
|
|
71
76
|
/>
|
|
72
77
|
);
|
package/index.ts
CHANGED
|
@@ -25,8 +25,10 @@ export { default as AutomatticBylineLogo } from './components/automattic-byline-
|
|
|
25
25
|
export { default as AutomatticIconLogo } from './components/automattic-icon-logo/index.tsx';
|
|
26
26
|
export { default as AutomatticForAgenciesLogo } from './components/automattic-for-agencies-logo/index.tsx';
|
|
27
27
|
export { default as JetpackFooter } from './components/jetpack-footer/index.tsx';
|
|
28
|
+
/** @deprecated Use `Spinner` from `@wordpress/components` instead. */
|
|
28
29
|
export { default as Spinner } from './components/spinner/index.tsx';
|
|
29
|
-
export { default as
|
|
30
|
+
export { default as Gravatar } from './components/gravatar/index.tsx';
|
|
31
|
+
export type { GravatarProps } from './components/gravatar/index.tsx';
|
|
30
32
|
export { default as IconTooltip } from './components/icon-tooltip/index.tsx';
|
|
31
33
|
export { default as ActionButton } from './components/action-button/index.tsx';
|
|
32
34
|
export { default as PricingCard } from './components/pricing-card/index.tsx';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/jetpack-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Jetpack Components Package",
|
|
5
5
|
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/components/#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -22,6 +22,22 @@
|
|
|
22
22
|
"types": "./build/index.d.ts",
|
|
23
23
|
"default": "./build/index.js"
|
|
24
24
|
},
|
|
25
|
+
"./admin-page": {
|
|
26
|
+
"types": "./build/components/admin-page/index.d.ts",
|
|
27
|
+
"default": "./build/components/admin-page/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./global-notices": {
|
|
30
|
+
"types": "./build/components/global-notices/index.d.ts",
|
|
31
|
+
"default": "./build/components/global-notices/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./gravatar": {
|
|
34
|
+
"types": "./build/components/gravatar/index.d.ts",
|
|
35
|
+
"default": "./build/components/gravatar/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./jetpack-footer": {
|
|
38
|
+
"types": "./build/components/jetpack-footer/index.d.ts",
|
|
39
|
+
"default": "./build/components/jetpack-footer/index.js"
|
|
40
|
+
},
|
|
25
41
|
"./jetpack-logo": {
|
|
26
42
|
"types": "./build/components/jetpack-logo/index.d.ts",
|
|
27
43
|
"default": "./build/components/jetpack-logo/index.js"
|
|
@@ -45,12 +61,13 @@
|
|
|
45
61
|
],
|
|
46
62
|
"dependencies": {
|
|
47
63
|
"@automattic/format-currency": "1.0.1",
|
|
48
|
-
"@automattic/jetpack-api": "^1.0.
|
|
49
|
-
"@automattic/jetpack-boost-score-api": "^1.0.
|
|
50
|
-
"@automattic/jetpack-script-data": "^0.6.
|
|
51
|
-
"@automattic/number-formatters": "^1.1.
|
|
64
|
+
"@automattic/jetpack-api": "^1.0.24",
|
|
65
|
+
"@automattic/jetpack-boost-score-api": "^1.0.40",
|
|
66
|
+
"@automattic/jetpack-script-data": "^0.6.3",
|
|
67
|
+
"@automattic/number-formatters": "^1.1.7",
|
|
52
68
|
"@babel/runtime": "^7",
|
|
53
|
-
"@
|
|
69
|
+
"@gravatar-com/hovercards": "0.16.0",
|
|
70
|
+
"@wordpress/admin-ui": "2.0.0",
|
|
54
71
|
"@wordpress/browserslist-config": "6.44.0",
|
|
55
72
|
"@wordpress/components": "32.6.0",
|
|
56
73
|
"@wordpress/compose": "7.44.0",
|
|
@@ -63,15 +80,16 @@
|
|
|
63
80
|
"@wordpress/theme": "0.11.0",
|
|
64
81
|
"@wordpress/ui": "0.11.0",
|
|
65
82
|
"clsx": "2.1.1",
|
|
83
|
+
"js-sha256": "0.11.1",
|
|
66
84
|
"prop-types": "^15.7.2",
|
|
67
85
|
"qrcode.react": "4.2.0",
|
|
68
86
|
"react-slider": "2.0.5",
|
|
69
|
-
"social-logos": "^3.3.
|
|
87
|
+
"social-logos": "^3.3.14",
|
|
70
88
|
"uplot": "1.6.31",
|
|
71
89
|
"uplot-react": "1.1.4"
|
|
72
90
|
},
|
|
73
91
|
"devDependencies": {
|
|
74
|
-
"@automattic/jetpack-base-styles": "^1.1
|
|
92
|
+
"@automattic/jetpack-base-styles": "^1.2.1",
|
|
75
93
|
"@babel/core": "7.29.0",
|
|
76
94
|
"@babel/preset-react": "7.28.5",
|
|
77
95
|
"@jest/globals": "30.3.0",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
|
-
import './style.scss';
|
|
3
|
-
import { GridiconProps } from './types.ts';
|
|
4
|
-
declare class Gridicon extends Component<GridiconProps> {
|
|
5
|
-
static defaultProps: {
|
|
6
|
-
'aria-hidden': string;
|
|
7
|
-
focusable: string;
|
|
8
|
-
};
|
|
9
|
-
needsOffset(icon: any, size: any): boolean;
|
|
10
|
-
getSVGDescription(icon: any): string;
|
|
11
|
-
renderIcon(icon: any): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
}
|
|
14
|
-
export default Gridicon;
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/* !!!
|
|
3
|
-
This is a fork of the Jetpack Gridicon code:
|
|
4
|
-
https://github.com/Automattic/jetpack/blob/f8078c2cd12ac508334da2fb08e37a92cf283c14/_inc/client/components/gridicon/index.jsx
|
|
5
|
-
|
|
6
|
-
It has been modified to work with Preact, and only includes the icons that we need.
|
|
7
|
-
!!! */
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import clsx from 'clsx';
|
|
10
|
-
import { Component } from 'react';
|
|
11
|
-
import './style.scss';
|
|
12
|
-
class Gridicon extends Component {
|
|
13
|
-
static defaultProps = {
|
|
14
|
-
'aria-hidden': 'false',
|
|
15
|
-
focusable: 'true',
|
|
16
|
-
};
|
|
17
|
-
needsOffset(icon, size) {
|
|
18
|
-
const iconNeedsOffset = [
|
|
19
|
-
'gridicons-arrow-left',
|
|
20
|
-
'gridicons-arrow-right',
|
|
21
|
-
'gridicons-calendar',
|
|
22
|
-
'gridicons-cart',
|
|
23
|
-
'gridicons-folder',
|
|
24
|
-
'gridicons-help-outline',
|
|
25
|
-
'gridicons-info',
|
|
26
|
-
'gridicons-info-outline',
|
|
27
|
-
'gridicons-posts',
|
|
28
|
-
'gridicons-star-outline',
|
|
29
|
-
'gridicons-star',
|
|
30
|
-
];
|
|
31
|
-
if (iconNeedsOffset.indexOf(icon) >= 0) {
|
|
32
|
-
return size % 18 === 0;
|
|
33
|
-
}
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
getSVGDescription(icon) {
|
|
37
|
-
// Enable overriding desc with falsy/truthy values.
|
|
38
|
-
if ('description' in this.props) {
|
|
39
|
-
return this.props.description;
|
|
40
|
-
}
|
|
41
|
-
switch (icon) {
|
|
42
|
-
default:
|
|
43
|
-
return '';
|
|
44
|
-
case 'gridicons-audio':
|
|
45
|
-
return __('Has audio', 'jetpack-components');
|
|
46
|
-
case 'gridicons-arrow-left':
|
|
47
|
-
return __('Arrow left', 'jetpack-components');
|
|
48
|
-
case 'gridicons-arrow-right':
|
|
49
|
-
return __('Arrow right', 'jetpack-components');
|
|
50
|
-
case 'gridicons-calendar':
|
|
51
|
-
return __('Is an event', 'jetpack-components');
|
|
52
|
-
case 'gridicons-cart':
|
|
53
|
-
return __('Is a product', 'jetpack-components');
|
|
54
|
-
case 'chevron-down':
|
|
55
|
-
return __('Show filters', 'jetpack-components');
|
|
56
|
-
case 'gridicons-comment':
|
|
57
|
-
return __('Matching comment', 'jetpack-components');
|
|
58
|
-
case 'gridicons-cross':
|
|
59
|
-
return __('Close', 'jetpack-components');
|
|
60
|
-
case 'gridicons-domains':
|
|
61
|
-
return __('Website', 'jetpack-components');
|
|
62
|
-
case 'gridicons-filter':
|
|
63
|
-
return __('Toggle search filters', 'jetpack-components');
|
|
64
|
-
case 'gridicons-folder':
|
|
65
|
-
return __('Category', 'jetpack-components');
|
|
66
|
-
case 'gridicons-help-outline':
|
|
67
|
-
return __('Help', 'jetpack-components');
|
|
68
|
-
case 'gridicons-info':
|
|
69
|
-
case 'gridicons-info-outline':
|
|
70
|
-
return __('Information', 'jetpack-components');
|
|
71
|
-
case 'gridicons-image-multiple':
|
|
72
|
-
return __('Has multiple images', 'jetpack-components');
|
|
73
|
-
case 'gridicons-image':
|
|
74
|
-
return __('Has an image', 'jetpack-components');
|
|
75
|
-
case 'gridicons-page':
|
|
76
|
-
return __('Page', 'jetpack-components');
|
|
77
|
-
case 'gridicons-post':
|
|
78
|
-
return __('Post', 'jetpack-components');
|
|
79
|
-
case 'gridicons-jetpack-search':
|
|
80
|
-
case 'gridicons-search':
|
|
81
|
-
return __('Magnifying Glass', 'jetpack-components');
|
|
82
|
-
case 'gridicons-tag':
|
|
83
|
-
return __('Tag', 'jetpack-components');
|
|
84
|
-
case 'gridicons-video':
|
|
85
|
-
return __('Has a video', 'jetpack-components');
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
renderIcon(icon) {
|
|
89
|
-
switch (icon) {
|
|
90
|
-
default:
|
|
91
|
-
return null;
|
|
92
|
-
case 'gridicons-audio':
|
|
93
|
-
return (_jsx("g", { children: _jsx("path", { d: "M8 4v10.184C7.686 14.072 7.353 14 7 14c-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3V7h7v4.184c-.314-.112-.647-.184-1-.184-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3V4H8z" }) }));
|
|
94
|
-
case 'gridicons-arrow-left':
|
|
95
|
-
return (_jsx("g", { children: _jsx("path", { d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" }) }));
|
|
96
|
-
case 'gridicons-arrow-right':
|
|
97
|
-
return (_jsx("g", { children: _jsx("path", { d: "M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z" }) }));
|
|
98
|
-
case 'gridicons-block':
|
|
99
|
-
return (_jsx("g", { children: _jsx("path", { d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12c0-4.418 3.582-8 8-8 1.848 0 3.545.633 4.9 1.686L5.686 16.9C4.633 15.545 4 13.848 4 12zm8 8c-1.848 0-3.546-.633-4.9-1.686L18.314 7.1C19.367 8.455 20 10.152 20 12c0 4.418-3.582 8-8 8z" }) }));
|
|
100
|
-
case 'gridicons-calendar':
|
|
101
|
-
return (_jsx("g", { children: _jsx("path", { d: "M19 4h-1V2h-2v2H8V2H6v2H5c-1.105 0-2 .896-2 2v13c0 1.104.895 2 2 2h14c1.104 0 2-.896 2-2V6c0-1.104-.896-2-2-2zm0 15H5V8h14v11z" }) }));
|
|
102
|
-
case 'gridicons-cart':
|
|
103
|
-
return (_jsx("g", { children: _jsx("path", { d: "M9 20c0 1.1-.9 2-2 2s-1.99-.9-1.99-2S5.9 18 7 18s2 .9 2 2zm8-2c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2zm.396-5c.937 0 1.75-.65 1.952-1.566L21 5H7V4c0-1.105-.895-2-2-2H3v2h2v11c0 1.105.895 2 2 2h12c0-1.105-.895-2-2-2H7v-2h10.396z" }) }));
|
|
104
|
-
case 'gridicons-checkmark':
|
|
105
|
-
return (_jsx("g", { children: _jsx("path", { d: "M11 17.768l-4.884-4.884 1.768-1.768L11 14.232l8.658-8.658C17.823 3.39 15.075 2 12 2 6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.528-.353-2.97-.966-4.266L11 17.768z" }) }));
|
|
106
|
-
case 'gridicons-chevron-left':
|
|
107
|
-
return (_jsx("g", { children: _jsx("path", { d: "M16.443 7.41L15.0399 6L9.06934 12L15.0399 18L16.443 16.59L11.8855 12L16.443 7.41Z" }) }));
|
|
108
|
-
case 'gridicons-chevron-right':
|
|
109
|
-
return (_jsx("g", { children: _jsx("path", { d: "M10.2366 6L8.8335 7.41L13.391 12L8.8335 16.59L10.2366 18L16.2072 12L10.2366 6Z" }) }));
|
|
110
|
-
case 'gridicons-chevron-down':
|
|
111
|
-
return (_jsx("g", { children: _jsx("path", { d: "M20 9l-8 8-8-8 1.414-1.414L12 14.172l6.586-6.586" }) }));
|
|
112
|
-
case 'gridicons-comment':
|
|
113
|
-
return (_jsx("g", { children: _jsx("path", { d: "M3 6v9c0 1.105.895 2 2 2h9v5l5.325-3.804c1.05-.75 1.675-1.963 1.675-3.254V6c0-1.105-.895-2-2-2H5c-1.105 0-2 .895-2 2z" }) }));
|
|
114
|
-
case 'gridicons-computer':
|
|
115
|
-
return (_jsx("g", { children: _jsx("path", { d: "M20 2H4c-1.104 0-2 .896-2 2v12c0 1.104.896 2 2 2h6v2H7v2h10v-2h-3v-2h6c1.104 0 2-.896 2-2V4c0-1.104-.896-2-2-2zm0 14H4V4h16v12z" }) }));
|
|
116
|
-
case 'gridicons-cross':
|
|
117
|
-
return (_jsx("g", { children: _jsx("path", { d: "M18.36 19.78L12 13.41l-6.36 6.37-1.42-1.42L10.59 12 4.22 5.64l1.42-1.42L12 10.59l6.36-6.36 1.41 1.41L13.41 12l6.36 6.36z" }) }));
|
|
118
|
-
case 'gridicons-domains':
|
|
119
|
-
return (_jsx("g", { children: _jsx("path", { d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm6.918 6h-3.215a49.088 49.088 0 00-.565-3.357A8.048 8.048 0 0118.918 8zm-5.904-3.928c.068.352.387 2.038.645 3.928h-3.318c.258-1.89.577-3.576.645-3.928C11.319 4.029 11.656 4 12 4s.681.029 1.014.072zM14 12c0 .598-.043 1.286-.109 2h-3.782c-.066-.714-.109-1.402-.109-2s.043-1.286.109-2h3.782c.066.714.109 1.402.109 2zM8.862 4.643A49.088 49.088 0 008.297 8H5.082a8.048 8.048 0 013.78-3.357zM4.263 10h3.821C8.033 10.668 8 11.344 8 12s.033 1.332.085 2H4.263C4.097 13.359 4 12.692 4 12s.098-1.359.263-2zm.819 6h3.215c.188 1.424.42 2.65.565 3.357A8.048 8.048 0 015.082 16zm5.904 3.928A77.282 77.282 0 0110.341 16h3.318a78.303 78.303 0 01-.645 3.928c-.333.043-.67.072-1.014.072s-.681-.029-1.014-.072zm4.152-.571c.145-.707.377-1.933.565-3.357h3.215a8.048 8.048 0 01-3.78 3.357zM19.737 14h-3.821c.051-.668.084-1.344.084-2s-.033-1.332-.085-2h3.821c.166.641.264 1.308.264 2s-.097 1.359-.263 2z" }) }));
|
|
120
|
-
case 'gridicons-filter':
|
|
121
|
-
return (_jsx("g", { children: _jsx("path", { d: "M10 19h4v-2h-4v2zm-4-6h12v-2H6v2zM3 5v2h18V5H3z" }) }));
|
|
122
|
-
case 'gridicons-folder':
|
|
123
|
-
return (_jsx("g", { children: _jsx("path", { d: "M18 19H6c-1.1 0-2-.9-2-2V7c0-1.1.9-2 2-2h3c1.1 0 2 .9 2 2h7c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2z" }) }));
|
|
124
|
-
case 'gridicons-help-outline':
|
|
125
|
-
return (_jsx("g", { children: _jsx("path", { d: "M12 4c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-1.962-2v-.528c0-.4.082-.74.246-1.017.163-.276.454-.546.87-.808.333-.21.572-.397.717-.565.146-.168.22-.36.22-.577 0-.172-.078-.308-.234-.41-.156-.1-.358-.15-.608-.15-.62 0-1.34.22-2.168.658l-.854-1.67c1.02-.58 2.084-.872 3.194-.872.913 0 1.63.202 2.15.603.52.4.78.948.78 1.64 0 .495-.116.924-.347 1.287-.23.362-.6.705-1.11 1.03-.43.278-.7.48-.807.61-.108.13-.163.282-.163.458V13h-1.885z" }) }));
|
|
126
|
-
case 'gridicons-image':
|
|
127
|
-
return (_jsx("g", { children: _jsx("path", { d: "M13 9.5c0-.828.672-1.5 1.5-1.5s1.5.672 1.5 1.5-.672 1.5-1.5 1.5-1.5-.672-1.5-1.5zM22 6v12c0 1.105-.895 2-2 2H4c-1.105 0-2-.895-2-2V6c0-1.105.895-2 2-2h16c1.105 0 2 .895 2 2zm-2 0H4v7.444L8 9l5.895 6.55 1.587-1.85c.798-.932 2.24-.932 3.037 0L20 15.426V6z" }) }));
|
|
128
|
-
case 'gridicons-image-multiple':
|
|
129
|
-
return (_jsx("g", { children: _jsx("path", { d: "M15 7.5c0-.828.672-1.5 1.5-1.5s1.5.672 1.5 1.5S17.328 9 16.5 9 15 8.328 15 7.5zM4 20h14c0 1.105-.895 2-2 2H4c-1.1 0-2-.9-2-2V8c0-1.105.895-2 2-2v14zM22 4v12c0 1.105-.895 2-2 2H8c-1.105 0-2-.895-2-2V4c0-1.105.895-2 2-2h12c1.105 0 2 .895 2 2zM8 4v6.333L11 7l4.855 5.395.656-.73c.796-.886 2.183-.886 2.977 0l.513.57V4H8z" }) }));
|
|
130
|
-
case 'gridicons-info':
|
|
131
|
-
return (_jsx("g", { children: _jsx("path", { d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }));
|
|
132
|
-
case 'gridicons-info-outline':
|
|
133
|
-
return (_jsx("g", { children: _jsx("path", { d: "M13 9h-2V7h2v2zm0 2h-2v6h2v-6zm-1-7c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8m0-2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z" }) }));
|
|
134
|
-
case 'gridicons-jetpack-search':
|
|
135
|
-
return (_jsx("g", { children: _jsx("path", { d: "M0 9.257C0 4.15 4.151 0 9.257 0c5.105 0 9.256 4.151 9.256 9.257a9.218 9.218 0 01-2.251 6.045l.034.033h1.053L24 22.01l-1.986 1.989-6.664-6.662v-1.055l-.033-.033a9.218 9.218 0 01-6.06 2.264C4.15 18.513 0 14.362 0 9.257zm4.169 1.537h4.61V1.82l-4.61 8.973zm5.547-3.092v8.974l4.61-8.974h-4.61z" }) }));
|
|
136
|
-
case 'gridicons-phone':
|
|
137
|
-
return (_jsx("g", { children: _jsx("path", { d: "M16 2H8c-1.104 0-2 .896-2 2v16c0 1.104.896 2 2 2h8c1.104 0 2-.896 2-2V4c0-1.104-.896-2-2-2zm-3 19h-2v-1h2v1zm3-2H8V5h8v14z" }) }));
|
|
138
|
-
case 'gridicons-pages':
|
|
139
|
-
return (_jsx("g", { children: _jsx("path", { d: "M16 8H8V6h8v2zm0 2H8v2h8v-2zm4-6v12l-6 6H6c-1.105 0-2-.895-2-2V4c0-1.105.895-2 2-2h12c1.105 0 2 .895 2 2zm-2 10V4H6v16h6v-4c0-1.105.895-2 2-2h4z" }) }));
|
|
140
|
-
case 'gridicons-posts':
|
|
141
|
-
return (_jsx("g", { children: _jsx("path", { d: "M16 19H3v-2h13v2zm5-10H3v2h18V9zM3 5v2h11V5H3zm14 0v2h4V5h-4zm-6 8v2h10v-2H11zm-8 0v2h5v-2H3z" }) }));
|
|
142
|
-
case 'gridicons-search':
|
|
143
|
-
return (_jsx("g", { children: _jsx("path", { d: "M21 19l-5.154-5.154C16.574 12.742 17 11.42 17 10c0-3.866-3.134-7-7-7s-7 3.134-7 7 3.134 7 7 7c1.42 0 2.742-.426 3.846-1.154L19 21l2-2zM5 10c0-2.757 2.243-5 5-5s5 2.243 5 5-2.243 5-5 5-5-2.243-5-5z" }) }));
|
|
144
|
-
case 'gridicons-star-outline':
|
|
145
|
-
return (_jsx("g", { children: _jsx("path", { d: "M12 6.308l1.176 3.167.347.936.997.042 3.374.14-2.647 2.09-.784.62.27.963.91 3.25-2.813-1.872-.83-.553-.83.552-2.814 1.87.91-3.248.27-.962-.783-.62-2.648-2.092 3.374-.14.996-.04.347-.936L12 6.308M12 2L9.418 8.953 2 9.257l5.822 4.602L5.82 21 12 16.89 18.18 21l-2.002-7.14L22 9.256l-7.418-.305L12 2z" }) }));
|
|
146
|
-
case 'gridicons-star':
|
|
147
|
-
return (_jsx("g", { children: _jsx("path", { d: "M12 2l2.582 6.953L22 9.257l-5.822 4.602L18.18 21 12 16.89 5.82 21l2.002-7.14L2 9.256l7.418-.304" }) }));
|
|
148
|
-
case 'gridicons-tag':
|
|
149
|
-
return (_jsx("g", { children: _jsx("path", { d: "M20 2.007h-7.087c-.53 0-1.04.21-1.414.586L2.592 11.5c-.78.78-.78 2.046 0 2.827l7.086 7.086c.78.78 2.046.78 2.827 0l8.906-8.906c.376-.374.587-.883.587-1.413V4.007c0-1.105-.895-2-2-2zM17.007 9c-1.105 0-2-.895-2-2s.895-2 2-2 2 .895 2 2-.895 2-2 2z" }) }));
|
|
150
|
-
case 'gridicons-video':
|
|
151
|
-
return (_jsx("g", { children: _jsx("path", { d: "M20 4v2h-2V4H6v2H4V4c-1.105 0-2 .895-2 2v12c0 1.105.895 2 2 2v-2h2v2h12v-2h2v2c1.105 0 2-.895 2-2V6c0-1.105-.895-2-2-2zM6 16H4v-3h2v3zm0-5H4V8h2v3zm4 4V9l4.5 3-4.5 3zm10 1h-2v-3h2v3zm0-5h-2V8h2v3z" }) }));
|
|
152
|
-
case 'gridicons-lock':
|
|
153
|
-
return (_jsxs(_Fragment, { children: [
|
|
154
|
-
_jsx("g", { id: "lock", children: _jsx("path", { d: "M18,8h-1V7c0-2.757-2.243-5-5-5S7,4.243,7,7v1H6c-1.105,0-2,0.895-2,2v10c0,1.105,0.895,2,2,2h12c1.105,0,2-0.895,2-2V10\n\t\t\t\t\t\t\t\t\tC20,8.895,19.105,8,18,8z M9,7c0-1.654,1.346-3,3-3s3,1.346,3,3v1H9V7z M13,15.723V18h-2v-2.277c-0.595-0.346-1-0.984-1-1.723\n\t\t\t\t\t\t\t\t\tc0-1.105,0.895-2,2-2s2,0.895,2,2C14,14.738,13.595,15.376,13,15.723z" }) }), _jsx("g", { id: "Layer_1" })
|
|
155
|
-
] }));
|
|
156
|
-
case 'gridicons-external':
|
|
157
|
-
return (_jsx("g", { children: _jsx("path", { d: "M19 13v6c0 1.105-.895 2-2 2H5c-1.105 0-2-.895-2-2V7c0-1.105.895-2 2-2h6v2H5v12h12v-6h2zM13 3v2h4.586l-7.793 7.793 1.414 1.414L19 6.414V11h2V3h-8z" }) }));
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
render() {
|
|
161
|
-
const { size = 24, className = '' } = this.props;
|
|
162
|
-
const height = this.props.height || size;
|
|
163
|
-
const width = this.props.width || size;
|
|
164
|
-
const style = this.props.style || { height, width };
|
|
165
|
-
const icon = 'gridicons-' + this.props.icon;
|
|
166
|
-
const iconClass = clsx('gridicon', icon, className, {
|
|
167
|
-
'needs-offset': this.needsOffset(icon, size),
|
|
168
|
-
});
|
|
169
|
-
const description = this.getSVGDescription(icon);
|
|
170
|
-
return (_jsxs("svg", { className: iconClass, focusable: this.props.focusable, height: height, onClick: this.props.onClick, style: style, viewBox: "0 0 24 24", width: width, xmlns: "http://www.w3.org/2000/svg", "aria-hidden": this.props['aria-hidden'], children: [description ? _jsx("desc", { children: description }) : null, this.renderIcon(icon)] }));
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
export default Gridicon;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
.gridicon {
|
|
2
|
-
fill: currentColor;
|
|
3
|
-
display: inline-block;
|
|
4
|
-
|
|
5
|
-
&.needs-offset g {
|
|
6
|
-
transform: translate(1px, 1px); /* translates to .5px because it's in a child element */
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
&.needs-offset-x g {
|
|
10
|
-
transform: translate(1px, 0); /* only nudges horizontally */
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&.needs-offset-y g {
|
|
14
|
-
transform: translate(0, 1px); /* only nudges vertically */
|
|
15
|
-
}
|
|
16
|
-
}
|