@applicaster/zapp-react-native-ui-components 16.0.0-rc.6 → 16.0.0-rc.60

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 (129) hide show
  1. package/Components/AudioPlayer/tv/__tests__/audioPlayer.test.js +19 -0
  2. package/Components/AudioPlayer/tv/__tests__/index.test.tsx +120 -0
  3. package/Components/AudioPlayer/tv/index.tsx +5 -1
  4. package/Components/BackgroundImage/BackgroundImage.android.tv.tsx +28 -0
  5. package/Components/BackgroundImage/BackgroundImage.ios.tv.tsx +24 -0
  6. package/Components/BackgroundImage/BackgroundImage.tsx +42 -0
  7. package/Components/BackgroundImage/index.ts +1 -0
  8. package/Components/CellRendererResolver/index.ts +2 -2
  9. package/Components/ComponentResolver/__tests__/componentResolver.test.js +1 -1
  10. package/Components/FocusableGroup/FocusableTvOS.tsx +11 -7
  11. package/Components/GeneralContentScreen/GeneralContentScreenHookAdapter.tsx +39 -0
  12. package/Components/GeneralContentScreen/__tests__/GeneralContentScreenHookAdapter.test.tsx +64 -0
  13. package/Components/GeneralContentScreen/__tests__/HookContentFocusGroup.web.test.tsx +91 -0
  14. package/Components/GeneralContentScreen/hookAdapter/__tests__/networkService.test.ts +74 -0
  15. package/Components/GeneralContentScreen/hookAdapter/__tests__/runInBackground.test.ts +139 -0
  16. package/Components/GeneralContentScreen/hookAdapter/__tests__/validationHelper.test.ts +124 -0
  17. package/Components/GeneralContentScreen/hookAdapter/logger.ts +6 -0
  18. package/Components/GeneralContentScreen/hookAdapter/networkService.ts +53 -0
  19. package/Components/GeneralContentScreen/hookAdapter/runInBackground.ts +48 -0
  20. package/Components/GeneralContentScreen/hookAdapter/validationHelper.ts +72 -0
  21. package/Components/GeneralContentScreen/hookFocus/index.tsx +13 -0
  22. package/Components/GeneralContentScreen/hookFocus/index.web.tsx +69 -0
  23. package/Components/GeneralContentScreen/index.ts +2 -0
  24. package/Components/Layout/FullWidthRow.tsx +38 -0
  25. package/Components/Layout/TV/ScreenContainer.tsx +5 -0
  26. package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +0 -1
  27. package/Components/Layout/TV/index.tsx +3 -4
  28. package/Components/Layout/TV/index.web.tsx +2 -3
  29. package/Components/MasterCell/DefaultComponents/ActionButton.tsx +16 -5
  30. package/Components/MasterCell/DefaultComponents/ActionButtonsCore/__tests__/placement.test.ts +47 -21
  31. package/Components/MasterCell/DefaultComponents/ActionButtonsCore/placement.ts +34 -6
  32. package/Components/MasterCell/DefaultComponents/ButtonContainerView/index.tsx +1 -1
  33. package/Components/MasterCell/DefaultComponents/Image/hoc/utils/__tests__/withDimensions.test.ts +420 -125
  34. package/Components/MasterCell/DefaultComponents/Image/hoc/utils/index.ts +114 -19
  35. package/Components/MasterCell/DefaultComponents/Image/hoc/withDimensions.tsx +19 -8
  36. package/Components/MasterCell/DefaultComponents/ImageContainer/index.tsx +5 -3
  37. package/Components/MasterCell/DefaultComponents/PressableView.tsx +29 -9
  38. package/Components/MasterCell/DefaultComponents/Text/hooks/useText.ts +4 -0
  39. package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/ActionButton.tsx +154 -100
  40. package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/AssetComponent.tsx +15 -4
  41. package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/Button.ts +56 -22
  42. package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/Spacer.ts +6 -4
  43. package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/TextLabelsContainer.ts +3 -1
  44. package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/__tests__/PressableView.test.tsx +32 -21
  45. package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/__tests__/index.test.ts +15 -4
  46. package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/index.ts +23 -16
  47. package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/utils/__tests__/insertButtons.test.ts +8 -3
  48. package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/utils/index.ts +2 -2
  49. package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/utils/__tests__/insertButtonsBetweenLabels.test.ts +45 -13
  50. package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/utils/index.ts +2 -2
  51. package/Components/MasterCell/contexts/PressedStateContext.ts +3 -0
  52. package/Components/MasterCell/dataAdapter.ts +15 -5
  53. package/Components/MasterCell/hooks/index.ts +2 -0
  54. package/Components/MasterCell/hooks/usePressedState.ts +4 -0
  55. package/Components/MasterCell/index.tsx +30 -5
  56. package/Components/MasterCell/utils/__tests__/resolveColor.test.js +169 -132
  57. package/Components/MasterCell/utils/__tests__/resolveColorForProp.test.js +92 -0
  58. package/Components/MasterCell/utils/index.ts +85 -46
  59. package/Components/ModalComponent/AudioPlayer/Components/Action.tsx +314 -0
  60. package/Components/ModalComponent/AudioPlayer/Components/Button.tsx +395 -0
  61. package/Components/ModalComponent/AudioPlayer/Components/Header.tsx +763 -0
  62. package/Components/ModalComponent/AudioPlayer/Components/Input.tsx +653 -0
  63. package/Components/ModalComponent/AudioPlayer/Components/Item.tsx +874 -0
  64. package/Components/ModalComponent/AudioPlayer/Components/NowPlayingHeaderSection.tsx +89 -0
  65. package/Components/ModalComponent/AudioPlayer/Components/index.ts +11 -0
  66. package/Components/ModalComponent/AudioPlayer/utils/mergeStyles.ts +199 -0
  67. package/Components/ModalComponent/BottomSheetDragArea.tsx +33 -0
  68. package/Components/ModalComponent/BottomSheetModalContent.tsx +386 -42
  69. package/Components/ModalComponent/Button/index.tsx +5 -3
  70. package/Components/ModalComponent/Header/index.tsx +20 -7
  71. package/Components/ModalComponent/Header/utils.ts +1 -1
  72. package/Components/ModalComponent/ModalBlocksStyleContext.tsx +10 -0
  73. package/Components/ModalComponent/SortableList.tsx +142 -0
  74. package/Components/ModalComponent/TextInputContent.tsx +100 -0
  75. package/Components/ModalComponent/__tests__/BottomSheetDragArea.test.tsx +74 -0
  76. package/Components/ModalComponent/__tests__/BottomSheetModalContent.test.tsx +238 -0
  77. package/Components/ModalComponent/__tests__/TextInputContent.test.tsx +120 -0
  78. package/Components/ModalComponent/__tests__/showTextInput.test.ts +95 -0
  79. package/Components/ModalComponent/index.tsx +11 -0
  80. package/Components/ModalComponent/presets/__tests__/getCell.test.ts +66 -0
  81. package/Components/ModalComponent/presets/dynamicCollectionCell.tsx +78 -0
  82. package/Components/ModalComponent/presets/index.ts +27 -0
  83. package/Components/ModalComponent/presets/selectableCell.tsx +28 -0
  84. package/Components/ModalComponent/presets/standardCell.tsx +41 -0
  85. package/Components/ModalComponent/presets/types.ts +35 -0
  86. package/Components/ModalComponent/showTextInput.ts +43 -0
  87. package/Components/ModalComponent/utils.ts +76 -20
  88. package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +4 -85
  89. package/Components/OfflineHandler/__tests__/index.test.tsx +78 -18
  90. package/Components/OfflineHandler/hooks.ts +123 -0
  91. package/Components/OfflineHandler/index.tsx +51 -73
  92. package/Components/OfflineHandler/utils/index.ts +1 -13
  93. package/Components/PlayerContainer/PlayerContainer.tsx +25 -17
  94. package/Components/PlayerContainer/ProgramInfo/index.tsx +3 -4
  95. package/Components/PlayerContainer/__tests__/PlayerContainer.test.tsx +337 -0
  96. package/Components/PreloaderWrapper/index.tsx +1 -1
  97. package/Components/River/ComponentsMap/ComponentsMap.tsx +2 -2
  98. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +3 -15
  99. package/Components/Screen/TV/hooks/__tests__/useAfterPaint.test.ts +60 -0
  100. package/Components/Screen/TV/hooks/index.ts +2 -0
  101. package/Components/Screen/TV/hooks/useAfterPaint.ts +23 -0
  102. package/Components/Screen/TV/index.web.tsx +16 -7
  103. package/Components/Screen/index.tsx +8 -4
  104. package/Components/ScreenFeedLoader/ScreenFeedLoader.tsx +5 -3
  105. package/Components/ScreenResolverFeedProvider/ScreenResolverFeedProvider.tsx +1 -1
  106. package/Components/ScreenRevealManager/Overlay.tsx +34 -0
  107. package/Components/ScreenRevealManager/__tests__/Overlay.test.tsx +88 -0
  108. package/Components/ScreenRevealManager/withScreenRevealManager.tsx +8 -19
  109. package/Components/TopCutoffOverlay/index.tsx +2 -2
  110. package/Components/Transitioner/Transitioner.tsx +28 -17
  111. package/Components/VideoLive/LiveImageManager.ts +41 -43
  112. package/Components/VideoModal/utils.ts +6 -1
  113. package/Components/ZappFrameworkComponents/BarView/BarView.tsx +12 -5
  114. package/Components/ZappFrameworkComponents/BarView/__tests__/BarView.test.tsx +2 -2
  115. package/Contexts/CachedDimensionsContext/__tests__/index.test.ts +154 -0
  116. package/Contexts/CachedDimensionsContext/index.ts +17 -2
  117. package/Helpers/ComponentCellSelectionHelper/index.js +0 -6
  118. package/Helpers/index.js +7 -40
  119. package/package.json +6 -5
  120. package/Components/Layout/TV/LayoutBackground.tsx +0 -31
  121. package/Components/OfflineHandler/NotificationView/NotificationView.lg.tsx +0 -112
  122. package/Components/OfflineHandler/NotificationView/NotificationView.samsung.tsx +0 -107
  123. package/Components/OfflineHandler/NotificationView/NotificationView.tsx +0 -153
  124. package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +0 -66
  125. package/Components/OfflineHandler/NotificationView/utils.ts +0 -34
  126. package/Components/Screen/utils.ts +0 -16
  127. package/Helpers/Analytics/index.js +0 -95
  128. /package/Components/MasterCell/DefaultComponents/ButtonContainerView/{index.tv.android.tsx → index.android.tv.tsx} +0 -0
  129. /package/Decorators/ZappPipesDataConnector/__tests__/{Hero.js → Hero.tsx} +0 -0
