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"./filterAttributesPassedByRadixUIAtRuntime-CGiuUnR2.js";import{n as u,t as d}from"./Icon-0niTGk4t.js";var f,p,m,h=t((()=>{f=`badge__ioy0w`,p=`label__lXPEF`,m={badge:f,label:p}})),g,_,v,y,b=t((()=>{s(),i(),g=e(n(),1),c(),u(),h(),_=a(),v=e=>{switch(e){case`xs`:return`small`;case`s`:return`medium`;case`m`:return`large`;default:return e}},y=(0,g.forwardRef)(function({type:e=`neutral`,size:t=`medium`,leadingSvgIcon:n,dataset:i,children:a,accent:s,inverted:c,hideLabel:u,...f},p){let h=v(t),g={...i,size:h};return s===void 0&&c===void 0?g.type=e:(g.accent=s||`unset`,g.inverted=!!c),(0,_.jsxs)(`span`,{...l(f),ref:p,className:m.badge,...r(g,{preplyDsComponent:o.Badge}),children:[!!n&&(0,_.jsx)(d,{accent:`primary`,size:t===`large`?`24`:`16`,svg:n}),(0,_.jsx)(`span`,{className:m.label,"data-hidden":u,children:a})]})});try{y.displayName=`Badge`,y.__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:`"xs"`},{value:`"s"`},{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:`"ai"`},{value:`"neutral"`},{value:`"info"`},{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{b as n,y as t};