From a8ed7358f109d7207e2b071e676f7ab4f4d6fe12 Mon Sep 17 00:00:00 2001 From: Justyna Date: Thu, 15 Jun 2023 11:21:36 +0200 Subject: [PATCH 1/3] feat: navbar top with simple mobile --- apps/docs/components/blocks/NavbarTop.md | 30 ++++ .../NavbarTop/NavbarTopFilledSimpleMobile.tsx | 134 +++++++++++++++++ .../NavbarTop/NavbarTopSimpleMobile.tsx | 135 ++++++++++++++++++ .../NavbarTop/NavbarTopFilledSimpleMobile.vue | 131 +++++++++++++++++ .../NavbarTop/NavbarTopSimpleMobile.vue | 127 ++++++++++++++++ 5 files changed, 557 insertions(+) create mode 100644 apps/preview/next/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.tsx create mode 100644 apps/preview/next/pages/showcases/NavbarTop/NavbarTopSimpleMobile.tsx create mode 100644 apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.vue create mode 100644 apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopSimpleMobile.vue diff --git a/apps/docs/components/blocks/NavbarTop.md b/apps/docs/components/blocks/NavbarTop.md index 596f514c53..a03f4a9433 100644 --- a/apps/docs/components/blocks/NavbarTop.md +++ b/apps/docs/components/blocks/NavbarTop.md @@ -34,3 +34,33 @@ hideToc: true + +## NavbarTop with white background and simple mobile bar + +The alternate NavbarTop variant designed to work seamlessly with the NavbarBottom, providing a cohesive mobile navigation experience. + +By combining with the NavbarBottom, you can create a unified navigation structure that accommodates both top and bottom navigation elements on mobile devices. This ensures a smooth and intuitive user experience, allowing users to access important navigation options easily. + + + + +<<<../../preview/nuxt/pages/showcases/NavbarTop/NavbarTopSimpleMobile.vue + + +<<<../../preview/next/pages/showcases/NavbarTop/NavbarTopSimpleMobile.tsx#source + + + + +## NavbarTop with filled background and simple mobile bar + + + + +<<<../../preview/nuxt/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.vue + + +<<<../../preview/next/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.tsx#source + + + diff --git a/apps/preview/next/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.tsx b/apps/preview/next/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.tsx new file mode 100644 index 0000000000..695681882f --- /dev/null +++ b/apps/preview/next/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.tsx @@ -0,0 +1,134 @@ +/* eslint-disable jsx-a11y/anchor-is-valid */ +import { ShowcasePageLayout } from '../../showcases'; +// #region source +import { useState } from 'react'; +import { + SfButton, + SfIconShoppingCart, + SfIconFavorite, + SfIconPerson, + SfIconExpandMore, + SfInput, + SfIconSearch, + SfIconMenu, + SfIconArrowBack, +} from '@storefront-ui/react'; + +export default function TopNavFilled() { + const [inputValue, setInputValue] = useState(''); + + const actionItems = [ + { + icon: , + label: '', + ariaLabel: 'Cart', + role: 'button', + }, + { + icon: , + label: '', + ariaLabel: 'Wishlist', + role: 'button', + }, + { + label: 'Log in', + icon: , + ariaLabel: 'Log in', + role: 'login', + }, + ]; + + const search = (event: React.FormEvent) => { + event.preventDefault(); + alert(`Successfully found 10 results for ${inputValue}`); + }; + + return ( +
+
+ + + + + Sf Logo + + + + + + + + } + > + Browse products + +
+ + + + + + } + onChange={(event) => setInputValue(event.target.value)} + /> + + +
+
+ ); +} + +// #endregion source +TopNavFilled.getLayout = ShowcasePageLayout; diff --git a/apps/preview/next/pages/showcases/NavbarTop/NavbarTopSimpleMobile.tsx b/apps/preview/next/pages/showcases/NavbarTop/NavbarTopSimpleMobile.tsx new file mode 100644 index 0000000000..7088d93e39 --- /dev/null +++ b/apps/preview/next/pages/showcases/NavbarTop/NavbarTopSimpleMobile.tsx @@ -0,0 +1,135 @@ +/* eslint-disable no-alert */ +/* eslint-disable jsx-a11y/anchor-is-valid */ +import { ShowcasePageLayout } from '../../showcases'; +// #region source +import { useState } from 'react'; +import { + SfButton, + SfIconShoppingCart, + SfIconFavorite, + SfIconPerson, + SfIconExpandMore, + SfInput, + SfIconSearch, + SfIconMenu, + SfIconArrowBack, +} from '@storefront-ui/react'; + +export default function TopNavSimpleMobile() { + const [inputValue, setInputValue] = useState(''); + + const actionItems = [ + { + icon: , + label: '', + ariaLabel: 'Cart', + role: 'button', + }, + { + icon: , + label: '', + ariaLabel: 'Wishlist', + role: 'button', + }, + { + label: 'Log in', + icon: , + ariaLabel: 'Log in', + role: 'login', + }, + ]; + + const search = (event: React.FormEvent) => { + event.preventDefault(); + alert(`Successfully found 10 results for ${inputValue}`); + }; + + return ( +
+
+ + + + + Sf Logo + + + + + + + + } + > + Browse products + +
+ + + + + + } + onChange={(event) => setInputValue(event.target.value)} + /> + + +
+
+ ); +} + +// #endregion source +TopNavSimpleMobile.getLayout = ShowcasePageLayout; diff --git a/apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.vue b/apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.vue new file mode 100644 index 0000000000..f2a678935c --- /dev/null +++ b/apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.vue @@ -0,0 +1,131 @@ + + diff --git a/apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopSimpleMobile.vue b/apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopSimpleMobile.vue new file mode 100644 index 0000000000..d458169256 --- /dev/null +++ b/apps/preview/nuxt/pages/showcases/NavbarTop/NavbarTopSimpleMobile.vue @@ -0,0 +1,127 @@ + + From be9413d65ef74db7bca96bd295cd3aa601cd0b91 Mon Sep 17 00:00:00 2001 From: Justyna Date: Thu, 15 Jun 2023 11:58:43 +0200 Subject: [PATCH 2/3] feat: navbar top with simple mobile --- apps/docs/components/blocks/NavbarTop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/components/blocks/NavbarTop.md b/apps/docs/components/blocks/NavbarTop.md index a03f4a9433..b1f02b6b99 100644 --- a/apps/docs/components/blocks/NavbarTop.md +++ b/apps/docs/components/blocks/NavbarTop.md @@ -39,7 +39,7 @@ hideToc: true The alternate NavbarTop variant designed to work seamlessly with the NavbarBottom, providing a cohesive mobile navigation experience. -By combining with the NavbarBottom, you can create a unified navigation structure that accommodates both top and bottom navigation elements on mobile devices. This ensures a smooth and intuitive user experience, allowing users to access important navigation options easily. +By combining with the NavbarBottom, you can create a unified navigation structure that accommodates both top and bottom navigation elements on mobile devices. This ensures a smooth and intuitive user experience, allowing users to access important navigation options easily. From b7c44b6494d0e7cb0c9d056b078cc782af0a05ea Mon Sep 17 00:00:00 2001 From: Justyna Date: Thu, 22 Jun 2023 10:07:12 +0200 Subject: [PATCH 3/3] fix: smaller iframe for navbars top --- apps/docs/components/blocks/NavbarTop.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/docs/components/blocks/NavbarTop.md b/apps/docs/components/blocks/NavbarTop.md index b1f02b6b99..e78bf1f156 100644 --- a/apps/docs/components/blocks/NavbarTop.md +++ b/apps/docs/components/blocks/NavbarTop.md @@ -11,7 +11,7 @@ hideToc: true ## NavbarTop with white background - + <<<../../preview/nuxt/pages/showcases/NavbarTop/NavbarTop.vue @@ -24,7 +24,7 @@ hideToc: true ## NavbarTop with filled background - + <<<../../preview/nuxt/pages/showcases/NavbarTop/NavbarTopFilled.vue @@ -41,7 +41,7 @@ The alternate NavbarTop variant designed to work seamlessly with the NavbarBotto By combining with the NavbarBottom, you can create a unified navigation structure that accommodates both top and bottom navigation elements on mobile devices. This ensures a smooth and intuitive user experience, allowing users to access important navigation options easily. - + <<<../../preview/nuxt/pages/showcases/NavbarTop/NavbarTopSimpleMobile.vue @@ -54,7 +54,7 @@ By combining with the NavbarBottom, you can create a unified navigation structur ## NavbarTop with filled background and simple mobile bar - + <<<../../preview/nuxt/pages/showcases/NavbarTop/NavbarTopFilledSimpleMobile.vue