@7shifts/sous-chef 3.7.0 → 3.9.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.
@@ -22,7 +22,9 @@ declare type Props<T> = {
22
22
  /** When the user opens the menu, if this prop is `true`, it will scroll the page into to the menu view (if its content falls under a scroll). It is recomended to disable this behaviour when using the `MultiSelectField` inside a modal. */
23
23
  menuShouldScrollIntoView?: boolean;
24
24
  testId?: string;
25
+ /** 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. */
26
+ isSearchable?: boolean;
25
27
  };
26
28
  /** Component to make possible choose from a predefined options. */
27
- declare const MultiSelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, label, caption, error, placeholder, noOptionsMessage, disabled, closeOnSelect, menuShouldScrollIntoView, testId }: Props<T>) => JSX.Element;
29
+ declare const MultiSelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, label, caption, error, placeholder, noOptionsMessage, disabled, closeOnSelect, menuShouldScrollIntoView, testId, isSearchable }: Props<T>) => JSX.Element;
28
30
  export default MultiSelectField;
@@ -30,6 +30,8 @@ export declare type Props<T> = {
30
30
  testId?: string;
31
31
  creatableButton?: React.ReactNode;
32
32
  onCreate?: (option: string) => void;
33
+ /** 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. */
34
+ isSearchable?: boolean;
33
35
  };
34
36
  /** Component to make possible choose from a predefined options. */
