import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{ht as r,t as i}from"./dist-DtfJeYQK.js";import{t as a}from"./jsx-runtime-C2wGStra.js";import{n as o,t as s}from"./dist-Cc1j9Pjk.js";import{n as c,t as l}from"./Icon-0Ag8a3l4.js";var u,d,f,p=t((()=>{u=`badge__ioy0w`,d=`label__lXPEF`,f={badge:u,label:d}})),m,h,g,_,v=t((()=>{s(),i(),m=e(n(),1),c(),p(),h=a(),g=e=>{switch(e){case`xs`:return`small`;case`s`:return`medium`;case`m`:return`large`;default:return e}},_=(0,m.forwardRef)(function({type:e=`neutral`,size:t=`medium`,leadingSvgIcon:n,dataset:i,children:a,accent:s,inverted:c,hideLabel:u,className:d,...p},m){let _=g(t),v={...i,size:_};return s===void 0&&c===void 0?v.type=e:(v.accent=s||`unset`,v.inverted=!!c),(0,h.jsxs)(`span`,{...p,ref:m,className:[f.badge,d].filter(Boolean).join(` `),...r(v,{preplyDsComponent:o.Badge}),children:[!!n&&(0,h.jsx)(l,{accent:`primary`,size:t===`large`?`24`:`16`,svg:n}),(0,h.jsx)(`span`,{className:f.label,"data-hidden":u,children:a})]})});try{_.displayName=`Badge`,_.__docgenInfo={description:``,displayName:`Badge`,props:{size:{defaultValue:{value:`medium`},description:`The size of the badge.`,name:`size`,required:!1,type:{name:`enum`,value:[{value:`"small"`},{value:`"medium"`},{value:`"large"`},{value:`"s"`},{value:`"xs"`},{value:`"m"`}]}},leadingSvgIcon:{defaultValue:null,description:`The leading SVG icon.
@example import TokyoUITag from '@preply/ds-media-icons/dist/24/TokyoUITag.svg';

<Badge leadingSvgIcon={TokyoUITag}>Badge</Badge>
or
<Badge leadingSvgIcon={<TokyoUITag />}>Badge</Badge>`,name:`leadingSvgIcon`,required:!1,type:{name:`enum`,value:[{value:`ComponentClass<SVGAttributes<SVGElement>, any>`},{value:`FunctionComponent<SVGAttributes<SVGElement>>`},{value:`ReactElement<any, string | JSXElementConstructor<any>>`}]}},dataset:{defaultValue:null,description:``,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}},hideLabel:{defaultValue:null,description:`@deprecated Look at <IconTile> if you need an icon-only badge.

Hides badge label visually, but keeps it in the accessibility tree.
Use this prop to implement icons-only badges.
@example <Badge leadingSvgIcon={<TokyoUITag />} hideLabel>Badge</Badge>`,name:`hideLabel`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},assistiveText:{defaultValue:null,description:`@deprecated badge children should have all necessary information`,name:`assistiveText`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},type:{defaultValue:{value:`neutral`},description:`The type of the badge.`,name:`type`,required:!1,type:{name:`enum`,value:[{value:`"neutral"`},{value:`"info"`},{value:`"ai"`},{value:`"positive"`},{value:`"warning"`},{value:`"critical"`}]}},accent:{defaultValue:null,description:"@deprecated Use `type` instead.",name:`accent`,required:!1,type:{name:`enum`,value:[{value:`"accent"`},{value:`"info"`},{value:`"positive"`},{value:`"warning"`},{value:`"critical"`},{value:`"tertiary"`}]}},inverted:{defaultValue:null,description:`@deprecated inverted badge is deprecated & will be removed in the future releases`,name:`inverted`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}}}}}catch{}}));export{v as n,_ as t};