@7shifts/sous-chef 3.37.0 → 3.38.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/README.md CHANGED
@@ -48,7 +48,6 @@ class Example extends Component {
48
48
  ## Documentation
49
49
 
50
50
  You can find the components documentation in [here](https://zeroheight.com/31613d024/p/94f423-introducing-sous-chef--components).
51
- just to trigger a CI
52
51
 
53
52
  ## Contributing
54
53
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { EmptyStateProps } from '../EmptyStateContainer/types';
3
- type Props = Omit<EmptyStateProps, 'isPaywall'>;
4
- declare const EmptyState: ({ header, title, children, mediaUrl, actions, caption, size, testId }: Props) => React.JSX.Element;
2
+ import { EmptyStateAsBanner, EmptyStateAsCard } from '../EmptyStateContainer/types';
3
+ type Props = Omit<EmptyStateAsCard, 'isPaywall'> | Omit<EmptyStateAsBanner, 'isPaywall'>;
4
+ declare const EmptyState: (props: Props) => React.JSX.Element;
5
5
  export default EmptyState;
@@ -22,3 +22,10 @@ export type EmptyStateProps = {
22
22
  /** This is used for setting a data-testid on the component*/
23
23
  testId?: string;
24
24
  };
25
+ export type EmptyStateAsCard = {
26
+ as?: 'card';
27
+ onClose?: () => void;
28
+ } & EmptyStateProps;
29
+ export type EmptyStateAsBanner = {
30
+ as?: 'banner';
31
+ } & EmptyStateProps;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
- import { EmptyStateProps } from '../EmptyStateContainer/types';
3
- declare const Paywall: ({ header, title, children, mediaUrl, actions, size, caption, testId }: Omit<EmptyStateProps, 'isPaywall'>) => React.JSX.Element;
2
+ import { EmptyStateAsBanner, EmptyStateAsCard } from '../EmptyStateContainer/types';
3
+ type Props = Omit<EmptyStateAsCard, 'isPaywall'> | Omit<EmptyStateAsBanner, 'isPaywall'>;
4
+ declare const Paywall: (props: Props) => React.JSX.Element;
4
5
  export default Paywall;
@@ -33,5 +33,8 @@
33
33
  "october": "October",
34
34
  "november": "November",
35
35
  "december": "December"
36
+ },
37
+ "Card": {
38
+ "dismiss": "Dismiss"
36
39
  }
37
40
  }
@@ -33,5 +33,8 @@
33
33
  "october": "Octubre",
34
34
  "november": "Noviembre",
35
35
  "december": "Diciembre"
36
+ },
37
+ "Card": {
38
+ "dismiss": "Descartar"
36
39
  }
37
40
  }
@@ -33,5 +33,8 @@
33
33
  "october": "Octobre",
34
34
  "november": "Novembre",
35
35
  "december": "Décembre"
36
+ },
37
+ "Card": {
38
+ "dismiss": "Rejeter"
36
39
  }
37
40
  }
package/dist/index.css CHANGED
@@ -1410,7 +1410,7 @@ h5._32amZ {
1410
1410
  box-sizing: border-box;
1411
1411
  background: white;
1412
1412
  border: 1px solid var(--color-grey-200);
1413
- border-radius: 8px;
1413
+ border-radius: 20px;
1414
1414
  width: 100%;
1415
1415
  height: 100%;
1416
1416
  padding: 24px 20px;
@@ -1447,12 +1447,22 @@ h5._32amZ {
1447
1447
  ._L9ZA7 {
1448
1448
  position: absolute;
1449
1449
  z-index: var(--z-index-base);
1450
- right: 8px;
1451
- top: 8px;
1450
+ right: 6px;
1451
+ top: 6px;
1452
1452
  }
1453
1453
  ._5YidV {
1454
1454
  pointer-events: none;
1455
1455
  }
1456
+ ._37yla {
1457
+ position: absolute;
1458
+ width: 38px;
1459
+ height: 38px;
1460
+ top: 6px;
1461
+ right: 6px;
1462
+ }
1463
+ ._3J4FP {
1464
+ pointer-events: none;
1465
+ }
1456
1466
  ._cQT44 {
1457
1467
  position: absolute;
1458
1468
  width: 38px;
@@ -4521,7 +4531,6 @@ input._1zowl {
4521
4531
  }
4522
4532
  }
4523
4533
  ._1AdW7 {
4524
- max-width: 1000px;
4525
4534
  display: flex;
4526
4535
  flex-direction: row;
4527
4536
  justify-content: space-between;
@@ -4559,4 +4568,18 @@ input._1zowl {
4559
4568
  text-align: center;
4560
4569
  flex-direction: column-reverse;
4561
4570
  }
4571
+ }
4572
+ ._3kFM9 {
4573
+ padding: 12px 16px;
4574
+ }
4575
+ ._3kmTB {
4576
+ display: flex;
4577
+ justify-content: center;
4578
+ }
4579
+ ._DrBEi {
4580
+ padding: 12px 16px;
4581
+ }
4582
+ ._3YbH7 {
4583
+ display: flex;
4584
+ justify-content: center;
4562
4585
  }
package/dist/index.js CHANGED
@@ -5694,12 +5694,16 @@ var Calendar = {
5694
5694
  november: "November",
5695
5695
  december: "December"
5696
5696
  };
5697
+ var Card = {
5698
+ dismiss: "Dismiss"
5699
+ };
5697
5700
  var en = {
5698
5701
  PaginationControls: PaginationControls,
5699
5702
  AsyncSelectField: AsyncSelectField,
5700
5703
  SelectField: SelectField,
5701
5704
  HintModal: HintModal,
5702
- Calendar: Calendar
5705
+ Calendar: Calendar,
5706
+ Card: Card
5703
5707
  };
5704
5708
 
5705
5709
  var initialValue = {
@@ -7246,13 +7250,14 @@ var KebabMenu = function KebabMenu(_ref) {
7246
7250
  })));
