plutonium 0.14.1 → 0.15.0.pre.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. checksums.yaml +4 -4
  2. data/README copy.md +1 -1
  3. data/README.md +1 -1
  4. data/app/assets/plutonium.css +1 -1
  5. data/app/views/{application → plutonium}/_resource_header.html copy.erb +1 -1
  6. data/app/views/{application → plutonium}/_resource_header.html.erb +1 -1
  7. data/app/views/{application → plutonium}/_resource_sidebar.html.erb +2 -0
  8. data/app/views/resource/_resource_details.html.erb +1 -36
  9. data/app/views/resource/_resource_form.html.erb +1 -5
  10. data/app/views/resource/_resource_table.html.erb +315 -85
  11. data/app/views/resource/edit.html.erb +1 -5
  12. data/app/views/resource/index.html.erb +1 -5
  13. data/app/views/resource/new.html.erb +1 -5
  14. data/app/views/resource/show.html.erb +1 -5
  15. data/config/initializers/pagy.rb +1 -0
  16. data/config/initializers/rabl.rb +27 -20
  17. data/gemfiles/rails_7.gemfile.lock +5 -1
  18. data/lib/generators/pu/core/install/templates/app/controllers/plutonium_controller.rb.tt +2 -0
  19. data/lib/generators/pu/core/install/templates/app/controllers/resource_controller.rb.tt +21 -1
  20. data/lib/generators/pu/core/install/templates/app/definitions/resource_definition.rb.tt +2 -0
  21. data/lib/generators/pu/core/install/templates/app/models/resource_record.rb.tt +0 -2
  22. data/lib/generators/pu/core/install/templates/config/initializers/plutonium.rb +1 -8
  23. data/lib/generators/pu/eject/shell/shell_generator.rb +2 -2
  24. data/lib/generators/pu/lib/plutonium_generators/concerns/actions.rb +1 -1
  25. data/lib/generators/pu/lib/plutonium_generators/concerns/logger.rb +1 -1
  26. data/lib/generators/pu/lib/plutonium_generators/generator.rb +5 -3
  27. data/lib/generators/pu/lib/plutonium_generators/model_generator_base.rb +26 -2
  28. data/lib/generators/pu/pkg/{feature/feature_generator.rb → package/package_generator.rb} +4 -4
  29. data/lib/generators/pu/pkg/{feature → package}/templates/app/controllers/resource_controller.rb.tt +0 -2
  30. data/lib/generators/pu/pkg/package/templates/app/definitions/resource_definition.rb.tt +4 -0
  31. data/lib/generators/pu/pkg/package/templates/app/query_objects/resource_query_object.rb.tt +4 -0
  32. data/lib/generators/pu/pkg/{app/app_generator.rb → portal/portal_generator.rb} +10 -8
  33. data/lib/generators/pu/pkg/{app → portal}/templates/app/controllers/concerns/controller.rb.tt +3 -7
  34. data/lib/generators/pu/pkg/{app → portal}/templates/app/controllers/dashboard_controller.rb.tt +1 -1
  35. data/lib/generators/pu/pkg/portal/templates/app/controllers/plutonium_controller.rb.tt +5 -0
  36. data/lib/generators/pu/pkg/{app/templates/app/controllers/controller.rb.tt → portal/templates/app/controllers/resource_controller.rb.tt} +1 -1
  37. data/lib/generators/pu/pkg/portal/templates/app/definitions/resource_definition.rb.tt +4 -0
  38. data/lib/generators/pu/pkg/{app → portal}/templates/app/views/package/dashboard/index.html.erb +2 -1
  39. data/lib/generators/pu/res/conn/conn_generator.rb +78 -3
  40. data/lib/generators/pu/res/conn/templates/app/controllers/resource_controller.rb.tt +1 -1
  41. data/lib/generators/pu/res/conn/templates/app/definitions/resource_definition.rb.tt +3 -0
  42. data/lib/generators/pu/res/conn/templates/app/policies/resource_policy.rb.tt +29 -1
  43. data/lib/generators/pu/res/conn/templates/app/presenters/resource_presenter.rb.tt +1 -1
  44. data/lib/generators/pu/res/conn/templates/app/query_objects/resource_query_object.rb.tt +1 -1
  45. data/lib/generators/pu/res/model/model_generator.rb +0 -7
  46. data/lib/generators/pu/res/model/templates/model.rb.tt +4 -1
  47. data/lib/generators/pu/res/scaffold/scaffold_generator.rb +22 -4
  48. data/lib/generators/pu/res/scaffold/templates/controller.rb.tt +0 -1
  49. data/lib/generators/pu/res/scaffold/templates/definition.rb.tt +4 -0
  50. data/lib/generators/pu/res/scaffold/templates/policy.rb.tt +2 -2
  51. data/lib/generators/pu/rodauth/templates/app/controllers/rodauth_controller.rb.tt +1 -1
  52. data/lib/generators/pu/rodauth/templates/app/rodauth/account_rodauth_plugin.rb.tt +270 -0
  53. data/lib/plutonium/action/README.md +0 -0
  54. data/lib/plutonium/action/base.rb +103 -0
  55. data/lib/plutonium/action/interactive.rb +117 -0
  56. data/lib/plutonium/action/route_options.rb +65 -0
  57. data/lib/plutonium/action/simple.rb +8 -0
  58. data/lib/plutonium/auth.rb +1 -1
  59. data/lib/plutonium/configuration.rb +0 -8
  60. data/lib/plutonium/core/actions/collection.rb +1 -1
  61. data/lib/plutonium/core/associations/renderers/factory.rb +3 -1
  62. data/lib/plutonium/core/controller.rb +110 -0
  63. data/lib/plutonium/core/controllers/authorizable.rb +12 -35
  64. data/lib/plutonium/core/controllers/bootable.rb +38 -7
  65. data/lib/plutonium/core/controllers/entity_scoping.rb +6 -2
  66. data/lib/plutonium/core/fields/renderers/association_renderer.rb +1 -1
  67. data/lib/plutonium/core/ui/collection.rb +1 -1
  68. data/lib/plutonium/core/ui/detail.rb +1 -1
  69. data/lib/plutonium/core/ui/form.rb +1 -1
  70. data/lib/plutonium/definition/actions.rb +50 -0
  71. data/lib/plutonium/definition/base.rb +92 -0
  72. data/lib/plutonium/definition/config_attr.rb +30 -0
  73. data/lib/plutonium/definition/defineable_props.rb +96 -0
  74. data/lib/plutonium/definition/search.rb +21 -0
  75. data/lib/plutonium/engine/validator.rb +30 -0
  76. data/lib/plutonium/engine.rb +25 -0
  77. data/lib/plutonium/helpers/form_helper.rb +1 -3
  78. data/lib/plutonium/interaction/README.md +369 -0
  79. data/lib/plutonium/interaction/base.rb +75 -0
  80. data/lib/plutonium/interaction/concerns/presentable.rb +61 -0
  81. data/lib/plutonium/interaction/concerns/workflow_dsl.rb +82 -0
  82. data/lib/plutonium/interaction/outcome.rb +129 -0
  83. data/lib/plutonium/interaction/response/base.rb +63 -0
  84. data/lib/plutonium/interaction/response/null.rb +33 -0
  85. data/lib/plutonium/interaction/response/redirect.rb +30 -0
  86. data/lib/plutonium/interaction/response/render.rb +28 -0
  87. data/lib/plutonium/lib/bit_flags.rb +70 -9
  88. data/lib/plutonium/{config → lib}/overlayed_hash.rb +1 -1
  89. data/lib/plutonium/lib/smart_cache.rb +171 -0
  90. data/lib/plutonium/models/has_cents.rb +170 -0
  91. data/lib/plutonium/{pkg/base.rb → package/engine.rb} +10 -2
  92. data/lib/plutonium/{application → portal}/controller.rb +3 -11
  93. data/lib/plutonium/{application → portal}/dynamic_controllers.rb +4 -4
  94. data/lib/plutonium/portal/engine.rb +15 -0
  95. data/lib/plutonium/railtie.rb +33 -1
  96. data/lib/plutonium/reloader.rb +5 -5
  97. data/lib/plutonium/resource/controller.rb +51 -34
  98. data/lib/plutonium/resource/controllers/authorizable.rb +128 -0
  99. data/lib/plutonium/{core → resource}/controllers/crud_actions.rb +23 -22
  100. data/lib/plutonium/resource/controllers/defineable.rb +26 -0
  101. data/lib/plutonium/{core → resource}/controllers/interactive_actions.rb +12 -12
  102. data/lib/plutonium/resource/controllers/presentable.rb +41 -0
  103. data/lib/plutonium/resource/controllers/queryable.rb +44 -0
  104. data/lib/plutonium/resource/definition.rb +6 -0
  105. data/lib/plutonium/resource/policy.rb +25 -13
  106. data/lib/plutonium/resource/query_object.rb +50 -51
  107. data/lib/plutonium/resource/record.rb +6 -89
  108. data/lib/plutonium/resource/register.rb +82 -0
  109. data/lib/plutonium/routing/mapper_extensions.rb +1 -1
  110. data/lib/plutonium/routing/resource_registration.rb +1 -1
  111. data/lib/plutonium/routing/route_set_extensions.rb +6 -18
  112. data/lib/plutonium/ui/action_button.rb +125 -0
  113. data/lib/plutonium/ui/breadcrumbs.rb +163 -0
  114. data/lib/plutonium/ui/component/base.rb +13 -0
  115. data/lib/plutonium/ui/component/behaviour.rb +38 -0
  116. data/lib/plutonium/ui/component/kit.rb +31 -0
  117. data/lib/plutonium/ui/component/methods.rb +54 -0
  118. data/lib/plutonium/ui/display/base.rb +25 -0
  119. data/lib/plutonium/ui/display/component/association.rb +26 -0
  120. data/lib/plutonium/ui/display/resource.rb +77 -0
  121. data/lib/plutonium/ui/display/theme.rb +27 -0
  122. data/lib/plutonium/ui/dyna_frame/content.rb +20 -0
  123. data/lib/plutonium/ui/empty_card.rb +20 -0
  124. data/lib/plutonium/ui/form/base.rb +37 -0
  125. data/lib/plutonium/ui/form/resource.rb +75 -0
  126. data/lib/plutonium/ui/form/theme.rb +42 -0
  127. data/lib/plutonium/ui/page/base.rb +112 -0
  128. data/lib/plutonium/ui/page/edit.rb +23 -0
  129. data/lib/plutonium/ui/page/index.rb +27 -0
  130. data/lib/plutonium/ui/page/new.rb +23 -0
  131. data/lib/plutonium/ui/page/show.rb +27 -0
  132. data/lib/plutonium/ui/page_header.rb +49 -0
  133. data/lib/plutonium/ui/table/base.rb +13 -0
  134. data/lib/plutonium/ui/table/components/pagy_info.rb +70 -0
  135. data/lib/plutonium/ui/table/components/pagy_page_info.rb +70 -0
  136. data/lib/plutonium/ui/table/components/pagy_pagination.rb +105 -0
  137. data/lib/plutonium/ui/table/components/scopes_bar.rb +136 -0
  138. data/lib/plutonium/ui/table/components/search_bar.rb +158 -0
  139. data/lib/plutonium/ui/table/display_theme.rb +21 -0
  140. data/lib/plutonium/ui/table/resource.rb +98 -0
  141. data/lib/plutonium/ui/table/theme.rb +35 -0
  142. data/lib/plutonium/ui.rb +9 -0
  143. data/lib/plutonium/version.rb +5 -1
  144. data/lib/plutonium.rb +14 -1
  145. data/package-lock.json +19 -22
  146. data/package.json +4 -4
  147. data/src/css/plutonium.css +15 -0
  148. data/tailwind.options.js +11 -3
  149. metadata +218 -81
  150. data/lib/generators/pu/core/install/templates/app/presenters/resource_presenter.rb.tt +0 -2
  151. data/lib/generators/pu/core/install/templates/app/query_objects/resource_query_object.rb.tt +0 -2
  152. data/lib/generators/pu/pkg/feature/templates/app/query_objects/resource_query_object.rb.tt +0 -4
  153. data/lib/plutonium/concerns/resource_validatable.rb +0 -34
  154. data/lib/plutonium/config.rb +0 -9
  155. data/lib/plutonium/core/controllers/base.rb +0 -101
  156. data/lib/plutonium/core/controllers/presentable.rb +0 -65
  157. data/lib/plutonium/core/controllers/queryable.rb +0 -28
  158. data/lib/plutonium/pkg/app.rb +0 -35
  159. data/lib/plutonium/pkg/concerns/resource_validatable.rb +0 -36
  160. data/lib/plutonium/pkg/feature.rb +0 -18
  161. data/lib/plutonium/policy/initializer.rb +0 -22
  162. data/lib/plutonium/policy/scope.rb +0 -19
  163. data/lib/plutonium/pundit/context.rb +0 -18
  164. data/lib/plutonium/pundit/policy_finder.rb +0 -25
  165. data/lib/plutonium/resource/policy_context.rb +0 -5
  166. data/lib/plutonium/resource_register.rb +0 -83
  167. data/lib/plutonium/smart_cache.rb +0 -151
  168. /data/app/views/{application → plutonium}/_flash.html.erb +0 -0
  169. /data/app/views/{application → plutonium}/_flash_alerts.html.erb +0 -0
  170. /data/app/views/{application → plutonium}/_flash_toasts.html.erb +0 -0
  171. /data/lib/generators/pu/pkg/{app/templates/app/views/package → package/templates}/.keep +0 -0
  172. /data/lib/generators/pu/pkg/{feature → package}/templates/app/interactions/resource_interaction.rb.tt +0 -0
  173. /data/lib/generators/pu/pkg/{feature → package}/templates/app/models/resource_record.rb.tt +0 -0
  174. /data/lib/generators/pu/pkg/{feature → package}/templates/app/policies/resource_policy.rb.tt +0 -0
  175. /data/lib/generators/pu/pkg/{feature → package}/templates/app/presenters/resource_presenter.rb.tt +0 -0
  176. /data/lib/generators/pu/pkg/{feature → package}/templates/lib/engine.rb.tt +0 -0
  177. /data/lib/generators/pu/pkg/{app → portal}/templates/app/policies/resource_policy.rb.tt +0 -0
  178. /data/lib/generators/pu/pkg/{app → portal}/templates/app/presenters/resource_presenter.rb.tt +0 -0
  179. /data/lib/generators/pu/pkg/{app → portal}/templates/app/query_objects/resource_query_object.rb.tt +0 -0
  180. /data/lib/generators/pu/pkg/{feature/templates → portal/templates/app/views/package}/.keep +0 -0
  181. /data/lib/generators/pu/pkg/{app → portal}/templates/config/routes.rb.tt +0 -0
  182. /data/lib/generators/pu/pkg/{app → portal}/templates/lib/engine.rb.tt +0 -0
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Plutonium
4
+ module UI
5
+ module Table
6
+ class Theme < Phlexi::Table::Theme
7
+ def self.theme
8
+ super.merge({
9
+ selection_checkbox: "w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",
10
+ name_column: "font-medium text-gray-900 whitespace-nowrap dark:text-white",
11
+ align_start: "text-start",
12
+ align_end: "text-end",
13
+ wrapper: "relative overflow-x-auto shadow-md sm:rounded-lg",
14
+ base: "w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400",
15
+ caption: "p-5 text-lg font-semibold text-left rtl:text-right text-gray-900 bg-white dark:text-white dark:bg-gray-800",
16
+ description: "mt-1 text-sm font-normal text-gray-500 dark:text-gray-400",
17
+ header: "text-xs text-gray-700 uppercase bg-gray-200 dark:bg-gray-700 dark:text-gray-400",
18
+ header_grouping_cell: "px-6 py-3 text-center text-sm border-b border-t border-r last:border-r-0 dark:border-gray-800",
19
+ header_cell: "px-6 py-3",
20
+ header_cell_content_wrapper: "inline-flex items-center",
21
+ header_cell_sort_wrapper: "flex items-center",
22
+ header_cell_sort_indicator: "ml-1.5",
23
+ body_row: "bg-white border-b last:border-none dark:bg-gray-800 dark:border-gray-700",
24
+ body_cell: "px-6 py-4 whitespace-pre max-w-[310px] hover:max-w-[600px] overflow-hidden text-ellipsis transition-all duration-300 ease-in-out",
25
+ sort_icon: "w-3 h-3",
26
+ sort_icon_active: "text-primary-600",
27
+ sort_index_clear_link: "ml-2",
28
+ sort_index_clear_link_text: "text-xs font-bold",
29
+ sort_index_clear_link_icon: "ml-1 text-red-600"
30
+ })
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tailwind_merge"
4
+
5
+ module Plutonium
6
+ module UI
7
+ TAILWIND_MERGER = TailwindMerge::Merger.new
8
+ end
9
+ end
@@ -1,3 +1,7 @@
1
1
  module Plutonium
