@snowball-tech/fractal
Version:
Fractal's (Snowball's design system) React component library based on RadixUI and PandaCSS
3 lines • 2.12 kB
JavaScript
'use client';
import{a as y}from"./chunk-I4SBEDGF.js";import{a as N}from"./chunk-3UNDO2SI.js";import{a as s}from"./chunk-7IQEK4L7.js";import{e as u}from"./chunk-WJB4GYBF.js";import{b as a}from"./chunk-CMFNILWJ.js";import{a as f,b as c}from"./chunk-XYM7TA65.js";import{forwardRef as k,useImperativeHandle as F,useRef as d}from"react";import D from"lodash/fp/isFunction";import w from"lodash/fp/isString";import p from"lodash/fp/omit";import{jsx as g,jsxs as b}from"react/jsx-runtime";var x=k(({cancel:r,children:E,confirm:i,fixedActions:o=!0,fullHeight:t=!1,onCancel:m,onConfirm:M,scrollable:$=!0,...e},P)=>{let l=d(null),C=d(null),R=d(null);F(P,()=>({get container(){return l?.current?.container??null},get content(){return l?.current?.content??null},get trigger(){return l?.current?.trigger??null},get cancel(){return C?.current??null},get confirm(){return R?.current??null}}));let _=n=>{D(m)&&m(n,!0),D(e.onDismiss)&&e.onDismiss(n)},h=b("div",{className:f(`${a}-${s}__actions`,"flex h-fit flex-col gap-1 pb-quarter md:flex-row md:justify-end to-md:items-center",o?e.condensed?"pr-one-and-half":"pr-[calc(theme(spacing.3)-theme(spacing.half))]":""),children:[r&&g(u,{ref:C,className:"to-md:w-full",variant:"secondary",onClick:n=>m?.(n,!1),...w(r)?{label:r}:p(["href","onClick","target","type","variant"],r)}),g(u,{ref:R,className:"to-md:w-full",onClick:M,...w(i)?{label:i}:p(["href","onClick","target","type","variant"],i)})]}),v=b("div",{className:f(`${a}-${s}__content`,"flex w-full flex-col gap-5",t?"flex-1":"",o?"min-h-0":""),children:[E,!o&&h]});return b(y,{ref:l,className:c(`${a}-${s}`,e.className),fullHeight:t,...p(["className","dismissable","modal","onDismiss","scrollable"],e),dismissable:!0,modal:!0,scrollable:!1,onDismiss:_,children:[$?g(N,{className:t?"flex-1":"",contentClassName:c("visible flex flex-col w-full",t?"h-full":"",e.condensed?"gap-3 pr-one-and-half":"gap-5 pr-[calc(theme(spacing.3)-theme(spacing.half))]",e.contentClassName),scrollbarOnHover:e.scrollbarOnHover,children:v}):v,o&&h]})});x.displayName="Confirm";var U=x;export{x as a,U as b};
//# sourceMappingURL=chunk-UDDSO3ZO.js.map