7247
7251
  };
7248
7252
 
7249
- var styles$q = {"card":"_2o1ez","card__body":"_1PFiJ","card__body--interactive":"_3dQzA","card--focus":"_5dJZO","card__body--focus":"_DWgI_","card__body--disabled":"_24dNX","card__body--with-kebab":"_2LVaD","card__kebab":"_L9ZA7","card__kebab--disabled":"_5YidV"};
7253
+ var styles$q = {"card":"_2o1ez","card__body":"_1PFiJ","card__body--interactive":"_3dQzA","card--focus":"_5dJZO","card__body--focus":"_DWgI_","card__body--disabled":"_24dNX","card__body--with-kebab":"_2LVaD","card__kebab":"_L9ZA7","card__kebab--disabled":"_5YidV","card__close":"_37yla","card__close--disabled":"_3J4FP"};
7250
7254
 
7251
- var _excluded$2w = ["children", "onClick", "isSelected", "disabled", "actions", "testId"];
7252
- var Card = function Card(_ref) {
7253
- var _classnames, _classnames2, _classnames3;
7255
+ var _excluded$2w = ["children", "onClick", "onClose", "isSelected", "disabled", "actions", "testId"];
7256
+ var Card$1 = function Card(_ref) {
7257
+ var _classnames, _classnames2, _classnames3, _classnames4;
7254
7258
  var children = _ref.children,
7255
7259
  onClick = _ref.onClick,
7260
+ onClose = _ref.onClose,
7256
7261
  _ref$isSelected = _ref.isSelected,
7257
7262
  isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
7258
7263
  _ref$disabled = _ref.disabled,
@@ -7260,6 +7265,7 @@ var Card = function Card(_ref) {
7260
7265
  actions = _ref.actions,
7261
7266
  testId = _ref.testId,
7262
7267
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$2w);
7268
+ var translate = useTranslation('Card');
7263
7269
  var _getPositionProps = getPositionProps(rest),
7264
7270
  positionProps = _getPositionProps.positionProps,
7265
7271
  otherProps = _getPositionProps.otherProps;
@@ -7281,8 +7287,17 @@ var Card = function Card(_ref) {
7281
7287
  }, children), actions && React__default.createElement("div", {
7282
7288
  className: classnames(styles$q['card__kebab'], (_classnames3 = {}, _classnames3[styles$q['card__kebab--disabled']] = disabled, _classnames3))
7283
7289
  }, React__default.createElement(KebabMenu, {
7284
- actions: actions
7285
- })));
7290
+ actions: onClose ? actions.concat({
7291
+ action: 'dismiss',
7292
+ label: translate('dismiss'),
7293
+ onAction: onClose
7294
+ }) : actions
7295
+ })), !actions && onClose && React__default.createElement("div", {
7296
+ className: classnames(styles$q['card__close'], (_classnames4 = {}, _classnames4[styles$q['card__close--disabled']] = disabled, _classnames4))
7297
+ }, React__default.createElement(Button, {
7298
+ theme: "link-icon",
7299
+ onClick: onClose
7300
+ }, React__default.createElement(IconTimes, null))));
7286
7301
  };
7287
7302
 
7288
7303
  var styles$r = {"callout-card__close":"_cQT44","callout-card__header":"_rSzMg"};
