@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
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactNode } from 'react';
|
|
3
1
|
import * as LucideIcons from 'lucide-react';
|
|
4
2
|
import * as react_native from 'react-native';
|
|
5
3
|
import { ViewProps, ImageSourcePropType, StyleProp, ViewStyle, TextProps as TextProps$1, TextStyle, ImageProps } from 'react-native';
|
|
4
|
+
import * as React$1 from 'react';
|
|
5
|
+
import React__default from 'react';
|
|
6
6
|
|
|
7
7
|
declare const sizes: {
|
|
8
8
|
readonly borderRadiusSm: 15;
|
|
@@ -22,6 +22,13 @@ declare const sizes: {
|
|
|
22
22
|
readonly xxxxxl: 60;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Adds optional children to any component props.
|
|
27
|
+
*/
|
|
28
|
+
type WithChildren<T = {}> = T & {
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
};
|
|
31
|
+
|
|
25
32
|
type Badge = {
|
|
26
33
|
id: string;
|
|
27
34
|
name: string;
|
|
@@ -238,6 +245,10 @@ type Tile = {
|
|
|
238
245
|
};
|
|
239
246
|
declare const getConfigForTileType: (tileType: TileType) => typeof BannerTileConfig | typeof PointsTileConfig | typeof ContentTileConfig | typeof RewardTileConfig | typeof BadgeTileConfig | typeof RewardCategoryTileConfig | typeof TierTileConfig;
|
|
240
247
|
type TileConfig = InstanceType<ReturnType<typeof getConfigForTileType>>;
|
|
248
|
+
type TileSizeInfo = {
|
|
249
|
+
isFullSize: boolean;
|
|
250
|
+
isHalfSize: boolean;
|
|
251
|
+
};
|
|
241
252
|
|
|
242
253
|
type PercentageKey = 5 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 95;
|
|
243
254
|
type DerivedColors = {
|
|
@@ -275,8 +286,7 @@ type ThemeContextType = {
|
|
|
275
286
|
theme: ThemeObject;
|
|
276
287
|
setTheme: (theme: ThemeObject) => void;
|
|
277
288
|
};
|
|
278
|
-
type ThemeProviderProps = {
|
|
279
|
-
children: ReactNode;
|
|
289
|
+
type ThemeProviderProps = WithChildren & {
|
|
280
290
|
theme?: Partial<BaseThemeObject>;
|
|
281
291
|
};
|
|
282
292
|
type Variant = 'primary' | 'accent' | 'positive' | 'negative';
|
|
@@ -340,26 +350,24 @@ type BaseBannerProps = {
|
|
|
340
350
|
};
|
|
341
351
|
declare const BaseBanner: React__default.FC<BaseBannerProps>;
|
|
342
352
|
|
|
343
|
-
type BaseTileProps = {
|
|
353
|
+
type BaseTileProps = WithChildren & {
|
|
344
354
|
tile: Tile;
|
|
345
|
-
children: ReactNode;
|
|
346
355
|
style?: ViewStyle;
|
|
347
356
|
};
|
|
348
|
-
type BaseTileRootProps = {
|
|
349
|
-
children: ReactNode;
|
|
357
|
+
type BaseTileRootProps = WithChildren & {
|
|
350
358
|
style?: ViewStyle;
|
|
351
359
|
};
|
|
352
360
|
/**
|
|
353
361
|
* BaseTile component with subcomponents attached.
|
|
354
362
|
*/
|
|
355
|
-
declare const BaseTile: (({ tile, children }: BaseTileProps) => JSX.Element) & {
|
|
363
|
+
declare const BaseTile: (({ tile, children, style, }: BaseTileProps) => JSX.Element | null) & {
|
|
356
364
|
Container: ({ children, style, }: BaseTileRootProps) => JSX.Element;
|
|
357
365
|
Media: (props: ImagePropsNoSource) => JSX.Element | null;
|
|
358
366
|
Content: ({ children, }: {
|
|
359
|
-
children
|
|
367
|
+
children?: React.ReactNode;
|
|
360
368
|
}) => JSX.Element | null;
|
|
361
369
|
Header: ({ children, }: {
|
|
362
|
-
children
|
|
370
|
+
children?: React.ReactNode;
|
|
363
371
|
}) => JSX.Element | null;
|
|
364
372
|
Title: () => JSX.Element | null;
|
|
365
373
|
Body: (props: Omit<react_native.TextProps, "style"> & {
|
|
@@ -371,13 +379,13 @@ declare const BaseTile: (({ tile, children }: BaseTileProps) => JSX.Element) & {
|
|
|
371
379
|
|
|
372
380
|
declare const Indicator: () => JSX.Element;
|
|
373
381
|
|
|
374
|
-
|
|
382
|
+
type SkeletonProps = {
|
|
375
383
|
width?: number | `${number}%`;
|
|
376
384
|
height?: number | `${number}%`;
|
|
377
385
|
borderRadius?: number;
|
|
378
386
|
style?: ViewStyle;
|
|
379
387
|
numberOfSquares?: number;
|
|
380
|
-
}
|
|
388
|
+
};
|
|
381
389
|
declare const Skeleton: ({ style, numberOfSquares, }: SkeletonProps) => JSX.Element;
|
|
382
390
|
|
|
383
391
|
type TileContainerProps = {
|
|
@@ -580,7 +588,9 @@ type GroupProps = {
|
|
|
580
588
|
* loading, errors, and empty states, providing a complete page experience for
|
|
581
589
|
* viewing group content.
|
|
582
590
|
*
|
|
583
|
-
* @param
|
|
591
|
+
* @param {GroupProps} props - Component props
|
|
592
|
+
* @param {string} props.id - The unique identifier of the group to fetch and display
|
|
593
|
+
* @returns {JSX.Element|null} The rendered group or null if invalid ID
|
|
584
594
|
*/
|
|
585
595
|
declare const Group: ({ id }: GroupProps) => JSX.Element | null;
|
|
586
596
|
|
|
@@ -605,6 +615,11 @@ type SectionProps = {
|
|
|
605
615
|
};
|
|
606
616
|
/**
|
|
607
617
|
* The Section component renders a section based on its type (e.g., Banner, Grid).
|
|
618
|
+
*
|
|
619
|
+
* @param {SectionProps} props - Component props
|
|
620
|
+
* @param {TSection} [props.section] - The section data
|
|
621
|
+
* @param {string} [props.sectionId] - The ID of the section to fetch
|
|
622
|
+
* @returns {JSX.Element|null} The rendered section or null if invalid props
|
|
608
623
|
*/
|
|
609
624
|
declare const Section: ({ section, sectionId }: SectionProps) => JSX.Element | null;
|
|
610
625
|
|
|
@@ -658,8 +673,7 @@ type WllSdkContextType = ThemeContextType & {
|
|
|
658
673
|
} & Readonly<{
|
|
659
674
|
readonly config: SDKConfig;
|
|
660
675
|
}>;
|
|
661
|
-
type WllSdkProviderProps = {
|
|
662
|
-
children: ReactNode;
|
|
676
|
+
type WllSdkProviderProps = WithChildren & {
|
|
663
677
|
theme?: Partial<BaseThemeObject>;
|
|
664
678
|
config: SDKConfig;
|
|
665
679
|
navigationConfig?: NavigationConfig;
|
|
@@ -667,4 +681,4 @@ type WllSdkProviderProps = {
|
|
|
667
681
|
declare const WllSdkProvider: ({ children, theme: providedTheme, config, navigationConfig, }: WllSdkProviderProps) => JSX.Element;
|
|
668
682
|
declare const useWllSdk: () => WllSdkContextType;
|
|
669
683
|
|
|
670
|
-
export { type APIResponse, type Align, type Availability, type Badge, type BadgeDetail, _default$5 as BadgeTile, BadgeTileConfig, BadgeTileType, _default$4 as BannerTile, BannerTileConfig, BaseBanner, type BaseThemeObject, BaseTile, Button, CTALinkTarget, Carousel, Column, _default$3 as ContentTile, ContentTileConfig, type DerivedColors, type DerivedProperties, type DesaturationType, type FlexDirection, FullFlex, Grid, Group, Icon, type ImagePropsNoSource, Indicator, type Justify, Layout, type LayoutProps$1 as LayoutProps, LoadingIndicator, type NavigationConfig, type NavigationType, type PercentageKey, _default$2 as PointsTile, PointsTileConfig, type ProgessType, ProgressBar, ProgressIndicator, ProgressType, ProgressiveImage, Reward, type RewardCategory, _default$1 as RewardCategoryTile, RewardCategoryTileConfig, _default as RewardTile, RewardTileConfig, Row, type SDKConfig, Section, SectionHeader, SectionType, type Size, Skeleton, Spacer, type TGroup, type TSection, Text, type ThemeContextType, type ThemeObject, type ThemeProviderProps, TierTileConfig, TierTileType, TierTile as TierTileUpdated, type TierType, type Tile, type TileConfig, TileContainer, TileHeight, TileType, type Variant, WllSdkProvider, alignMap, justifyMap, useWllSdk };
|
|
684
|
+
export { type APIResponse, type Align, type Availability, type Badge, type BadgeDetail, _default$5 as BadgeTile, BadgeTileConfig, BadgeTileType, _default$4 as BannerTile, BannerTileConfig, BaseBanner, type BaseThemeObject, BaseTile, Button, CTALinkTarget, Carousel, Column, _default$3 as ContentTile, ContentTileConfig, type DerivedColors, type DerivedProperties, type DesaturationType, type FlexDirection, FullFlex, Grid, Group, Icon, type ImagePropsNoSource, Indicator, type Justify, Layout, type LayoutProps$1 as LayoutProps, LoadingIndicator, type NavigationConfig, type NavigationType, type PercentageKey, _default$2 as PointsTile, PointsTileConfig, type ProgessType, ProgressBar, ProgressIndicator, ProgressType, ProgressiveImage, Reward, type RewardCategory, _default$1 as RewardCategoryTile, RewardCategoryTileConfig, _default as RewardTile, RewardTileConfig, Row, type SDKConfig, Section, SectionHeader, SectionType, type Size, Skeleton, Spacer, type TGroup, type TSection, Text, type ThemeContextType, type ThemeObject, type ThemeProviderProps, TierTileConfig, TierTileType, TierTile as TierTileUpdated, type TierType, type Tile, type TileConfig, TileContainer, TileHeight, type TileSizeInfo, TileType, type Variant, WllSdkProvider, alignMap, justifyMap, useWllSdk };
|