PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.6
Yatra – Travel Booking & Tour Operator Software v3.0.6
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
yatra / resources / js / lib / fa-free-picker-icons.ts

fa-free-picker-icons.ts in Yatra – Travel Booking & Tour Operator Software 3.0.6, at resources/js/lib/fa-free-picker-icons.ts

57 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Font Awesome 6 Free — full solid + regular icon lists for the admin picker.
3 * Names come from includes/fa-free-icon-names.json (regenerate: npm run sync-fa).
4 * Rendering uses webfont CSS (fa-solid / fa-regular + fa-{name}), not bundled SVG defs.
5 */
6 import faManifest from "@yatra/fa-icon-names";
7
8 export type FaPickerStyle = "fa-solid" | "fa-regular";
9
10 export type FaPickerItem = {
11 /** Icon name without fa- prefix (Font Awesome iconName) */
12 name: string;
13 label: string;
14 style: FaPickerStyle;
15 };
16
17 const manifest = faManifest as { solid: string[]; regular: string[] };
18
19 function humanizeIconName(iconName: string): string {
20 return iconName
21 .split("-")
22 .filter(Boolean)
23 .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
24 .join(" ");
25 }
26
27 function toPickerItems(
28 names: readonly string[],
29 style: FaPickerStyle,
30 ): FaPickerItem[] {
31 return names.map((name) => ({
32 name,
33 label: humanizeIconName(name),
34 style,
35 }));
36 }
37
38 /** Font Awesome Free — Solid (full pack) */
39 export const FA_FREE_SOLID_PICKER: FaPickerItem[] = toPickerItems(
40 manifest.solid,
41 "fa-solid",
42 );
43
44 /** Font Awesome Free — Regular (full pack) */
45 export const FA_FREE_REGULAR_PICKER: FaPickerItem[] = toPickerItems(
46 manifest.regular,
47 "fa-regular",
48 );
49
50 export const FA_FREE_ALL_PICKER: FaPickerItem[] = [
51 ...FA_FREE_SOLID_PICKER,
52 ...FA_FREE_REGULAR_PICKER,
53 ];
54
55 export const FA_SOLID_NAME_SET = new Set(manifest.solid);
56 export const FA_REGULAR_NAME_SET = new Set(manifest.regular);
57