-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dang-1822 / TopNavDropdown (MegaMenu redesign) (#380)
* TopNavDropdown * more TopNavDropdown * fix test * nits * add TopNavButton component * nits & add active black bg * nits & export TopNavButton * story nits * remove showmobilenav and cleanup of classes * fix test * change outline to dashed (not dotted) * remove unused disabled class from item * add one more item to top nav story * update mdx docs and stories * change topnav story to reflect current dashboard, with resources and username dropdowns * remove old MegaMenu components * nit: mainnav expand button centering * focus visible nit * nit * fix * package version & changelog
- Loading branch information
Showing
21 changed files
with
374 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
src/components/MegaMenu/__tests__/MegaMenuSubtitle.spec.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<template> | ||
<button class="type-small-700 text-gray-500 whitespace-nowrap h-[76px] px-8 hover:bg-gray-50 focus:outline-black focus:outline-dashed active:bg-black active:!text-white"> | ||
<div class="flex flex-col justify-center"> | ||
<div class="flex items-center"> | ||
<slot /> | ||
<div :class="{ 'ml-2': hasIcon }"> | ||
<slot name="icon" /> | ||
</div> | ||
</div> | ||
</div> | ||
</button> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'TopNavButton', | ||
computed: { | ||
hasIcon () { | ||
return Boolean(this.$slots.icon); | ||
} | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { | ||
Preview, | ||
Story, | ||
ArgsTable, | ||
PRIMARY_STORY, | ||
} from "@storybook/addon-docs"; | ||
import TopNavDropdown from "./TopNavDropdown.vue"; | ||
import TopNavDropdownItem from "./TopNavDropdownItem.vue"; | ||
|
||
# TopNavDropdown | ||
|
||
The TopNavDropdown component is used for displaying a big navigation menu with nested items displaying on hover. | ||
|
||
<Preview> | ||
<Story id="components-top-nav-dropdown--primary" /> | ||
</Preview> | ||
|
||
## How to Use | ||
|
||
The mega menu renders a semantic `nav` element. It is made to work with `TopNavDropdownItem` components. However, you can also write custom components for its slot. | ||
|
||
Example of using this component in a template, with a TopNavDropdownItem | ||
|
||
```html | ||
<TopNavDropdown title="Resources" navKey=""> | ||
<TopNavDropdownItem to="/settings/main/account"> | ||
Settings | ||
</TopNavDropdownItem> | ||
</TopNavDropdown> | ||
``` | ||
|
||
# TopNavDropdownItem | ||
|
||
The TopNavDropdownItem component is used for displaying a single item in the nested submenu that's displayed on hover. | ||
|
||
<Preview> | ||
<Story id="components-top-nav-dropdown--item" /> | ||
</Preview> | ||
|
||
## How to Use | ||
|
||
The TopNavDropdownItem component can render as a traditional link (hooked up to your app's routing) or as an anchor tag depending on if the link is internal to your app's routing or external. | ||
|
||
You can optionally provide an icon to display for the item in the `#icon` slot. | ||
|
||
Example of using this component in a template | ||
|
||
```html | ||
<TopNavDropdownItem to="/overview" navKey=""> | ||
<template #icon> <Signal /> </template> | ||
API Status | ||
</TopNavDropdownItem> | ||
``` | ||
|
||
## Props | ||
|
||
<ArgsTable story={PRIMARY_STORY} /> |
Oops, something went wrong.