phlex-icons-hero 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (352) hide show
  1. checksums.yaml +7 -0
  2. data/.devcontainer/devcontainer.json +53 -0
  3. data/.devcontainer/setup.sh +5 -0
  4. data/.rspec +3 -0
  5. data/.rubocop.yml +28 -0
  6. data/.ruby-version +1 -0
  7. data/CHANGELOG.md +5 -0
  8. data/CODE_OF_CONDUCT.md +132 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +138 -0
  11. data/Rakefile +12 -0
  12. data/generators/bootstrap.rb +69 -0
  13. data/generators/flag.rb +68 -0
  14. data/generators/helper.rb +102 -0
  15. data/generators/hero.rb +63 -0
  16. data/generators/lucide.rb +54 -0
  17. data/generators/radix.rb +54 -0
  18. data/generators/remix.rb +57 -0
  19. data/lib/phlex/icons/base.rb +19 -0
  20. data/lib/phlex/icons/configuration.rb +13 -0
  21. data/lib/phlex/icons/hero/academic_cap.rb +55 -0
  22. data/lib/phlex/icons/hero/adjustments_horizontal.rb +47 -0
  23. data/lib/phlex/icons/hero/adjustments_vertical.rb +47 -0
  24. data/lib/phlex/icons/hero/archive_box.rb +53 -0
  25. data/lib/phlex/icons/hero/archive_box_arrow_down.rb +53 -0
  26. data/lib/phlex/icons/hero/archive_box_x_mark.rb +53 -0
  27. data/lib/phlex/icons/hero/arrow_down.rb +48 -0
  28. data/lib/phlex/icons/hero/arrow_down_circle.rb +48 -0
  29. data/lib/phlex/icons/hero/arrow_down_left.rb +48 -0
  30. data/lib/phlex/icons/hero/arrow_down_on_square.rb +47 -0
  31. data/lib/phlex/icons/hero/arrow_down_on_square_stack.rb +53 -0
  32. data/lib/phlex/icons/hero/arrow_down_right.rb +48 -0
  33. data/lib/phlex/icons/hero/arrow_down_tray.rb +49 -0
  34. data/lib/phlex/icons/hero/arrow_left.rb +48 -0
  35. data/lib/phlex/icons/hero/arrow_left_circle.rb +48 -0
  36. data/lib/phlex/icons/hero/arrow_left_end_on_rectangle.rb +49 -0
  37. data/lib/phlex/icons/hero/arrow_left_on_rectangle.rb +49 -0
  38. data/lib/phlex/icons/hero/arrow_left_start_on_rectangle.rb +49 -0
  39. data/lib/phlex/icons/hero/arrow_long_down.rb +48 -0
  40. data/lib/phlex/icons/hero/arrow_long_left.rb +48 -0
  41. data/lib/phlex/icons/hero/arrow_long_right.rb +48 -0
  42. data/lib/phlex/icons/hero/arrow_long_up.rb +48 -0
  43. data/lib/phlex/icons/hero/arrow_path.rb +49 -0
  44. data/lib/phlex/icons/hero/arrow_path_rounded_square.rb +49 -0
  45. data/lib/phlex/icons/hero/arrow_right.rb +48 -0
  46. data/lib/phlex/icons/hero/arrow_right_circle.rb +48 -0
  47. data/lib/phlex/icons/hero/arrow_right_end_on_rectangle.rb +49 -0
  48. data/lib/phlex/icons/hero/arrow_right_on_rectangle.rb +49 -0
  49. data/lib/phlex/icons/hero/arrow_right_start_on_rectangle.rb +49 -0
  50. data/lib/phlex/icons/hero/arrow_small_down.rb +48 -0
  51. data/lib/phlex/icons/hero/arrow_small_left.rb +48 -0
  52. data/lib/phlex/icons/hero/arrow_small_right.rb +48 -0
  53. data/lib/phlex/icons/hero/arrow_small_up.rb +48 -0
  54. data/lib/phlex/icons/hero/arrow_top_right_on_square.rb +49 -0
  55. data/lib/phlex/icons/hero/arrow_trending_down.rb +49 -0
  56. data/lib/phlex/icons/hero/arrow_trending_up.rb +49 -0
  57. data/lib/phlex/icons/hero/arrow_turn_down_left.rb +48 -0
  58. data/lib/phlex/icons/hero/arrow_turn_down_right.rb +48 -0
  59. data/lib/phlex/icons/hero/arrow_turn_left_down.rb +48 -0
  60. data/lib/phlex/icons/hero/arrow_turn_left_up.rb +48 -0
  61. data/lib/phlex/icons/hero/arrow_turn_right_down.rb +48 -0
  62. data/lib/phlex/icons/hero/arrow_turn_right_up.rb +48 -0
  63. data/lib/phlex/icons/hero/arrow_turn_up_left.rb +48 -0
  64. data/lib/phlex/icons/hero/arrow_turn_up_right.rb +48 -0
  65. data/lib/phlex/icons/hero/arrow_up.rb +48 -0
  66. data/lib/phlex/icons/hero/arrow_up_circle.rb +48 -0
  67. data/lib/phlex/icons/hero/arrow_up_left.rb +48 -0
  68. data/lib/phlex/icons/hero/arrow_up_on_square.rb +47 -0
  69. data/lib/phlex/icons/hero/arrow_up_on_square_stack.rb +51 -0
  70. data/lib/phlex/icons/hero/arrow_up_right.rb +48 -0
  71. data/lib/phlex/icons/hero/arrow_up_tray.rb +49 -0
  72. data/lib/phlex/icons/hero/arrow_uturn_down.rb +48 -0
  73. data/lib/phlex/icons/hero/arrow_uturn_left.rb +48 -0
  74. data/lib/phlex/icons/hero/arrow_uturn_right.rb +48 -0
  75. data/lib/phlex/icons/hero/arrow_uturn_up.rb +48 -0
  76. data/lib/phlex/icons/hero/arrows_pointing_in.rb +49 -0
  77. data/lib/phlex/icons/hero/arrows_pointing_out.rb +49 -0
  78. data/lib/phlex/icons/hero/arrows_right_left.rb +49 -0
  79. data/lib/phlex/icons/hero/arrows_up_down.rb +49 -0
  80. data/lib/phlex/icons/hero/at_symbol.rb +49 -0
  81. data/lib/phlex/icons/hero/backspace.rb +49 -0
  82. data/lib/phlex/icons/hero/backward.rb +47 -0
  83. data/lib/phlex/icons/hero/banknotes.rb +54 -0
  84. data/lib/phlex/icons/hero/bars_2.rb +48 -0
  85. data/lib/phlex/icons/hero/bars_3.rb +48 -0
  86. data/lib/phlex/icons/hero/bars_3_bottom_left.rb +48 -0
  87. data/lib/phlex/icons/hero/bars_3_bottom_right.rb +48 -0
  88. data/lib/phlex/icons/hero/bars_3_center_left.rb +48 -0
  89. data/lib/phlex/icons/hero/bars_4.rb +48 -0
  90. data/lib/phlex/icons/hero/bars_arrow_down.rb +49 -0
  91. data/lib/phlex/icons/hero/bars_arrow_up.rb +49 -0
  92. data/lib/phlex/icons/hero/base.rb +25 -0
  93. data/lib/phlex/icons/hero/battery_0.rb +49 -0
  94. data/lib/phlex/icons/hero/battery_100.rb +49 -0
  95. data/lib/phlex/icons/hero/battery_50.rb +53 -0
  96. data/lib/phlex/icons/hero/beaker.rb +49 -0
  97. data/lib/phlex/icons/hero/bell.rb +49 -0
  98. data/lib/phlex/icons/hero/bell_alert.rb +53 -0
  99. data/lib/phlex/icons/hero/bell_slash.rb +53 -0
  100. data/lib/phlex/icons/hero/bell_snooze.rb +49 -0
  101. data/lib/phlex/icons/hero/bold.rb +48 -0
  102. data/lib/phlex/icons/hero/bolt.rb +48 -0
  103. data/lib/phlex/icons/hero/bolt_slash.rb +47 -0
  104. data/lib/phlex/icons/hero/book_open.rb +47 -0
  105. data/lib/phlex/icons/hero/bookmark.rb +49 -0
  106. data/lib/phlex/icons/hero/bookmark_slash.rb +47 -0
  107. data/lib/phlex/icons/hero/bookmark_square.rb +49 -0
  108. data/lib/phlex/icons/hero/briefcase.rb +53 -0
  109. data/lib/phlex/icons/hero/bug_ant.rb +49 -0
  110. data/lib/phlex/icons/hero/building_library.rb +54 -0
  111. data/lib/phlex/icons/hero/building_office.rb +49 -0
  112. data/lib/phlex/icons/hero/building_office_2.rb +49 -0
  113. data/lib/phlex/icons/hero/building_storefront.rb +53 -0
  114. data/lib/phlex/icons/hero/cake.rb +47 -0
  115. data/lib/phlex/icons/hero/calculator.rb +49 -0
  116. data/lib/phlex/icons/hero/calendar.rb +49 -0
  117. data/lib/phlex/icons/hero/calendar_date_range.rb +53 -0
  118. data/lib/phlex/icons/hero/calendar_days.rb +53 -0
  119. data/lib/phlex/icons/hero/camera.rb +56 -0
  120. data/lib/phlex/icons/hero/chart_bar.rb +47 -0
  121. data/lib/phlex/icons/hero/chart_bar_square.rb +49 -0
  122. data/lib/phlex/icons/hero/chart_pie.rb +59 -0
  123. data/lib/phlex/icons/hero/chat_bubble_bottom_center.rb +49 -0
  124. data/lib/phlex/icons/hero/chat_bubble_bottom_center_text.rb +49 -0
  125. data/lib/phlex/icons/hero/chat_bubble_left.rb +49 -0
  126. data/lib/phlex/icons/hero/chat_bubble_left_ellipsis.rb +49 -0
  127. data/lib/phlex/icons/hero/chat_bubble_left_right.rb +51 -0
  128. data/lib/phlex/icons/hero/chat_bubble_oval_left.rb +49 -0
  129. data/lib/phlex/icons/hero/chat_bubble_oval_left_ellipsis.rb +49 -0
  130. data/lib/phlex/icons/hero/check.rb +48 -0
  131. data/lib/phlex/icons/hero/check_badge.rb +49 -0
  132. data/lib/phlex/icons/hero/check_circle.rb +48 -0
  133. data/lib/phlex/icons/hero/chevron_double_down.rb +54 -0
  134. data/lib/phlex/icons/hero/chevron_double_left.rb +54 -0
  135. data/lib/phlex/icons/hero/chevron_double_right.rb +54 -0
  136. data/lib/phlex/icons/hero/chevron_double_up.rb +59 -0
  137. data/lib/phlex/icons/hero/chevron_down.rb +48 -0
  138. data/lib/phlex/icons/hero/chevron_left.rb +48 -0
  139. data/lib/phlex/icons/hero/chevron_right.rb +48 -0
  140. data/lib/phlex/icons/hero/chevron_up.rb +48 -0
  141. data/lib/phlex/icons/hero/chevron_up_down.rb +48 -0
  142. data/lib/phlex/icons/hero/circle_stack.rb +59 -0
  143. data/lib/phlex/icons/hero/clipboard.rb +49 -0
  144. data/lib/phlex/icons/hero/clipboard_document.rb +57 -0
  145. data/lib/phlex/icons/hero/clipboard_document_check.rb +55 -0
  146. data/lib/phlex/icons/hero/clipboard_document_list.rb +55 -0
  147. data/lib/phlex/icons/hero/clock.rb +48 -0
  148. data/lib/phlex/icons/hero/cloud.rb +49 -0
  149. data/lib/phlex/icons/hero/cloud_arrow_down.rb +49 -0
  150. data/lib/phlex/icons/hero/cloud_arrow_up.rb +49 -0
  151. data/lib/phlex/icons/hero/code_bracket.rb +48 -0
  152. data/lib/phlex/icons/hero/code_bracket_square.rb +49 -0
  153. data/lib/phlex/icons/hero/cog.rb +53 -0
  154. data/lib/phlex/icons/hero/cog_6_tooth.rb +54 -0
  155. data/lib/phlex/icons/hero/cog_8_tooth.rb +54 -0
  156. data/lib/phlex/icons/hero/command_line.rb +49 -0
  157. data/lib/phlex/icons/hero/computer_desktop.rb +49 -0
  158. data/lib/phlex/icons/hero/configuration.rb +15 -0
  159. data/lib/phlex/icons/hero/cpu_chip.rb +50 -0
  160. data/lib/phlex/icons/hero/credit_card.rb +50 -0
  161. data/lib/phlex/icons/hero/cube.rb +47 -0
  162. data/lib/phlex/icons/hero/cube_transparent.rb +49 -0
  163. data/lib/phlex/icons/hero/currency_bangladeshi.rb +49 -0
  164. data/lib/phlex/icons/hero/currency_dollar.rb +53 -0
  165. data/lib/phlex/icons/hero/currency_euro.rb +49 -0
  166. data/lib/phlex/icons/hero/currency_pound.rb +49 -0
  167. data/lib/phlex/icons/hero/currency_rupee.rb +49 -0
  168. data/lib/phlex/icons/hero/currency_yen.rb +49 -0
  169. data/lib/phlex/icons/hero/cursor_arrow_rays.rb +49 -0
  170. data/lib/phlex/icons/hero/cursor_arrow_ripple.rb +49 -0
  171. data/lib/phlex/icons/hero/device_phone_mobile.rb +50 -0
  172. data/lib/phlex/icons/hero/device_tablet.rb +50 -0
  173. data/lib/phlex/icons/hero/divide.rb +49 -0
  174. data/lib/phlex/icons/hero/document.rb +51 -0
  175. data/lib/phlex/icons/hero/document_arrow_down.rb +53 -0
  176. data/lib/phlex/icons/hero/document_arrow_up.rb +53 -0
  177. data/lib/phlex/icons/hero/document_chart_bar.rb +53 -0
  178. data/lib/phlex/icons/hero/document_check.rb +53 -0
  179. data/lib/phlex/icons/hero/document_currency_bangladeshi.rb +49 -0
  180. data/lib/phlex/icons/hero/document_currency_dollar.rb +49 -0
  181. data/lib/phlex/icons/hero/document_currency_euro.rb +53 -0
  182. data/lib/phlex/icons/hero/document_currency_pound.rb +49 -0
  183. data/lib/phlex/icons/hero/document_currency_rupee.rb +49 -0
  184. data/lib/phlex/icons/hero/document_currency_yen.rb +49 -0
  185. data/lib/phlex/icons/hero/document_duplicate.rb +51 -0
  186. data/lib/phlex/icons/hero/document_magnifying_glass.rb +54 -0
  187. data/lib/phlex/icons/hero/document_minus.rb +53 -0
  188. data/lib/phlex/icons/hero/document_plus.rb +53 -0
  189. data/lib/phlex/icons/hero/document_text.rb +53 -0
  190. data/lib/phlex/icons/hero/ellipsis_horizontal.rb +49 -0
  191. data/lib/phlex/icons/hero/ellipsis_horizontal_circle.rb +49 -0
  192. data/lib/phlex/icons/hero/ellipsis_vertical.rb +49 -0
  193. data/lib/phlex/icons/hero/envelope.rb +51 -0
  194. data/lib/phlex/icons/hero/envelope_open.rb +51 -0
  195. data/lib/phlex/icons/hero/equals.rb +48 -0
  196. data/lib/phlex/icons/hero/exclamation_circle.rb +49 -0
  197. data/lib/phlex/icons/hero/exclamation_triangle.rb +49 -0
  198. data/lib/phlex/icons/hero/eye.rb +55 -0
  199. data/lib/phlex/icons/hero/eye_dropper.rb +49 -0
  200. data/lib/phlex/icons/hero/eye_slash.rb +55 -0
  201. data/lib/phlex/icons/hero/face_frown.rb +49 -0
  202. data/lib/phlex/icons/hero/face_smile.rb +49 -0
  203. data/lib/phlex/icons/hero/film.rb +49 -0
  204. data/lib/phlex/icons/hero/finger_print.rb +49 -0
  205. data/lib/phlex/icons/hero/fire.rb +55 -0
  206. data/lib/phlex/icons/hero/flag.rb +49 -0
  207. data/lib/phlex/icons/hero/folder.rb +47 -0
  208. data/lib/phlex/icons/hero/folder_arrow_down.rb +49 -0
  209. data/lib/phlex/icons/hero/folder_minus.rb +49 -0
  210. data/lib/phlex/icons/hero/folder_open.rb +47 -0
  211. data/lib/phlex/icons/hero/folder_plus.rb +49 -0
  212. data/lib/phlex/icons/hero/forward.rb +47 -0
  213. data/lib/phlex/icons/hero/funnel.rb +49 -0
  214. data/lib/phlex/icons/hero/gif.rb +49 -0
  215. data/lib/phlex/icons/hero/gift.rb +47 -0
  216. data/lib/phlex/icons/hero/gift_top.rb +51 -0
  217. data/lib/phlex/icons/hero/globe_alt.rb +47 -0
  218. data/lib/phlex/icons/hero/globe_americas.rb +49 -0
  219. data/lib/phlex/icons/hero/globe_asia_australia.rb +53 -0
  220. data/lib/phlex/icons/hero/globe_europe_africa.rb +49 -0
  221. data/lib/phlex/icons/hero/h1.rb +49 -0
  222. data/lib/phlex/icons/hero/h2.rb +49 -0
  223. data/lib/phlex/icons/hero/h3.rb +49 -0
  224. data/lib/phlex/icons/hero/hand_raised.rb +47 -0
  225. data/lib/phlex/icons/hero/hand_thumb_down.rb +47 -0
  226. data/lib/phlex/icons/hero/hand_thumb_up.rb +47 -0
  227. data/lib/phlex/icons/hero/hashtag.rb +48 -0
  228. data/lib/phlex/icons/hero/heart.rb +47 -0
  229. data/lib/phlex/icons/hero/home.rb +51 -0
  230. data/lib/phlex/icons/hero/home_modern.rb +53 -0
  231. data/lib/phlex/icons/hero/identification.rb +49 -0
  232. data/lib/phlex/icons/hero/inbox.rb +49 -0
  233. data/lib/phlex/icons/hero/inbox_arrow_down.rb +55 -0
  234. data/lib/phlex/icons/hero/inbox_stack.rb +53 -0
  235. data/lib/phlex/icons/hero/information_circle.rb +49 -0
  236. data/lib/phlex/icons/hero/italic.rb +49 -0
  237. data/lib/phlex/icons/hero/key.rb +49 -0
  238. data/lib/phlex/icons/hero/language.rb +49 -0
  239. data/lib/phlex/icons/hero/lifebuoy.rb +49 -0
  240. data/lib/phlex/icons/hero/light_bulb.rb +53 -0
  241. data/lib/phlex/icons/hero/link.rb +49 -0
  242. data/lib/phlex/icons/hero/link_slash.rb +49 -0
  243. data/lib/phlex/icons/hero/list_bullet.rb +49 -0
  244. data/lib/phlex/icons/hero/lock_closed.rb +49 -0
  245. data/lib/phlex/icons/hero/lock_open.rb +47 -0
  246. data/lib/phlex/icons/hero/magnifying_glass.rb +49 -0
  247. data/lib/phlex/icons/hero/magnifying_glass_circle.rb +50 -0
  248. data/lib/phlex/icons/hero/magnifying_glass_minus.rb +49 -0
  249. data/lib/phlex/icons/hero/magnifying_glass_plus.rb +49 -0
  250. data/lib/phlex/icons/hero/map.rb +49 -0
  251. data/lib/phlex/icons/hero/map_pin.rb +54 -0
  252. data/lib/phlex/icons/hero/megaphone.rb +47 -0
  253. data/lib/phlex/icons/hero/microphone.rb +48 -0
  254. data/lib/phlex/icons/hero/minus.rb +42 -0
  255. data/lib/phlex/icons/hero/minus_circle.rb +48 -0
  256. data/lib/phlex/icons/hero/minus_small.rb +42 -0
  257. data/lib/phlex/icons/hero/moon.rb +49 -0
  258. data/lib/phlex/icons/hero/musical_note.rb +49 -0
  259. data/lib/phlex/icons/hero/newspaper.rb +53 -0
  260. data/lib/phlex/icons/hero/no_symbol.rb +49 -0
  261. data/lib/phlex/icons/hero/numbered_list.rb +49 -0
  262. data/lib/phlex/icons/hero/paint_brush.rb +49 -0
  263. data/lib/phlex/icons/hero/paper_airplane.rb +47 -0
  264. data/lib/phlex/icons/hero/paper_clip.rb +49 -0
  265. data/lib/phlex/icons/hero/pause.rb +48 -0
  266. data/lib/phlex/icons/hero/pause_circle.rb +48 -0
  267. data/lib/phlex/icons/hero/pencil.rb +47 -0
  268. data/lib/phlex/icons/hero/pencil_square.rb +51 -0
  269. data/lib/phlex/icons/hero/percent_badge.rb +49 -0
  270. data/lib/phlex/icons/hero/phone.rb +49 -0
  271. data/lib/phlex/icons/hero/phone_arrow_down_left.rb +55 -0
  272. data/lib/phlex/icons/hero/phone_arrow_up_right.rb +55 -0
  273. data/lib/phlex/icons/hero/phone_x_mark.rb +49 -0
  274. data/lib/phlex/icons/hero/photo.rb +49 -0
  275. data/lib/phlex/icons/hero/play.rb +49 -0
  276. data/lib/phlex/icons/hero/play_circle.rb +54 -0
  277. data/lib/phlex/icons/hero/play_pause.rb +47 -0
  278. data/lib/phlex/icons/hero/plus.rb +48 -0
  279. data/lib/phlex/icons/hero/plus_circle.rb +48 -0
  280. data/lib/phlex/icons/hero/plus_small.rb +44 -0
  281. data/lib/phlex/icons/hero/power.rb +48 -0
  282. data/lib/phlex/icons/hero/presentation_chart_bar.rb +49 -0
  283. data/lib/phlex/icons/hero/presentation_chart_line.rb +49 -0
  284. data/lib/phlex/icons/hero/printer.rb +49 -0
  285. data/lib/phlex/icons/hero/puzzle_piece.rb +47 -0
  286. data/lib/phlex/icons/hero/qr_code.rb +55 -0
  287. data/lib/phlex/icons/hero/question_mark_circle.rb +49 -0
  288. data/lib/phlex/icons/hero/queue_list.rb +47 -0
  289. data/lib/phlex/icons/hero/radio.rb +49 -0
  290. data/lib/phlex/icons/hero/receipt_percent.rb +49 -0
  291. data/lib/phlex/icons/hero/receipt_refund.rb +49 -0
  292. data/lib/phlex/icons/hero/rectangle_group.rb +49 -0
  293. data/lib/phlex/icons/hero/rectangle_stack.rb +47 -0
  294. data/lib/phlex/icons/hero/rocket_launch.rb +53 -0
  295. data/lib/phlex/icons/hero/rss.rb +49 -0
  296. data/lib/phlex/icons/hero/scale.rb +49 -0
  297. data/lib/phlex/icons/hero/scissors.rb +53 -0
  298. data/lib/phlex/icons/hero/server.rb +53 -0
  299. data/lib/phlex/icons/hero/server_stack.rb +53 -0
  300. data/lib/phlex/icons/hero/share.rb +49 -0
  301. data/lib/phlex/icons/hero/shield_check.rb +49 -0
  302. data/lib/phlex/icons/hero/shield_exclamation.rb +49 -0
  303. data/lib/phlex/icons/hero/shopping_bag.rb +49 -0
  304. data/lib/phlex/icons/hero/shopping_cart.rb +47 -0
  305. data/lib/phlex/icons/hero/signal.rb +49 -0
  306. data/lib/phlex/icons/hero/signal_slash.rb +49 -0
  307. data/lib/phlex/icons/hero/slash.rb +46 -0
  308. data/lib/phlex/icons/hero/sparkles.rb +49 -0
  309. data/lib/phlex/icons/hero/speaker_wave.rb +51 -0
  310. data/lib/phlex/icons/hero/speaker_x_mark.rb +47 -0
  311. data/lib/phlex/icons/hero/square_2_stack.rb +51 -0
  312. data/lib/phlex/icons/hero/square_3_stack_3d.rb +55 -0
  313. data/lib/phlex/icons/hero/squares_2x2.rb +49 -0
  314. data/lib/phlex/icons/hero/squares_plus.rb +47 -0
  315. data/lib/phlex/icons/hero/star.rb +49 -0
  316. data/lib/phlex/icons/hero/stop.rb +49 -0
  317. data/lib/phlex/icons/hero/stop_circle.rb +54 -0
  318. data/lib/phlex/icons/hero/strikethrough.rb +49 -0
  319. data/lib/phlex/icons/hero/sun.rb +47 -0
  320. data/lib/phlex/icons/hero/swatch.rb +53 -0
  321. data/lib/phlex/icons/hero/table_cells.rb +49 -0
  322. data/lib/phlex/icons/hero/tag.rb +54 -0
  323. data/lib/phlex/icons/hero/ticket.rb +49 -0
  324. data/lib/phlex/icons/hero/trash.rb +49 -0
  325. data/lib/phlex/icons/hero/trophy.rb +49 -0
  326. data/lib/phlex/icons/hero/truck.rb +52 -0
  327. data/lib/phlex/icons/hero/tv.rb +50 -0
  328. data/lib/phlex/icons/hero/underline.rb +48 -0
  329. data/lib/phlex/icons/hero/user.rb +49 -0
  330. data/lib/phlex/icons/hero/user_circle.rb +49 -0
  331. data/lib/phlex/icons/hero/user_group.rb +53 -0
  332. data/lib/phlex/icons/hero/user_minus.rb +47 -0
  333. data/lib/phlex/icons/hero/user_plus.rb +47 -0
  334. data/lib/phlex/icons/hero/users.rb +47 -0
  335. data/lib/phlex/icons/hero/variable.rb +49 -0
  336. data/lib/phlex/icons/hero/video_camera.rb +47 -0
  337. data/lib/phlex/icons/hero/video_camera_slash.rb +47 -0
  338. data/lib/phlex/icons/hero/view_columns.rb +47 -0
  339. data/lib/phlex/icons/hero/viewfinder_circle.rb +47 -0
  340. data/lib/phlex/icons/hero/wallet.rb +47 -0
  341. data/lib/phlex/icons/hero/wifi.rb +49 -0
  342. data/lib/phlex/icons/hero/window.rb +49 -0
  343. data/lib/phlex/icons/hero/wrench.rb +54 -0
  344. data/lib/phlex/icons/hero/wrench_screwdriver.rb +59 -0
  345. data/lib/phlex/icons/hero/x_circle.rb +48 -0
  346. data/lib/phlex/icons/hero/x_mark.rb +48 -0
  347. data/lib/phlex/icons/hero.rb +26 -0
  348. data/lib/phlex/icons/version.rb +7 -0
  349. data/lib/phlex_icons_hero.rb +22 -0
  350. data/phlex-icons.png +0 -0
  351. data/sig/phlex/icons.rbs +6 -0
  352. metadata +412 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9645e625496e726dab34a25538077ac8b31dae1f9ea3d49d7a619d2abad479fd
