import React from "react";
import { chunk as _chunk } from "lodash-es";
import Flex from "../../Flex/Flex";
import Chips from "../Chips";
import Text from "../../Text/Text";
import { createStoryMetaSettingsDecorator } from "../../../storybook";
import { createComponentTemplate } from "vibe-storybook-components";
import Search from "../../Search/Search";
import Avatar from "../../Avatar/Avatar";
import DialogContentContainer from "../../DialogContentContainer/DialogContentContainer";
import { Email } from "../../Icon/Icons";
import person1 from "./assets/person1.png";
import rotem from "./assets/rotem.png";
import { NOOP } from "../../../utils/function-utils";
import styles from "./Chips.stories.module.scss";
const metaSettings = createStoryMetaSettingsDecorator({
component: Chips,
enumPropNamesArray: ["color"],
iconPropNamesArray: ["rightIcon", "leftIcon"],
actionPropsArray: ["onDelete", "onMouseDown", "onClick"]
});
const chipsTemplate = createComponentTemplate(Chips);
export default {
title: "Data display/Chips",
component: Chips,
argTypes: metaSettings.argTypes,
decorators: metaSettings.decorators
};
export const Overview = {
render: chipsTemplate.bind({}),
name: "Overview",
args: {
label: "This is a chip",
onMouseDown: () => {},
onClick: () => {}
}
};
export const ChipsWithReadOnlyState = {
render: () => ,
name: "Chips with read only state"
};
export const ChipsWithIcons = {
render: () => (
<>
>
),
name: "Chips with icons"
};
export const ChipsWithAvatars = {
render: () => (
<>
>
),
name: "Chips with avatars"
};
export const Themes = {
render: () => (
<>
>
),
name: "Themes"
};
export const Clickable = {
render: () => {
return (
);
},
name: "Clickable"
};
export const ChipsPalette = {
render: () => {
const excludedColors = [Chips.colors.DARK_INDIGO, Chips.colors.BLACKISH];
const allowedColorsChunks = _chunk(
// @ts-ignore
Object.keys(Chips.colors).filter(k => !excludedColors.includes(Chips.colors[k])),
7
);
return (
{allowedColorsChunks.map((colorChunk: any) => {
return (
{colorChunk.map((colorName: any) => (
// @ts-ignore
))}
);
})}
);
},
name: "Chips palette"
};
export const OnColor = {
render: () => (
),
name: "On color"
};
export const ColorfulChipsForDifferentContent = {
render: () => (
),
name: "Colorful chips for different content"
};
export const ChipsInAPersonPickerComboBox = {
render: () => (
Suggested people
May Kishon (UX/UI Product Designer)
Liron Cohen (Customer Experience)
Amanda Lawrence (Customer Experience Designer)
Dor Yehuda (Customer Experience Designer)
),
name: "Chips in a person picker combo box"
};