@7shifts/sous-chef 3.87.0-beta.1 → 3.87.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.
Files changed (32) hide show
  1. package/dist/actions/Button/Button.d.ts +12 -1
  2. package/dist/actions/PaginationControls/PaginationControls.d.ts +5 -0
  3. package/dist/core/SousChefProvider/context/ProviderConfigContext.d.ts +0 -1
  4. package/dist/feedback/InlineBanner/InlineBanner.d.ts +7 -0
  5. package/dist/feedback/MicroBanner/MicroBanner.d.ts +7 -1
  6. package/dist/forms/PhoneField/usePhoneField.d.ts +0 -1
  7. package/dist/forms/SelectField/useSelectField.d.ts +0 -1
  8. package/dist/forms/TextField/useTextField.d.ts +0 -1
  9. package/dist/forms/hooks/useDateFieldControllers.d.ts +0 -1
  10. package/dist/forms/hooks/useMultiSelectFieldControllers.d.ts +0 -1
  11. package/dist/forms/hooks/usePhoneFieldControllers.d.ts +0 -1
  12. package/dist/forms/hooks/useRangeFieldControllers.d.ts +0 -1
  13. package/dist/forms/hooks/useSelectFieldControllers.d.ts +0 -1
  14. package/dist/foundation/tokens/color/color-constants.d.ts +3 -0
  15. package/dist/foundation/tokens/color/color-types.d.ts +1 -1
  16. package/dist/foundation/types.d.ts +40 -10
  17. package/dist/hooks/usePositionStyles.d.ts +0 -1
  18. package/dist/i18n/TranslationsContext.d.ts +0 -1
  19. package/dist/index.css +67 -128
  20. package/dist/index.css.map +1 -1
  21. package/dist/index.js +10 -11
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.modern.js +10 -11
  24. package/dist/index.modern.js.map +1 -1
  25. package/dist/lists/DataTable/DataTableContext.d.ts +0 -1
  26. package/dist/lists/hooks/useDataTableScrollState.d.ts +0 -1
  27. package/dist/overlay/KebabMenu/types.d.ts +0 -1
  28. package/dist/overlay/Tooltip/Tooltip.d.ts +3 -0
  29. package/dist/overlay/hooks/useListKeyboardNavigation/types.d.ts +0 -1
  30. package/dist/utils/elements.d.ts +0 -1
  31. package/dist/utils/types.d.ts +0 -1
  32. package/package.json +15 -18
@@ -3,9 +3,11 @@ import type { ButtonTheme, ButtonSize, ButtonType, ButtonTarget } from './types'
3
3
  import type { PositionStyles, DataProps } from '../../foundation/types';
4
4
  declare const Button: React.ForwardRefExoticComponent<{
5
5
  children: React.ReactNode;
6
+ /** Native HTML button type. If `submit` it will trigger the form `onSubmit`. */
6
7
  type?: ButtonType | undefined;
7
- /** It controls the button theme */
8
+ /** Button design theme */
8
9
  theme?: ButtonTheme | undefined;
10
+ /** It turns the disabled state of the button on. */
9
11
  disabled?: boolean | undefined;
10
12
  onClick?: React.MouseEventHandler<Element> | undefined;
11
13
  onMouseEnter?: React.MouseEventHandler<Element> | undefined;
@@ -14,10 +16,19 @@ declare const Button: React.ForwardRefExoticComponent<{
14
16
  onFocus?: React.FocusEventHandler<Element> | undefined;
15
17
  onKeyDown?: React.KeyboardEventHandler<Element> | undefined;
16
18
  id?: string | undefined;
19
+ /** It turns the loading state of the button on. */
17
20
  loading?: boolean | undefined;
18
21
  /** This will show a black tooltip when the user hover the button */
19
22
  title?: string | React.ReactNode;
23
+ /**
24
+ * @description It will show a black tooltip when the user hover the button.
25
+ * @category Acting as Link
26
+ */
20
27
  href?: string | undefined;
28
+ /**
29
+ * @description It will open the link in a new tab or the same tab depending on the value.
30
+ * @category Acting as Link
31
+ */
21
32
  target?: ButtonTarget | undefined;
22
33
  testId?: string | undefined;
23
34
  /**
@@ -1,11 +1,16 @@
1
1
  import React from 'react';
2
2
  import { DataProps } from '../../foundation/types';
3
3
  type Props = {
4
+ /** It will enable or disable the `Previous` button. */
4
5
  hasPrevious?: boolean;
6
+ /** It will enable or disable the `Next` button. */
5
7
  hasNext?: boolean;
8
+ /** It will be fired when the `Previous` button is clicked */
6
9
  onPreviousClick: () => void;
10
+ /** It will be fired when the `Next` button is clicked */
7
11
  onNextClick: () => void;
8
12
  testId?: string;
13
+ /** It is a target element that will be scrolled to the top when the buttons are clicked */
9
14
  scrollTarget?: React.RefObject<HTMLElement>;
10
15
  } & DataProps;
11
16
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CountryCode } from 'libphonenumber-js';
3
2
  import { TimeFormat } from '../../../forms/TimeField/types';
