@commercetools-frontend/application-components 22.12.0 → 22.13.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.
Files changed (28) hide show
  1. package/dist/commercetools-frontend-application-components.cjs.dev.js +747 -551
  2. package/dist/commercetools-frontend-application-components.cjs.prod.js +568 -423
  3. package/dist/commercetools-frontend-application-components.esm.js +746 -551
  4. package/dist/declarations/src/components/custom-views/custom-views-selector/custom-views-selector.d.ts +2 -1
  5. package/dist/declarations/src/components/detail-pages/custom-form-detail-page/custom-form-detail-page.d.ts +2 -2
  6. package/dist/declarations/src/components/detail-pages/form-detail-page/form-detail-page.d.ts +2 -2
  7. package/dist/declarations/src/components/detail-pages/info-detail-page/info-detail-page.d.ts +2 -2
  8. package/dist/declarations/src/components/detail-pages/tabular-detail-page/tabular-detail-page.d.ts +2 -2
  9. package/dist/declarations/src/components/drawer/drawer.d.ts +179 -0
  10. package/dist/declarations/src/components/drawer/index.d.ts +1 -0
  11. package/dist/declarations/src/components/internals/page-header-title.d.ts +2 -1
  12. package/dist/declarations/src/components/internals/page-header.d.ts +1 -0
  13. package/dist/declarations/src/components/internals/tabular-page.d.ts +5 -1
  14. package/dist/declarations/src/components/main-pages/custom-form-main-page/custom-form-main-page.d.ts +2 -2
  15. package/dist/declarations/src/components/main-pages/form-main-page/form-main-page.d.ts +2 -2
  16. package/dist/declarations/src/components/main-pages/info-main-page/info-main-page.d.ts +2 -2
  17. package/dist/declarations/src/components/main-pages/tabular-main-page/tabular-main-page.d.ts +2 -2
  18. package/dist/declarations/src/components/modal-pages/internals/modal-page-top-bar.d.ts +7 -1
  19. package/dist/declarations/src/components/modal-pages/internals/modal-page.d.ts +3 -2
  20. package/dist/declarations/src/components/modal-pages/internals/modal-page.styles.d.ts +22 -4
  21. package/dist/declarations/src/index.d.ts +1 -1
  22. package/dist/declarations/src/theming.d.ts +8 -7
  23. package/dist/{public-page-layout-0e1daa2e.cjs.prod.js → public-page-layout-609304bf.cjs.prod.js} +4 -3
  24. package/dist/{public-page-layout-4e26387d.cjs.dev.js → public-page-layout-6891ad6b.cjs.dev.js} +4 -3
  25. package/dist/{public-page-layout-82978d93.esm.js → public-page-layout-9ea88288.esm.js} +4 -3
  26. package/package.json +25 -24
  27. package/dist/declarations/src/components/custom-views/custom-panel/custom-panel.d.ts +0 -9
  28. package/dist/declarations/src/components/custom-views/custom-panel/index.d.ts +0 -1
@@ -34,15 +34,16 @@ var SecondaryButton = require('@commercetools-uikit/secondary-button');
34
34
  var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
35
35
  var omitBy = require('lodash/omitBy');
36
36
  var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
37
- var _setTimeout = require('@babel/runtime-corejs3/core-js-stable/set-timeout');
38
37
  var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
39
38
  var sentry = require('@commercetools-frontend/sentry');
39
+ var AccessibleButton = require('@commercetools-uikit/accessible-button');
40
40
  var Constraints = require('@commercetools-uikit/constraints');
41
41
  var actionsGlobal = require('@commercetools-frontend/actions-global');
42
42
  var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
43
- var reactBroadcast = require('@flopflip/react-broadcast');
44
- var FlatButton = require('@commercetools-uikit/flat-button');
45
43
  var IconButton = require('@commercetools-uikit/icon-button');
44
+ var _setTimeout = require('@babel/runtime-corejs3/core-js-stable/set-timeout');
45
+ var FlatButton = require('@commercetools-uikit/flat-button');
46
+ var reactBroadcast = require('@flopflip/react-broadcast');
46
47
  var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
47
48
  var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
48
49
  var PageNotFoundSVG = require('@commercetools-frontend/assets/images/page-not-found.svg');
@@ -71,11 +72,12 @@ var PrimaryButton__default = /*#__PURE__*/_interopDefault(PrimaryButton);
71
72
  var SecondaryButton__default = /*#__PURE__*/_interopDefault(SecondaryButton);
72
73
  var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
73
74
  var omitBy__default = /*#__PURE__*/_interopDefault(omitBy);
74
- var _setTimeout__default = /*#__PURE__*/_interopDefault(_setTimeout);
75
75
  var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
76
+ var AccessibleButton__default = /*#__PURE__*/_interopDefault(AccessibleButton);
76
77
  var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
77
- var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
78
78
  var IconButton__default = /*#__PURE__*/_interopDefault(IconButton);
79
+ var _setTimeout__default = /*#__PURE__*/_interopDefault(_setTimeout);
80
+ var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
79
81
  var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
80
82
  var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
81
83
  var PageNotFoundSVG__default = /*#__PURE__*/_interopDefault(PageNotFoundSVG);
