ingred-ui 14.9.0 → 14.10.0

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,5 +1,4 @@
1
1
  import * as React from "react";
2
- import { Props as BaseButtonProps } from "./internal/BaseButton";
3
2
  import { Theme } from "../../themes";
4
3
  export type ButtonSize = "small" | "medium" | "large";
5
4
  export type ButtonColor = "primary" | "secondary" | "danger" | "clear";
@@ -25,7 +24,7 @@ export type Padding = {
25
24
  size: ButtonSize;
26
25
  color: ButtonColor;
27
26
  };
28
- export type ButtonProps = Omit<BaseButtonProps, "color"> & {
27
+ type baseProps = {
29
28
  /**
30
29
  * The component used for the root node.
31
30
  * Default: `<button />`
@@ -40,29 +39,20 @@ export type ButtonProps = Omit<BaseButtonProps, "color"> & {
40
39
  inline?: boolean;
41
40
  size?: ButtonSize;
42
41
  onClick?: (event: React.MouseEvent<Element, MouseEvent>) => void;
42
+ } & React.ComponentPropsWithoutRef<"button">;
43
+ type AnchorProps = Omit<baseProps, "onClick"> & {
43
44
  /**
44
45
  * If added this props, root node becomes `<a />`.
45
46
  */
46
- href?: string;
47
+ href: string;
48
+ target?: "_blank" | "_self" | "_parent" | "_top";
49
+ rel?: string;
47
50
  };
48
- declare const Button: React.ForwardRefExoticComponent<Omit<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>>, "color"> & {
49
- /**
50
- * The component used for the root node.
51
- * Default: `<button />`
52
- */
53
- component?: keyof JSX.IntrinsicElements | React.ComponentType<{
54
- className: string;
55
- }> | undefined;
56
- color?: ButtonColor | undefined;
57
- /**
58
- * Control whether "inline" or "block" Element.
59
- */
60
- inline?: boolean | undefined;
61
- size?: ButtonSize | undefined;
62
- onClick?: ((event: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
63
- /**
64
- * If added this props, root node becomes `<a />`.
65
- */
66
- href?: string | undefined;
67
- } & React.RefAttributes<HTMLElement>>;
51
+ type BaseButtonProps = baseProps & {
52
+ href?: undefined;
53
+ target?: undefined;
54
+ rel?: undefined;
55
+ };
56
+ export type ButtonProps = BaseButtonProps | AnchorProps;
57
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
68
58
  export default Button;
@@ -3,16 +3,7 @@ import { StoryObj } from "@storybook/react";
3
3
  import { ButtonProps } from "./Button";
4
4
  declare const _default: {
5
5
  title: string;
6
- components: React.ForwardRefExoticComponent<Omit<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>>, "color"> & {
7
- component?: keyof JSX.IntrinsicElements | React.ComponentType<{
8
- className: string;
9
- }> | undefined;
10
- color?: import("./Button").ButtonColor | undefined;
11
- inline?: boolean | undefined;
12
- size?: import("./Button").ButtonSize | undefined;
13
- onClick?: ((event: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
14
- href?: string | undefined;
15
- } & React.RefAttributes<HTMLElement>>;
6
+ components: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
16
7
  args: {
17
8
  onClick: import("@storybook/addon-actions").HandlerFunction;
18
9
  };
@@ -8,16 +8,7 @@ declare const _default: {
8
8
  disabled?: boolean | undefined;
9
9
  } & React.RefAttributes<HTMLDivElement>>;
10
10
  subcomponents: {
11
- Button: React.ForwardRefExoticComponent<Omit<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>>, "color"> & {
12
- component?: keyof JSX.IntrinsicElements | React.ComponentType<{
13
- className: string;
14
- }> | undefined;
15
- color?: import("../Button/Button").ButtonColor | undefined;
16
- inline?: boolean | undefined;
17
- size?: import("../Button/Button").ButtonSize | undefined;
18
- onClick?: ((event: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
19
- href?: string | undefined;
20
- } & React.RefAttributes<HTMLElement>>;
11
+ Button: React.ForwardRefExoticComponent<import("..").ButtonProps & React.RefAttributes<HTMLElement>>;
21
12
  };
22
13
  };
23
14
  export default _default;
@@ -1,32 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare const ButtonContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
- export declare const MainButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>>, "color"> & {
4
- component?: keyof JSX.IntrinsicElements | import("react").ComponentType<{
5
- className: string;
6
- }> | undefined;
7
- color?: import("../Button/Button").ButtonColor | undefined;
8
- inline?: boolean | undefined;
9
- size?: import("../Button/Button").ButtonSize | undefined;
10
- onClick?: ((event: import("react").MouseEvent<Element, MouseEvent>) => void) | undefined;
11
- href?: string | undefined;
12
- } & import("react").RefAttributes<HTMLElement>>, import("styled-components").DefaultTheme, {}, never>;
13
- export declare const SplitToggle: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>>, "color"> & {
14
- component?: keyof JSX.IntrinsicElements | import("react").ComponentType<{
15
- className: string;
16
- }> | undefined;
17
- color?: import("../Button/Button").ButtonColor | undefined;
18
- inline?: boolean | undefined;
19
- size?: import("../Button/Button").ButtonSize | undefined;
20
- onClick?: ((event: import("react").MouseEvent<Element, MouseEvent>) => void) | undefined;
21
- href?: string | undefined;
22
- } & import("react").RefAttributes<HTMLElement>>, import("styled-components").DefaultTheme, {}, never>;
23
- export declare const SingleButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>>, "color"> & {
24
- component?: keyof JSX.IntrinsicElements | import("react").ComponentType<{
25
- className: string;
26
- }> | undefined;
27
- color?: import("../Button/Button").ButtonColor | undefined;
28
- inline?: boolean | undefined;
29
- size?: import("../Button/Button").ButtonSize | undefined;
30
- onClick?: ((event: import("react").MouseEvent<Element, MouseEvent>) => void) | undefined;
31
- href?: string | undefined;
32
- } & import("react").RefAttributes<HTMLElement>>, import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const MainButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Button").ButtonProps & import("react").RefAttributes<HTMLElement>>, import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const SplitToggle: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Button").ButtonProps & import("react").RefAttributes<HTMLElement>>, import("styled-components").DefaultTheme, {}, never>;
5
+ export declare const SingleButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Button").ButtonProps & import("react").RefAttributes<HTMLElement>>, import("styled-components").DefaultTheme, {}, never>;