fix: prompt agent button style
This commit is contained in:
@@ -1583,6 +1583,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
onSelect={local.agent.set}
|
onSelect={local.agent.set}
|
||||||
class="capitalize"
|
class="capitalize"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
|
triggerVariant="button"
|
||||||
/>
|
/>
|
||||||
</TooltipKeybind>
|
</TooltipKeybind>
|
||||||
<Show
|
<Show
|
||||||
|
|||||||
@@ -41,6 +41,34 @@
|
|||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&[data-trigger-style="button"] {
|
||||||
|
[data-slot="select-select-trigger"] {
|
||||||
|
padding: 0 6px;
|
||||||
|
min-width: auto;
|
||||||
|
height: 24px;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
|
||||||
|
[data-slot="select-select-trigger-icon"] {
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
background-color: transparent;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&[data-slot="select-select-trigger"]:hover:not(:disabled) {
|
||||||
|
background-color: var(--surface-raised-base-hover);
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&[data-slot="select-select-trigger"][data-expanded],
|
||||||
|
&[data-slot="select-select-trigger"][data-expanded]:hover:not(:disabled) {
|
||||||
|
background-color: var(--surface-raised-base-active);
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-component="select-content"] {
|
[data-component="select-content"] {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export type SelectProps<T> = Omit<ComponentProps<typeof Kobalte<T>>, "value" | "
|
|||||||
classList?: ComponentProps<"div">["classList"]
|
classList?: ComponentProps<"div">["classList"]
|
||||||
children?: (item: T | undefined) => JSX.Element
|
children?: (item: T | undefined) => JSX.Element
|
||||||
triggerStyle?: JSX.CSSProperties
|
triggerStyle?: JSX.CSSProperties
|
||||||
|
triggerVariant?: "default" | "button"
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Select<T>(props: SelectProps<T> & ButtonProps) {
|
export function Select<T>(props: SelectProps<T> & ButtonProps) {
|
||||||
@@ -34,6 +35,7 @@ export function Select<T>(props: SelectProps<T> & ButtonProps) {
|
|||||||
"onOpenChange",
|
"onOpenChange",
|
||||||
"children",
|
"children",
|
||||||
"triggerStyle",
|
"triggerStyle",
|
||||||
|
"triggerVariant",
|
||||||
])
|
])
|
||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
@@ -81,6 +83,7 @@ export function Select<T>(props: SelectProps<T> & ButtonProps) {
|
|||||||
<Kobalte<T, { category: string; options: T[] }>
|
<Kobalte<T, { category: string; options: T[] }>
|
||||||
{...others}
|
{...others}
|
||||||
data-component="select"
|
data-component="select"
|
||||||
|
data-trigger-style={local.triggerVariant}
|
||||||
placement="bottom-end"
|
placement="bottom-end"
|
||||||
gutter={4}
|
gutter={4}
|
||||||
value={local.current}
|
value={local.current}
|
||||||
@@ -145,7 +148,7 @@ export function Select<T>(props: SelectProps<T> & ButtonProps) {
|
|||||||
}}
|
}}
|
||||||
</Kobalte.Value>
|
</Kobalte.Value>
|
||||||
<Kobalte.Icon data-slot="select-select-trigger-icon">
|
<Kobalte.Icon data-slot="select-select-trigger-icon">
|
||||||
<Icon name="selector" size="small" />
|
<Icon name={local.triggerVariant === "button" ? "chevron-down" : "selector"} size="small" />
|
||||||
</Kobalte.Icon>
|
</Kobalte.Icon>
|
||||||
</Kobalte.Trigger>
|
</Kobalte.Trigger>
|
||||||
<Kobalte.Portal>
|
<Kobalte.Portal>
|
||||||
|
|||||||
Reference in New Issue
Block a user