@automattic/jetpack-components 1.10.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 +17 -0
- package/build/components/admin-page/index.d.ts +0 -1
- package/build/components/admin-page/index.js +2 -9
- package/build/components/admin-page/style.module.scss +16 -3
- package/build/components/boost-score-bar/index.js +3 -3
- 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/index.d.ts +2 -1
- package/build/index.js +1 -1
- package/components/admin-page/index.tsx +4 -16
- package/components/admin-page/style.module.scss +16 -3
- package/components/boost-score-bar/index.tsx +3 -3
- 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/index.ts +2 -1
- package/package.json +22 -4
- 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
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
/* !!!
|
|
2
|
-
This is a fork of the Jetpack Gridicon code:
|
|
3
|
-
https://github.com/Automattic/jetpack/blob/f8078c2cd12ac508334da2fb08e37a92cf283c14/_inc/client/components/gridicon/index.jsx
|
|
4
|
-
|
|
5
|
-
It has been modified to work with Preact, and only includes the icons that we need.
|
|
6
|
-
!!! */
|
|
7
|
-
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import clsx from 'clsx';
|
|
10
|
-
import { Component } from 'react';
|
|
11
|
-
import './style.scss';
|
|
12
|
-
import { GridiconProps } from './types.ts';
|
|
13
|
-
|
|
14
|
-
class Gridicon extends Component< GridiconProps > {
|
|
15
|
-
static defaultProps = {
|
|
16
|
-
'aria-hidden': 'false',
|
|
17
|
-
focusable: 'true',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
needsOffset( icon, size ) {
|
|
21
|
-
const iconNeedsOffset = [
|
|
22
|
-
'gridicons-arrow-left',
|
|
23
|
-
'gridicons-arrow-right',
|
|
24
|
-
'gridicons-calendar',
|
|
25
|
-
'gridicons-cart',
|
|
26
|
-
'gridicons-folder',
|
|
27
|
-
'gridicons-help-outline',
|
|
28
|
-
'gridicons-info',
|
|
29
|
-
'gridicons-info-outline',
|
|
30
|
-
'gridicons-posts',
|
|
31
|
-
'gridicons-star-outline',
|
|
32
|
-
'gridicons-star',
|
|
33
|
-
];
|
|
34
|
-
|
|
35
|
-
if ( iconNeedsOffset.indexOf( icon ) >= 0 ) {
|
|
36
|
-
return size % 18 === 0;
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
getSVGDescription( icon ) {
|
|
42
|
-
// Enable overriding desc with falsy/truthy values.
|
|
43
|
-
if ( 'description' in this.props ) {
|
|
44
|
-
return this.props.description;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
switch ( icon ) {
|
|
48
|
-
default:
|
|
49
|
-
return '';
|
|
50
|
-
case 'gridicons-audio':
|
|
51
|
-
return __( 'Has audio', 'jetpack-components' );
|
|
52
|
-
case 'gridicons-arrow-left':
|
|
53
|
-
return __( 'Arrow left', 'jetpack-components' );
|
|
54
|
-
case 'gridicons-arrow-right':
|
|
55
|
-
return __( 'Arrow right', 'jetpack-components' );
|
|
56
|
-
case 'gridicons-calendar':
|
|
57
|
-
return __( 'Is an event', 'jetpack-components' );
|
|
58
|
-
case 'gridicons-cart':
|
|
59
|
-
return __( 'Is a product', 'jetpack-components' );
|
|
60
|
-
case 'chevron-down':
|
|
61
|
-
return __( 'Show filters', 'jetpack-components' );
|
|
62
|
-
case 'gridicons-comment':
|
|
63
|
-
return __( 'Matching comment', 'jetpack-components' );
|
|
64
|
-
case 'gridicons-cross':
|
|
65
|
-
return __( 'Close', 'jetpack-components' );
|
|
66
|
-
case 'gridicons-domains':
|
|
67
|
-
return __( 'Website', 'jetpack-components' );
|
|
68
|
-
case 'gridicons-filter':
|
|
69
|
-
return __( 'Toggle search filters', 'jetpack-components' );
|
|
70
|
-
case 'gridicons-folder':
|
|
71
|
-
return __( 'Category', 'jetpack-components' );
|
|
72
|
-
case 'gridicons-help-outline':
|
|
73
|
-
return __( 'Help', 'jetpack-components' );
|
|
74
|
-
case 'gridicons-info':
|
|
75
|
-
case 'gridicons-info-outline':
|
|
76
|
-
return __( 'Information', 'jetpack-components' );
|
|
77
|
-
case 'gridicons-image-multiple':
|
|
78
|
-
return __( 'Has multiple images', 'jetpack-components' );
|
|
79
|
-
case 'gridicons-image':
|
|
80
|
-
return __( 'Has an image', 'jetpack-components' );
|
|
81
|
-
case 'gridicons-page':
|
|
82
|
-
return __( 'Page', 'jetpack-components' );
|
|
83
|
-
case 'gridicons-post':
|
|
84
|
-
return __( 'Post', 'jetpack-components' );
|
|
85
|
-
case 'gridicons-jetpack-search':
|
|
86
|
-
case 'gridicons-search':
|
|
87
|
-
return __( 'Magnifying Glass', 'jetpack-components' );
|
|
88
|
-
case 'gridicons-tag':
|
|
89
|
-
return __( 'Tag', 'jetpack-components' );
|
|
90
|
-
case 'gridicons-video':
|
|
91
|
-
return __( 'Has a video', 'jetpack-components' );
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
renderIcon( icon ) {
|
|
96
|
-
switch ( icon ) {
|
|
97
|
-
default:
|
|
98
|
-
return null;
|
|
99
|
-
case 'gridicons-audio':
|
|
100
|
-
return (
|
|
101
|
-
<g>
|
|
102
|
-
<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" />
|
|
103
|
-
</g>
|
|
104
|
-
);
|
|
105
|
-
case 'gridicons-arrow-left':
|
|
106
|
-
return (
|
|
107
|
-
<g>
|
|
108
|
-
<path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" />
|
|
109
|
-
</g>
|
|
110
|
-
);
|
|
111
|
-
case 'gridicons-arrow-right':
|
|
112
|
-
return (
|
|
113
|
-
<g>
|
|
114
|
-
<path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z" />
|
|
115
|
-
</g>
|
|
116
|
-
);
|
|
117
|
-
case 'gridicons-block':
|
|
118
|
-
return (
|
|
119
|
-
<g>
|
|
120
|
-
<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" />
|
|
121
|
-
</g>
|
|
122
|
-
);
|
|
123
|
-
case 'gridicons-calendar':
|
|
124
|
-
return (
|
|
125
|
-
<g>
|
|
126
|
-
<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" />
|
|
127
|
-
</g>
|
|
128
|
-
);
|
|
129
|
-
case 'gridicons-cart':
|
|
130
|
-
return (
|
|
131
|
-
<g>
|
|
132
|
-
<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" />
|
|
133
|
-
</g>
|
|
134
|
-
);
|
|
135
|
-
case 'gridicons-checkmark':
|
|
136
|
-
return (
|
|
137
|
-
<g>
|
|
138
|
-
<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" />
|
|
139
|
-
</g>
|
|
140
|
-
);
|
|
141
|
-
case 'gridicons-chevron-left':
|
|
142
|
-
return (
|
|
143
|
-
<g>
|
|
144
|
-
<path d="M16.443 7.41L15.0399 6L9.06934 12L15.0399 18L16.443 16.59L11.8855 12L16.443 7.41Z" />
|
|
145
|
-
</g>
|
|
146
|
-
);
|
|
147
|
-
case 'gridicons-chevron-right':
|
|
148
|
-
return (
|
|
149
|
-
<g>
|
|
150
|
-
<path d="M10.2366 6L8.8335 7.41L13.391 12L8.8335 16.59L10.2366 18L16.2072 12L10.2366 6Z" />
|
|
151
|
-
</g>
|
|
152
|
-
);
|
|
153
|
-
case 'gridicons-chevron-down':
|
|
154
|
-
return (
|
|
155
|
-
<g>
|
|
156
|
-
<path d="M20 9l-8 8-8-8 1.414-1.414L12 14.172l6.586-6.586" />
|
|
157
|
-
</g>
|
|
158
|
-
);
|
|
159
|
-
case 'gridicons-comment':
|
|
160
|
-
return (
|
|
161
|
-
<g>
|
|
162
|
-
<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" />
|
|
163
|
-
</g>
|
|
164
|
-
);
|
|
165
|
-
case 'gridicons-computer':
|
|
166
|
-
return (
|
|
167
|
-
<g>
|
|
168
|
-
<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"></path>
|
|
169
|
-
</g>
|
|
170
|
-
);
|
|
171
|
-
case 'gridicons-cross':
|
|
172
|
-
return (
|
|
173
|
-
<g>
|
|
174
|
-
<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" />
|
|
175
|
-
</g>
|
|
176
|
-
);
|
|
177
|
-
case 'gridicons-domains':
|
|
178
|
-
return (
|
|
179
|
-
<g>
|
|
180
|
-
<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" />
|
|
181
|
-
</g>
|
|
182
|
-
);
|
|
183
|
-
case 'gridicons-filter':
|
|
184
|
-
return (
|
|
185
|
-
<g>
|
|
186
|
-
<path d="M10 19h4v-2h-4v2zm-4-6h12v-2H6v2zM3 5v2h18V5H3z" />
|
|
187
|
-
</g>
|
|
188
|
-
);
|
|
189
|
-
case 'gridicons-folder':
|
|
190
|
-
return (
|
|
191
|
-
<g>
|
|
192
|
-
<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" />
|
|
193
|
-
</g>
|
|
194
|
-
);
|
|
195
|
-
case 'gridicons-help-outline':
|
|
196
|
-
return (
|
|
197
|
-
<g>
|
|
198
|
-
<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" />
|
|
199
|
-
</g>
|
|
200
|
-
);
|
|
201
|
-
case 'gridicons-image':
|
|
202
|
-
return (
|
|
203
|
-
<g>
|
|
204
|
-
<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" />
|
|
205
|
-
</g>
|
|
206
|
-
);
|
|
207
|
-
case 'gridicons-image-multiple':
|
|
208
|
-
return (
|
|
209
|
-
<g>
|
|
210
|
-
<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" />
|
|
211
|
-
</g>
|
|
212
|
-
);
|
|
213
|
-
case 'gridicons-info':
|
|
214
|
-
return (
|
|
215
|
-
<g>
|
|
216
|
-
<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" />
|
|
217
|
-
</g>
|
|
218
|
-
);
|
|
219
|
-
case 'gridicons-info-outline':
|
|
220
|
-
return (
|
|
221
|
-
<g>
|
|
222
|
-
<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"></path>
|
|
223
|
-
</g>
|
|
224
|
-
);
|
|
225
|
-
case 'gridicons-jetpack-search':
|
|
226
|
-
return (
|
|
227
|
-
<g>
|
|
228
|
-
<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" />
|
|
229
|
-
</g>
|
|
230
|
-
);
|
|
231
|
-
case 'gridicons-phone':
|
|
232
|
-
return (
|
|
233
|
-
<g>
|
|
234
|
-
<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"></path>
|
|
235
|
-
</g>
|
|
236
|
-
);
|
|
237
|
-
case 'gridicons-pages':
|
|
238
|
-
return (
|
|
239
|
-
<g>
|
|
240
|
-
<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" />
|
|
241
|
-
</g>
|
|
242
|
-
);
|
|
243
|
-
case 'gridicons-posts':
|
|
244
|
-
return (
|
|
245
|
-
<g>
|
|
246
|
-
<path d="M16 19H3v-2h13v2zm5-10H3v2h18V9zM3 5v2h11V5H3zm14 0v2h4V5h-4zm-6 8v2h10v-2H11zm-8 0v2h5v-2H3z" />
|
|
247
|
-
</g>
|
|
248
|
-
);
|
|
249
|
-
case 'gridicons-search':
|
|
250
|
-
return (
|
|
251
|
-
<g>
|
|
252
|
-
<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" />
|
|
253
|
-
</g>
|
|
254
|
-
);
|
|
255
|
-
case 'gridicons-star-outline':
|
|
256
|
-
return (
|
|
257
|
-
<g>
|
|
258
|
-
<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" />
|
|
259
|
-
</g>
|
|
260
|
-
);
|
|
261
|
-
case 'gridicons-star':
|
|
262
|
-
return (
|
|
263
|
-
<g>
|
|
264
|
-
<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" />
|
|
265
|
-
</g>
|
|
266
|
-
);
|
|
267
|
-
case 'gridicons-tag':
|
|
268
|
-
return (
|
|
269
|
-
<g>
|
|
270
|
-
<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" />
|
|
271
|
-
</g>
|
|
272
|
-
);
|
|
273
|
-
case 'gridicons-video':
|
|
274
|
-
return (
|
|
275
|
-
<g>
|
|
276
|
-
<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" />
|
|
277
|
-
</g>
|
|
278
|
-
);
|
|
279
|
-
case 'gridicons-lock':
|
|
280
|
-
return (
|
|
281
|
-
<>
|
|
282
|
-
<g id="lock">
|
|
283
|
-
<path
|
|
284
|
-
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
|
|
285
|
-
C20,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
|
|
286
|
-
c0-1.105,0.895-2,2-2s2,0.895,2,2C14,14.738,13.595,15.376,13,15.723z"
|
|
287
|
-
/>
|
|
288
|
-
</g>
|
|
289
|
-
<g id="Layer_1"></g>
|
|
290
|
-
</>
|
|
291
|
-
);
|
|
292
|
-
case 'gridicons-external':
|
|
293
|
-
return (
|
|
294
|
-
<g>
|
|
295
|
-
<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" />
|
|
296
|
-
</g>
|
|
297
|
-
);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
render() {
|
|
302
|
-
const { size = 24, className = '' } = this.props;
|
|
303
|
-
|
|
304
|
-
const height = this.props.height || size;
|
|
305
|
-
const width = this.props.width || size;
|
|
306
|
-
const style = this.props.style || { height, width };
|
|
307
|
-
|
|
308
|
-
const icon = 'gridicons-' + this.props.icon;
|
|
309
|
-
|
|
310
|
-
const iconClass = clsx( 'gridicon', icon, className, {
|
|
311
|
-
'needs-offset': this.needsOffset( icon, size ),
|
|
312
|
-
} );
|
|
313
|
-
const description = this.getSVGDescription( icon );
|
|
314
|
-
|
|
315
|
-
return (
|
|
316
|
-
<svg
|
|
317
|
-
className={ iconClass }
|
|
318
|
-
focusable={ this.props.focusable }
|
|
319
|
-
height={ height }
|
|
320
|
-
onClick={ this.props.onClick }
|
|
321
|
-
style={ style }
|
|
322
|
-
viewBox="0 0 24 24"
|
|
323
|
-
width={ width }
|
|
324
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
325
|
-
aria-hidden={ this.props[ 'aria-hidden' ] }
|
|
326
|
-
>
|
|
327
|
-
{ description ? <desc>{ description }</desc> : null }
|
|
328
|
-
{ this.renderIcon( icon ) }
|
|
329
|
-
</svg>
|
|
330
|
-
);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
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
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'react';
|
|
2
|
-
|
|
3
|
-
export type GridiconProps = {
|
|
4
|
-
/**
|
|
5
|
-
* Icon name
|
|
6
|
-
*/
|
|
7
|
-
icon: string;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* HTML class name
|
|
11
|
-
*/
|
|
12
|
-
className?: string;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Description for SVG for screen readers
|
|
16
|
-
*/
|
|
17
|
-
description?: string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Whether SVG is focussable
|
|
21
|
-
*/
|
|
22
|
-
focusable?: boolean;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* SVG height
|
|
26
|
-
*/
|
|
27
|
-
height?: number;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Click handler
|
|
31
|
-
*/
|
|
32
|
-
onClick?: VoidFunction;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* SVG width and height
|
|
36
|
-
*/
|
|
37
|
-
size?: number;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* SVG style
|
|
41
|
-
*/
|
|
42
|
-
style?: CSSProperties;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* SVG width
|
|
46
|
-
*/
|
|
47
|
-
width?: number;
|
|
48
|
-
};
|