@@ -0,0 +1,395 @@
1
+ /**
2
+ * Modal Building Block — Button
3
+ *
4
+ * Single-file Expo Snack demo for the Button building block spec.
5
+ * Two variants (with / without leading icon) are driven only by configuration + data.
6
+ *
7
+ * Green (configurable): background, title, icons (size + leading icon enable/action type)
8
+ * Black (hardcoded): action type → icon asset mapping
9
+ */
10
+
11
+ import React from "react";
12
+ import {
13
+ Image,
14
+ Platform,
15
+ Pressable,
16
+ StyleSheet,
17
+ Text,
18
+ View,
19
+ } from "react-native";
20
+
21
+ const styles = StyleSheet.create({
22
+ container: {
23
+ alignSelf: "stretch",
24
+ alignItems: "center",
25
+ justifyContent: "center",
26
+ },
27
+ contentRow: {
28
+ flexDirection: "row",
29
+ alignItems: "center",
30
+ justifyContent: "center",
31
+ },
32
+ title: {
33
+ textAlign: "center",
34
+ },
35
+ });
36
+
37
+ // ---------------------------------------------------------------------------
38
+ // Configuration (green / editable fields from spec)
39
+ // ---------------------------------------------------------------------------
40
+
41
+ export type ButtonActionType =
42
+ | "addToQueue"
43
+ | "addToPlaylist"
44
+ | "goToPlaylist"
45
+ | "confirm"
46
+ | "cancel";
47
+
48
+ export type TextTransform =
49
+ | "default"
50
+ | "lowercase"
51
+ | "uppercase"
52
+ | "capitalize";
53
+
54
+ export type BackgroundConfiguration = {
55
+ defaultColor: string;
56
+ focusedColor: string;
57
+ inactiveColor: string;
58
+ cornerRadius: number;
59
+ paddingTop: number;
60
+ paddingRight: number;
61
+ paddingBottom: number;
62
+ paddingLeft: number;
63
+ horizontalGutter: number;
64
+ };
65
+
66
+ export type TitleConfiguration = {
67
+ fontColor: string;
68
+ focusedFontColor: string;
69
+ inactiveFontColor: string;
70
+ iosFontFamily: string;
71
+ androidFontFamily: string;
72
+ fontSize: number;
73
+ lineHeight: number;
74
+ iosLetterSpacing: number;
75
+ androidLetterSpacing: number;
76
+ textTransform: TextTransform;
77
+ };
78
+
79
+ export type LeadingIconConfiguration = {
80
+ /** Enable: On / Off */
81
+ enabled: boolean;
82
+ /** Decides which icon will be displayed when enabled */
83
+ actionType?: ButtonActionType;
84
+ };
85
+
86
+ export type IconsConfiguration = {
87
+ width: number;
88
+ height: number;
89
+ leadingIcon: LeadingIconConfiguration;
90
+ };
91
+
92
+ export type ButtonConfiguration = {
93
+ background: BackgroundConfiguration;
94
+ title: TitleConfiguration;
95
+ icons: IconsConfiguration;
96
+ };
97
+
98
+ export const DEFAULT_BACKGROUND_CONFIGURATION: BackgroundConfiguration = {
99
+ defaultColor: "#FFFFFF",
100
+ focusedColor: "#E0E0E0",
101
+ inactiveColor: "#999999",
102
+ cornerRadius: 12,
103
+ paddingTop: 12,
104
+ paddingRight: 12,
105
+ paddingBottom: 12,
106
+ paddingLeft: 12,
107
+ horizontalGutter: 6,
108
+ };
109
+
110
+ export const DEFAULT_TITLE_CONFIGURATION: TitleConfiguration = {
111
+ fontColor: "#000000",
112
+ focusedFontColor: "#000000",
113
+ inactiveFontColor: "#000000",
114
+ iosFontFamily: "SFProText-Bold",
115
+ androidFontFamily: "Roboto-Bold",
116
+ fontSize: 15,
117
+ lineHeight: 24,
118
+ iosLetterSpacing: -0.2,
119
+ androidLetterSpacing: 0,
120
+ textTransform: "default",
121
+ };
122
+
123
+ export const DEFAULT_ICONS_CONFIGURATION: IconsConfiguration = {
124
+ width: 24,
125
+ height: 24,
126
+ leadingIcon: {
127
+ enabled: false,
128
+ },
129
+ };
130
+
131
+ // ---------------------------------------------------------------------------
132
+ // Data (runtime / localization — not styling config)
133
+ // ---------------------------------------------------------------------------
134
+
135
+ export type ButtonData = {
136
+ title: string;
137
+ disabled?: boolean;
138
+ };
139
+
140
+ export type AudioPlayerButtonProps = {
141
+ configuration: ButtonConfiguration;
142
+ data: ButtonData;
143
+ disabled?: boolean;
144
+ focused?: boolean;
145
+ onPress?: () => void;
146
+ };
147
+
148
+ // ---------------------------------------------------------------------------
149
+ // Hardcoded spec values (black fields)
150
+ // ---------------------------------------------------------------------------
151
+
152
+ // Hardcoded: action type → icon asset mapping (base64 PNG)
153
+ const ACTION_ICON_ASSETS: Record<ButtonActionType, string> = {
154
+ addToQueue:
155
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAKUlEQVR42mNgGAVDCfxHw6MWjFpAvEGk4lELKLdgNJmOWkA7C0YBbQAAwiZvkR9eFgQAAAAASUVORK5CYII=",
156
+ addToPlaylist:
157
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAJklEQVR42mNgGAUjFvzHgmluATF4cFswGsmjkTwayaORPAqGLwAA6Jpxj9Ms9QMAAAAASUVORK5CYII=",
158
+ goToPlaylist:
159
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAALklEQVR42mNgGAWjYNiD/7Q2/D8tLflPiSX/ycQ0t+D/yLGAEkeMWjAKRgG9AQB4zlSshwSzWwAAAABJRU5ErkJggg==",
160
+ confirm:
161
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAJElEQVR42mNgGAWjYBSQCv4TwKMWDHELho/hNE/3o2AUDDcAAPv0QMAyy1CtAAAAAElFTkSuQmCC",
162
+ cancel:
163
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAASElEQVR42mNgGAWjGvynkVoUTf+pqA6nxv8UqiHbEooNx2cQ1QzHZiDVDcdlCcOQsoCmQUTTSKZpMqV5RqNLUUHTwm4UDBMAALBLQ73LTvoyAAAAAElFTkSuQmCC",
164
+ };
165
+
166
+ function getTextTransformStyle(
167
+ textTransform: TextTransform
168
+ ): "none" | "lowercase" | "uppercase" | "capitalize" {
169
+ return textTransform === "default" ? "none" : textTransform;
170
+ }
171
+
172
+ function shouldShowLeadingIcon(leadingIcon: LeadingIconConfiguration) {
173
+ return leadingIcon.enabled && !!leadingIcon.actionType;
174
+ }
175
+
176
+ // ---------------------------------------------------------------------------
177
+ // Inner components (hardcoded styling lives here)
178
+ // ---------------------------------------------------------------------------
179
+
180
+ type ButtonContainerProps = {
181
+ focused: boolean;
182
+ disabled: boolean;
183
+ configuration: BackgroundConfiguration;
184
+ children: React.ReactNode;
185
+ onPress?: () => void;
186
+ };
187
+
188
+ function ButtonContainer({
189
+ focused,
190
+ disabled,
191
+ configuration,
192
+ children,
193
+ onPress,
194
+ }: ButtonContainerProps) {
195
+ const defaultBgColor = disabled
196
+ ? configuration.inactiveColor
197
+ : focused
198
+ ? configuration.focusedColor
199
+ : configuration.defaultColor;
200
+
201
+ return (
202
+ <Pressable
203
+ onPress={disabled ? undefined : onPress}
204
+ style={({ pressed }) => [
205
+ styles.container,
206
+ {
207
+ backgroundColor:
208
+ pressed && !disabled ? configuration.focusedColor : defaultBgColor,
209
+ borderRadius: configuration.cornerRadius,
210
+ paddingTop: configuration.paddingTop,
211
+ paddingRight: configuration.paddingRight,
212
+ paddingBottom: configuration.paddingBottom,
213
+ paddingLeft: configuration.paddingLeft,
214
+ },
215
+ ]}
216
+ >
217
+ {children}
218
+ </Pressable>
219
+ );
220
+ }
221
+
222
+ type ButtonTitleProps = {
223
+ title: string;
224
+ focused: boolean;
225
+ disabled: boolean;
226
+ configuration: TitleConfiguration;
227
+ };
228
+
229
+ function ButtonTitle({
230
+ title,
231
+ focused,
232
+ disabled,
233
+ configuration,
234
+ }: ButtonTitleProps) {
235
+ const color = disabled
236
+ ? configuration.inactiveFontColor
237
+ : focused
238
+ ? configuration.focusedFontColor
239
+ : configuration.fontColor;
240
+
241
+ const letterSpacing =
242
+ Platform.OS === "ios"
243
+ ? configuration.iosLetterSpacing
244
+ : configuration.androidLetterSpacing;
245
+
246
+ return (
247
+ <Text
248
+ style={[
249
+ styles.title,
250
+ {
251
+ color,
252
+ fontSize: configuration.fontSize,
253
+ lineHeight: configuration.lineHeight,
254
+ letterSpacing,
255
+ fontFamily: Platform.select({
256
+ ios: configuration.iosFontFamily,
257
+ android: configuration.androidFontFamily,
258
+ default: configuration.androidFontFamily,
259
+ }),
260
+ textTransform: getTextTransformStyle(configuration.textTransform),
261
+ },
262
+ ]}
263
+ numberOfLines={1}
264
+ >
265
+ {title}
266
+ </Text>
267
+ );
268
+ }
269
+
270
+ type ButtonLeadingIconProps = {
271
+ actionType: ButtonActionType;
272
+ configuration: IconsConfiguration;
273
+ };
274
+
275
+ function ButtonLeadingIcon({
276
+ actionType,
277
+ configuration,
278
+ }: ButtonLeadingIconProps) {
279
+ return (
280
+ <Image
281
+ source={{ uri: ACTION_ICON_ASSETS[actionType] }}
282
+ style={{
283
+ width: configuration.width,
284
+ height: configuration.height,
285
+ }}
286
+ resizeMode="contain"
287
+ />
288
+ );
289
+ }
290
+
291
+ // ---------------------------------------------------------------------------
292
+ // AudioPlayerButton — single building block driven by configuration + data
293
+ // ---------------------------------------------------------------------------
294
+
295
+ import { useModalBlocksStyle } from "../../ModalBlocksStyleContext";
296
+ import { mergeButtonConfiguration } from "../utils/mergeStyles";
297
+
298
+ export function AudioPlayerButton({
299
+ configuration,
300
+ data,
301
+ disabled,
302
+ 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
+
313
+ const {
314
+ background: effectiveBgConfig,
315
+ title: effectiveTitleConfig,
316
+ icons: iconsConfiguration,
317
+ } = effectiveConfig;
318
+
319
+ const { title } = data;
320
+ const isDisabled = disabled ?? data.disabled ?? false;
321
+
322
+ const { leadingIcon } = iconsConfiguration;
323
+ const showIcon = shouldShowLeadingIcon(leadingIcon);
324
+
325
+ return (
326
+ <ButtonContainer
327
+ focused={focused}
328
+ disabled={isDisabled}
329
+ configuration={effectiveBgConfig}
330
+ onPress={onPress}
331
+ >
332
+ <View style={styles.contentRow}>
333
+ {showIcon ? (
334
+ <>
335
+ <ButtonLeadingIcon
336
+ actionType={leadingIcon.actionType}
337
+ configuration={iconsConfiguration}
338
+ />
339
+ <View style={{ width: effectiveBgConfig.horizontalGutter }} />
340
+ </>
341
+ ) : null}
342
+ <ButtonTitle
343
+ title={title}
344
+ focused={focused}
345
+ disabled={isDisabled}
346
+ configuration={effectiveTitleConfig}
347
+ />
348
+ </View>
349
+ </ButtonContainer>
350
+ );
351
+ }
352
+
353
+ // ---------------------------------------------------------------------------
354
+ // Snack demo — two Button variants from configuration only
355
+ // ---------------------------------------------------------------------------
356
+
357
+ export const VARIANT_TEXT_ONLY: ButtonConfiguration = {
358
+ background: DEFAULT_BACKGROUND_CONFIGURATION,
359
+ title: DEFAULT_TITLE_CONFIGURATION,
360
+ icons: DEFAULT_ICONS_CONFIGURATION,
361
+ };
362
+
363
+ export const VARIANT_WITH_ICON: ButtonConfiguration = {
364
+ background: DEFAULT_BACKGROUND_CONFIGURATION,
365
+ title: DEFAULT_TITLE_CONFIGURATION,
366
+ icons: {
367
+ ...DEFAULT_ICONS_CONFIGURATION,
368
+ leadingIcon: {
369
+ enabled: true,
370
+ actionType: "addToPlaylist",
371
+ },
372
+ },
373
+ };
374
+
375
+ export const VARIANT_UPPERCASE_TITLE: ButtonConfiguration = {
376
+ background: DEFAULT_BACKGROUND_CONFIGURATION,
377
+ title: {
378
+ ...DEFAULT_TITLE_CONFIGURATION,
379
+ textTransform: "uppercase",
380
+ },
381
+ icons: DEFAULT_ICONS_CONFIGURATION,
382
+ };
383
+
384
+ export const VARIANT_LARGE_ICON: ButtonConfiguration = {
385
+ background: DEFAULT_BACKGROUND_CONFIGURATION,
386
+ title: DEFAULT_TITLE_CONFIGURATION,
387
+ icons: {
388
+ width: 32,
389
+ height: 32,
390
+ leadingIcon: {
391
+ enabled: true,
392
+ actionType: "addToQueue",
393
+ },
394
+ },
395
+ };