fluxbit_view_components 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/app/assets/javascripts/fluxbit_view_components/assigner_controller.js +49 -0
  4. data/app/assets/javascripts/fluxbit_view_components/auto_submit_controller.js +39 -0
  5. data/app/assets/javascripts/fluxbit_view_components/drawer_controller.js +135 -0
  6. data/app/assets/javascripts/fluxbit_view_components/index.js +56 -0
  7. data/app/assets/javascripts/fluxbit_view_components/method_link_controller.js +143 -0
  8. data/app/assets/javascripts/fluxbit_view_components/modal_controller.js +118 -0
  9. data/app/assets/javascripts/fluxbit_view_components/password_controller.js +170 -0
  10. data/app/assets/javascripts/fluxbit_view_components/progress_controller.js +374 -0
  11. data/app/assets/javascripts/fluxbit_view_components/row_click_controller.js +32 -0
  12. data/app/assets/javascripts/fluxbit_view_components/select_all_controller.js +122 -0
  13. data/app/assets/javascripts/fluxbit_view_components/spinner_percent_controller.js +174 -0
  14. data/app/assets/javascripts/fluxbit_view_components/theme_button_controller.js +90 -0
  15. data/app/assets/javascripts/fluxbit_view_components.js +1175 -0
  16. data/app/components/fluxbit/accordion_component.rb +125 -0
  17. data/app/components/fluxbit/alert_component.rb +8 -8
  18. data/app/components/fluxbit/avatar_component.rb +11 -12
  19. data/app/components/fluxbit/avatar_group_component.rb +1 -1
  20. data/app/components/fluxbit/badge_component.rb +8 -7
  21. data/app/components/fluxbit/banner_component.rb +139 -0
  22. data/app/components/fluxbit/bottom_navigation_component.rb +437 -0
  23. data/app/components/fluxbit/breadcrumb_component.rb +66 -0
  24. data/app/components/fluxbit/button_component.rb +39 -11
  25. data/app/components/fluxbit/button_group_component.rb +1 -1
  26. data/app/components/fluxbit/card_component.rb +26 -23
  27. data/app/components/fluxbit/carousel_component.rb +154 -0
  28. data/app/components/fluxbit/component.rb +24 -3
  29. data/app/components/fluxbit/drawer_component.html.erb +30 -0
  30. data/app/components/fluxbit/drawer_component.rb +125 -0
  31. data/app/components/fluxbit/dropdown_component.rb +41 -0
  32. data/app/components/fluxbit/dropdown_item_component.rb +68 -0
  33. data/app/components/fluxbit/flex_component.rb +1 -1
  34. data/app/components/fluxbit/form/component.rb +15 -8
  35. data/app/components/fluxbit/form/dropzone_component.rb +3 -3
  36. data/app/components/fluxbit/form/field_component.rb +4 -2
  37. data/app/components/fluxbit/form/help_text_component.rb +1 -1
  38. data/app/components/fluxbit/form/label_component.rb +10 -3
  39. data/app/components/fluxbit/form/password_component.rb +247 -0
  40. data/app/components/fluxbit/form/radio_group_button_component.rb +126 -0
  41. data/app/components/fluxbit/form/select_component.rb +108 -11
  42. data/app/components/fluxbit/form/text_field_component.rb +40 -23
  43. data/app/components/fluxbit/form/toggle_component.rb +2 -2
  44. data/app/components/fluxbit/form/upload_image_component.html.erb +3 -3
  45. data/app/components/fluxbit/form/upload_image_component.rb +12 -1
  46. data/app/components/fluxbit/gravatar_component.rb +7 -0
  47. data/app/components/fluxbit/icon_helpers.rb +167 -0
  48. data/app/components/fluxbit/link_component.rb +42 -0
  49. data/app/components/fluxbit/modal_component.rb +28 -31
  50. data/app/components/fluxbit/pagination_component.rb +206 -0
  51. data/app/components/fluxbit/popover_component.rb +14 -14
  52. data/app/components/fluxbit/progress_component.rb +196 -0
  53. data/app/components/fluxbit/skeleton_component.rb +237 -0
  54. data/app/components/fluxbit/speed_dial_action_component.html.erb +30 -0
  55. data/app/components/fluxbit/speed_dial_action_component.rb +59 -0
  56. data/app/components/fluxbit/speed_dial_component.html.erb +33 -0
  57. data/app/components/fluxbit/speed_dial_component.rb +73 -0
  58. data/app/components/fluxbit/spinner_component.rb +71 -0
  59. data/app/components/fluxbit/spinner_percent_component.rb +174 -0
  60. data/app/components/fluxbit/stepper_component.rb +223 -0
  61. data/app/components/fluxbit/tab_component.rb +44 -25
  62. data/app/components/fluxbit/table_component.rb +186 -0
  63. data/app/components/fluxbit/table_group_component.rb +28 -0
  64. data/app/components/fluxbit/theme_button_component.rb +64 -0
  65. data/app/components/fluxbit/timeline_component.rb +63 -0
  66. data/app/components/fluxbit/timeline_item_component.html.erb +64 -0
  67. data/app/components/fluxbit/timeline_item_component.rb +78 -0
  68. data/app/components/fluxbit/tooltip_component.rb +2 -2
  69. data/app/helpers/fluxbit/components_helper.rb +74 -4
  70. data/app/helpers/fluxbit/form_builder.rb +64 -15
  71. data/app/helpers/fluxbit/view_helper.rb +71 -0
  72. data/config/locales/en.yml +37 -4
  73. data/config/locales/pt-BR.yml +36 -0
  74. data/lib/fluxbit/config/accordion_component.rb +73 -0
  75. data/lib/fluxbit/config/avatar_component.rb +11 -11
  76. data/lib/fluxbit/config/badge_component.rb +14 -11
  77. data/lib/fluxbit/config/banner_component.rb +60 -0
  78. data/lib/fluxbit/config/bottom_navigation_component.rb +74 -0
  79. data/lib/fluxbit/config/breadcrumb_component.rb +24 -0
  80. data/lib/fluxbit/config/button_component.rb +6 -4
  81. data/lib/fluxbit/config/card_component.rb +23 -12
  82. data/lib/fluxbit/config/carousel_component.rb +33 -0
  83. data/lib/fluxbit/config/drawer_component.rb +48 -0
  84. data/lib/fluxbit/config/dropdown_component.rb +29 -0
  85. data/lib/fluxbit/config/form/check_box_component.rb +1 -1
  86. data/lib/fluxbit/config/form/dropzone_component.rb +1 -1
  87. data/lib/fluxbit/config/form/help_text_component.rb +1 -1
  88. data/lib/fluxbit/config/form/label_component.rb +3 -2
  89. data/lib/fluxbit/config/form/password_component.rb +19 -0
  90. data/lib/fluxbit/config/form/radio_group_button_component.rb +24 -0
  91. data/lib/fluxbit/config/form/text_field_component.rb +11 -11
  92. data/lib/fluxbit/config/form/toggle_component.rb +5 -5
  93. data/lib/fluxbit/config/link_component.rb +24 -0
  94. data/lib/fluxbit/config/modal_component.rb +1 -1
  95. data/lib/fluxbit/config/pagination_component.rb +31 -0
  96. data/lib/fluxbit/config/popover_component.rb +1 -1
  97. data/lib/fluxbit/config/progress_component.rb +63 -0
  98. data/lib/fluxbit/config/skeleton_component.rb +82 -0
  99. data/lib/fluxbit/config/speed_dial_component.rb +50 -0
  100. data/lib/fluxbit/config/spinner_component.rb +30 -0
  101. data/lib/fluxbit/config/spinner_percent_component.rb +61 -0
  102. data/lib/fluxbit/config/stepper_component.rb +299 -0
  103. data/lib/fluxbit/config/tab_component.rb +6 -0
  104. data/lib/fluxbit/config/table_component.rb +75 -0
  105. data/lib/fluxbit/config/theme_button_component.rb +19 -0
  106. data/lib/fluxbit/config/timeline_component.rb +77 -0
  107. data/lib/fluxbit/view_components/engine.rb +11 -3
  108. data/lib/fluxbit/view_components/version.rb +1 -1
  109. data/lib/fluxbit/view_components.rb +20 -0
  110. data/lib/generators/fluxbit/devise_views_generator.rb +116 -0
  111. data/lib/generators/fluxbit/pagy_generator.rb +39 -0
  112. data/lib/generators/fluxbit/scaffold_generator.rb +165 -0
  113. data/lib/generators/fluxbit/templates/_alert.html.erb.tt +1 -0
  114. data/lib/generators/fluxbit/templates/_flash.html.erb.tt +15 -0
  115. data/lib/generators/fluxbit/templates/_form.html.erb.tt +38 -0
  116. data/lib/generators/fluxbit/templates/_metadata.html.erb.tt +44 -0
  117. data/lib/generators/fluxbit/templates/controller.rb.tt +406 -0
  118. data/lib/generators/fluxbit/templates/create.turbo_stream.erb.tt +7 -0
  119. data/lib/generators/fluxbit/templates/destroy.turbo_stream.erb.tt +3 -0
  120. data/lib/generators/fluxbit/templates/destroy_all.turbo_stream.erb.tt +9 -0
  121. data/lib/generators/fluxbit/templates/devise_views/confirmations/new.html.erb +11 -0
  122. data/lib/generators/fluxbit/templates/devise_views/layouts/devise.html.erb +64 -0
  123. data/lib/generators/fluxbit/templates/devise_views/mailer/confirmation_instructions.html.erb +5 -0
  124. data/lib/generators/fluxbit/templates/devise_views/mailer/email_changed.html.erb +7 -0
  125. data/lib/generators/fluxbit/templates/devise_views/mailer/password_changed.html.erb +3 -0
  126. data/lib/generators/fluxbit/templates/devise_views/mailer/reset_password_instructions.html.erb +8 -0
  127. data/lib/generators/fluxbit/templates/devise_views/mailer/unlock_instructions.html.erb +7 -0
  128. data/lib/generators/fluxbit/templates/devise_views/passwords/edit.html.erb +29 -0
  129. data/lib/generators/fluxbit/templates/devise_views/passwords/new.html.erb +11 -0
  130. data/lib/generators/fluxbit/templates/devise_views/registrations/edit.html.erb +43 -0
  131. data/lib/generators/fluxbit/templates/devise_views/registrations/new.html.erb +34 -0
  132. data/lib/generators/fluxbit/templates/devise_views/sessions/new.html.erb +15 -0
  133. data/lib/generators/fluxbit/templates/devise_views/shared/_error_messages.html.erb +14 -0
  134. data/lib/generators/fluxbit/templates/devise_views/shared/_links.html.erb +25 -0
  135. data/lib/generators/fluxbit/templates/devise_views/unlocks/new.html.erb +11 -0
  136. data/lib/generators/fluxbit/templates/edit.html.erb.tt +47 -0
  137. data/lib/generators/fluxbit/templates/fluxbit_pagy.css +27 -0
  138. data/lib/generators/fluxbit/templates/i18n.en.yml.tt +121 -0
  139. data/lib/generators/fluxbit/templates/i18n.pt-BR.yml.tt +121 -0
  140. data/lib/generators/fluxbit/templates/index.html.erb.tt +254 -0
  141. data/lib/generators/fluxbit/templates/index.json.jbuilder.tt +33 -0
  142. data/lib/generators/fluxbit/templates/new.html.erb.tt +47 -0
  143. data/lib/generators/fluxbit/templates/partial.html.erb.tt +61 -0
  144. data/lib/generators/fluxbit/templates/policy.rb.tt +36 -0
  145. data/lib/generators/fluxbit/templates/send_alert_via_drawer.erb.tt +10 -0
  146. data/lib/generators/fluxbit/templates/show.html.erb.tt +44 -0
  147. data/lib/generators/fluxbit/templates/show.json.jbuilder.tt +6 -0
  148. data/lib/generators/fluxbit/templates/update.turbo_stream.erb.tt +10 -0
  149. data/lib/generators/fluxbit/templates/update_all.turbo_stream.erb.tt +20 -0
  150. data/lib/install/install.rb +58 -0
  151. metadata +107 -18
  152. data/app/helpers/fluxbit/classes_helper.rb +0 -9
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fluxbit::Config::LinkComponent
4
+ mattr_accessor :color, default: :primary
5
+
6
+ # rubocop: disable Layout/LineLength, Metrics/BlockLength
7
+ mattr_accessor :styles do
8
+ {
9
+ base: "font-medium text-blue-600 dark:text-blue-500 hover:underline",
10
+ colors: {
11
+ default: "text-gray-900 dark:text-white",
12
+ primary: "text-blue-600 dark:text-blue-500",
13
+ secondary: "text-gray-500 dark:text-gray-400",
14
+ success: "text-green-600 dark:text-green-500",
15
+ danger: "text-red-600 dark:text-red-500",
16
+ warning: "text-yellow-600 dark:text-yellow-500",
17
+ info: "text-blue-400 dark:text-blue-300",
18
+ light: "text-gray-300 dark:text-gray-200",
19
+ dark: "text-gray-800 dark:text-gray-700"
20
+ }
21
+ }
22
+ end
23
+ # rubocop: enable Layout/LineLength, Metrics/BlockLength
24
+ end
@@ -53,7 +53,7 @@ module Fluxbit::Config::ModalComponent
53
53
  no_title: "-mt-4"
