Compare commits

...

20 Commits

Author SHA1 Message Date
Daniel Bayley
47aa3c2664 Optimiseat-sign icon (#1213)
* Optimise `at-sign` icon

* Refine `at-sign` icon

* Restore `at-sign` ascender
2023-05-05 14:14:23 +02:00
Karsa
e50b03f316 Adds leafy-green icon (#1168)
Co-authored-by: Karsa <karsa@karsa.org>
2023-05-05 13:27:35 +02:00
Karsa
0065b5952b Adds alternate user icons (#1116)
Co-authored-by: Karsa <karsa@karsa.org>
2023-05-05 09:32:23 +02:00
Daniel Bayley
b35b586eda Add [un]group icons (#1108)
* Add `group` icon

* Add `ungroup` icon
2023-05-05 09:31:56 +02:00
Jakob Guddas
8b57fab71b Increased size of orbit (#1195) 2023-05-05 09:31:03 +02:00
Daniel Bayley
badd34374d Add list-filter icon (#1185) 2023-05-05 08:51:35 +02:00
Daniel Bayley
902431199c Fix unplug metadata (#1212)
This broke the `pre-commit` hook again, because it was `merge`d after the `coding` category was removed.
2023-05-03 22:33:22 +02:00
Daniel Bayley
bdbb4834b0 Replace shuffle icon (#1162)
* Add `shuffle` alternate icon

* Improve `shuffle` metadata

* Replace `shuffle` icon

* Update icons/shuffle.svg

Co-authored-by: Karsa <contact@karsa.org>

* Refine `shuffle` icon

---------

Co-authored-by: Karsa <contact@karsa.org>
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
2023-05-03 17:24:45 +02:00
Daniel Bayley
07fc4da6fa Optimise/add scroll[-text] (script) icon (#1211)
* Optimise `scroll` icon

* Add `scroll-text` (script) icon
2023-05-03 17:21:14 +02:00
Daniel Bayley
e1815242cf Fix folder-git icons (#1128)
* Fix `folder-git*` icons

* Refine `folder-git` icon

* Update icons/folder-git-2.svg

Co-authored-by: Karsa <contact@karsa.org>

* Update icons/folder-git.svg

Co-authored-by: Karsa <contact@karsa.org>

---------

Co-authored-by: Karsa <contact@karsa.org>
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
2023-05-03 16:41:28 +02:00
Daniel Bayley
d104ad5c8a Add file-code-2 icon (#1058)
* Add `file-code-2` icon

* Update icons/file-code-2.svg

Co-authored-by: Eric Fennis <eric.fennis@gmail.com>

* Swap `file-code`/`-2` icons

* Update icons/file-code-2.json

Co-authored-by: Karsa <contact@karsa.org>

* Improve `file-code` metadata

---------

Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
Co-authored-by: Karsa <contact@karsa.org>
2023-05-03 16:40:51 +02:00
Daniel Bayley
69989c5ae5 Optimize replace icons (#1107)
* Optimize `replace` icons

* Update replace.svg

* Update replace-all.svg

---------

Co-authored-by: Karsa <contact@karsa.org>
2023-05-03 16:16:17 +02:00
Daniel Bayley
9e996ef63c Add/refine [un]plug icons (#1035)
* Refine `plug-zap` icon

* Fix `plug` icon

* Add `unplug` icon

* Refine `plug-zap` alternate icon

* Update plug-zap-2.svg

* Update unplug.svg

* Update icons/plug.svg

---------

Co-authored-by: Karsa <contact@karsa.org>
2023-05-03 16:11:04 +02:00
Daniel Bayley
6ec9cc3dcf Add arrow-*-[to/from]-line icons (#1158)
* Add `arrow-right-to-line` (tab) icon

<kbd>tab</kbd>

* Add `arrow-left-to-line` icon

* Add `arrow-up-to-line` icon

* Add `arrow-down-to-line` (download) icon

* Add `arrow-up-from-line` icon

* Add `arrow-down-from-line` icon

* Add `arrow-left-from-line` icon

* Add `arrow-right-from-line` icon

* Extend `arrow-*-line`s

* Add `expand`/`collapse` metadata

Closes #980.

---------

Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
2023-05-03 15:50:55 +02:00
Daniel Bayley
01fa96ced3 Add menu-square icon (#1181)
* Add `menu` alternate icon

* Rename `menu-2` to `menu-square`
2023-05-03 15:43:36 +02:00
Jakob Guddas
481b27cc49 feat: added radii helper to svg preview (#1183) 2023-05-03 15:42:46 +02:00
Daniel Bayley
c5df7e73c6 Add list-restart icon (#1053)
* Add `list-restart` icon

* Update icons/list-restart.svg

Co-authored-by: Karsa <contact@karsa.org>

---------

Co-authored-by: Karsa <contact@karsa.org>
2023-05-03 15:40:49 +02:00
Daniel Bayley
428088436d Refine database-backup icon (#1051)
* Refine `database-backup` icon

* Refine `database-backup` icon

* Update icons/database-backup.svg

Co-authored-by: Karsa <contact@karsa.org>

---------

Co-authored-by: Karsa <contact@karsa.org>
2023-05-03 15:40:00 +02:00
Daniel Bayley
eec2c97595 Add *-dot icons (#1042)
* Add `undo-dot` icon

* Add `redo-dot` icon

* Add `arrow-up-from-dot` icon

* Add `arrow-down-to-dot` icon

* Add `dot` icon
Update icons/dot.json

Co-authored-by: Karsa <contact@karsa.org>

---------

Co-authored-by: Karsa <contact@karsa.org>
2023-05-03 15:23:17 +02:00
Daniel Bayley
f0529b9ef7 Add combine icon (#1069)
Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
2023-05-03 15:19:54 +02:00
93 changed files with 1282 additions and 74 deletions

View File

@@ -0,0 +1,14 @@
{
"$schema": "../icon.schema.json",
"tags": [
"direction",
"download",
"expand",
"fold",
"vertical"
],
"categories": [
"arrows",
"files"
]
}

View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="12" x2="12" y1="21" y2="7" />
<polyline points="6 15 12 21 18 15" />
<path d="M19 3H5" />
</svg>

After

Width:  |  Height:  |  Size: 314 B

View File

@@ -0,0 +1,11 @@
{
"$schema": "../icon.schema.json",
"tags": [
"direction",
"step",
"into"
],
"categories": [
"arrows"
]
}

View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="12" x2="12" y1="2" y2="16" />
<polyline points="19,9 12,16 5,9" />
<circle cx="12" cy="21" r="1" />
</svg>

After

Width:  |  Height:  |  Size: 324 B

View File

@@ -0,0 +1,18 @@
{
"$schema": "../icon.schema.json",
"tags": [
"direction",
"download",
"git",
"version control",
"pull",
"collapse",
"fold",
"vertical"
],
"categories": [
"arrows",
"files",
"development"
]
}

View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="12" x2="12" y1="17" y2="3" />
<polyline points="6 11 12 17 18 11" />
<path d="M19 21H5" />
</svg>

After

Width:  |  Height:  |  Size: 315 B

View File

@@ -0,0 +1,12 @@
{
"$schema": "../icon.schema.json",
"tags": [
"direction",
"expand",
"fold",
"horizontal"
],
"categories": [
"arrows"
]
}

View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="3" x2="17" y1="12" y2="12" />
<polyline points="9 6 3 12 9 18" />
<path d="M21 19V5" />
</svg>

After

Width:  |  Height:  |  Size: 312 B

View File

@@ -0,0 +1,12 @@
{
"$schema": "../icon.schema.json",
"tags": [
"direction",
"collapse",
"fold",
"horizontal"
],
"categories": [
"arrows"
]
}

View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="7" x2="21" y1="12" y2="12" />
<polyline points="13 6 7 12 13 18" />
<path d="M3 19V5" />
</svg>

After

Width:  |  Height:  |  Size: 313 B

View File

@@ -0,0 +1,13 @@
{
"$schema": "../icon.schema.json",
"tags": [
"direction",
"export",
"expand",
"fold",
"horizontal"
],
"categories": [
"arrows"
]
}

View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="21" x2="7" y1="12" y2="12" />
<polyline points="15 18 21 12 15 6" />
<path d="M3 5v14" />
</svg>

After

Width:  |  Height:  |  Size: 314 B

View File

@@ -0,0 +1,19 @@
{
"$schema": "../icon.schema.json",
"tags": [
"keyboard",
"key",
"tab",
"mac",
"button",
"indent",
"direction",
"collapse",
"fold",
"horizontal"
],
"categories": [
"arrows",
"development"
]
}

View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="17" x2="3" y1="12" y2="12" />
<polyline points="11 18 17 12 11 6" />
<path d="M21 5v14" />
</svg>

After

Width:  |  Height:  |  Size: 315 B

View File

@@ -0,0 +1,11 @@
{
"$schema": "../icon.schema.json",
"tags": [
"direction",
"step",
"out"
],
"categories": [
"arrows"
]
}

View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="12" x2="12" y1="16" y2="2" />
<polyline points="5,9 12,2 19,9" />
<circle cx="12" cy="21" r="1" />
</svg>

After

Width:  |  Height:  |  Size: 323 B

View File

@@ -0,0 +1,18 @@
{
"$schema": "../icon.schema.json",
"tags": [
"direction",
"upload",
"git",
"version control",
"push",
"expand",
"fold",
"vertical"
],
"categories": [
"arrows",
"files",
"development"
]
}

View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="12" x2="12" y1="3" y2="17" />
<polyline points="18 9 12 3 6 9" />
<path d="M5 21h14" />
</svg>

After

Width:  |  Height:  |  Size: 312 B

View File

@@ -0,0 +1,14 @@
{
"$schema": "../icon.schema.json",
"tags": [
"direction",
"upload",
"collapse",
"fold",
"vertical"
],
"categories": [
"arrows",
"files"
]
}

View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<line x1="12" x2="12" y1="7" y2="21" />
<polyline points="18 13 12 7 6 13" />
<path d="M5 3h14" />
</svg>

After

Width:  |  Height:  |  Size: 313 B

View File

@@ -10,5 +10,5 @@
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="4" />
<path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94" />
<path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8" />
</svg>

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 299 B

19
icons/combine.json Normal file
View File

@@ -0,0 +1,19 @@
{
"$schema": "../icon.schema.json",
"tags": [
"cubes",
"packages",
"parts",
"units",
"collection",
"cluster",
"combine",
"gather",
"merge"
],
"categories": [
"shapes",
"development",
"files"
]
}

18
icons/combine.svg Normal file
View File

@@ -0,0 +1,18 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="8" height="8" x="2" y="2" rx="2" />
<path d="M14 2c1.1 0 2 .9 2 2v4c0 1.1-.9 2-2 2" />
<path d="M20 2c1.1 0 2 .9 2 2v4c0 1.1-.9 2-2 2" />
<path d="M10 18H5c-1.7 0-3-1.3-3-3v-1" />
<polyline points="7 21 10 18 7 15" />
<rect width="8" height="8" x="14" y="14" rx="2" />
</svg>

After

Width:  |  Height:  |  Size: 502 B

10
icons/contact-2.json Normal file
View File

@@ -0,0 +1,10 @@
{
"$schema": "../icon.schema.json",
"tags": [
"person",
"user"
],
"categories": [
"account"
]
}

17
icons/contact-2.svg Normal file
View File

@@ -0,0 +1,17 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M16 18a4 4 0 0 0-8 0" />
<circle cx="12" cy="11" r="3" />
<rect width="18" height="18" x="3" y="4" rx="2" />
<line x1="8" x2="8" y1="2" y2="4" />
<line x1="16" x2="16" y1="2" y2="4" />
</svg>

After

Width:  |  Height:  |  Size: 412 B

View File

@@ -10,9 +10,9 @@
stroke-linejoin="round"
>
<ellipse cx="12" cy="5" rx="9" ry="3" />
<path d="M3 12c0 1.18 2.03 2.2 5 2.7" />
<path d="M21 5v4.5" />
<path d="m12 16 1.27-1.35a4.75 4.75 0 1 1 .41 5.74" />
<path d="M3 5v14c0 1.4 3 2.7 7 3" />
<path d="M3 12c0 1.2 2 2.5 5 3" />
<path d="M21 5v4" />
<path d="M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16" />
<path d="M12 12v4h4" />
<path d="M3 5v14c0 1.43 2.97 2.63 7 2.93" />
</svg>

Before

Width:  |  Height:  |  Size: 449 B

After

Width:  |  Height:  |  Size: 466 B

20
icons/dot.json Normal file
View File

@@ -0,0 +1,20 @@
{
"$schema": "../icon.schema.json",
"tags": [
"interpunct",
"interpoint",
"middot",
"step",
"punctuation",
"characters",
"font",
"typography",
"type",
"text",
"center"
],
"categories": [
"shapes",
"text"
]
}

13
icons/dot.svg Normal file
View File

@@ -0,0 +1,13 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12.1" cy="12.1" r="1" />
</svg>

After

Width:  |  Height:  |  Size: 247 B

15
icons/file-code-2.json Normal file
View File

@@ -0,0 +1,15 @@
{
"$schema": "../icon.schema.json",
"tags": [
"script",
"document",
"html",
"xml",
"property list",
"plist"
],
"categories": [
"files",
"development"
]
}

16
icons/file-code-2.svg Normal file
View File

@@ -0,0 +1,16 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v4" />
<polyline points="14 2 14 8 20 8" />
<path d="m9 18 3-3-3-3" />
<path d="m5 12-3 3 3 3" />
</svg>

After

Width:  |  Height:  |  Size: 372 B

View File

@@ -2,10 +2,15 @@
"$schema": "../icon.schema.json",
"tags": [
"script",
"document"
"document",
"gist",
"html",
"xml",
"property list",
"plist"
],
"categories": [
"files",
"development"
]
}
}

View File

@@ -9,8 +9,8 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v4" />
<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" />
<polyline points="14 2 14 8 20 8" />
<path d="m9 18 3-3-3-3" />
<path d="m5 12-3 3 3 3" />
<path d="m10 13-2 2 2 2" />
<path d="m14 17 2-2-2-2" />
</svg>

Before

Width:  |  Height:  |  Size: 372 B

After

Width:  |  Height:  |  Size: 392 B

View File

@@ -9,8 +9,8 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M22 13V8a1.974 1.974 0 0 0-2-2h-7.9c-.3 0-.7-.1-.9-.2-.3-.2-.5-.4-.7-.7l-.9-1.2c-.2-.3-.4-.5-.7-.7-.3-.1-.6-.2-1-.2H4a1.974 1.974 0 0 0-2 2v13c0 1.1.9 2 2 2h5"/>
<circle cx="20" cy="19" r="2"/>
<circle cx="13" cy="12." r="2"/>
<path d="M18 19c-2.8 0-5-2.2-5-5v8"/>
<path d="M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5" />
<circle cx="13" cy="12" r="2" />
<path d="M18 19c-2.8 0-5-2.2-5-5v8" />
<circle cx="20" cy="19" r="2" />
</svg>

Before

Width:  |  Height:  |  Size: 490 B

After

Width:  |  Height:  |  Size: 437 B

View File

@@ -10,7 +10,7 @@
stroke-linejoin="round"
>
<path d="M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z" />
<circle class="st0" cx="12" cy="13" r="2" />
<line class="st0" x1="6" y1="13" x2="10" y2="13" />
<line class="st0" x1="14" y1="13" x2="18" y2="13" />
<circle cx="12" cy="13" r="2" />
<path d="M14 13h3" />
<path d="M7 13h3" />
</svg>

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 428 B

16
icons/group.json Normal file
View File

@@ -0,0 +1,16 @@
{
"$schema": "../icon.schema.json",
"tags": [
"cubes",
"packages",
"parts",
"units",
"collection",
"cluster",
"gather"
],
"categories": [
"shapes",
"files"
]
}

18
icons/group.svg Normal file
View File

@@ -0,0 +1,18 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M3 7V5c0-1.1.9-2 2-2h2" />
<path d="M17 3h2c1.1 0 2 .9 2 2v2" />
<path d="M21 17v2c0 1.1-.9 2-2 2h-2" />
<path d="M7 21H5c-1.1 0-2-.9-2-2v-2" />
<rect width="7" height="5" x="7" y="7" rx="1" />
<rect width="7" height="5" x="10" y="12" rx="1" />
</svg>

After

Width:  |  Height:  |  Size: 474 B

15
icons/leafy-green.json Normal file
View File

@@ -0,0 +1,15 @@
{
"$schema": "../icon.schema.json",
"tags": [
"salad",
"lettuce",
"vegetable",
"chard",
"cabbage",
"bok choy"
],
"categories": [
"food-beverage",
"emoji"
]
}

14
icons/leafy-green.svg Normal file
View File

@@ -0,0 +1,14 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M2 22c1.25-.987 2.27-1.975 3.9-2.2a5.56 5.56 0 0 1 3.8 1.5 4 4 0 0 0 6.187-2.353 3.5 3.5 0 0 0 3.69-5.116A3.5 3.5 0 0 0 20.95 8 3.5 3.5 0 1 0 16 3.05a3.5 3.5 0 0 0-5.831 1.373 3.5 3.5 0 0 0-5.116 3.69 4 4 0 0 0-2.348 6.155C3.499 15.42 4.409 16.712 4.2 18.1 3.926 19.743 3.014 20.732 2 22" />
<path d="M2 22 17 7" />
</svg>

After

Width:  |  Height:  |  Size: 537 B

9
icons/list-filter.json Normal file
View File

@@ -0,0 +1,9 @@
{
"$schema": "../icon.schema.json",
"tags": [
"options"
],
"categories": [
"text"
]
}

15
icons/list-filter.svg Normal file
View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M3 6h18" />
<path d="M7 12h10" />
<path d="M10 18h4" />
</svg>

After

Width:  |  Height:  |  Size: 279 B

14
icons/list-restart.json Normal file
View File

@@ -0,0 +1,14 @@
{
"$schema": "../icon.schema.json",
"tags": [
"reset",
"refresh",
"reload",
"playlist",
"replay"
],
"categories": [
"multimedia",
"text"
]
}

17
icons/list-restart.svg Normal file
View File

@@ -0,0 +1,17 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M21 6H3" />
<path d="M7 12H3" />
<path d="M7 18H3" />
<path d="M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14" />
<path d="M11 10v4h4" />
</svg>

After

Width:  |  Height:  |  Size: 393 B

15
icons/menu-square.json Normal file
View File

@@ -0,0 +1,15 @@
{
"$schema": "../icon.schema.json",
"tags": [
"bars",
"navigation",
"hamburger",
"options",
"menu bar",
"panel"
],
"categories": [
"layout",
"account"
]
}

16
icons/menu-square.svg Normal file
View File

@@ -0,0 +1,16 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="18" height="18" x="3" y="3" rx="2" />
<path d="M7 8h10" />
<path d="M7 12h10" />
<path d="M7 16h10" />
</svg>

After

Width:  |  Height:  |  Size: 332 B

View File

@@ -10,8 +10,8 @@
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="3" />
<circle cx="18" cy="6" r="2" />
<circle cx="6" cy="18" r="2" />
<path d="M12 20a8 8 0 0 0 6.82-12.17" />
<path d="M12 4a8 8 0 0 0-6.82 12.17" />
<circle cx="19" cy="5" r="2" />
<circle cx="5" cy="19" r="2" />
<path d="M10.4 21.9a10 10 0 0 0 9.941-15.416" />
<path d="M13.5 2.1a10 10 0 0 0-9.841 15.416" />
</svg>

Before

Width:  |  Height:  |  Size: 396 B

After

Width:  |  Height:  |  Size: 412 B

14
icons/plug-zap-2.json Normal file
View File

@@ -0,0 +1,14 @@
{
"$schema": "../icon.schema.json",
"tags": [
"electricity",
"electronics",
"charge",
"charging",
"battery",
"connect"
],
"categories": [
"devices"
]
}

17
icons/plug-zap-2.svg Normal file
View File

@@ -0,0 +1,17 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="m13 2-2 2.5h3L12 7" />
<path d="M10 14v-3" />
<path d="M14 14v-3" />
<path d="M11 19c-1.7 0-3-1.3-3-3v-2h8v2c0 1.7-1.3 3-3 3Z" />
<path d="M12 22v-3" />
</svg>

After

Width:  |  Height:  |  Size: 380 B

View File

@@ -1,6 +1,8 @@
{
"$schema": "../icon.schema.json",
"tags": [
"electricity",
"electronics",
"charge",
"charging",
"battery",

View File

@@ -9,9 +9,9 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<rect x="8" y="13" width="8" height="6" rx="2" />
<path d="m13 2-2 2.5h3L12 7" />
<path d="M12 22v-3" />
<path d="M10 13v-2.5" />
<path d="M14 13v-2.5" />
<path d="M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z" />
<path d="m2 22 3-3" />
<path d="M7.5 13.5 10 11" />
<path d="M10.5 16.5 13 14" />
<path d="m18 3-4 4h6l-4 4" />
</svg>

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 413 B

View File

@@ -2,6 +2,7 @@
"$schema": "../icon.schema.json",
"tags": [
"electricity",
"electronics",
"socket",
"outlet"
],

View File

@@ -10,7 +10,7 @@
stroke-linejoin="round"
>
<path d="M12 22v-5" />
<path d="M9 7V2" />
<path d="M15 7V2" />
<path d="M6 13V8h12v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4Z" />
<path d="M9 8V2" />
<path d="M15 8V2" />
<path d="M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z" />
</svg>

Before

Width:  |  Height:  |  Size: 338 B

After

Width:  |  Height:  |  Size: 335 B

14
icons/redo-dot.json Normal file
View File

@@ -0,0 +1,14 @@
{
"$schema": "../icon.schema.json",
"tags": [
"redo",
"history",
"step",
"over",
"forward"
],
"categories": [
"text",
"arrows"
]
}

15
icons/redo-dot.svg Normal file
View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="17" r="1" />
<path d="M21 7v6h-6" />
<path d="M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" />
</svg>

After

Width:  |  Height:  |  Size: 326 B

View File

@@ -9,13 +9,13 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<rect x="2" y="14" width="8" height="8" rx="2" />
<path d="M14 4c0-1.1.9-2 2-2" />
<path d="M20 2c1.1 0 2 .9 2 2" />
<path d="M22 8c0 1.1-.9 2-2 2" />
<path d="M16 10c-1.1 0-2-.9-2-2" />
<path d="m3 7 3 3 3-3" />
<path d="M6 10V5a2.95 2.95 0 0 1 3-3h1" />
<path d="M22 8a2 2 0 0 1-2 2" />
<path d="M20 2a2 2 0 0 1 2 2" />
<path d="M14 4a2 2 0 0 1 2-2" />
<path d="M16 10a2 2 0 0 1-2-2" />
<path d="M14 14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2" />
<path d="M20 14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2" />
<path d="M6 10V5c0-1.7 1.3-3 3-3h1" />
<rect width="8" height="8" x="2" y="14" rx="2" />
<path d="M14 14c1.1 0 2 .9 2 2v4c0 1.1-.9 2-2 2" />
<path d="M20 14c1.1 0 2 .9 2 2v4c0 1.1-.9 2-2 2" />
</svg>

Before

Width:  |  Height:  |  Size: 578 B

After

Width:  |  Height:  |  Size: 582 B

View File

@@ -9,11 +9,11 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<rect x="2" y="14" width="8" height="8" rx="2" />
<path d="M14 4c0-1.1.9-2 2-2" />
<path d="M20 2c1.1 0 2 .9 2 2" />
<path d="M22 8c0 1.1-.9 2-2 2" />
<path d="M16 10c-1.1 0-2-.9-2-2" />
<path d="m3 7 3 3 3-3" />
<path d="M6 10V5a2.95 2.95 0 0 1 3-3h1" />
<path d="M22 8a2 2 0 0 1-2 2" />
<path d="M20 2a2 2 0 0 1 2 2" />
<path d="M14 4a2 2 0 0 1 2-2" />
<path d="M16 10a2 2 0 0 1-2-2" />
<path d="M6 10V5c0-1.7 1.3-3 3-3h1" />
<rect width="8" height="8" x="2" y="14" rx="2" />
</svg>

Before

Width:  |  Height:  |  Size: 474 B

After

Width:  |  Height:  |  Size: 474 B

View File

@@ -12,6 +12,7 @@
"health"
],
"categories": [
"food-beverage"
"food-beverage",
"emoji"
]
}

19
icons/scroll-text.json Normal file
View File

@@ -0,0 +1,19 @@
{
"$schema": "../icon.schema.json",
"tags": [
"paper",
"log",
"scripture",
"document",
"parchment",
"list",
"long",
"script",
"code"
],
"categories": [
"gaming",
"development",
"text"
]
}

16
icons/scroll-text.svg Normal file
View File

@@ -0,0 +1,16 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4" />
<path d="M19 17V5a2 2 0 0 0-2-2H4" />
<path d="M15 8h-5" />
<path d="M15 12h-5" />
</svg>

After

Width:  |  Height:  |  Size: 377 B

View File

@@ -5,10 +5,15 @@
"log",
"scripture",
"document",
"parchment"
"parchment",
"list",
"long",
"script",
"code"
],
"categories": [
"gaming",
"development"
"development",
"text"
]
}
}

View File

@@ -9,8 +9,6 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10 17v2a2 2 0 0 1-2 2v0a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v3h3" />
<path d="M22 17v2a2 2 0 0 1-2 2H8" />
<path d="M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4" />
<path d="M19 17V5a2 2 0 0 0-2-2H4" />
<path d="M22 17H10" />
</svg>

Before

Width:  |  Height:  |  Size: 403 B

After

Width:  |  Height:  |  Size: 328 B

View File

@@ -1,7 +1,9 @@
{
"$schema": "../icon.schema.json",
"tags": [
"music"
"music",
"random",
"reorder"
],
"categories": [
"multimedia",

View File

@@ -9,9 +9,9 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="16 3 21 3 21 8" />
<line x1="4" x2="21" y1="20" y2="3" />
<polyline points="21 16 21 21 16 21" />
<line x1="15" x2="21" y1="15" y2="21" />
<line x1="4" x2="9" y1="4" y2="9" />
<path d="M2 18h1.4c1.3 0 2.5-.6 3.3-1.7l6.1-8.6c.7-1.1 2-1.7 3.3-1.7H22" />
<path d="m18 2 4 4-4 4" />
<path d="M2 6h1.9c1.5 0 2.9.9 3.6 2.2" />
<path d="M22 18h-5.9c-1.3 0-2.6-.7-3.3-1.8l-.5-.8" />
<path d="m18 14 4 4-4 4" />
</svg>

Before

Width:  |  Height:  |  Size: 412 B

After

Width:  |  Height:  |  Size: 445 B

13
icons/undo-dot.json Normal file
View File

@@ -0,0 +1,13 @@
{
"$schema": "../icon.schema.json",
"tags": [
"redo",
"history",
"step",
"back"
],
"categories": [
"text",
"arrows"
]
}

15
icons/undo-dot.svg Normal file
View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="17" r="1" />
<path d="M3 7v6h6" />
<path d="M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" />
</svg>

After

Width:  |  Height:  |  Size: 324 B

16
icons/ungroup.json Normal file
View File

@@ -0,0 +1,16 @@
{
"$schema": "../icon.schema.json",
"tags": [
"cubes",
"packages",
"parts",
"units",
"collection",
"cluster",
"separate"
],
"categories": [
"shapes",
"files"
]
}

14
icons/ungroup.svg Normal file
View File

@@ -0,0 +1,14 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="8" height="6" x="5" y="4" rx="1" />
<rect width="8" height="6" x="11" y="14" rx="1" />
</svg>

After

Width:  |  Height:  |  Size: 312 B

14
icons/unplug.json Normal file
View File

@@ -0,0 +1,14 @@
{
"$schema": "../icon.schema.json",
"tags": [
"electricity",
"electronics",
"socket",
"outlet",
"disconnect"
],
"categories": [
"devices",
"development"
]
}

18
icons/unplug.svg Normal file
View File

@@ -0,0 +1,18 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="m19 5 3-3" />
<path d="m2 22 3-3" />
<path d="M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z" />
<path d="M7.5 13.5 10 11" />
<path d="M10.5 16.5 13 14" />
<path d="m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z" />
</svg>

After

Width:  |  Height:  |  Size: 489 B

11
icons/user-2.json Normal file
View File

@@ -0,0 +1,11 @@
{
"$schema": "../icon.schema.json",
"tags": [
"person",
"account",
"contact"
],
"categories": [
"account"
]
}

14
icons/user-2.svg Normal file
View File

@@ -0,0 +1,14 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="8" r="5" />
<path d="M20 21a8 8 0 1 0-16 0" />
</svg>

After

Width:  |  Height:  |  Size: 279 B

15
icons/user-check-2.json Normal file
View File

@@ -0,0 +1,15 @@
{
"$schema": "../icon.schema.json",
"tags": [
"followed",
"subscribed",
"done",
"todo",
"tick",
"complete",
"task"
],
"categories": [
"account"
]
}

15
icons/user-check-2.svg Normal file
View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M14 19a6 6 0 0 0-12 0" />
<circle cx="8" cy="9" r="4" />
<polyline points="16 11 18 13 22 9" />
</svg>

After

Width:  |  Height:  |  Size: 319 B

12
icons/user-circle-2.json Normal file
View File

@@ -0,0 +1,12 @@
{
"$schema": "../icon.schema.json",
"tags": [
"person",
"account",
"contact"
],
"categories": [
"account",
"shapes"
]
}

15
icons/user-circle-2.svg Normal file
View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M18 20a6 6 0 0 0-12 0" />
<circle cx="12" cy="10" r="4" />
<circle cx="12" cy="12" r="10" />
</svg>

After

Width:  |  Height:  |  Size: 316 B

12
icons/user-circle.json Normal file
View File

@@ -0,0 +1,12 @@
{
"$schema": "../icon.schema.json",
"tags": [
"person",
"account",
"contact"
],
"categories": [
"account",
"shapes"
]
}

15
icons/user-circle.svg Normal file
View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="10" />
<circle cx="12" cy="10" r="3" />
<path d="M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662" />
</svg>

After

Width:  |  Height:  |  Size: 343 B

12
icons/user-cog-2.json Normal file
View File

@@ -0,0 +1,12 @@
{
"$schema": "../icon.schema.json",
"tags": [
"settings",
"edit",
"cog",
"gear"
],
"categories": [
"account"
]
}

21
icons/user-cog-2.svg Normal file
View File

@@ -0,0 +1,21 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M14 19a6 6 0 0 0-12 0" />
<circle cx="8" cy="9" r="4" />
<circle cx="19" cy="11" r="2" />
<path d="M19 8v1" />
<path d="M19 13v1" />
<path d="m21.6 9.5-.87.5" />
<path d="m17.27 12-.87.5" />
<path d="m21.6 12.5-.87-.5" />
<path d="m17.27 10-.87-.5" />
</svg>

After

Width:  |  Height:  |  Size: 487 B

12
icons/user-minus-2.json Normal file
View File

@@ -0,0 +1,12 @@
{
"$schema": "../icon.schema.json",
"tags": [
"delete",
"remove",
"unfollow",
"unsubscribe"
],
"categories": [
"account"
]
}

15
icons/user-minus-2.svg Normal file
View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M14 19a6 6 0 0 0-12 0" />
<circle cx="8" cy="9" r="4" />
<line x1="22" x2="16" y1="11" y2="11" />
</svg>

After

Width:  |  Height:  |  Size: 321 B

13
icons/user-plus-2.json Normal file
View File

@@ -0,0 +1,13 @@
{
"$schema": "../icon.schema.json",
"tags": [
"new",
"add",
"create",
"follow",
"subscribe"
],
"categories": [
"account"
]
}

16
icons/user-plus-2.svg Normal file
View File

@@ -0,0 +1,16 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M14 19a6 6 0 0 0-12 0" />
<circle cx="8" cy="9" r="4" />
<line x1="19" x2="19" y1="8" y2="14" />
<line x1="22" x2="16" y1="11" y2="11" />
</svg>

After

Width:  |  Height:  |  Size: 363 B

12
icons/user-square-2.json Normal file
View File

@@ -0,0 +1,12 @@
{
"$schema": "../icon.schema.json",
"tags": [
"person",
"account",
"contact"
],
"categories": [
"account",
"shapes"
]
}

15
icons/user-square-2.svg Normal file
View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M18 21a6 6 0 0 0-12 0" />
<circle cx="12" cy="11" r="4" />
<rect width="18" height="18" x="3" y="3" rx="2" />
</svg>

After

Width:  |  Height:  |  Size: 333 B

12
icons/user-square.json Normal file
View File

@@ -0,0 +1,12 @@
{
"$schema": "../icon.schema.json",
"tags": [
"person",
"account",
"contact"
],
"categories": [
"account",
"shapes"
]
}

15
icons/user-square.svg Normal file
View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="18" height="18" x="3" y="3" rx="2" />
<circle cx="12" cy="10" r="3" />
<path d="M7 21v-2a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2" />
</svg>

After

Width:  |  Height:  |  Size: 352 B

13
icons/user-x-2.json Normal file
View File

@@ -0,0 +1,13 @@
{
"$schema": "../icon.schema.json",
"tags": [
"delete",
"remove",
"unfollow",
"unsubscribe",
"unavailable"
],
"categories": [
"account"
]
}

16
icons/user-x-2.svg Normal file
View File

@@ -0,0 +1,16 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M14 19a6 6 0 0 0-12 0" />
<circle cx="8" cy="9" r="4" />
<line x1="17" x2="22" y1="8" y2="13" />
<line x1="22" x2="17" y1="8" y2="13" />
</svg>

After

Width:  |  Height:  |  Size: 362 B

10
icons/users-2.json Normal file
View File

@@ -0,0 +1,10 @@
{
"$schema": "../icon.schema.json",
"tags": [
"group",
"people"
],
"categories": [
"account"
]
}

15
icons/users-2.svg Normal file
View File

@@ -0,0 +1,15 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M14 19a6 6 0 0 0-12 0" />
<circle cx="8" cy="9" r="4" />
<path d="M22 19a6 6 0 0 0-6-6 4 4 0 1 0 0-8" />
</svg>

After

Width:  |  Height:  |  Size: 328 B

View File

@@ -173,6 +173,31 @@ const ControlPath = ({
);
};
const Radii = ({
paths,
...props
}: { paths: Path[] } & PathProps<
'strokeWidth' | 'stroke' | 'strokeDasharray' | 'strokeOpacity',
any
>) => {
return (
<g className="svg-preview-radii-group" {...props}>
{paths
.filter(({ circle }) => circle)
.map(({ c, prev, next, circle: { x, y, r } }) =>
c.name === 'circle' ? (
<path d={`M${x} ${y}h.01`} />
) : (
<>
<path d={`M${prev.x} ${prev.y} ${x} ${y} ${next.x} ${next.y}`} />
<circle cy={y} cx={x} r={r} />
</>
)
)}
</g>
);
};
const SvgPreview = React.forwardRef<
SVGSVGElement,
{
@@ -184,6 +209,7 @@ const SvgPreview = React.forwardRef<
const darkModeCss = `@media screen and (prefers-color-scheme: dark) {
.svg-preview-grid-group,
.svg-preview-radii-group,
.svg-preview-shadow-mask-group,
.svg-preview-shadow-group {
stroke: #fff;
@@ -223,6 +249,13 @@ const SvgPreview = React.forwardRef<
'#52A675',
]}
/>
<Radii
paths={paths}
strokeWidth={0.12}
strokeDasharray="0 0.25 0.25"
stroke="#777"
strokeOpacity={0.3}
/>
<ControlPath radius={1} paths={paths} pointSize={1} stroke="#fff" strokeWidth={0.125} />
{children}
</svg>

View File

@@ -8,6 +8,7 @@ export type Path = {
prev: Point;
next: Point;
isStart: boolean;
circle: { x: number; y: number; r: number };
c: ReturnType<typeof getCommands>[number];
};

View File

@@ -12,33 +12,66 @@ export function assert(value: unknown): asserts value {
}
}
const extractPaths = (node: INode): { d: string; name: typeof node.name }[] => {
if (/(rect|circle|ellipse|polygon|polyline|line|path)/.test(node.name)) {
return [{ d: toPath(node), name: node.name }];
const convertToPathNode = (node: INode): { d: string; name: typeof node.name } => {
if (node.name === 'path') {
return { d: node.attributes.d, name: node.name };
}
if (node.name === 'circle') {
const cx = parseFloat(node.attributes.cx);
const cy = parseFloat(node.attributes.cy);
const r = parseFloat(node.attributes.r);
return {
d: [
`M ${cx} ${cy - r}`,
`a ${r} ${r} 0 0 1 ${r} ${r}`,
`a ${r} ${r} 0 0 1 ${0 - r} ${r}`,
`a ${r} ${r} 0 0 1 ${0 - r} ${0 - r}`,
`a ${r} ${r} 0 0 1 ${r} ${0 - r}`,
].join(''),
name: node.name,
};
}
return { d: toPath(node).replace(/z$/i, ''), name: node.name };
};
const extractNodes = (node: INode): INode[] => {
if (['rect', 'circle', 'ellipse', 'polygon', 'polyline', 'line', 'path'].includes(node.name)) {
return [node];
} else if (node.children && Array.isArray(node.children)) {
return node.children.flatMap(extractPaths);
return node.children.flatMap(extractNodes);
}
return [];
};
export const getNodes = (src: string) =>
extractNodes(parseSync(src.includes('<svg') ? src : `<svg>${src}</svg>`));
export const getCommands = (src: string) =>
extractPaths(parseSync(src)).flatMap(({ d, name }, idx) =>
new SVGPathData(d).toAbs().commands.map((c) => ({ ...c, id: idx, name }))
);
getNodes(src)
.map(convertToPathNode)
.flatMap(({ d, name }, idx) =>
new SVGPathData(d).toAbs().commands.map((c, cIdx) => ({ ...c, id: idx, idx: cIdx, name }))
);
export const getPaths = (src: string) => {
const commands = getCommands(src.includes('<svg') ? src : `<svg>${src}</svg>`);
const paths: Path[] = [];
let prev: Point | undefined = undefined;
let start: Point | undefined = undefined;
const addPath = (c: (typeof commands)[number], next: Point, d?: string) => {
const addPath = (
c: typeof commands[number],
next: Point,
d?: string,
circle?: Path['circle']
) => {
assert(prev);
paths.push({
c,
d: d || `M${prev.x} ${prev.y}L${next.x} ${next.y}`,
d: d || `M ${prev.x} ${prev.y} L ${next.x} ${next.y}`,
prev,
next,
circle,
isStart: start === prev,
});
prev = next;
@@ -77,7 +110,7 @@ export const getPaths = (src: string) => {
}
case SVGPathData.CURVE_TO: {
assert(prev);
addPath(c, c, `M ${prev.x},${prev.y} ${encodeSVGPath(c)}`);
addPath(c, c, `M ${prev.x} ${prev.y} ${encodeSVGPath(c)}`);
break;
}
case SVGPathData.SMOOTH_CURVE_TO: {
@@ -86,16 +119,16 @@ export const getPaths = (src: string) => {
const reflectedCp1 = {
x:
previousCommand &&
(previousCommand.type === SVGPathData.SMOOTH_CURVE_TO ||
previousCommand.type === SVGPathData.CURVE_TO)
(previousCommand.type === SVGPathData.SMOOTH_CURVE_TO ||
previousCommand.type === SVGPathData.CURVE_TO)
? previousCommand.relative
? previousCommand.x2 - previousCommand.x
: previousCommand.x2 - prev.x
: 0,
y:
previousCommand &&
(previousCommand.type === SVGPathData.SMOOTH_CURVE_TO ||
previousCommand.type === SVGPathData.CURVE_TO)
(previousCommand.type === SVGPathData.SMOOTH_CURVE_TO ||
previousCommand.type === SVGPathData.CURVE_TO)
? previousCommand.relative
? previousCommand.y2 - previousCommand.y
: previousCommand.y2 - prev.y
@@ -104,7 +137,7 @@ export const getPaths = (src: string) => {
addPath(
c,
c,
`M ${prev.x},${prev.y} ${encodeSVGPath({
`M ${prev.x} ${prev.y} ${encodeSVGPath({
type: SVGPathData.CURVE_TO,
relative: false,
x: c.x,
@@ -119,7 +152,7 @@ export const getPaths = (src: string) => {
}
case SVGPathData.QUAD_TO: {
assert(prev);
addPath(c, c, `M ${prev.x},${prev.y} ${encodeSVGPath(c)}`);
addPath(c, c, `M ${prev.x} ${prev.y} ${encodeSVGPath(c)}`);
break;
}
case SVGPathData.SMOOTH_QUAD_TO: {
@@ -157,7 +190,7 @@ export const getPaths = (src: string) => {
addPath(
c,
c,
`M ${prev.x},${prev.y} ${encodeSVGPath({
`M ${prev.x} ${prev.y} ${encodeSVGPath({
type: SVGPathData.QUAD_TO,
relative: false,
x: c.x,
@@ -170,10 +203,22 @@ export const getPaths = (src: string) => {
}
case SVGPathData.ARC: {
assert(prev);
const center = arcEllipseCenter(
prev.x,
prev.y,
c.rX,
c.rY,
c.xRot,
c.lArcFlag,
c.sweepFlag,
c.x,
c.y
);
addPath(
c,
c,
`M ${prev.x},${prev.y} A ${c.rX} ${c.rY} ${c.xRot} ${c.lArcFlag} ${c.sweepFlag} ${c.x} ${c.y}`
`M ${prev.x} ${prev.y} A${c.rX} ${c.rY} ${c.xRot} ${c.lArcFlag} ${c.sweepFlag} ${c.x} ${c.y}`,
c.rX === c.rY ? { ...center, r: c.rX } : undefined
);
break;
}
@@ -184,3 +229,58 @@ export const getPaths = (src: string) => {
}
return paths;
};
export const arcEllipseCenter = (
x1: number,
y1: number,
rx: number,
ry: number,
a: number,
fa: number,
fs: number,
x2: number,
y2: number
) => {
const phi = (a * Math.PI) / 180;
const M = [
[Math.cos(phi), Math.sin(phi)],
[-Math.sin(phi), Math.cos(phi)],
];
const V = [(x1 - x2) / 2, (y1 - y2) / 2];
const [x1p, y1p] = [M[0][0] * V[0] + M[0][1] * V[1], M[1][0] * V[0] + M[1][1] * V[1]];
rx = Math.abs(rx);
ry = Math.abs(ry);
const lambda = (x1p * x1p) / (rx * rx) + (y1p * y1p) / (ry * ry);
if (lambda > 1) {
rx = Math.sqrt(lambda) * rx;
ry = Math.sqrt(lambda) * ry;
}
const sign = fa === fs ? -1 : 1;
const co =
sign *
Math.sqrt(
Math.max(rx * rx * ry * ry - rx * rx * y1p * y1p - ry * ry * x1p * x1p, 0) /
(rx * rx * y1p * y1p + ry * ry * x1p * x1p)
);
const V2 = [(rx * y1p) / ry, (-ry * x1p) / rx];
const Cp = [V2[0] * co, V2[1] * co];
const M2 = [
[Math.cos(phi), -Math.sin(phi)],
[Math.sin(phi), Math.cos(phi)],
];
const V3 = [(x1 + x2) / 2, (y1 + y2) / 2];
const C = [
M2[0][0] * Cp[0] + M2[0][1] * Cp[1] + V3[0],
M2[1][0] * Cp[0] + M2[1][1] * Cp[1] + V3[1],
];
return { x: C[0], y: C[1] };
};