@@ -7295,7 +7310,7 @@ var CalloutCard = function CalloutCard(_ref) {
7295
7310
  onClose = _ref.onClose,
7296
7311
  actions = _ref.actions,
7297
7312
  testId = _ref.testId;
7298
- return React__default.createElement(Card, {
7313
+ return React__default.createElement(Card$1, {
7299
7314
  testId: testId
7300
7315
  }, React__default.createElement(Inline, null, React__default.createElement(Inline, {
7301
7316
  alignItems: "center"
@@ -12834,16 +12849,21 @@ var EmptyStateContainer = function EmptyStateContainer(_ref) {
12834
12849
  });
12835
12850
  };
12836
12851
 
12837
- var Paywall = function Paywall(_ref) {
12838
- var header = _ref.header,
12839
- title = _ref.title,
12840
- children = _ref.children,
12841
- mediaUrl = _ref.mediaUrl,
12842
- actions = _ref.actions,
12843
- size = _ref.size,
12844
- caption = _ref.caption,
12845
- testId = _ref.testId;
12846
- return React__default.createElement(EmptyStateContainer, {
12852
+ var styles$1f = {"paywall--as-card":"_3kFM9","paywall--as-card--centered":"_3kmTB"};
12853
+
12854
+ var Paywall = function Paywall(props) {
12855
+ var header = props.header,
12856
+ title = props.title,
12857
+ children = props.children,
12858
+ mediaUrl = props.mediaUrl,
12859
+ actions = props.actions,
12860
+ size = props.size,
12861
+ caption = props.caption,
12862
+ testId = props.testId,
12863
+ _props$as = props.as,
12864
+ as = _props$as === void 0 ? 'banner' : _props$as;
12865
+ var onClose = props.as === 'card' ? props.onClose : undefined;
12866
+ var emptyStateContainer = React__default.createElement(EmptyStateContainer, {
12847
12867
  header: header,
12848
12868
  title: title,
12849
12869
  mediaUrl: mediaUrl,
@@ -12853,18 +12873,32 @@ var Paywall = function Paywall(_ref) {
12853
12873
  isPaywall: true,
12854
12874
  testId: testId
12855
12875
  }, children);
12856
- };
12857
-
12858
- var EmptyState = function EmptyState(_ref) {
12859
- var header = _ref.header,
12860
- title = _ref.title,
12861
- children = _ref.children,
12862
- mediaUrl = _ref.mediaUrl,
12863
- actions = _ref.actions,
12864
- caption = _ref.caption,
12865
- size = _ref.size,
12866
- testId = _ref.testId;
12867
- return React__default.createElement(EmptyStateContainer, {
12876
+ if (as === 'card') {
12877
+ var _classnames;
12878
+ return React__default.createElement(Card$1, {
12879
+ onClose: onClose
12880
+ }, React__default.createElement("div", {
12881
+ className: classnames(styles$1f['paywall--as-card'], (_classnames = {}, _classnames[styles$1f['paywall--as-card--centered']] = size === 'small', _classnames))
12882
+ }, emptyStateContainer));
12883
+ }
12884
+ return emptyStateContainer;
12885
+ };
12886
+
12887
+ var styles$1g = {"empty-state--as-card":"_DrBEi","empty-state--as-card--centered":"_3YbH7"};
12888
+
12889
+ var EmptyState = function EmptyState(props) {
12890
+ var header = props.header,
12891
+ title = props.title,
12892
+ children = props.children,
12893
+ mediaUrl = props.mediaUrl,
12894
+ actions = props.actions,
12895
+ caption = props.caption,
12896
+ size = props.size,
12897
+ testId = props.testId,
12898
+ _props$as = props.as,
12899
+ as = _props$as === void 0 ? 'banner' : _props$as;
12900
+ var onClose = props.as === 'card' ? props.onClose : undefined;
12901
+ var emptyStateContainer = React__default.createElement(EmptyStateContainer, {
12868
12902
  header: size !== EMPTY_STATE_SIZE.SMALL ? header : undefined,
12869
12903
  title: title,
12870
12904
  mediaUrl: mediaUrl,
@@ -12873,6 +12907,15 @@ var EmptyState = function EmptyState(_ref) {
12873
12907
  size: size,
12874
12908
  testId: testId
12875
12909
  }, children);
12910
+ if (as === 'card') {
12911
+ var _classnames;
12912
+ return React__default.createElement(Card$1, {
12913
+ onClose: onClose
12914
+ }, React__default.createElement("div", {
12915
+ className: classnames(styles$1g['empty-state--as-card'], (_classnames = {}, _classnames[styles$1g['empty-state--as-card--centered']] = size === 'small', _classnames))
12916
+ }, emptyStateContainer));
12917
+ }
12918
+ return emptyStateContainer;
12876
12919
  };
12877
12920
 
12878
12921
  exports.AsyncSelectField = AsyncSelectField$1;
@@ -12885,7 +12928,7 @@ exports.Button = Button;
12885
12928
  exports.COLORS = COLORS;
12886
12929
  exports.Calendar = Calendar$1;
12887
12930
  exports.CalloutCard = CalloutCard;
12888
- exports.Card = Card;
12931
+ exports.Card = Card$1;
12889
12932
  exports.CheckboxField = CheckboxField;
12890
12933
  exports.Chip = Chip;
12891
12934
  exports.CircularProgress = CircularProgress;