phlex-icons-radix 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (345) 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/radix/accessibility.rb +28 -0
  22. data/lib/phlex/icons/radix/activity_log.rb +28 -0
  23. data/lib/phlex/icons/radix/align_baseline.rb +28 -0
  24. data/lib/phlex/icons/radix/align_bottom.rb +28 -0
  25. data/lib/phlex/icons/radix/align_center_horizontally.rb +28 -0
  26. data/lib/phlex/icons/radix/align_center_vertically.rb +28 -0
  27. data/lib/phlex/icons/radix/align_left.rb +28 -0
  28. data/lib/phlex/icons/radix/align_right.rb +28 -0
  29. data/lib/phlex/icons/radix/align_top.rb +28 -0
  30. data/lib/phlex/icons/radix/all_sides.rb +28 -0
  31. data/lib/phlex/icons/radix/angle.rb +28 -0
  32. data/lib/phlex/icons/radix/archive.rb +28 -0
  33. data/lib/phlex/icons/radix/arrow_bottom_left.rb +28 -0
  34. data/lib/phlex/icons/radix/arrow_bottom_right.rb +28 -0
  35. data/lib/phlex/icons/radix/arrow_down.rb +28 -0
  36. data/lib/phlex/icons/radix/arrow_left.rb +28 -0
  37. data/lib/phlex/icons/radix/arrow_right.rb +28 -0
  38. data/lib/phlex/icons/radix/arrow_top_left.rb +28 -0
  39. data/lib/phlex/icons/radix/arrow_top_right.rb +28 -0
  40. data/lib/phlex/icons/radix/arrow_up.rb +28 -0
  41. data/lib/phlex/icons/radix/aspect_ratio.rb +28 -0
  42. data/lib/phlex/icons/radix/avatar.rb +28 -0
  43. data/lib/phlex/icons/radix/backpack.rb +28 -0
  44. data/lib/phlex/icons/radix/badge.rb +28 -0
  45. data/lib/phlex/icons/radix/bar_chart.rb +28 -0
  46. data/lib/phlex/icons/radix/base.rb +17 -0
  47. data/lib/phlex/icons/radix/bell.rb +28 -0
  48. data/lib/phlex/icons/radix/blending_mode.rb +28 -0
  49. data/lib/phlex/icons/radix/bookmark.rb +28 -0
  50. data/lib/phlex/icons/radix/bookmark_filled.rb +28 -0
  51. data/lib/phlex/icons/radix/border_all.rb +100 -0
  52. data/lib/phlex/icons/radix/border_bottom.rb +235 -0
  53. data/lib/phlex/icons/radix/border_dashed.rb +28 -0
  54. data/lib/phlex/icons/radix/border_dotted.rb +28 -0
  55. data/lib/phlex/icons/radix/border_left.rb +261 -0
  56. data/lib/phlex/icons/radix/border_none.rb +285 -0
  57. data/lib/phlex/icons/radix/border_right.rb +209 -0
  58. data/lib/phlex/icons/radix/border_solid.rb +28 -0
  59. data/lib/phlex/icons/radix/border_split.rb +132 -0
  60. data/lib/phlex/icons/radix/border_style.rb +28 -0
  61. data/lib/phlex/icons/radix/border_top.rb +261 -0
  62. data/lib/phlex/icons/radix/border_width.rb +25 -0
  63. data/lib/phlex/icons/radix/box.rb +28 -0
  64. data/lib/phlex/icons/radix/box_model.rb +28 -0
  65. data/lib/phlex/icons/radix/button.rb +28 -0
  66. data/lib/phlex/icons/radix/calendar.rb +28 -0
  67. data/lib/phlex/icons/radix/camera.rb +28 -0
  68. data/lib/phlex/icons/radix/card_stack.rb +28 -0
  69. data/lib/phlex/icons/radix/card_stack_minus.rb +28 -0
  70. data/lib/phlex/icons/radix/card_stack_plus.rb +28 -0
  71. data/lib/phlex/icons/radix/caret_down.rb +28 -0
  72. data/lib/phlex/icons/radix/caret_left.rb +28 -0
  73. data/lib/phlex/icons/radix/caret_right.rb +28 -0
  74. data/lib/phlex/icons/radix/caret_sort.rb +28 -0
  75. data/lib/phlex/icons/radix/caret_up.rb +28 -0
  76. data/lib/phlex/icons/radix/chat_bubble.rb +28 -0
  77. data/lib/phlex/icons/radix/check.rb +28 -0
  78. data/lib/phlex/icons/radix/check_circled.rb +28 -0
  79. data/lib/phlex/icons/radix/checkbox.rb +28 -0
  80. data/lib/phlex/icons/radix/chevron_down.rb +28 -0
  81. data/lib/phlex/icons/radix/chevron_left.rb +28 -0
  82. data/lib/phlex/icons/radix/chevron_right.rb +28 -0
  83. data/lib/phlex/icons/radix/chevron_up.rb +28 -0
  84. data/lib/phlex/icons/radix/circle.rb +28 -0
  85. data/lib/phlex/icons/radix/circle_backslash.rb +28 -0
  86. data/lib/phlex/icons/radix/clipboard.rb +28 -0
  87. data/lib/phlex/icons/radix/clipboard_copy.rb +28 -0
  88. data/lib/phlex/icons/radix/clock.rb +28 -0
  89. data/lib/phlex/icons/radix/code.rb +28 -0
  90. data/lib/phlex/icons/radix/codesandbox_logo.rb +28 -0
  91. data/lib/phlex/icons/radix/color_wheel.rb +28 -0
  92. data/lib/phlex/icons/radix/column_spacing.rb +28 -0
  93. data/lib/phlex/icons/radix/columns.rb +28 -0
  94. data/lib/phlex/icons/radix/commit.rb +28 -0
  95. data/lib/phlex/icons/radix/component_1.rb +28 -0
  96. data/lib/phlex/icons/radix/component_2.rb +28 -0
  97. data/lib/phlex/icons/radix/component_boolean.rb +28 -0
  98. data/lib/phlex/icons/radix/component_instance.rb +28 -0
  99. data/lib/phlex/icons/radix/component_none.rb +28 -0
  100. data/lib/phlex/icons/radix/component_placeholder.rb +33 -0
  101. data/lib/phlex/icons/radix/container.rb +28 -0
  102. data/lib/phlex/icons/radix/cookie.rb +28 -0
  103. data/lib/phlex/icons/radix/copy.rb +28 -0
  104. data/lib/phlex/icons/radix/corner_bottom_left.rb +28 -0
  105. data/lib/phlex/icons/radix/corner_bottom_right.rb +28 -0
  106. data/lib/phlex/icons/radix/corner_top_left.rb +28 -0
  107. data/lib/phlex/icons/radix/corner_top_right.rb +28 -0
  108. data/lib/phlex/icons/radix/corners.rb +28 -0
  109. data/lib/phlex/icons/radix/countdown_timer.rb +28 -0
  110. data/lib/phlex/icons/radix/counter_clockwise_clock.rb +28 -0
  111. data/lib/phlex/icons/radix/crop.rb +28 -0
  112. data/lib/phlex/icons/radix/cross_1.rb +28 -0
  113. data/lib/phlex/icons/radix/cross_2.rb +28 -0
  114. data/lib/phlex/icons/radix/cross_circled.rb +28 -0
  115. data/lib/phlex/icons/radix/crosshair_1.rb +28 -0
  116. data/lib/phlex/icons/radix/crosshair_2.rb +28 -0
  117. data/lib/phlex/icons/radix/crumpled_paper.rb +28 -0
  118. data/lib/phlex/icons/radix/cube.rb +28 -0
  119. data/lib/phlex/icons/radix/cursor_arrow.rb +28 -0
  120. data/lib/phlex/icons/radix/cursor_text.rb +28 -0
  121. data/lib/phlex/icons/radix/dash.rb +28 -0
  122. data/lib/phlex/icons/radix/dashboard.rb +28 -0
  123. data/lib/phlex/icons/radix/desktop.rb +28 -0
  124. data/lib/phlex/icons/radix/dimensions.rb +28 -0
  125. data/lib/phlex/icons/radix/disc.rb +28 -0
  126. data/lib/phlex/icons/radix/discord_logo.rb +28 -0
  127. data/lib/phlex/icons/radix/divider_horizontal.rb +28 -0
  128. data/lib/phlex/icons/radix/divider_vertical.rb +28 -0
  129. data/lib/phlex/icons/radix/dot.rb +28 -0
  130. data/lib/phlex/icons/radix/dot_filled.rb +26 -0
  131. data/lib/phlex/icons/radix/dots_horizontal.rb +28 -0
  132. data/lib/phlex/icons/radix/dots_vertical.rb +28 -0
  133. data/lib/phlex/icons/radix/double_arrow_down.rb +28 -0
  134. data/lib/phlex/icons/radix/double_arrow_left.rb +28 -0
  135. data/lib/phlex/icons/radix/double_arrow_right.rb +28 -0
  136. data/lib/phlex/icons/radix/double_arrow_up.rb +28 -0
  137. data/lib/phlex/icons/radix/download.rb +28 -0
  138. data/lib/phlex/icons/radix/drag_handle_dots_1.rb +45 -0
  139. data/lib/phlex/icons/radix/drag_handle_dots_2.rb +28 -0
  140. data/lib/phlex/icons/radix/drag_handle_horizontal.rb +28 -0
  141. data/lib/phlex/icons/radix/drag_handle_vertical.rb +28 -0
  142. data/lib/phlex/icons/radix/drawing_pin.rb +28 -0
  143. data/lib/phlex/icons/radix/drawing_pin_filled.rb +35 -0
  144. data/lib/phlex/icons/radix/dropdown_menu.rb +28 -0
  145. data/lib/phlex/icons/radix/enter.rb +28 -0
  146. data/lib/phlex/icons/radix/enter_full_screen.rb +28 -0
  147. data/lib/phlex/icons/radix/envelope_closed.rb +28 -0
  148. data/lib/phlex/icons/radix/envelope_open.rb +28 -0
  149. data/lib/phlex/icons/radix/eraser.rb +28 -0
  150. data/lib/phlex/icons/radix/exclamation_triangle.rb +28 -0
  151. data/lib/phlex/icons/radix/exit.rb +28 -0
  152. data/lib/phlex/icons/radix/exit_full_screen.rb +28 -0
  153. data/lib/phlex/icons/radix/external_link.rb +28 -0
  154. data/lib/phlex/icons/radix/eye_closed.rb +28 -0
  155. data/lib/phlex/icons/radix/eye_none.rb +28 -0
  156. data/lib/phlex/icons/radix/eye_open.rb +28 -0
  157. data/lib/phlex/icons/radix/face.rb +28 -0
  158. data/lib/phlex/icons/radix/figma_logo.rb +28 -0
  159. data/lib/phlex/icons/radix/file.rb +28 -0
  160. data/lib/phlex/icons/radix/file_minus.rb +28 -0
  161. data/lib/phlex/icons/radix/file_plus.rb +28 -0
  162. data/lib/phlex/icons/radix/file_text.rb +28 -0
  163. data/lib/phlex/icons/radix/font_bold.rb +26 -0
  164. data/lib/phlex/icons/radix/font_family.rb +26 -0
  165. data/lib/phlex/icons/radix/font_italic.rb +28 -0
  166. data/lib/phlex/icons/radix/font_roman.rb +28 -0
  167. data/lib/phlex/icons/radix/font_size.rb +28 -0
  168. data/lib/phlex/icons/radix/font_style.rb +28 -0
  169. data/lib/phlex/icons/radix/frame.rb +28 -0
  170. data/lib/phlex/icons/radix/framer_logo.rb +28 -0
  171. data/lib/phlex/icons/radix/gear.rb +28 -0
  172. data/lib/phlex/icons/radix/github_logo.rb +28 -0
  173. data/lib/phlex/icons/radix/globe.rb +48 -0
  174. data/lib/phlex/icons/radix/grid.rb +28 -0
  175. data/lib/phlex/icons/radix/group.rb +28 -0
  176. data/lib/phlex/icons/radix/half_1.rb +28 -0
  177. data/lib/phlex/icons/radix/half_2.rb +28 -0
  178. data/lib/phlex/icons/radix/hamburger_menu.rb +28 -0
  179. data/lib/phlex/icons/radix/hand.rb +28 -0
  180. data/lib/phlex/icons/radix/heading.rb +28 -0
  181. data/lib/phlex/icons/radix/heart.rb +28 -0
  182. data/lib/phlex/icons/radix/heart_filled.rb +28 -0
  183. data/lib/phlex/icons/radix/height.rb +28 -0
  184. data/lib/phlex/icons/radix/hobby_knife.rb +28 -0
  185. data/lib/phlex/icons/radix/home.rb +28 -0
  186. data/lib/phlex/icons/radix/iconjar_logo.rb +28 -0
  187. data/lib/phlex/icons/radix/id_card.rb +28 -0
  188. data/lib/phlex/icons/radix/image.rb +28 -0
  189. data/lib/phlex/icons/radix/info_circled.rb +28 -0
  190. data/lib/phlex/icons/radix/input.rb +28 -0
  191. data/lib/phlex/icons/radix/instagram_logo.rb +28 -0
  192. data/lib/phlex/icons/radix/keyboard.rb +28 -0
  193. data/lib/phlex/icons/radix/lap_timer.rb +28 -0
  194. data/lib/phlex/icons/radix/laptop.rb +28 -0
  195. data/lib/phlex/icons/radix/layers.rb +28 -0
  196. data/lib/phlex/icons/radix/layout.rb +28 -0
  197. data/lib/phlex/icons/radix/letter_case_capitalize.rb +28 -0
  198. data/lib/phlex/icons/radix/letter_case_lowercase.rb +28 -0
  199. data/lib/phlex/icons/radix/letter_case_toggle.rb +28 -0
  200. data/lib/phlex/icons/radix/letter_case_uppercase.rb +28 -0
  201. data/lib/phlex/icons/radix/letter_spacing.rb +28 -0
  202. data/lib/phlex/icons/radix/lightning_bolt.rb +28 -0
  203. data/lib/phlex/icons/radix/line_height.rb +28 -0
  204. data/lib/phlex/icons/radix/link_1.rb +28 -0
  205. data/lib/phlex/icons/radix/link_2.rb +28 -0
  206. data/lib/phlex/icons/radix/link_break_1.rb +28 -0
  207. data/lib/phlex/icons/radix/link_break_2.rb +28 -0
  208. data/lib/phlex/icons/radix/link_none_1.rb +28 -0
  209. data/lib/phlex/icons/radix/link_none_2.rb +28 -0
  210. data/lib/phlex/icons/radix/linkedin_logo.rb +28 -0
  211. data/lib/phlex/icons/radix/list_bullet.rb +28 -0
  212. data/lib/phlex/icons/radix/lock_closed.rb +28 -0
  213. data/lib/phlex/icons/radix/lock_open_1.rb +28 -0
  214. data/lib/phlex/icons/radix/lock_open_2.rb +28 -0
  215. data/lib/phlex/icons/radix/loop.rb +28 -0
  216. data/lib/phlex/icons/radix/magic_wand.rb +28 -0
  217. data/lib/phlex/icons/radix/magnifying_glass.rb +28 -0
  218. data/lib/phlex/icons/radix/margin.rb +28 -0
  219. data/lib/phlex/icons/radix/mask_off.rb +28 -0
  220. data/lib/phlex/icons/radix/mask_on.rb +28 -0
  221. data/lib/phlex/icons/radix/minus.rb +28 -0
  222. data/lib/phlex/icons/radix/minus_circled.rb +28 -0
  223. data/lib/phlex/icons/radix/mix.rb +28 -0
  224. data/lib/phlex/icons/radix/mixer_horizontal.rb +28 -0
  225. data/lib/phlex/icons/radix/mixer_vertical.rb +28 -0
  226. data/lib/phlex/icons/radix/mobile.rb +28 -0
  227. data/lib/phlex/icons/radix/modulz_logo.rb +28 -0
  228. data/lib/phlex/icons/radix/moon.rb +28 -0
  229. data/lib/phlex/icons/radix/move.rb +28 -0
  230. data/lib/phlex/icons/radix/notion_logo.rb +26 -0
  231. data/lib/phlex/icons/radix/opacity.rb +28 -0
  232. data/lib/phlex/icons/radix/open_in_new_window.rb +28 -0
  233. data/lib/phlex/icons/radix/overline.rb +28 -0
  234. data/lib/phlex/icons/radix/padding.rb +28 -0
  235. data/lib/phlex/icons/radix/paper_plane.rb +28 -0
  236. data/lib/phlex/icons/radix/pause.rb +28 -0
  237. data/lib/phlex/icons/radix/pencil_1.rb +28 -0
  238. data/lib/phlex/icons/radix/pencil_2.rb +28 -0
  239. data/lib/phlex/icons/radix/person.rb +28 -0
  240. data/lib/phlex/icons/radix/pie_chart.rb +28 -0
  241. data/lib/phlex/icons/radix/pilcrow.rb +28 -0
  242. data/lib/phlex/icons/radix/pin_bottom.rb +28 -0
  243. data/lib/phlex/icons/radix/pin_left.rb +28 -0
  244. data/lib/phlex/icons/radix/pin_right.rb +28 -0
  245. data/lib/phlex/icons/radix/pin_top.rb +28 -0
  246. data/lib/phlex/icons/radix/play.rb +28 -0
  247. data/lib/phlex/icons/radix/plus.rb +28 -0
  248. data/lib/phlex/icons/radix/plus_circled.rb +28 -0
  249. data/lib/phlex/icons/radix/question_mark.rb +28 -0
  250. data/lib/phlex/icons/radix/question_mark_circled.rb +28 -0
  251. data/lib/phlex/icons/radix/quote.rb +28 -0
  252. data/lib/phlex/icons/radix/radiobutton.rb +28 -0
  253. data/lib/phlex/icons/radix/reader.rb +28 -0
  254. data/lib/phlex/icons/radix/reload.rb +28 -0
  255. data/lib/phlex/icons/radix/reset.rb +28 -0
  256. data/lib/phlex/icons/radix/resume.rb +28 -0
  257. data/lib/phlex/icons/radix/rocket.rb +28 -0
  258. data/lib/phlex/icons/radix/rotate_counter_clockwise.rb +28 -0
  259. data/lib/phlex/icons/radix/row_spacing.rb +28 -0
  260. data/lib/phlex/icons/radix/rows.rb +28 -0
  261. data/lib/phlex/icons/radix/ruler_horizontal.rb +28 -0
  262. data/lib/phlex/icons/radix/ruler_square.rb +28 -0
  263. data/lib/phlex/icons/radix/scissors.rb +28 -0
  264. data/lib/phlex/icons/radix/section.rb +28 -0
  265. data/lib/phlex/icons/radix/sewing_pin.rb +28 -0
  266. data/lib/phlex/icons/radix/sewing_pin_filled.rb +28 -0
  267. data/lib/phlex/icons/radix/shadow.rb +108 -0
  268. data/lib/phlex/icons/radix/shadow_inner.rb +108 -0
  269. data/lib/phlex/icons/radix/shadow_none.rb +108 -0
  270. data/lib/phlex/icons/radix/shadow_outer.rb +68 -0
  271. data/lib/phlex/icons/radix/share_1.rb +28 -0
  272. data/lib/phlex/icons/radix/share_2.rb +28 -0
  273. data/lib/phlex/icons/radix/shuffle.rb +28 -0
  274. data/lib/phlex/icons/radix/size.rb +28 -0
  275. data/lib/phlex/icons/radix/sketch_logo.rb +28 -0
  276. data/lib/phlex/icons/radix/slash.rb +25 -0
  277. data/lib/phlex/icons/radix/slider.rb +28 -0
  278. data/lib/phlex/icons/radix/space_between_horizontally.rb +28 -0
  279. data/lib/phlex/icons/radix/space_between_vertically.rb +28 -0
  280. data/lib/phlex/icons/radix/space_evenly_horizontally.rb +28 -0
  281. data/lib/phlex/icons/radix/space_evenly_vertically.rb +28 -0
  282. data/lib/phlex/icons/radix/speaker_loud.rb +28 -0
  283. data/lib/phlex/icons/radix/speaker_moderate.rb +28 -0
  284. data/lib/phlex/icons/radix/speaker_off.rb +28 -0
  285. data/lib/phlex/icons/radix/speaker_quiet.rb +28 -0
  286. data/lib/phlex/icons/radix/square.rb +25 -0
  287. data/lib/phlex/icons/radix/stack.rb +28 -0
  288. data/lib/phlex/icons/radix/star.rb +28 -0
  289. data/lib/phlex/icons/radix/star_filled.rb +26 -0
  290. data/lib/phlex/icons/radix/stitches_logo.rb +28 -0
  291. data/lib/phlex/icons/radix/stop.rb +28 -0
  292. data/lib/phlex/icons/radix/stopwatch.rb +28 -0
  293. data/lib/phlex/icons/radix/stretch_horizontally.rb +28 -0
  294. data/lib/phlex/icons/radix/stretch_vertically.rb +28 -0
  295. data/lib/phlex/icons/radix/strikethrough.rb +28 -0
  296. data/lib/phlex/icons/radix/sun.rb +28 -0
  297. data/lib/phlex/icons/radix/switch.rb +28 -0
  298. data/lib/phlex/icons/radix/symbol.rb +28 -0
  299. data/lib/phlex/icons/radix/table.rb +28 -0
  300. data/lib/phlex/icons/radix/target.rb +28 -0
  301. data/lib/phlex/icons/radix/text.rb +28 -0
  302. data/lib/phlex/icons/radix/text_align_bottom.rb +28 -0
  303. data/lib/phlex/icons/radix/text_align_center.rb +28 -0
  304. data/lib/phlex/icons/radix/text_align_justify.rb +28 -0
  305. data/lib/phlex/icons/radix/text_align_left.rb +28 -0
  306. data/lib/phlex/icons/radix/text_align_middle.rb +28 -0
  307. data/lib/phlex/icons/radix/text_align_right.rb +28 -0
  308. data/lib/phlex/icons/radix/text_align_top.rb +28 -0
  309. data/lib/phlex/icons/radix/text_none.rb +28 -0
  310. data/lib/phlex/icons/radix/thick_arrow_down.rb +28 -0
  311. data/lib/phlex/icons/radix/thick_arrow_left.rb +28 -0
  312. data/lib/phlex/icons/radix/thick_arrow_right.rb +28 -0
  313. data/lib/phlex/icons/radix/thick_arrow_up.rb +28 -0
  314. data/lib/phlex/icons/radix/timer.rb +28 -0
  315. data/lib/phlex/icons/radix/tokens.rb +28 -0
  316. data/lib/phlex/icons/radix/track_next.rb +28 -0
  317. data/lib/phlex/icons/radix/track_previous.rb +28 -0
  318. data/lib/phlex/icons/radix/transform.rb +28 -0
  319. data/lib/phlex/icons/radix/transparency_grid.rb +29 -0
  320. data/lib/phlex/icons/radix/trash.rb +28 -0
  321. data/lib/phlex/icons/radix/triangle_down.rb +18 -0
  322. data/lib/phlex/icons/radix/triangle_left.rb +18 -0
  323. data/lib/phlex/icons/radix/triangle_right.rb +18 -0
  324. data/lib/phlex/icons/radix/triangle_up.rb +18 -0
  325. data/lib/phlex/icons/radix/twitter_logo.rb +28 -0
  326. data/lib/phlex/icons/radix/underline.rb +28 -0
  327. data/lib/phlex/icons/radix/update.rb +28 -0
  328. data/lib/phlex/icons/radix/upload.rb +28 -0
  329. data/lib/phlex/icons/radix/value.rb +28 -0
  330. data/lib/phlex/icons/radix/value_none.rb +28 -0
  331. data/lib/phlex/icons/radix/vercel_logo.rb +28 -0
  332. data/lib/phlex/icons/radix/video.rb +28 -0
  333. data/lib/phlex/icons/radix/view_grid.rb +28 -0
  334. data/lib/phlex/icons/radix/view_horizontal.rb +28 -0
  335. data/lib/phlex/icons/radix/view_none.rb +28 -0
  336. data/lib/phlex/icons/radix/view_vertical.rb +28 -0
  337. data/lib/phlex/icons/radix/width.rb +28 -0
  338. data/lib/phlex/icons/radix/zoom_in.rb +28 -0
  339. data/lib/phlex/icons/radix/zoom_out.rb +28 -0
  340. data/lib/phlex/icons/radix.rb +15 -0
  341. data/lib/phlex/icons/version.rb +7 -0
  342. data/lib/phlex_icons_radix.rb +22 -0
  343. data/phlex-icons.png +0 -0
  344. data/sig/phlex/icons.rbs +6 -0
  345. metadata +405 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9bff7bd4a92bcdce771ae087a54f5a31efeb35d89d1c3735e0d92dc32979a40b
4
+ data.tar.gz: 90a48a09998167e62c5bedc7d68c3cfc71cbfffbc838241455fa9c0f8c3fd847
5
+ SHA512:
6
+ metadata.gz: aed76e05afa40809458121494d1e2308b8cc3fd5393820a7ed0ee25d815fa4573aa3b8e4b3008839e41bffe0a59d8f7a4d92afaff6f73fc41ccc78600f4de4e6
7
+ data.tar.gz: ef1de7aaf15556b8391a537f512690c0bafe3969440512173e69ca0d2595db4c265b7771ca0900e7e8fdc4d8971a00ef629a43153a66e13ac90688d0ee849a8b
@@ -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