@wlloyalty/wll-react-sdk 1.10.0 → 1.11.0

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.
@@ -6,3 +6,7 @@ export declare const Accent: import("@storybook/core/csf").AnnotatedStoryFn<impo
6
6
  export declare const Small: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import(".").ProgressBarProps>;
7
7
  export declare const Full: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import(".").ProgressBarProps>;
8
8
  export declare const Empty: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import(".").ProgressBarProps>;
9
+ export declare const WithLabel: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import(".").ProgressBarProps>;
10
+ export declare const WithLabelFull: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import(".").ProgressBarProps>;
11
+ export declare const WithLabelEmpty: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import(".").ProgressBarProps>;
12
+ export declare const WithLabelAccent: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import(".").ProgressBarProps>;
@@ -5,6 +5,9 @@ export type ProgressBarProps = {
5
5
  variant?: Variant;
6
6
  height?: Size;
7
7
  animationDuration?: number;
8
+ currentValue?: number;
9
+ targetValue?: number;
10
+ showProgressLabel?: boolean;
8
11
  };
9
- declare const ProgressBar: ({ percentage, variant, height, animationDuration, }: ProgressBarProps) => React.ReactElement;
12
+ declare const ProgressBar: ({ percentage, variant, height, animationDuration, currentValue, targetValue, showProgressLabel, }: ProgressBarProps) => React.ReactElement;
10
13
  export default ProgressBar;
@@ -0,0 +1,27 @@
1
+ import { Meta } from '@storybook/react';
2
+ declare const _default: Meta;
3
+ export default _default;
4
+ export declare const FullWithProgress: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
5
+ tile: import("../../../types/tile").Tile;
6
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
7
+ export declare const FullWithoutProgress: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
8
+ tile: import("../../../types/tile").Tile;
9
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
10
+ export declare const FullCompleted: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
11
+ tile: import("../../../types/tile").Tile;
12
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
13
+ export declare const FullArtworkOnly: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
14
+ tile: import("../../../types/tile").Tile;
15
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
16
+ export declare const FullWithoutImage: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
17
+ tile: import("../../../types/tile").Tile;
18
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
19
+ export declare const HalfWithProgress: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
20
+ tile: import("../../../types/tile").Tile;
21
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
22
+ export declare const HalfWithoutProgress: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
23
+ tile: import("../../../types/tile").Tile;
24
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
25
+ export declare const HalfArtworkOnly: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
26
+ tile: import("../../../types/tile").Tile;
27
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ /**
3
+ * Renders a chevron icon for a Campaign Tile.
4
+ *
5
+ * @returns React.ReactElement
6
+ */
7
+ export declare const CampaignTileChevron: () => React.ReactElement;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ /**
3
+ * Renders the description of a Campaign Tile.
4
+ *
5
+ * @returns React.ReactElement or null if no description is present
6
+ */
7
+ export declare const CampaignTileDescription: () => React.ReactElement | null;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ type CampaignTileMediaProps = {
3
+ isArtworkOnly?: boolean;
4
+ };
5
+ /**
6
+ * Renders the media header for a Campaign Tile.
7
+ *
8
+ * @param props {CampaignTileMediaProps} - Component props
9
+ * @param props.isArtworkOnly {boolean} - Whether the media should occupy the full tile height
10
+ * @returns React.ReactElement or null if no artworkUrl is present
11
+ */
12
+ export declare const CampaignTileMedia: ({ isArtworkOnly, }: CampaignTileMediaProps) => React.ReactElement | null;
13
+ export {};
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { CampaignProgress } from '../../../types/tile';
3
+ type CampaignTileProgressProps = {
4
+ progress: CampaignProgress | null;
5
+ };
6
+ /**
7
+ * Renders the progress bar and progress label for a Campaign Tile.
8
+ * If progress is null, nothing is rendered.
9
+ *
10
+ * @param props - Component props
11
+ * @param props.progress - The campaign progress data
12
+ * @returns React.ReactElement or null if progress is null
13
+ */
14
+ export declare const CampaignTileProgress: ({ progress, }: CampaignTileProgressProps) => React.ReactElement | null;
15
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ /**
3
+ * Renders the title of a Campaign Tile.
4
+ *
5
+ * @returns React.ReactElement or null if no name is present
6
+ */
7
+ export declare const CampaignTileTitle: () => React.ReactElement | null;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { Tile } from '../../../types/tile';
3
+ type CampaignTileProps = {
4
+ tile: Tile;
5
+ };
6
+ /**
7
+ * The CampaignTile component with subcomponents attached.
8
+ */
9
+ export declare const CampaignTile: (({ tile, }: CampaignTileProps) => React.ReactElement | null) & {
10
+ Media: ({ isArtworkOnly, }: {
11
+ isArtworkOnly?: boolean;
12
+ }) => React.ReactElement | null;
13
+ Title: () => React.ReactElement | null;
14
+ Description: () => React.ReactElement | null;
15
+ Progress: ({ progress, }: {
16
+ progress: import("../../../types/tile").CampaignProgress | null;
17
+ }) => React.ReactElement | null;
18
+ Chevron: () => React.ReactElement;
19
+ };
20
+ declare const _default: (props: Omit<CampaignTileProps, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps) => React.JSX.Element;
21
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { StyleSheet } from 'react-native';
2
+ /**
3
+ * Custom hook that returns the styles for the CampaignTile component.
4
+ * Applies responsive styling based on the current device.
5
+ *
6
+ * @returns StyleSheet styles for the CampaignTile component
7
+ */
8
+ export declare const useCampaignTileStyles: () => ReturnType<typeof StyleSheet.create>;
@@ -1,5 +1,6 @@
1
1
  export { default as BadgeTile } from './BadgeTile';
