@applicaster/zapp-react-native-ui-components 15.1.11-alpha.2710844646 → 15.1.11-alpha.5441005545

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 (36) hide show
  1. package/Components/Cell/Cell.tsx +3 -6
  2. package/Components/ModalComponent/AudioPlayer/Components/Action.tsx +87 -33
  3. package/Components/ModalComponent/AudioPlayer/Components/Button.tsx +71 -42
  4. package/Components/ModalComponent/AudioPlayer/Components/Header.tsx +107 -142
  5. package/Components/ModalComponent/AudioPlayer/Components/Item.tsx +154 -319
  6. package/Components/ModalComponent/AudioPlayer/Components/index.ts +4 -8
  7. package/Components/ModalComponent/BottomSheetModalContent.tsx +61 -379
  8. package/Components/ModalComponent/Button/index.tsx +3 -5
  9. package/Components/ModalComponent/Header/index.tsx +7 -20
  10. package/Components/ModalComponent/Header/utils.ts +1 -1
  11. package/Components/ModalComponent/index.tsx +0 -11
  12. package/Components/ModalComponent/utils.ts +20 -76
  13. package/package.json +5 -6
  14. package/Components/ModalComponent/ActionsBottomSheet/ActionButton.tsx +0 -54
  15. package/Components/ModalComponent/ActionsBottomSheet/boundActionButton.tsx +0 -21
  16. package/Components/ModalComponent/ActionsBottomSheet/index.ts +0 -9
  17. package/Components/ModalComponent/ActionsBottomSheet/openActionsBottomSheet.ts +0 -58
  18. package/Components/ModalComponent/AudioPlayer/Components/Input.tsx +0 -653
  19. package/Components/ModalComponent/AudioPlayer/Components/NowPlayingHeaderSection.tsx +0 -89
  20. package/Components/ModalComponent/AudioPlayer/utils/mergeStyles.ts +0 -199
  21. package/Components/ModalComponent/ModalBlocksStyleContext.tsx +0 -10
  22. package/Components/ModalComponent/SortableList.tsx +0 -142
  23. package/Components/ModalComponent/SortableList.web.tsx +0 -102
  24. package/Components/ModalComponent/TextInputContent.tsx +0 -100
  25. package/Components/ModalComponent/__tests__/BottomSheetModalContent.test.tsx +0 -238
  26. package/Components/ModalComponent/__tests__/TextInputContent.test.tsx +0 -120
  27. package/Components/ModalComponent/__tests__/showTextInput.test.ts +0 -95
  28. package/Components/ModalComponent/presets/__tests__/getCell.test.ts +0 -66
  29. package/Components/ModalComponent/presets/dynamicCollectionCell.tsx +0 -78
  30. package/Components/ModalComponent/presets/index.ts +0 -27
  31. package/Components/ModalComponent/presets/selectableCell.tsx +0 -28
  32. package/Components/ModalComponent/presets/standardCell.tsx +0 -41
  33. package/Components/ModalComponent/presets/types.ts +0 -35
  34. package/Components/ModalComponent/showTextInput.ts +0 -43
  35. package/Hooks/useEntryActionsExpander.ts +0 -63
  36. /package/Decorators/ZappPipesDataConnector/__tests__/{Hero.tsx → Hero.js} +0 -0
@@ -134,7 +134,7 @@ export class CellComponent extends React.Component<Props, State> {
134
134
  }
135
135
  }
136
136
 
