@woosmap/ui 3.65.0 → 3.66.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/package.json
CHANGED
|
@@ -153,12 +153,12 @@ import { ReactComponent as SocialFacebook } from '../../icons/social-facebook.sv
|
|
|
153
153
|
import { ReactComponent as SocialLinkedin } from '../../icons/social-linkedin.svg';
|
|
154
154
|
import { ReactComponent as SocialTwitter } from '../../icons/social-twitter.svg';
|
|
155
155
|
|
|
156
|
-
const
|
|
156
|
+
const WebsiteIcons = {
|
|
157
157
|
autocomplete: Autocomplete,
|
|
158
158
|
battery: Battery,
|
|
159
159
|
buildings: Buildings,
|
|
160
|
-
cars: Cars,
|
|
161
160
|
care: Care,
|
|
161
|
+
cars: Cars,
|
|
162
162
|
elephant: Elephant,
|
|
163
163
|
github: Github,
|
|
164
164
|
green: Green,
|
|
@@ -177,26 +177,28 @@ const Icons = {
|
|
|
177
177
|
speed: Speed,
|
|
178
178
|
world: World,
|
|
179
179
|
zoom: Zoom,
|
|
180
|
+
};
|
|
180
181
|
|
|
182
|
+
const ConsoleIcons = {
|
|
181
183
|
access: Access,
|
|
182
|
-
add: Add,
|
|
183
184
|
'add-circle': AddCircle,
|
|
184
|
-
|
|
185
|
-
'administration-tool': AdministrationTool,
|
|
185
|
+
add: Add,
|
|
186
186
|
'admin-key': AdminKey,
|
|
187
187
|
'admin-tool': AdminTool,
|
|
188
|
+
'administration-tool': AdministrationTool,
|
|
189
|
+
administration: Administration,
|
|
188
190
|
agenda: Agenda,
|
|
189
|
-
'alphabetical-order': AlphabeticalOrder,
|
|
190
191
|
'alphabetical-order-reversed': AlphabeticalOrderReversed,
|
|
192
|
+
'alphabetical-order': AlphabeticalOrder,
|
|
191
193
|
archive: Archive,
|
|
192
194
|
'arrow-bottom': ArrowBotton,
|
|
193
195
|
'arrow-left': ArrowLeft,
|
|
196
|
+
'arrow-link': ArrowLink,
|
|
194
197
|
'arrow-right': ArrowRight,
|
|
195
198
|
'arrow-top': ArrowTop,
|
|
196
|
-
'arrow-link': ArrowLink,
|
|
197
|
-
asset: Asset,
|
|
198
199
|
'asset-add-file': AssetAddFile,
|
|
199
200
|
'asset-add': AssetAdd,
|
|
201
|
+
asset: Asset,
|
|
200
202
|
bank: Bank,
|
|
201
203
|
beaker: Beaker,
|
|
202
204
|
bell: Bell,
|
|
@@ -208,14 +210,14 @@ const Icons = {
|
|
|
208
210
|
'caret-top': CaretTop,
|
|
209
211
|
charts: Charts,
|
|
210
212
|
chat: Chat,
|
|
211
|
-
check: Check,
|
|
212
|
-
checked: Checked,
|
|
213
213
|
'check-circle': CheckCircle,
|
|
214
214
|
'check-square': CheckSquare,
|
|
215
|
-
|
|
215
|
+
check: Check,
|
|
216
|
+
checked: Checked,
|
|
216
217
|
'clock-reversed': ClockReversed,
|
|
217
|
-
|
|
218
|
+
clock: Clock,
|
|
218
219
|
'close-thick': CloseThick,
|
|
220
|
+
close: Close,
|
|
219
221
|
company: Company,
|
|
220
222
|
copy: Copy,
|
|
221
223
|
'credit-card': CreditCard,
|
|
@@ -224,21 +226,21 @@ const Icons = {
|
|
|
224
226
|
delete: Delete,
|
|
225
227
|
details: Details,
|
|
226
228
|
documentation: Documentation,
|
|
227
|
-
dot: Dot,
|
|
228
229
|
'dot-fill': DotFill,
|
|
230
|
+
dot: Dot,
|
|
229
231
|
download: Download,
|
|
230
232
|
edit: Edit,
|
|
231
233
|
email: Email,
|
|
232
234
|
enter: Enter,
|
|
233
|
-
eye: Eye,
|
|
234
|
-
'eye-crossed-out': EyeCrossedOut,
|
|
235
235
|
exchange: Exchange,
|
|
236
236
|
expand: Expand,
|
|
237
237
|
export: Export,
|
|
238
|
+
'eye-crossed-out': EyeCrossedOut,
|
|
239
|
+
eye: Eye,
|
|
238
240
|
flag: Flag,
|
|
239
241
|
globe: Globe,
|
|
240
|
-
home: Home,
|
|
241
242
|
'home-user': HomeUser,
|
|
243
|
+
home: Home,
|
|
242
244
|
import: Import,
|
|
243
245
|
info: Info,
|
|
244
246
|
label: Label,
|
|
@@ -249,14 +251,14 @@ const Icons = {
|
|
|
249
251
|
longitude: Longitude,
|
|
250
252
|
manage: Manage,
|
|
251
253
|
marker: Marker,
|
|
252
|
-
members: Members,
|
|
253
254
|
member: Member,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
'menu-vertical': MenuVertical,
|
|
255
|
+
members: Members,
|
|
256
|
+
'menu-circle-horizontal': MenuCircleHorizontal,
|
|
257
257
|
'menu-circle-vertical': MenuCircleVertical,
|
|
258
258
|
'menu-horizontal': MenuHorizontal,
|
|
259
|
-
'menu-
|
|
259
|
+
'menu-vertical': MenuVertical,
|
|
260
|
+
metrics: Metrics,
|
|
261
|
+
more: More,
|
|
260
262
|
organization: Organization,
|
|
261
263
|
organizations: Organizations,
|
|
262
264
|
phone: Phone,
|
|
@@ -273,9 +275,12 @@ const Icons = {
|
|
|
273
275
|
'see-page': SeePage,
|
|
274
276
|
settings: Settings,
|
|
275
277
|
shield: Shield,
|
|
276
|
-
|
|
278
|
+
showcases: Showcases,
|
|
279
|
+
'social-facebook': SocialFacebook,
|
|
280
|
+
'social-linkedin': SocialLinkedin,
|
|
281
|
+
'social-twitter': SocialTwitter,
|
|
277
282
|
'star-filled': StarFilled,
|
|
278
|
-
|
|
283
|
+
star: Star,
|
|
279
284
|
support: Support,
|
|
280
285
|
switch: Switch,
|
|
281
286
|
team: Team,
|
|
@@ -287,23 +292,29 @@ const Icons = {
|
|
|
287
292
|
'view-mini-card': ViewMiniCard,
|
|
288
293
|
warning: Warning,
|
|
289
294
|
woosmap: Woosmap,
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
const ProductsIcons = {
|
|
290
298
|
address: Address,
|
|
299
|
+
connectors: Connectors,
|
|
291
300
|
distance: Distance,
|
|
301
|
+
geofencing: Geofencing,
|
|
292
302
|
geolocation: Geolocation,
|
|
293
|
-
|
|
303
|
+
indoor: Indoor,
|
|
294
304
|
localities: Localities,
|
|
305
|
+
mapping: Mapping,
|
|
295
306
|
maps: Map,
|
|
296
307
|
merchant: Merchant,
|
|
297
|
-
traffic: Traffic,
|
|
298
|
-
geofencing: Geofencing,
|
|
299
308
|
multisearch: MultiSearch,
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
309
|
+
storelocator: StoreLocator,
|
|
310
|
+
stores: Stores,
|
|
311
|
+
traffic: Traffic,
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
const Icons = {
|
|
315
|
+
...WebsiteIcons,
|
|
316
|
+
...ConsoleIcons,
|
|
317
|
+
...ProductsIcons,
|
|
307
318
|
};
|
|
308
319
|
|
|
309
320
|
class Icon extends Component {
|
|
@@ -313,7 +324,7 @@ class Icon extends Component {
|
|
|
313
324
|
return (
|
|
314
325
|
<IconComponent
|
|
315
326
|
className={cl('icon', className)}
|
|
316
|
-
data-testid={testId}
|
|
327
|
+
data-testid={`${testId}-${icon}`}
|
|
317
328
|
width={size}
|
|
318
329
|
height={size}
|
|
319
330
|
title={title}
|
|
@@ -336,6 +347,10 @@ Icon.propTypes = {
|
|
|
336
347
|
title: PropTypes.string,
|
|
337
348
|
testId: PropTypes.string,
|
|
338
349
|
};
|
|
350
|
+
|
|
339
351
|
export default Object.assign(Icon, {
|
|
340
352
|
Icons,
|
|
353
|
+
WebsiteIcons,
|
|
354
|
+
ConsoleIcons,
|
|
355
|
+
ProductsIcons,
|
|
341
356
|
});
|
|
@@ -13,17 +13,22 @@ const Template = () => (
|
|
|
13
13
|
<Icon size={64} icon="home" />
|
|
14
14
|
</div>
|
|
15
15
|
);
|
|
16
|
+
|
|
16
17
|
export const Default = Template.bind({});
|
|
17
18
|
Default.args = {};
|
|
18
|
-
|
|
19
|
-
const
|
|
19
|
+
|
|
20
|
+
const { Icons, WebsiteIcons, ConsoleIcons, ProductsIcons } = Icon;
|
|
21
|
+
|
|
22
|
+
const drawIcon = (icon) => (
|
|
20
23
|
<div key={icon} className="icon-story">
|
|
21
24
|
<div className="icon-story__container">
|
|
22
25
|
<Icon size={48} icon={icon} />
|
|
23
26
|
<div className="icon-story__name">{icon}</div>
|
|
24
27
|
</div>
|
|
25
28
|
</div>
|
|
26
|
-
)
|
|
27
|
-
const TemplateCatalog = () => <div className="flex-wrap">{allIcons}</div>;
|
|
29
|
+
);
|
|
28
30
|
|
|
29
|
-
export const
|
|
31
|
+
export const All = () => <div className="flex-wrap">{Object.keys(Icons).map(drawIcon)}</div>;
|
|
32
|
+
export const Website = () => <div className="flex-wrap">{Object.keys(WebsiteIcons).map(drawIcon)}</div>;
|
|
33
|
+
export const Console = () => <div className="flex-wrap">{Object.keys(ConsoleIcons).map(drawIcon)}</div>;
|
|
34
|
+
export const Products = () => <div className="flex-wrap">{Object.keys(ProductsIcons).map(drawIcon)}</div>;
|
|
@@ -6,16 +6,37 @@ import Icon from './Icon';
|
|
|
6
6
|
|
|
7
7
|
it('renders an icon component', () => {
|
|
8
8
|
const { getByTestId } = render(<Icon icon="home" size={64} />);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
|
|
10
|
+
const result = getByTestId('icon-home');
|
|
11
|
+
|
|
12
|
+
expect(result).toHaveClass('icon');
|
|
13
|
+
expect(result).toHaveAttribute('width', '64');
|
|
14
|
+
expect(result).toHaveTextContent('home');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const isIconRendered = (icon) => {
|
|
18
|
+
const { getByTestId } = render(<Icon icon={icon} />);
|
|
19
|
+
const result = getByTestId(`icon-${icon}`);
|
|
20
|
+
|
|
21
|
+
expect(result).toHaveClass('icon');
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
it('renders all website icons components', () => {
|
|
25
|
+
const { WebsiteIcons } = Icon;
|
|
26
|
+
Object.keys(WebsiteIcons).forEach(isIconRendered);
|
|
12
27
|
});
|
|
13
|
-
|
|
28
|
+
|
|
29
|
+
it('renders all console icons components', () => {
|
|
30
|
+
const { ConsoleIcons } = Icon;
|
|
31
|
+
Object.keys(ConsoleIcons).forEach(isIconRendered);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('renders all products icons components', () => {
|
|
35
|
+
const { ProductsIcons } = Icon;
|
|
36
|
+
Object.keys(ProductsIcons).forEach(isIconRendered);
|
|
37
|
+
});
|
|
38
|
+
|
|
14
39
|
it('renders all icon components', () => {
|
|
15
40
|
const { Icons } = Icon;
|
|
16
|
-
Object.keys(Icons).forEach(
|
|
17
|
-
const { container } = render(<Icon icon={icon} />);
|
|
18
|
-
expect(container.firstChild).toHaveTextContent(icon);
|
|
19
|
-
});
|
|
41
|
+
Object.keys(Icons).forEach(isIconRendered);
|
|
20
42
|
});
|
|
21
|
-
*/
|