@proulr/sdui-components 0.1.68 → 0.1.70

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.
@@ -1,10 +1,11 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <!--
3
- Camera — soft body plate, lens ring, flash nub.
3
+ Camera — landscape body with trapezoid viewfinder, lens, flash cuboid.
4
4
  -->
5
5
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
6
- <path fill="currentColor" fill-opacity="0.3" d="M8.2 5.2h2.1l1.1-1.4h1.4l1.1 1.4h2.1A2.4 2.4 0 0 1 18.4 7.6v10a2.4 2.4 0 0 1-2.4 2.4H8.2A2.4 2.4 0 0 1 5.8 17.6v-10A2.4 2.4 0 0 1 8.2 5.2z" />
7
- <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none" stroke-width="1.8" d="M8.2 5.8h2l1-1.2h1.6l1 1.2h2A1.8 1.8 0 0 1 17.6 7.6v10a1.8 1.8 0 0 1-1.8 1.8H8.2A1.8 1.8 0 0 1 6.4 17.6v-10A1.8 1.8 0 0 1 8.2 5.8z" />
8
- <circle cx="12" cy="12.6" r="3.4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none" stroke-width="1.8" />
9
- <circle cx="12" cy="12.6" r="1.65" fill="currentColor" />
6
+ <path fill="currentColor" fill-opacity="0.3" d="M9 3.2 7.2 6H4.2A2.6 2.6 0 0 0 1.6 8.6v9.6A2.6 2.6 0 0 0 4.2 20.8h15.6a2.6 2.6 0 0 0 2.6-2.6V8.6A2.6 2.6 0 0 0 19.8 6h-3L15 3.2H9z" />
7
+ <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none" stroke-width="1.85" d="M9.1 3.9 7.4 6.5H4.4A1.9 1.9 0 0 0 2.5 8.4v9.4A1.9 1.9 0 0 0 4.4 19.7h15.2a1.9 1.9 0 0 0 1.9-1.9V8.4a1.9 1.9 0 0 0-1.9-1.9h-3l-1.7-2.6H9.1z" />
8
+ <circle cx="12" cy="13.1" r="3.65" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none" stroke-width="1.85" />
9
+ <circle cx="12" cy="13.1" r="1.5" fill="currentColor" />
10
+ <rect x="5.35" y="8.35" width="2.55" height="1.9" rx="0.5" fill="currentColor" />
10
11
  </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proulr/sdui-components",
3
- "version": "0.1.68",
3
+ "version": "0.1.70",
4
4
  "type": "module",
5
5
  "main": "./src/renderer/index.ts",
6
6
  "types": "./src/renderer/index.ts",
@@ -39,7 +39,7 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "@proulr/sdui-contract": "^0.1.15",
42
+ "@proulr/sdui-contract": "^0.1.16",
43
43
  "react-native-qrcode-svg": "^6.3.21"
44
44
  },
