mirror of https://github.com/buster-so/buster.git
Stylize the select
This commit is contained in:
parent
7d2d9a9d46
commit
b7907cdd1e
|
@ -77,7 +77,6 @@ export const Default: Story = {
|
||||||
const onViewSearchItem = (item: SearchItem) => {
|
const onViewSearchItem = (item: SearchItem) => {
|
||||||
setSecondaryContent(<div>Secondary Content {item.label}</div>);
|
setSecondaryContent(<div>Secondary Content {item.label}</div>);
|
||||||
setOpen(true);
|
setOpen(true);
|
||||||
// setAddInSecondaryLabel(true);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const searchItems: SearchItems[] = mockSearchItems.map((item) => ({
|
const searchItems: SearchItems[] = mockSearchItems.map((item) => ({
|
||||||
|
@ -96,7 +95,6 @@ export const Default: Story = {
|
||||||
onViewSearchItem={onViewSearchItem}
|
onViewSearchItem={onViewSearchItem}
|
||||||
onSearchChange={() => {
|
onSearchChange={() => {
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
// setAddInSecondaryLabel(false);
|
|
||||||
}}
|
}}
|
||||||
openSecondaryContent={open}
|
openSecondaryContent={open}
|
||||||
secondaryContent={secondaryContent}
|
secondaryContent={secondaryContent}
|
||||||
|
|
|
@ -19,7 +19,7 @@ export const SearchModalContentItems = <M, T extends string>({
|
||||||
onSelectGlobal,
|
onSelectGlobal,
|
||||||
}: Pick<SearchModalContentProps<M, T>, 'searchItems' | 'onViewSearchItem'> & CommonProps<M, T>) => {
|
}: Pick<SearchModalContentProps<M, T>, 'searchItems' | 'onViewSearchItem'> & CommonProps<M, T>) => {
|
||||||
return (
|
return (
|
||||||
<Command.List className={cn('flex flex-col overflow-y-auto flex-1')}>
|
<Command.List className={cn('flex flex-col overflow-y-auto flex-1 px-3 pt-1.5 pb-1.5')}>
|
||||||
{searchItems.map((item, index) => (
|
{searchItems.map((item, index) => (
|
||||||
<ItemsSelecter
|
<ItemsSelecter
|
||||||
key={keyExtractor(item, index)}
|
key={keyExtractor(item, index)}
|
||||||
|
@ -68,7 +68,7 @@ const SearchItemComponent = <M, T extends string>(item: SearchItem<M, T> & Commo
|
||||||
return (
|
return (
|
||||||
<Command.Item
|
<Command.Item
|
||||||
className={cn(
|
className={cn(
|
||||||
'min-h-9 px-4 flex items-center',
|
'min-h-9 px-4 flex items-center rounded',
|
||||||
secondaryLabel && 'min-h-13.5',
|
secondaryLabel && 'min-h-13.5',
|
||||||
'data-[selected=true]:bg-item-hover data-[selected=true]:text-foreground',
|
'data-[selected=true]:bg-item-hover data-[selected=true]:text-foreground',
|
||||||
!disabled ? 'cursor-pointer' : 'cursor-not-allowed',
|
!disabled ? 'cursor-pointer' : 'cursor-not-allowed',
|
||||||
|
@ -81,7 +81,8 @@ const SearchItemComponent = <M, T extends string>(item: SearchItem<M, T> & Commo
|
||||||
{icon && (
|
{icon && (
|
||||||
<span
|
<span
|
||||||
className={cn(
|
className={cn(
|
||||||
'text-icon-color text-center group-hover:text-foreground size-4 text-icon-size',
|
'text-center group-hover:text-foreground size-4 text-icon-size text-icon-color',
|
||||||
|
'data-[selected=true]:text-foreground',
|
||||||
secondaryLabel && 'self-start mt-2.5'
|
secondaryLabel && 'self-start mt-2.5'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue