gov-gui
Version:
Gov UI Component Library Typscript Build
99 lines (98 loc) • 4.86 kB
JavaScript
import { html } from "lit-html"; // Storybook uses lit-html for templating
import "../../global/animate.min.css";
/**Breadcrumbs provide users with a clear visual representation of their current location
* within your website's information architecture,
* enabling quick navigation to previous levels or parent sections.
* When implementing breadcrumbs, forward slashes ("/") in the url will define the hierarchical path
* segments displayed to users. Each segment becomes a clickable link,
* allowing for convenient movement between different levels of content ,
* with the home icon taking the user back to the root page.
* Please note that when viewing this component inside an iframe environment,
* such as within Storybook's preview panel, the breadcrumb will display "iframe.html"
* rather than the expected path structure.
* This is a normal behavior as the component cannot access the proper navigation context
* when embedded in an iframe. For accurate testing of full breadcrumb functionality,
* the component should be observed in its actual implementation environment. */
export default {
title: 'Components/Breadcrumb',
component: 'gov-breadcrumb',
tags: ['autodocs'],
argTypes: {
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',
},
},
},
};
// Template for Stencil component in Storybook
const Template = (args) => html `
<gov-breadcrumb
animation-delay="${args.animationDelay}"
animation="${args.animation}"
animation-speed="${args.animationSpeed}"
></gov-breadcrumb>
`;
// Exporting the default story
export const Breadcrumb = Template.bind({});
Breadcrumb.args = {
// Default breadcrumb structure for the example
animation: '',
animationDelay: '',
animationSpeed: '',
};
// Custom Template for Display
Breadcrumb.parameters = {
docs: {
source: {
code: `<gov-breadcrumb
animation-delay="${Breadcrumb.args.animationDelay}"
animation="${Breadcrumb.args.animation}"
animation-speed="${Breadcrumb.args.animationSpeed}"
></gov-breadcrumb>`,
},
},
};
//# sourceMappingURL=gov-breadcrumb.stories.js.map