@7shifts/sous-chef 4.3.0 → 4.4.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/controls/ToolbarSelect/ToolbarSelect.d.ts +1 -1
- package/dist/forms/AsyncSelectField/AsyncSelectField.d.ts +1 -1
- package/dist/forms/CheckboxField/CheckboxField.d.ts +1 -1
- package/dist/forms/CurrencyField/CurrencyField.d.ts +2 -2
- package/dist/forms/DateField/DateField.d.ts +1 -1
- package/dist/forms/DateRangeField/DateRangeField.d.ts +1 -1
- package/dist/forms/MultiSelectField/MultiSelectField.d.ts +1 -1
- package/dist/forms/NumberField/NumberField.d.ts +1 -2
- package/dist/forms/PasswordField/PasswordField.d.ts +1 -1
- package/dist/forms/PercentageField/PercentageField.d.ts +1 -2
- package/dist/forms/PillSelectField/PillSelectField.d.ts +1 -1
- package/dist/forms/RadioGroupField/RadioGroupField.d.ts +1 -1
- package/dist/forms/SelectField/SelectField.d.ts +1 -1
- package/dist/forms/TextAreaField/TextAreaField.d.ts +1 -0
- package/dist/forms/TextField/TextField.d.ts +1 -0
- package/dist/forms/TimeField/TimeField.d.ts +2 -2
- package/dist/forms/TimeRangeField/TimeRangeField.d.ts +1 -0
- package/dist/forms/WeekField/WeekField.d.ts +1 -1
- package/dist/hooks/useScrollDetector.d.ts +1 -1
- package/dist/index.css +87 -3
- package/dist/index.css.map +1 -1
- package/dist/index.js +136 -82
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +141 -88
- package/dist/index.modern.js.map +1 -1
- package/dist/navigation/PrimaryNav/PrimaryNav.d.ts +3 -1
- package/dist/navigation/PrimaryNav/PrimaryNavContext.d.ts +3 -1
- package/dist/navigation/PrimaryNavItem/PrimaryNavItem.d.ts +3 -2
- package/dist/navigation/PrimaryNavSubItem/PrimaryNavSubItem.d.ts +3 -2
- package/package.json +2 -1
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { Props } from '../../forms/SelectField/SelectField';
|
|
3
3
|
import { DataProps } from '../../foundation/types';
|
|
4
4
|
type ToolbarSelectProps<T> = Omit<Props<T>, 'asToolbarFilter' | 'caption' | 'error' | 'id' | 'isClearable' | 'label' | 'noOptionMessage' | 'CustomOption' | 'SelectedOptionPrefix' | 'isSearchable'> & DataProps;
|
|
5
|
-
/**
|
|
5
|
+
/** ToolbarSelect is a compact dropdown filter for use in toolbars. It lets a user narrow page content or a paired component content by selecting from a predefined list of options. */
|
|
6
6
|
declare const ToolbarSelect: <T extends unknown>({ name, value, options, onChange, onBlur, placeholder, defaultValue, menuShouldScrollIntoView, disabled, prefix, testId, creatableButton, onCreate, ...rest }: ToolbarSelectProps<T>) => React.JSX.Element;
|
|
7
7
|
export default ToolbarSelect;
|
|
@@ -8,7 +8,7 @@ type Props<T> = {
|
|
|
8
8
|
key?: string | number;
|
|
9
9
|
} & Omit<SelectProps<T>, 'options'>;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* A variation of select field that loads a dynamic list of options from a source rather than a fixed set of options. Use when you need to select from a dynamic list that can change such as roles, employees, locations, etc.
|
|
12
12
|
* Instead of passing a `options` props, this component requires a `loadOptions` prop.
|
|
13
13
|
* */
|
|
14
14
|
declare const AsyncSelectField: <T extends unknown>({ loadOptions, ...props }: Props<T>) => React.JSX.Element;
|
|
@@ -14,6 +14,6 @@ type Props = {
|
|
|
14
14
|
/** This is used for setting the data-testid */
|
|
15
15
|
testId?: string;
|
|
16
16
|
} & DataProps;
|
|
17
|
-
/**
|
|
17
|
+
/** A simple check box with an option beside it. Allows the user to confirm a statement or enable an option with a simple boolean action. Use for things like agreeing to terms, or enabling one or more options in a list (where multiple selections are allowed). */
|
|
18
18
|
declare const CheckboxField: React.FC<Props>;
|
|
19
19
|
export default CheckboxField;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Props as TextFieldProps } from '../TextField/TextField';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* A variation of a TextField, but it only accepts numbers, and will auto format the number into a currency format when the user leaves the field. Use anytime the user must enter a currency value and nothing else.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* **You are in charge of validating the value and parsing it back to a value that you can use on your application**.
|
|
7
7
|
*/
|
|
8
8
|
declare const CurrencyField: React.ForwardRefExoticComponent<{
|
|
9
9
|
autoComplete?: ("off" | "on") | undefined;
|
|
@@ -22,6 +22,6 @@ type Props = {
|
|
|
22
22
|
testId?: string;
|
|
23
23
|
weekStart?: WeekStart;
|
|
24
24
|
};
|
|
25
|
-
/**
|
|
25
|
+
/** A dropdown style field for selecting a single specific date. It will load a calendar widget when activated allowing the user to find and pick a day. */
|
|
26
26
|
declare const DateField: React.FC<Props>;
|
|
27
27
|
export default DateField;
|
|
@@ -21,6 +21,6 @@ type Props = {
|
|
|
21
21
|
maxDays?: number;
|
|
22
22
|
testId?: string;
|
|
23
23
|
};
|
|
24
|
-
/**
|
|
24
|
+
/** A dropdown style field with 2 inputs. It allows the user to select a specific start date and end date separately to create a range of dates. . */
|
|
25
25
|
declare const DateRangeField: React.FC<Props>;
|
|
26
26
|
export default DateRangeField;
|
|
@@ -31,6 +31,6 @@ type Props<T> = {
|
|
|
31
31
|
onCreate?: (option: string, groupLabel?: string) => void;
|
|
32
32
|
isClearable?: boolean;
|
|
33
33
|
};
|
|
34
|
-
/**
|
|
34
|
+
/** A dropdown style field that lets you select and input more than one option within the field. Uses removable chips to represent selected items. */
|
|
35
35
|
declare const MultiSelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, label, caption, error, placeholder, prefix, noOptionsMessage, disabled, closeOnSelect, menuShouldScrollIntoView, testId, isSearchable, creatableButton, onCreate, isClearable }: Props<T>) => React.JSX.Element;
|
|
36
36
|
export default MultiSelectField;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Props as TextFieldProps } from '../TextField/TextField';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* In its default state it only allows whole numbers, but it can be configured to allow decimals and negative values.
|
|
4
|
+
* A special text input field that only accepts numbers. It has validation and formatting in place to properly display number values. In its default state it only allows whole numbers, but it can be configured to allow decimals and negative values.
|
|
6
5
|
*/
|
|
7
6
|
declare const NumberField: React.ForwardRefExoticComponent<{
|
|
8
7
|
max?: number | undefined;
|
|
@@ -15,6 +15,6 @@ type Props = {
|
|
|
15
15
|
criterias?: PasswordCriteria[];
|
|
16
16
|
testId?: string;
|
|
17
17
|
};
|
|
18
|
-
/**
|
|
18
|
+
/** A field used for passwords. It obfuscates the input by default, but has the option to reveal the input. Can also include required password criteria. */
|
|
19
19
|
declare const PasswordField: React.FC<Props>;
|
|
20
20
|
export default PasswordField;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Props as TextFieldProps } from '../TextField/TextField';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* In its default state it only allows integers between 0 and 100, but it can be configured to allow decimals and negative values.
|
|
4
|
+
* A special text input field that only accepts numbers. Comes with validation and formatting in place to properly display percentage values. In its default state it only allows integers between 0 and 100, but it can be configured to allow decimals and negative values.
|
|
6
5
|
*/
|
|
7
6
|
declare const PercentageField: React.ForwardRefExoticComponent<{
|
|
8
7
|
max?: number | undefined;
|
|
@@ -17,6 +17,6 @@ type Props<T> = {
|
|
|
17
17
|
onRemoveOption?: (remainingOptions: PillSelectOption<T>[]) => void;
|
|
18
18
|
createOptionLabel?: React.ReactNode;
|
|
19
19
|
};
|
|
20
|
-
/**
|
|
20
|
+
/** A field where the user can select one or more from a vertical line of pills. Can also be made fully reactive allowing users to add and delete their own options. Use this to select from a more visual list with a limited number of options, like selecting the day of the week. */
|
|
21
21
|
declare const PillSelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, label, caption, error, disabled, testId, onCreate, onRemoveOption, createOptionLabel }: Props<T>) => React.JSX.Element;
|
|
22
22
|
export default PillSelectField;
|
|
@@ -23,6 +23,6 @@ type Props = {
|
|
|
23
23
|
/** It states the radio options will be inline and defines how many columns it will have */
|
|
24
24
|
columns?: 2 | 3 | 4;
|
|
25
25
|
};
|
|
26
|
-
/**
|
|
26
|
+
/** A list of radio options appearing either as an input or box. Use when the user can only select one option from a visual list and the user needs to be able to see all the options to make an informed decision. */
|
|
27
27
|
declare const RadioGroupField: ({ name, value, onChange, label, caption, error, space, inline, disabled, children, testId, columns }: Props) => React.JSX.Element;
|
|
28
28
|
export default RadioGroupField;
|
|
@@ -41,6 +41,6 @@ export type Props<T> = {
|
|
|
41
41
|
isSearchable?: boolean;
|
|
42
42
|
autoFocus?: boolean;
|
|
43
43
|
} & DataProps;
|
|
44
|
-
/**
|
|
44
|
+
/** Simple dropdown field where the user chooses one option from a predefined list. */
|
|
45
45
|
declare const SelectField: <T extends unknown>(props: Props<T>) => React.JSX.Element;
|
|
46
46
|
export default SelectField;
|
|
@@ -24,5 +24,6 @@ type Props = {
|
|
|
24
24
|
testId?: string;
|
|
25
25
|
maxLength?: number;
|
|
26
26
|
};
|
|
27
|
+
/** A basic open input field used to get text from the user, with options to add a prefix or suffix element if necessary. Accepts any characters, so do not use it if you want to limit the format of the input to numbers only. */
|
|
27
28
|
declare const TextAreaField: React.FC<Props>;
|
|
28
29
|
export default TextAreaField;
|
|
@@ -25,6 +25,7 @@ export type Props = {
|
|
|
25
25
|
value?: string;
|
|
26
26
|
testId?: string;
|
|
27
27
|
} & DataProps;
|
|
28
|
+
/** A basic open input field used to get text from the user, with options to add a prefix or suffix element if necessary. Accepts any characters, so do not use it if you want to limit the format of the input to numbers only. */
|
|
28
29
|
declare const TextField: React.ForwardRefExoticComponent<{
|
|
29
30
|
autoComplete?: AutoCompleteType | undefined;
|
|
30
31
|
autoFocus?: boolean | undefined;
|
|
@@ -45,9 +45,9 @@ export declare const TimeRangeSelector: React.ForwardRefExoticComponent<{
|
|
|
45
45
|
timeFormat?: TimeFormat | undefined;
|
|
46
46
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* A special field design for selecting a specific time of the day. Users can choose from a dropdown of preset time intervals, or type directly into the field. When the user leaves the field, the input is automatically formatted into either AM/PM time or 24h time.
|
|
49
49
|
*
|
|
50
|
-
*
|
|
50
|
+
* **You are in charge of validating the value and parsing it back to a value that you can use on your application**.
|
|
51
51
|
*/
|
|
52
52
|
declare const TimeField: React.ForwardRefExoticComponent<Omit<Props, "prefix" | "subtractDuration" | "calculateDuration" | "suffix"> & React.RefAttributes<HTMLInputElement>>;
|
|
53
53
|
export default TimeField;
|
|
@@ -21,5 +21,6 @@ type Props = {
|
|
|
21
21
|
calculateDuration?: (e: TimeRange) => string;
|
|
22
22
|
timeFormat?: TimeFormat;
|
|
23
23
|
};
|
|
24
|
+
/** A special input field for selecting a time range. Comprised of 2 individual time fields, the user selects a start time and an end time individually to. */
|
|
24
25
|
declare const TimeRangeField: ({ name, id: inputId, value, interval, startTime, onChange, onBlur, label, caption, error, placeholder, disabled, testId, subtractDuration, calculateDuration, timeFormat }: Props) => React.JSX.Element;
|
|
25
26
|
export default TimeRangeField;
|
|
@@ -21,6 +21,6 @@ type Props = {
|
|
|
21
21
|
weekStart?: WeekStart;
|
|
22
22
|
testId?: string;
|
|
23
23
|
};
|
|
24
|
-
/**
|
|
24
|
+
/** A special dropdown style field used to select a single week from a calendar widget. Selections must always be 7 consecutive days, but you may customize the day of the week the selectable range starts on. */
|
|
25
25
|
declare const WeekField: React.FC<Props>;
|
|
26
26
|
export default WeekField;
|
package/dist/index.css
CHANGED
|
@@ -1784,7 +1784,6 @@ h5._i2LHD {
|
|
|
1784
1784
|
padding: 0 6px;
|
|
1785
1785
|
align-items: center;
|
|
1786
1786
|
justify-content: center;
|
|
1787
|
-
border: 1px solid var(--color-surface-color);
|
|
1788
1787
|
}
|
|
1789
1788
|
._RXV4h svg {
|
|
1790
1789
|
fill: var(--color-secondary-on-color);
|
|
@@ -5701,6 +5700,25 @@ input._TEU6N {
|
|
|
5701
5700
|
border-bottom: 1px solid var(--nav-foreground-color);
|
|
5702
5701
|
transition: box-shadow 0.4s ease-in-out;
|
|
5703
5702
|
}
|
|
5703
|
+
._lK6PV {
|
|
5704
|
+
display: inline-flex;
|
|
5705
|
+
align-items: center;
|
|
5706
|
+
justify-content: center;
|
|
5707
|
+
padding: 4px;
|
|
5708
|
+
margin: 0;
|
|
5709
|
+
border: 0;
|
|
5710
|
+
background: transparent;
|
|
5711
|
+
color: inherit;
|
|
5712
|
+
cursor: pointer;
|
|
5713
|
+
border-radius: var(--border-radius-400);
|
|
5714
|
+
}
|
|
5715
|
+
._lK6PV:hover {
|
|
5716
|
+
background: var(--color-hover-darken);
|
|
5717
|
+
}
|
|
5718
|
+
._lK6PV:focus-visible {
|
|
5719
|
+
outline: 2px solid var(--nav-object-normal-color);
|
|
5720
|
+
outline-offset: 2px;
|
|
5721
|
+
}
|
|
5704
5722
|
._Smo46 {
|
|
5705
5723
|
--nav-background-color: #f1f0ec;
|
|
5706
5724
|
--nav-foreground-color: #e2ded6;
|
|
@@ -5738,6 +5756,12 @@ input._TEU6N {
|
|
|
5738
5756
|
overflow-x: hidden;
|
|
5739
5757
|
background-color: var(--nav-background-color);
|
|
5740
5758
|
padding-top: 10px;
|
|
5759
|
+
margin: 0;
|
|
5760
|
+
padding-inline-start: 0;
|
|
5761
|
+
list-style: none;
|
|
5762
|
+
}
|
|
5763
|
+
._Smo46 a {
|
|
5764
|
+
text-decoration: none;
|
|
5741
5765
|
}
|
|
5742
5766
|
@keyframes _aMyIG {
|
|
5743
5767
|
from {
|
|
@@ -5752,13 +5776,25 @@ input._TEU6N {
|
|
|
5752
5776
|
min-height: 38px;
|
|
5753
5777
|
color: var(--nav-object-soft-color);
|
|
5754
5778
|
box-sizing: border-box;
|
|
5779
|
+
list-style: none;
|
|
5755
5780
|
}
|
|
5756
|
-
.
|
|
5781
|
+
._PiWFg {
|
|
5782
|
+
display: block;
|
|
5757
5783
|
width: 100%;
|
|
5758
5784
|
padding: 0;
|
|
5785
|
+
margin: 0;
|
|
5759
5786
|
border: 0;
|
|
5787
|
+
font: inherit;
|
|
5788
|
+
color: inherit;
|
|
5760
5789
|
text-align: left;
|
|
5790
|
+
text-decoration: none;
|
|
5761
5791
|
background-color: transparent;
|
|
5792
|
+
cursor: pointer;
|
|
5793
|
+
}
|
|
5794
|
+
._PiWFg:focus-visible {
|
|
5795
|
+
outline: 2px solid var(--nav-object-normal-color);
|
|
5796
|
+
outline-offset: -2px;
|
|
5797
|
+
border-radius: var(--border-radius-400);
|
|
5762
5798
|
}
|
|
5763
5799
|
._GkDWn {
|
|
5764
5800
|
display: flex;
|
|
@@ -5793,6 +5829,17 @@ input._TEU6N {
|
|
|
5793
5829
|
color: var(--nav-object-normal-color);
|
|
5794
5830
|
font-family: var(--font-family-body);
|
|
5795
5831
|
}
|
|
5832
|
+
._MFqwx {
|
|
5833
|
+
position: absolute;
|
|
5834
|
+
width: 1px;
|
|
5835
|
+
height: 1px;
|
|
5836
|
+
padding: 0;
|
|
5837
|
+
margin: -1px;
|
|
5838
|
+
overflow: hidden;
|
|
5839
|
+
clip: rect(0, 0, 0, 0);
|
|
5840
|
+
white-space: nowrap;
|
|
5841
|
+
border: 0;
|
|
5842
|
+
}
|
|
5796
5843
|
._yCxLl {
|
|
5797
5844
|
width: 8px;
|
|
5798
5845
|
height: 8px;
|
|
@@ -5808,7 +5855,9 @@ input._TEU6N {
|
|
|
5808
5855
|
display: flex;
|
|
5809
5856
|
flex-direction: column;
|
|
5810
5857
|
gap: 6px;
|
|
5811
|
-
margin
|
|
5858
|
+
margin: 4px 0 0;
|
|
5859
|
+
padding-inline-start: 0;
|
|
5860
|
+
list-style: none;
|
|
5812
5861
|
}
|
|
5813
5862
|
._zfy2L {
|
|
5814
5863
|
color: var(--nav-object-normal-color);
|
|
@@ -5852,6 +5901,36 @@ input._TEU6N {
|
|
|
5852
5901
|
min-height: 30px;
|
|
5853
5902
|
color: var(--nav-object-soft-color);
|
|
5854
5903
|
box-sizing: border-box;
|
|
5904
|
+
list-style: none;
|
|
5905
|
+
}
|
|
5906
|
+
._KXtsV {
|
|
5907
|
+
display: block;
|
|
5908
|
+
width: 100%;
|
|
5909
|
+
padding: 0;
|
|
5910
|
+
margin: 0;
|
|
5911
|
+
border: 0;
|
|
5912
|
+
font: inherit;
|
|
5913
|
+
color: inherit;
|
|
5914
|
+
text-align: left;
|
|
5915
|
+
text-decoration: none;
|
|
5916
|
+
background-color: transparent;
|
|
5917
|
+
cursor: pointer;
|
|
5918
|
+
}
|
|
5919
|
+
._KXtsV:focus-visible {
|
|
5920
|
+
outline: 2px solid var(--nav-object-normal-color);
|
|
5921
|
+
outline-offset: -2px;
|
|
5922
|
+
border-radius: var(--border-radius-400);
|
|
5923
|
+
}
|
|
5924
|
+
._nTZxa {
|
|
5925
|
+
position: absolute;
|
|
5926
|
+
width: 1px;
|
|
5927
|
+
height: 1px;
|
|
5928
|
+
padding: 0;
|
|
5929
|
+
margin: -1px;
|
|
5930
|
+
overflow: hidden;
|
|
5931
|
+
clip: rect(0, 0, 0, 0);
|
|
5932
|
+
white-space: nowrap;
|
|
5933
|
+
border: 0;
|
|
5855
5934
|
}
|
|
5856
5935
|
._c3utS {
|
|
5857
5936
|
display: flex;
|
|
@@ -5911,7 +5990,9 @@ input._TEU6N {
|
|
|
5911
5990
|
._qN8Zl {
|
|
5912
5991
|
width: 100%;
|
|
5913
5992
|
padding: 10px 15px;
|
|
5993
|
+
margin: 0;
|
|
5914
5994
|
box-sizing: border-box;
|
|
5995
|
+
list-style: none;
|
|
5915
5996
|
}
|
|
5916
5997
|
._qN8Zl::after {
|
|
5917
5998
|
content: "";
|
|
@@ -5923,6 +6004,9 @@ input._TEU6N {
|
|
|
5923
6004
|
._9dbuu {
|
|
5924
6005
|
flex-shrink: 0;
|
|
5925
6006
|
padding: 10px 0 20px 0;
|
|
6007
|
+
margin: 0;
|
|
6008
|
+
padding-inline-start: 0;
|
|
6009
|
+
list-style: none;
|
|
5926
6010
|
}
|
|
5927
6011
|
._Bq3B4 {
|
|
5928
6012
|
box-shadow: 0 0 12px -3px var(--color-shadow-overlay);
|