@jannchie/icons 0.4.0 → 0.5.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.
Files changed (91) hide show
  1. package/dist/all.js +54 -0
  2. package/dist/icons/arrows-up-down-half.js +8 -0
  3. package/dist/icons/continent.js +8 -0
  4. package/dist/icons/diorama.js +8 -0
  5. package/dist/icons/droplet-off.js +8 -0
  6. package/dist/icons/github.js +8 -0
  7. package/dist/icons/hologram.js +8 -0
  8. package/dist/icons/map-pin-ban.js +8 -0
  9. package/dist/icons/map-pin-bookmark.js +8 -0
  10. package/dist/icons/map-pin-check.js +8 -0
  11. package/dist/icons/map-pin-clock.js +8 -0
  12. package/dist/icons/map-pin-cloud.js +8 -0
  13. package/dist/icons/map-pin-heart.js +8 -0
  14. package/dist/icons/map-pin-image.js +8 -0
  15. package/dist/icons/map-pin-lock.js +8 -0
  16. package/dist/icons/map-pin-minus.js +8 -0
  17. package/dist/icons/map-pin-music.js +8 -0
  18. package/dist/icons/map-pin-plus.js +8 -0
  19. package/dist/icons/map-pin-search.js +8 -0
  20. package/dist/icons/map-pin-sparkle.js +8 -0
  21. package/dist/icons/map-pin-star.js +8 -0
  22. package/dist/icons/map-pin-video.js +8 -0
  23. package/dist/icons/map-pin-x.js +8 -0
  24. package/dist/icons/region.js +8 -0
  25. package/dist/icons/terrain-lower.js +8 -0
  26. package/dist/icons/terrain-raise.js +8 -0
  27. package/dist/icons/terrain-smooth.js +8 -0
  28. package/dist/icons/turntable.js +8 -0
  29. package/dist/index.d.ts +54 -0
  30. package/dist/index.js +28 -1
  31. package/dist/src/icons/arrows-up-down-half.js +13 -0
  32. package/dist/src/icons/continent.js +5 -0
  33. package/dist/src/icons/diorama.js +25 -0
  34. package/dist/src/icons/droplet-off.js +6 -0
  35. package/dist/src/icons/github.js +4 -0
  36. package/dist/src/icons/hologram.js +32 -0
  37. package/dist/src/icons/list-arrow-down.js +2 -2
  38. package/dist/src/icons/list-arrow-left.js +2 -2
  39. package/dist/src/icons/list-arrow-right.js +2 -2
  40. package/dist/src/icons/list-arrow-up.js +2 -2
  41. package/dist/src/icons/list-assets.js +2 -2
  42. package/dist/src/icons/list-ban.js +2 -2
  43. package/dist/src/icons/list-bookmark.js +2 -2
  44. package/dist/src/icons/list-check.js +2 -2
  45. package/dist/src/icons/list-circle.js +2 -2
  46. package/dist/src/icons/list-clock.js +2 -2
  47. package/dist/src/icons/list-cloud.js +2 -2
  48. package/dist/src/icons/list-code.js +2 -2
  49. package/dist/src/icons/list-gauge.js +2 -2
  50. package/dist/src/icons/list-heart.js +2 -2
  51. package/dist/src/icons/list-image.js +2 -2
  52. package/dist/src/icons/list-lock.js +2 -2
  53. package/dist/src/icons/list-minus.js +2 -2
  54. package/dist/src/icons/list-music-plus.js +2 -2
  55. package/dist/src/icons/list-music.js +2 -2
  56. package/dist/src/icons/list-plug.js +2 -2
  57. package/dist/src/icons/list-plus.js +2 -2
  58. package/dist/src/icons/list-puzzle.js +2 -2
  59. package/dist/src/icons/list-search.js +2 -2
  60. package/dist/src/icons/list-shield.js +2 -2
  61. package/dist/src/icons/list-sparkle.js +2 -2
  62. package/dist/src/icons/list-star.js +2 -2
  63. package/dist/src/icons/list-video.js +2 -2
  64. package/dist/src/icons/list-x.js +2 -2
  65. package/dist/src/icons/map-pin-ban.js +7 -0
  66. package/dist/src/icons/map-pin-bookmark.js +7 -0
  67. package/dist/src/icons/map-pin-check.js +7 -0
  68. package/dist/src/icons/map-pin-clock.js +7 -0
  69. package/dist/src/icons/map-pin-cloud.js +7 -0
  70. package/dist/src/icons/map-pin-heart.js +7 -0
  71. package/dist/src/icons/map-pin-image.js +7 -0
  72. package/dist/src/icons/map-pin-lock.js +7 -0
  73. package/dist/src/icons/map-pin-minus.js +7 -0
  74. package/dist/src/icons/map-pin-music.js +7 -0
  75. package/dist/src/icons/map-pin-plus.js +7 -0
  76. package/dist/src/icons/map-pin-search.js +7 -0
  77. package/dist/src/icons/map-pin-sparkle.js +7 -0
  78. package/dist/src/icons/map-pin-star.js +7 -0
  79. package/dist/src/icons/map-pin-video.js +7 -0
  80. package/dist/src/icons/map-pin-x.js +7 -0
  81. package/dist/src/icons/piggy-bank.js +15 -14
  82. package/dist/src/icons/region.js +13 -0
  83. package/dist/src/icons/rugby.js +6 -6
  84. package/dist/src/icons/swift.js +1 -1
  85. package/dist/src/icons/terrain-lower.js +10 -0
  86. package/dist/src/icons/terrain-raise.js +10 -0
  87. package/dist/src/icons/terrain-smooth.js +19 -0
  88. package/dist/src/icons/turntable.js +21 -0
  89. package/dist/src/list.js +7 -2
  90. package/dist/src/pin.js +35 -0
  91. package/package.json +1 -1
