mirror of https://github.com/buster-so/buster.git
group props with classname
This commit is contained in:
parent
dfc17043fb
commit
9e793787ef
|
@ -207,6 +207,7 @@ const manyCharacters: MentionInputTriggerItem[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
label: 'SpongeBob SquarePants Characters',
|
label: 'SpongeBob SquarePants Characters',
|
||||||
|
className: 'bg-red-100',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separator',
|
type: 'separator',
|
||||||
|
|
|
@ -46,6 +46,7 @@ export type MentionInputTriggerGroup<T = string> = {
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
type: 'group';
|
type: 'group';
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type MentionInputTriggerSeparator = {
|
export type MentionInputTriggerSeparator = {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
import { type MentionListGroupExtended, MentionListSelector } from './MentionListSelector';
|
import { type MentionListGroupExtended, MentionListSelector } from './MentionListSelector';
|
||||||
|
|
||||||
export function MentionListGroup<T = string>({
|
export function MentionListGroup<T = string>({
|
||||||
|
@ -7,9 +8,16 @@ export function MentionListGroup<T = string>({
|
||||||
setSelectedItem,
|
setSelectedItem,
|
||||||
selectedItem,
|
selectedItem,
|
||||||
onSelectItem,
|
onSelectItem,
|
||||||
|
type,
|
||||||
|
className,
|
||||||
|
disabled, //this is consumed by the children items, we can stylized this if we want
|
||||||
}: MentionListGroupExtended<T>) {
|
}: MentionListGroupExtended<T>) {
|
||||||
return (
|
return (
|
||||||
<div className="mention-list-group">
|
<div
|
||||||
|
className={cn('mention-list-group', className)}
|
||||||
|
aria-disabled={disabled}
|
||||||
|
data-testid={type}
|
||||||
|
>
|
||||||
<div className="flex items-center pb-1 px-2 pt-2 h-7 text-sm text-gray-dark">
|
<div className="flex items-center pb-1 px-2 pt-2 h-7 text-sm text-gray-dark">
|
||||||
{icon && <span className="mr-2 text-icon-color">{icon}</span>}
|
{icon && <span className="mr-2 text-icon-color">{icon}</span>}
|
||||||
{label}
|
{label}
|
||||||
|
|
Loading…
Reference in New Issue