{"version":3,"file":"chunk-QrCode.mjs","names":["QrCode","QrCodePrimitive","Icon.Icon"],"sources":["../../src/components/QrCode/QrCode.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { QrCode as QrCodePrimitive } from '@ark-ui/react/qr-code';\nimport React, { forwardRef } from 'react';\n\nimport { mx } from '@dxos/ui-theme';\nimport { type ThemedClassName } from '@dxos/ui-types';\n\nimport { recipes } from '../../recipes.ts';\nimport * as Icon from '../Icon/Icon.tsx';\n\nexport type QrCodeErrorCorrection = 'L' | 'M' | 'Q' | 'H';\n\nexport type QrCodeProps = ThemedClassName<\n  Omit<QrCodePrimitive.RootProps, 'value' | 'defaultValue' | 'encoding' | 'children'>\n> & {\n  /** What the code encodes. */\n  value: string;\n  /** How much of the code may be lost and still read; higher costs modules. `M` by default. */\n  errorCorrection?: QrCodeErrorCorrection;\n  /** An icon over the centre, which the error correction must cover (use `Q` or `H`). */\n  icon?: string;\n  /** Names the code (`aria-label`); otherwise reference a visible name with `aria-labelledby`. */\n  label?: string;\n};\n\n/**\n * Ark's QR code: a square that fills its host's width, its modules drawn in the current text colour on a transparent\n * ground so it reads on any surface. The root is the element (`role=img`), so a label lands on it.\n */\nexport const QrCode = forwardRef<HTMLDivElement, QrCodeProps>(\n  ({ classNames, value, errorCorrection = 'M', icon, label, ...props }, forwardedRef) => (\n    <QrCodePrimitive.Root\n      role='img'\n      {...(label && { 'aria-label': label })}\n      {...props}\n      value={value}\n      encoding={{ ecc: errorCorrection }}\n      className={mx(recipes.qrCode(), classNames)}\n      ref={forwardedRef}\n    >\n      <QrCodePrimitive.Frame className={recipes.qrCodeFrame()}>\n        <QrCodePrimitive.Pattern className={recipes.qrCodePattern()} />\n      </QrCodePrimitive.Frame>\n      {icon && (\n        <QrCodePrimitive.Overlay className={recipes.qrCodeOverlay()}>\n          <Icon.Icon icon={icon} />\n        </QrCodePrimitive.Overlay>\n      )}\n    </QrCodePrimitive.Root>\n  ),\n);\n\nQrCode.displayName = 'QrCode';\n"],"mappings":";;;;;;;;;;;;;AAkCA,IAAaA,WAAS,YACnB,EAAE,YAAY,OAAO,kBAAkB,KAAK,MAAM,OAAO,GAAG,SAAS,iBACpE,qBAACC,OAAgB,MAAjB;CACE,MAAK;CACL,GAAK,SAAS,EAAE,cAAc,MAAM;CACpC,GAAI;CACG;CACP,UAAU,EAAE,KAAK,gBAAgB;CACjC,WAAW,GAAG,QAAQ,OAAO,GAAG,UAAU;CAC1C,KAAK;CAPP,UAAA,CASE,oBAACA,OAAgB,OAAjB;EAAuB,WAAW,QAAQ,YAAY;EACpD,UAAA,oBAACA,OAAgB,SAAjB,EAAyB,WAAW,QAAQ,cAAc,EAAI,CAAA;CACzC,CAAA,GACtB,QACC,oBAACA,OAAgB,SAAjB;EAAyB,WAAW,QAAQ,cAAc;EACxD,UAAA,oBAACC,MAAD,EAAiB,KAAO,CAAA;CACD,CAAA,CAEP;AAE1B,CAAA,CAAA;AAEA,SAAO,cAAc"}