@@ -83,7 +85,7 @@ var FailedAuthorizationSVG__default = /*#__PURE__*/_interopDefault(FailedAuthori
83
85
  var useResizeObserver__default = /*#__PURE__*/_interopDefault(useResizeObserver);
84
86
 
85
87
  // NOTE: This string will be replaced on build time with the package version.
86
- var version = "22.12.0";
88
+ var version = "22.13.1";
87
89
 
88
90
  var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9;
89
91
  const appKitSpacing55 = '40px';
@@ -118,6 +120,7 @@ const themesOverrides = {
118
120
  heightForTab: '2px',
119
121
  lineHeightForNavbarLink: designSystem.designTokens.lineHeight20,
120
122
  marginBottomForPageTopBar: designSystem.designTokens.spacing40,
123
+ marginForCustomViewsSelectorAsTabular: "0 ".concat(appKitSpacing55),
121
124
  marginForDialogContainerContents: _concatInstanceProperty__default["default"](_context = "".concat(designSystem.designTokens.spacing30, " 0 ")).call(_context, designSystem.designTokens.spacing50, " 0"),
122
125
  marginForModalPageHeader: "0 ".concat(appKitSpacing55),
123
126
  marginForUserMenuItem: "".concat(designSystem.designTokens.spacing10, " 0"),
@@ -199,11 +202,11 @@ const TabHeader = props => {
199
202
  };
200
203
  TabHeader.propTypes = {};
201
204
  TabHeader.displayName = 'TabHeader';
202
- const defaultProps$i = {
205
+ const defaultProps$j = {
203
206
  isDisabled: false,
204
207
  exactPathMatch: false
205
208
  };
206
- TabHeader.defaultProps = defaultProps$i;
209
+ TabHeader.defaultProps = defaultProps$j;
207
210
 
208
211
  const getConstraintForGridStyle = size => {
209
212
  switch (size) {
@@ -255,7 +258,7 @@ jsxRuntime.jsx("div", _objectSpread$6(_objectSpread$6({}, props), {}, {
255
258
  "data-role": "dialog-overlay",
256
259
  children: contentElement
257
260
  }));
258
- const defaultProps$h = {
261
+ const defaultProps$i = {
259
262
  // TODO: t-shirt sizes are deprecated but we need to keep using them for
260
263
  // backwards compatibility and to help with styling migration
261
264
  // After the migration is done, we should change this default value to 13.
@@ -324,7 +327,7 @@ const DialogContainer = props => jsxRuntime.jsx(react.ClassNames, {
324
327
  });
325
328
  DialogContainer.propTypes = {};
326
329
  DialogContainer.displayName = 'DialogContainer';
327
- DialogContainer.defaultProps = defaultProps$h;
330
+ DialogContainer.defaultProps = defaultProps$i;
328
331
 
329
332
  // The overflow should be "auto", to make the container scrollable
330
333
  const DialogContent = /*#__PURE__*/_styled__default["default"]("div", {
@@ -381,7 +384,7 @@ function filterDataAttributes(obj) {
381
384
 
382
385
  function ownKeys$5(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
383
386
  function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
384
- const defaultProps$g = {
387
+ const defaultProps$h = {
385
388
  isPrimaryButtonDisabled: false,
386
389
  dataAttributesPrimaryButton: {},
387
390
  dataAttributesSecondaryButton: {}
@@ -409,9 +412,9 @@ const DialogFooter = props => {
409
412
  };
410
413
  DialogFooter.propTypes = {};
411
414
  DialogFooter.displayName = 'DialogFooter';
412
- DialogFooter.defaultProps = defaultProps$g;
415
+ DialogFooter.defaultProps = defaultProps$h;
413
416
 
414
- const defaultProps$f = {
417
+ const defaultProps$g = {
415
418
  labelSecondary: i18n.sharedMessages.cancel,
416
419
  labelPrimary: i18n.sharedMessages.confirm
417
420
  };
@@ -439,12 +442,12 @@ const ConfirmationDialog = props => jsxRuntime.jsxs(DialogContainer, {
439
442
  });
440
443
  ConfirmationDialog.propTypes = {};
441
444
  ConfirmationDialog.displayName = 'ConfirmationDialog';
442
- ConfirmationDialog.defaultProps = defaultProps$f;
445
+ ConfirmationDialog.defaultProps = defaultProps$g;
443
446
  // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
444
447
  // The Intl messages can be used for button labels.
445
448
  ConfirmationDialog.Intl = i18n.sharedMessages;
446
449
 
447
- const defaultProps$e = {
450
+ const defaultProps$f = {
448
451
  labelSecondary: i18n.sharedMessages.cancel,
449
452
  labelPrimary: i18n.sharedMessages.save
450
453
  };
@@ -473,12 +476,80 @@ const FormDialog = props => jsxRuntime.jsxs(DialogContainer, {
473
476
  });
474
477
  FormDialog.propTypes = {};
475
478
  FormDialog.displayName = 'FormDialog';
476
- FormDialog.defaultProps = defaultProps$e;
479
+ FormDialog.defaultProps = defaultProps$f;
477
480
  // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
478
481
  // The Intl messages can be used for button labels.
479
482
  FormDialog.Intl = i18n.sharedMessages;
480
483
 
481
- const defaultProps$d = {
484
+ function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
485
+ function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
486
+ const primaryDefaultProps = {
487
+ label: i18n.sharedMessages.confirm,
488
+ isDisabled: false,
489
+ dataAttributes: {}
490
+ };
491
+ const useFormattedLabel = label => {
492
+ const intl = reactIntl.useIntl();
493
+ return typeof label === 'string' ? label : intl.formatMessage(label);
494
+ };
495
+ const FormPrimaryButton = props => {
496
+ const label = useFormattedLabel(props.label);
497
+ return jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$4({
498
+ label: label,
499
+ onClick: props.onClick,
500
+ isDisabled: props.isDisabled
501
+ }, filterDataAttributes(props.dataAttributes)));
502
+ };
503
+ FormPrimaryButton.propTypes = {};
504
+ FormPrimaryButton.displayName = 'FormPrimaryButton';
505
+ FormPrimaryButton.defaultProps = primaryDefaultProps;
506
+ const secondaryDefaultProps = {
507
+ label: i18n.sharedMessages.cancel,
508
+ isDisabled: false,
509
+ dataAttributes: {}
510
+ };
511
+ const FormSecondaryButton = props => {
512
+ const label = useFormattedLabel(props.label);
513
+ return jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$4({
514
+ label: label,
515
+ onClick: props.onClick,
516
+ isDisabled: props.isDisabled,
517
+ iconLeft: props.iconLeft
518
+ }, filterDataAttributes(props.dataAttributes)));
519
+ };
520
+ FormSecondaryButton.propTypes = {};
521
+ FormSecondaryButton.displayName = 'FormSecondaryButton';
522
+ FormSecondaryButton.defaultProps = secondaryDefaultProps;
523
+ const deleteDefaultProps = {
524
+ label: i18n.sharedMessages.delete,
525
+ isDisabled: false,
526
+ dataAttributes: {}
527
+ };
528
+ const FormDeleteButton = props => {
529
+ const label = useFormattedLabel(props.label);
530
+ return jsxRuntime.jsx(IconButton__default["default"], _objectSpread$4({
531
+ icon: jsxRuntime.jsx(icons.BinLinearIcon, {}),
532
+ label: label,
533
+ onClick: props.onClick,
534
+ isDisabled: props.isDisabled
535
+ }, filterDataAttributes(props.dataAttributes)));
536
+ };
537
+ FormDeleteButton.propTypes = {};
538
+ FormDeleteButton.displayName = 'FormDeleteButton';
539
+ FormDeleteButton.defaultProps = deleteDefaultProps;
540
+
541
+ const messages$4 = reactIntl.defineMessages({
542
+ back: {
543
+ id: 'Components.ModalPage.TopBar.Back',
544
+ defaultMessage: 'Go Back'
545
+ },
546
+ close: {
547
+ id: 'Components.ModalPage.TopBar.Close',
548
+ defaultMessage: 'Close Modal Page'
549
+ }
550
+ });
551
+
552
+ const defaultProps$e = {
482
553
  titleSize: 'small',
483
554
  truncate: false
484
555
  };
@@ -494,6 +565,13 @@ const Title = props => {
494
565
  truncate: props.truncate,
495
566
  children: props.title
496
567
  });
568
+ case 'medium':
569
+ return jsxRuntime.jsx(Text__default["default"].Headline, {
570
+ as: "h2",
571
+ title: props.title,
572
+ truncate: props.truncate,
573
+ children: props.title
574
+ });
497
575
  default:
498
576
  return jsxRuntime.jsx(Text__default["default"].Subheadline, {
499
577
  as: "h4",
@@ -542,110 +620,344 @@ const PageHeaderTitle = props => jsxRuntime.jsxs("div", {
542
620
  });
543
621
  PageHeaderTitle.propTypes = {};
544
622
  PageHeaderTitle.displayName = 'PageHeaderTitle';
545
- PageHeaderTitle.defaultProps = defaultProps$d;
623
+ PageHeaderTitle.defaultProps = defaultProps$e;
546
624
 
547
- const PageHeader = props => {
625
+ // Component to have a larger clickable surface
626
+ var _ref2$2 = {
627
+ name: "1rxhroq",
628
+ styles: "display:flex;align-items:center;justify-content:center;&::after{content:'';position:absolute;height:35px;width:48px;top:0;right:0;}"
629
+ } ;
630
+ const LargeIconWrapper = props => jsxRuntime.jsx("span", {
631
+ css: _ref2$2,
632
+ children: /*#__PURE__*/react$1.cloneElement(props.children, {
633
+ size: props.size
634
+ })
635
+ });
636
+
637
+ // NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
638
+ // However, we need to explicitly define this otherwise the prop-types babel plugin
639
+ // does not recognize the object shape.
640
+ LargeIconWrapper.propTypes = {};
641
+ const defaultProps$d = {
642
+ color: 'surface',
643
+ previousPathLabel: messages$4.back,
644
+ hidePathLabel: false
645
+ };
646
+ var _ref$4 = {
647
+ name: "uvw8rn",
648
+ styles: "display:flex;overflow:hidden;button:first-of-type svg{height:12px!important;width:12px!important;}"
649
+ } ;
650
+ const ModalPageTopBar = props => {
651
+ const intl = reactIntl.useIntl();
548
652
  return jsxRuntime.jsxs("div", {
549
- css: /*#__PURE__*/react.css("display:flex;align-items:flex-end;justify-content:space-between;margin:", designTokens.marginForModalPageHeader, ";padding:", designTokens.paddingForModalPageHeader, ";border-bottom:1px solid ", designTokens.borderColorForModalPageHeaderDivider, ";&>*+*{margin-left:", designTokens.marginLeftForModalPageHeaderControls, ";}" + ("" ), "" ),
550
- children: [jsxRuntime.jsx(PageHeaderTitle, {
551
- title: props.title,
552
- titleSize: "big",
553
- subtitle: props.subtitle,
554
- truncate: true
555
- }), props.children]
653
+ css: /*#__PURE__*/react.css("position:relative;display:flex;align-items:center;justify-content:space-between;padding:", designTokens.paddingForModalTopBar, ";background-color:", props.color === 'neutral' ? designTokens.backgroundColorForPageHeader : designSystem.designTokens.colorSurface, ";border-bottom:1px solid ", props.color === 'neutral' ? designSystem.designTokens.colorSurface : designTokens.borderColorForModalTopBarWhenSurface, ";& *+*{margin-left:", designSystem.designTokens.spacingS, ";}p{font-size:12px!important;}" + ("" ), "" ),
654
+ children: [jsxRuntime.jsxs("div", {
655
+ css: _ref$4,
656
+ children: [!props.hidePathLabel && jsxRuntime.jsx(FlatButton__default["default"], {
657
+ tone: "primary",
658
+ label: typeof props.previousPathLabel === 'string' ? props.previousPathLabel : intl.formatMessage(props.previousPathLabel),
659
+ icon: jsxRuntime.jsx(icons.AngleLeftIcon, {
660
+ size: "medium",
661
+ color: "primary"
662
+ }),
663
+ onClick: props.onClose
664
+ }), props.currentPathLabel && jsxRuntime.jsxs(jsxRuntime.Fragment, {
665
+ children: [jsxRuntime.jsx(Text__default["default"].Detail, {
666
+ as: "span",
667
+ children: "/"
668
+ }), jsxRuntime.jsx(Text__default["default"].Detail, {
669
+ as: "span",
670
+ title: props.currentPathLabel,
671
+ truncate: true,
672
+ children: props.currentPathLabel
673
+ })]
674
+ })]
675
+ }), props.onClose && jsxRuntime.jsx(SecondaryIconButton__default["default"], {
676
+ label: intl.formatMessage(messages$4.close),
677
+ onClick: props.onClose,
678
+ icon: jsxRuntime.jsx(LargeIconWrapper, {
679
+ children: jsxRuntime.jsx(icons.CloseIcon, {})
680
+ }),
681
+ size: "big"
682
+ })]
556
683
  });
557
684
  };
558
- PageHeader.propTypes = {};
559
- PageHeader.displayName = 'PageHeader';
560
-
561
- const ContentWrapper$1 = /*#__PURE__*/_styled__default["default"]("div", {
562
- target: "e1b7jwn01"
563
- } )("flex:1;flex-basis:0;margin:", designTokens.marginForPageContent, ";overflow:auto;" + ("" ));
564
- const PageWrapper = /*#__PURE__*/_styled__default["default"]("div", {
565
- target: "e1b7jwn00"
566
- } )({
567
- name: "kdbhus",
568
- styles: "height:100%;display:flex;flex-direction:column"
569
- } );
570
-
571
- const ContentWrapper = /*#__PURE__*/_styled__default["default"]("div", {
572
- target: "e1alzj9m0"
573
- } )("height:100%;padding:", designSystem.designTokens.spacing40, " 40px;" + ("" ));
574
- function CustomPanel(props) {
575
- return jsxRuntime.jsx(ModalPage, {
576
- hidePathLabel: true,
577
- isOpen: true,
578
- onClose: props.onClose,
579
- size: props.size,
580
- title: props.title,
581
- children: jsxRuntime.jsx(ContentWrapper, {
582
- children: props.children
583
- })
584
- });
585
- }
586
- CustomPanel.propTypes = {};
587
-
588
- const messages$4 = reactIntl.defineMessages({
589
- loadError: {
590
- id: 'CustomViewLoader.error.load',
591
- defaultMessage: 'We could not load the Custom View. Please contact your administrator to check its configuration.'
592
- }
593
- });
685
+ ModalPageTopBar.propTypes = {};
686
+ ModalPageTopBar.displayName = 'ModalPageTopBar';
687
+ ModalPageTopBar.defaultProps = defaultProps$d;
594
688
 
595
- const isIframeReady = iFrameElementRef => {
596
- try {
597
- var _iFrameElementRef$con;
598
- return (iFrameElementRef === null || iFrameElementRef === void 0 || (_iFrameElementRef$con = iFrameElementRef.contentWindow) === null || _iFrameElementRef$con === void 0 ? void 0 : _iFrameElementRef$con.document.readyState) === 'complete';
599
- } catch {
600
- // Trying to access the contentWindow of a cross-origin iFrame will throw an error.
601
- // We are not supposed to even get here because the iFrame must use
602
- // a URL from our very same domain (the custom view is proxied through our http-proxy service).
603
- return false;
689
+ const stylesBySize = {
690
+ '10': {
691
+ width: '600px',
692
+ transitionTime: 200
693
+ },
694
+ '20': {
695
+ width: '900px',
696
+ transitionTime: 200
697
+ },
698
+ '30': {
699
+ width: '1200px',
700
+ transitionTime: 200
701
+ },
702
+ scale: {
703
+ width: '100%',
704
+ transitionTime: 300
604
705
  }
605
706
  };
606
- const CustomPanelIframe = /*#__PURE__*/_styled__default["default"]("iframe", {
607
- target: "ewwxuwo0"
608
- } )({
609
- name: "174lt7a",
610
- styles: "height:100%;width:100%;border:none"
611
- } );
612
- function CustomViewLoader(props) {
613
- var _props$customView$typ;
614
- const iFrameElementRef = react$1.useRef(null);
615
- const dataLocale = applicationShellConnectors.useApplicationContext(context => context.dataLocale);
616
- const projectKey = applicationShellConnectors.useApplicationContext(context => {
617
- var _context$project;
618
- return (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key;
619
- });
620
- const iFrameCommunicationChannel = react$1.useRef(new MessageChannel());
621
- const showNotification = actionsGlobal.useShowNotification();
622
- const intl = reactIntl.useIntl();
623
- const messageFromIFrameHandler = react$1.useCallback(event => {
624
- if (event.data.origin === window.location.origin) {
625
- console.log('message received from iframe port: ', event);
626
- }
627
- }, []);
628
-
629
- // onLoad handler is called from the iFrame even where the URL is not valid
630
- // (blocked by CORS, 404, etc.) so we need to make sure the iFrame is ready
631
- const onLoadSuccessHandler = react$1.useCallback(() => {
632
- var _iFrameElementRef$cur, _context;
633
- // Show error and block if the iFrame is not ready
634
- // (error loading it)
635
- if (!isIframeReady(iFrameElementRef.current)) {
636
- showNotification({
637
- domain: constants.DOMAINS.PAGE,
638
- kind: constants.NOTIFICATION_KINDS_PAGE.error,
639
- text: intl.formatMessage(messages$4.loadError)
640
- });
641
- return;
642
- }
707
+ const getContainerStyles = props => /*#__PURE__*/react.css("position:absolute;top:0;right:0;height:100%;width:", props.size !== 'scale' ? "".concat(stylesBySize[props.size].width, " !important") : stylesBySize.scale.width, ";display:flex;flex-direction:column;background-color:", designSystem.customProperties.colorSurface, ";box-shadow:0px 0px 40px 0px rgba(0, 0, 0, 0.1);outline:0;transform:translate3d(\n ", props.size !== 'scale' ? stylesBySize[props.size].width : '30px', ",\n 0,\n 0\n );transition:transform ", stylesBySize[props.size].transitionTime, "ms ease;" + ("" ), "" );
708
+ const getOverlayStyles = props => /*#__PURE__*/react.css("position:absolute;z-index:", typeof props.zIndex === 'number' ? // Use `!important` to overwrite the default value assigned by the Stacking Layer System.
709
+ "".concat(props.zIndex, " !important") : 'auto', ";top:0;left:0;width:100%;height:100%;background-color:hsla(195, 35%, 20%, 0.05);opacity:0;transition:transform ", stylesBySize[props.size].transitionTime, "ms ease;" + ("" ), "" );
710
+ var _ref3 = {
711
+ name: "1ffv7m4",
712
+ styles: "transform:translate3d(0, 0, 0)!important"
713
+ } ;
714
+ const getAfterOpenContainerAnimation = () => _ref3;
715
+ var _ref2$1 = {
716
+ name: "1d9ftqx",
717
+ styles: "opacity:1!important"
718
+ } ;
719
+ const getAfterOpenOverlayAnimation = () => _ref2$1;
720
+ const getBeforeCloseContainerAnimation = props => /*#__PURE__*/react.css("transform:translate3d(\n ", props.size !== 'scale' ? stylesBySize[props.size].width : '30px', ",\n ,\n 0,\n 0\n )!important;" + ("" ), "" );
721
+ var _ref$3 = {
722
+ name: "728dx5",
723
+ styles: "opacity:0!important"
724
+ } ;
725
+ const getBeforeCloseOverlayAnimation = () => _ref$3;
643
726
 
644
- // Listen for messages from the iFrame
645
- iFrameCommunicationChannel.current.port1.onmessage = messageFromIFrameHandler;
727
+ function ownKeys$3(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
728
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$3(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
729
+ const getDefaultParentSelector = () => document.querySelector("#".concat(constants.PORTALS_CONTAINER_ID));
730
+ const getOverlayElement = (props, contentElement) =>
731
+ // Assign the `data-role` to the overlay container, which is used as
732
+ // the CSS selector in the `<PortalsContainer>`.
733
+ jsxRuntime.jsx("div", _objectSpread$3(_objectSpread$3({}, props), {}, {
734
+ "data-role": "modal-overlay",
735
+ children: contentElement
736
+ }));
646
737
 
647
- // Transfer port2 to the iFrame so it can send messages back privately
648
- (_iFrameElementRef$cur = iFrameElementRef.current) === null || _iFrameElementRef$cur === void 0 || (_iFrameElementRef$cur = _iFrameElementRef$cur.contentWindow) === null || _iFrameElementRef$cur === void 0 || _iFrameElementRef$cur.postMessage(constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_BOOTSTRAP, window.location.href, [iFrameCommunicationChannel.current.port2]);
738
+ // NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
739
+ // However, we need to explicitly define this otherwise the prop-types babel plugin
740
+ // does not recognize the object shape.
741
+ const defaultProps$c = {
742
+ size: 'scale',
743
+ getParentSelector: getDefaultParentSelector,
744
+ shouldDelayOnClose: true
745
+ };
746
+ const ModalPage = props => {
747
+ const _useState = react$1.useState(false),
748
+ _useState2 = _slicedToArray(_useState, 2),
749
+ forceClose = _useState2[0],
750
+ setForceClose = _useState2[1];
751
+ const closingTimer = react$1.useRef();
752
+ react$1.useEffect(() => {
753
+ if (props.isOpen === true) setForceClose(false);
754
+ return () => {
755
+ if (closingTimer.current) {
756
+ clearTimeout(closingTimer.current);
757
+ }
758
+ };
759
+ }, [props.isOpen]);
760
+ const onClose = props.onClose;
761
+ const TRANSITION_DURATION = stylesBySize[props.size].transitionTime;
762
+ const handleClose = react$1.useCallback(event => {
763
+ if (props.shouldDelayOnClose) {
764
+ // In this case we want the closing animation to be shown
765
+ // and therefore we need wait for it to be completed
766
+ // before calling `onClose`.
767
+ setForceClose(true);
768
+ closingTimer.current = _setTimeout__default["default"](() => {
769
+ onClose && onClose(event);
770
+ }, TRANSITION_DURATION);
771
+ return;
772
+ }
773
+ onClose && onClose(event);
774
+ }, [onClose, props.shouldDelayOnClose, TRANSITION_DURATION]);
775
+ return jsxRuntime.jsx(react.ClassNames, {
776
+ children: _ref => {
777
+ var _props$afterOpenStyle;
778
+ let makeClassName = _ref.css;
779
+ return jsxRuntime.jsxs(Modal__default["default"], {
780
+ isOpen: forceClose === true ? false : props.isOpen,
781
+ onRequestClose: handleClose,
782
+ shouldCloseOnOverlayClick: Boolean(props.onClose),
783
+ shouldCloseOnEsc: Boolean(props.onClose),
784
+ overlayElement: getOverlayElement,
785
+ overlayClassName: {
786
+ base: makeClassName(getOverlayStyles(props)),
787
+ afterOpen: makeClassName(getAfterOpenOverlayAnimation()),
788
+ beforeClose: makeClassName(getBeforeCloseOverlayAnimation())
789
+ },
790
+ className: {
791
+ base: makeClassName(getContainerStyles(props)),
792
+ afterOpen: typeof props.afterOpenStyles === 'string' ? props.afterOpenStyles : makeClassName((_props$afterOpenStyle = props.afterOpenStyles) !== null && _props$afterOpenStyle !== void 0 ? _props$afterOpenStyle : getAfterOpenContainerAnimation()),
793
+ beforeClose: makeClassName(getBeforeCloseContainerAnimation(props))
794
+ },
795
+ contentLabel: props.title,
796
+ parentSelector: props.getParentSelector,
797
+ ariaHideApp: false
798
+ // Adjust this value if the (beforeClose) animation duration is changed
799
+ ,
800
+ closeTimeoutMS: TRANSITION_DURATION,
801
+ style: {
802
+ // stylelint-disable-next-line selector-type-no-unknown
803
+ overlay: {
804
+ zIndex: props.zIndex
805
+ }
806
+ },
807
+ children: [!props.hideTopBar && jsxRuntime.jsx(ModalPageTopBar, {
808
+ color: props.topBarColor,
809
+ onClose: handleClose,
810
+ currentPathLabel: props.currentPathLabel,
811
+ previousPathLabel: props.previousPathLabel,
812
+ hidePathLabel: props.hidePathLabel
813
+ }), props.children]
814
+ });
815
+ }
816
+ });
817
+ };
818
+ ModalPage.propTypes = {};
819
+ ModalPage.displayName = 'ModalPage';
820
+ ModalPage.defaultProps = defaultProps$c;
821
+
822
+ const defaultProps$b = {
823
+ size: 10,
824
+ hideControls: false,
825
+ onPrimaryButtonClick: () => {},
826
+ onSecondaryButtonClick: () => {}
827
+ };
828
+ const ContentWrapper$1 = /*#__PURE__*/_styled__default["default"]("div", {
829
+ target: "e18jo6y41"
830
+ } )("height:100%;padding:", designSystem.designTokens.spacing50, ";" + ("" ));
831
+ const HeaderWrapper = /*#__PURE__*/_styled__default["default"]("div", {
832
+ target: "e18jo6y40"
833
+ } )("padding:", designSystem.designTokens.spacing40, " 40px;border-bottom:1px solid ", designTokens.borderColorForModalPageHeaderDivider, ";" + ("" ));
834
+ function Drawer(props) {
835
+ const intl = reactIntl.useIntl();
836
+ return jsxRuntime.jsxs(ModalPage, {
837
+ isOpen: props.isOpen,
838
+ hidePathLabel: true,
839
+ hideTopBar: true,
840
+ onClose: props.onClose,
841
+ size: props.size,
842
+ title: props.title,
843
+ afterOpenStyles: props.afterOpenStyles,
844
+ getParentSelector: props.getParentSelector,
845
+ shouldDelayOnClose: props.shouldDelayOnClose,
846
+ topBarColor: props.topBarColor,
847
+ zIndex: props.zIndex,
848
+ children: [jsxRuntime.jsx(HeaderWrapper, {
849
+ children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
850
+ children: [jsxRuntime.jsxs(Spacings__default["default"].Inline, {
851
+ justifyContent: "space-between",
852
+ children: [jsxRuntime.jsx(PageHeaderTitle, {
853
+ title: props.title,
854
+ titleSize: "medium",
855
+ subtitle: props.subtitle && jsxRuntime.jsx(Text__default["default"].Detail, {
856
+ children: props.subtitle
857
+ })
858
+ }), props.onClose && jsxRuntime.jsx(SecondaryIconButton__default["default"], {
859
+ label: intl.formatMessage(messages$4.close),
860
+ onClick: props.onClose,
861
+ icon: jsxRuntime.jsx(LargeIconWrapper, {
862
+ children: jsxRuntime.jsx(icons.CloseIcon, {})
863
+ }),
864
+ size: "big"
865
+ })]
866
+ }), jsxRuntime.jsxs(Spacings__default["default"].Inline, {
867
+ justifyContent: "flex-end",
868
+ children: [!props.hideControls && props.formControls && props.formControls, !props.hideControls && !props.formControls && jsxRuntime.jsxs(jsxRuntime.Fragment, {
869
+ children: [jsxRuntime.jsx(FormSecondaryButton, {
870
+ label: props.labelSecondaryButton,
871
+ onClick: props.onSecondaryButtonClick,
872
+ isDisabled: props.isSecondaryButtonDisabled,
873
+ dataAttributes: props.dataAttributesSecondaryButton,
874
+ iconLeft: props.iconLeftSecondaryButton
875
+ }), jsxRuntime.jsx(FormPrimaryButton, {
876
+ label: props.labelPrimaryButton,
877
+ onClick: props.onPrimaryButtonClick,
878
+ isDisabled: props.isPrimaryButtonDisabled,
879
+ dataAttributes: props.dataAttributesPrimaryButton
880
+ })]
881
+ })]
882
+ })]
883
+ })
884
+ }), jsxRuntime.jsx(ContentWrapper$1, {
885
+ children: props.children
886
+ })]
887
+ });
888
+ }
889
+ Drawer.propTypes = {};
890
+ Drawer.displayName = 'Drawer';
891
+ Drawer.defaultProps = defaultProps$b;
892
+ // Static export of pre-configured form control buttons to easily re-use
893
+ // them in the custom controls.
894
+ Drawer.FormPrimaryButton = FormPrimaryButton;
895
+ Drawer.FormSecondaryButton = FormSecondaryButton;
896
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
897
+ // The Intl messages can be used for button labels.
898
+ Drawer.Intl = i18n.sharedMessages;
899
+
900
+ const messages$3 = reactIntl.defineMessages({
901
+ loadError: {
902
+ id: 'CustomViewLoader.error.load',
903
+ defaultMessage: 'We could not load the Custom View. Please contact your administrator to check its configuration.'
904
+ }
905
+ });
906
+
907
+ const isIframeReady = iFrameElementRef => {
908
+ try {
909
+ var _iFrameElementRef$con;
910
+ return (iFrameElementRef === null || iFrameElementRef === void 0 || (_iFrameElementRef$con = iFrameElementRef.contentWindow) === null || _iFrameElementRef$con === void 0 ? void 0 : _iFrameElementRef$con.document.readyState) === 'complete';
911
+ } catch {
912
+ // Trying to access the contentWindow of a cross-origin iFrame will throw an error.
913
+ // We are not supposed to even get here because the iFrame must use
914
+ // a URL from our very same domain (the custom view is proxied through our http-proxy service).
915
+ return false;
916
+ }
917
+ };
918
+ const CustomPanelIframe = /*#__PURE__*/_styled__default["default"]("iframe", {
919
+ target: "ewwxuwo0"
920
+ } )({
921
+ name: "174lt7a",
922
+ styles: "height:100%;width:100%;border:none"
923
+ } );
924
+ function CustomViewLoader(props) {
925
+ var _props$customView$typ;
926
+ const iFrameElementRef = react$1.useRef(null);
927
+ const dataLocale = applicationShellConnectors.useApplicationContext(context => context.dataLocale);
928
+ const projectKey = applicationShellConnectors.useApplicationContext(context => {
929
+ var _context$project;
930
+ return (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key;
931
+ });
932
+ const iFrameCommunicationChannel = react$1.useRef(new MessageChannel());
933
+ const showNotification = actionsGlobal.useShowNotification();
934
+ const intl = reactIntl.useIntl();
935
+ const messageFromIFrameHandler = react$1.useCallback(event => {
936
+ if (event.data.origin === window.location.origin) {
937
+ console.log('message received from iframe port: ', event);
938
+ }
939
+ }, []);
940
+
941
+ // onLoad handler is called from the iFrame even where the URL is not valid
942
+ // (blocked by CORS, 404, etc.) so we need to make sure the iFrame is ready
943
+ const onLoadSuccessHandler = react$1.useCallback(() => {
944
+ var _iFrameElementRef$cur, _context;
945
+ // Show error and block if the iFrame is not ready
946
+ // (error loading it)
947
+ if (!isIframeReady(iFrameElementRef.current)) {
948
+ showNotification({
949
+ domain: constants.DOMAINS.PAGE,
950
+ kind: constants.NOTIFICATION_KINDS_PAGE.error,
951
+ text: intl.formatMessage(messages$3.loadError)
952
+ });
953
+ return;
954
+ }
955
+
956
+ // Listen for messages from the iFrame
957
+ iFrameCommunicationChannel.current.port1.onmessage = messageFromIFrameHandler;
958
+
959
+ // Transfer port2 to the iFrame so it can send messages back privately
960
+ (_iFrameElementRef$cur = iFrameElementRef.current) === null || _iFrameElementRef$cur === void 0 || (_iFrameElementRef$cur = _iFrameElementRef$cur.contentWindow) === null || _iFrameElementRef$cur === void 0 || _iFrameElementRef$cur.postMessage(constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_BOOTSTRAP, window.location.href, [iFrameCommunicationChannel.current.port2]);
649
961
 
650
962
  // Send the initialization message to the iFrame
651
963
  iFrameCommunicationChannel.current.port1.postMessage({
@@ -680,10 +992,11 @@ function CustomViewLoader(props) {
680
992
  }
681
993
  const panelSize = ((_props$customView$typ = props.customView.typeSettings) === null || _props$customView$typ === void 0 || (_props$customView$typ = _props$customView$typ.size) === null || _props$customView$typ === void 0 ? void 0 : _props$customView$typ.toLocaleLowerCase()) || 'large';
682
994
  const iFrameUrl = [window.location.origin, 'custom-views', props.customView.id, 'projects', projectKey].join('/');
683
- return jsxRuntime.jsx(CustomPanel, {
995
+ return jsxRuntime.jsx(Drawer, {
996
+ isOpen: true,
684
997
  title: "Custom View: ".concat(props.customView.defaultLabel),
685
998
  onClose: props.onClose,
686
- size: panelSize,
999
+ size: panelSize === 'small' ? 10 : 30,
687
1000
  children: jsxRuntime.jsx(CustomPanelIframe, {
688
1001
  id: "custom-view-".concat(props.customView.id),
689
1002
  title: "Custom View: ".concat(props.customView.defaultLabel),
@@ -695,7 +1008,7 @@ function CustomViewLoader(props) {
695
1008
  }
696
1009
  CustomViewLoader.propTypes = {};
697
1010
 
698
- var messages$3 = reactIntl.defineMessages({
1011
+ var messages$2 = reactIntl.defineMessages({
699
1012
  title: {
700
1013
  id: 'CustomViewsSelector.title',
701
1014
  defaultMessage: 'Custom Views:'
@@ -726,15 +1039,41 @@ const useCustomViewsConnector = _ref => {
726
1039
  };
727
1040
  };
728
1041
 
729
- function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
730
- function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
731
- const COMPONENT_HEIGHT = '56px';
1042
+ function ownKeys$2(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1043
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1044
+ const COMPONENT_HEIGHT = '52px';
732
1045
  const Wrapper = /*#__PURE__*/_styled__default["default"]("div", {
733
- target: "e16cb3zv1"
734
- } )("height:", props => props.shouldRender ? COMPONENT_HEIGHT : '0', ";overflow:hidden;transition:height 0.3s ease-in-out;" + ("" ));
1046
+ target: "e16cb3zv3"
1047
+ } )("height:", props => props.shouldRender ? COMPONENT_HEIGHT : '0', ";overflow:hidden;transition:margin 0.3s ease-in-out,height 0.3s ease-in-out;margin:", props => props.shouldRender ? props.margin : '0', ";" + ("" ));
735
1048
  const Container$2 = /*#__PURE__*/_styled__default["default"]("div", {
1049
+ target: "e16cb3zv2"
1050
+ } )("background-color:", designSystem.designTokens.colorNeutral98, ";padding:10px ", designSystem.designTokens.spacing30, ";border:1px solid ", designSystem.designTokens.colorNeutral95, ";border-radius:", designSystem.designTokens.borderRadius8, ";" + ("" ));
1051
+ const hoverAndSelectedStateStyles = /*#__PURE__*/react.css("box-shadow:", designSystem.designTokens.shadow1, ";background-color:", designSystem.designTokens.colorSurface, ";color:", designSystem.designTokens.colorPrimary30, ";" + ("" ), "" );
1052
+ const CustomViewSelectorItem = props => {
1053
+ return jsxRuntime.jsx(AccessibleButton__default["default"], {
1054
+ css: /*#__PURE__*/react.css("display:flex;align-items:center;padding:", designSystem.designTokens.spacing20, " ", designSystem.designTokens.spacing25, ";height:30px;border-radius:", designSystem.designTokens.borderRadius6, ";color:", designSystem.designTokens.colorPrimary, ";", props.selected && hoverAndSelectedStateStyles, " :hover{", hoverAndSelectedStateStyles, ";}" + ("" ), "" ),
1055
+ onClick: props.onClick,
1056
+ label: props.label,
1057
+ children: jsxRuntime.jsx(Text__default["default"].Detail, {
1058
+ tone: "inherit",
1059
+ fontWeight: props.selected ? 'bold' : 'regular',
1060
+ children: props.label
1061
+ })
1062
+ });
1063
+ };
1064
+ CustomViewSelectorItem.propTypes = {};
1065
+ const SelectorLabel = /*#__PURE__*/_styled__default["default"]("div", {
1066
+ target: "e16cb3zv1"
1067
+ } )({
1068
+ name: "1i68o0s",
1069
+ styles: "display:flex;align-items:center;gap:6px;div{font-weight:300;}"
1070
+ } );
1071
+ const Separator = /*#__PURE__*/_styled__default["default"]("span", {
736
1072
  target: "e16cb3zv0"
737
- } )("background-color:", designSystem.designTokens.colorAccent98, ";padding:", designSystem.designTokens.spacing25, " ", designSystem.designTokens.spacing60, ";" + ("" ));
1073
+ } )({
1074
+ name: "1lsblg0",
1075
+ styles: "width:1px;height:18px;background-color:#cccccc"
1076
+ } );
738
1077
  function CustomViewSelector(props) {
739
1078
  const _useState = react$1.useState(null),
740
1079
  _useState2 = _slicedToArray(_useState, 2),
@@ -762,30 +1101,34 @@ function CustomViewSelector(props) {
762
1101
  }
763
1102
  return jsxRuntime.jsx(Wrapper, {
764
1103
  shouldRender: customViews.length > 0,
1104
+ margin: props.margin || '0',
765
1105
  children: jsxRuntime.jsx(Container$2, {
766
1106
  children: jsxRuntime.jsxs(Constraints__default["default"].Horizontal, {
767
1107
  max: "scale",
768
1108
  children: [jsxRuntime.jsxs(Spacings__default["default"].Inline, {
769
- scale: "m",
770
- justifyContent: "flex-end",
1109
+ scale: "s",
1110
+ justifyContent: "flex-start",
771
1111
  alignItems: "center",
772
- children: [jsxRuntime.jsxs(Spacings__default["default"].Inline, {
773
- scale: "xs",
774
- alignItems: "center",
775
- children: [jsxRuntime.jsx(icons.SidebarCollapseIcon, {
1112
+ children: [jsxRuntime.jsxs(SelectorLabel, {
1113
+ children: [jsxRuntime.jsx(icons.WindowEyeIcon, {
776
1114
  size: "medium",
777
1115
  color: "neutral60"
778
1116
  }), jsxRuntime.jsx(Text__default["default"].Detail, {
779
1117
  tone: "secondary",
780
- intlMessage: messages$3.title
1118
+ intlMessage: messages$2.title
781
1119
  })]
782
- }), _mapInstanceProperty__default["default"](customViews).call(customViews, customView => jsxRuntime.jsx(SecondaryButton__default["default"], {
783
- label: customView.defaultLabel,
784
- size: "medium",
785
- onClick: () => {
786
- setSelectedCustomView(customView);
787
- }
788
- }, customView.id))]
1120
+ }), _mapInstanceProperty__default["default"](customViews).call(customViews, (customView, index) => {
1121
+ const isNotLastItem = index !== customViews.length - 1;
1122
+ return jsxRuntime.jsxs(react$1.Fragment, {
1123
+ children: [jsxRuntime.jsx(CustomViewSelectorItem, {
1124
+ selected: (selectedCustomView === null || selectedCustomView === void 0 ? void 0 : selectedCustomView.id) === customView.id,
1125
+ onClick: () => {
1126
+ setSelectedCustomView(customView);
1127
+ },
1128
+ label: customView.defaultLabel
1129
+ }), isNotLastItem && jsxRuntime.jsx(Separator, {})]
1130
+ }, customView.id);
1131
+ })]
789
1132
  }), selectedCustomView && jsxRuntime.jsx(CustomViewLoader, {
790
1133
  customView: selectedCustomView,
791
1134
  onClose: () => {
@@ -797,211 +1140,46 @@ function CustomViewSelector(props) {
797
1140
  });
798
1141
  }
799
1142
  CustomViewSelector.propTypes = {};
1143
+ CustomViewSelector.displayName = 'CustomViewSelector';
800
1144
  const CustomViewSelectorOrNothing = props => {
801
1145
  if (!props.customViewLocatorCode) {
802
1146
  return null;
803
1147
  }
804
- return jsxRuntime.jsx(CustomViewSelector, _objectSpread$4(_objectSpread$4({}, props), {}, {
1148
+ return jsxRuntime.jsx(CustomViewSelector, _objectSpread$2(_objectSpread$2({}, props), {}, {
805
1149
  customViewLocatorCode: props.customViewLocatorCode
806
1150
  }));
807
1151
  };
808
1152
  CustomViewSelectorOrNothing.propTypes = {};
809
1153
 
810
- const messages$2 = reactIntl.defineMessages({
811
- back: {
812
- id: 'Components.ModalPage.TopBar.Back',
813
- defaultMessage: 'Go Back'
814
- },
815
- close: {
816
- id: 'Components.ModalPage.TopBar.Close',
817
- defaultMessage: 'Close Modal Page'
818
- }
819
- });
820
-
821
- // Component to have a larger clickable surface
822
- var _ref2$2 = {
823
- name: "1rxhroq",
824
- styles: "display:flex;align-items:center;justify-content:center;&::after{content:'';position:absolute;height:35px;width:48px;top:0;right:0;}"
825
- } ;
826
- const LargeIconWrapper = props => jsxRuntime.jsx("span", {
827
- css: _ref2$2,
828
- children: /*#__PURE__*/react$1.cloneElement(props.children, {
829
- size: props.size
830
- })
831
- });
832
-
833
- // NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
834
- // However, we need to explicitly define this otherwise the prop-types babel plugin
835
- // does not recognize the object shape.
836
- LargeIconWrapper.propTypes = {};
837
- const defaultProps$c = {
838
- color: 'surface',
839
- previousPathLabel: messages$2.back,
840
- hidePathLabel: false
841
- };
842
- var _ref$4 = {
843
- name: "uvw8rn",
844
- styles: "display:flex;overflow:hidden;button:first-of-type svg{height:12px!important;width:12px!important;}"
845
- } ;
846
- const ModalPageTopBar = props => {
847
- const intl = reactIntl.useIntl();
1154
+ const PageHeader = props => {
848
1155
  return jsxRuntime.jsxs("div", {
849
- css: /*#__PURE__*/react.css("position:relative;display:flex;align-items:center;justify-content:space-between;padding:", designTokens.paddingForModalTopBar, ";background-color:", props.color === 'neutral' ? designTokens.backgroundColorForPageHeader : designSystem.designTokens.colorSurface, ";border-bottom:1px solid ", props.color === 'neutral' ? designSystem.designTokens.colorSurface : designTokens.borderColorForModalTopBarWhenSurface, ";& *+*{margin-left:", designSystem.designTokens.spacingS, ";}p{font-size:12px!important;}" + ("" ), "" ),
1156
+ css: /*#__PURE__*/react.css("margin:", designTokens.marginForModalPageHeader, ";padding:", designTokens.paddingForModalPageHeader, ";border-bottom:1px solid ", designTokens.borderColorForModalPageHeaderDivider, ";" + ("" ), "" ),
850
1157
  children: [jsxRuntime.jsxs("div", {
851
- css: _ref$4,
852
- children: [!props.hidePathLabel && jsxRuntime.jsx(FlatButton__default["default"], {
853
- tone: "primary",
854
- label: typeof props.previousPathLabel === 'string' ? props.previousPathLabel : intl.formatMessage(props.previousPathLabel),
855
- icon: jsxRuntime.jsx(icons.AngleLeftIcon, {
856
- size: "medium",
857
- color: "primary"
858
- }),
859
- onClick: props.onClose
860
- }), props.currentPathLabel && jsxRuntime.jsxs(jsxRuntime.Fragment, {
861
- children: [jsxRuntime.jsx(Text__default["default"].Detail, {
862
- as: "span",
863
- children: "/"
864
- }), jsxRuntime.jsx(Text__default["default"].Detail, {
865
- as: "span",
866
- title: props.currentPathLabel,
867
- truncate: true,
868
- children: props.currentPathLabel
869
- })]
870
- })]
871
- }), props.onClose && jsxRuntime.jsx(SecondaryIconButton__default["default"], {
872
- label: intl.formatMessage(messages$2.close),
873
- onClick: props.onClose,
874
- icon: jsxRuntime.jsx(LargeIconWrapper, {
875
- children: jsxRuntime.jsx(icons.CloseIcon, {})
876
- }),
877
- size: "big"
1158
+ css: /*#__PURE__*/react.css("display:flex;align-items:flex-end;justify-content:space-between;&>*+*{margin-left:", designTokens.marginLeftForModalPageHeaderControls, ";}" + ("" ), "" ),
1159
+ children: [jsxRuntime.jsx(PageHeaderTitle, {
1160
+ title: props.title,
1161
+ titleSize: "big",
1162
+ subtitle: props.subtitle,
1163
+ truncate: true
1164
+ }), props.children]
1165
+ }), jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1166
+ margin: "".concat(designSystem.designTokens.spacing40, " 0 0 0"),
1167
+ customViewLocatorCode: props.customViewLocatorCode
878
1168
  })]
879
1169
  });
880
1170
  };
881
- ModalPageTopBar.propTypes = {};
882
- ModalPageTopBar.displayName = 'ModalPageTopBar';
883
- ModalPageTopBar.defaultProps = defaultProps$c;
884
-
885
- const TRANSITION_DURATION = 200;
886
- const getContainerStyles = _props => /*#__PURE__*/react.css("position:absolute;top:0;right:0;height:100%;width:", _props.size === 'small' ? '600px !important' : '100%', ";display:flex;flex-direction:column;background-color:", designSystem.customProperties.colorSurface, ";box-shadow:", designSystem.customProperties.shadow4, ",", designSystem.customProperties.shadow6, ";outline:0;transform:translate3d(30px, 0, 0);transition:transform ", TRANSITION_DURATION, "ms ease;" + ("" ), "" );
887
- const getOverlayStyles = props => /*#__PURE__*/react.css("position:absolute;z-index:", typeof props.zIndex === 'number' ? // Use `!important` to overwrite the default value assigned by the Stacking Layer System.
888
- "".concat(props.zIndex, " !important") : 'auto', ";top:0;left:0;width:100%;height:100%;background-color:rgba(32, 62, 72, 0.5);opacity:0;transition:opacity ", TRANSITION_DURATION, "ms ease;" + ("" ), "" );
889
- var _ref4 = {
890
- name: "1ffv7m4",
891
- styles: "transform:translate3d(0, 0, 0)!important"
892
- } ;
893
- const getAfterOpenContainerAnimation = () => _ref4;
894
- var _ref3 = {
895
- name: "1d9ftqx",
896
- styles: "opacity:1!important"
897
- } ;
898
- const getAfterOpenOverlayAnimation = () => _ref3;
899
- var _ref2$1 = {
900
- name: "110wxen",
901
- styles: "transform:translate3d(30px, 0, 0)!important"
902
- } ;
903
- const getBeforeCloseContainerAnimation = () => _ref2$1;
904
- var _ref$3 = {
905
- name: "728dx5",
906
- styles: "opacity:0!important"
907
- } ;
908
- const getBeforeCloseOverlayAnimation = () => _ref$3;
909
-
910
- function ownKeys$3(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
911
- function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$3(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
912
- const getDefaultParentSelector = () => document.querySelector("#".concat(constants.PORTALS_CONTAINER_ID));
913
- const getOverlayElement = (props, contentElement) =>
914
- // Assign the `data-role` to the overlay container, which is used as
915
- // the CSS selector in the `<PortalsContainer>`.
916
- jsxRuntime.jsx("div", _objectSpread$3(_objectSpread$3({}, props), {}, {
917
- "data-role": "modal-overlay",
918
- children: contentElement
919
- }));
1171
+ PageHeader.propTypes = {};
1172
+ PageHeader.displayName = 'PageHeader';
920
1173
 
921
- // NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
922
- // However, we need to explicitly define this otherwise the prop-types babel plugin
923
- // does not recognize the object shape.
924
- const defaultProps$b = {
925
- getParentSelector: getDefaultParentSelector,
926
- shouldDelayOnClose: true,
927
- size: 'large'
928
- };
929
- const ModalPage = props => {
930
- const _useState = react$1.useState(false),
931
- _useState2 = _slicedToArray(_useState, 2),
932
- forceClose = _useState2[0],
933
- setForceClose = _useState2[1];
934
- const closingTimer = react$1.useRef();
935
- react$1.useEffect(() => {
936
- if (props.isOpen === true) setForceClose(false);
937
- return () => {
938
- if (closingTimer.current) {
939
- clearTimeout(closingTimer.current);
940
- }
941
- };
942
- }, [props.isOpen]);
943
- const onClose = props.onClose;
944
- const handleClose = react$1.useCallback(event => {
945
- if (props.shouldDelayOnClose) {
946
- // In this case we want the closing animation to be shown
947
- // and therefore we need wait for it to be completed
948
- // before calling `onClose`.
949
- setForceClose(true);
950
- closingTimer.current = _setTimeout__default["default"](() => {
951
- onClose && onClose(event);
952
- }, TRANSITION_DURATION);
953
- return;
954
- }
955
- onClose && onClose(event);
956
- }, [onClose, props.shouldDelayOnClose]);
957
- return jsxRuntime.jsx(react.ClassNames, {
958
- children: _ref => {
959
- var _props$afterOpenStyle;
960
- let makeClassName = _ref.css;
961
- return jsxRuntime.jsxs(Modal__default["default"], {
962
- isOpen: forceClose === true ? false : props.isOpen,
963
- onRequestClose: handleClose,
964
- shouldCloseOnOverlayClick: Boolean(props.onClose),
965
- shouldCloseOnEsc: Boolean(props.onClose),
966
- overlayElement: getOverlayElement,
967
- overlayClassName: {
968
- base: makeClassName(getOverlayStyles(props)),
969
- afterOpen: makeClassName(getAfterOpenOverlayAnimation()),
970
- beforeClose: makeClassName(getBeforeCloseOverlayAnimation())
971
- },
972
- className: {
973
- base: makeClassName(getContainerStyles(props)),
974
- afterOpen: typeof props.afterOpenStyles === 'string' ? props.afterOpenStyles : makeClassName((_props$afterOpenStyle = props.afterOpenStyles) !== null && _props$afterOpenStyle !== void 0 ? _props$afterOpenStyle : getAfterOpenContainerAnimation()),
975
- beforeClose: makeClassName(getBeforeCloseContainerAnimation())
976
- },
977
- contentLabel: props.title,
978
- parentSelector: props.getParentSelector,
979
- ariaHideApp: false
980
- // Adjust this value if the (beforeClose) animation duration is changed
981
- ,
982
- closeTimeoutMS: TRANSITION_DURATION,
983
- style: {
984
- // stylelint-disable-next-line selector-type-no-unknown
985
- overlay: {
986
- zIndex: props.zIndex
987
- }
988
- },
989
- children: [jsxRuntime.jsx(CustomViewSelectorOrNothing, {
990
- customViewLocatorCode: props.customViewLocatorCode
991
- }), jsxRuntime.jsx(ModalPageTopBar, {
992
- color: props.topBarColor,
993
- onClose: handleClose,
994
- currentPathLabel: props.currentPathLabel,
995
- previousPathLabel: props.previousPathLabel,
996
- hidePathLabel: props.hidePathLabel
997
- }), props.children]
998
- });
999
- }
1000
- });
1001
- };
1002
- ModalPage.propTypes = {};
1003
- ModalPage.displayName = 'ModalPage';
1004
- ModalPage.defaultProps = defaultProps$b;
1174
+ const ContentWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1175
+ target: "e1b7jwn01"
1176
+ } )("flex:1;flex-basis:0;margin:", designTokens.marginForPageContent, ";overflow:auto;" + ("" ));
1177
+ const PageWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1178
+ target: "e1b7jwn00"
1179
+ } )({
1180
+ name: "kdbhus",
1181
+ styles: "height:100%;display:flex;flex-direction:column"
1182
+ } );
1005
1183
 
1006
1184
  const InfoModalPage = props => jsxRuntime.jsxs(ModalPage, {
1007
1185
  title: props.title,
@@ -1013,74 +1191,17 @@ const InfoModalPage = props => jsxRuntime.jsxs(ModalPage, {
1013
1191
  shouldDelayOnClose: props.shouldDelayOnClose,
1014
1192
  getParentSelector: props.getParentSelector,
1015
1193
  afterOpenStyles: props.afterOpenStyles,
1016
- customViewLocatorCode: props.customViewLocatorCode,
1017
1194
  children: [jsxRuntime.jsx(PageHeader, {
1018
1195
  title: props.title,
1019
- subtitle: props.subtitle
1020
- }), jsxRuntime.jsx(ContentWrapper$1, {
1196
+ subtitle: props.subtitle,
1197
+ customViewLocatorCode: props.customViewLocatorCode
1198
+ }), jsxRuntime.jsx(ContentWrapper, {
1021
1199
  children: props.children
1022
1200
  })]
1023
1201
  });
1024
1202
  InfoModalPage.propTypes = {};
1025
1203
  InfoModalPage.displayName = 'InfoModalPage';
1026
1204
 
1027
- function ownKeys$2(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1028
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1029
- const primaryDefaultProps = {
1030
- label: i18n.sharedMessages.confirm,
1031
- isDisabled: false,
1032
- dataAttributes: {}
1033
- };
1034
- const useFormattedLabel = label => {
1035
- const intl = reactIntl.useIntl();
1036
- return typeof label === 'string' ? label : intl.formatMessage(label);
1037
- };
1038
- const FormPrimaryButton = props => {
1039
- const label = useFormattedLabel(props.label);
1040
- return jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$2({
1041
- label: label,
1042
- onClick: props.onClick,
1043
- isDisabled: props.isDisabled
1044
- }, filterDataAttributes(props.dataAttributes)));
1045
- };
1046
- FormPrimaryButton.propTypes = {};
1047
- FormPrimaryButton.displayName = 'FormPrimaryButton';
1048
- FormPrimaryButton.defaultProps = primaryDefaultProps;
1049
- const secondaryDefaultProps = {
1050
- label: i18n.sharedMessages.cancel,
1051
- isDisabled: false,
1052
- dataAttributes: {}
1053
- };
1054
- const FormSecondaryButton = props => {
1055
- const label = useFormattedLabel(props.label);
1056
- return jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$2({
1057
- label: label,
1058
- onClick: props.onClick,
1059
- isDisabled: props.isDisabled,
1060
- iconLeft: props.iconLeft
1061
- }, filterDataAttributes(props.dataAttributes)));
1062
- };
1063
- FormSecondaryButton.propTypes = {};
1064
- FormSecondaryButton.displayName = 'FormSecondaryButton';
1065
- FormSecondaryButton.defaultProps = secondaryDefaultProps;
1066
- const deleteDefaultProps = {
1067
- label: i18n.sharedMessages.delete,
1068
- isDisabled: false,
1069
- dataAttributes: {}
1070
- };
1071
- const FormDeleteButton = props => {
1072
- const label = useFormattedLabel(props.label);
1073
- return jsxRuntime.jsx(IconButton__default["default"], _objectSpread$2({
1074
- icon: jsxRuntime.jsx(icons.BinLinearIcon, {}),
1075
- label: label,
1076
- onClick: props.onClick,
1077
- isDisabled: props.isDisabled
1078
- }, filterDataAttributes(props.dataAttributes)));
1079
- };
1080
- FormDeleteButton.propTypes = {};
1081
- FormDeleteButton.displayName = 'FormDeleteButton';
1082
- FormDeleteButton.defaultProps = deleteDefaultProps;
1083
-
1084
1205
  const CustomFormModalPage = props => jsxRuntime.jsxs(ModalPage, {
1085
1206
  title: props.title,
1086
1207
  isOpen: props.isOpen,
@@ -1091,15 +1212,15 @@ const CustomFormModalPage = props => jsxRuntime.jsxs(ModalPage, {
1091
1212
  getParentSelector: props.getParentSelector,
1092
1213
  shouldDelayOnClose: props.shouldDelayOnClose,
1093
1214
  afterOpenStyles: props.afterOpenStyles,
1094
- customViewLocatorCode: props.customViewLocatorCode,
1095
1215
  children: [jsxRuntime.jsx(PageHeader, {
1096
1216
  title: props.title,
1097
1217
  subtitle: props.subtitle,
1218
+ customViewLocatorCode: props.customViewLocatorCode,
1098
1219
  children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
1099
1220
  alignItems: "flex-end",
1100
1221
  children: props.formControls
1101
1222
  })
1102
- }), jsxRuntime.jsx(ContentWrapper$1, {
1223
+ }), jsxRuntime.jsx(ContentWrapper, {
1103
1224
  children: props.children
1104
1225
  })]
1105
1226
  });
@@ -1174,7 +1295,7 @@ const useCustomViewLocatorSelector = function () {
1174
1295
  };
1175
1296
 
1176
1297
  const TabControls = /*#__PURE__*/_styled__default["default"]("div", {
1177
- target: "elpldre1"
1298
+ target: "elpldre2"
1178
1299
  } )("margin-top:", designSystem.designTokens.spacingS, ";" + ("" ));
1179
1300
  const ControlsContainter = props => jsxRuntime.jsxs("div", {
1180
1301
  css: /*#__PURE__*/react.css("display:flex;align-items:flex-end;justify-content:space-between;margin-top:", designTokens.marginTopForTabControls, ";" + ("" ), "" ),
@@ -1196,8 +1317,11 @@ const defaultProps$9 = {
1196
1317
  };
1197
1318
  TabularPageContainer.defaultProps = defaultProps$9;
1198
1319
  const FormControlsContainer = /*#__PURE__*/_styled__default["default"]("div", {
1199
- target: "elpldre0"
1320
+ target: "elpldre1"
1200
1321
  } )("margin-bottom:", designSystem.designTokens.spacingM, ";" + ("" ));
1322
+ const CustomViewsSelectorWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1323
+ target: "elpldre0"
1324
+ } )("margin:", designTokens.marginForCustomViewsSelectorAsTabular, ";" + ("" ));
1201
1325
 
1202
1326
  const defaultProps$8 = {
1203
1327
  hideControls: false
@@ -1216,7 +1340,6 @@ const TabularModalPage = props => {
1216
1340
  getParentSelector: props.getParentSelector,
1217
1341
  shouldDelayOnClose: props.shouldDelayOnClose,
1218
1342
  afterOpenStyles: props.afterOpenStyles,
1219
- customViewLocatorCode: currentCustomViewLocatorCode,
1220
1343
  children: [jsxRuntime.jsxs(TabularPageContainer, {
1221
1344
  color: "neutral",
1222
1345
  children: [props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
@@ -1233,7 +1356,12 @@ const TabularModalPage = props => {
1233
1356
  })
1234
1357
  })
1235
1358
  })]
1236
- }), jsxRuntime.jsx(ContentWrapper$1, {
1359
+ }), jsxRuntime.jsx(CustomViewsSelectorWrapper, {
1360
+ children: jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1361
+ margin: "".concat(designSystem.designTokens.spacing30, " 0 0 0"),
1362
+ customViewLocatorCode: currentCustomViewLocatorCode
1363
+ })
1364
+ }), jsxRuntime.jsx(ContentWrapper, {
1237
1365
  children: props.children
1238
1366
  })]
1239
1367
  });
@@ -1252,7 +1380,7 @@ TabularModalPage.Intl = i18n.sharedMessages;
1252
1380
 
1253
1381
  const defaultProps$7 = {
1254
1382
  color: 'surface',
1255
- previousPathLabel: messages$2.back
1383
+ previousPathLabel: messages$4.back
1256
1384
  };
1257
1385
  const PageTopBar = props => {
1258
1386
  const intl = reactIntl.useIntl();
@@ -1279,6 +1407,10 @@ const DetailPageContainer = /*#__PURE__*/_styled__default["default"]("div", {
1279
1407
  const HeaderControlsWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1280
1408
  target: "etkdonc0"
1281
1409
  } )("margin-top:", designSystem.designTokens.spacingS, ";" + ("" ));
1410
+ const getCustomViewsSelectorMargin = hasContentBelow => {
1411
+ var _context;
1412
+ return _concatInstanceProperty__default["default"](_context = "".concat(designSystem.designTokens.spacing40, " 0 ")).call(_context, hasContentBelow ? designSystem.designTokens.spacing40 : '0', " 0");
1413
+ };
1282
1414
 
1283
1415
  // NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
1284
1416
  // However, we need to explicitly define this otherwise the prop-types babel plugin
@@ -1289,9 +1421,7 @@ const defaultProps$6 = {
1289
1421
  const CustomFormDetailPage = props => {
1290
1422
  var _props$title;
1291
1423
  return jsxRuntime.jsxs(PageWrapper, {
1292
- children: [jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1293
- customViewLocatorCode: props.customViewLocatorCode
1294
- }), jsxRuntime.jsxs(DetailPageContainer, {
1424
+ children: [jsxRuntime.jsxs(DetailPageContainer, {
1295
1425
  children: [jsxRuntime.jsx(PageTopBar, {
1296
1426
  color: "neutral",
1297
1427
  previousPathLabel: props.previousPathLabel,
@@ -1300,13 +1430,16 @@ const CustomFormDetailPage = props => {
1300
1430
  title: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : '',
1301
1431
  subtitle: props.subtitle,
1302
1432
  titleSize: "big"
1433
+ }), jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1434
+ margin: getCustomViewsSelectorMargin(!props.hideControls && !!props.formControls),
1435
+ customViewLocatorCode: props.customViewLocatorCode
1303
1436
  }), !props.hideControls && props.formControls && jsxRuntime.jsx(HeaderControlsWrapper, {
1304
1437
  children: jsxRuntime.jsx(Spacings__default["default"].Inline, {
1305
1438
  justifyContent: "flex-end",
1306
1439
  children: props.formControls
1307
1440
  })
1308
1441
  })]
1309
- }), jsxRuntime.jsx(ContentWrapper$1, {
1442
+ }), jsxRuntime.jsx(ContentWrapper, {
1310
1443
  children: props.children
1311
1444
  })]
1312
1445
  });
@@ -1388,9 +1521,7 @@ const TabularDetailPage = props => {
1388
1521
  const _useCustomViewLocator = useCustomViewLocatorSelector(props.customViewLocatorCodes),
1389
1522
  currentCustomViewLocatorCode = _useCustomViewLocator.currentCustomViewLocatorCode;
1390
1523
  return jsxRuntime.jsxs(PageWrapper, {
1391
- children: [jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1392
- customViewLocatorCode: currentCustomViewLocatorCode
1393
- }), jsxRuntime.jsxs(TabularPageContainer, {
1524
+ children: [jsxRuntime.jsxs(TabularPageContainer, {
1394
1525
  color: "neutral",
1395
1526
  children: [jsxRuntime.jsx(PageTopBar, {
1396
1527
  color: "neutral",
@@ -1409,7 +1540,12 @@ const TabularDetailPage = props => {
1409
1540
  })
1410
1541
  })
1411
1542
  })]
1412
- }), jsxRuntime.jsx(ContentWrapper$1, {
1543
+ }), jsxRuntime.jsx(CustomViewsSelectorWrapper, {
1544
+ children: jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1545
+ margin: "".concat(designSystem.designTokens.spacing30, " 0 0 0"),
1546
+ customViewLocatorCode: currentCustomViewLocatorCode
1547
+ })
1548
+ }), jsxRuntime.jsx(ContentWrapper, {
1413
1549
  children: props.children
1414
1550
  })]
1415
1551
  });
@@ -1428,7 +1564,7 @@ TabularDetailPage.PageHeaderTitle = PageHeaderTitle;
1428
1564
  // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1429
1565
  TabularDetailPage.Intl = i18n.sharedMessages;
1430
1566
 
1431
- const PublicPageLayout = /*#__PURE__*/react$1.lazy(() => Promise.resolve().then(function () { return require('./public-page-layout-0e1daa2e.cjs.prod.js' /* webpackChunkName: "public-page-layout" */); }));
1567
+ const PublicPageLayout = /*#__PURE__*/react$1.lazy(() => Promise.resolve().then(function () { return require('./public-page-layout-609304bf.cjs.prod.js' /* webpackChunkName: "public-page-layout" */); }));
1432
1568
 
1433
1569
  const MainPageContainer = /*#__PURE__*/_styled__default["default"]("div", {
1434
1570
  target: "ev8m2jf2"
@@ -1440,33 +1576,38 @@ const MainPageContent = /*#__PURE__*/_styled__default["default"]("div", {
1440
1576
  target: "ev8m2jf0"
1441
1577
  } )("flex:1;flex-basis:0;overflow:auto;margin:", designTokens.marginForPageContent, ";" + ("" ));
1442
1578
 
1443
- const defaultProps$3 = {
1444
- hideControls: false,
1445
- hideDivider: false
1446
- };
1579
+ const headerRowMargin = "".concat(designSystem.designTokens.spacing40, " 0 0 0");
1447
1580
  const CustomFormMainPage = props => {
1448
1581
  var _props$title;
1449
1582
  return jsxRuntime.jsxs(PageWrapper, {
1450
- children: [jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1451
- customViewLocatorCode: props.customViewLocatorCode
1452
- }), jsxRuntime.jsx(MainPageContainer, {
1453
- children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
1454
- scale: "l",
1455
- children: [props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
1456
- title: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : '',
1457
- subtitle: props.subtitle,
1458
- titleSize: "big"
1459
- }), !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
1583
+ children: [jsxRuntime.jsxs(MainPageContainer, {
1584
+ children: [props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
1585
+ title: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : '',
1586
+ subtitle: props.subtitle,
1587
+ titleSize: "big"
1588
+ }), jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1589
+ margin: headerRowMargin,
1590
+ customViewLocatorCode: props.customViewLocatorCode
1591
+ }), !props.hideControls && props.formControls && jsxRuntime.jsx("div", {
1592
+ css: /*#__PURE__*/react.css("margin:", headerRowMargin, ";" + ("" ), "" ),
1593
+ children: jsxRuntime.jsx(Spacings__default["default"].Inline, {
1460
1594
  justifyContent: "flex-end",
1461
1595
  children: props.formControls
1462
- }), !props.hideDivider && jsxRuntime.jsx(Divider, {})]
1463
- })
1596
+ })
1597
+ }), !props.hideDivider && jsxRuntime.jsx("div", {
1598
+ css: /*#__PURE__*/react.css("&>", Divider, "{margin:", headerRowMargin, ";}" + ("" ), "" ),
1599
+ children: jsxRuntime.jsx(Divider, {})
1600
+ })]
1464
1601
  }), jsxRuntime.jsx(MainPageContent, {
1465
1602
  children: props.children
1466
1603
  })]
1467
1604
  });
1468
1605
  };
1469
1606
  CustomFormMainPage.propTypes = {};
1607
+ const defaultProps$3 = {
1608
+ hideControls: false,
1609
+ hideDivider: false
1610
+ };
1470
1611
  CustomFormMainPage.displayName = 'CustomFormMainPage';
1471
1612
  CustomFormMainPage.defaultProps = defaultProps$3;
1472
1613
 
@@ -1547,9 +1688,7 @@ const TabularMainPage = props => {
1547
1688
  const _useCustomViewLocator = useCustomViewLocatorSelector(props.customViewLocatorCodes),
1548
1689
  currentCustomViewLocatorCode = _useCustomViewLocator.currentCustomViewLocatorCode;
1549
1690
  return jsxRuntime.jsxs(PageWrapper, {
1550
- children: [jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1551
- customViewLocatorCode: currentCustomViewLocatorCode
1552
- }), jsxRuntime.jsxs(TabularPageContainer, {
1691
+ children: [jsxRuntime.jsxs(TabularPageContainer, {
1553
1692
  color: "surface",
1554
1693
  children: [props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
1555
1694
  title: (_props$title = props.title) !== null && _props$title !== void 0 ? _props$title : '',
@@ -1564,7 +1703,12 @@ const TabularMainPage = props => {
1564
1703
  })
1565
1704
  })
1566
1705
  })]
1567
- }), jsxRuntime.jsx(ContentWrapper$1, {
1706
+ }), jsxRuntime.jsx(CustomViewsSelectorWrapper, {
1707
+ children: jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1708
+ margin: "".concat(designSystem.designTokens.spacing30, " 0 0 0"),
1709
+ customViewLocatorCode: currentCustomViewLocatorCode
1710
+ })
1711
+ }), jsxRuntime.jsx(ContentWrapper, {
1568
1712
  css: /*#__PURE__*/react.css("background-color:", designTokens.backgroundColorForTabularMainPageContent, ";" + ("" ), "" ),
1569
1713
  children: props.children
1570
1714
  })]
@@ -1836,6 +1980,7 @@ const PortalsContainer = /*#__PURE__*/react$1.forwardRef((props, ref) => {
1836
1980
  const containerSelectorToPreventScrollingOnOpen = (_props$containerSelec = props.containerSelectorToPreventScrollingOnOpen) !== null && _props$containerSelec !== void 0 ? _props$containerSelec : 'main';
1837
1981
  const zIndex = (_props$zIndex = props.zIndex) !== null && _props$zIndex !== void 0 ? _props$zIndex : 10000;
1838
1982
  const baseModalZIndex = (_props$baseModalZInde = props.baseModalZIndex) !== null && _props$baseModalZInde !== void 0 ? _props$baseModalZInde : 1000;
1983
+ const modalWidthTransition = 'width 150ms cubic-bezier(1, 0, 0.58, 1)';
1839
1984
  const portalsContainerRef = react$1.useRef(null);
1840
1985
  const globalNotificationsElementDimensions = useObserverElementDimensions(ref === null || ref === void 0 || (_current = ref.current) === null || _current === void 0 ? void 0 : _current.notificationsGlobalRef);
1841
1986
  const pageNotificationsElementDimensions = useObserverElementDimensions(ref === null || ref === void 0 || (_current2 = ref.current) === null || _current2 === void 0 ? void 0 : _current2.notificationsPageRef);
@@ -1879,7 +2024,7 @@ const PortalsContainer = /*#__PURE__*/react$1.forwardRef((props, ref) => {
1879
2024
  children: [jsxRuntime.jsx(react.Global
1880
2025
  // Apply some global styles, based on the `.ReactModal__Body--open` class.
1881
2026
  , {
1882
- styles: [/*#__PURE__*/react.css(".ReactModal__Body--open ", containerSelectorToPreventScrollingOnOpen, "{overflow:hidden;}.ReactModal__Body--open #", constants.PORTALS_CONTAINER_ID, "{position:fixed;height:calc(\n 100% - ", offsetTop, " -\n ", globalNotificationsElementDimensions.height, "px -\n ", pageNotificationsElementDimensions.height, "px\n );width:calc(100% - ", offsetLeft, ");top:calc(\n ", offsetTop, " +\n ", globalNotificationsElementDimensions.height, "px +\n ", pageNotificationsElementDimensions.height, "px\n );right:0;bottom:0;z-index:", zIndex, ";}.ReactModal__Body--open.body__menu-open #", constants.PORTALS_CONTAINER_ID, "{width:calc(100% - ", offsetLeftOnExpandedMenu, ");}" + ("" ), "" ),
2027
+ styles: [/*#__PURE__*/react.css(".ReactModal__Body--open ", containerSelectorToPreventScrollingOnOpen, "{overflow:hidden;}.ReactModal__Body--open #", constants.PORTALS_CONTAINER_ID, "{position:fixed;height:calc(\n 100% - ", offsetTop, " -\n ", globalNotificationsElementDimensions.height, "px -\n ", pageNotificationsElementDimensions.height, "px\n );width:calc(100% - ", offsetLeft, ");top:calc(\n ", offsetTop, " +\n ", globalNotificationsElementDimensions.height, "px +\n ", pageNotificationsElementDimensions.height, "px\n );right:0;bottom:0;z-index:", zIndex, ";transition:", modalWidthTransition, ";}.ReactModal__Body--open.body__menu-open #", constants.PORTALS_CONTAINER_ID, "{width:calc(100% - ", offsetLeftOnExpandedMenu, ");transition:", modalWidthTransition, ";}" + ("" ), "" ),
1883
2028
  // Apply styles for stacking layers.
1884
2029
  ..._mapInstanceProperty__default["default"](stackingLayers).call(stackingLayers,
1885
2030
  /**
@@ -1918,9 +2063,9 @@ exports.ConfirmationDialog = ConfirmationDialog;
1918
2063
  exports.CustomFormDetailPage = CustomFormDetailPage;
1919
2064
  exports.CustomFormMainPage = CustomFormMainPage;
1920
2065
  exports.CustomFormModalPage = CustomFormModalPage;
1921
- exports.CustomPanel = CustomPanel;
1922
2066
  exports.CustomViewLoader = CustomViewLoader;
1923
2067
  exports.CustomViewsSelector = CustomViewSelectorOrNothing;
2068
+ exports.Drawer = Drawer;
1924
2069
  exports.FormDetailPage = FormDetailPage;
1925
2070
  exports.FormDialog = FormDialog;
1926
2071
  exports.FormMainPage = FormMainPage;