@7shifts/sous-chef 3.87.2-beta.0 → 3.88.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.
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ /**
3
+ * Helper function to check if content is already a React element
4
+ */
5
+ export declare const isReactElement: (content: React.ReactNode) => content is React.ReactElement<any, string | React.JSXElementConstructor<any>>;
@@ -27,7 +27,8 @@ type Props<T> = {
27
27
  /** This is to allow disable the seach functionality. Use it just in some edge-cases, for example in touch devices when the user clicks on the field it opens a virtual keyboard to search, sometimes that virtual keyboard taks much space then passing `isSearchable={false}` prevents opening it. */
28
28
  isSearchable?: boolean;
29
29
  creatableButton?: React.ReactNode;
30
- onCreate?: (option: string) => void;
30
+ /** Callback when creating a new option. For grouped options, the groupLabel parameter will be provided. For non-grouped options, groupLabel will be undefined. */
31
+ onCreate?: (option: string, groupLabel?: string) => void;
31
32
  isClearable?: boolean;
32
33
  };
33
34
  /** Component to make possible choose from a predefined options. */
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import Button from '../../../actions/Button';
3
+ type Props = {
4
+ creatableButton: React.ReactNode;
5
+ onClick: () => void;
6
+ inputValue?: string;
7
+ onInputValueChange?: (value: string) => void;
8
+ alignLeft?: boolean;
9
+ };
10
+ /**
11
+ * Shared creatable button component used in CustomMenu and CustomGroupWithCreate.
12
+ * Handles both string labels and custom Button elements.
13
+ */
14
+ declare const CreatableButton: ({ creatableButton, onClick, inputValue, onInputValueChange, alignLeft }: Props) => React.ReactElement<typeof Button>;
15
+ export default CreatableButton;
@@ -0,0 +1 @@
1
+ export { default } from './CreatableButton';
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ textFieldRef: React.RefObject<HTMLInputElement>;
4
+ onMenuInputFocus: (isFocused: boolean) => void;
5
+ onSubmit: () => void;
6
+ defaultValue?: string;
7
+ wrapperClassName?: string;
8
+ inputClassName?: string;
9
+ testId: string;
10
+ };
11
+ /**
12
+ * Shared input form component used in CustomMenu and CustomGroupWithCreate.
13
+ * Provides text input + submit button for creating new options.
14
+ */
15
+ declare const CreateInputForm: ({ textFieldRef, onMenuInputFocus, onSubmit, defaultValue, wrapperClassName, inputClassName, testId }: Props) => React.JSX.Element;
16
+ export default CreateInputForm;
@@ -0,0 +1 @@
1
+ export { default } from './CreateInputForm';
@@ -0,0 +1,7 @@
1
+ import React, { ComponentProps } from 'react';
2
+ import { components } from 'react-select';
3
+ type Props = ComponentProps<typeof components.Group> & {
4
+ selectProps: any;
5
+ };
6
+ declare function CustomGroupWithCreate(props: Props): React.JSX.Element;
7
+ export default CustomGroupWithCreate;
@@ -0,0 +1 @@
1
+ export { default } from './CustomGroupWithCreate';
@@ -35,7 +35,8 @@ export type Props<T> = {
35
35
  /** This is used for setting the data-testid */
36
36
  testId?: string;
37
37
  creatableButton?: React.ReactNode;
38
- onCreate?: (option: string) => void;
38
+ /** Callback when creating a new option. For grouped options, the groupLabel parameter will be provided. For non-grouped options, groupLabel will be undefined. */
39
+ onCreate?: (option: string, groupLabel?: string) => void;
39
40
  /** This is to allow disable the seach functionality. Use it just in some edge-cases, for example in touch devices when the user clicks on the field it opens a virtual keyboard to search, sometimes that virtual keyboard taks much space then passing `isSearchable={false}` prevents opening it. */
40
41
  isSearchable?: boolean;
41
42
  autoFocus?: boolean;
@@ -26,5 +26,5 @@ export type CustomComponentsExtraProps = {
26
26
  SelectedOptionPrefix?: React.ElementType;
27
27
  creatableButton?: ReactNode;
28
28
  onMenuInputFocus: (isFocused: boolean) => void;
29
- onCreate?: (option: string) => void;
29
+ onCreate?: (option: string, groupLabel?: string) => void;
30
30
  };
@@ -0,0 +1,15 @@
1
+ import { RefObject } from 'react';
2
+ type Params = {
3
+ ref: RefObject<HTMLElement>;
4
+ shouldCheck: boolean;
5
+ };
6
+ /**
7
+ * This hook checks the background color of the container element
8
+ * and determines if it's dark or light. It climbs up the DOM tree
9
+ * to find the first ancestor with a non-transparent background color.
10
+ *
11
+ * NOTE: Use this hook only when necessary, as it involves DOM access
12
+ * and may impact performance.
13
+ */
14
+ export declare const useContainerBackgroundColorCheck: ({ ref, shouldCheck }: Params) => "dark" | "light" | undefined;
15
+ export {};
@@ -35,7 +35,19 @@
35
35
  "september": "September",
36
36
  "october": "October",
37
37
  "november": "November",
38
- "december": "December"
38
+ "december": "December",
39
+ "januaryShort": "Jan",
40
+ "februaryShort": "Feb",
41
+ "marchShort": "Mar",
42
+ "aprilShort": "Apr",
43
+ "mayShort": "May",
44
+ "juneShort": "Jun",
45
+ "julyShort": "Jul",
46
+ "augustShort": "Aug",
47
+ "septemberShort": "Sep",
48
+ "octoberShort": "Oct",
49
+ "novemberShort": "Nov",
50
+ "decemberShort": "Dec"
39
51
  },
