diff --git a/src-docs/src/views/selectable/selectable_sizing.tsx b/src-docs/src/views/selectable/selectable_sizing.tsx index ee103e61438b..0e839ac92219 100644 --- a/src-docs/src/views/selectable/selectable_sizing.tsx +++ b/src-docs/src/views/selectable/selectable_sizing.tsx @@ -9,7 +9,8 @@ import { EuiPopoverFooter, EuiPopoverTitle, EuiSelectable, - EuiSelectableOption, + type EuiSelectableOption, + type EuiSelectableProps, EuiSpacer, EuiTitle, EuiInputPopover, @@ -59,9 +60,6 @@ const OPTIONS: EuiSelectableOption[] = [ ]; export default () => { - const [isPopoverOpen, setIsPopoverOpen] = useState(false); - const [isFlyoutVisible, setIsFlyoutVisible] = useState(false); - const [options, setOptions] = useState(OPTIONS); const onChange = (options: EuiSelectableOption[]) => { setOptions(options); @@ -69,45 +67,96 @@ export default () => { return ( <> - setIsPopoverOpen(!isPopoverOpen)} - > - Show popover - - } - isOpen={isPopoverOpen} - closePopover={() => setIsPopoverOpen(false)} + + + + + + + +

In an input popover

+
+ + + + + +

+ Using listProps.bordered=true and{' '} + + listProps.paddingSize="none" + +

+
+ + - list} + + + ); +}; + +const SelectablePopover = ( + props: Pick +) => { + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + const { options, onChange } = props; + + return ( + setIsPopoverOpen(!isPopoverOpen)} > - {(list, search) => ( -
- {search} - {list} - - - Manage this list - - -
- )} -
-
+ Show popover + + } + isOpen={isPopoverOpen} + closePopover={() => setIsPopoverOpen(false)} + > + + {(list, search) => ( +
+ {search} + {list} + + + Manage this list + + +
+ )} +
+ + ); +}; - +const SelectableFlyout = ( + props: Pick +) => { + const [isFlyoutVisible, setIsFlyoutVisible] = useState(false); + const { options, onChange } = props; + return ( + <> setIsFlyoutVisible(true)}> Show flyout @@ -119,7 +168,7 @@ export default () => { aria-labelledby="selectableFlyout" > { )} - - - - -

In an input popover

-
- - - - - -

- Using listProps.bordered=true and{' '} - - listProps.paddingSize="none" - -

-
- - - - {(list) => list} - ); }; @@ -202,6 +222,8 @@ const SelectableInputPopover = () => { singleSelection searchable searchProps={{ + // wrapperProps: { isDropdown: true }, + // placeholder: 'Select an option', value: inputValue, onChange: (value) => { setInputValue(value);