@7shifts/sous-chef 2.10.0 → 2.12.1

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 (28) hide show
  1. package/dist/feedback/InlineBanner/ButtonCTA/ButtonCTA.d.ts +10 -0
  2. package/dist/feedback/InlineBanner/ButtonCTA/index.d.ts +1 -0
  3. package/dist/feedback/InlineBanner/InlineBanner.d.ts +13 -0
  4. package/dist/feedback/InlineBanner/InlineBannerCTA/InlineBannerCTA.d.ts +11 -0
  5. package/dist/feedback/InlineBanner/InlineBannerCTA/index.d.ts +1 -0
  6. package/dist/feedback/InlineBanner/InlineBannerIcon/InlineBannerIcon.d.ts +6 -0
  7. package/dist/feedback/InlineBanner/InlineBannerIcon/index.d.ts +1 -0
  8. package/dist/feedback/InlineBanner/constants.d.ts +11 -0
  9. package/dist/feedback/InlineBanner/index.d.ts +1 -0
  10. package/dist/feedback/InlineBanner/types.d.ts +1 -0
  11. package/dist/feedback/index.d.ts +2 -0
  12. package/dist/forms/AsyncSelectField/AsyncSelectField.d.ts +12 -0
  13. package/dist/forms/AsyncSelectField/CustomList/CustomList.d.ts +8 -0
  14. package/dist/forms/AsyncSelectField/CustomList/index.d.ts +1 -0
  15. package/dist/forms/AsyncSelectField/index.d.ts +1 -0
  16. package/dist/forms/AsyncSelectField/types.d.ts +5 -0
  17. package/dist/forms/DateField/DateField.d.ts +1 -0
  18. package/dist/forms/SelectField/CustomControl/CustomControl.d.ts +5 -5
  19. package/dist/forms/SelectField/CustomOption/CustomOption.d.ts +5 -5
  20. package/dist/forms/SelectField/SelectField.d.ts +2 -2
  21. package/dist/forms/SelectField/useSelectField.d.ts +12 -0
  22. package/dist/forms/index.d.ts +3 -1
  23. package/dist/index.css +136 -0
  24. package/dist/index.js +305 -57
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.modern.js +304 -58
  27. package/dist/index.modern.js.map +1 -1
  28. package/package.json +7 -3
@@ -0,0 +1,10 @@
1
+ import { InlineBannerTheme } from '../types';
2
+ import React from 'react';
3
+ declare type ButtonCTAProps = {
4
+ button: React.ReactElement;
5
+ bannerTheme: InlineBannerTheme;
6
+ primaryCTA?: boolean;
7
+ };
8
+ /** Infers theme prop for Sous Chef Button CTAs if not explicitly passed, default is hollow, primaryCTA is Upsell if banner theme is Upsell*/
9
+ declare const ButtonCTA: ({ button, bannerTheme, primaryCTA }: ButtonCTAProps) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
10
+ export default ButtonCTA;
@@ -0,0 +1 @@
1
+ export { default } from './ButtonCTA';
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { InlineBannerTheme } from './types';
3
+ declare type Props = {
4
+ children: React.ReactNode;
5
+ theme?: InlineBannerTheme;
6
+ title?: string;
7
+ onClose?: () => void;
8
+ caption?: string;
9
+ primaryButton?: React.ReactElement;
10
+ secondaryButton?: React.ReactElement;
11
+ };
12
+ declare const InlineBanner: React.FC<Props>;
13
+ export default InlineBanner;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { InlineBannerTheme } from '../types';
3
+ declare type Props = {
4
+ primaryButton: React.ReactElement;
5
+ secondaryButton?: React.ReactElement;
6
+ caption?: string;
7
+ multiLine: boolean;
8
+ bannerTheme: InlineBannerTheme;
9
+ };
10
+ declare const InlineBannerCTA: ({ primaryButton, secondaryButton, caption, multiLine, bannerTheme }: Props) => JSX.Element;
11
+ export default InlineBannerCTA;
@@ -0,0 +1 @@
1
+ export { default } from './InlineBannerCTA';
@@ -0,0 +1,6 @@
1
+ import { InlineBannerTheme } from '../types';
2
+ declare type BannerIconProps = {
3
+ theme: InlineBannerTheme;
4
+ };
5
+ declare const InlineBannerIcon: ({ theme }: BannerIconProps) => JSX.Element;
6
+ export default InlineBannerIcon;
@@ -0,0 +1 @@
1
+ export { default } from './InlineBannerIcon';
@@ -0,0 +1,11 @@
1
+ export declare const BANNER_THEME: {
2
+ INFO: "info";
3
+ WARNING: "warning";
4
+ SUCCESS: "success";
5
+ DANGER: "danger";
6
+ UPSELL: "upsell";
7
+ };
8
+ export declare const BUTTON_THEME: {
9
+ HOLLOW: "hollow";
10
+ UPSELL: "upsell";
11
+ };
@@ -0,0 +1 @@
1
+ export { default } from './InlineBanner';
@@ -0,0 +1 @@
1
+ export declare type InlineBannerTheme = 'info' | 'warning' | 'success' | 'danger' | 'upsell';
@@ -1,2 +1,4 @@
1
1
  import Spinner from './Spinner';
