@proulr/sdui-components 0.1.85 → 0.1.87

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.
Files changed (48) hide show
  1. package/package.json +1 -1
  2. package/src/bdc/components/discover.tsx +1 -4
  3. package/src/bdc/components/forms.tsx +4 -0
  4. package/src/bdc/components/inbox.tsx +4 -0
  5. package/src/renderer/SduiScreenRenderer.tsx +14 -2
  6. package/src/renderer/blocks/SduiDiscoverBlocks.tsx +50 -34
  7. package/src/renderer/blocks/SduiInboxBlocks.tsx +26 -11
  8. package/src/renderer/blocks/SduiLayoutBlocks.tsx +39 -46
  9. package/src/renderer/blocks/SduiNativeAdBlock.tsx +7 -8
  10. package/src/renderer/blocks/SduiSocialBlocks.tsx +4 -27
  11. package/src/renderer/lib/discover-profile-formatters.test.ts +7 -0
  12. package/src/renderer/lib/discover-profile-formatters.ts +6 -3
  13. package/src/renderer/sdui-hybrid-renderer-context.tsx +6 -1
  14. package/src/renderer/theme/proulr-theme.test.ts +107 -0
  15. package/src/renderer/theme/proulr-theme.ts +51 -9
  16. package/src/renderer/ui/AppButton.tsx +54 -28
  17. package/src/renderer/ui/AppChromeIconButton.tsx +19 -7
  18. package/src/renderer/ui/AuthStepShell.tsx +1 -2
  19. package/src/renderer/ui/Chip.tsx +41 -34
  20. package/src/renderer/ui/ChipRow.tsx +7 -13
  21. package/src/renderer/ui/HintText.tsx +2 -4
  22. package/src/renderer/ui/InfoBanner.tsx +20 -3
  23. package/src/renderer/ui/Label.tsx +2 -3
  24. package/src/renderer/ui/ListItem.tsx +28 -4
  25. package/src/renderer/ui/RangeSlider.tsx +1 -2
  26. package/src/renderer/ui/SectionHeader.tsx +3 -4
  27. package/src/renderer/ui/SelectRow.tsx +113 -22
  28. package/src/renderer/ui/StatRow.tsx +3 -3
  29. package/src/renderer/ui/TextField.tsx +15 -11
  30. package/src/renderer/ui/ToggleRow.tsx +38 -11
  31. package/src/renderer/ui/compose-audience-pill.tsx +2 -3
  32. package/src/renderer/ui/compose-media-carousel.tsx +20 -7
  33. package/src/renderer/ui/compose-media-shortcut.tsx +2 -3
  34. package/src/renderer/ui/compose-pill-input.tsx +28 -9
  35. package/src/renderer/ui/compose-recent-media-grid.tsx +5 -8
  36. package/src/renderer/ui/compose-reply-audience-sheet.tsx +19 -8
  37. package/src/renderer/ui/compose-screen-header.tsx +15 -10
  38. package/src/renderer/ui/compose-text-area.tsx +14 -8
  39. package/src/renderer/ui/compose-toolbar-icon.tsx +9 -5
  40. package/src/renderer/ui/compose-toolbar.tsx +0 -7
  41. package/src/renderer/ui/compose-visibility-row.tsx +2 -3
  42. package/src/renderer/ui/floating-create-menu.tsx +2 -3
  43. package/src/renderer/ui/focus-ring.ts +26 -0
  44. package/src/renderer/ui/index.ts +2 -1
  45. package/src/renderer/ui/story-compose-header.tsx +14 -9
  46. package/src/renderer/ui/story-create-shortcut-row.tsx +1 -1
  47. package/src/renderer/ui/story-editor-chrome.tsx +30 -16
  48. package/src/renderer/ui/story-surface-picker.tsx +1 -2
@@ -9,7 +9,7 @@ import {
9
9
  View,
10
10
  } from 'react-native';
11
11
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
12
- import { fonts, m3Colors, m3Shape, spacing } from '../theme/proulr-theme';
12
+ import { fonts, m3Colors, m3Shape, m3Type, spacing } from '../theme/proulr-theme';
13
13
  import { AppLoadingSpinner } from './AppLoadingSpinner';
14
14
  import { StoryBackGlyph } from './story-glyphs';
15
15
 
@@ -19,16 +19,21 @@ export type StoryEditorTool = {
19
19
  icon: ReactNode;
20
20
  };
21
21
 
