MultiCombobox: Add basic docs and make story public (#100806)

* MutliCombobox: Add basic docs and make story public

* Apply suggestions from code review

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
pull/100808/head
Tobias Skarhed 4 months ago committed by GitHub
parent 855eadcabd
commit f15c961a90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 20
      packages/grafana-ui/src/components/Combobox/MultiCombobox.mdx
  2. 6
      packages/grafana-ui/src/components/Combobox/MultiCombobox.story.tsx

@ -0,0 +1,20 @@
import { Meta, Preview, ArgTypes } from '@storybook/blocks';
import { MultiCombobox } from './MultiCombobox';
<Meta title="MDX|MultiCombobox" component={MultiCombobox} />
# MultiCombobox
The behavior of the MultiCombobox is similar to that of the Combobox, but it allows you to select multiple options. For all non-multi behaviors, see the Combobox documentation.
## "All" functionality
Use the prop `enableAllOption` to show the "All" option.
- If no filtering is applied, selecting "All" will select all options, returning the same array as the `options` prop.
- With filtering, selecting "All" will choose the filtered subset of options.
## Props
<ArgTypes of={MultiCombobox} />

@ -6,12 +6,18 @@ import { ComponentProps } from 'react';
import { Field } from '../Forms/Field';
import { MultiCombobox } from './MultiCombobox';
import mdx from './MultiCombobox.mdx';
import { generateOptions, fakeSearchAPI, generateGroupingOptions } from './storyUtils';
import { ComboboxOption } from './types';
const meta: Meta<typeof MultiCombobox> = {
title: 'Forms/MultiCombobox',
component: MultiCombobox,
parameters: {
docs: {
page: mdx,
},
},
};
const loadOptionsAction = action('options called');
Loading…
Cancel
Save