xtreme-ui 0.0.3 → 0.0.4

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,20 +1,20 @@
1
1
  import { MouseEvent } from 'react';
2
- export type TButtonProps = {
2
+ interface IButtonBaseProps {
3
3
  className?: string;
4
4
  type?: keyof typeof EButtonTypes;
5
5
  size?: keyof typeof EButtonSize;
6
+ label?: string;
7
+ iconName?: string;
6
8
  loading?: boolean;
7
9
  disabled?: boolean;
8
10
  iconFilled?: boolean;
9
11
  iconPosition?: 'left' | 'right';
10
12
  onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
11
- } & ({
12
- label: string;
13
- iconName?: string;
14
- } | {
15
- label?: string;
16
- iconName: string;
17
- });
13
+ }
14
+ type RequireProperty<T, Prop extends keyof T> = T & {
15
+ [key in Prop]-?: T[key];
16
+ };
17
+ export type TButtonProps = RequireProperty<IButtonBaseProps, 'label'> | RequireProperty<IButtonBaseProps, 'iconName'>;
18
18
  export declare enum EButtonTypes {
19
19
  primary = "primary",
20
20
  primaryDanger = "primaryDanger",
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/base/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,MAAM,MAAM,YAAY,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,OAAO,YAAY,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAA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,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;AAEtH,oBAAY,YAAY;IACvB,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,eAAe,oBAAoB;IACnC,IAAI,SAAS;IACb,UAAU,eAAe;CACzB;AAED,aAAK,WAAW;IACf,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;CACf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtreme-ui",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",