2
+ import InlineBanner from './InlineBanner';
2
3
  export { Spinner };
4
+ export { InlineBanner };
@@ -0,0 +1,12 @@
1
+ import type { Props as SelectProps } from '../SelectField/SelectField';
2
+ import { AsyncSelectOptions } from './types';
3
+ declare type Props<T> = {
4
+ /** It is a function that takes the input search as parameter and returns a Promise with all the options and if there are more options to load. */
5
+ loadOptions: (inputValue: string) => Promise<AsyncSelectOptions<T>>;
6
+ } & Omit<SelectProps<T>, 'options'>;
7
+ /**
8
+ * Component to make possible choose from async options. It looks exactly as the [SelectField](./?path=/docs/forms-selectfield--default) but, this one handle asynchronous options.
9
+ * Instead of passing a `options` props, this component requires a `loadOptions` prop.
10
+ * */
11
+ declare const AsyncSelectField: <T extends unknown>({ loadOptions, ...props }: Props<T>) => JSX.Element;
12
+ export default AsyncSelectField;
@@ -0,0 +1,8 @@
1
+ import { ComponentProps } from 'react';
2
+ import { components } from 'react-select';
3
+ declare type Props = ComponentProps<typeof components.MenuList> & {
4
+ hasMoreOptions: boolean;
5
+ hasMoreOptionsFirstLoad: boolean | null | undefined;
6
+ };
7
+ declare const CustomList: ({ children, hasMoreOptions, hasMoreOptionsFirstLoad, ...props }: Props) => JSX.Element;
8
+ export default CustomList;
@@ -0,0 +1 @@
1
+ export { default } from './CustomList';
@@ -0,0 +1 @@
1
+ export { default } from './AsyncSelectField';
@@ -0,0 +1,5 @@
1
+ import { SelectOptions } from '../SelectField/types';
2
+ export declare type AsyncSelectOptions<T> = {
3
+ options: SelectOptions<T>;
4
+ hasMore: boolean;
5
+ };
@@ -17,6 +17,7 @@ declare type Props = {
17
17
  disabled?: boolean;
18
18
  defaultValue?: Date;
19
19
  readOnly?: boolean;
20
+ onMonthChange?: (month: Date) => void;
20
21
  };
21
22
  /** DateField form element. */
