@edvisor/product-language 0.7.3 → 0.8.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,10 +1,14 @@
1
1
  import { FC, PropsWithChildren } from '@helpers';
2
2
  import { AlertLevelProps } from './alert-level-flags';
3
3
  interface IAlertBannerProps extends PropsWithChildren {
4
- /** @TODO can we get some examples of alert banner in card from figma? */
5
- inCard?: boolean;
6
4
  dismissible?: boolean;
7
5
  className?: string;
6
+ open?: boolean;
7
+ primaryButtonLabel?: string;
8
+ secondaryButtonLabel?: string;
9
+ onPrimaryAction?: () => void;
10
+ onSecondaryAction?: () => void;
11
+ onClose?: () => void;
8
12
  }
9
13
  export declare type AlertBannerProps = IAlertBannerProps & AlertLevelProps;
10
14
  export declare const AlertBanner: FC<AlertBannerProps>;
@@ -1,4 +1,5 @@
1
1
  import { Hex, MappedEnum, RequireOnlyOne, PropsWithChildren } from '@helpers';
2
+ import { ComponentType } from 'react';
2
3
  declare const enum AlertLevel {
3
4
  neutral = 1,
4
5
  info = 2,
@@ -10,4 +11,8 @@ declare type AlertLevels<T> = MappedEnum<typeof AlertLevel, T>;
10
11
  export declare type AlertLevelProps = Partial<RequireOnlyOne<AlertLevels<boolean>>> & PropsWithChildren;
11
12
  export declare function getBackgroundColor(props: AlertLevelProps): Hex;
12
13
  export declare function getBorderColor(props: AlertLevelProps): Hex;
14
+ export declare function getIcon(props: AlertLevelProps): {
15
+ icon: ComponentType;
16
+ color: Hex;
17
+ };
13
18
  export {};
@@ -18,5 +18,6 @@ export * from './select';
18
18
  export * from './tree-view';
19
19
  export * from './date-picker';
20
20
  export * from './range-slider';
21
+ export * from './modal';
21
22
  export * from './molecules';
22
23
  export * from './organisms';
@@ -0,0 +1,3 @@
1
+ export * from './modal-base';
2
+ export * from './modal';
3
+ export * from './modal-destructive';
@@ -0,0 +1,19 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { FC } from '@helpers';
3
+ export declare const enum MODAL_SIZE {
4
+ SMALL = 0,
5
+ CRITICAL = 1,
6
+ DEFAULT = 2,
7
+ LARGE = 3,
8
+ X_LARGE = 4
9
+ }
10
+ export interface IModalBaseProps {
11
+ open: boolean;
12
+ children: React.ReactElement;
13
+ closeOnEsc?: boolean;
14
+ modalSize?: MODAL_SIZE;
15
+ onOverlayClick?: () => void;
16
+ onClose: () => void;
17
+ }
18
+ export declare type IModalBase = InputHTMLAttributes<HTMLInputElement> & IModalBaseProps;
19
+ export declare const ModalBase: FC<IModalBase>;
@@ -0,0 +1,11 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { FC } from '@helpers';
3
+ import { IModalBaseProps } from './modal-base';
4
+ export interface IModalDestructiveProps extends IModalBaseProps {
5
+ primaryButtonLabel?: string;
6
+ closeButtonLabel: string;
7
+ onPrimaryAction: () => void;
8
+ }
9
+ declare type IModalDestructive = IModalDestructiveProps & InputHTMLAttributes<HTMLInputElement>;
10
+ export declare const ModalDestructive: FC<IModalDestructive>;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { FC } from '@helpers';
3
+ import { IModalBaseProps } from './modal-base';
4
+ export interface IModalProps extends IModalBaseProps {
5
+ title?: string;
6
+ primaryButtonLabel?: string;
7
+ closeButtonLabel?: string;
8
+ secondaryButtonLabel?: string;
9
+ onPrimaryAction?: () => void;
10
+ onSecondaryAction?: () => void;
11
+ }
12
+ export declare type IModal = IModalProps & InputHTMLAttributes<HTMLInputElement>;
13
+ export declare const Modal: FC<IModal>;
@@ -21,7 +21,7 @@ declare const enum ButtonDisabledType {
21
21
  declare type ButtonTypes<T> = MappedEnum<typeof ButtonType, T>;
22
22
  declare type ButtonSizes<T> = MappedEnum<typeof ButtonSize, T>;
23
23
  declare type ButtonDisabledTypes<T> = MappedEnum<typeof ButtonDisabledType, T>;
24
- export declare type ButtonTypeProps = Partial<RequireOnlyOne<ButtonTypes<boolean>>> & PropsWithChildren;
24
+ export declare type ButtonTypeProps = Partial<ButtonTypes<boolean>> & PropsWithChildren;
25
25
  export declare type ButtonSizeProps = Partial<RequireOnlyOne<ButtonSizes<boolean>>> & PropsWithChildren;
26
26
  export declare type ButtonDisabledTypeProps = Partial<RequireOnlyOne<ButtonDisabledTypes<boolean>>> & PropsWithChildren;
27
27
  export declare function getBackgroundColorByType(type: ButtonType): string;
@@ -1,5 +1,6 @@
1
1
  export declare const Background: {
2
2
  readonly Default: "#F3F4F6";
3
+ readonly Overlay: `#${string}`;
3
4
  };
4
5
  export declare const Surface: {
5
6
  Default: {
@@ -20,3 +20,14 @@ export declare const Margin: {
20
20
  readonly xl: SPACING.Size32;
21
21
  readonly xxl: SPACING.Size64;
22
22
  };
23
+ export declare const Gap: {
24
+ readonly none: 0;
25
+ readonly xxxs: SPACING.Size2;
26
+ readonly xxs: SPACING.Size4;
27
+ readonly xs: SPACING.Size8;
28
+ readonly s: SPACING.Size12;
29
+ readonly m: SPACING.Size16;
30
+ readonly l: SPACING.Size24;
31
+ readonly xl: SPACING.Size32;
32
+ readonly xxl: SPACING.Size64;
33
+ };
@@ -0,0 +1 @@
1
+ export declare function useKeyDown(targetKey: string, handler: () => void): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edvisor/product-language",
3
- "version": "0.7.3",
3
+ "version": "0.8.0",
4
4
  "license": "MIT",
5
5
  "description": "Edvisor.io product-language components",
6
6
  "repository": "https://github.com/edvisor-io/front-end/",