@scbt-ecom/ui 0.62.1 → 0.63.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.
@@ -1,33 +1,18 @@
1
1
  import { ReactElement } from 'react';
2
- import { ButtonProps } from '../../shared/ui';
3
2
  import { AdvantageClasses, AdvantagesProps } from '../advantages/Advantages';
4
- import { ButtonHandlerOptions } from '../buttonWithHandlers';
5
3
  import { BackgroundBannerColorsValues } from './model/constants';
6
- import { BannerClasses, ImgBanner } from './model/types';
4
+ import { BannerClasses, ButtonsConfig, ImgBanner } from './model/types';
7
5
  export interface BannerProps {
8
6
  headTitle: string | ReactElement;
9
7
  subtitle: string | ReactElement;
10
8
  imgDesktop: ImgBanner;
11
9
  imgMobile: ImgBanner;
12
- buttonsConfig: {
13
- primary: {
14
- buttonContent: ButtonProps & {
15
- handlerOptions: ButtonHandlerOptions;
16
- };
17
- enabled: boolean;
18
- };
19
- secondary?: {
20
- buttonContent: ButtonProps & {
21
- handlerOptions: ButtonHandlerOptions;
22
- };
23
- enabled: boolean;
24
- };
25
- };
10
+ buttonsConfig: ButtonsConfig;
26
11
  advantages?: AdvantagesProps;
12
+ variant?: 'separateImg' | 'fullImg';
13
+ color?: BackgroundBannerColorsValues;
27
14
  classes?: BannerClasses & {
28
15
  advantages?: AdvantageClasses;
29
16
  };
30
- variant?: 'separateImg' | 'fullImg';
31
- color?: BackgroundBannerColorsValues;
32
17
  }
33
18
  export declare const Banner: ({ variant, ...props }: BannerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
+ import { ButtonHandlerOptions } from '../../buttonWithHandlers';
2
3
  import { ButtonProps } from '../../../shared/ui';
3
- import { BannerButtonsGroupClasses } from '../ui/BannerButtonsGroup';
4
- export interface BannerClasses extends BannerButtonsGroupClasses {
4
+ export interface BannerClasses {
5
5
  root?: string;
6
6
  container?: string;
7
7
  wrapper?: string;
@@ -12,11 +12,25 @@ export interface BannerClasses extends BannerButtonsGroupClasses {
12
12
  imageContainer?: string;
13
13
  image?: string;
14
14
  advantageContainer?: string;
15
+ group?: string;
16
+ primary?: string;
17
+ secondary?: string;
15
18
  }
16
19
  export type ButtonsConfig = {
17
- primary: ButtonProps;
18
- secondary?: ButtonProps;
20
+ primary: {
21
+ buttonContent: ButtonProps & {
22
+ handlerOptions: ButtonHandlerOptions;
23
+ };
24
+ enabled: boolean;
25
+ };
26
+ secondary?: {
27
+ buttonContent: ButtonProps & {
28
+ handlerOptions: ButtonHandlerOptions;
29
+ };
30
+ enabled: boolean;
31
+ };
19
32
  };
20
33
  export type ImgBanner = ReactElement | {
21
34
  url: string;
35
+ alt: string;
22
36
  };
@@ -1,2 +1 @@
1
1
  export { BannerWithSeparateImg, BannerImageFull } from './banners';
2
- export { BannerButtonsGroup } from './BannerButtonsGroup';
@@ -7,6 +7,7 @@ export type Colors = keyof typeof allowedBannersBackgroundColors;
7
7
  export type AllowedBannerBackgroundColor = `bg-banner-${Colors}`;
8
8
  export type Img = {
9
9
  url: string;
10
+ alt: string;
10
11
  };
11
12
  export type Details = {
12
13
  button?: ButtonProps & {
@@ -1,20 +1,11 @@
1
1
  import { ReactElement } from 'react';
2
- import { ButtonHandlerOptions } from '../buttonWithHandlers';
3
- import { Details, LongBannerClasses, LongBannerConfig } from './model/types';
4
- import { ButtonProps } from '../../shared/ui';
2
+ import { ButtonConfig, Details, Image, LongBannerClasses, LongBannerConfig } from './model/types';
5
3
  export interface LongBannerProps<Enabled extends boolean> extends LongBannerConfig {
6
4
  headline: string | ReactElement;
7
5
  details: Details<Enabled>[];
8
6
  intent?: 'twoItems' | 'fourItems';
9
- buttonConfig?: {
10
- buttonContent: ButtonProps & {
11
- handlerOptions: ButtonHandlerOptions;
12
- };
13
- enabled: boolean;
14
- };
15
- image: ReactElement | {
16
- url: string;
17
- };
7
+ buttonConfig?: ButtonConfig;
8
+ image: Image;
18
9
  classes?: LongBannerClasses;
19
10
  }
20
11
  export declare const LongBanner: <Enabled extends boolean>({ headline, buttonConfig, intent, details, image, classes }: LongBannerProps<Enabled>) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { VariantProps } from 'class-variance-authority';
3
+ import { ButtonProps } from '../../../shared/ui';
4
+ import { ButtonHandlerOptions } from '../../buttonWithHandlers';
3
5
  import { itemConfig } from './cva';
4
6
  export type LongBannerConfig = VariantProps<typeof itemConfig>;
5
7
  export type Details<Enabled extends boolean> = {
@@ -32,4 +34,14 @@ export interface TextItemProps<Enabled extends boolean> extends LongBannerConfig
32
34
  popover?: Popover<Enabled>;
33
35
  };
34
36
  }
37
+ export type ButtonConfig = {
38
+ buttonContent: ButtonProps & {
39
+ handlerOptions: ButtonHandlerOptions;
40
+ };
41
+ enabled: boolean;
42
+ };
43
+ export type Image = ReactElement | {
44
+ url: string;
45
+ alt: string;
46
+ };
35
47
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scbt-ecom/ui",
3
- "version": "0.62.1",
3
+ "version": "0.63.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,13 +0,0 @@
1
- import { ButtonsConfig } from '../model';
2
- export interface BannerButtonsGroupClasses {
3
- group?: string;
4
- primary?: string;
5
- secondary?: string;
6
- }
7
- interface BannerButtonsGroupProps {
8
- buttonsConfig: ButtonsConfig;
9
- classes?: Partial<BannerButtonsGroupClasses>;
10
- className?: string;
11
- }
12
- export declare const BannerButtonsGroup: ({ buttonsConfig, classes, className }: BannerButtonsGroupProps) => import("react/jsx-runtime").JSX.Element;
13
- export {};