@commercetools-frontend/application-components 0.0.0-FEC-157-preview-releases-20241126230331

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 (102) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -0
  3. package/dist/commercetools-frontend-application-components.cjs.d.ts +2 -0
  4. package/dist/commercetools-frontend-application-components.cjs.d.ts.map +1 -0
  5. package/dist/commercetools-frontend-application-components.cjs.dev.js +2878 -0
  6. package/dist/commercetools-frontend-application-components.cjs.js +7 -0
  7. package/dist/commercetools-frontend-application-components.cjs.prod.js +2168 -0
  8. package/dist/commercetools-frontend-application-components.esm.js +2807 -0
  9. package/dist/declarations/src/components/custom-views/custom-view-loader/custom-view-loader.d.ts +8 -0
  10. package/dist/declarations/src/components/custom-views/custom-view-loader/index.d.ts +1 -0
  11. package/dist/declarations/src/components/custom-views/custom-view-loader/messages.d.ts +7 -0
  12. package/dist/declarations/src/components/custom-views/custom-views-selector/custom-views-selector.d.ts +10 -0
  13. package/dist/declarations/src/components/custom-views/custom-views-selector/index.d.ts +1 -0
  14. package/dist/declarations/src/components/custom-views/custom-views-selector/messages.d.ts +7 -0
  15. package/dist/declarations/src/components/custom-views/custom-views-selector/use-custom-views-connector.d.ts +11 -0
  16. package/dist/declarations/src/components/detail-pages/custom-form-detail-page/custom-form-detail-page.d.ts +237 -0
  17. package/dist/declarations/src/components/detail-pages/custom-form-detail-page/index.d.ts +1 -0
  18. package/dist/declarations/src/components/detail-pages/form-detail-page/form-detail-page.d.ts +180 -0
  19. package/dist/declarations/src/components/detail-pages/form-detail-page/index.d.ts +1 -0
  20. package/dist/declarations/src/components/detail-pages/info-detail-page/index.d.ts +1 -0
  21. package/dist/declarations/src/components/detail-pages/info-detail-page/info-detail-page.d.ts +59 -0
  22. package/dist/declarations/src/components/detail-pages/tabular-detail-page/index.d.ts +1 -0
  23. package/dist/declarations/src/components/detail-pages/tabular-detail-page/tabular-detail-page.d.ts +240 -0
  24. package/dist/declarations/src/components/dialogs/confirmation-dialog/confirmation-dialog.d.ts +111 -0
  25. package/dist/declarations/src/components/dialogs/confirmation-dialog/index.d.ts +1 -0
  26. package/dist/declarations/src/components/dialogs/form-dialog/form-dialog.d.ts +113 -0
  27. package/dist/declarations/src/components/dialogs/form-dialog/index.d.ts +1 -0
  28. package/dist/declarations/src/components/dialogs/info-dialog/index.d.ts +1 -0
  29. package/dist/declarations/src/components/dialogs/info-dialog/info-dialog.d.ts +19 -0
  30. package/dist/declarations/src/components/dialogs/internals/dialog-container.d.ts +18 -0
  31. package/dist/declarations/src/components/dialogs/internals/dialog-content.d.ts +6 -0
  32. package/dist/declarations/src/components/dialogs/internals/dialog-footer.d.ts +29 -0
  33. package/dist/declarations/src/components/dialogs/internals/dialog-header.d.ts +15 -0
  34. package/dist/declarations/src/components/dialogs/internals/dialog.styles.d.ts +8 -0
  35. package/dist/declarations/src/components/drawer/drawer.d.ts +181 -0
  36. package/dist/declarations/src/components/drawer/index.d.ts +1 -0
  37. package/dist/declarations/src/components/internals/default-form-buttons.d.ts +38 -0
  38. package/dist/declarations/src/components/internals/messages.d.ts +11 -0
  39. package/dist/declarations/src/components/internals/page-header-title.d.ts +15 -0
  40. package/dist/declarations/src/components/internals/page-header.d.ts +15 -0
  41. package/dist/declarations/src/components/internals/page-top-bar.d.ts +20 -0
  42. package/dist/declarations/src/components/internals/page.styles.d.ts +13 -0
  43. package/dist/declarations/src/components/internals/tabular-page.d.ts +27 -0
  44. package/dist/declarations/src/components/main-pages/custom-form-main-page/custom-form-main-page.d.ts +233 -0
  45. package/dist/declarations/src/components/main-pages/custom-form-main-page/index.d.ts +1 -0
  46. package/dist/declarations/src/components/main-pages/form-main-page/form-main-page.d.ts +174 -0
  47. package/dist/declarations/src/components/main-pages/form-main-page/index.d.ts +1 -0
  48. package/dist/declarations/src/components/main-pages/info-main-page/index.d.ts +1 -0
  49. package/dist/declarations/src/components/main-pages/info-main-page/info-main-page.d.ts +45 -0
  50. package/dist/declarations/src/components/main-pages/internals/main-page.styles.d.ts +13 -0
  51. package/dist/declarations/src/components/main-pages/tabular-main-page/index.d.ts +1 -0
  52. package/dist/declarations/src/components/main-pages/tabular-main-page/tabular-main-page.d.ts +228 -0
  53. package/dist/declarations/src/components/maintenance-page-layout/index.d.ts +1 -0
  54. package/dist/declarations/src/components/maintenance-page-layout/maintenance-page-layout.d.ts +15 -0
  55. package/dist/declarations/src/components/modal-pages/custom-form-modal-page/custom-form-modal-page.d.ts +207 -0
  56. package/dist/declarations/src/components/modal-pages/custom-form-modal-page/index.d.ts +1 -0
  57. package/dist/declarations/src/components/modal-pages/form-modal-page/form-modal-page.d.ts +129 -0
  58. package/dist/declarations/src/components/modal-pages/form-modal-page/index.d.ts +1 -0
  59. package/dist/declarations/src/components/modal-pages/info-modal-page/index.d.ts +1 -0
  60. package/dist/declarations/src/components/modal-pages/info-modal-page/info-modal-page.d.ts +38 -0
  61. package/dist/declarations/src/components/modal-pages/internals/modal-page.d.ts +40 -0
  62. package/dist/declarations/src/components/modal-pages/internals/modal-page.styles.d.ts +31 -0
  63. package/dist/declarations/src/components/modal-pages/tabular-modal-page/index.d.ts +1 -0
  64. package/dist/declarations/src/components/modal-pages/tabular-modal-page/tabular-modal-page.d.ts +211 -0
  65. package/dist/declarations/src/components/modal-pages/utils/index.d.ts +1 -0
  66. package/dist/declarations/src/components/modal-pages/utils/modal-page-top-bar.d.ts +27 -0
  67. package/dist/declarations/src/components/page-content-containers/page-content-full/index.d.ts +2 -0
  68. package/dist/declarations/src/components/page-content-containers/page-content-full/page-content-full.d.ts +6 -0
  69. package/dist/declarations/src/components/page-content-containers/page-content-narrow/index.d.ts +2 -0
  70. package/dist/declarations/src/components/page-content-containers/page-content-narrow/page-content-narrow.d.ts +6 -0
  71. package/dist/declarations/src/components/page-content-containers/page-content-wide/index.d.ts +2 -0
  72. package/dist/declarations/src/components/page-content-containers/page-content-wide/page-content-wide.d.ts +12 -0
  73. package/dist/declarations/src/components/page-not-found/index.d.ts +1 -0
  74. package/dist/declarations/src/components/page-not-found/messages.d.ts +11 -0
  75. package/dist/declarations/src/components/page-not-found/page-not-found.d.ts +5 -0
  76. package/dist/declarations/src/components/page-unauthorized/index.d.ts +1 -0
  77. package/dist/declarations/src/components/page-unauthorized/messages.d.ts +15 -0
  78. package/dist/declarations/src/components/page-unauthorized/page-unauthorized.d.ts +5 -0
  79. package/dist/declarations/src/components/portals-container/index.d.ts +1 -0
  80. package/dist/declarations/src/components/portals-container/portals-container.d.ts +44 -0
  81. package/dist/declarations/src/components/project-stamp/messages.d.ts +19 -0
  82. package/dist/declarations/src/components/project-stamp/project-stamp.d.ts +9 -0
  83. package/dist/declarations/src/components/public-page-layout/index.d.ts +8 -0
  84. package/dist/declarations/src/components/public-page-layout/public-page-layout.d.ts +26 -0
  85. package/dist/declarations/src/components/public-page-layout/public-page-layout.styles.d.ts +13 -0
  86. package/dist/declarations/src/components/tab-header/index.d.ts +1 -0
  87. package/dist/declarations/src/components/tab-header/tab-header.d.ts +37 -0
  88. package/dist/declarations/src/components/tab-header/tab.styles.d.ts +2 -0
  89. package/dist/declarations/src/hooks/use-custom-view-locator-selector/index.d.ts +1 -0
  90. package/dist/declarations/src/hooks/use-custom-view-locator-selector/use-custom-view-locator-selector.d.ts +5 -0
  91. package/dist/declarations/src/hooks/use-modal-state/index.d.ts +1 -0
  92. package/dist/declarations/src/hooks/use-modal-state/use-modal-state.d.ts +6 -0
  93. package/dist/declarations/src/index.d.ts +35 -0
  94. package/dist/declarations/src/theming.d.ts +13 -0
  95. package/dist/declarations/src/types/generated/settings.d.ts +2116 -0
  96. package/dist/declarations/src/utils/filter-data-attributes.d.ts +1 -0
  97. package/dist/declarations/src/version.d.ts +2 -0
  98. package/dist/public-page-layout-3fba954d.esm.js +110 -0
  99. package/dist/public-page-layout-81be35b4.cjs.dev.js +128 -0
  100. package/dist/public-page-layout-d365f38f.cjs.prod.js +108 -0
  101. package/materials/media-queries.css +15 -0
  102. package/package.json +103 -0