22
+ /** Chrome sobre mídia: o visual fica compacto, o hit slop devolve os 44 de alvo. */
23
+ const CHROME_HIT_SLOP = { top: 4, bottom: 4, left: 4, right: 4 };
24
+
22
25
  export function StoryEditorChrome({
23
26
  children,
24
27
  tools,
25
28
  caption,
26
29
  onChangeCaption,
30
+ backLabel,
31
+ captionPlaceholder,
27
32
  onBack,
28
33
  onToolPress,
29
34
  onPublish,
30
35
  publishing,
31
- publishLabel = 'Compartilhar',
36
+ publishLabel,
32
37
  footerLeft,
33
38
  accessory,
34
39
  showCaption = true,
@@ -38,11 +43,14 @@ export function StoryEditorChrome({
38
43
  tools: StoryEditorTool[];
39
44
  caption: string;
40
45
  onChangeCaption: (value: string) => void;
46
+ /** Copy de produto vem do chamador (Rosetta) — primitivo SDUI não traduz. */
47
+ backLabel: string;
48
+ captionPlaceholder: string;
41
49
  onBack: () => void;
42
50
  onToolPress: (toolId: string) => void;
43
51
  onPublish: () => void;
44
52
  publishing?: boolean;
45
- publishLabel?: string;
53
+ publishLabel: string;
46
54
  footerLeft?: ReactNode;
47
55
  accessory?: ReactNode;
48
56
  showCaption?: boolean;
@@ -71,8 +79,9 @@ export function StoryEditorChrome({
71
79
  <Pressable
72
80
  onPress={onBack}
73
81
  accessibilityRole="button"
74
- accessibilityLabel="Voltar"
75
- style={styles.topBtn}
82
+ accessibilityLabel={backLabel}
83
+ hitSlop={CHROME_HIT_SLOP}
84
+ style={({ pressed }) => [styles.topBtn, pressed && styles.pressedOverlay]}
76
85
  >
77
86
  <StoryBackGlyph />
78
87
  </Pressable>
@@ -86,7 +95,8 @@ export function StoryEditorChrome({
86
95
  onPress={() => onToolPress(tool.id)}
87
96
  accessibilityRole="button"
88
97
  accessibilityLabel={tool.label}
89
- style={styles.toolItem}
98
+ hitSlop={CHROME_HIT_SLOP}
99
+ style={({ pressed }) => [styles.toolItem, pressed && styles.toolItemPressed]}
90
100
  >
91
101
  <View style={styles.toolIcon}>{tool.icon}</View>
92
102
  <Text style={styles.toolLabel}>{tool.label}</Text>
@@ -100,8 +110,9 @@ export function StoryEditorChrome({
100
110
  <TextInput
101
111
  value={caption}
102
112
  onChangeText={onChangeCaption}
103
- placeholder="Adicione uma legenda..."
113
+ placeholder={captionPlaceholder}
104
114
  placeholderTextColor={m3Colors.onSurfaceVariant}
115
+ accessibilityLabel={captionPlaceholder}
105
116
  style={styles.captionInput}
106
117
  multiline
107
118
  maxLength={220}
@@ -118,7 +129,7 @@ export function StoryEditorChrome({
118
129
  style={({ pressed }) => [
119
130
  styles.publishBtn,
120
131
  publishing && styles.publishBtnDisabled,
121
- pressed && !publishing && { opacity: 0.9 },
132
+ pressed && !publishing && styles.publishBtnPressed,
122
133
  ]}
123
134
  >
124
135
  {publishing ? (
@@ -150,13 +161,14 @@ const styles = StyleSheet.create({
150
161
  zIndex: 2,
151
162
  },
152
163
  topBtn: {
153
- width: 40,
154
- height: 40,
155
- borderRadius: 20,
164
+ width: 44,
165
+ height: 44,
166
+ borderRadius: 22,
156
167
  backgroundColor: m3Colors.scrim,
157
168
  alignItems: 'center',
158
169
  justifyContent: 'center',
159
170
  },
171
+ pressedOverlay: { backgroundColor: m3Colors.statePressed },
160
172
  bottomChrome: {
161
173
  position: 'absolute',
162
174
  left: 0,
@@ -178,6 +190,7 @@ const styles = StyleSheet.create({
178
190
  alignItems: 'center',
179
191
  gap: spacing.xs,
180
192
  },
193
+ toolItemPressed: { opacity: 0.7 },
181
194
  toolIcon: {
182
195
  width: 44,
183
196
  height: 44,
@@ -188,14 +201,12 @@ const styles = StyleSheet.create({
188
201
  },
189
202
  toolLabel: {
190
203
  color: m3Colors.onPrimary,
191
- fontFamily: fonts.medium,
192
- fontSize: 11,
204
+ ...m3Type.labelSmall,
193
205
  textAlign: 'center',
194
206
  },
195
207
  captionInput: {
208
+ ...m3Type.body,
196
209
  color: m3Colors.onPrimary,
197
- fontFamily: fonts.regular,
198
- fontSize: 15,
199
210
  minHeight: 40,
200
211
  maxHeight: 72,
201
212
  paddingHorizontal: spacing.md,
@@ -223,9 +234,12 @@ const styles = StyleSheet.create({
223
234
  publishBtnDisabled: {
224
235
  opacity: 0.6,
225
236
  },
237
+ publishBtnPressed: {
238
+ opacity: 0.88,
239
+ },
226
240
  publishLabel: {
241
+ ...m3Type.label,
227
242
  color: m3Colors.onPrimary,
228
243
  fontFamily: fonts.bold,
229
- fontSize: 15,
230
244
  },
231
245
  });
@@ -117,9 +117,8 @@ const styles = StyleSheet.create({
117
117
  minWidth: 0,
118
118
  },
119
119
  optionLabel: {
120
+ ...m3Type.titleSmall,
120
121
  color: m3Colors.onSurface,
121
- fontFamily: fonts.semibold,
122
- fontSize: 16,
123
122
  },
124
123
  optionHint: {
125
124
  color: m3Colors.onSurfaceVariant,