@wlloyalty/wll-react-sdk 1.0.42 → 1.0.44

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 CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { ReactNode, FC } from 'react';
3
- import { ViewStyle, ImageSourcePropType, StyleProp, View, TextProps as TextProps$1, TextStyle, ImageProps } from 'react-native';
2
+ import React__default, { ReactNode } from 'react';
4
3
  import * as LucideIcons from 'lucide-react';
4
+ import * as react_native from 'react-native';
5
+ import { ImageSourcePropType, StyleProp, ViewStyle, View, TextProps as TextProps$1, TextStyle, ImageProps } from 'react-native';
5
6
 
6
7
  declare const sizes: {
7
8
  readonly borderRadiusSm: 15;
@@ -69,19 +70,7 @@ type ButtonProps = {
69
70
  onPress: () => void;
70
71
  variant: Variant;
71
72
  };
72
- declare const Button: React$1.FC<ButtonProps>;
73
-
74
- type Justify$1 = 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
75
- type Align$1 = 'start' | 'end' | 'center' | 'stretch';
76
- type ColumnProps = {
77
- children: React$1.ReactNode;
78
- justify?: Justify$1;
79
- align?: Align$1;
80
- direction?: FlexDirection$1;
81
- style?: ViewStyle;
82
- };
83
- type FlexDirection$1 = 'column' | 'row' | 'column-reverse' | 'row-reverse';
84
- declare const Column$1: React$1.FC<ColumnProps>;
73
+ declare const Button: ({ title, onPress, variant }: ButtonProps) => JSX.Element;
85
74
 
86
75
  type IconName = keyof typeof LucideIcons;
87
76
  type IconProps = {
@@ -90,7 +79,39 @@ type IconProps = {
90
79
  size?: number;
91
80
  strokeWidth?: number;
92
81
  };
93
- declare const Icon: React$1.FC<IconProps>;
82
+ declare const Icon: ({ name, color, size, strokeWidth, ...props }: IconProps) => JSX.Element | null;
83
+
84
+ declare const LoadingIndicator: () => JSX.Element;
85
+
86
+ type ProgressBarProps = {
87
+ percentage: number;
88
+ variant?: Variant;
89
+ height?: Size;
90
+ animationDuration?: number;
91
+ };
92
+ declare const ProgressBar: ({ percentage, variant, height, animationDuration, }: ProgressBarProps) => JSX.Element;
93
+
94
+ type ProgressiveImageProps = {
95
+ source: ImageSourcePropType;
96
+ style?: StyleProp<ViewStyle>;
97
+ isDesaturated?: boolean;
98
+ [key: string]: any;
99
+ };
100
+ declare const ProgressiveImage: ({ source, style, isDesaturated, ...props }: ProgressiveImageProps) => JSX.Element;
101
+
102
+ type RowHeaderProps = {
103
+ children: React$1.ReactNode;
104
+ className?: string;
105
+ } & React$1.ComponentProps<typeof View>;
106
+ declare const RowHeader: ({ children, style, ...props }: RowHeaderProps) => JSX.Element;
107
+
108
+ type TextVariant = 'eyebrow' | 'title' | 'description' | 'body' | 'caption' | 'label' | 'tier-requirement' | 'tier-earned';
109
+ type TextProps = TextProps$1 & {
110
+ variant?: TextVariant;
111
+ style?: TextStyle;
112
+ isSurface?: boolean;
113
+ };
114
+ declare const Text: ({ variant, style, isSurface, ...props }: TextProps) => JSX.Element;
94
115
 
95
116
  type Badge = {
96
117
  id: string;
@@ -308,72 +329,42 @@ type Tile = {
308
329
  declare const getConfigForTileType: (tileType: TileType) => typeof BannerTileConfig | typeof PointsTileConfig | typeof ContentTileConfig | typeof RewardTileConfig | typeof BadgeTileConfig | typeof RewardCategoryTileConfig | typeof TierTileConfig;
309
330
  type TileConfig = InstanceType<ReturnType<typeof getConfigForTileType>>;
310
331
 
311
- type LoadingIndicatorProps = {
312
- tile: Tile;
313
- };
314
- declare const LoadingIndicator: React$1.FC<LoadingIndicatorProps>;
315
-
316
- type ProgressBarProps = {
317
- percentage: number;
318
- variant?: Variant;
319
- height?: Size;
320
- animationDuration?: number;
321
- };
322
- declare const ProgressBar: React$1.FC<ProgressBarProps>;
323
-
324
- type ProgressiveImageProps = {
325
- source: ImageSourcePropType;
326
- style?: StyleProp<ViewStyle>;
327
- isDesaturated?: boolean;
328
- [key: string]: any;
329
- };
330
- declare const ProgressiveImage: React__default.FC<ProgressiveImageProps>;
331
-
332
- type RowHeaderProps = {
333
- children: React$1.ReactNode;
334
- className?: string;
335
- } & React$1.ComponentProps<typeof View>;
336
- declare const RowHeader: React$1.FC<RowHeaderProps>;
337
-
338
- type TextVariant = 'eyebrow' | 'title' | 'description' | 'body' | 'caption' | 'label' | 'tier-requirement' | 'tier-earned';
339
- type TextProps = TextProps$1 & {
340
- variant?: TextVariant;
341
- style?: TextStyle;
342
- isSurface?: boolean;
343
- };
344
- declare const Text: React$1.FC<TextProps>;
345
-
346
332
  type BaseBannerProps = {
347
333
  tile: Tile;
348
- children: React$1.ReactNode;
334
+ children: React__default.ReactNode;
349
335
  };
350
- declare const BaseBanner: React$1.FC<BaseBannerProps>;
351
-
352
- type ImagePropsNoSource = Omit<ImageProps, 'source'>;
336
+ declare const BaseBanner: ({ tile, children }: BaseBannerProps) => JSX.Element;
353
337
 
354
338
  type BaseTileProps = {
355
339
  tile: Tile;
356
340
  children: ReactNode;
357
341
  style?: ViewStyle;
358
342
  };
359
- type BaseTileComponent = FC<BaseTileProps> & {
360
- Root: FC<{
361
- children: ReactNode;
362
- style?: ViewStyle;
363
- }>;
364
- Media: FC<ImagePropsNoSource>;
365
- Content: FC<{
366
- children: ReactNode;
343
+ type BaseTileRootProps = {
344
+ children: ReactNode;
345
+ style?: ViewStyle;
346
+ };
347
+ /**
348
+ * BaseTile component with subcomponents attached.
349
+ */
350
+ declare const BaseTile: (({ tile, children }: BaseTileProps) => JSX.Element) & {
351
+ Root: ({ children, style }: BaseTileRootProps) => JSX.Element;
352
+ Media: React__default.FC<ImagePropsNoSource>;
353
+ Content: React__default.FC<{
354
+ children: React__default.ReactNode;
367
355
  }>;
368
- Header: FC<{
369
- children?: ReactNode;
356
+ Header: React__default.FC<{
357
+ children?: React__default.ReactNode;
370
358
  }>;
371
- Title: FC;
372
- Body: FC;
359
+ Title: React__default.FC;
360
+ Body: (props: Omit<react_native.TextProps, "style"> & {
361
+ variant?: "eyebrow" | "title" | "description" | "body" | "caption" | "label" | "tier-requirement" | "tier-earned";
362
+ isSurface?: boolean;
363
+ style?: react_native.TextStyle;
364
+ }) => React__default.JSX.Element | null;
373
365
  };
374
- declare const BaseTile: BaseTileComponent;
375
366
 
376
- declare const Indicator: () => React__default.JSX.Element;
367
+ declare const Indicator: () => JSX.Element;
377
368
 
378
369
  interface SkeletonProps {
379
370
  width?: number | `${number}%`;
@@ -382,24 +373,17 @@ interface SkeletonProps {
382
373
  style?: ViewStyle;
383
374
  numberOfSquares?: number;
384
375
  }
385
- declare const Skeleton: React$1.FC<SkeletonProps>;
376
+ declare const Skeleton: ({ style, numberOfSquares, }: SkeletonProps) => JSX.Element;
386
377
 
387
378
  type TileContainerProps = {
388
379
  tiles: Tile[];
389
380
  };
390
- declare const TileContainer: React$1.FC<TileContainerProps>;
391
-
392
- declare const Column: FC<LayoutProps>;
393
-
394
- declare const Row: FC<LayoutProps>;
395
-
396
- type FlexBoxProps = {
397
- children: React__default.ReactNode;
398
- };
399
- declare const FlexBox: ({ children }: FlexBoxProps) => React__default.JSX.Element;
400
-
401
- declare const Stack: React.FC<LayoutProps>;
381
+ /**
382
+ * TileContainer component to render a list of tiles with proper layout and spacing.
383
+ */
384
+ declare const TileContainer: ({ tiles }: TileContainerProps) => JSX.Element;
402
385
 
386
+ type ImagePropsNoSource = Omit<ImageProps, 'source'>;
403
387
  type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
404
388
  type Justify = 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
405
389
  type Align = 'start' | 'end' | 'center' | 'stretch' | 'baseline';
@@ -410,6 +394,82 @@ type LayoutProps = {
410
394
  direction?: FlexDirection;
411
395
  style?: ViewStyle;
412
396
  };
397
+ declare const justifyMap: Record<Justify, ViewStyle['justifyContent']>;
398
+ declare const alignMap: Record<Align, ViewStyle['alignItems']>;
399
+
400
+ type FlexProps = {
401
+ justify?: Justify;
402
+ align?: Align;
403
+ style?: ViewStyle;
404
+ };
405
+ type ColumnLayoutProps = FlexProps & {
406
+ children?: React__default.ReactNode;
407
+ };
408
+ /**
409
+ * A Column layout component that arranges its children in a vertical stack.
410
+ *
411
+ * @param children - The child components to render inside the column.
412
+ * @param justify - Defines how children are aligned along the main axis.
413
+ * @param align - Defines how children are aligned along the cross axis.
414
+ * @param style - Additional styles to apply to the container.
415
+ */
416
+ declare const Column: React__default.MemoExoticComponent<({ children, justify, align, style, }: ColumnLayoutProps) => JSX.Element>;
417
+
418
+ /**
419
+ * Props for the FlexBox component.
420
+ *
421
+ * @param children - The child components to render inside the flex container.
422
+ * @param style - Optional custom styles to apply to the container.
423
+ */
424
+ type FlexBoxProps = {
425
+ children: React__default.ReactNode;
426
+ style?: ViewStyle;
427
+ };
428
+ /**
429
+ * A FlexBox component that provides a flexible container with `flex: 1`.
430
+ *
431
+ * This component is commonly used to create a full-flex container that expands
432
+ * to fill available space in a layout.
433
+ */
434
+ declare const FlexBox: ({ children, style }: FlexBoxProps) => JSX.Element;
435
+
436
+ /**
437
+ * A Row layout component that arranges its children in a horizontal stack.
438
+ *
439
+ * @param children - The child components to render inside the row.
440
+ * @param justify - Defines how children are aligned along the main axis (horizontal).
441
+ * @param align - Defines how children are aligned along the cross axis (vertical).
442
+ * @param direction - The flex direction for the row (default is 'row').
443
+ * @param style - Additional styles to apply to the container.
444
+ */
445
+ declare const Row: ({ children, justify, align, direction, style, }: LayoutProps) => JSX.Element;
446
+
447
+ /**
448
+ * Props for the Spacer component.
449
+ *
450
+ * @param style - Optional custom styles to apply to the spacer.
451
+ */
452
+ type SpacerProps = {
453
+ style?: ViewStyle;
454
+ };
455
+ /**
456
+ * A simple Spacer component that creates flexible space in layouts.
457
+ *
458
+ * The Spacer is commonly used in flexbox layouts to create adjustable empty space
459
+ * between child elements, avoiding the need for explicit margins or padding.
460
+ */
461
+ declare const Spacer: ({ style }: SpacerProps) => JSX.Element;
462
+
463
+ /**
464
+ * A Stack layout component that arranges its children in a flexible stack.
465
+ *
466
+ * @param children - The child components to render inside the stack.
467
+ * @param justify - Defines how children are aligned along the main axis.
468
+ * @param align - Defines how children are aligned along the cross axis.
469
+ * @param direction - The flex direction for the stack (default is 'column').
470
+ * @param style - Additional styles to apply to the container.
471
+ */
472
+ declare const Stack: ({ children, justify, align, direction, style, }: LayoutProps) => JSX.Element;
413
473
 
414
474
  declare enum SectionType {
415
475
  Grid = "GRID",
@@ -437,12 +497,12 @@ type TSection = {
437
497
  type CarouselProps = {
438
498
  section: TSection;
439
499
  };
440
- declare const Carousel: React__default.FC<CarouselProps>;
500
+ declare const Carousel: ({ section }: CarouselProps) => JSX.Element;
441
501
 
442
502
  type GridProps = {
443
503
  section: TSection;
444
504
  };
445
- declare const Grid: React$1.FC<GridProps>;
505
+ declare const Grid: ({ section }: GridProps) => React__default.JSX.Element;
446
506
 
447
507
  type ProgressIndicatorProps = {
448
508
  currentPoints: number;
@@ -451,13 +511,13 @@ type ProgressIndicatorProps = {
451
511
  height?: Size;
452
512
  attained?: boolean;
453
513
  };
454
- declare const ProgressIndicator: React$1.FC<ProgressIndicatorProps>;
514
+ declare const ProgressIndicator: ({ currentPoints, maxPoints, variant, height, attained, }: ProgressIndicatorProps) => JSX.Element;
455
515
 
456
516
  type SectionHeaderProps = {
457
517
  title?: string;
458
518
  description?: string;
459
519
  };
460
- declare const SectionHeader: React__default.FC<SectionHeaderProps>;
520
+ declare const SectionHeader: ({ title, description, }: SectionHeaderProps) => JSX.Element | null;
461
521
 
462
522
  type WithTileFetchingProps = {
463
523
  tile?: Tile;
@@ -472,7 +532,7 @@ declare const _default$5: (props: Omit<BadgeTileProps, "tile"> & WithTileFetchin
472
532
  type BannerTileProps = {
473
533
  tile: Tile;
474
534
  };
475
- declare const _default$4: (props: Omit<BannerTileProps, "tile"> & WithTileFetchingProps) => React$1.JSX.Element;
535
+ declare const _default$4: (props: Omit<BannerTileProps, "tile"> & WithTileFetchingProps) => React__default.JSX.Element;
476
536
 
477
537
  type ContentTileProps = {
478
538
  tile: Tile;
@@ -482,7 +542,17 @@ declare const _default$3: (props: Omit<ContentTileProps, "tile"> & WithTileFetch
482
542
  type GroupProps = {
483
543
  id: string;
484
544
  };
485
- declare const Group: React__default.FC<GroupProps>;
545
+ /**
546
+ * A page-level component that represents a Group view in the application.
547
+ *
548
+ * This component serves as a container page that manages the fetching and display
549
+ * of a group's data and its associated sections. It handles various states including
550
+ * loading, errors, and empty states, providing a complete page experience for
551
+ * viewing group content.
552
+ *
553
+ * @param id - The unique identifier of the group to fetch and display.
554
+ */
555
+ declare const Group: ({ id }: GroupProps) => JSX.Element | null;
486
556
 
487
557
  type PointsTileProps = {
488
558
  tile: Tile;
@@ -492,7 +562,7 @@ declare const _default$2: (props: Omit<PointsTileProps, "tile"> & WithTileFetchi
492
562
  type RewardCategoryTileProps = {
493
563
  tile: Tile;
494
564
  };
495
- declare const _default$1: (props: Omit<RewardCategoryTileProps, "tile"> & WithTileFetchingProps) => React$1.JSX.Element;
565
+ declare const _default$1: (props: Omit<RewardCategoryTileProps, "tile"> & WithTileFetchingProps) => React__default.JSX.Element;
496
566
 
497
567
  type RewardTileProps = {
498
568
  tile: Tile;
@@ -503,7 +573,10 @@ type SectionProps = {
503
573
  section?: TSection;
504
574
  sectionId?: string;
505
575
  };
506
- declare const Section: React__default.FC<SectionProps>;
576
+ /**
577
+ * The Section component renders a section based on its type (e.g., Banner, Grid).
578
+ */
579
+ declare const Section: ({ section, sectionId }: SectionProps) => JSX.Element | null;
507
580
 
508
581
  type TierTileProps = {
509
582
  tile: Tile;
@@ -565,7 +638,7 @@ type WllSdkProviderProps = {
565
638
  config: SDKConfig;
566
639
  navigationConfig?: NavigationConfig;
567
640
  };
568
- declare const WllSdkProvider: React__default.FC<WllSdkProviderProps>;
641
+ declare const WllSdkProvider: ({ children, theme: providedTheme, config, navigationConfig, }: WllSdkProviderProps) => JSX.Element;
569
642
  declare const useWllSdk: () => WllSdkContextType;
570
643
 
571
- export { type APIResponse, 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, Column$1 as Content, _default$3 as ContentTile, ContentTileConfig, type DerivedProperties, FlexBox, Grid, Group, Icon, type ImagePropsNoSource, Indicator, type LayoutProps, LoadingIndicator, type NavigationConfig, type NavigationType, _default$2 as PointsTile, PointsTileConfig, type ProgessType, ProgressBar, ProgressIndicator, ProgressType, ProgressiveImage, Reward, type RewardCategory, _default$1 as RewardCategoryTile, RewardCategoryTileConfig, _default as RewardTile, RewardTileConfig, Row, RowHeader, type SDKConfig, Section, SectionHeader, SectionType, type Size, Skeleton, Stack, 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, useWllSdk };
644
+ 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 DerivedProperties, FlexBox, type FlexDirection, Grid, Group, Icon, type ImagePropsNoSource, Indicator, type Justify, type LayoutProps, LoadingIndicator, type NavigationConfig, type NavigationType, _default$2 as PointsTile, PointsTileConfig, type ProgessType, ProgressBar, ProgressIndicator, ProgressType, ProgressiveImage, Reward, type RewardCategory, _default$1 as RewardCategoryTile, RewardCategoryTileConfig, _default as RewardTile, RewardTileConfig, Row, RowHeader, type SDKConfig, Section, SectionHeader, SectionType, type Size, Skeleton, Spacer, Stack, 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 };