2
- VERSION = "0.14.1"
2
+ VERSION = "0.15.0-rc1"
3
+ NEXT_MAJOR_VERSION = VERSION.split(".").tap { |v|
4
+ v[1] = v[1].to_i + 1
5
+ v[2] = 0
6
+ }.join(".")
3
7
  end
data/lib/plutonium.rb CHANGED
@@ -1,6 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "zeitwerk"
4
+ require "action_policy"
5
+ require "phlex"
6
+ require "phlex-rails"
7
+ require "phlex/tabler_icons"
8
+ require "phlexi-display"
9
+ require "phlexi-form"
10
+ require "phlexi-table"
11
+
4
12
  require_relative "plutonium/configuration"
5
13
 
6
14
  # Plutonium module
@@ -14,14 +22,19 @@ module Plutonium
14
22
 
15
23
  # Set up Zeitwerk loader for the Plutonium gem
16
24
  # @return [Zeitwerk::Loader] configured Zeitwerk loader instance
17
- ZEITWERK_LOADER = Zeitwerk::Loader.for_gem(warn_on_extra_files: false).tap do |loader|
25
+ Loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false).tap do |loader|
18
26
  loader.ignore("#{__dir__}/generators")
19
27
  loader.ignore("#{__dir__}/plutonium/railtie.rb")
