@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 o,c as x,f as _,g as F}from"./chunk-BSYEQJDQ.js";import{e as S}from"./chunk-WJB4GYBF.js";import{c as N}from"./chunk-LYTTDLE2.js";import{a as d}from"./chunk-AOLTZ2WJ.js";import{b as t,c as f,d as C}from"./chunk-CMFNILWJ.js";import{a as i,b as v}from"./chunk-XYM7TA65.js";import{UilTimes as h}from"@tooni/iconscout-unicons-react";import A from"lodash/fp/isFunction";import E from"lodash/fp/isNumber";import L from"lodash/fp/isString";import B from"lodash/fp/omit";import{jsx as m,jsxs as T}from"react/jsx-runtime";var b=({children:$,color:e=x,dismissable:n=!1,dismissButtonLabel:u="Close",fontSize:a=_,icon:l,onDismiss:p,title:r,...c})=>{let O=!!$,g=E(a)?String(a):a,s=F[g];["1","2"].includes(s)||(s=_);let y=L(r)?r:N(r);return T("div",{"aria-label":y,className:v(`${t}-${o}`,`${t}-${o}--${e}`,`${t}-${o}--${a}`,"relative flex flex-col gap-1 rounded-sm p-2 text-dark",e==="body"?"bg-body":f[e],n?`${t}-${o}--dismissable pr-6`:"",c.className),title:y,...B(["className"],c),children:[(r||l)&&T(d,{className:i(`${t}-${o}__title`,`${t}-${o}__title--${a}`,"flex items-center gap-1"),element:"div",variant:`body-${s}-bold`,children:[l&&m("div",{className:i(`${t}-${o}__title__icon`,`${t}-${o}__title__icon--${e}`,"h-3 w-3 text",e==="body"?"text-black":C[e]),children:l}),r]}),O&&m(d,{className:i(`${t}-${o}__content`,`${t}-${o}__content--${a}`,"max-h-full overflow-y-auto"),element:"div",variant:`body-${s}`,children:$}),n&&m("div",{className:i(`${t}-${o}__dismiss`,"absolute right-2 top-2 h-3 w-3"),children:m(S,{icon:m(h,{}),iconOnly:!0,label:u,variant:"text",...A(p)?{onClick:p}:{}})})]})};b.displayName="Card";var j=b;export{b as a,j as b};
//# sourceMappingURL=chunk-XJBHVT7R.js.map