@eclass/ui-kit 1.41.3 → 1.42.1

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.
@@ -4,6 +4,7 @@ interface colorScheme {
4
4
  hover: string;
5
5
  }
6
6
  export interface propsBaseBtns {
7
+ ariaLabel?: string;
7
8
  children?: React.ReactNode;
8
9
  disabled?: boolean;
9
10
  isFullWidth?: boolean;
@@ -12,6 +13,7 @@ export interface propsBaseBtns {
12
13
  isLoading?: boolean;
13
14
  onClick?: (e: React.MouseEvent<HTMLElement>) => void;
14
15
  rightIcon?: React.ReactElement;
16
+ role?: 'button' | 'link';
15
17
  size?: 'regular' | 'small';
16
18
  type?: 'button' | 'submit' | 'reset';
17
19
  tabIndex?: number;
@@ -34,7 +36,7 @@ interface props extends propsBaseBtns {
34
36
  *
35
37
  * @example <Btn>Lorem</Btn>
36
38
  */
37
- export declare function Btn({ bg, borderColorActive, children, color, disabled, fillLoader, isFullWidth, leftIcon, m, isLoading, onClick, rightIcon, rounded, size, touchDark, type, tabIndex, id, }: props): JSX.Element;
39
+ export declare function Btn({ ariaLabel, bg, borderColorActive, children, color, disabled, fillLoader, id, isFullWidth, isLoading, leftIcon, m, onClick, rightIcon, role, rounded, size, touchDark, type, tabIndex, }: props): JSX.Element;
38
40
  export declare namespace Btn {
39
41
  var displayName: string;
40
42
  }
@@ -1,15 +1,18 @@
1
1
  /// <reference types="react" />
2
2
  export interface props {
3
+ as?: 'button' | 'a';
4
+ ariaLabel?: string;
3
5
  children?: React.ReactNode;
6
+ fontSize?: string | '0.875rem';
7
+ href?: string;
8
+ id?: string;
4
9
  m?: string;
5
- as?: 'button' | 'a';
6
10
  onClick?: (e: React.MouseEvent<HTMLElement>) => void;
7
- id?: string;
8
- href?: string;
11
+ role?: 'button' | 'link';
12
+ tabIndex?: number;
9
13
  textDecorationLine?: boolean;
10
- fontSize?: string | '0.875rem';
11
14
  }
12
- export declare function BtnLink({ children, m, onClick, id, as, href, textDecorationLine, fontSize, }: props): JSX.Element;
15
+ export declare function BtnLink({ as, ariaLabel, children, fontSize, href, id, m, onClick, role, tabIndex, textDecorationLine, }: props): JSX.Element;
13
16
  export declare namespace BtnLink {
14
17
  var displayName: string;
15
18
  }
@@ -7,7 +7,18 @@ import { propsBaseBtns } from './Btn';
7
7
  *
8
8
  * @example <BtnPrimary>Lorem</BtnPrimary>
9
9
  */
10
- export declare function BtnPrimary({ children, disabled, isFullWidth, leftIcon, m, isLoading, onClick, rightIcon, size, type, tabIndex, id, }: propsBaseBtns): JSX.Element;
10
+ declare type XOR<T, U> = T | U extends object ? (T extends U ? never : T) | (U extends T ? never : U) : T | U;
11
+ interface ButtonWithTextProps extends propsBaseBtns {
12
+ children: React.ReactNode;
13
+ ariaLabel?: string;
14
+ }
15
+ interface ButtonWithoutTextProps extends propsBaseBtns {
16
+ children?: React.ReactNode;
17
+ ariaLabel: string;
18
+ }
19
+ declare type PrimaryButtonProps = XOR<ButtonWithTextProps, ButtonWithoutTextProps>;
20
+ export declare function BtnPrimary({ ariaLabel, children, disabled, isFullWidth, leftIcon, m, isLoading, onClick, rightIcon, role, size, type, tabIndex, id, }: PrimaryButtonProps): JSX.Element;
11
21
  export declare namespace BtnPrimary {
12
22
  var displayName: string;
13
23
  }
24
+ export {};
@@ -7,7 +7,18 @@ import { propsBaseBtns } from './Btn';
7
7
  *
8
8
  * @example <BtnSecondary>Lorem</BtnSecondary>
9
9
  */
10
- export declare function BtnSecondary({ children, disabled, isFullWidth, leftIcon, m, isLoading, onClick, rightIcon, size, type, tabIndex, id, }: propsBaseBtns): JSX.Element;
10
+ declare type XOR<T, U> = T | U extends object ? (T extends U ? never : T) | (U extends T ? never : U) : T | U;
11
+ interface ButtonWithTextProps extends propsBaseBtns {
12
+ children: React.ReactNode;
13
+ ariaLabel?: string;
14
+ }
15
+ interface ButtonWithoutTextProps extends propsBaseBtns {
16
+ children?: React.ReactNode;
17
+ ariaLabel: string;
18
+ }
19
+ declare type SecondaryButtonProps = XOR<ButtonWithTextProps, ButtonWithoutTextProps>;
20
+ export declare function BtnSecondary({ ariaLabel, children, disabled, isFullWidth, leftIcon, m, isLoading, onClick, rightIcon, role, size, type, tabIndex, id, }: SecondaryButtonProps): JSX.Element;
11
21
  export declare namespace BtnSecondary {
12
22
  var displayName: string;
13
23
  }
24
+ export {};
@@ -1,20 +1,31 @@
1
1
  /// <reference types="react" />
2
+ declare type XOR<T, U> = T | U extends object ? (T extends U ? never : T) | (U extends T ? never : U) : T | U;
2
3
  export interface propsTertiaryBtn {
3
- iconStatus?: 'answer' | 'ahead' | 'back' | 'edit' | 'delete' | 'more' | 'password' | 'multimedia' | 'record' | 'download' | 'noIcon';
4
- children?: React.ReactNode;
5
- rightIcon?: boolean;
4
+ activeWhenPress?: boolean;
5
+ id?: string;
6
6
  iconCustom?: JSX.Element;
7
- withoutColor?: boolean;
7
+ iconStatus?: 'answer' | 'ahead' | 'back' | 'edit' | 'delete' | 'more' | 'password' | 'multimedia' | 'record' | 'download' | 'noIcon';
8
8
  m?: string;
9
- type?: 'button' | 'submit' | 'reset';
10
- tabIndex?: number;
11
- id?: string;
12
- activeWhenPress?: boolean;
13
9
  onClick?: (e: React.MouseEvent<HTMLElement>) => void;
14
10
  onMouseEnter?: (e: React.MouseEvent<HTMLElement>) => void;
15
11
  onMouseLeave?: (e: React.MouseEvent<HTMLElement>) => void;
12
+ rightIcon?: boolean;
13
+ role?: 'button' | 'link';
14
+ type?: 'button' | 'submit' | 'reset';
15
+ tabIndex?: number;
16
+ withoutColor?: boolean;
17
+ }
18
+ interface ButtonWithTextProps extends propsTertiaryBtn {
19
+ children: React.ReactNode;
20
+ ariaLabel?: string;
21
+ }
22
+ interface ButtonWithoutTextProps extends propsTertiaryBtn {
23
+ children?: React.ReactNode;
24
+ ariaLabel: string;
16
25
  }
17
- export declare function BtnTertiary({ children, iconStatus, iconCustom, rightIcon, withoutColor, m, type, tabIndex, id, activeWhenPress, onClick, onMouseEnter, onMouseLeave, }: propsTertiaryBtn): JSX.Element;
26
+ declare type ButtonProps = XOR<ButtonWithTextProps, ButtonWithoutTextProps>;
27
+ export declare function BtnTertiary({ ariaLabel, activeWhenPress, children, id, iconStatus, iconCustom, m, onClick, onMouseEnter, onMouseLeave, rightIcon, role, type, tabIndex, withoutColor, }: ButtonProps): JSX.Element;
18
28
  export declare namespace BtnTertiary {
19
29
  var displayName: string;
20
30
  }
31
+ export {};