ariadne_view_components 0.0.59 → 0.0.65

Sign up to get free protection for your applications and to get access to all the features.
Files changed (279) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +70 -0
  3. data/LICENSE.txt +661 -49
  4. data/README.md +52 -4
  5. data/app/assets/javascripts/ariadne_view_components.js +98 -7
  6. data/app/assets/javascripts/ariadne_view_components.js.br +0 -0
  7. data/app/assets/javascripts/ariadne_view_components.js.gz +0 -0
  8. data/app/assets/javascripts/ariadne_view_components.js.map +1 -1
  9. data/app/assets/stylesheets/ariadne_view_components.css +1 -7
  10. data/app/assets/stylesheets/ariadne_view_components.css.br +0 -0
  11. data/app/assets/stylesheets/ariadne_view_components.css.gz +0 -0
  12. data/app/components/ariadne/base_component.rb +79 -27
  13. data/app/components/ariadne/behaviors/tooltipable.rb +120 -0
  14. data/app/components/ariadne/conditional_wrapper.rb +21 -0
  15. data/app/components/ariadne/form/base_component.rb +74 -0
  16. data/app/components/ariadne/form/base_input_component.rb +60 -0
  17. data/app/components/ariadne/form/caption/component.html.erb +10 -0
  18. data/app/components/ariadne/form/caption/component.rb +29 -0
  19. data/app/components/ariadne/form/form_control/component.html.erb +19 -0
  20. data/app/components/ariadne/form/form_control/component.rb +27 -0
  21. data/app/components/ariadne/form/form_reference/component.html.erb +1 -0
  22. data/app/components/ariadne/form/form_reference/component.rb +18 -0
  23. data/app/components/ariadne/form/group/component.html.erb +5 -0
  24. data/app/components/ariadne/form/group/component.rb +27 -0
  25. data/app/components/ariadne/form/hidden_field/component.html.erb +1 -0
  26. data/app/components/ariadne/form/hidden_field/component.rb +15 -0
  27. data/app/components/ariadne/form/separator/component.html.erb +1 -0
  28. data/app/components/ariadne/form/separator/component.rb +8 -0
  29. data/app/components/ariadne/form/spacing_wrapper/component.html.erb +3 -0
  30. data/app/components/ariadne/form/spacing_wrapper/component.rb +8 -0
  31. data/app/components/ariadne/form/text_field/component.html.erb +25 -0
  32. data/app/components/ariadne/form/text_field/component.rb +132 -0
  33. data/app/components/ariadne/form/validation_message/component.html.erb +5 -0
  34. data/app/components/ariadne/form/validation_message/component.rb +14 -0
  35. data/app/components/ariadne/layout/narrow/component.html.erb +10 -0
  36. data/app/components/ariadne/layout/narrow/component.rb +24 -0
  37. data/app/components/ariadne/layout/nav_bar/component.css +0 -0
  38. data/app/components/ariadne/layout/nav_bar/component.html.erb +123 -0
  39. data/app/components/ariadne/layout/nav_bar/component.rb +77 -0
  40. data/app/components/ariadne/ui/button/component.html.erb +5 -0
  41. data/app/components/ariadne/ui/button/component.rb +184 -0
  42. data/app/components/ariadne/ui/clipboard_copy/component.html.erb +8 -0
  43. data/app/components/ariadne/ui/clipboard_copy/component.rb +102 -0
  44. data/app/components/ariadne/ui/clipboard_copy/component.ts +54 -0
  45. data/app/components/ariadne/ui/combobox/component.html.erb +32 -0
  46. data/app/components/ariadne/ui/combobox/component.rb +83 -0
  47. data/app/components/ariadne/ui/combobox/component.ts +119 -0
  48. data/app/components/ariadne/ui/combobox/menu_item/component.html.erb +9 -0
  49. data/app/components/ariadne/ui/combobox/menu_item/component.rb +53 -0
  50. data/app/components/ariadne/ui/combobox/option/component.html.erb +11 -0
  51. data/app/components/ariadne/ui/combobox/option/component.rb +45 -0
  52. data/app/components/ariadne/ui/heroicon/component.html.erb +3 -0
  53. data/app/components/ariadne/ui/heroicon/component.rb +141 -0
  54. data/app/components/ariadne/ui/image/component.rb +69 -0
  55. data/app/components/ariadne/ui/link/component.html.erb +3 -0
  56. data/app/components/ariadne/ui/link/component.rb +56 -0
  57. data/app/components/ariadne/ui/typography/component.html.erb +3 -0
  58. data/app/components/ariadne/ui/typography/component.rb +41 -0
  59. data/app/frontend/ariadne/index.ts +14 -0
  60. data/app/frontend/ariadne/stimulus_app.ts +53 -0
  61. data/app/frontend/ariadne/theme.ts +8 -0
  62. data/app/frontend/controllers/tooltip.ts +75 -0
  63. data/app/frontend/entrypoints/application.ts +1 -0
  64. data/app/frontend/stylesheets/ariadne_view_components.css +18 -0
  65. data/app/frontend/stylesheets/scrollbar.css +28 -0
  66. data/app/frontend/stylesheets/tippy.js/themes/tomato.css +4 -0
  67. data/app/frontend/stylesheets/typography.css +117 -0
  68. data/app/frontend/utils/createController.ts +95 -0
  69. data/app/helpers/ariadne/form_helper.rb +31 -0
  70. data/app/lib/ariadne/attributes_helper.rb +119 -0
  71. data/app/lib/ariadne/fetch_or_fallback_helper.rb +1 -1
  72. data/app/lib/ariadne/form.rb +16 -0
  73. data/app/lib/ariadne/view_helper.rb +2 -5
  74. data/app/lib/view_components_contrib/html_attrs.rb +64 -0
  75. data/app/lib/view_components_contrib/style_variants.rb +14 -0
  76. data/lib/ariadne/forms/acts_as_component.rb +125 -0
  77. data/lib/ariadne/forms/base.html.erb +8 -0
  78. data/lib/ariadne/forms/base.rb +132 -0
  79. data/lib/ariadne/forms/buffer_rewriter.rb +51 -0
  80. data/lib/ariadne/forms/builder.rb +88 -0
  81. data/lib/ariadne/forms/dsl/button_input.rb +33 -0
  82. data/lib/ariadne/forms/dsl/form_object.rb +26 -0
  83. data/lib/ariadne/forms/dsl/input.rb +322 -0
  84. data/lib/ariadne/forms/dsl/input_group.rb +34 -0
  85. data/lib/ariadne/forms/dsl/input_methods.rb +157 -0
  86. data/lib/ariadne/forms/dsl/submit_button_input.rb +36 -0
  87. data/lib/ariadne/forms/dsl/text_field_input.rb +73 -0
  88. data/lib/ariadne/forms/utils.rb +34 -0
  89. data/lib/ariadne/generate.rb +11 -0
  90. data/lib/ariadne/view_components/engine.rb +24 -7
  91. data/lib/ariadne/view_components/version.rb +1 -1
  92. data/lib/ariadne/view_components.rb +1 -1
  93. data/lib/ariadne/yard/backend.rb +24 -0
  94. data/lib/ariadne/yard/component_manifest.rb +148 -0
  95. data/lib/ariadne/yard/component_ref.rb +49 -0
  96. data/lib/ariadne/yard/docs_helper.rb +98 -0
  97. data/lib/ariadne/yard/info_arch_docs_helper.rb +31 -0
  98. data/lib/ariadne/yard/lookbook_docs_helper.rb +32 -0
  99. data/lib/ariadne/yard/lookbook_pages_backend.rb +235 -0
  100. data/lib/ariadne/yard/registry.rb +136 -0
  101. data/lib/ariadne/yard/renders_many_handler.rb +23 -0
  102. data/lib/ariadne/yard/renders_one_handler.rb +23 -0
  103. data/lib/ariadne/yard.rb +19 -0
  104. data/static/arguments.yml +141 -48
  105. data/static/audited_at.json +0 -9
  106. data/static/classes.yml +210 -209
  107. data/static/constants.json +2 -209
  108. data/static/statuses.json +0 -9
  109. metadata +140 -210
  110. data/app/assets/builds/ariadne_view_components.css +0 -2202
  111. data/app/assets/javascripts/components/ariadne/accumulator_controller/accumulator_controller.d.ts +0 -22
  112. data/app/assets/javascripts/components/ariadne/ariadne-form.d.ts +0 -22
  113. data/app/assets/javascripts/components/ariadne/ariadne.d.ts +0 -2
  114. data/app/assets/javascripts/components/ariadne/clipboard_copy_component/clipboard-copy-component.d.ts +0 -4
  115. data/app/assets/javascripts/components/ariadne/dropdown/menu_component.d.ts +0 -1
  116. data/app/assets/javascripts/components/ariadne/events_controller/events_controller.d.ts +0 -4
  117. data/app/assets/javascripts/components/ariadne/options_controller/options_controller.d.ts +0 -39
  118. data/app/assets/javascripts/components/ariadne/outlet_manager_controller/outlet_manager_controller.d.ts +0 -42
  119. data/app/assets/javascripts/components/ariadne/slideover_component/slideover-component.d.ts +0 -9
  120. data/app/assets/javascripts/components/ariadne/string_match_controller/string_match_controller.d.ts +0 -27
  121. data/app/assets/javascripts/components/ariadne/synced_boolean_attributes_controller/synced_boolean_attributes_controller.d.ts +0 -48
  122. data/app/assets/javascripts/components/ariadne/tab_container_component/tab-container-component.d.ts +0 -1
  123. data/app/assets/javascripts/components/ariadne/tab_nav_component/tab-nav-component.d.ts +0 -9
  124. data/app/assets/javascripts/components/ariadne/time_ago_component/time-ago-component.d.ts +0 -1
  125. data/app/assets/javascripts/components/ariadne/toggleable_controller/toggleable_controller.d.ts +0 -34
  126. data/app/assets/javascripts/components/ariadne/tooltip_component/tooltip-component.d.ts +0 -24
  127. data/app/assets/stylesheets/dropdown.css +0 -46
  128. data/app/assets/stylesheets/prosemirror.css +0 -323
  129. data/app/assets/stylesheets/tooltip-component.css +0 -37
  130. data/app/components/ariadne/accumulator_controller/accumulator_controller.d.ts +0 -22
  131. data/app/components/ariadne/accumulator_controller/accumulator_controller.js +0 -39
  132. data/app/components/ariadne/accumulator_controller/accumulator_controller.ts +0 -48
  133. data/app/components/ariadne/action_card_component.html.erb +0 -13
  134. data/app/components/ariadne/action_card_component.rb +0 -88
  135. data/app/components/ariadne/ariadne-form.d.ts +0 -22
  136. data/app/components/ariadne/ariadne-form.js +0 -85
  137. data/app/components/ariadne/ariadne.d.ts +0 -2
  138. data/app/components/ariadne/ariadne.js +0 -24
  139. data/app/components/ariadne/ariadne.ts +0 -29
  140. data/app/components/ariadne/avatar_component.rb +0 -81
  141. data/app/components/ariadne/avatar_stack_component/avatar_stack_component.html.erb +0 -12
  142. data/app/components/ariadne/avatar_stack_component.rb +0 -75
  143. data/app/components/ariadne/base_button.rb +0 -70
  144. data/app/components/ariadne/blankslate_component/blankslate_component.html.erb +0 -26
  145. data/app/components/ariadne/blankslate_component.rb +0 -148
  146. data/app/components/ariadne/body_component.rb +0 -30
  147. data/app/components/ariadne/bottom_tab_component.html.erb +0 -4
  148. data/app/components/ariadne/bottom_tab_component.rb +0 -44
  149. data/app/components/ariadne/bottom_tab_nav_component.html.erb +0 -5
  150. data/app/components/ariadne/bottom_tab_nav_component.rb +0 -33
  151. data/app/components/ariadne/breadcrumbs_component.html.erb +0 -13
  152. data/app/components/ariadne/breadcrumbs_component.rb +0 -31
  153. data/app/components/ariadne/button_component/button_component.html.erb +0 -4
  154. data/app/components/ariadne/button_component.rb +0 -165
  155. data/app/components/ariadne/checkbox_component.html.erb +0 -5
  156. data/app/components/ariadne/checkbox_component.rb +0 -43
  157. data/app/components/ariadne/clipboard_copy_component/clipboard-copy-component.d.ts +0 -4
  158. data/app/components/ariadne/clipboard_copy_component/clipboard-copy-component.js +0 -18
  159. data/app/components/ariadne/clipboard_copy_component/clipboard-copy-component.ts +0 -19
  160. data/app/components/ariadne/clipboard_copy_component/clipboard_copy_component.html.erb +0 -9
  161. data/app/components/ariadne/clipboard_copy_component.rb +0 -90
  162. data/app/components/ariadne/close_button_component.html.erb +0 -4
  163. data/app/components/ariadne/close_button_component.rb +0 -33
  164. data/app/components/ariadne/combobox_component.html.erb +0 -14
  165. data/app/components/ariadne/combobox_component.rb +0 -76
  166. data/app/components/ariadne/component.rb +0 -127
  167. data/app/components/ariadne/container_component/container_component.html.erb +0 -3
  168. data/app/components/ariadne/container_component.rb +0 -25
  169. data/app/components/ariadne/content.rb +0 -12
  170. data/app/components/ariadne/counter_component.rb +0 -100
  171. data/app/components/ariadne/details_component/details_component.html.erb +0 -4
  172. data/app/components/ariadne/details_component.rb +0 -81
  173. data/app/components/ariadne/dropdown/menu_component.d.ts +0 -1
  174. data/app/components/ariadne/dropdown/menu_component.html.erb +0 -20
  175. data/app/components/ariadne/dropdown/menu_component.js +0 -1
  176. data/app/components/ariadne/dropdown/menu_component.rb +0 -101
  177. data/app/components/ariadne/dropdown/menu_component.ts +0 -1
  178. data/app/components/ariadne/dropdown_component/dropdown_component.html.erb +0 -8
  179. data/app/components/ariadne/dropdown_component.rb +0 -172
  180. data/app/components/ariadne/events_controller/events_controller.d.ts +0 -4
  181. data/app/components/ariadne/events_controller/events_controller.js +0 -6
  182. data/app/components/ariadne/events_controller/events_controller.ts +0 -7
  183. data/app/components/ariadne/flash_component/flash_component.html.erb +0 -31
  184. data/app/components/ariadne/flash_component.rb +0 -128
  185. data/app/components/ariadne/flex_component/flex_component.html.erb +0 -5
  186. data/app/components/ariadne/flex_component.rb +0 -56
  187. data/app/components/ariadne/footer_component/footer_component.html.erb +0 -7
  188. data/app/components/ariadne/footer_component.rb +0 -23
  189. data/app/components/ariadne/grid_component/grid_component.html.erb +0 -26
  190. data/app/components/ariadne/grid_component.rb +0 -67
  191. data/app/components/ariadne/header_component/header_component.html.erb +0 -29
  192. data/app/components/ariadne/header_component.rb +0 -111
  193. data/app/components/ariadne/heading_component.rb +0 -49
  194. data/app/components/ariadne/heroicon_component/heroicon_component.html.erb +0 -4
  195. data/app/components/ariadne/heroicon_component.rb +0 -166
  196. data/app/components/ariadne/image_component.rb +0 -53
  197. data/app/components/ariadne/inline_flex_component/inline_flex_component.html.erb +0 -6
  198. data/app/components/ariadne/inline_flex_component.rb +0 -72
  199. data/app/components/ariadne/layout_component.html.erb +0 -21
  200. data/app/components/ariadne/layout_component.rb +0 -69
  201. data/app/components/ariadne/link_component.rb +0 -65
  202. data/app/components/ariadne/list_component/list_component.html.erb +0 -3
  203. data/app/components/ariadne/list_component.rb +0 -70
  204. data/app/components/ariadne/modal_component.html.erb +0 -11
  205. data/app/components/ariadne/modal_component.rb +0 -88
  206. data/app/components/ariadne/narrow_container_component/narrow_container_component.html.erb +0 -3
  207. data/app/components/ariadne/narrow_container_component.rb +0 -30
  208. data/app/components/ariadne/options_controller/options_controller.d.ts +0 -39
  209. data/app/components/ariadne/options_controller/options_controller.js +0 -89
  210. data/app/components/ariadne/options_controller/options_controller.ts +0 -122
  211. data/app/components/ariadne/outlet_manager_controller/outlet_manager_controller.d.ts +0 -42
  212. data/app/components/ariadne/outlet_manager_controller/outlet_manager_controller.js +0 -237
  213. data/app/components/ariadne/outlet_manager_controller/outlet_manager_controller.ts +0 -278
  214. data/app/components/ariadne/panel_bar_component/panel_bar_component.html.erb +0 -20
  215. data/app/components/ariadne/panel_bar_component.rb +0 -80
  216. data/app/components/ariadne/pill_component/pill_component.html.erb +0 -3
  217. data/app/components/ariadne/pill_component.rb +0 -44
  218. data/app/components/ariadne/popover_component.html.erb +0 -10
  219. data/app/components/ariadne/popover_component.rb +0 -81
  220. data/app/components/ariadne/progress_bar_component.html.erb +0 -5
  221. data/app/components/ariadne/progress_bar_component.rb +0 -63
  222. data/app/components/ariadne/relative_time_component.html.erb +0 -3
  223. data/app/components/ariadne/relative_time_component.rb +0 -61
  224. data/app/components/ariadne/show_more_button_component.html.erb +0 -11
  225. data/app/components/ariadne/show_more_button_component.rb +0 -47
  226. data/app/components/ariadne/slideover_component/slideover-component.d.ts +0 -9
  227. data/app/components/ariadne/slideover_component/slideover-component.js +0 -11
  228. data/app/components/ariadne/slideover_component/slideover-component.ts +0 -17
  229. data/app/components/ariadne/slideover_component/slideover_component.html.erb +0 -9
  230. data/app/components/ariadne/slideover_component.rb +0 -66
  231. data/app/components/ariadne/spinner_component.html.erb +0 -16
  232. data/app/components/ariadne/spinner_component.rb +0 -45
  233. data/app/components/ariadne/string_match_controller/string_match_controller.d.ts +0 -27
  234. data/app/components/ariadne/string_match_controller/string_match_controller.js +0 -51
  235. data/app/components/ariadne/string_match_controller/string_match_controller.ts +0 -65
  236. data/app/components/ariadne/subheader_component.html.erb +0 -11
  237. data/app/components/ariadne/subheader_component.rb +0 -65
  238. data/app/components/ariadne/synced_boolean_attributes_controller/synced_boolean_attributes_controller.d.ts +0 -48
  239. data/app/components/ariadne/synced_boolean_attributes_controller/synced_boolean_attributes_controller.js +0 -207
  240. data/app/components/ariadne/synced_boolean_attributes_controller/synced_boolean_attributes_controller.ts +0 -256
  241. data/app/components/ariadne/tab_component/tab_component.html.erb +0 -3
  242. data/app/components/ariadne/tab_component.rb +0 -98
  243. data/app/components/ariadne/tab_container_component/tab-container-component.d.ts +0 -1
  244. data/app/components/ariadne/tab_container_component/tab-container-component.js +0 -23
  245. data/app/components/ariadne/tab_container_component/tab-container-component.ts +0 -24
  246. data/app/components/ariadne/tab_container_component.erb +0 -10
  247. data/app/components/ariadne/tab_container_component.rb +0 -68
  248. data/app/components/ariadne/tab_nav_component/tab-nav-component.d.ts +0 -9
  249. data/app/components/ariadne/tab_nav_component/tab-nav-component.js +0 -33
  250. data/app/components/ariadne/tab_nav_component/tab-nav-component.ts +0 -34
  251. data/app/components/ariadne/tab_nav_component/tab_nav_component.html.erb +0 -7
  252. data/app/components/ariadne/tab_nav_component.rb +0 -72
  253. data/app/components/ariadne/table_nav_component/table_nav_component.html.erb +0 -52
  254. data/app/components/ariadne/table_nav_component.rb +0 -338
  255. data/app/components/ariadne/text.rb +0 -25
  256. data/app/components/ariadne/time_ago_component/time-ago-component.d.ts +0 -1
  257. data/app/components/ariadne/time_ago_component/time-ago-component.js +0 -1
  258. data/app/components/ariadne/time_ago_component/time-ago-component.ts +0 -1
  259. data/app/components/ariadne/time_ago_component.rb +0 -56
  260. data/app/components/ariadne/timeline_component/timeline_component.html.erb +0 -19
  261. data/app/components/ariadne/timeline_component.rb +0 -34
  262. data/app/components/ariadne/toggle_component/toggle_component.html.erb +0 -15
  263. data/app/components/ariadne/toggle_component.rb +0 -95
  264. data/app/components/ariadne/toggleable_controller/toggleable_controller.d.ts +0 -34
  265. data/app/components/ariadne/toggleable_controller/toggleable_controller.js +0 -54
  266. data/app/components/ariadne/toggleable_controller/toggleable_controller.ts +0 -77
  267. data/app/components/ariadne/tooltip_component/tooltip-component.d.ts +0 -24
  268. data/app/components/ariadne/tooltip_component/tooltip-component.js +0 -43
  269. data/app/components/ariadne/tooltip_component/tooltip-component.ts +0 -57
  270. data/app/components/ariadne/tooltip_component/tooltip_component.html.erb +0 -4
  271. data/app/components/ariadne/tooltip_component.rb +0 -108
  272. data/app/lib/ariadne/action_view_extensions/form_helper.rb +0 -30
  273. data/app/lib/ariadne/audited/dsl.rb +0 -32
  274. data/app/lib/ariadne/form_builder.rb +0 -80
  275. data/app/lib/ariadne/status/dsl.rb +0 -41
  276. data/config/importmap.rb +0 -3
  277. data/exe/tailwindcss +0 -21
  278. data/lib/rubocop/cop/ariadne/base_cop.rb +0 -26
  279. data/tailwind.config.js +0 -70
