shadcn_view_component 0.3.3
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +255 -0
- data/MIT-LICENSE +20 -0
- data/README.md +604 -0
- data/app/assets/stylesheets/shadcn-themes.css +1075 -0
- data/app/assets/stylesheets/shadcn.css +853 -0
- data/app/components/shadcn/accordion/component.rb +44 -0
- data/app/components/shadcn/accordion/content/component.rb +44 -0
- data/app/components/shadcn/accordion/item/component.rb +41 -0
- data/app/components/shadcn/accordion/preview.rb +16 -0
- data/app/components/shadcn/accordion/previews/default.html.erb +10 -0
- data/app/components/shadcn/accordion/previews/multiple.html.erb +13 -0
- data/app/components/shadcn/accordion/trigger/component.rb +52 -0
- data/app/components/shadcn/alert/component.rb +52 -0
- data/app/components/shadcn/alert/preview.rb +11 -0
- data/app/components/shadcn/alert/previews/default.html.erb +8 -0
- data/app/components/shadcn/alert.rb +17 -0
- data/app/components/shadcn/alert_dialog/action/component.rb +35 -0
- data/app/components/shadcn/alert_dialog/cancel/component.rb +16 -0
- data/app/components/shadcn/alert_dialog/component.rb +20 -0
- data/app/components/shadcn/alert_dialog/content/component.rb +55 -0
- data/app/components/shadcn/alert_dialog/header/component.rb +33 -0
- data/app/components/shadcn/alert_dialog/preview.rb +16 -0
- data/app/components/shadcn/alert_dialog/previews/default.html.erb +13 -0
- data/app/components/shadcn/alert_dialog/previews/small_with_media.html.erb +38 -0
- data/app/components/shadcn/alert_dialog.rb +32 -0
- data/app/components/shadcn/application_view_component.rb +225 -0
- data/app/components/shadcn/application_view_component_preview.rb +8 -0
- data/app/components/shadcn/aspect_ratio/component.rb +34 -0
- data/app/components/shadcn/aspect_ratio/preview.rb +16 -0
- data/app/components/shadcn/aspect_ratio/previews/default.html.erb +5 -0
- data/app/components/shadcn/aspect_ratio/previews/ratios.html.erb +12 -0
- data/app/components/shadcn/attachment/action/component.rb +19 -0
- data/app/components/shadcn/attachment/component.rb +76 -0
- data/app/components/shadcn/attachment/media/component.rb +56 -0
- data/app/components/shadcn/attachment/preview.rb +11 -0
- data/app/components/shadcn/attachment/previews/default.html.erb +80 -0
- data/app/components/shadcn/attachment/trigger/component.rb +31 -0
- data/app/components/shadcn/attachment.rb +42 -0
- data/app/components/shadcn/avatar/component.rb +43 -0
- data/app/components/shadcn/avatar/fallback/component.rb +23 -0
- data/app/components/shadcn/avatar/image/component.rb +20 -0
- data/app/components/shadcn/avatar/preview.rb +11 -0
- data/app/components/shadcn/avatar/previews/default.html.erb +13 -0
- data/app/components/shadcn/avatar.rb +32 -0
- data/app/components/shadcn/badge/component.rb +57 -0
- data/app/components/shadcn/badge/preview.rb +11 -0
- data/app/components/shadcn/badge/previews/default.html.erb +5 -0
- data/app/components/shadcn/breadcrumb/component.rb +15 -0
- data/app/components/shadcn/breadcrumb/ellipsis/component.rb +28 -0
- data/app/components/shadcn/breadcrumb/page/component.rb +25 -0
- data/app/components/shadcn/breadcrumb/preview.rb +16 -0
- data/app/components/shadcn/breadcrumb/previews/custom_separator.html.erb +17 -0
- data/app/components/shadcn/breadcrumb/previews/default.html.erb +15 -0
- data/app/components/shadcn/breadcrumb/separator/component.rb +31 -0
- data/app/components/shadcn/breadcrumb.rb +18 -0
- data/app/components/shadcn/bubble/component.rb +90 -0
- data/app/components/shadcn/bubble/preview.rb +16 -0
- data/app/components/shadcn/bubble/previews/alignment.html.erb +33 -0
- data/app/components/shadcn/bubble/previews/default.html.erb +22 -0
- data/app/components/shadcn/bubble/reactions/component.rb +54 -0
- data/app/components/shadcn/bubble.rb +24 -0
- data/app/components/shadcn/button/component.rb +85 -0
- data/app/components/shadcn/button/preview.rb +31 -0
- data/app/components/shadcn/button/previews/default.html.erb +8 -0
- data/app/components/shadcn/button/previews/sizes.html.erb +5 -0
- data/app/components/shadcn/button/previews/variants.html.erb +5 -0
- data/app/components/shadcn/button_group/component.rb +53 -0
- data/app/components/shadcn/button_group/preview.rb +15 -0
- data/app/components/shadcn/button_group/previews/default.html.erb +18 -0
- data/app/components/shadcn/button_group/previews/vertical.html.erb +5 -0
- data/app/components/shadcn/button_group/separator/component.rb +30 -0
- data/app/components/shadcn/button_group/text/component.rb +20 -0
- data/app/components/shadcn/calendar/component.rb +558 -0
- data/app/components/shadcn/calendar/month.rb +74 -0
- data/app/components/shadcn/calendar/preview.rb +64 -0
- data/app/components/shadcn/calendar/previews/booked.html.erb +18 -0
- data/app/components/shadcn/calendar/previews/custom_cell_size.html.erb +11 -0
- data/app/components/shadcn/calendar/previews/date_and_time.html.erb +31 -0
- data/app/components/shadcn/calendar/previews/default.html.erb +8 -0
- data/app/components/shadcn/calendar/previews/dropdown_caption.html.erb +11 -0
- data/app/components/shadcn/calendar/previews/in_a_form.html.erb +8 -0
- data/app/components/shadcn/calendar/previews/presets.html.erb +20 -0
- data/app/components/shadcn/calendar/previews/range.html.erb +10 -0
- data/app/components/shadcn/calendar/previews/week_numbers.html.erb +8 -0
- data/app/components/shadcn/card/component.rb +24 -0
- data/app/components/shadcn/card/header/component.rb +26 -0
- data/app/components/shadcn/card/preview.rb +16 -0
- data/app/components/shadcn/card/previews/default.html.erb +18 -0
- data/app/components/shadcn/card/previews/image.html.erb +37 -0
- data/app/components/shadcn/card.rb +21 -0
- data/app/components/shadcn/carousel/component.rb +61 -0
- data/app/components/shadcn/carousel/content/component.rb +86 -0
- data/app/components/shadcn/carousel/item/component.rb +42 -0
- data/app/components/shadcn/carousel/next/component.rb +59 -0
- data/app/components/shadcn/carousel/preview.rb +22 -0
- data/app/components/shadcn/carousel/previews/default.html.erb +22 -0
- data/app/components/shadcn/carousel/previews/sizes.html.erb +42 -0
- data/app/components/shadcn/carousel/previews/vertical.html.erb +27 -0
- data/app/components/shadcn/carousel/previous/component.rb +59 -0
- data/app/components/shadcn/chart/area/component.rb +43 -0
- data/app/components/shadcn/chart/bar/component.rb +75 -0
- data/app/components/shadcn/chart/cartesian/component.rb +152 -0
- data/app/components/shadcn/chart/component.rb +124 -0
- data/app/components/shadcn/chart/focusable.rb +38 -0
- data/app/components/shadcn/chart/legend/component.rb +55 -0
- data/app/components/shadcn/chart/line/component.rb +50 -0
- data/app/components/shadcn/chart/pie/component.rb +169 -0
- data/app/components/shadcn/chart/plot.rb +147 -0
- data/app/components/shadcn/chart/preview.rb +45 -0
- data/app/components/shadcn/chart/previews/area.html.erb +31 -0
- data/app/components/shadcn/chart/previews/bar.html.erb +32 -0
- data/app/components/shadcn/chart/previews/bar_stacked.html.erb +30 -0
- data/app/components/shadcn/chart/previews/default.html.erb +30 -0
- data/app/components/shadcn/chart/previews/donut.html.erb +16 -0
- data/app/components/shadcn/chart/previews/line.html.erb +30 -0
- data/app/components/shadcn/chart/previews/percentages.html.erb +17 -0
- data/app/components/shadcn/chart/table/component.rb +75 -0
- data/app/components/shadcn/chart/tooltip/component.rb +111 -0
- data/app/components/shadcn/checkbox/component.rb +109 -0
- data/app/components/shadcn/checkbox/preview.rb +16 -0
- data/app/components/shadcn/checkbox/previews/default.html.erb +14 -0
- data/app/components/shadcn/checkbox/previews/states.html.erb +23 -0
- data/app/components/shadcn/collapsible/component.rb +35 -0
- data/app/components/shadcn/collapsible/content/component.rb +20 -0
- data/app/components/shadcn/collapsible/preview.rb +11 -0
- data/app/components/shadcn/collapsible/previews/default.html.erb +9 -0
- data/app/components/shadcn/collapsible/trigger/component.rb +23 -0
- data/app/components/shadcn/combobox/chip/component.rb +60 -0
- data/app/components/shadcn/combobox/chip_input/component.rb +43 -0
- data/app/components/shadcn/combobox/chips/component.rb +54 -0
- data/app/components/shadcn/combobox/clear/component.rb +32 -0
- data/app/components/shadcn/combobox/component.rb +113 -0
- data/app/components/shadcn/combobox/content/component.rb +59 -0
- data/app/components/shadcn/combobox/empty/component.rb +23 -0
- data/app/components/shadcn/combobox/input/component.rb +85 -0
- data/app/components/shadcn/combobox/item/component.rb +69 -0
- data/app/components/shadcn/combobox/list/component.rb +27 -0
- data/app/components/shadcn/combobox/preview.rb +31 -0
- data/app/components/shadcn/combobox/previews/default.html.erb +20 -0
- data/app/components/shadcn/combobox/previews/grouped.html.erb +25 -0
- data/app/components/shadcn/combobox/previews/multiple.html.erb +28 -0
- data/app/components/shadcn/combobox/previews/with_clear.html.erb +16 -0
- data/app/components/shadcn/combobox/trigger/component.rb +54 -0
- data/app/components/shadcn/combobox.rb +16 -0
- data/app/components/shadcn/command/component.rb +67 -0
- data/app/components/shadcn/command/dialog/component.rb +72 -0
- data/app/components/shadcn/command/empty/component.rb +29 -0
- data/app/components/shadcn/command/group/component.rb +63 -0
- data/app/components/shadcn/command/input/component.rb +66 -0
- data/app/components/shadcn/command/item/component.rb +62 -0
- data/app/components/shadcn/command/list/component.rb +36 -0
- data/app/components/shadcn/command/preview.rb +26 -0
- data/app/components/shadcn/command/previews/default.html.erb +41 -0
- data/app/components/shadcn/command/previews/dialog.html.erb +33 -0
- data/app/components/shadcn/command/previews/ranking.html.erb +16 -0
- data/app/components/shadcn/command/separator/component.rb +33 -0
- data/app/components/shadcn/command.rb +14 -0
- data/app/components/shadcn/concerns/modal_root.rb +43 -0
- data/app/components/shadcn/concerns/submits_value.rb +81 -0
- data/app/components/shadcn/context_menu/component.rb +45 -0
- data/app/components/shadcn/context_menu/content/component.rb +40 -0
- data/app/components/shadcn/context_menu/preview.rb +16 -0
- data/app/components/shadcn/context_menu/previews/default.html.erb +34 -0
- data/app/components/shadcn/context_menu/previews/items.html.erb +35 -0
- data/app/components/shadcn/context_menu/sub/component.rb +47 -0
- data/app/components/shadcn/context_menu/sub_content/component.rb +31 -0
- data/app/components/shadcn/context_menu/trigger/component.rb +50 -0
- data/app/components/shadcn/context_menu.rb +43 -0
- data/app/components/shadcn/dialog/close/component.rb +20 -0
- data/app/components/shadcn/dialog/component.rb +20 -0
- data/app/components/shadcn/dialog/content/component.rb +78 -0
- data/app/components/shadcn/dialog/header/component.rb +23 -0
- data/app/components/shadcn/dialog/overlay/component.rb +28 -0
- data/app/components/shadcn/dialog/preview.rb +28 -0
- data/app/components/shadcn/dialog/previews/default.html.erb +17 -0
- data/app/components/shadcn/dialog/previews/inside_stacking_context.html.erb +25 -0
- data/app/components/shadcn/dialog/previews/no_close_button.html.erb +15 -0
- data/app/components/shadcn/dialog/previews/scrollable_content.html.erb +29 -0
- data/app/components/shadcn/dialog/trigger/component.rb +24 -0
- data/app/components/shadcn/dialog.rb +17 -0
- data/app/components/shadcn/drawer/component.rb +33 -0
- data/app/components/shadcn/drawer/content/component.rb +95 -0
- data/app/components/shadcn/drawer/header/component.rb +34 -0
- data/app/components/shadcn/drawer/preview.rb +29 -0
- data/app/components/shadcn/drawer/previews/default.html.erb +21 -0
- data/app/components/shadcn/drawer/previews/scrollable.html.erb +20 -0
- data/app/components/shadcn/drawer/previews/scrollable_side.html.erb +21 -0
- data/app/components/shadcn/drawer/previews/sides.html.erb +17 -0
- data/app/components/shadcn/drawer.rb +27 -0
- data/app/components/shadcn/dropdown_menu/checkbox_item/component.rb +61 -0
- data/app/components/shadcn/dropdown_menu/component.rb +48 -0
- data/app/components/shadcn/dropdown_menu/content/component.rb +49 -0
- data/app/components/shadcn/dropdown_menu/group/component.rb +16 -0
- data/app/components/shadcn/dropdown_menu/item/component.rb +50 -0
- data/app/components/shadcn/dropdown_menu/preview.rb +16 -0
- data/app/components/shadcn/dropdown_menu/previews/checkboxes_and_radio.html.erb +34 -0
- data/app/components/shadcn/dropdown_menu/previews/default.html.erb +23 -0
- data/app/components/shadcn/dropdown_menu/radio_group/component.rb +16 -0
- data/app/components/shadcn/dropdown_menu/radio_item/component.rb +63 -0
- data/app/components/shadcn/dropdown_menu/sub/component.rb +44 -0
- data/app/components/shadcn/dropdown_menu/sub_content/component.rb +45 -0
- data/app/components/shadcn/dropdown_menu/sub_trigger/component.rb +58 -0
- data/app/components/shadcn/dropdown_menu/trigger/component.rb +25 -0
- data/app/components/shadcn/dropdown_menu.rb +18 -0
- data/app/components/shadcn/empty/component.rb +17 -0
- data/app/components/shadcn/empty/media/component.rb +48 -0
- data/app/components/shadcn/empty/preview.rb +16 -0
- data/app/components/shadcn/empty/previews/default.html.erb +15 -0
- data/app/components/shadcn/empty/previews/media.html.erb +32 -0
- data/app/components/shadcn/empty.rb +26 -0
- data/app/components/shadcn/field/component.rb +61 -0
- data/app/components/shadcn/field/error/component.rb +49 -0
- data/app/components/shadcn/field/legend/component.rb +30 -0
- data/app/components/shadcn/field/preview.rb +17 -0
- data/app/components/shadcn/field/previews/default.html.erb +29 -0
- data/app/components/shadcn/field/previews/form_builder.html.erb +38 -0
- data/app/components/shadcn/field/separator/component.rb +35 -0
- data/app/components/shadcn/field.rb +44 -0
- data/app/components/shadcn/hover_card/component.rb +51 -0
- data/app/components/shadcn/hover_card/content/component.rb +45 -0
- data/app/components/shadcn/hover_card/preview.rb +16 -0
- data/app/components/shadcn/hover_card/previews/default.html.erb +36 -0
- data/app/components/shadcn/hover_card/previews/sides.html.erb +15 -0
- data/app/components/shadcn/hover_card/trigger/component.rb +33 -0
- data/app/components/shadcn/icon/component.rb +76 -0
- data/app/components/shadcn/icon.rb +43 -0
- data/app/components/shadcn/input/component.rb +26 -0
- data/app/components/shadcn/input/preview.rb +16 -0
- data/app/components/shadcn/input/previews/default.html.erb +5 -0
- data/app/components/shadcn/input/previews/states.html.erb +20 -0
- data/app/components/shadcn/input_group/addon/component.rb +65 -0
- data/app/components/shadcn/input_group/button/component.rb +40 -0
- data/app/components/shadcn/input_group/component.rb +43 -0
- data/app/components/shadcn/input_group/input/component.rb +25 -0
- data/app/components/shadcn/input_group/preview.rb +17 -0
- data/app/components/shadcn/input_group/previews/addons.html.erb +53 -0
- data/app/components/shadcn/input_group/previews/default.html.erb +25 -0
- data/app/components/shadcn/input_group/text/component.rb +20 -0
- data/app/components/shadcn/input_group/textarea/component.rb +21 -0
- data/app/components/shadcn/input_otp/component.rb +95 -0
- data/app/components/shadcn/input_otp/preview.rb +17 -0
- data/app/components/shadcn/input_otp/previews/default.html.erb +19 -0
- data/app/components/shadcn/input_otp/previews/variations.html.erb +33 -0
- data/app/components/shadcn/input_otp/separator/component.rb +21 -0
- data/app/components/shadcn/input_otp/slot/component.rb +60 -0
- data/app/components/shadcn/input_otp.rb +11 -0
- data/app/components/shadcn/item/component.rb +56 -0
- data/app/components/shadcn/item/group/component.rb +53 -0
- data/app/components/shadcn/item/media/component.rb +53 -0
- data/app/components/shadcn/item/preview.rb +20 -0
- data/app/components/shadcn/item/previews/default.html.erb +32 -0
- data/app/components/shadcn/item/previews/link.html.erb +39 -0
- data/app/components/shadcn/item/previews/outline.html.erb +8 -0
- data/app/components/shadcn/item/separator/component.rb +24 -0
- data/app/components/shadcn/item.rb +34 -0
- data/app/components/shadcn/kbd/component.rb +23 -0
- data/app/components/shadcn/kbd/group/component.rb +17 -0
- data/app/components/shadcn/kbd/preview.rb +11 -0
- data/app/components/shadcn/kbd/previews/default.html.erb +4 -0
- data/app/components/shadcn/label/component.rb +20 -0
- data/app/components/shadcn/label/preview.rb +11 -0
- data/app/components/shadcn/label/previews/default.html.erb +4 -0
- data/app/components/shadcn/marker/component.rb +46 -0
- data/app/components/shadcn/marker/icon/component.rb +23 -0
- data/app/components/shadcn/marker/preview.rb +17 -0
- data/app/components/shadcn/marker/previews/default.html.erb +18 -0
- data/app/components/shadcn/marker/previews/status.html.erb +32 -0
- data/app/components/shadcn/marker.rb +17 -0
- data/app/components/shadcn/menubar/component.rb +36 -0
- data/app/components/shadcn/menubar/content/component.rb +49 -0
- data/app/components/shadcn/menubar/menu/component.rb +39 -0
- data/app/components/shadcn/menubar/preview.rb +16 -0
- data/app/components/shadcn/menubar/previews/default.html.erb +52 -0
- data/app/components/shadcn/menubar/previews/items.html.erb +38 -0
- data/app/components/shadcn/menubar/sub/component.rb +43 -0
- data/app/components/shadcn/menubar/sub_content/component.rb +31 -0
- data/app/components/shadcn/menubar/sub_trigger/component.rb +31 -0
- data/app/components/shadcn/menubar/trigger/component.rb +41 -0
- data/app/components/shadcn/menubar.rb +47 -0
- data/app/components/shadcn/message/component.rb +33 -0
- data/app/components/shadcn/message/preview.rb +16 -0
- data/app/components/shadcn/message/previews/actions.html.erb +51 -0
- data/app/components/shadcn/message/previews/default.html.erb +35 -0
- data/app/components/shadcn/message.rb +35 -0
- data/app/components/shadcn/message_scroller/button/component.rb +78 -0
- data/app/components/shadcn/message_scroller/component.rb +59 -0
- data/app/components/shadcn/message_scroller/content/component.rb +50 -0
- data/app/components/shadcn/message_scroller/item/component.rb +45 -0
- data/app/components/shadcn/message_scroller/preview.rb +11 -0
- data/app/components/shadcn/message_scroller/previews/default.html.erb +72 -0
- data/app/components/shadcn/message_scroller/viewport/component.rb +41 -0
- data/app/components/shadcn/mode_switcher/component.rb +67 -0
- data/app/components/shadcn/mode_switcher/preview.rb +11 -0
- data/app/components/shadcn/mode_switcher/previews/default.html.erb +5 -0
- data/app/components/shadcn/mode_toggle/component.rb +75 -0
- data/app/components/shadcn/mode_toggle/preview.rb +11 -0
- data/app/components/shadcn/mode_toggle/previews/default.html.erb +20 -0
- data/app/components/shadcn/native_select/component.rb +59 -0
- data/app/components/shadcn/native_select/preview.rb +16 -0
- data/app/components/shadcn/native_select/previews/default.html.erb +9 -0
- data/app/components/shadcn/native_select/previews/groups.html.erb +26 -0
- data/app/components/shadcn/native_select.rb +16 -0
- data/app/components/shadcn/navigation_menu/component.rb +51 -0
- data/app/components/shadcn/navigation_menu/content/component.rb +58 -0
- data/app/components/shadcn/navigation_menu/preview.rb +11 -0
- data/app/components/shadcn/navigation_menu/previews/default.html.erb +49 -0
- data/app/components/shadcn/navigation_menu/trigger/component.rb +59 -0
- data/app/components/shadcn/navigation_menu.rb +28 -0
- data/app/components/shadcn/pagination/component.rb +19 -0
- data/app/components/shadcn/pagination/ellipsis/component.rb +28 -0
- data/app/components/shadcn/pagination/link/component.rb +37 -0
- data/app/components/shadcn/pagination/next/component.rb +31 -0
- data/app/components/shadcn/pagination/preview.rb +16 -0
- data/app/components/shadcn/pagination/previews/default.html.erb +18 -0
- data/app/components/shadcn/pagination/previews/simple.html.erb +39 -0
- data/app/components/shadcn/pagination/previous/component.rb +31 -0
- data/app/components/shadcn/pagination.rb +14 -0
- data/app/components/shadcn/parts.rb +38 -0
- data/app/components/shadcn/popover/anchor/component.rb +17 -0
- data/app/components/shadcn/popover/component.rb +42 -0
- data/app/components/shadcn/popover/content/component.rb +40 -0
- data/app/components/shadcn/popover/preview.rb +28 -0
- data/app/components/shadcn/popover/previews/align.html.erb +13 -0
- data/app/components/shadcn/popover/previews/default.html.erb +9 -0
- data/app/components/shadcn/popover/previews/inside_containing_block.html.erb +41 -0
- data/app/components/shadcn/popover/previews/inside_stacking_context.html.erb +30 -0
- data/app/components/shadcn/popover/trigger/component.rb +24 -0
- data/app/components/shadcn/popover.rb +16 -0
- data/app/components/shadcn/progress/component.rb +62 -0
- data/app/components/shadcn/progress/preview.rb +11 -0
- data/app/components/shadcn/progress/previews/default.html.erb +5 -0
- data/app/components/shadcn/radio_group/component.rb +51 -0
- data/app/components/shadcn/radio_group/item/component.rb +74 -0
- data/app/components/shadcn/radio_group/preview.rb +16 -0
- data/app/components/shadcn/radio_group/previews/default.html.erb +15 -0
- data/app/components/shadcn/radio_group/previews/states.html.erb +41 -0
- data/app/components/shadcn/resizable/component.rb +59 -0
- data/app/components/shadcn/resizable/handle/component.rb +70 -0
- data/app/components/shadcn/resizable/panel/component.rb +53 -0
- data/app/components/shadcn/resizable/preview.rb +23 -0
- data/app/components/shadcn/resizable/previews/default.html.erb +25 -0
- data/app/components/shadcn/resizable/previews/vertical.html.erb +19 -0
- data/app/components/shadcn/resizable/previews/with_handle.html.erb +17 -0
- data/app/components/shadcn/scroll_area/component.rb +84 -0
- data/app/components/shadcn/scroll_area/preview.rb +11 -0
- data/app/components/shadcn/scroll_area/previews/default.html.erb +36 -0
- data/app/components/shadcn/scroll_area/scrollbar/component.rb +72 -0
- data/app/components/shadcn/scroll_area/viewport/component.rb +70 -0
- data/app/components/shadcn/scroll_area.rb +14 -0
- data/app/components/shadcn/select/component.rb +67 -0
- data/app/components/shadcn/select/content/component.rb +157 -0
- data/app/components/shadcn/select/empty/component.rb +38 -0
- data/app/components/shadcn/select/group/component.rb +16 -0
- data/app/components/shadcn/select/item/component.rb +71 -0
- data/app/components/shadcn/select/list/component.rb +41 -0
- data/app/components/shadcn/select/preview.rb +24 -0
- data/app/components/shadcn/select/previews/default.html.erb +17 -0
- data/app/components/shadcn/select/previews/scrollable.html.erb +19 -0
- data/app/components/shadcn/select/previews/searchable.html.erb +18 -0
- data/app/components/shadcn/select/previews/states.html.erb +25 -0
- data/app/components/shadcn/select/search/component.rb +54 -0
- data/app/components/shadcn/select/trigger/component.rb +78 -0
- data/app/components/shadcn/select/value/component.rb +28 -0
- data/app/components/shadcn/select.rb +15 -0
- data/app/components/shadcn/separator/component.rb +41 -0
- data/app/components/shadcn/separator/preview.rb +11 -0
- data/app/components/shadcn/separator/previews/default.html.erb +9 -0
- data/app/components/shadcn/sheet/component.rb +16 -0
- data/app/components/shadcn/sheet/content/component.rb +98 -0
- data/app/components/shadcn/sheet/header/component.rb +23 -0
- data/app/components/shadcn/sheet/preview.rb +16 -0
- data/app/components/shadcn/sheet/previews/default.html.erb +16 -0
- data/app/components/shadcn/sheet/previews/no_close_button.html.erb +14 -0
- data/app/components/shadcn/sheet.rb +22 -0
- data/app/components/shadcn/sidebar/component.rb +232 -0
- data/app/components/shadcn/sidebar/input/component.rb +25 -0
- data/app/components/shadcn/sidebar/menu_action/component.rb +58 -0
- data/app/components/shadcn/sidebar/menu_button/component.rb +100 -0
- data/app/components/shadcn/sidebar/menu_skeleton/component.rb +51 -0
- data/app/components/shadcn/sidebar/menu_sub_button/component.rb +60 -0
- data/app/components/shadcn/sidebar/preview.rb +22 -0
- data/app/components/shadcn/sidebar/previews/default.html.erb +189 -0
- data/app/components/shadcn/sidebar/previews/floating.html.erb +39 -0
- data/app/components/shadcn/sidebar/previews/inset.html.erb +48 -0
- data/app/components/shadcn/sidebar/provider/component.rb +53 -0
- data/app/components/shadcn/sidebar/rail/component.rb +43 -0
- data/app/components/shadcn/sidebar/separator/component.rb +23 -0
- data/app/components/shadcn/sidebar/trigger/component.rb +39 -0
- data/app/components/shadcn/sidebar.rb +98 -0
- data/app/components/shadcn/skeleton/component.rb +14 -0
- data/app/components/shadcn/skeleton/preview.rb +11 -0
- data/app/components/shadcn/skeleton/previews/default.html.erb +7 -0
- data/app/components/shadcn/slider/component.rb +145 -0
- data/app/components/shadcn/slider/preview.rb +16 -0
- data/app/components/shadcn/slider/previews/default.html.erb +17 -0
- data/app/components/shadcn/slider/previews/vertical.html.erb +7 -0
- data/app/components/shadcn/slider/range/component.rb +51 -0
- data/app/components/shadcn/slider/thumb/component.rb +58 -0
- data/app/components/shadcn/slider/track/component.rb +32 -0
- data/app/components/shadcn/spinner/component.rb +21 -0
- data/app/components/shadcn/spinner/preview.rb +11 -0
- data/app/components/shadcn/spinner/previews/default.html.erb +7 -0
- data/app/components/shadcn/switch/component.rb +104 -0
- data/app/components/shadcn/switch/preview.rb +11 -0
- data/app/components/shadcn/switch/previews/default.html.erb +24 -0
- data/app/components/shadcn/table/component.rb +26 -0
- data/app/components/shadcn/table/preview.rb +16 -0
- data/app/components/shadcn/table/previews/default.html.erb +19 -0
- data/app/components/shadcn/table/previews/footer.html.erb +25 -0
- data/app/components/shadcn/table.rb +33 -0
- data/app/components/shadcn/tabs/component.rb +40 -0
- data/app/components/shadcn/tabs/content/component.rb +34 -0
- data/app/components/shadcn/tabs/list/component.rb +51 -0
- data/app/components/shadcn/tabs/preview.rb +16 -0
- data/app/components/shadcn/tabs/previews/default.html.erb +21 -0
- data/app/components/shadcn/tabs/previews/line.html.erb +23 -0
- data/app/components/shadcn/tabs/trigger/component.rb +66 -0
- data/app/components/shadcn/textarea/component.rb +24 -0
- data/app/components/shadcn/textarea/preview.rb +16 -0
- data/app/components/shadcn/textarea/previews/default.html.erb +3 -0
- data/app/components/shadcn/textarea/previews/states.html.erb +18 -0
- data/app/components/shadcn/theme_selector/component.rb +88 -0
- data/app/components/shadcn/theme_selector/preview.rb +17 -0
- data/app/components/shadcn/theme_selector/previews/all_themes.html.erb +20 -0
- data/app/components/shadcn/theme_selector/previews/default.html.erb +18 -0
- data/app/components/shadcn/toaster/component.rb +139 -0
- data/app/components/shadcn/toaster/preview.rb +16 -0
- data/app/components/shadcn/toaster/previews/default.html.erb +19 -0
- data/app/components/shadcn/toaster/previews/from_the_server.html.erb +15 -0
- data/app/components/shadcn/toaster/toast/component.rb +134 -0
- data/app/components/shadcn/toggle/component.rb +81 -0
- data/app/components/shadcn/toggle/preview.rb +11 -0
- data/app/components/shadcn/toggle/previews/default.html.erb +6 -0
- data/app/components/shadcn/toggle_group/component.rb +62 -0
- data/app/components/shadcn/toggle_group/item/component.rb +59 -0
- data/app/components/shadcn/toggle_group/preview.rb +16 -0
- data/app/components/shadcn/toggle_group/previews/default.html.erb +12 -0
- data/app/components/shadcn/toggle_group/previews/sizes.html.erb +37 -0
- data/app/components/shadcn/tooltip/component.rb +38 -0
- data/app/components/shadcn/tooltip/content/component.rb +62 -0
- data/app/components/shadcn/tooltip/preview.rb +21 -0
- data/app/components/shadcn/tooltip/previews/default.html.erb +4 -0
- data/app/components/shadcn/tooltip/previews/sides.html.erb +19 -0
- data/app/components/shadcn/tooltip/previews/with_keyboard_shortcut.html.erb +11 -0
- data/app/components/shadcn/tooltip/provider/component.rb +28 -0
- data/app/components/shadcn/tooltip/trigger/component.rb +25 -0
- data/app/helpers/shadcn_view_component/form_helper.rb +25 -0
- data/app/helpers/shadcn_view_component/theme_helper.rb +61 -0
- data/app/javascript/shadcn/animation.js +180 -0
- data/app/javascript/shadcn/command_score.js +110 -0
- data/app/javascript/shadcn/controllers/accordion_controller.js +127 -0
- data/app/javascript/shadcn/controllers/avatar_controller.js +32 -0
- data/app/javascript/shadcn/controllers/calendar_controller.js +633 -0
- data/app/javascript/shadcn/controllers/carousel_controller.js +139 -0
- data/app/javascript/shadcn/controllers/chart_controller.js +110 -0
- data/app/javascript/shadcn/controllers/checkbox_controller.js +61 -0
- data/app/javascript/shadcn/controllers/collapsible_controller.js +55 -0
- data/app/javascript/shadcn/controllers/combobox_controller.js +360 -0
- data/app/javascript/shadcn/controllers/command_controller.js +199 -0
- data/app/javascript/shadcn/controllers/dialog_controller.js +154 -0
- data/app/javascript/shadcn/controllers/drawer_controller.js +265 -0
- data/app/javascript/shadcn/controllers/dropdown_menu_controller.js +259 -0
- data/app/javascript/shadcn/controllers/hover_card_controller.js +85 -0
- data/app/javascript/shadcn/controllers/input_group_controller.js +17 -0
- data/app/javascript/shadcn/controllers/input_otp_controller.js +80 -0
- data/app/javascript/shadcn/controllers/menubar_controller.js +151 -0
- data/app/javascript/shadcn/controllers/message_scroller_controller.js +456 -0
- data/app/javascript/shadcn/controllers/navigation_menu_controller.js +211 -0
- data/app/javascript/shadcn/controllers/popover_controller.js +66 -0
- data/app/javascript/shadcn/controllers/radio_group_controller.js +69 -0
- data/app/javascript/shadcn/controllers/resizable_controller.js +167 -0
- data/app/javascript/shadcn/controllers/scroll_area_controller.js +253 -0
- data/app/javascript/shadcn/controllers/select_controller.js +320 -0
- data/app/javascript/shadcn/controllers/sidebar_controller.js +273 -0
- data/app/javascript/shadcn/controllers/slider_controller.js +230 -0
- data/app/javascript/shadcn/controllers/switch_controller.js +39 -0
- data/app/javascript/shadcn/controllers/tabs_controller.js +81 -0
- data/app/javascript/shadcn/controllers/theme_controller.js +67 -0
- data/app/javascript/shadcn/controllers/toaster_controller.js +281 -0
- data/app/javascript/shadcn/controllers/toggle_controller.js +24 -0
- data/app/javascript/shadcn/controllers/toggle_group_controller.js +73 -0
- data/app/javascript/shadcn/controllers/tooltip_controller.js +58 -0
- data/app/javascript/shadcn/direction.js +41 -0
- data/app/javascript/shadcn/dismiss.js +73 -0
- data/app/javascript/shadcn/floating.js +207 -0
- data/app/javascript/shadcn/focus.js +86 -0
- data/app/javascript/shadcn/id.js +14 -0
- data/app/javascript/shadcn/index.js +110 -0
- data/app/javascript/shadcn/popper.js +262 -0
- data/app/javascript/shadcn/scroll_geometry.js +267 -0
- data/app/javascript/shadcn/theme.js +161 -0
- data/app/javascript/shadcn/top_layer.js +59 -0
- data/app/javascript/shadcn/typeahead.js +99 -0
- data/config/importmap.rb +6 -0
- data/config/locales/en.yml +62 -0
- data/lib/generators/shadcn_view_component/install/install_generator.rb +149 -0
- data/lib/shadcn_view_component/engine.rb +73 -0
- data/lib/shadcn_view_component/form_builder.rb +264 -0
- data/lib/shadcn_view_component/icon_registry.rb +66 -0
- data/lib/shadcn_view_component/icons.rb +32 -0
- data/lib/shadcn_view_component/themes.rb +1065 -0
- data/lib/shadcn_view_component/version.rb +3 -0
- data/lib/shadcn_view_component.rb +82 -0
- data/lib/tasks/icons.rake +53 -0
- data/lib/tasks/themes.rake +171 -0
- metadata +608 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: fb17c00e6a7c48bd2f4200a6217e5ab11e4f0e2cbac476d6da69b44283ea47f8
|
|
4
|
+
data.tar.gz: 849103710735badb2c08c568ae597bdd2b0132dee928401d3a54ac6ac8f3008b
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: b6704cdb80865d299846a69abeb08c02d0ad6a3d1fed942619b6ce2f2162363eb38920fb4b4f8515ca384b9448323bf59cc07ed6c33561073f63bfa0cb759f88
|
|
7
|
+
data.tar.gz: 564c0ddb59fc5cc388ea5d61dcd0bfcac17df8e240f9ce3c25912f0cb0e85e15c20129d47a1b49e0ba3085bdd360cc392c51fc1b1559056cdc12a296f1e6b565
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [0.3.3] — 2026-08-20
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- A palette the **server** rendered now survives the boot. `getTheme` fell back
|
|
12
|
+
to the literal `"neutral"` whenever `localStorage` held nothing, and
|
|
13
|
+
`applyTheme` runs on every connect — so a host that sets a default with
|
|
14
|
+
`shadcn_theme_class(default: "sky")` saw its palette until the JavaScript
|
|
15
|
+
loaded and then watched it swap back, with nothing to explain it. That is
|
|
16
|
+
every host without a `ThemeSelector`, since only the selector writes storage.
|
|
17
|
+
|
|
18
|
+
The fallback now reads what the document already says: the `theme-*` class the
|
|
19
|
+
server rendered, then the `data-shadcn-theme` the theme script tag stamps on
|
|
20
|
+
`<html>`. The class comes first because it is resolved from the cookie this
|
|
21
|
+
module mirrors every choice into, so it still knows the visitor's answer when
|
|
22
|
+
storage has been cleared.
|
|
23
|
+
|
|
24
|
+
Two bugs deep, and the second only showed once the first was fixed:
|
|
25
|
+
`applyTheme` asked for the theme *after* removing the `theme-*` classes, so
|
|
26
|
+
the fallback read a body it had just erased. It resolves before the loop now.
|
|
27
|
+
|
|
28
|
+
`spec/system/theming_spec.rb` covers it with a palette chosen, storage
|
|
29
|
+
cleared, and a fresh page — which was neutral before and is the chosen one
|
|
30
|
+
after.
|
|
31
|
+
|
|
32
|
+
## [0.3.2] — 2026-08-19
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- A button inside a `Drawer` now receives its click. `press` captured the
|
|
37
|
+
pointer on the panel at every press inside it, whatever the press had landed
|
|
38
|
+
on; capture retargets `pointerup` — and the compatibility `mouseup` with it —
|
|
39
|
+
at the panel, and a click is dispatched at the common ancestor of down and up.
|
|
40
|
+
So the click landed on the panel and the button got nothing. Every button in
|
|
41
|
+
every drawer, the footer's own Close included.
|
|
42
|
+
|
|
43
|
+
A press landing on `a`, `button`, `input`, `select`, `textarea`, `label` or
|
|
44
|
+
inside `[data-vaul-no-drag]` is no longer a drag, so nothing is captured. That
|
|
45
|
+
attribute is vaul's own way of saying "not from here" and was already
|
|
46
|
+
honoured — but only in `shouldDrag`, which runs on the first *move*, by which
|
|
47
|
+
time the capture has happened. The cost is dragging the panel by pressing on a
|
|
48
|
+
control, which is not a gesture anyone makes deliberately.
|
|
49
|
+
|
|
50
|
+
It hid because the two obvious ways of checking both work: typing in a field
|
|
51
|
+
is fine, since focus follows `pointerdown`, and so is submitting with Enter,
|
|
52
|
+
since no pointer is involved. It also survives a JavaScript `.click()`, which
|
|
53
|
+
skips the pointer path — so no test driving the page that way could see it.
|
|
54
|
+
Found in a host app, by a person: a form in a side drawer submitted with the
|
|
55
|
+
keyboard and did nothing with the mouse.
|
|
56
|
+
|
|
57
|
+
## [0.3.1] — 2026-08-18
|
|
58
|
+
|
|
59
|
+
### Fixed
|
|
60
|
+
|
|
61
|
+
- An option added to a `Select`, `Combobox` or `Command` after its controller
|
|
62
|
+
connected now gets an id, so `aria-activedescendant` has something to point
|
|
63
|
+
at. The ids were handed out once in `connect`, which only ever saw what the
|
|
64
|
+
server rendered — anything appended later arrived without one, the attribute
|
|
65
|
+
pointed at nothing, and the highlight moved on screen while a screen reader
|
|
66
|
+
followed none of it. Silent, and invisible to anyone not listening.
|
|
67
|
+
|
|
68
|
+
The id is assigned where it is read instead, so it no longer matters when or
|
|
69
|
+
by whom the option was created. Found wiring a dependent select in a host app:
|
|
70
|
+
choosing a client refills the sites beside it.
|
|
71
|
+
|
|
72
|
+
## [0.3.0] — 2026-08-18
|
|
73
|
+
|
|
74
|
+
### Added
|
|
75
|
+
|
|
76
|
+
- **`input_attributes:` on `Select`, `RadioGroup` and `ToggleGroup`**, reaching
|
|
77
|
+
the hidden input that carries the control's value into the form and nothing
|
|
78
|
+
else. That input is the library's own invention — Radix bubbles a native
|
|
79
|
+
control instead — and a host had no way to name it. `id`, which a
|
|
80
|
+
`<label for>` or an external script needs, and `form`, which is how HTML lets
|
|
81
|
+
a control submit with a form it does not sit inside, had no workaround at all.
|
|
82
|
+
`name` and `value` stay the component's.
|
|
83
|
+
|
|
84
|
+
Not offered on Combobox in `multiple` mode, Slider with several thumbs or
|
|
85
|
+
Calendar in `range`/`multiple`: those render several inputs, and copying a
|
|
86
|
+
caller's attributes onto each would duplicate `id` and connect a
|
|
87
|
+
`data-controller` once per input. Those take their attributes on the root.
|
|
88
|
+
|
|
89
|
+
Every rendered snapshot is unchanged: the attribute order the components
|
|
90
|
+
emitted before is preserved.
|
|
91
|
+
|
|
92
|
+
## [0.2.1] — 2026-08-17
|
|
93
|
+
|
|
94
|
+
### Fixed
|
|
95
|
+
|
|
96
|
+
- `data-controller` from a caller now concatenates onto the component's own
|
|
97
|
+
instead of being emitted twice. `data-action` was given this treatment
|
|
98
|
+
already; `data-controller` was missed, and its failure is quieter — two
|
|
99
|
+
attributes is invalid HTML, the browser keeps the first, which is the
|
|
100
|
+
component's, so the *caller's* controller never connects with nothing logged
|
|
101
|
+
and the component still working. Found in a host app wiring a dependent
|
|
102
|
+
select: `data: { controller: "set-location" }` on a Select, and choosing a
|
|
103
|
+
client silently stopped reloading its locations.
|
|
104
|
+
|
|
105
|
+
## [0.2.0] — 2026-08-17
|
|
106
|
+
|
|
107
|
+
### Added
|
|
108
|
+
|
|
109
|
+
- **Multiple selection in `Combobox`.** `multiple: true` takes an array in
|
|
110
|
+
`value:` and renders the chips box in place of the field, through a new
|
|
111
|
+
`combobox_chips` slot. Choosing an option adds a chip, taking it again puts it
|
|
112
|
+
back, and Backspace on an empty field removes the last one. It submits as a
|
|
113
|
+
Rails collection — `name` gains `[]`, one hidden input per value, plus an
|
|
114
|
+
empty one so clearing every chip still sends the parameter. The chips markup
|
|
115
|
+
was already ported; adding one is what was missing. Two of the rules are ours
|
|
116
|
+
rather than upstream's, because Base UI documents neither and is not vendored
|
|
117
|
+
here to check against; both are named as such in the system spec. See
|
|
118
|
+
[features/combobox.md](.claude/docs/features/combobox.md).
|
|
119
|
+
|
|
120
|
+
- `bin/eslint`, and a lint step for it in CI. It covers the one thing Ruby
|
|
121
|
+
tooling cannot see: whether the JavaScript refers to something that exists.
|
|
122
|
+
`stimulus_contract_spec` checks the other direction, from the components in.
|
|
123
|
+
Node is a development dependency and only that — the gem ships no npm package
|
|
124
|
+
and needs none at runtime.
|
|
125
|
+
|
|
126
|
+
### Fixed
|
|
127
|
+
|
|
128
|
+
- `shadcn_t` did not fall back to the bundled English, though the comment above
|
|
129
|
+
it had claimed it did since it was written. Every string the components render
|
|
130
|
+
went through a bare `I18n.t`, so a host whose locale was not `en` got
|
|
131
|
+
`I18n::MissingTranslationData` — and with `config.i18n.raise_on_missing_translations`,
|
|
132
|
+
which the Rails generators turn on in development and test, a raised page
|
|
133
|
+
rather than a fallback string. Found by installing the gem in an Italian app,
|
|
134
|
+
where the searchable select took the page down.
|
|
135
|
+
|
|
136
|
+
- `MessageScroller`'s controller called `getContentBottom`, which is exported by
|
|
137
|
+
`scroll_geometry.js` and was never imported there. The method around it was
|
|
138
|
+
called by nothing, so it is gone rather than repaired — it would have thrown
|
|
139
|
+
for the first caller. Found by eslint's first run.
|
|
140
|
+
|
|
141
|
+
## [0.1.0] — 2026-08-17
|
|
142
|
+
|
|
143
|
+
The first release. shadcn/ui ported to Rails ViewComponent 1:1 — the same part
|
|
144
|
+
names, variants, Tailwind classes and `data-slot` attributes — with Radix UI's
|
|
145
|
+
behaviour reimplemented in Stimulus, and no React and no npm at runtime.
|
|
146
|
+
|
|
147
|
+
### Added
|
|
148
|
+
|
|
149
|
+
- **Every component in the vendored registry.** 64 families under `Shadcn::`,
|
|
150
|
+
from `Accordion` to `Tooltip`, with `parity_spec`'s `not_yet_ported` list
|
|
151
|
+
empty. `form` is the one deliberate exception: it is answered by a Rails
|
|
152
|
+
FormBuilder rather than transcribed, since Rails already owns ids, names and
|
|
153
|
+
errors.
|
|
154
|
+
- **32 Stimulus controllers**, one per family with behaviour, over shared
|
|
155
|
+
modules for positioning (`popper.js`, `floating.js`), the dismiss stack, the
|
|
156
|
+
focus trap, the browser's top layer, typeahead and exit animations.
|
|
157
|
+
- **Shapes drawn on the server where the React version reaches for a package.**
|
|
158
|
+
The calendar builds its own months, the carousel its own track, the OTP input
|
|
159
|
+
its own boxes, and the chart draws pie, bar, line and area over a `Chart::Plot`
|
|
160
|
+
that computes the scale, the ticks and the bands — because `chart.tsx` draws
|
|
161
|
+
nothing at all, and recharts is 29,091 lines. Where a package *is* the work,
|
|
162
|
+
that is recorded rather than pretended away.
|
|
163
|
+
- **The icons are lucide's own files**, vendored under `vendor/lucide/icons` and
|
|
164
|
+
generated into the registry the component reads. A host adds its own with
|
|
165
|
+
`IconRegistry.load_directory`, a directory of SVGs and one line — no asset
|
|
166
|
+
pipeline involved.
|
|
167
|
+
- **An accessibility audit in both palettes**, over every preview, at rest and
|
|
168
|
+
with each layer open. The colour scheme is pinned, because headless Chrome
|
|
169
|
+
otherwise takes it from the desktop it runs on and audits whichever palette
|
|
170
|
+
the author is sitting in front of.
|
|
171
|
+
|
|
172
|
+
- RuboCop, on [Rails omakase](https://github.com/rails/rubocop-rails-omakase) —
|
|
173
|
+
which is the style the codebase was already written in — with `bin/rubocop`
|
|
174
|
+
and a lint job in CI. The generated theme registry, the dummy application and
|
|
175
|
+
the vendored shadcn sources are excluded.
|
|
176
|
+
- An axe audit over every family, at rest and with each layer open, plus
|
|
177
|
+
contrast in dark mode. It found that Select, Checkbox and Switch reached the
|
|
178
|
+
browser with no accessible name — a `<label for>` does not name a `<button>`,
|
|
179
|
+
and `role="combobox"` forbids taking the name from content. The FormBuilder
|
|
180
|
+
now wires `aria-labelledby` for them, and the previews demonstrate it.
|
|
181
|
+
- System specs driving headless Chrome against the gallery, so the
|
|
182
|
+
Stimulus controllers, `popper.js`, the dismiss stack and the focus trap are
|
|
183
|
+
executed rather than merely name-checked. They cover open/close, keyboard
|
|
184
|
+
navigation, focus trapping and restoration, scroll locking, positioning and
|
|
185
|
+
flipping, ARIA wiring, and mode/palette persistence across reloads.
|
|
186
|
+
- `shadcn_form_with` and `ShadcnViewComponent::FormBuilder`, wiring the `Field`
|
|
187
|
+
family to a model: ids and names from Rails, error text, `aria-invalid`,
|
|
188
|
+
`aria-describedby` and `data-invalid` from `ActiveModel::Errors`. Controls for
|
|
189
|
+
input, textarea, native select, select, checkbox, switch, radio group and
|
|
190
|
+
submit.
|
|
191
|
+
- A `part` macro for the sub-components that are only an element with a
|
|
192
|
+
`data-slot` and fixed classes. Declared on the family module, they no longer
|
|
193
|
+
need a file each — 53 files and their directories are gone, and a family now
|
|
194
|
+
reads on one screen. The generated classes are identical, which the rendered
|
|
195
|
+
snapshots confirm.
|
|
196
|
+
- Theming: 24 shadcn palettes generated from the upstream registry, a
|
|
197
|
+
`shadcn--theme` Stimulus controller, `ModeToggle`, `ModeSwitcher` and
|
|
198
|
+
`ThemeSelector` components, and `shadcn_theme_script_tag` to apply the stored
|
|
199
|
+
preference before the first paint.
|
|
200
|
+
- `bin/rails generate shadcn_view_component:install`, which resolves the
|
|
201
|
+
Tailwind `@source` path from the loaded gem instead of asking you to guess
|
|
202
|
+
where bundler put it.
|
|
203
|
+
- Every user-visible string goes through I18n under `shadcn_view_component.*`,
|
|
204
|
+
with shadcn's English as the default.
|
|
205
|
+
- `spec/snapshot_spec.rb`: golden snapshots of the rendered HTML for every
|
|
206
|
+
preview, which is what catches a class that moved to the wrong part or the
|
|
207
|
+
wrong variant.
|
|
208
|
+
- `spec/stimulus_contract_spec.rb`: asserts every `shadcn--x#action`, target and
|
|
209
|
+
value a component emits exists on the matching controller.
|
|
210
|
+
- `config.shadcn_view_component.cache_size` for tailwind-merge's LRU, defaulting
|
|
211
|
+
to 10,000 rather than the gem's 500.
|
|
212
|
+
|
|
213
|
+
### Fixed
|
|
214
|
+
|
|
215
|
+
- The controllers re-sync on `turbo:morph`. A morph refresh rewrites attributes
|
|
216
|
+
in place without disconnecting them, so `connect()` never ran again and the
|
|
217
|
+
DOM went back to the server's state while the controller kept the old ids,
|
|
218
|
+
targets and open/closed state. The dummy app now runs Turbo, and
|
|
219
|
+
`spec/system/turbo_spec.rb` covers Drive navigation, cache restoration and
|
|
220
|
+
morph refreshes.
|
|
221
|
+
- Floating layers and modals are promoted to the browser's top layer with the
|
|
222
|
+
Popover API, so a stacking context above them — a `sticky z-40` header, an
|
|
223
|
+
`isolate` card, anything with `opacity < 1` — can no longer bury them. They
|
|
224
|
+
stay where they are in the DOM, so the Stimulus actions inside them keep
|
|
225
|
+
working. Browsers without the API keep the previous `position: fixed`
|
|
226
|
+
behaviour.
|
|
227
|
+
- Attributes passed by the caller now win over the component's own, matching
|
|
228
|
+
React's `{...props}` spread. Previously `Icon.new("x", width: "16")` rendered
|
|
229
|
+
`width="24"` and every caller override was silently ignored.
|
|
230
|
+
- `data: { action: … }` no longer emits a second `data-action` attribute. The
|
|
231
|
+
duplicate was invalid HTML, and the browser kept the first — so the
|
|
232
|
+
component's own action never fired.
|
|
233
|
+
- DOM ids use a counter instead of `crypto.randomUUID()`, which is defined only
|
|
234
|
+
in a secure context: over plain HTTP the controllers threw on connect and
|
|
235
|
+
dialog, select, dropdown and tooltip were silently dead.
|
|
236
|
+
- Escape no longer stops propagating at the document capture phase, where an
|
|
237
|
+
open layer — a tooltip was enough — swallowed the key for the whole page.
|
|
238
|
+
- Floating content returns to its original position in the DOM instead of the
|
|
239
|
+
end of its container, which reordered the markup after one open/close.
|
|
240
|
+
- Repositioning is coalesced into one animation frame, instead of forcing a
|
|
241
|
+
synchronous layout on every scroll event.
|
|
242
|
+
- The gem ships its own `[data-slot][hidden]` rule rather than relying on
|
|
243
|
+
Tailwind's preflight, which a host app may not import — without it every
|
|
244
|
+
dialog, sheet, dropdown and select painted open on load.
|
|
245
|
+
- `:root` and `.dark` are generated from the same registry data as the palettes,
|
|
246
|
+
so the default look really is `theme-neutral`. They had drifted.
|
|
247
|
+
|
|
248
|
+
### Removed
|
|
249
|
+
|
|
250
|
+
- The `surface-*`, `code-*`, `selection-*` and `destructive-foreground` tokens.
|
|
251
|
+
They dress ui.shadcn.com's own chrome, no ported component uses them, and no
|
|
252
|
+
registry palette defines them.
|
|
253
|
+
- Dead scaffolding from `rails plugin new`: `test/test_helper.rb` (no minitest
|
|
254
|
+
tests exist), and the dummy's `config/ci.rb`, `bin/ci` and `bin/setup`, which
|
|
255
|
+
ran `bin/rails test` against nothing.
|
data/MIT-LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2026 sirion1987
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|