UNPKG

@snowball-tech/fractal

Version:

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

2 lines 1.24 kB
import{a as e,i as t}from"../constants-CW2-utNH.js";import{r as n}from"../helpers-DBEwVIlX.js";import{Typography as r}from"../Typography/Typography.js";import{r as i}from"../utils-K22C_6qC.js";import{DEFAULT_COLOR as a,sizeToTypographyVariant as o}from"./Tag.constants.js";import s from"lodash/fp/isEmpty.js";import c from"lodash/fp/isString.js";import l from"lodash/fp/omit.js";import{jsx as u}from"react/jsx-runtime";const d=({children:d,color:f=a,disabled:p=!1,fullWidth:m=!1,label:h,size:g=`s`,..._})=>{let v=!!d;!v&&!h&&console.warn("You must provide a `label` or `children` to the `DropdownItem` component");let y=c(h)?h:s(h)?i(d):i(h);return u(r,{"aria-label":y,className:n(`${e}-tag`,`${e}-tag--${f}`,`${e}-tag--${g}`,`inline-flex w-fit items-center justify-center rounded-full border-1`,{m:`px-2 py-1 leading-[20px] max-h-[38px]`,s:`px-1 py-half max-h-[28px] leading-[18px]`}[g],f===`white`?`border-grey-70`:`border-transparent`,m?`${e}-tag--full-width w-full`:``,p?`${e}-tag--disabled cursor-not-allowed bg-disabled-light text-disabled`:`${t[f]} cursor-default`,_.className),element:`div`,title:y,variant:o[g],...l([`className`],_),children:v?d:h})};d.displayName=`Tag`;export{d as Tag,d as default}; //# sourceMappingURL=Tag.js.map