@7shifts/sous-chef 2.6.0 → 2.8.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.
@@ -159,7 +159,7 @@ var Inline = function Inline(props) {
159
159
  }));
160
160
  };
161
161
 
162
- var styles$2 = {"spinner":"_2wtfD","rotator":"_2Jprn","spinner--block":"_Jmh8M","path":"_3zucL","dash":"_3ZqYM","path--mint":"_3XYKx","path--disabled":"_1pYbs","path--contrast":"_3ofDF"};
162
+ var styles$2 = {"spinner":"_2wtfD","rotator":"_2Jprn","spinner--block":"_Jmh8M","path":"_3zucL","dash":"_3ZqYM","path--mint":"_3XYKx","path--disabled":"_1pYbs","path--contrast":"_3ofDF","path--pride":"_e0OH1"};
163
163
 
164
164
  var Spinner = function Spinner(_ref) {
165
165
  var _classnames;
@@ -179,7 +179,75 @@ var Spinner = function Spinner(_ref) {
179
179
  height: size,
180
180
  viewBox: "0 0 66 66",
181
181
  "data-testid": "spinner"
182
- }, React__default.createElement("circle", {
182
+ }, React__default.createElement("defs", null, React__default.createElement("linearGradient", {
183
+ id: "prideGradient"
184
+ }, React__default.createElement("stop", {
185
+ offset: "0",
186
+ stopColor: "#000000"
187
+ }), React__default.createElement("stop", {
188
+ offset: "0.0500",
189
+ stopColor: "#000000"
190
+ }), React__default.createElement("stop", {
191
+ offset: "0.0501",
192
+ stopColor: "#ffafc7"
193
+ }), React__default.createElement("stop", {
194
+ offset: "0.15",
195
+ stopColor: "#ffafc7"
196
+ }), React__default.createElement("stop", {
197
+ offset: "0.1501",
198
+ stopColor: "#73d7ee"
199
+ }), React__default.createElement("stop", {
200
+ offset: "0.25",
201
+ stopColor: "#73d7ee"
202
+ }), React__default.createElement("stop", {
203
+ offset: "0.2501",
204
+ stopColor: "#613915"
205
+ }), React__default.createElement("stop", {
206
+ offset: "0.35",
207
+ stopColor: "#613915"
208
+ }), React__default.createElement("stop", {
209
+ offset: "0.3501",
210
+ stopColor: "#ffffff"
211
+ }), React__default.createElement("stop", {
212
+ offset: "0.45",
213
+ stopColor: "#ffffff"
214
+ }), React__default.createElement("stop", {
215
+ offset: "0.4501",
216
+ stopColor: "#e50000"
217
+ }), React__default.createElement("stop", {
218
+ offset: "0.55",
219
+ stopColor: "#e50000"
220
+ }), React__default.createElement("stop", {
221
+ offset: "0.5501",
222
+ stopColor: "#ff8d00"
223
+ }), React__default.createElement("stop", {
224
+ offset: "0.65",
225
+ stopColor: "#ff8d00"
226
+ }), React__default.createElement("stop", {
227
+ offset: "0.6501",
228
+ stopColor: "#ddee00"
229
+ }), React__default.createElement("stop", {
230
+ offset: "0.75",
231
+ stopColor: "#ddee00"
232
+ }), React__default.createElement("stop", {
233
+ offset: "0.7501",
234
+ stopColor: "#028121"
235
+ }), React__default.createElement("stop", {
236
+ offset: "0.85",
237
+ stopColor: "#028121"
238
+ }), React__default.createElement("stop", {
239
+ offset: "0.8501",
240
+ stopColor: "#004cff"
241
+ }), React__default.createElement("stop", {
242
+ offset: "0.95",
243
+ stopColor: "#004cff"
244
+ }), React__default.createElement("stop", {
245
+ offset: "0.9501",
246
+ stopColor: "#760088"
247
+ }), React__default.createElement("stop", {
248
+ offset: "1",
249
+ stopColor: "#760088"
250
+ }))), React__default.createElement("circle", {
183
251
  className: classnames(styles$2['path'], styles$2["path--" + theme]),
184
252
  fill: "none",
185
253
  strokeWidth: "6",
@@ -2731,6 +2799,28 @@ var IconUndo = function IconUndo(props) {
2731
2799
 
2732
2800
  IconUndo.displayName = 'IconUndo';
2733
2801
 
2802
+ var IconUniversity = function IconUniversity(props) {
2803
+ return React__default.createElement("svg", Object.assign({
2804
+ viewBox: "0 0 20 20",
2805
+ fill: "none",
2806
+ xmlns: "http://www.w3.org/2000/svg",
2807
+ "data-testid": "icon-university",
2808
+ style: getIconStyles(props)
2809
+ }, props), React__default.createElement("g", {
2810
+ clipPath: "url(#icon-university_svg__a)"
2811
+ }, React__default.createElement("path", {
2812
+ d: "M19.375 17.5h-.625v-1.563a.937.937 0 0 0-.938-.937H16.25V8.125H15V15h-2.5V8.125h-1.25V15h-2.5V8.125H7.5V15H5V8.125H3.75V15H2.187a.937.937 0 0 0-.937.938V17.5H.625a.625.625 0 0 0-.625.625v.313a.313.313 0 0 0 .313.312h19.375a.313.313 0 0 0 .312-.313v-.312a.625.625 0 0 0-.625-.625ZM2.5 16.25h15v1.25h-15v-1.25ZM19.698 5.312l-9.105-3.966a1.875 1.875 0 0 0-1.186 0L.302 5.312A.469.469 0 0 0 0 5.752v.343c0 .259.21.468.469.468h.781v.47c0 .258.21.468.469.468H18.28c.26 0 .469-.21.469-.469v-.468h.781c.26 0 .469-.21.469-.47v-.342a.469.469 0 0 0-.302-.439ZM17.5 6.25h-15v-.531L9.842 2.52a.625.625 0 0 1 .316 0L17.5 5.72v.531Z",
2813
+ fill: "currentColor"
2814
+ })), React__default.createElement("defs", null, React__default.createElement("clipPath", {
2815
+ id: "icon-university_svg__a"
2816
+ }, React__default.createElement("path", {
2817
+ fill: "#fff",
2818
+ d: "M0 0h20v20H0z"
2819
+ }))));
2820
+ };
2821
+
2822
+ IconUniversity.displayName = 'IconUniversity';
2823
+
2734
2824
  var IconUserComputer = function IconUserComputer(props) {
2735
2825
  return React__default.createElement("svg", Object.assign({
2736
2826
  viewBox: "0 0 20 20",
@@ -3605,7 +3695,7 @@ var useFieldControllers = function useFieldControllers(_ref) {
3605
3695
  return formik.setFieldValue(name, e.target.value);
3606
3696
  },
3607
3697
  onBlur: _onBlur ? function (e) {
3608
- controllers.onBlur(e);
3698
+ _onBlur && _onBlur(e.target.value);
3609
3699
  currencyBlur();
3610
3700
  } : function () {
3611
3701
  formik.setFieldTouched(name);
@@ -4487,7 +4577,7 @@ var useRadioGroupFieldControllers = function useRadioGroupFieldControllers(_ref)
4487
4577
  error: error !== undefined ? controllers.error : formikState.error,
4488
4578
  value: value !== undefined ? controllers.value : formikState.value,
4489
4579
  onChange: function onChange(e) {
4490
- formik.setFieldValue(name, e.target.checked);
4580
+ formik.setFieldValue(name, e.target.value);
4491
4581
  _onChange && _onChange(e.target.value);
4492
4582
  }
4493
4583
  });
@@ -4865,6 +4955,28 @@ function CustomOption(_ref) {
4865
4955
  return React__default.createElement(components.Option, Object.assign({}, props), React__default.createElement(CustomComponent, Object.assign({}, props), children));
4866
4956
  }
4867
4957
 
4958
+ var isScrollingTheSelectMenu = function isScrollingTheSelectMenu(element) {
4959
+ if (!isReactSelectElement(element)) {
4960
+ var _element$children;
4961
+
4962
+ return isReactSelectElement(element === null || element === void 0 ? void 0 : (_element$children = element.children) === null || _element$children === void 0 ? void 0 : _element$children[0]);
4963
+ }
4964
+
4965
+ return true;
4966
+ };
4967
+
4968
+ var isReactSelectElement = function isReactSelectElement(element) {
4969
+ var _element$children2;
4970
+
4971
+ var firstOption = element === null || element === void 0 ? void 0 : (_element$children2 = element.children) === null || _element$children2 === void 0 ? void 0 : _element$children2[0];
4972
+
4973
+ if (!firstOption) {
4974
+ return false;
4975
+ }
4976
+
4977
+ return typeof firstOption.id === 'string' && firstOption.id.includes('react-select');
4978
+ };
4979
+
4868
4980
  var MultiSelectField = function MultiSelectField(_ref) {
4869
4981
  var name = _ref.name,
4870
4982
  inputId = _ref.id,
@@ -4933,10 +5045,7 @@ var MultiSelectField = function MultiSelectField(_ref) {
4933
5045
  return false;
4934
5046
  }
4935
5047
 
4936
- var target = e.target;
4937
- var firstOption = target.children[0];
4938
- var isScrollingTheMenu = firstOption && typeof firstOption.id === 'string' && firstOption.id.includes('react-select');
4939
- return !isScrollingTheMenu;
5048
+ return !isScrollingTheSelectMenu(e.target);
4940
5049
  }
4941
5050
  }));
4942
5051
  };
@@ -5026,10 +5135,7 @@ var SelectField = function SelectField(_ref) {
5026
5135
  return false;
5027
5136
  }
5028
5137
 
5029
- var target = e.target;
5030
- var firstOption = target.children[0];
5031
- var isScrollingTheMenu = firstOption && typeof firstOption.id === 'string' && firstOption.id.includes('react-select');
5032
- return !isScrollingTheMenu;
5138
+ return !isScrollingTheSelectMenu(e.target);
5033
5139
  },
5034
5140
  components: {
5035
5141
  Option: UserCustomOption ? function (props) {
@@ -5267,7 +5373,7 @@ var DateField = function DateField(_ref) {
5267
5373
  inputProps: {
5268
5374
  name: name,
5269
5375
  id: controllers.id,
5270
- className: classnames(inputStyles['date-field'], (_classnames = {}, _classnames[inputStyles['date--invalid']] = hasError, _classnames)),
5376
+ className: classnames(inputStyles['date-field'], (_classnames = {}, _classnames[inputStyles['date-field--invalid']] = hasError, _classnames)),
5271
5377
  'data-testid': "date-field-" + name,
5272
5378
  'aria-describedby': hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
5273
5379
  'aria-invalid': hasError,
@@ -5769,7 +5875,7 @@ var WeekField = function WeekField(_ref) {
5769
5875
  inputProps: {
5770
5876
  name: name,
5771
5877
  id: controllers.id,
5772
- className: classnames(inputStyles['date-field'], (_classnames = {}, _classnames[inputStyles['date--invalid']] = hasError, _classnames)),
5878
+ className: classnames(inputStyles['date-field'], (_classnames = {}, _classnames[inputStyles['date-field--invalid']] = hasError, _classnames)),
5773
5879
  'data-testid': "week-field-" + name,
5774
5880
  'aria-describedby': hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
5775
5881
  'aria-invalid': hasError,
@@ -5815,6 +5921,135 @@ var TimeFieldElement = function TimeFieldElement(_ref, ref) {
5815
5921
 
5816
5922
  var TimeField = forwardRef(TimeFieldElement);
5817
5923
 
5924
+ var _excluded$7 = ["currencySymbol"];
5925
+
5926
+ var CurrencyFieldElement = function CurrencyFieldElement(_ref, ref) {
5927
+ var _ref$currencySymbol = _ref.currencySymbol,
5928
+ currencySymbol = _ref$currencySymbol === void 0 ? "$" : _ref$currencySymbol,
5929
+ allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$7);
5930
+
5931
+ var _useTextField = useTextField(_extends({}, allOtherProps, {
5932
+ ref: ref
5933
+ })),
5934
+ inputProps = _useTextField.inputProps,
5935
+ fieldProps = _useTextField.fieldProps;
5936
+
5937
+ return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
5938
+ prefix: currencySymbol
5939
+ }, React__default.createElement("input", Object.assign({}, inputProps, {
5940
+ type: 'number',
5941
+ inputMode: 'decimal',
5942
+ step: '0.01',
5943
+ min: 0,
5944
+ onKeyDown: function onKeyDown(e) {
5945
+ if (e.key === 'e' || e.key === '-') {
5946
+ e.preventDefault();
5947
+ return;
5948
+ }
5949
+
5950
+ inputProps.onKeyDown(e);
5951
+ },
5952
+ onBlur: function onBlur(e) {
5953
+ e.currentTarget.value = parseFloat(e.currentTarget.value).toFixed(2);
5954
+ inputProps.onChange(e);
5955
+ inputProps.onBlur(e);
5956
+ }
5957
+ }))));
5958
+ };
5959
+
5960
+ var CurrencyField = forwardRef(CurrencyFieldElement);
5961
+
5962
+ var _excluded$8 = ["max", "min", "precision", "stepSize"];
5963
+
5964
+ var PercentageElement = function PercentageElement(_ref, ref) {
5965
+ var _ref$max = _ref.max,
5966
+ max = _ref$max === void 0 ? 100 : _ref$max,
5967
+ _ref$min = _ref.min,
5968
+ min = _ref$min === void 0 ? 0 : _ref$min,
5969
+ _ref$precision = _ref.precision,
5970
+ precision = _ref$precision === void 0 ? 0 : _ref$precision,
5971
+ _ref$stepSize = _ref.stepSize,
5972
+ stepSize = _ref$stepSize === void 0 ? 1 : _ref$stepSize,
5973
+ allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$8);
5974
+
5975
+ var _useTextField = useTextField(_extends({}, allOtherProps, {
5976
+ ref: ref
5977
+ })),
5978
+ inputProps = _useTextField.inputProps,
5979
+ fieldProps = _useTextField.fieldProps;
5980
+
5981
+ var inputMode = precision > 0 ? 'decimal' : 'numeric';
5982
+
5983
+ var decimalDigitsCount = function decimalDigitsCount(input) {
5984
+ var decimalIndex = input.indexOf('.');
5985
+ return decimalIndex === -1 ? 0 : input.length - decimalIndex - 1;
5986
+ };
5987
+
5988
+ var inputIsValid = function inputIsValid(valueAsString) {
5989
+ if (valueAsString.startsWith('00')) {
5990
+ return false;
5991
+ }
5992
+
5993
+ if (valueAsString === '-' || valueAsString === '.') {
5994
+ return true;
5995
+ }
5996
+
5997
+ if (valueAsString.indexOf('-') > 0) {
5998
+ return false;
5999
+ }
6000
+
6001
+ return decimalDigitsCount(valueAsString) <= precision;
6002
+ };
6003
+
6004
+ var keyPressIsValid = function keyPressIsValid(keyPress, value) {
6005
+ if (keyPress == 'e' || keyPress == '+' || keyPress == '-' && min >= 0) {
6006
+ return false;
6007
+ }
6008
+
6009
+ if (keyPress == '.' && (precision == 0 || Number(value) == max)) {
6010
+ return false;
6011
+ }
6012
+
6013
+ return true;
6014
+ };
6015
+
6016
+ return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
6017
+ suffix: '%'
6018
+ }, React__default.createElement("input", Object.assign({}, inputProps, {
6019
+ type: 'number',
6020
+ inputMode: inputMode,
6021
+ step: stepSize,
6022
+ max: max,
6023
+ min: min,
6024
+ onKeyDown: function onKeyDown(e) {
6025
+ var value = e.currentTarget.value + e.key;
6026
+
6027
+ if (e.key.length === 1 && (!keyPressIsValid(e.key, value) || !inputIsValid(value))) {
6028
+ e.preventDefault();
6029
+ return;
6030
+ }
6031
+
6032
+ inputProps.onKeyDown(e);
6033
+ },
6034
+ onChange: function onChange(e) {
6035
+ var number = Number(e.target.value);
6036
+
6037
+ if (number > max) {
6038
+ e.target.value = String(max);
6039
+ }
6040
+
6041
+ if (number < min) {
6042
+ e.target.value = String(min);
6043
+ }
6044
+
6045
+ inputProps.onChange(e);
6046
+ inputProps.onBlur(e);
6047
+ }
6048
+ }))));
6049
+ };
6050
+
6051
+ var PercentageField = forwardRef(PercentageElement);
6052
+
5818
6053
  var styles$u = {"caption":"_1QDLF","label":"_2wiMV","toggle":"_1ui8X","toggle__label":"_1YRJT","toggle__caption":"_1jEiW","toggle__switch":"_3tNyE"};
5819
6054
 
5820
6055
  var Toggle = function Toggle(_ref) {
@@ -5988,7 +6223,7 @@ var FooterContainer = function FooterContainer(_ref2) {
5988
6223
 
5989
6224
  var styles$z = {"badge":"_2f81N","badge--warning":"_2g1GI","badge--danger":"_2zLnM","badge--success":"_27QOo","badge--info":"_2gmsM"};
5990
6225
 
5991
- var _excluded$7 = ["children", "theme", "title"];
6226
+ var _excluded$9 = ["children", "theme", "title"];
5992
6227
 
5993
6228
  var Badge = function Badge(_ref, forwardedRef) {
5994
6229
  var _classnames;
@@ -5996,7 +6231,7 @@ var Badge = function Badge(_ref, forwardedRef) {
5996
6231
  var children = _ref.children,
5997
6232
  theme = _ref.theme,
5998
6233
  title = _ref.title,
5999
- otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$7);
6234
+ otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$9);
6000
6235
 
6001
6236
  var internalRef = useRef(null);
6002
6237
  var ref = forwardedRef || internalRef;
@@ -6127,5 +6362,5 @@ var Avatar = function Avatar(_ref) {
6127
6362
  }, badge));
6128
6363
  };
6129
6364
 
6130
- export { Avatar, Badge$1 as Badge, Button$1 as Button, CheckboxField, DataTable, DataTableCell, DataTableEditableCell, DataTableRow, DateField, DateRangeField, Form, FormRow, IconAnalytics, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowToTop, IconArrowUp, IconAward, IconBalanceScale, IconBalanceScaleLeft, IconBan, IconBarsH, IconBarsV, IconBell, IconBirthdayCake, IconBold, IconBolt, IconBook, IconBriefcase, IconBullseyeArrow, IconCalculator, IconCalendar, IconCalendarAlt, IconCalendarCheck, IconCalendarDay, IconCalendarExclamation, IconCalendarStar, IconCalendarTomorrow, IconCamera, IconCameraSlash, IconCashRegister, IconChartBar, IconCheck, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClipboardList, IconClock, IconCog, IconComment, IconCommentLines, IconCopy, IconCreditCard, IconCreditCardPlus, IconDownload, IconEdit, IconEllipsisV, IconEnvelope, IconExclaimation, IconExclaimationTriangle, IconExpand, IconExternalLink, IconEye, IconEyeSlash, IconFile, IconFilePdf, IconFlag, IconFourDotsCircle, IconFourSquares, IconGavel, IconGif, IconGift, IconGrinBeam, IconGripVertical, IconHandshake, IconImage, IconInfoCircle, IconIslandTropical, IconItalic, IconLaptopSearch, IconLink, IconList, IconListOI as IconListOi, IconLock, IconMagicSolid, IconMapMarker, IconMegaphone, IconMinus, IconMinusCircle, IconMoneyBill, IconNotesMedical, IconOvertime, IconPaperPlane, IconPaperPlaneClock, IconPaperclip, IconPencil, IconPercentage, IconPhone, IconPlug, IconPlus, IconPrint, IconQuestionCircle, IconRepeat, IconSearch, IconSignOut, IconSitemap, IconSlidersH, IconSort, IconStar, IconStarSolid, IconStickyNoteLines, IconStopwatch, IconStrikethrough, IconSync, IconSyncExclaimation, IconTachometer, IconTimes, IconTimesOctagon, IconTrash, IconUnderline, IconUndo, IconUserComputer, IconUserLight, IconUserPlus, IconUserSlash, IconUserSolid, IconUserTag, IconUserTie, IconUsers, IconVideo, IconVolume, IconVolumeMute, IconWrench, Inline, Modal, ModalBody, ModalFooter, MultiSelectField, PaginationControls, PasswordField, PillSelectField, RadioGroupField, RadioGroupOption, ResourceTable, ResourceTableRow, SIZE_25_PERCENT, SIZE_33_PERCENT, SIZE_50_PERCENT, SIZE_66_PERCENT, SIZE_75_PERCENT, SelectField, Spinner, Stack, TextAreaField, TextField, TimeField, Toggle, ToolbarSelect, Tooltip$1 as Tooltip, WeekField };
6365
+ export { Avatar, Badge$1 as Badge, Button$1 as Button, CheckboxField, CurrencyField, DataTable, DataTableCell, DataTableEditableCell, DataTableRow, DateField, DateRangeField, Form, FormRow, IconAnalytics, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowToTop, IconArrowUp, IconAward, IconBalanceScale, IconBalanceScaleLeft, IconBan, IconBarsH, IconBarsV, IconBell, IconBirthdayCake, IconBold, IconBolt, IconBook, IconBriefcase, IconBullseyeArrow, IconCalculator, IconCalendar, IconCalendarAlt, IconCalendarCheck, IconCalendarDay, IconCalendarExclamation, IconCalendarStar, IconCalendarTomorrow, IconCamera, IconCameraSlash, IconCashRegister, IconChartBar, IconCheck, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClipboardList, IconClock, IconCog, IconComment, IconCommentLines, IconCopy, IconCreditCard, IconCreditCardPlus, IconDownload, IconEdit, IconEllipsisV, IconEnvelope, IconExclaimation, IconExclaimationTriangle, IconExpand, IconExternalLink, IconEye, IconEyeSlash, IconFile, IconFilePdf, IconFlag, IconFourDotsCircle, IconFourSquares, IconGavel, IconGif, IconGift, IconGrinBeam, IconGripVertical, IconHandshake, IconImage, IconInfoCircle, IconIslandTropical, IconItalic, IconLaptopSearch, IconLink, IconList, IconListOI as IconListOi, IconLock, IconMagicSolid, IconMapMarker, IconMegaphone, IconMinus, IconMinusCircle, IconMoneyBill, IconNotesMedical, IconOvertime, IconPaperPlane, IconPaperPlaneClock, IconPaperclip, IconPencil, IconPercentage, IconPhone, IconPlug, IconPlus, IconPrint, IconQuestionCircle, IconRepeat, IconSearch, IconSignOut, IconSitemap, IconSlidersH, IconSort, IconStar, IconStarSolid, IconStickyNoteLines, IconStopwatch, IconStrikethrough, IconSync, IconSyncExclaimation, IconTachometer, IconTimes, IconTimesOctagon, IconTrash, IconUnderline, IconUndo, IconUniversity, IconUserComputer, IconUserLight, IconUserPlus, IconUserSlash, IconUserSolid, IconUserTag, IconUserTie, IconUsers, IconVideo, IconVolume, IconVolumeMute, IconWrench, Inline, Modal, ModalBody, ModalFooter, MultiSelectField, PaginationControls, PasswordField, PercentageField, PillSelectField, RadioGroupField, RadioGroupOption, ResourceTable, ResourceTableRow, SIZE_25_PERCENT, SIZE_33_PERCENT, SIZE_50_PERCENT, SIZE_66_PERCENT, SIZE_75_PERCENT, SelectField, Spinner, Stack, TextAreaField, TextField, TimeField, Toggle, ToolbarSelect, Tooltip$1 as Tooltip, WeekField };
6131
6366
  //# sourceMappingURL=index.modern.js.map