UNPKG

gov-gui

Version:

Gov UI Component Library Typscript Build

113 lines (112 loc) 4.69 kB
import { html } from "lit-html"; import "../../global/animate.min.css"; /** * Icon component used to display SVG icons with different sizes, colors, and variants. */ export default { title: 'Components/Icon', tags: ['autodocs'], parameters: { actions: { handles: ['onClick'], }, }, argTypes: { name: { control: 'text', description: 'The name of the icon to display.', table: { type: { summary: 'string' }, defaultValue: { summary: '' }, category: 'Attributes', }, }, size: { control: 'select', options: ['sm', 'md', 'lg'], description: 'Size of the icon.', table: { type: { summary: 'string' }, defaultValue: { summary: 'medium' }, category: 'Attributes', }, }, variant: { control: 'select', options: ['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'white'], description: 'Preset color variant for the icon.', 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-icon name="${args.name}" size="${args.size}" variant="${args.variant}" animation-delay="${args.animationDelay}" animation="${args.animation}" animation-speed="${args.animationSpeed}" ></gov-icon> `; export const Icon = Template.bind({}); Icon.args = { name: 'home', // Example icon name, replace with actual icons available size: 'md', variant: 'info', animation: '', animationDelay: '', animationSpeed: '', }; //# sourceMappingURL=gov-icon.stories.js.map