@snowball-tech/fractal
Version:
Fractal's (Snowball's design system) React component library based on RadixUI and PandaCSS
3 lines • 1.44 kB
JavaScript
'use client';
import{a as u}from"./chunk-YWWK6PZ5.js";import{a as n}from"./chunk-JVVBSAPQ.js";import{a as x}from"./chunk-LAEC4JYL.js";import{c as s}from"./chunk-LYTTDLE2.js";import{a as f}from"./chunk-AOLTZ2WJ.js";import{b as m}from"./chunk-CMFNILWJ.js";import{b as d}from"./chunk-XYM7TA65.js";import*as t from"@radix-ui/react-select";import{useContext as S}from"react";import T from"lodash/fp/isEmpty";import b from"lodash/fp/isString";import _ from"lodash/fp/omit";import{jsx as a,jsxs as P}from"react/jsx-runtime";var I=({children:o,disabled:R=!1,label:e,labelElement:g,rainbow:y=!0,value:w,...l})=>{let r=!!o;!r&&!e&&console.warn("You must provide a `label` or `children` to the `SelectItem` component");let{disabled:h,rainbow:v}=S(x),{disabled:C,rainbow:N}=S(u),i=R||h||C,c=y&&v&&N,p=b(e)?e:T(e)?s(o):s(e);return P(t.Item,{"aria-label":p,className:d(`${m}-${n}__item`,c?"alternatee":"","flex select-none items-center gap-1 rounded-sm p-2 outline-none transition-background-color duration-300 ease-out",i?`${m}-${n}__item--disabled cursor-not-allowed !bg-transparent text-disabled`:"cursor-pointer text-dark",!i&&!c?"hover:bg-decorative-pink-90":"",l.className),disabled:i,title:p,value:w,..._(["className"],l),children:[a(t.ItemText,{asChild:!0,children:a(f,{element:g||(b(r?o:e)?void 0:"div"),children:r?o:e})}),a(t.ItemIndicator,{})]})};I.displayName="SelectItem";var U=I;export{I as a,U as b};
//# sourceMappingURL=chunk-6AFEUXVB.js.map