| 22 | >; |
| 23 | |
| 24 | export const SelectTrigger = <T extends ValidComponent = "button">( |
| 25 | props: PolymorphicProps<T, selectTriggerProps<T>>, |
| 26 | ) => { |
| 27 | const [local, rest] = splitProps(props as selectTriggerProps, [ |
| 28 | "class", |
| 29 | "children", |
| 30 | ]); |
| 31 | |
| 32 | return ( |
| 33 | <SelectPrimitive.Trigger |
| 34 | class={cn( |
| 35 | "flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background transition-shadow placeholder:text-muted-foreground focus:outline-none focus-visible:ring-[1.5px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", |
| 36 | local.class, |
| 37 | )} |
| 38 | {...rest} |
| 39 | > |
| 40 | {local.children} |
| 41 | <SelectPrimitive.Icon |
| 42 | as="svg" |
| 43 | xmlns="http://www.w3.org/2000/svg" |
| 44 | width="1em" |
| 45 | height="1em" |
| 46 | viewBox="0 0 24 24" |
| 47 | class="flex size-4 items-center justify-center opacity-50" |
| 48 | > |
| 49 | <path |
| 50 | fill="none" |
| 51 | stroke="currentColor" |
| 52 | strokeLinecap="round" |
| 53 | strokeLinejoin="round" |
| 54 | strokeWidth="2" |
| 55 | d="m8 9l4-4l4 4m0 6l-4 4l-4-4" |
| 56 | /> |
| 57 | </SelectPrimitive.Icon> |
| 58 | </SelectPrimitive.Trigger> |
| 59 | ); |
| 60 | }; |
| 61 | |
| 62 | type selectContentProps<T extends ValidComponent = "div"> = |
| 63 | SelectContentProps<T> & { |