@7shifts/sous-chef 3.87.0-beta.2 → 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.
@@ -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;
@@ -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;
package/dist/index.css CHANGED
@@ -4180,12 +4180,20 @@ input:disabled + ._Yfxkl::after {
4180
4180
  border-top-left-radius: 0;
4181
4181
  border-bottom-left-radius: 0;
4182
4182
  }
4183
+ ._GyYnE {
4184
+ color: transparent;
4185
+ }
4186
+ ._GyYnE:focus {
4187
+ color: var(--color-surface-on-color);
4188
+ }
4189
+ ._GyYnE:disabled {
4190
+ color: transparent;
4191
+ }
4183
4192
  ._ddacu {
4184
4193
  font-family: var(--font-family-body);
4185
4194
  font-size: var(--font-size-200);
4186
4195
  line-height: var(--font-line-height-200);
4187
4196
  font-weight: var(--p-font-weight-normal);
4188
- background-color: var(--color-surface-container);
4189
4197
  position: absolute;
4190
4198
  height: 36px;
4191
4199
  margin-top: 1px;
@@ -4196,7 +4204,6 @@ input:disabled + ._Yfxkl::after {
4196
4204
  }
4197
4205
  ._o1-zA {
4198
4206
  color: var(--color-surface-on-container-disabled);
4199
- background-color: var(--color-surface-container-disabled);
4200
4207
  }
4201
4208
  ._Q0GfJ {
4202
4209
  flex-grow: 1;