40
52
  "Card": {
41
53
  "dismiss": "Dismiss"
package/dist/index.css CHANGED
@@ -896,13 +896,13 @@ Just for future references:
896
896
  }
897
897
  ._obtsl:disabled {
898
898
  background: transparent;
899
- border-color: var(--color-outline);
900
- color: var(--color-surface-on-color-disabled);
899
+ border-color: var(--color-surface-on-inverse-disabled);
900
+ color: var(--color-surface-on-inverse-disabled);
901
901
  }
902
902
  ._obtsl[aria-disabled=true] {
903
903
  background: transparent;
904
- border-color: var(--color-outline);
905
- color: var(--color-surface-on-color-disabled);
904
+ border-color: var(--color-surface-on-inverse-disabled);
905
+ color: var(--color-surface-on-inverse-disabled);
906
906
  }
907
907
 
908
908
  ._00jK4 {
@@ -921,13 +921,13 @@ Just for future references:
921
921
  }
922
922
  ._00jK4:disabled {
923
923
  background: transparent;
924
- border-color: transparent;
925
- color: var(--color-surface-on-color-disabled);
924
+ border-color: var(--color-surface-on-inverse-disabled);
925
+ color: var(--color-surface-on-inverse-disabled);
926
926
  }
927
927
  ._00jK4[aria-disabled=true] {
928
928
  background: transparent;
929
- border-color: transparent;
930
- color: var(--color-surface-on-color-disabled);
929
+ border-color: var(--color-surface-on-inverse-disabled);
930
+ color: var(--color-surface-on-inverse-disabled);
931
931
  }
932
932
 
933
933
  ._JPwJ7 {
@@ -1110,6 +1110,9 @@ Just for future references:
1110
1110
  color: var(--color-surface-on-color);
1111
1111
  text-decoration: underline;
1112
1112
  }
1113
+ ._weJDR {
1114
+ color: var(--color-surface-on-inverse);
1115
+ }
1113
1116
  ._sp-pT {
1114
1117
  position: absolute;
1115
1118
  list-style: none;
@@ -2093,6 +2096,9 @@ input:checked ~ ._kmvBP::after {
2093
2096
  input:focus-visible + ._kmvBP {
2094
2097
  outline: var(--color-primary-color) solid 1px;
2095
2098
  }
2099
+ ._Id4qm input:disabled {
2100
+ cursor: default;
2101
+ }
2096
2102
  input:disabled + ._kmvBP {
2097
2103
  background-color: var(--color-surface-container-disabled);
2098
2104
  border: 1px solid var(--color-outline);
@@ -3258,6 +3264,28 @@ input:disabled + ._kmvBP::after {
3258
3264
  ._1XpI4 {
3259
3265
  padding: 8px 4px 8px 4px;
3260
3266
  }
3267
+ ._Qw267 button {
3268
+ justify-content: flex-start;
3269
+ }
3270
+ ._f9V5D button:active {
3271
+ transform: none;
3272
+ }
3273
+ ._JZG4r {
3274
+ box-sizing: border-box;
3275
+ width: 100%;
3276
+ }
3277
+
3278
+ ._04fIM {
3279
+ margin: 0;
3280
+ }
3281
+
3282
+ ._oJzDV {
3283
+ padding: 0 4px 0 4px;
3284
+ }
3285
+
3286
+ ._hLu2D {
3287
+ padding: 0;
3288
+ }
3261
3289
  ._vqC1M {
3262
3290
  margin-right: 28px;
3263
3291
  }
@@ -3321,6 +3349,42 @@ input:disabled + ._kmvBP::after {
3321
3349
  border-radius: 0px var(--border-radius-400) var(--border-radius-400) 0px;
3322
3350
  border-left: 0;
3323
3351
  }
3352
+ ._KJp1e {
3353
+ width: 260px;
3354
+ padding: 12px;
3355
+ box-sizing: border-box;
3356
+ }
3357
+ ._Mn-1P {
3358
+ font-weight: var(--p-font-weight-bold);
3359
+ font-size: var(--font-size-normal);
3360
+ border: none;
3361
+ background-color: transparent;
3362
+ color: var(--color-surface-on-color);
3363
+ border-radius: var(--border-radius-400);
3364
+ }
3365
+ ._Mn-1P:focus {
3366
+ box-shadow: 0 0 8px 0 var(--color-shadow-active);
3367
+ outline: none;
3368
+ }
3369
+ ._5TJrn {
3370
+ width: 52px;
3371
+ text-align: center;
3372
+ padding: 8px;
3373
+ border-radius: var(--border-radius-600);
3374
+ cursor: pointer;
3375
+ border: none;
3376
+ background-color: transparent;
3377
+ color: var(--color-surface-on-color);
3378
+ }
3379
+ ._QxJjU {
3380
+ color: var(--color-primary-color);
3381
+ }
3382
+ ._TqBVI {
3383
+ background-color: var(--color-primary-container);
3384
+ }
3385
+ ._5TJrn:hover {
3386
+ background-color: var(--color-primary-container);
3387
+ }
3324
3388
  ._RezMY {
3325
3389
  display: inline-flex;
3326
3390
  gap: 2px;
@@ -3743,6 +3807,9 @@ input:checked ~ ._Yfxkl::after {
3743
3807
  input:focus-visible + ._Yfxkl {
3744
3808
  outline: var(--color-primary-color) solid 1px;
3745
3809
  }
3810
+ ._7fVpn input:disabled {
3811
+ cursor: default;
3812
+ }
3746
3813
  input:disabled + ._Yfxkl {
3747
3814
  background-color: var(--color-surface-container-disabled);
3748
3815
  border: 1px solid var(--color-outline);