@7shifts/sous-chef 2.3.5 → 2.3.6

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 @@
1
+ export { default } from './ToolbarSelect';
@@ -0,0 +1,2 @@
1
+ import ToolbarSelect from './ToolbarSelect';
2
+ export { ToolbarSelect };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { IconSize } from '../types';
3
+ declare type Props = {
4
+ size?: IconSize;
5
+ color?: string;
6
+ } & React.SVGProps<SVGSVGElement>;
7
+ declare const IconStarSolid: {
8
+ (props: Props): JSX.Element;
9
+ displayName: string;
10
+ };
11
+ export default IconStarSolid;
@@ -94,6 +94,7 @@ export { default as IconSignOut } from './IconSignOut';
94
94
  export { default as IconSitemap } from './IconSitemap';
95
95
  export { default as IconSlidersH } from './IconSlidersH';
96
96
  export { default as IconSort } from './IconSort';
97
+ export { default as IconStarSolid } from './IconStarSolid';
97
98
  export { default as IconStar } from './IconStar';
98
99
  export { default as IconStickyNoteLines } from './IconStickyNoteLines';
99
100
  export { default as IconStopwatch } from './IconStopwatch';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './core';
2
+ export * from './controls';
2
3
  export * from './forms';
3
4
  export * from './feedback';
4
5
  export * from './actions';
package/dist/index.js CHANGED
@@ -2493,6 +2493,21 @@ var IconSort = function IconSort(props) {
2493
2493
 
2494
2494
  IconSort.displayName = 'IconSort';
2495
2495
 
2496
+ var IconStarSolid = function IconStarSolid(props) {
2497
+ return React__default.createElement("svg", Object.assign({
2498
+ viewBox: "0 0 20 20",
2499
+ fill: "none",
2500
+ xmlns: "http://www.w3.org/2000/svg",
2501
+ "data-testid": "icon-star-solid",
2502
+ style: getIconStyles(props)
2503
+ }, props), React__default.createElement("path", {
2504
+ d: "M8.944 1.591 6.602 6.34l-5.239.763C.423 7.24.047 8.398.73 9.06l3.79 3.694-.897 5.217c-.16.943.832 1.65 1.664 1.209l4.687-2.464 4.686 2.463c.832.438 1.826-.265 1.664-1.208l-.896-5.217 3.79-3.694c.681-.663.305-1.821-.635-1.958l-5.239-.763-2.341-4.748c-.42-.846-1.635-.857-2.058 0Z",
2505
+ fill: "currentColor"
2506
+ }));
2507
+ };
2508
+
2509
+ IconStarSolid.displayName = 'IconStarSolid';
2510
+
2496
2511
  var IconStar = function IconStar(props) {
2497
2512
  return React__default.createElement("svg", Object.assign({
2498
2513
  viewBox: "0 0 20 20",
@@ -3754,6 +3769,187 @@ var DataTableEditableCell = function DataTableEditableCell(_ref) {
3754
3769
  }))));
3755
3770
  };
3756
3771
 
