@while-and-for/tremor-react
Version:
The React library to build dashboards faster.
3 lines (2 loc) • 1.37 kB
JavaScript
'use client';
import{__rest as e}from"tslib";import t from"react";import{sizing as r}from"../../../lib/sizing.js";import{spacing as a}from"../../../lib/spacing.js";import{makeClassName as o}from"../../../lib/utils.js";import{tremorTwMerge as m}from"../../../lib/tremorTwMerge.js";import{Listbox as n}from"@headlessui/react";const i=o("SelectItem"),s=t.forwardRef(((o,s)=>{const{value:c,icon:d,className:l,children:u}=o,g=e(o,["value","icon","className","children"]),p=d;return t.createElement(n.Option,Object.assign({className:m(i("root"),"flex justify-start items-center cursor-default text-tremor-default","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",a.md.paddingX,a.md.paddingY,l),ref:s,key:c,value:c},g),p&&t.createElement(p,{className:m(i("icon"),"flex-none","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",r.lg.width,a.xs.marginRight)}),t.createElement("span",{className:"whitespace-nowrap truncate"},null!=u?u:c))}));s.displayName="SelectItem";export{s as default};