shadcn-rails 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. checksums.yaml +7 -0
  2. data/.dockerignore +40 -0
  3. data/CHANGELOG.md +54 -0
  4. data/CLAUDE.md +463 -0
  5. data/PROGRESS.md +485 -0
  6. data/README.md +1483 -0
  7. data/Rakefile +29 -0
  8. data/__tests__/controllers/__snapshots__/calendar_controller.test.js.snap +13 -0
  9. data/__tests__/controllers/__snapshots__/popover_controller.test.js.snap +46 -0
  10. data/__tests__/controllers/__snapshots__/sheet_controller.test.js.snap +111 -0
  11. data/__tests__/controllers/__snapshots__/tabs_controller.test.js.snap +27 -0
  12. data/__tests__/controllers/accordion_controller.test.js +904 -0
  13. data/__tests__/controllers/calendar_controller.test.js +1370 -0
  14. data/__tests__/controllers/carousel_controller.test.js +912 -0
  15. data/__tests__/controllers/checkbox_controller.test.js +454 -0
  16. data/__tests__/controllers/collapsible_controller.test.js +407 -0
  17. data/__tests__/controllers/combobox_controller.test.js +966 -0
  18. data/__tests__/controllers/context_menu_controller.test.js +627 -0
  19. data/__tests__/controllers/date_picker_controller.test.js +636 -0
  20. data/__tests__/controllers/dialog_controller.test.js +878 -0
  21. data/__tests__/controllers/drawer_controller.test.js +995 -0
  22. data/__tests__/controllers/menubar_controller.test.js +736 -0
  23. data/__tests__/controllers/navigation_menu_controller.test.js +598 -0
  24. data/__tests__/controllers/popover_controller.test.js +1007 -0
  25. data/__tests__/controllers/radio_group_controller.test.js +640 -0
  26. data/__tests__/controllers/resizable_controller.test.js +680 -0
  27. data/__tests__/controllers/select_controller.test.js +674 -0
  28. data/__tests__/controllers/sheet_controller.test.js +986 -0
  29. data/__tests__/controllers/slider_controller.test.js +1036 -0
  30. data/__tests__/controllers/switch_controller.test.js +424 -0
  31. data/__tests__/controllers/tabs_controller.test.js +907 -0
  32. data/__tests__/controllers/toggle_group_controller.test.js +839 -0
  33. data/__tests__/controllers/tooltip_controller.test.js +808 -0
  34. data/__tests__/helpers/stimulus-test-helper.js +203 -0
  35. data/app/assets/config/manifest.js +1 -0
  36. data/app/assets/javascripts/shadcn/controllers/accordion_controller.d.ts +53 -0
  37. data/app/assets/javascripts/shadcn/controllers/accordion_controller.js +140 -0
  38. data/app/assets/javascripts/shadcn/controllers/avatar_controller.d.ts +22 -0
  39. data/app/assets/javascripts/shadcn/controllers/avatar_controller.js +26 -0
  40. data/app/assets/javascripts/shadcn/controllers/calendar_controller.js +592 -0
  41. data/app/assets/javascripts/shadcn/controllers/carousel_controller.js +263 -0
  42. data/app/assets/javascripts/shadcn/controllers/checkbox_controller.d.ts +31 -0
  43. data/app/assets/javascripts/shadcn/controllers/checkbox_controller.js +48 -0
  44. data/app/assets/javascripts/shadcn/controllers/collapsible_controller.d.ts +43 -0
  45. data/app/assets/javascripts/shadcn/controllers/collapsible_controller.js +73 -0
  46. data/app/assets/javascripts/shadcn/controllers/combobox_controller.js +234 -0
  47. data/app/assets/javascripts/shadcn/controllers/command_controller.js +141 -0
  48. data/app/assets/javascripts/shadcn/controllers/command_dialog_controller.js +162 -0
  49. data/app/assets/javascripts/shadcn/controllers/context_menu_controller.js +202 -0
  50. data/app/assets/javascripts/shadcn/controllers/date_picker_controller.js +282 -0
  51. data/app/assets/javascripts/shadcn/controllers/dialog_controller.d.ts +67 -0
  52. data/app/assets/javascripts/shadcn/controllers/dialog_controller.js +187 -0
  53. data/app/assets/javascripts/shadcn/controllers/drawer_controller.d.ts +58 -0
  54. data/app/assets/javascripts/shadcn/controllers/drawer_controller.js +112 -0
  55. data/app/assets/javascripts/shadcn/controllers/dropdown_controller.d.ts +83 -0
  56. data/app/assets/javascripts/shadcn/controllers/dropdown_controller.js +225 -0
  57. data/app/assets/javascripts/shadcn/controllers/hover_card_controller.d.ts +59 -0
  58. data/app/assets/javascripts/shadcn/controllers/hover_card_controller.js +143 -0
  59. data/app/assets/javascripts/shadcn/controllers/input_otp_controller.d.ts +44 -0
  60. data/app/assets/javascripts/shadcn/controllers/input_otp_controller.js +206 -0
  61. data/app/assets/javascripts/shadcn/controllers/menubar_controller.js +323 -0
  62. data/app/assets/javascripts/shadcn/controllers/navigation_menu_controller.js +251 -0
  63. data/app/assets/javascripts/shadcn/controllers/popover_controller.d.ts +56 -0
  64. data/app/assets/javascripts/shadcn/controllers/popover_controller.js +141 -0
  65. data/app/assets/javascripts/shadcn/controllers/radio_group_controller.d.ts +47 -0
  66. data/app/assets/javascripts/shadcn/controllers/radio_group_controller.js +108 -0
  67. data/app/assets/javascripts/shadcn/controllers/resizable_controller.js +272 -0
  68. data/app/assets/javascripts/shadcn/controllers/scroll_area_controller.d.ts +44 -0
  69. data/app/assets/javascripts/shadcn/controllers/scroll_area_controller.js +74 -0
  70. data/app/assets/javascripts/shadcn/controllers/select_controller.d.ts +84 -0
  71. data/app/assets/javascripts/shadcn/controllers/select_controller.js +222 -0
  72. data/app/assets/javascripts/shadcn/controllers/sheet_controller.d.ts +60 -0
  73. data/app/assets/javascripts/shadcn/controllers/sheet_controller.js +151 -0
  74. data/app/assets/javascripts/shadcn/controllers/sidebar_controller.js +148 -0
  75. data/app/assets/javascripts/shadcn/controllers/slider_controller.d.ts +102 -0
  76. data/app/assets/javascripts/shadcn/controllers/slider_controller.js +364 -0
  77. data/app/assets/javascripts/shadcn/controllers/switch_controller.d.ts +46 -0
  78. data/app/assets/javascripts/shadcn/controllers/switch_controller.js +78 -0
  79. data/app/assets/javascripts/shadcn/controllers/tabs_controller.d.ts +51 -0
  80. data/app/assets/javascripts/shadcn/controllers/tabs_controller.js +126 -0
  81. data/app/assets/javascripts/shadcn/controllers/toast_controller.d.ts +37 -0
  82. data/app/assets/javascripts/shadcn/controllers/toast_controller.js +58 -0
  83. data/app/assets/javascripts/shadcn/controllers/toggle_controller.d.ts +27 -0
  84. data/app/assets/javascripts/shadcn/controllers/toggle_controller.js +42 -0
  85. data/app/assets/javascripts/shadcn/controllers/toggle_group_controller.d.ts +44 -0
  86. data/app/assets/javascripts/shadcn/controllers/toggle_group_controller.js +68 -0
  87. data/app/assets/javascripts/shadcn/controllers/tooltip_controller.d.ts +56 -0
  88. data/app/assets/javascripts/shadcn/controllers/tooltip_controller.js +117 -0
  89. data/app/assets/javascripts/shadcn/index.d.ts +74 -0
  90. data/app/assets/javascripts/shadcn/index.js +133 -0
  91. data/app/assets/stylesheets/.keep +0 -0
  92. data/app/assets/stylesheets/shadcn/base.css +445 -0
  93. data/app/assets/stylesheets/shadcn/components.css +513 -0
  94. data/app/assets/stylesheets/shadcn/index.css +18 -0
  95. data/app/assets/stylesheets/shadcn/themes/gray.css +68 -0
  96. data/app/assets/stylesheets/shadcn/themes/slate.css +68 -0
  97. data/app/assets/stylesheets/shadcn/themes/stone.css +68 -0
  98. data/app/assets/stylesheets/shadcn/themes/zinc.css +68 -0
  99. data/app/components/shadcn/accordion_component.rb +63 -0
  100. data/app/components/shadcn/accordion_content_component.rb +29 -0
  101. data/app/components/shadcn/accordion_item_component.rb +40 -0
  102. data/app/components/shadcn/accordion_trigger_component.rb +49 -0
  103. data/app/components/shadcn/alert_component.rb +75 -0
  104. data/app/components/shadcn/alert_description_component.rb +12 -0
  105. data/app/components/shadcn/alert_dialog_action_component.rb +24 -0
  106. data/app/components/shadcn/alert_dialog_cancel_component.rb +24 -0
  107. data/app/components/shadcn/alert_dialog_component.rb +71 -0
  108. data/app/components/shadcn/alert_dialog_content_component.rb +57 -0
  109. data/app/components/shadcn/alert_dialog_description_component.rb +12 -0
  110. data/app/components/shadcn/alert_dialog_footer_component.rb +19 -0
  111. data/app/components/shadcn/alert_dialog_header_component.rb +19 -0
  112. data/app/components/shadcn/alert_dialog_title_component.rb +12 -0
  113. data/app/components/shadcn/alert_title_component.rb +12 -0
  114. data/app/components/shadcn/aspect_ratio_component.rb +49 -0
  115. data/app/components/shadcn/avatar_component.rb +107 -0
  116. data/app/components/shadcn/avatar_fallback_component.rb +17 -0
  117. data/app/components/shadcn/badge_component.rb +49 -0
  118. data/app/components/shadcn/base_component.rb +100 -0
  119. data/app/components/shadcn/breadcrumb_component.rb +70 -0
  120. data/app/components/shadcn/breadcrumb_item_component.rb +50 -0
  121. data/app/components/shadcn/button_component.rb +141 -0
  122. data/app/components/shadcn/button_group_component.rb +69 -0
  123. data/app/components/shadcn/calendar_component.rb +337 -0
  124. data/app/components/shadcn/card_action_component.rb +10 -0
  125. data/app/components/shadcn/card_component.rb +63 -0
  126. data/app/components/shadcn/card_content_component.rb +19 -0
  127. data/app/components/shadcn/card_description_component.rb +12 -0
  128. data/app/components/shadcn/card_footer_component.rb +12 -0
  129. data/app/components/shadcn/card_header_component.rb +24 -0
  130. data/app/components/shadcn/card_title_component.rb +18 -0
  131. data/app/components/shadcn/carousel_component.rb +275 -0
  132. data/app/components/shadcn/checkbox_component.rb +103 -0
  133. data/app/components/shadcn/collapsible_component.rb +66 -0
  134. data/app/components/shadcn/collapsible_content_component.rb +28 -0
  135. data/app/components/shadcn/combobox_component.rb +322 -0
  136. data/app/components/shadcn/command_component.rb +52 -0
  137. data/app/components/shadcn/command_dialog_component.rb +76 -0
  138. data/app/components/shadcn/command_empty_component.rb +12 -0
  139. data/app/components/shadcn/command_group_component.rb +34 -0
  140. data/app/components/shadcn/command_input_component.rb +59 -0
  141. data/app/components/shadcn/command_item_component.rb +48 -0
  142. data/app/components/shadcn/command_list_component.rb +38 -0
  143. data/app/components/shadcn/command_separator_component.rb +12 -0
  144. data/app/components/shadcn/command_shortcut_component.rb +12 -0
  145. data/app/components/shadcn/context_menu_component.rb +64 -0
  146. data/app/components/shadcn/context_menu_content_component.rb +44 -0
  147. data/app/components/shadcn/context_menu_item_component.rb +63 -0
  148. data/app/components/shadcn/context_menu_label_component.rb +18 -0
  149. data/app/components/shadcn/context_menu_separator_component.rb +12 -0
  150. data/app/components/shadcn/context_menu_shortcut_component.rb +12 -0
  151. data/app/components/shadcn/date_picker_component.rb +368 -0
  152. data/app/components/shadcn/dialog_component.rb +77 -0
  153. data/app/components/shadcn/dialog_content_component.rb +91 -0
  154. data/app/components/shadcn/dialog_description_component.rb +12 -0
  155. data/app/components/shadcn/dialog_footer_component.rb +12 -0
  156. data/app/components/shadcn/dialog_header_component.rb +19 -0
  157. data/app/components/shadcn/dialog_title_component.rb +12 -0
  158. data/app/components/shadcn/drawer_component.rb +72 -0
  159. data/app/components/shadcn/drawer_content_component.rb +76 -0
  160. data/app/components/shadcn/drawer_description_component.rb +12 -0
  161. data/app/components/shadcn/drawer_footer_component.rb +12 -0
  162. data/app/components/shadcn/drawer_header_component.rb +19 -0
  163. data/app/components/shadcn/drawer_title_component.rb +12 -0
  164. data/app/components/shadcn/dropdown_menu_component.rb +75 -0
  165. data/app/components/shadcn/dropdown_menu_content_component.rb +49 -0
  166. data/app/components/shadcn/dropdown_menu_group_component.rb +10 -0
  167. data/app/components/shadcn/dropdown_menu_item_component.rb +63 -0
  168. data/app/components/shadcn/dropdown_menu_label_component.rb +18 -0
  169. data/app/components/shadcn/dropdown_menu_separator_component.rb +12 -0
  170. data/app/components/shadcn/dropdown_menu_shortcut_component.rb +12 -0
  171. data/app/components/shadcn/empty_component.rb +48 -0
  172. data/app/components/shadcn/empty_content_component.rb +12 -0
  173. data/app/components/shadcn/empty_description_component.rb +12 -0
  174. data/app/components/shadcn/empty_header_component.rb +29 -0
  175. data/app/components/shadcn/empty_media_component.rb +21 -0
  176. data/app/components/shadcn/empty_title_component.rb +12 -0
  177. data/app/components/shadcn/field_component.rb +113 -0
  178. data/app/components/shadcn/hover_card_component.rb +64 -0
  179. data/app/components/shadcn/hover_card_content_component.rb +36 -0
  180. data/app/components/shadcn/input_component.rb +108 -0
  181. data/app/components/shadcn/input_group_component.rb +70 -0
  182. data/app/components/shadcn/input_otp_component.rb +183 -0
  183. data/app/components/shadcn/item_actions_component.rb +12 -0
  184. data/app/components/shadcn/item_component.rb +98 -0
  185. data/app/components/shadcn/item_content_component.rb +24 -0
  186. data/app/components/shadcn/item_description_component.rb +12 -0
  187. data/app/components/shadcn/item_footer_component.rb +12 -0
  188. data/app/components/shadcn/item_group_component.rb +24 -0
  189. data/app/components/shadcn/item_header_component.rb +12 -0
  190. data/app/components/shadcn/item_media_component.rb +22 -0
  191. data/app/components/shadcn/item_separator_component.rb +12 -0
  192. data/app/components/shadcn/item_title_component.rb +12 -0
  193. data/app/components/shadcn/kbd_component.rb +36 -0
  194. data/app/components/shadcn/label_component.rb +49 -0
  195. data/app/components/shadcn/menubar_checkbox_item_component.rb +76 -0
  196. data/app/components/shadcn/menubar_component.rb +56 -0
  197. data/app/components/shadcn/menubar_content_component.rb +64 -0
  198. data/app/components/shadcn/menubar_item_component.rb +65 -0
  199. data/app/components/shadcn/menubar_label_component.rb +27 -0
  200. data/app/components/shadcn/menubar_menu_component.rb +34 -0
  201. data/app/components/shadcn/menubar_radio_group_component.rb +42 -0
  202. data/app/components/shadcn/menubar_radio_item_component.rb +76 -0
  203. data/app/components/shadcn/menubar_separator_component.rb +22 -0
  204. data/app/components/shadcn/menubar_shortcut_component.rb +21 -0
  205. data/app/components/shadcn/menubar_sub_component.rb +38 -0
  206. data/app/components/shadcn/menubar_sub_content_component.rb +45 -0
  207. data/app/components/shadcn/menubar_sub_trigger_component.rb +59 -0
  208. data/app/components/shadcn/menubar_trigger_component.rb +31 -0
  209. data/app/components/shadcn/native_select_component.rb +150 -0
  210. data/app/components/shadcn/navigation_menu_component.rb +76 -0
  211. data/app/components/shadcn/navigation_menu_content_component.rb +30 -0
  212. data/app/components/shadcn/navigation_menu_item_component.rb +39 -0
  213. data/app/components/shadcn/navigation_menu_link_component.rb +38 -0
  214. data/app/components/shadcn/navigation_menu_list_component.rb +29 -0
  215. data/app/components/shadcn/navigation_menu_trigger_component.rb +59 -0
  216. data/app/components/shadcn/pagination_component.rb +195 -0
  217. data/app/components/shadcn/pagination_content_component.rb +47 -0
  218. data/app/components/shadcn/pagination_ellipsis_component.rb +30 -0
  219. data/app/components/shadcn/pagination_item_component.rb +53 -0
  220. data/app/components/shadcn/pagination_next_component.rb +48 -0
  221. data/app/components/shadcn/pagination_previous_component.rb +48 -0
  222. data/app/components/shadcn/popover_component.rb +76 -0
  223. data/app/components/shadcn/popover_content_component.rb +25 -0
  224. data/app/components/shadcn/progress_component.rb +77 -0
  225. data/app/components/shadcn/radio_group_component.rb +129 -0
  226. data/app/components/shadcn/radio_group_item_component.rb +109 -0
  227. data/app/components/shadcn/resizable_handle_component.rb +98 -0
  228. data/app/components/shadcn/resizable_panel_component.rb +56 -0
  229. data/app/components/shadcn/resizable_panel_group_component.rb +94 -0
  230. data/app/components/shadcn/scroll_area_component.rb +110 -0
  231. data/app/components/shadcn/select_component.rb +151 -0
  232. data/app/components/shadcn/select_group_component.rb +32 -0
  233. data/app/components/shadcn/select_item_component.rb +59 -0
  234. data/app/components/shadcn/select_separator_component.rb +12 -0
  235. data/app/components/shadcn/separator_component.rb +54 -0
  236. data/app/components/shadcn/sheet_component.rb +82 -0
  237. data/app/components/shadcn/sheet_content_component.rb +95 -0
  238. data/app/components/shadcn/sheet_description_component.rb +12 -0
  239. data/app/components/shadcn/sheet_footer_component.rb +12 -0
  240. data/app/components/shadcn/sheet_header_component.rb +19 -0
  241. data/app/components/shadcn/sheet_title_component.rb +12 -0
  242. data/app/components/shadcn/sidebar_component.rb +180 -0
  243. data/app/components/shadcn/sidebar_content_component.rb +32 -0
  244. data/app/components/shadcn/sidebar_footer_component.rb +24 -0
  245. data/app/components/shadcn/sidebar_group_action_component.rb +26 -0
  246. data/app/components/shadcn/sidebar_group_component.rb +38 -0
  247. data/app/components/shadcn/sidebar_group_content_component.rb +32 -0
  248. data/app/components/shadcn/sidebar_group_label_component.rb +25 -0
  249. data/app/components/shadcn/sidebar_header_component.rb +24 -0
  250. data/app/components/shadcn/sidebar_inset_component.rb +25 -0
  251. data/app/components/shadcn/sidebar_menu_action_component.rb +37 -0
  252. data/app/components/shadcn/sidebar_menu_badge_component.rb +25 -0
  253. data/app/components/shadcn/sidebar_menu_button_component.rb +52 -0
  254. data/app/components/shadcn/sidebar_menu_component.rb +32 -0
  255. data/app/components/shadcn/sidebar_menu_item_component.rb +41 -0
  256. data/app/components/shadcn/sidebar_menu_skeleton_component.rb +46 -0
  257. data/app/components/shadcn/sidebar_menu_sub_button_component.rb +43 -0
  258. data/app/components/shadcn/sidebar_menu_sub_component.rb +33 -0
  259. data/app/components/shadcn/sidebar_menu_sub_item_component.rb +30 -0
  260. data/app/components/shadcn/sidebar_provider_component.rb +57 -0
  261. data/app/components/shadcn/sidebar_rail_component.rb +30 -0
  262. data/app/components/shadcn/sidebar_separator_component.rb +24 -0
  263. data/app/components/shadcn/sidebar_trigger_component.rb +51 -0
  264. data/app/components/shadcn/skeleton_component.rb +29 -0
  265. data/app/components/shadcn/slider_component.rb +76 -0
  266. data/app/components/shadcn/spinner_component.rb +67 -0
  267. data/app/components/shadcn/switch_component.rb +147 -0
  268. data/app/components/shadcn/table_body_component.rb +16 -0
  269. data/app/components/shadcn/table_caption_component.rb +12 -0
  270. data/app/components/shadcn/table_cell_component.rb +12 -0
  271. data/app/components/shadcn/table_component.rb +57 -0
  272. data/app/components/shadcn/table_footer_component.rb +16 -0
  273. data/app/components/shadcn/table_head_component.rb +12 -0
  274. data/app/components/shadcn/table_header_component.rb +16 -0
  275. data/app/components/shadcn/table_row_component.rb +40 -0
  276. data/app/components/shadcn/tabs_component.rb +78 -0
  277. data/app/components/shadcn/tabs_content_component.rb +32 -0
  278. data/app/components/shadcn/tabs_list_component.rb +30 -0
  279. data/app/components/shadcn/tabs_trigger_component.rb +37 -0
  280. data/app/components/shadcn/textarea_component.rb +84 -0
  281. data/app/components/shadcn/toast_action_component.rb +18 -0
  282. data/app/components/shadcn/toast_component.rb +114 -0
  283. data/app/components/shadcn/toast_description_component.rb +12 -0
  284. data/app/components/shadcn/toast_title_component.rb +12 -0
  285. data/app/components/shadcn/toast_viewport_component.rb +12 -0
  286. data/app/components/shadcn/toggle_component.rb +77 -0
  287. data/app/components/shadcn/toggle_group_component.rb +96 -0
  288. data/app/components/shadcn/toggle_group_item_component.rb +62 -0
  289. data/app/components/shadcn/tooltip_component.rb +89 -0
  290. data/app/components/shadcn/typography_component.rb +112 -0
  291. data/babel.config.cjs +5 -0
  292. data/bin/console +11 -0
  293. data/bin/setup +8 -0
  294. data/config/importmap.rb +5 -0
  295. data/fly.toml +26 -0
  296. data/jest.config.js +19 -0
  297. data/jest.setup.js +8 -0
  298. data/lib/generators/shadcn/component/component_generator.rb +188 -0
  299. data/lib/generators/shadcn/install/install_generator.rb +140 -0
  300. data/lib/generators/shadcn/install/templates/initializer.rb.tt +35 -0
  301. data/lib/generators/shadcn/install/templates/shadcn.yml.tt +35 -0
  302. data/lib/generators/shadcn/theme/theme_generator.rb +128 -0
  303. data/lib/shadcn/rails/class_merger.rb +228 -0
  304. data/lib/shadcn/rails/configuration.rb +341 -0
  305. data/lib/shadcn/rails/engine.rb +59 -0
  306. data/lib/shadcn/rails/helpers/class_name_helper.rb +35 -0
  307. data/lib/shadcn/rails/helpers/component_helper.rb +60 -0
  308. data/lib/shadcn/rails/helpers/pagination_helper.rb +187 -0
  309. data/lib/shadcn/rails/version.rb +7 -0
  310. data/lib/shadcn/rails.rb +179 -0
  311. data/package-lock.json +7415 -0
  312. data/package.json +68 -0
  313. data/rollup.config.js +29 -0
  314. data/sig/shadcn/rails.rbs +6 -0
  315. metadata +526 -0