4
3
  export type ProviderConfigContextType = {
@@ -3,12 +3,19 @@ import { InlineBannerTheme } from './types';
3
3
  import { PositionStyles } from '../../foundation/types';
4
4
  type Props = {
5
5
  children: React.ReactNode;
6
+ /** Banner design theme */
6
7
  theme?: InlineBannerTheme;
8
+ /** Overrides the default icon determined by the theme. Generally you should not use this prop in order to maintain visual consistency between banner colours and icons. It is recommended to only use icons that are already in Sous Chef. */
7
9
  icon?: React.ReactElement;
10
+ /** It adds a title to the banner and changes the banner format to multi-line */
8
11
  title?: string;
12
+ /** It is the callback function to close the banner */
9
13
  onClose?: () => void;
14
+ /** It describes the CTA options */
10
15
  caption?: React.ReactNode;
16
+ /** It is the primary CTA button */
11
17
  primaryButton?: React.ReactElement;
18
+ /** It is the secondary CTA button */
12
19
  secondaryButton?: React.ReactElement;
13
20
  testId?: string;
14
21
  } & PositionStyles;
@@ -1,13 +1,19 @@
1
1
  import React from 'react';
2
2
  import { MicroBannerTheme } from './types';
3
+ import { PositionStyles } from 'foundation/types';
3
4
  type Props = {
4
5
  children?: React.ReactNode;
6
+ /** Banner design theme */
5
7
  theme?: MicroBannerTheme;
8
+ /** Overrides the default icon determined by the theme. Generally you should not use this prop in order to maintain visual consistency between banner colours and icons. It is recommended to only use icons that are already in Sous Chef. */
6
9
  icon?: React.ReactElement;
10
+ /** Turns off the display of the icon */
7
11
  hideIcon?: boolean;
12
+ /** Adds a title to the banner above the body content */
8
13
  title?: string;
14
+ /** The primary CTA button */
9
15
  primaryButton?: React.ReactElement;
10
16
  testId?: string;
11
- };
17
+ } & PositionStyles;
12
18
  declare const MicroBanner: React.FC<Props>;
13
19
  export default MicroBanner;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { RefType } from '../../utils/types';
3
2
  import type { Props } from './PhoneField';
4
3
  type UseTextFieldProps = Props & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Props } from './SelectField';
3
2
  import { CustomComponentsExtraProps } from './types';
