gov-gui
Version:
Gov UI Component Library Typscript Build
111 lines (109 loc) • 5 kB
JavaScript
import { html } from "lit-html";
import "../../global/animate.min.css";
/** Horizontal or vertical navigation component that provides access to various functions or sections within an application.
* It typically contains a list of menu items, which can be dropdowns or submenus,
* to organize and simplify access to different features or pages.
* Box is added around the component to keep the drop down in place */
export default {
title: 'Components/Menubar',
tags: ['autodocs'],
parameters: {
actions: {
handles: ['click'],
},
},
argTypes: {
type: {
control: 'select',
options: ['horizontal', 'vertical', 'sticky'],
description: 'Defines the type of menu layout.',
table: {
type: { summary: 'string' },
defaultValue: { summary: 'horizontal' },
category: 'Attributes',
},
},
items: {
control: 'object',
description: 'Array of menu items with optional submenus and icons.',
table: {
type: { summary: 'array' },
defaultValue: { summary: [] },
category: 'Attributes',
},
},
animation: {
control: 'select',
options: ["",
"bounce", "flash", "pulse", "rubberBand", "shakeX", "shakeY", "headShake", "swing", "tada", "wobble", "jello", "heartBeat",
"backInDown", "backInLeft", "backInRight", "backInUp",
"backOutDown", "backOutLeft", "backOutRight", "backOutUp",
"bounceIn", "bounceInDown", "bounceInLeft", "bounceInRight", "bounceInUp",
"bounceOut", "bounceOutDown", "bounceOutLeft", "bounceOutRight", "bounceOutUp",
"fadeIn", "fadeInDown", "fadeInDownBig", "fadeInLeft", "fadeInLeftBig", "fadeInRight", "fadeInRightBig", "fadeInUp", "fadeInUpBig", "fadeInTopLeft", "fadeInTopRight", "fadeInBottomLeft", "fadeInBottomRight",
"fadeOut", "fadeOutDown", "fadeOutDownBig", "fadeOutLeft", "fadeOutLeftBig", "fadeOutRight", "fadeOutRightBig", "fadeOutUp", "fadeOutUpBig", "fadeOutTopLeft", "fadeOutTopRight", "fadeOutBottomRight", "fadeOutBottomLeft",
"flip", "flipInX", "flipInY", "flipOutX", "flipOutY",
"lightSpeedInRight", "lightSpeedInLeft", "lightSpeedOutRight", "lightSpeedOutLeft",
"rotateIn", "rotateInDownLeft", "rotateInDownRight", "rotateInUpLeft", "rotateInUpRight",
"rotateOut", "rotateOutDownLeft", "rotateOutDownRight", "rotateOutUpLeft", "rotateOutUpRight",
"hinge", "jackInTheBox", "rollIn", "rollOut",
"zoomIn", "zoomInDown", "zoomInLeft", "zoomInRight", "zoomInUp",
"zoomOut", "zoomOutDown", "zoomOutLeft", "zoomOutRight", "zoomOutUp",
"slideInDown", "slideInLeft", "slideInRight", "slideInUp",
"slideOutDown", "slideOutLeft", "slideOutRight", "slideOutUp"
],
description: 'Selects the animation effect to apply to the component.',
table: {
type: { summary: 'string' },
defaultValue: { summary: '' },
category: 'Animations',
},
},
animationDelay: {
control: 'select',
options: ["2s", "3s", "4s", "5s"],
description: 'Sets the delay before the animation begins (in seconds).',
table: {
type: { summary: 'string' },
defaultValue: { summary: '2s' },
category: 'Animations',
},
},
animationSpeed: {
control: 'select',
options: ["slow", "slower", "fast", "faster"],
description: 'Controls how quickly the animation plays.',
table: {
type: { summary: 'string' },
defaultValue: { summary: '' },
category: 'Animations',
},
},
},
};
const Template = (args) => html `
<gov-box size="3" xl="1" md="3" sm="6">
<gov-menubar type="${args.type}" .items=${JSON.stringify(args.items)}
animation-delay="${args.animationDelay}"
animation="${args.animation}"
animation-speed="${args.animationSpeed}"></gov-menubar>
</gov-box>
`;
export const Menubar = Template.bind({});
Menubar.args = {
type: 'horizontal',
items: [
{ label: 'Home', link: '/', icon: 'homeOutline' },
{ label: 'About', link: '/about', icon: "annotation" },
{ label: 'Services', icon: 'adjustmentsHorizontal', subItems: [
{ label: 'Web Development', link: '/services/web' },
{ label: 'SEO', link: '/services/seo' }
]
},
{ label: 'Contact', link: '/contact', icon: "phone" },
],
animation: '',
animationDelay: '',
animationSpeed: '',
};
//# sourceMappingURL=gov-menubar.stories.js.map