@goodhood-web/ui 3.0.0-development.22 → 3.0.0-development.23

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,7 +1,8 @@
1
1
  import { ButtonOwnProps } from '@mui/base';
2
- import { AriaRole, ForwardedRef, MouseEvent, ReactElement, ReactNode } from 'react';
2
+ import { AriaRole, ElementType, ForwardedRef, MouseEvent, ReactElement, ReactNode } from 'react';
3
3
  import { IconProps } from '../../../Base/Icon/Icon.types';
4
4
  interface CommonProps {
5
+ allowedIcons?: ElementType[];
5
6
  ariaDescribedBy?: string;
6
7
  ariaLabel?: string;
7
8
  ariaLabelledBy?: string;
@@ -9,7 +10,9 @@ interface CommonProps {
9
10
  'data-testid'?: string;
10
11
  disabled?: boolean;
11
12
  isToggleButton?: boolean;
13
+ leftIcon?: ReactElement<IconProps>;
12
14
  ref?: ForwardedRef<null>;
15
+ rightIcon?: ReactElement<IconProps>;
13
16
  role?: AriaRole;
14
17
  selected?: boolean;
15
18
  }
@@ -25,9 +28,7 @@ export interface LinkProps extends CommonProps {
25
28
  }
26
29
  export interface ButtonVariationProps {
27
30
  fullWidth?: boolean;
28
- leftIcon?: ReactElement<IconProps>;
29
31
  loading?: boolean;
30
- rightIcon?: ReactElement<IconProps>;
31
32
  size?: 'small' | 'medium' | 'large' | 'extraLarge';
32
33
  target?: string;
33
34
  text?: string;
@@ -1,3 +1,3 @@
1
1
  import { ButtonPrimaryProps } from './ButtonPrimary.types';
2
- declare const ButtonPrimary: ({ children, className, color, disabled, fullWidth, leftIcon, loading, rightIcon, size, text, ...props }: ButtonPrimaryProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const ButtonPrimary: ({ children, className, color, disabled, fullWidth, loading, size, text, ...props }: ButtonPrimaryProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default ButtonPrimary;
@@ -1,3 +1,3 @@
1
1
  import { ButtonSecondaryProps } from './ButtonSecondary.types';
2
- declare const ButtonSecondary: ({ children, className, color, disabled, fullWidth, leftIcon, loading, rightIcon, size, text, ...props }: ButtonSecondaryProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const ButtonSecondary: ({ children, className, color, disabled, fullWidth, loading, size, text, ...props }: ButtonSecondaryProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default ButtonSecondary;
@@ -1,3 +1,3 @@
1
1
  import { ButtonTertiaryProps } from './ButtonTertiary.types';
2
- declare const ButtonTertiary: ({ children, className, color, disabled, fullWidth, leftIcon, loading, rightIcon, size, text, ...props }: ButtonTertiaryProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const ButtonTertiary: ({ children, className, color, disabled, fullWidth, loading, size, text, ...props }: ButtonTertiaryProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default ButtonTertiary;
@@ -5,5 +5,5 @@ export declare const typographyType: {
5
5
  medium: string;
6
6
  small: string;
7
7
  };
8
- export declare function TextButton({ className, color, disabled, leftIcon, rightIcon, size, text, ...props }: TextButtonProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function TextButton({ className, color, disabled, size, text, ...props }: TextButtonProps): import("react/jsx-runtime").JSX.Element;
9
9
  export default TextButton;
@@ -1,12 +1,7 @@
1
- import { ReactElement } from 'react';
2
- import { IconProps } from '../../../Base/Icon/Icon.types';
3
- import { NotificationBubbleProps } from '../../NotificationBubble/NotificationBubble.types';
4
1
  import { ButtonProps } from '../Button/Button.types';
5
2
  export interface TextButtonProps extends Omit<ButtonProps, 'role' | 'className'> {
6
3
  className?: string;
7
4
  color: 'green' | 'blue' | 'deepPurple' | 'pinkLight' | 'pinkDark';
8
- leftIcon?: ReactElement<IconProps | NotificationBubbleProps>;
9
- rightIcon?: ReactElement<IconProps | NotificationBubbleProps>;
10
5
  size: 'large' | 'medium' | 'small' | 'link';
11
6
  text: string;
12
7
  type?: 'button' | 'submit' | 'reset';
@@ -1,3 +1,3 @@
1
- import { default as NoticeProps } from './Notice.types';
2
- declare const Notice: (props: NoticeProps) => import("react/jsx-runtime").JSX.Element;
1
+ import { NoticeInfoProps, NoticeWarningProps } from './Notice.types';
2
+ declare const Notice: ({ bodyText, color, context, cta, dismissible, headline, icon, markdown, notificationBubble, onDismiss, size, type, variant, }: NoticeWarningProps | NoticeInfoProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Notice;
@@ -1,18 +1,65 @@
1
1
  import { IconButtonProps } from '../../../Atoms/Buttons/IconButton/IconButton.types';
2
2
  import { TextButtonProps } from '../../../Atoms/Buttons/TextButton/TextButton.types';
3
3
  import { NotificationBubbleProps } from '../../../Atoms/NotificationBubble/NotificationBubble.types';
4
- import { Icon24 } from '../../../Base/Icon/Icon.types';
5
- export default interface NoticeProps {
6
- context: 'warning' | 'infoGrey' | 'infoGreen' | 'infoVanilla';
7
- dismissible?: boolean;
8
- iconName?: Icon24;
4
+ import { Icon24, Icon32 } from '../../../Base/Icon/Icon.types';
5
+ interface NoticePropsBase {
6
+ bodyText?: string;
7
+ cta?: {
8
+ color?: TextButtonProps['color'];
9
+ onClick: TextButtonProps['onClick'];
10
+ text: string;
11
+ };
12
+ headline: string;
13
+ icon?: {
14
+ name: Icon24;
15
+ size?: '24';
16
+ } | {
17
+ name: Icon32;
18
+ size: '32';
19
+ };
9
20
  markdown?: boolean;
10
21
  notificationBubble?: NotificationBubbleProps;
11
- onClick?: TextButtonProps['onClick'];
12
- onDismiss?: IconButtonProps['onClick'];
13
- primaryText: string;
14
- secondaryText?: string;
15
- size: 'small' | 'medium';
16
- textButton?: string;
17
- type: 'embedded' | 'sticky';
22
+ size?: 'small' | 'medium';
23
+ type?: 'embedded' | 'sticky';
24
+ variant?: 'detailed' | 'simple';
18
25
  }
26
+ type NoticeProps = (NoticePropsBase & ({
27
+ bodyText?: never;
28
+ variant?: 'simple';
29
+ } | {
30
+ bodyText: string;
31
+ variant: 'detailed';
32
+ }) & {
33
+ dismissible?: false;
34
+ onDismiss?: IconButtonProps['onClick'];
35
+ }) | (NoticePropsBase & ({
36
+ bodyText: string;
37
+ variant: 'detailed';
38
+ } | {
39
+ bodyText?: never;
40
+ variant?: 'simple';
41
+ }) & {
42
+ dismissible?: true;
43
+ onDismiss: IconButtonProps['onClick'];
44
+ });
45
+ export type NoticeWarningProps = {
46
+ color?: 'pinkDark' | 'pinkLight';
47
+ context: 'warning';
48
+ } & NoticeProps;
49
+ export type NoticeInfoProps = {
50
+ color?: 'green' | 'grey' | 'vanilla';
51
+ context?: 'info';
52
+ } & NoticeProps;
53
+ export declare const VariantEnum: {
54
+ readonly DETAILED: "detailed";
55
+ readonly SIMPLE: "simple";
56
+ };
57
+ export declare const SizeEnum: {
58
+ readonly MEDIUM: "medium";
59
+ readonly SMALL: "small";
60
+ };
61
+ export declare const ContextEnum: {
62
+ readonly INFO: "info";
63
+ readonly WARNING: "warning";
64
+ };
65
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodhood-web/ui",
3
- "version": "3.0.0-development.22",
3
+ "version": "3.0.0-development.23",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "repository": "https://github.com/good-hood-gmbh/goodhood-web",