54
54
  },
55
55
  header: {
56
- base: "flex items-start justify-between rounded-t border-b p-5 dark:border-gray-600",
56
+ base: "flex items-start justify-between rounded-t border-b p-5 border-gray-200 dark:border-gray-600",
57
57
  flat: "border-b-0 p-2",
58
58
  title: "text-xl font-medium text-gray-900 dark:text-white",
59
59
  close: {
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fluxbit::Config::PaginationComponent
4
+ mattr_accessor :show_first_last, default: false
5
+ mattr_accessor :show_prev_next, default: true
6
+ mattr_accessor :show_pages, default: true
7
+ mattr_accessor :show_icons, default: true
8
+ mattr_accessor :show_texts, default: false
9
+ mattr_accessor :sizing, default: 0
10
+
11
+ # rubocop: disable Layout/LineLength, Metrics/BlockLength
12
+ mattr_accessor :styles do
13
+ {
14
+ root: "inline-flex -space-x-px border-e-0 rounded-s-lg",
15
+ page_link: "flex items-center justify-center px-3 h-8 leading-tight text-slate-500 bg-white border border-slate-300 hover:bg-slate-100 hover:text-slate-700 dark:bg-slate-800 dark:border-slate-700 dark:text-slate-400 dark:hover:bg-slate-700 dark:hover:text-white",
16
+ previous: "ms-0 border-e-0 rounded-s-lg",
17
+ next: "rounded-e-lg",
18
+ disabled: "px-3 py-1 text-slate-400 cursor-default",
19
+ current: "flex items-center justify-center px-3 h-8 leading-tight border border-slate-300 text-blue-600 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:bg-slate-700 dark:border-slate-700 dark:text-white",
20
+ text_with_icon_prev: "ms-2",
21
+ text_with_icon_next: "me-2",
22
+ only_text: "",
23
+ only_icon: "sr-only",
24
+ sizes: [
25
+ { root: "text-sm", page_link: "px-3 h-8" },
26
+ { root: "text-base h-10", page_link: "px-4 h-10" }
27
+ ]
28
+ }
29
+ end
30
+ # rubocop: enable Layout/LineLength, Metrics/BlockLength
31
+ end
@@ -3,7 +3,7 @@
3
3
  module Fluxbit::Config::PopoverComponent
4
4
  mattr_accessor :has_arrow, default: true
5
5
  mattr_accessor :image_position, default: :right
6
- mattr_accessor :image_props, default: {}
6
+ mattr_accessor :image_html, default: {}
7
7
  mattr_accessor :size, default: 2
8
8
 
9
9
  # rubocop: disable Layout/LineLength, Metrics/BlockLength
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fluxbit::Config::ProgressComponent
4
+ # Default values
5
+ mattr_accessor :progress, default: 0
6
+ mattr_accessor :color, default: :default
7
+ mattr_accessor :size, default: 1
8
+ mattr_accessor :text_label, default: nil
9
+ mattr_accessor :label_progress, default: false
10
+ mattr_accessor :label_text, default: false
11
+ mattr_accessor :progress_label_position, default: :inside
12
+ mattr_accessor :text_label_position, default: :outside
13
+ mattr_accessor :label_html, default: {}
14
+ mattr_accessor :stimulus, default: false
15
+
16
+ # Styling system
17
+ mattr_accessor :styles do
18
+ {
19
+ base: "w-full bg-gray-200 rounded-full dark:bg-gray-700",
20
+ bar: {
21
+ base: "h-full font-medium text-center leading-none rounded-full transition-all duration-300 ease-in-out flex items-center justify-center",
22
+ colors: {
23
+ default: "bg-blue-600 text-blue-100",
24
+ dark: "bg-gray-600 text-gray-100",
25
+ blue: "bg-blue-600 text-blue-100",
26
+ red: "bg-red-600 text-red-100",
27
+ green: "bg-green-600 text-green-100",
28
+ yellow: "bg-yellow-400 text-yellow-800",
29
+ indigo: "bg-indigo-600 text-indigo-100",
30
+ purple: "bg-purple-600 text-purple-100",
31
+ cyan: "bg-cyan-600 text-cyan-100",
32
+ gray: "bg-gray-600 text-gray-100",
33
+ lime: "bg-lime-600 text-lime-100",
34
+ pink: "bg-pink-600 text-pink-100",
35
+ teal: "bg-teal-600 text-teal-100"
36
+ },
37
+ text_sizes: [
38
+ "text-xs px-1", # size 0 - very small text, minimal padding
39
+ "text-xs px-1", # size 1 - small text, minimal padding
40
+ "text-xs px-2", # size 2 - normal text, normal padding
41
+ "text-sm px-2" # size 3 - larger text, normal padding
42
+ ]
43
+ },
44
+ sizes: [
45
+ "h-1.5", # size 0 - sm
46
+ "h-2.5", # size 1 - md (default)
47
+ "h-4", # size 2 - lg
48
+ "h-6" # size 3 - xl
49
+ ],
50
+ labels: {
51
+ outside: {
52
+ base: "flex justify-between items-center mb-1",
53
+ text: "text-base font-medium text-blue-700 dark:text-white",
54
+ progress: "text-sm font-medium text-blue-700 dark:text-white"
55
+ },
56
+ inside: {
57
+ text: "text-xs font-medium text-center",
58
+ progress: "text-xs font-medium text-center"
59
+ }
60
+ }
61
+ }
62
+ end
63
+ end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fluxbit::Config::SkeletonComponent
4
+ mattr_accessor :variant, default: :default
5
+ mattr_accessor :animation, default: true
6
+ mattr_accessor :rows, default: 3
7
+
8
+ # rubocop: disable Layout/LineLength, Metrics/BlockLength
9
+ mattr_accessor :styles do
10
+ {
11
+ base: "animate-pulse",
12
+ container: "w-full",
13
+ screen_reader: "sr-only",
14
+ text: {
15
+ line: "h-2.5 bg-gray-200 rounded-full dark:bg-gray-700",
16
+ small: "h-2 bg-gray-200 rounded-full dark:bg-gray-700",
17
+ large: "h-3 bg-gray-200 rounded-full dark:bg-gray-700"
18
+ },
19
+ widths: {
20
+ first_line: "w-48",
21
+ last_line: "w-32",
22
+ full: "w-full",
23
+ card_header: "w-48",
24
+ widget_title: "w-48",
25
+ list_name: "w-24",
26
+ list_content: "w-32",
27
+ testimonial_last: "w-24",
28
+ testimonial_name: "w-32",
29
+ testimonial_title: "w-24"
30
+ },
31
+ avatar: {
32
+ small: "w-8 h-8 bg-gray-200 rounded-full dark:bg-gray-700",
33
+ medium: "w-10 h-10 bg-gray-200 rounded-full dark:bg-gray-700",
34
+ large: "w-14 h-14 bg-gray-200 rounded-full dark:bg-gray-700"
35
+ },
36
+ image: {
37
+ small: "h-32 bg-gray-300 rounded dark:bg-gray-700",
38
+ medium: "h-48 bg-gray-300 rounded dark:bg-gray-700",
39
+ large: "h-64 bg-gray-300 rounded dark:bg-gray-700",
40
+ container: "flex items-center justify-center w-full",
41
+ icon: "w-8 h-8 text-gray-200 dark:text-gray-600"
42
+ },
43
+ video: {
44
+ small: "h-32 bg-gray-300 rounded dark:bg-gray-700",
45
+ medium: "h-48 bg-gray-300 rounded dark:bg-gray-700",
46
+ large: "h-64 bg-gray-300 rounded dark:bg-gray-700",
47
+ container: "flex items-center justify-center w-full",
48
+ icon: "w-10 h-10 text-gray-200 dark:text-gray-600"
49
+ },
50
+ button: "h-8 bg-gray-200 rounded dark:bg-gray-700 w-20",
51
+ card: {
52
+ container: "p-4 border border-gray-200 rounded shadow dark:border-gray-700",
53
+ header: "h-4 bg-gray-200 rounded-full dark:bg-gray-700",
54
+ body: "h-2 bg-gray-200 rounded-full dark:bg-gray-700"
55
+ },
56
+ widget: {
57
+ container: "p-6 bg-white border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700",
58
+ title: "h-4 bg-gray-200 rounded-full dark:bg-gray-700 mb-4",
59
+ content: "h-2 bg-gray-200 rounded-full dark:bg-gray-700"
60
+ },
61
+ list: {
62
+ container: "space-y-3",
63
+ item: "flex items-center space-x-4",
64
+ avatar: "w-10 h-10 bg-gray-200 rounded-full dark:bg-gray-700",
65
+ content: "flex-1 space-y-2"
66
+ },
67
+ testimonial: {
68
+ container: "p-4",
69
+ quote: "h-2 bg-gray-200 rounded-full dark:bg-gray-700",
70
+ author: "flex items-center mt-4 space-x-3",
71
+ avatar: "w-8 h-8 bg-gray-200 rounded-full dark:bg-gray-700"
72
+ },
73
+ spacing: {
74
+ none: "",
75
+ small: "mb-2.5",
76
+ medium: "mb-4",
77
+ large: "mb-6"
78
+ }
79
+ }
80
+ end
81
+ # rubocop: enable Layout/LineLength, Metrics/BlockLength
82
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fluxbit::Config::SpeedDialComponent
4
+ mattr_accessor :position, default: :bottom_right
5
+ mattr_accessor :square, default: false
6
+ mattr_accessor :text_outside, default: false
7
+
8
+ # rubocop: disable Layout/LineLength, Metrics/BlockLength
9
+ mattr_accessor :styles do
10
+ {
11
+ base: "fixed z-50 group",
12
+ positions: {
13
+ top_left: "top-6 start-6",
14
+ top_right: "top-6 end-6",
15
+ bottom_left: "bottom-6 start-6",
16
+ bottom_right: "bottom-6 end-6"
17
+ },
18
+ menu: {
19
+ base: "flex flex-col items-center space-y-2",
20
+ hidden: "hidden",
21
+ spacing: {
22
+ top: "mt-4",
23
+ bottom: "mb-4"
24
+ }
25
+ },
26
+ trigger: {
27
+ base: "flex items-center justify-center text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 transition-all duration-200",
28
+ shapes: {
29
+ rounded: "rounded-full w-14 h-14",
30
+ square: "rounded-lg w-14 h-14"
31
+ },
32
+ icon: "w-5 h-5 transition-transform group-hover:rotate-45"
33
+ },
34
+ action: {
35
+ base: "flex justify-center items-center w-[52px] h-[52px] text-gray-500 hover:text-gray-900 bg-white border border-gray-200 dark:border-gray-600 shadow-sm dark:hover:text-white dark:text-gray-400 hover:bg-gray-50 dark:bg-gray-700 dark:hover:bg-gray-600 focus:ring-4 focus:ring-gray-300 focus:outline-none dark:focus:ring-gray-400 transition-all duration-200",
36
+ shapes: {
37
+ rounded: "rounded-full",
38
+ square: "rounded-lg"
39
+ },
40
+ icon: "w-5 h-5",
41
+ text: {
42
+ base: "relative",
43
+ outside: "block mb-px text-sm font-medium text-gray-900 dark:text-white"
44
+ }
45
+ },
46
+ screen_reader: "sr-only"
47
+ }
48
+ end
49
+ # rubocop: enable Layout/LineLength, Metrics/BlockLength
50
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fluxbit::Config::SpinnerComponent
4
+ mattr_accessor :color, default: :default
5
+ mattr_accessor :size, default: 1
6
+ mattr_accessor :label, default: "Loading..."
7
+
8
+ mattr_accessor :styles do
9
+ {
10
+ base: "animate-spin",
11
+ sizes: [
12
+ "w-4 h-4", # 0 - xs
13
+ "w-6 h-6", # 1 - sm (default)
14
+ "w-8 h-8", # 2 - md
15
+ "w-10 h-10", # 3 - lg
16
+ "w-12 h-12" # 4 - xl
17
+ ],
18
+ colors: {
19
+ default: "text-gray-200 fill-blue-600",
20
+ info: "text-gray-200 fill-cyan-600",
21
+ success: "text-gray-200 fill-green-500",
22
+ failure: "text-gray-200 fill-red-600",
23
+ warning: "text-gray-200 fill-yellow-400",
24
+ pink: "text-gray-200 fill-pink-600",
25
+ purple: "text-gray-200 fill-purple-600"
26
+ },
27
+ screen_reader: "sr-only"
28
+ }
29
+ end
30
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fluxbit::Config::SpinnerPercentComponent
4
+ mattr_accessor :color, default: :default
5
+ mattr_accessor :size, default: 2
6
+ mattr_accessor :percent, default: 10
7
+ mattr_accessor :label, default: "Loading..."
8
+ mattr_accessor :show_percent, default: true
9
+ mattr_accessor :text, default: nil
10
+ mattr_accessor :animate, default: false
11
+ mattr_accessor :speed, default: :normal
12
+
13
+ mattr_accessor :styles do
14
+ {
15
+ base: "relative",
16
+ sizes: [
17
+ "w-12 h-12", # 0 - xxs
18
+ "w-16 h-16", # 1 - xs
19
+ "w-20 h-20", # 2 - sm (default)
20
+ "w-24 h-24", # 3 - md
21
+ "w-32 h-32", # 4 - lg
22
+ "w-40 h-40" # 5 - xl
23
+ ],
24
+ colors: {
25
+ default: "text-gray-200 stroke-blue-600",
26
+ info: "text-gray-200 stroke-cyan-600",
27
+ success: "text-gray-200 stroke-green-500",
28
+ failure: "text-gray-200 stroke-red-600",
29
+ warning: "text-gray-200 stroke-yellow-400",
30
+ pink: "text-gray-200 stroke-pink-600",
31
+ purple: "text-gray-200 stroke-purple-600"
32
+ },
33
+ screen_reader: "sr-only",
34
+ text_colors: {
35
+ default: "text-blue-600",
36
+ info: "text-cyan-600",
37
+ success: "text-green-500",
38
+ failure: "text-red-600",
39
+ warning: "text-yellow-400",
40
+ pink: "text-pink-600",
41
+ purple: "text-purple-600"
42
+ },
43
+ animation: "animate-spin",
44
+ speeds: {
45
+ slow: "animate-spin duration-[3s]", # 3 seconds per rotation
46
+ normal: "animate-spin duration-1000", # 1 second per rotation (default)
47
+ fast: "animate-spin duration-500", # 0.5 seconds per rotation
48
+ very_fast: "animate-spin duration-300" # 0.3 seconds per rotation
49
+ },
50
+ svg: {
51
+ transform: "transform -rotate-90"
52
+ },
53
+ percentage_text: {
54
+ position: "absolute inset-0 flex items-center justify-center text-sm font-semibold"
55
+ },
56
+ progress_circle: {
57
+ transition: "transition-all duration-300 ease-in-out"
58
+ }
59
+ }
60
+ end
61
+ end
@@ -0,0 +1,299 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fluxbit::Config::StepperComponent
4
+ mattr_accessor :orientation, default: :horizontal
5
+ mattr_accessor :variant, default: :default
6
+ mattr_accessor :color, default: :blue
7
+
8
+ # rubocop: disable Layout/LineLength, Metrics/BlockLength
9
+ mattr_accessor :styles do
10
+ {
11
+ base: {
12
+ horizontal: "flex items-center w-full",
13
+ vertical: "flex flex-col"
14
+ },
15
+ list: {
16
+ default: {
17
+ horizontal: "flex items-center w-full text-sm font-medium text-center text-gray-500 dark:text-gray-400 sm:text-base",
18
+ vertical: "text-sm font-medium text-gray-500 dark:text-gray-400"
19
+ },
20
+ progress: {
21
+ horizontal: "flex items-center w-full text-sm font-medium text-center text-gray-500 dark:text-gray-400 sm:text-base",
22
+ vertical: "text-sm font-medium text-gray-500 dark:text-gray-400"
23
+ },
24
+ detailed: {
25
+ horizontal: "flex items-center w-full text-sm font-medium text-center text-gray-500 dark:text-gray-400 sm:text-base",
26
+ vertical: "space-y-4"
27
+ }
28
+ },
29
+ item: {
30
+ default: {
31
+ horizontal: "flex md:w-full items-center",
32
+ vertical: "mb-4"
33
+ },
34
+ progress: {
35
+ horizontal: "flex md:w-full items-center",
36
+ vertical: "mb-4"
37
+ },
38
+ detailed: {
39
+ horizontal: "flex md:w-full items-center",
40
+ vertical: "flex items-start p-4 border border-gray-200 rounded-lg dark:border-gray-700 relative"
41
+ }
42
+ },
43
+ step: {
44
+ default: {
45
+ base: "flex items-center justify-center w-10 h-10 bg-gray-100 rounded-full lg:h-12 lg:w-12 dark:bg-gray-700 shrink-0",
46
+ completed: "flex items-center justify-center w-10 h-10 rounded-full lg:h-12 lg:w-12 dark:bg-green-800 bg-green-100 shrink-0",
47
+ active: {
48
+ blue: "flex items-center justify-center w-10 h-10 bg-blue-100 rounded-full lg:h-12 lg:w-12 dark:bg-blue-800 shrink-0",
49
+ green: "flex items-center justify-center w-10 h-10 bg-green-100 rounded-full lg:h-12 lg:w-12 dark:bg-green-800 shrink-0",
50
+ red: "flex items-center justify-center w-10 h-10 bg-red-100 rounded-full lg:h-12 lg:w-12 dark:bg-red-800 shrink-0",
51
+ yellow: "flex items-center justify-center w-10 h-10 bg-yellow-100 rounded-full lg:h-12 lg:w-12 dark:bg-yellow-800 shrink-0",
52
+ indigo: "flex items-center justify-center w-10 h-10 bg-indigo-100 rounded-full lg:h-12 lg:w-12 dark:bg-indigo-800 shrink-0",
53
+ purple: "flex items-center justify-center w-10 h-10 bg-purple-100 rounded-full lg:h-12 lg:w-12 dark:bg-purple-800 shrink-0"
54
+ }
55
+ },
56
+ progress: {
57
+ base: "flex items-center justify-center w-8 h-8 bg-gray-100 rounded-full dark:bg-gray-700 shrink-0",
58
+ completed: "flex items-center justify-center w-8 h-8 rounded-full dark:bg-green-600 bg-green-600 shrink-0",
59
+ active: {
60
+ blue: "flex items-center justify-center w-8 h-8 bg-blue-600 rounded-full dark:bg-blue-600 shrink-0",
61
+ green: "flex items-center justify-center w-8 h-8 bg-green-600 rounded-full dark:bg-green-600 shrink-0",
62
+ red: "flex items-center justify-center w-8 h-8 bg-red-600 rounded-full dark:bg-red-600 shrink-0",
63
+ yellow: "flex items-center justify-center w-8 h-8 bg-yellow-600 rounded-full dark:bg-yellow-600 shrink-0",
64
+ indigo: "flex items-center justify-center w-8 h-8 bg-indigo-600 rounded-full dark:bg-indigo-600 shrink-0",
65
+ purple: "flex items-center justify-center w-8 h-8 bg-purple-600 rounded-full dark:bg-purple-600 shrink-0"
66
+ }
67
+ },
68
+ detailed: {
69
+ base: "flex items-center justify-center w-12 h-12 bg-white border-2 border-gray-300 rounded-full dark:bg-gray-800 dark:border-gray-600 shrink-0",
70
+ completed: "flex items-center justify-center w-12 h-12 bg-green-600 border-2 border-green-600 rounded-full dark:bg-green-600 dark:border-green-600 shrink-0",
71
+ active: {
72
+ blue: "flex items-center justify-center w-12 h-12 bg-blue-600 border-2 border-blue-600 rounded-full dark:bg-blue-600 dark:border-blue-600 shrink-0",
73
+ green: "flex items-center justify-center w-12 h-12 bg-green-600 border-2 border-green-600 rounded-full dark:bg-green-600 dark:border-green-600 shrink-0",
74
+ red: "flex items-center justify-center w-12 h-12 bg-red-600 border-2 border-red-600 rounded-full dark:bg-red-600 dark:border-red-600 shrink-0",
75
+ yellow: "flex items-center justify-center w-12 h-12 bg-yellow-600 border-2 border-yellow-600 rounded-full dark:bg-yellow-600 dark:border-yellow-600 shrink-0",
76
+ indigo: "flex items-center justify-center w-12 h-12 bg-indigo-600 border-2 border-indigo-600 rounded-full dark:bg-indigo-600 dark:border-indigo-600 shrink-0",
77
+ purple: "flex items-center justify-center w-12 h-12 bg-purple-600 border-2 border-purple-600 rounded-full dark:bg-purple-600 dark:border-purple-600 shrink-0"
78
+ }
79
+ }
80
+ },
81
+ step_number: {
82
+ default: {
83
+ base: "text-gray-500 dark:text-gray-100",
84
+ completed: "text-green-600 dark:text-green-300",
85
+ active: {
86
+ blue: "text-blue-600 dark:text-blue-300",
87
+ green: "text-green-600 dark:text-green-300",
88
+ red: "text-red-600 dark:text-red-300",
89
+ yellow: "text-yellow-600 dark:text-yellow-300",
90
+ indigo: "text-indigo-600 dark:text-indigo-300",
91
+ purple: "text-purple-600 dark:text-purple-300"
92
+ }
93
+ },
94
+ progress: {
95
+ base: "hidden",
96
+ completed: "text-white text-xs font-bold",
97
+ active: {
98
+ blue: "text-white text-xs font-bold",
99
+ green: "text-white text-xs font-bold",
100
+ red: "text-white text-xs font-bold",
101
+ yellow: "text-white text-xs font-bold",
102
+ indigo: "text-white text-xs font-bold",
103
+ purple: "text-white text-xs font-bold"
104
+ }
105
+ },
106
+ detailed: {
107
+ base: "text-gray-600 dark:text-gray-300 font-semibold",
108
+ completed: "text-white font-semibold",
109
+ active: {
110
+ blue: "text-white font-semibold",
111
+ green: "text-white font-semibold",
112
+ red: "text-white font-semibold",
113
+ yellow: "text-white font-semibold",
114
+ indigo: "text-white font-semibold",
115
+ purple: "text-white font-semibold"
116
+ }
117
+ }
118
+ },
119
+ step_icon: {
120
+ default: {
121
+ completed: "w-3.5 h-3.5 text-green-600 dark:text-green-300",
122
+ base: "w-4 h-4 text-gray-500 dark:text-gray-100"
123
+ },
124
+ progress: {
125
+ completed: "w-3 h-3 text-white",
126
+ base: "w-3 h-3 text-gray-500 dark:text-gray-100"
127
+ },
128
+ detailed: {
129
+ completed: "w-4 h-4 text-white",
130
+ base: "w-4 h-4 text-gray-600 dark:text-gray-300"
131
+ }
132
+ },
133
+ content: {
134
+ default: {
135
+ horizontal: "sm:ml-4 ml-2 mt-0",
136
+ vertical: "ml-4 mt-0"
137
+ },
138
+ progress: {
139
+ horizontal: "sm:ml-4 ml-2 mt-0",
140
+ vertical: "ml-4 mt-0"
141
+ },
142
+ detailed: {
143
+ horizontal: "sm:ml-6 ml-4 mt-0",
144
+ vertical: "ml-6 mt-0"
145
+ }
146
+ },
147
+ title: {
148
+ base: "text-gray-900 dark:text-white",
149
+ completed: "text-green-600 dark:text-green-300",
150
+ active: {
151
+ blue: "text-blue-600 dark:text-blue-300",
152
+ green: "text-green-600 dark:text-green-300",
153
+ red: "text-red-600 dark:text-red-300",
154
+ yellow: "text-yellow-600 dark:text-yellow-300",
155
+ indigo: "text-indigo-600 dark:text-indigo-300",
156
+ purple: "text-purple-600 dark:text-purple-300"
157
+ }
158
+ },
159
+ description: "text-sm text-gray-500 dark:text-gray-400",
160
+ connector: {
161
+ default: {
162
+ horizontal: "hidden sm:flex w-full bg-gray-200 h-0.5 dark:bg-gray-700",
163
+ vertical: "w-0.5 h-6 bg-gray-200 dark:bg-gray-700 mx-auto"
164
+ },
165
+ progress: {
166
+ horizontal: "hidden sm:flex w-full bg-gray-200 h-0.5 dark:bg-gray-700",
167
+ vertical: "w-0.5 h-6 bg-gray-200 dark:bg-gray-700 mx-auto"
168
+ },
169
+ detailed: {
170
+ horizontal: "hidden sm:flex w-full bg-gray-200 h-0.5 dark:bg-gray-700",
171
+ vertical: "w-0.5 h-6 bg-gray-200 dark:bg-gray-700 mx-auto"
172
+ },
173
+ completed: {
174
+ default: {
175
+ horizontal: "hidden sm:flex w-full bg-green-200 h-0.5 dark:bg-green-700",
176
+ vertical: "w-0.5 h-6 bg-green-200 dark:bg-green-700 mx-auto"
177
+ },
178
+ progress: {
179
+ horizontal: "hidden sm:flex w-full bg-green-200 h-0.5 dark:bg-green-700",
180
+ vertical: "w-0.5 h-6 bg-green-200 dark:bg-green-700 mx-auto"
181
+ },
182
+ detailed: {
183
+ horizontal: "hidden sm:flex w-full bg-green-200 h-0.5 dark:bg-green-700",
184
+ vertical: "w-0.5 h-6 bg-green-200 dark:bg-green-700 mx-auto"
185
+ }
186
+ },
187
+ active: {
188
+ blue: {
189
+ default: {
190
+ horizontal: "hidden sm:flex w-full bg-blue-200 h-0.5 dark:bg-blue-700",
191
+ vertical: "w-0.5 h-6 bg-blue-200 dark:bg-blue-700 mx-auto"
192
+ },
193
+ progress: {
194
+ horizontal: "hidden sm:flex w-full bg-blue-200 h-0.5 dark:bg-blue-700",
195
+ vertical: "w-0.5 h-6 bg-blue-200 dark:bg-blue-700"
196
+ },
197
+ detailed: {
198
+ horizontal: "hidden sm:flex w-full bg-blue-200 h-0.5 dark:bg-blue-700",
199
+ vertical: "w-0.5 h-6 bg-blue-200 dark:bg-blue-700"
200
+ }
201
+ },
202
+ green: {
203
+ default: {
204
+ horizontal: "hidden sm:flex w-full bg-green-200 h-0.5 dark:bg-green-700",
205
+ vertical: "ml-5 w-0.5 h-6 bg-green-200 dark:bg-green-700"
206
+ },
207
+ progress: {
208
+ horizontal: "hidden sm:flex w-full bg-green-200 h-0.5 dark:bg-green-700",
209
+ vertical: "w-0.5 h-6 bg-green-200 dark:bg-green-700 mx-auto"
210
+ },
211
+ detailed: {
212
+ horizontal: "hidden sm:flex w-full bg-green-200 h-0.5 dark:bg-green-700",
213
+ vertical: "w-0.5 h-6 bg-green-200 dark:bg-green-700 mx-auto"
214
+ }
215
+ },
216
+ red: {
217
+ default: {
218
+ horizontal: "hidden sm:flex w-full bg-red-200 h-0.5 dark:bg-red-700",
219
+ vertical: "ml-5 w-0.5 h-6 bg-red-200 dark:bg-red-700"
220
+ },
221
+ progress: {
222
+ horizontal: "hidden sm:flex w-full bg-red-200 h-0.5 dark:bg-red-700",
223
+ vertical: "w-0.5 h-6 bg-red-200 dark:bg-red-700 mx-auto"
224
+ },
225
+ detailed: {
226
+ horizontal: "hidden sm:flex w-full bg-red-200 h-0.5 dark:bg-red-700",
227
+ vertical: "w-0.5 h-6 bg-red-200 dark:bg-red-700 mx-auto"
228
+ }
229
+ },
230
+ yellow: {
231
+ default: {
232
+ horizontal: "hidden sm:flex w-full bg-yellow-200 h-0.5 dark:bg-yellow-700",
233
+ vertical: "ml-5 w-0.5 h-6 bg-yellow-200 dark:bg-yellow-700"
234
+ },
235
+ progress: {
236
+ horizontal: "hidden sm:flex w-full bg-yellow-200 h-0.5 dark:bg-yellow-700",
237
+ vertical: "w-0.5 h-6 bg-yellow-200 dark:bg-yellow-700 mx-auto"
238
+ },
239
+ detailed: {
240
+ horizontal: "hidden sm:flex w-full bg-yellow-200 h-0.5 dark:bg-yellow-700",
241
+ vertical: "w-0.5 h-6 bg-yellow-200 dark:bg-yellow-700 mx-auto"
242
+ }
243
+ },
244
+ indigo: {
245
+ default: {
246
+ horizontal: "hidden sm:flex w-full bg-indigo-200 h-0.5 dark:bg-indigo-700",
247
+ vertical: "ml-5 w-0.5 h-6 bg-indigo-200 dark:bg-indigo-700"
248
+ },
249
+ progress: {
250
+ horizontal: "hidden sm:flex w-full bg-indigo-200 h-0.5 dark:bg-indigo-700",
251
+ vertical: "w-0.5 h-6 bg-indigo-200 dark:bg-indigo-700 mx-auto"
252
+ },
253
+ detailed: {
254
+ horizontal: "hidden sm:flex w-full bg-indigo-200 h-0.5 dark:bg-indigo-700",
255
+ vertical: "w-0.5 h-6 bg-indigo-200 dark:bg-indigo-700 mx-auto"
256
+ }
257
+ },
258
+ purple: {
259
+ default: {
260
+ horizontal: "hidden sm:flex w-full bg-purple-200 h-0.5 dark:bg-purple-700",
261
+ vertical: "ml-5 w-0.5 h-6 bg-purple-200 dark:bg-purple-700"
262
+ },
263
+ progress: {
264
+ horizontal: "hidden sm:flex w-full bg-purple-200 h-0.5 dark:bg-purple-700",
265
+ vertical: "w-0.5 h-6 bg-purple-200 dark:bg-purple-700 mx-auto"
266
+ },
267
+ detailed: {
268
+ horizontal: "hidden sm:flex w-full bg-purple-200 h-0.5 dark:bg-purple-700",
269
+ vertical: "w-0.5 h-6 bg-purple-200 dark:bg-purple-700 mx-auto"
270
+ }
271
+ }
272
+ }
273
+ },
274
+ layout: {
275
+ wrapper: "relative",
276
+ flex_center: "flex items-center"
277
+ },
278
+ vertical_connector: {
279
+ base: "absolute top-full w-0.5 h-6",
280
+ positions: {
281
+ progress: "left-4", # w-8 circles
282
+ detailed: "left-6", # w-12 circles
283
+ default: "left-5" # w-10 circles
284
+ },
285
+ colors: {
286
+ completed: "bg-green-200 dark:bg-green-700",
287
+ default: "bg-gray-200 dark:bg-gray-700",
288
+ blue: "bg-blue-200 dark:bg-blue-700",
289
+ green: "bg-green-200 dark:bg-green-700",
290
+ red: "bg-red-200 dark:bg-red-700",
291
+ yellow: "bg-yellow-200 dark:bg-yellow-700",
292
+ indigo: "bg-indigo-200 dark:bg-indigo-700",
293
+ purple: "bg-purple-200 dark:bg-purple-700"
294
+ }
295
+ }
296
+ }
297
+ end
298
+ # rubocop: enable Layout/LineLength, Metrics/BlockLength
299
+ end