@@ -122,6 +122,7 @@ const SelectComparisonStory: StoryFn<typeof Combobox> = (args) => {
|
|||||||
<div style={{ border: '1px solid ' + theme.colors.border.weak, padding: 16 }}>
|
<div style={{ border: '1px solid ' + theme.colors.border.weak, padding: 16 }}>
|
||||||
<Field label="Combobox with default size">
|
<Field label="Combobox with default size">
|
||||||
<Combobox
|
<Combobox
|
||||||
|
{...args}
|
||||||
id="combobox-default-size"
|
id="combobox-default-size"
|
||||||
value={comboboxValue}
|
value={comboboxValue}
|
||||||
options={args.options}
|
options={args.options}
|
||||||
@@ -147,7 +148,9 @@ const SelectComparisonStory: StoryFn<typeof Combobox> = (args) => {
|
|||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
<Field label="Combobox with explicit size (25)">
|
<Field label="Combobox with explicit size (25)">
|
||||||
|
{/*@ts-ignore minWidth and maxWidth has never, which is incompatible with args. It lacks the context that width=25 on the component*/}
|
||||||
<Combobox
|
<Combobox
|
||||||
|
{...args}
|
||||||
id="combobox-explicit-size"
|
id="combobox-explicit-size"
|
||||||
width={25}
|
width={25}
|
||||||
value={comboboxValue}
|
value={comboboxValue}
|
||||||
@@ -176,6 +179,7 @@ const SelectComparisonStory: StoryFn<typeof Combobox> = (args) => {
|
|||||||
|
|
||||||
<Field label="Combobox with auto width, minWidth 15">
|
<Field label="Combobox with auto width, minWidth 15">
|
||||||
<Combobox
|
<Combobox
|
||||||
|
{...args}
|
||||||
id="combobox-auto-size"
|
id="combobox-auto-size"
|
||||||
width="auto"
|
width="auto"
|
||||||
minWidth={15}
|
minWidth={15}
|
||||||
@@ -203,6 +207,7 @@ const SelectComparisonStory: StoryFn<typeof Combobox> = (args) => {
|
|||||||
|
|
||||||
<Field label="Combobox with auto width, minWidth 15, empty value">
|
<Field label="Combobox with auto width, minWidth 15, empty value">
|
||||||
<Combobox
|
<Combobox
|
||||||
|
{...args}
|
||||||
id="combobox-auto-size-empty"
|
id="combobox-auto-size-empty"
|
||||||
width="auto"
|
width="auto"
|
||||||
minWidth={15}
|
minWidth={15}
|
||||||
@@ -288,6 +293,7 @@ const AsyncStory: StoryFn<PropsAndCustomArgs> = (args) => {
|
|||||||
description="This tests when options have both a label and a value. Consumers are required to pass in a full ComboboxOption as a value with a label"
|
description="This tests when options have both a label and a value. Consumers are required to pass in a full ComboboxOption as a value with a label"
|
||||||
>
|
>
|
||||||
<Combobox
|
<Combobox
|
||||||
|
{...args}
|
||||||
id="test-combobox-one"
|
id="test-combobox-one"
|
||||||
placeholder="Select an option"
|
placeholder="Select an option"
|
||||||
options={loadOptionsWithLabels}
|
options={loadOptionsWithLabels}
|
||||||
@@ -305,6 +311,7 @@ const AsyncStory: StoryFn<PropsAndCustomArgs> = (args) => {
|
|||||||
description="Or without labels, where consumer can just pass in a raw scalar value Value"
|
description="Or without labels, where consumer can just pass in a raw scalar value Value"
|
||||||
>
|
>
|
||||||
<Combobox
|
<Combobox
|
||||||
|
{...args}
|
||||||
id="test-combobox-two"
|
id="test-combobox-two"
|
||||||
placeholder="Select an option"
|
placeholder="Select an option"
|
||||||
options={loadOptionsOnlyValues}
|
options={loadOptionsOnlyValues}
|
||||||
@@ -319,6 +326,7 @@ const AsyncStory: StoryFn<PropsAndCustomArgs> = (args) => {
|
|||||||
|
|
||||||
<Field label="Async with error" description="An odd number of characters throws an error">
|
<Field label="Async with error" description="An odd number of characters throws an error">
|
||||||
<Combobox
|
<Combobox
|
||||||
|
{...args}
|
||||||
id="test-combobox-error"
|
id="test-combobox-error"
|
||||||
placeholder="Select an option"
|
placeholder="Select an option"
|
||||||
options={loadOptionsWithErrors}
|
options={loadOptionsWithErrors}
|
||||||
@@ -366,9 +374,9 @@ const PositioningTestStory: StoryFn<PropsAndCustomArgs> = (args) => {
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Combobox placeholder={`${pos} top`} options={args.options} value={null} onChange={noop} />
|
<Combobox {...args} placeholder={`${pos} top`} options={args.options} value={null} onChange={noop} />
|
||||||
<Combobox placeholder={`${pos} middle`} options={args.options} value={null} onChange={noop} />
|
<Combobox {...args} placeholder={`${pos} middle`} options={args.options} value={null} onChange={noop} />
|
||||||
<Combobox placeholder={`${pos} bottom`} options={args.options} value={null} onChange={noop} />
|
<Combobox {...args} placeholder={`${pos} bottom`} options={args.options} value={null} onChange={noop} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user