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,867 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
import {
|
|
3
|
+
startOfMonth, endOfMonth, startOfWeek, endOfWeek,
|
|
4
|
+
eachDayOfInterval, format, addMonths, subMonths, addYears, subYears,
|
|
5
|
+
isSameMonth, isSameDay, isToday, addDays, differenceInDays,
|
|
6
|
+
setMonth, setYear, getYear, getMonth, isWithinInterval,
|
|
7
|
+
isBefore, isAfter, parseISO
|
|
8
|
+
} from "date-fns"
|
|
9
|
+
|
|
10
|
+
export default class extends Controller {
|
|
11
|
+
static targets = ["grid", "monthLabel", "input", "monthSelect", "yearSelect", "liveRegion", "weekdaysHeader", "monthContainer"]
|
|
12
|
+
|
|
13
|
+
static values = {
|
|
14
|
+
mode: { type: String, default: "single" },
|
|
15
|
+
selected: { type: Array, default: [] },
|
|
16
|
+
month: { type: String, default: "" },
|
|
17
|
+
numberOfMonths: { type: Number, default: 1 },
|
|
18
|
+
weekStartsOn: { type: Number, default: 0 },
|
|
19
|
+
locale: { type: String, default: "en-US" },
|
|
20
|
+
minDate: { type: String, default: "" },
|
|
21
|
+
maxDate: { type: String, default: "" },
|
|
22
|
+
disabled: { type: Array, default: [] },
|
|
23
|
+
showOutsideDays: { type: Boolean, default: true },
|
|
24
|
+
fixedWeeks: { type: Boolean, default: false },
|
|
25
|
+
yearRange: { type: Number, default: 100 },
|
|
26
|
+
// Range constraints
|
|
27
|
+
minRangeDays: { type: Number, default: 0 },
|
|
28
|
+
maxRangeDays: { type: Number, default: 0 },
|
|
29
|
+
excludeDisabled: { type: Boolean, default: false }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
connect() {
|
|
33
|
+
this.currentMonth = this.monthValue ? new Date(this.monthValue) : new Date()
|
|
34
|
+
this.hoveredDate = null // For range preview
|
|
35
|
+
this.animationDirection = null // For month transition animation
|
|
36
|
+
this.initializeLocale()
|
|
37
|
+
this.render()
|
|
38
|
+
this.renderWeekdayHeaders()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
disconnect() {
|
|
42
|
+
this.hoveredDate = null
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Initialize locale-aware formatters using Intl API
|
|
46
|
+
initializeLocale() {
|
|
47
|
+
const locale = this.localeValue || "en-US"
|
|
48
|
+
|
|
49
|
+
// Month formatter for labels (e.g., "November 2024")
|
|
50
|
+
this.monthFormatter = new Intl.DateTimeFormat(locale, {
|
|
51
|
+
month: "long",
|
|
52
|
+
year: "numeric"
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
// Short weekday formatter (e.g., "Su", "Mo")
|
|
56
|
+
this.weekdayFormatter = new Intl.DateTimeFormat(locale, {
|
|
57
|
+
weekday: "short"
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
// Full weekday formatter for aria-labels (e.g., "Sunday")
|
|
61
|
+
this.weekdayFullFormatter = new Intl.DateTimeFormat(locale, {
|
|
62
|
+
weekday: "long"
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
// Month name formatter for dropdowns (e.g., "November")
|
|
66
|
+
this.monthNameFormatter = new Intl.DateTimeFormat(locale, {
|
|
67
|
+
month: "long"
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
// Day formatter for aria-labels (e.g., "Friday, November 15, 2024")
|
|
71
|
+
this.dayFormatter = new Intl.DateTimeFormat(locale, {
|
|
72
|
+
weekday: "long",
|
|
73
|
+
year: "numeric",
|
|
74
|
+
month: "long",
|
|
75
|
+
day: "numeric"
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Navigation
|
|
80
|
+
previousMonth() {
|
|
81
|
+
this.animationDirection = "prev"
|
|
82
|
+
this.currentMonth = subMonths(this.currentMonth, 1)
|
|
83
|
+
this.render()
|
|
84
|
+
this.announceMonthChange()
|
|
85
|
+
this.dispatchMonthChange()
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
nextMonth() {
|
|
89
|
+
this.animationDirection = "next"
|
|
90
|
+
this.currentMonth = addMonths(this.currentMonth, 1)
|
|
91
|
+
this.render()
|
|
92
|
+
this.announceMonthChange()
|
|
93
|
+
this.dispatchMonthChange()
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
previousYear() {
|
|
97
|
+
this.animationDirection = "prev"
|
|
98
|
+
this.currentMonth = subYears(this.currentMonth, 1)
|
|
99
|
+
this.render()
|
|
100
|
+
this.announceMonthChange()
|
|
101
|
+
this.dispatchMonthChange()
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
nextYear() {
|
|
105
|
+
this.animationDirection = "next"
|
|
106
|
+
this.currentMonth = addYears(this.currentMonth, 1)
|
|
107
|
+
this.render()
|
|
108
|
+
this.announceMonthChange()
|
|
109
|
+
this.dispatchMonthChange()
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
goToMonth(event) {
|
|
113
|
+
const month = parseInt(event.target.value)
|
|
114
|
+
const oldMonth = getMonth(this.currentMonth)
|
|
115
|
+
this.animationDirection = month > oldMonth ? "next" : "prev"
|
|
116
|
+
this.currentMonth = setMonth(this.currentMonth, month)
|
|
117
|
+
this.render()
|
|
118
|
+
this.announceMonthChange()
|
|
119
|
+
this.dispatchMonthChange()
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
goToYear(event) {
|
|
123
|
+
const year = parseInt(event.target.value)
|
|
124
|
+
const oldYear = getYear(this.currentMonth)
|
|
125
|
+
this.animationDirection = year > oldYear ? "next" : "prev"
|
|
126
|
+
this.currentMonth = setYear(this.currentMonth, year)
|
|
127
|
+
this.render()
|
|
128
|
+
this.announceMonthChange()
|
|
129
|
+
this.dispatchMonthChange()
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Go to today's date
|
|
133
|
+
goToToday() {
|
|
134
|
+
const today = new Date()
|
|
135
|
+
const oldMonth = this.currentMonth
|
|
136
|
+
this.animationDirection = isBefore(oldMonth, today) ? "next" : "prev"
|
|
137
|
+
this.currentMonth = startOfMonth(today)
|
|
138
|
+
this.focusedDate = format(today, "yyyy-MM-dd")
|
|
139
|
+
this.render()
|
|
140
|
+
this.announceMonthChange()
|
|
141
|
+
this.dispatchMonthChange()
|
|
142
|
+
this.restoreFocus()
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Dispatch month change event
|
|
146
|
+
dispatchMonthChange() {
|
|
147
|
+
this.dispatch("monthChange", {
|
|
148
|
+
detail: {
|
|
149
|
+
month: this.currentMonth,
|
|
150
|
+
direction: this.animationDirection
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Announce month changes to screen readers via aria-live region
|
|
156
|
+
announceMonthChange() {
|
|
157
|
+
if (this.hasLiveRegionTarget) {
|
|
158
|
+
const monthName = this.monthFormatter.format(this.currentMonth)
|
|
159
|
+
this.liveRegionTarget.textContent = monthName
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Announce date selection to screen readers
|
|
164
|
+
announceSelection(dateStr) {
|
|
165
|
+
if (this.hasLiveRegionTarget) {
|
|
166
|
+
const date = parseISO(dateStr)
|
|
167
|
+
const formattedDate = this.dayFormatter.format(date)
|
|
168
|
+
this.liveRegionTarget.textContent = `Selected: ${formattedDate}`
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Selection handlers
|
|
173
|
+
selectDate(event) {
|
|
174
|
+
// Stop propagation to prevent popover's handleClickOutside from closing the popover
|
|
175
|
+
// This is necessary because render() replaces the DOM, removing event.target from the document
|
|
176
|
+
// which would make contains() return false in handleClickOutside
|
|
177
|
+
event.stopPropagation()
|
|
178
|
+
|
|
179
|
+
const dateStr = event.currentTarget.dataset.date
|
|
180
|
+
if (this.isDisabled(parseISO(dateStr))) return
|
|
181
|
+
|
|
182
|
+
// Track focused date to restore after render
|
|
183
|
+
this.focusedDate = dateStr
|
|
184
|
+
|
|
185
|
+
switch (this.modeValue) {
|
|
186
|
+
case "single":
|
|
187
|
+
this.selectedValue = [dateStr]
|
|
188
|
+
break
|
|
189
|
+
case "range":
|
|
190
|
+
this.selectRange(dateStr)
|
|
191
|
+
break
|
|
192
|
+
case "multiple":
|
|
193
|
+
this.toggleDate(dateStr)
|
|
194
|
+
break
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
this.updateInput()
|
|
198
|
+
this.render()
|
|
199
|
+
this.restoreFocus()
|
|
200
|
+
this.announceSelection(dateStr)
|
|
201
|
+
this.dispatch("select", { detail: { selected: this.selectedValue, date: dateStr } })
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
selectRange(dateStr) {
|
|
205
|
+
const selected = this.selectedValue
|
|
206
|
+
if (selected.length === 0 || selected.length === 2) {
|
|
207
|
+
this.selectedValue = [dateStr]
|
|
208
|
+
} else {
|
|
209
|
+
const start = parseISO(selected[0])
|
|
210
|
+
const end = parseISO(dateStr)
|
|
211
|
+
|
|
212
|
+
// Swap if end is before start
|
|
213
|
+
const [rangeStart, rangeEnd] = isBefore(end, start)
|
|
214
|
+
? [end, start]
|
|
215
|
+
: [start, end]
|
|
216
|
+
|
|
217
|
+
// Validate min/max range days
|
|
218
|
+
const daysDiff = differenceInDays(rangeEnd, rangeStart)
|
|
219
|
+
|
|
220
|
+
if (this.minRangeDaysValue > 0 && daysDiff < this.minRangeDaysValue) {
|
|
221
|
+
// Range too short, don't complete selection
|
|
222
|
+
this.dispatch("rangeError", {
|
|
223
|
+
detail: { error: "min", minDays: this.minRangeDaysValue, actualDays: daysDiff }
|
|
224
|
+
})
|
|
225
|
+
return
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (this.maxRangeDaysValue > 0 && daysDiff > this.maxRangeDaysValue) {
|
|
229
|
+
// Range too long, don't complete selection
|
|
230
|
+
this.dispatch("rangeError", {
|
|
231
|
+
detail: { error: "max", maxDays: this.maxRangeDaysValue, actualDays: daysDiff }
|
|
232
|
+
})
|
|
233
|
+
return
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// Check for disabled dates in range if excludeDisabled is true
|
|
237
|
+
if (this.excludeDisabledValue) {
|
|
238
|
+
const hasDisabledInRange = this.hasDisabledDatesInRange(rangeStart, rangeEnd)
|
|
239
|
+
if (hasDisabledInRange) {
|
|
240
|
+
// Don't complete selection if there are disabled dates in range
|
|
241
|
+
this.dispatch("rangeError", {
|
|
242
|
+
detail: { error: "disabled", message: "Range contains disabled dates" }
|
|
243
|
+
})
|
|
244
|
+
return
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
this.selectedValue = [format(rangeStart, "yyyy-MM-dd"), format(rangeEnd, "yyyy-MM-dd")]
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Check if there are any disabled dates within a range
|
|
253
|
+
hasDisabledDatesInRange(start, end) {
|
|
254
|
+
const days = eachDayOfInterval({ start, end })
|
|
255
|
+
return days.some(day => this.isDisabled(day))
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
toggleDate(dateStr) {
|
|
259
|
+
const idx = this.selectedValue.indexOf(dateStr)
|
|
260
|
+
if (idx === -1) {
|
|
261
|
+
this.selectedValue = [...this.selectedValue, dateStr]
|
|
262
|
+
} else {
|
|
263
|
+
this.selectedValue = this.selectedValue.filter((_, i) => i !== idx)
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Hover preview for range mode
|
|
268
|
+
handleDayHover(event) {
|
|
269
|
+
if (this.modeValue !== "range") return
|
|
270
|
+
if (this.selectedValue.length !== 1) return
|
|
271
|
+
|
|
272
|
+
const dateStr = event.currentTarget.dataset.date
|
|
273
|
+
if (!dateStr) return
|
|
274
|
+
|
|
275
|
+
this.hoveredDate = parseISO(dateStr)
|
|
276
|
+
this.updateRangePreview()
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
handleDayLeave() {
|
|
280
|
+
if (this.modeValue !== "range") return
|
|
281
|
+
if (!this.hoveredDate) return
|
|
282
|
+
|
|
283
|
+
this.hoveredDate = null
|
|
284
|
+
this.updateRangePreview()
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Update visual preview for range selection
|
|
288
|
+
updateRangePreview() {
|
|
289
|
+
if (!this.hasGridTarget) return
|
|
290
|
+
|
|
291
|
+
const buttons = this.element.querySelectorAll("[data-date]")
|
|
292
|
+
buttons.forEach(button => {
|
|
293
|
+
const dateStr = button.dataset.date
|
|
294
|
+
const date = parseISO(dateStr)
|
|
295
|
+
const isInPreview = this.isInRangePreview(date)
|
|
296
|
+
const isPreviewStart = this.isRangePreviewStart(date)
|
|
297
|
+
const isPreviewEnd = this.isRangePreviewEnd(date)
|
|
298
|
+
const td = button.closest("td")
|
|
299
|
+
|
|
300
|
+
// Update td background for preview
|
|
301
|
+
if (td) {
|
|
302
|
+
td.classList.toggle("bg-accent/50", isInPreview && !this.isSelected(date))
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// Update button classes for preview
|
|
306
|
+
button.classList.toggle("bg-accent/50", isInPreview && !this.isSelected(date))
|
|
307
|
+
|
|
308
|
+
// Update rounding for preview start/end
|
|
309
|
+
if (isPreviewStart && !isPreviewEnd) {
|
|
310
|
+
button.classList.add("rounded-l-md", "rounded-r-none")
|
|
311
|
+
} else if (isPreviewEnd && !isPreviewStart) {
|
|
312
|
+
button.classList.add("rounded-r-md", "rounded-l-none")
|
|
313
|
+
} else if (!isInPreview) {
|
|
314
|
+
// Reset rounding only if not in actual selection
|
|
315
|
+
if (!this.isRangeStart(date) && !this.isRangeEnd(date)) {
|
|
316
|
+
button.classList.remove("rounded-l-md", "rounded-r-md", "rounded-l-none", "rounded-r-none")
|
|
317
|
+
button.classList.add("rounded-md")
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
})
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Check if date is in the preview range (between selected start and hovered date)
|
|
324
|
+
isInRangePreview(date) {
|
|
325
|
+
if (this.modeValue !== "range") return false
|
|
326
|
+
if (this.selectedValue.length !== 1) return false
|
|
327
|
+
if (!this.hoveredDate) return false
|
|
328
|
+
|
|
329
|
+
const start = parseISO(this.selectedValue[0])
|
|
330
|
+
const end = this.hoveredDate
|
|
331
|
+
|
|
332
|
+
const [rangeStart, rangeEnd] = isBefore(end, start) ? [end, start] : [start, end]
|
|
333
|
+
return isWithinInterval(date, { start: rangeStart, end: rangeEnd })
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
isRangePreviewStart(date) {
|
|
337
|
+
if (!this.isInRangePreview(date)) return false
|
|
338
|
+
const start = parseISO(this.selectedValue[0])
|
|
339
|
+
const end = this.hoveredDate
|
|
340
|
+
const actualStart = isBefore(end, start) ? end : start
|
|
341
|
+
return isSameDay(date, actualStart)
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
isRangePreviewEnd(date) {
|
|
345
|
+
if (!this.isInRangePreview(date)) return false
|
|
346
|
+
const start = parseISO(this.selectedValue[0])
|
|
347
|
+
const end = this.hoveredDate
|
|
348
|
+
const actualEnd = isBefore(end, start) ? start : end
|
|
349
|
+
return isSameDay(date, actualEnd)
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// Rendering
|
|
353
|
+
render() {
|
|
354
|
+
this.renderMonthLabels()
|
|
355
|
+
this.renderDropdowns()
|
|
356
|
+
this.renderGrids()
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
renderMonthLabels() {
|
|
360
|
+
// Handle multiple month labels for multi-month calendars
|
|
361
|
+
if (this.hasMonthLabelTarget) {
|
|
362
|
+
this.monthLabelTargets.forEach((label, index) => {
|
|
363
|
+
const monthDate = addMonths(this.currentMonth, index)
|
|
364
|
+
// Use locale-aware formatter
|
|
365
|
+
label.textContent = this.monthFormatter.format(monthDate)
|
|
366
|
+
})
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// Render localized weekday headers
|
|
371
|
+
renderWeekdayHeaders() {
|
|
372
|
+
if (!this.hasWeekdaysHeaderTarget) return
|
|
373
|
+
|
|
374
|
+
this.weekdaysHeaderTargets.forEach(header => {
|
|
375
|
+
const weekdays = this.getLocalizedWeekdays()
|
|
376
|
+
header.innerHTML = weekdays.map(day =>
|
|
377
|
+
`<th scope="col" class="text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]" aria-label="${day.full}">${day.short}</th>`
|
|
378
|
+
).join("")
|
|
379
|
+
})
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// Get localized weekday names respecting weekStartsOn
|
|
383
|
+
getLocalizedWeekdays() {
|
|
384
|
+
const weekdays = []
|
|
385
|
+
// Start from a known Sunday (Jan 4, 1970 was a Sunday)
|
|
386
|
+
const baseSunday = new Date(1970, 0, 4)
|
|
387
|
+
|
|
388
|
+
for (let i = 0; i < 7; i++) {
|
|
389
|
+
const dayIndex = (i + this.weekStartsOnValue) % 7
|
|
390
|
+
const date = new Date(baseSunday)
|
|
391
|
+
date.setDate(baseSunday.getDate() + dayIndex)
|
|
392
|
+
|
|
393
|
+
weekdays.push({
|
|
394
|
+
short: this.weekdayFormatter.format(date).slice(0, 2), // "Su", "Mo", etc.
|
|
395
|
+
full: this.weekdayFullFormatter.format(date) // "Sunday", "Monday", etc.
|
|
396
|
+
})
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
return weekdays
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// Get localized month names for dropdowns
|
|
403
|
+
getLocalizedMonthNames() {
|
|
404
|
+
const months = []
|
|
405
|
+
for (let i = 0; i < 12; i++) {
|
|
406
|
+
const date = new Date(2024, i, 1) // Any year works
|
|
407
|
+
months.push({
|
|
408
|
+
value: i,
|
|
409
|
+
name: this.monthNameFormatter.format(date)
|
|
410
|
+
})
|
|
411
|
+
}
|
|
412
|
+
return months
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
renderDropdowns() {
|
|
416
|
+
// Handle multiple dropdowns for multi-month calendars
|
|
417
|
+
if (this.hasMonthSelectTarget) {
|
|
418
|
+
this.monthSelectTargets.forEach((select, index) => {
|
|
419
|
+
const monthDate = addMonths(this.currentMonth, index)
|
|
420
|
+
const value = getMonth(monthDate).toString()
|
|
421
|
+
this.updateSelectValue(select, value)
|
|
422
|
+
})
|
|
423
|
+
}
|
|
424
|
+
if (this.hasYearSelectTarget) {
|
|
425
|
+
this.yearSelectTargets.forEach((select, index) => {
|
|
426
|
+
const monthDate = addMonths(this.currentMonth, index)
|
|
427
|
+
const value = getYear(monthDate).toString()
|
|
428
|
+
this.updateSelectValue(select, value)
|
|
429
|
+
})
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// Update select value - works with both native selects and UI Select component
|
|
434
|
+
updateSelectValue(element, value) {
|
|
435
|
+
// For native select elements
|
|
436
|
+
if (element.tagName === "SELECT") {
|
|
437
|
+
element.value = value
|
|
438
|
+
return
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// For hidden inputs inside UI Select component
|
|
442
|
+
element.value = value
|
|
443
|
+
|
|
444
|
+
// Find parent UI Select controller and update its value
|
|
445
|
+
const selectElement = element.closest("[data-controller='ui--select']")
|
|
446
|
+
if (selectElement) {
|
|
447
|
+
selectElement.dataset.uiSelectValueValue = value
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
renderGrids() {
|
|
452
|
+
if (!this.hasGridTarget) return
|
|
453
|
+
|
|
454
|
+
// Animate month transitions
|
|
455
|
+
if (this.animationDirection) {
|
|
456
|
+
this.animateMonthTransition()
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// Render each grid with its corresponding month
|
|
460
|
+
this.gridTargets.forEach((grid, index) => {
|
|
461
|
+
const monthDate = addMonths(this.currentMonth, index)
|
|
462
|
+
this.renderGrid(grid, monthDate)
|
|
463
|
+
})
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// Animate month transition with fade and slide effect
|
|
467
|
+
animateMonthTransition() {
|
|
468
|
+
this.gridTargets.forEach(grid => {
|
|
469
|
+
// Set initial state for animation
|
|
470
|
+
grid.style.opacity = "0"
|
|
471
|
+
grid.style.transform = this.animationDirection === "next" ? "translateX(10px)" : "translateX(-10px)"
|
|
472
|
+
|
|
473
|
+
// Trigger animation after content is rendered
|
|
474
|
+
requestAnimationFrame(() => {
|
|
475
|
+
grid.style.transition = "opacity 150ms ease-out, transform 150ms ease-out"
|
|
476
|
+
grid.style.opacity = "1"
|
|
477
|
+
grid.style.transform = "translateX(0)"
|
|
478
|
+
})
|
|
479
|
+
|
|
480
|
+
// Clean up after animation
|
|
481
|
+
setTimeout(() => {
|
|
482
|
+
grid.style.transition = ""
|
|
483
|
+
grid.style.transform = ""
|
|
484
|
+
this.animationDirection = null
|
|
485
|
+
}, 160)
|
|
486
|
+
})
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
renderGrid(gridElement, monthDate) {
|
|
490
|
+
const days = this.getDaysInMonth(monthDate)
|
|
491
|
+
let html = ""
|
|
492
|
+
|
|
493
|
+
// Render weeks
|
|
494
|
+
for (let i = 0; i < days.length; i += 7) {
|
|
495
|
+
html += '<tr class="flex w-full mt-2">'
|
|
496
|
+
for (let j = i; j < i + 7 && j < days.length; j++) {
|
|
497
|
+
html += this.renderDay(days[j], monthDate)
|
|
498
|
+
}
|
|
499
|
+
html += "</tr>"
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
gridElement.innerHTML = html
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
getDaysInMonth(monthDate) {
|
|
506
|
+
const start = startOfWeek(startOfMonth(monthDate), { weekStartsOn: this.weekStartsOnValue })
|
|
507
|
+
const end = endOfWeek(endOfMonth(monthDate), { weekStartsOn: this.weekStartsOnValue })
|
|
508
|
+
|
|
509
|
+
if (this.fixedWeeksValue) {
|
|
510
|
+
const days = eachDayOfInterval({ start, end })
|
|
511
|
+
while (days.length < 42) {
|
|
512
|
+
days.push(addDays(days[days.length - 1], 1))
|
|
513
|
+
}
|
|
514
|
+
return days
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
return eachDayOfInterval({ start, end })
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
renderDay(date, monthDate) {
|
|
521
|
+
const dateStr = format(date, "yyyy-MM-dd")
|
|
522
|
+
const isSelected = this.isSelected(date)
|
|
523
|
+
const isCurrentMonth = isSameMonth(date, monthDate)
|
|
524
|
+
const isTodayDate = isToday(date)
|
|
525
|
+
const isDisabledDate = this.isDisabled(date)
|
|
526
|
+
const isRangeMiddle = this.isInRange(date) && !isSelected
|
|
527
|
+
|
|
528
|
+
const classes = this.getDayClasses({
|
|
529
|
+
isSelected,
|
|
530
|
+
isCurrentMonth,
|
|
531
|
+
isTodayDate,
|
|
532
|
+
isDisabled: isDisabledDate,
|
|
533
|
+
isRangeMiddle,
|
|
534
|
+
isRangeStart: this.isRangeStart(date),
|
|
535
|
+
isRangeEnd: this.isRangeEnd(date)
|
|
536
|
+
})
|
|
537
|
+
|
|
538
|
+
// Handle outside days visibility
|
|
539
|
+
if (!isCurrentMonth && !this.showOutsideDaysValue) {
|
|
540
|
+
return `<td class="relative p-0 text-center text-sm h-9 w-9"></td>`
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// Build data-action with hover events for range mode
|
|
544
|
+
let actions = "click->ui--calendar#selectDate focus->ui--calendar#handleDayFocus blur->ui--calendar#handleDayBlur"
|
|
545
|
+
if (this.modeValue === "range") {
|
|
546
|
+
actions += " mouseenter->ui--calendar#handleDayHover mouseleave->ui--calendar#handleDayLeave"
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
return `
|
|
550
|
+
<td class="relative p-0 text-center text-sm focus-within:relative focus-within:z-20 ${this.getTdClasses(isSelected, isCurrentMonth, isRangeMiddle)}">
|
|
551
|
+
<button
|
|
552
|
+
type="button"
|
|
553
|
+
data-date="${dateStr}"
|
|
554
|
+
data-action="${actions}"
|
|
555
|
+
${isDisabledDate ? "disabled" : ""}
|
|
556
|
+
aria-selected="${isSelected}"
|
|
557
|
+
class="${classes}"
|
|
558
|
+
tabindex="${isSelected || isTodayDate ? 0 : -1}"
|
|
559
|
+
>${date.getDate()}</button>
|
|
560
|
+
</td>
|
|
561
|
+
`
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
// Day focus event handler
|
|
565
|
+
handleDayFocus(event) {
|
|
566
|
+
const dateStr = event.currentTarget.dataset.date
|
|
567
|
+
if (!dateStr) return
|
|
568
|
+
|
|
569
|
+
this.dispatch("dayFocus", {
|
|
570
|
+
detail: { date: dateStr, element: event.currentTarget }
|
|
571
|
+
})
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
// Day blur event handler
|
|
575
|
+
handleDayBlur(event) {
|
|
576
|
+
const dateStr = event.currentTarget.dataset.date
|
|
577
|
+
if (!dateStr) return
|
|
578
|
+
|
|
579
|
+
this.dispatch("dayBlur", {
|
|
580
|
+
detail: { date: dateStr, element: event.currentTarget }
|
|
581
|
+
})
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
getTdClasses(isSelected, isCurrentMonth, isRangeMiddle) {
|
|
585
|
+
const classes = []
|
|
586
|
+
|
|
587
|
+
if (isSelected || isRangeMiddle) {
|
|
588
|
+
classes.push("bg-accent")
|
|
589
|
+
if (!isCurrentMonth) classes.push("bg-accent/50")
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
return classes.join(" ")
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
getDayClasses({ isSelected, isCurrentMonth, isTodayDate, isDisabled, isRangeMiddle, isRangeStart, isRangeEnd }) {
|
|
596
|
+
const base = "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 h-9 w-9 p-0 font-normal"
|
|
597
|
+
const classes = [base]
|
|
598
|
+
|
|
599
|
+
if (isSelected && !isRangeMiddle) {
|
|
600
|
+
classes.push("bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground")
|
|
601
|
+
} else if (isRangeMiddle) {
|
|
602
|
+
classes.push("bg-accent text-accent-foreground rounded-none")
|
|
603
|
+
} else if (isTodayDate && !isSelected) {
|
|
604
|
+
classes.push("bg-accent text-accent-foreground")
|
|
605
|
+
} else {
|
|
606
|
+
classes.push("hover:bg-accent hover:text-accent-foreground")
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
if (!isCurrentMonth) {
|
|
610
|
+
classes.push("text-muted-foreground opacity-50")
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
if (isDisabled) {
|
|
614
|
+
classes.push("text-muted-foreground opacity-50 pointer-events-none")
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
if (isRangeStart) {
|
|
618
|
+
classes.push("rounded-l-md rounded-r-none")
|
|
619
|
+
}
|
|
620
|
+
if (isRangeEnd) {
|
|
621
|
+
classes.push("rounded-r-md rounded-l-none")
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
return classes.join(" ")
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
// State helpers
|
|
628
|
+
isSelected(date) {
|
|
629
|
+
return this.selectedValue.some(d => isSameDay(parseISO(d), date))
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
isDisabled(date) {
|
|
633
|
+
if (this.minDateValue && isBefore(date, parseISO(this.minDateValue))) return true
|
|
634
|
+
if (this.maxDateValue && isAfter(date, parseISO(this.maxDateValue))) return true
|
|
635
|
+
return this.disabledValue.some(d => isSameDay(parseISO(d), date))
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
isInRange(date) {
|
|
639
|
+
if (this.modeValue !== "range" || this.selectedValue.length !== 2) return false
|
|
640
|
+
const [start, end] = this.selectedValue.map(d => parseISO(d))
|
|
641
|
+
return isWithinInterval(date, { start, end })
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
isRangeStart(date) {
|
|
645
|
+
if (this.modeValue !== "range" || this.selectedValue.length === 0) return false
|
|
646
|
+
return isSameDay(parseISO(this.selectedValue[0]), date)
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
isRangeEnd(date) {
|
|
650
|
+
if (this.modeValue !== "range" || this.selectedValue.length !== 2) return false
|
|
651
|
+
return isSameDay(parseISO(this.selectedValue[1]), date)
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
updateInput() {
|
|
655
|
+
if (this.hasInputTarget) {
|
|
656
|
+
this.inputTarget.value = this.selectedValue.join(",")
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
// Keyboard navigation
|
|
661
|
+
// Supports:
|
|
662
|
+
// - Arrow keys: move focus by day/week
|
|
663
|
+
// - Shift+Arrow Left/Right: move by month
|
|
664
|
+
// - Shift+Arrow Up/Down: move by year
|
|
665
|
+
// - PageUp/PageDown: previous/next month
|
|
666
|
+
// - Shift+PageUp/PageDown: previous/next year
|
|
667
|
+
// - Home/End: start/end of week
|
|
668
|
+
// - Enter/Space: select focused date
|
|
669
|
+
handleKeydown(event) {
|
|
670
|
+
// Check if focus is on a day button - if not, don't handle Enter/Space
|
|
671
|
+
// This allows other components like Select to handle their own keyboard events
|
|
672
|
+
const focusedElement = document.activeElement
|
|
673
|
+
const isFocusOnDayButton = focusedElement?.hasAttribute("data-date")
|
|
674
|
+
|
|
675
|
+
// For Enter and Space, only handle if focus is on a day button
|
|
676
|
+
if ((event.key === "Enter" || event.key === " ") && !isFocusOnDayButton) {
|
|
677
|
+
return // Let the event bubble up to other handlers
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
// Handle Shift+Arrow combinations for month/year navigation
|
|
681
|
+
if (event.shiftKey) {
|
|
682
|
+
const shiftActions = {
|
|
683
|
+
ArrowLeft: () => this.navigateAndFocus("previousMonth"),
|
|
684
|
+
ArrowRight: () => this.navigateAndFocus("nextMonth"),
|
|
685
|
+
ArrowUp: () => this.navigateAndFocus("previousYear"),
|
|
686
|
+
ArrowDown: () => this.navigateAndFocus("nextYear"),
|
|
687
|
+
PageUp: () => this.navigateAndFocus("previousYear"),
|
|
688
|
+
PageDown: () => this.navigateAndFocus("nextYear")
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
if (shiftActions[event.key]) {
|
|
692
|
+
event.preventDefault()
|
|
693
|
+
shiftActions[event.key]()
|
|
694
|
+
return
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
const actions = {
|
|
699
|
+
ArrowLeft: () => this.moveFocus(-1),
|
|
700
|
+
ArrowRight: () => this.moveFocus(1),
|
|
701
|
+
ArrowUp: () => this.moveFocus(-7),
|
|
702
|
+
ArrowDown: () => this.moveFocus(7),
|
|
703
|
+
PageUp: () => this.navigateAndFocus("previousMonth"),
|
|
704
|
+
PageDown: () => this.navigateAndFocus("nextMonth"),
|
|
705
|
+
Home: () => this.moveToStartOfWeek(),
|
|
706
|
+
End: () => this.moveToEndOfWeek(),
|
|
707
|
+
Enter: () => this.selectFocusedDate(),
|
|
708
|
+
" ": () => this.selectFocusedDate()
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
if (actions[event.key]) {
|
|
712
|
+
event.preventDefault()
|
|
713
|
+
actions[event.key]()
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
moveFocus(days) {
|
|
718
|
+
const focused = this.element.querySelector("[data-date]:focus")
|
|
719
|
+
let currentDateStr = focused?.dataset.date || this.focusedDate
|
|
720
|
+
|
|
721
|
+
// If no focused element and no tracked date, find the first selectable date
|
|
722
|
+
if (!currentDateStr) {
|
|
723
|
+
const firstButton = this.element.querySelector("[data-date]")
|
|
724
|
+
if (!firstButton) return
|
|
725
|
+
currentDateStr = firstButton.dataset.date
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
const currentDate = parseISO(currentDateStr)
|
|
729
|
+
const newDate = addDays(currentDate, days)
|
|
730
|
+
const newDateStr = format(newDate, "yyyy-MM-dd")
|
|
731
|
+
|
|
732
|
+
// Track the new focused date
|
|
733
|
+
this.focusedDate = newDateStr
|
|
734
|
+
|
|
735
|
+
// Check if the new date is in the current view
|
|
736
|
+
let target = this.element.querySelector(`[data-date="${newDateStr}"]`)
|
|
737
|
+
|
|
738
|
+
if (!target) {
|
|
739
|
+
// Navigate to the new month if needed
|
|
740
|
+
if (days > 0) {
|
|
741
|
+
this.nextMonth()
|
|
742
|
+
} else {
|
|
743
|
+
this.previousMonth()
|
|
744
|
+
}
|
|
745
|
+
// Try to find the target after rendering
|
|
746
|
+
requestAnimationFrame(() => {
|
|
747
|
+
target = this.element.querySelector(`[data-date="${newDateStr}"]`)
|
|
748
|
+
target?.focus()
|
|
749
|
+
})
|
|
750
|
+
} else {
|
|
751
|
+
target.focus()
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
selectFocusedDate() {
|
|
756
|
+
const focused = this.element.querySelector("[data-date]:focus")
|
|
757
|
+
focused?.click()
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
restoreFocus() {
|
|
761
|
+
if (this.focusedDate) {
|
|
762
|
+
requestAnimationFrame(() => {
|
|
763
|
+
const target = this.element.querySelector(`[data-date="${this.focusedDate}"]`)
|
|
764
|
+
target?.focus()
|
|
765
|
+
})
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
// Navigate by month/year while maintaining focus on same day-of-month when possible
|
|
770
|
+
navigateAndFocus(direction) {
|
|
771
|
+
const focused = this.element.querySelector("[data-date]:focus")
|
|
772
|
+
let currentDateStr = focused?.dataset.date || this.focusedDate
|
|
773
|
+
|
|
774
|
+
if (!currentDateStr) {
|
|
775
|
+
// No focus, just navigate
|
|
776
|
+
this[direction]()
|
|
777
|
+
return
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
const currentDate = parseISO(currentDateStr)
|
|
781
|
+
let newDate
|
|
782
|
+
|
|
783
|
+
switch (direction) {
|
|
784
|
+
case "previousMonth":
|
|
785
|
+
newDate = subMonths(currentDate, 1)
|
|
786
|
+
break
|
|
787
|
+
case "nextMonth":
|
|
788
|
+
newDate = addMonths(currentDate, 1)
|
|
789
|
+
break
|
|
790
|
+
case "previousYear":
|
|
791
|
+
newDate = subYears(currentDate, 1)
|
|
792
|
+
break
|
|
793
|
+
case "nextYear":
|
|
794
|
+
newDate = addYears(currentDate, 1)
|
|
795
|
+
break
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
const newDateStr = format(newDate, "yyyy-MM-dd")
|
|
799
|
+
this.focusedDate = newDateStr
|
|
800
|
+
this.currentMonth = startOfMonth(newDate)
|
|
801
|
+
this.render()
|
|
802
|
+
this.announceMonthChange()
|
|
803
|
+
|
|
804
|
+
requestAnimationFrame(() => {
|
|
805
|
+
const target = this.element.querySelector(`[data-date="${newDateStr}"]`)
|
|
806
|
+
target?.focus()
|
|
807
|
+
})
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
// Move focus to start of current week
|
|
811
|
+
moveToStartOfWeek() {
|
|
812
|
+
const focused = this.element.querySelector("[data-date]:focus")
|
|
813
|
+
let currentDateStr = focused?.dataset.date || this.focusedDate
|
|
814
|
+
|
|
815
|
+
if (!currentDateStr) {
|
|
816
|
+
const firstButton = this.element.querySelector("[data-date]")
|
|
817
|
+
if (!firstButton) return
|
|
818
|
+
currentDateStr = firstButton.dataset.date
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
const currentDate = parseISO(currentDateStr)
|
|
822
|
+
const weekStart = startOfWeek(currentDate, { weekStartsOn: this.weekStartsOnValue })
|
|
823
|
+
const weekStartStr = format(weekStart, "yyyy-MM-dd")
|
|
824
|
+
|
|
825
|
+
this.focusedDate = weekStartStr
|
|
826
|
+
|
|
827
|
+
let target = this.element.querySelector(`[data-date="${weekStartStr}"]`)
|
|
828
|
+
if (!target) {
|
|
829
|
+
this.previousMonth()
|
|
830
|
+
requestAnimationFrame(() => {
|
|
831
|
+
target = this.element.querySelector(`[data-date="${weekStartStr}"]`)
|
|
832
|
+
target?.focus()
|
|
833
|
+
})
|
|
834
|
+
} else {
|
|
835
|
+
target.focus()
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// Move focus to end of current week
|
|
840
|
+
moveToEndOfWeek() {
|
|
841
|
+
const focused = this.element.querySelector("[data-date]:focus")
|
|
842
|
+
let currentDateStr = focused?.dataset.date || this.focusedDate
|
|
843
|
+
|
|
844
|
+
if (!currentDateStr) {
|
|
845
|
+
const firstButton = this.element.querySelector("[data-date]")
|
|
846
|
+
if (!firstButton) return
|
|
847
|
+
currentDateStr = firstButton.dataset.date
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
const currentDate = parseISO(currentDateStr)
|
|
851
|
+
const weekEnd = endOfWeek(currentDate, { weekStartsOn: this.weekStartsOnValue })
|
|
852
|
+
const weekEndStr = format(weekEnd, "yyyy-MM-dd")
|
|
853
|
+
|
|
854
|
+
this.focusedDate = weekEndStr
|
|
855
|
+
|
|
856
|
+
let target = this.element.querySelector(`[data-date="${weekEndStr}"]`)
|
|
857
|
+
if (!target) {
|
|
858
|
+
this.nextMonth()
|
|
859
|
+
requestAnimationFrame(() => {
|
|
860
|
+
target = this.element.querySelector(`[data-date="${weekEndStr}"]`)
|
|
861
|
+
target?.focus()
|
|
862
|
+
})
|
|
863
|
+
} else {
|
|
864
|
+
target.focus()
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}
|