4
+ data.tar.gz: dbfdc0e3d8a3475faec42df32be64899aff0f90eac47e7633ff9fd31bfd1b8d5
5
+ SHA512:
6
+ metadata.gz: 6fbda92fcec71617190282a3cd60ac75bdd922e501ca92993551b497c6d28fdb8cc450710c0d0512ac1303ede5ca93f9e405b1d18b925dd7f812bc76770e6175
7
+ data.tar.gz: 5c813b36b1d9ea03b35bfbb7626650aaf35832069071638d7a883ed41b6015e45e0d50af1f8ba352f3c3e91d697b3c54b14c797fda94f8f512ba54de5a0699bb
@@ -0,0 +1,53 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3
+ {
4
+ "name": "phlex-icons",
5
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
+ "image": "ghcr.io/rails/devcontainer/images/ruby:3.3.4",
7
+
8
+ // Features to add to the dev container. More info: https://containers.dev/features.
9
+ "features": {
10
+ "ghcr.io/jungaretti/features/vim": {}
11
+ },
12
+
13
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
14
+ // "forwardPorts": [],
15
+
16
+ // Use 'postCreateCommand' to run commands after the container is created.
17
+ "postCreateCommand": ".devcontainer/setup.sh",
18
+
19
+ // Configure tool-specific properties.
20
+ "customizations": {
21
+ "vscode": {
22
+ "settings": {
23
+ "workbench": {
24
+ "iconTheme": "vscode-icons"
25
+ },
26
+ "editor": {
27
+ "formatOnSave": true
28
+ },
29
+ "[ruby]": {
30
+ "editor": {
31
+ "formatOnType": false,
32
+ "tabSize": 2,
33
+ "useTabStops": false,
34
+ "defaultFormatter": "Shopify.ruby-lsp"
35
+ }
36
+ },
37
+ "rubyLsp": {
38
+ "rubyVersionManager": "rbenv",
39
+ "formatter": "rubocop"
40
+ }
41
+ },
42
+ "extensions": [
43
+ "bung87.vscode-gemfile",
44
+ "eamodio.gitlens",
45
+ "vscode-icons-team.vscode-icons",
46
+ "waderyan.gitblame"
47
+ ]
48
+ }
49
+ }
50
+
51
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
52
+ // "remoteUser": "root"
53
+ }
@@ -0,0 +1,5 @@
1
+ mkdir -p .ruby-lsp
2
+ cp .ruby-version .ruby-lsp/.ruby-version
3
+
4
+ gem update --system
5
+ bundle
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,28 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.0.0
3
+ NewCops: enable
4
+ Exclude:
5
+ - '**/._*'
6
+ - 'vendor/bundle/**/*'
7
+
8
+ Layout/LineLength:
9
+ AllowedPatterns:
10
+ - !ruby/regexp /\A *# /
11
+
12
+ Style/StringLiteralsInInterpolation:
13
+ EnforcedStyle: single_quotes
14
+
15
+ Style/QuotedSymbols:
16
+ EnforcedStyle: single_quotes
17
+
18
+ Style/StringLiterals:
19
+ EnforcedStyle: single_quotes
20
+
21
+ Style/Documentation:
22
+ Enabled: false
23
+
24
+ Metrics/MethodLength:
25
+ CountAsOne: ['array', 'method_call']
26
+
27
+ Metrics/ClassLength:
28
+ CountAsOne: ['array', 'method_call']
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.3.4
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2024-08-29
4
+
5
+ - Initial release
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Ali Hamdi Ali Fadel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,138 @@
1
+ <div align="center">
2
+ <img src="phlex-icons.png" alt="Phlex Icons" width="500">
3
+
4
+ [![Gem Version](https://badge.fury.io/rb/phlex-icons.svg)](https://badge.fury.io/rb/phlex-icons)
5
+ ![rubocop](https://github.com/AliOsm/phlex-icons/actions/workflows/rubocop.yml/badge.svg?branch=main)
6
+ [![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop)
7
+ ![Ruby Version](https://img.shields.io/badge/ruby_version->=_3.0.0-blue.svg)
8
+
9
+ </div>
10
+
11
+ # Phlex::Icons
12
+
13
+ General icons extension for [Phlex](https://phlex.fun). Includes more than 🎨 7,300 icons from:
14
+ - [Bootstrap Icons](https://icons.getbootstrap.com) (2,000+)
15
+ - [Flag Icons](https://flagicons.lipis.dev) (250+)
16
+ - [Heroicons](https://heroicons.com) (300+)
17
+ - [Lucide Icons](https://lucide.dev/icons) (1,500+)
18
+ - [RadixUI Icons](https://radix-ui.com/icons) (300+)
19
+ - [Remix Icons](https://remixicon.com) (2,800+)
20
+
21
+ And happy to extend to other icon packs!
22
+
23
+ Thanks [nejdetkadir](https://github.com/nejdetkadir) for creating [Phlex::Heroicons](https://github.com/nejdetkadir/phlex-heroicons) as it was the base for this gem.
24
+
25
+ Other Phlex icon gems:
26
+ - [phlex-remixicon](https://github.com/danieldocki/phlex-remixicon)
27
+ - [phlex-lucide](https://github.com/akodkod/phlex-lucide)
28
+
29
+ ## Installation
30
+
31
+ Install the gem and add it to the application's Gemfile by executing:
32
+
33
+ ```bash
34
+ bundle add phlex-icons
35
+ ```
36
+
37
+ If bundler is not being used to manage dependencies, install the gem by executing:
38
+
39
+ ```bash
40
+ gem install phlex-icons
41
+ ```
42
+
43
+ ## Configuration
44
+
45
+ The gem provides global configuration options, and per icons pack configuration options.
46
+
47
+ ### Global configuration
48
+
49
+ ```ruby
50
+ Phlex::Icons.configure do |config|
51
+ config.default_classes = 'size-6'
52
+ end
53
+
54
+ # OR
55
+
56
+ Phlex::Icons.configuration.default_classes = 'size-6'
57
+ ```
58
+
59
+ ### Bootstrap Icons configuration
60
+
61
+ Nothing to configure for Bootstrap Icons.
62
+
63
+ ### Flag Icons configuration
64
+
65
+ ```ruby
66
+ Phlex::Icons::Flag.configure do |config|
67
+ config.default_variant = :square # or :rectangle
68
+ end
69
+
70
+ # OR
71
+
72
+ Phlex::Icons::Flag.configuration.default_variant = :square # or :rectangle
73
+ ```
74
+
75
+ ### Heroicons configuration
76
+
77
+ ```ruby
78
+ Phlex::Icons::Hero.configure do |config|
79
+ config.default_variant = :solid # or :outline
80
+ end
81
+
82
+ # OR
83
+
84
+ Phlex::Icons::Hero.configuration.default_variant = :solid # or :outline
85
+ ```
86
+
87
+ ### Lucide Icons configuration
88
+
89
+ Nothing to configure for Lucide Icons.
90
+
91
+ ### RadixUI Icons configuration
92
+
93
+ Nothing to configure for RadixUI Icons.
94
+
95
+ ### Remix Icons configuration
96
+
97
+ Nothing to configure for Remix Icons.
98
+
99
+ ## Usage
100
+
101
+ ```ruby
102
+ require 'phlex_icons'
103
+
104
+ class PhlexIcons < Phlex::HTML
105
+ def view_template
106
+ div do
107
+ render Phlex::Icons::Bootstrap::House.new(classes: 'size-4')
108
+ render Phlex::Icons::Flag::Sa.new(variant: :rectangle, classes: 'size-4')
109
+ render Phlex::Icons::Hero::Home.new(variant: :solid, classes: 'size-4')
110
+ render Phlex::Icons::Lucide::House.new(classes: 'size-4')
111
+ render Phlex::Icons::Radix::Home.new(classes: 'size-4')
112
+ render Phlex::Icons::Remix::HomeLine.new(classes: 'size-4')
113
+ end
114
+ end
115
+ end
116
+ ```
117
+
118
+ ## Update icon packs
119
+
120
+ All icon packs provided in this gem are auto-generated by their generator under [`generators`](/generators) directory. You just need to clone the repo and run the generator for the icon pack you want to update. In future, I'm planning to add GitHub Actions to automatically generate the icon packs and update the gem.
121
+
122
+ ## Development
123
+
124
+ After checking out the repo, open it in VSCode and click `Reopen in Container` to start a development container. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
125
+
126
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
127
+
128
+ ## Contributing
129
+
130
+ Bug reports and pull requests are welcome on GitHub at https://github.com/AliOsm/phlex-icons. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/AliOsm/phlex-icons/blob/master/CODE_OF_CONDUCT.md).
131
+
132
+ ## License
133
+
134
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
135
+
136
+ ## Code of Conduct
137
+
138
+ Everyone interacting in the Phlex::Icons project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/AliOsm/phlex-icons/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require 'rubocop/rake_task'
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ REPO_URL = 'https://github.com/twbs/icons.git'
6
+ REPO_NAME = 'twbs-icons'
7
+ ICONS_PACK_PATH = 'lib/phlex/icons/bootstrap'
8
+
9
+ TEMPLATE = ERB.new <<~TEMPLATE
10
+ # frozen_string_literal: true
11
+
12
+ # rubocop:disable #{ROBOCOP_DISABLE_WARNINGS}
13
+ module Phlex
14
+ module Icons
15
+ module Bootstrap
16
+ class <%= icon_name %> < Base
17
+ def view_template
18
+ <%= icon %>
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ # rubocop:enable #{ROBOCOP_DISABLE_WARNINGS}
25
+ TEMPLATE
26
+
27
+ REPLACEMENTS = {
28
+ '0-' => 'zero-',
29
+ '1-' => 'one-',
30
+ '2-' => 'two-',
31
+ '3-' => 'three-',
32
+ '4-' => 'four-',
33
+ '5-' => 'five-',
34
+ '6-' => 'six-',
35
+ '7-' => 'seven-',
36
+ '8-' => 'eight-',
37
+ '9-' => 'nine-',
38
+ '123' => 'one-two-three'
39
+ }.freeze
40
+
41
+ def main
42
+ run_generator { icon_file_paths.tqdm.each { create_icon_component(_1) } }
43
+ end
44
+
45
+ def icon_file_paths
46
+ Dir.glob("generators/#{REPO_NAME}/icons/*")
47
+ end
48
+
49
+ def create_icon_component(icon_file_path)
50
+ File.write(
51
+ File.join(ICONS_PACK_PATH, component_file_name(icon_file_path, REPLACEMENTS)),
52
+ TEMPLATE.result_with_hash(
53
+ icon_name: component_class_name(icon_file_path, REPLACEMENTS),
54
+ icon: read_and_convert_icon(icon_file_path)
55
+ )
56
+ )
57
+ end
58
+
59
+ def read_and_convert_icon(icon_file_path)
60
+ icon_file_content = File.read(icon_file_path)
61
+ .sub(/class="bi [^"]*"/, '')
62
+ .sub('width="16"', '')
63
+ .sub('height="16"', '')
64
+
65
+ Phlexing::Converter.convert(icon_file_content)
66
+ .sub('svg(', "svg(\nclass: classes,")
67
+ end
68
+
69
+ main if __FILE__ == $PROGRAM_NAME
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helper'
4
+
5
+ REPO_URL = 'https://github.com/lipis/flag-icons.git'
6
+ REPO_NAME = 'lipis-flag-icons'
7
+ ICONS_PACK_PATH = 'lib/phlex/icons/flag'
8
+
9
+ TEMPLATE = ERB.new <<~TEMPLATE
10
+ # frozen_string_literal: true
11
+
12
+ # rubocop:disable #{ROBOCOP_DISABLE_WARNINGS}
13
+ module Phlex
14
+ module Icons
15
+ module Flag
16
+ class <%= icon_name %> < Base
17
+ def square
18
+ <%= square_icon %>
19
+ end
20
+
21
+ def rectangle
22
+ <%= rectangle_icon %>
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ # rubocop:enable #{ROBOCOP_DISABLE_WARNINGS}
29
+ TEMPLATE
30
+
31
+ def main
32
+ run_generator { icon_file_names.tqdm.each { create_icon_component(_1) } }
33
+ end
34
+
35
+ def icon_file_names
36
+ Dir.glob("generators/#{REPO_NAME}/flags/1x1/*").map { |file| File.basename(file) }
37
+ end
38
+
39
+ def create_icon_component(icon_file_name)
40
+ File.write(
41
+ File.join(ICONS_PACK_PATH, component_file_name(icon_file_name)),
42
+ TEMPLATE.result_with_hash(
43
+ icon_name: component_class_name(icon_file_name),
44
+ square_icon: read_and_convert_icon(square_icon_file_path(icon_file_name)),
45
+ rectangle_icon: read_and_convert_icon(rectangle_icon_file_path(icon_file_name))
46
+ )
47
+ )
48
+ end
49
+
50
+ def read_and_convert_icon(icon_file_path)
51
+ icon_file_content = File.read(icon_file_path)
52
+ .sub(/id="flag-icons-[^"]*"/, '')
53
+
54
+ Phlexing::Converter.convert(icon_file_content)
55
+ .sub('svg(', "svg(\nclass: classes,")
56
+ .sub('xmlns:xlink:', '"xmlns:xlink":')
57
+ .gsub('xlink:href:', '"xlink:href":')
58
+ end
59
+
60
+ def square_icon_file_path(icon_file_name)
61
+ "generators/#{REPO_NAME}/flags/1x1/#{icon_file_name}"
62
+ end
63
+
64
+ def rectangle_icon_file_path(icon_file_name)
65
+ "generators/#{REPO_NAME}/flags/4x3/#{icon_file_name}"
66
+ end
67
+
68
+ main if __FILE__ == $PROGRAM_NAME
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'erb'
4
+ require 'fileutils'
5
+ require 'phlexing'
6
+ require 'tqdm'
7
+
8
+ ROBOCOP_DISABLE_WARNINGS = %w[
9
+ Layout/LineLength
10
+ Metrics/AbcSize
11
+ Metrics/BlockLength
12
+ Metrics/ClassLength
13
+ Metrics/MethodLength
14
+ ].join(',')
15
+
16
+ def run_generator(&block)
17
+ clone_repo(REPO_URL, REPO_NAME)
18
+ prepare_phlex_icons_pack_directory(ICONS_PACK_PATH)
19
+
20
+ print '⌛ Creating icon components...'
21
+ yield block
22
+ puts "\r🎉 Icon components created successfully!"
23
+
24
+ run_rubocop(ICONS_PACK_PATH)
25
+ delete_repo(REPO_NAME)
26
+ end
27
+
28
+ def clone_repo(repo_url, repo_name)
29
+ print "⌛ Cloning '#{repo_name}' repo..."
30
+
31
+ if Dir.exist?("generators/#{repo_name}")
32
+ puts "\r✅ '#{repo_name}' repo already exists"
33
+
34
+ return
35
+ end
36
+
37
+ system!("git clone #{repo_url} generators/#{repo_name}")
38
+
39
+ puts "\r🎉 '#{repo_name}' repo cloned successfully!"
40
+ end
41
+
42
+ def prepare_phlex_icons_pack_directory(icons_pack_path)
43
+ print "⌛ Preparing '#{icons_pack_path}' directory..."
44
+
45
+ FileUtils.mkdir_p(icons_pack_path)
46
+
47
+ Dir.glob("#{icons_pack_path}/*").each do |file|
48
+ next if ['base.rb', 'configuration.rb'].include?(File.basename(file))
49
+
50
+ File.delete(file)
51
+ end
52
+
53
+ puts "\r🎉 '#{icons_pack_path}' directory prepared successfully!"
54
+ end
55
+
56
+ def component_file_name(icon_file_name, replacements = nil)
57
+ replacements ||= {}
58
+
59
+ icon_name = File.basename(icon_file_name, '.svg')
60
+
61
+ replacements.each do |key, value|
62
+ icon_name = icon_name.gsub(key, value) if icon_name.start_with?(key)
63
+ end
64
+
65
+ "#{icon_name.gsub('-', '_')}.rb"
66
+ end
67
+
68
+ def component_class_name(icon_file_name, replacements = nil)
69
+ replacements ||= {}
70
+
71
+ icon_name = File.basename(icon_file_name, '.svg')
72
+
73
+ replacements.each do |key, value|
74
+ icon_name = icon_name.gsub(key, value) if icon_name.start_with?(key)
75
+ end
76
+
77
+ icon_name.gsub('-', ' ').split.map(&:capitalize).join
78
+ end
79
+
80
+ def run_rubocop(path)
81
+ print '⌛ Running RuboCop...'
82
+
83
+ system("rubocop -A #{path}", out: File::NULL, err: File::NULL)
84
+
85
+ Dir.glob("#{path}/*.rb").each do |file|
86
+ File.write(file, File.read(file).gsub('rubocop:enable ,', 'rubocop:enable '))
87
+ end
88
+
89
+ puts "\r🎉 RuboCop ran successfully!"
90
+ end
91
+
92
+ def delete_repo(repo_name)
93
+ print "⌛ Deleting '#{repo_name}' repo..."
94
+
95
+ FileUtils.rm_rf("generators/#{repo_name}")
96
+
97
+ puts "\r🎉 '#{repo_name}' repo deleted successfully!"
98
+ end
99
+
100
+ def system!(command)
101
+ system(command, out: File::NULL, err: File::NULL) || raise("❌ Command failed: '#{command}'")
102
+ end