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