@applicaster/zapp-react-native-ui-components 16.0.0-alpha.7845362739 → 16.0.0-alpha.8101951023
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/Components/AudioPlayer/tv/__tests__/audioPlayer.test.js +19 -0
- package/Components/AudioPlayer/tv/__tests__/index.test.tsx +120 -0
- package/Components/AudioPlayer/tv/index.tsx +5 -1
- package/Components/Cell/Cell.tsx +3 -6
- package/Components/Cell/TvOSCellComponent.tsx +0 -1
- package/Components/GeneralContentScreen/GeneralContentScreenHookAdapter.tsx +15 -0
- package/Components/GeneralContentScreen/hookAdapter/__tests__/skipExpression.test.ts +294 -0
- package/Components/GeneralContentScreen/hookAdapter/__tests__/validationHelper.test.ts +64 -0
- package/Components/GeneralContentScreen/hookAdapter/skipExpression.ts +252 -0
- package/Components/GeneralContentScreen/hookAdapter/validationHelper.ts +18 -0
- package/Components/LinkHandler/LinkHandler.tsx +2 -7
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +5 -1
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/components/ActionButtonController.tsx +19 -4
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/components/__tests__/ActionButtonController.test.tsx +43 -1
- package/Components/MasterCell/DefaultComponents/Button.tsx +1 -0
- package/Components/MasterCell/DefaultComponents/LiveImage/executePreloadHooks.ts +2 -4
- package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +2 -3
- package/Components/MasterCell/DefaultComponents/Toggle.tsx +36 -14
- package/Components/MasterCell/DefaultComponents/__tests__/Toggle.test.tsx +167 -0
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/factory.test.ts +32 -0
- package/Components/MasterCell/SharedUI/CollapsibleTextContainer/index.ts +1 -2
- package/Components/ModalComponent/ActionsBottomSheet/ActionButton.tsx +56 -0
- package/Components/ModalComponent/ActionsBottomSheet/__tests__/openActionsBottomSheet.test.ts +38 -0
- package/Components/ModalComponent/ActionsBottomSheet/boundActionButton.tsx +24 -0
- package/Components/ModalComponent/ActionsBottomSheet/index.ts +9 -0
- package/Components/ModalComponent/ActionsBottomSheet/openActionsBottomSheet.ts +61 -0
- package/Components/ModalComponent/AudioPlayer/Components/Button.tsx +87 -97
- package/Components/ModalComponent/AudioPlayer/Components/Header.tsx +87 -126
- package/Components/ModalComponent/AudioPlayer/Components/Input.tsx +1 -44
- package/Components/ModalComponent/AudioPlayer/Components/Item.tsx +252 -123
- package/Components/ModalComponent/AudioPlayer/Components/NowPlayingHeaderSection.tsx +84 -0
- package/Components/ModalComponent/AudioPlayer/Components/__tests__/Item.test.tsx +113 -0
- package/Components/ModalComponent/AudioPlayer/Components/index.ts +3 -3
- package/Components/ModalComponent/AudioPlayer/utils/__tests__/mergeStyles.test.ts +356 -0
- package/Components/ModalComponent/AudioPlayer/utils/mergeStyles.ts +521 -0
- package/Components/ModalComponent/BottomSheetModalContent.tsx +488 -66
- package/Components/ModalComponent/Button/index.tsx +5 -3
- package/Components/ModalComponent/Header/CloseButton.tsx +12 -0
- package/Components/ModalComponent/Header/__tests__/CloseButton.test.tsx +72 -0
- package/Components/ModalComponent/Header/index.tsx +20 -7
- package/Components/ModalComponent/Header/utils.ts +1 -1
- package/Components/ModalComponent/ModalBlocksStyleContext.tsx +10 -0
- package/Components/ModalComponent/SortableList.tsx +157 -0
- package/Components/ModalComponent/SortableList.web.tsx +34 -0
- package/Components/ModalComponent/TextInputContent.tsx +112 -0
- package/Components/ModalComponent/__tests__/BottomSheetModalContent.test.tsx +270 -0
- package/Components/ModalComponent/__tests__/SortableList.web.test.tsx +16 -0
- package/Components/ModalComponent/__tests__/TextInputContent.test.tsx +156 -0
- package/Components/ModalComponent/__tests__/showTextInput.test.ts +95 -0
- package/Components/ModalComponent/index.tsx +18 -9
- package/Components/ModalComponent/presets/__tests__/getCell.test.ts +90 -0
- package/Components/ModalComponent/presets/dynamicCollectionCell.tsx +78 -0
- package/Components/ModalComponent/presets/index.ts +27 -0
- package/Components/ModalComponent/presets/selectableCell.tsx +28 -0
- package/Components/ModalComponent/presets/standardCell.tsx +41 -0
- package/Components/ModalComponent/presets/types.ts +35 -0
- package/Components/ModalComponent/showTextInput.ts +43 -0
- package/Components/ModalComponent/utils.ts +82 -21
- package/Components/OfflineHandler/hooks.ts +0 -12
- package/Components/PlayerContainer/PlayerContainer.tsx +11 -7
- package/Components/PlayerContainer/ProgramInfo/index.tsx +3 -4
- package/Components/PlayerContainer/__tests__/PlayerContainer.test.tsx +66 -13
- package/Components/River/ComponentsMap/ComponentsMap.tsx +85 -59
- package/Components/River/River.tsx +4 -0
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +138 -75
- package/Components/River/__tests__/componentsMap.test.js +8 -3
- package/Components/River/__tests__/resultCallback.test.tsx +47 -0
- package/Components/Screen/__tests__/Screen.test.tsx +24 -0
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +2 -0
- package/Components/Screen/index.tsx +5 -0
- package/Components/Screen/navigationHandler.ts +8 -8
- package/Components/ScreenRevealManager/ScreenRevealManager.ts +18 -2
- package/Components/ScreenRevealManager/__tests__/ScreenRevealManager.test.ts +36 -0
- package/Components/ScreenRevealManager/__tests__/withScreenRevealManager.test.tsx +56 -0
- package/Components/ScreenRevealManager/withScreenRevealManager.tsx +21 -4
- package/Components/VideoLive/LiveImageManager.ts +1 -1
- package/Contexts/ModalNavigationContext/__tests__/index.test.tsx +15 -0
- package/Contexts/ModalNavigationContext/index.tsx +2 -2
- package/Hooks/useEntryActionsExpander.ts +63 -0
- package/package.json +6 -5
- package/Components/ModalComponent/AudioPlayer/Components/Action.tsx +0 -332
- /package/Decorators/ZappPipesDataConnector/__tests__/{Hero.js → Hero.tsx} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Modal Building Block — Header
|
|
3
3
|
*
|
|
4
|
-
* Single-file Expo Snack demo for the Header building block spec.
|
|
5
|
-
*
|
|
6
4
|
* Green (configurable): title, closeButton (enable + asset), actionButtons styling
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* (incl. Clear padding/radius for Variant 3 / section_header Studio keys)
|
|
6
|
+
* White (hardcoded): container gutters, action button slot enablement/actions,
|
|
7
|
+
* close dimensions, default action labels (overridable via HeaderData.clearLabel)
|
|
9
8
|
*/
|
|
10
9
|
|
|
11
10
|
import React, { useCallback, useState } from "react";
|
|
12
11
|
import { Platform, Pressable, StyleSheet, Text, View } from "react-native";
|
|
12
|
+
import { isApplePlatform } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
13
13
|
|
|
14
14
|
const styles = StyleSheet.create({
|
|
15
15
|
row: {
|
|
@@ -45,29 +45,6 @@ const styles = StyleSheet.create({
|
|
|
45
45
|
alignItems: "center",
|
|
46
46
|
justifyContent: "center",
|
|
47
47
|
},
|
|
48
|
-
demoScreen: {
|
|
49
|
-
flex: 1,
|
|
50
|
-
backgroundColor: "#1C1C1E",
|
|
51
|
-
paddingTop: 64,
|
|
52
|
-
paddingHorizontal: 0,
|
|
53
|
-
gap: 24,
|
|
54
|
-
},
|
|
55
|
-
demoBlock: {
|
|
56
|
-
gap: 8,
|
|
57
|
-
paddingHorizontal: 0,
|
|
58
|
-
},
|
|
59
|
-
demoHeading: {
|
|
60
|
-
color: "#FFFFFF",
|
|
61
|
-
fontSize: 20,
|
|
62
|
-
fontWeight: "600",
|
|
63
|
-
marginBottom: 8,
|
|
64
|
-
paddingHorizontal: 24,
|
|
65
|
-
},
|
|
66
|
-
demoLabel: {
|
|
67
|
-
color: "#999999",
|
|
68
|
-
fontSize: 13,
|
|
69
|
-
paddingHorizontal: 24,
|
|
70
|
-
},
|
|
71
48
|
});
|
|
72
49
|
|
|
73
50
|
// ---------------------------------------------------------------------------
|
|
@@ -85,11 +62,7 @@ export type TextTransform =
|
|
|
85
62
|
export type TitleAlignment = "left" | "center";
|
|
86
63
|
|
|
87
64
|
/** Selects hardcoded container + action layout (white fields). */
|
|
88
|
-
export type HeaderVariant =
|
|
89
|
-
| "singleLine"
|
|
90
|
-
| "headerWithActions"
|
|
91
|
-
| "headerWithActionsCancelOnly"
|
|
92
|
-
| "section";
|
|
65
|
+
export type HeaderVariant = "singleLine" | "headerWithActions" | "section";
|
|
93
66
|
|
|
94
67
|
export type TitleConfiguration = {
|
|
95
68
|
fontColor: string;
|
|
@@ -120,10 +93,16 @@ export type ActionButtonsStyleConfiguration = {
|
|
|
120
93
|
iosLetterSpacing: number;
|
|
121
94
|
androidLetterSpacing: number;
|
|
122
95
|
textTransform: TextTransform;
|
|
96
|
+
/** Green Variant 3 fields — defaults match ACTION_BUTTON_LAYOUT_SPEC. */
|
|
97
|
+
paddingTop?: number;
|
|
98
|
+
paddingRight?: number;
|
|
99
|
+
paddingBottom?: number;
|
|
100
|
+
paddingLeft?: number;
|
|
101
|
+
cornerRadius?: number;
|
|
123
102
|
};
|
|
124
103
|
|
|
125
104
|
export type HeaderConfiguration = {
|
|
126
|
-
paddingTop
|
|
105
|
+
paddingTop?: number;
|
|
127
106
|
variant: HeaderVariant;
|
|
128
107
|
title: TitleConfiguration;
|
|
129
108
|
closeButton: CloseButtonConfiguration;
|
|
@@ -159,6 +138,11 @@ export const DEFAULT_ACTION_BUTTONS_STYLE_CONFIGURATION: ActionButtonsStyleConfi
|
|
|
159
138
|
iosLetterSpacing: 0,
|
|
160
139
|
androidLetterSpacing: 0,
|
|
161
140
|
textTransform: "default",
|
|
141
|
+
paddingTop: 6,
|
|
142
|
+
paddingRight: 10,
|
|
143
|
+
paddingBottom: 6,
|
|
144
|
+
paddingLeft: 10,
|
|
145
|
+
cornerRadius: 16,
|
|
162
146
|
};
|
|
163
147
|
|
|
164
148
|
// ---------------------------------------------------------------------------
|
|
@@ -167,6 +151,8 @@ export const DEFAULT_ACTION_BUTTONS_STYLE_CONFIGURATION: ActionButtonsStyleConfi
|
|
|
167
151
|
|
|
168
152
|
export type HeaderData = {
|
|
169
153
|
title: string;
|
|
154
|
+
/** Localization override for Clear; falls back to ACTION_LABELS.clear. */
|
|
155
|
+
clearLabel?: string;
|
|
170
156
|
};
|
|
171
157
|
|
|
172
158
|
export type AudioPlayerHeaderProps = {
|
|
@@ -220,13 +206,6 @@ const CONTAINER_SPEC: Record<HeaderVariant, ContainerSpec> = {
|
|
|
220
206
|
paddingBottom: 8,
|
|
221
207
|
paddingLeft: 20,
|
|
222
208
|
},
|
|
223
|
-
headerWithActionsCancelOnly: {
|
|
224
|
-
horizontalGutter: 12,
|
|
225
|
-
paddingTop: 0,
|
|
226
|
-
paddingRight: 20,
|
|
227
|
-
paddingBottom: 8,
|
|
228
|
-
paddingLeft: 20,
|
|
229
|
-
},
|
|
230
209
|
section: {
|
|
231
210
|
horizontalGutter: 12,
|
|
232
211
|
paddingTop: 0,
|
|
@@ -250,11 +229,6 @@ const ACTION_BUTTONS_BEHAVIOR: Record<
|
|
|
250
229
|
leading: { enabled: true, actionType: "cancel" },
|
|
251
230
|
trailing: { enabled: true, actionType: "done" },
|
|
252
231
|
},
|
|
253
|
-
headerWithActionsCancelOnly: {
|
|
254
|
-
sectionEnabled: true,
|
|
255
|
-
leading: { enabled: true, actionType: "cancel" },
|
|
256
|
-
trailing: { enabled: false },
|
|
257
|
-
},
|
|
258
232
|
section: {
|
|
259
233
|
sectionEnabled: true,
|
|
260
234
|
leading: { enabled: false },
|
|
@@ -305,6 +279,8 @@ type HeaderContainerProps = {
|
|
|
305
279
|
children: React.ReactNode;
|
|
306
280
|
};
|
|
307
281
|
|
|
282
|
+
const TRANSPARENT = "transparent";
|
|
283
|
+
|
|
308
284
|
function HeaderContainer({
|
|
309
285
|
variant,
|
|
310
286
|
configuration,
|
|
@@ -317,6 +293,8 @@ function HeaderContainer({
|
|
|
317
293
|
? configuration.paddingTop
|
|
318
294
|
: container.paddingTop;
|
|
319
295
|
|
|
296
|
+
const backgroundColor = (configuration as any).backgroundColor || TRANSPARENT;
|
|
297
|
+
|
|
320
298
|
return (
|
|
321
299
|
<View
|
|
322
300
|
style={{
|
|
@@ -324,6 +302,7 @@ function HeaderContainer({
|
|
|
324
302
|
paddingRight: container.paddingRight,
|
|
325
303
|
paddingBottom: container.paddingBottom,
|
|
326
304
|
paddingLeft: container.paddingLeft,
|
|
305
|
+
backgroundColor: backgroundColor,
|
|
327
306
|
}}
|
|
328
307
|
>
|
|
329
308
|
{children}
|
|
@@ -338,17 +317,18 @@ type HeaderTitleProps = {
|
|
|
338
317
|
};
|
|
339
318
|
|
|
340
319
|
function HeaderTitle({ title, configuration, centered }: HeaderTitleProps) {
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
320
|
+
const { fontColor, fontSize } = configuration;
|
|
321
|
+
|
|
322
|
+
const letterSpacing = isApplePlatform()
|
|
323
|
+
? configuration.iosLetterSpacing
|
|
324
|
+
: configuration.androidLetterSpacing;
|
|
345
325
|
|
|
346
326
|
return (
|
|
347
327
|
<Text
|
|
348
328
|
style={{
|
|
349
329
|
flex: centered ? undefined : 1,
|
|
350
|
-
color:
|
|
351
|
-
fontSize:
|
|
330
|
+
color: fontColor,
|
|
331
|
+
fontSize: fontSize,
|
|
352
332
|
lineHeight: configuration.lineHeight,
|
|
353
333
|
letterSpacing,
|
|
354
334
|
fontFamily: Platform.select({
|
|
@@ -469,6 +449,7 @@ type HeaderActionButtonProps = {
|
|
|
469
449
|
actionType: HeaderActionType;
|
|
470
450
|
configuration: ActionButtonsStyleConfiguration;
|
|
471
451
|
focused?: boolean;
|
|
452
|
+
label?: string;
|
|
472
453
|
onPress?: () => void;
|
|
473
454
|
};
|
|
474
455
|
|
|
@@ -476,8 +457,24 @@ function HeaderActionButton({
|
|
|
476
457
|
actionType,
|
|
477
458
|
configuration,
|
|
478
459
|
focused = false,
|
|
460
|
+
label,
|
|
479
461
|
onPress,
|
|
480
462
|
}: HeaderActionButtonProps) {
|
|
463
|
+
const paddingTop =
|
|
464
|
+
configuration.paddingTop ?? ACTION_BUTTON_LAYOUT_SPEC.paddingTop;
|
|
465
|
+
|
|
466
|
+
const paddingRight =
|
|
467
|
+
configuration.paddingRight ?? ACTION_BUTTON_LAYOUT_SPEC.paddingRight;
|
|
468
|
+
|
|
469
|
+
const paddingBottom =
|
|
470
|
+
configuration.paddingBottom ?? ACTION_BUTTON_LAYOUT_SPEC.paddingBottom;
|
|
471
|
+
|
|
472
|
+
const paddingLeft =
|
|
473
|
+
configuration.paddingLeft ?? ACTION_BUTTON_LAYOUT_SPEC.paddingLeft;
|
|
474
|
+
|
|
475
|
+
const cornerRadius =
|
|
476
|
+
configuration.cornerRadius ?? ACTION_BUTTON_LAYOUT_SPEC.cornerRadius;
|
|
477
|
+
|
|
481
478
|
return (
|
|
482
479
|
<Pressable
|
|
483
480
|
onPress={onPress}
|
|
@@ -486,11 +483,11 @@ function HeaderActionButton({
|
|
|
486
483
|
pressed || focused
|
|
487
484
|
? configuration.focusedBackgroundColor
|
|
488
485
|
: configuration.defaultBackgroundColor,
|
|
489
|
-
borderRadius:
|
|
490
|
-
paddingTop
|
|
491
|
-
paddingRight
|
|
492
|
-
paddingBottom
|
|
493
|
-
paddingLeft
|
|
486
|
+
borderRadius: cornerRadius,
|
|
487
|
+
paddingTop,
|
|
488
|
+
paddingRight,
|
|
489
|
+
paddingBottom,
|
|
490
|
+
paddingLeft,
|
|
494
491
|
})}
|
|
495
492
|
>
|
|
496
493
|
<Text
|
|
@@ -513,7 +510,7 @@ function HeaderActionButton({
|
|
|
513
510
|
}}
|
|
514
511
|
numberOfLines={1}
|
|
515
512
|
>
|
|
516
|
-
{ACTION_LABELS[actionType]}
|
|
513
|
+
{label || ACTION_LABELS[actionType]}
|
|
517
514
|
</Text>
|
|
518
515
|
</Pressable>
|
|
519
516
|
);
|
|
@@ -610,6 +607,9 @@ function CenterAlignedHeaderLayout({
|
|
|
610
607
|
// AudioPlayerHeader
|
|
611
608
|
// ---------------------------------------------------------------------------
|
|
612
609
|
|
|
610
|
+
import { useModalBlocksStyle } from "../../ModalBlocksStyleContext";
|
|
611
|
+
import { mergeHeaderConfiguration } from "../utils/mergeStyles";
|
|
612
|
+
|
|
613
613
|
export function AudioPlayerHeader({
|
|
614
614
|
configuration,
|
|
615
615
|
data,
|
|
@@ -622,8 +622,21 @@ export function AudioPlayerHeader({
|
|
|
622
622
|
onDone,
|
|
623
623
|
onClear,
|
|
624
624
|
}: AudioPlayerHeaderProps) {
|
|
625
|
-
const
|
|
626
|
-
|
|
625
|
+
const modalBlocksStyle = useModalBlocksStyle();
|
|
626
|
+
|
|
627
|
+
// Next Up section header uses sectionHeader — never Theme modal `header`,
|
|
628
|
+
// so the Queue title styles do not collide with the section title.
|
|
629
|
+
const styleBlock =
|
|
630
|
+
configuration.variant === "section"
|
|
631
|
+
? modalBlocksStyle?.sectionHeader
|
|
632
|
+
: modalBlocksStyle?.header;
|
|
633
|
+
|
|
634
|
+
const effectiveConfig = React.useMemo(() => {
|
|
635
|
+
return mergeHeaderConfiguration(configuration, styleBlock);
|
|
636
|
+
}, [configuration, styleBlock]);
|
|
637
|
+
|
|
638
|
+
const { variant, title, closeButton, actionButtons } = effectiveConfig;
|
|
639
|
+
const { title: titleText, clearLabel } = data;
|
|
627
640
|
|
|
628
641
|
const container = CONTAINER_SPEC[variant];
|
|
629
642
|
const behavior = ACTION_BUTTONS_BEHAVIOR[variant];
|
|
@@ -634,16 +647,24 @@ export function AudioPlayerHeader({
|
|
|
634
647
|
behavior.sectionEnabled
|
|
635
648
|
);
|
|
636
649
|
|
|
637
|
-
const showTrailingAction =
|
|
638
|
-
behavior.trailing,
|
|
639
|
-
behavior.
|
|
640
|
-
|
|
650
|
+
const showTrailingAction =
|
|
651
|
+
shouldShowActionSlot(behavior.trailing, behavior.sectionEnabled) &&
|
|
652
|
+
(behavior.trailing.actionType !== "clear" || !!onClear);
|
|
653
|
+
|
|
654
|
+
const actionLabelFor = (actionType?: HeaderActionType) => {
|
|
655
|
+
if (actionType === "clear" && clearLabel) {
|
|
656
|
+
return clearLabel;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
return actionType ? ACTION_LABELS[actionType] : undefined;
|
|
660
|
+
};
|
|
641
661
|
|
|
642
662
|
const leadingContent = showLeadingAction ? (
|
|
643
663
|
<HeaderActionButton
|
|
644
|
-
actionType={behavior.leading.actionType}
|
|
664
|
+
actionType={behavior.leading.actionType as HeaderActionType}
|
|
645
665
|
configuration={actionButtons}
|
|
646
666
|
focused={focusedLeadingAction}
|
|
667
|
+
label={actionLabelFor(behavior.leading.actionType)}
|
|
647
668
|
onPress={onCancel}
|
|
648
669
|
/>
|
|
649
670
|
) : onBack ? (
|
|
@@ -652,9 +673,10 @@ export function AudioPlayerHeader({
|
|
|
652
673
|
|
|
653
674
|
const trailingContent = showTrailingAction ? (
|
|
654
675
|
<HeaderActionButton
|
|
655
|
-
actionType={behavior.trailing.actionType}
|
|
676
|
+
actionType={behavior.trailing.actionType as HeaderActionType}
|
|
656
677
|
configuration={actionButtons}
|
|
657
678
|
focused={focusedTrailingAction}
|
|
679
|
+
label={actionLabelFor(behavior.trailing.actionType)}
|
|
658
680
|
onPress={behavior.trailing.actionType === "done" ? onDone : onClear}
|
|
659
681
|
/>
|
|
660
682
|
) : closeButton.enabled && !isCenterAligned ? (
|
|
@@ -731,25 +753,6 @@ export const VARIANT_HEADER_WITH_ACTIONS: HeaderConfiguration = {
|
|
|
731
753
|
paddingTop: 16,
|
|
732
754
|
};
|
|
733
755
|
|
|
734
|
-
/** Variant 2 — single side action (layout rule demo) */
|
|
735
|
-
export const VARIANT_HEADER_WITH_CANCEL_ONLY: HeaderConfiguration = {
|
|
736
|
-
variant: "headerWithActionsCancelOnly",
|
|
737
|
-
title: {
|
|
738
|
-
fontColor: "#FFFFFF",
|
|
739
|
-
iosFontFamily: "SFProText-Bold",
|
|
740
|
-
androidFontFamily: "Roboto-Bold",
|
|
741
|
-
fontSize: 22,
|
|
742
|
-
lineHeight: 28,
|
|
743
|
-
iosLetterSpacing: -0.6,
|
|
744
|
-
androidLetterSpacing: 0,
|
|
745
|
-
textTransform: "default",
|
|
746
|
-
alignment: "center",
|
|
747
|
-
},
|
|
748
|
-
closeButton: { enabled: false },
|
|
749
|
-
actionButtons: DEFAULT_ACTION_BUTTONS_STYLE_CONFIGURATION,
|
|
750
|
-
paddingTop: 16,
|
|
751
|
-
};
|
|
752
|
-
|
|
753
756
|
/** Variant 3 — Section Header */
|
|
754
757
|
export const VARIANT_SECTION_HEADER: HeaderConfiguration = {
|
|
755
758
|
variant: "section",
|
|
@@ -767,45 +770,3 @@ export const VARIANT_SECTION_HEADER: HeaderConfiguration = {
|
|
|
767
770
|
closeButton: { enabled: false },
|
|
768
771
|
actionButtons: DEFAULT_ACTION_BUTTONS_STYLE_CONFIGURATION,
|
|
769
772
|
};
|
|
770
|
-
|
|
771
|
-
export default function App() {
|
|
772
|
-
return (
|
|
773
|
-
<View style={styles.demoScreen}>
|
|
774
|
-
<Text style={styles.demoHeading}>Modal Header Building Block</Text>
|
|
775
|
-
|
|
776
|
-
<View style={styles.demoBlock}>
|
|
777
|
-
<Text style={styles.demoLabel}>Single Line Header</Text>
|
|
778
|
-
<AudioPlayerHeader
|
|
779
|
-
configuration={VARIANT_SINGLE_LINE_HEADER}
|
|
780
|
-
data={{ title: "Playback Speed" }}
|
|
781
|
-
/>
|
|
782
|
-
</View>
|
|
783
|
-
|
|
784
|
-
<View style={styles.demoBlock}>
|
|
785
|
-
<Text style={styles.demoLabel}>Header With Actions</Text>
|
|
786
|
-
<AudioPlayerHeader
|
|
787
|
-
configuration={VARIANT_HEADER_WITH_ACTIONS}
|
|
788
|
-
data={{ title: "Playback Speed" }}
|
|
789
|
-
/>
|
|
790
|
-
</View>
|
|
791
|
-
|
|
792
|
-
<View style={styles.demoBlock}>
|
|
793
|
-
<Text style={styles.demoLabel}>
|
|
794
|
-
Header With Actions — single side action
|
|
795
|
-
</Text>
|
|
796
|
-
<AudioPlayerHeader
|
|
797
|
-
configuration={VARIANT_HEADER_WITH_CANCEL_ONLY}
|
|
798
|
-
data={{ title: "Playback Speed" }}
|
|
799
|
-
/>
|
|
800
|
-
</View>
|
|
801
|
-
|
|
802
|
-
<View style={styles.demoBlock}>
|
|
803
|
-
<Text style={styles.demoLabel}>Section Header</Text>
|
|
804
|
-
<AudioPlayerHeader
|
|
805
|
-
configuration={VARIANT_SECTION_HEADER}
|
|
806
|
-
data={{ title: "Next in Queue" }}
|
|
807
|
-
/>
|
|
808
|
-
</View>
|
|
809
|
-
</View>
|
|
810
|
-
);
|
|
811
|
-
}
|
|
@@ -37,24 +37,6 @@ const styles = StyleSheet.create({
|
|
|
37
37
|
underline: {
|
|
38
38
|
alignSelf: "stretch",
|
|
39
39
|
},
|
|
40
|
-
demoScreen: {
|
|
41
|
-
flex: 1,
|
|
42
|
-
backgroundColor: "#1C1C1E",
|
|
43
|
-
paddingTop: 64,
|
|
44
|
-
paddingHorizontal: 16,
|
|
45
|
-
gap: 24,
|
|
46
|
-
},
|
|
47
|
-
demoHeading: {
|
|
48
|
-
color: "#FFFFFF",
|
|
49
|
-
fontSize: 20,
|
|
50
|
-
fontWeight: "600",
|
|
51
|
-
marginBottom: 8,
|
|
52
|
-
},
|
|
53
|
-
demoLabel: {
|
|
54
|
-
color: "#999999",
|
|
55
|
-
fontSize: 13,
|
|
56
|
-
marginTop: 8,
|
|
57
|
-
},
|
|
58
40
|
});
|
|
59
41
|
|
|
60
42
|
// ---------------------------------------------------------------------------
|
|
@@ -583,7 +565,7 @@ export function AudioPlayerInput({
|
|
|
583
565
|
}
|
|
584
566
|
|
|
585
567
|
// ---------------------------------------------------------------------------
|
|
586
|
-
// Variant
|
|
568
|
+
// Variant configurations
|
|
587
569
|
// ---------------------------------------------------------------------------
|
|
588
570
|
|
|
589
571
|
/** Search pill — leading icon + clear button */
|
|
@@ -644,28 +626,3 @@ export const VARIANT_NAME_PLAYLIST_INPUT: InputConfiguration = {
|
|
|
644
626
|
},
|
|
645
627
|
},
|
|
646
628
|
};
|
|
647
|
-
|
|
648
|
-
/** Text only search pill — no leading icon */
|
|
649
|
-
export const VARIANT_TEXT_ONLY_INPUT: InputConfiguration = {
|
|
650
|
-
background: DEFAULT_BACKGROUND_CONFIGURATION,
|
|
651
|
-
label: DEFAULT_LABEL_CONFIGURATION,
|
|
652
|
-
text: DEFAULT_TEXT_CONFIGURATION,
|
|
653
|
-
icons: {
|
|
654
|
-
...DEFAULT_ICONS_CONFIGURATION,
|
|
655
|
-
leadingIcon: { enabled: false },
|
|
656
|
-
},
|
|
657
|
-
};
|
|
658
|
-
|
|
659
|
-
/** Search without clear button */
|
|
660
|
-
export const VARIANT_SEARCH_WITHOUT_CLEAR: InputConfiguration = {
|
|
661
|
-
background: DEFAULT_BACKGROUND_CONFIGURATION,
|
|
662
|
-
label: DEFAULT_LABEL_CONFIGURATION,
|
|
663
|
-
text: DEFAULT_TEXT_CONFIGURATION,
|
|
664
|
-
icons: {
|
|
665
|
-
...DEFAULT_ICONS_CONFIGURATION,
|
|
666
|
-
trailingIcon: {
|
|
667
|
-
...DEFAULT_ICONS_CONFIGURATION.trailingIcon,
|
|
668
|
-
enabled: false,
|
|
669
|
-
},
|
|
670
|
-
},
|
|
671
|
-
};
|