fernandes-ui 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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +392 -0
- data/Rakefile +6 -0
- data/app/assets/javascripts/ui.esm.js +14385 -0
- data/app/assets/javascripts/ui.js +13990 -0
- data/app/assets/stylesheets/ui/application.css +584 -0
- data/app/assets/stylesheets/ui/sonner.css +610 -0
- data/app/behaviors/ui/accordion_behavior.rb +30 -0
- data/app/behaviors/ui/accordion_content_behavior.rb +72 -0
- data/app/behaviors/ui/accordion_item_behavior.rb +47 -0
- data/app/behaviors/ui/accordion_trigger_behavior.rb +79 -0
- data/app/behaviors/ui/alert_behavior.rb +44 -0
- data/app/behaviors/ui/alert_description_behavior.rb +32 -0
- data/app/behaviors/ui/alert_dialog_action_behavior.rb +27 -0
- data/app/behaviors/ui/alert_dialog_behavior.rb +41 -0
- data/app/behaviors/ui/alert_dialog_cancel_behavior.rb +27 -0
- data/app/behaviors/ui/alert_dialog_content_behavior.rb +42 -0
- data/app/behaviors/ui/alert_dialog_description_behavior.rb +25 -0
- data/app/behaviors/ui/alert_dialog_footer_behavior.rb +26 -0
- data/app/behaviors/ui/alert_dialog_header_behavior.rb +25 -0
- data/app/behaviors/ui/alert_dialog_overlay_behavior.rb +68 -0
- data/app/behaviors/ui/alert_dialog_title_behavior.rb +25 -0
- data/app/behaviors/ui/alert_dialog_trigger_behavior.rb +39 -0
- data/app/behaviors/ui/alert_title_behavior.rb +32 -0
- data/app/behaviors/ui/aspect_ratio_behavior.rb +47 -0
- data/app/behaviors/ui/avatar_behavior.rb +43 -0
- data/app/behaviors/ui/avatar_fallback_behavior.rb +43 -0
- data/app/behaviors/ui/avatar_image_behavior.rb +46 -0
- data/app/behaviors/ui/badge_behavior.rb +50 -0
- data/app/behaviors/ui/blockquote_behavior.rb +23 -0
- data/app/behaviors/ui/breadcrumb_behavior.rb +22 -0
- data/app/behaviors/ui/breadcrumb_ellipsis_behavior.rb +34 -0
- data/app/behaviors/ui/breadcrumb_item_behavior.rb +32 -0
- data/app/behaviors/ui/breadcrumb_link_behavior.rb +33 -0
- data/app/behaviors/ui/breadcrumb_list_behavior.rb +32 -0
- data/app/behaviors/ui/breadcrumb_page_behavior.rb +35 -0
- data/app/behaviors/ui/breadcrumb_separator_behavior.rb +34 -0
- data/app/behaviors/ui/button_behavior.rb +99 -0
- data/app/behaviors/ui/button_group_behavior.rb +55 -0
- data/app/behaviors/ui/button_group_separator_behavior.rb +33 -0
- data/app/behaviors/ui/button_group_text_behavior.rb +34 -0
- data/app/behaviors/ui/calendar_behavior.rb +119 -0
- data/app/behaviors/ui/card_action_behavior.rb +32 -0
- data/app/behaviors/ui/card_behavior.rb +32 -0
- data/app/behaviors/ui/card_content_behavior.rb +32 -0
- data/app/behaviors/ui/card_description_behavior.rb +32 -0
- data/app/behaviors/ui/card_footer_behavior.rb +32 -0
- data/app/behaviors/ui/card_header_behavior.rb +32 -0
- data/app/behaviors/ui/card_title_behavior.rb +32 -0
- data/app/behaviors/ui/carousel_behavior.rb +53 -0
- data/app/behaviors/ui/carousel_content_behavior.rb +65 -0
- data/app/behaviors/ui/carousel_item_behavior.rb +26 -0
- data/app/behaviors/ui/carousel_next_behavior.rb +39 -0
- data/app/behaviors/ui/carousel_previous_behavior.rb +39 -0
- data/app/behaviors/ui/checkbox_behavior.rb +48 -0
- data/app/behaviors/ui/collapsible_behavior.rb +42 -0
- data/app/behaviors/ui/collapsible_content_behavior.rb +39 -0
- data/app/behaviors/ui/collapsible_trigger_behavior.rb +55 -0
- data/app/behaviors/ui/combobox_behavior.rb +0 -0
- data/app/behaviors/ui/command_behavior.rb +37 -0
- data/app/behaviors/ui/command_dialog_behavior.rb +30 -0
- data/app/behaviors/ui/command_empty_behavior.rb +36 -0
- data/app/behaviors/ui/command_group_behavior.rb +43 -0
- data/app/behaviors/ui/command_input_behavior.rb +49 -0
- data/app/behaviors/ui/command_item_behavior.rb +47 -0
- data/app/behaviors/ui/command_list_behavior.rb +38 -0
- data/app/behaviors/ui/command_separator_behavior.rb +30 -0
- data/app/behaviors/ui/command_shortcut_behavior.rb +29 -0
- data/app/behaviors/ui/context_menu_behavior.rb +32 -0
- data/app/behaviors/ui/context_menu_checkbox_item_behavior.rb +38 -0
- data/app/behaviors/ui/context_menu_content_behavior.rb +37 -0
- data/app/behaviors/ui/context_menu_item_behavior.rb +40 -0
- data/app/behaviors/ui/context_menu_label_behavior.rb +33 -0
- data/app/behaviors/ui/context_menu_radio_group_behavior.rb +20 -0
- data/app/behaviors/ui/context_menu_radio_item_behavior.rb +38 -0
- data/app/behaviors/ui/context_menu_separator_behavior.rb +22 -0
- data/app/behaviors/ui/context_menu_shortcut_behavior.rb +21 -0
- data/app/behaviors/ui/context_menu_trigger_behavior.rb +32 -0
- data/app/behaviors/ui/date_picker_behavior.rb +90 -0
- data/app/behaviors/ui/date_picker_input_behavior.rb +62 -0
- data/app/behaviors/ui/date_picker_trigger_behavior.rb +62 -0
- data/app/behaviors/ui/dialog_behavior.rb +46 -0
- data/app/behaviors/ui/dialog_content_behavior.rb +46 -0
- data/app/behaviors/ui/dialog_footer_behavior.rb +26 -0
- data/app/behaviors/ui/dialog_header_behavior.rb +26 -0
- data/app/behaviors/ui/dialog_overlay_behavior.rb +69 -0
- data/app/behaviors/ui/drawer_behavior.rb +57 -0
- data/app/behaviors/ui/drawer_close_behavior.rb +10 -0
- data/app/behaviors/ui/drawer_content_behavior.rb +107 -0
- data/app/behaviors/ui/drawer_description_behavior.rb +23 -0
- data/app/behaviors/ui/drawer_footer_behavior.rb +23 -0
- data/app/behaviors/ui/drawer_handle_behavior.rb +40 -0
- data/app/behaviors/ui/drawer_header_behavior.rb +29 -0
- data/app/behaviors/ui/drawer_overlay_behavior.rb +75 -0
- data/app/behaviors/ui/drawer_title_behavior.rb +26 -0
- data/app/behaviors/ui/drawer_trigger_behavior.rb +18 -0
- data/app/behaviors/ui/dropdown_menu_behavior.rb +43 -0
- data/app/behaviors/ui/dropdown_menu_checkbox_item_behavior.rb +46 -0
- data/app/behaviors/ui/dropdown_menu_content_behavior.rb +37 -0
- data/app/behaviors/ui/dropdown_menu_item_behavior.rb +40 -0
- data/app/behaviors/ui/dropdown_menu_label_behavior.rb +30 -0
- data/app/behaviors/ui/dropdown_menu_radio_group_behavior.rb +20 -0
- data/app/behaviors/ui/dropdown_menu_radio_item_behavior.rb +46 -0
- data/app/behaviors/ui/dropdown_menu_separator_behavior.rb +23 -0
- data/app/behaviors/ui/dropdown_menu_shortcut_behavior.rb +21 -0
- data/app/behaviors/ui/dropdown_menu_sub_behavior.rb +21 -0
- data/app/behaviors/ui/dropdown_menu_sub_content_behavior.rb +38 -0
- data/app/behaviors/ui/dropdown_menu_sub_trigger_behavior.rb +35 -0
- data/app/behaviors/ui/dropdown_menu_trigger_behavior.rb +46 -0
- data/app/behaviors/ui/empty_behavior.rb +124 -0
- data/app/behaviors/ui/field_behavior.rb +46 -0
- data/app/behaviors/ui/field_content_behavior.rb +26 -0
- data/app/behaviors/ui/field_description_behavior.rb +26 -0
- data/app/behaviors/ui/field_error_behavior.rb +47 -0
- data/app/behaviors/ui/field_group_behavior.rb +26 -0
- data/app/behaviors/ui/field_label_behavior.rb +27 -0
- data/app/behaviors/ui/field_legend_behavior.rb +28 -0
- data/app/behaviors/ui/field_separator_behavior.rb +33 -0
- data/app/behaviors/ui/field_set_behavior.rb +26 -0
- data/app/behaviors/ui/field_title_behavior.rb +26 -0
- data/app/behaviors/ui/h1_behavior.rb +23 -0
- data/app/behaviors/ui/h2_behavior.rb +23 -0
- data/app/behaviors/ui/h3_behavior.rb +23 -0
- data/app/behaviors/ui/h4_behavior.rb +23 -0
- data/app/behaviors/ui/hover_card_behavior.rb +29 -0
- data/app/behaviors/ui/hover_card_content_behavior.rb +41 -0
- data/app/behaviors/ui/hover_card_trigger_behavior.rb +44 -0
- data/app/behaviors/ui/inline_code_behavior.rb +23 -0
- data/app/behaviors/ui/input_behavior.rb +52 -0
- data/app/behaviors/ui/input_group_addon_behavior.rb +52 -0
- data/app/behaviors/ui/input_group_behavior.rb +63 -0
- data/app/behaviors/ui/input_group_button_behavior.rb +82 -0
- data/app/behaviors/ui/input_group_input_behavior.rb +50 -0
- data/app/behaviors/ui/input_group_text_behavior.rb +32 -0
- data/app/behaviors/ui/input_group_textarea_behavior.rb +50 -0
- data/app/behaviors/ui/input_otp_behavior.rb +44 -0
- data/app/behaviors/ui/input_otp_group_behavior.rb +32 -0
- data/app/behaviors/ui/input_otp_separator_behavior.rb +33 -0
- data/app/behaviors/ui/input_otp_slot_behavior.rb +49 -0
- data/app/behaviors/ui/item_actions_behavior.rb +31 -0
- data/app/behaviors/ui/item_behavior.rb +100 -0
- data/app/behaviors/ui/item_content_behavior.rb +31 -0
- data/app/behaviors/ui/item_description_behavior.rb +31 -0
- data/app/behaviors/ui/item_footer_behavior.rb +31 -0
- data/app/behaviors/ui/item_group_behavior.rb +31 -0
- data/app/behaviors/ui/item_header_behavior.rb +31 -0
- data/app/behaviors/ui/item_media_behavior.rb +47 -0
- data/app/behaviors/ui/item_separator_behavior.rb +31 -0
- data/app/behaviors/ui/item_title_behavior.rb +31 -0
- data/app/behaviors/ui/kbd_behavior.rb +28 -0
- data/app/behaviors/ui/kbd_group_behavior.rb +26 -0
- data/app/behaviors/ui/label_behavior.rb +35 -0
- data/app/behaviors/ui/large_behavior.rb +23 -0
- data/app/behaviors/ui/lead_behavior.rb +23 -0
- data/app/behaviors/ui/list_behavior.rb +23 -0
- data/app/behaviors/ui/menubar_behavior.rb +43 -0
- data/app/behaviors/ui/menubar_checkbox_item_behavior.rb +56 -0
- data/app/behaviors/ui/menubar_content_behavior.rb +53 -0
- data/app/behaviors/ui/menubar_item_behavior.rb +78 -0
- data/app/behaviors/ui/menubar_label_behavior.rb +41 -0
- data/app/behaviors/ui/menubar_menu_behavior.rb +39 -0
- data/app/behaviors/ui/menubar_radio_group_behavior.rb +34 -0
- data/app/behaviors/ui/menubar_radio_item_behavior.rb +61 -0
- data/app/behaviors/ui/menubar_separator_behavior.rb +30 -0
- data/app/behaviors/ui/menubar_shortcut_behavior.rb +29 -0
- data/app/behaviors/ui/menubar_sub_behavior.rb +30 -0
- data/app/behaviors/ui/menubar_sub_content_behavior.rb +49 -0
- data/app/behaviors/ui/menubar_sub_trigger_behavior.rb +57 -0
- data/app/behaviors/ui/menubar_trigger_behavior.rb +48 -0
- data/app/behaviors/ui/muted_behavior.rb +23 -0
- data/app/behaviors/ui/navigation_menu_behavior.rb +42 -0
- data/app/behaviors/ui/navigation_menu_content_behavior.rb +65 -0
- data/app/behaviors/ui/navigation_menu_item_behavior.rb +38 -0
- data/app/behaviors/ui/navigation_menu_link_behavior.rb +68 -0
- data/app/behaviors/ui/navigation_menu_list_behavior.rb +33 -0
- data/app/behaviors/ui/navigation_menu_trigger_behavior.rb +57 -0
- data/app/behaviors/ui/navigation_menu_viewport_behavior.rb +61 -0
- data/app/behaviors/ui/p_behavior.rb +23 -0
- data/app/behaviors/ui/pagination_behavior.rb +26 -0
- data/app/behaviors/ui/pagination_content_behavior.rb +24 -0
- data/app/behaviors/ui/pagination_ellipsis_behavior.rb +25 -0
- data/app/behaviors/ui/pagination_item_behavior.rb +13 -0
- data/app/behaviors/ui/pagination_link_behavior.rb +57 -0
- data/app/behaviors/ui/pagination_next_behavior.rb +20 -0
- data/app/behaviors/ui/pagination_previous_behavior.rb +20 -0
- data/app/behaviors/ui/popover_behavior.rb +54 -0
- data/app/behaviors/ui/popover_content_behavior.rb +52 -0
- data/app/behaviors/ui/popover_trigger_behavior.rb +33 -0
- data/app/behaviors/ui/progress_behavior.rb +48 -0
- data/app/behaviors/ui/radio_button_behavior.rb +46 -0
- data/app/behaviors/ui/resizable_handle_behavior.rb +81 -0
- data/app/behaviors/ui/resizable_panel_behavior.rb +53 -0
- data/app/behaviors/ui/resizable_panel_group_behavior.rb +41 -0
- data/app/behaviors/ui/responsive_dialog_behavior.rb +41 -0
- data/app/behaviors/ui/scroll_area_behavior.rb +36 -0
- data/app/behaviors/ui/scroll_area_corner_behavior.rb +34 -0
- data/app/behaviors/ui/scroll_area_scrollbar_behavior.rb +50 -0
- data/app/behaviors/ui/scroll_area_thumb_behavior.rb +34 -0
- data/app/behaviors/ui/scroll_area_viewport_behavior.rb +36 -0
- data/app/behaviors/ui/select_behavior.rb +84 -0
- data/app/behaviors/ui/select_content_behavior.rb +42 -0
- data/app/behaviors/ui/select_group_behavior.rb +35 -0
- data/app/behaviors/ui/select_item_behavior.rb +48 -0
- data/app/behaviors/ui/select_label_behavior.rb +34 -0
- data/app/behaviors/ui/select_scroll_down_button_behavior.rb +51 -0
- data/app/behaviors/ui/select_scroll_up_button_behavior.rb +51 -0
- data/app/behaviors/ui/select_trigger_behavior.rb +40 -0
- data/app/behaviors/ui/separator_behavior.rb +58 -0
- data/app/behaviors/ui/shared_as_child_behavior.rb +71 -0
- data/app/behaviors/ui/sheet_behavior.rb +46 -0
- data/app/behaviors/ui/sheet_content_behavior.rb +92 -0
- data/app/behaviors/ui/sheet_footer_behavior.rb +27 -0
- data/app/behaviors/ui/sheet_header_behavior.rb +27 -0
- data/app/behaviors/ui/sheet_overlay_behavior.rb +76 -0
- data/app/behaviors/ui/sidebar_behavior.rb +88 -0
- data/app/behaviors/ui/sidebar_content_behavior.rb +36 -0
- data/app/behaviors/ui/sidebar_footer_behavior.rb +35 -0
- data/app/behaviors/ui/sidebar_group_action_behavior.rb +40 -0
- data/app/behaviors/ui/sidebar_group_behavior.rb +35 -0
- data/app/behaviors/ui/sidebar_group_content_behavior.rb +35 -0
- data/app/behaviors/ui/sidebar_group_label_behavior.rb +39 -0
- data/app/behaviors/ui/sidebar_header_behavior.rb +35 -0
- data/app/behaviors/ui/sidebar_input_behavior.rb +36 -0
- data/app/behaviors/ui/sidebar_inset_behavior.rb +39 -0
- data/app/behaviors/ui/sidebar_menu_action_behavior.rb +49 -0
- data/app/behaviors/ui/sidebar_menu_badge_behavior.rb +39 -0
- data/app/behaviors/ui/sidebar_menu_behavior.rb +35 -0
- data/app/behaviors/ui/sidebar_menu_button_behavior.rb +70 -0
- data/app/behaviors/ui/sidebar_menu_item_behavior.rb +35 -0
- data/app/behaviors/ui/sidebar_menu_skeleton_behavior.rb +35 -0
- data/app/behaviors/ui/sidebar_menu_sub_behavior.rb +36 -0
- data/app/behaviors/ui/sidebar_menu_sub_button_behavior.rb +59 -0
- data/app/behaviors/ui/sidebar_menu_sub_item_behavior.rb +35 -0
- data/app/behaviors/ui/sidebar_provider_behavior.rb +56 -0
- data/app/behaviors/ui/sidebar_rail_behavior.rb +47 -0
- data/app/behaviors/ui/sidebar_separator_behavior.rb +36 -0
- data/app/behaviors/ui/sidebar_trigger_behavior.rb +40 -0
- data/app/behaviors/ui/slider_behavior.rb +46 -0
- data/app/behaviors/ui/slider_range_behavior.rb +18 -0
- data/app/behaviors/ui/slider_thumb_behavior.rb +25 -0
- data/app/behaviors/ui/slider_track_behavior.rb +23 -0
- data/app/behaviors/ui/small_behavior.rb +23 -0
- data/app/behaviors/ui/sonner_toaster_behavior.rb +34 -0
- data/app/behaviors/ui/spinner_behavior.rb +50 -0
- data/app/behaviors/ui/switch_behavior.rb +68 -0
- data/app/behaviors/ui/table_behavior.rb +28 -0
- data/app/behaviors/ui/table_body_behavior.rb +28 -0
- data/app/behaviors/ui/table_caption_behavior.rb +28 -0
- data/app/behaviors/ui/table_cell_behavior.rb +28 -0
- data/app/behaviors/ui/table_footer_behavior.rb +28 -0
- data/app/behaviors/ui/table_head_behavior.rb +28 -0
- data/app/behaviors/ui/table_header_behavior.rb +28 -0
- data/app/behaviors/ui/table_row_behavior.rb +28 -0
- data/app/behaviors/ui/tabs_behavior.rb +32 -0
- data/app/behaviors/ui/tabs_content_behavior.rb +38 -0
- data/app/behaviors/ui/tabs_list_behavior.rb +20 -0
- data/app/behaviors/ui/tabs_trigger_behavior.rb +47 -0
- data/app/behaviors/ui/textarea_behavior.rb +36 -0
- data/app/behaviors/ui/toggle_behavior.rb +85 -0
- data/app/behaviors/ui/toggle_group_behavior.rb +68 -0
- data/app/behaviors/ui/toggle_group_item_behavior.rb +88 -0
- data/app/behaviors/ui/tooltip_behavior.rb +29 -0
- data/app/behaviors/ui/tooltip_content_behavior.rb +57 -0
- data/app/behaviors/ui/tooltip_trigger_behavior.rb +60 -0
- data/app/components/ui/accordion.rb +36 -0
- data/app/components/ui/accordion_content.rb +30 -0
- data/app/components/ui/accordion_item.rb +48 -0
- data/app/components/ui/accordion_trigger.rb +52 -0
- data/app/components/ui/alert.rb +31 -0
- data/app/components/ui/alert_description.rb +26 -0
- data/app/components/ui/alert_dialog.rb +33 -0
- data/app/components/ui/alert_dialog_action.rb +34 -0
- data/app/components/ui/alert_dialog_cancel.rb +34 -0
- data/app/components/ui/alert_dialog_content.rb +25 -0
- data/app/components/ui/alert_dialog_description.rb +25 -0
- data/app/components/ui/alert_dialog_footer.rb +28 -0
- data/app/components/ui/alert_dialog_header.rb +27 -0
- data/app/components/ui/alert_dialog_overlay.rb +30 -0
- data/app/components/ui/alert_dialog_title.rb +25 -0
- data/app/components/ui/alert_dialog_trigger.rb +27 -0
- data/app/components/ui/alert_title.rb +24 -0
- data/app/components/ui/aspect_ratio.rb +32 -0
- data/app/components/ui/avatar.rb +31 -0
- data/app/components/ui/avatar_fallback.rb +33 -0
- data/app/components/ui/avatar_image.rb +33 -0
- data/app/components/ui/badge.rb +37 -0
- data/app/components/ui/blockquote.rb +15 -0
- data/app/components/ui/breadcrumb.rb +31 -0
- data/app/components/ui/breadcrumb_ellipsis.rb +55 -0
- data/app/components/ui/breadcrumb_item.rb +27 -0
- data/app/components/ui/breadcrumb_link.rb +27 -0
- data/app/components/ui/breadcrumb_list.rb +27 -0
- data/app/components/ui/breadcrumb_page.rb +25 -0
- data/app/components/ui/breadcrumb_separator.rb +51 -0
- data/app/components/ui/button.rb +52 -0
- data/app/components/ui/button_group.rb +48 -0
- data/app/components/ui/button_group_separator.rb +32 -0
- data/app/components/ui/button_group_text.rb +45 -0
- data/app/components/ui/calendar.rb +209 -0
- data/app/components/ui/card.rb +14 -0
- data/app/components/ui/card_action.rb +14 -0
- data/app/components/ui/card_content.rb +14 -0
- data/app/components/ui/card_description.rb +14 -0
- data/app/components/ui/card_footer.rb +14 -0
- data/app/components/ui/card_header.rb +14 -0
- data/app/components/ui/card_title.rb +14 -0
- data/app/components/ui/carousel.rb +16 -0
- data/app/components/ui/carousel_content.rb +15 -0
- data/app/components/ui/carousel_item.rb +13 -0
- data/app/components/ui/carousel_next.rb +29 -0
- data/app/components/ui/carousel_previous.rb +29 -0
- data/app/components/ui/checkbox.rb +49 -0
- data/app/components/ui/collapsible.rb +23 -0
- data/app/components/ui/collapsible_content.rb +15 -0
- data/app/components/ui/collapsible_trigger.rb +21 -0
- data/app/components/ui/combobox_wrapper.rb +57 -0
- data/app/components/ui/command.rb +15 -0
- data/app/components/ui/command_dialog.rb +25 -0
- data/app/components/ui/command_empty.rb +14 -0
- data/app/components/ui/command_group.rb +21 -0
- data/app/components/ui/command_input.rb +32 -0
- data/app/components/ui/command_item.rb +16 -0
- data/app/components/ui/command_list.rb +14 -0
- data/app/components/ui/command_separator.rb +14 -0
- data/app/components/ui/command_shortcut.rb +14 -0
- data/app/components/ui/context_menu.rb +30 -0
- data/app/components/ui/context_menu_checkbox_item.rb +51 -0
- data/app/components/ui/context_menu_content.rb +27 -0
- data/app/components/ui/context_menu_item.rb +40 -0
- data/app/components/ui/context_menu_label.rb +27 -0
- data/app/components/ui/context_menu_radio_group.rb +28 -0
- data/app/components/ui/context_menu_radio_item.rb +51 -0
- data/app/components/ui/context_menu_separator.rb +23 -0
- data/app/components/ui/context_menu_shortcut.rb +25 -0
- data/app/components/ui/context_menu_trigger.rb +27 -0
- data/app/components/ui/date_picker.rb +128 -0
- data/app/components/ui/date_picker_input.rb +75 -0
- data/app/components/ui/date_picker_trigger.rb +74 -0
- data/app/components/ui/dialog.rb +19 -0
- data/app/components/ui/dialog_close.rb +27 -0
- data/app/components/ui/dialog_content.rb +17 -0
- data/app/components/ui/dialog_description.rb +22 -0
- data/app/components/ui/dialog_footer.rb +15 -0
- data/app/components/ui/dialog_header.rb +15 -0
- data/app/components/ui/dialog_overlay.rb +18 -0
- data/app/components/ui/dialog_title.rb +22 -0
- data/app/components/ui/dialog_trigger.rb +38 -0
- data/app/components/ui/drawer.rb +39 -0
- data/app/components/ui/drawer_close.rb +23 -0
- data/app/components/ui/drawer_content.rb +19 -0
- data/app/components/ui/drawer_description.rb +16 -0
- data/app/components/ui/drawer_footer.rb +16 -0
- data/app/components/ui/drawer_handle.rb +14 -0
- data/app/components/ui/drawer_header.rb +16 -0
- data/app/components/ui/drawer_overlay.rb +17 -0
- data/app/components/ui/drawer_title.rb +16 -0
- data/app/components/ui/drawer_trigger.rb +34 -0
- data/app/components/ui/dropdown_menu.rb +56 -0
- data/app/components/ui/dropdown_menu_checkbox_item.rb +55 -0
- data/app/components/ui/dropdown_menu_content.rb +29 -0
- data/app/components/ui/dropdown_menu_item.rb +40 -0
- data/app/components/ui/dropdown_menu_label.rb +27 -0
- data/app/components/ui/dropdown_menu_radio_group.rb +28 -0
- data/app/components/ui/dropdown_menu_radio_item.rb +57 -0
- data/app/components/ui/dropdown_menu_separator.rb +23 -0
- data/app/components/ui/dropdown_menu_shortcut.rb +25 -0
- data/app/components/ui/dropdown_menu_sub.rb +28 -0
- data/app/components/ui/dropdown_menu_sub_content.rb +31 -0
- data/app/components/ui/dropdown_menu_sub_trigger.rb +47 -0
- data/app/components/ui/dropdown_menu_trigger.rb +43 -0
- data/app/components/ui/empty.rb +25 -0
- data/app/components/ui/empty_content.rb +22 -0
- data/app/components/ui/empty_description.rb +20 -0
- data/app/components/ui/empty_header.rb +24 -0
- data/app/components/ui/empty_media.rb +28 -0
- data/app/components/ui/empty_title.rb +20 -0
- data/app/components/ui/field.rb +35 -0
- data/app/components/ui/field_content.rb +25 -0
- data/app/components/ui/field_description.rb +25 -0
- data/app/components/ui/field_error.rb +61 -0
- data/app/components/ui/field_group.rb +28 -0
- data/app/components/ui/field_label.rb +27 -0
- data/app/components/ui/field_legend.rb +30 -0
- data/app/components/ui/field_separator.rb +50 -0
- data/app/components/ui/field_set.rb +27 -0
- data/app/components/ui/field_title.rb +25 -0
- data/app/components/ui/h1.rb +15 -0
- data/app/components/ui/h2.rb +15 -0
- data/app/components/ui/h3.rb +15 -0
- data/app/components/ui/h4.rb +15 -0
- data/app/components/ui/hover_card.rb +26 -0
- data/app/components/ui/hover_card_content.rb +32 -0
- data/app/components/ui/hover_card_trigger.rb +46 -0
- data/app/components/ui/inline_code.rb +15 -0
- data/app/components/ui/input.rb +19 -0
- data/app/components/ui/input_group.rb +33 -0
- data/app/components/ui/input_group_addon.rb +32 -0
- data/app/components/ui/input_group_button.rb +40 -0
- data/app/components/ui/input_group_input.rb +43 -0
- data/app/components/ui/input_group_text.rb +31 -0
- data/app/components/ui/input_group_textarea.rb +43 -0
- data/app/components/ui/input_otp.rb +56 -0
- data/app/components/ui/input_otp_group.rb +25 -0
- data/app/components/ui/input_otp_separator.rb +34 -0
- data/app/components/ui/input_otp_slot.rb +32 -0
- data/app/components/ui/item.rb +26 -0
- data/app/components/ui/item_actions.rb +14 -0
- data/app/components/ui/item_content.rb +14 -0
- data/app/components/ui/item_description.rb +14 -0
- data/app/components/ui/item_footer.rb +14 -0
- data/app/components/ui/item_group.rb +14 -0
- data/app/components/ui/item_header.rb +14 -0
- data/app/components/ui/item_media.rb +15 -0
- data/app/components/ui/item_separator.rb +14 -0
- data/app/components/ui/item_title.rb +14 -0
- data/app/components/ui/kbd.rb +29 -0
- data/app/components/ui/kbd_group.rb +30 -0
- data/app/components/ui/label.rb +30 -0
- data/app/components/ui/large.rb +15 -0
- data/app/components/ui/lead.rb +15 -0
- data/app/components/ui/list.rb +15 -0
- data/app/components/ui/menubar.rb +36 -0
- data/app/components/ui/menubar_checkbox_item.rb +54 -0
- data/app/components/ui/menubar_content.rb +32 -0
- data/app/components/ui/menubar_item.rb +39 -0
- data/app/components/ui/menubar_label.rb +29 -0
- data/app/components/ui/menubar_menu.rb +29 -0
- data/app/components/ui/menubar_radio_group.rb +29 -0
- data/app/components/ui/menubar_radio_item.rb +56 -0
- data/app/components/ui/menubar_separator.rb +22 -0
- data/app/components/ui/menubar_shortcut.rb +27 -0
- data/app/components/ui/menubar_sub.rb +30 -0
- data/app/components/ui/menubar_sub_content.rb +27 -0
- data/app/components/ui/menubar_sub_trigger.rb +48 -0
- data/app/components/ui/menubar_trigger.rb +26 -0
- data/app/components/ui/muted.rb +15 -0
- data/app/components/ui/navigation_menu.rb +50 -0
- data/app/components/ui/navigation_menu_content.rb +33 -0
- data/app/components/ui/navigation_menu_item.rb +36 -0
- data/app/components/ui/navigation_menu_link.rb +70 -0
- data/app/components/ui/navigation_menu_list.rb +28 -0
- data/app/components/ui/navigation_menu_trigger.rb +51 -0
- data/app/components/ui/navigation_menu_viewport.rb +25 -0
- data/app/components/ui/p.rb +15 -0
- data/app/components/ui/pagination.rb +19 -0
- data/app/components/ui/pagination_content.rb +19 -0
- data/app/components/ui/pagination_ellipsis.rb +26 -0
- data/app/components/ui/pagination_item.rb +17 -0
- data/app/components/ui/pagination_link.rb +25 -0
- data/app/components/ui/pagination_next.rb +31 -0
- data/app/components/ui/pagination_previous.rb +31 -0
- data/app/components/ui/popover.rb +48 -0
- data/app/components/ui/popover_content.rb +29 -0
- data/app/components/ui/popover_trigger.rb +36 -0
- data/app/components/ui/progress.rb +37 -0
- data/app/components/ui/radio_button.rb +50 -0
- data/app/components/ui/resizable_handle.rb +58 -0
- data/app/components/ui/resizable_panel.rb +35 -0
- data/app/components/ui/resizable_panel_group.rb +41 -0
- data/app/components/ui/responsive_dialog.rb +98 -0
- data/app/components/ui/scroll_area.rb +62 -0
- data/app/components/ui/scroll_area_corner.rb +33 -0
- data/app/components/ui/scroll_area_scrollbar.rb +45 -0
- data/app/components/ui/scroll_area_thumb.rb +38 -0
- data/app/components/ui/scroll_area_viewport.rb +41 -0
- data/app/components/ui/select.rb +42 -0
- data/app/components/ui/select_content.rb +43 -0
- data/app/components/ui/select_group.rb +38 -0
- data/app/components/ui/select_item.rb +67 -0
- data/app/components/ui/select_label.rb +34 -0
- data/app/components/ui/select_scroll_down_button.rb +47 -0
- data/app/components/ui/select_scroll_up_button.rb +47 -0
- data/app/components/ui/select_trigger.rb +45 -0
- data/app/components/ui/separator.rb +39 -0
- data/app/components/ui/sheet.rb +19 -0
- data/app/components/ui/sheet_close.rb +39 -0
- data/app/components/ui/sheet_content.rb +55 -0
- data/app/components/ui/sheet_description.rb +22 -0
- data/app/components/ui/sheet_footer.rb +15 -0
- data/app/components/ui/sheet_header.rb +15 -0
- data/app/components/ui/sheet_overlay.rb +18 -0
- data/app/components/ui/sheet_title.rb +22 -0
- data/app/components/ui/sheet_trigger.rb +27 -0
- data/app/components/ui/sidebar.rb +100 -0
- data/app/components/ui/sidebar_content.rb +34 -0
- data/app/components/ui/sidebar_footer.rb +36 -0
- data/app/components/ui/sidebar_group.rb +52 -0
- data/app/components/ui/sidebar_group_action.rb +47 -0
- data/app/components/ui/sidebar_group_content.rb +42 -0
- data/app/components/ui/sidebar_group_label.rb +46 -0
- data/app/components/ui/sidebar_header.rb +36 -0
- data/app/components/ui/sidebar_input.rb +42 -0
- data/app/components/ui/sidebar_inset.rb +42 -0
- data/app/components/ui/sidebar_menu.rb +39 -0
- data/app/components/ui/sidebar_menu_action.rb +60 -0
- data/app/components/ui/sidebar_menu_badge.rb +39 -0
- data/app/components/ui/sidebar_menu_button.rb +71 -0
- data/app/components/ui/sidebar_menu_item.rb +45 -0
- data/app/components/ui/sidebar_menu_skeleton.rb +63 -0
- data/app/components/ui/sidebar_menu_sub.rb +50 -0
- data/app/components/ui/sidebar_menu_sub_button.rb +48 -0
- data/app/components/ui/sidebar_menu_sub_item.rb +34 -0
- data/app/components/ui/sidebar_provider.rb +73 -0
- data/app/components/ui/sidebar_rail.rb +35 -0
- data/app/components/ui/sidebar_separator.rb +32 -0
- data/app/components/ui/sidebar_trigger.rb +57 -0
- data/app/components/ui/skeleton.rb +42 -0
- data/app/components/ui/small.rb +15 -0
- data/app/components/ui/sonner_toaster.rb +53 -0
- data/app/components/ui/spinner.rb +41 -0
- data/app/components/ui/switch.rb +70 -0
- data/app/components/ui/table.rb +45 -0
- data/app/components/ui/table_body.rb +29 -0
- data/app/components/ui/table_caption.rb +16 -0
- data/app/components/ui/table_cell.rb +16 -0
- data/app/components/ui/table_footer.rb +29 -0
- data/app/components/ui/table_head.rb +16 -0
- data/app/components/ui/table_header.rb +29 -0
- data/app/components/ui/table_row.rb +25 -0
- data/app/components/ui/tabs.rb +40 -0
- data/app/components/ui/tabs_content.rb +30 -0
- data/app/components/ui/tabs_list.rb +27 -0
- data/app/components/ui/tabs_trigger.rb +33 -0
- data/app/components/ui/textarea.rb +19 -0
- data/app/components/ui/toggle.rb +43 -0
- data/app/components/ui/toggle_group.rb +58 -0
- data/app/components/ui/toggle_group_item.rb +71 -0
- data/app/components/ui/tooltip.rb +31 -0
- data/app/components/ui/tooltip_content.rb +35 -0
- data/app/components/ui/tooltip_trigger.rb +42 -0
- data/app/controllers/ui/application_controller.rb +4 -0
- data/app/helpers/ui/application_helper.rb +20 -0
- data/app/helpers/ui/combobox_behavior.rb +59 -0
- data/app/helpers/ui/empty_behavior.rb +124 -0
- data/app/helpers/ui/input_group_addon_behavior.rb +52 -0
- data/app/helpers/ui/input_group_behavior.rb +63 -0
- data/app/helpers/ui/input_group_button_behavior.rb +82 -0
- data/app/helpers/ui/input_group_input_behavior.rb +50 -0
- data/app/helpers/ui/input_group_text_behavior.rb +32 -0
- data/app/helpers/ui/input_group_textarea_behavior.rb +50 -0
- data/app/helpers/ui/popover_behavior.rb +54 -0
- data/app/helpers/ui/popover_content_behavior.rb +52 -0
- data/app/helpers/ui/popover_trigger_behavior.rb +33 -0
- data/app/helpers/ui/scroll_area_behavior.rb +36 -0
- data/app/helpers/ui/scroll_area_corner_behavior.rb +34 -0
- data/app/helpers/ui/scroll_area_scrollbar_behavior.rb +50 -0
- data/app/helpers/ui/scroll_area_thumb_behavior.rb +34 -0
- data/app/helpers/ui/scroll_area_viewport_behavior.rb +36 -0
- data/app/helpers/ui/select_behavior.rb +84 -0
- data/app/helpers/ui/select_content_behavior.rb +42 -0
- data/app/helpers/ui/select_group_behavior.rb +35 -0
- data/app/helpers/ui/select_item_behavior.rb +48 -0
- data/app/helpers/ui/select_label_behavior.rb +34 -0
- data/app/helpers/ui/select_scroll_down_button_behavior.rb +51 -0
- data/app/helpers/ui/select_scroll_up_button_behavior.rb +51 -0
- data/app/helpers/ui/select_trigger_behavior.rb +40 -0
- data/app/helpers/ui/spinner_behavior.rb +50 -0
- data/app/helpers/ui/textarea_behavior.rb +36 -0
- data/app/javascript/ui/common.js +24 -0
- data/app/javascript/ui/controllers/accordion_controller.js +159 -0
- data/app/javascript/ui/controllers/alert_dialog_controller.js +98 -0
- data/app/javascript/ui/controllers/avatar_controller.js +84 -0
- data/app/javascript/ui/controllers/calendar_controller.js +867 -0
- data/app/javascript/ui/controllers/carousel_controller.js +191 -0
- data/app/javascript/ui/controllers/checkbox_controller.js +27 -0
- data/app/javascript/ui/controllers/collapsible_controller.js +65 -0
- data/app/javascript/ui/controllers/combobox_controller.js +149 -0
- data/app/javascript/ui/controllers/command_controller.js +199 -0
- data/app/javascript/ui/controllers/command_dialog_controller.js +100 -0
- data/app/javascript/ui/controllers/context_menu_controller.js +289 -0
- data/app/javascript/ui/controllers/datepicker_controller.js +385 -0
- data/app/javascript/ui/controllers/dialog_controller.js +136 -0
- data/app/javascript/ui/controllers/drawer_controller.js +945 -0
- data/app/javascript/ui/controllers/dropdown_controller.js +850 -0
- data/app/javascript/ui/controllers/hello_controller.js +30 -0
- data/app/javascript/ui/controllers/hover_card_controller.js +147 -0
- data/app/javascript/ui/controllers/input_otp_controller.js +139 -0
- data/app/javascript/ui/controllers/menubar_controller.js +799 -0
- data/app/javascript/ui/controllers/navigation_menu_controller.js +527 -0
- data/app/javascript/ui/controllers/popover_controller.js +257 -0
- data/app/javascript/ui/controllers/resizable_controller.js +449 -0
- data/app/javascript/ui/controllers/responsive_dialog_controller.js +156 -0
- data/app/javascript/ui/controllers/scroll_area_controller.js +623 -0
- data/app/javascript/ui/controllers/select_controller.js +456 -0
- data/app/javascript/ui/controllers/sidebar_controller.js +284 -0
- data/app/javascript/ui/controllers/slider_controller.js +342 -0
- data/app/javascript/ui/controllers/sonner_controller.js +393 -0
- data/app/javascript/ui/controllers/switch_controller.js +75 -0
- data/app/javascript/ui/controllers/tabs_controller.js +156 -0
- data/app/javascript/ui/controllers/toggle_controller.js +49 -0
- data/app/javascript/ui/controllers/toggle_group_controller.js +155 -0
- data/app/javascript/ui/controllers/tooltip_controller.js +122 -0
- data/app/javascript/ui/index.js +94 -0
- data/app/javascript/ui/utils/click-outside-manager.js +133 -0
- data/app/javascript/ui/utils/escape-key-manager.js +118 -0
- data/app/javascript/ui/utils/floating-ui-positioner.js +282 -0
- data/app/javascript/ui/utils/focus-trap-manager.js +238 -0
- data/app/javascript/ui/utils/index.js +86 -0
- data/app/javascript/ui/utils/menu_utils.js +423 -0
- data/app/javascript/ui/utils/scroll-lock-manager.js +149 -0
- data/app/javascript/ui/utils/state-manager.js +205 -0
- data/app/jobs/ui/application_job.rb +4 -0
- data/app/mailers/ui/application_mailer.rb +6 -0
- data/app/models/ui/application_record.rb +5 -0
- data/app/view_components/ui/accordion_component.rb +35 -0
- data/app/view_components/ui/accordion_content_component.rb +29 -0
- data/app/view_components/ui/accordion_item_component.rb +43 -0
- data/app/view_components/ui/accordion_trigger_component.rb +31 -0
- data/app/view_components/ui/alert_component.rb +23 -0
- data/app/view_components/ui/alert_description_component.rb +21 -0
- data/app/view_components/ui/alert_title_component.rb +21 -0
- data/app/view_components/ui/aspect_ratio_component.rb +26 -0
- data/app/view_components/ui/avatar_component.rb +21 -0
- data/app/view_components/ui/avatar_fallback_component.rb +21 -0
- data/app/view_components/ui/avatar_image_component.rb +23 -0
- data/app/view_components/ui/badge_component.rb +23 -0
- data/app/view_components/ui/blockquote_component.rb +18 -0
- data/app/view_components/ui/breadcrumb_component.rb +33 -0
- data/app/view_components/ui/breadcrumb_ellipsis_component.rb +50 -0
- data/app/view_components/ui/breadcrumb_item_component.rb +29 -0
- data/app/view_components/ui/breadcrumb_link_component.rb +29 -0
- data/app/view_components/ui/breadcrumb_list_component.rb +29 -0
- data/app/view_components/ui/breadcrumb_page_component.rb +27 -0
- data/app/view_components/ui/breadcrumb_separator_component.rb +47 -0
- data/app/view_components/ui/button_component.rb +43 -0
- data/app/view_components/ui/button_group_component.rb +38 -0
- data/app/view_components/ui/button_group_separator_component.rb +33 -0
- data/app/view_components/ui/button_group_text_component.rb +30 -0
- data/app/view_components/ui/calendar_component.rb +185 -0
- data/app/view_components/ui/card_action_component.rb +14 -0
- data/app/view_components/ui/card_component.rb +14 -0
- data/app/view_components/ui/card_content_component.rb +14 -0
- data/app/view_components/ui/card_description_component.rb +14 -0
- data/app/view_components/ui/card_footer_component.rb +14 -0
- data/app/view_components/ui/card_header_component.rb +14 -0
- data/app/view_components/ui/card_title_component.rb +14 -0
- data/app/view_components/ui/carousel_component.rb +16 -0
- data/app/view_components/ui/carousel_content_component.rb +15 -0
- data/app/view_components/ui/carousel_item_component.rb +13 -0
- data/app/view_components/ui/carousel_next_component.rb +31 -0
- data/app/view_components/ui/carousel_previous_component.rb +31 -0
- data/app/view_components/ui/checkbox_component.rb +55 -0
- data/app/view_components/ui/collapsible_component.rb +23 -0
- data/app/view_components/ui/collapsible_content_component.rb +15 -0
- data/app/view_components/ui/collapsible_trigger_component.rb +21 -0
- data/app/view_components/ui/combobox_wrapper_component.rb +56 -0
- data/app/view_components/ui/command_component.rb +15 -0
- data/app/view_components/ui/command_dialog_component.rb +25 -0
- data/app/view_components/ui/command_empty_component.rb +14 -0
- data/app/view_components/ui/command_group_component.rb +21 -0
- data/app/view_components/ui/command_input_component.rb +20 -0
- data/app/view_components/ui/command_item_component.rb +16 -0
- data/app/view_components/ui/command_list_component.rb +14 -0
- data/app/view_components/ui/command_separator_component.rb +14 -0
- data/app/view_components/ui/command_shortcut_component.rb +14 -0
- data/app/view_components/ui/context_menu_checkbox_item_component.rb +45 -0
- data/app/view_components/ui/context_menu_component.rb +20 -0
- data/app/view_components/ui/context_menu_content_component.rb +20 -0
- data/app/view_components/ui/context_menu_item_component.rb +29 -0
- data/app/view_components/ui/context_menu_label_component.rb +22 -0
- data/app/view_components/ui/context_menu_radio_group_component.rb +19 -0
- data/app/view_components/ui/context_menu_radio_item_component.rb +45 -0
- data/app/view_components/ui/context_menu_separator_component.rb +15 -0
- data/app/view_components/ui/context_menu_shortcut_component.rb +19 -0
- data/app/view_components/ui/context_menu_trigger_component.rb +20 -0
- data/app/view_components/ui/date_picker_component.rb +137 -0
- data/app/view_components/ui/date_picker_input_component.rb +76 -0
- data/app/view_components/ui/date_picker_trigger_component.rb +79 -0
- data/app/view_components/ui/dialog_close_component.rb +71 -0
- data/app/view_components/ui/dialog_component.rb +50 -0
- data/app/view_components/ui/dialog_content_component.rb +28 -0
- data/app/view_components/ui/dialog_description_component.rb +26 -0
- data/app/view_components/ui/dialog_footer_component.rb +21 -0
- data/app/view_components/ui/dialog_header_component.rb +22 -0
- data/app/view_components/ui/dialog_overlay_component.rb +36 -0
- data/app/view_components/ui/dialog_title_component.rb +26 -0
- data/app/view_components/ui/dialog_trigger_component.rb +71 -0
- data/app/view_components/ui/drawer_close_component.rb +35 -0
- data/app/view_components/ui/drawer_component.rb +81 -0
- data/app/view_components/ui/drawer_content_component.rb +32 -0
- data/app/view_components/ui/drawer_description_component.rb +21 -0
- data/app/view_components/ui/drawer_footer_component.rb +24 -0
- data/app/view_components/ui/drawer_handle_component.rb +24 -0
- data/app/view_components/ui/drawer_header_component.rb +24 -0
- data/app/view_components/ui/drawer_overlay_component.rb +28 -0
- data/app/view_components/ui/drawer_title_component.rb +21 -0
- data/app/view_components/ui/drawer_trigger_component.rb +71 -0
- data/app/view_components/ui/dropdown_menu_checkbox_item_component.rb +36 -0
- data/app/view_components/ui/dropdown_menu_component.rb +52 -0
- data/app/view_components/ui/dropdown_menu_content_component.rb +18 -0
- data/app/view_components/ui/dropdown_menu_item_component.rb +21 -0
- data/app/view_components/ui/dropdown_menu_label_component.rb +18 -0
- data/app/view_components/ui/dropdown_menu_radio_group_component.rb +17 -0
- data/app/view_components/ui/dropdown_menu_radio_item_component.rb +37 -0
- data/app/view_components/ui/dropdown_menu_separator_component.rb +15 -0
- data/app/view_components/ui/dropdown_menu_shortcut_component.rb +17 -0
- data/app/view_components/ui/dropdown_menu_sub_component.rb +17 -0
- data/app/view_components/ui/dropdown_menu_sub_content_component.rb +19 -0
- data/app/view_components/ui/dropdown_menu_sub_trigger_component.rb +29 -0
- data/app/view_components/ui/dropdown_menu_trigger_component.rb +52 -0
- data/app/view_components/ui/empty_component.rb +17 -0
- data/app/view_components/ui/empty_content_component.rb +17 -0
- data/app/view_components/ui/empty_description_component.rb +17 -0
- data/app/view_components/ui/empty_header_component.rb +17 -0
- data/app/view_components/ui/empty_media_component.rb +18 -0
- data/app/view_components/ui/empty_title_component.rb +17 -0
- data/app/view_components/ui/field_component.rb +41 -0
- data/app/view_components/ui/field_content_component.rb +27 -0
- data/app/view_components/ui/field_description_component.rb +27 -0
- data/app/view_components/ui/field_error_component.rb +63 -0
- data/app/view_components/ui/field_group_component.rb +32 -0
- data/app/view_components/ui/field_label_component.rb +29 -0
- data/app/view_components/ui/field_legend_component.rb +34 -0
- data/app/view_components/ui/field_separator_component.rb +53 -0
- data/app/view_components/ui/field_set_component.rb +30 -0
- data/app/view_components/ui/field_title_component.rb +27 -0
- data/app/view_components/ui/h1_component.rb +21 -0
- data/app/view_components/ui/h2_component.rb +21 -0
- data/app/view_components/ui/h3_component.rb +18 -0
- data/app/view_components/ui/h4_component.rb +18 -0
- data/app/view_components/ui/hover_card_component.rb +30 -0
- data/app/view_components/ui/hover_card_content_component.rb +36 -0
- data/app/view_components/ui/hover_card_trigger_component.rb +54 -0
- data/app/view_components/ui/inline_code_component.rb +18 -0
- data/app/view_components/ui/input_component.rb +23 -0
- data/app/view_components/ui/input_group_addon_component.rb +36 -0
- data/app/view_components/ui/input_group_button_component.rb +36 -0
- data/app/view_components/ui/input_group_component.rb +35 -0
- data/app/view_components/ui/input_group_input_component.rb +42 -0
- data/app/view_components/ui/input_group_text_component.rb +33 -0
- data/app/view_components/ui/input_group_textarea_component.rb +42 -0
- data/app/view_components/ui/input_otp_component.rb +61 -0
- data/app/view_components/ui/input_otp_group_component.rb +29 -0
- data/app/view_components/ui/input_otp_separator_component.rb +36 -0
- data/app/view_components/ui/input_otp_slot_component.rb +32 -0
- data/app/view_components/ui/item_actions_component.rb +18 -0
- data/app/view_components/ui/item_component.rb +30 -0
- data/app/view_components/ui/item_content_component.rb +18 -0
- data/app/view_components/ui/item_description_component.rb +18 -0
- data/app/view_components/ui/item_footer_component.rb +18 -0
- data/app/view_components/ui/item_group_component.rb +18 -0
- data/app/view_components/ui/item_header_component.rb +18 -0
- data/app/view_components/ui/item_media_component.rb +19 -0
- data/app/view_components/ui/item_separator_component.rb +18 -0
- data/app/view_components/ui/item_title_component.rb +18 -0
- data/app/view_components/ui/kbd_component.rb +31 -0
- data/app/view_components/ui/kbd_group_component.rb +32 -0
- data/app/view_components/ui/label_component.rb +23 -0
- data/app/view_components/ui/large_component.rb +18 -0
- data/app/view_components/ui/lead_component.rb +18 -0
- data/app/view_components/ui/list_component.rb +18 -0
- data/app/view_components/ui/menubar_checkbox_item_component.rb +47 -0
- data/app/view_components/ui/menubar_component.rb +24 -0
- data/app/view_components/ui/menubar_content_component.rb +26 -0
- data/app/view_components/ui/menubar_item_component.rb +31 -0
- data/app/view_components/ui/menubar_label_component.rb +23 -0
- data/app/view_components/ui/menubar_menu_component.rb +25 -0
- data/app/view_components/ui/menubar_radio_group_component.rb +26 -0
- data/app/view_components/ui/menubar_radio_item_component.rb +48 -0
- data/app/view_components/ui/menubar_separator_component.rb +20 -0
- data/app/view_components/ui/menubar_shortcut_component.rb +22 -0
- data/app/view_components/ui/menubar_sub_component.rb +25 -0
- data/app/view_components/ui/menubar_sub_content_component.rb +25 -0
- data/app/view_components/ui/menubar_sub_trigger_component.rb +43 -0
- data/app/view_components/ui/menubar_trigger_component.rb +23 -0
- data/app/view_components/ui/muted_component.rb +18 -0
- data/app/view_components/ui/navigation_menu_component.rb +42 -0
- data/app/view_components/ui/navigation_menu_content_component.rb +23 -0
- data/app/view_components/ui/navigation_menu_item_component.rb +23 -0
- data/app/view_components/ui/navigation_menu_link_component.rb +101 -0
- data/app/view_components/ui/navigation_menu_list_component.rb +21 -0
- data/app/view_components/ui/navigation_menu_trigger_component.rb +45 -0
- data/app/view_components/ui/navigation_menu_viewport_component.rb +21 -0
- data/app/view_components/ui/p_component.rb +18 -0
- data/app/view_components/ui/pagination_component.rb +18 -0
- data/app/view_components/ui/pagination_content_component.rb +18 -0
- data/app/view_components/ui/pagination_ellipsis_component.rb +25 -0
- data/app/view_components/ui/pagination_item_component.rb +16 -0
- data/app/view_components/ui/pagination_link_component.rb +26 -0
- data/app/view_components/ui/pagination_next_component.rb +30 -0
- data/app/view_components/ui/pagination_previous_component.rb +30 -0
- data/app/view_components/ui/popover_component.rb +55 -0
- data/app/view_components/ui/popover_content_component.rb +43 -0
- data/app/view_components/ui/popover_trigger_component.rb +72 -0
- data/app/view_components/ui/progress_component.rb +39 -0
- data/app/view_components/ui/radio_button_component.rb +56 -0
- data/app/view_components/ui/resizable_handle_component.rb +35 -0
- data/app/view_components/ui/resizable_panel_component.rb +39 -0
- data/app/view_components/ui/resizable_panel_group_component.rb +45 -0
- data/app/view_components/ui/responsive_dialog_component.rb +81 -0
- data/app/view_components/ui/scroll_area_component.rb +46 -0
- data/app/view_components/ui/scroll_area_corner_component.rb +22 -0
- data/app/view_components/ui/scroll_area_scrollbar_component.rb +35 -0
- data/app/view_components/ui/scroll_area_thumb_component.rb +29 -0
- data/app/view_components/ui/scroll_area_viewport_component.rb +32 -0
- data/app/view_components/ui/select_component.rb +31 -0
- data/app/view_components/ui/select_content_component.rb +41 -0
- data/app/view_components/ui/select_group_component.rb +26 -0
- data/app/view_components/ui/select_item_component.rb +45 -0
- data/app/view_components/ui/select_label_component.rb +22 -0
- data/app/view_components/ui/select_scroll_down_button_component.rb +35 -0
- data/app/view_components/ui/select_scroll_up_button_component.rb +35 -0
- data/app/view_components/ui/select_trigger_component.rb +27 -0
- data/app/view_components/ui/separator_component.rb +27 -0
- data/app/view_components/ui/sheet_close_component.rb +71 -0
- data/app/view_components/ui/sheet_component.rb +50 -0
- data/app/view_components/ui/sheet_content_component.rb +52 -0
- data/app/view_components/ui/sheet_description_component.rb +25 -0
- data/app/view_components/ui/sheet_footer_component.rb +21 -0
- data/app/view_components/ui/sheet_header_component.rb +21 -0
- data/app/view_components/ui/sheet_overlay_component.rb +36 -0
- data/app/view_components/ui/sheet_title_component.rb +25 -0
- data/app/view_components/ui/sheet_trigger_component.rb +60 -0
- data/app/view_components/ui/skeleton_component.rb +30 -0
- data/app/view_components/ui/slider_component.rb +61 -0
- data/app/view_components/ui/slider_range_component.rb +24 -0
- data/app/view_components/ui/slider_thumb_component.rb +30 -0
- data/app/view_components/ui/slider_track_component.rb +28 -0
- data/app/view_components/ui/small_component.rb +18 -0
- data/app/view_components/ui/sonner_toaster_component.rb +53 -0
- data/app/view_components/ui/spinner_component.rb +48 -0
- data/app/view_components/ui/switch_component.rb +55 -0
- data/app/view_components/ui/table_body_component.rb +21 -0
- data/app/view_components/ui/table_caption_component.rb +14 -0
- data/app/view_components/ui/table_cell_component.rb +14 -0
- data/app/view_components/ui/table_component.rb +27 -0
- data/app/view_components/ui/table_footer_component.rb +21 -0
- data/app/view_components/ui/table_head_component.rb +14 -0
- data/app/view_components/ui/table_header_component.rb +21 -0
- data/app/view_components/ui/table_row_component.rb +23 -0
- data/app/view_components/ui/tabs_component.rb +39 -0
- data/app/view_components/ui/tabs_content_component.rb +34 -0
- data/app/view_components/ui/tabs_list_component.rb +30 -0
- data/app/view_components/ui/tabs_trigger_component.rb +37 -0
- data/app/view_components/ui/textarea_component.rb +18 -0
- data/app/view_components/ui/toggle_component.rb +48 -0
- data/app/view_components/ui/toggle_group_component.rb +68 -0
- data/app/view_components/ui/toggle_group_item_component.rb +72 -0
- data/app/view_components/ui/tooltip_component.rb +19 -0
- data/app/view_components/ui/tooltip_content_component.rb +28 -0
- data/app/view_components/ui/tooltip_trigger_component.rb +25 -0
- data/app/views/layouts/ui/application.html.erb +21 -0
- data/app/views/ui/_accordion.html.erb +17 -0
- data/app/views/ui/_alert.html.erb +22 -0
- data/app/views/ui/_aspect_ratio.html.erb +18 -0
- data/app/views/ui/_avatar.html.erb +13 -0
- data/app/views/ui/_badge.html.erb +18 -0
- data/app/views/ui/_blockquote.html.erb +19 -0
- data/app/views/ui/_breadcrumb.html.erb +14 -0
- data/app/views/ui/_button.html.erb +38 -0
- data/app/views/ui/_button_group.html.erb +17 -0
- data/app/views/ui/_calendar.html.erb +172 -0
- data/app/views/ui/_card.html.erb +18 -0
- data/app/views/ui/_carousel.html.erb +17 -0
- data/app/views/ui/_checkbox.html.erb +32 -0
- data/app/views/ui/_collapsible.html.erb +23 -0
- data/app/views/ui/_command.html.erb +19 -0
- data/app/views/ui/_context_menu.html.erb +21 -0
- data/app/views/ui/_date_picker.html.erb +93 -0
- data/app/views/ui/_dialog.html.erb +18 -0
- data/app/views/ui/_drawer.html.erb +25 -0
- data/app/views/ui/_dropdown_menu.html.erb +40 -0
- data/app/views/ui/_empty.html.erb +13 -0
- data/app/views/ui/_field.html.erb +15 -0
- data/app/views/ui/_h1.html.erb +19 -0
- data/app/views/ui/_h2.html.erb +19 -0
- data/app/views/ui/_h3.html.erb +19 -0
- data/app/views/ui/_h4.html.erb +19 -0
- data/app/views/ui/_hover_card.html.erb +14 -0
- data/app/views/ui/_inline_code.html.erb +19 -0
- data/app/views/ui/_input.html.erb +18 -0
- data/app/views/ui/_input_group.html.erb +14 -0
- data/app/views/ui/_input_otp.html.erb +44 -0
- data/app/views/ui/_item.html.erb +9 -0
- data/app/views/ui/_kbd.html.erb +15 -0
- data/app/views/ui/_label.html.erb +16 -0
- data/app/views/ui/_large.html.erb +19 -0
- data/app/views/ui/_lead.html.erb +19 -0
- data/app/views/ui/_list.html.erb +19 -0
- data/app/views/ui/_menubar.html.erb +25 -0
- data/app/views/ui/_muted.html.erb +19 -0
- data/app/views/ui/_navigation_menu.html.erb +34 -0
- data/app/views/ui/_p.html.erb +19 -0
- data/app/views/ui/_pagination.html.erb +14 -0
- data/app/views/ui/_popover.html.erb +19 -0
- data/app/views/ui/_progress.html.erb +15 -0
- data/app/views/ui/_radio_button.html.erb +34 -0
- data/app/views/ui/_responsive_dialog.html.erb +44 -0
- data/app/views/ui/_scroll_area.html.erb +60 -0
- data/app/views/ui/_select.html.erb +17 -0
- data/app/views/ui/_separator.html.erb +20 -0
- data/app/views/ui/_sheet.html.erb +18 -0
- data/app/views/ui/_skeleton.html.erb +19 -0
- data/app/views/ui/_slider.html.erb +27 -0
- data/app/views/ui/_small.html.erb +19 -0
- data/app/views/ui/_spinner.html.erb +28 -0
- data/app/views/ui/_switch.html.erb +45 -0
- data/app/views/ui/_table.html.erb +18 -0
- data/app/views/ui/_tabs.html.erb +23 -0
- data/app/views/ui/_textarea.html.erb +16 -0
- data/app/views/ui/_toggle.html.erb +27 -0
- data/app/views/ui/_toggle_group.html.erb +38 -0
- data/app/views/ui/_tooltip.html.erb +13 -0
- data/app/views/ui/accordion/_content.html.erb +21 -0
- data/app/views/ui/accordion/_item.html.erb +21 -0
- data/app/views/ui/accordion/_trigger.html.erb +23 -0
- data/app/views/ui/alert/_description.html.erb +13 -0
- data/app/views/ui/alert/_title.html.erb +13 -0
- data/app/views/ui/avatar/_fallback.html.erb +13 -0
- data/app/views/ui/avatar/_image.html.erb +18 -0
- data/app/views/ui/breadcrumb/_ellipsis.html.erb +26 -0
- data/app/views/ui/breadcrumb/_item.html.erb +14 -0
- data/app/views/ui/breadcrumb/_link.html.erb +16 -0
- data/app/views/ui/breadcrumb/_list.html.erb +14 -0
- data/app/views/ui/breadcrumb/_page.html.erb +15 -0
- data/app/views/ui/breadcrumb/_separator.html.erb +23 -0
- data/app/views/ui/button_group/_separator.html.erb +19 -0
- data/app/views/ui/button_group/_text.html.erb +16 -0
- data/app/views/ui/card/_action.html.erb +18 -0
- data/app/views/ui/card/_content.html.erb +18 -0
- data/app/views/ui/card/_description.html.erb +20 -0
- data/app/views/ui/card/_footer.html.erb +18 -0
- data/app/views/ui/card/_header.html.erb +18 -0
- data/app/views/ui/card/_title.html.erb +20 -0
- data/app/views/ui/carousel/_content.html.erb +16 -0
- data/app/views/ui/carousel/_item.html.erb +14 -0
- data/app/views/ui/carousel/_next.html.erb +13 -0
- data/app/views/ui/carousel/_previous.html.erb +13 -0
- data/app/views/ui/collapsible/_content.html.erb +20 -0
- data/app/views/ui/collapsible/_trigger.html.erb +18 -0
- data/app/views/ui/combobox/_wrapper.html.erb +43 -0
- data/app/views/ui/command/_dialog.html.erb +17 -0
- data/app/views/ui/command/_empty.html.erb +19 -0
- data/app/views/ui/command/_group.html.erb +23 -0
- data/app/views/ui/command/_input.html.erb +20 -0
- data/app/views/ui/command/_item.html.erb +21 -0
- data/app/views/ui/command/_list.html.erb +17 -0
- data/app/views/ui/command/_separator.html.erb +15 -0
- data/app/views/ui/command/_shortcut.html.erb +19 -0
- data/app/views/ui/context_menu/_checkbox_item.html.erb +23 -0
- data/app/views/ui/context_menu/_content.html.erb +15 -0
- data/app/views/ui/context_menu/_item.html.erb +19 -0
- data/app/views/ui/context_menu/_label.html.erb +16 -0
- data/app/views/ui/context_menu/_radio_group.html.erb +14 -0
- data/app/views/ui/context_menu/_radio_item.html.erb +23 -0
- data/app/views/ui/context_menu/_separator.html.erb +12 -0
- data/app/views/ui/context_menu/_shortcut.html.erb +15 -0
- data/app/views/ui/context_menu/_trigger.html.erb +14 -0
- data/app/views/ui/date_picker/_input.html.erb +47 -0
- data/app/views/ui/date_picker/_trigger.html.erb +53 -0
- data/app/views/ui/dialog/_close.html.erb +24 -0
- data/app/views/ui/dialog/_content.html.erb +22 -0
- data/app/views/ui/dialog/_description.html.erb +14 -0
- data/app/views/ui/dialog/_footer.html.erb +14 -0
- data/app/views/ui/dialog/_header.html.erb +14 -0
- data/app/views/ui/dialog/_overlay.html.erb +19 -0
- data/app/views/ui/dialog/_title.html.erb +14 -0
- data/app/views/ui/dialog/_trigger.html.erb +24 -0
- data/app/views/ui/drawer/_close.html.erb +17 -0
- data/app/views/ui/drawer/_content.html.erb +31 -0
- data/app/views/ui/drawer/_description.html.erb +15 -0
- data/app/views/ui/drawer/_footer.html.erb +15 -0
- data/app/views/ui/drawer/_handle.html.erb +12 -0
- data/app/views/ui/drawer/_header.html.erb +15 -0
- data/app/views/ui/drawer/_overlay.html.erb +16 -0
- data/app/views/ui/drawer/_title.html.erb +15 -0
- data/app/views/ui/drawer/_trigger.html.erb +25 -0
- data/app/views/ui/dropdown_menu/_checkbox_item.html.erb +24 -0
- data/app/views/ui/dropdown_menu/_content.html.erb +15 -0
- data/app/views/ui/dropdown_menu/_item.html.erb +24 -0
- data/app/views/ui/dropdown_menu/_label.html.erb +16 -0
- data/app/views/ui/dropdown_menu/_radio_group.html.erb +15 -0
- data/app/views/ui/dropdown_menu/_radio_item.html.erb +27 -0
- data/app/views/ui/dropdown_menu/_separator.html.erb +12 -0
- data/app/views/ui/dropdown_menu/_shortcut.html.erb +15 -0
- data/app/views/ui/dropdown_menu/_sub.html.erb +14 -0
- data/app/views/ui/dropdown_menu/_sub_content.html.erb +17 -0
- data/app/views/ui/dropdown_menu/_sub_trigger.html.erb +17 -0
- data/app/views/ui/dropdown_menu/_trigger.html.erb +20 -0
- data/app/views/ui/empty/_content.html.erb +13 -0
- data/app/views/ui/empty/_description.html.erb +13 -0
- data/app/views/ui/empty/_header.html.erb +13 -0
- data/app/views/ui/empty/_media.html.erb +14 -0
- data/app/views/ui/empty/_title.html.erb +13 -0
- data/app/views/ui/field/_content.html.erb +14 -0
- data/app/views/ui/field/_description.html.erb +15 -0
- data/app/views/ui/field/_error.html.erb +15 -0
- data/app/views/ui/field/_group.html.erb +14 -0
- data/app/views/ui/field/_label.html.erb +15 -0
- data/app/views/ui/field/_legend.html.erb +16 -0
- data/app/views/ui/field/_separator.html.erb +15 -0
- data/app/views/ui/field/_set.html.erb +14 -0
- data/app/views/ui/field/_title.html.erb +15 -0
- data/app/views/ui/hover_card/_content.html.erb +16 -0
- data/app/views/ui/hover_card/_trigger.html.erb +27 -0
- data/app/views/ui/input_group/_addon.html.erb +15 -0
- data/app/views/ui/input_group/_button.html.erb +18 -0
- data/app/views/ui/input_group/_input.html.erb +17 -0
- data/app/views/ui/input_group/_text.html.erb +15 -0
- data/app/views/ui/input_group/_textarea.html.erb +17 -0
- data/app/views/ui/input_otp/_group.html.erb +20 -0
- data/app/views/ui/input_otp/_separator.html.erb +22 -0
- data/app/views/ui/input_otp/_slot.html.erb +28 -0
- data/app/views/ui/item/_actions.html.erb +7 -0
- data/app/views/ui/item/_content.html.erb +7 -0
- data/app/views/ui/item/_description.html.erb +7 -0
- data/app/views/ui/item/_footer.html.erb +7 -0
- data/app/views/ui/item/_group.html.erb +7 -0
- data/app/views/ui/item/_header.html.erb +7 -0
- data/app/views/ui/item/_media.html.erb +8 -0
- data/app/views/ui/item/_separator.html.erb +5 -0
- data/app/views/ui/item/_title.html.erb +7 -0
- data/app/views/ui/kbd/_group.html.erb +14 -0
- data/app/views/ui/menubar/_checkbox_item.html.erb +24 -0
- data/app/views/ui/menubar/_content.html.erb +18 -0
- data/app/views/ui/menubar/_item.html.erb +24 -0
- data/app/views/ui/menubar/_label.html.erb +16 -0
- data/app/views/ui/menubar/_menu.html.erb +14 -0
- data/app/views/ui/menubar/_radio_group.html.erb +16 -0
- data/app/views/ui/menubar/_radio_item.html.erb +25 -0
- data/app/views/ui/menubar/_separator.html.erb +12 -0
- data/app/views/ui/menubar/_shortcut.html.erb +15 -0
- data/app/views/ui/menubar/_sub.html.erb +15 -0
- data/app/views/ui/menubar/_sub_content.html.erb +15 -0
- data/app/views/ui/menubar/_sub_trigger.html.erb +20 -0
- data/app/views/ui/menubar/_trigger.html.erb +15 -0
- data/app/views/ui/navigation_menu/_content.html.erb +13 -0
- data/app/views/ui/navigation_menu/_item.html.erb +13 -0
- data/app/views/ui/navigation_menu/_link.html.erb +33 -0
- data/app/views/ui/navigation_menu/_list.html.erb +12 -0
- data/app/views/ui/navigation_menu/_trigger.html.erb +30 -0
- data/app/views/ui/navigation_menu/_viewport.html.erb +13 -0
- data/app/views/ui/pagination/_content.html.erb +14 -0
- data/app/views/ui/pagination/_ellipsis.html.erb +19 -0
- data/app/views/ui/pagination/_item.html.erb +14 -0
- data/app/views/ui/pagination/_link.html.erb +18 -0
- data/app/views/ui/pagination/_next.html.erb +19 -0
- data/app/views/ui/pagination/_previous.html.erb +19 -0
- data/app/views/ui/popover/_content.html.erb +14 -0
- data/app/views/ui/popover/_trigger.html.erb +15 -0
- data/app/views/ui/resizable/_handle.html.erb +22 -0
- data/app/views/ui/resizable/_panel.html.erb +21 -0
- data/app/views/ui/resizable/_panel_group.html.erb +20 -0
- data/app/views/ui/scroll_area/_corner.html.erb +40 -0
- data/app/views/ui/scroll_area/_scrollbar.html.erb +50 -0
- data/app/views/ui/scroll_area/_thumb.html.erb +44 -0
- data/app/views/ui/scroll_area/_viewport.html.erb +47 -0
- data/app/views/ui/select/_content.html.erb +25 -0
- data/app/views/ui/select/_group.html.erb +42 -0
- data/app/views/ui/select/_item.html.erb +48 -0
- data/app/views/ui/select/_label.html.erb +42 -0
- data/app/views/ui/select/_scroll_down_button.html.erb +44 -0
- data/app/views/ui/select/_scroll_up_button.html.erb +44 -0
- data/app/views/ui/select/_trigger.html.erb +43 -0
- data/app/views/ui/sheet/_close.html.erb +24 -0
- data/app/views/ui/sheet/_content.html.erb +30 -0
- data/app/views/ui/sheet/_description.html.erb +14 -0
- data/app/views/ui/sheet/_footer.html.erb +14 -0
- data/app/views/ui/sheet/_header.html.erb +14 -0
- data/app/views/ui/sheet/_overlay.html.erb +19 -0
- data/app/views/ui/sheet/_title.html.erb +14 -0
- data/app/views/ui/sheet/_trigger.html.erb +21 -0
- data/app/views/ui/slider/_range.html.erb +13 -0
- data/app/views/ui/slider/_thumb.html.erb +14 -0
- data/app/views/ui/slider/_track.html.erb +16 -0
- data/app/views/ui/sonner/_toaster.html.erb +38 -0
- data/app/views/ui/table/_body.html.erb +18 -0
- data/app/views/ui/table/_caption.html.erb +18 -0
- data/app/views/ui/table/_cell.html.erb +18 -0
- data/app/views/ui/table/_footer.html.erb +18 -0
- data/app/views/ui/table/_head.html.erb +18 -0
- data/app/views/ui/table/_header.html.erb +18 -0
- data/app/views/ui/table/_row.html.erb +18 -0
- data/app/views/ui/tabs/_content.html.erb +19 -0
- data/app/views/ui/tabs/_list.html.erb +16 -0
- data/app/views/ui/tabs/_trigger.html.erb +20 -0
- data/app/views/ui/toggle_group/_item.html.erb +51 -0
- data/app/views/ui/tooltip/_content.html.erb +17 -0
- data/app/views/ui/tooltip/_trigger.html.erb +39 -0
- data/config/importmap.rb +6 -0
- data/config/routes.rb +3 -0
- data/lib/fernandes-ui.rb +12 -0
- data/lib/generators/ui/install/install_generator.rb +141 -0
- data/lib/generators/ui/install/templates/Procfile.dev +2 -0
- data/lib/generators/ui/install/templates/application.tailwind.css +32 -0
- data/lib/generators/ui/install/templates/package.json +13 -0
- data/lib/tasks/ui_tasks.rake +4 -0
- data/lib/ui/configuration.rb +54 -0
- data/lib/ui/engine.rb +158 -0
- data/lib/ui/version.rb +3 -0
- data/lib/ui.rb +8 -0
- metadata +1214 -0
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
|
|
3
|
+
export default class extends Controller {
|
|
4
|
+
static values = {
|
|
5
|
+
position: { type: String, default: "bottom-right" },
|
|
6
|
+
theme: { type: String, default: "system" },
|
|
7
|
+
richColors: { type: Boolean, default: false },
|
|
8
|
+
expand: { type: Boolean, default: false },
|
|
9
|
+
duration: { type: Number, default: 4000 },
|
|
10
|
+
closeButton: { type: Boolean, default: false },
|
|
11
|
+
visibleToasts: { type: Number, default: 3 },
|
|
12
|
+
gap: { type: Number, default: 14 },
|
|
13
|
+
offset: { type: Number, default: 16 }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
connect() {
|
|
17
|
+
this.toasts = []
|
|
18
|
+
this.toastId = 0
|
|
19
|
+
this.isHovered = false
|
|
20
|
+
this.lastCloseTimestamp = 0
|
|
21
|
+
this.setupContainer()
|
|
22
|
+
this.setupEventListeners()
|
|
23
|
+
this.setupHoverListeners()
|
|
24
|
+
this.detectTheme()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
setupContainer() {
|
|
28
|
+
const [yPos, xPos] = this.positionValue.split("-")
|
|
29
|
+
this.element.setAttribute("data-sonner-toaster", "")
|
|
30
|
+
this.element.setAttribute("data-y-position", yPos)
|
|
31
|
+
this.element.setAttribute("data-x-position", xPos)
|
|
32
|
+
this.element.setAttribute("dir", "ltr")
|
|
33
|
+
this.element.style.setProperty("--width", "356px")
|
|
34
|
+
this.element.style.setProperty("--gap", `${this.gapValue}px`)
|
|
35
|
+
this.element.style.setProperty("--offset-top", `${this.offsetValue}px`)
|
|
36
|
+
this.element.style.setProperty("--offset-bottom", `${this.offsetValue}px`)
|
|
37
|
+
this.element.style.setProperty("--offset-left", `${this.offsetValue}px`)
|
|
38
|
+
this.element.style.setProperty("--offset-right", `${this.offsetValue}px`)
|
|
39
|
+
// Mobile offsets
|
|
40
|
+
this.element.style.setProperty("--mobile-offset-top", `${this.offsetValue}px`)
|
|
41
|
+
this.element.style.setProperty("--mobile-offset-bottom", `${this.offsetValue}px`)
|
|
42
|
+
this.element.style.setProperty("--mobile-offset-left", `${this.offsetValue}px`)
|
|
43
|
+
this.element.style.setProperty("--mobile-offset-right", `${this.offsetValue}px`)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
detectTheme() {
|
|
47
|
+
let theme = this.themeValue
|
|
48
|
+
if (theme === "system") {
|
|
49
|
+
theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"
|
|
50
|
+
}
|
|
51
|
+
this.element.setAttribute("data-sonner-theme", theme)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
setupHoverListeners() {
|
|
55
|
+
this.boundHandleMouseEnter = this.handleMouseEnter.bind(this)
|
|
56
|
+
this.boundHandleMouseLeave = this.handleMouseLeave.bind(this)
|
|
57
|
+
this.element.addEventListener("mouseenter", this.boundHandleMouseEnter)
|
|
58
|
+
this.element.addEventListener("mouseleave", this.boundHandleMouseLeave)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
handleMouseEnter() {
|
|
62
|
+
this.isHovered = true
|
|
63
|
+
this.expandToasts()
|
|
64
|
+
this.pauseAllTimers()
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
handleMouseLeave() {
|
|
68
|
+
this.isHovered = false
|
|
69
|
+
this.collapseToasts()
|
|
70
|
+
this.resumeAllTimers()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
expandToasts() {
|
|
74
|
+
this.toasts.forEach(t => {
|
|
75
|
+
t.element.setAttribute("data-expanded", "true")
|
|
76
|
+
})
|
|
77
|
+
this.updateToastPositions()
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
collapseToasts() {
|
|
81
|
+
this.toasts.forEach(t => {
|
|
82
|
+
t.element.setAttribute("data-expanded", "false")
|
|
83
|
+
})
|
|
84
|
+
this.updateToastPositions()
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
pauseAllTimers() {
|
|
88
|
+
const now = Date.now()
|
|
89
|
+
this.toasts.forEach(t => {
|
|
90
|
+
if (t.timerId) {
|
|
91
|
+
clearTimeout(t.timerId)
|
|
92
|
+
t.timerId = null
|
|
93
|
+
// Calculate remaining time
|
|
94
|
+
t.remainingTime = Math.max(0, t.dismissAt - now)
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
resumeAllTimers() {
|
|
100
|
+
const now = Date.now()
|
|
101
|
+
this.toasts.forEach(t => {
|
|
102
|
+
if (t.remainingTime !== undefined && t.remainingTime > 0) {
|
|
103
|
+
t.dismissAt = now + t.remainingTime
|
|
104
|
+
t.timerId = setTimeout(() => this.dismiss(t.id), t.remainingTime)
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Core toast creation
|
|
110
|
+
show(message, options = {}) {
|
|
111
|
+
const id = ++this.toastId
|
|
112
|
+
const toast = this.createToastElement(id, message, options)
|
|
113
|
+
|
|
114
|
+
this.element.appendChild(toast)
|
|
115
|
+
|
|
116
|
+
// Store height as null initially, will be set after first render
|
|
117
|
+
const toastData = { id, element: toast, options, timerId: null, dismissAt: null, remainingTime: null, height: null }
|
|
118
|
+
this.toasts.push(toastData)
|
|
119
|
+
this.updateToastPositions()
|
|
120
|
+
|
|
121
|
+
// Trigger mount animation after a frame and capture height
|
|
122
|
+
requestAnimationFrame(() => {
|
|
123
|
+
const height = toast.getBoundingClientRect().height
|
|
124
|
+
// Store the original height permanently in the toast data
|
|
125
|
+
toastData.height = height
|
|
126
|
+
toast.style.setProperty("--initial-height", `${height}px`)
|
|
127
|
+
this.element.style.setProperty("--front-toast-height", `${height}px`)
|
|
128
|
+
toast.setAttribute("data-mounted", "true")
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
// Auto-dismiss (only if not hovered)
|
|
132
|
+
const duration = options.duration ?? this.durationValue
|
|
133
|
+
if (duration !== Infinity) {
|
|
134
|
+
if (!this.isHovered) {
|
|
135
|
+
toastData.dismissAt = Date.now() + duration
|
|
136
|
+
toastData.timerId = setTimeout(() => this.dismiss(id), duration)
|
|
137
|
+
} else {
|
|
138
|
+
// Store the duration for when hover ends
|
|
139
|
+
toastData.remainingTime = duration
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return id
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
createToastElement(id, message, options) {
|
|
147
|
+
const [yPos, xPos] = this.positionValue.split("-")
|
|
148
|
+
const toast = document.createElement("li")
|
|
149
|
+
toast.setAttribute("data-sonner-toast", "")
|
|
150
|
+
toast.setAttribute("data-styled", "true")
|
|
151
|
+
toast.setAttribute("data-y-position", yPos)
|
|
152
|
+
toast.setAttribute("data-x-position", xPos)
|
|
153
|
+
toast.setAttribute("data-front", "true")
|
|
154
|
+
toast.setAttribute("data-visible", "true")
|
|
155
|
+
toast.setAttribute("data-swipe-out", "false")
|
|
156
|
+
// Start expanded if hovered, otherwise collapsed
|
|
157
|
+
toast.setAttribute("data-expanded", this.isHovered || this.expandValue ? "true" : "false")
|
|
158
|
+
if (options.type) toast.setAttribute("data-type", options.type)
|
|
159
|
+
if (this.richColorsValue) toast.setAttribute("data-rich-colors", "true")
|
|
160
|
+
|
|
161
|
+
// Build inner HTML
|
|
162
|
+
let html = ""
|
|
163
|
+
|
|
164
|
+
// Icon (if type)
|
|
165
|
+
if (options.type) {
|
|
166
|
+
html += `<div data-icon>${this.getIcon(options.type)}</div>`
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Content
|
|
170
|
+
html += `<div data-content>`
|
|
171
|
+
html += `<div data-title>${this.escapeHtml(message)}</div>`
|
|
172
|
+
if (options.description) {
|
|
173
|
+
html += `<div data-description>${this.escapeHtml(options.description)}</div>`
|
|
174
|
+
}
|
|
175
|
+
html += `</div>`
|
|
176
|
+
|
|
177
|
+
// Action button
|
|
178
|
+
if (options.action) {
|
|
179
|
+
html += `<button data-button>${this.escapeHtml(options.action.label)}</button>`
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Close button
|
|
183
|
+
if (this.closeButtonValue || options.closeButton) {
|
|
184
|
+
html += `<button data-close-button aria-label="Close toast"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button>`
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
toast.innerHTML = html
|
|
188
|
+
|
|
189
|
+
// Event listeners
|
|
190
|
+
const actionBtn = toast.querySelector("[data-button]")
|
|
191
|
+
if (actionBtn && options.action) {
|
|
192
|
+
actionBtn.addEventListener("click", () => {
|
|
193
|
+
if (options.action.onClick) {
|
|
194
|
+
options.action.onClick()
|
|
195
|
+
}
|
|
196
|
+
if (options.action.event) {
|
|
197
|
+
document.dispatchEvent(new CustomEvent(options.action.event, { detail: options.action.data }))
|
|
198
|
+
}
|
|
199
|
+
this.dismiss(id)
|
|
200
|
+
})
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const closeBtn = toast.querySelector("[data-close-button]")
|
|
204
|
+
if (closeBtn) {
|
|
205
|
+
closeBtn.addEventListener("click", () => this.dismiss(id))
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Add hover listeners to individual toasts for expand/collapse
|
|
209
|
+
toast.addEventListener("mouseenter", () => this.handleMouseEnter())
|
|
210
|
+
toast.addEventListener("mouseleave", (e) => {
|
|
211
|
+
// Only trigger leave if we're not moving to another toast or the toaster
|
|
212
|
+
const relatedTarget = e.relatedTarget
|
|
213
|
+
if (!relatedTarget || (!relatedTarget.closest('[data-sonner-toast]') && !relatedTarget.closest('[data-sonner-toaster]'))) {
|
|
214
|
+
this.handleMouseLeave()
|
|
215
|
+
}
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
return toast
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
escapeHtml(text) {
|
|
222
|
+
const div = document.createElement("div")
|
|
223
|
+
div.textContent = text
|
|
224
|
+
return div.innerHTML
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
getIcon(type) {
|
|
228
|
+
const icons = {
|
|
229
|
+
success: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>`,
|
|
230
|
+
error: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>`,
|
|
231
|
+
info: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>`,
|
|
232
|
+
warning: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>`,
|
|
233
|
+
loading: `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="animate-spin"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>`
|
|
234
|
+
}
|
|
235
|
+
return icons[type] || ""
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
updateToastPositions() {
|
|
239
|
+
const visible = this.toasts.slice(-this.visibleToastsValue)
|
|
240
|
+
const totalToasts = this.toasts.length
|
|
241
|
+
const isExpanded = this.isHovered || this.expandValue
|
|
242
|
+
|
|
243
|
+
// Use stored heights (or fallback to getBoundingClientRect for toasts not yet measured)
|
|
244
|
+
const heights = this.toasts.map(t => t.height || t.element.getBoundingClientRect().height || 50)
|
|
245
|
+
|
|
246
|
+
// For expanded mode, calculate offsets from front (most recent) to back
|
|
247
|
+
// Front toast (most recent) has offset 0, older toasts stack above it
|
|
248
|
+
let heightOffset = 0
|
|
249
|
+
|
|
250
|
+
// Process from front (newest) to back (oldest)
|
|
251
|
+
for (let i = totalToasts - 1; i >= 0; i--) {
|
|
252
|
+
const t = this.toasts[i]
|
|
253
|
+
const isVisible = visible.includes(t)
|
|
254
|
+
const isFront = i === totalToasts - 1
|
|
255
|
+
const toastsBefore = totalToasts - 1 - i
|
|
256
|
+
|
|
257
|
+
t.element.setAttribute("data-visible", isVisible ? "true" : "false")
|
|
258
|
+
t.element.setAttribute("data-front", isFront ? "true" : "false")
|
|
259
|
+
t.element.setAttribute("data-expanded", isExpanded ? "true" : "false")
|
|
260
|
+
t.element.style.setProperty("--z-index", i + 1)
|
|
261
|
+
t.element.style.setProperty("--toasts-before", toastsBefore)
|
|
262
|
+
// Only set --initial-height if we have a stored height (preserve original height)
|
|
263
|
+
if (t.height) {
|
|
264
|
+
t.element.style.setProperty("--initial-height", `${t.height}px`)
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
if (isExpanded) {
|
|
268
|
+
// In expanded mode: front toast at offset 0, older toasts stack above
|
|
269
|
+
t.element.style.setProperty("--offset", `${heightOffset}px`)
|
|
270
|
+
if (isVisible) {
|
|
271
|
+
heightOffset += heights[i] + this.gapValue
|
|
272
|
+
}
|
|
273
|
+
} else {
|
|
274
|
+
// In collapsed mode, use toastsBefore for slight visual offset
|
|
275
|
+
t.element.style.setProperty("--offset", `${toastsBefore * this.gapValue}px`)
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// Set front toast height for stacking calculations
|
|
280
|
+
if (totalToasts > 0) {
|
|
281
|
+
this.element.style.setProperty("--front-toast-height", `${heights[totalToasts - 1]}px`)
|
|
282
|
+
|
|
283
|
+
// Calculate total height for the toaster container (for hover detection)
|
|
284
|
+
const visibleCount = Math.min(totalToasts, this.visibleToastsValue)
|
|
285
|
+
let totalHeight = 0
|
|
286
|
+
if (isExpanded) {
|
|
287
|
+
// Sum all visible toast heights + gaps
|
|
288
|
+
for (let i = totalToasts - 1; i >= totalToasts - visibleCount; i--) {
|
|
289
|
+
totalHeight += heights[i] + this.gapValue
|
|
290
|
+
}
|
|
291
|
+
totalHeight -= this.gapValue // Remove last gap
|
|
292
|
+
} else {
|
|
293
|
+
// Collapsed: front toast height + small offset for stacked appearance
|
|
294
|
+
totalHeight = heights[totalToasts - 1] + (visibleCount - 1) * this.gapValue
|
|
295
|
+
}
|
|
296
|
+
this.element.style.height = `${totalHeight}px`
|
|
297
|
+
} else {
|
|
298
|
+
this.element.style.height = '0'
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
dismiss(id) {
|
|
303
|
+
const index = this.toasts.findIndex(t => t.id === id)
|
|
304
|
+
if (index === -1) return
|
|
305
|
+
|
|
306
|
+
const toast = this.toasts[index]
|
|
307
|
+
|
|
308
|
+
// Clear any pending timer
|
|
309
|
+
if (toast.timerId) {
|
|
310
|
+
clearTimeout(toast.timerId)
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
toast.element.setAttribute("data-removed", "true")
|
|
314
|
+
toast.element.setAttribute("data-front", "true")
|
|
315
|
+
|
|
316
|
+
setTimeout(() => {
|
|
317
|
+
toast.element.remove()
|
|
318
|
+
// Find current index again as array may have changed during animation
|
|
319
|
+
const currentIndex = this.toasts.findIndex(t => t.id === id)
|
|
320
|
+
if (currentIndex !== -1) {
|
|
321
|
+
this.toasts.splice(currentIndex, 1)
|
|
322
|
+
}
|
|
323
|
+
this.updateToastPositions()
|
|
324
|
+
}, 400) // Match CSS transition duration
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
dismissAll() {
|
|
328
|
+
const ids = this.toasts.map(t => t.id)
|
|
329
|
+
ids.forEach(id => this.dismiss(id))
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// Public API methods - triggered via Stimulus actions
|
|
333
|
+
default(event) {
|
|
334
|
+
const { message, description, duration } = event.params || {}
|
|
335
|
+
if (message) {
|
|
336
|
+
this.show(message, { description, duration })
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
success(event) {
|
|
341
|
+
const { message, description, duration } = event.params || {}
|
|
342
|
+
if (message) {
|
|
343
|
+
this.show(message, { type: "success", description, duration })
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
error(event) {
|
|
348
|
+
const { message, description, duration } = event.params || {}
|
|
349
|
+
if (message) {
|
|
350
|
+
this.show(message, { type: "error", description, duration })
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
info(event) {
|
|
355
|
+
const { message, description, duration } = event.params || {}
|
|
356
|
+
if (message) {
|
|
357
|
+
this.show(message, { type: "info", description, duration })
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
warning(event) {
|
|
362
|
+
const { message, description, duration } = event.params || {}
|
|
363
|
+
if (message) {
|
|
364
|
+
this.show(message, { type: "warning", description, duration })
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// Global event listener for triggering toasts from anywhere
|
|
369
|
+
setupEventListeners() {
|
|
370
|
+
this.boundHandleToast = this.handleToast.bind(this)
|
|
371
|
+
document.addEventListener("ui:toast", this.boundHandleToast)
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
handleToast(event) {
|
|
375
|
+
const detail = event.detail || {}
|
|
376
|
+
const { type, message, description, duration, action, closeButton } = detail
|
|
377
|
+
// Only create toast if message is a non-empty string
|
|
378
|
+
if (message && typeof message === 'string' && message.trim()) {
|
|
379
|
+
this.show(message.trim(), { type, description, duration, action, closeButton })
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
disconnect() {
|
|
384
|
+
document.removeEventListener("ui:toast", this.boundHandleToast)
|
|
385
|
+
this.element.removeEventListener("mouseenter", this.boundHandleMouseEnter)
|
|
386
|
+
this.element.removeEventListener("mouseleave", this.boundHandleMouseLeave)
|
|
387
|
+
|
|
388
|
+
// Clear all timers
|
|
389
|
+
this.toasts.forEach(t => {
|
|
390
|
+
if (t.timerId) clearTimeout(t.timerId)
|
|
391
|
+
})
|
|
392
|
+
}
|
|
393
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
import { syncCheckedState } from "../utils/state-manager.js"
|
|
3
|
+
|
|
4
|
+
// Switch controller for toggle switches
|
|
5
|
+
//
|
|
6
|
+
// Manages the state and interactions for a binary toggle switch component.
|
|
7
|
+
// Implements Radix UI Switch behavior with keyboard support (Space/Enter).
|
|
8
|
+
//
|
|
9
|
+
// Targets:
|
|
10
|
+
// thumb - The circular thumb element that moves on toggle
|
|
11
|
+
//
|
|
12
|
+
// Values:
|
|
13
|
+
// checked - Boolean state of the switch
|
|
14
|
+
//
|
|
15
|
+
// Actions:
|
|
16
|
+
// click->ui--switch#toggle - Toggle the switch state
|
|
17
|
+
//
|
|
18
|
+
// Events:
|
|
19
|
+
// change - Dispatched when switch state changes (bubbles for form integration)
|
|
20
|
+
//
|
|
21
|
+
// Example:
|
|
22
|
+
// <button data-controller="ui--switch" data-ui--switch-checked-value="false">
|
|
23
|
+
// <span data-ui--switch-target="thumb"></span>
|
|
24
|
+
// </button>
|
|
25
|
+
export default class extends Controller {
|
|
26
|
+
static targets = ["thumb"]
|
|
27
|
+
static values = {
|
|
28
|
+
checked: { type: Boolean, default: false }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
connect() {
|
|
32
|
+
this.updateState(this.checkedValue, false)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
toggle(event) {
|
|
36
|
+
if (event) {
|
|
37
|
+
event.preventDefault()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Don't toggle if disabled
|
|
41
|
+
if (this.element.hasAttribute("disabled")) {
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
this.checkedValue = !this.checkedValue
|
|
46
|
+
this.updateState(this.checkedValue, true)
|
|
47
|
+
|
|
48
|
+
// Dispatch change event for forms
|
|
49
|
+
this.element.dispatchEvent(new Event("change", { bubbles: true }))
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
handleKeydown(event) {
|
|
53
|
+
// Support Space and Enter keys (Radix UI behavior)
|
|
54
|
+
if (event.key === " " || event.key === "Enter") {
|
|
55
|
+
event.preventDefault()
|
|
56
|
+
this.toggle()
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
updateState(isChecked, animate = true) {
|
|
61
|
+
// Sync state on main element and thumb target
|
|
62
|
+
const additionalTargets = this.hasThumbTarget ? [this.thumbTarget] : []
|
|
63
|
+
syncCheckedState(this.element, isChecked, { additionalTargets })
|
|
64
|
+
|
|
65
|
+
// Update hidden input if it exists (for form submission)
|
|
66
|
+
const hiddenInput = this.element.querySelector('input[type="hidden"]')
|
|
67
|
+
if (hiddenInput) {
|
|
68
|
+
hiddenInput.value = isChecked ? "1" : "0"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
checkedValueChanged(value) {
|
|
73
|
+
this.updateState(value, true)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
import { setState } from "../utils/state-manager.js"
|
|
3
|
+
|
|
4
|
+
// Tabs controller for tabbed interface with keyboard navigation
|
|
5
|
+
export default class extends Controller {
|
|
6
|
+
static targets = ["trigger", "content"]
|
|
7
|
+
static values = {
|
|
8
|
+
defaultValue: { type: String, default: "" },
|
|
9
|
+
orientation: { type: String, default: "horizontal" },
|
|
10
|
+
activationMode: { type: String, default: "automatic" }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
connect() {
|
|
14
|
+
this.setupTabs()
|
|
15
|
+
this.setupKeyboardNavigation()
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
setupTabs() {
|
|
19
|
+
// Set initial active tab based on defaultValue
|
|
20
|
+
const activeValue = this.defaultValueValue
|
|
21
|
+
|
|
22
|
+
this.triggerTargets.forEach((trigger) => {
|
|
23
|
+
const value = trigger.dataset.value
|
|
24
|
+
const isActive = value === activeValue
|
|
25
|
+
|
|
26
|
+
if (isActive) {
|
|
27
|
+
this.activateTrigger(trigger)
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
this.contentTargets.forEach((content) => {
|
|
32
|
+
const value = content.dataset.value
|
|
33
|
+
const isActive = value === activeValue
|
|
34
|
+
|
|
35
|
+
if (isActive) {
|
|
36
|
+
this.showContent(content)
|
|
37
|
+
} else {
|
|
38
|
+
this.hideContent(content)
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
setupKeyboardNavigation() {
|
|
44
|
+
this.triggerTargets.forEach((trigger) => {
|
|
45
|
+
trigger.addEventListener("keydown", this.handleKeyDown.bind(this))
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
selectTab(event) {
|
|
50
|
+
const trigger = event.currentTarget
|
|
51
|
+
const value = trigger.dataset.value
|
|
52
|
+
|
|
53
|
+
// Deactivate all triggers
|
|
54
|
+
this.triggerTargets.forEach((t) => {
|
|
55
|
+
this.deactivateTrigger(t)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
// Activate clicked trigger
|
|
59
|
+
this.activateTrigger(trigger)
|
|
60
|
+
|
|
61
|
+
// Hide all content panels
|
|
62
|
+
this.contentTargets.forEach((content) => {
|
|
63
|
+
this.hideContent(content)
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
// Show matching content
|
|
67
|
+
const content = this.contentTargets.find((c) => c.dataset.value === value)
|
|
68
|
+
if (content) {
|
|
69
|
+
this.showContent(content)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Focus the trigger
|
|
73
|
+
trigger.focus()
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
activateTrigger(trigger) {
|
|
77
|
+
setState(trigger, 'active')
|
|
78
|
+
trigger.setAttribute("aria-selected", "true")
|
|
79
|
+
trigger.setAttribute("tabindex", "0")
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
deactivateTrigger(trigger) {
|
|
83
|
+
setState(trigger, 'inactive')
|
|
84
|
+
trigger.setAttribute("aria-selected", "false")
|
|
85
|
+
trigger.setAttribute("tabindex", "-1")
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
showContent(content) {
|
|
89
|
+
setState(content, 'active')
|
|
90
|
+
content.removeAttribute("hidden")
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
hideContent(content) {
|
|
94
|
+
setState(content, 'inactive')
|
|
95
|
+
content.setAttribute("hidden", "")
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
handleKeyDown(event) {
|
|
99
|
+
const trigger = event.target
|
|
100
|
+
const triggers = this.triggerTargets
|
|
101
|
+
const currentIndex = triggers.indexOf(trigger)
|
|
102
|
+
|
|
103
|
+
let nextIndex = currentIndex
|
|
104
|
+
|
|
105
|
+
// Determine next trigger based on orientation
|
|
106
|
+
const isHorizontal = this.orientationValue === "horizontal"
|
|
107
|
+
|
|
108
|
+
switch (event.key) {
|
|
109
|
+
case "ArrowRight":
|
|
110
|
+
if (isHorizontal) {
|
|
111
|
+
event.preventDefault()
|
|
112
|
+
nextIndex = (currentIndex + 1) % triggers.length
|
|
113
|
+
}
|
|
114
|
+
break
|
|
115
|
+
case "ArrowLeft":
|
|
116
|
+
if (isHorizontal) {
|
|
117
|
+
event.preventDefault()
|
|
118
|
+
nextIndex = currentIndex - 1 < 0 ? triggers.length - 1 : currentIndex - 1
|
|
119
|
+
}
|
|
120
|
+
break
|
|
121
|
+
case "ArrowDown":
|
|
122
|
+
if (!isHorizontal) {
|
|
123
|
+
event.preventDefault()
|
|
124
|
+
nextIndex = (currentIndex + 1) % triggers.length
|
|
125
|
+
}
|
|
126
|
+
break
|
|
127
|
+
case "ArrowUp":
|
|
128
|
+
if (!isHorizontal) {
|
|
129
|
+
event.preventDefault()
|
|
130
|
+
nextIndex = currentIndex - 1 < 0 ? triggers.length - 1 : currentIndex - 1
|
|
131
|
+
}
|
|
132
|
+
break
|
|
133
|
+
case "Home":
|
|
134
|
+
event.preventDefault()
|
|
135
|
+
nextIndex = 0
|
|
136
|
+
break
|
|
137
|
+
case "End":
|
|
138
|
+
event.preventDefault()
|
|
139
|
+
nextIndex = triggers.length - 1
|
|
140
|
+
break
|
|
141
|
+
default:
|
|
142
|
+
return
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Focus next trigger
|
|
146
|
+
const nextTrigger = triggers[nextIndex]
|
|
147
|
+
if (nextTrigger) {
|
|
148
|
+
nextTrigger.focus()
|
|
149
|
+
|
|
150
|
+
// Activate in automatic mode
|
|
151
|
+
if (this.activationModeValue === "automatic") {
|
|
152
|
+
nextTrigger.click()
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
import { syncPressedState } from "../utils/state-manager.js"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Toggle Controller
|
|
6
|
+
*
|
|
7
|
+
* Manages the pressed state of a toggle button with ARIA support.
|
|
8
|
+
*
|
|
9
|
+
* Values:
|
|
10
|
+
* - pressed: Boolean indicating if toggle is active/pressed
|
|
11
|
+
*
|
|
12
|
+
* Actions:
|
|
13
|
+
* - toggle: Toggles the pressed state
|
|
14
|
+
*
|
|
15
|
+
* Data Attributes:
|
|
16
|
+
* - data-state: "on" when pressed, "off" when not pressed
|
|
17
|
+
* - aria-pressed: "true" when pressed, "false" when not pressed
|
|
18
|
+
*/
|
|
19
|
+
export default class extends Controller {
|
|
20
|
+
static values = {
|
|
21
|
+
pressed: { type: Boolean, default: false }
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
connect() {
|
|
25
|
+
// Initialize state based on value
|
|
26
|
+
this.updateState()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Toggle the pressed state
|
|
31
|
+
*/
|
|
32
|
+
toggle() {
|
|
33
|
+
this.pressedValue = !this.pressedValue
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Update data-state and aria-pressed attributes when pressed value changes
|
|
38
|
+
*/
|
|
39
|
+
pressedValueChanged() {
|
|
40
|
+
this.updateState()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Update the button's state attributes
|
|
45
|
+
*/
|
|
46
|
+
updateState() {
|
|
47
|
+
syncPressedState(this.element, this.pressedValue, { useOnOff: true })
|
|
48
|
+
}
|
|
49
|
+
}
|