@opencode/ui 2.0.21 → 2.0.23
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/dist/context/dialog.d.ts +7 -3
- package/dist/data-display/accordion/accordion.d.ts +3 -1
- package/dist/data-display/project-avatar/project-avatar.d.ts +10 -0
- package/dist/feedback/toast/toast.d.ts +3 -2
- package/dist/i18n/en.d.ts +4 -0
- package/dist/icons/catalog.d.ts +253 -0
- package/dist/icons/icon/additional-icons.d.ts +1 -0
- package/dist/icons/icon/icon.d.ts +1 -237
- package/package.json +5 -1
- package/src/context/dialog.tsx +99 -52
- package/src/data-display/accordion/accordion.tsx +16 -2
- package/src/data-display/project-avatar/project-avatar.tsx +33 -0
- package/src/feedback/toast/toast.tsx +32 -6
- package/src/i18n/en.ts +9 -0
- package/src/icons/catalog.ts +269 -0
- package/src/icons/icon/additional-icons.ts +1 -0
- package/src/icons/icon/icon.tsx +10 -250
- package/src/navigation/tabs/tabs.css +2 -68
- package/src/styles/tailwind/index.css +1 -0
- package/src/styles/theme.css +1 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { additionalIcons, additionalIconViewBox } from "./icon/additional-icons"
|
|
2
|
+
|
|
3
|
+
// Consumers center the SVG viewport, so each icon must center its artwork within its viewBox.
|
|
4
|
+
const icons = {
|
|
5
|
+
lock: {
|
|
6
|
+
viewBox: "0 0 16 16",
|
|
7
|
+
body: `<rect x="3.5" y="7" width="9" height="7" rx="1" stroke="currentColor"/><path d="M5 7V5a3 3 0 0 1 6 0v2M8 10v1" stroke="currentColor" stroke-linecap="round"/>`,
|
|
8
|
+
},
|
|
9
|
+
globe: {
|
|
10
|
+
viewBox: "0 0 16 16",
|
|
11
|
+
body: `<circle cx="8" cy="8" r="6" stroke="currentColor"/><ellipse cx="8" cy="8" rx="2.5" ry="6" stroke="currentColor"/><path d="M2 8h12" stroke="currentColor"/>`,
|
|
12
|
+
},
|
|
13
|
+
"select-element": {
|
|
14
|
+
viewBox: "0 0 16 16",
|
|
15
|
+
body: `<path d="M12.5 6.5V2.5C12.5 1.94772 12.0523 1.5 11.5 1.5H2.5C1.94772 1.5 1.5 1.94772 1.5 2.5V11.5C1.5 12.0523 1.94772 12.5 2.5 12.5H6.5" stroke="currentColor" stroke-linecap="round"/><path d="M7.5 7.5L14.5 10.1L11.1 11.1L10.1 14.5L7.5 7.5Z" stroke="currentColor" stroke-linejoin="round"/>`,
|
|
16
|
+
},
|
|
17
|
+
flask: {
|
|
18
|
+
viewBox: "0 0 16 16",
|
|
19
|
+
body: `<path d="M5.5 2H10.5M6 2V6L2.5 12C2 13 2.5 14 3.5 14H12.5C13.5 14 14 13 13.5 12L10 6V2M4.25 9H11.75" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>`,
|
|
20
|
+
},
|
|
21
|
+
edit: {
|
|
22
|
+
viewBox: "0 0 16 16",
|
|
23
|
+
body: `<path d="M13.5556 8.21529V13.5556H2.44446L2.44446 2.44445H7.78474M6.00002 8.16216V10H7.83786L14 3.83784L12.1622 2L6.00002 8.16216Z" stroke="currentColor"/>`,
|
|
24
|
+
},
|
|
25
|
+
"folder-add-left": {
|
|
26
|
+
viewBox: "0 0 16 16",
|
|
27
|
+
body: `<path d="M7.5 13.3333H1.5V2H6.83333L8.83333 4H14.8333V6M10.1667 11.3333H15.5M12.8333 8.66667V14" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`,
|
|
28
|
+
},
|
|
29
|
+
folder: {
|
|
30
|
+
viewBox: "0 0 16 16",
|
|
31
|
+
body: `<path d="M1.33337 2V13.3333H14.6667V4H8.66671L6.66671 2H1.33337Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`,
|
|
32
|
+
},
|
|
33
|
+
branch: {
|
|
34
|
+
viewBox: "0 0 16 16",
|
|
35
|
+
body: `<path d="M5.118 5.686V10.314M5.118 5.686C5.97 5.686 6.661 4.995 6.661 4.143C6.661 3.291 5.97 2.6 5.118 2.6C4.266 2.6 3.575 3.291 3.575 4.143C3.575 4.995 4.266 5.686 5.118 5.686ZM5.118 10.314C4.266 10.314 3.575 11.005 3.575 11.857C3.575 12.709 4.266 13.4 5.118 13.4C5.97 13.4 6.661 12.709 6.661 11.857M5.118 10.314C5.97 10.314 6.661 11.005 6.661 11.857M10.882 5.686C11.734 5.686 12.425 4.995 12.425 4.143C12.425 3.291 11.734 2.6 10.882 2.6C10.03 2.6 9.339 3.291 9.339 4.143C9.339 4.995 10.03 5.686 10.882 5.686ZM10.882 5.686V9.457C10.882 10.783 9.807 11.857 8.482 11.857H6.661" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>`,
|
|
36
|
+
},
|
|
37
|
+
"branch-out": {
|
|
38
|
+
viewBox: "0 0 16 16",
|
|
39
|
+
body: `<path d="M10.4225 3.35355L12.9024 5.83344L10.4225 8.31333" stroke="currentColor"/><path d="M1 12.2852H4.23042C4.89912 12.2852 5.52359 11.951 5.89452 11.3946L9.00783 6.72462C8.37877 6.16823 10.0032 5.83402 10.6719 5.83402H12.9024" stroke="currentColor"/><path d="M8.5 12.2852H14" stroke="currentColor" stroke-linejoin="round"/>`,
|
|
40
|
+
},
|
|
41
|
+
"grid-plus": {
|
|
42
|
+
viewBox: "0 0 16 16",
|
|
43
|
+
body: `<path d="M13.9948 11.668H9.32812M11.6641 9.33203V13.9987M6.66667 9.33203V13.9987H2V9.33203H6.66667ZM6.66667 2V6.66667H2V2H6.66667ZM13.9948 2V6.66667H9.32812V2H13.9948Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`,
|
|
44
|
+
},
|
|
45
|
+
help: {
|
|
46
|
+
viewBox: "0 0 16 16",
|
|
47
|
+
body: `<path d="M6.33345 6.33349V5.00015H9.66679V7.00015L8.00015 8.00015V9.66679M8.27485 11.6819H7.71897M14.4446 8.00011C14.4446 11.5593 11.5593 14.4446 8.00011 14.4446C4.44094 14.4446 1.55566 11.5593 1.55566 8.00011C1.55566 4.44094 4.44094 1.55566 8.00011 1.55566C11.5593 1.55566 14.4446 4.44094 14.4446 8.00011Z" stroke="currentColor" stroke-linecap="square"/>`,
|
|
48
|
+
},
|
|
49
|
+
info: {
|
|
50
|
+
viewBox: "0 0 16 16",
|
|
51
|
+
body: `<g transform="translate(2 2)"><path d="M12 12H0V0H12V12ZM1 1V11H11V1H1ZM6.5791 4.81641V9.37207H5.5791V5.81641H4.46777V4.81641H6.5791ZM6.85645 2.62891V3.62891H5.30078V2.62891H6.85645Z" fill="currentColor"/></g>`,
|
|
52
|
+
},
|
|
53
|
+
"circle-exclamation": {
|
|
54
|
+
viewBox: "0 0 16 16",
|
|
55
|
+
body: `<path d="M8.75 11.75H7.25V10.25H8.75V11.75Z" fill="currentColor"/><path d="M8.75 9.25H7.25V4.25H8.75V9.25Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 1C9.93286 1 11.684 1.7836 12.9502 3.0498C14.2164 4.31601 15 6.06714 15 8C15 11.866 11.866 15 8 15C6.06714 15 4.31601 14.2164 3.0498 12.9502C1.7836 11.684 1 9.93286 1 8C1 4.13401 4.13401 1 8 1ZM8 2C4.68629 2 2 4.68629 2 8C2 9.65699 2.67148 11.1559 3.75781 12.2422C4.84415 13.3285 6.34301 14 8 14C11.3137 14 14 11.3137 14 8C14 6.34301 13.3285 4.84415 12.2422 3.75781C11.1559 2.67148 9.65699 2 8 2Z" fill="currentColor"/>`,
|
|
56
|
+
},
|
|
57
|
+
"circle-xmark": {
|
|
58
|
+
viewBox: "0 0 16 16",
|
|
59
|
+
body: `<path fill-rule="evenodd" clip-rule="evenodd" d="M1.33334 8.00016C1.33334 4.31826 4.31811 1.3335 8.00001 1.3335C11.6819 1.3335 14.6667 4.31826 14.6667 8.00016C14.6667 11.6821 11.6819 14.6668 8.00001 14.6668C4.31811 14.6668 1.33334 11.6821 1.33334 8.00016ZM6.00001 5.29306L5.2929 6.00016L7.2929 8.00016L5.2929 10.0002L6.00001 10.7073L8.00001 8.70727L10 10.7073L10.7071 10.0002L8.70712 8.00016L10.7071 6.00016L10 5.29306L8.00001 7.29306L6.00001 5.29306Z" fill="currentColor"/>`,
|
|
60
|
+
},
|
|
61
|
+
"sidebar-right": {
|
|
62
|
+
viewBox: "0 0 20 20",
|
|
63
|
+
body: `<path d="M2.91536 2.91406H2.36536V2.36406H2.91536V2.91406ZM2.91536 17.0807V17.6307H2.36536V17.0807H2.91536ZM17.082 17.0807H17.632V17.6307H17.082V17.0807ZM17.082 2.91406V2.36406H17.632V2.91406H17.082ZM6.9987 2.91406H6.4487V2.36406H6.9987V2.91406ZM6.9987 17.0807V17.6307H6.4487V17.0807H6.9987ZM2.91536 2.91406H3.46536V17.0807H2.91536H2.36536V2.91406H2.91536ZM2.91536 17.0807V16.5307H17.082V17.0807V17.6307H2.91536V17.0807ZM17.082 17.0807H16.532V2.91406H17.082H17.632V17.0807H17.082ZM17.082 2.91406V3.46406H2.91536V2.91406V2.36406H17.082V2.91406ZM6.9987 2.91406H7.5487V17.0807H6.9987H6.4487V2.91406H6.9987ZM17.082 17.0807L17.082 17.6307L6.9987 17.6307V17.0807V16.5307L17.082 16.5307L17.082 17.0807ZM6.9987 2.91406V2.36406H17.082V2.91406V3.46406H6.9987V2.91406Z" fill="currentColor"/>`,
|
|
64
|
+
},
|
|
65
|
+
status: {
|
|
66
|
+
viewBox: "0 0 20 20",
|
|
67
|
+
body: `<path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`,
|
|
68
|
+
},
|
|
69
|
+
"status-active": {
|
|
70
|
+
viewBox: "0 0 20 20",
|
|
71
|
+
body: `<path d="M18 2H2V10H18V2Z" fill="currentColor" fill-opacity="0.1"/><path d="M2 18H18V10H2V18Z" fill="currentColor" fill-opacity="0.1"/><path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`,
|
|
72
|
+
},
|
|
73
|
+
"magnifying-glass": {
|
|
74
|
+
viewBox: "0 0 16 16",
|
|
75
|
+
body: `<path d="M14 14L10.3454 10.3454M6.88889 11.7778C9.58889 11.7778 11.7778 9.58889 11.7778 6.88889C11.7778 4.18889 9.58889 2 6.88889 2C4.18889 2 2 4.18889 2 6.88889C2 9.58889 4.18889 11.7778 6.88889 11.7778Z" stroke="currentColor"/>`,
|
|
76
|
+
},
|
|
77
|
+
menu: {
|
|
78
|
+
viewBox: "0 0 16 16",
|
|
79
|
+
body: `<path d="M2 8H14M2 4.664H14M2 11.336H14" stroke="currentColor"/>`,
|
|
80
|
+
},
|
|
81
|
+
plus: {
|
|
82
|
+
viewBox: "0 0 16 16",
|
|
83
|
+
body: `<path d="M8 2.88867V13.1109" stroke="currentColor" stroke-linejoin="round"/><path d="M2.88867 8H13.1109" stroke="currentColor" stroke-linejoin="round"/>`,
|
|
84
|
+
},
|
|
85
|
+
"settings-gear": {
|
|
86
|
+
viewBox: "0 0 16 16",
|
|
87
|
+
body: `<path d="M7.99998 1.3335L14 4.66683V11.3335L7.99998 14.6668L2 11.3335V4.66683L7.99998 1.3335Z" stroke="currentColor"/><path d="M9.99998 8.00016C9.99998 9.10476 9.10458 10.0002 7.99998 10.0002C6.89538 10.0002 5.99998 9.10476 5.99998 8.00016C5.99998 6.89556 6.89538 6.00016 7.99998 6.00016C9.10458 6.00016 9.99998 6.89556 9.99998 8.00016Z" stroke="currentColor"/>`,
|
|
88
|
+
},
|
|
89
|
+
"chevron-down": {
|
|
90
|
+
viewBox: "0 0 16 16",
|
|
91
|
+
body: `<path d="M5 6.5L8 9.5L11 6.5" stroke="currentColor"/>`,
|
|
92
|
+
},
|
|
93
|
+
collapse: {
|
|
94
|
+
viewBox: "0 0 16 16",
|
|
95
|
+
body: `<path d="M8 1V6M11 3L8 6L5 3" stroke="currentColor"/><path d="M8 15V10M11 13L8 10L5 13" stroke="currentColor"/><path d="M4 8H6" stroke="currentColor"/><path d="M7 8H9" stroke="currentColor"/><path d="M10 8H12" stroke="currentColor"/>`,
|
|
96
|
+
},
|
|
97
|
+
check: {
|
|
98
|
+
viewBox: "0 0 16 16",
|
|
99
|
+
body: `<path d="M3.53613 8.17857L6.39328 11.75L12.4647 4.25" stroke="currentColor"/>`,
|
|
100
|
+
},
|
|
101
|
+
monitor: {
|
|
102
|
+
viewBox: "0 0 16 16",
|
|
103
|
+
body: `<path d="M4.05559 9.38889H0.500007C0.500007 9.38889 0.500017 8.59298 0.500017 7.61112V2.27778C0.500017 1.29594 0.500102 0.5 0.500102 0.5H13.3889C13.3889 0.5 13.3889 1.29594 13.3889 2.27778V7.61112C13.3889 8.59298 13.3889 9.38889 13.3889 9.38889H9.83336M4.05559 9.38889V11.6111H6.94448H9.83336V9.38889M4.05559 9.38889H9.83336" transform="translate(1.05556 1.94444)" stroke="currentColor"/>`,
|
|
104
|
+
},
|
|
105
|
+
"workspace-new": {
|
|
106
|
+
viewBox: "0 0 16 16",
|
|
107
|
+
body: `<path d="M2 10.7578V14.0011H5.24324M13.9991 5.24324V2H10.7559M13.9991 10.7578V14.0011H10.7559M2 5.24324V2H5.24324" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/><path d="M8 4.5V11.5M4.5 8H11.5" stroke="currentColor" stroke-linejoin="round"/>`,
|
|
108
|
+
},
|
|
109
|
+
"workspace-isolated": {
|
|
110
|
+
viewBox: "0 0 16 16",
|
|
111
|
+
body: `<path d="M10.5 10.5V5.5H5.5V10.5H10.5Z" fill="currentColor"/><rect x="2.5" y="2.5" width="11" height="11" stroke="currentColor"/>`,
|
|
112
|
+
},
|
|
113
|
+
workspace: {
|
|
114
|
+
viewBox: "0 0 16 16",
|
|
115
|
+
body: `<path d="M2 10.668V14.0013H10.6667M13.9974 10.6667V2H2.66406M13.9974 10.668V14.0013H10.6641M2 10V2H5.33333" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/><path d="M10.6693 10.6654V5.33203H5.33594V10.6654H10.6693Z" fill="currentColor"/>`,
|
|
116
|
+
},
|
|
117
|
+
"outline-worktree": {
|
|
118
|
+
viewBox: "0 0 16 16",
|
|
119
|
+
body: `<path d="M12 3.11133L14.3885 5.49977L12 7.88822M14.5 5.49972H10.058L5.13456 11.8139M14.5 11.6606L8.5 11.6606M5.50012 11.6597H1.5" stroke="currentColor"/>`,
|
|
120
|
+
},
|
|
121
|
+
"outline-trash": {
|
|
122
|
+
viewBox: "0 0 16 16",
|
|
123
|
+
body: `<path d="M2.44434 4.22224H13.5554M5.99994 4.22224V2.44446C5.99994 1.95557 5.99992 1.55557 5.99992 1.55557H9.99989C9.99989 1.55557 9.99994 1.95557 9.99994 2.44446V4.22224M6.55545 7.77779L6.7485 11.7778M9.44437 7.77779L9.2513 11.7778M12.1756 6.88891L11.8666 12.7556C11.8168 13.7068 11.7748 14.4445 11.7748 14.4445H4.22511C4.22511 14.4445 4.18392 13.7067 4.13414 12.7556L3.82509 6.88891" stroke="currentColor"/>`,
|
|
124
|
+
},
|
|
125
|
+
close: {
|
|
126
|
+
viewBox: "0 0 20 20",
|
|
127
|
+
body: `<path d="M14.4446 5.55566L5.55566 14.4446M5.55566 5.55566L14.4446 14.4446" stroke="currentColor" stroke-linejoin="round"/>`,
|
|
128
|
+
},
|
|
129
|
+
"xmark-small": {
|
|
130
|
+
viewBox: "0 0 16 16",
|
|
131
|
+
body: `<path d="M4.25 11.75L11.75 4.25M11.75 11.75L4.25 4.25" stroke="currentColor"/>`,
|
|
132
|
+
},
|
|
133
|
+
"outline-xmark": {
|
|
134
|
+
viewBox: "0 0 16 16",
|
|
135
|
+
body: `<path fill-rule="evenodd" clip-rule="evenodd" d="M4.99487 5.70186L7.29297 7.99995L4.99487 10.2981L5.70198 11.0052L8.00008 8.70706L10.2982 11.0052L11.0053 10.2981L8.70718 7.99995L11.0053 5.70186L10.2982 4.99475L8.00008 7.29285L5.70198 4.99475L4.99487 5.70186Z" fill="currentColor"/>`,
|
|
136
|
+
},
|
|
137
|
+
"outline-chevron-down": {
|
|
138
|
+
viewBox: "0 0 16 16",
|
|
139
|
+
body: `<path d="M5 6.5L8 9.5L11 6.5" stroke="currentColor"/>`,
|
|
140
|
+
},
|
|
141
|
+
"outline-dots": {
|
|
142
|
+
viewBox: "0 0 16 16",
|
|
143
|
+
body: `<path d="M2.5 7.5H3.5V8.5H2.5V7.5Z" stroke="currentColor"/><path d="M7.5 7.5H8.5V8.5H7.5V7.5Z" stroke="currentColor"/><path d="M12.5 7.5H13.5V8.5H12.5V7.5Z" stroke="currentColor"/>`,
|
|
144
|
+
},
|
|
145
|
+
expand: {
|
|
146
|
+
viewBox: "0 0 16 16",
|
|
147
|
+
body: `<path d="M8.25 6.17773V1.17773M11.25 4.17773L8.25 1.17773L5.25 4.17773" stroke="currentColor"/><path d="M8.25 9.17773V14.1777M11.25 11.1777L8.25 14.1777L5.25 11.1777" stroke="currentColor"/><path d="M4.25 7.67773H12.25" stroke="currentColor"/>`,
|
|
148
|
+
},
|
|
149
|
+
filetree: {
|
|
150
|
+
viewBox: "0 0 16 16",
|
|
151
|
+
body: `<path d="M2.5 1.5V12.2484H6.75M2.5 4.74838H6.75" stroke="currentColor"/><rect x="8.5" y="3.2168" width="6" height="3" fill="none" stroke="currentColor"/><rect x="8.5" y="10.75" width="6" height="3" fill="none" stroke="currentColor"/>`,
|
|
152
|
+
},
|
|
153
|
+
split: {
|
|
154
|
+
viewBox: "0 0 16 16",
|
|
155
|
+
body: `<path d="M1 14H15L15 2H1V14Z" stroke="currentColor"/><rect x="3" y="4" width="4" height="8" fill="currentColor" fill-opacity="0.5"/><rect x="9" y="4" width="4" height="8" fill="currentColor" fill-opacity="0.5"/>`,
|
|
156
|
+
},
|
|
157
|
+
unified: {
|
|
158
|
+
viewBox: "0 0 16 16",
|
|
159
|
+
body: `<path d="M3.00001 4.00045L12.9998 4L13 6.99955L3 7L3.00001 4.00045Z" fill="currentColor" fill-opacity="0.5"/><path d="M3.0001 9H13L12.9999 12H3L3.0001 9Z" fill="currentColor" fill-opacity="0.5"/><path d="M1 14H15L15 2H1V14Z" stroke="currentColor"/>`,
|
|
160
|
+
},
|
|
161
|
+
review: {
|
|
162
|
+
viewBox: "0 0 20 20",
|
|
163
|
+
body: `<path d="M7 14.5H13M7 7.99512H10.0049M10.0049 7.99512H13M10.0049 7.99512V5M10.0049 7.99512V11M18 18V2L2 2L2 18H18Z" stroke="currentColor"/>`,
|
|
164
|
+
},
|
|
165
|
+
"window-analytics": {
|
|
166
|
+
viewBox: "0 0 16 16",
|
|
167
|
+
body: `<path d="M14.5 9.8333V13.5H1.5V2.5H7.1667M9.5 2.5V7.5H14.5V2.5H9.5Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`,
|
|
168
|
+
},
|
|
169
|
+
"graduation-cap": {
|
|
170
|
+
viewBox: "0 0 16 16",
|
|
171
|
+
body: `<path d="M12.3327 7.50065V11.0007L7.99935 13.6673L3.66602 11.0007V7.50065M14.3327 9.83398V6.16732M7.99935 2.33398L1.66602 6.00065L7.99935 10.0007L14.3327 6.00065L7.99935 2.33398Z" stroke="currentColor" stroke-linecap="square"/>`,
|
|
172
|
+
},
|
|
173
|
+
"code-slash": {
|
|
174
|
+
viewBox: "0 0 16 16",
|
|
175
|
+
body: `<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0812 2.10803L6.55974 14.0809L5.92016 13.8928L9.44161 1.91992L10.0812 2.10803ZM4.13793 4.97275L1.44666 8.00045L4.13793 11.0281L3.63966 11.471L0.554688 8.00045L3.63966 4.52984L4.13793 4.97275ZM12.3617 4.52984L15.4467 8.00045L12.3617 11.471L11.8634 11.0281L14.5547 8.00045L11.8634 4.97275L12.3617 4.52984Z" fill="currentColor"/>`,
|
|
176
|
+
},
|
|
177
|
+
trash: {
|
|
178
|
+
viewBox: "0 0 20 20",
|
|
179
|
+
body: `<path d="M4.58342 17.9134L4.58369 17.4134L4.22787 17.5384L4.22766 18.0384H4.58342V17.9134ZM15.4167 17.9134V18.0384H15.7725L15.7723 17.5384L15.4167 17.9134ZM2.08342 3.95508V3.45508H1.58342V3.95508H2.08342V4.45508V3.95508ZM17.9167 4.45508V4.95508H18.4167V4.45508H17.9167V3.95508V4.45508ZM4.16677 4.58008L3.66701 4.5996L4.22816 17.5379L4.72792 17.4934L5.22767 17.4489L4.66652 4.54055L4.16677 4.58008ZM4.58342 18.0384V17.9134H15.4167V18.0384V18.5384H4.58342V18.0384ZM15.4167 17.9134L15.8332 17.5379L16.2498 4.5996L15.7501 4.58008L15.2503 4.56055L14.8337 17.4989L15.4167 17.9134ZM15.8334 4.58008V4.08008H4.16677V4.58008V5.08008H15.8334V4.58008ZM2.08342 4.45508V4.95508H4.16677V4.58008V4.08008H2.08342V4.45508ZM15.8334 4.58008V5.08008H17.9167V4.45508V3.95508H15.8334V4.58008ZM6.83951 4.35149L7.432 4.55047C7.79251 3.47701 8.80699 2.70508 10.0001 2.70508V2.20508V1.70508C8.25392 1.70508 6.77335 2.83539 6.24702 4.15251L6.83951 4.35149ZM10.0001 2.20508V2.70508C11.1932 2.70508 12.2077 3.47701 12.5682 4.55047L13.1607 4.35149L13.7532 4.15251C13.2269 2.83539 11.7463 1.70508 10.0001 1.70508V2.20508Z" fill="currentColor"/>`,
|
|
180
|
+
},
|
|
181
|
+
"outline-sliders": {
|
|
182
|
+
viewBox: "0 0 16 16",
|
|
183
|
+
body: `<path d="M11.7779 4.66675H14.4446M11.7779 4.66675C11.7779 5.77132 10.8825 6.66675 9.77789 6.66675C8.67332 6.66675 7.77789 5.77132 7.77789 4.66675M11.7779 4.66675C11.7779 3.56218 10.8825 2.66675 9.77789 2.66675C8.67332 2.66675 7.77789 3.56218 7.77789 4.66675M1.55566 4.66675H7.77789M4.22233 11.3334H1.55566M4.22233 11.3334C4.22233 12.438 5.11776 13.3334 6.22233 13.3334C7.3269 13.3334 8.22233 12.438 8.22233 11.3334M4.22233 11.3334C4.22233 10.2288 5.11776 9.33341 6.22233 9.33341C7.3269 9.33341 8.22233 10.2288 8.22233 11.3334M14.4446 11.3334H8.22233" stroke="currentColor"/>`,
|
|
184
|
+
},
|
|
185
|
+
"outline-copy": {
|
|
186
|
+
viewBox: "0 0 16 16",
|
|
187
|
+
body: `<path d="M4.14908 11.0081H1.76282V1.51758H9.1038V2.55588M14.2225 4.99681H6.75397V14.4873H14.2225V4.99681Z" stroke="currentColor"/>`,
|
|
188
|
+
},
|
|
189
|
+
"arrow-up-right": {
|
|
190
|
+
viewBox: "0 0 16 16",
|
|
191
|
+
body: `<path d="M11 9.56V5H6.44M11 5L5 11" stroke="currentColor"/>`,
|
|
192
|
+
},
|
|
193
|
+
"outline-square-arrow": {
|
|
194
|
+
viewBox: "0 0 16 16",
|
|
195
|
+
body: `<path d="M13.5555 6.66656V2.44434H9.33326M13.5555 2.44434L7.99993 7.99989M13.5555 9.33324V13.5555C13.5555 13.5555 12.7599 13.5555 11.7777 13.5555H2.44438C2.44438 13.5555 2.44438 12.7599 2.44438 11.7777V4.22213C2.44438 3.2399 2.44434 2.44435 2.44434 2.44435H6.66661" stroke="currentColor"/>`,
|
|
196
|
+
},
|
|
197
|
+
"outline-arrow-to-corner-top-right": {
|
|
198
|
+
viewBox: "0 0 16 16",
|
|
199
|
+
body: `<path d="M2 8.5V2H14V14H8M5 5.66667H10.3333V11M3.66797 12.333L9.94292 6.05806" stroke="currentColor" stroke-linecap="square"/>`,
|
|
200
|
+
},
|
|
201
|
+
"outline-hexagonal-warning": {
|
|
202
|
+
viewBox: "0 0 16 16",
|
|
203
|
+
body: `<path d="M10.6667 1.33325H5.33272L1.33334 5.33325L1.33342 10.6917L5.3327 14.691L10.6667 14.6909L14.6911 10.6917V5.33255L10.6667 1.33325Z" stroke="currentColor"/><path d="M8 10.6667H8.00667" stroke="currentColor" stroke-linecap="square"/><path d="M8 7.99992V5.33325" stroke="currentColor" stroke-linecap="square"/>`,
|
|
204
|
+
},
|
|
205
|
+
"outline-share": {
|
|
206
|
+
viewBox: "0 0 16 16",
|
|
207
|
+
body: `<path d="M13.5554 10.4445V13.5556C13.5554 13.5556 12.7599 13.5556 11.7777 13.5556H4.22211C3.23989 13.5556 2.44434 13.5556 2.44434 13.5556V10.4445M4.88878 5.55557L7.99989 2.44446L11.111 5.55557M7.99989 2.44446L7.99989 9.11112" stroke="currentColor"/>`,
|
|
208
|
+
},
|
|
209
|
+
"outline-eye": {
|
|
210
|
+
viewBox: "0 0 20 20",
|
|
211
|
+
body: `<path d="M2.5 10s3.33-5.42 7.5-5.42S17.5 10 17.5 10s-3.33 5.42-7.5 5.42S2.5 10 2.5 10Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><circle cx="10" cy="10" r="2.5" stroke="currentColor"/>`,
|
|
212
|
+
},
|
|
213
|
+
"outline-eye-slash": {
|
|
214
|
+
viewBox: "0 0 20 20",
|
|
215
|
+
body: `<path d="M2.5 10s3.33-5.42 7.5-5.42S17.5 10 17.5 10s-3.33 5.42-7.5 5.42S2.5 10 2.5 10Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><circle cx="10" cy="10" r="2.5" stroke="currentColor"/><path d="M3 3 17 17" stroke="currentColor" stroke-linecap="round"/>`,
|
|
216
|
+
},
|
|
217
|
+
refresh: {
|
|
218
|
+
viewBox: "0 0 20 20",
|
|
219
|
+
body: `<path d="M16.25 7.5A6.5 6.5 0 1 0 16.5 11M16.25 3.5v4h-4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>`,
|
|
220
|
+
},
|
|
221
|
+
reset: {
|
|
222
|
+
viewBox: "0 0 20 20",
|
|
223
|
+
body: `<path d="M5.83333 4.16406L2.5 7.4974L5.83333 10.8307M3.33333 7.4974H17.9167V15.4141H10" stroke="currentColor" stroke-linecap="square"/>`,
|
|
224
|
+
},
|
|
225
|
+
"outline-reset": {
|
|
226
|
+
viewBox: "0 0 20 20",
|
|
227
|
+
body: `<path d="M5.83333 4.16406L2.5 7.4974L5.83333 10.8307M3.33333 7.4974H17.9167V15.4141H10" stroke="currentColor" stroke-linecap="square"/>`,
|
|
228
|
+
},
|
|
229
|
+
"fill-triangle-down": {
|
|
230
|
+
viewBox: "0 0 16 16",
|
|
231
|
+
body: `<path d="M5.37624 6.75194C5.18184 6.41861 5.42224 6 5.80814 6H10.1921C10.578 6 10.8184 6.41861 10.624 6.75194L8.43203 10.5096C8.23909 10.8404 7.76119 10.8404 7.56825 10.5096L5.37624 6.75194Z" fill="currentColor"/>`,
|
|
232
|
+
},
|
|
233
|
+
archive: {
|
|
234
|
+
viewBox: "0 0 16 16",
|
|
235
|
+
body: `<path d="M13.1112 13.5555V14.0555H13.6112V13.5555H13.1112ZM2.889 13.5555H2.389L2.389 14.0555H2.889V13.5555ZM3.38901 5.55546L3.38901 5.05546L2.38901 5.05546L2.38901 5.55546L2.88901 5.55546L3.38901 5.55546ZM14.4446 2.44434H14.9446V1.94434L14.4446 1.94434L14.4446 2.44434ZM14.4446 5.55545L14.4446 6.05545L14.9446 6.05545V5.55545H14.4446ZM1.55566 5.55546L1.05566 5.55545L1.05566 6.05546L1.55566 6.05546L1.55566 5.55546ZM1.5557 2.44436L1.5557 1.94436L1.05571 1.94436L1.0557 2.44435L1.5557 2.44436ZM13.1112 5.55546H12.6112V13.5555H13.1112H13.6112V5.55546H13.1112ZM2.889 13.5555H3.389L3.38901 5.55546L2.88901 5.55546L2.38901 5.55546L2.389 13.5555H2.889ZM14.4446 2.44434H13.9446V5.55545H14.4446H14.9446V2.44434H14.4446ZM1.55566 5.55546L2.05566 5.55547L2.0557 2.44436L1.5557 2.44436L1.0557 2.44435L1.05566 5.55545L1.55566 5.55546ZM6.22234 8.22213V8.72213H9.7779V8.22213V7.72213H6.22234V8.22213ZM13.1112 13.5555V13.0555H2.889V13.5555V14.0555H13.1112V13.5555ZM1.5557 2.44436L1.5557 2.94436L14.4446 2.94434L14.4446 2.44434L14.4446 1.94434L1.5557 1.94436L1.5557 2.44436ZM14.4446 5.55545L14.4446 5.05545L1.55566 5.05546L1.55566 5.55546L1.55566 6.05546L14.4446 6.05545L14.4446 5.55545Z" fill="currentColor"/>`,
|
|
236
|
+
},
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/** Icon names derived from the shared artwork, with no UI or runtime dependencies. */
|
|
240
|
+
export type IconName = keyof typeof icons | keyof typeof additionalIcons
|
|
241
|
+
|
|
242
|
+
/** The artwork catalog's names, in sprite order. */
|
|
243
|
+
export function iconNames() {
|
|
244
|
+
// SAFETY: every key comes from one of the two artwork records that define IconName.
|
|
245
|
+
return Array.from(new Set([...Object.keys(additionalIcons), ...Object.keys(icons)])) as IconName[]
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Narrows a name against the shared artwork catalog.
|
|
250
|
+
* @param name - A name supplied by a caller, including names unknown to this build.
|
|
251
|
+
*/
|
|
252
|
+
export function isIconName(name: string): name is IconName {
|
|
253
|
+
return Object.hasOwn(icons, name) || Object.hasOwn(additionalIcons, name)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The SVG body and viewport for a known catalog name, with primary artwork taking precedence.
|
|
258
|
+
* @param name - A name validated by the type or by `isIconName`.
|
|
259
|
+
*/
|
|
260
|
+
export function getIcon(name: IconName) {
|
|
261
|
+
// SAFETY: IconName is the union of both catalogs' keys; an absent primary entry falls back to additional artwork.
|
|
262
|
+
const icon = icons[name as keyof typeof icons]
|
|
263
|
+
|
|
264
|
+
if (icon) return icon
|
|
265
|
+
// SAFETY: the primary lookup ruled out its entries, so the remaining name belongs to additionalIcons.
|
|
266
|
+
const key = name as keyof typeof additionalIcons
|
|
267
|
+
|
|
268
|
+
return { body: additionalIcons[key], viewBox: additionalIconViewBox(key) }
|
|
269
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Additional UI artwork, independent of a renderer. */
|
|
1
2
|
export const additionalIcons = {
|
|
2
3
|
"align-right": `<path d="M12.292 6.04167L16.2503 9.99998L12.292 13.9583M2.91699 9.99998H15.6253M17.0837 3.75V16.25" stroke="currentColor" stroke-linecap="square"/>`,
|
|
3
4
|
"arrow-up": `<path fill-rule="evenodd" clip-rule="evenodd" d="M9.99991 2.24121L16.0921 8.33343L15.2083 9.21731L10.6249 4.63397V17.5001H9.37492V4.63398L4.7916 9.21731L3.90771 8.33343L9.99991 2.24121Z" fill="currentColor"/>`,
|
package/src/icons/icon/icon.tsx
CHANGED
|
@@ -1,270 +1,30 @@
|
|
|
1
1
|
import { onMount, type ComponentProps, splitProps } from "solid-js"
|
|
2
|
-
import {
|
|
2
|
+
import { iconNames, isIconName, getIcon, type IconName } from "../catalog"
|
|
3
3
|
import "./icon.css"
|
|
4
4
|
|
|
5
|
-
// Consumers center the SVG viewport, so each icon must center its artwork within its viewBox.
|
|
6
|
-
const icons = {
|
|
7
|
-
lock: {
|
|
8
|
-
viewBox: "0 0 16 16",
|
|
9
|
-
body: `<rect x="3.5" y="7" width="9" height="7" rx="1" stroke="currentColor"/><path d="M5 7V5a3 3 0 0 1 6 0v2M8 10v1" stroke="currentColor" stroke-linecap="round"/>`,
|
|
10
|
-
},
|
|
11
|
-
globe: {
|
|
12
|
-
viewBox: "0 0 16 16",
|
|
13
|
-
body: `<circle cx="8" cy="8" r="6" stroke="currentColor"/><ellipse cx="8" cy="8" rx="2.5" ry="6" stroke="currentColor"/><path d="M2 8h12" stroke="currentColor"/>`,
|
|
14
|
-
},
|
|
15
|
-
"select-element": {
|
|
16
|
-
viewBox: "0 0 16 16",
|
|
17
|
-
body: `<path d="M12.5 6.5V2.5C12.5 1.94772 12.0523 1.5 11.5 1.5H2.5C1.94772 1.5 1.5 1.94772 1.5 2.5V11.5C1.5 12.0523 1.94772 12.5 2.5 12.5H6.5" stroke="currentColor" stroke-linecap="round"/><path d="M7.5 7.5L14.5 10.1L11.1 11.1L10.1 14.5L7.5 7.5Z" stroke="currentColor" stroke-linejoin="round"/>`,
|
|
18
|
-
},
|
|
19
|
-
flask: {
|
|
20
|
-
viewBox: "0 0 16 16",
|
|
21
|
-
body: `<path d="M5.5 2H10.5M6 2V6L2.5 12C2 13 2.5 14 3.5 14H12.5C13.5 14 14 13 13.5 12L10 6V2M4.25 9H11.75" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>`,
|
|
22
|
-
},
|
|
23
|
-
edit: {
|
|
24
|
-
viewBox: "0 0 16 16",
|
|
25
|
-
body: `<path d="M13.5556 8.21529V13.5556H2.44446L2.44446 2.44445H7.78474M6.00002 8.16216V10H7.83786L14 3.83784L12.1622 2L6.00002 8.16216Z" stroke="currentColor"/>`,
|
|
26
|
-
},
|
|
27
|
-
"folder-add-left": {
|
|
28
|
-
viewBox: "0 0 16 16",
|
|
29
|
-
body: `<path d="M7.5 13.3333H1.5V2H6.83333L8.83333 4H14.8333V6M10.1667 11.3333H15.5M12.8333 8.66667V14" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`,
|
|
30
|
-
},
|
|
31
|
-
folder: {
|
|
32
|
-
viewBox: "0 0 16 16",
|
|
33
|
-
body: `<path d="M1.33337 2V13.3333H14.6667V4H8.66671L6.66671 2H1.33337Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`,
|
|
34
|
-
},
|
|
35
|
-
branch: {
|
|
36
|
-
viewBox: "0 0 16 16",
|
|
37
|
-
body: `<path d="M5.118 5.686V10.314M5.118 5.686C5.97 5.686 6.661 4.995 6.661 4.143C6.661 3.291 5.97 2.6 5.118 2.6C4.266 2.6 3.575 3.291 3.575 4.143C3.575 4.995 4.266 5.686 5.118 5.686ZM5.118 10.314C4.266 10.314 3.575 11.005 3.575 11.857C3.575 12.709 4.266 13.4 5.118 13.4C5.97 13.4 6.661 12.709 6.661 11.857M5.118 10.314C5.97 10.314 6.661 11.005 6.661 11.857M10.882 5.686C11.734 5.686 12.425 4.995 12.425 4.143C12.425 3.291 11.734 2.6 10.882 2.6C10.03 2.6 9.339 3.291 9.339 4.143C9.339 4.995 10.03 5.686 10.882 5.686ZM10.882 5.686V9.457C10.882 10.783 9.807 11.857 8.482 11.857H6.661" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>`,
|
|
38
|
-
},
|
|
39
|
-
"branch-out": {
|
|
40
|
-
viewBox: "0 0 16 16",
|
|
41
|
-
body: `<path d="M10.4225 3.35355L12.9024 5.83344L10.4225 8.31333" stroke="currentColor"/><path d="M1 12.2852H4.23042C4.89912 12.2852 5.52359 11.951 5.89452 11.3946L9.00783 6.72462C8.37877 6.16823 10.0032 5.83402 10.6719 5.83402H12.9024" stroke="currentColor"/><path d="M8.5 12.2852H14" stroke="currentColor" stroke-linejoin="round"/>`,
|
|
42
|
-
},
|
|
43
|
-
"grid-plus": {
|
|
44
|
-
viewBox: "0 0 16 16",
|
|
45
|
-
body: `<path d="M13.9948 11.668H9.32812M11.6641 9.33203V13.9987M6.66667 9.33203V13.9987H2V9.33203H6.66667ZM6.66667 2V6.66667H2V2H6.66667ZM13.9948 2V6.66667H9.32812V2H13.9948Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`,
|
|
46
|
-
},
|
|
47
|
-
help: {
|
|
48
|
-
viewBox: "0 0 16 16",
|
|
49
|
-
body: `<path d="M6.33345 6.33349V5.00015H9.66679V7.00015L8.00015 8.00015V9.66679M8.27485 11.6819H7.71897M14.4446 8.00011C14.4446 11.5593 11.5593 14.4446 8.00011 14.4446C4.44094 14.4446 1.55566 11.5593 1.55566 8.00011C1.55566 4.44094 4.44094 1.55566 8.00011 1.55566C11.5593 1.55566 14.4446 4.44094 14.4446 8.00011Z" stroke="currentColor" stroke-linecap="square"/>`,
|
|
50
|
-
},
|
|
51
|
-
info: {
|
|
52
|
-
viewBox: "0 0 16 16",
|
|
53
|
-
body: `<g transform="translate(2 2)"><path d="M12 12H0V0H12V12ZM1 1V11H11V1H1ZM6.5791 4.81641V9.37207H5.5791V5.81641H4.46777V4.81641H6.5791ZM6.85645 2.62891V3.62891H5.30078V2.62891H6.85645Z" fill="currentColor"/></g>`,
|
|
54
|
-
},
|
|
55
|
-
"circle-exclamation": {
|
|
56
|
-
viewBox: "0 0 16 16",
|
|
57
|
-
body: `<path d="M8.75 11.75H7.25V10.25H8.75V11.75Z" fill="currentColor"/><path d="M8.75 9.25H7.25V4.25H8.75V9.25Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 1C9.93286 1 11.684 1.7836 12.9502 3.0498C14.2164 4.31601 15 6.06714 15 8C15 11.866 11.866 15 8 15C6.06714 15 4.31601 14.2164 3.0498 12.9502C1.7836 11.684 1 9.93286 1 8C1 4.13401 4.13401 1 8 1ZM8 2C4.68629 2 2 4.68629 2 8C2 9.65699 2.67148 11.1559 3.75781 12.2422C4.84415 13.3285 6.34301 14 8 14C11.3137 14 14 11.3137 14 8C14 6.34301 13.3285 4.84415 12.2422 3.75781C11.1559 2.67148 9.65699 2 8 2Z" fill="currentColor"/>`,
|
|
58
|
-
},
|
|
59
|
-
"circle-xmark": {
|
|
60
|
-
viewBox: "0 0 16 16",
|
|
61
|
-
body: `<path fill-rule="evenodd" clip-rule="evenodd" d="M1.33334 8.00016C1.33334 4.31826 4.31811 1.3335 8.00001 1.3335C11.6819 1.3335 14.6667 4.31826 14.6667 8.00016C14.6667 11.6821 11.6819 14.6668 8.00001 14.6668C4.31811 14.6668 1.33334 11.6821 1.33334 8.00016ZM6.00001 5.29306L5.2929 6.00016L7.2929 8.00016L5.2929 10.0002L6.00001 10.7073L8.00001 8.70727L10 10.7073L10.7071 10.0002L8.70712 8.00016L10.7071 6.00016L10 5.29306L8.00001 7.29306L6.00001 5.29306Z" fill="currentColor"/>`,
|
|
62
|
-
},
|
|
63
|
-
"sidebar-right": {
|
|
64
|
-
viewBox: "0 0 20 20",
|
|
65
|
-
body: `<path d="M2.91536 2.91406H2.36536V2.36406H2.91536V2.91406ZM2.91536 17.0807V17.6307H2.36536V17.0807H2.91536ZM17.082 17.0807H17.632V17.6307H17.082V17.0807ZM17.082 2.91406V2.36406H17.632V2.91406H17.082ZM6.9987 2.91406H6.4487V2.36406H6.9987V2.91406ZM6.9987 17.0807V17.6307H6.4487V17.0807H6.9987ZM2.91536 2.91406H3.46536V17.0807H2.91536H2.36536V2.91406H2.91536ZM2.91536 17.0807V16.5307H17.082V17.0807V17.6307H2.91536V17.0807ZM17.082 17.0807H16.532V2.91406H17.082H17.632V17.0807H17.082ZM17.082 2.91406V3.46406H2.91536V2.91406V2.36406H17.082V2.91406ZM6.9987 2.91406H7.5487V17.0807H6.9987H6.4487V2.91406H6.9987ZM17.082 17.0807L17.082 17.6307L6.9987 17.6307V17.0807V16.5307L17.082 16.5307L17.082 17.0807ZM6.9987 2.91406V2.36406H17.082V2.91406V3.46406H6.9987V2.91406Z" fill="currentColor"/>`,
|
|
66
|
-
},
|
|
67
|
-
status: {
|
|
68
|
-
viewBox: "0 0 20 20",
|
|
69
|
-
body: `<path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`,
|
|
70
|
-
},
|
|
71
|
-
"status-active": {
|
|
72
|
-
viewBox: "0 0 20 20",
|
|
73
|
-
body: `<path d="M18 2H2V10H18V2Z" fill="currentColor" fill-opacity="0.1"/><path d="M2 18H18V10H2V18Z" fill="currentColor" fill-opacity="0.1"/><path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`,
|
|
74
|
-
},
|
|
75
|
-
"magnifying-glass": {
|
|
76
|
-
viewBox: "0 0 16 16",
|
|
77
|
-
body: `<path d="M14 14L10.3454 10.3454M6.88889 11.7778C9.58889 11.7778 11.7778 9.58889 11.7778 6.88889C11.7778 4.18889 9.58889 2 6.88889 2C4.18889 2 2 4.18889 2 6.88889C2 9.58889 4.18889 11.7778 6.88889 11.7778Z" stroke="currentColor"/>`,
|
|
78
|
-
},
|
|
79
|
-
menu: {
|
|
80
|
-
viewBox: "0 0 16 16",
|
|
81
|
-
body: `<path d="M2 8H14M2 4.664H14M2 11.336H14" stroke="currentColor"/>`,
|
|
82
|
-
},
|
|
83
|
-
plus: {
|
|
84
|
-
viewBox: "0 0 16 16",
|
|
85
|
-
body: `<path d="M8 2.88867V13.1109" stroke="currentColor" stroke-linejoin="round"/><path d="M2.88867 8H13.1109" stroke="currentColor" stroke-linejoin="round"/>`,
|
|
86
|
-
},
|
|
87
|
-
"settings-gear": {
|
|
88
|
-
viewBox: "0 0 16 16",
|
|
89
|
-
body: `<path d="M7.99998 1.3335L14 4.66683V11.3335L7.99998 14.6668L2 11.3335V4.66683L7.99998 1.3335Z" stroke="currentColor"/><path d="M9.99998 8.00016C9.99998 9.10476 9.10458 10.0002 7.99998 10.0002C6.89538 10.0002 5.99998 9.10476 5.99998 8.00016C5.99998 6.89556 6.89538 6.00016 7.99998 6.00016C9.10458 6.00016 9.99998 6.89556 9.99998 8.00016Z" stroke="currentColor"/>`,
|
|
90
|
-
},
|
|
91
|
-
"chevron-down": {
|
|
92
|
-
viewBox: "0 0 16 16",
|
|
93
|
-
body: `<path d="M5 6.5L8 9.5L11 6.5" stroke="currentColor"/>`,
|
|
94
|
-
},
|
|
95
|
-
collapse: {
|
|
96
|
-
viewBox: "0 0 16 16",
|
|
97
|
-
body: `<path d="M8 1V6M11 3L8 6L5 3" stroke="currentColor"/><path d="M8 15V10M11 13L8 10L5 13" stroke="currentColor"/><path d="M4 8H6" stroke="currentColor"/><path d="M7 8H9" stroke="currentColor"/><path d="M10 8H12" stroke="currentColor"/>`,
|
|
98
|
-
},
|
|
99
|
-
check: {
|
|
100
|
-
viewBox: "0 0 16 16",
|
|
101
|
-
body: `<path d="M3.53613 8.17857L6.39328 11.75L12.4647 4.25" stroke="currentColor"/>`,
|
|
102
|
-
},
|
|
103
|
-
monitor: {
|
|
104
|
-
viewBox: "0 0 16 16",
|
|
105
|
-
body: `<path d="M4.05559 9.38889H0.500007C0.500007 9.38889 0.500017 8.59298 0.500017 7.61112V2.27778C0.500017 1.29594 0.500102 0.5 0.500102 0.5H13.3889C13.3889 0.5 13.3889 1.29594 13.3889 2.27778V7.61112C13.3889 8.59298 13.3889 9.38889 13.3889 9.38889H9.83336M4.05559 9.38889V11.6111H6.94448H9.83336V9.38889M4.05559 9.38889H9.83336" transform="translate(1.05556 1.94444)" stroke="currentColor"/>`,
|
|
106
|
-
},
|
|
107
|
-
"workspace-new": {
|
|
108
|
-
viewBox: "0 0 16 16",
|
|
109
|
-
body: `<path d="M2 10.7578V14.0011H5.24324M13.9991 5.24324V2H10.7559M13.9991 10.7578V14.0011H10.7559M2 5.24324V2H5.24324" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/><path d="M8 4.5V11.5M4.5 8H11.5" stroke="currentColor" stroke-linejoin="round"/>`,
|
|
110
|
-
},
|
|
111
|
-
"workspace-isolated": {
|
|
112
|
-
viewBox: "0 0 16 16",
|
|
113
|
-
body: `<path d="M10.5 10.5V5.5H5.5V10.5H10.5Z" fill="currentColor"/><rect x="2.5" y="2.5" width="11" height="11" stroke="currentColor"/>`,
|
|
114
|
-
},
|
|
115
|
-
workspace: {
|
|
116
|
-
viewBox: "0 0 16 16",
|
|
117
|
-
body: `<path d="M2 10.668V14.0013H10.6667M13.9974 10.6667V2H2.66406M13.9974 10.668V14.0013H10.6641M2 10V2H5.33333" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/><path d="M10.6693 10.6654V5.33203H5.33594V10.6654H10.6693Z" fill="currentColor"/>`,
|
|
118
|
-
},
|
|
119
|
-
"outline-worktree": {
|
|
120
|
-
viewBox: "0 0 16 16",
|
|
121
|
-
body: `<path d="M12 3.11133L14.3885 5.49977L12 7.88822M14.5 5.49972H10.058L5.13456 11.8139M14.5 11.6606L8.5 11.6606M5.50012 11.6597H1.5" stroke="currentColor"/>`,
|
|
122
|
-
},
|
|
123
|
-
"outline-trash": {
|
|
124
|
-
viewBox: "0 0 16 16",
|
|
125
|
-
body: `<path d="M2.44434 4.22224H13.5554M5.99994 4.22224V2.44446C5.99994 1.95557 5.99992 1.55557 5.99992 1.55557H9.99989C9.99989 1.55557 9.99994 1.95557 9.99994 2.44446V4.22224M6.55545 7.77779L6.7485 11.7778M9.44437 7.77779L9.2513 11.7778M12.1756 6.88891L11.8666 12.7556C11.8168 13.7068 11.7748 14.4445 11.7748 14.4445H4.22511C4.22511 14.4445 4.18392 13.7067 4.13414 12.7556L3.82509 6.88891" stroke="currentColor"/>`,
|
|
126
|
-
},
|
|
127
|
-
close: {
|
|
128
|
-
viewBox: "0 0 20 20",
|
|
129
|
-
body: `<path d="M14.4446 5.55566L5.55566 14.4446M5.55566 5.55566L14.4446 14.4446" stroke="currentColor" stroke-linejoin="round"/>`,
|
|
130
|
-
},
|
|
131
|
-
"xmark-small": {
|
|
132
|
-
viewBox: "0 0 16 16",
|
|
133
|
-
body: `<path d="M4.25 11.75L11.75 4.25M11.75 11.75L4.25 4.25" stroke="currentColor"/>`,
|
|
134
|
-
},
|
|
135
|
-
"outline-xmark": {
|
|
136
|
-
viewBox: "0 0 16 16",
|
|
137
|
-
body: `<path fill-rule="evenodd" clip-rule="evenodd" d="M4.99487 5.70186L7.29297 7.99995L4.99487 10.2981L5.70198 11.0052L8.00008 8.70706L10.2982 11.0052L11.0053 10.2981L8.70718 7.99995L11.0053 5.70186L10.2982 4.99475L8.00008 7.29285L5.70198 4.99475L4.99487 5.70186Z" fill="currentColor"/>`,
|
|
138
|
-
},
|
|
139
|
-
"outline-chevron-down": {
|
|
140
|
-
viewBox: "0 0 16 16",
|
|
141
|
-
body: `<path d="M5 6.5L8 9.5L11 6.5" stroke="currentColor"/>`,
|
|
142
|
-
},
|
|
143
|
-
"outline-dots": {
|
|
144
|
-
viewBox: "0 0 16 16",
|
|
145
|
-
body: `<path d="M2.5 7.5H3.5V8.5H2.5V7.5Z" stroke="currentColor"/><path d="M7.5 7.5H8.5V8.5H7.5V7.5Z" stroke="currentColor"/><path d="M12.5 7.5H13.5V8.5H12.5V7.5Z" stroke="currentColor"/>`,
|
|
146
|
-
},
|
|
147
|
-
expand: {
|
|
148
|
-
viewBox: "0 0 16 16",
|
|
149
|
-
body: `<path d="M8.25 6.17773V1.17773M11.25 4.17773L8.25 1.17773L5.25 4.17773" stroke="currentColor"/><path d="M8.25 9.17773V14.1777M11.25 11.1777L8.25 14.1777L5.25 11.1777" stroke="currentColor"/><path d="M4.25 7.67773H12.25" stroke="currentColor"/>`,
|
|
150
|
-
},
|
|
151
|
-
filetree: {
|
|
152
|
-
viewBox: "0 0 16 16",
|
|
153
|
-
body: `<path d="M2.5 1.5V12.2484H6.75M2.5 4.74838H6.75" stroke="currentColor"/><rect x="8.5" y="3.2168" width="6" height="3" fill="none" stroke="currentColor"/><rect x="8.5" y="10.75" width="6" height="3" fill="none" stroke="currentColor"/>`,
|
|
154
|
-
},
|
|
155
|
-
split: {
|
|
156
|
-
viewBox: "0 0 16 16",
|
|
157
|
-
body: `<path d="M1 14H15L15 2H1V14Z" stroke="currentColor"/><rect x="3" y="4" width="4" height="8" fill="currentColor" fill-opacity="0.5"/><rect x="9" y="4" width="4" height="8" fill="currentColor" fill-opacity="0.5"/>`,
|
|
158
|
-
},
|
|
159
|
-
unified: {
|
|
160
|
-
viewBox: "0 0 16 16",
|
|
161
|
-
body: `<path d="M3.00001 4.00045L12.9998 4L13 6.99955L3 7L3.00001 4.00045Z" fill="currentColor" fill-opacity="0.5"/><path d="M3.0001 9H13L12.9999 12H3L3.0001 9Z" fill="currentColor" fill-opacity="0.5"/><path d="M1 14H15L15 2H1V14Z" stroke="currentColor"/>`,
|
|
162
|
-
},
|
|
163
|
-
review: {
|
|
164
|
-
viewBox: "0 0 20 20",
|
|
165
|
-
body: `<path d="M7 14.5H13M7 7.99512H10.0049M10.0049 7.99512H13M10.0049 7.99512V5M10.0049 7.99512V11M18 18V2L2 2L2 18H18Z" stroke="currentColor"/>`,
|
|
166
|
-
},
|
|
167
|
-
"window-analytics": {
|
|
168
|
-
viewBox: "0 0 16 16",
|
|
169
|
-
body: `<path d="M14.5 9.8333V13.5H1.5V2.5H7.1667M9.5 2.5V7.5H14.5V2.5H9.5Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`,
|
|
170
|
-
},
|
|
171
|
-
"graduation-cap": {
|
|
172
|
-
viewBox: "0 0 16 16",
|
|
173
|
-
body: `<path d="M12.3327 7.50065V11.0007L7.99935 13.6673L3.66602 11.0007V7.50065M14.3327 9.83398V6.16732M7.99935 2.33398L1.66602 6.00065L7.99935 10.0007L14.3327 6.00065L7.99935 2.33398Z" stroke="currentColor" stroke-linecap="square"/>`,
|
|
174
|
-
},
|
|
175
|
-
"code-slash": {
|
|
176
|
-
viewBox: "0 0 16 16",
|
|
177
|
-
body: `<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0812 2.10803L6.55974 14.0809L5.92016 13.8928L9.44161 1.91992L10.0812 2.10803ZM4.13793 4.97275L1.44666 8.00045L4.13793 11.0281L3.63966 11.471L0.554688 8.00045L3.63966 4.52984L4.13793 4.97275ZM12.3617 4.52984L15.4467 8.00045L12.3617 11.471L11.8634 11.0281L14.5547 8.00045L11.8634 4.97275L12.3617 4.52984Z" fill="currentColor"/>`,
|
|
178
|
-
},
|
|
179
|
-
trash: {
|
|
180
|
-
viewBox: "0 0 20 20",
|
|
181
|
-
body: `<path d="M4.58342 17.9134L4.58369 17.4134L4.22787 17.5384L4.22766 18.0384H4.58342V17.9134ZM15.4167 17.9134V18.0384H15.7725L15.7723 17.5384L15.4167 17.9134ZM2.08342 3.95508V3.45508H1.58342V3.95508H2.08342V4.45508V3.95508ZM17.9167 4.45508V4.95508H18.4167V4.45508H17.9167V3.95508V4.45508ZM4.16677 4.58008L3.66701 4.5996L4.22816 17.5379L4.72792 17.4934L5.22767 17.4489L4.66652 4.54055L4.16677 4.58008ZM4.58342 18.0384V17.9134H15.4167V18.0384V18.5384H4.58342V18.0384ZM15.4167 17.9134L15.8332 17.5379L16.2498 4.5996L15.7501 4.58008L15.2503 4.56055L14.8337 17.4989L15.4167 17.9134ZM15.8334 4.58008V4.08008H4.16677V4.58008V5.08008H15.8334V4.58008ZM2.08342 4.45508V4.95508H4.16677V4.58008V4.08008H2.08342V4.45508ZM15.8334 4.58008V5.08008H17.9167V4.45508V3.95508H15.8334V4.58008ZM6.83951 4.35149L7.432 4.55047C7.79251 3.47701 8.80699 2.70508 10.0001 2.70508V2.20508V1.70508C8.25392 1.70508 6.77335 2.83539 6.24702 4.15251L6.83951 4.35149ZM10.0001 2.20508V2.70508C11.1932 2.70508 12.2077 3.47701 12.5682 4.55047L13.1607 4.35149L13.7532 4.15251C13.2269 2.83539 11.7463 1.70508 10.0001 1.70508V2.20508Z" fill="currentColor"/>`,
|
|
182
|
-
},
|
|
183
|
-
"outline-sliders": {
|
|
184
|
-
viewBox: "0 0 16 16",
|
|
185
|
-
body: `<path d="M11.7779 4.66675H14.4446M11.7779 4.66675C11.7779 5.77132 10.8825 6.66675 9.77789 6.66675C8.67332 6.66675 7.77789 5.77132 7.77789 4.66675M11.7779 4.66675C11.7779 3.56218 10.8825 2.66675 9.77789 2.66675C8.67332 2.66675 7.77789 3.56218 7.77789 4.66675M1.55566 4.66675H7.77789M4.22233 11.3334H1.55566M4.22233 11.3334C4.22233 12.438 5.11776 13.3334 6.22233 13.3334C7.3269 13.3334 8.22233 12.438 8.22233 11.3334M4.22233 11.3334C4.22233 10.2288 5.11776 9.33341 6.22233 9.33341C7.3269 9.33341 8.22233 10.2288 8.22233 11.3334M14.4446 11.3334H8.22233" stroke="currentColor"/>`,
|
|
186
|
-
},
|
|
187
|
-
"outline-copy": {
|
|
188
|
-
viewBox: "0 0 16 16",
|
|
189
|
-
body: `<path d="M4.14908 11.0081H1.76282V1.51758H9.1038V2.55588M14.2225 4.99681H6.75397V14.4873H14.2225V4.99681Z" stroke="currentColor"/>`,
|
|
190
|
-
},
|
|
191
|
-
"arrow-up-right": {
|
|
192
|
-
viewBox: "0 0 16 16",
|
|
193
|
-
body: `<path d="M11 9.56V5H6.44M11 5L5 11" stroke="currentColor"/>`,
|
|
194
|
-
},
|
|
195
|
-
"outline-square-arrow": {
|
|
196
|
-
viewBox: "0 0 16 16",
|
|
197
|
-
body: `<path d="M13.5555 6.66656V2.44434H9.33326M13.5555 2.44434L7.99993 7.99989M13.5555 9.33324V13.5555C13.5555 13.5555 12.7599 13.5555 11.7777 13.5555H2.44438C2.44438 13.5555 2.44438 12.7599 2.44438 11.7777V4.22213C2.44438 3.2399 2.44434 2.44435 2.44434 2.44435H6.66661" stroke="currentColor"/>`,
|
|
198
|
-
},
|
|
199
|
-
"outline-arrow-to-corner-top-right": {
|
|
200
|
-
viewBox: "0 0 16 16",
|
|
201
|
-
body: `<path d="M2 8.5V2H14V14H8M5 5.66667H10.3333V11M3.66797 12.333L9.94292 6.05806" stroke="currentColor" stroke-linecap="square"/>`,
|
|
202
|
-
},
|
|
203
|
-
"outline-hexagonal-warning": {
|
|
204
|
-
viewBox: "0 0 16 16",
|
|
205
|
-
body: `<path d="M10.6667 1.33325H5.33272L1.33334 5.33325L1.33342 10.6917L5.3327 14.691L10.6667 14.6909L14.6911 10.6917V5.33255L10.6667 1.33325Z" stroke="currentColor"/><path d="M8 10.6667H8.00667" stroke="currentColor" stroke-linecap="square"/><path d="M8 7.99992V5.33325" stroke="currentColor" stroke-linecap="square"/>`,
|
|
206
|
-
},
|
|
207
|
-
"outline-share": {
|
|
208
|
-
viewBox: "0 0 16 16",
|
|
209
|
-
body: `<path d="M13.5554 10.4445V13.5556C13.5554 13.5556 12.7599 13.5556 11.7777 13.5556H4.22211C3.23989 13.5556 2.44434 13.5556 2.44434 13.5556V10.4445M4.88878 5.55557L7.99989 2.44446L11.111 5.55557M7.99989 2.44446L7.99989 9.11112" stroke="currentColor"/>`,
|
|
210
|
-
},
|
|
211
|
-
"outline-eye": {
|
|
212
|
-
viewBox: "0 0 20 20",
|
|
213
|
-
body: `<path d="M2.5 10s3.33-5.42 7.5-5.42S17.5 10 17.5 10s-3.33 5.42-7.5 5.42S2.5 10 2.5 10Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><circle cx="10" cy="10" r="2.5" stroke="currentColor"/>`,
|
|
214
|
-
},
|
|
215
|
-
"outline-eye-slash": {
|
|
216
|
-
viewBox: "0 0 20 20",
|
|
217
|
-
body: `<path d="M2.5 10s3.33-5.42 7.5-5.42S17.5 10 17.5 10s-3.33 5.42-7.5 5.42S2.5 10 2.5 10Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><circle cx="10" cy="10" r="2.5" stroke="currentColor"/><path d="M3 3 17 17" stroke="currentColor" stroke-linecap="round"/>`,
|
|
218
|
-
},
|
|
219
|
-
refresh: {
|
|
220
|
-
viewBox: "0 0 20 20",
|
|
221
|
-
body: `<path d="M16.25 7.5A6.5 6.5 0 1 0 16.5 11M16.25 3.5v4h-4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>`,
|
|
222
|
-
},
|
|
223
|
-
reset: {
|
|
224
|
-
viewBox: "0 0 20 20",
|
|
225
|
-
body: `<path d="M5.83333 4.16406L2.5 7.4974L5.83333 10.8307M3.33333 7.4974H17.9167V15.4141H10" stroke="currentColor" stroke-linecap="square"/>`,
|
|
226
|
-
},
|
|
227
|
-
"outline-reset": {
|
|
228
|
-
viewBox: "0 0 20 20",
|
|
229
|
-
body: `<path d="M5.83333 4.16406L2.5 7.4974L5.83333 10.8307M3.33333 7.4974H17.9167V15.4141H10" stroke="currentColor" stroke-linecap="square"/>`,
|
|
230
|
-
},
|
|
231
|
-
"fill-triangle-down": {
|
|
232
|
-
viewBox: "0 0 16 16",
|
|
233
|
-
body: `<path d="M5.37624 6.75194C5.18184 6.41861 5.42224 6 5.80814 6H10.1921C10.578 6 10.8184 6.41861 10.624 6.75194L8.43203 10.5096C8.23909 10.8404 7.76119 10.8404 7.56825 10.5096L5.37624 6.75194Z" fill="currentColor"/>`,
|
|
234
|
-
},
|
|
235
|
-
archive: {
|
|
236
|
-
viewBox: "0 0 16 16",
|
|
237
|
-
body: `<path d="M13.1112 13.5555V14.0555H13.6112V13.5555H13.1112ZM2.889 13.5555H2.389L2.389 14.0555H2.889V13.5555ZM3.38901 5.55546L3.38901 5.05546L2.38901 5.05546L2.38901 5.55546L2.88901 5.55546L3.38901 5.55546ZM14.4446 2.44434H14.9446V1.94434L14.4446 1.94434L14.4446 2.44434ZM14.4446 5.55545L14.4446 6.05545L14.9446 6.05545V5.55545H14.4446ZM1.55566 5.55546L1.05566 5.55545L1.05566 6.05546L1.55566 6.05546L1.55566 5.55546ZM1.5557 2.44436L1.5557 1.94436L1.05571 1.94436L1.0557 2.44435L1.5557 2.44436ZM13.1112 5.55546H12.6112V13.5555H13.1112H13.6112V5.55546H13.1112ZM2.889 13.5555H3.389L3.38901 5.55546L2.88901 5.55546L2.38901 5.55546L2.389 13.5555H2.889ZM14.4446 2.44434H13.9446V5.55545H14.4446H14.9446V2.44434H14.4446ZM1.55566 5.55546L2.05566 5.55547L2.0557 2.44436L1.5557 2.44436L1.0557 2.44435L1.05566 5.55545L1.55566 5.55546ZM6.22234 8.22213V8.72213H9.7779V8.22213V7.72213H6.22234V8.22213ZM13.1112 13.5555V13.0555H2.889V13.5555V14.0555H13.1112V13.5555ZM1.5557 2.44436L1.5557 2.94436L14.4446 2.94434L14.4446 2.44434L14.4446 1.94434L1.5557 1.94436L1.5557 2.44436ZM14.4446 5.55545L14.4446 5.05545L1.55566 5.05546L1.55566 5.55546L1.55566 6.05546L14.4446 6.05545L14.4446 5.55545Z" fill="currentColor"/>`,
|
|
238
|
-
},
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
type IconName = keyof typeof icons | keyof typeof additionalIcons
|
|
242
|
-
|
|
243
5
|
const spriteID = "opencode-v2-icon-sprite"
|
|
6
|
+
|
|
244
7
|
const symbol = (name: IconName) => `opencode-v2-icon-${name}`
|
|
245
|
-
let spriteInserted = false
|
|
246
8
|
|
|
247
|
-
|
|
248
|
-
const icon = icons[name as keyof typeof icons]
|
|
249
|
-
if (icon) return icon
|
|
250
|
-
const body = additionalIcons[name as keyof typeof additionalIcons]
|
|
251
|
-
return { body, viewBox: additionalIconViewBox(name as keyof typeof additionalIcons) }
|
|
252
|
-
}
|
|
9
|
+
let spriteInserted = false
|
|
253
10
|
|
|
254
11
|
function spriteContent() {
|
|
255
|
-
return
|
|
12
|
+
return iconNames()
|
|
256
13
|
.map((name) => `<symbol id="${symbol(name)}" viewBox="${getIcon(name).viewBox}">${getIcon(name).body}</symbol>`)
|
|
257
14
|
.join("")
|
|
258
15
|
}
|
|
259
16
|
|
|
260
17
|
function ensureSprite() {
|
|
261
18
|
if (spriteInserted) return
|
|
19
|
+
|
|
262
20
|
if (typeof document === "undefined") return
|
|
263
21
|
// Hot reload preserves the DOM sprite, but its symbols may be from an older module.
|
|
264
22
|
const existing = document.getElementById(spriteID)
|
|
23
|
+
|
|
265
24
|
if (existing) {
|
|
266
25
|
existing.innerHTML = spriteContent()
|
|
267
26
|
spriteInserted = true
|
|
27
|
+
|
|
268
28
|
return
|
|
269
29
|
}
|
|
270
30
|
|
|
@@ -287,11 +47,11 @@ export interface IconProps extends ComponentProps<"svg"> {
|
|
|
287
47
|
|
|
288
48
|
export function Icon(props: IconProps) {
|
|
289
49
|
const [split, rest] = splitProps(props, ["name", "size"])
|
|
50
|
+
|
|
290
51
|
const iconName = (): IconName => {
|
|
291
|
-
|
|
292
|
-
if (additionalIcons[split.name as keyof typeof additionalIcons]) return split.name as keyof typeof additionalIcons
|
|
293
|
-
return "plus"
|
|
52
|
+
return isIconName(split.name) ? split.name : "plus"
|
|
294
53
|
}
|
|
54
|
+
|
|
295
55
|
const icon = () => getIcon(iconName())
|
|
296
56
|
const pixelSize = split.size === "small" ? 14 : split.size === "large" ? 20 : 16
|
|
297
57
|
onMount(ensureSprite)
|