@scbt-ecom/ui 0.6.0 → 0.7.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,5 +1,6 @@
1
+ import { ReactElement } from 'react';
1
2
  export interface IBreadcrumbLink {
2
- label: string;
3
+ label: string | ReactElement;
3
4
  path: string;
4
5
  isDisabled?: boolean;
5
6
  }
@@ -1,10 +1,11 @@
1
+ import { ReactElement } from 'react';
1
2
  import { VariantProps } from 'class-variance-authority';
2
3
  declare const iconConfig: (props?: ({
3
4
  intent?: "outline" | "filled" | null | undefined;
4
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
5
6
  type TIconConfig = VariantProps<typeof iconConfig>;
6
7
  export interface IDocumentProps extends TIconConfig {
7
- text: string;
8
+ text: string | ReactElement;
8
9
  size: number;
9
10
  sizeType: 'КБ' | 'МБ';
10
11
  href: string;
@@ -1,11 +1,12 @@
1
+ import { ReactElement } from 'react';
1
2
  interface IPhoneViewClasses {
2
3
  wrapper: string;
3
4
  link: string;
4
5
  text: string;
5
6
  }
6
7
  export interface IPhoneViewProps {
7
- phone: string;
8
- text: string;
8
+ phone: string | ReactElement;
9
+ text: string | ReactElement;
9
10
  classes?: Partial<IPhoneViewClasses>;
10
11
  }
11
12
  export declare const PhoneView: ({ phone, text, classes }: IPhoneViewProps) => import("react/jsx-runtime").JSX.Element;
@@ -13,7 +13,7 @@ export interface ITabContent {
13
13
  id: string;
14
14
  body: React.ReactElement | string;
15
15
  accordion?: {
16
- title: string;
16
+ title: string | React.ReactElement;
17
17
  };
18
18
  }
19
19
  interface ITabTrigger {
@@ -4,23 +4,23 @@ import * as React from 'react';
4
4
  type TSelectVariant = 'primary' | 'secondary';
5
5
  export interface SelectOption<ValueType> {
6
6
  value: ValueType;
7
- label: string;
7
+ label: string | React.ReactElement;
8
8
  }
9
9
  export interface IComboboxControlProps<T extends FieldValues, ValueType> {
10
10
  name: Path<T>;
11
11
  control: Control<T>;
12
12
  options: SelectOption<ValueType>[];
13
- label: string;
13
+ label: string | React.ReactElement;
14
14
  size?: 'sm' | 'md' | 'lg' | 'full';
15
- helperText?: string;
15
+ helperText?: string | React.ReactElement;
16
16
  marker?: boolean;
17
17
  variant?: TSelectVariant;
18
18
  isClearable?: boolean;
19
19
  defaultValue?: ValueType;
20
- noOptionsMessage?: string;
20
+ noOptionsMessage?: string | React.ReactElement;
21
21
  disabled?: boolean;
22
22
  isMulti?: boolean;
23
- placeholder?: string;
23
+ placeholder?: string | React.ReactElement;
24
24
  onClickIcon?: (...args: unknown[]) => unknown;
25
25
  onKeyDownIcon?: (event: React.KeyboardEvent) => unknown;
26
26
  isSearchable?: boolean;
@@ -1,3 +1,4 @@
1
+ import { ReactElement } from 'react';
1
2
  import { FieldValues } from 'react-hook-form';
2
3
  import { TFieldControlledProps } from '../model';
3
4
  export type TEditorControlClasses = {
@@ -8,8 +9,8 @@ export type TEditorControlClasses = {
8
9
  };
9
10
  export interface ICommonEditorProps {
10
11
  editable?: boolean;
11
- helperText?: string;
12
- label?: string;
12
+ helperText?: string | ReactElement;
13
+ label?: string | ReactElement;
13
14
  }
14
15
  export type IEditorControlProps<T extends FieldValues> = TFieldControlledProps<T> & ICommonEditorProps & {
15
16
  classes?: Partial<TEditorControlClasses>;
@@ -1,6 +1,7 @@
1
1
  import { FieldValues } from 'react-hook-form';
2
2
  import { TAdditionalInputClassesWithAttachment, TControlledInputProps } from '../model';
3
3
  import { TSliderVariants } from './model/types';
4
+ import * as React from 'react';
4
5
  export interface IInputSliderCommonProps {
5
6
  min: number;
6
7
  max: number;
@@ -14,7 +15,7 @@ export interface InputSliderControlProps<T extends FieldValues> extends TControl
14
15
  };
15
16
  disabled?: boolean;
16
17
  onInputChange?: (value?: number) => void;
17
- leftText?: string;
18
- rightText?: string;
18
+ leftText?: string | React.ReactElement;
19
+ rightText?: string | React.ReactElement;
19
20
  }
20
- export declare const InputSliderControl: <T extends FieldValues>({ label, size, helperText, control, classes, badge, icon, disabled, onInputChange, min, max, variant, ...props }: InputSliderControlProps<T>) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const InputSliderControl: <T extends FieldValues>({ label, size, helperText, control, classes, badge, icon, disabled, onInputChange, min, max, variant, leftText, rightText, ...props }: InputSliderControlProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { TSliderVariants } from '../types';
2
2
  export declare const getInputSliderSuffix: (variant: TSliderVariants, value: number) => string;
3
- export declare const getMinMaxTextSlider: (variant: TSliderVariants, min: number, max: number) => string[] | ("лет" | "год" | "года")[];
@@ -1,4 +1,3 @@
1
- export { getMinMaxTextSlider } from './getInputSliderSuffix';
2
1
  export { formatNumber } from './formatNumber';
3
2
  export { getInputSliderSuffix } from './getInputSliderSuffix';
4
3
  export { getStepByVariant } from './getStepByVariant';
@@ -2,7 +2,7 @@ import { TFieldWrapperClasses } from '../model';
2
2
  import * as React from 'react';
3
3
  interface IFieldWrapperProps<V> {
4
4
  children: React.ReactElement;
5
- label: string;
5
+ label: string | React.ReactElement;
6
6
  fieldId: string;
7
7
  value: V;
8
8
  error?: boolean;
@@ -1,6 +1,7 @@
1
+ import { ReactElement } from 'react';
1
2
  import { TFieldWrapperClasses } from '../model';
2
3
  interface ILabelProps<V> {
3
- label: string;
4
+ label: string | ReactElement;
4
5
  fieldId: string;
5
6
  value: V;
6
7
  classes?: Partial<TFieldWrapperClasses>;
@@ -1,3 +1,4 @@
1
+ import { ReactElement } from 'react';
1
2
  import { FieldError } from 'react-hook-form';
2
3
  import { VariantProps } from 'class-variance-authority';
3
4
  declare const messageViewConfig: (props?: ({
@@ -6,7 +7,7 @@ declare const messageViewConfig: (props?: ({
6
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
8
  export interface IMessageViewProps extends VariantProps<typeof messageViewConfig> {
8
9
  as?: 'div' | 'span' | 'p';
9
- text?: string | FieldError['message'];
10
+ text?: string | FieldError['message'] | ReactElement;
10
11
  className?: string;
11
12
  }
12
13
  export declare const MessageView: ({ intent, as: Element, disabled, text, className, ...props }: IMessageViewProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -2,7 +2,7 @@ import { ReactElement } from 'react';
2
2
  export interface INotificationProps {
3
3
  duration?: number;
4
4
  intent: 'info' | 'error';
5
- text: string;
5
+ text: string | ReactElement;
6
6
  customIcon?: ReactElement;
7
7
  content?: ReactElement;
8
8
  closure?: boolean;
@@ -1,3 +1,4 @@
1
+ import { ReactElement } from 'react';
1
2
  import { IAdvantage } from '../Advantages';
2
3
  import { IBannerButtonsGroupClasses } from './ui/BannerButtonsGroup';
3
4
  import { IButtonProps } from '../../shared/ui';
@@ -18,8 +19,8 @@ export type TButtonsConfig = {
18
19
  secondary?: IButtonProps;
19
20
  };
20
21
  export interface IBannerProps {
21
- headTitle: string;
22
- subtitle: string;
22
+ headTitle: string | ReactElement;
23
+ subtitle: string | ReactElement;
23
24
  img?: string;
24
25
  imgSets?: {
25
26
  large: string;
@@ -1,7 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { IButtonConfig, ILongBannerClasses, ITextContent, TLongBannerConfig } from './model/types';
3
3
  export interface ILongBannerProps extends TLongBannerConfig {
4
- title: string;
4
+ title: string | ReactElement;
5
5
  buttonConfig?: IButtonConfig;
6
6
  textContent: ITextContent[];
7
7
  imageComponent: ReactElement;
@@ -1,13 +1,14 @@
1
+ import { ReactElement } from 'react';
1
2
  import { VariantProps } from 'class-variance-authority';
2
3
  import { itemConfig } from './cva';
3
4
  export type TLongBannerConfig = VariantProps<typeof itemConfig>;
4
5
  export interface ITextContent {
5
- title: string;
6
- description: string;
7
- popoverText?: string;
6
+ title: string | ReactElement;
7
+ description: string | ReactElement;
8
+ popoverText?: string | ReactElement;
8
9
  }
9
10
  export interface IButtonConfig {
10
- text: string;
11
+ text: string | ReactElement;
11
12
  onClick: () => void;
12
13
  }
13
14
  export interface ILongBannerClasses {
@@ -22,8 +23,8 @@ export interface ILongBannerClasses {
22
23
  }
23
24
  export interface ITextItem extends TLongBannerConfig {
24
25
  data: {
25
- title: string;
26
- description: string;
27
- popoverText?: string;
26
+ title: string | ReactElement;
27
+ description: string | ReactElement;
28
+ popoverText?: string | ReactElement;
28
29
  };
29
30
  }
@@ -1,3 +1,4 @@
1
+ import { ReactElement } from 'react';
1
2
  import { TBrandLogoVariant } from '../../shared/ui';
2
3
  export interface ICommonHeaderProps {
3
4
  logoPath?: string;
@@ -5,8 +6,8 @@ export interface ICommonHeaderProps {
5
6
  }
6
7
  interface IHeaderWithPhone extends ICommonHeaderProps {
7
8
  variant: 'withPhone';
8
- phone: string;
9
- phoneText: string;
9
+ phone: string | ReactElement;
10
+ phoneText: string | ReactElement;
10
11
  }
11
12
  interface IHeaderWithButton extends ICommonHeaderProps {
12
13
  variant: 'withButton';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scbt-ecom/ui",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./style.css": "./dist/style.css",