45
45
  "peerDependencies": {
@@ -282,11 +282,11 @@ export function SduiChipBlock({ block, onAction }: SduiBlockRenderProps) {
282
282
  const active = readBooleanProp(block, 'active');
283
283
  const variant = readStringProp(block, 'variant') ?? 'default';
284
284
  const isHeader = variant === 'on_header';
285
- const displayLabel = glyph ? `${glyph} ${label}` : label;
286
285
 
287
286
  return (
288
287
  <Chip
289
- label={displayLabel}
288
+ label={label}
289
+ icon={glyph}
290
290
  active={active}
291
291
  disabled={!actionId}
292
292
  variant={isHeader ? 'onHeader' : 'default'}
@@ -1,5 +1,6 @@
1
1
  import { Pressable, StyleSheet, Text } from 'react-native';
2
2
  import { colors, fonts, m3Colors, m3Shape, spacing } from '../theme/proulr-theme';
3
+ import { AppIcon, isAppIconName } from './app-icon';
3
4
 
4
5
  export function Chip({
5
6
  label,
@@ -7,12 +8,14 @@ export function Chip({
7
8
  onPress,
8
9
  variant = 'default',
9
10
  disabled,
11
+ icon,
10
12
  }: {
11
13
  label: string;
12
14
  active?: boolean;
13
15
  onPress?: () => void;
14
16
  variant?: 'default' | 'onHeader';
15
17
  disabled?: boolean;
18
+ icon?: string;
16
19
  }) {
17
20
  const isHeader = variant === 'onHeader';
18
21
 
@@ -32,12 +35,15 @@ export function Chip({
32
35
  ? colors.textOnAccent
33
36
  : m3Colors.onSurfaceVariant;
34
37
 
38
+ const iconName = icon && isAppIconName(icon) ? icon : null;
39
+
35
40
  return (
36
41
  <Pressable
37
42
  onPress={onPress}
38
43
  disabled={disabled}
39
44
  style={[styles.chip, isHeader && styles.chipOnHeader, containerStyle]}
40
45
  >
46
+ {iconName ? <AppIcon name={iconName} size={isHeader ? 14 : 15} color={textColor} /> : null}
41
47
  <Text
42
48
  style={{
43
49
  color: textColor,
@@ -53,6 +59,9 @@ export function Chip({
53
59
 
54
60
  const styles = StyleSheet.create({
55
61
  chip: {
62
+ flexDirection: 'row',
63
+ alignItems: 'center',
64
+ gap: spacing.xs,
56
65
  paddingHorizontal: spacing.sm,
57
66
  paddingVertical: spacing.sm,
58
67
  borderRadius: m3Shape.cornerSmall,
@@ -1,5 +1,5 @@
1
1
  /* Generated by scripts/generate-app-icons.mjs — do not edit. */
2
- import Svg, { Circle, Path } from 'react-native-svg';
2
+ import Svg, { Circle, Path, Rect } from 'react-native-svg';
3
3
  import { m3Colors } from '../../theme/proulr-theme';
4
4
  import type { AppIconGlyphProps } from '../app-icon-glyph-props';
5
5
 
@@ -9,10 +9,11 @@ export function CameraIcon({
9
9
  }: AppIconGlyphProps) {
10
10
  return (
11
11
  <Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
12
- <Path fill={color} fillOpacity={0.3} d="M8.2 5.2h2.1l1.1-1.4h1.4l1.1 1.4h2.1A2.4 2.4 0 0 1 18.4 7.6v10a2.4 2.4 0 0 1-2.4 2.4H8.2A2.4 2.4 0 0 1 5.8 17.6v-10A2.4 2.4 0 0 1 8.2 5.2z" />
13
- <Path stroke={color} strokeLinecap="round" strokeLinejoin="round" fill="none" strokeWidth={1.8} d="M8.2 5.8h2l1-1.2h1.6l1 1.2h2A1.8 1.8 0 0 1 17.6 7.6v10a1.8 1.8 0 0 1-1.8 1.8H8.2A1.8 1.8 0 0 1 6.4 17.6v-10A1.8 1.8 0 0 1 8.2 5.8z" />
14
- <Circle cx={12} cy={12.6} r={3.4} stroke={color} strokeLinecap="round" strokeLinejoin="round" fill="none" strokeWidth={1.8} />
15
- <Circle cx={12} cy={12.6} r={1.65} fill={color} />
12
+ <Path fill={color} fillOpacity={0.3} d="M9 3.2 7.2 6H4.2A2.6 2.6 0 0 0 1.6 8.6v9.6A2.6 2.6 0 0 0 4.2 20.8h15.6a2.6 2.6 0 0 0 2.6-2.6V8.6A2.6 2.6 0 0 0 19.8 6h-3L15 3.2H9z" />
13
+ <Path stroke={color} strokeLinecap="round" strokeLinejoin="round" fill="none" strokeWidth={1.85} d="M9.1 3.9 7.4 6.5H4.4A1.9 1.9 0 0 0 2.5 8.4v9.4A1.9 1.9 0 0 0 4.4 19.7h15.2a1.9 1.9 0 0 0 1.9-1.9V8.4a1.9 1.9 0 0 0-1.9-1.9h-3l-1.7-2.6H9.1z" />
14
+ <Circle cx={12} cy={13.1} r={3.65} stroke={color} strokeLinecap="round" strokeLinejoin="round" fill="none" strokeWidth={1.85} />
15
+ <Circle cx={12} cy={13.1} r={1.5} fill={color} />
16
+ <Rect x={5.35} y={8.35} width={2.55} height={1.9} rx={0.5} fill={color} />
16
17
  </Svg>
17
18
  );
18
19
  }