gov-gui
Version:
Gov UI Component Library Typscript Build
108 lines (107 loc) • 4.72 kB
JavaScript
import { html } from "lit-html";
import "../../global/animate.min.css";
/**
* The component renders a list of items passed as a comma-separated string.
* Users can click on items to set an active item, which will be visually highlighted.
*/
export default {
title: 'Components/List',
tags: ['autodocs'],
argTypes: {
items: {
control: 'text',
description: 'Comma-separated list of items to display in the list.',
table: {
type: { summary: 'string' },
defaultValue: { summary: '' },
category: 'Attributes',
},
},
alignment: {
control: 'select',
options: ['vertical', 'horizontal'],
description: 'The direction the content flows.',
table: {
type: { summary: 'string' },
defaultValue: { summary: 'vertical' },
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',
},
},
selectedItem: {
control: 'text',
description: 'Event emitted when an item is clicked, emitting the active item.',
table: {
type: { summary: '' },
defaultValue: { summary: () => { } },
category: 'Events',
},
},
},
parameters: {
actions: {
handles: ['selectedItem'], // Track click actions for the list items
},
},
};
const Template = (args) => html `
<gov-list items="${args.items}" alignment="${args.alignment}"
animation-delay="${args.animationDelay}"
animation="${args.animation}"
animation-speed="${args.animationSpeed}"></gov-list>
`;
export const List = Template.bind({});
List.args = {
items: 'Item 1, Item 2, Item 3',
alignment: 'vertical',
animation: '',
animationDelay: '',
animationSpeed: '',
};
//# sourceMappingURL=gov-list.stories.js.map