panda_cms 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +71 -0
  3. data/Rakefile +8 -0
  4. data/app/assets/builds/panda_cms.css +1 -0
  5. data/app/assets/config/panda_cms_manifest.js +1 -0
  6. data/app/assets/stylesheets/panda_cms/application.tailwind.css +61 -0
  7. data/app/builders/panda_cms/form_builder.rb +118 -0
  8. data/app/components/panda_cms/admin/button_component.rb +65 -0
  9. data/app/components/panda_cms/admin/container_component.html.erb +13 -0
  10. data/app/components/panda_cms/admin/container_component.rb +11 -0
  11. data/app/components/panda_cms/admin/flash_message_component.html.erb +30 -0
  12. data/app/components/panda_cms/admin/flash_message_component.rb +44 -0
  13. data/app/components/panda_cms/admin/heading_component.rb +43 -0
  14. data/app/components/panda_cms/admin/panel_component.html.erb +7 -0
  15. data/app/components/panda_cms/admin/panel_component.rb +11 -0
  16. data/app/components/panda_cms/admin/slideover_component.html.erb +9 -0
  17. data/app/components/panda_cms/admin/slideover_component.rb +13 -0
  18. data/app/components/panda_cms/admin/statistics_component.html.erb +4 -0
  19. data/app/components/panda_cms/admin/statistics_component.rb +15 -0
  20. data/app/components/panda_cms/admin/tab_bar_component.html.erb +35 -0
  21. data/app/components/panda_cms/admin/tab_bar_component.rb +13 -0
  22. data/app/components/panda_cms/admin/table_component.html.erb +21 -0
  23. data/app/components/panda_cms/admin/table_component.rb +43 -0
  24. data/app/components/panda_cms/admin/tag_component.rb +33 -0
  25. data/app/components/panda_cms/admin/user_activity_component.html.erb +5 -0
  26. data/app/components/panda_cms/admin/user_activity_component.rb +19 -0
  27. data/app/components/panda_cms/admin/user_display_component.html.erb +11 -0
  28. data/app/components/panda_cms/admin/user_display_component.rb +19 -0
  29. data/app/components/panda_cms/grid_component.html.erb +6 -0
  30. data/app/components/panda_cms/grid_component.rb +13 -0
  31. data/app/components/panda_cms/menu_component.html.erb +3 -0
  32. data/app/components/panda_cms/menu_component.rb +18 -0
  33. data/app/components/panda_cms/page_menu_component.html.erb +24 -0
  34. data/app/components/panda_cms/page_menu_component.rb +24 -0
  35. data/app/components/panda_cms/rich_text_component.html.erb +40 -0
  36. data/app/components/panda_cms/rich_text_component.rb +35 -0
  37. data/app/components/panda_cms/text_component.rb +67 -0
  38. data/app/constraints/panda_cms/admin_constraint.rb +16 -0
  39. data/app/controllers/panda_cms/admin/block_contents_controller.rb +44 -0
  40. data/app/controllers/panda_cms/admin/dashboard_controller.rb +31 -0
  41. data/app/controllers/panda_cms/admin/files_controller.rb +19 -0
  42. data/app/controllers/panda_cms/admin/forms_controller.rb +51 -0
  43. data/app/controllers/panda_cms/admin/menus_controller.rb +81 -0
  44. data/app/controllers/panda_cms/admin/pages_controller.rb +88 -0
  45. data/app/controllers/panda_cms/admin/posts_controller.rb +34 -0
  46. data/app/controllers/panda_cms/admin/sessions_controller.rb +83 -0
  47. data/app/controllers/panda_cms/admin/settings/bulk_editor_controller.rb +35 -0
  48. data/app/controllers/panda_cms/admin/settings_controller.rb +18 -0
  49. data/app/controllers/panda_cms/application_controller.rb +55 -0
  50. data/app/controllers/panda_cms/errors_controller.rb +31 -0
  51. data/app/controllers/panda_cms/form_submissions_controller.rb +21 -0
  52. data/app/controllers/panda_cms/pages_controller.rb +56 -0
  53. data/app/controllers/panda_cms/posts_controller.rb +17 -0
  54. data/app/helpers/panda_cms/admin/files_helper.rb +4 -0
  55. data/app/helpers/panda_cms/admin/pages_helper.rb +4 -0
  56. data/app/helpers/panda_cms/application_helper.rb +96 -0
  57. data/app/helpers/panda_cms/pages_helper.rb +4 -0
  58. data/app/helpers/panda_cms/theme_helper.rb +16 -0
  59. data/app/javascript/base.js +37 -0
  60. data/app/javascript/controllers/menu_controller.js +19 -0
  61. data/app/javascript/controllers/text_controller.js +78 -0
  62. data/app/javascript/controllers/text_field_update_controller.js +23 -0
  63. data/app/javascript/vendor/stimulus-components-rails-nested-form.js +2 -0
  64. data/app/javascript/vendor/tailwindcss-stimulus-components.js +2 -0
  65. data/app/jobs/panda_cms/application_job.rb +4 -0
  66. data/app/jobs/panda_cms/record_visit_job.rb +29 -0
  67. data/app/lib/panda_cms/bulk_editor.rb +169 -0
  68. data/app/lib/panda_cms/demo_site_generator.rb +70 -0
  69. data/app/lib/panda_cms/slug.rb +22 -0
  70. data/app/mailers/panda_cms/application_mailer.rb +6 -0
  71. data/app/mailers/panda_cms/form_mailer.rb +19 -0
  72. data/app/models/panda_cms/application_record.rb +5 -0
  73. data/app/models/panda_cms/block.rb +32 -0
  74. data/app/models/panda_cms/block_content.rb +16 -0
  75. data/app/models/panda_cms/block_content_version.rb +6 -0
  76. data/app/models/panda_cms/breadcrumb.rb +10 -0
  77. data/app/models/panda_cms/current.rb +15 -0
  78. data/app/models/panda_cms/form.rb +7 -0
  79. data/app/models/panda_cms/form_submission.rb +5 -0
  80. data/app/models/panda_cms/menu.rb +50 -0
  81. data/app/models/panda_cms/menu_item.rb +56 -0
  82. data/app/models/panda_cms/page.rb +81 -0
  83. data/app/models/panda_cms/page_version.rb +6 -0
  84. data/app/models/panda_cms/post.rb +25 -0
  85. data/app/models/panda_cms/post_version.rb +6 -0
  86. data/app/models/panda_cms/redirect.rb +9 -0
  87. data/app/models/panda_cms/template.rb +117 -0
  88. data/app/models/panda_cms/template_version.rb +6 -0
  89. data/app/models/panda_cms/user.rb +15 -0
  90. data/app/models/panda_cms/version.rb +6 -0
  91. data/app/models/panda_cms/visit.rb +7 -0
  92. data/app/views/layouts/panda_cms/application.html.erb +44 -0
  93. data/app/views/layouts/panda_cms/public.html.erb +3 -0
  94. data/app/views/panda_cms/admin/dashboard/show.html.erb +11 -0
  95. data/app/views/panda_cms/admin/files/index.html.erb +124 -0
  96. data/app/views/panda_cms/admin/files/show.html.erb +2 -0
  97. data/app/views/panda_cms/admin/forms/edit.html.erb +0 -0
  98. data/app/views/panda_cms/admin/forms/index.html.erb +13 -0
  99. data/app/views/panda_cms/admin/forms/new.html.erb +16 -0
  100. data/app/views/panda_cms/admin/forms/show.html.erb +35 -0
  101. data/app/views/panda_cms/admin/menus/_form.html.erb +21 -0
  102. data/app/views/panda_cms/admin/menus/_menu_item_fields.html.erb +7 -0
  103. data/app/views/panda_cms/admin/menus/edit.html.erb +58 -0
  104. data/app/views/panda_cms/admin/menus/index.html.erb +10 -0
  105. data/app/views/panda_cms/admin/menus/new.html.erb +5 -0
  106. data/app/views/panda_cms/admin/pages/edit.html.erb +26 -0
  107. data/app/views/panda_cms/admin/pages/index.html.erb +16 -0
  108. data/app/views/panda_cms/admin/pages/new.html.erb +16 -0
  109. data/app/views/panda_cms/admin/pages/show.html.erb +1 -0
  110. data/app/views/panda_cms/admin/posts/index.html.erb +16 -0
  111. data/app/views/panda_cms/admin/sessions/new.html.erb +18 -0
  112. data/app/views/panda_cms/admin/settings/bulk_editor/new.html.erb +68 -0
  113. data/app/views/panda_cms/admin/settings/index.html.erb +19 -0
  114. data/app/views/panda_cms/admin/shared/_breadcrumbs.html.erb +28 -0
  115. data/app/views/panda_cms/admin/shared/_flash.html.erb +5 -0
  116. data/app/views/panda_cms/admin/shared/_sidebar.html.erb +45 -0
  117. data/app/views/panda_cms/form_mailer/notification_email.html.erb +11 -0
  118. data/app/views/panda_cms/shared/_favicons.html.erb +9 -0
  119. data/app/views/panda_cms/shared/_footer.html.erb +2 -0
  120. data/app/views/panda_cms/shared/_header.html.erb +15 -0
  121. data/config/importmap.rb +9 -0
  122. data/config/initializers/panda_cms/form_errors.rb +38 -0
  123. data/config/initializers/panda_cms/healthcheck_log_silencer.rb +11 -0
  124. data/config/initializers/panda_cms.rb +52 -0
  125. data/config/locales/en.yml +29 -0
  126. data/config/routes.rb +43 -0
  127. data/config/tailwind.config.js +35 -0
  128. data/config/tailwind.embed.config.js +20 -0
  129. data/db/migrate/20240205223709_create_panda_cms_pages.rb +9 -0
  130. data/db/migrate/20240219213327_create_panda_cms_page_versions.rb +14 -0
  131. data/db/migrate/20240303002805_create_panda_cms_templates.rb +11 -0
  132. data/db/migrate/20240303003434_create_panda_cms_template_versions.rb +14 -0
  133. data/db/migrate/20240303022441_create_panda_cms_blocks.rb +13 -0
  134. data/db/migrate/20240303024256_create_panda_cms_block_contents.rb +10 -0
  135. data/db/migrate/20240303024746_create_panda_cms_block_content_versions.rb +14 -0
  136. data/db/migrate/20240303233238_add_panda_cms_menu_table.rb +10 -0
  137. data/db/migrate/20240303234724_add_panda_cms_menu_item_table.rb +12 -0
  138. data/db/migrate/20240304134343_add_parent_id_to_panda_cms_pages.rb +5 -0
  139. data/db/migrate/20240315125421_add_nested_sets_to_panda_cms_pages.rb +16 -0
  140. data/db/migrate/20240316212822_add_kind_to_panda_cms_menus.rb +6 -0
  141. data/db/migrate/20240316221425_add_start_page_to_panda_cms_menus.rb +5 -0
  142. data/db/migrate/20240316230706_add_nested_to_panda_cms_menu_items.rb +24 -0
  143. data/db/migrate/20240317010532_create_panda_cms_users.rb +12 -0
  144. data/db/migrate/20240317161534_add_max_uses_to_panda_cms_template.rb +7 -0
  145. data/db/migrate/20240317163053_reset_counter_cache_on_panda_cms_template.rb +5 -0
  146. data/db/migrate/20240317214827_create_panda_cms_redirects.rb +14 -0
  147. data/db/migrate/20240317230622_create_panda_cms_visits.rb +13 -0
  148. data/db/migrate/20240324205703_create_active_storage_tables.active_storage.rb +58 -0
  149. data/db/migrate/20240408084718_default_panda_cms_users_admin_to_false.rb +5 -0
  150. data/db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb +22 -0
  151. data/db/migrate/20240701225423_create_active_storage_variant_records.active_storage.rb +28 -0
  152. data/db/migrate/20240701225424_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb +8 -0
  153. data/db/migrate/20240804110225_add_status_to_panda_cms_pages.rb +7 -0
  154. data/db/migrate/20240804235210_create_panda_cms_forms.rb +11 -0
  155. data/db/migrate/20240805013612_create_panda_cms_form_submissions.rb +9 -0
  156. data/db/migrate/20240805121123_create_panda_cms_posts.rb +27 -0
  157. data/db/migrate/20240805123104_create_panda_cms_post_versions.rb +14 -0
  158. data/db/migrate/20240806112735_fix_panda_cms_visits_column_names.rb +13 -0
  159. data/db/migrate/20240806204412_add_completion_path_to_panda_cms_forms.rb +5 -0
  160. data/db/migrate/20240820081917_change_form_submissions_to_submission_count.rb +5 -0
  161. data/db/seeds.rb +4 -0
  162. data/lib/generators/panda_cms/install_generator.rb +24 -0
  163. data/lib/panda_cms/engine.rb +167 -0
  164. data/lib/panda_cms/exceptions_app.rb +24 -0
  165. data/lib/panda_cms/version.rb +3 -0
  166. data/lib/panda_cms.rb +15 -0
  167. data/lib/tasks/panda_cms.rake +92 -0
  168. data/lib/templates/erb/scaffold/_form.html.erb.tt +43 -0
  169. data/lib/templates/erb/scaffold/edit.html.erb.tt +8 -0
  170. data/lib/templates/erb/scaffold/index.html.erb.tt +14 -0
  171. data/lib/templates/erb/scaffold/new.html.erb.tt +7 -0
  172. data/lib/templates/erb/scaffold/partial.html.erb.tt +22 -0
  173. data/lib/templates/erb/scaffold/show.html.erb.tt +15 -0
  174. data/public/panda-cms-assets/favicons/android-chrome-192x192.png +0 -0
  175. data/public/panda-cms-assets/favicons/android-chrome-512x512.png +0 -0
  176. data/public/panda-cms-assets/favicons/apple-touch-icon.png +0 -0
  177. data/public/panda-cms-assets/favicons/browserconfig.xml +9 -0
  178. data/public/panda-cms-assets/favicons/favicon-16x16.png +0 -0
  179. data/public/panda-cms-assets/favicons/favicon-32x32.png +0 -0
  180. data/public/panda-cms-assets/favicons/favicon.ico +0 -0
  181. data/public/panda-cms-assets/favicons/mstile-150x150.png +0 -0
  182. data/public/panda-cms-assets/favicons/safari-pinned-tab.svg +61 -0
  183. data/public/panda-cms-assets/favicons/site.webmanifest +14 -0
  184. data/public/panda-cms-assets/javascripts/base.js +37 -0
  185. data/public/panda-cms-assets/javascripts/controllers/menu_controller.js +19 -0
  186. data/public/panda-cms-assets/javascripts/controllers/text_field_update_controller.js +23 -0
  187. data/public/panda-cms-assets/javascripts/embed/editable.js +308 -0
  188. data/public/panda-cms-assets/javascripts/vendor/stimulus-components-rails-nested-form.js +2 -0
  189. data/public/panda-cms-assets/javascripts/vendor/stimulus-loading.js +113 -0
  190. data/public/panda-cms-assets/javascripts/vendor/tailwindcss-stimulus-components.js +2 -0
  191. data/public/panda-cms-assets/panda-logo-screenprint.png +0 -0
  192. data/public/panda-cms-assets/panda-nav.png +0 -0
  193. metadata +1034 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2c792dc4f11481116ec3f1ebd1ca8485be8555e203f8063eb733dbf65aec70d0
