demio-ui 2.1.67 → 2.1.68

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,19 +1,17 @@
1
- import React, { MouseEventHandler } from 'react';
2
- type Props = {
1
+ import React, { MouseEventHandler, ReactNode } from 'react';
2
+ type ColorVariants = 'red' | 'green' | 'dark';
3
+ type Props<Variant extends string = 'primary' | 'secondary' | 'tertiary' | 'quartery'> = {
3
4
  disabled?: boolean;
4
- children?: string;
5
- variant?: 'filled' | 'outlined' | 'tonal' | 'text';
6
- color?: 'primary' | 'secondary' | 'tertiary' | 'gray' | 'dark' | 'red';
5
+ children?: ReactNode;
6
+ variant?: Variant;
7
+ color?: Variant extends 'primary' | 'secondary' ? ColorVariants : never;
7
8
  onClick: MouseEventHandler<HTMLButtonElement>;
8
9
  type?: 'button' | 'submit' | 'reset';
9
10
  className?: string;
10
- prefix?: string | React.ReactNode;
11
- suffix?: string | React.ReactNode;
11
+ prefix?: ReactNode;
12
+ suffix?: ReactNode;
12
13
  fullWidth?: boolean;
13
14
  showLoader?: boolean;
14
15
  };
15
- /**
16
- * Button component documentation.
17
- **/
18
- declare const Button: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
16
+ declare const Button: React.ForwardRefExoticComponent<Props<"primary" | "secondary" | "tertiary" | "quartery"> & React.RefAttributes<HTMLButtonElement>>;
19
17
  export default Button;
@@ -1,19 +1,17 @@
1
- import React, { MouseEventHandler } from 'react';
2
- type Props = {
1
+ import React, { MouseEventHandler, ReactNode } from 'react';
2
+ type ColorVariants = 'red' | 'green' | 'dark';
3
+ type Props<Variant extends string = 'primary' | 'secondary' | 'tertiary' | 'quartery'> = {
3
4
  disabled?: boolean;
4
- children?: string;
5
- variant?: 'filled' | 'outlined' | 'tonal' | 'text';
6
- color?: 'primary' | 'secondary' | 'tertiary' | 'gray' | 'dark' | 'red';
5
+ children?: ReactNode;
6
+ variant?: Variant;
7
+ color?: Variant extends 'primary' | 'secondary' ? ColorVariants : never;
7
8
  onClick: MouseEventHandler<HTMLButtonElement>;
8
9
  type?: 'button' | 'submit' | 'reset';
9
10
  className?: string;
10
- prefix?: string | React.ReactNode;
11
- suffix?: string | React.ReactNode;
11
+ prefix?: ReactNode;
12
+ suffix?: ReactNode;
12
13
  fullWidth?: boolean;
13
14
  showLoader?: boolean;
14
15
  };
15
- /**
16
- * Button component documentation.
17
- **/
18
- declare const Button: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
16
+ declare const Button: React.ForwardRefExoticComponent<Props<"primary" | "secondary" | "tertiary" | "quartery"> & React.RefAttributes<HTMLButtonElement>>;
19
17
  export default Button;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "demio-ui",
3
- "version": "2.1.67",
3
+ "version": "2.1.68",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- type Props = {
3
- message?: string;
4
- };
5
- declare function Toast({ message, }: Props): React.JSX.Element;
6
- export default Toast;
@@ -1 +0,0 @@
1
- export { default } from './Toast';
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- type Props = {
3
- message?: string;
4
- };
5
- declare function Toast({ message, }: Props): React.JSX.Element;
6
- export default Toast;
@@ -1 +0,0 @@
1
- export { default } from './Toast';