Open History to see the last commit
1import type { Icon } from "@tabler/icons-react-native/types";
2/*
3 * Keep these as per-icon exports. Importing the package root eagerly registers
4 * the entire Tabler icon set in Metro.
5 */
6import IconAdjustmentsHorizontal from "@tabler/icons-react-native/IconAdjustmentsHorizontal";
7import IconAlignLeft from "@tabler/icons-react-native/IconAlignLeft";
8import IconAlertCircle from "@tabler/icons-react-native/IconAlertCircle";
9import IconAlertTriangle from "@tabler/icons-react-native/IconAlertTriangle";
10import IconApps from "@tabler/icons-react-native/IconApps";
11import IconArchive from "@tabler/icons-react-native/IconArchive";
12import IconCalendarClock from "@tabler/icons-react-native/IconCalendarClock";
13import IconArrowBackUp from "@tabler/icons-react-native/IconArrowBackUp";
14import IconArrowDown from "@tabler/icons-react-native/IconArrowDown";
15import IconArrowForwardUp from "@tabler/icons-react-native/IconArrowForwardUp";
16import IconArrowLeft from "@tabler/icons-react-native/IconArrowLeft";
17import IconArrowRight from "@tabler/icons-react-native/IconArrowRight";
18import IconArrowDownCircle from "@tabler/icons-react-native/IconArrowDownCircle";
19import IconArrowRightCircle from "@tabler/icons-react-native/IconArrowRightCircle";
20import IconArrowUp from "@tabler/icons-react-native/IconArrowUp";
21import IconArrowUpCircle from "@tabler/icons-react-native/IconArrowUpCircle";
22import IconArrowUpRight from "@tabler/icons-react-native/IconArrowUpRight";
23import IconArrowUpRightCircle from "@tabler/icons-react-native/IconArrowUpRightCircle";
24import IconArrowsLeftRight from "@tabler/icons-react-native/IconArrowsLeftRight";
25import IconArrowsDiagonal2 from "@tabler/icons-react-native/IconArrowsDiagonal2";
26import IconArrowsMinimize from "@tabler/icons-react-native/IconArrowsMinimize";
27import IconBan from "@tabler/icons-react-native/IconBan";
28import IconBellRinging from "@tabler/icons-react-native/IconBellRinging";
29import IconBolt from "@tabler/icons-react-native/IconBolt";
30import IconBox from "@tabler/icons-react-native/IconBox";
31import IconBrain from "@tabler/icons-react-native/IconBrain";
32import IconCamera from "@tabler/icons-react-native/IconCamera";
33import IconCar from "@tabler/icons-react-native/IconCar";
34import IconChartBar from "@tabler/icons-react-native/IconChartBar";
35import IconCheck from "@tabler/icons-react-native/IconCheck";
36import IconCloud from "@tabler/icons-react-native/IconCloud";
37import IconChevronDown from "@tabler/icons-react-native/IconChevronDown";
38import IconChevronLeft from "@tabler/icons-react-native/IconChevronLeft";
39import IconChevronRight from "@tabler/icons-react-native/IconChevronRight";
40import IconChevronUp from "@tabler/icons-react-native/IconChevronUp";
41import IconCircle from "@tabler/icons-react-native/IconCircle";
42import IconCircleFilled from "@tabler/icons-react-native/IconCircleFilled";
43import IconCircleCheck from "@tabler/icons-react-native/IconCircleCheck";
44import IconCircleDashed from "@tabler/icons-react-native/IconCircleDashed";
45import IconCircleDot from "@tabler/icons-react-native/IconCircleDot";
46import IconCircleXFilled from "@tabler/icons-react-native/IconCircleXFilled";
47import IconTicket from "@tabler/icons-react-native/IconTicket";
48import IconClock from "@tabler/icons-react-native/IconClock";
49import IconCode from "@tabler/icons-react-native/IconCode";
50import IconCopy from "@tabler/icons-react-native/IconCopy";
51import IconDatabase from "@tabler/icons-react-native/IconDatabase";
52import IconDeviceDesktop from "@tabler/icons-react-native/IconDeviceDesktop";
53import IconDeviceLaptop from "@tabler/icons-react-native/IconDeviceLaptop";
54import IconDeviceMobile from "@tabler/icons-react-native/IconDeviceMobile";
55import IconDots from "@tabler/icons-react-native/IconDots";
56import IconPlusMinus from "@tabler/icons-react-native/IconPlusMinus";
57import IconDotsVertical from "@tabler/icons-react-native/IconDotsVertical";
58import IconDotsCircleHorizontal from "@tabler/icons-react-native/IconDotsCircleHorizontal";
59import IconEdit from "@tabler/icons-react-native/IconEdit";
60import IconExternalLink from "@tabler/icons-react-native/IconExternalLink";
61import IconEyeOff from "@tabler/icons-react-native/IconEyeOff";
62import IconEye from "@tabler/icons-react-native/IconEye";
63import IconFileText from "@tabler/icons-react-native/IconFileText";
64import IconFileDiff from "@tabler/icons-react-native/IconFileDiff";
65import IconFilter from "@tabler/icons-react-native/IconFilter";
66import IconFilterFilled from "@tabler/icons-react-native/IconFilterFilled";
67import IconFolder from "@tabler/icons-react-native/IconFolder";
68import IconFolderOpen from "@tabler/icons-react-native/IconFolderOpen";
69import IconHeadphones from "@tabler/icons-react-native/IconHeadphones";
70import IconFolderPlus from "@tabler/icons-react-native/IconFolderPlus";
71import IconGitPullRequestClosed from "@tabler/icons-react-native/IconGitPullRequestClosed";
72import IconGitPullRequestDraft from "@tabler/icons-react-native/IconGitPullRequestDraft";
73import IconGitCommit from "@tabler/icons-react-native/IconGitCommit";
74import IconGitBranch from "@tabler/icons-react-native/IconGitBranch";
75import IconGitMerge from "@tabler/icons-react-native/IconGitMerge";
76import IconGitPullRequest from "@tabler/icons-react-native/IconGitPullRequest";
77import IconHammer from "@tabler/icons-react-native/IconHammer";
78import IconHome from "@tabler/icons-react-native/IconHome";
79import IconInfoCircle from "@tabler/icons-react-native/IconInfoCircle";
80import IconKeyboard from "@tabler/icons-react-native/IconKeyboard";
81import IconKeyboardHide from "@tabler/icons-react-native/IconKeyboardHide";
82import IconLock from "@tabler/icons-react-native/IconLock";
83import IconLayoutColumns from "@tabler/icons-react-native/IconLayoutColumns";
84import IconLayoutSidebar from "@tabler/icons-react-native/IconLayoutSidebar";
85import IconLayoutSidebarRight from "@tabler/icons-react-native/IconLayoutSidebarRight";
86import IconLetterSpacing from "@tabler/icons-react-native/IconLetterSpacing";
87import IconMicrophone from "@tabler/icons-react-native/IconMicrophone";
88import IconLink from "@tabler/icons-react-native/IconLink";
89import IconListNumbers from "@tabler/icons-react-native/IconListNumbers";
90import IconMenu2 from "@tabler/icons-react-native/IconMenu2";
91import IconMessageCircleQuestion from "@tabler/icons-react-native/IconMessageCircleQuestion";
92import IconMessage from "@tabler/icons-react-native/IconMessage";
93import IconMessagePlus from "@tabler/icons-react-native/IconMessagePlus";
94import IconMinus from "@tabler/icons-react-native/IconMinus";
95import IconMoon from "@tabler/icons-react-native/IconMoon";
96import IconNetwork from "@tabler/icons-react-native/IconNetwork";
97import IconPalette from "@tabler/icons-react-native/IconPalette";
98import IconPencil from "@tabler/icons-react-native/IconPencil";
99import IconPlug from "@tabler/icons-react-native/IconPlug";
100import IconPhoto from "@tabler/icons-react-native/IconPhoto";
101import IconPin from "@tabler/icons-react-native/IconPin";
102import IconPinnedOff from "@tabler/icons-react-native/IconPinnedOff";
103import IconPlayerPlay from "@tabler/icons-react-native/IconPlayerPlay";
104import IconPlayerStopFilled from "@tabler/icons-react-native/IconPlayerStopFilled";
105import IconPlus from "@tabler/icons-react-native/IconPlus";
106import IconQrcode from "@tabler/icons-react-native/IconQrcode";
107import IconRefresh from "@tabler/icons-react-native/IconRefresh";
108import IconSearch from "@tabler/icons-react-native/IconSearch";
109import IconShare from "@tabler/icons-react-native/IconShare";
110import IconServer from "@tabler/icons-react-native/IconServer";
111import IconSettings from "@tabler/icons-react-native/IconSettings";
112import IconSparkles from "@tabler/icons-react-native/IconSparkles";
113import IconStack2 from "@tabler/icons-react-native/IconStack2";
114import IconStar from "@tabler/icons-react-native/IconStar";
115import IconStarFilled from "@tabler/icons-react-native/IconStarFilled";
116import IconStethoscope from "@tabler/icons-react-native/IconStethoscope";
117import IconSun from "@tabler/icons-react-native/IconSun";
118import IconShieldQuestion from "@tabler/icons-react-native/IconShieldQuestion";
119import IconTarget from "@tabler/icons-react-native/IconTarget";
120import IconTerminal2 from "@tabler/icons-react-native/IconTerminal2";
121import IconTextDecrease from "@tabler/icons-react-native/IconTextDecrease";
122import IconTextIncrease from "@tabler/icons-react-native/IconTextIncrease";
123import IconTool from "@tabler/icons-react-native/IconTool";
124import IconTrash from "@tabler/icons-react-native/IconTrash";
125import IconTypography from "@tabler/icons-react-native/IconTypography";
126import IconUpload from "@tabler/icons-react-native/IconUpload";
127import IconUserCircle from "@tabler/icons-react-native/IconUserCircle";
128import IconUserCheck from "@tabler/icons-react-native/IconUserCheck";
129import IconUserX from "@tabler/icons-react-native/IconUserX";
130import IconUserQuestion from "@tabler/icons-react-native/IconUserQuestion";
131import IconUserPlus from "@tabler/icons-react-native/IconUserPlus";
132import IconUsers from "@tabler/icons-react-native/IconUsers";
133import IconWifi from "@tabler/icons-react-native/IconWifi";
134import IconWifiOff from "@tabler/icons-react-native/IconWifiOff";
135import IconWorld from "@tabler/icons-react-native/IconWorld";
136import IconX from "@tabler/icons-react-native/IconX";
137import type { AndroidSymbol, SFSymbol, SymbolViewProps } from "expo-symbols";
138import { withUniwind } from "uniwind";
139
140const ANDROID_ICON_BY_SF_SYMBOL = {
141 plusminus: IconPlusMinus,
142 "git.pull-request.closed": IconGitPullRequestClosed,
143 "git.pull-request.draft": IconGitPullRequestDraft,
144 "git.commit": IconGitCommit,
145 "arrow.branch": IconGitBranch,
146 "arrow.left": IconArrowLeft,
147 "arrow.right": IconArrowRight,
148 "arrow.left.arrow.right": IconArrowsLeftRight,
149 "arrow.clockwise": IconRefresh,
150 "arrow.down": IconArrowDown,
151 "arrow.down.circle": IconArrowDownCircle,
152 "arrow.right.circle": IconArrowRightCircle,
153 "arrow.triangle.branch": IconGitBranch,
154 "arrow.triangle.merge": IconGitMerge,
155 "arrow.triangle.pull": IconGitPullRequest,
156 "square.3.layers.3d": IconStack2,
157 "arrow.turn.left.up": IconArrowBackUp,
158 "arrow.up": IconArrowUp,
159 "arrow.up.circle": IconArrowUpCircle,
160 "arrow.up.left.and.arrow.down.right": IconArrowsDiagonal2,
161 "arrow.down.right.and.arrow.up.left": IconArrowsMinimize,
162 "arrow.up.right": IconArrowUpRight,
163 "arrow.up.right.circle": IconArrowUpRightCircle,
164 "arrow.uturn.backward": IconArrowBackUp,
165 "arrow.uturn.forward": IconArrowForwardUp,
166 archivebox: IconArchive,
167 "archivebox.fill": IconArchive,
168 "bell.badge": IconBellRinging,
169 "bolt.circle": IconBolt,
170 "bolt.horizontal.circle": IconBolt,
171 brain: IconBrain,
172 "cable.connector": IconPlug,
173 camera: IconCamera,
174 car: IconCar,
175 "chart.bar.xaxis": IconChartBar,
176 checkmark: IconCheck,
177 "checkmark.circle": IconCircleCheck,
178 "checkmark.circle.fill": IconCircleCheck,
179 circle: IconCircle,
180 "circle.fill": IconCircleFilled,
181 "circle.dashed": IconCircleDashed,
182 "circle.inset.filled": IconCircleDot,
183 "circle.dashed.inset.filled": IconCircleDot,
184 "calendar.badge.clock": IconCalendarClock,
185 clock: IconClock,
186 timer: IconClock,
187 ticket: IconTicket,
188 cloud: IconCloud,
189 cube: IconBox,
190 "chevron.down": IconChevronDown,
191 "chevron.left": IconChevronLeft,
192 "chevron.left.forwardslash.chevron.right": IconCode,
193 "chevron.right": IconChevronRight,
194 "chevron.up": IconChevronUp,
195 desktopcomputer: IconDeviceDesktop,
196 doc: IconFileText,
197 "doc.on.doc": IconCopy,
198 "doc.text": IconFileText,
199 "file.diff": IconFileDiff,
200 ellipsis: IconDots,
201 moon: IconMoon,
202 "ellipsis.circle": IconDotsCircleHorizontal,
203 "exclamationmark.triangle": IconAlertTriangle,
204 "exclamationmark.circle": IconAlertCircle,
205 eye: IconEye,
206 "eye.slash": IconEyeOff,
207 folder: IconFolder,
208 "folder.badge.plus": IconFolderPlus,
209 "folder.fill": IconFolder,
210 gearshape: IconSettings,
211 globe: IconWorld,
212 hammer: IconHammer,
213 headphones: IconHeadphones,
214 house: IconHome,
215 "info.circle": IconInfoCircle,
216 internaldrive: IconDatabase,
217 iphone: IconDeviceMobile,
218 keyboard: IconKeyboard,
219 laptopcomputer: IconDeviceLaptop,
220 link: IconLink,
221 "list.number": IconListNumbers,
222 "line.3.horizontal": IconMenu2,
223 "line.3.horizontal.decrease": IconFilter,
224 "line.3.horizontal.decrease.circle": IconFilter,
225 "line.3.horizontal.decrease.circle.fill": IconFilterFilled,
226 macmini: IconServer,
227 macstudio: IconDeviceDesktop,
228 magnifyingglass: IconSearch,
229 mic: IconMicrophone,
230 paintbrush: IconPalette,
231 pencil: IconPencil,
232 "person.crop.circle": IconUserCircle,
233 "person.2": IconUsers,
234 "person.fill.checkmark": IconUserCheck,
235 "person.fill.xmark": IconUserX,
236 "person.badge.clock": IconUserQuestion,
237 "person.badge.plus": IconUserPlus,
238 photo: IconPhoto,
239 pin: IconPin,
240 "pin.slash": IconPinnedOff,
241 play: IconPlayerPlay,
242 plus: IconPlus,
243 minus: IconMinus,
244 "slash.circle": IconBan,
245 "qrcode.viewfinder": IconQrcode,
246 "point.3.connected.trianglepath.dotted": IconNetwork,
247 "point.topleft.down.curvedto.point.bottomright.up": IconGitMerge,
248 safari: IconExternalLink,
249 "server.rack": IconServer,
250 stethoscope: IconStethoscope,
251 "sidebar.left": IconLayoutSidebar,
252 "sidebar.right": IconLayoutSidebarRight,
253 "slider.horizontal.3": IconAdjustmentsHorizontal,
254 "square.and.arrow.up": IconShare,
255 "square.and.pencil": IconEdit,
256 "square.on.square": IconCopy,
257 "square.grid.2x2": IconApps,
258 "square.split.2x1": IconLayoutColumns,
259 star: IconStar,
260 "star.fill": IconStarFilled,
261 "sun.max": IconSun,
262 "stop.fill": IconPlayerStopFilled,
263 target: IconTarget,
264 terminal: IconTerminal2,
265 "text.alignleft": IconAlignLeft,
266 "text.bubble": IconMessage,
267 "questionmark.bubble": IconMessageCircleQuestion,
268 "exclamationmark.shield": IconShieldQuestion,
269 "bubble.left.and.bubble.right": IconMessage,
270 "bubble.left": IconMessage,
271 sparkles: IconSparkles,
272 "plus.bubble": IconMessagePlus,
273 "text.word.spacing": IconLetterSpacing,
274 "textformat.size": IconTypography,
275 "textformat.size.larger": IconTextIncrease,
276 "textformat.size.smaller": IconTextDecrease,
277 "tray.and.arrow.up": IconUpload,
278 trash: IconTrash,
279 wifi: IconWifi,
280 "wifi.slash": IconWifiOff,
281 xmark: IconX,
282 "xmark.circle.fill": IconCircleXFilled,
283} satisfies Partial<
284 Record<
285 SFSymbol | "git.pull-request.closed" | "git.pull-request.draft" | "git.commit" | "file.diff",
286 Icon
287 >
288>;
289const SF_ICON_LOOKUP: Partial<
290 Record<
291 SFSymbol | "git.pull-request.closed" | "git.pull-request.draft" | "git.commit" | "file.diff",
292 Icon
293 >
294> = ANDROID_ICON_BY_SF_SYMBOL;
295
296const ANDROID_ICON_BY_MATERIAL_NAME = {
297 auto_awesome: IconSparkles,
298 bolt: IconBolt,
299 build: IconTool,
300 chat: IconMessage,
301 chat_bubble: IconMessage,
302 check: IconCheck,
303 close: IconX,
304 construction: IconHammer,
305 content_copy: IconCopy,
306 desktop_windows: IconDeviceDesktop,
307 edit: IconEdit,
308 error: IconAlertCircle,
309 folder: IconFolder,
310 folder_open: IconFolderOpen,
311 keyboard: IconKeyboard,
312 keyboard_arrow_down: IconChevronDown,
313 keyboard_arrow_up: IconChevronUp,
314 keyboard_hide: IconKeyboardHide,
315 lock: IconLock,
316 more_vert: IconDotsVertical,
317 merge: IconGitMerge,
318 psychology: IconBrain,
319 public: IconWorld,
320 remove: IconMinus,
321 smartphone: IconDeviceMobile,
322 terminal: IconTerminal2,
323 visibility: IconEye,
324} satisfies Partial<Record<AndroidSymbol, Icon>>;
325
326export type { SFSymbol } from "expo-symbols";
327export type AppSymbolName =
328 | keyof typeof ANDROID_ICON_BY_SF_SYMBOL
329 | {
330 ios: SFSymbol;
331 android: keyof typeof ANDROID_ICON_BY_MATERIAL_NAME;
332 };
333
334export type AppSymbolViewProps = Omit<SymbolViewProps, "name"> & { name: AppSymbolName };
335
336export function isAppSymbolName(name: string): name is Extract<AppSymbolName, string> {
337 return Object.prototype.hasOwnProperty.call(ANDROID_ICON_BY_SF_SYMBOL, name);
338}
339
340function AppSymbolView(props: AppSymbolViewProps) {
341 const materialName = typeof props.name === "string" ? undefined : props.name.android;
342 const sfSymbol = typeof props.name === "string" ? props.name : props.name.ios;
343 const AndroidIcon =
344 (materialName ? ANDROID_ICON_BY_MATERIAL_NAME[materialName] : undefined) ??
345 (sfSymbol ? SF_ICON_LOOKUP[sfSymbol] : undefined);
346
347 if (!AndroidIcon) {
348 return props.fallback ?? null;
349 }
350
351 return (
352 <AndroidIcon
353 accessibilityLabel={props.accessibilityLabel}
354 color={props.tintColor}
355 size={props.size}
356 strokeWidth={2}
357 style={props.style}
358 testID={props.testID}
359 />
360 );
361}
362
363export const SymbolView = withUniwind(AppSymbolView);