3772
+ var useSelectFieldControllers = function useSelectFieldControllers(_ref) {
3773
+ var name = _ref.name,
3774
+ inputId = _ref.id,
3775
+ value = _ref.value,
3776
+ _onChange = _ref.onChange,
3777
+ _onBlur = _ref.onBlur,
3778
+ error = _ref.error;
3779
+
3780
+ var _useFormContext = useFormContext(),
3781
+ formik = _useFormContext.formik;
3782
+
3783
+ var id = useFieldId({
3784
+ name: name,
3785
+ id: inputId
3786
+ });
3787
+ var controllers = {
3788
+ id: id,
3789
+ error: error,
3790
+ value: value,
3791
+ onChange: function onChange(option) {
3792
+ return _onChange && _onChange(option);
3793
+ },
3794
+ onBlur: function onBlur(option) {
3795
+ return _onBlur && _onBlur(option);
3796
+ }
3797
+ };
3798
+ var formikState = getFormikState(name, formik);
3799
+
3800
+ if (formik && formikState) {
3801
+ controllers = _extends({}, controllers, {
3802
+ error: error ? controllers.error : formikState.error,
3803
+ value: value ? controllers.value : formikState.value,
3804
+ onChange: function onChange(option) {
3805
+ if (_onChange) {
3806
+ _onChange(option);
3807
+ }
3808
+
3809
+ formik.setFieldValue(name, option);
3810
+ },
3811
+ onBlur: function onBlur(option) {
3812
+ if (_onBlur) {
3813
+ _onBlur(option);
3814
+ }
3815
+
3816
+ formik.setFieldTouched(name);
3817
+ }
3818
+ });
3819
+ }
3820
+
3821
+ return controllers;
3822
+ };
3823
+
3824
+ var getSelectStyles = function getSelectStyles(_ref) {
3825
+ var _ref$wrapToNextLine = _ref.wrapToNextLine,
3826
+ wrapToNextLine = _ref$wrapToNextLine === void 0 ? false : _ref$wrapToNextLine;
3827
+ return {
3828
+ valueContainer: function valueContainer(base) {
3829
+ return Object.assign({}, base, {
3830
+ flexWrap: wrapToNextLine ? 'wrap' : 'nowrap'
3831
+ });
3832
+ },
3833
+ container: function container(base, state) {
3834
+ return Object.assign({}, base, {
3835
+ flex: '1',
3836
+ fontFamily: FONT_FAMILY,
3837
+ minWidth: '64px',
3838
+ background: state.isDisabled ? GREY100 : WHITE,
3839
+ ':hover': {
3840
+ backgroundColor: GREY100
3841
+ },
3842
+ position: 'initial'
3843
+ });
3844
+ },
3845
+ control: function control(base, state) {
3846
+ return Object.assign({}, base, {
3847
+ color: state.isDisabled ? GREY400 : GREY500,
3848
+ boxShadow: 'none',
3849
+ fontSize: '14px',
3850
+ cursor: 'pointer',
3851
+ background: 'none',
3852
+ outline: '1px solid',
3853
+ outlineColor: GREY300,
3854
+ borderRadius: '4px',
3855
+ border: 'none'
3856
+ });
3857
+ },
3858
+ indicatorSeparator: function indicatorSeparator() {
3859
+ return {
3860
+ display: 'none'
3861
+ };
3862
+ },
3863
+ placeholder: function placeholder(base, state) {
3864
+ return _extends({}, base, {
3865
+ color: state.isDisabled ? GREY300 : GREY400,
3866
+ marginRight: 0,
3867
+ position: 'static',
3868
+ transform: 'initial',
3869
+ overflow: 'hidden',
3870
+ textOverflow: 'ellipsis',
3871
+ whiteSpace: 'nowrap'
3872
+ });
3873
+ },
3874
+ singleValue: function singleValue(base, state) {
3875
+ return Object.assign({}, base, {
3876
+ color: state.isDisabled ? GREY400 : null,
3877
+ marginRight: 0,
3878
+ position: 'static',
3879
+ transform: 'initial',
3880
+ overflow: 'hidden',
3881
+ textOverflow: 'ellipsis',
3882
+ whiteSpace: 'nowrap'
3883
+ });
3884
+ },
3885
+ dropdownIndicator: function dropdownIndicator(base) {
3886
+ return Object.assign({}, base, {
3887
+ color: GREY400,
3888
+ padding: '8px'
3889
+ });
3890
+ },
3891
+ option: function option(base, state) {
3892
+ return Object.assign({}, base, {
3893
+ backgroundColor: state.isDisabled ? null : state.isSelected ? EGGPLANT200 : state.isFocused ? GREY100 : WHITE,
3894
+ color: state.isDisabled ? GREY400 : GREY500,
3895
+ cursor: state.isDisabled ? 'default' : 'pointer',
3896
+ fontFamily: FONT_FAMILY,
3897
+ fontSize: '14px'
3898
+ });
3899
+ },
3900
+ group: function group(base) {
3901
+ return Object.assign({}, base, {
3902
+ fontFamily: FONT_FAMILY
3903
+ });
3904
+ },
3905
+ menu: function menu(base) {
3906
+ return _extends({}, base, {
3907
+ zIndex: Z_INDEX_LAYERS.MENU,
3908
+ minWidth: '164px'
3909
+ });
3910
+ },
3911
+ menuPortal: function menuPortal(base) {
3912
+ return _extends({}, base, {
3913
+ zIndex: Z_INDEX_LAYERS.MENU
3914
+ });
3915
+ }
3916
+ };
3917
+ };
3918
+
3919
+ var ToolbarSelect = function ToolbarSelect(_ref) {
3920
+ var name = _ref.name,
3921
+ value = _ref.value,
3922
+ options = _ref.options,
3923
+ onChange = _ref.onChange,
3924
+ onBlur = _ref.onBlur,
3925
+ placeholder = _ref.placeholder,
3926
+ disabled = _ref.disabled,
3927
+ prefix = _ref.prefix;
3928
+ var controllers = useSelectFieldControllers({
3929
+ name: name,
3930
+ value: value,
3931
+ onChange: onChange,
3932
+ onBlur: onBlur
3933
+ });
3934
+ return React__default.createElement(AffixContainer, {
3935
+ prefix: prefix
3936
+ }, React__default.createElement(Select__default, {
3937
+ inputId: controllers.id,
3938
+ options: options,
3939
+ isDisabled: disabled,
3940
+ value: controllers.value,
3941
+ placeholder: placeholder,
3942
+ styles: getSelectStyles({}),
3943
+ menuPortalTarget: document.body,
3944
+ onChange: controllers.onChange,
3945
+ onBlur: controllers.onBlur,
3946
+ components: {
3947
+ Option: Select.components.Option,
3948
+ Control: Select.components.Control
3949
+ }
3950
+ }));
3951
+ };
3952
+
3757
3953
  var styles$h = {"form--standard-size":"_3CaV0"};
