import { useState } from 'react';
import { Chip } from 'reablocks';
import { ChipTheme, chipTheme } from 'reablocks';
export default {
title: 'Components/Elements/Chip',
component: Chip
};
export const Colors = () => (
Default
Primary
Secondary
Error
Success
Warning
Info
);
export const Sizes = () => (
Small
Medium
Large
);
export const Adornment = () => (
}>Icon
}>Icon
}>
Icon
);
export const StartAdornment = () => }>Icon;
export const EndAdornment = () => }>Icon;
export const StartEndAdornment = () => (
}>
Icon
);
export const Variants = () => (
Filled
Outline
);
export const Selectable = () => {
const [isFilledSelected, setisFilledSelected] = useState(false);
const [isOutlineSelected, setIsOutlineSelected] = useState(false);
return (
setisFilledSelected(!isFilledSelected)}
selected={isFilledSelected}
>
Selectable
setIsOutlineSelected(!isOutlineSelected)}
selected={isOutlineSelected}
>
Selectable
);
};
export const Disabled = () => (
Selectable
Selectable
);
const DemoIcon = () => (
);
export const CustomTheme = () => {
const customTheme: ChipTheme = {
...chipTheme,
base: `${chipTheme.base} rounded-full`,
colors: {
...chipTheme?.colors,
secondary: {
...chipTheme.colors.secondary,
variants: {
...chipTheme.colors.secondary.variants,
filled: `${chipTheme?.colors?.secondary?.variants?.filled} dark:bg-gray-100 light:bg-gray-900 text-panel`
}
},
info: {
...chipTheme.colors.info,
variants: {
...chipTheme.colors.info.variants,
filled: `${chipTheme?.colors?.info?.variants?.filled} text-text-primary bg-info/10 border-info`
}
},
error: {
...chipTheme.colors.error,
variants: {
...chipTheme.colors.error.variants,
filled: `${chipTheme?.colors?.error?.variants?.filled} text-text-primary bg-error/10 border-error`
}
},
warning: {
...chipTheme.colors.warning,
variants: {
...chipTheme.colors.warning.variants,
filled: `${chipTheme?.colors?.warning?.variants?.filled} text-text-primary bg-warning/10 border-warning`
}
},
success: {
...chipTheme.colors.success,
variants: {
...chipTheme.colors.success.variants,
filled: `${chipTheme?.colors?.success?.variants?.filled} text-text-primary bg-success/10 border-success`
}
}
}
};
return (
Default
Primary
Secondary
Error
Success
Warning
Info
);
};