@@ -0,0 +1,513 @@
1
+ /**
2
+ * shadcn-rails Component Styles
3
+ *
4
+ * This file contains component-specific styles that work with Stimulus controllers.
5
+ * These styles handle data-state attributes and other dynamic styling needs.
6
+ *
7
+ * Import this file in your application's stylesheet:
8
+ * @import "shadcn/components";
9
+ *
10
+ * Or with asset pipeline:
11
+ * *= require shadcn/components
12
+ */
13
+
14
+ /* ============================================
15
+ Switch Component
16
+ ============================================ */
17
+
18
+ /* Button-based Switch with data-state */
19
+ button[role="switch"] {
20
+ background-color: hsl(var(--input));
21
+ transition: background-color 0.2s ease-in-out;
22
+ }
23
+
24
+ button[role="switch"][data-state="checked"] {
25
+ background-color: hsl(var(--primary));
26
+ }
27
+
28
+ button[role="switch"][data-state="unchecked"] {
29
+ background-color: hsl(var(--input));
30
+ }
31
+
32
+ /* Switch thumb positioning */
33
+ button[role="switch"] > span[data-state="checked"] {
34
+ transform: translateX(1rem);
35
+ }
36
+
37
+ button[role="switch"] > span[data-state="unchecked"] {
38
+ transform: translateX(0);
39
+ }
40
+
41
+ /* Disabled switch */
42
+ button[role="switch"]:disabled {
43
+ opacity: 0.5;
44
+ cursor: not-allowed;
45
+ }
46
+
47
+ /* ============================================
48
+ Slider Component
49
+ ============================================ */
50
+
51
+ /* Custom slider styling with CSS custom property for fill */
52
+ input[type="range"].shadcn-slider {
53
+ -webkit-appearance: none;
54
+ appearance: none;
55
+ background: transparent;
56
+ cursor: pointer;
57
+ width: 100%;
58
+ }
59
+
60
+ /* Track styling */
61
+ input[type="range"].shadcn-slider::-webkit-slider-runnable-track {
62
+ height: 0.5rem;
63
+ border-radius: 9999px;
64
+ background: linear-gradient(
65
+ to right,
66
+ hsl(var(--primary)) 0%,
67
+ hsl(var(--primary)) var(--slider-fill, 0%),
68
+ hsl(var(--secondary)) var(--slider-fill, 0%),
69
+ hsl(var(--secondary)) 100%
70
+ );
71
+ }
72
+
73
+ input[type="range"].shadcn-slider::-moz-range-track {
74
+ height: 0.5rem;
75
+ border-radius: 9999px;
76
+ background: hsl(var(--secondary));
77
+ }
78
+
79
+ input[type="range"].shadcn-slider::-moz-range-progress {
80
+ height: 0.5rem;
81
+ border-radius: 9999px;
82
+ background: hsl(var(--primary));
83
+ }
84
+
85
+ /* Thumb styling */
86
+ input[type="range"].shadcn-slider::-webkit-slider-thumb {
87
+ -webkit-appearance: none;
88
+ appearance: none;
89
+ width: 1.25rem;
90
+ height: 1.25rem;
91
+ border-radius: 9999px;
92
+ background: hsl(var(--background));
93
+ border: 2px solid hsl(var(--primary));
94
+ margin-top: -0.375rem;
95
+ transition: transform 0.1s ease-in-out;
96
+ }
97
+
98
+ input[type="range"].shadcn-slider::-moz-range-thumb {
99
+ width: 1.25rem;
100
+ height: 1.25rem;
101
+ border-radius: 9999px;
102
+ background: hsl(var(--background));
103
+ border: 2px solid hsl(var(--primary));
104
+ transition: transform 0.1s ease-in-out;
105
+ }
106
+
107
+ /* Hover/focus states for thumb */
108
+ input[type="range"].shadcn-slider:hover::-webkit-slider-thumb {
109
+ transform: scale(1.1);
110
+ }
111
+
112
+ input[type="range"].shadcn-slider:hover::-moz-range-thumb {
113
+ transform: scale(1.1);
114
+ }
115
+
116
+ input[type="range"].shadcn-slider:focus::-webkit-slider-thumb {
117
+ box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
118
+ }
119
+
120
+ input[type="range"].shadcn-slider:focus::-moz-range-thumb {
121
+ box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
122
+ }
123
+
124
+ /* Disabled slider */
125
+ input[type="range"].shadcn-slider:disabled {
126
+ opacity: 0.5;
127
+ cursor: not-allowed;
128
+ }
129
+
130
+ input[type="range"].shadcn-slider:disabled::-webkit-slider-thumb {
131
+ cursor: not-allowed;
132
+ }
133
+
134
+ input[type="range"].shadcn-slider:disabled::-moz-range-thumb {
135
+ cursor: not-allowed;
136
+ }
137
+
138
+ /* ============================================
139
+ Checkbox Component
140
+ ============================================ */
141
+
142
+ /* Native checkbox styling */
143
+ input[type="checkbox"].shadcn-checkbox {
144
+ -webkit-appearance: none;
145
+ appearance: none;
146
+ width: 1rem;
147
+ height: 1rem;
148
+ border: 1px solid hsl(var(--primary));
149
+ border-radius: calc(var(--radius) - 4px);
150
+ background-color: transparent;
151
+ cursor: pointer;
152
+ position: relative;
153
+ transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
154
+ }
155
+
156
+ input[type="checkbox"].shadcn-checkbox:checked {
157
+ background-color: hsl(var(--primary));
158
+ border-color: hsl(var(--primary));
159
+ }
160
+
161
+ /* Checkmark */
162
+ input[type="checkbox"].shadcn-checkbox:checked::after {
163
+ content: "";
164
+ position: absolute;
165
+ left: 50%;
166
+ top: 45%;
167
+ width: 4px;
168
+ height: 8px;
169
+ border: solid hsl(var(--primary-foreground));
170
+ border-width: 0 2px 2px 0;
171
+ transform: translate(-50%, -50%) rotate(45deg);
172
+ }
173
+
174
+ /* Focus state */
175
+ input[type="checkbox"].shadcn-checkbox:focus-visible {
176
+ outline: none;
177
+ box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
178
+ }
179
+
180
+ /* Disabled state */
181
+ input[type="checkbox"].shadcn-checkbox:disabled {
182
+ opacity: 0.5;
183
+ cursor: not-allowed;
184
+ }
185
+
186
+ /* ============================================
187
+ Radio Group Component
188
+ ============================================ */
189
+
190
+ /* Native radio styling */
191
+ input[type="radio"].shadcn-radio {
192
+ -webkit-appearance: none;
193
+ appearance: none;
194
+ width: 1rem;
195
+ height: 1rem;
196
+ border: 1px solid hsl(var(--primary));
197
+ border-radius: 9999px;
198
+ background-color: transparent;
199
+ cursor: pointer;
200
+ position: relative;
201
+ transition: border-color 0.15s ease-in-out;
202
+ }
203
+
204
+ input[type="radio"].shadcn-radio:checked {
205
+ border-color: hsl(var(--primary));
206
+ }
207
+
208
+ /* Radio dot */
209
+ input[type="radio"].shadcn-radio:checked::after {
210
+ content: "";
211
+ position: absolute;
212
+ left: 50%;
213
+ top: 50%;
214
+ width: 0.5rem;
215
+ height: 0.5rem;
216
+ border-radius: 9999px;
217
+ background-color: hsl(var(--primary));
218
+ transform: translate(-50%, -50%);
219
+ }
220
+
221
+ /* Focus state */
222
+ input[type="radio"].shadcn-radio:focus-visible {
223
+ outline: none;
224
+ box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
225
+ }
226
+
227
+ /* Disabled state */
228
+ input[type="radio"].shadcn-radio:disabled {
229
+ opacity: 0.5;
230
+ cursor: not-allowed;
231
+ }
232
+
233
+ /* ============================================
234
+ Toggle Component
235
+ ============================================ */
236
+
237
+ /* Toggle button with data-state */
238
+ button[data-state="on"].shadcn-toggle {
239
+ background-color: hsl(var(--accent));
240
+ color: hsl(var(--accent-foreground));
241
+ }
242
+
243
+ button[data-state="off"].shadcn-toggle {
244
+ background-color: transparent;
245
+ }
246
+
247
+ /* ============================================
248
+ Accordion Component
249
+ ============================================ */
250
+
251
+ /* Accordion content animation */
252
+ [data-state="open"] > .accordion-content {
253
+ animation: accordion-down 0.2s ease-out;
254
+ }
255
+
256
+ [data-state="closed"] > .accordion-content {
257
+ animation: accordion-up 0.2s ease-out;
258
+ }
259
+
260
+ /* Accordion chevron rotation */
261
+ [data-state="open"] .accordion-chevron {
262
+ transform: rotate(180deg);
263
+ }
264
+
265
+ [data-state="closed"] .accordion-chevron {
266
+ transform: rotate(0deg);
267
+ }
268
+
269
+ .accordion-chevron {
270
+ transition: transform 0.2s ease-in-out;
271
+ }
272
+
273
+ /* ============================================
274
+ Collapsible Component
275
+ ============================================ */
276
+
277
+ /* Collapsible content animation */
278
+ [data-state="open"] > .collapsible-content {
279
+ animation: collapsible-down 0.2s ease-out;
280
+ }
281
+
282
+ [data-state="closed"] > .collapsible-content {
283
+ animation: collapsible-up 0.2s ease-out;
284
+ }
285
+
286
+ /* ============================================
287
+ Dialog & Sheet Components
288
+ ============================================ */
289
+
290
+ /* Overlay styles */
291
+ .shadcn-overlay {
292
+ position: fixed;
293
+ inset: 0;
294
+ background-color: rgba(0, 0, 0, 0.8);
295
+ z-index: 50;
296
+ }
297
+
298
+ .shadcn-overlay[data-state="open"] {
299
+ animation: fade-in 150ms ease-out;
300
+ }
301
+
302
+ .shadcn-overlay[data-state="closed"] {
303
+ animation: fade-out 150ms ease-in;
304
+ }
305
+
306
+ /* Dialog content */
307
+ .shadcn-dialog-content[data-state="open"] {
308
+ animation: fade-in 150ms ease-out, zoom-in 150ms ease-out;
309
+ }
310
+
311
+ .shadcn-dialog-content[data-state="closed"] {
312
+ animation: fade-out 150ms ease-in, zoom-out 150ms ease-in;
313
+ }
314
+
315
+ /* Sheet content - slides from different directions */
316
+ .shadcn-sheet-content[data-side="top"][data-state="open"] {
317
+ animation: slide-in-from-top 300ms ease-out;
318
+ }
319
+
320
+ .shadcn-sheet-content[data-side="bottom"][data-state="open"] {
321
+ animation: slide-in-from-bottom 300ms ease-out;
322
+ }
323
+
324
+ .shadcn-sheet-content[data-side="left"][data-state="open"] {
325
+ animation: slide-in-from-left 300ms ease-out;
326
+ }
327
+
328
+ .shadcn-sheet-content[data-side="right"][data-state="open"] {
329
+ animation: slide-in-from-right 300ms ease-out;
330
+ }
331
+
332
+ /* ============================================
333
+ Popover & Tooltip Components
334
+ ============================================ */
335
+
336
+ .shadcn-popover[data-state="open"],
337
+ .shadcn-tooltip[data-state="open"] {
338
+ animation: fade-in 150ms ease-out, zoom-in 150ms ease-out;
339
+ }
340
+
341
+ .shadcn-popover[data-state="closed"],
342
+ .shadcn-tooltip[data-state="closed"] {
343
+ animation: fade-out 150ms ease-in, zoom-out 150ms ease-in;
344
+ }
345
+
346
+ /* ============================================
347
+ Dropdown Menu Component
348
+ ============================================ */
349
+
350
+ .shadcn-dropdown[data-state="open"] {
351
+ animation: fade-in 150ms ease-out, zoom-in 150ms ease-out;
352
+ }
353
+
354
+ .shadcn-dropdown[data-state="closed"] {
355
+ animation: fade-out 150ms ease-in, zoom-out 150ms ease-in;
356
+ }
357
+
358
+ /* ============================================
359
+ Select Component
360
+ ============================================ */
361
+
362
+ .shadcn-select-content[data-state="open"] {
363
+ animation: fade-in 150ms ease-out, zoom-in 150ms ease-out;
364
+ }
365
+
366
+ .shadcn-select-content[data-state="closed"] {
367
+ animation: fade-out 150ms ease-in, zoom-out 150ms ease-in;
368
+ }
369
+
370
+ /* Select trigger chevron */
371
+ .shadcn-select-trigger[data-state="open"] .select-chevron {
372
+ transform: rotate(180deg);
373
+ }
374
+
375
+ .select-chevron {
376
+ transition: transform 0.2s ease-in-out;
377
+ }
378
+
379
+ /* ============================================
380
+ Tabs Component
381
+ ============================================ */
382
+
383
+ /* Active tab indicator */
384
+ [role="tab"][data-state="active"] {
385
+ color: hsl(var(--foreground));
386
+ }
387
+
388
+ [role="tab"][data-state="inactive"] {
389
+ color: hsl(var(--muted-foreground));
390
+ }
391
+
392
+ /* Tab content visibility */
393
+ [role="tabpanel"][data-state="active"] {
394
+ display: block;
395
+ }
396
+
397
+ [role="tabpanel"][data-state="inactive"] {
398
+ display: none;
399
+ }
400
+
401
+ /* ============================================
402
+ Toast Component
403
+ ============================================ */
404
+
405
+ .shadcn-toast[data-state="open"] {
406
+ animation: slide-in-from-right 300ms ease-out;
407
+ }
408
+
409
+ .shadcn-toast[data-state="closed"] {
410
+ animation: fade-out 150ms ease-in, slide-out-to-right 300ms ease-in;
411
+ }
412
+
413
+ /* Toast variants */
414
+ .shadcn-toast[data-variant="destructive"] {
415
+ border-color: hsl(var(--destructive));
416
+ background-color: hsl(var(--destructive));
417
+ color: hsl(var(--destructive-foreground));
418
+ }
419
+
420
+ /* ============================================
421
+ Progress Component
422
+ ============================================ */
423
+
424
+ .shadcn-progress-indeterminate .shadcn-progress-indicator {
425
+ animation: progress-indeterminate 1.5s ease-in-out infinite;
426
+ }
427
+
428
+ /* ============================================
429
+ Hover Card Component
430
+ ============================================ */
431
+
432
+ .shadcn-hover-card[data-state="open"] {
433
+ animation: fade-in 150ms ease-out, zoom-in 150ms ease-out;
434
+ }
435
+
436
+ .shadcn-hover-card[data-state="closed"] {
437
+ animation: fade-out 150ms ease-in, zoom-out 150ms ease-in;
438
+ }
439
+
440
+ /* ============================================
441
+ Drawer Component
442
+ ============================================ */
443
+
444
+ /* Drawer overlay */
445
+ [data-shadcn--drawer-target="overlay"] {
446
+ transition: opacity 200ms ease-out;
447
+ opacity: 0;
448
+ }
449
+
450
+ [data-shadcn--drawer-target="overlay"][data-state="open"] {
451
+ opacity: 1;
452
+ }
453
+
454
+ [data-shadcn--drawer-target="overlay"][data-state="closed"] {
455
+ opacity: 0;
456
+ }
457
+
458
+ /* Drawer content base styles */
459
+ [data-shadcn--drawer-target="content"] {
460
+ transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
461
+ }
462
+
463
+ /* Bottom drawer animations */
464
+ [data-shadcn--drawer-target="content"][data-direction="bottom"] {
465
+ transform: translateY(100%);
466
+ }
467
+
468
+ [data-shadcn--drawer-target="content"][data-direction="bottom"][data-state="open"] {
469
+ transform: translateY(0);
470
+ }
471
+
472
+ [data-shadcn--drawer-target="content"][data-direction="bottom"][data-state="closed"] {
473
+ transform: translateY(100%);
474
+ }
475
+
476
+ /* Top drawer animations */
477
+ [data-shadcn--drawer-target="content"][data-direction="top"] {
478
+ transform: translateY(-100%);
479
+ }
480
+
481
+ [data-shadcn--drawer-target="content"][data-direction="top"][data-state="open"] {
482
+ transform: translateY(0);
483
+ }
484
+
485
+ [data-shadcn--drawer-target="content"][data-direction="top"][data-state="closed"] {
486
+ transform: translateY(-100%);
487
+ }
488
+
489
+ /* Left drawer animations */
490
+ [data-shadcn--drawer-target="content"][data-direction="left"] {
491
+ transform: translateX(-100%);
492
+ }
493
+
494
+ [data-shadcn--drawer-target="content"][data-direction="left"][data-state="open"] {
495
+ transform: translateX(0);
496
+ }
497
+
498
+ [data-shadcn--drawer-target="content"][data-direction="left"][data-state="closed"] {
499
+ transform: translateX(-100%);
500
+ }
501
+
502
+ /* Right drawer animations */
503
+ [data-shadcn--drawer-target="content"][data-direction="right"] {
504
+ transform: translateX(100%);
505
+ }
506
+
507
+ [data-shadcn--drawer-target="content"][data-direction="right"][data-state="open"] {
508
+ transform: translateX(0);
509
+ }
510
+
511
+ [data-shadcn--drawer-target="content"][data-direction="right"][data-state="closed"] {
512
+ transform: translateX(100%);
513
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * shadcn-rails Complete Styles
3
+ *
4
+ * This file imports all shadcn-rails styles including:
5
+ * - base.css: CSS variables, theme colors, and animations
6
+ * - components.css: Component-specific styles for data-state and interactive elements
7
+ *
8
+ * Import this single file to get everything:
9
+ * @import "shadcn/index";
10
+ *
11
+ * Or with asset pipeline:
12
+ * *= require shadcn/index
13
+ *
14
+ * You can also import files individually if you only need specific styles.
15
+ */
16
+
17
+ @import "shadcn/base.css";
18
+ @import "shadcn/components.css";
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Gray Theme for shadcn-rails
3
+ *
4
+ * Import this file to use the Gray color theme:
5
+ * @import "shadcn/themes/gray";
6
+ */
7
+
8
+ :root {
9
+ --background: 0 0% 100%;
10
+ --foreground: 224 71.4% 4.1%;
11
+
12
+ --card: 0 0% 100%;
13
+ --card-foreground: 224 71.4% 4.1%;
14
+
15
+ --popover: 0 0% 100%;
16
+ --popover-foreground: 224 71.4% 4.1%;
17
+
18
+ --primary: 220.9 39.3% 11%;
19
+ --primary-foreground: 210 20% 98%;
20
+
21
+ --secondary: 220 14.3% 95.9%;
22
+ --secondary-foreground: 220.9 39.3% 11%;
23
+
24
+ --muted: 220 14.3% 95.9%;
25
+ --muted-foreground: 220 8.9% 46.1%;
26
+
27
+ --accent: 220 14.3% 95.9%;
28
+ --accent-foreground: 220.9 39.3% 11%;
29
+
30
+ --destructive: 0 84.2% 60.2%;
31
+ --destructive-foreground: 210 20% 98%;
32
+
33
+ --border: 220 13% 91%;
34
+ --input: 220 13% 91%;
35
+ --ring: 224 71.4% 4.1%;
36
+
37
+ --radius: 0.5rem;
38
+ }
39
+
40
+ .dark {
41
+ --background: 224 71.4% 4.1%;
42
+ --foreground: 210 20% 98%;
43
+
44
+ --card: 224 71.4% 4.1%;
45
+ --card-foreground: 210 20% 98%;
46
+
47
+ --popover: 224 71.4% 4.1%;
48
+ --popover-foreground: 210 20% 98%;
49
+
50
+ --primary: 210 20% 98%;
51
+ --primary-foreground: 220.9 39.3% 11%;
52
+
53
+ --secondary: 215 27.9% 16.9%;
54
+ --secondary-foreground: 210 20% 98%;
55
+
56
+ --muted: 215 27.9% 16.9%;
57
+ --muted-foreground: 217.9 10.6% 64.9%;
58
+
59
+ --accent: 215 27.9% 16.9%;
60
+ --accent-foreground: 210 20% 98%;
61
+
62
+ --destructive: 0 62.8% 30.6%;
63
+ --destructive-foreground: 210 20% 98%;
64
+
65
+ --border: 215 27.9% 16.9%;
66
+ --input: 215 27.9% 16.9%;
67
+ --ring: 216 12.2% 83.9%;
68
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Slate Theme for shadcn-rails
3
+ *
4
+ * Import this file to use the Slate color theme:
5
+ * @import "shadcn/themes/slate";
6
+ */
7
+
8
+ :root {
9
+ --background: 0 0% 100%;
10
+ --foreground: 222.2 84% 4.9%;
11
+
12
+ --card: 0 0% 100%;
13
+ --card-foreground: 222.2 84% 4.9%;
14
+
15
+ --popover: 0 0% 100%;
16
+ --popover-foreground: 222.2 84% 4.9%;
17
+
18
+ --primary: 222.2 47.4% 11.2%;
19
+ --primary-foreground: 210 40% 98%;
20
+
21
+ --secondary: 210 40% 96.1%;
22
+ --secondary-foreground: 222.2 47.4% 11.2%;
23
+
24
+ --muted: 210 40% 96.1%;
25
+ --muted-foreground: 215.4 16.3% 46.9%;
26
+
27
+ --accent: 210 40% 96.1%;
28
+ --accent-foreground: 222.2 47.4% 11.2%;
29
+
30
+ --destructive: 0 84.2% 60.2%;
31
+ --destructive-foreground: 210 40% 98%;
32
+
33
+ --border: 214.3 31.8% 91.4%;
34
+ --input: 214.3 31.8% 91.4%;
35
+ --ring: 222.2 84% 4.9%;
36
+
37
+ --radius: 0.5rem;
38
+ }
39
+
40
+ .dark {
41
+ --background: 222.2 84% 4.9%;
42
+ --foreground: 210 40% 98%;
43
+
44
+ --card: 222.2 84% 4.9%;
45
+ --card-foreground: 210 40% 98%;
46
+
47
+ --popover: 222.2 84% 4.9%;
48
+ --popover-foreground: 210 40% 98%;
49
+
50
+ --primary: 210 40% 98%;
51
+ --primary-foreground: 222.2 47.4% 11.2%;
52
+
53
+ --secondary: 217.2 32.6% 17.5%;
54
+ --secondary-foreground: 210 40% 98%;
55
+
56
+ --muted: 217.2 32.6% 17.5%;
57
+ --muted-foreground: 215 20.2% 65.1%;
58
+
59
+ --accent: 217.2 32.6% 17.5%;
60
+ --accent-foreground: 210 40% 98%;
61
+
62
+ --destructive: 0 62.8% 30.6%;
63
+ --destructive-foreground: 210 40% 98%;
64
+
65
+ --border: 217.2 32.6% 17.5%;
66
+ --input: 217.2 32.6% 17.5%;
67
+ --ring: 212.7 26.8% 83.9%;
68
+ }