3758
3954
 
3759
3955
  var Form = function Form(_ref) {
@@ -4513,7 +4709,7 @@ var PasswordField = function PasswordField(_ref) {
4513
4709
  }))));
4514
4710
  };
4515
4711
 
4516
- var getSelectStyles = function getSelectStyles(_ref) {
4712
+ var getSelectStyles$1 = function getSelectStyles(_ref) {
4517
4713
  var isInvalid = _ref.isInvalid,
4518
4714
  _ref$asToolbarFilter = _ref.asToolbarFilter,
4519
4715
  asToolbarFilter = _ref$asToolbarFilter === void 0 ? false : _ref$asToolbarFilter,
@@ -4687,7 +4883,7 @@ var MultiSelectField = function MultiSelectField(_ref) {
4687
4883
  value: controllers.value,
4688
4884
  placeholder: placeholder,
4689
4885
  noOptionsMessage: typeof noOptionsMessage === 'function' ? noOptionsMessage : defaultNoOptionsMessage,
4690
- styles: getSelectStyles({
4886
+ styles: getSelectStyles$1({
4691
4887
  isInvalid: hasError,
4692
4888
  wrapToNextLine: true
4693
4889
  }),
@@ -4719,58 +4915,6 @@ var MultiSelectField = function MultiSelectField(_ref) {
4719
4915
  }));
4720
4916
  };
4721
4917
 
4722
- var useSelectFieldControllers = function useSelectFieldControllers(_ref) {
4723
- var name = _ref.name,
4724
- inputId = _ref.id,
4725
- value = _ref.value,
4726
- _onChange = _ref.onChange,
4727
- _onBlur = _ref.onBlur,
4728
- error = _ref.error;
4729
-
4730
- var _useFormContext = useFormContext(),
4731
- formik = _useFormContext.formik;
4732
-
4733
- var id = useFieldId({
4734
- name: name,
4735
- id: inputId
4736
- });
4737
- var controllers = {
4738
- id: id,
4739
- error: error,
4740
- value: value,
4741
- onChange: function onChange(option) {
4742
- return _onChange && _onChange(option);
4743
- },
4744
- onBlur: function onBlur(option) {
4745
- return _onBlur && _onBlur(option);
4746
- }
4747
- };
4748
- var formikState = getFormikState(name, formik);
4749
-
4750
- if (formik && formikState) {
4751
- controllers = _extends({}, controllers, {
4752
- error: error ? controllers.error : formikState.error,
4753
- value: value ? controllers.value : formikState.value,
4754
- onChange: function onChange(option) {
4755
- if (_onChange) {
4756
- _onChange(option);
4757
- }
4758
-
4759
- formik.setFieldValue(name, option);
4760
- },
4761
- onBlur: function onBlur(option) {
4762
- if (_onBlur) {
4763
- _onBlur(option);
4764
- }
4765
-
4766
- formik.setFieldTouched(name);
4767
- }
4768
- });
4769
- }
4770
-
4771
- return controllers;
4772
- };
4773
-
4774
4918
  var styles$q = {"custom-control":"_1cDCR"};
4775
4919
 
4776
4920
  var _excluded$4 = ["children", "CustomPrefixComponent"];
@@ -4855,7 +4999,7 @@ var SelectField = function SelectField(_ref) {
4855
4999
  value: controllers.value,
4856
5000
  placeholder: placeholder,
4857
5001
  noOptionsMessage: typeof noOptionsMessage === 'function' ? noOptionsMessage : defaultNoOptionsMessage,
4858
- styles: getSelectStyles({
5002
+ styles: getSelectStyles$1({
4859
5003
  isInvalid: hasError,
4860
5004
  asToolbarFilter: asToolbarFilter
4861
5005
  }),
@@ -5927,6 +6071,7 @@ exports.IconSitemap = IconSitemap;
5927
6071
  exports.IconSlidersH = IconSlidersH;
5928
6072
  exports.IconSort = IconSort;
5929
6073
  exports.IconStar = IconStar;
6074
+ exports.IconStarSolid = IconStarSolid;
5930
6075
  exports.IconStickyNoteLines = IconStickyNoteLines;
5931
6076
  exports.IconStopwatch = IconStopwatch;
5932
6077
  exports.IconStrikethrough = IconStrikethrough;
@@ -5974,6 +6119,7 @@ exports.TextAreaField = TextAreaField;
5974
6119
  exports.TextField = TextField;
5975
6120
  exports.TimeField = TimeField;
5976
6121
  exports.Toggle = Toggle;
6122
+ exports.ToolbarSelect = ToolbarSelect;
5977
6123
  exports.Tooltip = Tooltip$1;
5978
6124
  exports.WeekField = WeekField;
5979
6125
  //# sourceMappingURL=index.js.map