@proulr/sdui-components 0.1.43 → 0.1.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proulr/sdui-components",
3
- "version": "0.1.43",
3
+ "version": "0.1.45",
4
4
  "type": "module",
5
5
  "main": "./src/renderer/index.ts",
6
6
  "types": "./src/renderer/index.ts",
@@ -1,13 +1,18 @@
1
1
  import React from 'react';
2
2
  import { StyleSheet, Text, View } from 'react-native';
3
3
  import QRCode from 'react-native-qrcode-svg';
4
- import { m3Colors, m3Shape, m3Type, spacing } from '../theme/proulr-theme';
4
+ import { gradients, m3Colors, m3Shape, m3Type, spacing } from '../theme/proulr-theme';
5
5
  import { resolveViewStyleProps } from '../theme/resolve-style-props';
6
6
  import type { SduiBlockRenderProps } from './SduiPrimitiveBlocks';
7
7
 
8
+ // `require` (padrão RN para assets estáticos) — import ESM de .png exigiria um
9
+ // ambient d.ts que consumers compilando o source em node_modules não enxergam.
10
+ const brandMarkAsset = require('../assets/proulr-brand-mark.png') as number;
11
+
8
12
  /**
9
13
  * Nametag de QR estilo "cartão de convite" (ref. Instagram): cartão claro
10
- * (inverseSurface) com QR de alto contraste e rótulo opcional (ex.: @handle).
14
+ * (inverseSurface) com QR customizado da marca — módulos no gradiente Proulr
15
+ * (roxo → fúcsia) e brand mark no centro (ECC alto para manter a leitura).
11
16
  * Wire: `value` = conteúdo do QR, `size` em px, `label` = texto sob o código.
12
17
  */
13
18
  export function SduiQrCodeBlock({ block }: SduiBlockRenderProps) {
@@ -24,8 +29,15 @@ export function SduiQrCodeBlock({ block }: SduiBlockRenderProps) {
24
29
  <QRCode
25
30
  value={value}
26
31
  size={size}
27
- color={m3Colors.inverseOnSurface}
28
32
  backgroundColor={m3Colors.inverseSurface}
33
+ enableLinearGradient
34
+ linearGradient={[...gradients.brand]}
35
+ ecl="H"
36
+ logo={brandMarkAsset}
37
+ logoSize={Math.round(size * 0.22)}
38
+ logoBackgroundColor={m3Colors.inverseSurface}
39
+ logoMargin={Math.max(3, Math.round(size * 0.02))}
40
+ logoBorderRadius={m3Shape.cornerMedium}
29
41
  />
30
42
  {label ? <Text style={styles.label}>{label}</Text> : null}
31
43
  </View>