@7shifts/sous-chef 3.29.2 → 3.30.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.
- package/dist/actions/Button/Button.d.ts +21 -19
- package/dist/actions/Link/Link.d.ts +3 -2
- package/dist/actions/PaginationControls/PaginationControls.d.ts +2 -1
- package/dist/actions/Toggle/Toggle.d.ts +2 -1
- package/dist/forms/MultiSelectField/MultiSelectField.d.ts +3 -1
- package/dist/index.js +421 -349
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +421 -349
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/props.d.ts +27 -0
- package/dist/utils/storybookArgTypes.d.ts +12 -0
- package/dist/utils/string.d.ts +1 -0
- package/package.json +1 -1
- package/dist/foundation/types.d.ts +0 -22
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import type { ButtonTheme, ButtonSize, ButtonType, ButtonTarget } from './types';
|
|
3
|
+
import type { PositionStyles, DataProps } from '../../foundation/types';
|
|
4
|
+
declare type Props = {
|
|
4
5
|
children: React.ReactNode;
|
|
5
|
-
type?:
|
|
6
|
+
type?: ButtonType;
|
|
6
7
|
/** It controls the button theme */
|
|
7
|
-
theme?:
|
|
8
|
-
disabled?: boolean
|
|
9
|
-
onClick?:
|
|
10
|
-
onMouseEnter?:
|
|
11
|
-
onMouseLeave?:
|
|
12
|
-
onBlur?:
|
|
13
|
-
onFocus?:
|
|
14
|
-
onKeyDown?:
|
|
15
|
-
id?: string
|
|
16
|
-
loading?: boolean
|
|
8
|
+
theme?: ButtonTheme;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onClick?: React.MouseEventHandler;
|
|
11
|
+
onMouseEnter?: React.MouseEventHandler;
|
|
12
|
+
onMouseLeave?: React.MouseEventHandler;
|
|
13
|
+
onBlur?: React.FocusEventHandler;
|
|
14
|
+
onFocus?: React.FocusEventHandler;
|
|
15
|
+
onKeyDown?: React.KeyboardEventHandler;
|
|
16
|
+
id?: string;
|
|
17
|
+
loading?: boolean;
|
|
17
18
|
/** This will show a black tooltip when the user hover the button */
|
|
18
|
-
title?: React.ReactNode;
|
|
19
|
-
href?: string
|
|
20
|
-
target?:
|
|
21
|
-
testId?: string
|
|
19
|
+
title?: string | React.ReactNode;
|
|
20
|
+
href?: string;
|
|
21
|
+
target?: ButtonTarget;
|
|
22
|
+
testId?: string;
|
|
22
23
|
/**
|
|
23
24
|
* This prop controls how the button grows having the following options:<br/>
|
|
24
25
|
* *full-width*: Will grow to fill the size of the container it is placed within.
|
|
25
26
|
* *min-width-100*: It will have a `min-width: 100` style. It is used for CTA buttons in forms and modals.
|
|
26
27
|
*/
|
|
27
|
-
size?:
|
|
28
|
-
} & PositionStyles &
|
|
28
|
+
size?: ButtonSize;
|
|
29
|
+
} & PositionStyles & DataProps;
|
|
30
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, any> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
29
31
|
export default _default;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Target, Theme } from './types';
|
|
3
|
+
import { DataProps } from '../../foundation/types';
|
|
3
4
|
declare type Props = {
|
|
4
5
|
href: string;
|
|
5
6
|
target?: Target;
|
|
6
7
|
theme?: Theme;
|
|
7
8
|
onClick?: React.MouseEventHandler;
|
|
8
9
|
children: React.ReactNode;
|
|
9
|
-
};
|
|
10
|
-
declare const Link: ({ href, target, theme, onClick, children }: Props) => React.JSX.Element;
|
|
10
|
+
} & DataProps;
|
|
11
|
+
declare const Link: ({ href, target, theme, onClick, children, ...otherProps }: Props) => React.JSX.Element;
|
|
11
12
|
export default Link;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { DataProps } from '../../foundation/types';
|
|
2
3
|
declare type Props = {
|
|
3
4
|
hasPrevious?: boolean;
|
|
4
5
|
hasNext?: boolean;
|
|
@@ -6,7 +7,7 @@ declare type Props = {
|
|
|
6
7
|
onNextClick: () => void;
|
|
7
8
|
testId?: string;
|
|
8
9
|
scrollTarget?: React.RefObject<HTMLElement>;
|
|
9
|
-
};
|
|
10
|
+
} & DataProps;
|
|
10
11
|
/**
|
|
11
12
|
* `PaginationControls` are two buttons side by side.
|
|
12
13
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { DataProps } from '../../foundation/types';
|
|
2
3
|
declare type Props = {
|
|
3
4
|
/** It turns the toggle ON if `true` and OFF if `false` */
|
|
4
5
|
checked: boolean;
|
|
@@ -8,7 +9,7 @@ declare type Props = {
|
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
id?: string;
|
|
10
11
|
testId?: string;
|
|
11
|
-
};
|
|
12
|
+
} & DataProps;
|
|
12
13
|
/**
|
|
13
14
|
* Used when you want to allow the user to turn some information ON and OFF.
|
|
14
15
|
*
|
|
@@ -16,6 +16,8 @@ declare type Props<T> = {
|
|
|
16
16
|
caption?: React.ReactNode;
|
|
17
17
|
error?: React.ReactNode;
|
|
18
18
|
placeholder?: string;
|
|
19
|
+
/** Use a prefix for things like currency symbols (“$”, “¥”, “£”) or icons. */
|
|
20
|
+
prefix?: React.ReactNode;
|
|
19
21
|
noOptionsMessage?: string | NoOptionsMessageFunction;
|
|
20
22
|
disabled?: boolean;
|
|
21
23
|
closeOnSelect?: boolean;
|
|
@@ -28,5 +30,5 @@ declare type Props<T> = {
|
|
|
28
30
|
onCreate?: (option: string) => void;
|
|
29
31
|
};
|
|
30
32
|
/** Component to make possible choose from a predefined options. */
|
|
31
|
-
declare const MultiSelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, label, caption, error, placeholder, noOptionsMessage, disabled, closeOnSelect, menuShouldScrollIntoView: menuShouldScrollIntoViewProp, testId, isSearchable, creatableButton, onCreate }: Props<T>) => React.JSX.Element;
|
|
33
|
+
declare const MultiSelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, label, caption, error, placeholder, prefix, noOptionsMessage, disabled, closeOnSelect, menuShouldScrollIntoView: menuShouldScrollIntoViewProp, testId, isSearchable, creatableButton, onCreate }: Props<T>) => React.JSX.Element;
|
|
32
34
|
export default MultiSelectField;
|