UNPKG

@snowball-tech/fractal

Version:

Fractal's (Snowball's design system) React component library based on RadixUI and PandaCSS

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