yattho_view_components 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +0 -0
- data/README.md +17 -0
- data/app/assets/javascripts/app/components/yattho/alpha/dropdown/menu.d.ts +1 -0
- data/app/assets/javascripts/app/components/yattho/alpha/dropdown.d.ts +1 -0
- data/app/assets/javascripts/app/components/yattho/alpha/image_crop.d.ts +1 -0
- data/app/assets/javascripts/app/components/yattho/alpha/modal_dialog.d.ts +18 -0
- data/app/assets/javascripts/app/components/yattho/alpha/nav_list.d.ts +25 -0
- data/app/assets/javascripts/app/components/yattho/alpha/segmented_control.d.ts +12 -0
- data/app/assets/javascripts/app/components/yattho/alpha/tab_container.d.ts +1 -0
- data/app/assets/javascripts/app/components/yattho/alpha/toggle_switch.d.ts +29 -0
- data/app/assets/javascripts/app/components/yattho/alpha/tool_tip.d.ts +25 -0
- data/app/assets/javascripts/app/components/yattho/alpha/x_banner.d.ts +11 -0
- data/app/assets/javascripts/app/components/yattho/beta/auto_complete/auto_complete.d.ts +1 -0
- data/app/assets/javascripts/app/components/yattho/beta/clipboard_copy.d.ts +1 -0
- data/app/assets/javascripts/app/components/yattho/local_time.d.ts +1 -0
- data/app/assets/javascripts/app/components/yattho/time_ago_component.d.ts +1 -0
- data/app/assets/javascripts/app/components/yattho/yattho.d.ts +16 -0
- data/app/assets/javascripts/lib/yattho/forms/toggle_switch_input.d.ts +5 -0
- data/app/assets/javascripts/lib/yattho/forms/yattho_multi_input.d.ts +10 -0
- data/app/assets/javascripts/lib/yattho/forms/yattho_text_field.d.ts +1 -0
- data/app/assets/javascripts/yattho_view_components.js +2 -0
- data/app/assets/javascripts/yattho_view_components.js.map +1 -0
- data/app/assets/styles/yattho_view_components.css +5958 -0
- data/app/assets/styles/yattho_view_components.css.map +1 -0
- data/app/components/yattho/alpha/action_list/divider.rb +35 -0
- data/app/components/yattho/alpha/action_list/heading.html.erb +8 -0
- data/app/components/yattho/alpha/action_list/heading.rb +38 -0
- data/app/components/yattho/alpha/action_list/item.html.erb +39 -0
- data/app/components/yattho/alpha/action_list/item.rb +242 -0
- data/app/components/yattho/alpha/action_list.css +697 -0
- data/app/components/yattho/alpha/action_list.css.json +1 -0
- data/app/components/yattho/alpha/action_list.css.map +1 -0
- data/app/components/yattho/alpha/action_list.html.erb +15 -0
- data/app/components/yattho/alpha/action_list.pcss +682 -0
- data/app/components/yattho/alpha/action_list.rb +112 -0
- data/app/components/yattho/alpha/auto_complete/auto_complete.html.erb +24 -0
- data/app/components/yattho/alpha/auto_complete/item.rb +46 -0
- data/app/components/yattho/alpha/auto_complete.css +130 -0
- data/app/components/yattho/alpha/auto_complete.css.json +1 -0
- data/app/components/yattho/alpha/auto_complete.css.map +1 -0
- data/app/components/yattho/alpha/auto_complete.pcss +118 -0
- data/app/components/yattho/alpha/auto_complete.rb +159 -0
- data/app/components/yattho/alpha/banner.css +131 -0
- data/app/components/yattho/alpha/banner.css.json +1 -0
- data/app/components/yattho/alpha/banner.css.map +1 -0
- data/app/components/yattho/alpha/banner.html.erb +33 -0
- data/app/components/yattho/alpha/banner.pcss +126 -0
- data/app/components/yattho/alpha/banner.rb +138 -0
- data/app/components/yattho/alpha/button_marketing.css +211 -0
- data/app/components/yattho/alpha/button_marketing.css.json +1 -0
- data/app/components/yattho/alpha/button_marketing.css.map +1 -0
- data/app/components/yattho/alpha/button_marketing.pcss +175 -0
- data/app/components/yattho/alpha/button_marketing.rb +70 -0
- data/app/components/yattho/alpha/dialog/body.rb +28 -0
- data/app/components/yattho/alpha/dialog/footer.rb +34 -0
- data/app/components/yattho/alpha/dialog/header.html.erb +15 -0
- data/app/components/yattho/alpha/dialog/header.rb +40 -0
- data/app/components/yattho/alpha/dialog.css +613 -0
- data/app/components/yattho/alpha/dialog.css.json +1 -0
- data/app/components/yattho/alpha/dialog.css.map +1 -0
- data/app/components/yattho/alpha/dialog.html.erb +12 -0
- data/app/components/yattho/alpha/dialog.pcss +484 -0
- data/app/components/yattho/alpha/dialog.rb +164 -0
- data/app/components/yattho/alpha/dropdown/menu.d.ts +1 -0
- data/app/components/yattho/alpha/dropdown/menu.html.erb +24 -0
- data/app/components/yattho/alpha/dropdown/menu.js +1 -0
- data/app/components/yattho/alpha/dropdown/menu.rb +108 -0
- data/app/components/yattho/alpha/dropdown/menu.ts +1 -0
- data/app/components/yattho/alpha/dropdown.css +264 -0
- data/app/components/yattho/alpha/dropdown.css.json +1 -0
- data/app/components/yattho/alpha/dropdown.css.map +1 -0
- data/app/components/yattho/alpha/dropdown.d.ts +1 -0
- data/app/components/yattho/alpha/dropdown.html.erb +8 -0
- data/app/components/yattho/alpha/dropdown.js +1 -0
- data/app/components/yattho/alpha/dropdown.pcss +260 -0
- data/app/components/yattho/alpha/dropdown.rb +154 -0
- data/app/components/yattho/alpha/dropdown.ts +1 -0
- data/app/components/yattho/alpha/hellip_button.rb +41 -0
- data/app/components/yattho/alpha/hidden_text_expander.rb +57 -0
- data/app/components/yattho/alpha/image.rb +50 -0
- data/app/components/yattho/alpha/image_crop.d.ts +1 -0
- data/app/components/yattho/alpha/image_crop.html.erb +12 -0
- data/app/components/yattho/alpha/image_crop.js +1 -0
- data/app/components/yattho/alpha/image_crop.rb +39 -0
- data/app/components/yattho/alpha/image_crop.ts +1 -0
- data/app/components/yattho/alpha/layout.css +398 -0
- data/app/components/yattho/alpha/layout.css.json +1 -0
- data/app/components/yattho/alpha/layout.css.map +1 -0
- data/app/components/yattho/alpha/layout.html.erb +5 -0
- data/app/components/yattho/alpha/layout.pcss +268 -0
- data/app/components/yattho/alpha/layout.rb +282 -0
- data/app/components/yattho/alpha/menu.css +117 -0
- data/app/components/yattho/alpha/menu.css.json +1 -0
- data/app/components/yattho/alpha/menu.css.map +1 -0
- data/app/components/yattho/alpha/menu.html.erb +6 -0
- data/app/components/yattho/alpha/menu.pcss +119 -0
- data/app/components/yattho/alpha/menu.rb +76 -0
- data/app/components/yattho/alpha/modal_dialog.d.ts +18 -0
- data/app/components/yattho/alpha/modal_dialog.js +162 -0
- data/app/components/yattho/alpha/modal_dialog.ts +173 -0
- data/app/components/yattho/alpha/nav_list/item.html.erb +13 -0
- data/app/components/yattho/alpha/nav_list/item.rb +125 -0
- data/app/components/yattho/alpha/nav_list/section.html.erb +3 -0
- data/app/components/yattho/alpha/nav_list/section.rb +85 -0
- data/app/components/yattho/alpha/nav_list.d.ts +25 -0
- data/app/components/yattho/alpha/nav_list.html.erb +10 -0
- data/app/components/yattho/alpha/nav_list.js +130 -0
- data/app/components/yattho/alpha/nav_list.rb +112 -0
- data/app/components/yattho/alpha/nav_list.ts +129 -0
- data/app/components/yattho/alpha/octicon_symbols.html.erb +3 -0
- data/app/components/yattho/alpha/octicon_symbols.rb +60 -0
- data/app/components/yattho/alpha/segmented_control/item.html.erb +13 -0
- data/app/components/yattho/alpha/segmented_control/item.rb +29 -0
- data/app/components/yattho/alpha/segmented_control.css +164 -0
- data/app/components/yattho/alpha/segmented_control.css.json +1 -0
- data/app/components/yattho/alpha/segmented_control.css.map +1 -0
- data/app/components/yattho/alpha/segmented_control.d.ts +12 -0
- data/app/components/yattho/alpha/segmented_control.html.erb +7 -0
- data/app/components/yattho/alpha/segmented_control.js +47 -0
- data/app/components/yattho/alpha/segmented_control.pcss +134 -0
- data/app/components/yattho/alpha/segmented_control.rb +96 -0
- data/app/components/yattho/alpha/segmented_control.ts +41 -0
- data/app/components/yattho/alpha/tab_container.d.ts +1 -0
- data/app/components/yattho/alpha/tab_container.js +1 -0
- data/app/components/yattho/alpha/tab_container.rb +43 -0
- data/app/components/yattho/alpha/tab_container.ts +1 -0
- data/app/components/yattho/alpha/tab_nav.css +106 -0
- data/app/components/yattho/alpha/tab_nav.css.json +1 -0
- data/app/components/yattho/alpha/tab_nav.css.map +1 -0
- data/app/components/yattho/alpha/tab_nav.html.erb +9 -0
- data/app/components/yattho/alpha/tab_nav.pcss +100 -0
- data/app/components/yattho/alpha/tab_nav.rb +129 -0
- data/app/components/yattho/alpha/tab_panels.html.erb +14 -0
- data/app/components/yattho/alpha/tab_panels.rb +82 -0
- data/app/components/yattho/alpha/text_field.css +836 -0
- data/app/components/yattho/alpha/text_field.css.json +1 -0
- data/app/components/yattho/alpha/text_field.css.map +1 -0
- data/app/components/yattho/alpha/text_field.pcss +689 -0
- data/app/components/yattho/alpha/text_field.rb +105 -0
- data/app/components/yattho/alpha/toggle_switch.css +253 -0
- data/app/components/yattho/alpha/toggle_switch.css.json +1 -0
- data/app/components/yattho/alpha/toggle_switch.css.map +1 -0
- data/app/components/yattho/alpha/toggle_switch.d.ts +29 -0
- data/app/components/yattho/alpha/toggle_switch.html.erb +43 -0
- data/app/components/yattho/alpha/toggle_switch.js +156 -0
- data/app/components/yattho/alpha/toggle_switch.pcss +250 -0
- data/app/components/yattho/alpha/toggle_switch.rb +90 -0
- data/app/components/yattho/alpha/toggle_switch.ts +173 -0
- data/app/components/yattho/alpha/tool_tip.d.ts +25 -0
- data/app/components/yattho/alpha/tool_tip.js +369 -0
- data/app/components/yattho/alpha/tool_tip.ts +370 -0
- data/app/components/yattho/alpha/tooltip.rb +127 -0
- data/app/components/yattho/alpha/underline_nav.css +148 -0
- data/app/components/yattho/alpha/underline_nav.css.json +1 -0
- data/app/components/yattho/alpha/underline_nav.css.map +1 -0
- data/app/components/yattho/alpha/underline_nav.html.erb +13 -0
- data/app/components/yattho/alpha/underline_nav.pcss +133 -0
- data/app/components/yattho/alpha/underline_nav.rb +138 -0
- data/app/components/yattho/alpha/underline_panels.html.erb +18 -0
- data/app/components/yattho/alpha/underline_panels.rb +86 -0
- data/app/components/yattho/alpha/x_banner.d.ts +11 -0
- data/app/components/yattho/alpha/x_banner.js +35 -0
- data/app/components/yattho/alpha/x_banner.ts +38 -0
- data/app/components/yattho/base_component.rb +173 -0
- data/app/components/yattho/beta/auto_complete/auto_complete.d.ts +1 -0
- data/app/components/yattho/beta/auto_complete/auto_complete.html.erb +28 -0
- data/app/components/yattho/beta/auto_complete/auto_complete.js +1 -0
- data/app/components/yattho/beta/auto_complete/auto_complete.ts +1 -0
- data/app/components/yattho/beta/auto_complete/item.html.erb +21 -0
- data/app/components/yattho/beta/auto_complete/item.rb +80 -0
- data/app/components/yattho/beta/auto_complete.rb +201 -0
- data/app/components/yattho/beta/avatar.css +74 -0
- data/app/components/yattho/beta/avatar.css.json +1 -0
- data/app/components/yattho/beta/avatar.css.map +1 -0
- data/app/components/yattho/beta/avatar.pcss +73 -0
- data/app/components/yattho/beta/avatar.rb +84 -0
- data/app/components/yattho/beta/avatar_stack.css +138 -0
- data/app/components/yattho/beta/avatar_stack.css.json +1 -0
- data/app/components/yattho/beta/avatar_stack.css.map +1 -0
- data/app/components/yattho/beta/avatar_stack.html.erb +10 -0
- data/app/components/yattho/beta/avatar_stack.pcss +141 -0
- data/app/components/yattho/beta/avatar_stack.rb +92 -0
- data/app/components/yattho/beta/base_button.rb +48 -0
- data/app/components/yattho/beta/blankslate.css +90 -0
- data/app/components/yattho/beta/blankslate.css.json +1 -0
- data/app/components/yattho/beta/blankslate.css.map +1 -0
- data/app/components/yattho/beta/blankslate.html.erb +17 -0
- data/app/components/yattho/beta/blankslate.pcss +90 -0
- data/app/components/yattho/beta/blankslate.rb +238 -0
- data/app/components/yattho/beta/border_box/header.html.erb +4 -0
- data/app/components/yattho/beta/border_box/header.rb +52 -0
- data/app/components/yattho/beta/border_box.css +279 -0
- data/app/components/yattho/beta/border_box.css.json +1 -0
- data/app/components/yattho/beta/border_box.css.map +1 -0
- data/app/components/yattho/beta/border_box.html.erb +12 -0
- data/app/components/yattho/beta/border_box.pcss +284 -0
- data/app/components/yattho/beta/border_box.rb +147 -0
- data/app/components/yattho/beta/breadcrumbs.css +27 -0
- data/app/components/yattho/beta/breadcrumbs.css.json +1 -0
- data/app/components/yattho/beta/breadcrumbs.css.map +1 -0
- data/app/components/yattho/beta/breadcrumbs.html.erb +8 -0
- data/app/components/yattho/beta/breadcrumbs.pcss +30 -0
- data/app/components/yattho/beta/breadcrumbs.rb +82 -0
- data/app/components/yattho/beta/button.css +365 -0
- data/app/components/yattho/beta/button.css.json +1 -0
- data/app/components/yattho/beta/button.css.map +1 -0
- data/app/components/yattho/beta/button.html.erb +23 -0
- data/app/components/yattho/beta/button.pcss +344 -0
- data/app/components/yattho/beta/button.rb +198 -0
- data/app/components/yattho/beta/button_group.html.erb +5 -0
- data/app/components/yattho/beta/button_group.rb +59 -0
- data/app/components/yattho/beta/clipboard_copy.d.ts +1 -0
- data/app/components/yattho/beta/clipboard_copy.html.erb +8 -0
- data/app/components/yattho/beta/clipboard_copy.js +43 -0
- data/app/components/yattho/beta/clipboard_copy.rb +50 -0
- data/app/components/yattho/beta/clipboard_copy.ts +55 -0
- data/app/components/yattho/beta/close_button.rb +41 -0
- data/app/components/yattho/beta/counter.css +36 -0
- data/app/components/yattho/beta/counter.css.json +1 -0
- data/app/components/yattho/beta/counter.css.map +1 -0
- data/app/components/yattho/beta/counter.pcss +35 -0
- data/app/components/yattho/beta/counter.rb +114 -0
- data/app/components/yattho/beta/details.html.erb +4 -0
- data/app/components/yattho/beta/details.rb +72 -0
- data/app/components/yattho/beta/flash.css +150 -0
- data/app/components/yattho/beta/flash.css.json +1 -0
- data/app/components/yattho/beta/flash.css.map +1 -0
- data/app/components/yattho/beta/flash.html.erb +10 -0
- data/app/components/yattho/beta/flash.pcss +143 -0
- data/app/components/yattho/beta/flash.rb +72 -0
- data/app/components/yattho/beta/heading.rb +46 -0
- data/app/components/yattho/beta/icon_button.html.erb +6 -0
- data/app/components/yattho/beta/icon_button.rb +110 -0
- data/app/components/yattho/beta/label.css +105 -0
- data/app/components/yattho/beta/label.css.json +1 -0
- data/app/components/yattho/beta/label.css.map +1 -0
- data/app/components/yattho/beta/label.pcss +103 -0
- data/app/components/yattho/beta/label.rb +102 -0
- data/app/components/yattho/beta/link.css +62 -0
- data/app/components/yattho/beta/link.css.json +1 -0
- data/app/components/yattho/beta/link.css.map +1 -0
- data/app/components/yattho/beta/link.pcss +60 -0
- data/app/components/yattho/beta/link.rb +103 -0
- data/app/components/yattho/beta/markdown.rb +290 -0
- data/app/components/yattho/beta/octicon.html.erb +7 -0
- data/app/components/yattho/beta/octicon.rb +88 -0
- data/app/components/yattho/beta/popover.css +235 -0
- data/app/components/yattho/beta/popover.css.json +1 -0
- data/app/components/yattho/beta/popover.css.map +1 -0
- data/app/components/yattho/beta/popover.html.erb +6 -0
- data/app/components/yattho/beta/popover.pcss +225 -0
- data/app/components/yattho/beta/popover.rb +127 -0
- data/app/components/yattho/beta/progress_bar.css +26 -0
- data/app/components/yattho/beta/progress_bar.css.json +1 -0
- data/app/components/yattho/beta/progress_bar.css.map +1 -0
- data/app/components/yattho/beta/progress_bar.html.erb +5 -0
- data/app/components/yattho/beta/progress_bar.pcss +26 -0
- data/app/components/yattho/beta/progress_bar.rb +72 -0
- data/app/components/yattho/beta/relative_time.rb +166 -0
- data/app/components/yattho/beta/spinner.html.erb +4 -0
- data/app/components/yattho/beta/spinner.rb +45 -0
- data/app/components/yattho/beta/state.css +50 -0
- data/app/components/yattho/beta/state.css.json +1 -0
- data/app/components/yattho/beta/state.css.map +1 -0
- data/app/components/yattho/beta/state.pcss +50 -0
- data/app/components/yattho/beta/state.rb +76 -0
- data/app/components/yattho/beta/subhead.css +54 -0
- data/app/components/yattho/beta/subhead.css.json +1 -0
- data/app/components/yattho/beta/subhead.css.map +1 -0
- data/app/components/yattho/beta/subhead.html.erb +5 -0
- data/app/components/yattho/beta/subhead.pcss +49 -0
- data/app/components/yattho/beta/subhead.rb +135 -0
- data/app/components/yattho/beta/text.rb +27 -0
- data/app/components/yattho/beta/timeline_item.css +95 -0
- data/app/components/yattho/beta/timeline_item.css.json +1 -0
- data/app/components/yattho/beta/timeline_item.css.map +1 -0
- data/app/components/yattho/beta/timeline_item.html.erb +5 -0
- data/app/components/yattho/beta/timeline_item.pcss +93 -0
- data/app/components/yattho/beta/timeline_item.rb +90 -0
- data/app/components/yattho/beta/truncate.css +37 -0
- data/app/components/yattho/beta/truncate.css.json +1 -0
- data/app/components/yattho/beta/truncate.css.map +1 -0
- data/app/components/yattho/beta/truncate.html.erb +5 -0
- data/app/components/yattho/beta/truncate.pcss +31 -0
- data/app/components/yattho/beta/truncate.rb +114 -0
- data/app/components/yattho/blankslate_component.html.erb +25 -0
- data/app/components/yattho/blankslate_component.rb +156 -0
- data/app/components/yattho/box.rb +25 -0
- data/app/components/yattho/button_component.html.erb +12 -0
- data/app/components/yattho/button_component.rb +175 -0
- data/app/components/yattho/component.rb +139 -0
- data/app/components/yattho/conditional_wrapper.rb +36 -0
- data/app/components/yattho/content.rb +12 -0
- data/app/components/yattho/dropdown/menu.rb +14 -0
- data/app/components/yattho/dropdown.rb +7 -0
- data/app/components/yattho/hellip_button.rb +7 -0
- data/app/components/yattho/icon_button.html.erb +12 -0
- data/app/components/yattho/icon_button.rb +109 -0
- data/app/components/yattho/label_component.rb +7 -0
- data/app/components/yattho/layout_component.html.erb +9 -0
- data/app/components/yattho/layout_component.rb +71 -0
- data/app/components/yattho/link_component.rb +7 -0
- data/app/components/yattho/local_time.d.ts +1 -0
- data/app/components/yattho/local_time.js +1 -0
- data/app/components/yattho/local_time.rb +64 -0
- data/app/components/yattho/local_time.ts +1 -0
- data/app/components/yattho/markdown.rb +7 -0
- data/app/components/yattho/menu_component.rb +7 -0
- data/app/components/yattho/navigation/tab_component.html.erb +11 -0
- data/app/components/yattho/navigation/tab_component.rb +166 -0
- data/app/components/yattho/octicon_component.rb +7 -0
- data/app/components/yattho/octicon_symbols_component.rb +7 -0
- data/app/components/yattho/popover_component.rb +8 -0
- data/app/components/yattho/spinner_component.rb +7 -0
- data/app/components/yattho/state_component.rb +7 -0
- data/app/components/yattho/subhead_component.rb +7 -0
- data/app/components/yattho/tab_container_component.rb +7 -0
- data/app/components/yattho/time_ago_component.d.ts +1 -0
- data/app/components/yattho/time_ago_component.js +1 -0
- data/app/components/yattho/time_ago_component.rb +51 -0
- data/app/components/yattho/time_ago_component.ts +1 -0
- data/app/components/yattho/timeline_item_component.rb +13 -0
- data/app/components/yattho/tooltip.rb +91 -0
- data/app/components/yattho/truncate.css +30 -0
- data/app/components/yattho/truncate.css.json +1 -0
- data/app/components/yattho/truncate.css.map +1 -0
- data/app/components/yattho/truncate.pcss +30 -0
- data/app/components/yattho/truncate.rb +55 -0
- data/app/components/yattho/yattho.d.ts +16 -0
- data/app/components/yattho/yattho.js +16 -0
- data/app/components/yattho/yattho.pcss +37 -0
- data/app/components/yattho/yattho.ts +16 -0
- data/app/forms/after_content_form/after_content.html.erb +1 -0
- data/app/forms/after_content_form.rb +13 -0
- data/app/forms/application_form.rb +5 -0
- data/app/forms/array_check_box_group_form/places_lopez_caption.html.erb +1 -0
- data/app/forms/array_check_box_group_form.rb +15 -0
- data/app/forms/both_types_of_caption_form/first_name_caption.html.erb +1 -0
- data/app/forms/both_types_of_caption_form.rb +13 -0
- data/app/forms/caption_template_form/age_middle_aged_caption.html.erb +1 -0
- data/app/forms/caption_template_form/age_young_caption.html.erb +1 -0
- data/app/forms/caption_template_form/cool_caption.html.erb +1 -0
- data/app/forms/caption_template_form/first_name_caption.html.erb +1 -0
- data/app/forms/caption_template_form.rb +22 -0
- data/app/forms/check_box_group_form.rb +28 -0
- data/app/forms/check_box_with_nested_form.rb +39 -0
- data/app/forms/composed_form.rb +14 -0
- data/app/forms/example_toggle_switch_form/example_field_caption.html.erb +1 -0
- data/app/forms/example_toggle_switch_form.rb +8 -0
- data/app/forms/first_name_form.rb +13 -0
- data/app/forms/horizontal_form.rb +34 -0
- data/app/forms/immediate_validation_form.rb +29 -0
- data/app/forms/invalid_form.rb +21 -0
- data/app/forms/last_name_form.rb +13 -0
- data/app/forms/multi_input_form.rb +27 -0
- data/app/forms/multi_text_field_form.rb +27 -0
- data/app/forms/name_with_question_mark_form/enabled_caption.html.erb +1 -0
- data/app/forms/name_with_question_mark_form.rb +11 -0
- data/app/forms/radio_button_group_form.rb +12 -0
- data/app/forms/radio_button_with_nested_form.rb +40 -0
- data/app/forms/select_list_form.rb +13 -0
- data/app/forms/single_text_field_form.rb +13 -0
- data/app/forms/submit_button_form.rb +26 -0
- data/app/forms/text_field_and_checkbox_form.rb +19 -0
- data/app/helpers/yattho/form_helper.rb +23 -0
- data/app/lib/yattho/audited/dsl.rb +32 -0
- data/app/lib/yattho/class_name_helper.rb +29 -0
- data/app/lib/yattho/css/layout.css +1541 -0
- data/app/lib/yattho/css/layout.css.json +1 -0
- data/app/lib/yattho/css/utilities.css +7304 -0
- data/app/lib/yattho/css/utilities.css.json +1 -0
- data/app/lib/yattho/fetch_or_fallback_helper.rb +63 -0
- data/app/lib/yattho/join_style_arguments_helper.rb +14 -0
- data/app/lib/yattho/octicon/cache.rb +45 -0
- data/app/lib/yattho/status/dsl.rb +44 -0
- data/app/lib/yattho/tab_nav_helper.rb +35 -0
- data/app/lib/yattho/tabbed_component_helper.rb +44 -0
- data/app/lib/yattho/test_selector_helper.rb +20 -0
- data/app/lib/yattho/underline_nav_helper.rb +44 -0
- data/app/lib/yattho/view_helper.rb +22 -0
- data/lib/postcss_mixins/activeIndicatorLine.pcss +11 -0
- data/lib/postcss_mixins/clearfix.pcss +12 -0
- data/lib/postcss_mixins/focusBoxShadowInset.pcss +6 -0
- data/lib/postcss_mixins/focusOutline.pcss +5 -0
- data/lib/postcss_mixins/focusOutlineOnEmphasis.pcss +6 -0
- data/lib/postcss_mixins/minTouchTarget.js +20 -0
- data/lib/postcss_mixins/targetBoxShadow.pcss +7 -0
- data/lib/rubocop/config/default.yml +20 -0
- data/lib/rubocop/cop/yattho/base_cop.rb +28 -0
- data/lib/rubocop/cop/yattho/component_name_migration.rb +37 -0
- data/lib/rubocop/cop/yattho/deprecated_arguments.rb +317 -0
- data/lib/rubocop/cop/yattho/deprecated_button_arguments.rb +51 -0
- data/lib/rubocop/cop/yattho/deprecated_components.rb +49 -0
- data/lib/rubocop/cop/yattho/deprecated_label_schemes.rb +68 -0
- data/lib/rubocop/cop/yattho/deprecated_label_variants.rb +73 -0
- data/lib/rubocop/cop/yattho/deprecated_layout_component.rb +30 -0
- data/lib/rubocop/cop/yattho/no_tag_memoize.rb +43 -0
- data/lib/rubocop/cop/yattho/system_argument_instead_of_class.rb +57 -0
- data/lib/rubocop/cop/yattho/test_selector.rb +48 -0
- data/lib/rubocop/cop/yattho/yattho_octicon.rb +219 -0
- data/lib/rubocop/cop/yattho.rb +3 -0
- data/lib/tasks/custom_utilities.yml +310 -0
- data/lib/tasks/docs.rake +541 -0
- data/lib/tasks/helpers/ast_processor.rb +44 -0
- data/lib/tasks/helpers/ast_traverser.rb +77 -0
- data/lib/tasks/static.rake +15 -0
- data/lib/tasks/test.rake +83 -0
- data/lib/tasks/utilities.rake +109 -0
- data/lib/tasks/yattho_view_components.rake +47 -0
- data/lib/yattho/classify/utilities.rb +204 -0
- data/lib/yattho/classify/utilities.yml +1817 -0
- data/lib/yattho/classify/validation.rb +18 -0
- data/lib/yattho/classify.rb +135 -0
- data/lib/yattho/deprecations.rb +99 -0
- data/lib/yattho/deprecations.yml +109 -0
- data/lib/yattho/example_image.rb +8 -0
- data/lib/yattho/form_components.rb +37 -0
- data/lib/yattho/forms/acts_as_component.rb +118 -0
- data/lib/yattho/forms/base.html.erb +8 -0
- data/lib/yattho/forms/base.rb +133 -0
- data/lib/yattho/forms/base_component.rb +76 -0
- data/lib/yattho/forms/buffer_rewriter.rb +51 -0
- data/lib/yattho/forms/builder.rb +87 -0
- data/lib/yattho/forms/button.html.erb +4 -0
- data/lib/yattho/forms/button.rb +68 -0
- data/lib/yattho/forms/caption.html.erb +10 -0
- data/lib/yattho/forms/caption.rb +29 -0
- data/lib/yattho/forms/check_box.html.erb +16 -0
- data/lib/yattho/forms/check_box.rb +46 -0
- data/lib/yattho/forms/check_box_group.html.erb +12 -0
- data/lib/yattho/forms/check_box_group.rb +14 -0
- data/lib/yattho/forms/dsl/button_input.rb +29 -0
- data/lib/yattho/forms/dsl/check_box_group_input.rb +54 -0
- data/lib/yattho/forms/dsl/check_box_input.rb +54 -0
- data/lib/yattho/forms/dsl/form_object.rb +25 -0
- data/lib/yattho/forms/dsl/form_reference_input.rb +59 -0
- data/lib/yattho/forms/dsl/hidden_input.rb +29 -0
- data/lib/yattho/forms/dsl/input.rb +282 -0
- data/lib/yattho/forms/dsl/input_group.rb +34 -0
- data/lib/yattho/forms/dsl/input_methods.rb +91 -0
- data/lib/yattho/forms/dsl/multi_input.rb +55 -0
- data/lib/yattho/forms/dsl/radio_button_group_input.rb +38 -0
- data/lib/yattho/forms/dsl/radio_button_input.rb +37 -0
- data/lib/yattho/forms/dsl/select_list_input.rb +61 -0
- data/lib/yattho/forms/dsl/submit_button_input.rb +29 -0
- data/lib/yattho/forms/dsl/text_area_input.rb +33 -0
- data/lib/yattho/forms/dsl/text_field_input.rb +88 -0
- data/lib/yattho/forms/dsl/toggle_switch_input.rb +35 -0
- data/lib/yattho/forms/form_control.html.erb +22 -0
- data/lib/yattho/forms/form_control.rb +25 -0
- data/lib/yattho/forms/form_list.html.erb +5 -0
- data/lib/yattho/forms/form_list.rb +21 -0
- data/lib/yattho/forms/form_reference.html.erb +3 -0
- data/lib/yattho/forms/form_reference.rb +18 -0
- data/lib/yattho/forms/group.html.erb +5 -0
- data/lib/yattho/forms/group.rb +27 -0
- data/lib/yattho/forms/hidden_field.html.erb +1 -0
- data/lib/yattho/forms/hidden_field.rb +15 -0
- data/lib/yattho/forms/multi.html.erb +7 -0
- data/lib/yattho/forms/multi.rb +14 -0
- data/lib/yattho/forms/radio_button.html.erb +16 -0
- data/lib/yattho/forms/radio_button.rb +29 -0
- data/lib/yattho/forms/radio_button_group.html.erb +12 -0
- data/lib/yattho/forms/radio_button_group.rb +14 -0
- data/lib/yattho/forms/select_list.html.erb +5 -0
- data/lib/yattho/forms/select_list.rb +29 -0
- data/lib/yattho/forms/separator.html.erb +1 -0
- data/lib/yattho/forms/separator.rb +8 -0
- data/lib/yattho/forms/spacing_wrapper.html.erb +3 -0
- data/lib/yattho/forms/spacing_wrapper.rb +8 -0
- data/lib/yattho/forms/submit_button.html.erb +1 -0
- data/lib/yattho/forms/submit_button.rb +14 -0
- data/lib/yattho/forms/text_area.html.erb +5 -0
- data/lib/yattho/forms/text_area.rb +20 -0
- data/lib/yattho/forms/text_field.html.erb +19 -0
- data/lib/yattho/forms/text_field.rb +36 -0
- data/lib/yattho/forms/toggle_switch.html.erb +22 -0
- data/lib/yattho/forms/toggle_switch.rb +17 -0
- data/lib/yattho/forms/toggle_switch_form.rb +74 -0
- data/lib/yattho/forms/toggle_switch_input.d.ts +5 -0
- data/lib/yattho/forms/toggle_switch_input.js +29 -0
- data/lib/yattho/forms/toggle_switch_input.ts +19 -0
- data/lib/yattho/forms/utils.rb +28 -0
- data/lib/yattho/forms/yattho_multi_input.d.ts +10 -0
- data/lib/yattho/forms/yattho_multi_input.js +45 -0
- data/lib/yattho/forms/yattho_multi_input.ts +46 -0
- data/lib/yattho/forms/yattho_text_field.d.ts +1 -0
- data/lib/yattho/forms/yattho_text_field.js +62 -0
- data/lib/yattho/forms/yattho_text_field.ts +48 -0
- data/lib/yattho/view_components/audited.rb +14 -0
- data/lib/yattho/view_components/constants.rb +55 -0
- data/lib/yattho/view_components/engine.rb +69 -0
- data/lib/yattho/view_components/linters/argument_mappers/base.rb +103 -0
- data/lib/yattho/view_components/linters/argument_mappers/button.rb +75 -0
- data/lib/yattho/view_components/linters/argument_mappers/clipboard_copy.rb +21 -0
- data/lib/yattho/view_components/linters/argument_mappers/close_button.rb +46 -0
- data/lib/yattho/view_components/linters/argument_mappers/conversion_error.rb +10 -0
- data/lib/yattho/view_components/linters/argument_mappers/flash.rb +32 -0
- data/lib/yattho/view_components/linters/argument_mappers/helpers/erb_block.rb +68 -0
- data/lib/yattho/view_components/linters/argument_mappers/label.rb +56 -0
- data/lib/yattho/view_components/linters/argument_mappers/system_arguments.rb +48 -0
- data/lib/yattho/view_components/linters/autocorrectable.rb +32 -0
- data/lib/yattho/view_components/linters/base_linter.rb +208 -0
- data/lib/yattho/view_components/linters/blankslate_api_migration.rb +153 -0
- data/lib/yattho/view_components/linters/blankslate_component_migration_counter.rb +14 -0
- data/lib/yattho/view_components/linters/breadcrumbs_component_migration_counter.rb +14 -0
- data/lib/yattho/view_components/linters/button_component_migration_counter.rb +26 -0
- data/lib/yattho/view_components/linters/clipboard_copy_component_migration_counter.rb +20 -0
- data/lib/yattho/view_components/linters/close_button_component_migration_counter.rb +121 -0
- data/lib/yattho/view_components/linters/deprecated_components_counter.rb +60 -0
- data/lib/yattho/view_components/linters/disallow_action_list.rb +73 -0
- data/lib/yattho/view_components/linters/flash_migration_counter.rb +36 -0
- data/lib/yattho/view_components/linters/helpers/deprecated_components_helpers.rb +20 -0
- data/lib/yattho/view_components/linters/helpers/rubocop_helpers.rb +14 -0
- data/lib/yattho/view_components/linters/label_component_migration_counter.rb +24 -0
- data/lib/yattho/view_components/linters/migrate_deprecated_flash_arguments.rb +140 -0
- data/lib/yattho/view_components/linters/severity_schema.rb +14 -0
- data/lib/yattho/view_components/linters/subhead_component_migration_counter.rb +14 -0
- data/lib/yattho/view_components/linters/super_in_component_templates.rb +65 -0
- data/lib/yattho/view_components/linters/tag_tree_helpers.rb +61 -0
- data/lib/yattho/view_components/linters/two_column_layout_migration_counter.rb +158 -0
- data/lib/yattho/view_components/linters.rb +3 -0
- data/lib/yattho/view_components/statuses.rb +14 -0
- data/lib/yattho/view_components/version.rb +18 -0
- data/lib/yattho/view_components.rb +63 -0
- data/lib/yattho/yard/backend.rb +38 -0
- data/lib/yattho/yard/component_manifest.rb +123 -0
- data/lib/yattho/yard/docs_helper.rb +81 -0
- data/lib/yattho/yard/legacy_gatsby_backend.rb +271 -0
- data/lib/yattho/yard/registry.rb +146 -0
- data/lib/yattho/yard/renders_many_handler.rb +23 -0
- data/lib/yattho/yard/renders_one_handler.rb +23 -0
- data/previews/docs/alpha_auto_complete_item_preview/default.html.erb +10 -0
- data/previews/docs/alpha_auto_complete_item_preview.rb +7 -0
- data/previews/docs/alpha_auto_complete_preview/default.html.erb +1 -0
- data/previews/docs/alpha_auto_complete_preview/with_clear_button.html.erb +1 -0
- data/previews/docs/alpha_auto_complete_preview/with_custom_classes_for_the_input.html.erb +3 -0
- data/previews/docs/alpha_auto_complete_preview/with_custom_classes_for_the_results.html.erb +10 -0
- data/previews/docs/alpha_auto_complete_preview/with_icon.html.erb +1 -0
- data/previews/docs/alpha_auto_complete_preview/with_icon_and_non_visible_label.html.erb +1 -0
- data/previews/docs/alpha_auto_complete_preview/with_inline_label.html.erb +1 -0
- data/previews/docs/alpha_auto_complete_preview/with_non_visible_label.html.erb +1 -0
- data/previews/docs/alpha_auto_complete_preview.rb +21 -0
- data/previews/docs/alpha_banner_preview/custom_icon.html.erb +1 -0
- data/previews/docs/alpha_banner_preview/dismissible.html.erb +1 -0
- data/previews/docs/alpha_banner_preview/full_width.html.erb +1 -0
- data/previews/docs/alpha_banner_preview/schemes.html.erb +6 -0
- data/previews/docs/alpha_banner_preview/with_action_button.html.erb +4 -0
- data/previews/docs/alpha_banner_preview/with_custom_action.html.erb +6 -0
- data/previews/docs/alpha_banner_preview.rb +17 -0
- data/previews/docs/alpha_button_marketing_preview/schemes.html.erb +6 -0
- data/previews/docs/alpha_button_marketing_preview/sizes.html.erb +2 -0
- data/previews/docs/alpha_button_marketing_preview.rb +9 -0
- data/previews/docs/alpha_dialog_preview/dialog_with_cancel_and_submit_buttons.html.erb +13 -0
- data/previews/docs/alpha_dialog_preview.rb +7 -0
- data/previews/docs/alpha_dropdown_preview/customizing_menu_items.html.erb +11 -0
- data/previews/docs/alpha_dropdown_preview/customizing_the_button.html.erb +12 -0
- data/previews/docs/alpha_dropdown_preview/default.html.erb +11 -0
- data/previews/docs/alpha_dropdown_preview/menu_as_list.html.erb +13 -0
- data/previews/docs/alpha_dropdown_preview/with_caret.html.erb +12 -0
- data/previews/docs/alpha_dropdown_preview/with_direction.html.erb +12 -0
- data/previews/docs/alpha_dropdown_preview/with_dividers.html.erb +16 -0
- data/previews/docs/alpha_dropdown_preview.rb +19 -0
- data/previews/docs/alpha_hellip_button_preview/default.html.erb +1 -0
- data/previews/docs/alpha_hellip_button_preview/inline.html.erb +1 -0
- data/previews/docs/alpha_hellip_button_preview/styling_the_button.html.erb +1 -0
- data/previews/docs/alpha_hellip_button_preview.rb +11 -0
- data/previews/docs/alpha_hidden_text_expander_preview/default.html.erb +1 -0
- data/previews/docs/alpha_hidden_text_expander_preview/inline.html.erb +1 -0
- data/previews/docs/alpha_hidden_text_expander_preview/styling_the_button.html.erb +1 -0
- data/previews/docs/alpha_hidden_text_expander_preview.rb +11 -0
- data/previews/docs/alpha_image_crop_preview/cropper_with_a_custom_loader.html.erb +3 -0
- data/previews/docs/alpha_image_crop_preview/simple_cropper.html.erb +1 -0
- data/previews/docs/alpha_image_crop_preview/square_cropper.html.erb +1 -0
- data/previews/docs/alpha_image_crop_preview.rb +11 -0
- data/previews/docs/alpha_image_preview/custom_size.html.erb +2 -0
- data/previews/docs/alpha_image_preview/default.html.erb +2 -0
- data/previews/docs/alpha_image_preview/helper.html.erb +2 -0
- data/previews/docs/alpha_image_preview/lazy_loading.html.erb +2 -0
- data/previews/docs/alpha_image_preview.rb +13 -0
- data/previews/docs/alpha_layout_preview/changing_when_to_render_layout_as_columns.html.erb +12 -0
- data/previews/docs/alpha_layout_preview/default.html.erb +5 -0
- data/previews/docs/alpha_layout_preview/main_widths.html.erb +16 -0
- data/previews/docs/alpha_layout_preview/sidebar_placement.html.erb +8 -0
- data/previews/docs/alpha_layout_preview/sidebar_placement_as_row.html.erb +12 -0
- data/previews/docs/alpha_layout_preview/sidebar_widths.html.erb +12 -0
- data/previews/docs/alpha_layout_preview.rb +17 -0
- data/previews/docs/alpha_menu_preview/default.html.erb +17 -0
- data/previews/docs/alpha_menu_preview.rb +7 -0
- data/previews/docs/alpha_nav_list_preview/expandable_sub_items.html.erb +24 -0
- data/previews/docs/alpha_nav_list_preview/items_and_headings.html.erb +12 -0
- data/previews/docs/alpha_nav_list_preview/leading_and_trailing_visuals.html.erb +17 -0
- data/previews/docs/alpha_nav_list_preview/trailing_action.html.erb +12 -0
- data/previews/docs/alpha_nav_list_preview.rb +13 -0
- data/previews/docs/alpha_octicon_symbols_preview/symbol_dictionary.html.erb +4 -0
- data/previews/docs/alpha_octicon_symbols_preview.rb +7 -0
- data/previews/docs/alpha_segmented_control_preview/basic_usage.html.erb +6 -0
- data/previews/docs/alpha_segmented_control_preview/fill_width_of_parent.html.erb +5 -0
- data/previews/docs/alpha_segmented_control_preview/small.html.erb +6 -0
- data/previews/docs/alpha_segmented_control_preview/with_icons.html.erb +5 -0
- data/previews/docs/alpha_segmented_control_preview/with_icons_only.html.erb +5 -0
- data/previews/docs/alpha_segmented_control_preview.rb +15 -0
- data/previews/docs/alpha_tab_container_preview/default.html.erb +16 -0
- data/previews/docs/alpha_tab_container_preview.rb +7 -0
- data/previews/docs/alpha_tab_nav_preview/adding_extra_content_after_the_tabs.html.erb +10 -0
- data/previews/docs/alpha_tab_nav_preview/customizing_the_body.html.erb +5 -0
- data/previews/docs/alpha_tab_nav_preview/default_with_div.html.erb +5 -0
- data/previews/docs/alpha_tab_nav_preview/default_with_nav.html.erb +5 -0
- data/previews/docs/alpha_tab_nav_preview/with_extra_content.html.erb +8 -0
- data/previews/docs/alpha_tab_nav_preview/with_icons_and_counters.html.erb +15 -0
- data/previews/docs/alpha_tab_nav_preview.rb +17 -0
- data/previews/docs/alpha_tab_panels_preview/default.html.erb +14 -0
- data/previews/docs/alpha_tab_panels_preview.rb +7 -0
- data/previews/docs/alpha_text_field_preview/default.html.erb +1 -0
- data/previews/docs/alpha_text_field_preview/disabled.html.erb +7 -0
- data/previews/docs/alpha_text_field_preview/full_width.html.erb +7 -0
- data/previews/docs/alpha_text_field_preview/invalid.html.erb +7 -0
- data/previews/docs/alpha_text_field_preview/with_a_caption.html.erb +7 -0
- data/previews/docs/alpha_text_field_preview/with_a_clear_button.html.erb +7 -0
- data/previews/docs/alpha_text_field_preview/with_a_leading_visual.html.erb +9 -0
- data/previews/docs/alpha_text_field_preview/with_a_validation_message.html.erb +7 -0
- data/previews/docs/alpha_text_field_preview.rb +21 -0
- data/previews/docs/alpha_toggle_switch_preview/checked.html.erb +1 -0
- data/previews/docs/alpha_toggle_switch_preview/checked_and_disabled.html.erb +1 -0
- data/previews/docs/alpha_toggle_switch_preview/default.html.erb +1 -0
- data/previews/docs/alpha_toggle_switch_preview/disabled.html.erb +1 -0
- data/previews/docs/alpha_toggle_switch_preview/small.html.erb +1 -0
- data/previews/docs/alpha_toggle_switch_preview/with_status_label_positioned_at_the_end.html.erb +1 -0
- data/previews/docs/alpha_toggle_switch_preview.rb +17 -0
- data/previews/docs/alpha_tooltip_preview/as_a_label_for_an_iconbutton.html.erb +1 -0
- data/previews/docs/alpha_tooltip_preview/as_a_supplementary_description_for_a_button.html.erb +4 -0
- data/previews/docs/alpha_tooltip_preview/as_a_supplementary_description_for_an_iconbutton.html.erb +1 -0
- data/previews/docs/alpha_tooltip_preview/directly_using_tooltip.html.erb +4 -0
- data/previews/docs/alpha_tooltip_preview/with_direction.html.erb +32 -0
- data/previews/docs/alpha_tooltip_preview.rb +15 -0
- data/previews/docs/alpha_underline_nav_preview/align_right.html.erb +11 -0
- data/previews/docs/alpha_underline_nav_preview/customizing_the_body.html.erb +5 -0
- data/previews/docs/alpha_underline_nav_preview/default_with_nav.html.erb +7 -0
- data/previews/docs/alpha_underline_nav_preview/with_div.html.erb +7 -0
- data/previews/docs/alpha_underline_nav_preview/with_icons_and_counters.html.erb +18 -0
- data/previews/docs/alpha_underline_nav_preview.rb +15 -0
- data/previews/docs/alpha_underline_panels_preview/default.html.erb +17 -0
- data/previews/docs/alpha_underline_panels_preview.rb +7 -0
- data/previews/docs/beta_auto_complete_item_preview/default.html.erb +6 -0
- data/previews/docs/beta_auto_complete_item_preview.rb +7 -0
- data/previews/docs/beta_auto_complete_preview/full_width_field.html.erb +3 -0
- data/previews/docs/beta_auto_complete_preview/inset_variant.html.erb +3 -0
- data/previews/docs/beta_auto_complete_preview/leading_visual.html.erb +3 -0
- data/previews/docs/beta_auto_complete_preview/monospace_variant.html.erb +3 -0
- data/previews/docs/beta_auto_complete_preview/trailing_action.html.erb +1 -0
- data/previews/docs/beta_auto_complete_preview/visually_hidden_label.html.erb +3 -0
- data/previews/docs/beta_auto_complete_preview/with_custom_classes_for_the_input.html.erb +3 -0
- data/previews/docs/beta_auto_complete_preview/with_custom_classes_for_the_results.html.erb +3 -0
- data/previews/docs/beta_auto_complete_preview.rb +21 -0
- data/previews/docs/beta_avatar_preview/default.html.erb +1 -0
- data/previews/docs/beta_avatar_preview/link.html.erb +1 -0
- data/previews/docs/beta_avatar_preview/square.html.erb +1 -0
- data/previews/docs/beta_avatar_preview/with_size.html.erb +7 -0
- data/previews/docs/beta_avatar_preview.rb +13 -0
- data/previews/docs/beta_avatar_stack_preview/align_right.html.erb +5 -0
- data/previews/docs/beta_avatar_stack_preview/default.html.erb +5 -0
- data/previews/docs/beta_avatar_stack_preview/with_tooltip.html.erb +5 -0
- data/previews/docs/beta_avatar_stack_preview.rb +11 -0
- data/previews/docs/beta_base_button_preview/block.html.erb +2 -0
- data/previews/docs/beta_base_button_preview.rb +7 -0
- data/previews/docs/beta_blankslate_preview/basic.html.erb +4 -0
- data/previews/docs/beta_blankslate_preview/custom_content.html.erb +6 -0
- data/previews/docs/beta_blankslate_preview/icon.html.erb +5 -0
- data/previews/docs/beta_blankslate_preview/loading.html.erb +5 -0
- data/previews/docs/beta_blankslate_preview/primary_action.html.erb +6 -0
- data/previews/docs/beta_blankslate_preview/primary_and_secondary_actions.html.erb +7 -0
- data/previews/docs/beta_blankslate_preview/secondary_action.html.erb +6 -0
- data/previews/docs/beta_blankslate_preview/using_an_image.html.erb +5 -0
- data/previews/docs/beta_blankslate_preview/variations.html.erb +8 -0
- data/previews/docs/beta_blankslate_preview/with_border.html.erb +5 -0
- data/previews/docs/beta_blankslate_preview.rb +25 -0
- data/previews/docs/beta_border_box_header_preview/default.html.erb +4 -0
- data/previews/docs/beta_border_box_header_preview/with_title.html.erb +3 -0
- data/previews/docs/beta_border_box_header_preview.rb +9 -0
- data/previews/docs/beta_border_box_preview/header_with_title_body_rows_and_footer.html.erb +21 -0
- data/previews/docs/beta_border_box_preview/padding_density.html.erb +14 -0
- data/previews/docs/beta_border_box_preview/row_colors.html.erb +14 -0
- data/previews/docs/beta_border_box_preview.rb +11 -0
- data/previews/docs/beta_breadcrumbs_preview/basic.html.erb +5 -0
- data/previews/docs/beta_breadcrumbs_preview.rb +7 -0
- data/previews/docs/beta_button_group_preview/default.html.erb +8 -0
- data/previews/docs/beta_button_group_preview/sizes.html.erb +7 -0
- data/previews/docs/beta_button_group_preview.rb +9 -0
- data/previews/docs/beta_button_preview/full_width.html.erb +2 -0
- data/previews/docs/beta_button_preview/schemes.html.erb +4 -0
- data/previews/docs/beta_button_preview/sizes.html.erb +2 -0
- data/previews/docs/beta_button_preview/with_leading_and_trailing_visuals.html.erb +5 -0
- data/previews/docs/beta_button_preview/with_leading_visual.html.erb +4 -0
- data/previews/docs/beta_button_preview/with_tooltip.html.erb +4 -0
- data/previews/docs/beta_button_preview/with_trailing_visual.html.erb +4 -0
- data/previews/docs/beta_button_preview.rb +19 -0
- data/previews/docs/beta_clipboard_copy_preview/copying_from_an_element.html.erb +2 -0
- data/previews/docs/beta_clipboard_copy_preview/default.html.erb +1 -0
- data/previews/docs/beta_clipboard_copy_preview/with_text_instead_of_icons.html.erb +3 -0
- data/previews/docs/beta_clipboard_copy_preview.rb +11 -0
- data/previews/docs/beta_close_button_preview/default.html.erb +1 -0
- data/previews/docs/beta_close_button_preview.rb +7 -0
- data/previews/docs/beta_counter_preview/default.html.erb +1 -0
- data/previews/docs/beta_counter_preview/schemes.html.erb +2 -0
- data/previews/docs/beta_counter_preview.rb +9 -0
- data/previews/docs/beta_details_preview/default.html.erb +9 -0
- data/previews/docs/beta_details_preview.rb +7 -0
- data/previews/docs/beta_flash_preview/dismissible.html.erb +1 -0
- data/previews/docs/beta_flash_preview/full_width.html.erb +1 -0
- data/previews/docs/beta_flash_preview/icon.html.erb +1 -0
- data/previews/docs/beta_flash_preview/schemes.html.erb +4 -0
- data/previews/docs/beta_flash_preview/with_actions.html.erb +6 -0
- data/previews/docs/beta_flash_preview.rb +15 -0
- data/previews/docs/beta_heading_preview/default.html.erb +6 -0
- data/previews/docs/beta_heading_preview.rb +7 -0
- data/previews/docs/beta_icon_button_preview/custom_tooltip_direction.html.erb +2 -0
- data/previews/docs/beta_icon_button_preview/default.html.erb +2 -0
- data/previews/docs/beta_icon_button_preview/schemes.html.erb +3 -0
- data/previews/docs/beta_icon_button_preview/with_an_aria_description.html.erb +1 -0
- data/previews/docs/beta_icon_button_preview.rb +13 -0
- data/previews/docs/beta_label_preview/inline.html.erb +2 -0
- data/previews/docs/beta_label_preview/schemes.html.erb +10 -0
- data/previews/docs/beta_label_preview/sizes.html.erb +2 -0
- data/previews/docs/beta_label_preview.rb +11 -0
- data/previews/docs/beta_link_preview/default.html.erb +1 -0
- data/previews/docs/beta_link_preview/muted.html.erb +1 -0
- data/previews/docs/beta_link_preview/schemes.html.erb +2 -0
- data/previews/docs/beta_link_preview/with_tooltip.html.erb +4 -0
- data/previews/docs/beta_link_preview/without_underline.html.erb +1 -0
- data/previews/docs/beta_link_preview.rb +15 -0
- data/previews/docs/beta_markdown_preview/default.html.erb +260 -0
- data/previews/docs/beta_markdown_preview.rb +7 -0
- data/previews/docs/beta_octicon_preview/default.html.erb +2 -0
- data/previews/docs/beta_octicon_preview/helper.html.erb +1 -0
- data/previews/docs/beta_octicon_preview/medium.html.erb +1 -0
- data/previews/docs/beta_octicon_preview.rb +11 -0
- data/previews/docs/beta_popover_preview/caret_position.html.erb +8 -0
- data/previews/docs/beta_popover_preview/default.html.erb +8 -0
- data/previews/docs/beta_popover_preview/large.html.erb +8 -0
- data/previews/docs/beta_popover_preview/with_multiple_elements_in_the_body.html.erb +11 -0
- data/previews/docs/beta_popover_preview.rb +13 -0
- data/previews/docs/beta_progress_bar_preview/default.html.erb +3 -0
- data/previews/docs/beta_progress_bar_preview/large.html.erb +3 -0
- data/previews/docs/beta_progress_bar_preview/multiple_items.html.erb +5 -0
- data/previews/docs/beta_progress_bar_preview/small.html.erb +3 -0
- data/previews/docs/beta_progress_bar_preview.rb +13 -0
- data/previews/docs/beta_relative_time_preview/default.html.erb +1 -0
- data/previews/docs/beta_relative_time_preview/elapsed_time.html.erb +1 -0
- data/previews/docs/beta_relative_time_preview/past_time.html.erb +1 -0
- data/previews/docs/beta_relative_time_preview.rb +11 -0
- data/previews/docs/beta_spinner_preview/default.html.erb +1 -0
- data/previews/docs/beta_spinner_preview/large.html.erb +1 -0
- data/previews/docs/beta_spinner_preview/small.html.erb +1 -0
- data/previews/docs/beta_spinner_preview.rb +11 -0
- data/previews/docs/beta_state_preview/default.html.erb +1 -0
- data/previews/docs/beta_state_preview/schemes.html.erb +4 -0
- data/previews/docs/beta_state_preview/sizes.html.erb +2 -0
- data/previews/docs/beta_state_preview.rb +11 -0
- data/previews/docs/beta_subhead_preview/default.html.erb +8 -0
- data/previews/docs/beta_subhead_preview/with_actions.html.erb +15 -0
- data/previews/docs/beta_subhead_preview/with_dangerous_heading.html.erb +8 -0
- data/previews/docs/beta_subhead_preview/with_long_description.html.erb +6 -0
- data/previews/docs/beta_subhead_preview/without_border.html.erb +8 -0
- data/previews/docs/beta_subhead_preview.rb +15 -0
- data/previews/docs/beta_text_preview/default.html.erb +2 -0
- data/previews/docs/beta_text_preview.rb +7 -0
- data/previews/docs/beta_timeline_item_preview/default.html.erb +7 -0
- data/previews/docs/beta_timeline_item_preview.rb +7 -0
- data/previews/docs/beta_truncate_preview/advanced_multiple_items.html.erb +9 -0
- data/previews/docs/beta_truncate_preview/default.html.erb +1 -0
- data/previews/docs/beta_truncate_preview/expand_on_hover_or_focus.html.erb +6 -0
- data/previews/docs/beta_truncate_preview/max_widths.html.erb +5 -0
- data/previews/docs/beta_truncate_preview/max_widths_on_new_lines.html.erb +11 -0
- data/previews/docs/beta_truncate_preview/multiple_items.html.erb +6 -0
- data/previews/docs/beta_truncate_preview.rb +17 -0
- data/previews/docs/blankslate_component_preview/action_button.html.erb +8 -0
- data/previews/docs/blankslate_component_preview/basic.html.erb +4 -0
- data/previews/docs/blankslate_component_preview/custom_content.html.erb +5 -0
- data/previews/docs/blankslate_component_preview/icon.html.erb +5 -0
- data/previews/docs/blankslate_component_preview/link.html.erb +7 -0
- data/previews/docs/blankslate_component_preview/loading.html.erb +6 -0
- data/previews/docs/blankslate_component_preview/variations.html.erb +8 -0
- data/previews/docs/blankslate_component_preview.rb +19 -0
- data/previews/docs/box_preview/color_and_padding.html.erb +1 -0
- data/previews/docs/box_preview/default.html.erb +1 -0
- data/previews/docs/box_preview.rb +9 -0
- data/previews/docs/button_component_preview/block.html.erb +2 -0
- data/previews/docs/button_component_preview/schemes.html.erb +6 -0
- data/previews/docs/button_component_preview/sizes.html.erb +2 -0
- data/previews/docs/button_component_preview/with_dropdown_caret.html.erb +3 -0
- data/previews/docs/button_component_preview/with_leading_and_trailing_visuals.html.erb +5 -0
- data/previews/docs/button_component_preview/with_leading_visual.html.erb +4 -0
- data/previews/docs/button_component_preview/with_tooltip.html.erb +4 -0
- data/previews/docs/button_component_preview/with_trailing_visual.html.erb +4 -0
- data/previews/docs/button_component_preview.rb +21 -0
- data/previews/docs/dropdown_preview/customizing_menu_items.html.erb +11 -0
- data/previews/docs/dropdown_preview/customizing_the_button.html.erb +12 -0
- data/previews/docs/dropdown_preview/default.html.erb +11 -0
- data/previews/docs/dropdown_preview/menu_as_list.html.erb +13 -0
- data/previews/docs/dropdown_preview/with_caret.html.erb +12 -0
- data/previews/docs/dropdown_preview/with_direction.html.erb +12 -0
- data/previews/docs/dropdown_preview/with_dividers.html.erb +16 -0
- data/previews/docs/dropdown_preview.rb +19 -0
- data/previews/docs/hellip_button_preview/default.html.erb +1 -0
- data/previews/docs/hellip_button_preview/inline.html.erb +1 -0
- data/previews/docs/hellip_button_preview/styling_the_button.html.erb +1 -0
- data/previews/docs/hellip_button_preview.rb +11 -0
- data/previews/docs/icon_button_preview/custom_tooltip_direction.html.erb +2 -0
- data/previews/docs/icon_button_preview/default.html.erb +2 -0
- data/previews/docs/icon_button_preview/in_a_borderbox.html.erb +7 -0
- data/previews/docs/icon_button_preview/schemes.html.erb +3 -0
- data/previews/docs/icon_button_preview/with_an_aria_description.html.erb +1 -0
- data/previews/docs/icon_button_preview.rb +15 -0
- data/previews/docs/label_component_preview/inline.html.erb +2 -0
- data/previews/docs/label_component_preview/schemes.html.erb +10 -0
- data/previews/docs/label_component_preview/sizes.html.erb +2 -0
- data/previews/docs/label_component_preview.rb +11 -0
- data/previews/docs/layout_component_preview/default.html.erb +4 -0
- data/previews/docs/layout_component_preview/left_sidebar.html.erb +4 -0
- data/previews/docs/layout_component_preview.rb +9 -0
- data/previews/docs/link_component_preview/default.html.erb +1 -0
- data/previews/docs/link_component_preview/muted.html.erb +1 -0
- data/previews/docs/link_component_preview/schemes.html.erb +2 -0
- data/previews/docs/link_component_preview/with_tooltip.html.erb +4 -0
- data/previews/docs/link_component_preview/without_underline.html.erb +1 -0
- data/previews/docs/link_component_preview.rb +15 -0
- data/previews/docs/local_time_preview/all_the_options.html.erb +1 -0
- data/previews/docs/local_time_preview/default.html.erb +1 -0
- data/previews/docs/local_time_preview/with_initial_content.html.erb +4 -0
- data/previews/docs/local_time_preview.rb +11 -0
- data/previews/docs/markdown_preview/default.html.erb +260 -0
- data/previews/docs/markdown_preview.rb +7 -0
- data/previews/docs/menu_component_preview/default.html.erb +17 -0
- data/previews/docs/menu_component_preview.rb +7 -0
- data/previews/docs/navigation_tab_component_preview/default.html.erb +6 -0
- data/previews/docs/navigation_tab_component_preview/inside_a_list.html.erb +3 -0
- data/previews/docs/navigation_tab_component_preview/with_custom_html.html.erb +5 -0
- data/previews/docs/navigation_tab_component_preview/with_icons_and_counters.html.erb +13 -0
- data/previews/docs/navigation_tab_component_preview.rb +13 -0
- data/previews/docs/octicon_component_preview/default.html.erb +2 -0
- data/previews/docs/octicon_component_preview/helper.html.erb +1 -0
- data/previews/docs/octicon_component_preview/medium.html.erb +1 -0
- data/previews/docs/octicon_component_preview.rb +11 -0
- data/previews/docs/octicon_symbols_component_preview/symbol_dictionary.html.erb +4 -0
- data/previews/docs/octicon_symbols_component_preview.rb +7 -0
- data/previews/docs/popover_component_preview/caret_position.html.erb +8 -0
- data/previews/docs/popover_component_preview/default.html.erb +8 -0
- data/previews/docs/popover_component_preview/large.html.erb +8 -0
- data/previews/docs/popover_component_preview/with_multiple_elements_in_the_body.html.erb +11 -0
- data/previews/docs/popover_component_preview.rb +13 -0
- data/previews/docs/spinner_component_preview/default.html.erb +1 -0
- data/previews/docs/spinner_component_preview/large.html.erb +1 -0
- data/previews/docs/spinner_component_preview/small.html.erb +1 -0
- data/previews/docs/spinner_component_preview.rb +11 -0
- data/previews/docs/state_component_preview/default.html.erb +1 -0
- data/previews/docs/state_component_preview/schemes.html.erb +4 -0
- data/previews/docs/state_component_preview/sizes.html.erb +2 -0
- data/previews/docs/state_component_preview.rb +11 -0
- data/previews/docs/subhead_component_preview/default.html.erb +8 -0
- data/previews/docs/subhead_component_preview/with_actions.html.erb +15 -0
- data/previews/docs/subhead_component_preview/with_dangerous_heading.html.erb +8 -0
- data/previews/docs/subhead_component_preview/with_long_description.html.erb +6 -0
- data/previews/docs/subhead_component_preview/without_border.html.erb +8 -0
- data/previews/docs/subhead_component_preview.rb +15 -0
- data/previews/docs/tab_container_component_preview/default.html.erb +16 -0
- data/previews/docs/tab_container_component_preview.rb +7 -0
- data/previews/docs/time_ago_component_preview/default.html.erb +1 -0
- data/previews/docs/time_ago_component_preview.rb +7 -0
- data/previews/docs/timeline_item_component_preview/default.html.erb +7 -0
- data/previews/docs/timeline_item_component_preview.rb +7 -0
- data/previews/docs/tooltip_preview/default.html.erb +3 -0
- data/previews/docs/tooltip_preview/with_a_direction.html.erb +3 -0
- data/previews/docs/tooltip_preview/with_an_alignment.html.erb +3 -0
- data/previews/docs/tooltip_preview/without_a_delay.html.erb +3 -0
- data/previews/docs/tooltip_preview/wrapping_another_component.html.erb +5 -0
- data/previews/docs/tooltip_preview.rb +15 -0
- data/previews/docs/truncate_preview/custom_size.html.erb +1 -0
- data/previews/docs/truncate_preview/default.html.erb +3 -0
- data/previews/docs/truncate_preview/expandable.html.erb +1 -0
- data/previews/docs/truncate_preview/inline.html.erb +1 -0
- data/previews/docs/truncate_preview/with_html_content.html.erb +3 -0
- data/previews/docs/truncate_preview.rb +15 -0
- data/previews/yattho/alpha/action_list_preview/heading.html.erb +4 -0
- data/previews/yattho/alpha/action_list_preview.rb +367 -0
- data/previews/yattho/alpha/auto_complete_preview.rb +120 -0
- data/previews/yattho/alpha/banner_preview/with_action_button.html.erb +4 -0
- data/previews/yattho/alpha/banner_preview/with_action_content.html.erb +6 -0
- data/previews/yattho/alpha/banner_preview.rb +97 -0
- data/previews/yattho/alpha/button_marketing_preview.rb +62 -0
- data/previews/yattho/alpha/dialog_preview/body_has_scrollbar_overflow.html.erb +9 -0
- data/previews/yattho/alpha/dialog_preview/custom_header.html.erb +7 -0
- data/previews/yattho/alpha/dialog_preview/nested_dialog.html.erb +14 -0
- data/previews/yattho/alpha/dialog_preview/test.html.erb +7 -0
- data/previews/yattho/alpha/dialog_preview/with_footer.html.erb +8 -0
- data/previews/yattho/alpha/dialog_preview/with_form.html.erb +12 -0
- data/previews/yattho/alpha/dialog_preview/with_text_input.html.erb +10 -0
- data/previews/yattho/alpha/dialog_preview.rb +147 -0
- data/previews/yattho/alpha/dropdown_preview.rb +210 -0
- data/previews/yattho/alpha/hellip_button_preview.rb +24 -0
- data/previews/yattho/alpha/hidden_text_expander_preview.rb +22 -0
- data/previews/yattho/alpha/image_crop_preview.rb +31 -0
- data/previews/yattho/alpha/layout_preview.rb +211 -0
- data/previews/yattho/alpha/menu_preview/default.html.erb +17 -0
- data/previews/yattho/alpha/menu_preview/playground.html.erb +17 -0
- data/previews/yattho/alpha/menu_preview.rb +14 -0
- data/previews/yattho/alpha/nav_list_preview.rb +93 -0
- data/previews/yattho/alpha/segmented_control_preview.rb +164 -0
- data/previews/yattho/alpha/tab_nav_preview.rb +55 -0
- data/previews/yattho/alpha/tab_panels_preview.rb +38 -0
- data/previews/yattho/alpha/text_field_preview.rb +149 -0
- data/previews/yattho/alpha/toggle_switch_preview.rb +56 -0
- data/previews/yattho/alpha/tooltip_preview/with_multiple_on_a_page.html.erb +14 -0
- data/previews/yattho/alpha/tooltip_preview/with_right_most_position.html.erb +7 -0
- data/previews/yattho/alpha/tooltip_preview.rb +93 -0
- data/previews/yattho/alpha/underline_nav_preview/default.html.erb +8 -0
- data/previews/yattho/alpha/underline_nav_preview/playground.html.erb +8 -0
- data/previews/yattho/alpha/underline_nav_preview.rb +56 -0
- data/previews/yattho/alpha/underline_panels_preview.rb +38 -0
- data/previews/yattho/beta/auto_complete_item_preview/default.html.erb +9 -0
- data/previews/yattho/beta/auto_complete_item_preview/playground.html.erb +9 -0
- data/previews/yattho/beta/auto_complete_item_preview/with_description.html.erb +11 -0
- data/previews/yattho/beta/auto_complete_item_preview.rb +54 -0
- data/previews/yattho/beta/auto_complete_preview/with_submit_button.html.erb +20 -0
- data/previews/yattho/beta/auto_complete_preview.rb +267 -0
- data/previews/yattho/beta/avatar_preview.rb +82 -0
- data/previews/yattho/beta/avatar_stack_preview.rb +101 -0
- data/previews/yattho/beta/base_button_preview.rb +26 -0
- data/previews/yattho/beta/blankslate_preview.rb +130 -0
- data/previews/yattho/beta/border_box_preview.rb +98 -0
- data/previews/yattho/beta/breadcrumbs_preview.rb +30 -0
- data/previews/yattho/beta/button_group_preview.rb +32 -0
- data/previews/yattho/beta/button_preview/all_schemes.html.erb +26 -0
- data/previews/yattho/beta/button_preview/invisible_all_visuals.html.erb +54 -0
- data/previews/yattho/beta/button_preview/leading_visual.html.erb +10 -0
- data/previews/yattho/beta/button_preview/trailing_action.html.erb +10 -0
- data/previews/yattho/beta/button_preview/trailing_visual.html.erb +11 -0
- data/previews/yattho/beta/button_preview/with_tooltip.html.erb +10 -0
- data/previews/yattho/beta/button_preview.rb +291 -0
- data/previews/yattho/beta/clipboard_copy_preview/element.html.erb +2 -0
- data/previews/yattho/beta/clipboard_copy_preview.rb +39 -0
- data/previews/yattho/beta/close_button_preview.rb +22 -0
- data/previews/yattho/beta/counter_preview.rb +82 -0
- data/previews/yattho/beta/details_preview.rb +60 -0
- data/previews/yattho/beta/flash_preview.rb +69 -0
- data/previews/yattho/beta/heading_preview.rb +24 -0
- data/previews/yattho/beta/icon_button_preview.rb +110 -0
- data/previews/yattho/beta/label_preview.rb +104 -0
- data/previews/yattho/beta/link_preview.rb +69 -0
- data/previews/yattho/beta/markdown_preview.rb +241 -0
- data/previews/yattho/beta/octicon_preview.rb +24 -0
- data/previews/yattho/beta/popover_preview.rb +79 -0
- data/previews/yattho/beta/progress_bar_preview.rb +60 -0
- data/previews/yattho/beta/relative_time_preview.rb +286 -0
- data/previews/yattho/beta/spinner_preview.rb +22 -0
- data/previews/yattho/beta/state_preview.rb +66 -0
- data/previews/yattho/beta/subhead_preview/actions.html.erb +13 -0
- data/previews/yattho/beta/subhead_preview.rb +99 -0
- data/previews/yattho/beta/text_preview.rb +24 -0
- data/previews/yattho/beta/timeline_item_preview.rb +30 -0
- data/previews/yattho/beta/truncate_preview.rb +54 -0
- data/previews/yattho/forms/forms_preview/after_content_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/array_check_box_group_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/caption_template_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/check_box_group_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/check_box_with_nested_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/composed_form.html.erb +4 -0
- data/previews/yattho/forms/forms_preview/example_toggle_switch_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/horizontal_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/immediate_validation_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/invalid_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/multi_input_form.html.erb +14 -0
- data/previews/yattho/forms/forms_preview/multi_text_field_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/name_with_question_mark_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/radio_button_group_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/radio_button_with_nested_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/select_list_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/single_text_field_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/submit_button_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview/text_field_and_checkbox_form.html.erb +3 -0
- data/previews/yattho/forms/forms_preview.rb +46 -0
- data/previews/yattho/layout_component_preview.rb +30 -0
- data/previews/yattho/local_time_component_preview.rb +61 -0
- data/previews/yattho/time_ago_component_preview.rb +27 -0
- data/previews/yattho/url_helpers.rb +15 -0
- data/static/arguments.json +2560 -0
- data/static/assets/view-components.svg +18 -0
- data/static/audited_at.json +103 -0
- data/static/constants.json +1159 -0
- data/static/statuses.json +103 -0
- metadata +1403 -0
@@ -0,0 +1,370 @@
|
|
1
|
+
import type {AnchorAlignment, AnchorSide} from '@primer/behaviors'
|
2
|
+
import {getAnchoredPosition} from '@primer/behaviors'
|
3
|
+
|
4
|
+
const TOOLTIP_OPEN_CLASS = 'tooltip-open'
|
5
|
+
const TOOLTIP_ARROW_EDGE_OFFSET = 6
|
6
|
+
const TOOLTIP_SR_ONLY_CLASS = 'sr-only'
|
7
|
+
|
8
|
+
type Direction = 'n' | 's' | 'e' | 'w' | 'ne' | 'se' | 'nw' | 'sw'
|
9
|
+
|
10
|
+
const DIRECTION_CLASSES = [
|
11
|
+
'tooltip-n',
|
12
|
+
'tooltip-s',
|
13
|
+
'tooltip-e',
|
14
|
+
'tooltip-w',
|
15
|
+
'tooltip-ne',
|
16
|
+
'tooltip-se',
|
17
|
+
'tooltip-nw',
|
18
|
+
'tooltip-sw'
|
19
|
+
]
|
20
|
+
|
21
|
+
class ToolTipElement extends HTMLElement {
|
22
|
+
styles() {
|
23
|
+
return `
|
24
|
+
:host {
|
25
|
+
position: absolute;
|
26
|
+
z-index: 1000000;
|
27
|
+
padding: .5em .75em;
|
28
|
+
font: normal normal 11px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
29
|
+
-webkit-font-smoothing: subpixel-antialiased;
|
30
|
+
color: var(--color-fg-on-emphasis);
|
31
|
+
text-align: center;
|
32
|
+
text-decoration: none;
|
33
|
+
text-shadow: none;
|
34
|
+
text-transform: none;
|
35
|
+
letter-spacing: normal;
|
36
|
+
word-wrap: break-word;
|
37
|
+
white-space: pre;
|
38
|
+
background: var(--color-neutral-emphasis-plus);
|
39
|
+
border-radius: 6px;
|
40
|
+
opacity: 0;
|
41
|
+
max-width: 250px;
|
42
|
+
word-wrap: break-word;
|
43
|
+
white-space: normal;
|
44
|
+
width: max-content;
|
45
|
+
}
|
46
|
+
:host:before{
|
47
|
+
position: absolute;
|
48
|
+
z-index: 1000001;
|
49
|
+
color: var(--color-neutral-emphasis-plus);
|
50
|
+
content: "";
|
51
|
+
border: 6px solid transparent;
|
52
|
+
opacity: 0
|
53
|
+
}
|
54
|
+
@keyframes tooltip-appear {
|
55
|
+
from {
|
56
|
+
opacity: 0
|
57
|
+
}
|
58
|
+
to {
|
59
|
+
opacity: 1
|
60
|
+
}
|
61
|
+
}
|
62
|
+
:host:after{
|
63
|
+
position: absolute;
|
64
|
+
display: block;
|
65
|
+
right: 0;
|
66
|
+
left: 0;
|
67
|
+
height: 12px;
|
68
|
+
content: ""
|
69
|
+
}
|
70
|
+
:host(.${TOOLTIP_OPEN_CLASS}),
|
71
|
+
:host(.${TOOLTIP_OPEN_CLASS}):before {
|
72
|
+
animation-name: tooltip-appear;
|
73
|
+
animation-duration: .1s;
|
74
|
+
animation-fill-mode: forwards;
|
75
|
+
animation-timing-function: ease-in;
|
76
|
+
animation-delay: .4s
|
77
|
+
}
|
78
|
+
:host(.tooltip-s):before,
|
79
|
+
:host(.tooltip-n):before {
|
80
|
+
right: 50%;
|
81
|
+
margin-right: -${TOOLTIP_ARROW_EDGE_OFFSET}px;
|
82
|
+
}
|
83
|
+
:host(.tooltip-s):before,
|
84
|
+
:host(.tooltip-se):before,
|
85
|
+
:host(.tooltip-sw):before {
|
86
|
+
bottom: 100%;
|
87
|
+
border-bottom-color: var(--color-neutral-emphasis-plus)
|
88
|
+
}
|
89
|
+
:host(.tooltip-s):after,
|
90
|
+
:host(.tooltip-se):after,
|
91
|
+
:host(.tooltip-sw):after {
|
92
|
+
bottom: 100%
|
93
|
+
}
|
94
|
+
:host(.tooltip-n):before,
|
95
|
+
:host(.tooltip-ne):before,
|
96
|
+
:host(.tooltip-nw):before {
|
97
|
+
top: 100%;
|
98
|
+
border-top-color: var(--color-neutral-emphasis-plus)
|
99
|
+
}
|
100
|
+
:host(.tooltip-n):after,
|
101
|
+
:host(.tooltip-ne):after,
|
102
|
+
:host(.tooltip-nw):after {
|
103
|
+
top: 100%
|
104
|
+
}
|
105
|
+
:host(.tooltip-se):before,
|
106
|
+
:host(.tooltip-ne):before {
|
107
|
+
left: 0;
|
108
|
+
margin-left: ${TOOLTIP_ARROW_EDGE_OFFSET}px;
|
109
|
+
}
|
110
|
+
:host(.tooltip-sw):before,
|
111
|
+
:host(.tooltip-nw):before {
|
112
|
+
right: 0;
|
113
|
+
margin-right: ${TOOLTIP_ARROW_EDGE_OFFSET}px;
|
114
|
+
}
|
115
|
+
:host(.tooltip-w):before {
|
116
|
+
top: 50%;
|
117
|
+
bottom: 50%;
|
118
|
+
left: 100%;
|
119
|
+
margin-top: -6px;
|
120
|
+
border-left-color: var(--color-neutral-emphasis-plus)
|
121
|
+
}
|
122
|
+
:host(.tooltip-e):before {
|
123
|
+
top: 50%;
|
124
|
+
right: 100%;
|
125
|
+
bottom: 50%;
|
126
|
+
margin-top: -6px;
|
127
|
+
border-right-color: var(--color-neutral-emphasis-plus)
|
128
|
+
}
|
129
|
+
`
|
130
|
+
}
|
131
|
+
|
132
|
+
#abortController: AbortController | undefined
|
133
|
+
#align: AnchorAlignment = 'center'
|
134
|
+
#side: AnchorSide = 'outside-bottom'
|
135
|
+
#allowUpdatePosition = false
|
136
|
+
|
137
|
+
get htmlFor(): string {
|
138
|
+
return this.getAttribute('for') || ''
|
139
|
+
}
|
140
|
+
|
141
|
+
set htmlFor(value: string) {
|
142
|
+
this.setAttribute('for', value)
|
143
|
+
}
|
144
|
+
|
145
|
+
get type(): 'description' | 'label' {
|
146
|
+
const type = this.getAttribute('data-type')
|
147
|
+
return type === 'label' ? 'label' : 'description'
|
148
|
+
}
|
149
|
+
|
150
|
+
set type(value: 'description' | 'label') {
|
151
|
+
this.setAttribute('data-type', value)
|
152
|
+
}
|
153
|
+
|
154
|
+
get direction(): Direction {
|
155
|
+
return (this.getAttribute('data-direction') || 's') as Direction
|
156
|
+
}
|
157
|
+
|
158
|
+
set direction(value: Direction) {
|
159
|
+
this.setAttribute('data-direction', value)
|
160
|
+
}
|
161
|
+
|
162
|
+
get control(): HTMLElement | null {
|
163
|
+
return this.ownerDocument.getElementById(this.htmlFor)
|
164
|
+
}
|
165
|
+
|
166
|
+
set hiddenFromView(value: true | false) {
|
167
|
+
this.classList.toggle(TOOLTIP_SR_ONLY_CLASS, value)
|
168
|
+
if (this.isConnected) this.#update()
|
169
|
+
}
|
170
|
+
|
171
|
+
get hiddenFromView() {
|
172
|
+
return this.classList.contains(TOOLTIP_SR_ONLY_CLASS)
|
173
|
+
}
|
174
|
+
|
175
|
+
connectedCallback() {
|
176
|
+
this.#updateControlReference()
|
177
|
+
this.#updateDirection()
|
178
|
+
if (!this.shadowRoot) {
|
179
|
+
const shadow = this.attachShadow({mode: 'open'})
|
180
|
+
const style = shadow.appendChild(document.createElement('style'))
|
181
|
+
style.textContent = this.styles()
|
182
|
+
shadow.appendChild(document.createElement('slot'))
|
183
|
+
}
|
184
|
+
this.hiddenFromView = true
|
185
|
+
this.#allowUpdatePosition = true
|
186
|
+
|
187
|
+
if (!this.control) return
|
188
|
+
|
189
|
+
this.setAttribute('role', 'tooltip')
|
190
|
+
|
191
|
+
this.#abortController?.abort()
|
192
|
+
this.#abortController = new AbortController()
|
193
|
+
const {signal} = this.#abortController
|
194
|
+
|
195
|
+
this.addEventListener('mouseleave', this, {signal})
|
196
|
+
this.control.addEventListener('mouseenter', this, {signal})
|
197
|
+
this.control.addEventListener('mouseleave', this, {signal})
|
198
|
+
this.control.addEventListener('focus', this, {signal})
|
199
|
+
this.control.addEventListener('blur', this, {signal})
|
200
|
+
this.ownerDocument.addEventListener('keydown', this, {signal})
|
201
|
+
this.#update()
|
202
|
+
}
|
203
|
+
|
204
|
+
disconnectedCallback() {
|
205
|
+
this.#abortController?.abort()
|
206
|
+
}
|
207
|
+
|
208
|
+
handleEvent(event: Event) {
|
209
|
+
if (!this.control) return
|
210
|
+
|
211
|
+
// Ensures that tooltip stays open when hovering between tooltip and element
|
212
|
+
// WCAG Success Criterion 1.4.13 Hoverable
|
213
|
+
if ((event.type === 'mouseenter' || event.type === 'focus') && this.hiddenFromView) {
|
214
|
+
this.hiddenFromView = false
|
215
|
+
} else if (event.type === 'blur') {
|
216
|
+
this.hiddenFromView = true
|
217
|
+
} else if (
|
218
|
+
event.type === 'mouseleave' &&
|
219
|
+
(event as MouseEvent).relatedTarget !== this.control &&
|
220
|
+
(event as MouseEvent).relatedTarget !== this
|
221
|
+
) {
|
222
|
+
this.hiddenFromView = true
|
223
|
+
} else if (event.type === 'keydown' && (event as KeyboardEvent).key === 'Escape' && !this.hiddenFromView) {
|
224
|
+
this.hiddenFromView = true
|
225
|
+
}
|
226
|
+
}
|
227
|
+
|
228
|
+
static observedAttributes = ['data-type', 'data-direction', 'id']
|
229
|
+
|
230
|
+
#update() {
|
231
|
+
if (this.hiddenFromView) {
|
232
|
+
this.classList.remove(TOOLTIP_OPEN_CLASS, ...DIRECTION_CLASSES)
|
233
|
+
} else {
|
234
|
+
this.classList.add(TOOLTIP_OPEN_CLASS)
|
235
|
+
for (const tooltip of this.ownerDocument.querySelectorAll<ToolTipElement>(this.tagName)) {
|
236
|
+
if (tooltip !== this) tooltip.hiddenFromView = true
|
237
|
+
}
|
238
|
+
this.#updatePosition()
|
239
|
+
}
|
240
|
+
}
|
241
|
+
|
242
|
+
attributeChangedCallback(name: string) {
|
243
|
+
if (!this.isConnected) return
|
244
|
+
|
245
|
+
if (name === 'id' || name === 'data-type') {
|
246
|
+
this.#updateControlReference()
|
247
|
+
} else if (name === 'data-direction') {
|
248
|
+
this.#updateDirection()
|
249
|
+
}
|
250
|
+
}
|
251
|
+
|
252
|
+
#updateControlReference() {
|
253
|
+
if (!this.id || !this.control) return
|
254
|
+
if (this.type === 'label') {
|
255
|
+
let labelledBy = this.control.getAttribute('aria-labelledby')
|
256
|
+
if (labelledBy) {
|
257
|
+
if (!labelledBy.split(' ').includes(this.id)) {
|
258
|
+
labelledBy = `${labelledBy} ${this.id}`
|
259
|
+
} else {
|
260
|
+
labelledBy = `${labelledBy}`
|
261
|
+
}
|
262
|
+
} else {
|
263
|
+
labelledBy = this.id
|
264
|
+
}
|
265
|
+
this.control.setAttribute('aria-labelledby', labelledBy)
|
266
|
+
|
267
|
+
// Prevent duplicate accessible name announcements.
|
268
|
+
this.setAttribute('aria-hidden', 'true')
|
269
|
+
} else {
|
270
|
+
let describedBy = this.control.getAttribute('aria-describedby')
|
271
|
+
if (describedBy) {
|
272
|
+
if (!describedBy.split(' ').includes(this.id)) {
|
273
|
+
describedBy = `${describedBy} ${this.id}`
|
274
|
+
} else {
|
275
|
+
describedBy = `${describedBy}`
|
276
|
+
}
|
277
|
+
} else {
|
278
|
+
describedBy = this.id
|
279
|
+
}
|
280
|
+
this.control.setAttribute('aria-describedby', describedBy)
|
281
|
+
}
|
282
|
+
}
|
283
|
+
|
284
|
+
#updateDirection() {
|
285
|
+
this.classList.remove(...DIRECTION_CLASSES)
|
286
|
+
const direction = this.direction
|
287
|
+
if (direction === 'n') {
|
288
|
+
this.#align = 'center'
|
289
|
+
this.#side = 'outside-top'
|
290
|
+
} else if (direction === 'ne') {
|
291
|
+
this.#align = 'start'
|
292
|
+
this.#side = 'outside-top'
|
293
|
+
} else if (direction === 'e') {
|
294
|
+
this.#align = 'center'
|
295
|
+
this.#side = 'outside-right'
|
296
|
+
} else if (direction === 'se') {
|
297
|
+
this.#align = 'start'
|
298
|
+
this.#side = 'outside-bottom'
|
299
|
+
} else if (direction === 's') {
|
300
|
+
this.#align = 'center'
|
301
|
+
this.#side = 'outside-bottom'
|
302
|
+
} else if (direction === 'sw') {
|
303
|
+
this.#align = 'end'
|
304
|
+
this.#side = 'outside-bottom'
|
305
|
+
} else if (direction === 'w') {
|
306
|
+
this.#align = 'center'
|
307
|
+
this.#side = 'outside-left'
|
308
|
+
} else if (direction === 'nw') {
|
309
|
+
this.#align = 'end'
|
310
|
+
this.#side = 'outside-top'
|
311
|
+
}
|
312
|
+
}
|
313
|
+
|
314
|
+
#updatePosition() {
|
315
|
+
if (!this.control) return
|
316
|
+
if (!this.#allowUpdatePosition || this.hiddenFromView) return
|
317
|
+
|
318
|
+
const TOOLTIP_OFFSET = 10
|
319
|
+
|
320
|
+
this.style.left = `0px` // Ensures we have reliable tooltip width in `getAnchoredPosition`
|
321
|
+
|
322
|
+
const position = getAnchoredPosition(this, this.control, {
|
323
|
+
side: this.#side,
|
324
|
+
align: this.#align,
|
325
|
+
anchorOffset: TOOLTIP_OFFSET
|
326
|
+
})
|
327
|
+
const anchorSide = position.anchorSide
|
328
|
+
const align = position.anchorAlign
|
329
|
+
|
330
|
+
this.style.top = `${position.top}px`
|
331
|
+
this.style.left = `${position.left}px`
|
332
|
+
|
333
|
+
let direction: Direction = 's'
|
334
|
+
|
335
|
+
if (anchorSide === 'outside-left') {
|
336
|
+
direction = 'w'
|
337
|
+
} else if (anchorSide === 'outside-right') {
|
338
|
+
direction = 'e'
|
339
|
+
} else if (anchorSide === 'outside-top') {
|
340
|
+
if (align === 'center') {
|
341
|
+
direction = 'n'
|
342
|
+
} else if (align === 'start') {
|
343
|
+
direction = 'ne'
|
344
|
+
} else {
|
345
|
+
direction = 'nw'
|
346
|
+
}
|
347
|
+
} else {
|
348
|
+
if (align === 'center') {
|
349
|
+
direction = 's'
|
350
|
+
} else if (align === 'start') {
|
351
|
+
direction = 'se'
|
352
|
+
} else {
|
353
|
+
direction = 'sw'
|
354
|
+
}
|
355
|
+
}
|
356
|
+
|
357
|
+
this.classList.add(`tooltip-${direction}`)
|
358
|
+
}
|
359
|
+
}
|
360
|
+
|
361
|
+
if (!window.customElements.get('tool-tip')) {
|
362
|
+
window.ToolTipElement = ToolTipElement
|
363
|
+
window.customElements.define('tool-tip', ToolTipElement)
|
364
|
+
}
|
365
|
+
|
366
|
+
declare global {
|
367
|
+
interface Window {
|
368
|
+
ToolTipElement: typeof ToolTipElement
|
369
|
+
}
|
370
|
+
}
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Yattho
|
4
|
+
module Alpha
|
5
|
+
# `Tooltip` only appears on mouse hover or keyboard focus and contain a label or description text. Use tooltips sparingly and as a last resort.
|
6
|
+
# Use tooltips as a last resort. Please consider [Tooltips alternatives](https://yattho.com/design/accessibility/tooltip-alternatives).
|
7
|
+
#
|
8
|
+
# When using a tooltip, follow the provided guidelines to avoid accessibility issues:
|
9
|
+
# - Tooltips should contain only **non-essential text**. Tooltips can easily be missed and are not accessible on touch devices so never use tooltips to convey critical information.
|
10
|
+
# - `Tooltip` should be rendered through the API of <%= link_to_component(Yattho::ButtonComponent)%>, <%= link_to_component(Yattho::Beta::Link)%>, or <%= link_to_component(Yattho::IconButton)%>. Avoid using `Tooltip` a standalone component unless absolutely necessary (and **only** on interactive elements).
|
11
|
+
# @accessibility
|
12
|
+
# - Tooltip text must be brief and concise whether it is a label or a description.
|
13
|
+
# - Tooltip can only hold string content.
|
14
|
+
# - **Never set tooltips on static, non-interactive elements** like `span` or `div`. Tooltips should only be used on interactive elements like buttons or links to avoid excluding keyboard-only users
|
15
|
+
# and screen reader users. Use of tooltip through <%= link_to_component(Yattho::ButtonComponent) %>, <%= link_to_component(Yattho::Beta::Link) %>, or <%= link_to_component(Yattho::IconButton) %> will guarantee this.
|
16
|
+
# - If you must use `Tooltip` as a standalone component, place it adjacent after the trigger element in the DOM. This allows screen reader users to navigate to and copy the tooltip
|
17
|
+
# content.
|
18
|
+
# ### Which type should I set?
|
19
|
+
# Semantically, a tooltip will either act an accessible name or an accessible description for the element that it is associated with resulting in either a
|
20
|
+
# `aria-labelledby` or an `aria-describedby` association. The `type` drastically changes semantics and screen reader behavior so follow these guidelines carefully:
|
21
|
+
# - When there is already a visible label text on the trigger element, the tooltip is likely intended be supplementary, so set `type: :description`.
|
22
|
+
# The majority of tooltips will fall under this category.
|
23
|
+
# - When there is no visible text on the trigger element and the tooltip content is appropriate as a label for the element, set `type: :label`.
|
24
|
+
# `label` type is usually only appropriate for an icon-only control.
|
25
|
+
class Tooltip < Yattho::Component
|
26
|
+
DIRECTION_DEFAULT = :s
|
27
|
+
DIRECTION_OPTIONS = [DIRECTION_DEFAULT, :n, :e, :w, :ne, :nw, :se, :sw].freeze
|
28
|
+
|
29
|
+
TYPE_FALLBACK = :description
|
30
|
+
TYPE_OPTIONS = [:label, :description].freeze
|
31
|
+
# @example As a supplementary description for a button
|
32
|
+
# @description
|
33
|
+
# In this example, the button has a visible label text, "Save". `type: :description` is set because the tooltip content is supplementary.
|
34
|
+
# A screen reader user who encounters this button will hear the accessible name, "Save" followed by the accessible description, "This will immediately impact all organization members".
|
35
|
+
# @code
|
36
|
+
# <%= render(Yattho::ButtonComponent.new(id: "save-button")) do |component| %>
|
37
|
+
# <% component.with_tooltip(text: "This will immediately impact all organization members", type: :description, direction: :ne) %>
|
38
|
+
# Save
|
39
|
+
# <% end %>
|
40
|
+
# @example As a label for an `IconButton`
|
41
|
+
# @description
|
42
|
+
# An `IconButton` of `tag: :button` and `tag: :a` will render a tooltip using the `aria-label` content by default. While tooltips should generally be avoided, a tooltip on an `IconButton`
|
43
|
+
# has usability benefits because it provides a textual label for sighted users.
|
44
|
+
# A screen reader user who encounters the following button will hear the accessible name, "Bold".
|
45
|
+
# @code
|
46
|
+
# <%= render(Yattho::IconButton.new(id: "bold-button-0", icon: :bold, "aria-label": "Bold")) %>
|
47
|
+
# @example As a supplementary description for an `IconButton`
|
48
|
+
# @description
|
49
|
+
# If you want to provide a description for the `IconButton`, set both `aria-label` and `aria-description` text. The tooltip will use the `aria-description` text.
|
50
|
+
# A screen reader user who encounters the following button will hear the accessible name "Search", followed by the accessible description "Use keywords like 'repo:' and 'org:' in your query".
|
51
|
+
# @code
|
52
|
+
# <%= render(Yattho::IconButton.new(id: "search-button", icon: :search, "aria-label": "Search", "aria-description": "Use keywords like 'repo:' and 'org:' in your query")) %>
|
53
|
+
#
|
54
|
+
# @example With direction
|
55
|
+
# @description
|
56
|
+
# Set direction of tooltip with `direction`. The tooltip is responsive and will automatically adjust direction to avoid cutting off.
|
57
|
+
# @code
|
58
|
+
# <%= render(Yattho::ButtonComponent.new(id: "North", m: 2)) do |component| %>
|
59
|
+
# <% component.with_tooltip(text: "This is a North-facing tooltip, and is responsive.", type: :description, direction: :n) %>
|
60
|
+
# North
|
61
|
+
# <% end %>
|
62
|
+
# <%= render(Yattho::ButtonComponent.new(id: "South", m: 2)) do |component| %>
|
63
|
+
# <% component.with_tooltip(text: "This is a South-facing tooltip, and is responsive.", type: :description, direction: :s) %>
|
64
|
+
# South
|
65
|
+
# <% end %>
|
66
|
+
# <%= render(Yattho::ButtonComponent.new(id: "East", m: 2)) do |component| %>
|
67
|
+
# <% component.with_tooltip(text: "This is a East-facing tooltip, and is responsive.", type: :description, direction: :e) %>
|
68
|
+
# East
|
69
|
+
# <% end %>
|
70
|
+
# <%= render(Yattho::ButtonComponent.new(id: "West", m: 2)) do |component| %>
|
71
|
+
# <% component.with_tooltip(text: "This is a West-facing tooltip, and is responsive.", type: :description, direction: :w) %>
|
72
|
+
# West
|
73
|
+
# <% end %>
|
74
|
+
# <%= render(Yattho::ButtonComponent.new(id: "Northwest", m: 2)) do |component| %>
|
75
|
+
# <% component.with_tooltip(text: "This is a Northwest-facing tooltip, and is responsive.", type: :description, direction: :nw) %>
|
76
|
+
# Northwest
|
77
|
+
# <% end %>
|
78
|
+
# <%= render(Yattho::ButtonComponent.new(id: "Southwest", m: 2)) do |component| %>
|
79
|
+
# <% component.with_tooltip(text: "This is a Southwest-facing tooltip, and is responsive.", type: :description, direction: :sw) %>
|
80
|
+
# Southwest
|
81
|
+
# <% end %>
|
82
|
+
# <%= render(Yattho::ButtonComponent.new(id: "Northeast", m: 2)) do |component| %>
|
83
|
+
# <% component.with_tooltip(text: "This is a Northeast-facing tooltip, and is responsive.", type: :description, direction: :ne) %>
|
84
|
+
# Northeast
|
85
|
+
# <% end %>
|
86
|
+
# <%= render(Yattho::ButtonComponent.new(id: "Southeast", m: 2)) do |component| %>
|
87
|
+
# <% component.with_tooltip(text: "This is a Southeast-facing tooltip, and is responsive.", type: :description, direction: :se) %>
|
88
|
+
# Southeast
|
89
|
+
# <% end %>
|
90
|
+
# @example Directly using `Tooltip`
|
91
|
+
# @description
|
92
|
+
# When you have a valid tooltip usecase for an interactive element that is not one of the supported components, you may need to use the `Tooltip` component directly.
|
93
|
+
# The tooltip should be placed directly adjacent after the element you are associating it with.
|
94
|
+
# The tooltip is absolutely positioned so ensure there is a wrapper with `position: relative` to avoid positioning issues.
|
95
|
+
# @code
|
96
|
+
# <div style="position: relative;">
|
97
|
+
# <button type="button" id="test-button">Test</button>
|
98
|
+
# <%= render(Yattho::Alpha::Tooltip.new(for_id: "test-button", type: :description, text: "This tooltip should take up the full width", direction: :ne)) %>
|
99
|
+
# </div>
|
100
|
+
# @param for_id [String] The ID of the element that the tooltip should be attached to.
|
101
|
+
# @param type [Symbol] <%= one_of(Yattho::Alpha::Tooltip::TYPE_OPTIONS) %>
|
102
|
+
# @param direction [Symbol] <%= one_of(Yattho::Alpha::Tooltip::DIRECTION_OPTIONS) %>
|
103
|
+
# @param text [String] The text content of the tooltip. This should be brief and no longer than a sentence.
|
104
|
+
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
105
|
+
def initialize(type:, for_id:, text:, direction: DIRECTION_DEFAULT, **system_arguments)
|
106
|
+
raise TypeError, "tooltip text must be a string" unless text.is_a?(String)
|
107
|
+
|
108
|
+
@text = text
|
109
|
+
@system_arguments = system_arguments
|
110
|
+
@system_arguments[:id] ||= self.class.generate_id
|
111
|
+
@system_arguments[:tag] = :'tool-tip'
|
112
|
+
@system_arguments[:for] = for_id
|
113
|
+
@system_arguments[:classes] = class_names(
|
114
|
+
@system_arguments[:classes],
|
115
|
+
"sr-only"
|
116
|
+
)
|
117
|
+
@system_arguments[:position] = :absolute
|
118
|
+
@system_arguments[:'data-direction'] = fetch_or_fallback(DIRECTION_OPTIONS, direction, DIRECTION_DEFAULT).to_s
|
119
|
+
@system_arguments[:'data-type'] = fetch_or_fallback(TYPE_OPTIONS, type, TYPE_FALLBACK).to_s
|
120
|
+
end
|
121
|
+
|
122
|
+
def call
|
123
|
+
render(Yattho::BaseComponent.new(**@system_arguments)) { @text }
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
@@ -0,0 +1,148 @@
|
|
1
|
+
/* UnderlineNav */
|
2
|
+
|
3
|
+
.UnderlineNav {
|
4
|
+
display: flex;
|
5
|
+
min-height: var(--base-size-48, 48px);
|
6
|
+
overflow-x: auto;
|
7
|
+
overflow-y: hidden;
|
8
|
+
box-shadow: inset 0 -1px 0 var(--color-border-muted);
|
9
|
+
-webkit-overflow-scrolling: auto;
|
10
|
+
justify-content: space-between;
|
11
|
+
}
|
12
|
+
|
13
|
+
.UnderlineNav .Counter {
|
14
|
+
margin-left: var(--yattho-control-medium-gap, 8px);
|
15
|
+
color: var(--color-fg-default);
|
16
|
+
background-color: var(--color-neutral-muted);
|
17
|
+
}
|
18
|
+
|
19
|
+
.UnderlineNav .Counter--primary {
|
20
|
+
color: var(--color-fg-on-emphasis);
|
21
|
+
background-color: var(--color-neutral-emphasis);
|
22
|
+
}
|
23
|
+
|
24
|
+
.UnderlineNav-body {
|
25
|
+
display: flex;
|
26
|
+
align-items: center;
|
27
|
+
gap: var(--yattho-control-medium-gap, 8px);
|
28
|
+
list-style: none;
|
29
|
+
}
|
30
|
+
|
31
|
+
.UnderlineNav-item {
|
32
|
+
position: relative;
|
33
|
+
display: flex;
|
34
|
+
padding: 0 var(--yattho-control-medium-paddingInline-condensed, 8px);
|
35
|
+
font-size: var(--yattho-text-body-size-medium, 14px);
|
36
|
+
line-height: 30px;
|
37
|
+
color: var(--color-fg-default);
|
38
|
+
text-align: center;
|
39
|
+
white-space: nowrap;
|
40
|
+
cursor: pointer;
|
41
|
+
background-color: transparent;
|
42
|
+
border: 0;
|
43
|
+
border-radius: var(--yattho-borderRadius-medium, 6px);
|
44
|
+
align-items: center;
|
45
|
+
}
|
46
|
+
|
47
|
+
.UnderlineNav-item:hover,
|
48
|
+
.UnderlineNav-item:focus,
|
49
|
+
.UnderlineNav-item:focus-visible {
|
50
|
+
color: var(--color-fg-default);
|
51
|
+
text-decoration: none;
|
52
|
+
border-bottom-color: var(--color-neutral-muted);
|
53
|
+
outline-offset: -2px;
|
54
|
+
transition: border-bottom-color 0.12s ease-out;
|
55
|
+
}
|
56
|
+
|
57
|
+
/* renders a visibly hidden "copy" of the label in bold, reserving box space for when label becomes bold on selected */
|
58
|
+
|
59
|
+
.UnderlineNav-item [data-content]::before {
|
60
|
+
display: block;
|
61
|
+
height: 0;
|
62
|
+
font-weight: var(--base-text-weight-semibold, 600);
|
63
|
+
visibility: hidden;
|
64
|
+
content: attr(data-content);
|
65
|
+
}
|
66
|
+
|
67
|
+
/* increase touch target area */
|
68
|
+
|
69
|
+
.UnderlineNav-item::before {
|
70
|
+
position: absolute;
|
71
|
+
top: 50%;
|
72
|
+
left: 50%;
|
73
|
+
width: 100%;
|
74
|
+
height: 100%;
|
75
|
+
min-height: 48px;
|
76
|
+
content: "";
|
77
|
+
transform: translateX(-50%) translateY(-50%);
|
78
|
+
}
|
79
|
+
|
80
|
+
/* hover state was "sticking" on mobile after click */
|
81
|
+
|
82
|
+
@media (pointer: fine) {
|
83
|
+
.UnderlineNav-item:hover {
|
84
|
+
color: var(--color-fg-default);
|
85
|
+
text-decoration: none;
|
86
|
+
background: var(--color-action-list-item-default-hover-bg);
|
87
|
+
transition: background 0.12s ease-out;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
.UnderlineNav-item.selected,
|
92
|
+
.UnderlineNav-item[role='tab'][aria-selected='true'],
|
93
|
+
.UnderlineNav-item[aria-current]:not([aria-current='false']) {
|
94
|
+
font-weight: var(--base-text-weight-semibold, 600);
|
95
|
+
color: var(--color-fg-default);
|
96
|
+
border-bottom-color: var(--color-yattho-border-active);
|
97
|
+
|
98
|
+
/* current/selected underline */
|
99
|
+
}
|
100
|
+
|
101
|
+
.UnderlineNav-item.selected::after, .UnderlineNav-item[role='tab'][aria-selected='true']::after, .UnderlineNav-item[aria-current]:not([aria-current='false'])::after {
|
102
|
+
position: absolute;
|
103
|
+
right: 50%;
|
104
|
+
bottom: calc(50% - 25px); /* 48px total height / 2 (24px) + 1px */
|
105
|
+
width: 100%;
|
106
|
+
height: 2px;
|
107
|
+
content: '';
|
108
|
+
background: var(--color-yattho-border-active);
|
109
|
+
border-radius: var(--yattho-borderRadius-medium, 6px);
|
110
|
+
transform: translate(50%, -50%);
|
111
|
+
}
|
112
|
+
|
113
|
+
.UnderlineNav--right {
|
114
|
+
justify-content: flex-end;
|
115
|
+
}
|
116
|
+
|
117
|
+
.UnderlineNav--right .UnderlineNav-actions {
|
118
|
+
flex: 1 1 auto;
|
119
|
+
}
|
120
|
+
|
121
|
+
.UnderlineNav-actions {
|
122
|
+
align-self: center;
|
123
|
+
}
|
124
|
+
|
125
|
+
.UnderlineNav--full {
|
126
|
+
display: block;
|
127
|
+
|
128
|
+
/* required for underline to align with additional wrapper element */
|
129
|
+
}
|
130
|
+
|
131
|
+
.UnderlineNav--full .UnderlineNav-body {
|
132
|
+
min-height: var(--base-size-48, 48px);
|
133
|
+
}
|
134
|
+
|
135
|
+
.UnderlineNav-octicon {
|
136
|
+
display: inline !important;
|
137
|
+
}
|
138
|
+
|
139
|
+
.UnderlineNav-octicon {
|
140
|
+
margin-right: var(--yattho-control-medium-gap, 8px);
|
141
|
+
color: var(--color-fg-muted);
|
142
|
+
fill: var(--color-fg-muted);
|
143
|
+
}
|
144
|
+
|
145
|
+
.UnderlineNav-container {
|
146
|
+
display: flex;
|
147
|
+
justify-content: space-between;
|
148
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"name":"alpha/underline_nav","selectors":[".UnderlineNav",".UnderlineNav .Counter",".UnderlineNav .Counter--primary",".UnderlineNav-body",".UnderlineNav-item",".UnderlineNav-item:hover","\n .UnderlineNav-item:focus","\n .UnderlineNav-item:focus-visible",".UnderlineNav-item [data-content]::before",".UnderlineNav-item::before",".UnderlineNav-item.selected","\n .UnderlineNav-item[role='tab'][aria-selected='true']","\n .UnderlineNav-item[aria-current]:not([aria-current='false'])",".UnderlineNav-item.selected::after"," .UnderlineNav-item[role='tab'][aria-selected='true']::after"," .UnderlineNav-item[aria-current]:not([aria-current='false'])::after",".UnderlineNav--right",".UnderlineNav--right .UnderlineNav-actions",".UnderlineNav-actions",".UnderlineNav--full",".UnderlineNav--full .UnderlineNav-body",".UnderlineNav-octicon",".UnderlineNav-container"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["underline_nav.pcss","<no source>"],"names":[],"mappings":"AAAA,iBAAiB;;AAEjB;EACE,aAAa;EACb,qCAAqC;EACrC,gBAAgB;EAChB,kBAAkB;EAClB,oDAAoD;EACpD,gCAAgC;EAChC,8BAA8B;AAYhC;;AAVE;IACE,kDAAkD;IAClD,8BAA8B;IAC9B,4CAA4C;EAC9C;;AAEA;IACE,kCAAkC;IAClC,+CAA+C;EACjD;;AAGF;EACE,aAAa;EACb,mBAAmB;EACnB,0CAA0C;EAC1C,gBAAgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,aAAa;EACb,oEAAoE;EACpE,oDAAoD;EACpD,iBAAiB;EACjB,8BAA8B;EAC9B,kBAAkB;EAClB,mBAAmB;EACnB,eAAe;EACf,6BAA6B;EAC7B,SAAS;EACT,qDAAqD;EACrD,mBAAmB;AAwDrB;;AAtDE;;;IAGE,8BAA8B;IAC9B,qBAAqB;IACrB,+CAA+C;IAC/C,oBAAoB;IACpB,8CAA8C;EAChD;;AAEA,sHAAsH;;AACtH;IACE,cAAc;IACd,SAAS;IACT,kDAAkD;IAClD,kBAAkB;IAClB,2BAA2B;EAC7B;;AAEA,+BAA+B;;AAE7B;EClEJ,mBAAA;EAAA,SAAA;EAAA,UAAA;EAAA,YAAA;EAAA,aAAA;EAAA,iBAAA;EAAA,YAAA;EAAA;ADkE8B;;AAG5B,qDAAqD;;AACrD;IACE;MACE,8BAA8B;MAC9B,qBAAqB;MACrB,0DAA0D;MAC1D,qCAAqC;IACvC;EACF;;AAEA;;;IAGE,kDAAkD;IAClD,8BAA8B;IAC9B,sDAAsD;;IAEtD,+BAA+B;EAYjC;;AAXE;MACE,kBAAkB;MAClB,UAAU;MACV,wBAAwB,EAAE,uCAAuC;MACjE,WAAW;MACX,WAAW;MACX,WAAW;MACX,6CAA6C;MAC7C,qDAAqD;MACrD,+BAA+B;IACjC;;AAIJ;EACE,yBAAyB;AAK3B;;AAHE;IACE,cAAc;EAChB;;AAGF;EACE,kBAAkB;AACpB;;AAEA;EACE,cAAc;;EAEd,oEAAoE;AAItE;;AAHE;IACE,qCAAqC;EACvC;;AAGF;EACE,0BAA0B;AAI5B;;AALA;EAEE,mDAAmD;EACnD,4BAA4B;EAC5B,2BAA2B;AAC7B;;AAEA;EACE,aAAa;EACb,8BAA8B;AAChC","file":"underline_nav.css","sourcesContent":["/* UnderlineNav */\n\n.UnderlineNav {\n display: flex;\n min-height: var(--base-size-48, 48px);\n overflow-x: auto;\n overflow-y: hidden;\n box-shadow: inset 0 -1px 0 var(--color-border-muted);\n -webkit-overflow-scrolling: auto;\n justify-content: space-between;\n\n & .Counter {\n margin-left: var(--yattho-control-medium-gap, 8px);\n color: var(--color-fg-default);\n background-color: var(--color-neutral-muted);\n }\n\n & .Counter--primary {\n color: var(--color-fg-on-emphasis);\n background-color: var(--color-neutral-emphasis);\n }\n}\n\n.UnderlineNav-body {\n display: flex;\n align-items: center;\n gap: var(--yattho-control-medium-gap, 8px);\n list-style: none;\n}\n\n.UnderlineNav-item {\n position: relative;\n display: flex;\n padding: 0 var(--yattho-control-medium-paddingInline-condensed, 8px);\n font-size: var(--yattho-text-body-size-medium, 14px);\n line-height: 30px;\n color: var(--color-fg-default);\n text-align: center;\n white-space: nowrap;\n cursor: pointer;\n background-color: transparent;\n border: 0;\n border-radius: var(--yattho-borderRadius-medium, 6px);\n align-items: center;\n\n &:hover,\n &:focus,\n &:focus-visible {\n color: var(--color-fg-default);\n text-decoration: none;\n border-bottom-color: var(--color-neutral-muted);\n outline-offset: -2px;\n transition: border-bottom-color 0.12s ease-out;\n }\n\n /* renders a visibly hidden \"copy\" of the label in bold, reserving box space for when label becomes bold on selected */\n & [data-content]::before {\n display: block;\n height: 0;\n font-weight: var(--base-text-weight-semibold, 600);\n visibility: hidden;\n content: attr(data-content);\n }\n\n /* increase touch target area */\n &::before {\n @mixin minTouchTarget 48px;\n }\n\n /* hover state was \"sticking\" on mobile after click */\n @media (pointer: fine) {\n &:hover {\n color: var(--color-fg-default);\n text-decoration: none;\n background: var(--color-action-list-item-default-hover-bg);\n transition: background 0.12s ease-out;\n }\n }\n\n &.selected,\n &[role='tab'][aria-selected='true'],\n &[aria-current]:not([aria-current='false']) {\n font-weight: var(--base-text-weight-semibold, 600);\n color: var(--color-fg-default);\n border-bottom-color: var(--color-yattho-border-active);\n\n /* current/selected underline */\n &::after {\n position: absolute;\n right: 50%;\n bottom: calc(50% - 25px); /* 48px total height / 2 (24px) + 1px */\n width: 100%;\n height: 2px;\n content: '';\n background: var(--color-yattho-border-active);\n border-radius: var(--yattho-borderRadius-medium, 6px);\n transform: translate(50%, -50%);\n }\n }\n}\n\n.UnderlineNav--right {\n justify-content: flex-end;\n\n & .UnderlineNav-actions {\n flex: 1 1 auto;\n }\n}\n\n.UnderlineNav-actions {\n align-self: center;\n}\n\n.UnderlineNav--full {\n display: block;\n\n /* required for underline to align with additional wrapper element */\n & .UnderlineNav-body {\n min-height: var(--base-size-48, 48px);\n }\n}\n\n.UnderlineNav-octicon {\n display: inline !important;\n margin-right: var(--yattho-control-medium-gap, 8px);\n color: var(--color-fg-muted);\n fill: var(--color-fg-muted);\n}\n\n.UnderlineNav-container {\n display: flex;\n justify-content: space-between;\n}",null]}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= render Yattho::BaseComponent.new(**@system_arguments) do %>
|
2
|
+
<% if @align == :right %>
|
3
|
+
<%= actions %>
|
4
|
+
<% end %>
|
5
|
+
<%= render body do %>
|
6
|
+
<% tabs.each do |tab| %>
|
7
|
+
<%= tab %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
<% if @align == :left %>
|
11
|
+
<%= actions %>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|