@@ -2,21 +2,21 @@ import { rotate } from "../transform.js";
2
2
  //#region src/icons/rugby.js
3
3
  var t = (d) => rotate(d, -45);
4
4
  var rugby_default = () => [
5
- t("M12 2.5C17 6 17 18 12 21.5C7 18 7 6 12 2.5Z"),
5
+ t("M12 2.5C18.5 6 18.5 18 12 21.5C5.5 18 5.5 6 12 2.5Z"),
6
6
  {
7
- d: t("M10.5 9.25H13.5"),
7
+ d: t("M10 9.25H14"),
8
8
  thin: true
9
9
  },
10
10
  {
11
- d: t("M10.5 12H13.5"),
11
+ d: t("M10 12H14"),
12
12
  thin: true
13
13
  },
14
14
  {
15
- d: t("M10.5 14.75H13.5"),
15
+ d: t("M10 14.75H14"),
16
16
  thin: true
17
17
  },
18
- t("M9.4 6.25C11 6.75 13 6.75 14.6 6.25"),
19
- t("M9.4 17.75C11 17.25 13 17.25 14.6 17.75")
18
+ t("M8.4 6.5C10.5 7.25 13.5 7.25 15.6 6.5"),
19
+ t("M8.4 17.5C10.5 16.75 13.5 16.75 15.6 17.5")
20
20
  ];
21
21
  //#endregion
22
22
  export { rugby_default as default };
@@ -1,4 +1,4 @@
1
1
  //#region src/icons/swift.js
2
- var swift_default = () => ["M20 19C21.5 14.5 20 8 14.5 3.5C17 8.5 16.5 12 14.5 14C11.5 12.5 7 9 3.5 5C5.5 8.5 7.5 11 9.5 13C7 12 5 11 3 10C6 15.5 11 19 16.5 18.5C18 18.5 19.5 19 20.5 20.5"];
2
+ var swift_default = () => ["M3 12C6.5 16.5 11 18 15 16.5C17 17.5 19 19 20.5 20.5C21.5 14 19.5 7.5 15.5 3C17 7 16.5 11 14 13.5C11 11.5 7.5 8.5 4 5.5C6.5 9.5 9 12.5 11 14.5C8.25 14.25 5.5 13.5 3 12Z"];
3
3
  //#endregion
4
4
  export { swift_default as default };