@@ -0,0 +1,2168 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
6
+ var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
7
+ var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
8
+ var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
9
+ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
10
+ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
11
+ var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
12
+ var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
13
+ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
14
+ require('prop-types');
15
+ var reactIntl = require('react-intl');
16
+ var reactRouterDom = require('react-router-dom');
17
+ var Text = require('@commercetools-uikit/text');
18
+ var utils = require('@commercetools-uikit/utils');
19
+ var react = require('@emotion/react');
20
+ var designSystem = require('@commercetools-uikit/design-system');
21
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
22
+ var react$1 = require('react');
23
+ var _styled = require('@emotion/styled/base');
24
+ var Modal = require('react-modal');
25
+ var constants = require('@commercetools-frontend/constants');
26
+ var Card = require('@commercetools-uikit/card');
27
+ var icons = require('@commercetools-uikit/icons');
28
+ var SecondaryIconButton = require('@commercetools-uikit/secondary-icon-button');
29
+ var Spacings = require('@commercetools-uikit/spacings');
30
+ var i18n = require('@commercetools-frontend/i18n');
31
+ var PrimaryButton = require('@commercetools-uikit/primary-button');
32
+ var SecondaryButton = require('@commercetools-uikit/secondary-button');
33
+ var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
34
+ var omitBy = require('lodash/omitBy');
35
+ var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
36
+ var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
37
+ var sentry = require('@commercetools-frontend/sentry');
38
+ var AccessibleButton = require('@commercetools-uikit/accessible-button');
39
+ var Constraints = require('@commercetools-uikit/constraints');
40
+ var reactBroadcast = require('@flopflip/react-broadcast');
41
+ var actionsGlobal = require('@commercetools-frontend/actions-global');
42
+ var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
43
+ var _setTimeout = require('@babel/runtime-corejs3/core-js-stable/set-timeout');
44
+ var FlatButton = require('@commercetools-uikit/flat-button');
45
+ var IconButton = require('@commercetools-uikit/icon-button');
46
+ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
47
+ var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
48
+ var PageNotFoundSVG = require('@commercetools-frontend/assets/images/page-not-found.svg');
49
+ var FailedAuthorizationSVG = require('@commercetools-frontend/assets/images/doors-closed.svg');
50
+ var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
51
+ var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
52
+ var Stamp = require('@commercetools-uikit/stamp');
53
+ var useResizeObserver = require('@react-hook/resize-observer');
54
+ var hooks = require('@commercetools-uikit/hooks');
55
+
56
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
57
+
58
+ var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
59
+ var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
60
+ var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
61
+ var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptor);
62
+ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
63
+ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
64
+ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
65
+ var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
66
+ var Text__default = /*#__PURE__*/_interopDefault(Text);
67
+ var _styled__default = /*#__PURE__*/_interopDefault(_styled);
68
+ var Modal__default = /*#__PURE__*/_interopDefault(Modal);
69
+ var Card__default = /*#__PURE__*/_interopDefault(Card);
70
+ var SecondaryIconButton__default = /*#__PURE__*/_interopDefault(SecondaryIconButton);
71
+ var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
72
+ var PrimaryButton__default = /*#__PURE__*/_interopDefault(PrimaryButton);
73
+ var SecondaryButton__default = /*#__PURE__*/_interopDefault(SecondaryButton);
74
+ var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
75
+ var omitBy__default = /*#__PURE__*/_interopDefault(omitBy);
76
+ var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
77
+ var AccessibleButton__default = /*#__PURE__*/_interopDefault(AccessibleButton);
78
+ var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
79
+ var _setTimeout__default = /*#__PURE__*/_interopDefault(_setTimeout);
80
+ var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
81
+ var IconButton__default = /*#__PURE__*/_interopDefault(IconButton);
82
+ var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
83
+ var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
84
+ var PageNotFoundSVG__default = /*#__PURE__*/_interopDefault(PageNotFoundSVG);
85
+ var FailedAuthorizationSVG__default = /*#__PURE__*/_interopDefault(FailedAuthorizationSVG);
86
+ var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
87
+ var Stamp__default = /*#__PURE__*/_interopDefault(Stamp);
88
+ var useResizeObserver__default = /*#__PURE__*/_interopDefault(useResizeObserver);
89
+
90
+ // NOTE: This string will be replaced on build time with the package version.
91
+ var version = "22.35.1";
92
+
93
+ // We keep these tokens as they are related to page layout components which should have
94
+ // a slightly different layout (margins/paddings) when used within a Custom View panel.
95
+ // https://github.com/commercetools/merchant-center-application-kit/pull/3353
96
+ const themesOverrides = {
97
+ default: {
98
+ marginForCustomViewsSelectorAsTabular: `0 ${designSystem.designTokens.spacing55}`,
99
+ marginForPageContent: `${designSystem.designTokens.spacing50} ${designSystem.designTokens.spacing55}`,
100
+ paddingForDetailPageHeader: `${designSystem.designTokens.spacing50} ${designSystem.designTokens.spacing55} ${designSystem.designTokens.spacing40}`,
101
+ paddingForMainPageHeader: `${designSystem.designTokens.spacing50} ${designSystem.designTokens.spacing55} 0`,
102
+ paddingForTabularPageHeader: `${designSystem.designTokens.spacing40} ${designSystem.designTokens.spacing55} 0`,
103
+ backgroundColorForNavbar: designSystem.designTokens.colorPrimary10,
104
+ backgroundColorForNavbarHeader: designSystem.designTokens.colorPrimary10,
105
+ fontColorForTabLabelWhenActive: designSystem.designTokens.colorPrimary
106
+ }
107
+ };
108
+ const designTokens = designSystem.transformTokensToCssVarsReferences(themesOverrides.default, {
109
+ includeDefaultValue: false
110
+ });
111
+
112
+ const getBottomBorderStyles = background => /*#__PURE__*/react.css(":after{content:'';position:absolute;bottom:0;left:0;right:0;height:2px;border-radius:", designSystem.designTokens.borderRadius2, ";background-color:", background, ";transition:background-color ", designSystem.designTokens.transitionEaseinout150Ms, ";}" + ("" ), "" );
113
+ var _ref$8 = {
114
+ name: "1u0tiat",
115
+ styles: "&[aria-disabled='true']{cursor:not-allowed;opacity:0.5;&:active{pointer-events:none;}}"
116
+ } ;
117
+ const getLinkStyles = (isActive, isDisabled) => [/*#__PURE__*/react.css("font-size:", designSystem.designTokens.fontSize30, ";padding:", designSystem.designTokens.spacingS, " ", designSystem.designTokens.spacingM, ";position:relative;text-align:center;display:inline-block;color:inherit;text-decoration:inherit;&:first-of-type{padding-left:", designSystem.designTokens.spacing30, ";}", getBottomBorderStyles('transparent'), ";" + ("" ), "" ), isActive && /*#__PURE__*/react.css(getBottomBorderStyles(designSystem.designTokens.colorPrimary), " & h3{color:", designTokens.fontColorForTabLabelWhenActive, "!important;}" + ("" ), "" ), isDisabled && _ref$8, !isActive && !isDisabled && /*#__PURE__*/react.css(":hover,:focus,:active{& h3{color:", designTokens.fontColorForTabLabelWhenActive, "!important;}}" + ("" ), "" )];
118
+
119
+ function ownKeys$8(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; }
120
+ function _objectSpread$8(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$8(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$8(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
121
+ const pathWithoutSearch$1 = path => typeof path === 'string' ? path.split('?')[0] : path.pathname;
122
+ const warnIfMissingContent = props => {
123
+ Boolean(props.intlMessage) || Boolean(props.label);
124
+ };
125
+ const getDisabledLinkAtributes = isDisabled => isDisabled ? {
126
+ tabIndex: -1,
127
+ 'aria-disabled': true
128
+ } : {};
129
+ const TabLabel = _ref => {
130
+ let children = _ref.children;
131
+ return jsxRuntime.jsx(Text__default["default"].Headline, {
132
+ as: "h3",
133
+ truncate: true,
134
+ children: children
135
+ });
136
+ };
137
+ const TabHeader = props => {
138
+ const intl = reactIntl.useIntl();
139
+ const location = reactRouterDom.useLocation();
140
+ const isActive = Boolean(reactRouterDom.matchPath(location.pathname, {
141
+ // strip the search, otherwise the path won't match
142
+ path: pathWithoutSearch$1(props.to),
143
+ exact: props.exactPathMatch,
144
+ strict: false
145
+ }));
146
+ const isDisabled = props.isDisabled;
147
+ let label = props.label;
148
+ if (props.intlMessage) {
149
+ label = intl.formatMessage(props.intlMessage);
150
+ }
151
+ warnIfMissingContent(props);
152
+ return jsxRuntime.jsx(reactRouterDom.Link, _objectSpread$8(_objectSpread$8({
153
+ role: "tab",
154
+ "aria-selected": isActive,
155
+ to: props.to,
156
+ css: getLinkStyles(isActive, isDisabled)
157
+ }, getDisabledLinkAtributes(isDisabled)), {}, {
158
+ children: jsxRuntime.jsx(TabLabel, {
159
+ children: label
160
+ })
161
+ }));
162
+ };
163
+ TabHeader.propTypes = {};
164
+ TabHeader.displayName = 'TabHeader';
165
+ const defaultProps$i = {
166
+ isDisabled: false,
167
+ exactPathMatch: false
168
+ };
169
+ TabHeader.defaultProps = defaultProps$i;
170
+
171
+ const getConstraintForGridStyle = size => {
172
+ switch (size) {
173
+ case 7:
174
+ return designSystem.designTokens.constraint7;
175
+ case 8:
176
+ return designSystem.designTokens.constraint8;
177
+ case 9:
178
+ case 'm':
179
+ return designSystem.designTokens.constraint9;
180
+ case 10:
181
+ return designSystem.designTokens.constraint10;
182
+ case 11:
183
+ return designSystem.designTokens.constraint11;
184
+ case 12:
185
+ return designSystem.designTokens.constraint12;
186
+ case 13:
187
+ case 'l':
188
+ return designSystem.designTokens.constraint13;
189
+ case 16:
190
+ return designSystem.designTokens.constraint16;
191
+ case 'scale':
192
+ return designSystem.designTokens.constraintScale;
193
+ default:
194
+ return designSystem.designTokens.constraintScale;
195
+ }
196
+ };
197
+ const getModalContentStyles = props => {
198
+ const sizeConstraint = getConstraintForGridStyle(props.size);
199
+ const gridStyle = props.size === 'scale' ? /*#__PURE__*/react.css("grid:[row1-start] 'top top top' minmax(\n ", designSystem.designTokens.spacingXl, ",\n 1fr\n ) [row1-end] [row2-start] 'left main right' minmax(0, 100%) [row2-end] [row3-start] 'bottom bottom bottom' minmax(\n ", designSystem.designTokens.spacingXl, ",\n 1fr\n ) [row3-end]/", designSystem.designTokens.spacingXl, " 1fr ", designSystem.designTokens.spacingXl, ";" + ("" ), "" ) : /*#__PURE__*/react.css("grid:[row1-start] 'top top top' minmax(\n ", designSystem.designTokens.spacingXl, ",\n 1fr\n ) [row1-end] [row2-start] 'left main right' minmax(0, 100%) [row2-end] [row3-start] 'bottom bottom bottom' minmax(\n ", designSystem.designTokens.spacingXl, ",\n 1fr\n ) [row3-end]/minmax(", designSystem.designTokens.spacingXl, ", 1fr) ", sizeConstraint, " minmax(", designSystem.designTokens.spacingXl, ", 1fr);" + ("" ), "" );
200
+
201
+ // To ensure that the mouse click on the overlay surface goes "through"
202
+ // and triggers the modal to close, we need to turn off the pointer events.
203
+ const baseStyles = /*#__PURE__*/react.css("display:grid;height:100%;width:100%;outline:none;pointer-events:none;", gridStyle, ";" + ("" ), "" );
204
+ return baseStyles;
205
+ };
206
+ const getOverlayStyles$1 = props => /*#__PURE__*/react.css("display:flex;position:absolute;z-index:", typeof props.zIndex === 'number' ?
207
+ // Use `!important` to overwrite the default value assigned by the Stacking Layer System.
208
+ `${props.zIndex} !important` : 'auto', ";top:0;width:100%;height:100%;background-color:rgba(32, 62, 72, 0.5);opacity:1;" + ("" ), "" );
209
+
210
+ function ownKeys$7(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; }
211
+ function _objectSpread$7(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$7(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$7(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
212
+ const getDefaultParentSelector$1 = () => document.querySelector(`#${constants.PORTALS_CONTAINER_ID}`);
213
+ const getOverlayElement$1 = (props, contentElement) =>
214
+ // Assign the `data-role` to the overlay container, which is used as
215
+ // the CSS selector in the `<PortalsContainer>`.
216
+ jsxRuntime.jsx("div", _objectSpread$7(_objectSpread$7({}, props), {}, {
217
+ "data-role": "dialog-overlay",
218
+ children: contentElement
219
+ }));
220
+ const defaultProps$h = {
221
+ // TODO: t-shirt sizes are deprecated but we need to keep using them for
222
+ // backwards compatibility and to help with styling migration
223
+ // After the migration is done, we should change this default value to 13.
224
+ // t-shirt sizes then can be removed in a next breaking change release
225
+ size: 'l',
226
+ getParentSelector: getDefaultParentSelector$1
227
+ };
228
+ const GridArea = /*#__PURE__*/_styled__default["default"]("div", {
229
+ target: "elx55gk0"
230
+ } )("grid-area:", props => props.name, ";" + ("" ));
231
+ var _ref$7 = {
232
+ name: "1daj17f",
233
+ styles: "display:flex;flex-direction:column;align-items:stretch;height:100%;min-height:0"
234
+ } ;
235
+ var _ref2$3 = {
236
+ name: "1187q51",
237
+ styles: "display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;overflow:hidden"
238
+ } ;
239
+ const DialogContainer = props => {
240
+ utils.useWarning(typeof props.title === 'string' || typeof props.title !== 'string' && Boolean(props['aria-label']), 'app-kit/DialogHeader: "aria-label" prop is required when the "title" prop is not a string.');
241
+ return jsxRuntime.jsx(react.ClassNames, {
242
+ children: _ref3 => {
243
+ let makeClassName = _ref3.css;
244
+ return jsxRuntime.jsxs(Modal__default["default"], {
245
+ isOpen: props.isOpen,
246
+ onRequestClose: props.onClose,
247
+ shouldCloseOnOverlayClick: Boolean(props.onClose),
248
+ shouldCloseOnEsc: Boolean(props.onClose),
249
+ overlayElement: getOverlayElement$1,
250
+ overlayClassName: makeClassName(getOverlayStyles$1(props)),
251
+ className: makeClassName(getModalContentStyles(props)),
252
+ contentLabel: typeof props.title === 'string' ? props.title : props['aria-label'],
253
+ parentSelector: props.getParentSelector,
254
+ ariaHideApp: false,
255
+ children: [jsxRuntime.jsx(GridArea, {
256
+ name: "top"
257
+ }), jsxRuntime.jsx(GridArea, {
258
+ name: "left"
259
+ }), jsxRuntime.jsx(GridArea, {
260
+ name: "right"
261
+ }), jsxRuntime.jsx(GridArea, {
262
+ name: "bottom"
263
+ }), jsxRuntime.jsx(GridArea, {
264
+ name: "main",
265
+ css: _ref2$3,
266
+ children: jsxRuntime.jsx(Card__default["default"]
267
+ // 1. For the min-height: https://stackoverflow.com/questions/28636832/firefox-overflow-y-not-working-with-nested-flexbox/28639686#28639686
268
+ // 2. For the actual "> div" container with the content, we need to use normal pointer events so that clicking on it does not close the dialog.
269
+ , {
270
+ css: /*#__PURE__*/react.css("min-height:0;padding:", designSystem.designTokens.spacing20, " ", designSystem.designTokens.spacing30, ";>div{display:flex;flex-direction:column;height:100%;pointer-events:auto;min-height:0;}" + ("" ), "" ),
271
+ children: jsxRuntime.jsx("div", {
272
+ css: _ref$7,
273
+ children: props.children
274
+ })
275
+ })
276
+ })]
277
+ });
278
+ }
279
+ });
280
+ };
281
+ DialogContainer.propTypes = {};
282
+ DialogContainer.displayName = 'DialogContainer';
283
+ DialogContainer.defaultProps = defaultProps$h;
284
+
285
+ // The overflow should be "auto", to make the container scrollable
286
+ const DialogContent = /*#__PURE__*/_styled__default["default"]("div", {
287
+ target: "eo6zkz80"
288
+ } )("border-top:1px solid ", designSystem.designTokens.colorNeutral90, ";padding:", designSystem.designTokens.spacing40, " 0 0;flex:1;overflow:auto;" + ("" ));
289
+
290
+ const TextTitle = props => jsxRuntime.jsx(Text__default["default"].Headline, {
291
+ as: "h3",
292
+ title: props.title,
293
+ truncate: true,
294
+ children: props.title
295
+ });
296
+ TextTitle.propTypes = {};
297
+ const Title$1 = props => {
298
+ if (typeof props.title === 'string') {
299
+ return jsxRuntime.jsx(TextTitle, {
300
+ title: props.title
301
+ });
302
+ } else {
303
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
304
+ children: props.title
305
+ });
306
+ }
307
+ };
308
+ const DialogHeader = props => jsxRuntime.jsx("div", {
309
+ css: /*#__PURE__*/react.css("flex:0 1 auto;display:flex;flex-direction:column;margin-bottom:", designSystem.designTokens.spacing30, ";" + ("" ), "" ),
310
+ children: jsxRuntime.jsxs(Spacings__default["default"].Inline, {
311
+ scale: "m",
312
+ alignItems: "center",
313
+ justifyContent: "space-between",
314
+ children: [jsxRuntime.jsx(Title$1, {
315
+ title: props.title
316
+ }), props.onClose && jsxRuntime.jsx(SecondaryIconButton__default["default"], {
317
+ label: "Close dialog",
318
+ onClick: props.onClose,
319
+ icon: jsxRuntime.jsx(icons.CloseIcon, {}),
320
+ size: "30"
321
+ })]
322
+ })
323
+ });
324
+ DialogHeader.propTypes = {};
325
+ DialogHeader.displayName = 'DialogHeader';
326
+
327
+ const InfoDialog = props => jsxRuntime.jsxs(DialogContainer, {
328
+ isOpen: props.isOpen,
329
+ onClose: props.onClose,
330
+ size: props.size,
331
+ zIndex: props.zIndex,
332
+ title: props.title,
333
+ "aria-label": props['aria-label'],
334
+ getParentSelector: props.getParentSelector,
335
+ children: [jsxRuntime.jsx(DialogHeader, {
336
+ title: props.title,
337
+ onClose: props.onClose
338
+ }), jsxRuntime.jsx(DialogContent, {
339
+ children: props.children
340
+ })]
341
+ });
342
+ InfoDialog.propTypes = {};
343
+ InfoDialog.displayName = 'InfoDialog';
344
+
345
+ // Allow consumers who want to use a custom title to reuse the same title styles
346
+ // as the default dialog title.
347
+ InfoDialog.TextTitle = TextTitle;
348
+
349
+ function filterDataAttributes(obj) {
350
+ return omitBy__default["default"](obj, (_value, key) => !_startsWithInstanceProperty__default["default"](key).call(key, 'data-'));
351
+ }
352
+
353
+ function ownKeys$6(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; }
354
+ function _objectSpread$6(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$6(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$6(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
355
+ const defaultProps$g = {
356
+ isPrimaryButtonDisabled: false,
357
+ dataAttributesPrimaryButton: {},
358
+ dataAttributesSecondaryButton: {}
359
+ };
360
+ const getFormattedLabel = (label, intl) => typeof label === 'string' ? label : intl.formatMessage(label);
361
+ const DialogFooter = props => {
362
+ const intl = reactIntl.useIntl();
363
+ return jsxRuntime.jsx("div", {
364
+ css: /*#__PURE__*/react.css("margin-top:", designSystem.designTokens.spacing50, ";" + ("" ), "" ),
365
+ children: jsxRuntime.jsxs(Spacings__default["default"].Inline, {
366
+ alignItems: "center",
367
+ justifyContent: "space-between",
368
+ children: [jsxRuntime.jsx("div", {
369
+ children: props.footerContent
370
+ }), jsxRuntime.jsxs(Spacings__default["default"].Inline, {
371
+ scale: "m",
372
+ alignItems: "center",
373
+ justifyContent: "flex-end",
374
+ children: [jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$6({
375
+ label: getFormattedLabel(props.labelSecondary, intl),
376
+ onClick: props.onCancel,
377
+ iconLeft: props.iconLeftSecondaryButton
378
+ }, filterDataAttributes(props.dataAttributesSecondaryButton))), jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$6({
379
+ label: getFormattedLabel(props.labelPrimary, intl),
380
+ onClick: props.onConfirm,
381
+ isDisabled: props.isPrimaryButtonDisabled
382
+ }, filterDataAttributes(props.dataAttributesPrimaryButton)))]
383
+ })]
384
+ })
385
+ });
386
+ };
387
+ DialogFooter.propTypes = {};
388
+ DialogFooter.displayName = 'DialogFooter';
389
+ DialogFooter.defaultProps = defaultProps$g;
390
+
391
+ const defaultProps$f = {
392
+ labelSecondary: i18n.sharedMessages.cancel,
393
+ labelPrimary: i18n.sharedMessages.confirm
394
+ };
395
+ const ConfirmationDialog = props => jsxRuntime.jsxs(DialogContainer, {
396
+ isOpen: props.isOpen,
397
+ onClose: props.onClose,
398
+ size: props.size,
399
+ zIndex: props.zIndex,
400
+ title: props.title,
401
+ "aria-label": props['aria-label'],
402
+ getParentSelector: props.getParentSelector,
403
+ children: [jsxRuntime.jsx(DialogHeader, {
404
+ title: props.title,
405
+ onClose: props.onClose
406
+ }), jsxRuntime.jsx(DialogContent, {
407
+ children: props.children
408
+ }), jsxRuntime.jsx(DialogFooter, {
409
+ labelSecondary: props.labelSecondary,
410
+ labelPrimary: props.labelPrimary,
411
+ isPrimaryButtonDisabled: props.isPrimaryButtonDisabled,
412
+ onCancel: props.onCancel,
413
+ onConfirm: props.onConfirm,
414
+ dataAttributesSecondaryButton: props.dataAttributesSecondaryButton,
415
+ dataAttributesPrimaryButton: props.dataAttributesPrimaryButton
416
+ })]
417
+ });
418
+ ConfirmationDialog.propTypes = {};
419
+ ConfirmationDialog.displayName = 'ConfirmationDialog';
420
+ ConfirmationDialog.defaultProps = defaultProps$f;
421
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
422
+ // The Intl messages can be used for button labels.
423
+ ConfirmationDialog.Intl = i18n.sharedMessages;
424
+ // Allow consumers who want to use a custom title to reuse the same title styles
425
+ // as the default dialog title.
426
+ ConfirmationDialog.TextTitle = TextTitle;
427
+
428
+ const defaultProps$e = {
429
+ labelSecondary: i18n.sharedMessages.cancel,
430
+ labelPrimary: i18n.sharedMessages.save
431
+ };
432
+ const FormDialog = props => jsxRuntime.jsxs(DialogContainer, {
433
+ isOpen: props.isOpen,
434
+ onClose: props.onClose,
435
+ size: props.size,
436
+ zIndex: props.zIndex,
437
+ title: props.title,
438
+ "aria-label": props['aria-label'],
439
+ getParentSelector: props.getParentSelector,
440
+ children: [jsxRuntime.jsx(DialogHeader, {
441
+ title: props.title,
442
+ onClose: props.onClose
443
+ }), jsxRuntime.jsx(DialogContent, {
444
+ children: props.children
445
+ }), jsxRuntime.jsx(DialogFooter, {
446
+ labelSecondary: props.labelSecondary,
447
+ labelPrimary: props.labelPrimary,
448
+ isPrimaryButtonDisabled: props.isPrimaryButtonDisabled,
449
+ onCancel: props.onSecondaryButtonClick,
450
+ onConfirm: props.onPrimaryButtonClick,
451
+ dataAttributesSecondaryButton: props.dataAttributesSecondaryButton,
452
+ dataAttributesPrimaryButton: props.dataAttributesPrimaryButton,
453
+ iconLeftSecondaryButton: props.iconLeftSecondaryButton,
454
+ footerContent: props.footerContent
455
+ })]
456
+ });
457
+ FormDialog.propTypes = {};
458
+ FormDialog.displayName = 'FormDialog';
459
+ FormDialog.defaultProps = defaultProps$e;
460
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
461
+ // The Intl messages can be used for button labels.
462
+ FormDialog.Intl = i18n.sharedMessages;
463
+ // Allow consumers who want to use a custom title to reuse the same title styles
464
+ // as the default dialog title.
465
+ FormDialog.TextTitle = TextTitle;
466
+
467
+ const messages$5 = reactIntl.defineMessages({
468
+ back: {
469
+ id: 'Components.ModalPage.TopBar.Back',
470
+ defaultMessage: 'Go Back'
471
+ },
472
+ close: {
473
+ id: 'Components.ModalPage.TopBar.Close',
474
+ defaultMessage: 'Close Modal Page'
475
+ }
476
+ });
477
+
478
+ // Component to have a larger clickable surface
479
+ var _ref2$2 = {
480
+ name: "1rxhroq",
481
+ styles: "display:flex;align-items:center;justify-content:center;&::after{content:'';position:absolute;height:35px;width:48px;top:0;right:0;}"
482
+ } ;
483
+ const LargeIconWrapper = props => jsxRuntime.jsx("span", {
484
+ css: _ref2$2,
485
+ children: /*#__PURE__*/react$1.cloneElement(props.children, {
486
+ size: props.size
487
+ })
488
+ });
489
+
490
+ // NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
491
+ // However, we need to explicitly define this otherwise the prop-types babel plugin
492
+ // does not recognize the object shape.
493
+ LargeIconWrapper.propTypes = {};
494
+ const defaultProps$d = {
495
+ color: 'surface',
496
+ previousPathLabel: messages$5.back,
497
+ hidePathLabel: false
498
+ };
499
+ var _ref$6 = {
500
+ name: "uvw8rn",
501
+ styles: "display:flex;overflow:hidden;button:first-of-type svg{height:12px!important;width:12px!important;}"
502
+ } ;
503
+ const ModalPageTopBar = props => {
504
+ const intl = reactIntl.useIntl();
505
+ return jsxRuntime.jsxs("div", {
506
+ css: /*#__PURE__*/react.css("position:relative;display:flex;align-items:center;justify-content:space-between;padding:", designSystem.designTokens.spacing40, " ", designSystem.designTokens.spacing55, " 0;background-color:", designSystem.designTokens.colorSurface, ";border-bottom:1px solid ", designSystem.designTokens.colorSurface, ";& *+*{margin-left:", designSystem.designTokens.spacingS, ";}p{font-size:12px!important;}" + ("" ), "" ),
507
+ children: [jsxRuntime.jsxs("div", {
508
+ css: _ref$6,
509
+ children: [!props.hidePathLabel && jsxRuntime.jsx(FlatButton__default["default"], {
510
+ tone: "primary",
511
+ label: typeof props.previousPathLabel === 'string' ? props.previousPathLabel : intl.formatMessage(props.previousPathLabel),
512
+ icon: jsxRuntime.jsx(icons.AngleLeftIcon, {
513
+ size: "medium",
514
+ color: "primary"
515
+ }),
516
+ onClick: props.onClose
517
+ }), props.currentPathLabel && jsxRuntime.jsxs(jsxRuntime.Fragment, {
518
+ children: [jsxRuntime.jsx(Text__default["default"].Detail, {
519
+ as: "span",
520
+ children: "/"
521
+ }), jsxRuntime.jsx(Text__default["default"].Detail, {
522
+ as: "span",
523
+ title: props.currentPathLabel,
524
+ truncate: true,
525
+ children: props.currentPathLabel
526
+ })]
527
+ })]
528
+ }), props.onClose && jsxRuntime.jsx(SecondaryIconButton__default["default"], {
529
+ label: intl.formatMessage(messages$5.close),
530
+ onClick: props.onClose,
531
+ icon: jsxRuntime.jsx(LargeIconWrapper, {
532
+ children: jsxRuntime.jsx(icons.CloseIcon, {})
533
+ }),
534
+ size: "40"
535
+ })]
536
+ });
537
+ };
538
+ ModalPageTopBar.propTypes = {};
539
+ ModalPageTopBar.displayName = 'ModalPageTopBar';
540
+ ModalPageTopBar.defaultProps = defaultProps$d;
541
+
542
+ const stylesBySize = {
543
+ '10': {
544
+ width: '600px',
545
+ transitionTime: 200
546
+ },
547
+ '20': {
548
+ width: '900px',
549
+ transitionTime: 200
550
+ },
551
+ '30': {
552
+ width: '1200px',
553
+ transitionTime: 200
554
+ },
555
+ scale: {
556
+ width: '100%',
557
+ transitionTime: 300
558
+ }
559
+ };
560
+ const getContainerStyles = props => /*#__PURE__*/react.css("position:absolute;top:0;right:0;height:100%;width:", props.size !== 'scale' ?
561
+ // In case we're using a specific size, we want it to be used until there's no space left.
562
+ // In such scenario, we want the modal to be as wide as possible, but using the shared indentation width size.
563
+ `min(${stylesBySize[props.size].width}, calc(100% - ${constants.PORTALS_CONTAINER_INDENTATION_SIZE})) !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;" + ("" ), "" );
564
+ const getOverlayStyles = props => /*#__PURE__*/react.css("position:absolute;z-index:", typeof props.zIndex === 'number' ?
565
+ // Use `!important` to overwrite the default value assigned by the Stacking Layer System.
566
+ `${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;" + ("" ), "" );
567
+ var _ref3 = {
568
+ name: "1ffv7m4",
569
+ styles: "transform:translate3d(0, 0, 0)!important"
570
+ } ;
571
+ const getAfterOpenContainerAnimation = () => _ref3;
572
+ var _ref2$1 = {
573
+ name: "1d9ftqx",
574
+ styles: "opacity:1!important"
575
+ } ;
576
+ const getAfterOpenOverlayAnimation = () => _ref2$1;
577
+ const getBeforeCloseContainerAnimation = props => /*#__PURE__*/react.css("transform:translate3d(\n ", props.size !== 'scale' ? stylesBySize[props.size].width : '30px', ",\n ,\n 0,\n 0\n )!important;" + ("" ), "" );
578
+ var _ref$5 = {
579
+ name: "728dx5",
580
+ styles: "opacity:0!important"
581
+ } ;
582
+ const getBeforeCloseOverlayAnimation = () => _ref$5;
583
+
584
+ 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; }
585
+ 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; }
586
+ const getDefaultParentSelector = () => document.querySelector(`#${constants.PORTALS_CONTAINER_ID}`);
587
+ const getOverlayElement = (props, contentElement) =>
588
+ // Assign the `data-role` to the overlay container, which is used as
589
+ // the CSS selector in the `<PortalsContainer>`.
590
+ jsxRuntime.jsx("div", _objectSpread$5(_objectSpread$5({}, props), {}, {
591
+ "data-role": "modal-overlay",
592
+ children: contentElement
593
+ }));
594
+
595
+ // NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
596
+ // However, we need to explicitly define this otherwise the prop-types babel plugin
597
+ // does not recognize the object shape.
598
+
599
+ const defaultProps$c = {
600
+ size: 'scale',
601
+ getParentSelector: getDefaultParentSelector,
602
+ shouldDelayOnClose: true
603
+ };
604
+ const ModalPage = props => {
605
+ const _useState = react$1.useState(false),
606
+ _useState2 = _slicedToArray(_useState, 2),
607
+ forceClose = _useState2[0],
608
+ setForceClose = _useState2[1];
609
+ const closingTimer = react$1.useRef();
610
+ react$1.useEffect(() => {
611
+ if (props.isOpen === true) setForceClose(false);
612
+ return () => {
613
+ if (closingTimer.current) {
614
+ clearTimeout(closingTimer.current);
615
+ }
616
+ };
617
+ }, [props.isOpen]);
618
+ const onClose = props.onClose;
619
+ const TRANSITION_DURATION = stylesBySize[props.size].transitionTime;
620
+ const handleClose = react$1.useCallback(event => {
621
+ if (props.shouldDelayOnClose) {
622
+ // In this case we want the closing animation to be shown
623
+ // and therefore we need wait for it to be completed
624
+ // before calling `onClose`.
625
+ setForceClose(true);
626
+ closingTimer.current = _setTimeout__default["default"](() => {
627
+ onClose && onClose(event);
628
+ }, TRANSITION_DURATION);
629
+ return;
630
+ }
631
+ onClose && onClose(event);
632
+ }, [onClose, props.shouldDelayOnClose, TRANSITION_DURATION]);
633
+ return jsxRuntime.jsx(react.ClassNames, {
634
+ children: _ref => {
635
+ let makeClassName = _ref.css;
636
+ return jsxRuntime.jsxs(Modal__default["default"], {
637
+ isOpen: forceClose === true ? false : props.isOpen,
638
+ onRequestClose: handleClose,
639
+ shouldCloseOnOverlayClick: Boolean(props.onClose),
640
+ shouldCloseOnEsc: Boolean(props.onClose),
641
+ overlayElement: getOverlayElement,
642
+ overlayClassName: {
643
+ base: makeClassName(getOverlayStyles(props)),
644
+ afterOpen: makeClassName(getAfterOpenOverlayAnimation()),
645
+ beforeClose: makeClassName(getBeforeCloseOverlayAnimation())
646
+ },
647
+ className: {
648
+ base: makeClassName(getContainerStyles(props)),
649
+ afterOpen: typeof props.afterOpenStyles === 'string' ? props.afterOpenStyles : makeClassName(props.afterOpenStyles ?? getAfterOpenContainerAnimation()),
650
+ beforeClose: makeClassName(getBeforeCloseContainerAnimation(props))
651
+ },
652
+ contentLabel: props.title,
653
+ parentSelector: props.getParentSelector,
654
+ ariaHideApp: false
655
+ // Adjust this value if the (beforeClose) animation duration is changed
656
+ ,
657
+ closeTimeoutMS: TRANSITION_DURATION,
658
+ style: {
659
+ // stylelint-disable-next-line selector-type-no-unknown
660
+ overlay: {
661
+ zIndex: props.zIndex
662
+ }
663
+ },
664
+ children: [!props.hideTopBar && jsxRuntime.jsx(ModalPageTopBar, {
665
+ color: props.topBarColor,
666
+ onClose: handleClose,
667
+ currentPathLabel: props.currentPathLabel,
668
+ previousPathLabel: props.previousPathLabel,
669
+ hidePathLabel: props.hidePathLabel
670
+ }), props.children]
671
+ });
672
+ }
673
+ });
674
+ };
675
+ ModalPage.propTypes = {};
676
+ ModalPage.displayName = 'ModalPage';
677
+ ModalPage.defaultProps = defaultProps$c;
678
+
679
+ const messages$4 = reactIntl.defineMessages({
680
+ loadError: {
681
+ id: 'CustomViewLoader.error.load',
682
+ defaultMessage: 'We could not load the Custom View. Please contact your administrator to check its configuration.'
683
+ }
684
+ });
685
+
686
+ const isIframeReady = iFrameElementRef => {
687
+ try {
688
+ return iFrameElementRef?.contentWindow?.document.readyState === 'complete';
689
+ } catch {
690
+ // Trying to access the contentWindow of a cross-origin iFrame will throw an error.
691
+ // We are not supposed to even get here because the iFrame must use
692
+ // a URL from our very same domain (the custom view is proxied through our http-proxy service).
693
+ return false;
694
+ }
695
+ };
696
+ const ContentWrapper$2 = /*#__PURE__*/_styled__default["default"]("div", {
697
+ target: "ewwxuwo1"
698
+ } )({
699
+ name: "13udsys",
700
+ styles: "height:100%"
701
+ } );
702
+ const CustomPanelIframe = /*#__PURE__*/_styled__default["default"]("iframe", {
703
+ target: "ewwxuwo0"
704
+ } )({
705
+ name: "174lt7a",
706
+ styles: "height:100%;width:100%;border:none"
707
+ } );
708
+ function CustomViewLoader(props) {
709
+ const iFrameElementRef = react$1.useRef(null);
710
+ const dataLocale = applicationShellConnectors.useApplicationContext(context => context.dataLocale);
711
+ const projectKey = applicationShellConnectors.useApplicationContext(context => context.project?.key);
712
+ const featureFlags = reactBroadcast.useAllFeatureToggles();
713
+ const iFrameCommunicationChannel = react$1.useRef(new MessageChannel());
714
+ const showNotification = actionsGlobal.useShowNotification();
715
+ const intl = reactIntl.useIntl();
716
+ const messageFromIFrameHandler = react$1.useCallback(event => {
717
+ if (event.data.origin === window.location.origin) {
718
+ switch (event.data.eventName) {
719
+ case constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_CLOSE:
720
+ props.onClose();
721
+ break;
722
+ }
723
+ }
724
+ }, [props]);
725
+
726
+ // onLoad handler is called from the iFrame even where the URL is not valid
727
+ // (blocked by CORS, 404, etc.) so we need to make sure the iFrame is ready
728
+ const onLoadSuccessHandler = react$1.useCallback(() => {
729
+ // Show error and block if the iFrame is not ready
730
+ // (error loading it)
731
+ if (!isIframeReady(iFrameElementRef.current)) {
732
+ showNotification({
733
+ domain: constants.DOMAINS.PAGE,
734
+ kind: constants.NOTIFICATION_KINDS_PAGE.error,
735
+ text: intl.formatMessage(messages$4.loadError)
736
+ });
737
+ return;
738
+ }
739
+
740
+ // Listen for messages from the iFrame
741
+ iFrameCommunicationChannel.current.port1.onmessage = messageFromIFrameHandler;
742
+
743
+ // Transfer port2 to the iFrame so it can send messages back privately
744
+ iFrameElementRef.current?.contentWindow?.postMessage(constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_BOOTSTRAP, window.location.href, [iFrameCommunicationChannel.current.port2]);
745
+
746
+ // Send the initialization message to the iFrame
747
+ iFrameCommunicationChannel.current.port1.postMessage({
748
+ source: constants.CUSTOM_VIEWS_EVENTS_META.HOST_APPLICATION_CODE,
749
+ destination: `${constants.CUSTOM_VIEWS_EVENTS_META.CUSTOM_VIEW_KEY_PREFIX}${props.customView.id}`,
750
+ eventName: constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_INITIALIZATION,
751
+ eventData: {
752
+ context: {
753
+ dataLocale,
754
+ projectKey,
755
+ featureFlags,
756
+ customViewConfig: props.customView,
757
+ hostUrl: props.hostUrl || window.location.href
758
+ }
759
+ }
760
+ });
761
+
762
+ // We want the effect to run only once so we don't need the dependencies array.
763
+ // eslint-disable-next-line react-hooks/exhaustive-deps
764
+ }, []);
765
+ react$1.useEffect(() => {
766
+ // Close the channel when the component unmounts
767
+ const communicationChannel = iFrameCommunicationChannel.current;
768
+ return () => {
769
+ communicationChannel?.port1.close();
770
+ };
771
+ }, []);
772
+
773
+ // Currently we only support custom panels
774
+ if (props.customView.type !== 'CustomPanel') {
775
+ sentry.reportErrorToSentry(new Error(`CustomViewLoader: Provided Custom View has an unsupported type: ${props.customView.type}. Supported types: ['CustomPanel'].`));
776
+ return null;
777
+ }
778
+ const panelSize = props.customView.typeSettings?.size?.toLocaleLowerCase() || 'large';
779
+ const iFrameUrl = [window.location.origin, 'custom-views', props.customView.id, 'projects', projectKey].join('/');
780
+ return jsxRuntime.jsx(ModalPage, {
781
+ isOpen: true,
782
+ onClose: props.onClose,
783
+ size: panelSize === 'small' ? 10 : 30,
784
+ title: `Custom View: ${props.customView.defaultLabel}`,
785
+ hideTopBar: true,
786
+ children: jsxRuntime.jsx(ContentWrapper$2, {
787
+ children: jsxRuntime.jsx(CustomPanelIframe, {
788
+ id: `custom-view-${props.customView.id}`,
789
+ title: `Custom View: ${props.customView.defaultLabel}`,
790
+ ref: iFrameElementRef,
791
+ src: iFrameUrl,
792
+ onLoad: onLoadSuccessHandler
793
+ }, `custom-view-${props.customView.id}`)
794
+ })
795
+ });
796
+ }
797
+ CustomViewLoader.propTypes = {};
798
+
799
+ var messages$3 = reactIntl.defineMessages({
800
+ title: {
801
+ id: 'CustomViewsSelector.title',
802
+ defaultMessage: 'Custom Views:'
803
+ }
804
+ });
805
+
806
+ var FetchCustomViewsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchCustomViewsByLocator" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "customViewLocatorCode" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "allCustomViewsInstallationsByLocator" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "locator" }, value: { kind: "Variable", name: { kind: "Name", value: "customViewLocatorCode" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "customView" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "defaultLabel" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "url" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "typeSettings" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "size" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "locators" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "oAuthScopes" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 405, source: { body: "query FetchCustomViewsByLocator($customViewLocatorCode: String!) {\n allCustomViewsInstallationsByLocator(locator: $customViewLocatorCode) {\n id\n customView {\n id\n defaultLabel\n labelAllLocales {\n locale\n value\n }\n url\n type\n typeSettings {\n size\n }\n locators\n permissions {\n name\n oAuthScopes\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
807
+ const useCustomViewsConnector = _ref => {
808
+ let customViewLocatorCode = _ref.customViewLocatorCode;
809
+ const enableCustomViews = reactBroadcast.useFlagVariation(constants.featureFlags.CUSTOM_VIEWS);
810
+ const areCustomViewsEnabled =
811
+ // @ts-ignore In case it's coming from the MC API, it's an object { value: boolean }.
812
+ (enableCustomViews?.value ?? enableCustomViews) && process.env.DISABLE_CUSTOM_VIEWS_FEATURE !== 'true';
813
+ const _useMcQuery = applicationShellConnectors.useMcQuery(FetchCustomViewsQuery, {
814
+ variables: {
815
+ customViewLocatorCode
816
+ },
817
+ context: {
818
+ target: constants.GRAPHQL_TARGETS.SETTINGS_SERVICE
819
+ },
820
+ skip: !areCustomViewsEnabled
821
+ }),
822
+ data = _useMcQuery.data,
823
+ error = _useMcQuery.error,
824
+ loading = _useMcQuery.loading;
825
+ return {
826
+ customViews: data?.allCustomViewsInstallationsByLocator?.map(installation => installation.customView) || [],
827
+ error,
828
+ loading
829
+ };
830
+ };
831
+
832
+ 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; }
833
+ 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; }
834
+ const COMPONENT_HEIGHT = '52px';
835
+ const Wrapper = /*#__PURE__*/_styled__default["default"]("div", {
836
+ target: "e16cb3zv3"
837
+ } )("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', ";" + ("" ));
838
+ const Container$2 = /*#__PURE__*/_styled__default["default"]("div", {
839
+ target: "e16cb3zv2"
840
+ } )("background-color:", designSystem.designTokens.colorNeutral98, ";padding:10px ", designSystem.designTokens.spacing30, ";border:1px solid ", designSystem.designTokens.colorNeutral95, ";border-radius:", designSystem.designTokens.borderRadius8, ";" + ("" ));
841
+ const hoverAndSelectedStateStyles = /*#__PURE__*/react.css("box-shadow:", designSystem.designTokens.shadow1, ";background-color:", designSystem.designTokens.colorSurface, ";color:", designSystem.designTokens.colorPrimary30, ";" + ("" ), "" );
842
+ const CustomViewSelectorItem = props => {
843
+ return jsxRuntime.jsx(AccessibleButton__default["default"], {
844
+ 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, ";}" + ("" ), "" ),
845
+ onClick: props.onClick,
846
+ label: props.label,
847
+ children: jsxRuntime.jsx(Text__default["default"].Detail, {
848
+ tone: "inherit",
849
+ fontWeight: props.selected ? 'bold' : 'regular',
850
+ children: props.label
851
+ })
852
+ });
853
+ };
854
+ CustomViewSelectorItem.propTypes = {};
855
+ const SelectorLabel = /*#__PURE__*/_styled__default["default"]("div", {
856
+ target: "e16cb3zv1"
857
+ } )({
858
+ name: "1i68o0s",
859
+ styles: "display:flex;align-items:center;gap:6px;div{font-weight:300;}"
860
+ } );
861
+ const Separator = /*#__PURE__*/_styled__default["default"]("span", {
862
+ target: "e16cb3zv0"
863
+ } )({
864
+ name: "1lsblg0",
865
+ styles: "width:1px;height:18px;background-color:#cccccc"
866
+ } );
867
+ function CustomViewSelector(props) {
868
+ const _useState = react$1.useState(null),
869
+ _useState2 = _slicedToArray(_useState, 2),
870
+ selectedCustomView = _useState2[0],
871
+ setSelectedCustomView = _useState2[1];
872
+ const _useCustomViewsConnec = useCustomViewsConnector({
873
+ customViewLocatorCode: props.customViewLocatorCode
874
+ }),
875
+ customViews = _useCustomViewsConnec.customViews,
876
+ error = _useCustomViewsConnec.error,
877
+ loading = _useCustomViewsConnec.loading;
878
+ const onCustomViewsResolved = props.onCustomViewsResolved;
879
+ react$1.useEffect(() => {
880
+ if (!loading && !error && onCustomViewsResolved) {
881
+ onCustomViewsResolved(customViews);
882
+ }
883
+ }, [customViews, error, loading, onCustomViewsResolved]);
884
+ if (error) {
885
+ sentry.reportErrorToSentry(error, {
886
+ extra: {
887
+ customViewLocatorCode: props.customViewLocatorCode
888
+ }
889
+ });
890
+ return null;
891
+ }
892
+ return jsxRuntime.jsx(Wrapper, {
893
+ shouldRender: customViews.length > 0,
894
+ margin: props.margin || '0',
895
+ children: jsxRuntime.jsx(Container$2, {
896
+ children: jsxRuntime.jsxs(Constraints__default["default"].Horizontal, {
897
+ max: "scale",
898
+ children: [jsxRuntime.jsxs(Spacings__default["default"].Inline, {
899
+ scale: "s",
900
+ justifyContent: "flex-start",
901
+ alignItems: "center",
902
+ children: [jsxRuntime.jsxs(SelectorLabel, {
903
+ children: [jsxRuntime.jsx(icons.WindowEyeIcon, {
904
+ size: "medium",
905
+ color: "neutral60"
906
+ }), jsxRuntime.jsx(Text__default["default"].Detail, {
907
+ tone: "secondary",
908
+ intlMessage: messages$3.title
909
+ })]
910
+ }), _mapInstanceProperty__default["default"](customViews).call(customViews, (customView, index) => {
911
+ const isNotLastItem = index !== customViews.length - 1;
912
+ return jsxRuntime.jsxs(react$1.Fragment, {
913
+ children: [jsxRuntime.jsx(CustomViewSelectorItem, {
914
+ selected: selectedCustomView?.id === customView.id,
915
+ onClick: () => {
916
+ setSelectedCustomView(customView);
917
+ },
918
+ label: customView.defaultLabel
919
+ }), isNotLastItem && jsxRuntime.jsx(Separator, {})]
920
+ }, customView.id);
921
+ })]
922
+ }), selectedCustomView && jsxRuntime.jsx(CustomViewLoader, {
923
+ customView: selectedCustomView,
924
+ onClose: () => {
925
+ setSelectedCustomView(null);
926
+ }
927
+ })]
928
+ })
929
+ })
930
+ });
931
+ }
932
+ CustomViewSelector.propTypes = {};
933
+ CustomViewSelector.displayName = 'CustomViewSelector';
934
+ const CustomViewSelectorOrNothing = props => {
935
+ if (!props.customViewLocatorCode) {
936
+ return null;
937
+ }
938
+ return jsxRuntime.jsx(CustomViewSelector, _objectSpread$4(_objectSpread$4({}, props), {}, {
939
+ customViewLocatorCode: props.customViewLocatorCode
940
+ }));
941
+ };
942
+ CustomViewSelectorOrNothing.propTypes = {};
943
+
944
+ const defaultProps$b = {
945
+ titleSize: 'small',
946
+ truncate: false
947
+ };
948
+ const SubtitleWrapper = /*#__PURE__*/_styled__default["default"]("div", {
949
+ target: "epaiodd0"
950
+ } )("margin-top:", designSystem.designTokens.spacing20, ";" + ("" ));
951
+ const Title = props => {
952
+ switch (props.titleSize) {
953
+ case 'big':
954
+ return jsxRuntime.jsx(Text__default["default"].Headline, {
955
+ as: "h1",
956
+ title: props.title,
957
+ truncate: props.truncate,
958
+ children: props.title
959
+ });
960
+ case 'medium':
961
+ return jsxRuntime.jsx(Text__default["default"].Headline, {
962
+ as: "h2",
963
+ title: props.title,
964
+ truncate: props.truncate,
965
+ children: props.title
966
+ });
967
+ default:
968
+ return jsxRuntime.jsx(Text__default["default"].Subheadline, {
969
+ as: "h4",
970
+ title: props.title,
971
+ truncate: props.truncate,
972
+ children: props.title
973
+ });
974
+ }
975
+ };
976
+ const Subtitle = props => {
977
+ if (!props.subtitle) {
978
+ return null;
979
+ }
980
+ if ( /*#__PURE__*/react$1.isValidElement(props.subtitle)) {
981
+ return jsxRuntime.jsx(SubtitleWrapper, {
982
+ children: props.subtitle
983
+ });
984
+ }
985
+ return jsxRuntime.jsx(SubtitleWrapper, {
986
+ children: jsxRuntime.jsx(Text__default["default"].Body, {
987
+ title: typeof props.subtitle === 'string' ? props.subtitle : undefined,
988
+ truncate: props.truncate,
989
+ tone: "secondary",
990
+ children: props.subtitle
991
+ })
992
+ });
993
+ };
994
+ Subtitle.propTypes = {};
995
+ Subtitle.defaultProps = {
996
+ truncate: false
997
+ };
998
+ var _ref$4 = {
999
+ name: "d3v9zr",
1000
+ styles: "overflow:hidden"
1001
+ } ;
1002
+ const PageHeaderTitle = props => jsxRuntime.jsxs("div", {
1003
+ css: _ref$4,
1004
+ children: [jsxRuntime.jsx(Title, {
1005
+ title: props.title,
1006
+ titleSize: props.titleSize,
1007
+ truncate: props.truncate
1008
+ }), jsxRuntime.jsx(Subtitle, {
1009
+ subtitle: props.subtitle,
1010
+ truncate: props.truncate
1011
+ })]
1012
+ });
1013
+ PageHeaderTitle.propTypes = {};
1014
+ PageHeaderTitle.displayName = 'PageHeaderTitle';
1015
+ PageHeaderTitle.defaultProps = defaultProps$b;
1016
+
1017
+ const PageHeader = props => {
1018
+ return jsxRuntime.jsxs("div", {
1019
+ css: /*#__PURE__*/react.css("margin:0 ", designSystem.designTokens.spacing55, ";padding:", designSystem.designTokens.spacing40, " 0 ", designSystem.designTokens.spacing40, ";border-bottom:1px solid ", designSystem.designTokens.colorNeutral90, ";" + ("" ), "" ),
1020
+ children: [jsxRuntime.jsxs("div", {
1021
+ css: /*#__PURE__*/react.css("display:flex;align-items:flex-end;justify-content:space-between;&>*+*{margin-left:", designSystem.designTokens.spacing50, ";}" + ("" ), "" ),
1022
+ children: [jsxRuntime.jsx(PageHeaderTitle, {
1023
+ title: props.title,
1024
+ titleSize: "big",
1025
+ subtitle: props.subtitle,
1026
+ truncate: true
1027
+ }), props.children]
1028
+ }), jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1029
+ margin: `${designSystem.designTokens.spacing40} 0 0 0`,
1030
+ customViewLocatorCode: props.customViewLocatorCode
1031
+ })]
1032
+ });
1033
+ };
1034
+ PageHeader.propTypes = {};
1035
+ PageHeader.displayName = 'PageHeader';
1036
+
1037
+ const ContentWrapper$1 = /*#__PURE__*/_styled__default["default"]("div", {
1038
+ target: "e1b7jwn02"
1039
+ } )("flex:1;flex-basis:0;overflow:auto;margin:", designTokens.marginForPageContent, ";" + ("" ));
1040
+ const ModalContentWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1041
+ target: "e1b7jwn01"
1042
+ } )("flex:1;flex-basis:0;overflow:auto;margin:", designSystem.designTokens.spacing50, " ", designSystem.designTokens.spacing55, ";" + ("" ));
1043
+ const PageWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1044
+ target: "e1b7jwn00"
1045
+ } )({
1046
+ name: "kdbhus",
1047
+ styles: "height:100%;display:flex;flex-direction:column"
1048
+ } );
1049
+
1050
+ const InfoModalPage = props => jsxRuntime.jsxs(ModalPage, {
1051
+ title: props.title,
1052
+ isOpen: props.isOpen,
1053
+ zIndex: props.zIndex,
1054
+ onClose: props.onClose,
1055
+ currentPathLabel: props.topBarCurrentPathLabel || props.title,
1056
+ previousPathLabel: props.topBarPreviousPathLabel,
1057
+ shouldDelayOnClose: props.shouldDelayOnClose,
1058
+ getParentSelector: props.getParentSelector,
1059
+ afterOpenStyles: props.afterOpenStyles,
1060
+ children: [jsxRuntime.jsx(PageHeader, {
1061
+ title: props.title,
1062
+ subtitle: props.subtitle,
1063
+ customViewLocatorCode: props.customViewLocatorCode
1064
+ }), jsxRuntime.jsx(ModalContentWrapper, {
1065
+ children: props.children
1066
+ })]
1067
+ });
1068
+ InfoModalPage.propTypes = {};
1069
+ InfoModalPage.displayName = 'InfoModalPage';
1070
+
1071
+ 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; }
1072
+ 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; }
1073
+ const primaryDefaultProps = {
1074
+ label: i18n.sharedMessages.confirm,
1075
+ isDisabled: false,
1076
+ dataAttributes: {}
1077
+ };
1078
+ const useFormattedLabel = label => {
1079
+ const intl = reactIntl.useIntl();
1080
+ return typeof label === 'string' ? label : intl.formatMessage(label);
1081
+ };
1082
+ const FormPrimaryButton = props => {
1083
+ const label = useFormattedLabel(props.label);
1084
+ return jsxRuntime.jsx(PrimaryButton__default["default"], _objectSpread$3({
1085
+ label: label,
1086
+ onClick: props.onClick,
1087
+ isDisabled: props.isDisabled,
1088
+ iconLeft: props.iconLeft
1089
+ }, filterDataAttributes(props.dataAttributes)));
1090
+ };
1091
+ FormPrimaryButton.propTypes = {};
1092
+ FormPrimaryButton.displayName = 'FormPrimaryButton';
1093
+ FormPrimaryButton.defaultProps = primaryDefaultProps;
1094
+ const secondaryDefaultProps = {
1095
+ label: i18n.sharedMessages.cancel,
1096
+ isDisabled: false,
1097
+ dataAttributes: {}
1098
+ };
1099
+ const FormSecondaryButton = props => {
1100
+ const label = useFormattedLabel(props.label);
1101
+ return jsxRuntime.jsx(SecondaryButton__default["default"], _objectSpread$3({
1102
+ label: label,
1103
+ onClick: props.onClick,
1104
+ isDisabled: props.isDisabled,
1105
+ iconLeft: props.iconLeft
1106
+ }, filterDataAttributes(props.dataAttributes)));
1107
+ };
1108
+ FormSecondaryButton.propTypes = {};
1109
+ FormSecondaryButton.displayName = 'FormSecondaryButton';
1110
+ FormSecondaryButton.defaultProps = secondaryDefaultProps;
1111
+ const deleteDefaultProps = {
1112
+ label: i18n.sharedMessages.delete,
1113
+ isDisabled: false,
1114
+ dataAttributes: {}
1115
+ };
1116
+ const FormDeleteButton = props => {
1117
+ const label = useFormattedLabel(props.label);
1118
+ return jsxRuntime.jsx(IconButton__default["default"], _objectSpread$3({
1119
+ icon: jsxRuntime.jsx(icons.BinLinearIcon, {}),
1120
+ label: label,
1121
+ onClick: props.onClick,
1122
+ isDisabled: props.isDisabled
1123
+ }, filterDataAttributes(props.dataAttributes)));
1124
+ };
1125
+ FormDeleteButton.propTypes = {};
1126
+ FormDeleteButton.displayName = 'FormDeleteButton';
1127
+ FormDeleteButton.defaultProps = deleteDefaultProps;
1128
+
1129
+ const CustomFormModalPage = props => jsxRuntime.jsxs(ModalPage, {
1130
+ title: props.title,
1131
+ isOpen: props.isOpen,
1132
+ zIndex: props.zIndex,
1133
+ onClose: props.onClose,
1134
+ currentPathLabel: props.topBarCurrentPathLabel || props.title,
1135
+ previousPathLabel: props.topBarPreviousPathLabel,
1136
+ getParentSelector: props.getParentSelector,
1137
+ shouldDelayOnClose: props.shouldDelayOnClose,
1138
+ afterOpenStyles: props.afterOpenStyles,
1139
+ children: [jsxRuntime.jsx(PageHeader, {
1140
+ title: props.title,
1141
+ subtitle: props.subtitle,
1142
+ customViewLocatorCode: props.customViewLocatorCode,
1143
+ children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
1144
+ alignItems: "flex-end",
1145
+ children: props.formControls
1146
+ })
1147
+ }), jsxRuntime.jsx(ModalContentWrapper, {
1148
+ children: props.children
1149
+ })]
1150
+ });
1151
+ CustomFormModalPage.propTypes = {};
1152
+ CustomFormModalPage.displayName = 'CustomFormModalPage';
1153
+ // Static export of pre-configured form control buttons to easily re-use
1154
+ // them in the custom controls.
1155
+ CustomFormModalPage.FormPrimaryButton = FormPrimaryButton;
1156
+ CustomFormModalPage.FormSecondaryButton = FormSecondaryButton;
1157
+ CustomFormModalPage.FormDeleteButton = FormDeleteButton;
1158
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1159
+ // The Intl messages can be used for button labels.
1160
+ CustomFormModalPage.Intl = i18n.sharedMessages;
1161
+
1162
+ const defaultProps$a = {
1163
+ hideControls: false
1164
+ };
1165
+ const FormModalPage = props => jsxRuntime.jsx(CustomFormModalPage, {
1166
+ title: props.title,
1167
+ subtitle: props.subtitle,
1168
+ isOpen: props.isOpen,
1169
+ zIndex: props.zIndex,
1170
+ onClose: props.onClose,
1171
+ topBarCurrentPathLabel: props.topBarCurrentPathLabel,
1172
+ topBarPreviousPathLabel: props.topBarPreviousPathLabel,
1173
+ getParentSelector: props.getParentSelector,
1174
+ shouldDelayOnClose: props.shouldDelayOnClose,
1175
+ hideControls: props.hideControls,
1176
+ afterOpenStyles: props.afterOpenStyles,
1177
+ formControls: jsxRuntime.jsxs(jsxRuntime.Fragment, {
1178
+ children: [jsxRuntime.jsx(CustomFormModalPage.FormSecondaryButton, {
1179
+ label: props.labelSecondaryButton,
1180
+ onClick: props.onSecondaryButtonClick,
1181
+ isDisabled: props.isSecondaryButtonDisabled,
1182
+ dataAttributes: props.dataAttributesSecondaryButton,
1183
+ iconLeft: props.iconLeftSecondaryButton
1184
+ }), jsxRuntime.jsx(CustomFormModalPage.FormPrimaryButton, {
1185
+ label: props.labelPrimaryButton,
1186
+ onClick: props.onPrimaryButtonClick,
1187
+ isDisabled: props.isPrimaryButtonDisabled,
1188
+ dataAttributes: props.dataAttributesPrimaryButton
1189
+ })]
1190
+ }),
1191
+ customViewLocatorCode: props.customViewLocatorCode,
1192
+ children: props.children
1193
+ });
1194
+ FormModalPage.propTypes = {};
1195
+ FormModalPage.displayName = 'FormModalPage';
1196
+ FormModalPage.defaultProps = defaultProps$a;
1197
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1198
+ // The Intl messages can be used for button labels.
1199
+ FormModalPage.Intl = i18n.sharedMessages;
1200
+
1201
+ const pathWithoutSearch = path => typeof path === 'string' ? path.split('?')[0] : path.pathname;
1202
+ const useCustomViewLocatorSelector = function () {
1203
+ var _context;
1204
+ let customViewLocatorCodes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1205
+ const location = reactRouterDom.useLocation();
1206
+ const customViewLocator = _findInstanceProperty__default["default"](_context = _Object$entries__default["default"](customViewLocatorCodes)).call(_context, _ref => {
1207
+ let _ref2 = _slicedToArray(_ref, 2),
1208
+ locator = _ref2[1];
1209
+ return reactRouterDom.matchPath(location.pathname, {
1210
+ // strip the search, otherwise the path won't match
1211
+ path: pathWithoutSearch(locator),
1212
+ exact: true,
1213
+ strict: false
1214
+ });
1215
+ });
1216
+ return {
1217
+ currentCustomViewLocatorCode: customViewLocator?.[0]
1218
+ };
1219
+ };
1220
+
1221
+ const TabControls = /*#__PURE__*/_styled__default["default"]("div", {
1222
+ target: "elpldre4"
1223
+ } )("margin-top:", designSystem.designTokens.spacingS, ";" + ("" ));
1224
+ const ControlsContainter = props => jsxRuntime.jsxs("div", {
1225
+ css: /*#__PURE__*/react.css("display:flex;align-items:flex-end;justify-content:space-between;margin-top:", designSystem.designTokens.spacing40, ";" + ("" ), "" ),
1226
+ children: [jsxRuntime.jsx(TabControls, {
1227
+ role: "tablist",
1228
+ children: props.tabControls
1229
+ }), props.formControls]
1230
+ });
1231
+ ControlsContainter.propTypes = {};
1232
+ ControlsContainter.displayName = 'ControlsContainter';
1233
+ const TabularPageContainer = /*#__PURE__*/_styled__default["default"]("div", {
1234
+ target: "elpldre3"
1235
+ } )("background-color:", designSystem.designTokens.colorSurface, ";padding:", designTokens.paddingForTabularPageHeader, ";border-bottom:1px solid ", designSystem.designTokens.colorNeutral90, ";" + ("" ));
1236
+ const FormControlsContainer = /*#__PURE__*/_styled__default["default"]("div", {
1237
+ target: "elpldre2"
1238
+ } )("margin-bottom:", designSystem.designTokens.spacingM, ";" + ("" ));
1239
+ const CustomViewsSelectorWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1240
+ target: "elpldre1"
1241
+ } )("margin:", designTokens.marginForCustomViewsSelectorAsTabular, ";" + ("" ));
1242
+ const TabularModalPageContainer = /*#__PURE__*/_styled__default["default"]("div", {
1243
+ target: "elpldre0"
1244
+ } )(TabularPageContainer, "{padding:", designSystem.designTokens.spacing40, " ", designSystem.designTokens.spacing55, " 0;}" + ("" ));
1245
+
1246
+ const defaultProps$9 = {
1247
+ hideControls: false
1248
+ };
1249
+ const TabularModalPage = props => {
1250
+ const _useCustomViewLocator = useCustomViewLocatorSelector(props.customViewLocatorCodes),
1251
+ currentCustomViewLocatorCode = _useCustomViewLocator.currentCustomViewLocatorCode;
1252
+ return jsxRuntime.jsxs(ModalPage, {
1253
+ title: props.title,
1254
+ isOpen: props.isOpen,
1255
+ zIndex: props.zIndex,
1256
+ onClose: props.onClose,
1257
+ topBarColor: "neutral",
1258
+ currentPathLabel: props.topBarCurrentPathLabel || props.title,
1259
+ previousPathLabel: props.topBarPreviousPathLabel,
1260
+ getParentSelector: props.getParentSelector,
1261
+ shouldDelayOnClose: props.shouldDelayOnClose,
1262
+ afterOpenStyles: props.afterOpenStyles,
1263
+ children: [jsxRuntime.jsx(TabularModalPageContainer, {
1264
+ children: jsxRuntime.jsxs(TabularPageContainer, {
1265
+ children: [props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
1266
+ title: props.title,
1267
+ titleSize: "big",
1268
+ subtitle: props.subtitle,
1269
+ truncate: true
1270
+ }), jsxRuntime.jsx(ControlsContainter, {
1271
+ tabControls: props.tabControls,
1272
+ formControls: jsxRuntime.jsx(FormControlsContainer, {
1273
+ children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
1274
+ alignItems: "flex-end",
1275
+ children: props.formControls
1276
+ })
1277
+ })
1278
+ })]
1279
+ })
1280
+ }), jsxRuntime.jsx(CustomViewsSelectorWrapper, {
1281
+ children: jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1282
+ margin: `${designSystem.designTokens.spacing30} 0 0 0`,
1283
+ customViewLocatorCode: currentCustomViewLocatorCode
1284
+ })
1285
+ }), jsxRuntime.jsx(ModalContentWrapper, {
1286
+ children: props.children
1287
+ })]
1288
+ });
1289
+ };
1290
+ TabularModalPage.propTypes = {};
1291
+ TabularModalPage.displayName = 'TabularModalPage';
1292
+ TabularModalPage.defaultProps = defaultProps$9;
1293
+ // Static export of pre-configured form control buttons to easily re-use
1294
+ // them in the custom controls.
1295
+ TabularModalPage.FormPrimaryButton = FormPrimaryButton;
1296
+ TabularModalPage.FormSecondaryButton = FormSecondaryButton;
1297
+ TabularModalPage.FormDeleteButton = FormDeleteButton;
1298
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1299
+ // The Intl messages can be used for button labels.
1300
+ TabularModalPage.Intl = i18n.sharedMessages;
1301
+
1302
+ const defaultProps$8 = {
1303
+ color: 'surface',
1304
+ previousPathLabel: messages$5.back
1305
+ };
1306
+ const PageTopBar = props => {
1307
+ const intl = reactIntl.useIntl();
1308
+ return jsxRuntime.jsx("div", {
1309
+ css: /*#__PURE__*/react.css("position:relative;display:flex;align-items:center;justify-content:space-between;margin-bottom:", designSystem.designTokens.spacing40, ";background-color:", designSystem.designTokens.colorSurface, ";" + ("" ), "" ),
1310
+ children: jsxRuntime.jsx(FlatButton__default["default"], {
1311
+ tone: "primary",
1312
+ label: typeof props.previousPathLabel === 'string' ? props.previousPathLabel : intl.formatMessage(props.previousPathLabel),
1313
+ icon: jsxRuntime.jsx(icons.ListIcon, {
1314
+ size: "medium",
1315
+ color: "primary"
1316
+ }),
1317
+ onClick: props.onClick
1318
+ })
1319
+ });
1320
+ };
1321
+ PageTopBar.propTypes = {};
1322
+ PageTopBar.displayName = 'PageTopBar';
1323
+ PageTopBar.defaultProps = defaultProps$8;
1324
+
1325
+ const DetailPageContainer = /*#__PURE__*/_styled__default["default"]("div", {
1326
+ target: "etkdonc1"
1327
+ } )("background-color:", designSystem.designTokens.colorSurface, ";padding:", designTokens.paddingForDetailPageHeader, ";border-bottom:1px ", designSystem.designTokens.colorNeutral90, " solid;" + ("" ));
1328
+ const HeaderControlsWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1329
+ target: "etkdonc0"
1330
+ } )("margin-top:", designSystem.designTokens.spacingS, ";" + ("" ));
1331
+ const getCustomViewsSelectorMargin = hasContentBelow => `${designSystem.designTokens.spacing40} 0 ${hasContentBelow ? designSystem.designTokens.spacing40 : '0'} 0`;
1332
+
1333
+ // NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
1334
+ // However, we need to explicitly define this otherwise the prop-types babel plugin
1335
+ // does not recognize the object shape.
1336
+
1337
+ const defaultProps$7 = {
1338
+ hideControls: false
1339
+ };
1340
+ const CustomFormDetailPage = props => {
1341
+ return jsxRuntime.jsxs(PageWrapper, {
1342
+ children: [jsxRuntime.jsxs(DetailPageContainer, {
1343
+ children: [jsxRuntime.jsx(PageTopBar, {
1344
+ color: "neutral",
1345
+ previousPathLabel: props.previousPathLabel,
1346
+ onClick: props.onPreviousPathClick
1347
+ }), props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
1348
+ title: props.title ?? '',
1349
+ subtitle: props.subtitle,
1350
+ titleSize: "big"
1351
+ }), jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1352
+ margin: getCustomViewsSelectorMargin(!props.hideControls && !!props.formControls),
1353
+ customViewLocatorCode: props.customViewLocatorCode
1354
+ }), !props.hideControls && props.formControls && jsxRuntime.jsx(HeaderControlsWrapper, {
1355
+ children: jsxRuntime.jsx(Spacings__default["default"].Inline, {
1356
+ justifyContent: "flex-end",
1357
+ children: props.formControls
1358
+ })
1359
+ })]
1360
+ }), jsxRuntime.jsx(ContentWrapper$1, {
1361
+ children: props.children
1362
+ })]
1363
+ });
1364
+ };
1365
+ CustomFormDetailPage.propTypes = {};
1366
+ CustomFormDetailPage.displayName = 'CustomFormDetailPage';
1367
+ CustomFormDetailPage.defaultProps = defaultProps$7;
1368
+ // Static export of pre-configured page header title component to easily
1369
+ // use as part of a custom title row
1370
+ CustomFormDetailPage.PageHeaderTitle = PageHeaderTitle;
1371
+ // Static export of pre-configured form control buttons to easily re-use
1372
+ // them in the custom controls.
1373
+ CustomFormDetailPage.FormPrimaryButton = FormPrimaryButton;
1374
+ CustomFormDetailPage.FormSecondaryButton = FormSecondaryButton;
1375
+ CustomFormDetailPage.FormDeleteButton = FormDeleteButton;
1376
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1377
+ // The Intl messages can be used for button labels.
1378
+ CustomFormDetailPage.Intl = i18n.sharedMessages;
1379
+
1380
+ const defaultProps$6 = {
1381
+ hideControls: false
1382
+ };
1383
+ const FormDetailPage = props => jsxRuntime.jsx(CustomFormDetailPage, {
1384
+ title: props.title,
1385
+ subtitle: props.subtitle,
1386
+ customTitleRow: props.customTitleRow,
1387
+ customViewLocatorCode: props.customViewLocatorCode,
1388
+ previousPathLabel: props.previousPathLabel,
1389
+ onPreviousPathClick: props.onPreviousPathClick,
1390
+ hideControls: props.hideControls,
1391
+ formControls: jsxRuntime.jsxs(jsxRuntime.Fragment, {
1392
+ children: [jsxRuntime.jsx(CustomFormDetailPage.FormSecondaryButton, {
1393
+ label: props.labelSecondaryButton,
1394
+ onClick: props.onSecondaryButtonClick,
1395
+ isDisabled: props.isSecondaryButtonDisabled,
1396
+ dataAttributes: props.dataAttributesSecondaryButton,
1397
+ iconLeft: props.iconLeftSecondaryButton
1398
+ }), jsxRuntime.jsx(CustomFormDetailPage.FormPrimaryButton, {
1399
+ label: props.labelPrimaryButton,
1400
+ onClick: props.onPrimaryButtonClick,
1401
+ isDisabled: props.isPrimaryButtonDisabled,
1402
+ dataAttributes: props.dataAttributesPrimaryButton
1403
+ })]
1404
+ }),
1405
+ children: props.children
1406
+ });
1407
+ FormDetailPage.propTypes = {};
1408
+ FormDetailPage.displayName = 'FormDetailPage';
1409
+ FormDetailPage.defaultProps = defaultProps$6;
1410
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1411
+ // The Intl messages can be used for button labels.
1412
+ // Static export of pre-configured page header title component to easily
1413
+ // use as part of a custom title row
1414
+ FormDetailPage.PageHeaderTitle = PageHeaderTitle;
1415
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1416
+ // The Intl messages can be used for button labels.
1417
+ FormDetailPage.Intl = i18n.sharedMessages;
1418
+
1419
+ const InfoDetailPage = props => jsxRuntime.jsx(CustomFormDetailPage, {
1420
+ title: props.title,
1421
+ subtitle: props.subtitle,
1422
+ customTitleRow: props.customTitleRow,
1423
+ previousPathLabel: props.previousPathLabel,
1424
+ customViewLocatorCode: props.customViewLocatorCode,
1425
+ onPreviousPathClick: props.onPreviousPathClick,
1426
+ children: props.children
1427
+ });
1428
+ InfoDetailPage.propTypes = {};
1429
+ InfoDetailPage.displayName = 'InfoDetailPage';
1430
+ // Static export of pre-configured page header title component to easily
1431
+ // use as part of a custom title row
1432
+ InfoDetailPage.PageHeaderTitle = PageHeaderTitle;
1433
+
1434
+ const defaultProps$5 = {
1435
+ hideControls: false
1436
+ };
1437
+ const TabularDetailPage = props => {
1438
+ const _useCustomViewLocator = useCustomViewLocatorSelector(props.customViewLocatorCodes),
1439
+ currentCustomViewLocatorCode = _useCustomViewLocator.currentCustomViewLocatorCode;
1440
+ return jsxRuntime.jsxs(PageWrapper, {
1441
+ children: [jsxRuntime.jsxs(TabularPageContainer, {
1442
+ children: [jsxRuntime.jsx(PageTopBar, {
1443
+ color: "neutral",
1444
+ previousPathLabel: props.previousPathLabel,
1445
+ onClick: props.onPreviousPathClick
1446
+ }), props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
1447
+ title: props.title ?? '',
1448
+ subtitle: props.subtitle,
1449
+ titleSize: "big"
1450
+ }), jsxRuntime.jsx(ControlsContainter, {
1451
+ tabControls: props.tabControls,
1452
+ formControls: jsxRuntime.jsx(FormControlsContainer, {
1453
+ children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
1454
+ alignItems: "flex-end",
1455
+ children: props.formControls
1456
+ })
1457
+ })
1458
+ })]
1459
+ }), jsxRuntime.jsx(CustomViewsSelectorWrapper, {
1460
+ children: jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1461
+ margin: `${designSystem.designTokens.spacing30} 0 0 0`,
1462
+ customViewLocatorCode: currentCustomViewLocatorCode
1463
+ })
1464
+ }), jsxRuntime.jsx(ContentWrapper$1, {
1465
+ children: props.children
1466
+ })]
1467
+ });
1468
+ };
1469
+ TabularDetailPage.propTypes = {};
1470
+ TabularDetailPage.displayName = 'TabularDetailPage';
1471
+ TabularDetailPage.defaultProps = defaultProps$5;
1472
+ // Static export of pre-configured form control buttons to easily re-use
1473
+ // them in the custom controls.
1474
+ TabularDetailPage.FormPrimaryButton = FormPrimaryButton;
1475
+ TabularDetailPage.FormSecondaryButton = FormSecondaryButton;
1476
+ TabularDetailPage.FormDeleteButton = FormDeleteButton;
1477
+ // Static export of pre-configured page header title component to easily
1478
+ // use as part of a custom title row
1479
+ TabularDetailPage.PageHeaderTitle = PageHeaderTitle;
1480
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1481
+ TabularDetailPage.Intl = i18n.sharedMessages;
1482
+
1483
+ const PublicPageLayout = /*#__PURE__*/react$1.lazy(() => Promise.resolve().then(function () { return require('./public-page-layout-d365f38f.cjs.prod.js' /* webpackChunkName: "public-page-layout" */); }));
1484
+
1485
+ const MainPageContainer = /*#__PURE__*/_styled__default["default"]("div", {
1486
+ target: "ev8m2jf2"
1487
+ } )("padding:", designTokens.paddingForMainPageHeader, ";" + ("" ));
1488
+ const Divider = /*#__PURE__*/_styled__default["default"]("hr", {
1489
+ target: "ev8m2jf1"
1490
+ } )("background-color:", designSystem.designTokens.colorNeutral90, ";height:1px;border:0;" + ("" ));
1491
+
1492
+ // NOTE: do not change "margin" to "padding" as this breaks sticky DataTable styles
1493
+ const MainPageContent = /*#__PURE__*/_styled__default["default"]("div", {
1494
+ target: "ev8m2jf0"
1495
+ } )("flex:1;flex-basis:0;overflow:auto;margin:", designTokens.marginForPageContent, ";" + ("" ));
1496
+
1497
+ const headerRowMargin = `${designSystem.designTokens.spacing40} 0 0 0`;
1498
+ const CustomFormMainPage = props => {
1499
+ return jsxRuntime.jsxs(PageWrapper, {
1500
+ children: [jsxRuntime.jsxs(MainPageContainer, {
1501
+ children: [props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
1502
+ title: props.title ?? '',
1503
+ subtitle: props.subtitle,
1504
+ titleSize: "big"
1505
+ }), jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1506
+ margin: headerRowMargin,
1507
+ customViewLocatorCode: props.customViewLocatorCode
1508
+ }), !props.hideControls && props.formControls && jsxRuntime.jsx("div", {
1509
+ css: /*#__PURE__*/react.css("margin:", headerRowMargin, ";" + ("" ), "" ),
1510
+ children: jsxRuntime.jsx(Spacings__default["default"].Inline, {
1511
+ justifyContent: "flex-end",
1512
+ children: props.formControls
1513
+ })
1514
+ }), !props.hideDivider && jsxRuntime.jsx("div", {
1515
+ css: /*#__PURE__*/react.css("&>", Divider, "{margin:", headerRowMargin, ";}" + ("" ), "" ),
1516
+ children: jsxRuntime.jsx(Divider, {})
1517
+ })]
1518
+ }), jsxRuntime.jsx(MainPageContent, {
1519
+ children: props.children
1520
+ })]
1521
+ });
1522
+ };
1523
+ CustomFormMainPage.propTypes = {};
1524
+ const defaultProps$4 = {
1525
+ hideControls: false,
1526
+ hideDivider: false
1527
+ };
1528
+ CustomFormMainPage.displayName = 'CustomFormMainPage';
1529
+ CustomFormMainPage.defaultProps = defaultProps$4;
1530
+
1531
+ // Static export of pre-configured page header title component to easily
1532
+ // use as part of a custom title row
1533
+ CustomFormMainPage.PageHeaderTitle = PageHeaderTitle;
1534
+
1535
+ // Static export of pre-configured form control buttons to easily re-use
1536
+ // them in the custom controls.
1537
+ CustomFormMainPage.FormPrimaryButton = FormPrimaryButton;
1538
+ CustomFormMainPage.FormSecondaryButton = FormSecondaryButton;
1539
+ CustomFormMainPage.FormDeleteButton = FormDeleteButton;
1540
+
1541
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1542
+ // The Intl messages can be used for button labels.
1543
+ CustomFormMainPage.Intl = i18n.sharedMessages;
1544
+
1545
+ const defaultProps$3 = {
1546
+ hideControls: false
1547
+ };
1548
+ const FormMainPage = props => {
1549
+ return jsxRuntime.jsx(CustomFormMainPage, {
1550
+ title: props.title,
1551
+ subtitle: props.subtitle,
1552
+ customTitleRow: props.customTitleRow,
1553
+ customViewLocatorCode: props.customViewLocatorCode,
1554
+ hideControls: props.hideControls,
1555
+ formControls: jsxRuntime.jsxs(jsxRuntime.Fragment, {
1556
+ children: [jsxRuntime.jsx(CustomFormMainPage.FormSecondaryButton, {
1557
+ label: props.labelSecondaryButton,
1558
+ onClick: props.onSecondaryButtonClick,
1559
+ isDisabled: props.isSecondaryButtonDisabled,
1560
+ dataAttributes: props.dataAttributesSecondaryButton,
1561
+ iconLeft: props.iconLeftSecondaryButton
1562
+ }), jsxRuntime.jsx(CustomFormMainPage.FormPrimaryButton, {
1563
+ label: props.labelPrimaryButton,
1564
+ onClick: props.onPrimaryButtonClick,
1565
+ isDisabled: props.isPrimaryButtonDisabled,
1566
+ dataAttributes: props.dataAttributesPrimaryButton
1567
+ })]
1568
+ }),
1569
+ children: props.children
1570
+ });
1571
+ };
1572
+ FormMainPage.propTypes = {};
1573
+ FormMainPage.displayName = 'FormMainPage';
1574
+ FormMainPage.defaultProps = defaultProps$3;
1575
+
1576
+ // Static export of pre-configured page header title component to easily
1577
+ // use as part of a custom title row
1578
+ FormMainPage.PageHeaderTitle = PageHeaderTitle;
1579
+
1580
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1581
+ // The Intl messages can be used for button labels.
1582
+ FormMainPage.Intl = i18n.sharedMessages;
1583
+
1584
+ const InfoMainPage = props => {
1585
+ return jsxRuntime.jsx(CustomFormMainPage, {
1586
+ title: props.title,
1587
+ subtitle: props.subtitle,
1588
+ customTitleRow: props.customTitleRow,
1589
+ customViewLocatorCode: props.customViewLocatorCode,
1590
+ hideDivider: true,
1591
+ children: props.children
1592
+ });
1593
+ };
1594
+ InfoMainPage.propTypes = {};
1595
+ InfoMainPage.displayName = 'InfoMainPage';
1596
+ // Static export of pre-configured page header title component to easily
1597
+ // use as part of a custom title row
1598
+ InfoMainPage.PageHeaderTitle = PageHeaderTitle;
1599
+
1600
+ const defaultProps$2 = {
1601
+ hideControls: false
1602
+ };
1603
+ const TabularMainPage = props => {
1604
+ const _useCustomViewLocator = useCustomViewLocatorSelector(props.customViewLocatorCodes),
1605
+ currentCustomViewLocatorCode = _useCustomViewLocator.currentCustomViewLocatorCode;
1606
+ return jsxRuntime.jsxs(PageWrapper, {
1607
+ children: [jsxRuntime.jsxs(TabularPageContainer, {
1608
+ children: [props.customTitleRow || jsxRuntime.jsx(PageHeaderTitle, {
1609
+ title: props.title ?? '',
1610
+ subtitle: props.subtitle,
1611
+ titleSize: "big"
1612
+ }), jsxRuntime.jsx(ControlsContainter, {
1613
+ tabControls: props.tabControls,
1614
+ formControls: jsxRuntime.jsx(FormControlsContainer, {
1615
+ children: !props.hideControls && props.formControls && jsxRuntime.jsx(Spacings__default["default"].Inline, {
1616
+ alignItems: "flex-end",
1617
+ children: props.formControls
1618
+ })
1619
+ })
1620
+ })]
1621
+ }), jsxRuntime.jsx(CustomViewsSelectorWrapper, {
1622
+ children: jsxRuntime.jsx(CustomViewSelectorOrNothing, {
1623
+ margin: `${designSystem.designTokens.spacing30} 0 0 0`,
1624
+ customViewLocatorCode: currentCustomViewLocatorCode
1625
+ })
1626
+ }), jsxRuntime.jsx(ContentWrapper$1, {
1627
+ css: /*#__PURE__*/react.css("background-color:", designSystem.designTokens.colorSurface, ";" + ("" ), "" ),
1628
+ children: props.children
1629
+ })]
1630
+ });
1631
+ };
1632
+ TabularMainPage.propTypes = {};
1633
+ TabularMainPage.displayName = 'TabularMainPage';
1634
+ TabularMainPage.defaultProps = defaultProps$2;
1635
+ // Static export of pre-configured form control buttons to easily re-use
1636
+ // them in the custom controls.
1637
+ TabularMainPage.FormPrimaryButton = FormPrimaryButton;
1638
+ TabularMainPage.FormSecondaryButton = FormSecondaryButton;
1639
+ TabularMainPage.FormDeleteButton = FormDeleteButton;
1640
+ // Static export of pre-configured page header title component to easily
1641
+ // use as part of a custom title row
1642
+ TabularMainPage.PageHeaderTitle = PageHeaderTitle;
1643
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1644
+ TabularMainPage.Intl = i18n.sharedMessages;
1645
+
1646
+ var _ref$3 = {
1647
+ name: "zl1inp",
1648
+ styles: "display:flex;justify-content:center"
1649
+ } ;
1650
+ var _ref2 = {
1651
+ name: "10lgefo",
1652
+ styles: "display:grid;align-items:center;justify-content:center;height:100%;white-space:pre-wrap;text-align:center"
1653
+ } ;
1654
+ const MaintenancePageLayout = props => jsxRuntime.jsx("div", {
1655
+ css: _ref2,
1656
+ children: jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
1657
+ max: 10,
1658
+ children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
1659
+ scale: "m",
1660
+ children: [jsxRuntime.jsx("div", {
1661
+ children: jsxRuntime.jsx("img", {
1662
+ style: {
1663
+ height: designSystem.designTokens.constraint7
1664
+ },
1665
+ src: props.imageSrc,
1666
+ alt: props.label
1667
+ })
1668
+ }), jsxRuntime.jsx(Text__default["default"].Headline, {
1669
+ as: "h2",
1670
+ children: props.title
1671
+ }), jsxRuntime.jsx(Text__default["default"].Body, {
1672
+ children: props.paragraph1
1673
+ }), props.bodyContent && jsxRuntime.jsx("div", {
1674
+ css: _ref$3,
1675
+ children: props.bodyContent
1676
+ }), props.paragraph2 && jsxRuntime.jsx(Text__default["default"].Body, {
1677
+ children: props.paragraph2
1678
+ })]
1679
+ })
1680
+ })
1681
+ });
1682
+ MaintenancePageLayout.propTypes = {};
1683
+ MaintenancePageLayout.displayName = 'MaintenancePageLayout';
1684
+
1685
+ var messages$2 = reactIntl.defineMessages({
1686
+ title: {
1687
+ id: 'PageNotFound.title',
1688
+ defaultMessage: 'We could not find what you are looking for'
1689
+ },
1690
+ paragraph1: {
1691
+ id: 'PageNotFound.paragraph1',
1692
+ defaultMessage: 'The item you are looking for may have been deleted, does not exist, or the URL was entered incorrectly. Check the URL and try again.\n\nPlease contact your system administrator or the commercetools <a>Help Desk</a> if you have any further questions.'
1693
+ }
1694
+ });
1695
+
1696
+ 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; }
1697
+ 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; }
1698
+ const getLink = msg => jsxRuntime.jsx("a", {
1699
+ href: constants.SUPPORT_PORTAL_URL,
1700
+ target: "_blank",
1701
+ rel: "noopener noreferrer",
1702
+ children: msg
1703
+ });
1704
+ const PageNotFound = () => {
1705
+ const intl = reactIntl.useIntl();
1706
+ return jsxRuntime.jsx(MaintenancePageLayout, {
1707
+ imageSrc: PageNotFoundSVG__default["default"],
1708
+ title: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages$2.title)),
1709
+ label: intl.formatMessage(messages$2.title),
1710
+ paragraph1: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2(_objectSpread$2({}, messages$2.paragraph1), {}, {
1711
+ values: {
1712
+ a: getLink
1713
+ }
1714
+ }))
1715
+ });
1716
+ };
1717
+ PageNotFound.displayName = 'PageNotFound';
1718
+
1719
+ var messages$1 = reactIntl.defineMessages({
1720
+ title: {
1721
+ id: 'PageUnauthorized.title',
1722
+ defaultMessage: 'We could not find what you are looking for'
1723
+ },
1724
+ paragraph1: {
1725
+ id: 'PageUnauthorized.paragraph1',
1726
+ defaultMessage: 'The Module you are looking for either does not exist for this Project or you are not authorized to view it.'
1727
+ },
1728
+ paragraph2: {
1729
+ id: 'PageUnauthorized.paragraph2',
1730
+ defaultMessage: 'Please contact your system administrator or the commercetools <a>Help Desk</a> if you have any further questions.'
1731
+ }
1732
+ });
1733
+
1734
+ function ownKeys$1(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; }
1735
+ function _objectSpread$1(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$1(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$1(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1736
+ const getSupportUrlLink = msg => jsxRuntime.jsx("a", {
1737
+ href: constants.SUPPORT_PORTAL_URL,
1738
+ target: "_blank",
1739
+ rel: "noopener noreferrer",
1740
+ children: msg
1741
+ });
1742
+ const PageUnauthorized = () => {
1743
+ const intl = reactIntl.useIntl();
1744
+ return jsxRuntime.jsx(MaintenancePageLayout, {
1745
+ imageSrc: FailedAuthorizationSVG__default["default"],
1746
+ title: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages$1.title)),
1747
+ label: intl.formatMessage(messages$1.title),
1748
+ paragraph1: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages$1.paragraph1)),
1749
+ paragraph2: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1(_objectSpread$1({}, messages$1.paragraph2), {}, {
1750
+ values: {
1751
+ a: getSupportUrlLink
1752
+ }
1753
+ }))
1754
+ });
1755
+ };
1756
+ PageUnauthorized.displayName = 'PageUnauthorized';
1757
+
1758
+ const Content$1 = /*#__PURE__*/_styled__default["default"]("section", {
1759
+ target: "e1jvhtw81"
1760
+ } )({
1761
+ name: "1sxg93g",
1762
+ styles: "grid-area:content"
1763
+ } );
1764
+ const Container$1 = /*#__PURE__*/_styled__default["default"]("div", {
1765
+ target: "e1jvhtw80"
1766
+ } )({
1767
+ name: "1vpm32e",
1768
+ styles: "display:grid;grid-template-areas:'. content .';grid-template-columns:1fr minmax(400px, 742px) 1fr;width:100%"
1769
+ } );
1770
+ function PageContentNarrow(props) {
1771
+ return jsxRuntime.jsx(Container$1, {
1772
+ children: jsxRuntime.jsx(Content$1, {
1773
+ children: props.children
1774
+ })
1775
+ });
1776
+ }
1777
+ PageContentNarrow.propTypes = {};
1778
+
1779
+ const Content = /*#__PURE__*/_styled__default["default"]("section", {
1780
+ target: "e1dg479f4"
1781
+ } )("grid-area:content;display:grid;grid-template-areas:", props => props.columns === '1' ? 'none' : '"left-column right-column"', ";grid-template-columns:", props => {
1782
+ // NOTE: using only `?fr` can cause the layout the "break" as `fr`
1783
+ // is all about distribution of the available space.
1784
+ // If the content of a column becomes "bigger", the system tries
1785
+ // to compensate for the lack of space by reducing the width of the
1786
+ // other column (it does not overflow).
1787
+ // To fix that, we can use `minmax` to instruct the system that
1788
+ // the column size has to be maintained. However, this will cause
1789
+ // some overflow if the content is bigger.
1790
+ // For us, it's important to ensure that the columns layout maintains
1791
+ // the correct dimensions and sizes, thus using `minmax`.
1792
+ switch (props.columns) {
1793
+ case '1/1':
1794
+ return 'repeat(2, minmax(0, 1fr))';
1795
+ case '2/1':
1796
+ return 'minmax(0, 2fr) minmax(0, 1fr)';
1797
+ default:
1798
+ return 'minmax(0, 1fr)';
1799
+ }
1800
+ }, ";gap:", props => props.gapSize === '10' ? designSystem.designTokens.spacing50 : designSystem.designTokens.spacing70, ";width:100%;" + ("" ));
1801
+ const LeftContentColumn = /*#__PURE__*/_styled__default["default"]("div", {
1802
+ target: "e1dg479f3"
1803
+ } )({
1804
+ name: "1ibwnup",
1805
+ styles: "grid-area:left-column"
1806
+ } );
1807
+ const RightContentColumn = /*#__PURE__*/_styled__default["default"]("div", {
1808
+ target: "e1dg479f2"
1809
+ } )({
1810
+ name: "hjfyry",
1811
+ styles: "grid-area:right-column"
1812
+ } );
1813
+ const RightColumnContentWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1814
+ target: "e1dg479f1"
1815
+ } )("top:0;position:", props => props.columns === '2/1' ? 'sticky' : 'static', ";" + ("" ));
1816
+ const Container = /*#__PURE__*/_styled__default["default"]("div", {
1817
+ target: "e1dg479f0"
1818
+ } )({
1819
+ name: "5phl7w",
1820
+ styles: "display:grid;grid-template-areas:'. content .';grid-template-columns:1fr minmax(800px, 1200px) 1fr;width:100%"
1821
+ } );
1822
+ function PageContentWide(props) {
1823
+ const _Children$toArray = react$1.Children.toArray(props.children),
1824
+ _Children$toArray2 = _slicedToArray(_Children$toArray, 2),
1825
+ leftChild = _Children$toArray2[0],
1826
+ rightChild = _Children$toArray2[1];
1827
+ const childrenCount = react$1.Children.count(props.children);
1828
+ const isOneColumnAndMoreThanOneChild = props.columns === '1' && childrenCount > 1;
1829
+ const isTwoColumnsAndMoreThanTwoChildren = props.columns !== '1' && childrenCount > 2;
1830
+ utils.useWarning(!isOneColumnAndMoreThanOneChild, 'PageContentWide: This component only renders its first children when using a single column but you provided more than one.');
1831
+ utils.useWarning(!isTwoColumnsAndMoreThanTwoChildren, 'PageContentWide: This component only renders its first two children when using a two columns layout but you provided more than two.');
1832
+ return jsxRuntime.jsx(Container, {
1833
+ children: jsxRuntime.jsx(Content, {
1834
+ columns: props.columns,
1835
+ gapSize: props.gapSize,
1836
+ children: props.columns === '1' ? jsxRuntime.jsx(jsxRuntime.Fragment, {
1837
+ children: leftChild
1838
+ }) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
1839
+ children: [jsxRuntime.jsx(LeftContentColumn, {
1840
+ children: leftChild
1841
+ }), jsxRuntime.jsx(RightContentColumn, {
1842
+ children: jsxRuntime.jsx(RightColumnContentWrapper, {
1843
+ columns: props.columns,
1844
+ children: rightChild
1845
+ })
1846
+ })]
1847
+ })
1848
+ })
1849
+ });
1850
+ }
1851
+ PageContentWide.propTypes = {};
1852
+ const defaultProps$1 = {
1853
+ columns: '1',
1854
+ gapSize: '20'
1855
+ };
1856
+ PageContentWide.defaultProps = defaultProps$1;
1857
+
1858
+ var _ref$2 = {
1859
+ name: "1d3w5wq",
1860
+ styles: "width:100%"
1861
+ } ;
1862
+ function PageContentFull(props) {
1863
+ return jsxRuntime.jsx("div", {
1864
+ css: _ref$2,
1865
+ children: jsxRuntime.jsx("section", {
1866
+ children: props.children
1867
+ })
1868
+ });
1869
+ }
1870
+ PageContentFull.propTypes = {};
1871
+
1872
+ const defaultProps = {
1873
+ size: 10,
1874
+ hideControls: false,
1875
+ onPrimaryButtonClick: () => {},
1876
+ onSecondaryButtonClick: () => {}
1877
+ };
1878
+ const ContentWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1879
+ target: "e18jo6y41"
1880
+ } )("flex:1;flex-basis:0;margin:", designTokens.marginForPageContent, ";overflow:auto;" + ("" ));
1881
+ const HeaderWrapper = /*#__PURE__*/_styled__default["default"]("div", {
1882
+ target: "e18jo6y40"
1883
+ } )("padding:", designSystem.designTokens.spacing40, " 40px;border-bottom:1px solid ", designSystem.designTokens.colorNeutral90, ";" + ("" ));
1884
+ function Drawer(props) {
1885
+ const intl = reactIntl.useIntl();
1886
+ return jsxRuntime.jsxs(ModalPage, {
1887
+ isOpen: props.isOpen,
1888
+ hidePathLabel: true,
1889
+ hideTopBar: true,
1890
+ onClose: props.onClose,
1891
+ size: props.size,
1892
+ title: props.title,
1893
+ afterOpenStyles: props.afterOpenStyles,
1894
+ getParentSelector: props.getParentSelector,
1895
+ shouldDelayOnClose: props.shouldDelayOnClose,
1896
+ topBarColor: props.topBarColor,
1897
+ zIndex: props.zIndex,
1898
+ children: [jsxRuntime.jsx(HeaderWrapper, {
1899
+ children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
1900
+ children: [jsxRuntime.jsxs(Spacings__default["default"].Inline, {
1901
+ justifyContent: "space-between",
1902
+ children: [jsxRuntime.jsx(PageHeaderTitle, {
1903
+ title: props.title,
1904
+ titleSize: "medium",
1905
+ subtitle: props.subtitle && jsxRuntime.jsx(Text__default["default"].Detail, {
1906
+ children: props.subtitle
1907
+ })
1908
+ }), props.onClose && jsxRuntime.jsx(SecondaryIconButton__default["default"], {
1909
+ label: intl.formatMessage(messages$5.close),
1910
+ onClick: props.onClose,
1911
+ icon: jsxRuntime.jsx(LargeIconWrapper, {
1912
+ children: jsxRuntime.jsx(icons.CloseIcon, {})
1913
+ }),
1914
+ size: "40"
1915
+ })]
1916
+ }), jsxRuntime.jsxs(Spacings__default["default"].Inline, {
1917
+ justifyContent: "flex-end",
1918
+ children: [!props.hideControls && props.formControls && props.formControls, !props.hideControls && !props.formControls && jsxRuntime.jsxs(jsxRuntime.Fragment, {
1919
+ children: [jsxRuntime.jsx(FormSecondaryButton, {
1920
+ label: props.labelSecondaryButton,
1921
+ onClick: props.onSecondaryButtonClick,
1922
+ isDisabled: props.isSecondaryButtonDisabled,
1923
+ dataAttributes: props.dataAttributesSecondaryButton,
1924
+ iconLeft: props.iconLeftSecondaryButton
1925
+ }), jsxRuntime.jsx(FormPrimaryButton, {
1926
+ label: props.labelPrimaryButton,
1927
+ onClick: props.onPrimaryButtonClick,
1928
+ isDisabled: props.isPrimaryButtonDisabled,
1929
+ dataAttributes: props.dataAttributesPrimaryButton
1930
+ })]
1931
+ })]
1932
+ })]
1933
+ })
1934
+ }), jsxRuntime.jsx(ContentWrapper, {
1935
+ children: props.children
1936
+ })]
1937
+ });
1938
+ }
1939
+ Drawer.propTypes = {};
1940
+ Drawer.displayName = 'Drawer';
1941
+ Drawer.defaultProps = defaultProps;
1942
+ // Static export of pre-configured form control buttons to easily re-use
1943
+ // them in the custom controls.
1944
+ Drawer.FormPrimaryButton = FormPrimaryButton;
1945
+ Drawer.FormSecondaryButton = FormSecondaryButton;
1946
+ // This is a convenience proxy export to expose pre-defined Intl messages defined in the `@commercetools-frontend/i18n` package.
1947
+ // The Intl messages can be used for button labels.
1948
+ Drawer.Intl = i18n.sharedMessages;
1949
+
1950
+ var messages = reactIntl.defineMessages({
1951
+ ProjectProduction: {
1952
+ id: 'ProjectStamp.production',
1953
+ defaultMessage: 'Production'
1954
+ },
1955
+ ProjectSuspended: {
1956
+ id: 'ProjectStamp.suspended',
1957
+ defaultMessage: 'Suspended'
1958
+ },
1959
+ ProjectExpired: {
1960
+ id: 'ProjectStamp.expired',
1961
+ defaultMessage: 'Trial expired'
1962
+ },
1963
+ ProjectWillExpire: {
1964
+ id: 'ProjectStamp.willExpire',
1965
+ defaultMessage: '{daysLeft, select, 0 {Trial ends today} 1 {Trial ends in 1 day} other {Trial ends in {daysLeft} days}}'
1966
+ }
1967
+ });
1968
+
1969
+ const _excluded = ["values"];
1970
+ function ownKeys(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; }
1971
+ function _objectSpread(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(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(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1972
+ function CustomStamp(props) {
1973
+ const intl = reactIntl.useIntl();
1974
+ const _props$label = props.label,
1975
+ values = _valuesInstanceProperty__default["default"](_props$label),
1976
+ message = _objectWithoutProperties(_props$label, _excluded);
1977
+ return jsxRuntime.jsx(Stamp__default["default"], {
1978
+ tone: props.tone,
1979
+ isCondensed: true,
1980
+ label: intl.formatMessage(message, values || {}),
1981
+ icon: props.icon
1982
+ });
1983
+ }
1984
+ CustomStamp.propTypes = {};
1985
+ var _ref$1 = {
1986
+ name: "ph6b5m",
1987
+ styles: "height:18px;svg{height:18px;width:12px;}"
1988
+ } ;
1989
+ const IsProduction = () => {
1990
+ return jsxRuntime.jsx(CustomStamp, {
1991
+ tone: "positive",
1992
+ label: messages.ProjectProduction,
1993
+ icon: jsxRuntime.jsx("div", {
1994
+ css: _ref$1,
1995
+ children: jsxRuntime.jsx(icons.DotIcon, {
1996
+ color: "success"
1997
+ })
1998
+ })
1999
+ });
2000
+ };
2001
+ const IsSuspended = () => jsxRuntime.jsx(CustomStamp, {
2002
+ tone: "critical",
2003
+ label: messages.ProjectSuspended
2004
+ });
2005
+ const IsExpired = () => jsxRuntime.jsx(CustomStamp, {
2006
+ tone: "critical",
2007
+ label: messages.ProjectExpired
2008
+ });
2009
+ const WillExpire = props => jsxRuntime.jsx(CustomStamp, {
2010
+ tone: "information",
2011
+ label: _objectSpread(_objectSpread({}, messages.ProjectWillExpire), {}, {
2012
+ values: {
2013
+ daysLeft: props.daysLeft
2014
+ }
2015
+ })
2016
+ });
2017
+ const ProjectStamp = {
2018
+ IsProduction,
2019
+ IsSuspended,
2020
+ IsExpired,
2021
+ WillExpire
2022
+ };
2023
+
2024
+ const useObserverElementDimensions = element => {
2025
+ const _useState = react$1.useState({
2026
+ height: 0,
2027
+ width: 0
2028
+ }),
2029
+ _useState2 = _slicedToArray(_useState, 2),
2030
+ dimensions = _useState2[0],
2031
+ setDimensions = _useState2[1];
2032
+ useResizeObserver__default["default"](element, entry => {
2033
+ setDimensions({
2034
+ height: entry.contentRect.height,
2035
+ width: entry.contentRect.width
2036
+ });
2037
+ });
2038
+ return dimensions;
2039
+ };
2040
+
2041
+ // All modal components expect to be rendered inside this container.
2042
+ var _ref = {
2043
+ name: "qk9kof",
2044
+ styles: "display:flex;height:1px;margin-top:-1px"
2045
+ } ;
2046
+ const PortalsContainer = /*#__PURE__*/react$1.forwardRef((props, ref) => {
2047
+ // Initialize props with default values.
2048
+ // NOTE: using `defaultProps` with `forwardRef` results in the type declarations
2049
+ // to ignore the `defaultProps`. Therefore, the default props are typed
2050
+ // as optional and we initialize the value here with the default values.
2051
+ const offsetTop = props.offsetTop ?? '0px';
2052
+ const offsetLeft = props.offsetLeft ?? '0px';
2053
+ const offsetLeftOnExpandedMenu = props.offsetLeftOnExpandedMenu ?? '0px';
2054
+ const containerSelectorToPreventScrollingOnOpen = props.containerSelectorToPreventScrollingOnOpen ?? 'main';
2055
+ const zIndex = props.zIndex ?? 10000;
2056
+ const baseModalZIndex = props.baseModalZIndex ?? 1000;
2057
+ const modalWidthTransition = 'width 150ms cubic-bezier(1, 0, 0.58, 1)';
2058
+ const portalsContainerRef = react$1.useRef(null);
2059
+ const globalNotificationsElementDimensions = useObserverElementDimensions(ref?.current?.notificationsGlobalRef);
2060
+ const pageNotificationsElementDimensions = useObserverElementDimensions(ref?.current?.notificationsPageRef);
2061
+ const _useState3 = react$1.useState([]),
2062
+ _useState4 = _slicedToArray(_useState3, 2),
2063
+ stackingLayers = _useState4[0],
2064
+ setStackingLayers = _useState4[1];
2065
+ // The mutation observer gets triggered every time a child node gets added or
2066
+ // removed from the portals container.
2067
+ // The stacking layers are then re-calculated.
2068
+ hooks.useMutationObserver(portalsContainerRef, mutationList => {
2069
+ var _context;
2070
+ // We expect only a single element in the mutation list as we configured the
2071
+ // observer to only listen to `childList` changes.
2072
+ const _mutationList = _slicedToArray(mutationList, 1),
2073
+ mutationEvent = _mutationList[0];
2074
+ let indentationLevel = 0;
2075
+ const nextStackingLevels = [];
2076
+ _forEachInstanceProperty__default["default"](_context = mutationEvent.target.childNodes).call(_context, (node, index) => {
2077
+ if (node instanceof HTMLElement) {
2078
+ const stackingLevel = index + 1;
2079
+ node.dataset.level = String(stackingLevel);
2080
+ const overlayNode = node.firstChild;
2081
+ if (overlayNode instanceof HTMLElement) {
2082
+ if (overlayNode.dataset.role === 'modal-overlay') {
2083
+ indentationLevel += 1;
2084
+ }
2085
+ }
2086
+ nextStackingLevels.push({
2087
+ stackingLevel,
2088
+ indentationLevel
2089
+ });
2090
+ }
2091
+ });
2092
+ setStackingLayers(nextStackingLevels);
2093
+ }, {
2094
+ // Only subscribe to changes to the child nodes of the portals container.
2095
+ childList: true
2096
+ });
2097
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
2098
+ children: [jsxRuntime.jsx(react.Global
2099
+ // Apply some global styles, based on the `.ReactModal__Body--open` class.
2100
+ , {
2101
+ 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, ";}" + ("" ), "" ),
2102
+ // Apply styles for stacking layers.
2103
+ ..._mapInstanceProperty__default["default"](stackingLayers).call(stackingLayers,
2104
+ /**
2105
+ * Every "overlay" container gets assigned a sequential `z-index` level.
2106
+ * Furthermore, the "modal overlay" containers (not "dialog") get assigned
2107
+ * the correct indentation level width.
2108
+ */
2109
+ stackingLayer => /*#__PURE__*/react.css("#", constants.PORTALS_CONTAINER_ID, " .ReactModalPortal[data-level='", stackingLayer.stackingLevel, "'] [data-role$='overlay']{z-index:calc(\n ", baseModalZIndex, " + ", stackingLayer.stackingLevel, "\n );}#", constants.PORTALS_CONTAINER_ID, " .ReactModalPortal[data-level='", stackingLayer.stackingLevel, "'] [data-role='modal-overlay'] [role='dialog']{width:calc(\n 100% -\n (\n ", constants.PORTALS_CONTAINER_INDENTATION_SIZE, " *\n ", stackingLayer.indentationLevel, "\n )\n );}" + ("" ), "" )), "" ]
2110
+ }), jsxRuntime.jsx("div", {
2111
+ id: constants.PORTALS_CONTAINER_ID,
2112
+ ref: portalsContainerRef
2113
+ // The container needs a height in order to be tabbable: https://reactjs/react-modal#774
2114
+ ,
2115
+ css: _ref
2116
+ })]
2117
+ });
2118
+ });
2119
+ PortalsContainer.displayName = 'PortalsContainer';
2120
+
2121
+ const useModalState = function () {
2122
+ let isInitiallyOpen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2123
+ const _useState = react$1.useState(isInitiallyOpen),
2124
+ _useState2 = _slicedToArray(_useState, 2),
2125
+ isModalOpen = _useState2[0],
2126
+ setIsModalOpen = _useState2[1];
2127
+ const openModal = react$1.useCallback(() => setIsModalOpen(true), []);
2128
+ const closeModal = react$1.useCallback(() => setIsModalOpen(false), []);
2129
+ return {
2130
+ isModalOpen,
2131
+ openModal,
2132
+ closeModal
2133
+ };
2134
+ };
2135
+
2136
+ exports.ConfirmationDialog = ConfirmationDialog;
2137
+ exports.CustomFormDetailPage = CustomFormDetailPage;
2138
+ exports.CustomFormMainPage = CustomFormMainPage;
2139
+ exports.CustomFormModalPage = CustomFormModalPage;
2140
+ exports.CustomViewLoader = CustomViewLoader;
2141
+ exports.CustomViewsSelector = CustomViewSelectorOrNothing;
2142
+ exports.Drawer = Drawer;
2143
+ exports.FormDetailPage = FormDetailPage;
2144
+ exports.FormDialog = FormDialog;
2145
+ exports.FormMainPage = FormMainPage;
2146
+ exports.FormModalPage = FormModalPage;
2147
+ exports.InfoDetailPage = InfoDetailPage;
2148
+ exports.InfoDialog = InfoDialog;
2149
+ exports.InfoMainPage = InfoMainPage;
2150
+ exports.InfoModalPage = InfoModalPage;
2151
+ exports.MaintenancePageLayout = MaintenancePageLayout;
2152
+ exports.ModalPageTopBar = ModalPageTopBar;
2153
+ exports.PageContentFull = PageContentFull;
2154
+ exports.PageContentNarrow = PageContentNarrow;
2155
+ exports.PageContentWide = PageContentWide;
2156
+ exports.PageNotFound = PageNotFound;
2157
+ exports.PageUnauthorized = PageUnauthorized;
2158
+ exports.PortalsContainer = PortalsContainer;
2159
+ exports.ProjectStamp = ProjectStamp;
2160
+ exports.PublicPageLayout = PublicPageLayout;
2161
+ exports.TabHeader = TabHeader;
2162
+ exports.TabularDetailPage = TabularDetailPage;
2163
+ exports.TabularMainPage = TabularMainPage;
2164
+ exports.TabularModalPage = TabularModalPage;
2165
+ exports.designTokens = designTokens;
2166
+ exports.themesOverrides = themesOverrides;
2167
+ exports.useModalState = useModalState;
2168
+ exports.version = version;