UNPKG

@snowball-tech/fractal

Version:

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

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