UNPKG

@snowball-tech/fractal

Version:

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

3 lines 1.61 kB
'use client'; import{b as l}from"./chunk-ZSI5LRZG.js";import{a as p}from"./chunk-FOFU25YN.js";import{a}from"./chunk-CIUXHROH.js";import{b as s}from"./chunk-JCH6ZCER.js";import{b as n}from"./chunk-CMFNILWJ.js";import{b as i}from"./chunk-XYM7TA65.js";import{forwardRef as R,useContext as T,useState as y}from"react";import M from"lodash/fp/isEmpty";import P from"lodash/fp/isFunction";import E from"lodash/fp/omit";import{jsx as m}from"react/jsx-runtime";var f=R(({active:c=!1,children:b,disabled:g=!1,elevation:h="2",icon:w,iconOnly:u=!1,iconPosition:D="left",label:e,...r},C)=>{M(e)&&console.warn("You must provide a `label` to the `ToolbarDropdown` component");let{disabled:v}=T(p),o=g||v,[t,x]=y(!1),O=d=>{P(r.onMenuOpenChange)&&r.onMenuOpenChange(d),x(d)};return m(s,{ref:C,"aria-label":e,className:i(`${n}-${a}__dropdown`,"group h-3 max-h-3 rounded-xs",t&&!o?"text-dark":o?"text-disabled":"text-placeholder",t&&!o?"bg-decorative-pink-90":"",o?`${n}-${a}__dropdown--disabled`:"hover:bg-decorative-pink-90 hover:text-dark"),condensed:!0,disabled:o,dropdown:{className:'data-[side="bottom"]:mt-2 data-[side="top"]:mb-2 data-[side="right"]:ml-[calc(theme(spacing.2)+theme(spacing.half))] data-[side="left"]:mr-[calc(theme(spacing.2)+theme(spacing.half))]'},elevation:h,open:r.open||t,title:e,trigger:m(l,{active:c,disabled:o,icon:w,iconOnly:u,iconPosition:D,label:e}),triggerAsButton:!1,onMenuOpenChange:O,...E(["className","condensed","trigger","onMenuOpenChange","triggerAsButton"],r),children:b})});f.displayName="ToolbarDropdown";var X=f;export{f as a,X as b}; //# sourceMappingURL=chunk-P2MVTZE7.js.map