22
23
  declare const DateField: React.FC<Props>;
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
- import { ControlProps } from 'react-select';
3
- interface Props<T> extends ControlProps<T, false> {
1
+ import React, { ComponentProps } from 'react';
2
+ import { components } from 'react-select';
3
+ declare type Props = ComponentProps<typeof components.Control> & {
4
4
  CustomPrefixComponent: React.ElementType;
5
- }
6
- declare function CustomControl<T>({ children, CustomPrefixComponent, ...props }: Props<T>): JSX.Element;
5
+ };
6
+ declare function CustomControl({ children, CustomPrefixComponent, ...props }: Props): JSX.Element;
7
7
  export default CustomControl;
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
- import { OptionProps } from 'react-select';
3
- interface Props<T> extends OptionProps<T, false> {
1
+ import React, { ComponentProps } from 'react';
2
+ import { components } from 'react-select';
3
+ declare type Props = ComponentProps<typeof components.Option> & {
4
4
  CustomComponent: React.ElementType;
5
- }
6
- declare function CustomOption<T>({ children, CustomComponent, ...props }: Props<T>): JSX.Element;
5
+ };
6
+ declare function CustomOption({ children, CustomComponent, ...props }: Props): JSX.Element;
7
7
  export default CustomOption;
@@ -3,7 +3,7 @@ import type { SelectOption, SelectOptions } from './types';
3
3
  declare type NoOptionsMessageFunction = (input: {
4
4
  inputValue: string;
5
5
  }) => string | null;