@@ -1,7 +1 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- @import 'tooltip-component.css';
6
- @import 'prosemirror.css';
7
- @import 'dropdown.css';
1
+ .scroll{scrollbar-color:rgb(163,166,177) transparent;scrollbar-color:oklch(.726563 .016 275 / 20) transparent}.scroll *::-webkit-scrollbar{height:1rem;width:.5rem}.scroll *::-webkit-scrollbar:horizontal{height:.5rem;width:1rem}.scroll *::-webkit-scrollbar-track{background-color:transparent}.scroll *::-webkit-scrollbar-thumb{background-color:#a3a6b133}.scroll *::-webkit-scrollbar-thumb:hover{background-color:#a3a6b166}.scroll *::-webkit-scrollbar-thumb{-webkit-transition-property:opacity;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}@media (min-width: 768px){.scrollbar-trigger *::-webkit-scrollbar-thumb{visibility:hidden}.scrollbar-trigger:hover *::-webkit-scrollbar-thumb{visibility:visible}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e3ef}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Instrument Sans,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;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}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,samp,pre{font-family:Martian Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color: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,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#b7bac5}input::placeholder,textarea::placeholder{opacity:1;color:#b7bac5}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--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: rgb(147 197 253 / .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: rgb(147 197 253 / .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: }.ariadne-z-50{z-index:50}.ariadne-mx-auto{margin-left:auto;margin-right:auto}.ariadne-mt-10{margin-top:2.5rem}.ariadne-mt-2{margin-top:.5rem}.ariadne-flex{display:flex}.ariadne-inline-flex{display:inline-flex}.ariadne-hidden{display:none}.ariadne-h-10{height:2.5rem}.ariadne-h-12{height:3rem}.ariadne-h-16{height:4rem}.ariadne-h-4{height:1rem}.ariadne-h-5{height:1.25rem}.ariadne-h-6{height:1.5rem}.ariadne-w-10{width:2.5rem}.ariadne-w-12{width:3rem}.ariadne-w-16{width:4rem}.ariadne-w-4{width:1rem}.ariadne-w-5{width:1.25rem}.ariadne-w-6{width:1.5rem}.ariadne-w-8{width:2rem}.ariadne-w-full{width:100%}.ariadne-flex-1{flex:1 1 0%}.ariadne-flex-shrink-0{flex-shrink:0}.ariadne-grow{flex-grow:1}.ariadne-scroll-m-20{scroll-margin:5rem}.ariadne-flex-col{flex-direction:column}.ariadne-items-center{align-items:center}.ariadne-justify-end{justify-content:flex-end}.ariadne-justify-center{justify-content:center}.ariadne-justify-between{justify-content:space-between}.ariadne-gap-0{gap:0px}.ariadne-gap-0\.5{gap:.125rem}.ariadne-gap-1{gap:.25rem}.ariadne-gap-8{gap:2rem}.ariadne-gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.ariadne-gap-x-1\.5{-moz-column-gap:.375rem;column-gap:.375rem}.ariadne-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.ariadne-overflow-hidden{overflow:hidden}.ariadne-rounded{border-radius:.25rem}.ariadne-rounded-lg{border-radius:.5rem}.ariadne-rounded-md{border-radius:.375rem}.ariadne-border{border-width:1px}.ariadne-border-b{border-bottom-width:1px}.ariadne-border-solid{border-style:solid}.ariadne-border-red-600{--tw-border-opacity: 1;border-color:rgba(205,98,101,var(--tw-border-opacity))}@supports (color: oklab(0% 0 0%)){.ariadne-border-red-600{border-color:oklch(.626953 .135937 20 / var(--tw-border-opacity))}}.ariadne-border-transparent{border-color:transparent}.ariadne-border-zinc-100{--tw-border-opacity: 1;border-color:rgba(242,243,249,var(--tw-border-opacity))}@supports (color: oklab(0% 0 0%)){.ariadne-border-zinc-100{border-color:oklch(.964844 .008 275 / var(--tw-border-opacity))}}.ariadne-border-zinc-200{--tw-border-opacity: 1;border-color:rgba(226,228,233,var(--tw-border-opacity))}@supports (color: oklab(0% 0 0%)){.ariadne-border-zinc-200{border-color:oklch(.917969 .008 275 / var(--tw-border-opacity))}}.ariadne-bg-emerald-600{--tw-bg-opacity: 1;background-color:rgba(79,147,64,var(--tw-bg-opacity))}@supports (color: oklab(0% 0 0%)){.ariadne-bg-emerald-600{background-color:oklch(.597656 .135937 140 / var(--tw-bg-opacity))}}.ariadne-bg-red-200{--tw-bg-opacity: 1;background-color:rgba(255,219,218,var(--tw-bg-opacity))}@supports (color: color(display-p3 0 0 0%)){.ariadne-bg-red-200{background-color:color(display-p3 .98165 .86321 .85651 / var(--tw-bg-opacity))}}@supports (color: oklab(0% 0 0%)){.ariadne-bg-red-200{background-color:oklch(.921875 .0421875 20 / var(--tw-bg-opacity))}}.ariadne-bg-transparent{background-color:transparent}.ariadne-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.ariadne-bg-zinc-100{--tw-bg-opacity: 1;background-color:rgba(242,243,249,var(--tw-bg-opacity))}@supports (color: oklab(0% 0 0%)){.ariadne-bg-zinc-100{background-color:oklch(.964844 .008 275 / var(--tw-bg-opacity))}}.ariadne-bg-zinc-50{--tw-bg-opacity: 1;background-color:rgba(250,251,255,var(--tw-bg-opacity))}@supports (color: oklab(0% 0 0%)){.ariadne-bg-zinc-50{background-color:oklch(.988281 .004875 275 / var(--tw-bg-opacity))}}.ariadne-object-cover{-o-object-fit:cover;object-fit:cover}.ariadne-object-center{-o-object-position:center;object-position:center}.ariadne-px-1{padding-left:.25rem;padding-right:.25rem}.ariadne-px-1\.5{padding-left:.375rem;padding-right:.375rem}.ariadne-px-2{padding-left:.5rem;padding-right:.5rem}.ariadne-px-2\.5{padding-left:.625rem;padding-right:.625rem}.ariadne-px-3{padding-left:.75rem;padding-right:.75rem}.ariadne-px-3\.5{padding-left:.875rem;padding-right:.875rem}.ariadne-px-6{padding-left:1.5rem;padding-right:1.5rem}.ariadne-py-1{padding-top:.25rem;padding-bottom:.25rem}.ariadne-py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.ariadne-py-12{padding-top:3rem;padding-bottom:3rem}.ariadne-py-2{padding-top:.5rem;padding-bottom:.5rem}.ariadne-py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.ariadne-py-6{padding-top:1.5rem;padding-bottom:1.5rem}.ariadne-text-4xl{font-size:2.25rem;line-height:2.5rem}.ariadne-text-base{font-size:1rem;line-height:1.5rem}.ariadne-text-lg{font-size:1.125rem;line-height:1.75rem}.ariadne-text-sm{font-size:.875rem;line-height:1.25rem}.ariadne-text-xl{font-size:1.25rem;line-height:1.75rem}.ariadne-text-xs{font-size:.75rem;line-height:1rem}.ariadne-font-extrabold{font-weight:800}.ariadne-font-medium{font-weight:500}.ariadne-font-semibold{font-weight:600}.ariadne-leading-10{line-height:2.5rem}.ariadne-leading-5{line-height:1.25rem}.ariadne-leading-7{line-height:1.75rem}.ariadne-leading-8{line-height:2rem}.ariadne-leading-none{line-height:1}.ariadne-tracking-tight{letter-spacing:-.025em}.ariadne-text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.ariadne-text-gray-500{--tw-text-opacity: 1;color:rgba(163,166,177,var(--tw-text-opacity))}@supports (color: oklab(0% 0 0%)){.ariadne-text-gray-500{color:oklch(.726563 .016 275 / var(--tw-text-opacity))}}.ariadne-text-red-600{--tw-text-opacity: 1;color:rgba(205,98,101,var(--tw-text-opacity))}@supports (color: oklab(0% 0 0%)){.ariadne-text-red-600{color:oklch(.626953 .135937 20 / var(--tw-text-opacity))}}.ariadne-text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.ariadne-shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ariadne-shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ariadne-shadow-sm{--tw-shadow: 0 1px 3px 0 rgba(0 0 0 / 10%), 0 0 1px 0 rgba(0 0 0 / 10%);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 0 1px 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)}summary::-webkit-details-marker{display:none}@media (prefers-reduced-motion){*{animation-duration:.01s;transition-duration:.01s}}.placeholder\:ariadne-text-zinc-600::-moz-placeholder{--tw-text-opacity: 1;color:rgba(131,132,137,var(--tw-text-opacity))}.placeholder\:ariadne-text-zinc-600::placeholder{--tw-text-opacity: 1;color:rgba(131,132,137,var(--tw-text-opacity))}@supports (color: oklab(0% 0 0%)){.placeholder\:ariadne-text-zinc-600::-moz-placeholder{color:oklch(.613281 .008 275 / var(--tw-text-opacity))}.placeholder\:ariadne-text-zinc-600::placeholder{color:oklch(.613281 .008 275 / var(--tw-text-opacity))}}.hover\:ariadne-border-indigo-600:hover{--tw-border-opacity: 1;border-color:rgba(82,131,213,var(--tw-border-opacity))}@supports (color: oklab(0% 0 0%)){.hover\:ariadne-border-indigo-600:hover{border-color:oklch(.613281 .135937 260 / var(--tw-border-opacity))}}.hover\:ariadne-bg-emerald-700:hover{--tw-bg-opacity: 1;background-color:rgba(63,118,51,var(--tw-bg-opacity))}@supports (color: oklab(0% 0 0%)){.hover\:ariadne-bg-emerald-700:hover{background-color:oklch(.511719 .115625 140 / var(--tw-bg-opacity))}}.hover\:ariadne-bg-red-500:hover{--tw-bg-opacity: 1;background-color:rgba(252,128,131,var(--tw-bg-opacity))}@supports (color: oklab(0% 0 0%)){.hover\:ariadne-bg-red-500:hover{background-color:oklch(.742188 .151562 20 / var(--tw-bg-opacity))}}.hover\:ariadne-bg-zinc-200\/20:hover{background-color:#e2e4e933}.hover\:ariadne-bg-zinc-300\/20:hover{background-color:#cdced433}.hover\:ariadne-text-indigo-600:hover{--tw-text-opacity: 1;color:rgba(82,131,213,var(--tw-text-opacity))}@supports (color: oklab(0% 0 0%)){.hover\:ariadne-text-indigo-600:hover{color:oklch(.613281 .135937 260 / var(--tw-text-opacity))}}.hover\:ariadne-text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.focus\:\!ariadne-border-transparent:focus{border-color:transparent!important}.focus\:ariadne-border-blue-300:focus{--tw-border-opacity: 1;border-color:rgba(159,213,252,var(--tw-border-opacity))}@supports (color: oklab(0% 0 0%)){.focus\:ariadne-border-blue-300:focus{border-color:oklch(.849609 .078125 240 / var(--tw-border-opacity))}}.focus\:ariadne-bg-blue-300\/20:focus{background-color:#9fd5fc33}.focus\:ariadne-text-indigo-600:focus{--tw-text-opacity: 1;color:rgba(82,131,213,var(--tw-text-opacity))}@supports (color: oklab(0% 0 0%)){.focus\:ariadne-text-indigo-600:focus{color:oklch(.613281 .135937 260 / var(--tw-text-opacity))}}.focus-visible\:ariadne-outline:focus-visible{outline-style:solid}.focus-visible\:ariadne-outline-2:focus-visible{outline-width:2px}.focus-visible\:ariadne-outline-offset-2:focus-visible{outline-offset:2px}.active\:ariadne-border-transparent:active{border-color:transparent}.active\:ariadne-bg-emerald-800:active{--tw-bg-opacity: 1;background-color:rgba(43,83,33,var(--tw-bg-opacity))}@supports (color: oklab(0% 0 0%)){.active\:ariadne-bg-emerald-800:active{background-color:oklch(.400391 .090625 140 / var(--tw-bg-opacity))}}.active\:ariadne-bg-indigo-700\/10:active{background-color:#4169ac1a}.active\:ariadne-bg-red-600:active{--tw-bg-opacity: 1;background-color:rgba(205,98,101,var(--tw-bg-opacity))}@supports (color: oklab(0% 0 0%)){.active\:ariadne-bg-red-600:active{background-color:oklch(.626953 .135937 20 / var(--tw-bg-opacity))}}.active\:ariadne-bg-zinc-200\/80:active{background-color:#e2e4e9cc}.active\:ariadne-bg-zinc-500\/10:active{background-color:#a5a6ac1a}.active\:ariadne-text-white:active{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.disabled\:ariadne-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:ariadne-border-transparent:disabled{border-color:transparent}.disabled\:ariadne-bg-emerald-100:disabled{--tw-bg-opacity: 1;background-color:rgba(237,246,235,var(--tw-bg-opacity))}@supports (color: oklab(0% 0 0%)){.disabled\:ariadne-bg-emerald-100:disabled{background-color:oklch(.962891 .0171875 140 / var(--tw-bg-opacity))}}.disabled\:ariadne-bg-zinc-200:disabled{--tw-bg-opacity: 1;background-color:rgba(226,228,233,var(--tw-bg-opacity))}@supports (color: oklab(0% 0 0%)){.disabled\:ariadne-bg-zinc-200:disabled{background-color:oklch(.917969 .008 275 / var(--tw-bg-opacity))}}.disabled\:ariadne-text-emerald-400:disabled{--tw-text-opacity: 1;color:rgba(143,201,130,var(--tw-text-opacity))}@supports (color: oklab(0% 0 0%)){.disabled\:ariadne-text-emerald-400:disabled{color:oklch(.777344 .114063 140 / var(--tw-text-opacity))}}.disabled\:ariadne-text-zinc-400:disabled{--tw-text-opacity: 1;color:rgba(184,186,191,var(--tw-text-opacity))}@supports (color: oklab(0% 0 0%)){.disabled\:ariadne-text-zinc-400:disabled{color:oklch(.789063 .008 275 / var(--tw-text-opacity))}}.ariadne-peer:disabled~.peer-disabled\:ariadne-cursor-not-allowed{cursor:not-allowed}.ariadne-peer:disabled~.peer-disabled\:ariadne-opacity-70{opacity:.7}.dark\:ariadne-border-zinc-900:is(.ariadne-dark *){--tw-border-opacity: 1;border-color:rgba(45,46,51,var(--tw-border-opacity))}@supports (color: oklab(0% 0 0%)){.dark\:ariadne-border-zinc-900:is(.ariadne-dark *){border-color:oklch(.302734 .008 275 / var(--tw-border-opacity))}}.dark\:ariadne-bg-red-900:is(.ariadne-dark *){--tw-bg-opacity: 1;background-color:rgba(75,32,33,var(--tw-bg-opacity))}@supports (color: oklab(0% 0 0%)){.dark\:ariadne-bg-red-900:is(.ariadne-dark *){background-color:oklch(.306641 .065625 20 / var(--tw-bg-opacity))}}.dark\:ariadne-bg-zinc-900:is(.ariadne-dark *){--tw-bg-opacity: 1;background-color:rgba(45,46,51,var(--tw-bg-opacity))}@supports (color: oklab(0% 0 0%)){.dark\:ariadne-bg-zinc-900:is(.ariadne-dark *){background-color:oklch(.302734 .008 275 / var(--tw-bg-opacity))}}.dark\:ariadne-text-slate-100:is(.ariadne-dark *){--tw-text-opacity: 1;color:rgba(240,243,255,var(--tw-text-opacity))}@supports (color: color(display-p3 0 0 0%)){.dark\:ariadne-text-slate-100:is(.ariadne-dark *){color:color(display-p3 .94177 .95165 .99851 / var(--tw-text-opacity))}}@supports (color: oklab(0% 0 0%)){.dark\:ariadne-text-slate-100:is(.ariadne-dark *){color:oklch(.964844 .01775 275 / var(--tw-text-opacity))}}.dark\:ariadne-text-white:is(.ariadne-dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:placeholder\:ariadne-text-zinc-400:is(.ariadne-dark *)::-moz-placeholder{--tw-text-opacity: 1;color:rgba(184,186,191,var(--tw-text-opacity))}.dark\:placeholder\:ariadne-text-zinc-400:is(.ariadne-dark *)::placeholder{--tw-text-opacity: 1;color:rgba(184,186,191,var(--tw-text-opacity))}@supports (color: oklab(0% 0 0%)){.dark\:placeholder\:ariadne-text-zinc-400:is(.ariadne-dark *)::-moz-placeholder{color:oklch(.789063 .008 275 / var(--tw-text-opacity))}.dark\:placeholder\:ariadne-text-zinc-400:is(.ariadne-dark *)::placeholder{color:oklch(.789063 .008 275 / var(--tw-text-opacity))}}.dark\:hover\:ariadne-border-indigo-400:hover:is(.ariadne-dark *){--tw-border-opacity: 1;border-color:rgba(144,187,255,var(--tw-border-opacity))}@supports (color: color(display-p3 0 0 0%)){.dark\:hover\:ariadne-border-indigo-400:hover:is(.ariadne-dark *){border-color:color(display-p3 .59635 .72902 .99463 / var(--tw-border-opacity))}}@supports (color: oklab(0% 0 0%)){.dark\:hover\:ariadne-border-indigo-400:hover:is(.ariadne-dark *){border-color:oklch(.789063 .114063 260 / var(--tw-border-opacity))}}.dark\:hover\:ariadne-bg-zinc-600\/20:hover:is(.ariadne-dark *){background-color:#83848933}.dark\:hover\:ariadne-text-indigo-400:hover:is(.ariadne-dark *){--tw-text-opacity: 1;color:rgba(144,187,255,var(--tw-text-opacity))}@supports (color: color(display-p3 0 0 0%)){.dark\:hover\:ariadne-text-indigo-400:hover:is(.ariadne-dark *){color:color(display-p3 .59635 .72902 .99463 / var(--tw-text-opacity))}}@supports (color: oklab(0% 0 0%)){.dark\:hover\:ariadne-text-indigo-400:hover:is(.ariadne-dark *){color:oklch(.789063 .114063 260 / var(--tw-text-opacity))}}.dark\:focus\:ariadne-border-blue-600:focus:is(.ariadne-dark *){--tw-border-opacity: 1;border-color:rgba(12,138,202,var(--tw-border-opacity))}@supports (color: oklab(0% 0 0%)){.dark\:focus\:ariadne-border-blue-600:focus:is(.ariadne-dark *){border-color:oklch(.605469 .135937 240 / var(--tw-border-opacity))}}.dark\:focus\:ariadne-bg-blue-600\/20:focus:is(.ariadne-dark *){background-color:#0c8aca33}.dark\:focus\:ariadne-text-indigo-400:focus:is(.ariadne-dark *){--tw-text-opacity: 1;color:rgba(144,187,255,var(--tw-text-opacity))}@supports (color: color(display-p3 0 0 0%)){.dark\:focus\:ariadne-text-indigo-400:focus:is(.ariadne-dark *){color:color(display-p3 .59635 .72902 .99463 / var(--tw-text-opacity))}}@supports (color: oklab(0% 0 0%)){.dark\:focus\:ariadne-text-indigo-400:focus:is(.ariadne-dark *){color:oklch(.789063 .114063 260 / var(--tw-text-opacity))}}.active\:dark\:ariadne-bg-indigo-300\/10:is(.ariadne-dark *):active{background-color:#b3d0ff1a;background-color:color(display-p3 .71915 .81354 .99753 / .1);background-color:oklch(.853516 .078125 260 / .1)}.dark\:active\:ariadne-bg-red-400:active:is(.ariadne-dark *){--tw-bg-opacity: 1;background-color:rgba(255,160,159,var(--tw-bg-opacity))}@supports (color: color(display-p3 0 0 0%)){.dark\:active\:ariadne-bg-red-400:active:is(.ariadne-dark *){background-color:color(display-p3 .94751 .64312 .63424 / var(--tw-bg-opacity))}}@supports (color: oklab(0% 0 0%)){.dark\:active\:ariadne-bg-red-400:active:is(.ariadne-dark *){background-color:oklch(.800781 .114063 20 / var(--tw-bg-opacity))}}.dark\:active\:ariadne-bg-zinc-500\/10:active:is(.ariadne-dark *){background-color:#a5a6ac1a}.dark\:active\:ariadne-bg-zinc-700\/20:active:is(.ariadne-dark *){background-color:#686a6f33}.dark\:disabled\:ariadne-bg-zinc-800:disabled:is(.ariadne-dark *){--tw-bg-opacity: 1;background-color:rgba(73,75,79,var(--tw-bg-opacity))}@supports (color: oklab(0% 0 0%)){.dark\:disabled\:ariadne-bg-zinc-800:disabled:is(.ariadne-dark *){background-color:oklch(.412109 .008 275 / var(--tw-bg-opacity))}}.disabled\:dark\:ariadne-bg-emerald-900:is(.ariadne-dark *):disabled{--tw-bg-opacity: 1;background-color:rgba(25,52,19,var(--tw-bg-opacity))}@supports (color: oklab(0% 0 0%)){.disabled\:dark\:ariadne-bg-emerald-900:is(.ariadne-dark *):disabled{background-color:oklch(.294922 .065625 140 / var(--tw-bg-opacity))}}.dark\:disabled\:ariadne-text-zinc-600:disabled:is(.ariadne-dark *){--tw-text-opacity: 1;color:rgba(131,132,137,var(--tw-text-opacity))}@supports (color: oklab(0% 0 0%)){.dark\:disabled\:ariadne-text-zinc-600:disabled:is(.ariadne-dark *){color:oklch(.613281 .008 275 / var(--tw-text-opacity))}}.disabled\:dark\:ariadne-text-emerald-600:is(.ariadne-dark *):disabled{--tw-text-opacity: 1;color:rgba(79,147,64,var(--tw-text-opacity))}@supports (color: oklab(0% 0 0%)){.disabled\:dark\:ariadne-text-emerald-600:is(.ariadne-dark *):disabled{color:oklch(.597656 .135937 140 / var(--tw-text-opacity))}}@media (min-width: 640px){.sm\:ariadne-mx-auto{margin-left:auto;margin-right:auto}.sm\:ariadne-w-full{width:100%}.sm\:ariadne-max-w-\[480px\]{max-width:480px}.sm\:ariadne-rounded-lg{border-radius:.5rem}.sm\:ariadne-px-12{padding-left:3rem;padding-right:3rem}.sm\:ariadne-px-4{padding-left:1rem;padding-right:1rem}}@media (min-width: 1024px){.lg\:ariadne-ml-4{margin-left:1rem}.lg\:ariadne-ml-6{margin-left:1.5rem}.lg\:ariadne-flex{display:flex}.lg\:ariadne-items-center{align-items:center}.lg\:ariadne-space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.lg\:ariadne-px-0{padding-left:0;padding-right:0}.lg\:ariadne-px-8{padding-left:2rem;padding-right:2rem}.lg\:ariadne-text-5xl{font-size:3rem;line-height:1}}.\[\&\:not\(\:focus\)\]\:enabled\:hover\:ariadne-border-red-700:hover:enabled:not(:focus){--tw-border-opacity: 1;border-color:rgba(166,78,81,var(--tw-border-opacity))}@supports (color: oklab(0% 0 0%)){.\[\&\:not\(\:focus\)\]\:enabled\:hover\:ariadne-border-red-700:hover:enabled:not(:focus){border-color:oklch(.535156 .115625 20 / var(--tw-border-opacity))}}.\[\&\:not\(\:focus\)\]\:enabled\:hover\:ariadne-border-zinc-300:hover:enabled:not(:focus){--tw-border-opacity: 1;border-color:rgba(205,206,212,var(--tw-border-opacity))}@supports (color: oklab(0% 0 0%)){.\[\&\:not\(\:focus\)\]\:enabled\:hover\:ariadne-border-zinc-300:hover:enabled:not(:focus){border-color:oklch(.853516 .008 275 / var(--tw-border-opacity))}}.\[\&\:not\(\:focus\)\]\:enabled\:hover\:ariadne-bg-red-300\/80:hover:enabled:not(:focus){background-color:#ffbebdcc;background-color:color(display-p3 .96737 .75397 .74438 / .8);background-color:oklch(.861328 .078125 20 / .8)}.\[\&\:not\(\:focus\)\]\:enabled\:hover\:ariadne-bg-zinc-200\/20:hover:enabled:not(:focus){background-color:#e2e4e933}.\[\&\:not\(\:focus\)\]\:dark\:enabled\:hover\:ariadne-border-red-700:hover:enabled:is(.ariadne-dark *):not(:focus){--tw-border-opacity: 1;border-color:rgba(166,78,81,var(--tw-border-opacity))}@supports (color: oklab(0% 0 0%)){.\[\&\:not\(\:focus\)\]\:dark\:enabled\:hover\:ariadne-border-red-700:hover:enabled:is(.ariadne-dark *):not(:focus){border-color:oklch(.535156 .115625 20 / var(--tw-border-opacity))}}.\[\&\:not\(\:focus\)\]\:dark\:enabled\:hover\:ariadne-border-zinc-600:hover:enabled:is(.ariadne-dark *):not(:focus){--tw-border-opacity: 1;border-color:rgba(131,132,137,var(--tw-border-opacity))}@supports (color: oklab(0% 0 0%)){.\[\&\:not\(\:focus\)\]\:dark\:enabled\:hover\:ariadne-border-zinc-600:hover:enabled:is(.ariadne-dark *):not(:focus){border-color:oklch(.613281 .008 275 / var(--tw-border-opacity))}}.\[\&\:not\(\:focus\)\]\:dark\:enabled\:hover\:ariadne-bg-red-900\/80:hover:enabled:is(.ariadne-dark *):not(:focus){background-color:#4b2021cc}.\[\&\:not\(\:focus\)\]\:dark\:enabled\:hover\:ariadne-bg-zinc-700\/20:hover:enabled:is(.ariadne-dark *):not(:focus){background-color:#686a6f33}.\[\&\>svg\]\:ariadne-size-3>svg{width:.75rem;height:.75rem}.\[\&\>svg\]\:ariadne-size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:ariadne-size-5>svg{width:1.25rem;height:1.25rem}.\[\&\>svg\]\:ariadne-text-zinc-400>svg{--tw-text-opacity: 1;color:rgba(184,186,191,var(--tw-text-opacity))}@supports (color: oklab(0% 0 0%)){.\[\&\>svg\]\:ariadne-text-zinc-400>svg{color:oklch(.789063 .008 275 / var(--tw-text-opacity))}}.\[\&\>svg\]\:dark\:ariadne-text-zinc-600:is(.ariadne-dark *)>svg{--tw-text-opacity: 1;color:rgba(131,132,137,var(--tw-text-opacity))}@supports (color: oklab(0% 0 0%)){.\[\&\>svg\]\:dark\:ariadne-text-zinc-600:is(.ariadne-dark *)>svg{color:oklch(.613281 .008 275 / var(--tw-text-opacity))}}.typography p,.typography ol,.typography ul{max-width:600px}.typography a{font-weight:500;text-decoration-line:underline}.typography strong{font-weight:700}.typography ol{position:relative;list-style-type:none;padding-left:1.5rem;counter-reset:list-number}.typography ol>li:before{position:absolute;left:0;width:1.25rem;overflow:hidden;text-align:right;counter-increment:list-number;content:counter(list-number) "."}.typography ul{position:relative;list-style-type:none;padding-left:1.5rem}.typography ul>li:before{position:absolute;left:0;width:1.25rem;overflow:hidden;text-align:center;content:"▪"}.typography dt{font-weight:600}.typography hr{border-top-width:1px}.typography blockquote{border-left-width:4px;padding-left:.5rem;font-weight:500;font-style:italic}.typography blockquote p:first-of-type:before{content:open-quote}.typography blockquote p:last-of-type:after{content:close-quote}.typography kbd{font-weight:500;color:inherit;font-family:inherit}.typography code{font-family:Martian Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-weight:600}.typography pre{overflow-x:auto;border-radius:.5rem;background-color:rgba(205,206,212,var(--tw-bg-opacity));--tw-bg-opacity: .1;padding:.5rem .75rem;font-family:Martian Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}@supports (color: oklab(0% 0 0%)){.typography pre{background-color:oklch(.853516 .008 275 / var(--tw-bg-opacity))}}.typography pre:is(.ariadne-dark *){background-color:rgba(104,106,111,var(--tw-bg-opacity));--tw-bg-opacity: .1}@supports (color: oklab(0% 0 0%)){.typography pre:is(.ariadne-dark *){background-color:oklch(.523438 .008 275 / var(--tw-bg-opacity))}}.typography pre code{color:inherit;font:inherit}.typography :not(pre)>code{border-radius:.5rem;background-color:rgba(205,206,212,var(--tw-bg-opacity));--tw-bg-opacity: .1;padding:.25rem}@supports (color: oklab(0% 0 0%)){.typography :not(pre)>code{background-color:oklch(.853516 .008 275 / var(--tw-bg-opacity))}}.typography :not(pre)>code:is(.ariadne-dark *){background-color:rgba(104,106,111,var(--tw-bg-opacity));--tw-bg-opacity: .1}@supports (color: oklab(0% 0 0%)){.typography :not(pre)>code:is(.ariadne-dark *){background-color:oklch(.523438 .008 275 / var(--tw-bg-opacity))}}.typography pre code:before,.typography pre code:after{--tw-content: none;content:var(--tw-content)}.typography table{width:100%;table-layout:auto;text-align:left}.typography thead{border-bottom-width:1px;border-bottom-color:#fafbfe1a}.typography thead th{padding-top:.25rem;padding-bottom:.25rem;vertical-align:bottom;font-weight:600}.typography tbody tr{border-bottom-width:1px;border-bottom-color:#fafbfe1a}.typography tbody tr:last-child{border-bottom-width:0px}.typography tbody td{padding-top:.25rem;padding-bottom:.25rem;vertical-align:baseline}.typography tfoot{border-top-width:1px}.typography tfoot td{vertical-align:top}.tippy-box.tomato-theme{background-color:tomato;color:#ff0}
@@ -1,37 +1,89 @@
1
+ # typed: false
1
2
  # frozen_string_literal: true
2
3
 
4
+ require_relative "../../lib/view_components_contrib/html_attrs"
5
+ require "dry-initializer"
6
+
3
7
  module Ariadne
4
- # All Ariadne ViewComponents accept a standard set of options: classes, which match Tailwind CSS classes, and attributes, which match HTML attributes..
5
- #
6
- # Under the hood, any-non class attributes is passed to Rails' [`tag`](https://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-tag)
7
- # (for self-closing tags) or [`content_tag`](https://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-content_tag).
8
- class BaseComponent < Ariadne::Component
9
- SELF_CLOSING_TAGS = [:area, :base, :br, :col, :embed, :hr, :img, :input, :link, :meta, :param, :source, :track, :wbr].freeze
10
-
11
- def initialize(tag:, classes: "", attributes: {})
12
- @tag = tag
13
-
14
- @attributes = validate_attributes(tag: tag, attributes: attributes) || {}
15
- @attributes[:"data-ariadne-view-component"] = true
16
-
17
- classes = @attributes.fetch(:classes, "") if classes.blank?
18
- @classes = validate_merge_class_names(classes) || {}
19
- @content_tag_args = {}
20
- end
21
-
22
- def call
23
- options = @attributes.merge(@classes)
24
- if SELF_CLOSING_TAGS.include?(@tag)
25
- tag(@tag, options)
26
- else
27
- content_tag(@tag, content, options)
8
+ # :nodoc:
9
+ class BaseComponent < ViewComponentContrib::Base
10
+ include ViewComponentContrib::StyleVariants
11
+ require_relative "../../lib/view_components_contrib/style_variants"
12
+
13
+ include ViewComponentContrib::HTMLAttrs
14
+ include ViewComponentContrib::TranslationHelper
15
+
16
+ include Ariadne::AttributesHelper
17
+
18
+ extend Dry::Initializer[undefined: false]
19
+
20
+ accepts_html_attributes
21
+
22
+ ACCEPT_ANYTHING = lambda { |static_content = nil, &block|
23
+ next static_content if static_content.present?
24
+
25
+ view_context.capture { block&.call }
26
+ }
27
+
28
+ # classes is an array of CSS classes
29
+ style_config.postprocess_with do |classes|
30
+ Ariadne::ViewComponents.tailwind_merger.merge(classes)
31
+ end
32
+
33
+ class << self
34
+ def component_name
35
+ @component_name ||= name.sub(/::Component$/, "").underscore
36
+ end
37
+
38
+ def component_id(&block)
39
+ @component_id ||= block || proc { self.class.component_name.delete_prefix("ui/").gsub(/[^a-z0-9]+/, "-") }
40
+ end
41
+
42
+ def stimulus_name
43
+ # @tag stimulus-id
44
+ @stimulus_name ||= component_name.gsub(/[^a-z0-9]+/, "-")
28
45
  end
29
46
  end
30
47
 
31
- private def validate_merge_class_names(classes)
32
- return if classes.blank?
48
+ self.i18n_namespace = nil
49
+
50
+ # Support relative component names within components
51
+ def component(name, ...)
52
+ return super unless name.starts_with?(".")
53
+
54
+ full_name = Pathname.new(File.join(self.class.component_name, name)).cleanpath.to_s
55
+
56
+ super(full_name, ...)
57
+ end
58
+
59
+ def component_id
60
+ @component_id ||= instance_eval(&self.class.component_id)
61
+ end
62
+
63
+ def class_for(name)
64
+ # @tag isolated-styles
65
+ # stripping away UI and Component
66
+ modulename = self.class.name.split("::")[1...-1].join("--").downcase
67
+
68
+ "ariadne-#{modulename}-#{name}"
69
+ end
70
+
71
+ def stimulus_name
72
+ self.class.stimulus_name
73
+ end
74
+
75
+ def options
76
+ @options ||= self.class.dry_initializer.attributes(self)
77
+ end
78
+
79
+ def html_attributes
80
+ tag.attributes(html_attrs.except(:class))
81
+ end
33
82
 
34
- { class: Ariadne::ViewComponents.tailwind_merger.merge(classes) }
83
+ def validate_aria_label!(html_attrs)
84
+ aria_label = aria(html_attrs, "label")
85
+ aria_labelledby = aria(html_attrs, "labelledby")
86
+ raise ArgumentError, "`aria-label` or `aria-labelledby` is required." if aria_label.nil? && aria_labelledby.nil?
35
87
  end
36
88
  end
37
89
  end
@@ -0,0 +1,120 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ariadne
4
+ module Behaviors
5
+ module Tooltipable
6
+ def with_tooltip(text, **options)
7
+ @tooltip_id = Generate.id
8
+
9
+ html_attrs.merge!(
10
+ "data-ariadne-tooltip-target" => "activator",
11
+ "aria-describedby" => @tooltip_id,
12
+ )
13
+
14
+ prepend_action(html_attrs, tooltip_action)
15
+
16
+ # TODO: this should raise if component's tag isn't an ARIA-compatible tag
17
+ # ('a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])')
18
+ Ariadne::Behaviors::Tooltip.new(id: @tooltip_id, text: text, component: self, **options)
19
+ end
20
+
21
+ def tooltip_action
22
+ "mouseover->ariadne-tooltip#showTooltip mouseout->ariadne-tooltip#hideTooltip"
23
+ end
24
+ end
25
+
26
+ class Tooltip < Ariadne::BaseComponent
27
+ option :id
28
+ option :text
29
+ option :component
30
+ option :size, default: -> { :sm }
31
+
32
+ erb_template <<~ERB
33
+ <div data-controller="ariadne-tooltip",>
34
+ <%= render(component) { content } %>
35
+ <div class="<%= style(:tooltip_wrapper) %>" data-ariadne-tooltip-target="wrapper">
36
+ <div id="<%= id %>" class="<%= style(size:) %>" data-ariadne-tooltip-target="tooltip">
37
+ <div class="<%= style(:arrow) %>" class=arrow data-ariadne-tooltip-target="arrow"></div>
38
+ <div class="<%= style(:text) %>"><%= text %></div>
39
+ </div>
40
+ </div>
41
+ </template>
42
+ ERB
43
+
44
+ style do
45
+ base do
46
+ [
47
+ "absolute",
48
+ "w-max",
49
+ "z-20",
50
+ "isolate",
51
+ "flex",
52
+ "flex-col",
53
+ "gap-0.5",
54
+ "p-2",
55
+ "text-center",
56
+ "rounded-lg",
57
+ "bg-zinc-950",
58
+ "dark:bg-zinc-100",
59
+ "shadow-lg",
60
+ "dark:shadow-zinc-100/50",
61
+ ]
62
+ end
63
+
64
+ variants do
65
+ size do
66
+ # w-36
67
+ sm { "max-w-[min(144px,90vw)]" }
68
+ # w-52
69
+ md { "max-w-[min(208px,90vw)]" }
70
+ # w-96
71
+ lg { "max-w-[min(384px,90vw)]" }
72
+ end
73
+ end
74
+ end
75
+
76
+ style :tooltip_wrapper do
77
+ base do
78
+ "hidden"
79
+ end
80
+ end
81
+
82
+ style :arrow do
83
+ base do
84
+ [
85
+ "absolute",
86
+ "z-10",
87
+ "w-2",
88
+ "h-2",
89
+ "rounded-tl-sm",
90
+ "rotate-45",
91
+ "bg-zinc-950",
92
+ "dark:bg-zinc-50",
93
+ "shadow-lg",
94
+ "dark:shadow-zinc-50",
95
+ ]
96
+ end
97
+ end
98
+
99
+ style :text do
100
+ base do
101
+ [
102
+ "text-sm",
103
+ "text-zinc-50",
104
+ "dark:text-zinc-900",
105
+ ]
106
+ end
107
+ end
108
+
109
+ style :action_text do
110
+ base do
111
+ [
112
+ "ariadne-xs-md",
113
+ "text-zinc-400",
114
+ "dark:text-zinc-600",
115
+ ]
116
+ end
117
+ end
118
+ end
119
+ end
120
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ariadne
4
+ # Conditionally renders a `Ariadne::BaseComponent` around the given content. If the given condition
5
+ # is true, a `Ariadne::BaseComponent` will render around the content. If the condition is false, only
6
+ # the content is rendered.
7
+ class ConditionalWrapper < Ariadne::BaseComponent
8
+ # @param condition [Boolean] Whether or not to wrap the content in a `Ariadne::BaseComponent`.
9
+ # @param base_component_arguments [Hash] The arguments to pass to `Ariadne::BaseComponent`.
10
+ def initialize(condition:, **base_component_arguments)
11
+ @condition = condition
12
+ @base_component_arguments = base_component_arguments
13
+ end
14
+
15
+ def call
16
+ return content unless @condition
17
+
18
+ BaseComponent.new(**@base_component_arguments).render_in(self) { content }
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ariadne
4
+ module Form
5
+ # :nodoc:
6
+ class BaseComponent
7
+ include Ariadne::ClassNameHelper
8
+ extend Ariadne::Forms::ActsAsComponent
9
+
10
+ def self.inherited(base)
11
+ base_path = Ariadne::Forms::Utils.const_source_location(base.name)
12
+
13
+ unless base_path
14
+ warn("Could not identify the template for #{base}")
15
+ return
16
+ end
17
+
18
+ dir = File.dirname(base_path)
19
+ base.renders_template(File.join(dir, "#{base.name.demodulize.underscore}.html.erb"), :render_template)
20
+ end
21
+
22
+ delegate :required?, :disabled?, :hidden?, to: :@input
23
+
24
+ def perform_render(&block)
25
+ return "" unless render?
26
+
27
+ @__prf_content_block = block
28
+ compile_and_render_template
29
+ end
30
+
31
+ def content
32
+ return @__prf_content if defined?(@__prf_content_evaluated) && @__prf_content_evaluated
33
+
34
+ @__prf_content_evaluated = true
35
+ @__prf_content = capture do
36
+ @__prf_content_block.call
37
+ end
38
+ end
39
+
40
+ # :nocov:
41
+ def type
42
+ :component
43
+ end
44
+ # :nocov:
45
+
46
+ def input?
47
+ false
48
+ end
49
+
50
+ def to_component
51
+ self
52
+ end
53
+
54
+ def render?
55
+ true
56
+ end
57
+
58
+ private
59
+
60
+ def compile_and_render_template
61
+ self.class.compile! unless self.class.instance_methods(false).include?(:render_template)
62
+ render_template
63
+ end
64
+
65
+ def content_tag_if(condition, tag, **kwargs, &block)
66
+ if condition
67
+ content_tag(tag, **kwargs, &block)
68
+ else
69
+ capture(&block)
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ariadne
4
+ module Form
5
+ class BaseInputComponent < Ariadne::BaseComponent
6
+ option :required, optional: true
7
+ option :caption, optional: true
8
+
9
+ def add_label_classes(*class_names)
10
+ # label_arguments[:class] = merge_class_names(
11
+ # label_arguments[:class], *class_names
12
+ # )
13
+ end
14
+
15
+ def label_arguments
16
+ {}
17
+ end
18
+
19
+ def hidden?
20
+ !!html_attrs[:hidden]
21
+ end
22
+
23
+ def full_width?
24
+ @full_width
25
+ end
26
+
27
+ # Whether or not to wrap the component in a FormControl, which renders a
28
+ # label above and validation message beneath the input.
29
+ def form_control?
30
+ html_attrs.delete(:form_control) { true }
31
+ end
32
+
33
+ private def before_render
34
+ # make sure to evaluate the component's content block so slots are defined
35
+ content
36
+
37
+ @input_attributes = {
38
+ aria: {},
39
+ }
40
+
41
+ ids = [].tap do |memo|
42
+ memo << @validation_id if @validation_message
43
+ memo << @caption_id if @init_caption || caption?
44
+ end
45
+
46
+ return if ids.empty?
47
+
48
+ @input_attributes[:aria][:describedby] = ids.join(" ")
49
+ end
50
+
51
+ private def caption?
52
+ @caption.present?
53
+ end
54
+
55
+ private def required?
56
+ @required.present?
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,10 @@
1
+ <% if @input.caption? && !@input.caption.blank? %>
2
+ <span class="FormControl-caption" id="<%= @input.caption_id %>"><%= @input.caption %></span>
3
+ <% elsif caption_template? %>
4
+ <% caption_template = render_caption_template %>
5
+ <% unless caption_template.blank? %>
6
+ <span class="FormControl-caption" id="<%= @input.caption_id %>">
7
+ <%= caption_template %>
8
+ </span>
9
+ <% end %>
10
+ <% end %>
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ariadne
4
+ module Form
5
+ # :nodoc:
6
+ class Caption < BaseComponent
7
+ def initialize(input:)
8
+ @input = input
9
+ end
10
+
11
+ def caption_template?
12
+ @input.caption_template?
13
+ end
14
+
15
+ def render_caption_template
16
+ @input.render_caption_template
17
+ end
18
+
19
+ def before_render
20
+ return unless @input.caption? && caption_template?
21
+
22
+ raise <<~MESSAGE
23
+ Please provide either a caption: argument or caption template for the
24
+ '#{@input.name}' input; both were found.
25
+ MESSAGE
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,19 @@
1
+ <% if @input.form_control? %>
2
+ <%= content_tag(@tag, **@form_group_arguments) do %>
3
+ <% if @input.label %>
4
+ <%= builder.label(@input.name, **@input.label_arguments) do %>
5
+ <%= @input.label %>
6
+ <% if @input.required? %>
7
+ <%= content_tag(:span, aria: { hidden: "true" }) { "*" } %>
8
+ <% end %>
9
+ <% end %>
10
+ <% end %>
11
+ <%= content %>
12
+ <% if @input.supports_validation? %>
13
+ <%= render(ValidationMessage.new(input: @input)) %>
14
+ <% end %>
15
+ <%= render(Caption.new(input: @input)) %>
16
+ <% end %>
17
+ <% else %>
18
+ <%= content %>
19
+ <% end %>
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ariadne
4
+ module Form
5
+ # :nodoc:
6
+ class FormControl < BaseComponent
7
+ delegate :builder, :form, to: :@input
8
+
9
+ def initialize(input:, tag: :div, **system_arguments)
10
+ @input = input
11
+ @tag = tag
12
+ @input.add_label_classes("FormControl-label")
13
+ @form_group_arguments = {
14
+ # **system_arguments,
15
+ # class: class_names(
16
+ # system_arguments[:class],
17
+ # system_arguments[:classes],
18
+ # "FormControl",
19
+ # "width-full FormControl--fullWidth" => @input.full_width?,
20
+ # ),
21
+ }
22
+
23
+ @form_group_arguments[:hidden] = "hidden" if @input.hidden?
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ariadne
4
+ module Form
5
+ # :nodoc:
6
+ class FormReference < BaseComponent
7
+ delegate :builder, :form, to: :@input
8
+
9
+ def initialize(input:)
10
+ @input = input
11
+ end
12
+
13
+ def builder_or_view
14
+ @input.nested? ? builder : @view_context
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ <%= content_tag_if(horizontal?, :div, class: "xxx") do %>
2
+ <% @inputs.each do |input| %>
3
+ <%= render(input.to_component) %>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ariadne
4
+ module Form
5
+ # :nodoc:
6
+ module Group
7
+ class Component < Ariadne::Form::BaseComponent
8
+ VERTICAL = :vertical
9
+ HORIZONTAL = :horizontal
10
+ DEFAULT_LAYOUT = VERTICAL
11
+ LAYOUTS = [VERTICAL, HORIZONTAL].freeze
12
+
13
+ def initialize(inputs:, builder:, form:, layout: DEFAULT_LAYOUT, **system_arguments)
14
+ @inputs = inputs
15
+ @builder = builder
16
+ @form = form
17
+ @layout = layout
18
+ @system_arguments = system_arguments
19
+ end
20
+
21
+ def horizontal?
22
+ @layout == HORIZONTAL
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1 @@
1
+ <%= builder.hidden_field(@input.name, **@input.input_attributes) %>
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ariadne
4
+ module Form
5
+ # :nodoc:
6
+ class HiddenField < Ariadne::Forms::BaseComponent
7
+ delegate :builder, :form, to: :@input
8
+
9
+ def initialize(input:)
10
+ @input = input
11
+ @input.add_input_classes("FormField-input")
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1 @@
1
+ <div class="border-top color-border-muted"></div>
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ariadne
4
+ module Form
5
+ class Separator < Ariadne::Forms::BaseComponent
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ <div class="FormControl-spacingWrapper">
2
+ <%= content %>
3
+ </div>
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ariadne
4
+ module Form
5
+ class SpacingWrapper < BaseComponent
6
+ end
7
+ end
8
+ end