UNPKG

@snowball-tech/fractal

Version:

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

3 lines 1.81 kB
'use client'; import{a as x}from"./chunk-V46VJOI6.js";import{a as b}from"./chunk-IU2UNORC.js";import{a as e}from"./chunk-Q4ACHLJ4.js";import{a as _}from"./chunk-HTOKQYVM.js";import{b as o}from"./chunk-CMFNILWJ.js";import{a as f,b as D}from"./chunk-XYM7TA65.js";import*as R from"@radix-ui/react-dropdown-menu";import{forwardRef as A,useContext as h}from"react";import $ from"lodash/fp/isEmpty";import g from"lodash/fp/isFunction";import B from"lodash/fp/omit";import{jsx as y,jsxs as O}from"react/jsx-runtime";var v=A(({active:i=!1,children:a,condensed:I=!1,disabled:C,href:s,icon:n,label:r,onClick:m,onSelect:p,rainbow:M=!0,target:N,value:l,...w},E)=>{let c=!!a;!c&&$(r)&&console.warn("You must provide a `label` or `children` to the `DropdownItem` component");let{condensed:P,disabled:k,rainbow:F}=h(b),{condensed:T,disabled:L,rainbow:G}=h(x),t=C||L||k,H=I||T||P,u=M&&G&&F,d=!$(s);return y(R.Item,{ref:E,"aria-label":r,asChild:!0,className:D(`${o}-${e}__item`,u?"alternatee":"","flex items-center gap-1","rounded-sm outline-none transition-background-color duration-300 ease-out",H?`${o}-${e}__item--condensed max-h-6 px-2 py-1`:"p-2",n?`${o}-${e}__with-icon`:"",t?`${o}-${e}__item--disabled cursor-not-allowed !bg-transparent text-disabled`:"cursor-pointer text-dark",!t&&!u?"hover:bg-decorative-pink-90":"",d?`${o}-${e}__item__link no-underline`:"",w.className),disabled:t,title:r,...i?{"data-highlighted":i}:{},...d?{href:s,target:N}:{},...l===void 0?{}:{"data-value":l},...g(m)?{onSelect:m}:{},...g(p)?{onSelect:p}:{},...B(["className","data-value"],w),children:O(_,{element:d?"a":"div",variant:"body-1",children:[n&&y("div",{className:f(`${o}-${e}__item__icon`,"max-h-3 max-w-3"),children:n}),c?a:r]})})});v.displayName="DropdownItem";var V=v;export{v as a,V as b}; //# sourceMappingURL=chunk-UL2O53MQ.js.map