gov-gui
Version:
Gov UI Component Library Typscript Build
109 lines (108 loc) • 4.88 kB
JavaScript
import { html } from "lit-html";
import { unsafeHTML } from "lit-html/directives/unsafe-html.js";
import "../../global/animate.min.css";
/** A varient of the chips compact.
* These allow users to make selections from a list of options or toggle between
* different states in a compact and visually distinct manner.*/
export default {
title: 'Components/Chips/Segmented Chips',
tags: ['autodocs'],
argTypes: {
name: {
control: "text",
description: 'The name of the segement chip component.',
table: {
type: { summary: 'string' },
defaultValue: { summary: '' },
category: 'Attributes',
},
},
variant: {
control: 'select',
options: ['filled', 'outlined', 'disabled'],
description: 'The available varrients for the segmented chips.',
table: {
type: { summary: 'string' },
defaultValue: { summary: 'filled' },
category: 'Attributes',
},
},
chips: {
control: "text",
description: 'The slot item to enter your div items.',
table: {
type: { summary: 'string' },
defaultValue: { summary: '' },
category: 'Slot',
},
},
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 SegmentedChipsTemplate = (args) => html `
<gov-segmented-chips name="${args.name}"
variant="${args.variant}"
animation-delay="${args.animationDelay}"
animation="${args.animation}"
animation-speed="${args.animationSpeed}">
${args.chips ? unsafeHTML(args.chips) : ''}
</gov-segmented-chips>
`;
export const SegmentedChips = SegmentedChipsTemplate.bind({});
SegmentedChips.args = {
name: 'segment2',
variant: 'outlined',
chips: `<div name="light">Light Mode</div>
<div name="dark">Dark Mode</div>
<div name="moon">Moon Mode</div>`,
animation: '',
animationDelay: '',
animationSpeed: '',
};
//# sourceMappingURL=gov-segmented-chips.stories.js.map