6
- declare type Props<T> = {
6
+ export declare type Props<T> = {
7
7
  asToolbarFilter?: boolean;
8
8
  caption?: React.ReactNode;
9
9
  disabled?: boolean;
@@ -27,5 +27,5 @@ declare type Props<T> = {
27
27
  SelectedOptionPrefix?: React.ElementType;
28
28
  };
29
29
  /** Component to make possible choose from a predefined options. */
30
- declare const SelectField: <T extends unknown>({ asToolbarFilter, caption, disabled, error, id: inputId, isClearable, label, menuShouldScrollIntoView, name, noOptionsMessage, options, onBlur, onChange, placeholder, prefix, value, CustomOption: UserCustomOption, SelectedOptionPrefix }: Props<T>) => JSX.Element;
30
+ declare const SelectField: <T extends unknown>(props: Props<T>) => JSX.Element;
31
31
  export default SelectField;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { Props } from './SelectField';
3
+ export declare const useSelectField: <T extends unknown>({ asToolbarFilter, caption, disabled, error, id, isClearable, label, menuShouldScrollIntoView, name, noOptionsMessage, options, onBlur, onChange, placeholder, value, CustomOption: UserCustomOption, SelectedOptionPrefix }: Props<T>) => {
4
+ selectProps: Pick<import("react-select").Props<import("react-select").OptionTypeBase, boolean, import("react-select").GroupTypeBase<any>>, React.ReactText> & import("react-select/src/stateManager").Props<import("react-select").OptionTypeBase, boolean, import("react-select").GroupTypeBase<any>> & import("react-select").Props<import("react-select").OptionTypeBase, boolean, import("react-select").GroupTypeBase<any>>;
5
+ fieldProps: {
6
+ caption: React.ReactNode;
7
+ error: string | undefined;
8
+ id: string;
9
+ label: React.ReactNode;
10
+ name: string;
11
+ };
12
+ };
@@ -9,13 +9,15 @@ import RadioGroupOption from './RadioGroupOption';
9
9
  import PasswordField from './PasswordField';
10
10
  import MultiSelectField from './MultiSelectField';
11
11
  import SelectField from './SelectField';
12
+ import AsyncSelectField from './AsyncSelectField';
12
13
  import DateField from './DateField';
13
14
  import DateRangeField from './DateRangeField';
14
15
  import WeekField from './WeekField';
15
16
  import TimeField from './TimeField';
16
17
  import CurrencyField from './CurrencyField';
17
18
  import PercentageField from './PercentageField';
18
- export { Form, FormRow, TextAreaField, TextField, CheckboxField, PillSelectField, RadioGroupField, RadioGroupOption, PasswordField, MultiSelectField, SelectField, DateField, DateRangeField, WeekField, TimeField, CurrencyField, PercentageField, SIZE_25_PERCENT, SIZE_33_PERCENT, SIZE_50_PERCENT, SIZE_66_PERCENT, SIZE_75_PERCENT };
19
+ export { Form, FormRow, TextAreaField, TextField, CheckboxField, PillSelectField, RadioGroupField, RadioGroupOption, PasswordField, MultiSelectField, SelectField, AsyncSelectField, DateField, DateRangeField, WeekField, TimeField, CurrencyField, PercentageField, SIZE_25_PERCENT, SIZE_33_PERCENT, SIZE_50_PERCENT, SIZE_66_PERCENT, SIZE_75_PERCENT };
19
20
  export type { PasswordCriteria } from './PasswordField/types';
20
21
  export type { SelectOption, SelectOptions } from './SelectField/types';
22
+ export type { AsyncSelectOptions } from './AsyncSelectField/types';
21
23
  export type { FormikType } from './Form/types';
package/dist/index.css CHANGED
@@ -1706,6 +1706,27 @@ The smaller the number the lighter the color. So $eggplant-100 would be light pu
1706
1706
  The base colour is the default colour and is numbered with 400. If someone says "use Tangerine" they are referring to the base color.
1707
1707
  Please ask a designer if you have questions about which colours to use.
1708
1708
  */
1709
+ ._uC4zU {
1710
+ font-family: "Proxima Nova", sans-serif;
1711
+ font-weight: 16px;
1712
+ font-size: 14px;
1713
+ color: #929292;
1714
+ display: flex;
1715
+ flex-direction: column;
1716
+ justify-content: center;
1717
+ padding: 8px 12px;
1718
+ }
1719
+ /*********************************
1720
+ For new colours, see _colors.scss.
1721
+ **********************************/
1722
+ /* stylelint-disable color-no-hex */
1723
+ /*
1724
+ These are the colour variables to be used around the webapp.
1725
+ The variables are set up to describe the color and number which represents the lightness of the color.
1726
+ The smaller the number the lighter the color. So $eggplant-100 would be light purple and $eggplant-600 would be dark purple.
1727
+ The base colour is the default colour and is numbered with 400. If someone says "use Tangerine" they are referring to the base color.
1728
+ Please ask a designer if you have questions about which colours to use.
1729
+ */
1709
1730
  ._1btTx, ._1Sc9D {
1710
1731
  padding: 7px;
1711
1732
  line-height: 22px;
@@ -2569,6 +2590,121 @@ The smaller the number the lighter the color. So $eggplant-100 would be light pu
2569
2590
  The base colour is the default colour and is numbered with 400. If someone says "use Tangerine" they are referring to the base color.
2570
2591
  Please ask a designer if you have questions about which colours to use.
2571
2592
  */
2593
+ ._vgLin {
2594
+ padding: 16px 12px 16px 12px;
2595
+ background: #f8f8f8;
2596
+ margin-left: 1px;
2597
+ margin-right: 1px;
2598
+ position: relative;
2599
+ border-radius: 3px;
2600
+ box-shadow: 0 0 0 1px rgba(63, 63, 68, 0.05), 0 1px 3px 0 rgba(63, 63, 68, 0.15);
2601
+ }
2602
+
2603
+ ._63TwY {
2604
+ font-weight: 600;
2605
+ font-size: 14px;
2606
+ line-height: 16px;
2607
+ color: #555;
2608
+ }
2609
+
2610
+ ._3n6S7 {
2611
+ font-size: 14px;
2612
+ line-height: 16px;
2613
+ flex-grow: 1;
2614
+ color: #555;
2615
+ }
2616
+
2617
+ ._2pMYs {
2618
+ margin-bottom: 4px;
2619
+ }
2620
+
2621
+ ._ON6Eg {
2622
+ background: #f6fdff;
2623
+ box-shadow: 0 0 0 1px rgba(81, 172, 199, 0.15), 0 1px 3px 0 rgba(81, 172, 199, 0.25);
2624
+ }
2625
+ ._ON6Eg ._1-D-E {
2626
+ color: #51acc7;
2627
+ }
2628
+
2629
+ ._1FFZh {
2630
+ background: #ecfaf8;
2631
+ box-shadow: 0 0 0 1px rgba(53, 172, 154, 0.15), 0 1px 3px 0 rgba(53, 172, 154, 0.25);
2632
+ }
2633
+ ._1FFZh ._1-D-E {
2634
+ color: #35ac9a;
2635
+ }
2636
+
2637
+ ._2R34O {
2638
+ background: #fcf0f0;
2639
+ box-shadow: 0 0 0 1px rgba(207, 92, 92, 0.15), 0 1px 3px 0 rgba(207, 92, 92, 0.25);
2640
+ }
2641
+ ._2R34O ._1-D-E {
2642
+ color: #cf5c5c;
2643
+ }
2644
+
2645
+ ._3Cfhe {
2646
+ background: #fff9ed;
2647
+ box-shadow: 0 0 0 1px rgba(229, 178, 66, 0.15), 0 1px 3px 0 rgba(229, 178, 66, 0.25);
2648
+ }
2649
+ ._3Cfhe ._1-D-E {
2650
+ color: #e5b242;
2651
+ }
2652
+
2653
+ ._1SIOw {
2654
+ background: #f0f3fb;
2655
+ box-shadow: 0 0 0 1px rgba(97, 121, 198, 0.15), 0 1px 3px 0 rgba(97, 121, 198, 0.25);
2656
+ }
2657
+ ._1SIOw ._1-D-E {
2658
+ color: #6179c6;
2659
+ }
2660
+
2661
+ ._3SNQ1 {
2662
+ position: absolute;
2663
+ width: 38px;
2664
+ height: 38px;
2665
+ top: 4px;
2666
+ right: 4px;
2667
+ }
2668
+
2669
+ ._3nLTI {
2670
+ padding-top: 12px;
2671
+ padding-bottom: 12px;
2672
+ }
2673
+ ._3nLTI ._3SNQ1 {
2674
+ position: static;
2675
+ }
2676
+ ._3nLTI ._3n6S7 {
2677
+ display: flex;
2678
+ align-items: center;
2679
+ min-height: 38px;
2680
+ }
2681
+ /*********************************
2682
+ For new colours, see _colors.scss.
2683
+ **********************************/
2684
+ /* stylelint-disable color-no-hex */
2685
+ /*
2686
+ These are the colour variables to be used around the webapp.
2687
+ The variables are set up to describe the color and number which represents the lightness of the color.
2688
+ The smaller the number the lighter the color. So $eggplant-100 would be light purple and $eggplant-600 would be dark purple.
2689
+ The base colour is the default colour and is numbered with 400. If someone says "use Tangerine" they are referring to the base color.
2690
+ Please ask a designer if you have questions about which colours to use.
2691
+ */
2692
+ ._1jqm8 {
2693
+ font-size: 12px;
2694
+ line-height: 12px;
2695
+ color: #555;
2696
+ }
2697
+ /*********************************
2698
+ For new colours, see _colors.scss.
2699
+ **********************************/
2700
+ /* stylelint-disable color-no-hex */
2701
+ /*
2702
+ These are the colour variables to be used around the webapp.
2703
+ The variables are set up to describe the color and number which represents the lightness of the color.
2704
+ The smaller the number the lighter the color. So $eggplant-100 would be light purple and $eggplant-600 would be dark purple.
2705
+ The base colour is the default colour and is numbered with 400. If someone says "use Tangerine" they are referring to the base color.
2706
+ Please ask a designer if you have questions about which colours to use.
2707
+ */
2572
2708
  ._2puqJ {
2573
2709
  position: fixed;
2574
2710
  inset: 0px;