From eef27951abeaae101883d610d1b72409bb074a6e Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Mon, 6 Feb 2023 15:03:06 -0800 Subject: [PATCH 01/23] feat(support): help and feedback drawer content additions --- docs/app/views/application/_nav.html.erb | 2 +- docs/app/views/application/_scripts.html.erb | 2 + docs/app/views/application/_sidebar.html.erb | 12 ++++-- docs/app/views/pages/_support_modal.html.erb | 45 ++++++++++++++++++++ docs/app/views/pages/support.html.erb | 12 +++++- 5 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 docs/app/views/pages/_support_modal.html.erb diff --git a/docs/app/views/application/_nav.html.erb b/docs/app/views/application/_nav.html.erb index 075cdb1757..881d0e41eb 100644 --- a/docs/app/views/application/_nav.html.erb +++ b/docs/app/views/application/_nav.html.erb @@ -48,7 +48,7 @@ name: "stack" }, } %> - <%= sage_component SageButton, { value: "Helpers", attributes: { href: pages_helpers_path(:spacing), - title: "Style Helpers" + title: "Style Helpers", + "data-nav-active": page_active('helpers') ? "true" : nil }, subtle: true, icon: { style: "left", name: "code" }, + css_classes: "docs-nav__item" } %> <% end %> diff --git a/docs/app/views/layouts/application.html.erb b/docs/app/views/layouts/application.html.erb index dce1162801..e940252535 100644 --- a/docs/app/views/layouts/application.html.erb +++ b/docs/app/views/layouts/application.html.erb @@ -10,7 +10,7 @@ <%= render "application/content_skip_link", link_id: "main-content" -%> - <%= sage_component(SageHeader, {}) do %> + <%= sage_component(SageHeader, {css_classes: "sage-docs-header"}) do %> <%= render "application/assistant" %> <% end %> <%= sage_component(SageStage, {}) do %> diff --git a/docs/lib/sage-frontend/stylesheets/docs/_nav.scss b/docs/lib/sage-frontend/stylesheets/docs/_nav.scss index 5104a83d39..a1d82caa7c 100644 --- a/docs/lib/sage-frontend/stylesheets/docs/_nav.scss +++ b/docs/lib/sage-frontend/stylesheets/docs/_nav.scss @@ -4,8 +4,11 @@ For Sage documentation use ================================================== */ -.docs-nav { +.sage-docs-header { + position: relative; +} +.docs-nav { .sage-btn::before { @media screen and (min-width: sage-breakpoint(md-min)) { display: none; @@ -24,6 +27,20 @@ } } +.docs-nav__item > span::before { + display: block; + position: absolute; + top: 100%; + left: 0; + width: 100%; + height: rem(3px); + background-color: sage-color(sage, 200); +} + +[data-nav-active=true] > span::before { + content: ""; +} + // displays "skip to content" link when focused .skip-link:focus, .skip-link:focus-within { From 6a07c9ae4158f994b40415779c6279f2fb0ac9c2 Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Thu, 8 Jun 2023 21:37:53 -0700 Subject: [PATCH 22/23] fix(nav): search page nav route --- docs/app/helpers/nav_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/app/helpers/nav_helper.rb b/docs/app/helpers/nav_helper.rb index 6380b70789..aeafcd9548 100644 --- a/docs/app/helpers/nav_helper.rb +++ b/docs/app/helpers/nav_helper.rb @@ -1,6 +1,6 @@ module NavHelper def page_active(page_action, page_controller = "pages") - return if current_page?(controller: 'pages', action: 'index') + return if current_page?(controller: 'pages', action: 'index') || current_page?(controller: 'pages', action: 'search') current_page?(controller: page_controller, action: page_action) end end From ececedf92416f9ebce13e813731b6a1a44f217b2 Mon Sep 17 00:00:00 2001 From: Kevin Chang Date: Thu, 8 Jun 2023 21:38:36 -0700 Subject: [PATCH 23/23] fix(footer): link and icon adjustments --- docs/app/views/application/_footer.html.erb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/app/views/application/_footer.html.erb b/docs/app/views/application/_footer.html.erb index 0bfa3eb322..8baf4acdb0 100644 --- a/docs/app/views/application/_footer.html.erb +++ b/docs/app/views/application/_footer.html.erb @@ -8,6 +8,8 @@ <%= sage_component SageButtonGroup, { gap: :md } do %> <%= sage_component SageButton, { value: "Was this page helpful?", + subtle: true, + style: "primary", icon: { style: "left", name: "feedback", @@ -23,6 +25,10 @@ external: true, style: "secondary", remove_underline: true, + icon: { + name: "launch", + style: "right" + }, } %> <%= sage_component SageLink, { label: "Storybook", @@ -30,6 +36,10 @@ external: true, style: "secondary", remove_underline: true, + icon: { + name: "launch", + style: "right" + }, } %> <% end %> <%= sage_component SageButtonGroup, { gap: :md } do %>