compositeSelect.stories.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import CompositeSelect from 'sentry/components/compactSelect/composite';
  2. export default {
  3. title: 'Components/Composite Select',
  4. component: CompositeSelect,
  5. };
  6. export const _CompositeSelect = props => (
  7. <CompositeSelect {...props}>
  8. <CompositeSelect.Region
  9. label="Region 1"
  10. defaultValue="choice_one"
  11. onChange={() => {}}
  12. options={[
  13. {value: 'choice_one', label: 'Choice One'},
  14. {value: 'choice_two', label: 'Choice Two'},
  15. ]}
  16. />
  17. <CompositeSelect.Region
  18. multiple
  19. label="Region 2"
  20. defaultValue={['choice_three']}
  21. onChange={() => {}}
  22. options={[
  23. {value: 'choice_three', label: 'Choice Three'},
  24. {value: 'choice_four', label: 'Choice Four'},
  25. ]}
  26. />
  27. </CompositeSelect>
  28. );
  29. _CompositeSelect.args = {
  30. disabled: false,
  31. menuTitle: '',
  32. isSearchable: false,
  33. isLoading: false,
  34. isClearable: false,
  35. placeholder: 'Search…',
  36. shouldCloseOnBlur: true,
  37. isDismissable: true,
  38. offset: 8,
  39. crossOffset: 0,
  40. containerPadding: 8,
  41. placement: 'bottom left',
  42. triggerProps: {
  43. prefix: 'Prefix',
  44. },
  45. };
  46. _CompositeSelect.argTypes = {
  47. placement: {
  48. options: [
  49. 'top',
  50. 'bottom',
  51. 'left',
  52. 'right',
  53. 'top left',
  54. 'top right',
  55. 'bottom left',
  56. 'bottom right',
  57. 'left top',
  58. 'left bottom',
  59. 'right top',
  60. 'right bottom',
  61. ],
  62. control: {type: 'radio'},
  63. },
  64. };