35
37
  declare const SelectField: <T extends unknown>(props: Props<T>) => JSX.Element;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
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, defaultValue, CustomOption: UserCustomOption, SelectedOptionPrefix, testId, creatableButton, onCreate }: Props<T>) => {
3
+ export declare const useSelectField: <T extends unknown>({ asToolbarFilter, caption, disabled, error, id, isClearable, label, menuShouldScrollIntoView, name, noOptionsMessage, options, onBlur, onChange, placeholder, value, defaultValue, CustomOption: UserCustomOption, SelectedOptionPrefix, testId, creatableButton, onCreate, isSearchable }: Props<T>) => {
4
4
  selectProps: Pick<import("react-select").Props<import("react-select").OptionTypeBase, boolean, import("react-select").GroupTypeBase<any>>, import("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
5
  fieldProps: {
6
6
  caption: import("react").ReactNode;
package/dist/index.css CHANGED
@@ -784,13 +784,6 @@ Just for future references:
784
784
  ._3EHwm {
785
785
  padding-left: 20px;
786
786
  }
787
- ._2GGMG {
788
- display: flex;
789
- }
790
- ._2GGMG:not(:last-child):not(._1ZCir) {
791
- border-bottom: 1px solid var(--color-grey-200);
792
- }
793
-
794
787
  ._2GGMG:focus:not(:focus-visible) {
795
788
  /* Remove the focus indicator on mouse-focus for browsers
796
789
  that do support :focus-visible */
@@ -804,50 +797,17 @@ Just for future references:
804
797
  background-color: var(--color-grey-100);
805
798
  }
806
799
 
807
- ._1ZCir {
808
- border: 1px solid var(--color-eggplant-400);
809
- box-sizing: border-box;
810
- box-shadow: 0 0 8px var(--color-eggplant-300);
811
- }
812
- ._1ZCir:first-child {
813
- border-top-left-radius: 8px;
814
- border-top-right-radius: 8px;
815
- }
816
- ._1ZCir:first-child:not(:last-child) {
817
- border-bottom-left-radius: 0;
818
- border-bottom-right-radius: 0;
819
- }
820
- ._1ZCir:last-child {
821
- border-bottom-left-radius: 8px;
822
- border-bottom-right-radius: 8px;
823
- }
824
- ._1ZCir:last-child:not(:first-child) {
825
- border-top-left-radius: 0;
826
- border-top-right-radius: 0;
800
+ ._2GGMG:first-of-type > td {
801
+ border-top: 1px solid var(--color-grey-200);
827
802
  }
828
803
 
829
- ._kcNkt {
830
- display: flex;
831
- flex-direction: column;
832
- justify-content: center;
833
- position: relative;
834
- }
835
- ._2obax {
836
- padding: 16px;
837
- }
838
- ._bLVPl {
839
- flex-direction: unset;
840
- justify-content: flex-end;
841
- }
842
- ._3PWfD:not(:last-child) {
843
- border-right: 1px solid var(--color-grey-200);
804
+ ._1ZCir td {
805
+ background-color: var(--color-eggplant-100);
844
806
  }
845
-
846
- ._1IGwu {
847
- width: 40px;
848
- padding: 16px;
849
- box-sizing: content-box;
850
- flex-flow: row nowrap;
807
+ ._3Iab2 {
808
+ white-space: nowrap;
809
+ width: 100%;
810
+ display: flex;
851
811
  justify-content: flex-end;
852
812
  }
853
813
  ._v0AEt {
@@ -876,84 +836,51 @@ Just for future references:
876
836
  ._IRJ4j:hover {
877
837
  background: var(--color-grey-100);
878
838
  }
879
- ._2ZgmC {
880
- display: flex;
881
- font-size: 12px;
882
- font-weight: 600;
883
- font-family: "Proxima Nova", sans-serif;
884
- color: var(--color-grey-500);
885
- padding: 0px 17px 8px 17px;
886
- }
887
-
888
- ._3slLU {
889
- display: flex;
890
- align-items: center;
891
- line-height: 21px;
892
- }
893
- ._3slLU:not(._3slLU:first-child) {
894
- padding-left: 16px;
895
- }
896
- ._3slLU:not(._3slLU:last-child) {
897
- padding-right: 16px;
898
- }
899
- ._1-26z {
900
- cursor: pointer;
901
- }
902
- ._1vCLo {
903
- justify-content: flex-end;
839
+ ._2Ybjx {
840
+ position: relative;
841
+ border-bottom: 1px solid var(--color-grey-200);
842
+ padding: 16px;
843
+ word-break: break-word;
844
+ -webkit-hyphens: auto;
845
+ -ms-hyphens: auto;
846
+ hyphens: auto;
904
847
  }
905
-
906
- ._3slLU:focus:not(:focus-visible) {
907
- /* Remove the focus indicator on mouse-focus for browsers
908
- that do support :focus-visible */
909
- outline: none;
848
+ ._2Ybjx:first-of-type {
849
+ border-left: 1px solid var(--color-grey-200);
910
850
  }
911
-
912
- ._2i1wY {
913
- width: 40px;
914
- box-sizing: content-box;
915
- }
916
-
917
- ._BLrNe {
918
- display: inline-block;
919
- padding: 0 8px;
920
- line-height: 1em;
851
+ ._2Ybjx:last-of-type {
852
+ border-right: 1px solid var(--color-grey-200);
921
853
  }
922
-
923
- ._CT4Lp {
924
- border: 1px solid var(--color-grey-200);
925
- border-radius: 8px;
926
- font-family: "Proxima Nova", sans-serif;
927
- font-size: 14px;
854
+ ._5KXHH {
855
+ padding: 0;
928
856
  }
929
-
930
- ._398L3 {
931
- background: var(--color-grey-100);
932
- font-weight: 600;
857
+ ._2-I0j:not(:last-child) {
858
+ border-right: 1px solid var(--color-grey-200);
933
859
  }
934
-
935
- ._2smmY {
936
- margin-top: 20px;
937
- font-family: "Proxima Nova", sans-serif;
860
+ ._D73Vx {
861
+ background: var(--color-radish-100);
862
+ color: var(--color-radish-400);
938
863
  }
939
- ._2Ybjx {
940
- padding: 16px;
941
- align-items: center;
942
- display: flex;
943
- width: 100%;
864
+ ._3A9-M {
944
865
  height: 100%;
945
- box-sizing: border-box;
866
+ display: flex;
867
+ align-items: center;
946
868
  }
947
- ._1cXj6 {
948
- width: 100%;
869
+ ._17Km7 {
949
870
  justify-content: flex-end;
950
871
  }
951
- ._D73Vx {
952
- border-color: var(--color-radish-400);
953
- background: var(--color-radish-100);
954
- color: var(--color-radish-400);
872
+ ._2c6KQ {
955
873
  justify-content: space-between;
956
874
  }
875
+ ._2hIl3 {
876
+ width: 16px;
877
+ }
878
+ ._8Uhyd {
879
+ margin-left: 4px;
880
+ }
881
+ ._3X51R {
882
+ margin-right: 4px;
883
+ }
957
884
  ._2puqJ {
958
885
  position: fixed;
959
886
  top: 0px;
@@ -1679,6 +1606,215 @@ Just for future references:
1679
1606
  ._3Mm-v._3Mm-v {
1680
1607
  border-bottom-right-radius: 8px;
1681
1608
  }
1609
+ ._3qoNq {
1610
+ position: relative;
1611
+ }
1612
+
1613
+ ._2HcDV {
1614
+ position: relative;
1615
+ }
1616
+ ._3dowz > table > thead, ._3dowz > table > tfoot {
1617
+ position: sticky;
1618
+ background-color: white;
1619
+ z-index: 1;
1620
+ }
1621
+ ._3dowz > table > thead {
1622
+ top: 0;
1623
+ }
1624
+ ._3dowz > table > tfoot {
1625
+ bottom: 0;
1626
+ }
1627
+
1628
+ ._tGpUv {
1629
+ width: 100%;
1630
+ height: 100%;
1631
+ border-spacing: 0;
1632
+ border-collapse: separate;
1633
+ border: 0;
1634
+ }
1635
+ ._3VePT {
1636
+ table-layout: fixed;
1637
+ }
1638
+
1639
+ ._2ZgmC {
1640
+ text-align: left;
1641
+ }
1642
+
1643
+ ._3slLU {
1644
+ line-height: 20px;
1645
+ padding: 0 16px 8px 16px;
1646
+ background-color: unset;
1647
+ color: var(--color-grey-500);
1648
+ font-size: 12px;
1649
+ font-weight: 600;
1650
+ font-family: "Proxima Nova", sans-serif;
1651
+ border: 0;
1652
+ }
1653
+ ._1jb-H {
1654
+ width: 100%;
1655
+ height: 100%;
1656
+ display: flex;
1657
+ align-items: center;
1658
+ }
1659
+ ._2Np60 {
1660
+ justify-content: flex-end;
1661
+ }
1662
+ ._1-26z {
1663
+ cursor: pointer;
1664
+ }
1665
+
1666
+ ._3slLU:focus:not(:focus-visible) {
1667
+ /* Remove the focus indicator on mouse-focus for browsers
1668
+ that do support :focus-visible */
1669
+ outline: none;
1670
+ }
1671
+
1672
+ ._2i1wY {
1673
+ box-sizing: content-box;
1674
+ }
1675
+
1676
+ ._BLrNe {
1677
+ display: inline-block;
1678
+ padding-left: 8px;
1679
+ line-height: 1em;
1680
+ }
1681
+
1682
+ ._CT4Lp {
1683
+ border: 1px solid var(--color-grey-200);
1684
+ border-radius: 8px;
1685
+ font-family: "Proxima Nova", sans-serif;
1686
+ font-size: 14px;
1687
+ }
1688
+ ._CT4Lp tr:first-of-type > td:first-of-type {
1689
+ border-top-left-radius: 8px;
1690
+ }
1691
+ ._CT4Lp tr:first-of-type > td:last-of-type {
1692
+ border-top-right-radius: 8px;
1693
+ }
1694
+ ._CT4Lp tr:last-of-type > td:first-of-type {
1695
+ border-bottom-left-radius: 8px;
1696
+ }
1697
+ ._CT4Lp tr:last-of-type > td:last-of-type {
1698
+ border-bottom-right-radius: 8px;
1699
+ }
1700
+ ._1wU1R tr:last-of-type > td:first-of-type {
1701
+ border-bottom-left-radius: 0;
1702
+ }
1703
+ ._1wU1R tr:last-of-type > td:last-of-type {
1704
+ border-bottom-right-radius: 0;
1705
+ }
1706
+
1707
+ ._398L3 {
1708
+ font-weight: 600;
1709
+ font-size: 14px;
1710
+ }
1711
+ ._398L3 tr td {
1712
+ background: var(--color-grey-100);
1713
+ }
1714
+ ._398L3 tr td:first-of-type {
1715
+ border-left: 1px solid var(--color-grey-200);
1716
+ }
1717
+ ._398L3 tr td:last-of-type {
1718
+ border-right: 1px solid var(--color-grey-200);
1719
+ }
1720
+ ._398L3 tr:first-of-type td {
1721
+ border-top: 0;
1722
+ }
1723
+ ._398L3 tr:last-of-type td:first-of-type {
1724
+ border-bottom-left-radius: 8px;
1725
+ }
1726
+ ._398L3 tr:last-of-type td:last-of-type {
1727
+ border-bottom-right-radius: 8px;
1728
+ }
1729
+
1730
+ ._2smmY {
1731
+ margin-top: 20px;
1732
+ font-family: "Proxima Nova", sans-serif;
1733
+ }
1734
+ ._1zw4R {
1735
+ width: 100%;
1736
+ height: 20px;
1737
+ border: 1px solid var(--color-grey-200);
1738
+ box-sizing: border-box;
1739
+ position: absolute;
1740
+ z-index: 1;
1741
+ pointer-events: none;
1742
+ }
1743
+ ._2vWl5 {
1744
+ top: 28px;
1745
+ border-bottom: 0;
1746
+ border-top-right-radius: 8px;
1747
+ border-top-left-radius: 8px;
1748
+ }
1749
+ ._397Yd {
1750
+ bottom: 0;
1751
+ border-top: 0;
1752
+ border-bottom-right-radius: 8px;
1753
+ border-bottom-left-radius: 8px;
1754
+ }
1755
+ ._AGTVL {
1756
+ width: 8px;
1757
+ height: 8px;
1758
+ overflow: hidden;
1759
+ position: absolute;
1760
+ left: -1px;
1761
+ }
1762
+ ._AGTVL::before {
1763
+ content: "";
1764
+ display: block;
1765
+ width: 200%;
1766
+ height: 200%;
1767
+ position: absolute;
1768
+ border-radius: 50%;
1769
+ left: 0;
1770
+ }
1771
+ ._3wzKK {
1772
+ top: -1px;
1773
+ }
1774
+ ._3wzKK::before {
1775
+ top: 0;
1776
+ box-shadow: -6px -6px 0 0 white;
1777
+ }
1778
+ ._2pJrs {
1779
+ bottom: -1px;
1780
+ }
1781
+ ._2pJrs::before {
1782
+ bottom: 0;
1783
+ box-shadow: -6px 6px 0 0 white;
1784
+ }
1785
+ ._vh4go {
1786
+ width: 8px;
1787
+ height: 8px;
1788
+ overflow: hidden;
1789
+ position: absolute;
1790
+ right: -1px;
1791
+ }
1792
+ ._vh4go::before {
1793
+ content: "";
1794
+ display: block;
1795
+ width: 200%;
1796
+ height: 200%;
1797
+ position: absolute;
1798
+ border-radius: 50%;
1799
+ right: 0;
1800
+ }
1801
+ ._2sj0a {
1802
+ top: -1px;
1803
+ }
1804
+ ._2sj0a::before {
1805
+ top: 0;
1806
+ box-shadow: 6px -6px 0 0 white;
1807
+ }
1808
+ ._1s8kO {
1809
+ bottom: -1px;
1810
+ }
1811
+ ._1s8kO::before {
1812
+ bottom: 0;
1813
+ box-shadow: 6px 6px 0 0 white;
1814
+ }
1815
+ ._94pbt > td {
1816
+ border: 1px solid var(--color-grey-200);
1817
+ }
1682
1818
  ._2X-yg {
1683
1819
  width: 272px;
1684
1820
  }
@@ -3204,6 +3340,7 @@ input:disabled + ._1tMq-::after {
3204
3340
  max-width: fit-content;
3205
3341
  display: inline-block;
3206
3342
  text-align: center;
3343
+ white-space: nowrap;
3207
3344
  }
3208
3345
  ._23q4Y::first-letter {
3209
3346
  text-transform: capitalize;