@@ -0,0 +1,10 @@
1
+ import { crisp, rounded } from "../geometry.js";
2
+ import { arrow } from "../media.js";
3
+ //#region src/icons/terrain-lower.js
4
+ var terrain_lower_default = ({ radius }) => [
5
+ "M2.5 10.5H5.5C8.5 10.5 9.5 20.5 12.5 20.5C15.5 20.5 16.5 10.5 19.5 10.5H21.5",
6
+ "M12.5 3.5V14",
7
+ rounded(arrow(12.5, 14, "down", 2.5), crisp(radius), false)
8
+ ];
9
+ //#endregion
10
+ export { terrain_lower_default as default };
@@ -0,0 +1,10 @@
1
+ import { crisp, rounded } from "../geometry.js";
2
+ import { arrow } from "../media.js";
3
+ //#region src/icons/terrain-raise.js
4
+ var terrain_raise_default = ({ radius }) => [
5
+ "M2.5 20.5H5.5C8.5 20.5 9.5 13.5 12.5 13.5C15.5 13.5 16.5 20.5 19.5 20.5H21.5",
6
+ "M12.5 10.5V3.5",
7
+ rounded(arrow(12.5, 3.5, "up", 3), crisp(radius), false)
8
+ ];
9
+ //#endregion
10
+ export { terrain_raise_default as default };
@@ -0,0 +1,19 @@
1
+ import { crisp, rounded } from "../geometry.js";
2
+ //#region src/icons/terrain-smooth.js
3
+ var h = 19 / 4;
4
+ var wave = "M2.5 7";
5
+ for (let i = 0; i < 4; i++) {
6
+ const [x0, k] = [2.5 + i * h, i % 2 ? 1 : -1];
7
+ wave += `C${x0 + h * .36} ${7 + k * 3} ${x0 + h * .64} ${7 + k * 3} ${x0 + h} 7`;
8
+ }
9
+ var terrain_smooth_default = ({ radius }) => [
10
+ wave,
11
+ rounded([
12
+ [9, 12.5],
13
+ [12, 15.5],
14
+ [15, 12.5]
15
+ ], crisp(radius), false),
16
+ "M2.5 20.5H21.5"
17
+ ];
18
+ //#endregion
19
+ export { terrain_smooth_default as default };
@@ -0,0 +1,21 @@
1
+ import { dot } from "../scene.js";
2
+ import { circle, crisp, rounded } from "../geometry.js";
3
+ //#region src/icons/turntable.js
4
+ var turntable_default = ({ radius }) => [
5
+ rounded([
6
+ [3.5, 3.5],
7
+ [20.5, 3.5],
8
+ [20.5, 20.5],
9
+ [3.5, 20.5]
10
+ ], Math.min(radius, 2.5)),
11
+ circle(10.5, 12, 5),
12
+ dot(10.5, 12),
13
+ dot(17.5, 6.5, 3),
14
+ rounded([
15
+ [17.5, 6.5],
16
+ [17.5, 13],
17
+ [13, 14.5]
18
+ ], crisp(radius), false)
19
+ ];
20
+ //#endregion
21
+ export { turntable_default as default };
package/dist/src/list.js CHANGED
@@ -15,11 +15,16 @@ var badgeRows = [
15
15
  14.5
16
16
  ];
17
17
  var from = 3.5;
18
- var center = [17.5, 17.5];
18
+ var BADGE_SCALE = 1.4;
19
19
  function listBadge(outline, k, stroke) {
20
- const shape = place(outline, center, k);
20
+ const size = k * BADGE_SCALE;
21
+ const extent = (outline.circle ?? Math.max(outline.box[2], outline.box[3])) * size;
22
+ const c = Math.min(16.5, Math.floor((21 - extent) * 2) / 2);
23
+ const center = [c, c];
24
+ const shape = place(outline, center, size);
21
25
  return {
22
26
  center,
27
+ size,
23
28
  lines: badgeRows.map((y) => {
24
29
  const b = blocked(shape, "x", y, stroke);
25
30
  return `M${from} ${y}H${b && b[0] < end ? Math.max(b[0], from) : end}`;
@@ -0,0 +1,35 @@
1
+ import { place } from "./clearance.js";
2
+ import { circle } from "./geometry.js";
3
+ import { badge } from "./folder.js";
4
+ import { cornerScale, outlines } from "./symbols.js";
5
+ //#region src/pin.js
6
+ var plain = () => ["M10.5 21.5C10.5 21.5 4 15.5 4 9.5A6.5 6.5 0 0 1 17 9.5C17 15.5 10.5 21.5 10.5 21.5Z", circle(10.5, 9.5, 2.25)];
7
+ function withBadge(name, draw, tone, radius) {
8
+ const k = cornerScale[name];
9
+ const shape = place(outlines[name], badge, k);
10
+ const [x0, y0, x1, y1] = shape.circle ? [
11
+ shape.c[0] - shape.circle,
12
+ shape.c[1] - shape.circle,
13
+ shape.c[0] + shape.circle,
14
+ shape.c[1] + shape.circle
15
+ ] : shape.box;
16
+ const hole = {
17
+ d: `M${x0} ${y0}H${x1}V${y1}H${x0}Z`,
18
+ cut: true,
19
+ hidden: true,
20
+ occlude: true
21
+ };
22
+ return [
23
+ ...plain(),
24
+ hole,
25
+ ...tone(draw(badge, k, radius)).map((p) => typeof p === "string" ? {
26
+ d: p,
27
+ cut: true
28
+ } : {
29
+ ...p,
30
+ cut: true
31
+ })
32
+ ];
33
+ }
34
+ //#endregion
35
+ export { plain, withBadge };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jannchie/icons",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Line icons on a 24-unit grid, redrawn for every corner radius and stroke weight, with pixel hinting and duo-tone colors",
5
5
  "license": "MIT",
6
6
  "author": "Jianqi Pan",