@wlloyalty/wll-react-sdk 1.0.61 → 1.0.63
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/dist/index.d.ts +31 -17
- package/dist/native.js +593 -254
- package/dist/native.js.map +1 -1
- package/dist/types/components/atoms/BaseTile/base-tile-body.d.ts +6 -0
- package/dist/types/components/atoms/BaseTile/base-tile-content.d.ts +11 -4
- package/dist/types/components/atoms/BaseTile/base-tile-header.d.ts +11 -4
- package/dist/types/components/atoms/BaseTile/base-tile-media.d.ts +6 -0
- package/dist/types/components/atoms/BaseTile/base-tile-title.d.ts +5 -0
- package/dist/types/components/atoms/BaseTile/index.d.ts +9 -8
- package/dist/types/components/atoms/BaseTile/styles.d.ts +27 -0
- package/dist/types/components/atoms/Skeleton/index.d.ts +2 -2
- package/dist/types/components/atoms/SkeletonTile/index.d.ts +2 -2
- package/dist/types/components/organisms/BadgeTile/badge-tile-date-earned.d.ts +5 -0
- package/dist/types/components/organisms/BadgeTile/badge-tile-description.d.ts +5 -0
- package/dist/types/components/organisms/BadgeTile/badge-tile-media.d.ts +5 -0
- package/dist/types/components/organisms/BadgeTile/badge-tile-status.d.ts +5 -0
- package/dist/types/components/organisms/BadgeTile/badge-tile-title.d.ts +5 -0
- package/dist/types/components/organisms/BadgeTile/styles.d.ts +6 -0
- package/dist/types/components/organisms/BannerTile/banner-tile-cta.d.ts +5 -0
- package/dist/types/components/organisms/BannerTile/banner-tile-description.d.ts +5 -0
- package/dist/types/components/organisms/BannerTile/banner-tile-media.d.ts +5 -0
- package/dist/types/components/organisms/BannerTile/banner-tile-title.d.ts +5 -0
- package/dist/types/components/organisms/BannerTile/styles.d.ts +6 -0
- package/dist/types/components/organisms/ContentTile/content-tile-container.d.ts +2 -4
- package/dist/types/components/organisms/ContentTile/content-tile-content.d.ts +2 -4
- package/dist/types/components/organisms/ContentTile/index.d.ts +2 -6
- package/dist/types/components/organisms/ContentTile/styles.d.ts +6 -0
- package/dist/types/components/organisms/Group/index.d.ts +26 -3
- package/dist/types/components/organisms/PointsTile/points-tile-formatted-points.d.ts +5 -0
- package/dist/types/components/organisms/PointsTile/points-tile-media.d.ts +5 -0
- package/dist/types/components/organisms/PointsTile/points-tile-title.d.ts +5 -0
- package/dist/types/components/organisms/PointsTile/styles.d.ts +6 -0
- package/dist/types/components/organisms/RewardCategoryTile/reward-category-header.d.ts +5 -0
- package/dist/types/components/organisms/RewardCategoryTile/reward-category-media.d.ts +5 -0
- package/dist/types/components/organisms/RewardCategoryTile/styles.d.ts +6 -0
- package/dist/types/components/organisms/RewardTile/reward-tile-chevron.d.ts +5 -0
- package/dist/types/components/organisms/RewardTile/reward-tile-media.d.ts +7 -0
- package/dist/types/components/organisms/RewardTile/reward-tile-points.d.ts +5 -0
- package/dist/types/components/organisms/RewardTile/reward-tile-summary.d.ts +5 -0
- package/dist/types/components/organisms/RewardTile/reward-tile-title.d.ts +5 -0
- package/dist/types/components/organisms/RewardTile/styles.d.ts +6 -0
- package/dist/types/components/organisms/Section/index.d.ts +8 -0
- package/dist/types/components/organisms/Section/styles.d.ts +6 -0
- package/dist/types/context/WllSdkContext.d.ts +2 -3
- package/dist/types/types/helpers.d.ts +11 -0
- package/dist/types/types/responsive.d.ts +4 -4
- package/dist/types/types/theme.d.ts +2 -3
- package/dist/types/types/tile.d.ts +4 -0
- package/dist/types/utils/contextHelpers.d.ts +17 -0
- package/dist/web.js +593 -254
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,5 +4,11 @@ type BaseTileBodyProps = Omit<TextProps, 'style'> & {
|
|
|
4
4
|
isSurface?: boolean;
|
|
5
5
|
style?: TextStyle;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Renders the body text of a BaseTile component.
|
|
9
|
+
*
|
|
10
|
+
* @param {BaseTileBodyProps} props - Component props including text styling options
|
|
11
|
+
* @returns {JSX.Element|null} The rendered body text or null if conditions for display are not met
|
|
12
|
+
*/
|
|
7
13
|
export declare const BaseTileBody: (props: BaseTileBodyProps) => JSX.Element | null;
|
|
8
14
|
export {};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { WithChildren } from '../../../types/helpers';
|
|
2
|
+
type BaseTileContentProps = WithChildren;
|
|
3
|
+
/**
|
|
4
|
+
* Renders the content section of a BaseTile component.
|
|
5
|
+
*
|
|
6
|
+
* @param {BaseTileContentProps} props - Component props
|
|
7
|
+
* @param {ReactNode} props.children - Child elements to render within the content area
|
|
8
|
+
* @returns {JSX.Element|null} The rendered content or null if conditions for display are not met
|
|
9
|
+
*/
|
|
10
|
+
export declare const BaseTileContent: ({ children, }: BaseTileContentProps) => JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { WithChildren } from '../../../types/helpers';
|
|
2
|
+
type BaseTileHeaderProps = WithChildren;
|
|
3
|
+
/**
|
|
4
|
+
* Renders the header section of a BaseTile component.
|
|
5
|
+
*
|
|
6
|
+
* @param {BaseTileHeaderProps} props - Component props
|
|
7
|
+
* @param {ReactNode} props.children - Child elements to render within the header
|
|
8
|
+
* @returns {JSX.Element|null} The rendered header or null if conditions for display are not met
|
|
9
|
+
*/
|
|
10
|
+
export declare const BaseTileHeader: ({ children, }: BaseTileHeaderProps) => JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { ImagePropsNoSource } from '../../../types/common';
|
|
2
|
+
/**
|
|
3
|
+
* Renders the media (image) for a BaseTile component.
|
|
4
|
+
*
|
|
5
|
+
* @param {ImagePropsNoSource} props - The image props excluding source
|
|
6
|
+
* @returns {JSX.Element|null} The rendered image or null if no artwork URL is present
|
|
7
|
+
*/
|
|
2
8
|
export declare const BaseTileMedia: (props: ImagePropsNoSource) => JSX.Element | null;
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
1
|
import { ViewStyle } from 'react-native';
|
|
3
2
|
import { Tile } from '../../../types/tile';
|
|
3
|
+
import { WithChildren } from '../../../types/helpers';
|
|
4
4
|
/**
|
|
5
5
|
* Custom hook to access the TileContext.
|
|
6
|
+
*
|
|
7
|
+
* @returns {Tile} The current tile from context
|
|
8
|
+
* @throws {Error} If used outside of a BaseTile
|
|
6
9
|
*/
|
|
7
10
|
export declare const useTileContext: () => Tile;
|
|
8
|
-
type BaseTileProps = {
|
|
11
|
+
type BaseTileProps = WithChildren & {
|
|
9
12
|
tile: Tile;
|
|
10
|
-
children: ReactNode;
|
|
11
13
|
style?: ViewStyle;
|
|
12
14
|
};
|
|
13
|
-
type BaseTileRootProps = {
|
|
14
|
-
children: ReactNode;
|
|
15
|
+
type BaseTileRootProps = WithChildren & {
|
|
15
16
|
style?: ViewStyle;
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* BaseTile component with subcomponents attached.
|
|
19
20
|
*/
|
|
20
|
-
export declare const BaseTile: (({ tile, children }: BaseTileProps) => JSX.Element) & {
|
|
21
|
+
export declare const BaseTile: (({ tile, children, style, }: BaseTileProps) => JSX.Element | null) & {
|
|
21
22
|
Container: ({ children, style, }: BaseTileRootProps) => JSX.Element;
|
|
22
23
|
Media: (props: import("../../..").ImagePropsNoSource) => JSX.Element | null;
|
|
23
24
|
Content: ({ children, }: {
|
|
24
|
-
children
|
|
25
|
+
children?: React.ReactNode;
|
|
25
26
|
}) => JSX.Element | null;
|
|
26
27
|
Header: ({ children, }: {
|
|
27
|
-
children
|
|
28
|
+
children?: React.ReactNode;
|
|
28
29
|
}) => JSX.Element | null;
|
|
29
30
|
Title: () => JSX.Element | null;
|
|
30
31
|
Body: (props: Omit<import("react-native").TextProps, "style"> & {
|
|
@@ -13,7 +13,34 @@ export declare const baseStyles: {
|
|
|
13
13
|
objectFit: "cover";
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Custom hook that returns the styles for the BaseTile component.
|
|
18
|
+
* Applies responsive styling based on the current device.
|
|
19
|
+
*
|
|
20
|
+
* @returns StyleSheet styles for the BaseTile component
|
|
21
|
+
*/
|
|
16
22
|
export declare const useBaseTileStyles: () => {
|
|
23
|
+
container: {
|
|
24
|
+
width: "100%";
|
|
25
|
+
height: "100%";
|
|
26
|
+
overflow: "hidden";
|
|
27
|
+
position: "relative";
|
|
28
|
+
};
|
|
29
|
+
content: {
|
|
30
|
+
display: "flex";
|
|
31
|
+
};
|
|
32
|
+
header: {
|
|
33
|
+
marginBottom: number;
|
|
34
|
+
marginTop: number;
|
|
35
|
+
flexDirection: "row";
|
|
36
|
+
alignItems: "center";
|
|
37
|
+
justifyContent: "space-between";
|
|
38
|
+
};
|
|
39
|
+
media: {
|
|
40
|
+
width: "100%";
|
|
41
|
+
objectFit: "cover";
|
|
42
|
+
};
|
|
43
|
+
} | {
|
|
17
44
|
container: {
|
|
18
45
|
backgroundColor: string;
|
|
19
46
|
aspectRatio: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ViewStyle } from 'react-native';
|
|
2
|
-
|
|
2
|
+
type SkeletonProps = {
|
|
3
3
|
width?: number | `${number}%`;
|
|
4
4
|
height?: number | `${number}%`;
|
|
5
5
|
borderRadius?: number;
|
|
6
6
|
style?: ViewStyle;
|
|
7
7
|
numberOfSquares?: number;
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
declare const Skeleton: ({ style, numberOfSquares, }: SkeletonProps) => JSX.Element;
|
|
10
10
|
export default Skeleton;
|
|
@@ -4,4 +4,9 @@ export type BadgeTileMediaProps = {
|
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
alt?: string;
|
|
6
6
|
} & Omit<React.ComponentProps<typeof ProgressiveImage>, 'source' | 'alt'>;
|
|
7
|
+
/**
|
|
8
|
+
* Renders the media for a Badge Tile.
|
|
9
|
+
*
|
|
10
|
+
* @returns JSX.Element or null if media is not present
|
|
11
|
+
*/
|
|
7
12
|
export declare const BadgeTileMedia: ({ children, alt, ...props }: BadgeTileMediaProps) => JSX.Element | null;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook that returns the styles for the BadgeTile component.
|
|
4
|
+
* Applies responsive styling based on the current device.
|
|
5
|
+
*
|
|
6
|
+
* @returns StyleSheet styles for the BadgeTile component
|
|
7
|
+
*/
|
|
2
8
|
export declare const useBadgeTileStyles: () => ReturnType<typeof StyleSheet.create>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
type BannerTileMediaProps = {
|
|
2
2
|
isArtworkOnly: boolean;
|
|
3
3
|
};
|
|
4
|
+
/**
|
|
5
|
+
* Renders the media of a Banner Tile.
|
|
6
|
+
*
|
|
7
|
+
* @returns JSX.Element or null if no media is present
|
|
8
|
+
*/
|
|
4
9
|
export declare const BannerTileMedia: ({ isArtworkOnly, }: BannerTileMediaProps) => JSX.Element | null;
|
|
5
10
|
export {};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook that returns the styles for the BannerTile component.
|
|
4
|
+
* Applies responsive styling based on the current device.
|
|
5
|
+
*
|
|
6
|
+
* @returns StyleSheet styles for the BannerTile component
|
|
7
|
+
*/
|
|
2
8
|
export declare const useBannerTileStyles: () => ReturnType<typeof StyleSheet.create>;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const ContentTileContainer: ({ children, }:
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
}) => JSX.Element;
|
|
1
|
+
import { WithChildren } from '../../../types/helpers';
|
|
2
|
+
export declare const ContentTileContainer: ({ children, }: WithChildren) => JSX.Element;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const ContentTileContent: ({ children
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
}) => JSX.Element;
|
|
1
|
+
import { WithChildren } from '../../../types/helpers';
|
|
2
|
+
export declare const ContentTileContent: ({ children }: WithChildren) => JSX.Element;
|
|
@@ -7,13 +7,9 @@ type ContentTileProps = {
|
|
|
7
7
|
* The ContentTile component with subcomponents attached.
|
|
8
8
|
*/
|
|
9
9
|
export declare const ContentTile: (({ tile }: ContentTileProps) => JSX.Element | null) & {
|
|
10
|
-
Container: ({ children, }:
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
}) => JSX.Element;
|
|
10
|
+
Container: ({ children, }: import("../../../types/helpers").WithChildren) => JSX.Element;
|
|
13
11
|
Media: () => JSX.Element;
|
|
14
|
-
Content: ({ children
|
|
15
|
-
children: React.ReactNode;
|
|
16
|
-
}) => JSX.Element;
|
|
12
|
+
Content: ({ children }: import("../../../types/helpers").WithChildren) => JSX.Element;
|
|
17
13
|
Header: () => JSX.Element | null;
|
|
18
14
|
Body: () => JSX.Element;
|
|
19
15
|
};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook that returns the styles for the ContentTile component.
|
|
4
|
+
* Applies responsive styling based on the current device.
|
|
5
|
+
*
|
|
6
|
+
* @returns StyleSheet styles for the ContentTile component
|
|
7
|
+
*/
|
|
2
8
|
export declare const useContentTileStyles: () => ReturnType<typeof StyleSheet.create>;
|
|
@@ -9,8 +9,31 @@ type GroupContextType = {
|
|
|
9
9
|
type GroupEmptyStateProps = {
|
|
10
10
|
message: string;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Context for providing group data to child components
|
|
14
|
+
*/
|
|
12
15
|
export declare const GroupContext: React.Context<GroupContextType | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* Custom hook to access the GroupContext
|
|
18
|
+
*
|
|
19
|
+
* @returns {GroupContextType} The group context data
|
|
20
|
+
* @throws {Error} If used outside of a GroupProvider
|
|
21
|
+
*/
|
|
13
22
|
export declare const useGroupContext: () => GroupContextType;
|
|
23
|
+
/**
|
|
24
|
+
* Component to display an empty state with a message
|
|
25
|
+
*
|
|
26
|
+
* @param {GroupEmptyStateProps} props - Component props
|
|
27
|
+
* @param {string} props.message - Message to display
|
|
28
|
+
* @returns {JSX.Element} The empty state component
|
|
29
|
+
*/
|
|
30
|
+
export declare const GroupEmptyState: ({ message, }: GroupEmptyStateProps) => JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* Component to render all sections in a group
|
|
33
|
+
*
|
|
34
|
+
* @returns {JSX.Element} The sections component
|
|
35
|
+
*/
|
|
36
|
+
export declare const GroupSections: () => JSX.Element;
|
|
14
37
|
/**
|
|
15
38
|
* A page-level component that represents a Group view in the application.
|
|
16
39
|
*
|
|
@@ -19,9 +42,9 @@ export declare const useGroupContext: () => GroupContextType;
|
|
|
19
42
|
* loading, errors, and empty states, providing a complete page experience for
|
|
20
43
|
* viewing group content.
|
|
21
44
|
*
|
|
22
|
-
* @param
|
|
45
|
+
* @param {GroupProps} props - Component props
|
|
46
|
+
* @param {string} props.id - The unique identifier of the group to fetch and display
|
|
47
|
+
* @returns {JSX.Element|null} The rendered group or null if invalid ID
|
|
23
48
|
*/
|
|
24
49
|
declare const Group: ({ id }: GroupProps) => JSX.Element | null;
|
|
25
50
|
export default Group;
|
|
26
|
-
export declare const GroupSections: () => JSX.Element;
|
|
27
|
-
export declare const GroupEmptyState: ({ message, }: GroupEmptyStateProps) => JSX.Element;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
type PointsTileMediaProps = {
|
|
2
2
|
isFullSize: boolean;
|
|
3
3
|
};
|
|
4
|
+
/**
|
|
5
|
+
* Renders the media of a Points Tile.
|
|
6
|
+
*
|
|
7
|
+
* @returns JSX.Element or null if media is not present
|
|
8
|
+
*/
|
|
4
9
|
export declare const PointsTileMedia: ({ isFullSize, }: PointsTileMediaProps) => JSX.Element | null;
|
|
5
10
|
export {};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook that returns the styles for the PointsTile component.
|
|
4
|
+
* Applies responsive styling based on the current device.
|
|
5
|
+
*
|
|
6
|
+
* @returns StyleSheet styles for the PointsTile component
|
|
7
|
+
*/
|
|
2
8
|
export declare const usePointsTileStyles: (isFullSize?: boolean) => {
|
|
3
9
|
container: ViewStyle;
|
|
4
10
|
contentContainer: ViewStyle;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook that returns the styles for the RewardCategory component.
|
|
4
|
+
* Applies responsive styling based on the current device.
|
|
5
|
+
*
|
|
6
|
+
* @returns StyleSheet styles for the RewardCategory component
|
|
7
|
+
*/
|
|
2
8
|
export declare const useRewardCategoryTileStyles: () => ReturnType<typeof StyleSheet.create>;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
type RewardTileMediaProps = {
|
|
2
2
|
isArtworkOnly: boolean;
|
|
3
3
|
};
|
|
4
|
+
/**
|
|
5
|
+
* Renders the media for a Reward Tile.
|
|
6
|
+
*
|
|
7
|
+
* @param props {RewardTileMediaProps} - Component props
|
|
8
|
+
* @param props.isArtworkOnly {boolean} - Whether the media should be rendered as an artwork only component
|
|
9
|
+
* @returns JSX.Element or null if no artwork URL is present or artwork should not be shown
|
|
10
|
+
*/
|
|
4
11
|
export declare const RewardTileMedia: ({ isArtworkOnly, }: RewardTileMediaProps) => JSX.Element | null;
|
|
5
12
|
export {};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook that returns the styles for the RewardTile component.
|
|
4
|
+
* Applies responsive styling based on the current device.
|
|
5
|
+
*
|
|
6
|
+
* @returns StyleSheet styles for the RewardTile component
|
|
7
|
+
*/
|
|
2
8
|
export declare const useRewardTileStyles: () => ReturnType<typeof StyleSheet.create>;
|
|
@@ -13,10 +13,18 @@ type SectionProps = {
|
|
|
13
13
|
export declare const SectionContext: React.Context<SectionContextType | undefined>;
|
|
14
14
|
/**
|
|
15
15
|
* Custom hook to access the SectionContext.
|
|
16
|
+
*
|
|
17
|
+
* @returns {SectionContextType} The section context value
|
|
18
|
+
* @throws {Error} If used outside of a SectionProvider
|
|
16
19
|
*/
|
|
17
20
|
export declare const useSectionContext: () => SectionContextType;
|
|
18
21
|
/**
|
|
19
22
|
* The Section component renders a section based on its type (e.g., Banner, Grid).
|
|
23
|
+
*
|
|
24
|
+
* @param {SectionProps} props - Component props
|
|
25
|
+
* @param {TSection} [props.section] - The section data
|
|
26
|
+
* @param {string} [props.sectionId] - The ID of the section to fetch
|
|
27
|
+
* @returns {JSX.Element|null} The rendered section or null if invalid props
|
|
20
28
|
*/
|
|
21
29
|
declare const Section: ({ section, sectionId }: SectionProps) => JSX.Element | null;
|
|
22
30
|
export default Section;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook that returns the styles for the Section component.
|
|
4
|
+
* Applies responsive styling based on the current device.
|
|
5
|
+
*
|
|
6
|
+
* @returns StyleSheet styles for the Section component
|
|
7
|
+
*/
|
|
2
8
|
export declare const useSectionStyles: () => ReturnType<typeof StyleSheet.create>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import { TGroup } from '../types/group';
|
|
2
|
+
import { WithChildren } from '../types/helpers';
|
|
3
3
|
import { NavigationConfig } from '../types/navigation';
|
|
4
4
|
import { TSection } from '../types/section';
|
|
5
5
|
import { BaseThemeObject, ThemeContextType } from '../types/theme';
|
|
@@ -24,8 +24,7 @@ type WllSdkContextType = ThemeContextType & {
|
|
|
24
24
|
} & Readonly<{
|
|
25
25
|
readonly config: SDKConfig;
|
|
26
26
|
}>;
|
|
27
|
-
type WllSdkProviderProps = {
|
|
28
|
-
children: ReactNode;
|
|
27
|
+
type WllSdkProviderProps = WithChildren & {
|
|
29
28
|
theme?: Partial<BaseThemeObject>;
|
|
30
29
|
config: SDKConfig;
|
|
31
30
|
navigationConfig?: NavigationConfig;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Makes a configuration type with required and optional fields,
|
|
3
|
+
* providing default values for optional fields.
|
|
4
|
+
*/
|
|
5
|
+
export type SafeConfig<T, R extends keyof T> = Required<Pick<T, R>> & Partial<Omit<T, R>>;
|
|
6
|
+
/**
|
|
7
|
+
* Adds optional children to any component props.
|
|
8
|
+
*/
|
|
9
|
+
export type WithChildren<T = {}> = T & {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export type DimensionMode = 'desktop' | 'tablet' | 'mobile';
|
|
2
|
-
export
|
|
2
|
+
export type WindowDimensions = {
|
|
3
3
|
width: number;
|
|
4
4
|
height: number;
|
|
5
|
-
}
|
|
6
|
-
export
|
|
5
|
+
};
|
|
6
|
+
export type ResponsiveContextType = {
|
|
7
7
|
dimensionMode: DimensionMode;
|
|
8
8
|
isTablet: boolean;
|
|
9
9
|
isMobile: boolean;
|
|
10
10
|
isDesktop: boolean;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import { sizes } from '../utils/styling';
|
|
2
|
+
import { WithChildren } from './helpers';
|
|
3
3
|
import { BadgeTileType } from './tile';
|
|
4
4
|
export type PercentageKey = 5 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 95;
|
|
5
5
|
export type DerivedColors = {
|
|
@@ -37,8 +37,7 @@ export type ThemeContextType = {
|
|
|
37
37
|
theme: ThemeObject;
|
|
38
38
|
setTheme: (theme: ThemeObject) => void;
|
|
39
39
|
};
|
|
40
|
-
export type ThemeProviderProps = {
|
|
41
|
-
children: ReactNode;
|
|
40
|
+
export type ThemeProviderProps = WithChildren & {
|
|
42
41
|
theme?: Partial<BaseThemeObject>;
|
|
43
42
|
};
|
|
44
43
|
export type Variant = 'primary' | 'accent' | 'positive' | 'negative';
|
|
@@ -155,4 +155,8 @@ export type Tile = {
|
|
|
155
155
|
};
|
|
156
156
|
declare const getConfigForTileType: (tileType: TileType) => typeof BannerTileConfig | typeof PointsTileConfig | typeof ContentTileConfig | typeof RewardTileConfig | typeof BadgeTileConfig | typeof RewardCategoryTileConfig | typeof TierTileConfig;
|
|
157
157
|
export type TileConfig = InstanceType<ReturnType<typeof getConfigForTileType>>;
|
|
158
|
+
export type TileSizeInfo = {
|
|
159
|
+
isFullSize: boolean;
|
|
160
|
+
isHalfSize: boolean;
|
|
161
|
+
};
|
|
158
162
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TileSizeInfo } from '../types/tile';
|
|
2
|
+
/**
|
|
3
|
+
* Utility function that checks if a component context and its configuration exist.
|
|
4
|
+
* Works for both tile contexts and banner contexts.
|
|
5
|
+
*
|
|
6
|
+
* @param context - The component context to validate (tileContext or bannerContext)
|
|
7
|
+
* @returns `true` if both the context and its configuration exist, otherwise `false`
|
|
8
|
+
*/
|
|
9
|
+
export declare function isContextValid(context: any): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a tile's content should be hidden based on its size and artwork configuration.
|
|
12
|
+
*
|
|
13
|
+
* @param {TileSizeInfo | null} sizeInfo - The size information for the tile
|
|
14
|
+
* @param {string | null | undefined} artworkUrl - The URL of the tile's artwork
|
|
15
|
+
* @returns {boolean} True if the content should be hidden, false otherwise
|
|
16
|
+
*/
|
|
17
|
+
export declare const shouldHideContentForHalfTile: (sizeInfo: TileSizeInfo | null, artworkUrl?: string | null) => boolean;
|