import {action} from '@storybook/addon-actions';
import CompactSelect from 'sentry/components/compactSelect';
import CompositeSelect from 'sentry/components/compositeSelect';
import RadioGroup from 'sentry/components/forms/controls/radioGroup';
import RangeSlider from 'sentry/components/forms/controls/rangeSlider';
import NewBooleanField from 'sentry/components/forms/fields/booleanField';
import CheckboxField from 'sentry/components/forms/fields/checkboxField';
import DatePickerField from 'sentry/components/forms/fields/datePickerField';
import FileField from 'sentry/components/forms/fields/fileField';
import RadioField from 'sentry/components/forms/fields/radioField';
import SelectField from 'sentry/components/forms/fields/selectField';
import TextareaField from 'sentry/components/forms/fields/textareaField';
import TextField from 'sentry/components/forms/fields/textField';
import Form from 'sentry/components/forms/form';
import FormField from 'sentry/components/forms/formField';
import {Panel} from 'sentry/components/panels';
import {RadioGroupRating} from 'sentry/components/radioGroupRating';
import Switch from 'sentry/components/switchButton';
import TextCopyInput from 'sentry/components/textCopyInput';
export default {
title: 'Components/Forms/Fields',
};
export const _TextField = () => (
);
_TextField.storyName = 'Text';
_TextField.parameters = {
docs: {
description: {
story: 'Simple text field',
},
},
};
export const _TextareaField = ({autosize, rows}) => (
);
_TextareaField.storyName = 'Textarea';
_TextareaField.args = {
autosize: true,
rows: 1,
};
export const __BooleanField = () => (
);
__BooleanField.storyName = 'Boolean';
export const _CheckboxField = () => (
);
_CheckboxField.storyName = 'Checkbox';
export const _DatePickerField = () => (
);
_DatePickerField.storyName = 'Datepicker';
export const _RadioField = () => (
);
export const __FileField = () => (
);
__FileField.storyName = 'File';
_RadioField.storyName = 'Radio';
export const _SelectField = () => (
);
_SelectField.storyName = 'Select';
export const SelectFieldMultiple = () => (
);
SelectFieldMultiple.storyName = 'Select - Multiple';
export const SelectFieldGrouped = () => (
);
SelectFieldGrouped.storyName = 'Select - Grouped';
export const SelectFieldInFieldLabel = () => (
);
SelectFieldInFieldLabel.storyName = 'Select - Label in Field';
SelectFieldInFieldLabel.parameters = {
docs: {
description: {
story: 'Select Control w/ Label In Field',
},
},
};
export const CompactSelectField = props => (
);
CompactSelectField.storyName = 'Select - Compact';
CompactSelectField.parameters = {
docs: {
description: {
story: 'Compact',
},
},
};
CompactSelectField.args = {
size: 'md',
menuTitle: '',
isSearchable: false,
isDisabled: false,
isClearable: false,
isLoading: false,
multiple: false,
placeholder: 'Search…',
closeOnSelect: true,
shouldCloseOnBlur: true,
isDismissable: true,
offset: 8,
crossOffset: 0,
containerPadding: 8,
placement: 'bottom left',
triggerProps: {
prefix: 'Prefix',
},
};
CompactSelectField.argTypes = {
placement: {
options: [
'top',
'bottom',
'left',
'right',
'top left',
'top right',
'bottom left',
'bottom right',
'left top',
'left bottom',
'right top',
'right bottom',
],
control: {type: 'radio'},
},
size: {
options: ['md', 'sm', 'xs'],
control: {type: 'radio'},
},
};
export const CompositeSelectField = props => (
);
CompositeSelectField.storyName = 'Select - Composite';
CompositeSelectField.args = {...CompactSelectField.args};
delete CompositeSelectField.args.multiple;
CompositeSelectField.argTypes = CompactSelectField.argTypes;
export const NonInlineField = () => (
);
NonInlineField.storyName = 'Non-inline';
NonInlineField.parameters = {
docs: {
description: {
story: 'Radio Group used w/ FormField',
},
},
};
export const _RadioGroupRating = () => (
);
_RadioGroupRating.storyName = 'Radio Group Rating';
_RadioGroupRating.parameters = {
docs: {
description: {
story: 'Used to provide insights regarding opinions and experiences',
},
},
};
export const _RangeSlider = () => (
{
return `${value} Toaster Strudle${value > 1 ? 's' : ''}`;
}}
/>
);
_RangeSlider.storyName = 'Range Slider';
export const WithoutAParentForm = ({onChange}) => {
return (
);
};
WithoutAParentForm.storyName = 'Without a Parent Form';
WithoutAParentForm.argTypes = {
onChange: {action: 'onChange'},
};
WithoutAParentForm.parameters = {
docs: {
description: {
story: 'New form fields used without having a parent Form',
},
},
};
export const __TextCopyInput = () => (
Value to be copied
);
__TextCopyInput.storyName = 'Text Copy';