@unocss/preset-icons 0.44.7 → 0.45.1

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.
@@ -14,6 +14,9 @@ const defaults = Object.freeze({
14
14
  rotate: 0
15
15
  });
16
16
 
17
+ const allKeys = Object.keys(defaults);
18
+ allKeys.filter((key) => key !== "width" && key !== "height");
19
+
17
20
  const iconDefaults = Object.freeze({
18
21
  left: 0,
19
22
  top: 0,
@@ -87,6 +90,14 @@ function getIconData(data, name, full = false) {
87
90
  return result && full ? fullIcon(result) : result;
88
91
  }
89
92
 
93
+ for (const prop in iconDefaults) {
94
+ typeof iconDefaults[prop];
95
+ }
96
+
97
+ Object.keys(iconDefaults).concat([
98
+ "provider"
99
+ ]);
100
+
90
101
  const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
91
102
  const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
92
103
  function calculateSize(size, ratio, precision) {
@@ -248,10 +259,188 @@ function iconToSVG(icon, customisations) {
248
259
  return result;
249
260
  }
250
261
 
262
+ "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
263
+
251
264
  function trimSVG(str) {
252
265
  return str.replace(/(["';{}><])\s*\n\s*/g, "$1").replace(/\s*\n\s*/g, " ").replace(/\s+"/g, '"').replace(/="\s+/g, '="').trim();
253
266
  }
254
267
 
268
+ function add(keyword, colors) {
269
+ const type = "rgb";
270
+ const r = colors[0];
271
+ const length = colors.length;
272
+ ({
273
+ type,
274
+ r,
275
+ g: length > 1 ? colors[1] : r,
276
+ b: length > 2 ? colors[2] : r,
277
+ alpha: length > 3 ? colors[3] : 1
278
+ });
279
+ }
280
+ add("silver", [192]);
281
+ add("gray", [128]);
282
+ add("white", [255]);
283
+ add("maroon", [128, 0, 0]);
284
+ add("red", [255, 0, 0]);
285
+ add("purple", [128, 0]);
286
+ add("fuchsia", [255, 0]);
287
+ add("green", [0, 128]);
288
+ add("lime", [0, 255]);
289
+ add("olive", [128, 128, 0]);
290
+ add("yellow", [255, 255, 0]);
291
+ add("navy", [0, 0, 128]);
292
+ add("blue", [0, 0, 255]);
293
+ add("teal", [0, 128, 128]);
294
+ add("aqua", [0, 255, 255]);
295
+ add("aliceblue", [240, 248, 255]);
296
+ add("antiquewhite", [250, 235, 215]);
297
+ add("aqua", [0, 255, 255]);
298
+ add("aquamarine", [127, 255, 212]);
299
+ add("azure", [240, 255, 255]);
300
+ add("beige", [245, 245, 220]);
301
+ add("bisque", [255, 228, 196]);
302
+ add("black", [0]);
303
+ add("blanchedalmond", [255, 235, 205]);
304
+ add("blue", [0, 0, 255]);
305
+ add("blueviolet", [138, 43, 226]);
306
+ add("brown", [165, 42, 42]);
307
+ add("burlywood", [222, 184, 135]);
308
+ add("cadetblue", [95, 158, 160]);
309
+ add("chartreuse", [127, 255, 0]);
310
+ add("chocolate", [210, 105, 30]);
311
+ add("coral", [255, 127, 80]);
312
+ add("cornflowerblue", [100, 149, 237]);
313
+ add("cornsilk", [255, 248, 220]);
314
+ add("crimson", [220, 20, 60]);
315
+ add("cyan", [0, 255, 255]);
316
+ add("darkblue", [0, 0, 139]);
317
+ add("darkcyan", [0, 139, 139]);
318
+ add("darkgoldenrod", [184, 134, 11]);
319
+ add("darkgray", [169]);
320
+ add("darkgreen", [0, 100]);
321
+ add("darkgrey", [169]);
322
+ add("darkkhaki", [189, 183, 107]);
323
+ add("darkmagenta", [139, 0]);
324
+ add("darkolivegreen", [85, 107, 47]);
325
+ add("darkorange", [255, 140, 0]);
326
+ add("darkorchid", [153, 50, 204]);
327
+ add("darkred", [139, 0, 0]);
328
+ add("darksalmon", [233, 150, 122]);
329
+ add("darkseagreen", [143, 188]);
330
+ add("darkslateblue", [72, 61, 139]);
331
+ add("darkslategray", [47, 79, 79]);
332
+ add("darkslategrey", [47, 79, 79]);
333
+ add("darkturquoise", [0, 206, 209]);
334
+ add("darkviolet", [148, 0, 211]);
335
+ add("deeppink", [255, 20, 147]);
336
+ add("deepskyblue", [0, 191, 255]);
337
+ add("dimgray", [105]);
338
+ add("dimgrey", [105]);
339
+ add("dodgerblue", [30, 144, 255]);
340
+ add("firebrick", [178, 34, 34]);
341
+ add("floralwhite", [255, 250, 240]);
342
+ add("forestgreen", [34, 139]);
343
+ add("fuchsia", [255, 0]);
344
+ add("gainsboro", [220]);
345
+ add("ghostwhite", [248, 248, 255]);
346
+ add("gold", [255, 215, 0]);
347
+ add("goldenrod", [218, 165, 32]);
348
+ add("gray", [128]);
349
+ add("green", [0, 128]);
350
+ add("greenyellow", [173, 255, 47]);
351
+ add("grey", [128]);
352
+ add("honeydew", [240, 255]);
353
+ add("hotpink", [255, 105, 180]);
354
+ add("indianred", [205, 92, 92]);
355
+ add("indigo", [75, 0, 130]);
356
+ add("ivory", [255, 255, 240]);
357
+ add("khaki", [240, 230, 140]);
358
+ add("lavender", [230, 230, 250]);
359
+ add("lavenderblush", [255, 240, 245]);
360
+ add("lawngreen", [124, 252, 0]);
361
+ add("lemonchiffon", [255, 250, 205]);
362
+ add("lightblue", [173, 216, 230]);
363
+ add("lightcoral", [240, 128, 128]);
364
+ add("lightcyan", [224, 255, 255]);
365
+ add("lightgoldenrodyellow", [250, 250, 210]);
366
+ add("lightgray", [211]);
367
+ add("lightgreen", [144, 238]);
368
+ add("lightgrey", [211]);
369
+ add("lightpink", [255, 182, 193]);
370
+ add("lightsalmon", [255, 160, 122]);
371
+ add("lightseagreen", [32, 178, 170]);
372
+ add("lightskyblue", [135, 206, 250]);
373
+ add("lightslategray", [119, 136, 153]);
374
+ add("lightslategrey", [119, 136, 153]);
375
+ add("lightsteelblue", [176, 196, 222]);
376
+ add("lightyellow", [255, 255, 224]);
377
+ add("lime", [0, 255]);
378
+ add("limegreen", [50, 205]);
379
+ add("linen", [250, 240, 230]);
380
+ add("magenta", [255, 0]);
381
+ add("maroon", [128, 0, 0]);
382
+ add("mediumaquamarine", [102, 205, 170]);
383
+ add("mediumblue", [0, 0, 205]);
384
+ add("mediumorchid", [186, 85, 211]);
385
+ add("mediumpurple", [147, 112, 219]);
386
+ add("mediumseagreen", [60, 179, 113]);
387
+ add("mediumslateblue", [123, 104, 238]);
388
+ add("mediumspringgreen", [0, 250, 154]);
389
+ add("mediumturquoise", [72, 209, 204]);
390
+ add("mediumvioletred", [199, 21, 133]);
391
+ add("midnightblue", [25, 25, 112]);
392
+ add("mintcream", [245, 255, 250]);
393
+ add("mistyrose", [255, 228, 225]);
394
+ add("moccasin", [255, 228, 181]);
395
+ add("navajowhite", [255, 222, 173]);
396
+ add("navy", [0, 0, 128]);
397
+ add("oldlace", [253, 245, 230]);
398
+ add("olive", [128, 128, 0]);
399
+ add("olivedrab", [107, 142, 35]);
400
+ add("orange", [255, 165, 0]);
401
+ add("orangered", [255, 69, 0]);
402
+ add("orchid", [218, 112, 214]);
403
+ add("palegoldenrod", [238, 232, 170]);
404
+ add("palegreen", [152, 251]);
405
+ add("paleturquoise", [175, 238, 238]);
406
+ add("palevioletred", [219, 112, 147]);
407
+ add("papayawhip", [255, 239, 213]);
408
+ add("peachpuff", [255, 218, 185]);
409
+ add("peru", [205, 133, 63]);
410
+ add("pink", [255, 192, 203]);
411
+ add("plum", [221, 160]);
412
+ add("powderblue", [176, 224, 230]);
413
+ add("purple", [128, 0]);
414
+ add("rebeccapurple", [102, 51, 153]);
415
+ add("red", [255, 0, 0]);
416
+ add("rosybrown", [188, 143, 143]);
417
+ add("royalblue", [65, 105, 225]);
418
+ add("saddlebrown", [139, 69, 19]);
419
+ add("salmon", [250, 128, 114]);
420
+ add("sandybrown", [244, 164, 96]);
421
+ add("seagreen", [46, 139, 87]);
422
+ add("seashell", [255, 245, 238]);
423
+ add("sienna", [160, 82, 45]);
424
+ add("silver", [192]);
425
+ add("skyblue", [135, 206, 235]);
426
+ add("slateblue", [106, 90, 205]);
427
+ add("slategray", [112, 128, 144]);
428
+ add("slategrey", [112, 128, 144]);
429
+ add("snow", [255, 250, 250]);
430
+ add("springgreen", [0, 255, 127]);
431
+ add("steelblue", [70, 130, 180]);
432
+ add("tan", [210, 180, 140]);
433
+ add("teal", [0, 128, 128]);
434
+ add("thistle", [216, 191]);
435
+ add("tomato", [255, 99, 71]);
436
+ add("turquoise", [64, 224, 208]);
437
+ add("violet", [238, 130]);
438
+ add("wheat", [245, 222, 179]);
439
+ add("white", [255]);
440
+ add("whitesmoke", [245]);
441
+ add("yellow", [255, 255, 0]);
442
+ add("yellowgreen", [154, 205, 50]);
443
+
255
444
  const svgWidthRegex = /width\s*=\s*["'](\w+)["']/;
256
445
  const svgHeightRegex = /height\s*=\s*["'](\w+)["']/;
257
446
  function configureSvgSize(svg, props, scale) {
@@ -12,6 +12,9 @@ const defaults = Object.freeze({
12
12
  rotate: 0
13
13
  });
14
14
 
15
+ const allKeys = Object.keys(defaults);
16
+ allKeys.filter((key) => key !== "width" && key !== "height");
17
+
15
18
  const iconDefaults = Object.freeze({
16
19
  left: 0,
17
20
  top: 0,
@@ -85,6 +88,14 @@ function getIconData(data, name, full = false) {
85
88
  return result && full ? fullIcon(result) : result;
86
89
  }
87
90
 
91
+ for (const prop in iconDefaults) {
92
+ typeof iconDefaults[prop];
93
+ }
94
+
95
+ Object.keys(iconDefaults).concat([
96
+ "provider"
97
+ ]);
98
+
88
99
  const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
89
100
  const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
90
101
  function calculateSize(size, ratio, precision) {
@@ -246,10 +257,188 @@ function iconToSVG(icon, customisations) {
246
257
  return result;
247
258
  }
248
259
 
260
+ "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
261
+
249
262
  function trimSVG(str) {
250
263
  return str.replace(/(["';{}><])\s*\n\s*/g, "$1").replace(/\s*\n\s*/g, " ").replace(/\s+"/g, '"').replace(/="\s+/g, '="').trim();
251
264
  }
252
265
 
266
+ function add(keyword, colors) {
267
+ const type = "rgb";
268
+ const r = colors[0];
269
+ const length = colors.length;
270
+ ({
271
+ type,
272
+ r,
273
+ g: length > 1 ? colors[1] : r,
274
+ b: length > 2 ? colors[2] : r,
275
+ alpha: length > 3 ? colors[3] : 1
276
+ });
277
+ }
278
+ add("silver", [192]);
279
+ add("gray", [128]);
280
+ add("white", [255]);
281
+ add("maroon", [128, 0, 0]);
282
+ add("red", [255, 0, 0]);
283
+ add("purple", [128, 0]);
284
+ add("fuchsia", [255, 0]);
285
+ add("green", [0, 128]);
286
+ add("lime", [0, 255]);
287
+ add("olive", [128, 128, 0]);
288
+ add("yellow", [255, 255, 0]);
289
+ add("navy", [0, 0, 128]);
290
+ add("blue", [0, 0, 255]);
291
+ add("teal", [0, 128, 128]);
292
+ add("aqua", [0, 255, 255]);
293
+ add("aliceblue", [240, 248, 255]);
294
+ add("antiquewhite", [250, 235, 215]);
295
+ add("aqua", [0, 255, 255]);
296
+ add("aquamarine", [127, 255, 212]);
297
+ add("azure", [240, 255, 255]);
298
+ add("beige", [245, 245, 220]);
299
+ add("bisque", [255, 228, 196]);
300
+ add("black", [0]);
301
+ add("blanchedalmond", [255, 235, 205]);
302
+ add("blue", [0, 0, 255]);
303
+ add("blueviolet", [138, 43, 226]);
304
+ add("brown", [165, 42, 42]);
305
+ add("burlywood", [222, 184, 135]);
306
+ add("cadetblue", [95, 158, 160]);
307
+ add("chartreuse", [127, 255, 0]);
308
+ add("chocolate", [210, 105, 30]);
309
+ add("coral", [255, 127, 80]);
310
+ add("cornflowerblue", [100, 149, 237]);
311
+ add("cornsilk", [255, 248, 220]);
312
+ add("crimson", [220, 20, 60]);
313
+ add("cyan", [0, 255, 255]);
314
+ add("darkblue", [0, 0, 139]);
315
+ add("darkcyan", [0, 139, 139]);
316
+ add("darkgoldenrod", [184, 134, 11]);
317
+ add("darkgray", [169]);
318
+ add("darkgreen", [0, 100]);
319
+ add("darkgrey", [169]);
320
+ add("darkkhaki", [189, 183, 107]);
321
+ add("darkmagenta", [139, 0]);
322
+ add("darkolivegreen", [85, 107, 47]);
323
+ add("darkorange", [255, 140, 0]);
324
+ add("darkorchid", [153, 50, 204]);
325
+ add("darkred", [139, 0, 0]);
326
+ add("darksalmon", [233, 150, 122]);
327
+ add("darkseagreen", [143, 188]);
328
+ add("darkslateblue", [72, 61, 139]);
329
+ add("darkslategray", [47, 79, 79]);
330
+ add("darkslategrey", [47, 79, 79]);
331
+ add("darkturquoise", [0, 206, 209]);
332
+ add("darkviolet", [148, 0, 211]);
333
+ add("deeppink", [255, 20, 147]);
334
+ add("deepskyblue", [0, 191, 255]);
335
+ add("dimgray", [105]);
336
+ add("dimgrey", [105]);
337
+ add("dodgerblue", [30, 144, 255]);
338
+ add("firebrick", [178, 34, 34]);
339
+ add("floralwhite", [255, 250, 240]);
340
+ add("forestgreen", [34, 139]);
341
+ add("fuchsia", [255, 0]);
342
+ add("gainsboro", [220]);
343
+ add("ghostwhite", [248, 248, 255]);
344
+ add("gold", [255, 215, 0]);
345
+ add("goldenrod", [218, 165, 32]);
346
+ add("gray", [128]);
347
+ add("green", [0, 128]);
348
+ add("greenyellow", [173, 255, 47]);
349
+ add("grey", [128]);
350
+ add("honeydew", [240, 255]);
351
+ add("hotpink", [255, 105, 180]);
352
+ add("indianred", [205, 92, 92]);
353
+ add("indigo", [75, 0, 130]);
354
+ add("ivory", [255, 255, 240]);
355
+ add("khaki", [240, 230, 140]);
356
+ add("lavender", [230, 230, 250]);
357
+ add("lavenderblush", [255, 240, 245]);
358
+ add("lawngreen", [124, 252, 0]);
359
+ add("lemonchiffon", [255, 250, 205]);
360
+ add("lightblue", [173, 216, 230]);
361
+ add("lightcoral", [240, 128, 128]);
362
+ add("lightcyan", [224, 255, 255]);
363
+ add("lightgoldenrodyellow", [250, 250, 210]);
364
+ add("lightgray", [211]);
365
+ add("lightgreen", [144, 238]);
366
+ add("lightgrey", [211]);
367
+ add("lightpink", [255, 182, 193]);
368
+ add("lightsalmon", [255, 160, 122]);
369
+ add("lightseagreen", [32, 178, 170]);
370
+ add("lightskyblue", [135, 206, 250]);
371
+ add("lightslategray", [119, 136, 153]);
372
+ add("lightslategrey", [119, 136, 153]);
373
+ add("lightsteelblue", [176, 196, 222]);
374
+ add("lightyellow", [255, 255, 224]);
375
+ add("lime", [0, 255]);
376
+ add("limegreen", [50, 205]);
377
+ add("linen", [250, 240, 230]);
378
+ add("magenta", [255, 0]);
379
+ add("maroon", [128, 0, 0]);
380
+ add("mediumaquamarine", [102, 205, 170]);
381
+ add("mediumblue", [0, 0, 205]);
382
+ add("mediumorchid", [186, 85, 211]);
383
+ add("mediumpurple", [147, 112, 219]);
384
+ add("mediumseagreen", [60, 179, 113]);
385
+ add("mediumslateblue", [123, 104, 238]);
386
+ add("mediumspringgreen", [0, 250, 154]);
387
+ add("mediumturquoise", [72, 209, 204]);
388
+ add("mediumvioletred", [199, 21, 133]);
389
+ add("midnightblue", [25, 25, 112]);
390
+ add("mintcream", [245, 255, 250]);
391
+ add("mistyrose", [255, 228, 225]);
392
+ add("moccasin", [255, 228, 181]);
393
+ add("navajowhite", [255, 222, 173]);
394
+ add("navy", [0, 0, 128]);
395
+ add("oldlace", [253, 245, 230]);
396
+ add("olive", [128, 128, 0]);
397
+ add("olivedrab", [107, 142, 35]);
398
+ add("orange", [255, 165, 0]);
399
+ add("orangered", [255, 69, 0]);
400
+ add("orchid", [218, 112, 214]);
401
+ add("palegoldenrod", [238, 232, 170]);
402
+ add("palegreen", [152, 251]);
403
+ add("paleturquoise", [175, 238, 238]);
404
+ add("palevioletred", [219, 112, 147]);
405
+ add("papayawhip", [255, 239, 213]);
406
+ add("peachpuff", [255, 218, 185]);
407
+ add("peru", [205, 133, 63]);
408
+ add("pink", [255, 192, 203]);
409
+ add("plum", [221, 160]);
410
+ add("powderblue", [176, 224, 230]);
411
+ add("purple", [128, 0]);
412
+ add("rebeccapurple", [102, 51, 153]);
413
+ add("red", [255, 0, 0]);
414
+ add("rosybrown", [188, 143, 143]);
415
+ add("royalblue", [65, 105, 225]);
416
+ add("saddlebrown", [139, 69, 19]);
417
+ add("salmon", [250, 128, 114]);
418
+ add("sandybrown", [244, 164, 96]);
419
+ add("seagreen", [46, 139, 87]);
420
+ add("seashell", [255, 245, 238]);
421
+ add("sienna", [160, 82, 45]);
422
+ add("silver", [192]);
423
+ add("skyblue", [135, 206, 235]);
424
+ add("slateblue", [106, 90, 205]);
425
+ add("slategray", [112, 128, 144]);
426
+ add("slategrey", [112, 128, 144]);
427
+ add("snow", [255, 250, 250]);
428
+ add("springgreen", [0, 255, 127]);
429
+ add("steelblue", [70, 130, 180]);
430
+ add("tan", [210, 180, 140]);
431
+ add("teal", [0, 128, 128]);
432
+ add("thistle", [216, 191]);
433
+ add("tomato", [255, 99, 71]);
434
+ add("turquoise", [64, 224, 208]);
435
+ add("violet", [238, 130]);
436
+ add("wheat", [245, 222, 179]);
437
+ add("white", [255]);
438
+ add("whitesmoke", [245]);
439
+ add("yellow", [255, 255, 0]);
440
+ add("yellowgreen", [154, 205, 50]);
441
+
253
442
  const svgWidthRegex = /width\s*=\s*["'](\w+)["']/;
254
443
  const svgHeightRegex = /height\s*=\s*["'](\w+)["']/;
255
444
  function configureSvgSize(svg, props, scale) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-icons",
3
- "version": "0.44.7",
3
+ "version": "0.45.1",
4
4
  "description": "Pure CSS Icons for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -48,7 +48,7 @@
48
48
  ],
49
49
  "dependencies": {
50
50
  "@iconify/utils": "^1.0.33",
51
- "@unocss/core": "0.44.7",
51
+ "@unocss/core": "0.45.1",
52
52
  "ohmyfetch": "^0.4.18"
53
53
  },
54
54
  "devDependencies": {