137
- onFocus(focusable, mouse) {
137
+ onFocus(focusable) {
138
138
  const {
139
139
  item: { id, title },
140
140
  shouldScrollVertically,
@@ -145,10 +145,7 @@ export class CellComponent extends React.Component<Props, State> {
145
145
  if (isFocusable) {
146
146
  this.setState({ cellFocused: true });
147
147
 
148
- if (
149
- shouldUpdate &&
150
- shouldScrollVertically?.(mouse, focusable, id, title)
151
- ) {
148
+ if (shouldUpdate && shouldScrollVertically?.(focusable, id, title)) {
152
149
  this.scrollVertically(focusable);
153
150
  }
154
151
  }
@@ -262,7 +259,7 @@ export class CellComponent extends React.Component<Props, State> {
262
259
  const handleFocus = (focusable, mouse) => {
263
260
  const focusFn = onFocus || noop;
264
261
  focusFn(focusable, mouse);
265
- this.onFocus(focusable, mouse);
262
+ this.onFocus(focusable);
266
263
  };
267
264
 
268
265
  if (this.state.hasFocusableInside) {
@@ -11,20 +11,31 @@
11
11
  */
12
12
 
13
13
  import React from "react";
14
- import {
15
- Image,
16
- Platform,
17
- Pressable,
18
- StyleSheet,
19
- Text,
20
- View,
21
- } from "react-native";
14
+ import { Image, Platform, StyleSheet, Text, View } from "react-native";
22
15
 
23
16
  const styles = StyleSheet.create({
24
17
  row: {
25
18
  flexDirection: "row",
26
19
  alignItems: "center",
27
20
  },
21
+ demoScreen: {
22
+ flex: 1,
23
+ backgroundColor: "#1C1C1E",
24
+ paddingTop: 64,
25
+ paddingHorizontal: 16,
26
+ gap: 12,
27
+ },
28
+ demoHeading: {
29
+ color: "#FFFFFF",
30
+ fontSize: 20,
31
+ fontWeight: "600",
32
+ marginBottom: 8,
33
+ },
34
+ demoLabel: {
35
+ color: "#999999",
36
+ fontSize: 13,
37
+ marginTop: 8,
38
+ },
28
39
  });
29
40
 
30
41
  // ---------------------------------------------------------------------------
@@ -112,11 +123,10 @@ export type ActionData = {
112
123
  showTrailingChevron?: boolean;
113
124
  };
114
125
 
115
- export type AudioPlayerActionProps = {
126
+ export type ItemProps = {
116
127
  configuration: ActionConfiguration;
117
128
  data: ActionData;
118
129
  focused?: boolean;
119
- onPress?: () => void;
120
130
  };
121
131
 
122
132
  // ---------------------------------------------------------------------------
@@ -177,32 +187,28 @@ type ActionContainerProps = {
177
187
  configuration: BackgroundConfiguration;
178
188
  focused: boolean;
179
189
  children: React.ReactNode;
180
- onPress?: () => void;
181
190
  };
182
191
 
183
192
  function ActionContainer({
184
193
  configuration,
185
194
  focused,
186
195
  children,
187
- onPress,
188
196
  }: ActionContainerProps) {
189
197
  return (
190
- <Pressable
191
- onPress={onPress}
192
- style={({ pressed }) => ({
193
- backgroundColor:
194
- pressed || focused
195
- ? configuration.focusedColor
196
- : configuration.defaultColor,
198
+ <View
199
+ style={{
200
+ backgroundColor: focused
201
+ ? configuration.focusedColor
202
+ : configuration.defaultColor,
197
203
  borderRadius: configuration.cornerRadius,
198
204
  paddingTop: CONTAINER_SPEC.paddingTop,
199
205
  paddingRight: CONTAINER_SPEC.paddingRight,
200
206
  paddingBottom: CONTAINER_SPEC.paddingBottom,
201
207
  paddingLeft: CONTAINER_SPEC.paddingLeft,
202
- })}
208
+ }}
203
209
  >
204
210
  {children}
205
- </Pressable>
211
+ </View>
206
212
  );
207
213
  }
208
214
 
@@ -273,15 +279,10 @@ function ActionTrailingIcon({ configuration }: ActionTrailingIconProps) {
273
279
  }
274
280
 
275
281
  // ---------------------------------------------------------------------------
276
- // AudioPlayerAction
282
+ // Item
277
283
  // ---------------------------------------------------------------------------
278
284
 
279
- export function AudioPlayerAction({
280
- configuration,
281
- data,
282
- focused = false,
283
- onPress,
284
- }: AudioPlayerActionProps) {
285
+ export function Item({ configuration, data, focused = false }: ItemProps) {
285
286
  const { background, title, trailingIcon } = configuration;
286
287
  const { title: label, leadingActionType, showTrailingChevron } = data;
287
288
 
@@ -289,11 +290,7 @@ export function AudioPlayerAction({
289
290
  const showTrailing = shouldShowTrailingIcon(showTrailingChevron);
290
291
 
291
292
  return (
292
- <ActionContainer
293
- configuration={background}
294
- focused={focused}
295
- onPress={onPress}
296
- >
293
+ <ActionContainer configuration={background} focused={focused}>
297
294
  <View style={styles.row}>
298
295
  {showLeading ? (
299
296
  <>
@@ -312,3 +309,60 @@ export function AudioPlayerAction({
312
309
  </ActionContainer>
313
310
  );
314
311
  }
312
+
313
+ // ---------------------------------------------------------------------------
314
+ // Demo
315
+ // ---------------------------------------------------------------------------
316
+
317
+ export default function App() {
318
+ return (
319
+ <View style={styles.demoScreen}>
320
+ <Text style={styles.demoHeading}>Modal Action Building Block</Text>
321
+
322
+ <Text style={styles.demoLabel}>
323
+ Leading icon + text — Add To Queue (focused)
324
+ </Text>
325
+ <Item
326
+ configuration={DEFAULT_ACTION_CONFIGURATION}
327
+ data={{ title: "Add To Queue", leadingActionType: "addToQueue" }}
328
+ focused
329
+ />
330
+
331
+ <Text style={styles.demoLabel}>
332
+ Leading icon + text + trailing chevron — Add To Playlist
333
+ </Text>
334
+ <Item
335
+ configuration={DEFAULT_ACTION_CONFIGURATION}
336
+ data={{
337
+ title: "Add To Playlist",
338
+ leadingActionType: "addToPlaylist",
339
+ showTrailingChevron: true,
340
+ }}
341
+ />
342
+
343
+ <Text style={styles.demoLabel}>Text only — Go To Playlist</Text>
344
+ <Item
345
+ configuration={DEFAULT_ACTION_CONFIGURATION}
346
+ data={{ title: "Go To Playlist" }}
347
+ />
348
+
349
+ <Text style={styles.demoLabel}>Leading icon + text — Favorite</Text>
350
+ <Item
351
+ configuration={DEFAULT_ACTION_CONFIGURATION}
352
+ data={{ title: "Favorite", leadingActionType: "favorite" }}
353
+ />
354
+
355
+ <Text style={styles.demoLabel}>Leading icon + text — Share</Text>
356
+ <Item
357
+ configuration={DEFAULT_ACTION_CONFIGURATION}
358
+ data={{ title: "Share", leadingActionType: "share" }}
359
+ />
360
+
361
+ <Text style={styles.demoLabel}>Text only — Go To Artist</Text>
362
+ <Item
363
+ configuration={DEFAULT_ACTION_CONFIGURATION}
364
+ data={{ title: "Go To Artist" }}
365
+ />
366
+ </View>
367
+ );
368
+ }
@@ -9,14 +9,7 @@
9
9
  */
10
10
 
11
11
  import React from "react";
12
- import {
13
- Image,
14
- Platform,
15
- Pressable,
16
- StyleSheet,
17
- Text,
18
- View,
19
- } from "react-native";
12
+ import { Image, Platform, StyleSheet, Text, View } from "react-native";
20
13
 
21
14
  const styles = StyleSheet.create({
22
15
  container: {
@@ -32,6 +25,24 @@ const styles = StyleSheet.create({
32
25
  title: {
33
26
  textAlign: "center",
34
27
  },
28
+ demoScreen: {
29
+ flex: 1,
30
+ backgroundColor: "#1C1C1E",
31
+ paddingTop: 64,
32
+ paddingHorizontal: 24,
33
+ gap: 12,
34
+ },
35
+ demoHeading: {
36
+ color: "#FFFFFF",
37
+ fontSize: 20,
38
+ fontWeight: "600",
39
+ marginBottom: 8,
40
+ },
41
+ demoLabel: {
42
+ color: "#999999",
43
+ fontSize: 13,
44
+ marginTop: 8,
45
+ },
35
46
  });
36
47
 
37
48
  // ---------------------------------------------------------------------------
@@ -137,12 +148,11 @@ export type ButtonData = {
137
148
  disabled?: boolean;
138
149
  };
139
150
 
140
- export type AudioPlayerButtonProps = {
151
+ export type ItemProps = {
141
152
  configuration: ButtonConfiguration;
142
153
  data: ButtonData;
143
154
  disabled?: boolean;
144
155
  focused?: boolean;
145
- onPress?: () => void;
146
156
  };
147
157
 
148
158
  // ---------------------------------------------------------------------------
@@ -160,7 +170,7 @@ const ACTION_ICON_ASSETS: Record<ButtonActionType, string> = {
160
170
  confirm:
161
171
  "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAJElEQVR42mNgGAWjYBSQCv4TwKMWDHELho/hNE/3o2AUDDcAAPv0QMAyy1CtAAAAAElFTkSuQmCC",
162
172
  cancel:
163
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAASElEQVR42mNgGAWjGvynkVoUTf+pqA6nxv8UqiHbEooNx2cQ1QzHZiDVDcdlCcOQsoCmQUTTSKZpMqV5RqNLUUHTwm4UDBMAALBLQ73LTvoyAAAAAElFTkSuQmCC",
173
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAASElEQVR42mNgGAUjGvynkVoUTf+pqA6nxv8UqiHbEooNx2cQ1QzHZiDVDcdlCcOQsoCmQUTTSKZpMqV5RqNLUUHTwm4UDBMAALBLQ73LTvoyAAAAAElFTkSuQmCC",
164
174
  };
165
175
 
166
176
  function getTextTransformStyle(
@@ -182,7 +192,6 @@ type ButtonContainerProps = {
182
192
  disabled: boolean;
183
193
  configuration: BackgroundConfiguration;
184
194
  children: React.ReactNode;
185
- onPress?: () => void;
186
195
  };
187
196
 
188
197
  function ButtonContainer({
@@ -190,22 +199,19 @@ function ButtonContainer({
190
199
  disabled,
191
200
  configuration,
192
201
  children,
193
- onPress,
194
202
  }: ButtonContainerProps) {
195
- const defaultBgColor = disabled
203
+ const backgroundColor = disabled
196
204
  ? configuration.inactiveColor
197
205
  : focused
198
206
  ? configuration.focusedColor
199
207
  : configuration.defaultColor;
200
208
 
201
209
  return (
202
- <Pressable
203
- onPress={disabled ? undefined : onPress}
204
- style={({ pressed }) => [
210
+ <View
211
+ style={[
205
212
  styles.container,
206
213
  {
207
- backgroundColor:
208
- pressed && !disabled ? configuration.focusedColor : defaultBgColor,
214
+ backgroundColor,
209
215
  borderRadius: configuration.cornerRadius,
210
216
  paddingTop: configuration.paddingTop,
211
217
  paddingRight: configuration.paddingRight,
@@ -215,7 +221,7 @@ function ButtonContainer({
215
221
  ]}
216
222
  >
217
223
  {children}
218
- </Pressable>
224
+ </View>
219
225
  );
220
226
  }
221
227
 
@@ -289,32 +295,20 @@ function ButtonLeadingIcon({
289
295
  }
290
296
 
291
297
  // ---------------------------------------------------------------------------
292
- // AudioPlayerButton — single building block driven by configuration + data
298
+ // Item — single building block driven by configuration + data
293
299
  // ---------------------------------------------------------------------------
294
300
 
295
- import { useModalBlocksStyle } from "../../ModalBlocksStyleContext";
296
- import { mergeButtonConfiguration } from "../utils/mergeStyles";
297
-
298
- export function AudioPlayerButton({
301
+ export function Item({
299
302
  configuration,
300
303
  data,
301
304
  disabled,
302
305
  focused = false,
303
- onPress,
304
- }: AudioPlayerButtonProps) {
305
- const modalBlocksStyle = useModalBlocksStyle();
306
- const buttonBlock = modalBlocksStyle?.button;
307
- const actionBlock = modalBlocksStyle?.action;
308
-
309
- const effectiveConfig = React.useMemo(() => {
310
- return mergeButtonConfiguration(configuration, buttonBlock, actionBlock);
311
- }, [configuration, buttonBlock, actionBlock]);
312
-
306
+ }: ItemProps) {
313
307
  const {
314
- background: effectiveBgConfig,
315
- title: effectiveTitleConfig,
308
+ background: backgroundConfiguration,
309
+ title: titleConfiguration,
316
310
  icons: iconsConfiguration,
317
- } = effectiveConfig;
311
+ } = configuration;
318
312
 
319
313
  const { title } = data;
320
314
  const isDisabled = disabled ?? data.disabled ?? false;
@@ -326,8 +320,7 @@ export function AudioPlayerButton({
326
320
  <ButtonContainer
327
321
  focused={focused}
328
322
  disabled={isDisabled}
329
- configuration={effectiveBgConfig}
330
- onPress={onPress}
323
+ configuration={backgroundConfiguration}
331
324
  >
332
325
  <View style={styles.contentRow}>
333
326
  {showIcon ? (
@@ -336,14 +329,14 @@ export function AudioPlayerButton({
336
329
  actionType={leadingIcon.actionType}
337
330
  configuration={iconsConfiguration}
338
331
  />
339
- <View style={{ width: effectiveBgConfig.horizontalGutter }} />
332
+ <View style={{ width: backgroundConfiguration.horizontalGutter }} />
340
333
  </>
341
334
  ) : null}
342
335
  <ButtonTitle
343
336
  title={title}
344
337
  focused={focused}
345
338
  disabled={isDisabled}
346
- configuration={effectiveTitleConfig}
339
+ configuration={titleConfiguration}
347
340
  />
348
341
  </View>
349
342
  </ButtonContainer>
@@ -393,3 +386,39 @@ export const VARIANT_LARGE_ICON: ButtonConfiguration = {
393
386
  },
394
387
  },
395
388
  };
389
+
390
+ export default function App() {
391
+ return (
392
+ <View style={styles.demoScreen}>
393
+ <Text style={styles.demoHeading}>Modal Button Building Block</Text>
394
+
395
+ <Text style={styles.demoLabel}>Variant 1 — Text only (confirmation)</Text>
396
+ <Item configuration={VARIANT_TEXT_ONLY} data={{ title: "Confirm" }} />
397
+
398
+ <Text style={styles.demoLabel}>Variant 2 — Leading icon + text</Text>
399
+ <Item
400
+ configuration={VARIANT_WITH_ICON}
401
+ data={{ title: "Add To Playlist" }}
402
+ />
403
+
404
+ <Text style={styles.demoLabel}>Inactive state</Text>
405
+ <Item
406
+ configuration={VARIANT_TEXT_ONLY}
407
+ data={{ title: "Unavailable" }}
408
+ disabled
409
+ />
410
+
411
+ <Text style={styles.demoLabel}>Custom title config — uppercase</Text>
412
+ <Item
413
+ configuration={VARIANT_UPPERCASE_TITLE}
414
+ data={{ title: "Save Changes" }}
415
+ />
416
+
417
+ <Text style={styles.demoLabel}>Custom icons config — 32×32</Text>
418
+ <Item
419
+ configuration={VARIANT_LARGE_ICON}
420
+ data={{ title: "Add To Queue" }}
421
+ />
422
+ </View>
423
+ );
424
+ }