UNPKG

gov-gui

Version:

Gov UI Component Library Typscript Build

126 lines (125 loc) 5.26 kB
import { html } from "lit-html"; import { unsafeHTML } from "lit-html/directives/unsafe-html.js"; import "../../global/animate.min.css"; /** A small, usually circular indicator used to display notifications, status, or counts. * It is typically placed near an icon or avatar to highlight new information or updates, * such as unread messages or active states. */ export default { title: 'Components/Badge', tags: ['autodocs'], parameters: { actions: { handles: ['click'], }, }, argTypes: { variant: { control: 'select', options: ['primary', 'secondary', 'success', 'warning', 'danger', 'info'], description: 'Defines the badge style variant.', table: { type: { summary: 'string' }, defaultValue: { summary: 'success' }, category: 'Attributes', }, }, size: { control: 'select', options: ['sm', 'md', 'lg'], description: 'Defines the badge size.', table: { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Attributes', }, }, slot: { control: "text", description: 'Slot information for what is displayed in the badge.', table: { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Attributes', }, }, style: { control: "text", description: 'Addition styles that can be applied to the component for specific use e.g position.', table: { type: { summary: 'string' }, 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-badge variant="${args.variant}" style="${args.style}" size="${args.size}" animation-delay="${args.animationDelay}" animation="${args.animation}" animation-speed="${args.animationSpeed}" > ${args.slot ? unsafeHTML(args.slot) : ''} </gov-badge> `; export const Badge = Template.bind({}); Badge.args = { variant: 'primary', size: 'md', slot: 'Text', style: '', animation: '', animationDelay: '', animationSpeed: '', }; //# sourceMappingURL=gov-badge.stories.js.map