4
+ data.tar.gz: d27a4e96c077c6fef1359c02d2432e87ca6a1a6bcd8b675f9034a0409a9bf01b
5
+ SHA512:
6
+ metadata.gz: 77ab8fc869c388bead7a207e1b78d126120d7bab04cd4eb8bb8e1dbd20e1ef72fa58c2f9fc7bad0faf019793b33b86f8e986cc58c1e07fc4b7ba2c6508b659d2
7
+ data.tar.gz: ddca9298c136c577c29008f92c7c6adba0b8e4f2753cf381849f96071fec98a1aa7cf805b5ac44ed7b3b22ecf9b769b1824fd3845ac48424e3cc75dd16f96474
data/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # Panda CMS
2
+
3
+ > [!CAUTION]
4
+ > This application is being developed in public. It is not ready for production use. If you'd like to try it out (or help with documentation), please contact [@jfi](https://github.com/jfi).
5
+
6
+ ## Panda CMS is the CMS we always wanted. 🐼
7
+
8
+ Better websites, on Rails.
9
+
10
+ [Read more about the project...](https://github.com/pandacms/.github/blob/main/profile/README.md) ✨
11
+
12
+ Panda is grown from our work at [Otaina](https://www.otaina.co.uk), a small group of freelancers. We needed something that could handle websites large and small – but where we could expand it too. We sent our first websites live in March 2024.
13
+
14
+ ![GitHub Last Commit](https://img.shields.io/github/last-commit/pandacms/panda_cms) [![Ruby Code Style](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/standardrb/standard)
15
+
16
+ ## Usage
17
+
18
+ To create a new Rails app[^1], run the command below, replacing `demo` with the name of the application you want to create:
19
+
20
+ ```
21
+ rails new demo $(curl -fsSL https://raw.githubusercontent.com/pandacms/generator/main/.railsrc) -m https://raw.githubusercontent.com/pandacms/generator/main/template.rb
22
+ ```
23
+
24
+ `cd` into your directory (e.g. `demo`) and run `bin/dev`. You'll see a basic website has automatically been created for you at http://localhost:3000/
25
+
26
+ The easiest way for you to get started is to visit http://localhost:3000/admin and login with your GitHub credentials. As the first user, you'll automatically have an administrator account created.
27
+
28
+ ### Existing applications
29
+
30
+ Add the following to `Gemfile`:
31
+
32
+ ```ruby
33
+ source "https://rubygems.pkg.github.com/pandacms" do
34
+ gem "panda_cms"
35
+ end
36
+ ```
37
+
38
+ For initial setup, run:
39
+
40
+ ```shell
41
+ bundle install
42
+ rails generate panda_cms:install
43
+ rails db:migrate
44
+ rails db:seed
45
+ ```
46
+
47
+ If you don't want to use GitHub to login, you'll need to configure a user provider (in `config/initializers/panda_cms.rb`), and then set your user's `admin` attribute to `true` once you've first tried to login. (And yes, there should be a better first-time setup experience than this. We're working on it!)
48
+
49
+ ## Gotchas
50
+
51
+ This is a non-exhuastive list (there will be many more):
52
+
53
+ * To date, this has only been tested with Rails 7.1 and 7.2.
54
+ * This assumes you're using Tailwind CSS for your frontend. We'll attempt to relax this in future, but supporting Tailwind CSS is our current priority.
55
+ * If you change your login path from `/admin` the GitHub application we supply won't work on first login, so probably don't do that until you're setup!
56
+
57
+ ## Contributing
58
+
59
+ We welcome contributions.
60
+
61
+ See our [Contributing Guidelines](https://github.com/pandacms/panda_cms/blob/main/CONTRIBUTING.md).
62
+
63
+ See [Credits](https://github.com/pandacms/panda_cms/blob/main/CREDITS.md) for thanks, influences, libraries and other credits.
64
+
65
+ ## License
66
+
67
+ The gem is available as open source under the terms of the [BSD-3-Clause License](https://opensource.org/licenses/bsd-3-clause).
68
+
69
+ Copyright © 2024, Panda Software Limited.
70
+
71
+ [^1]: You can of course use an existing Rails app, but on your head be it – we haven't tested this at all yet!
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "bundler/setup"
2
+
3
+ APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
4
+ load "rails/tasks/engine.rake"
5
+ load "rails/tasks/statistics.rake"
6
+ load APP_RAKEFILE if File.exist?(APP_RAKEFILE)
7
+
8
+ require "bundler/gem_tasks"
@@ -0,0 +1 @@
1
+ /*! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],input:where(:not([type])),select,textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-radius:0;border-width:1px;font-size:1rem;line-height:1.5rem;padding:.5rem .75rem;--tw-shadow:0 0 #0000}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,input:where(:not([type])):focus,select:focus,textarea:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);border-color:#2563eb;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-bottom:0;padding-top:0}select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple],[size]:where(select:not([size="1"])){background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-origin:border-box;border-color:#6b7280;border-width:1px;color:#2563eb;display:inline-block;flex-shrink:0;height:1rem;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1rem;--tw-shadow:0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0'/%3E%3C/svg%3E")}@media (forced-colors:active) {[type=checkbox]:checked{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=radio]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}@media (forced-colors:active) {[type=radio]:checked{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=radio]:checked:focus,[type=radio]:checked:hover{background-color:currentColor;border-color:transparent}[type=checkbox]:indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}@media (forced-colors:active) {[type=checkbox]:indeterminate{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{background-color:currentColor;border-color:transparent}[type=file]{background:unset;border-color:inherit;border-radius:0;border-width:0;font-size:unset;line-height:inherit;padding:0}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}html[data-theme=default]{--color-white:249 249 249;--color-black:26 22 29;--color-light:238 206 230;--color-mid:141 94 183;--color-dark:33 29 73;--color-highlight:208 64 20;--color-active:188 230 163;--color-warning:250 207 142;--color-inactive:211 229 249;--color-error:245 129 129}html[data-theme=sky]{--color-white:249 249 249;--color-black:26 22 29;--color-light:204 238 242;--color-mid:42 102 159;--color-dark:20 32 74;--color-highlight:208 64 20;--color-active:166 211 129;--color-warning:244 190 102;--color-error:208 64 20}a.block-link:after{content:"";inset:0;position:absolute}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.aspect-h-7{--tw-aspect-h:7}.aspect-w-10{padding-bottom:calc(var(--tw-aspect-h)/var(--tw-aspect-w)*100%);position:relative;--tw-aspect-w:10}.aspect-w-10>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.-inset-1\.5{inset:-.375rem}.inset-0{inset:0}.right-0{right:0}.right-2{right:.5rem}.top-0{top:0}.top-2{top:.5rem}.z-10{z-index:10}.z-50{z-index:50}.col-span-3{grid-column:span 3/span 3}.m-0{margin:0}.-mx-3{margin-left:-.75rem;margin-right:-.75rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-auto{margin-left:auto;margin-right:auto}.-mb-1{margin-bottom:-.25rem}.-mb-px{margin-bottom:-1px}.-ml-1{margin-left:-.25rem}.-mt-1{margin-top:-.25rem}.-mt-4{margin-top:-1rem}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-0{margin-left:0}.ml-0\.5{margin-left:.125rem}.ml-12{margin-left:3rem}.ml-16{margin-left:4rem}.ml-2{margin-left:.5rem}.ml-20{margin-left:5rem}.ml-24{margin-left:6rem}.ml-28{margin-left:7rem}.ml-3{margin-left:.75rem}.ml-32{margin-left:8rem}.ml-36{margin-left:9rem}.ml-4{margin-left:1rem}.ml-40{margin-left:10rem}.ml-48{margin-left:12rem}.ml-6{margin-left:1.5rem}.ml-8{margin-left:2rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-5{margin-right:1.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.table-cell{display:table-cell}.table-header-group{display:table-header-group}.table-row-group{display:table-row-group}.table-row{display:table-row}.grid{display:grid}.hidden{display:none}.h-0{height:0}.h-10{height:2.5rem}.h-14{height:3.5rem}.h-20{height:5rem}.h-32{height:8rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[calc\(100vh-10rem\)\]{height:calc(100vh - 10rem)}.h-full{height:100%}.max-h-16{max-height:4rem}.max-h-full{max-height:100%}.min-h-20{min-height:5rem}.min-h-full{min-height:100%}.w-0{width:0}.w-10{width:2.5rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-96{width:24rem}.w-auto{width:auto}.w-full{width:100%}.min-w-56{min-width:14rem}.min-w-full{min-width:100%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-auto{flex:1 1 auto}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-3\/12{flex-basis:25%}.table-auto{table-layout:auto}.border-collapse{border-collapse:collapse}.translate-x-0{--tw-translate-x:0px}.translate-x-0,.translate-x-full{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x:100%}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-5{gap:1.25rem}.gap-x-1\.5{-moz-column-gap:.375rem;column-gap:.375rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-5{row-gap:1.25rem}.gap-y-8{row-gap:2rem}.space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1.5rem*var(--tw-space-x-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-b-lg{border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-md{border-top-right-radius:.375rem}.border{border-width:1px}.border-0{border-width:0}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-dark{--tw-border-opacity:1;border-color:rgb(var(--color-dark)/var(--tw-border-opacity))}.border-mid{--tw-border-opacity:1;border-color:rgb(var(--color-mid)/var(--tw-border-opacity))}.border-mid\/20{border-color:rgb(var(--color-mid)/.2)}.border-transparent{border-color:transparent}.bg-active{--tw-bg-opacity:1;background-color:rgb(var(--color-active)/var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity:1;background-color:rgb(var(--color-black)/var(--tw-bg-opacity))}.bg-black\/5{background-color:rgb(var(--color-black)/.05)}.bg-mid{--tw-bg-opacity:1;background-color:rgb(var(--color-mid)/var(--tw-bg-opacity))}.bg-mid\/5{background-color:rgb(var(--color-mid)/.05)}.bg-transparent{background-color:transparent}.bg-warning{--tw-bg-opacity:1;background-color:rgb(var(--color-warning)/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(var(--color-white)/var(--tw-bg-opacity))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-dark{--tw-gradient-from:rgb(var(--color-dark)/1) var(--tw-gradient-from-position);--tw-gradient-to:rgb(var(--color-dark)/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-light\/20{--tw-gradient-from:rgb(var(--color-light)/0.2) var(--tw-gradient-from-position);--tw-gradient-to:rgb(var(--color-light)/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.to-light{--tw-gradient-to:rgb(var(--color-light)/1) var(--tw-gradient-to-position)}.to-mid{--tw-gradient-to:rgb(var(--color-mid)/1) var(--tw-gradient-to-position)}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\.5{padding-bottom:.375rem;padding-top:.375rem}.py-12{padding-bottom:3rem;padding-top:3rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-2\.5{padding-bottom:.625rem;padding-top:.625rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-3\.5{padding-bottom:.875rem;padding-top:.875rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-5{padding-bottom:1.25rem;padding-top:1.25rem}.pb-16{padding-bottom:4rem}.pb-4{padding-bottom:1rem}.pl-0{padding-left:0}.pl-12{padding-left:3rem}.pl-16{padding-left:4rem}.pl-20{padding-left:5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pl-8{padding-left:2rem}.pr-10{padding-right:2.5rem}.pr-3{padding-right:.75rem}.pr-8{padding-right:2rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-6{line-height:1.5rem}.leading-loose{line-height:2}.tracking-tight{letter-spacing:-.025em}.text-active{--tw-text-opacity:1;color:rgb(var(--color-active)/var(--tw-text-opacity))}.text-black{--tw-text-opacity:1;color:rgb(var(--color-black)/var(--tw-text-opacity))}.text-black\/60{color:rgb(var(--color-black)/.6)}.text-black\/80{color:rgb(var(--color-black)/.8)}.text-dark{--tw-text-opacity:1;color:rgb(var(--color-dark)/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(var(--color-white)/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-lg,.shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.shadow-sm,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-1,.ring-2{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-inset{--tw-ring-inset:inset}.ring-black{--tw-ring-opacity:1;--tw-ring-color:rgb(var(--color-black)/var(--tw-ring-opacity))}.ring-black\/30{--tw-ring-color:rgb(var(--color-black)/0.3)}.ring-mid{--tw-ring-opacity:1;--tw-ring-color:rgb(var(--color-mid)/var(--tw-ring-opacity))}.ring-opacity-5{--tw-ring-opacity:0.05}.ring-offset-2{--tw-ring-offset-width:2px}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-all{transition-duration:.15s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ql-editor{border:none;font-size:1.3em!important;margin:0;padding:0;&:active,&:focus{border:none;outline:none}h1,h2,h3,p{margin-bottom:20px!important}h1,h2,h3,li,p{font-size:130%!important}}.focus-within\:ring-2:focus-within{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-within\:ring-offset-2:focus-within{--tw-ring-offset-width:2px}.hover\:bg-black:hover{--tw-bg-opacity:1;background-color:rgb(var(--color-black)/var(--tw-bg-opacity))}.hover\:bg-light:hover{--tw-bg-opacity:1;background-color:rgb(var(--color-light)/var(--tw-bg-opacity))}.hover\:bg-mid\/20:hover{background-color:rgb(var(--color-mid)/.2)}.hover\:bg-mid\/60:hover{background-color:rgb(var(--color-mid)/.6)}.hover\:bg-white:hover{--tw-bg-opacity:1;background-color:rgb(var(--color-white)/var(--tw-bg-opacity))}.hover\:text-black\/80:hover{color:rgb(var(--color-black)/.8)}.hover\:text-white:hover{--tw-text-opacity:1;color:rgb(var(--color-white)/var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-sm:hover{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\:underline:focus{text-decoration-line:underline}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring-1:focus,.focus\:ring-2:focus{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring-inset:focus{--tw-ring-inset:inset}.focus\:ring-dark:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(var(--color-dark)/var(--tw-ring-opacity))}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\:outline:focus-visible{outline-style:solid}.focus-visible\:outline-2:focus-visible{outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.group:hover .group-hover\:text-black\/60{color:rgb(var(--color-black)/.6)}.group:hover .group-hover\:opacity-75{opacity:.75}@media (min-width:640px){.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mx-auto{margin-left:auto;margin-right:auto}.sm\:mt-2{margin-top:.5rem}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:w-full{width:100%}.sm\:max-w-sm{max-width:24rem}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:items-end{align-items:flex-end}.sm\:gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.sm\:rounded-lg{border-radius:.5rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:leading-6{line-height:1.5rem}}@media (min-width:768px){.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:1024px){.lg\:fixed{position:fixed}.lg\:inset-y-0{bottom:0;top:0}.lg\:z-50{z-index:50}.lg\:ml-72{margin-left:18rem}.lg\:mt-0{margin-top:0}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:max-h-full{max-height:100%}.lg\:w-72{width:18rem}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-col{flex-direction:column}.lg\:px-6{padding-left:1.5rem;padding-right:1.5rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}}@media (min-width:1280px){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.xl\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(2rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(2rem*var(--tw-space-x-reverse))}}
@@ -0,0 +1 @@
1
+ //= link_tree ../builds/ .css
@@ -0,0 +1,61 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ @layer base {
6
+ html[data-theme="default"] {
7
+ --color-white: 249 249 249; /* #F9F9F9 */
8
+ --color-black: 26 22 29; /* #1A161D */
9
+
10
+ --color-light: 238 206 230; /* #EECEE6 */
11
+ --color-mid: 141 94 183; /* #8D5EB7 */
12
+ --color-dark: 33 29 73; /* #211D49 */
13
+
14
+ --color-highlight: 208 64 20; /* #D04014 */
15
+
16
+ --color-active: 188 230 163; /* #BCE6A3 */
17
+ --color-warning: 250 207 142; /* #FACF8E */
18
+ --color-inactive: 211 229 249; /* #D3E5F9 */
19
+ --color-error: 245 129 129; /* #F58181 */
20
+ }
21
+
22
+ html[data-theme="sky"] {
23
+ --color-white: 249 249 249; /* #F9F9F9 */
24
+ --color-black: 26 22 29; /* #1A161D */
25
+ --color-light: 204 238 242; /* #CCEEF2 */
26
+ --color-mid: 42 102 159; /* #2A669F */
27
+ --color-dark: 20 32 74; /* #14204A */
28
+ --color-highlight: 208 64 20; /* #D04014 */
29
+
30
+ --color-active: 166 211 129; /* #A6D381 */
31
+ --color-warning: 244 190 102; /* #F4BE66 */
32
+ --color-error: 208 64 20; /* #D04014 */
33
+ }
34
+
35
+ a.block-link:after {
36
+ position: absolute;
37
+ content: "";
38
+ inset: 0;
39
+ }
40
+ }
41
+
42
+ .ql-editor {
43
+ border: none;
44
+ font-size: 1.3em !important;
45
+ padding: 0;
46
+ margin: 0;
47
+
48
+ &:active, &:focus {
49
+ border: none;
50
+ outline: none;
51
+ }
52
+
53
+ h1, h2, h3, p {
54
+ margin-bottom: 20px !important;
55
+ font-size: 130% !important;
56
+ }
57
+
58
+ li {
59
+ font-size: 130% !important;
60
+ }
61
+ }
@@ -0,0 +1,118 @@
1
+ module PandaCms
2
+ class FormBuilder < ActionView::Helpers::FormBuilder
3
+ include ActionView::Helpers::TagHelper
4
+
5
+ def label(attribute, text = nil, options = {}, &block)
6
+ super(attribute, text, options.reverse_merge(class: "font-medium text-sm leading-6 text-gray-500"))
7
+ end
8
+
9
+ def text_field(attribute, options = {})
10
+ if options.dig(:data, :prefix)
11
+ content_tag :div, class: container_styles do
12
+ label(attribute) +
13
+ content_tag(:div, class: "flex flex-grow") do
14
+ content_tag(:span, class: "inline-flex items-center px-3 text-sm text-gray-900 bg-gray-200 border border-e-0 border-gray-300 rounded-s-md dark:bg-gray-600 dark:text-gray-400 dark:border-gray-600 whitespace-nowrap break-keep") { options.dig(:data, :prefix) } +
15
+ super(attribute, options.reverse_merge(class: input_styles_prefix + " rounded-l-none"))
16
+ end
17
+ end
18
+ else
19
+ content_tag :div, class: container_styles do
20
+ label(attribute) + super(attribute, options.reverse_merge(class: input_styles))
21
+ end
22
+ end
23
+ end
24
+
25
+ def email_field(attribute, options = {})
26
+ content_tag :div, class: container_styles do
27
+ label(attribute) + super(attribute, options.reverse_merge(class: input_styles))
28
+ end
29
+ end
30
+
31
+ def password_field(attribute, options = {})
32
+ content_tag :div, class: container_styles do
33
+ label(attribute) + super(attribute, options.reverse_merge(class: input_styles))
34
+ end
35
+ end
36
+
37
+ def select(method, choices = nil, options = {}, html_options = {}, &block)
38
+ content_tag :div, class: container_styles do
39
+ label(method) + super(method, choices, options, html_options.reverse_merge(class: input_styles))
40
+ end
41
+ end
42
+
43
+ def collection_select(method, collection, value_method, text_method, options = {}, html_options = {})
44
+ content_tag :div, class: container_styles do
45
+ label(method) + super(method, collection, value_method, text_method, options, html_options.reverse_merge(class: input_styles))
46
+ end
47
+ end
48
+
49
+ def time_zone_select(method, priority_zones = nil, options = {}, html_options = {})
50
+ content_tag :div, class: container_styles do
51
+ label(method) + super(method, priority_zones, options, html_options.reverse_merge(class: input_styles))
52
+ end
53
+ end
54
+
55
+ def file_field(method, options = {})
56
+ content_tag :div, class: container_styles do
57
+ label(method) + super(method, options.reverse_merge(class: "file:rounded file:border-0 file:text-sm file:bg-white file:text-gray-500 hover:file:bg-gray-50 bg-white px-2.5 hover:bg-gray-50".concat(input_styles)))
58
+ end
59
+ end
60
+
61
+ def button(value = nil, options = {}, &block) # => 7.1.3
62
+ case value
63
+ when Hash
64
+ value, options = nil, value
65
+ when Symbol
66
+ value, options = nil, {name: field_name(value), id: field_id(value)}.merge!(options.to_h)
67
+ end
68
+ value ||= submit_default_value
69
+
70
+ formmethod = options[:formmethod]
71
+ if formmethod.present? && !/post|get/i.match?(formmethod) && !options.key?(:name) && !options.key?(:value)
72
+ options.merge! formmethod: :post, name: "_method", value: formmethod
73
+ end
74
+
75
+ value = if block
76
+ @template.capture { yield(value) }
77
+ else
78
+ content_tag(:i, "", class: "fa-sharp fa-circle-check mr-2 pt-[0.2rem]") + value
79
+ end
80
+
81
+ @template.button_tag(value, options.reverse_merge(class: button_styles))
82
+ end
83
+
84
+ def submit(value = nil, options = {}) # => 7.1.3
85
+ super(value, options.reverse_merge(class: button_styles))
86
+ end
87
+
88
+ def check_box(method, options = {}, checked_value = "1", unchecked_value = "0")
89
+ content_tag :div, class: container_styles do
90
+ label(method) + super(method, options.reverse_merge(class: "border-gray-300 ml-2"), checked_value, unchecked_value)
91
+ end
92
+ end
93
+
94
+ def date_field(method, options = {})
95
+ content_tag :div, class: container_styles do
96
+ label(method) + super(method, options.reverse_merge(class: input_styles))
97
+ end
98
+ end
99
+
100
+ private
101
+
102
+ def input_styles
103
+ "block w-full rounded-md border-0 p-2 text-gray-900 ring-1 ring-inset ring-mid placeholder:text-gray-300 focus:outline-panda-light focus:ring-1 focus:ring-inset focus:ring-dark sm:text-sm sm:leading-6 hover:pointer"
104
+ end
105
+
106
+ def input_styles_prefix
107
+ input_styles.concat(" prefix")
108
+ end
109
+
110
+ def button_styles
111
+ "inline-flex items-center rounded-md font-medium shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 text-dark border-2 border-dark bg-transparent hover:bg-light transition-all gap-x-1.5 px-3 py-2 text-base gap-x-1.5 px-2.5 py-1.5 text-sm mt-2 "
112
+ end
113
+
114
+ def container_styles
115
+ "panda-field-container mb-2"
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PandaCms
4
+ module Admin
5
+ class ButtonComponent < ViewComponent::Base
6
+ attr_accessor :text, :action, :link, :icon, :size, :data
7
+
8
+ def initialize(text: "Button", action: nil, data: {}, link: "#", icon: nil, size: :regular)
9
+ @text = text
10
+ @action = action
11
+ @data = data
12
+ @link = link
13
+ @icon = icon
14
+ @size = size
15
+ end
16
+
17
+ def call
18
+ @icon = set_icon_from_action(@action) if @action && @icon.nil?
19
+ icon = content_tag(:i, "", class: "mr-2 fa-regular fa-#{@icon}") if @icon
20
+ @text = "#{icon} #{@text.titleize}".html_safe
21
+
22
+ classes = "inline-flex items-center rounded-md font-medium shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 "
23
+
24
+ case @size
25
+ when :small, :sm
26
+ classes += "gap-x-1.5 px-2.5 py-1.5 text-sm "
27
+ when :medium, :regular, :md
28
+ classes += "gap-x-1.5 px-3 py-2 text-base "
29
+ when :large, :lg
30
+ classes += "gap-x-2 px-3.5 py-2.5 text-lg "
31
+ end
32
+
33
+ classes += case @action
34
+ when :save, :create
35
+ "text-white bg-green-700"
36
+ when :secondary
37
+ "text-panda-cms-dark border border-panda-cms-dark bg-white hover:bg-sky-100 focus-visible:outline-panda-cms-dark "
38
+ when :delete, :destroy, :danger
39
+ "text-red-900 border border-red-900 bg-red-100 hover:bg-red-200 hover:text-red-900 focus-visible:outline-red-300 "
40
+ else
41
+ "text-dark border-2 border-dark bg-transparent hover:bg-light transition-all "
42
+ end
43
+
44
+ content_tag :a, href: @link, class: classes, data: @data do
45
+ @text
46
+ end
47
+ end
48
+
49
+ private
50
+
51
+ def set_icon_from_action(action)
52
+ case action
53
+ when :add, :new, :create
54
+ "plus"
55
+ when :save
56
+ "check"
57
+ when :edit, :update
58
+ "pencil"
59
+ when :delete, :destroy
60
+ "trash"
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,13 @@
1
+ <main class="overflow-auto flex-1 h-full min-h-full max-h-full">
2
+ <div class="overflow-auto px-2 pt-4 mx-auto sm:px-6 lg:px-6">
3
+ <%= heading %>
4
+ <%= tab_bar %>
5
+ <%# I mean, you can edit this CSS if you want, but I hope you want to lose 2 hours to iFrame joy? %>
6
+ <section class="flex-auto h-[calc(100vh-10rem)]">
7
+ <div class="flex-1 mt-4 w-full h-full">
8
+ <%= content %>
9
+ </div>
10
+ <%= slideover %>
11
+ </section>
12
+ </div>
13
+ </main>
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PandaCms
4
+ module Admin
5
+ class ContainerComponent < ViewComponent::Base
6
+ renders_one :heading, "PandaCms::Admin::HeadingComponent"
7
+ renders_one :tab_bar, "PandaCms::Admin::TabBarComponent"
8
+ renders_one :slideover, "PandaCms::Admin::SlideoverComponent"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,30 @@
1
+ <div class="fixed top-2 right-2 z-50 p-2 space-y-4 w-full max-w-sm pointer-events-none sm:items-end" data-controller="alert"
2
+ data-alert-dismiss-after-value="3000"
3
+ data-transition-enter="ease-in-out duration-500"
4
+ data-transition-enter-from="translate-x-full opacity-0"
5
+ data-transition-enter-to="translate-x-0 opacity-100"
6
+ data-transition-leave="ease-in-out duration-500"
7
+ data-transition-leave-from="translate-x-0 opacity-100"
8
+ data-transition-leave-to="translate-x-full opacity-0">
9
+ <div class="overflow-hidden w-full max-w-sm bg-white rounded-lg ring-1 ring-black ring-opacity-5 shadow-lg pointer-events-auto">
10
+ <div class="p-4">
11
+ <div class="flex items-start">
12
+ <div class="flex-shrink-0">
13
+ <i class="fa-regular text-xl <%= icon_css %> <%= text_colour_css %>"></i>
14
+ </div>
15
+ <div class="flex-1 pt-0.5 ml-3 w-0">
16
+ <p class="mb-1 text-sm font-medium <%= text_colour_css %>"><%= kind.to_s.titleize %></p>
17
+ <p class="mt-1 mb-0 text-sm text-gray-500"><%= message %></p>
18
+ </div>
19
+ <div class="flex flex-shrink-0 ml-4">
20
+ <button data-action="alert#close" type="button" class="inline-flex text-gray-400 bg-white rounded-md transition duration-150 ease-in-out hover:text-gray-500 focus:ring-2 focus:ring-offset-2 focus:outline-none focus:ring-sky-500">
21
+ <span class="sr-only">Close</span>
22
+ <svg class="w-5 h-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
23
+ <path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" />
24
+ </svg>
25
+ </button>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </div>
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PandaCms
4
+ module Admin
5
+ class FlashMessageComponent < ::ViewComponent::Base
6
+ attr_reader :kind, :message
7
+
8
+ def initialize(message:, kind:)
9
+ @kind = kind.to_sym
10
+ @message = message
11
+ end
12
+
13
+ def text_colour_css
14
+ case kind
15
+ when :success
16
+ "text-green-700"
17
+ when :alert, :error
18
+ "text-red-700"
19
+ when :warning
20
+ "text-yellow-700"
21
+ when :info, :notice
22
+ "text-blue-700"
23
+ else
24
+ "text-blue-700"
25
+ end
26
+ end
27
+
28
+ def icon_css
29
+ case kind
30
+ when :success
31
+ "fa-circle-check"
32
+ when :alert
33
+ "fa-circle-xmark"
34
+ when :warning
35
+ "fa-triangle-exclamation"
36
+ when :info, :notice
37
+ "fa-circle-info"
38
+ else
39
+ "fa-circle-info"
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PandaCms
4
+ module Admin
5
+ class HeadingComponent < ViewComponent::Base
6
+ renders_many :buttons, PandaCms::Admin::ButtonComponent
7
+
8
+ attr_reader :text, :level, :icon, :additional_styles
9
+
10
+ def initialize(text:, level: 2, icon: "", additional_styles: "")
11
+ @text = text
12
+ @level = level
13
+ @icon = icon
14
+ @additional_styles = additional_styles
15
+ @additional_styles = @additional_styles.split(" ") if @additional_styles.is_a?(String)
16
+ end
17
+
18
+ def call
19
+ output = ""
20
+ output += content_tag(:div, @text, class: "grow")
21
+
22
+ if buttons?
23
+ output += content_tag(:span, class: "actions flex gap-x-2 -mt-1") do
24
+ safe_join(buttons, "")
25
+ end
26
+ end
27
+
28
+ output = output.html_safe
29
+ base_heading_styles = "flex pt-1 text-black mb-5 -mt-1"
30
+
31
+ if level == 1
32
+ content_tag(:h1, output, class: [base_heading_styles, "text-2xl font-medium", @additional_styles])
33
+ elsif level == 2
34
+ content_tag(:h2, output, class: [base_heading_styles, "text-xl font-medium", @additional_styles])
35
+ elsif level == 3
36
+ content_tag(:h3, output, class: [base_heading_styles, "text-xl", "font-light", @additional_styles])
37
+ elsif level == :panel
38
+ content_tag(:h3, output, class: ["text-base font-medium p-4 text-white"])
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,7 @@
1
+ <div class="col-span-3 mt-5 rounded-lg shadow-md bg-mid shadow-inherit/20">
2
+ <%= heading %>
3
+
4
+ <div class="p-4 text-black bg-white rounded-b-lg">
5
+ <%= content %>
6
+ </div>
7
+ </div>
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PandaCms
4
+ module Admin
5
+ class PanelComponent < ViewComponent::Base
6
+ renders_one :heading, ->(text:, icon: "", level: :panel, additional_styles: "") do
7
+ PandaCms::Admin::HeadingComponent.new(text: text, icon: icon, level: level, additional_styles: additional_styles)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ <% content_for :sidebar do %>
2
+ <aside class="hidden overflow-y-auto w-96 h-full bg-white lg:block">
3
+ <%= content %>
4
+ </aside>
5
+ <% end %>
6
+
7
+ <% content_for :sidebar_title do %>
8
+ <%= title %>
9
+ <% end %>
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PandaCms
4
+ module Admin
5
+ class SlideoverComponent < ViewComponent::Base
6
+ attr_reader :title
7
+
8
+ def initialize(title: "Settings")
9
+ @title = title
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,4 @@
1
+ <div class="overflow-hidden p-4 bg-gradient-to-br rounded-lg border-2 from-light/20 to-light border-mid">
2
+ <dt class="text-base font-medium truncate text-dark"><%= metric %></dt>
3
+ <dd class="mt-1 text-3xl font-medium tracking-tight text-dark"><%= value %></dd>
4
+ </div>
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PandaCms
4
+ module Admin
5
+ class StatisticsComponent < ViewComponent::Base
6
+ attr_reader :metric
7
+ attr_reader :value
8
+
9
+ def initialize(metric:, value:)
10
+ @metric = metric
11
+ @value = value
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,35 @@
1
+ <div class="mt-3 sm:mt-2">
2
+ <div class="sm:hidden">
3
+ <label for="tabs" class="sr-only">Select a tab</label>
4
+ <!-- Use an "onChange" listener to redirect the user to the selected tab URL. -->
5
+ <select id="tabs" name="tabs" class="block py-1.5 pr-10 pl-3 w-full text-gray-900 rounded-md border-0 ring-1 ring-inset focus:ring-2 focus:ring-inset ring-mid focus:border-panda-dark focus:ring-panda-dark">
6
+ <% tabs.each do |tab| %>
7
+ <option><%= tab %></option>
8
+ <% end %>
9
+ </select>
10
+ </div>
11
+ <div class="hidden sm:block">
12
+ <div class="flex items-center border-b border-gray-200">
13
+ <nav class="flex flex-1 -mb-px space-x-6 xl:space-x-8" aria-label="Tabs">
14
+ <!-- Current: "border-panda-dark text-panda-dark", Default: "border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700" -->
15
+ <a href="#" aria-current="page" class="py-4 px-1 text-sm font-medium whitespace-nowrap border-b-2 border-panda-dark text-panda-dark">Recently Viewed</a>
16
+ <a href="#" class="py-4 px-1 text-sm font-medium text-gray-500 whitespace-nowrap border-b-2 border-transparent hover:text-gray-700 hover:border-gray-300">Recently Added</a>
17
+ <a href="#" class="py-4 px-1 text-sm font-medium text-gray-500 whitespace-nowrap border-b-2 border-transparent hover:text-gray-700 hover:border-gray-300">Favourited</a>
18
+ </nav>
19
+ <div class="hidden items-center p-0.5 ml-6 bg-gray-100 rounded-lg sm:flex">
20
+ <button type="button" class="p-1.5 text-gray-400 rounded-md hover:bg-white hover:shadow-sm focus:ring-2 focus:ring-inset focus:outline-none focus:ring-panda-dark">
21
+ <svg class="w-5 h-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
22
+ <path fill-rule="evenodd" d="M2 3.75A.75.75 0 012.75 3h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 3.75zm0 4.167a.75.75 0 01.75-.75h14.5a.75.75 0 010 1.5H2.75a.75.75 0 01-.75-.75zm0 4.166a.75.75 0 01.75-.75h14.5a.75.75 0 010 1.5H2.75a.75.75 0 01-.75-.75zm0 4.167a.75.75 0 01.75-.75h14.5a.75.75 0 010 1.5H2.75a.75.75 0 01-.75-.75z" clip-rule="evenodd" />
23
+ </svg>
24
+ <span class="sr-only">Use list view</span>
25
+ </button>
26
+ <button type="button" class="p-1.5 ml-0.5 text-gray-400 bg-white rounded-md shadow-sm focus:ring-2 focus:ring-inset focus:outline-none focus:ring-panda-dark">
27
+ <svg class="w-5 h-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
28
+ <path fill-rule="evenodd" d="M4.25 2A2.25 2.25 0 002 4.25v2.5A2.25 2.25 0 004.25 9h2.5A2.25 2.25 0 009 6.75v-2.5A2.25 2.25 0 006.75 2h-2.5zm0 9A2.25 2.25 0 002 13.25v2.5A2.25 2.25 0 004.25 18h2.5A2.25 2.25 0 009 15.75v-2.5A2.25 2.25 0 006.75 11h-2.5zm9-9A2.25 2.25 0 0011 4.25v2.5A2.25 2.25 0 0013.25 9h2.5A2.25 2.25 0 0018 6.75v-2.5A2.25 2.25 0 0015.75 2h-2.5zm0 9A2.25 2.25 0 0011 13.25v2.5A2.25 2.25 0 0013.25 18h2.5A2.25 2.25 0 0018 15.75v-2.5A2.25 2.25 0 0015.75 11h-2.5z" clip-rule="evenodd" />
29
+ </svg>
30
+ <span class="sr-only">Use grid view</span>
31
+ </button>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>