2
2
  export { default as BannerTile } from './BannerTile';
3
+ export { default as CampaignTile } from './CampaignTile';
3
4
  export { default as ContentTile } from './ContentTile';
4
5
  export { default as Group } from './Group';
5
6
  export { default as PointsTile } from './PointsTile';
@@ -0,0 +1,6 @@
1
+ import { CampaignTileConfig, Tile, TileHeight } from '../../types/tile';
2
+ export type CampaignTileMockConfig = Partial<CampaignTileConfig> & {
3
+ active?: boolean;
4
+ tileHeight?: TileHeight;
5
+ };
6
+ export declare const createCampaignTileMock: (config?: CampaignTileMockConfig) => Tile;
@@ -20,7 +20,8 @@ export declare enum TileType {
20
20
  RewardCategory = "REWARD_CATEGORY",
21
21
  Tier = "TIER",
22
22
  Roundup = "ROUND_UP_BALANCE",
23
- Venue = "VENUE"
23
+ Venue = "VENUE",
24
+ Campaign = "EARNING_CAMPAIGN"
24
25
  }
25
26
  export declare enum TileHeight {
26
27
  Half = "HALF",
@@ -175,6 +176,46 @@ export declare class TierTileConfig {
175
176
  pointsToTierSuffix?: string;
176
177
  locale: string;
177
178
  }
179
+ export declare class CampaignTileConfig {
180
+ campaignId: string;
181
+ type: string;
182
+ status: string;
183
+ name: string;
184
+ description: string;
185
+ artworkUrl: string;
186
+ showDetails?: boolean;
187
+ effectivity: {
188
+ start: Date | null;
189
+ end: Date | null;
190
+ };
191
+ progress: CampaignProgress | null;
192
+ missions: CampaignMission[];
193
+ }
194
+ export type CampaignProgress = {
195
+ currentValue: number;
196
+ targetValue: number;
197
+ windowStart: string | null;
198
+ windowEnd: string | null;
199
+ optedInAt: string | null;
200
+ completedAt: string | null;
201
+ availableAgainAt: string | null;
202
+ cooldownCycle: number | null;
203
+ };
204
+ export type CampaignMission = {
205
+ id: string;
206
+ name: string;
207
+ description: string | null;
208
+ pictureUrl: string | null;
209
+ completionType: string;
210
+ targetValue: number;
211
+ displayStyle: string;
212
+ requiresOptIn: boolean;
213
+ lockState: string;
214
+ order: number;
215
+ duration: number | null;
216
+ cooldownDuration: number | null;
217
+ progress: CampaignProgress;
218
+ };
178
219
  export type Tile = {
179
220
  id: string | null;
180
221
  type?: TileType;
@@ -185,7 +226,7 @@ export type Tile = {
185
226
  configuration: TileConfig;
186
227
  priority: number;
187
228
  };
188
- declare const getConfigForTileType: (tileType: TileType) => typeof BannerTileConfig | typeof PointsTileConfig | typeof ContentTileConfig | typeof RewardTileConfig | typeof VenueTileConfig | typeof BadgeTileConfig | typeof RewardCategoryTileConfig | typeof TierTileConfig;
229
+ declare const getConfigForTileType: (tileType: TileType) => typeof BannerTileConfig | typeof PointsTileConfig | typeof ContentTileConfig | typeof RewardTileConfig | typeof VenueTileConfig | typeof BadgeTileConfig | typeof RewardCategoryTileConfig | typeof TierTileConfig | typeof CampaignTileConfig;
189
230
  export type TileConfig = InstanceType<ReturnType<typeof getConfigForTileType>>;
190
231
  export type TileSizeInfo = {
191
232
  isFullSize: boolean;