@wlloyalty/wll-react-sdk 1.0.61 → 1.0.62

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 (49) hide show
  1. package/dist/index.d.ts +24 -14
  2. package/dist/native.js +582 -250
  3. package/dist/native.js.map +1 -1
  4. package/dist/types/components/atoms/BaseTile/base-tile-body.d.ts +6 -0
  5. package/dist/types/components/atoms/BaseTile/base-tile-content.d.ts +11 -4
  6. package/dist/types/components/atoms/BaseTile/base-tile-header.d.ts +11 -4
  7. package/dist/types/components/atoms/BaseTile/base-tile-media.d.ts +6 -0
  8. package/dist/types/components/atoms/BaseTile/base-tile-title.d.ts +5 -0
  9. package/dist/types/components/atoms/BaseTile/index.d.ts +9 -8
  10. package/dist/types/components/atoms/BaseTile/styles.d.ts +27 -0
  11. package/dist/types/components/organisms/BadgeTile/badge-tile-date-earned.d.ts +5 -0
  12. package/dist/types/components/organisms/BadgeTile/badge-tile-description.d.ts +5 -0
  13. package/dist/types/components/organisms/BadgeTile/badge-tile-media.d.ts +5 -0
  14. package/dist/types/components/organisms/BadgeTile/badge-tile-status.d.ts +5 -0
  15. package/dist/types/components/organisms/BadgeTile/badge-tile-title.d.ts +5 -0
  16. package/dist/types/components/organisms/BadgeTile/styles.d.ts +6 -0
  17. package/dist/types/components/organisms/BannerTile/banner-tile-cta.d.ts +5 -0
  18. package/dist/types/components/organisms/BannerTile/banner-tile-description.d.ts +5 -0
  19. package/dist/types/components/organisms/BannerTile/banner-tile-media.d.ts +5 -0
  20. package/dist/types/components/organisms/BannerTile/banner-tile-title.d.ts +5 -0
  21. package/dist/types/components/organisms/BannerTile/styles.d.ts +6 -0
  22. package/dist/types/components/organisms/ContentTile/content-tile-container.d.ts +2 -4
  23. package/dist/types/components/organisms/ContentTile/content-tile-content.d.ts +2 -4
  24. package/dist/types/components/organisms/ContentTile/index.d.ts +2 -6
  25. package/dist/types/components/organisms/ContentTile/styles.d.ts +6 -0
  26. package/dist/types/components/organisms/Group/index.d.ts +26 -3
  27. package/dist/types/components/organisms/PointsTile/points-tile-formatted-points.d.ts +5 -0
  28. package/dist/types/components/organisms/PointsTile/points-tile-media.d.ts +5 -0
  29. package/dist/types/components/organisms/PointsTile/points-tile-title.d.ts +5 -0
  30. package/dist/types/components/organisms/PointsTile/styles.d.ts +6 -0
  31. package/dist/types/components/organisms/RewardCategoryTile/reward-category-header.d.ts +5 -0
  32. package/dist/types/components/organisms/RewardCategoryTile/reward-category-media.d.ts +5 -0
  33. package/dist/types/components/organisms/RewardCategoryTile/styles.d.ts +6 -0
  34. package/dist/types/components/organisms/RewardTile/index.d.ts +6 -1
  35. package/dist/types/components/organisms/RewardTile/reward-tile-chevron.d.ts +5 -0
  36. package/dist/types/components/organisms/RewardTile/reward-tile-media.d.ts +7 -0
  37. package/dist/types/components/organisms/RewardTile/reward-tile-points.d.ts +5 -0
  38. package/dist/types/components/organisms/RewardTile/reward-tile-summary.d.ts +5 -0
  39. package/dist/types/components/organisms/RewardTile/reward-tile-title.d.ts +5 -0
  40. package/dist/types/components/organisms/RewardTile/styles.d.ts +6 -0
  41. package/dist/types/components/organisms/Section/index.d.ts +8 -0
  42. package/dist/types/components/organisms/Section/styles.d.ts +6 -0
  43. package/dist/types/context/WllSdkContext.d.ts +2 -3
  44. package/dist/types/types/helpers.d.ts +11 -0
  45. package/dist/types/types/theme.d.ts +2 -3
  46. package/dist/types/utils/contextHelpers.d.ts +8 -0
  47. package/dist/web.js +582 -250
  48. package/dist/web.js.map +1 -1
  49. 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 { ReactNode } from 'react';
2
- export declare const BaseTileContent: ({ children, }: {
3
- children: ReactNode;
4
- }) => JSX.Element | null;
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 { ReactNode } from 'react';
2
- export declare const BaseTileHeader: ({ children, }: {
3
- children: ReactNode;
4
- }) => JSX.Element | null;
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 +1,6 @@
1
+ /**
2
+ * Renders the title of a BaseTile component.
3
+ *
4
+ * @returns {JSX.Element|null} The rendered title or null if conditions for display are not met
5
+ */
1
6
  export declare const BaseTileTitle: () => 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: React.ReactNode;
25
+ children?: React.ReactNode;
25
26
  }) => JSX.Element | null;
