@snowball-tech/fractal
Version:
Fractal's (Snowball's design system) React component library based on RadixUI and PandaCSS
3 lines • 1.71 kB
JavaScript
'use client';
import{a as x}from"./chunk-PQNWZLJS.js";import{a as _}from"./chunk-XBL3ZKKI.js";import{a as e}from"./chunk-Q4ACHLJ4.js";import{a as D}from"./chunk-UC7BXZ7T.js";import{b as o}from"./chunk-CMFNILWJ.js";import{a as u,b as w}from"./chunk-KHPUS472.js";import*as g from"@radix-ui/react-dropdown-menu";import{forwardRef as k,useContext as $}from"react";import h from"lodash/fp/isEmpty";import y from"lodash/fp/isFunction";import L from"lodash/fp/omit";import{jsx as b,jsxs as G}from"react/jsx-runtime";var I=k(({active:d=!1,children:i,condensed:R=!1,disabled:C,href:a,icon:r,label:t,onClick:m,onSelect:s,target:v,value:p,...l},M)=>{let c=!!i;!c&&h(t)&&console.warn("You must provide a `label` or `children` to the `DropdownItem` component");let{condensed:N,disabled:E}=$(_),{condensed:P,disabled:F}=$(x),f=C||F||E,T=R||P||N,n=!h(a);return b(g.Item,{ref:M,"aria-label":t,asChild:!0,className:w(`${o}-${e}__item`,"alternatee","flex items-center gap-1","rounded-sm outline-none transition-background-color duration-300 ease-out",T?`${o}-${e}__item--condensed max-h-6 px-2 py-1`:"p-2",r?`${o}-${e}__with-icon`:"",f?`${o}-${e}__item--disabled cursor-not-allowed !bg-transparent text-disabled`:"cursor-pointer text-dark",n?`${o}-${e}__item__link no-underline`:"",l.className),disabled:f,title:t,...d?{"data-highlighted":d}:{},...n?{href:a,target:v}:{},...p===void 0?{}:{"data-value":p},...y(m)?{onSelect:m}:{},...y(s)?{onSelect:s}:{},...L(["className","data-value"],l),children:G(D,{element:n?"a":"div",children:[r&&b("div",{className:u(`${o}-${e}__item__icon`,"max-h-3 max-w-3"),children:r}),c?i:t]})})});I.displayName="DropdownItem";var J=I;export{I as a,J as b};
//# sourceMappingURL=chunk-2DSC5YTX.js.map