UNPKG

gov-gui

Version:

Gov UI Component Library Typscript Build

125 lines (124 loc) 5.4 kB
import { html } from "lit-html"; import "../../global/animate.min.css"; /** * Progress Bars visually represent the completion status of a task or process. * They are often used to show the progress of file uploads, time remaining, or completion percentages. */ export default { title: 'Components/ProgressBar', tags: ['autodocs'], parameters: { actions: { handles: ['complete'], // You can listen for the event that indicates completion if it exists }, }, argTypes: { progress: { control: 'number', description: 'Manually controlled progress value (0-100)%.', table: { type: { summary: 'number' }, defaultValue: { summary: 0 }, // Default duration in ms category: 'Attributes', }, }, label: { control: 'text', description: 'Optional label displayed in the progress bar.', table: { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Attributes', }, }, variant: { control: 'select', options: ['primary', 'success', 'info', 'warning', 'danger'], description: 'The color of the progress bar fill. Defaults to green if not provided.', table: { type: { summary: 'string' }, defaultValue: { summary: 'success' }, // Default color for progress fill category: 'Attributes', }, }, type: { control: 'select', options: ['linear', 'circular'], description: 'Determines the variant of the progress bar.', table: { type: { summary: 'string' }, defaultValue: { summary: 'linear' }, 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-progress-bar progress="${args.progress}" label="${args.label}" variant="${args.variant}" type="${args.type}" animation-delay="${args.animationDelay}" animation="${args.animation}" animation-speed="${args.animationSpeed}"> </gov-progress-bar> `; export const ProgressBar = Template.bind({}); ProgressBar.args = { progress: 0, // Default progress: label: '', // Default label: "Loading" variant: 'primary', // Default color: Green type: 'linear', animation: '', animationDelay: '', animationSpeed: '', }; //# sourceMappingURL=gov-progress.stories.js.map