Skip to content

Commit

Permalink
docs: add multiselect combobox docs (#2711)
Browse files Browse the repository at this point in the history
* docs: add multiselect combobox docs

* fix(combobox): refine typings for multiselect

* docs: fix storybook urls

* docs: tiny fix to props table

* docs: fix pr comments

* chore: design fixes

* fix: pr review

* chore: small commit for CI

* chore: small commit for ci
  • Loading branch information
TheSisb committed Sep 29, 2022
1 parent be2ce22 commit d068c20
Show file tree
Hide file tree
Showing 8 changed files with 975 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .changeset/perfect-lobsters-beam.md
@@ -0,0 +1,6 @@
---
'@twilio-paste/combobox': patch
'@twilio-paste/core': patch
---

[Combobox] Refine typings and styling for group options for Multiselect Combobox.
Expand Up @@ -27,8 +27,8 @@ const ComboboxListboxGroup = React.forwardRef<HTMLUListElement, ComboboxListboxG
as="li"
backgroundColor="colorBackground"
role="presentation"
paddingY="space40"
paddingLeft="space70"
paddingY="space30"
paddingLeft="space50"
paddingRight="space50"
element={`${element}_GROUPNAME`}
>
Expand Down
Expand Up @@ -17,7 +17,7 @@ export interface ComboboxListboxOptionProps extends Pick<BoxProps, 'element'> {

const VariantStyles: {[key in ComboboxListboxOptionProps['variant']]: BoxStyleProps} = {
groupOption: {
paddingLeft: 'space70',
paddingLeft: 'space90',
paddingRight: 'space50',
},
default: {
Expand Down
16 changes: 13 additions & 3 deletions packages/paste-core/components/combobox/src/types.ts
Expand Up @@ -83,8 +83,15 @@ export interface ComboboxProps extends Omit<InputProps, 'id' | 'type' | 'value'>
}

export interface MultiselectComboboxProps
extends Omit<ComboboxProps, 'autocomplete' | 'initialSelectedItem' | 'selectedItem' | 'onSelectedItemChange'> {
filterItems?: (items: any[], inputValue: string) => any[];
extends Omit<
ComboboxProps,
| 'autocomplete'
| 'initialSelectedItem'
| 'selectedItem'
| 'onSelectedItemChange'
| 'getA11yStatusMessage'
| 'getA11ySelectionMessage'
> {
initialSelectedItems?: any[];
onSelectedItemsChange?: (newSelectedItems: any[]) => void;
selectedItemsLabelText: string;
Expand All @@ -93,7 +100,10 @@ export interface MultiselectComboboxProps
}

export interface ComboboxItemsProps
extends Pick<ComboboxProps, 'groupItemsBy' | 'optionTemplate' | 'groupLabelTemplate' | 'element' | 'emptyState'> {
extends Pick<
ComboboxProps,
'groupItemsBy' | 'optionTemplate' | 'groupLabelTemplate' | 'element' | 'emptyState' | 'state'
> {
items: Item[];
selectedItems?: Item[];
disabledItems?: Item[];
Expand Down

0 comments on commit d068c20

Please sign in to comment.