4
3
  export declare const useSelectField: <T extends unknown>({ asToolbarFilter, caption, disabled, error, id, isClearable, label, menuShouldScrollIntoView, name, noOptionsMessage, options, onBlur, onChange, placeholder, value, defaultValue, CustomOption: UserCustomOption, SelectedOptionPrefix, testId, creatableButton, onCreate, isSearchable, autoFocus, ...rest }: Props<T>) => {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { RefType } from '../../utils/types';
3
2
  import type { Props } from './TextField';
4
3
  import type { DataProps } from '../../foundation/types';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type FieldControls = {
3
2
  id: string;
4
3
  error?: React.ReactNode;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { SelectOption } from '../SelectField/types';
3
2
  type FieldControls<T> = {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CountryCode } from 'libphonenumber-js';
3
2
  type FieldControls = {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type FieldControls<T> = {
3
2
  id: string;
4
3
  error?: React.ReactNode;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { SelectOption } from '../SelectField/types';
3
2
  type FieldControls<T> = {
4
3
  id: string;
@@ -162,6 +162,9 @@ export declare const COLORS: {
162
162
  readonly 'warning-on-container-variant': "var(--color-warning-on-container-variant)";
163
163
  readonly 'shadow-overlay': "var(--color-shadow-overlay)";
164
164
  readonly 'shadow-active': "var(--color-shadow-active)";
165
+ readonly 'hover-inverse': "var(--color-hover-inverse)";
166
+ readonly 'hover-lighten': "var(--color-hover-lighten)";
167
+ readonly 'hover-darken': "var(--color-hover-darken)";
165
168
  readonly 'brand-neutrals-caviar-dynamic': "var(--color-brand-neutrals-caviar-dynamic)";
166
169
  readonly 'brand-neutrals-chefscoat-dynamic': "var(--color-brand-neutrals-chefscoat-dynamic)";
167
170
  };
@@ -1 +1 @@
1
- export type Color = 'white' | 'black' | 'tangerine-100' | 'tangerine-200' | 'tangerine-300' | 'tangerine-400' | 'tangerine-500' | 'tangerine-600' | 'eggplant-100' | 'eggplant-200' | 'eggplant-300' | 'eggplant-400' | 'eggplant-500' | 'eggplant-600' | 'mint-100' | 'mint-200' | 'mint-300' | 'mint-400' | 'mint-500' | 'mint-600' | 'radish-100' | 'radish-200' | 'radish-300' | 'radish-400' | 'radish-500' | 'radish-600' | 'blueberry-100' | 'blueberry-200' | 'blueberry-300' | 'blueberry-400' | 'blueberry-500' | 'blueberry-600' | 'banana-100' | 'banana-200' | 'banana-300' | 'banana-400' | 'banana-500' | 'banana-600' | 'grey-100' | 'grey-200' | 'grey-300' | 'grey-400' | 'grey-500' | 'grey-600' | 'oat-100' | 'oat-200' | 'oat-300' | 'oat-400' | 'oat-500' | 'oat-600' | 'lime-100' | 'lime-200' | 'lime-300' | 'lime-400' | 'lime-500' | 'lime-600' | 'blackberry-100' | 'blackberry-200' | 'blackberry-300' | 'blackberry-400' | 'blackberry-500' | 'blackberry-600' | 'neutral-color' | 'neutral-on-color' | 'neutral-container' | 'neutral-on-container' | 'neutral-container-variant' | 'neutral-on-container-variant' | 'neutral-black-transparent-05' | 'neutral-black-transparent-10' | 'neutral-black-transparent-15' | 'neutral-black-transparent-20' | 'neutral-black-transparent-30' | 'neutral-black-transparent-40' | 'neutral-black-transparent-50' | 'neutral-black-transparent-60' | 'neutral-black-transparent-70' | 'neutral-black-transparent-80' | 'neutral-black-transparent-90' | 'neutral-white-transparent-05' | 'neutral-white-transparent-10' | 'neutral-white-transparent-15' | 'neutral-white-transparent-20' | 'neutral-white-transparent-30' | 'neutral-white-transparent-40' | 'neutral-white-transparent-50' | 'neutral-white-transparent-60' | 'neutral-white-transparent-70' | 'neutral-white-transparent-80' | 'neutral-white-transparent-90' | 'surface-color-overlay' | 'surface-color-dim' | 'surface-color' | 'surface-on-color-disabled' | 'surface-on-color-subtle' | 'surface-on-color' | 'surface-on-color-bold' | 'surface-container' | 'surface-container-high' | 'surface-container-highest' | 'surface-container-disabled' | 'surface-container-disabled-variant' | 'surface-on-container-disabled' | 'surface-inverse' | 'surface-on-inverse' | 'surface-on-inverse-disabled' | 'outline' | 'outline-variant' | 'outline-inverse' | 'primary-color' | 'primary-on-color' | 'primary-color-variant' | 'primary-on-color-variant' | 'primary-container' | 'primary-on-container' | 'primary-container-variant' | 'primary-on-container-variant' | 'secondary-color' | 'secondary-on-color' | 'secondary-container' | 'secondary-on-container' | 'secondary-container-variant' | 'secondary-on-container-variant' | 'tertiary-color' | 'tertiary-on-color' | 'tertiary-container' | 'tertiary-on-container' | 'tertiary-container-variant' | 'tertiary-on-container-variant' | 'success-color' | 'success-on-color' | 'success-container' | 'success-on-container' | 'success-container-variant' | 'success-on-container-variant' | 'danger-color' | 'danger-on-color' | 'danger-container' | 'danger-on-container' | 'danger-container-variant' | 'danger-on-container-variant' | 'info-color' | 'info-on-color' | 'info-container' | 'info-on-container' | 'info-container-variant' | 'info-on-container-variant' | 'upsell-color' | 'upsell-on-color' | 'upsell-color-variant' | 'upsell-on-color-variant' | 'upsell-container' | 'upsell-on-container' | 'upsell-container-variant' | 'upsell-on-container-variant' | 'warning-color' | 'warning-on-color' | 'warning-container' | 'warning-on-container' | 'warning-container-variant' | 'warning-on-container-variant' | 'shadow-overlay' | 'shadow-active' | 'brand-neutrals-caviar-dynamic' | 'brand-neutrals-chefscoat-dynamic';
1
+ export type Color = 'white' | 'black' | 'tangerine-100' | 'tangerine-200' | 'tangerine-300' | 'tangerine-400' | 'tangerine-500' | 'tangerine-600' | 'eggplant-100' | 'eggplant-200' | 'eggplant-300' | 'eggplant-400' | 'eggplant-500' | 'eggplant-600' | 'mint-100' | 'mint-200' | 'mint-300' | 'mint-400' | 'mint-500' | 'mint-600' | 'radish-100' | 'radish-200' | 'radish-300' | 'radish-400' | 'radish-500' | 'radish-600' | 'blueberry-100' | 'blueberry-200' | 'blueberry-300' | 'blueberry-400' | 'blueberry-500' | 'blueberry-600' | 'banana-100' | 'banana-200' | 'banana-300' | 'banana-400' | 'banana-500' | 'banana-600' | 'grey-100' | 'grey-200' | 'grey-300' | 'grey-400' | 'grey-500' | 'grey-600' | 'oat-100' | 'oat-200' | 'oat-300' | 'oat-400' | 'oat-500' | 'oat-600' | 'lime-100' | 'lime-200' | 'lime-300' | 'lime-400' | 'lime-500' | 'lime-600' | 'blackberry-100' | 'blackberry-200' | 'blackberry-300' | 'blackberry-400' | 'blackberry-500' | 'blackberry-600' | 'neutral-color' | 'neutral-on-color' | 'neutral-container' | 'neutral-on-container' | 'neutral-container-variant' | 'neutral-on-container-variant' | 'neutral-black-transparent-05' | 'neutral-black-transparent-10' | 'neutral-black-transparent-15' | 'neutral-black-transparent-20' | 'neutral-black-transparent-30' | 'neutral-black-transparent-40' | 'neutral-black-transparent-50' | 'neutral-black-transparent-60' | 'neutral-black-transparent-70' | 'neutral-black-transparent-80' | 'neutral-black-transparent-90' | 'neutral-white-transparent-05' | 'neutral-white-transparent-10' | 'neutral-white-transparent-15' | 'neutral-white-transparent-20' | 'neutral-white-transparent-30' | 'neutral-white-transparent-40' | 'neutral-white-transparent-50' | 'neutral-white-transparent-60' | 'neutral-white-transparent-70' | 'neutral-white-transparent-80' | 'neutral-white-transparent-90' | 'surface-color-overlay' | 'surface-color-dim' | 'surface-color' | 'surface-on-color-disabled' | 'surface-on-color-subtle' | 'surface-on-color' | 'surface-on-color-bold' | 'surface-container' | 'surface-container-high' | 'surface-container-highest' | 'surface-container-disabled' | 'surface-container-disabled-variant' | 'surface-on-container-disabled' | 'surface-inverse' | 'surface-on-inverse' | 'surface-on-inverse-disabled' | 'outline' | 'outline-variant' | 'outline-inverse' | 'primary-color' | 'primary-on-color' | 'primary-color-variant' | 'primary-on-color-variant' | 'primary-container' | 'primary-on-container' | 'primary-container-variant' | 'primary-on-container-variant' | 'secondary-color' | 'secondary-on-color' | 'secondary-container' | 'secondary-on-container' | 'secondary-container-variant' | 'secondary-on-container-variant' | 'tertiary-color' | 'tertiary-on-color' | 'tertiary-container' | 'tertiary-on-container' | 'tertiary-container-variant' | 'tertiary-on-container-variant' | 'success-color' | 'success-on-color' | 'success-container' | 'success-on-container' | 'success-container-variant' | 'success-on-container-variant' | 'danger-color' | 'danger-on-color' | 'danger-container' | 'danger-on-container' | 'danger-container-variant' | 'danger-on-container-variant' | 'info-color' | 'info-on-color' | 'info-container' | 'info-on-container' | 'info-container-variant' | 'info-on-container-variant' | 'upsell-color' | 'upsell-on-color' | 'upsell-color-variant' | 'upsell-on-color-variant' | 'upsell-container' | 'upsell-on-container' | 'upsell-container-variant' | 'upsell-on-container-variant' | 'warning-color' | 'warning-on-color' | 'warning-container' | 'warning-on-container' | 'warning-container-variant' | 'warning-on-container-variant' | 'shadow-overlay' | 'shadow-active' | 'hover-inverse' | 'hover-lighten' | 'hover-darken' | 'brand-neutrals-caviar-dynamic' | 'brand-neutrals-chefscoat-dynamic';
@@ -1,23 +1,53 @@
1
1
  export type PositionStyles = {
2
- /** Shortcut for `margin`. */
2
+ /**
3
+ * @description Shortcut for `margin`.
4
+ * @category Positioning
5
+ */
3
6
  m?: string | number;
4
- /** Defines the margin around of the element. */
7
+ /**
8
+ * @description Defines the margin around of the element.
9
+ * @category Positioning
10
+ */
5
11
  margin?: string | number;
6
- /** Shortcut for `marginTop`. */
12
+ /**
13
+ * @description Shortcut for `marginTop`.
14
+ * @category Positioning
15
+ */
7
16
  mt?: string | number;
8
- /** Defines the margin on the top of the element. */
17
+ /**
18
+ * @description Defines the margin on the top of the element.
19
+ * @category Positioning
20
+ */
9
21
  marginTop?: string | number;
10
- /** Shortcut for `marginRight`. */
22
+ /**
23
+ * @description Shortcut for `marginRight`.
24
+ * @category Positioning
25
+ */
11
26
  mr?: string | number;
12
- /** Defines the margin on the right side of the element. */
27
+ /**
28
+ * @description Defines the margin on the right side of the element.
29
+ * @category Positioning
30
+ */
13
31
  marginRight?: string | number;
14
- /** Shortcut for `marginBottom`. */
32
+ /**
33
+ * @description Shortcut for `marginBottom`.
34
+ * @category Positioning
35
+ */
15
36
  mb?: string | number;
16
- /** Defines the margin on the bottom of the element. */
37
+ /**
38
+ * @description Defines the margin on the bottom of the element.
39
+ * @category Positioning
40
+ */
17
41
  marginBottom?: string | number;
18
- /** Shortcut for `marginLeft`. */
42
+ /**
43
+ * @description Shortcut for `marginLeft`.
44
+ * @category Positioning
45
+ */
19
46
  ml?: string | number;
20
- /** Defines the margin on the left side of the element. */
47
+ /**
48
+ * @description Defines the margin on the left side of the element.
49
+ * @category Positioning
50
+ */
21
51
  marginLeft?: string | number;
22
52
  };
23
53
  export type DataProps = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PositionStyles } from '../foundation/types';
3
2
  type CSSPositionStyles = Pick<React.CSSProperties, 'margin' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft'>;
4
3
  export declare const usePositionStyles: ({ m, margin, marginTop, mt, marginRight, mr, marginBottom, mb, marginLeft, ml }: PositionStyles) => CSSPositionStyles;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import en from './locales/en.json';
3
2
  export type TranslationsContextType = {
4
3
  i18n: typeof en;