26
27
  Header: ({ children, }: {
27
- children: React.ReactNode;
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 +1,6 @@
1
+ /**
2
+ * Renders the date earned for a Badge Tile.
3
+ *
4
+ * @returns JSX.Element or null if badge is not earned or badgeNotEarnedMessage exists
5
+ */
1
6
  export declare const BadgeTileDateEarned: () => JSX.Element | null;
@@ -1 +1,6 @@
1
+ /**
2
+ * Renders the description for a Badge Tile.
3
+ *
4
+ * @returns JSX.Element or null if description is not present
5
+ */
1
6
  export declare const BadgeTileDescription: () => JSX.Element | null;
@@ -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 +1,6 @@
1
+ /**
2
+ * Renders the status for a Badge Tile.
3
+ *
4
+ * @returns JSX.Element or null if badge is not earned or badgeNotEarnedMessage exists
5
+ */
1
6
  export declare const BadgeTileStatus: () => JSX.Element | null;
@@ -1 +1,6 @@
1
+ /**
2
+ * Renders the title for a Badge Tile.
3
+ *
4
+ * @returns JSX.Element or null if name is not present
5
+ */
1
6
  export declare const BadgeTileTitle: () => 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 +1,6 @@
1
+ /**
2
+ * Renders the call to action of a Banner Tile.
3
+ *
4
+ * @returns JSX.Element or null if no text or required props are present
5
+ */
1
6
  export declare const BannerTileCTA: () => JSX.Element | null;
@@ -1 +1,6 @@
1
+ /**
2
+ * Renders the description text of a Banner Tile.
3
+ *
4
+ * @returns JSX.Element or null if no description is present
5
+ */
1
6
  export declare const BannerTileDescription: () => JSX.Element | null;
@@ -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 +1,6 @@
1
+ /**
2
+ * Renders the title of a Banner Tile.
3
+ *
4
+ * @returns JSX.Element or null if no title is present
5
+ */
1
6
  export declare const BannerTileTitle: () => JSX.Element | null;
@@ -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 { ReactNode } from 'react';
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 { ReactNode } from 'react';
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 id - The unique identifier of the group to fetch and display.
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 +1,6 @@
1
+ /**
2
+ * Renders formatted points value for a Points Tile.
3
+ *
4
+ * @returns JSX.Element or null if points are undefined or zero
5
+ */
1
6
  export declare const PointsTileFormattedPoints: () => JSX.Element | null;
@@ -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 +1,6 @@
1
+ /**
2
+ * Renders the title of a Points Tile.
3
+ *
4
+ * @returns JSX.Element or null if no title is present
5
+ */
1
6
  export declare const PointsTileTitle: () => JSX.Element | null;
@@ -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 +1,6 @@
1
+ /**
2
+ * Renders the header for a Reward Category Tile.
3
+ *
4
+ * @returns JSX.Element or null if showName is false or name is not present
5
+ */
1
6
  export declare const RewardCategoryHeader: () => JSX.Element | null;
@@ -1 +1,6 @@
1
+ /**
2
+ * Renders the background media for a Reward Category Tile.
3
+ *
4
+ * @returns JSX.Element or null if no artwork URL is present
5
+ */
1
6
  export declare const RewardCategoryMedia: () => JSX.Element | null;
@@ -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>;
@@ -12,7 +12,12 @@ export declare const RewardTile: (({ tile }: RewardTileProps) => JSX.Element | n
12
12
  }) => JSX.Element | null;
13
13
  Title: () => JSX.Element | null;
14
14
  Summary: () => JSX.Element | null;
15
- Points: () => JSX.Element | null;
15
+ Points: () => JSX.Element /**
16
+ * Helper function to determine if the tile should display artwork only.
17
+ *
18
+ * @param configuration - The configuration object of the tile.
19
+ * @returns `true` if the tile should display artwork only.
20
+ */ | null;
16
21
  Chevron: () => JSX.Element;
17
22
  };
18
23
  declare const _default: (props: Omit<RewardTileProps, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps) => React.JSX.Element;
@@ -1 +1,6 @@
1
+ /**
2
+ * Renders a chevron icon for a Reward Tile.
3
+ *
4
+ * @returns JSX.Element
5
+ */
1
6
  export declare const RewardTileChevron: () => JSX.Element;
@@ -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 +1,6 @@
1
+ /**
2
+ * Renders the points value of a Reward Tile.
3
+ *
4
+ * @returns JSX.Element or null if price should not be shown or is zero/undefined
5
+ */
1
6
  export declare const RewardTilePoints: () => JSX.Element | null;
@@ -1 +1,6 @@
1
+ /**
2
+ * Renders the summary of a Reward Tile.
3
+ *
4
+ * @returns JSX.Element or null if no summary is present
5
+ */
1
6
  export declare const RewardTileSummary: () => JSX.Element | null;
@@ -1 +1,6 @@
1
+ /**
2
+ * Renders the title of a Reward Tile.
3
+ *
4
+ * @returns JSX.Element or null if no name is present
5
+ */
1
6
  export declare const RewardTileTitle: () => JSX.Element | null;
@@ -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,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';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Utility function that checks if a component context and its configuration exist.
3
+ * Works for both tile contexts and banner contexts.
4
+ *
5
+ * @param context - The component context to validate (tileContext or bannerContext)
6
+ * @returns `true` if both the context and its configuration exist, otherwise `false`
7
+ */
8
+ export declare function isContextValid(context: any): boolean;