28
+ loader.inflector.inflect("ui" => "UI")
20
29
  loader.enable_reloading if defined?(Rails.env) && Rails.env.development?
21
30
  loader.setup
22
31
  end
23
32
 
24
33
  class << self
34
+ def deprecator
35
+ @deprecator ||= ActiveSupport::Deprecation.new("1.0", "Plutonium")
36
+ end
37
+
25
38
  # Get the root directory of the gem
26
39
  #
27
40
  # @return [Pathname] the root directory path
data/package-lock.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
- "name": "@plutonium-rails/core",
3
- "version": "0.1.0",
2
+ "name": "@radioactive-labs/plutonium",
3
+ "version": "0.1.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
- "name": "@plutonium-rails/core",
9
- "version": "0.1.0",
8
+ "name": "@radioactive-labs/plutonium",
9
+ "version": "0.1.3",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@hotwired/stimulus": "^3.2.2",
13
13
  "@hotwired/turbo": "^8.0.4",
14
+ "flowbite": "^2.3.0",
14
15
  "lodash.debounce": "^4.0.8"
15
16
  },
16
17
  "devDependencies": {
@@ -20,7 +21,6 @@
20
21
  "cssnano": "^7.0.2",
21
22
  "esbuild": "^0.20.1",
22
23
  "esbuild-plugin-manifest": "^1.0.3",
23
- "flowbite": "^2.3.0",
24
24
  "postcss": "^8.4.35",
25
25
  "postcss-cli": "^11.0.0",
26
26
  "postcss-hash": "^3.0.0",
@@ -546,7 +546,6 @@
546
546
  "version": "2.11.8",
547
547
  "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
548
548
  "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
549
- "dev": true,
550
549
  "funding": {
551
550
  "type": "opencollective",
552
551
  "url": "https://opencollective.com/popperjs"
@@ -702,12 +701,12 @@
702
701
  }
703
702
  },
