@julien-wiegandt/open-ui 0.1.18 → 0.1.20

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.
@@ -7,6 +7,7 @@ export type ButtonProps = {
7
7
  label?: string;
8
8
  startIcon?: React.ReactNode;
9
9
  endIcon?: React.ReactNode;
10
+ endClickAnimation?: boolean;
10
11
  size?: "sm" | "md" | "lg";
11
12
  bgcolor?: string;
12
13
  radius?: Radius;
@@ -14,6 +15,9 @@ export type ButtonProps = {
14
15
  loading?: boolean;
15
16
  active?: boolean;
16
17
  txtColor?: string;
18
+ align?: "left" | "center" | "right";
19
+ w?: string;
20
+ h?: string;
17
21
  } & MarginProps & PaddingProps & React.ButtonHTMLAttributes<HTMLButtonElement>;
18
22
  export declare const Button: React.ForwardRefExoticComponent<{
19
23
  color: Color;
@@ -21,6 +25,7 @@ export declare const Button: React.ForwardRefExoticComponent<{
21
25
  label?: string;
22
26
  startIcon?: React.ReactNode;
23
27
  endIcon?: React.ReactNode;
28
+ endClickAnimation?: boolean;
24
29
  size?: "sm" | "md" | "lg";
25
30
  bgcolor?: string;
26
31
  radius?: Radius;
@@ -28,4 +33,7 @@ export declare const Button: React.ForwardRefExoticComponent<{
28
33
  loading?: boolean;
29
34
  active?: boolean;
30
35
  txtColor?: string;
36
+ align?: "left" | "center" | "right";
37
+ w?: string;
38
+ h?: string;
31
39
  } & MarginProps & PaddingProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
@@ -1,8 +1,14 @@
1
+ import { Color, Theme } from '../../theme/types';
1
2
  import { ButtonProps } from '.';
2
3
  import { TextProps } from '../text';
4
+ export declare const getVariantStyle: ({ color, theme, }: {
5
+ color: Color;
6
+ theme: Theme;
7
+ }) => Record<string, any>;
3
8
  export declare const sizeMap: Record<NonNullable<ButtonProps["size"]>, {
4
9
  padding: string;
5
10
  fontSize: TextProps["size"];
11
+ height: number;
6
12
  }>;
7
13
  export declare const sizeIconMap: Record<NonNullable<ButtonProps["size"]>, {
8
14
  padding: string;
@@ -1,7 +1,7 @@
1
1
  import { Elevation } from '../../theme/types';
2
2
  import { Styles } from 'styled-components/dist/types';
3
3
  import { MarginProps, PaddingProps } from '../common/types';
4
- export type FlexDirection = "row" | "column";
4
+ export type FlexDirection = "row" | "column" | "row-reverse" | "column-reverse";
5
5
  export type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
6
6
  export type FlexJustify = "center" | "start" | "end" | "between" | "around" | "evenly";
7
7
  export type FlexAlign = "normal" | "center" | "start" | "end" | "stretch";
@@ -0,0 +1,15 @@
1
+ export type CheckIconProps = {
2
+ isVisible: boolean;
3
+ size?: number;
4
+ animated?: boolean;
5
+ strokeWidth?: number;
6
+ color?: string;
7
+ } & React.SVGAttributes<SVGSVGElement>;
8
+ declare const CheckIcon: import('react').ForwardRefExoticComponent<{
9
+ isVisible: boolean;
10
+ size?: number;
11
+ animated?: boolean;
12
+ strokeWidth?: number;
13
+ color?: string;
14
+ } & import('react').SVGAttributes<SVGSVGElement> & import('react').RefAttributes<SVGSVGElement>>;
15
+ export default CheckIcon;
@@ -0,0 +1 @@
1
+ export * from './check';
@@ -2,7 +2,8 @@ import { Color } from '../../theme/types';
2
2
  export type ProgressBarProps = {
3
3
  color: Color;
4
4
  value: number;
5
+ animationDurationInSeconds?: number;
5
6
  h?: string;
6
7
  w?: string;
7
8
  };
8
- export declare const ProgressBar: ({ color, value, h, w }: ProgressBarProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const ProgressBar: ({ color, value, h, w, animationDurationInSeconds, }: ProgressBarProps) => import("react/jsx-runtime").JSX.Element;
@@ -5,6 +5,10 @@ export type TextProps = {
5
5
  width?: string;
6
6
  height?: string;
7
7
  align?: "left" | "center" | "right" | "justify";
8
+ onSizeChange?: (size: {
9
+ width: number;
10
+ height: number;
11
+ }) => void;
8
12
  } & MarginProps & PaddingProps & React.HTMLAttributes<HTMLParagraphElement>;
9
13
  export declare const Text: import('react').ForwardRefExoticComponent<{
10
14
  weight?: "regular" | "medium" | "semibold" | "bold";
@@ -12,4 +16,8 @@ export declare const Text: import('react').ForwardRefExoticComponent<{
12
16
  width?: string;
13
17
  height?: string;
14
18
  align?: "left" | "center" | "right" | "justify";
19
+ onSizeChange?: (size: {
20
+ width: number;
21
+ height: number;
22
+ }) => void;
15
23
  } & MarginProps & PaddingProps & import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
@@ -8,6 +8,10 @@ export declare const StyledText: import('styled-components/dist/types').IStyledC
8
8
  width?: string;
9
9
  height?: string;
10
10
  align?: "left" | "center" | "right" | "justify";
11
+ onSizeChange?: (size: {
12
+ width: number;
13
+ height: number;
14
+ }) => void;
11
15
  } & import('../common/types').MarginProps & import('../common/types').PaddingProps & import('react').HTMLAttributes<HTMLParagraphElement> & {
12
16
  breakpoint: Breakpoint;
13
17
  }>> & string;
@@ -1,34 +1,17 @@
1
1
  import { Color } from '../../theme/types';
2
2
  import { FlexProps } from '../flex';
3
+ /**
4
+ * TODO:
5
+ * - make children/custom toast component available
6
+ */
3
7
  export type ToastProps = {
4
- title?: React.ReactNode;
8
+ id: string;
5
9
  color?: Color;
6
- startIcon?: React.ReactNode;
7
- endIcon?: React.ReactNode;
8
- size?: "sm" | "md" | "lg";
10
+ title: string;
11
+ icon?: React.ReactNode;
12
+ duration?: number;
9
13
  children?: React.ReactNode;
10
14
  style?: React.CSSProperties;
11
15
  onClose?: () => void;
12
16
  } & FlexProps & React.HTMLAttributes<HTMLDivElement>;
13
- export declare const Toast: import('react').ForwardRefExoticComponent<{
14
- title?: React.ReactNode;
15
- color?: Color;
16
- startIcon?: React.ReactNode;
17
- endIcon?: React.ReactNode;
18
- size?: "sm" | "md" | "lg";
19
- children?: React.ReactNode;
20
- style?: React.CSSProperties;
21
- onClose?: () => void;
22
- } & {
23
- elevation?: import('../../theme/types').Elevation;
24
- direction?: import('../flex').FlexDirection;
25
- gap?: string | number;
26
- align?: import('../flex').FlexAlign;
27
- justify?: import('../flex').FlexJustify;
28
- wrap?: import('../flex').FlexWrap;
29
- width?: string;
30
- height?: string;
31
- minWidth?: string;
32
- minheight?: string;
33
- hoverstyle?: import('styled-components/dist/types').Styles<object>;
34
- } & import('../common/types').MarginProps & import('../common/types').PaddingProps & import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
17
+ export declare const Toast: import('react').ForwardRefExoticComponent<Omit<ToastProps, "id"> & import('react').RefAttributes<HTMLDivElement>>;
@@ -11,7 +11,7 @@ export declare const StyledToast: import('styled-components/dist/types').IStyled
11
11
  minWidth?: string;
12
12
  minheight?: string;
13
13
  hoverstyle?: import('styled-components/dist/types').Styles<object>;
14
- } & import('../common/types').MarginProps & import('../common/types').PaddingProps & import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>, ToastProps>> & string & Omit<import('react').ForwardRefExoticComponent<{
14
+ } & import('../common/types').MarginProps & import('../common/types').PaddingProps & import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>, Omit<ToastProps, "id">>> & string & Omit<import('react').ForwardRefExoticComponent<{
15
15
  elevation?: import('../../theme/types').Elevation;
16
16
  direction?: import('../flex').FlexDirection;
17
17
  gap?: string | number;
@@ -0,0 +1 @@
1
+ export declare function useCombinedRefs<T>(...refs: React.Ref<T>[]): (element: T) => void;
@@ -1,27 +1,19 @@
1
- import { Toast } from '../components/toast';
2
- import { Color } from '../theme/types';
3
- type Toast = {
4
- id: string;
5
- title: string;
6
- color?: Color;
7
- startIcon?: React.ReactNode;
8
- endIcon?: React.ReactNode;
9
- size?: "sm" | "md" | "lg";
10
- children?: React.ReactNode;
11
- style?: React.CSSProperties;
12
- duration?: number;
13
- onClose?: () => void;
14
- };
1
+ import { ToastProps } from '../components/toast';
15
2
  export type IToastContext = {
16
- toasts: Toast[];
17
- addToast: (toast: Omit<Toast, "id">) => void;
3
+ toasts: ToastProps[];
4
+ addToast: (toast: Omit<ToastProps, "id">) => void;
18
5
  };
19
6
  export declare const ToastContext: import('react').Context<IToastContext>;
20
- export declare const ToastContextProvider: ({ children }: {
7
+ export type ToastSettings = {
8
+ maxToastDisplay: number;
9
+ durationInSeconds: number;
10
+ } | undefined;
11
+ export declare const ToastContextProvider: ({ children, ...props }: {
21
12
  children: React.ReactNode;
13
+ settings?: ToastSettings;
22
14
  }) => import("react/jsx-runtime").JSX.Element;
23
- export declare const ToastProvider: ({ toasts, removeToast, }: {
24
- toasts: Toast[];
15
+ export declare const ToastProvider: ({ toasts, removeToast, settings, }: {
16
+ toasts: ToastProps[];
25
17
  removeToast: (id: string) => void;
18
+ settings: NonNullable<ToastSettings>;
26
19
  }) => import("react/jsx-runtime").JSX.Element;
27
- export {};
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './components/button';
2
2
  export * from './components/chip';
3
3
  export * from './components/flex';
4
+ export * from './components/icons';
4
5
  export * from './components/input';
5
6
  export * from './components/modal';
6
7
  export * from './components/progress-bar';