{"version":3,"file":"chunk-Badge.mjs","names":[],"sources":["../../src/components/Badge/Badge.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport React, { type HTMLAttributes, forwardRef } from 'react';\n\nimport { mx } from '@dxos/ui-theme';\nimport { type ThemedClassName } from '@dxos/ui-types';\n\nimport { recipes } from '../../recipes.ts';\n\ntype BadgeCorner = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';\n\ntype BadgeRootProps = ThemedClassName<HTMLAttributes<HTMLSpanElement>>;\n\n/** Sizes to its child (an Avatar or an Icon) and anchors a `Mark` to one of its corners. */\nconst BadgeRoot = forwardRef<HTMLSpanElement, BadgeRootProps>(({ classNames, ...props }, forwardedRef) => (\n  <span {...props} data-scope='badge' data-part='root' className={mx(recipes.badge(), classNames)} ref={forwardedRef} />\n));\n\nBadgeRoot.displayName = 'Badge.Root';\n\ntype BadgeMarkProps = ThemedClassName<HTMLAttributes<HTMLSpanElement>> & {\n  corner?: BadgeCorner;\n};\n\n/**\n * A small glyph (an Avatar with `fill`, or an Icon) half the root's size over one of its corners, ringed in the surface\n * colour so it reads as cut out of what it overlaps.\n */\nconst BadgeMark = forwardRef<HTMLSpanElement, BadgeMarkProps>(\n  ({ classNames, corner = 'bottom-end', ...props }, forwardedRef) => (\n    <span\n      {...props}\n      data-scope='badge'\n      data-part='mark'\n      data-corner={corner}\n      className={mx(recipes.badgeMark(), classNames)}\n      ref={forwardedRef}\n    />\n  ),\n);\n\nBadgeMark.displayName = 'Badge.Mark';\n\nexport { BadgeMark as Mark, BadgeRoot as Root };\nexport type { BadgeCorner as Corner, BadgeMarkProps as MarkProps, BadgeRootProps as RootProps };\n"],"mappings":";;;;;;;;;;;AAkBA,IAAM,YAAY,YAA6C,EAAE,YAAY,GAAG,SAAS,iBACvF,oBAAC,QAAD;CAAM,GAAI;CAAO,cAAW;CAAQ,aAAU;CAAO,WAAW,GAAG,QAAQ,MAAM,GAAG,UAAU;CAAG,KAAK;AAAe,CAAA,CACtH;AAED,UAAU,cAAc;;;;;AAUxB,IAAM,YAAY,YACf,EAAE,YAAY,SAAS,cAAc,GAAG,SAAS,iBAChD,oBAAC,QAAD;CACE,GAAI;CACJ,cAAW;CACX,aAAU;CACV,eAAa;CACb,WAAW,GAAG,QAAQ,UAAU,GAAG,UAAU;CAC7C,KAAK;AACN,CAAA,CAEL;AAEA,UAAU,cAAc"}