704
703
  "node_modules/braces": {
705
- "version": "3.0.2",
706
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
707
- "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
704
+ "version": "3.0.3",
705
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
706
+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
708
707
  "dev": true,
709
708
  "dependencies": {
710
- "fill-range": "^7.0.1"
709
+ "fill-range": "^7.1.1"
711
710
  },
712
711
  "engines": {
713
712
  "node": ">=8"
@@ -767,9 +766,9 @@
767
766
  }
768
767
  },
769
768
  "node_modules/caniuse-lite": {
770
- "version": "1.0.30001596",
771
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001596.tgz",
772
- "integrity": "sha512-zpkZ+kEr6We7w63ORkoJ2pOfBwBkY/bJrG/UZ90qNb45Isblu8wzDgevEOrRL1r9dWayHjYiiyCMEXPn4DweGQ==",
769
+ "version": "1.0.30001658",
770
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001658.tgz",
771
+ "integrity": "sha512-N2YVqWbJELVdrnsW5p+apoQyYt51aBMSsBZki1XZEfeBCexcM/sf4xiAHcXQBkuOwJBXtWF7aW1sYX6tKebPHw==",
773
772
  "dev": true,
774
773
  "funding": [
775
774
  {
@@ -1431,9 +1430,9 @@
1431
1430
  }
1432
1431
  },
1433
1432
  "node_modules/fill-range": {
1434
- "version": "7.0.1",
1435
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
1436
- "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
1433
+ "version": "7.1.1",
1434
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
1435
+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
1437
1436
  "dev": true,
1438
1437
  "dependencies": {
1439
1438
  "to-regex-range": "^5.0.1"
@@ -1446,7 +1445,6 @@
1446
1445
  "version": "2.3.0",
1447
1446
  "resolved": "https://registry.npmjs.org/flowbite/-/flowbite-2.3.0.tgz",
1448
1447
  "integrity": "sha512-pm3JRo8OIJHGfFYWgaGpPv8E+UdWy0Z3gEAGufw+G/1dusaU/P1zoBLiQpf2/+bYAi+GBQtPVG86KYlV0W+AFQ==",
1449
- "dev": true,
1450
1448
  "dependencies": {
1451
1449
  "@popperjs/core": "^2.9.3",
1452
1450
  "mini-svg-data-uri": "^1.4.3"
@@ -1800,12 +1798,12 @@
1800
1798
  }
1801
1799
  },
1802
1800
  "node_modules/micromatch": {
1803
- "version": "4.0.5",
1804
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
1805
- "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
1801
+ "version": "4.0.8",
1802
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
1803
+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
1806
1804
  "dev": true,
1807
1805
  "dependencies": {
1808
- "braces": "^3.0.2",
1806
+ "braces": "^3.0.3",
1809
1807
  "picomatch": "^2.3.1"
1810
1808
  },
1811
1809
  "engines": {
@@ -1816,7 +1814,6 @@
1816
1814
  "version": "1.4.4",
1817
1815
  "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz",
1818
1816
  "integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==",
1819
- "dev": true,
1820
1817
  "bin": {
1821
1818
  "mini-svg-data-uri": "cli.js"
1822
1819
  }
data/package.json CHANGED
@@ -19,21 +19,21 @@
19
19
  "homepage": "https://github.com/radioactive-labs/plutonium-core#readme",
20
20
  "dependencies": {
21
21
  "@hotwired/stimulus": "^3.2.2",
22
- "lodash.debounce": "^4.0.8",
23
22
  "@hotwired/turbo": "^8.0.4",
24
- "flowbite": "^2.3.0"
23
+ "flowbite": "^2.3.0",
24
+ "lodash.debounce": "^4.0.8"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@tailwindcss/forms": "^0.5.7",
28
28
  "autoprefixer": "^10.4.18",
29
29
  "concurrently": "^8.2.2",
30
+ "cssnano": "^7.0.2",
30
31
  "esbuild": "^0.20.1",
31
32
  "esbuild-plugin-manifest": "^1.0.3",
32
33
  "postcss": "^8.4.35",
33
34
  "postcss-cli": "^11.0.0",
34
35
  "postcss-hash": "^3.0.0",
35
- "tailwindcss": "^3.4.1",
36
- "cssnano": "^7.0.2"
36
+ "tailwindcss": "^3.4.1"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "npm run js:prod && npm run css:prod",
@@ -1,3 +1,18 @@
1
1
  @tailwind base;
2
2
  @tailwind components;
3
3
  @tailwind utilities;
4
+
5
+
6
+ @layer components {
7
+ .pu-color-input::-webkit-color-swatch-wrapper {
8
+ @apply p-0;
9
+ }
10
+
11
+ .pu-color-input::-webkit-color-swatch {
12
+ @apply border-none rounded-lg;
13
+ }
14
+
15
+ .pu-color-input::-moz-color-swatch {
16
+ @apply border-none rounded-lg;
17
+ }
18
+ }
data/tailwind.options.js CHANGED
@@ -2,13 +2,11 @@ export const content = [
2
2
  `${__dirname}/src/**/*.{css,js}`,
3
3
  `${__dirname}/app/views/**/*.{rb,erb,js}`,
4
4
  `${__dirname}/config/initializers/simple_form.rb`,
5
+ `${__dirname}/lib/plutonium/**/*.rb`,
5
6
 
6
7
  // node modules are not packaged as part of the gem.
7
8
  // requires users to have flowbite installed in their own project.
8
9
  './node_modules/flowbite/**/*.js',
9
- // TODO: temporary workaround for legacy components.
10
- // To be removed after converting buttons_helper and other files containing tailwind to components .
11
- // `${__dirname}/lib/plutonium/**/*.{rb,erb}`
12
10
  ];
13
11
  export const darkMode = "selector";
14
12
  export const plugins = [
@@ -71,6 +69,16 @@ export const theme = {
71
69
  'Segoe UI Emoji',
72
70
  'Segoe UI Symbol',
73
71
  'Noto Color Emoji'
72
+ ],
73
+ 'mono': [
74
+ 'ui-monospace',
75
+ 'SFMono-Regular',
76
+ 'Menlo',
77
+ 'Monaco',
78
+ 'Consolas',
79
+ 'Liberation Mono',
80
+ 'Courier New',
81
+ 'monospace'
74
82
  ]
75
83
  }
76
84
  };