wix-style-react
Version:
77 lines (73 loc) • 1.99 kB
JavaScript
export const _mode = `
() => {
const [value, setValue] = React.useState(3);
return (
<StorybookComponents.Stack>
<FacesRatingBar value={value} onChange={setValue} />
<FacesRatingBar value={3} readOnly />
</StorybookComponents.Stack>
);
};`;
export const _description = `
() => {
const descriptionValues = [
'Strong Negative',
'Negative',
'Neutral',
'Positive',
'Strong Positive',
];
return <FacesRatingBar descriptionValues={descriptionValues} />;
};`;
export const _collectingFeedback = `
() => {
const [value, setValue] = React.useState(3);
const descriptionValues = ['Terrible', 'Bad', 'Okay', 'Good', 'Great'];
const renderRatingBar = (
<FormField label="How was the help you received from customer support?">
<FacesRatingBar
value={value}
descriptionValues={descriptionValues}
onChange={setValue}
/>
</FormField>
);
const renderInput = (
<FormField label="Review (optional)">
<InputArea
minHeight="90px"
placeholder="Describe your experience. What went well and where could we improve?"
/>
</FormField>
);
return (
<CustomModalLayout
primaryButtonText="Send a Review"
secondaryButtonText="Cancel"
onCloseButtonClick={() => {}}
title="Rate your experience"
>
<Layout>
<Cell span={12}>{renderRatingBar}</Cell>
<Cell span={12}>{renderInput}</Cell>
</Layout>
</CustomModalLayout>
);
};`;
export const _displayingFeedback = `
<Card>
<Card.Content>
<Box direction="vertical" gap="18px">
<Heading appearance="H5">Collaboration</Heading>
<FacesRatingBar value={4} readOnly />
<Box gap="12px">
<Text weight="bold" size="small">
Positive:
</Text>
<Text weight="thin" size="small">
Knows how to work in a team, seems like a good team player.
</Text>
</Box>
</Box>
</Card.Content>
</Card>;`;