@nulogy/components 8.2.2 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('styled-components'), require('@babel/runtime/helpers/typeof'), require('@babel/runtime/helpers/classCallCheck'), require('@babel/runtime/helpers/createClass'), require('@babel/runtime/helpers/defineProperty'), require('object-assign'), require('@nulogy/icons'), require('@babel/runtime/helpers/extends'), require('@babel/runtime/helpers/assertThisInitialized'), require('@babel/runtime/helpers/inheritsLoose'), require('prop-types'), require('react-fast-compare'), require('warning'), require('@babel/runtime/helpers/slicedToArray'), require('@babel/runtime/helpers/objectWithoutPropertiesLoose'), require('deep-equal'), require('create-react-context'), require('react-resize-detector'), require('react-windowed-select'), require('react-dom'), require('exenv'), require('smoothscroll-polyfill'), require('classnames'), require('@babel/runtime/helpers/toConsumableArray'), require('react-input-autosize'), require('@babel/runtime/helpers/taggedTemplateLiteral')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react', 'styled-components', '@babel/runtime/helpers/typeof', '@babel/runtime/helpers/classCallCheck', '@babel/runtime/helpers/createClass', '@babel/runtime/helpers/defineProperty', 'object-assign', '@nulogy/icons', '@babel/runtime/helpers/extends', '@babel/runtime/helpers/assertThisInitialized', '@babel/runtime/helpers/inheritsLoose', 'prop-types', 'react-fast-compare', 'warning', '@babel/runtime/helpers/slicedToArray', '@babel/runtime/helpers/objectWithoutPropertiesLoose', 'deep-equal', 'create-react-context', 'react-resize-detector', 'react-windowed-select', 'react-dom', 'exenv', 'smoothscroll-polyfill', 'classnames', '@babel/runtime/helpers/toConsumableArray', 'react-input-autosize', '@babel/runtime/helpers/taggedTemplateLiteral'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.NDSComponents = {}, global.React, global.styled, global.typeof, global.classCallCheck, global.createClass, global.defineProperty, global.assign, global.icons, global.extends, global.assertThisInitialized, global.inheritsLoose, global.PropTypes, global.isEqual, global.warning, global.slicedToArray, global.objectWithoutPropertiesLoose, global.deepEqual, global.createReactContext, global.ReactResizeDetector, global.components, global.reactDom, global.exenv, global.smoothscroll, global.t, null, global.AutosizeInput));
5
- }(this, (function (exports, React, styled, _typeof$1, _classCallCheck$1, _createClass$1, _defineProperty$1, assign$1, icons, _extends$4, _assertThisInitialized$2, _inheritsLoose$2, PropTypes, isEqual$2, warning$1, _slicedToArray$1, _objectWithoutPropertiesLoose$2, deepEqual, createContext, ReactResizeDetector, WindowedSelect, reactDom, exenv, smoothscroll, t, toConsumableArray, AutosizeInput) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('styled-components'), require('@babel/runtime/helpers/typeof'), require('@babel/runtime/helpers/classCallCheck'), require('@babel/runtime/helpers/createClass'), require('@babel/runtime/helpers/defineProperty'), require('object-assign'), require('@nulogy/icons'), require('@babel/runtime/helpers/extends'), require('@babel/runtime/helpers/assertThisInitialized'), require('@babel/runtime/helpers/inheritsLoose'), require('prop-types'), require('react-fast-compare'), require('warning'), require('@babel/runtime/helpers/slicedToArray'), require('@babel/runtime/helpers/objectWithoutPropertiesLoose'), require('deep-equal'), require('create-react-context'), require('react-resize-detector'), require('react-windowed-select'), require('regenerator-runtime'), require('react-dom'), require('exenv'), require('smoothscroll-polyfill'), require('classnames'), require('@babel/runtime/helpers/toConsumableArray'), require('react-input-autosize'), require('@babel/runtime/helpers/taggedTemplateLiteral')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react', 'styled-components', '@babel/runtime/helpers/typeof', '@babel/runtime/helpers/classCallCheck', '@babel/runtime/helpers/createClass', '@babel/runtime/helpers/defineProperty', 'object-assign', '@nulogy/icons', '@babel/runtime/helpers/extends', '@babel/runtime/helpers/assertThisInitialized', '@babel/runtime/helpers/inheritsLoose', 'prop-types', 'react-fast-compare', 'warning', '@babel/runtime/helpers/slicedToArray', '@babel/runtime/helpers/objectWithoutPropertiesLoose', 'deep-equal', 'create-react-context', 'react-resize-detector', 'react-windowed-select', 'regenerator-runtime', 'react-dom', 'exenv', 'smoothscroll-polyfill', 'classnames', '@babel/runtime/helpers/toConsumableArray', 'react-input-autosize', '@babel/runtime/helpers/taggedTemplateLiteral'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.NDSComponents = {}, global.React, global.styled, global.typeof, global.classCallCheck, global.createClass, global.defineProperty, global.assign, global.icons, global.extends, global.assertThisInitialized, global.inheritsLoose, global.PropTypes, global.isEqual, global.warning, global.slicedToArray, global.objectWithoutPropertiesLoose, global.deepEqual, global.createReactContext, global.ReactResizeDetector, global.components, global.regeneratorRuntime, global.reactDom, global.exenv, global.smoothscroll, global.t, null, global.AutosizeInput));
5
+ }(this, (function (exports, React, styled, _typeof$1, _classCallCheck$1, _createClass$1, _defineProperty$1, assign$1, icons, _extends$4, _assertThisInitialized$2, _inheritsLoose$2, PropTypes, isEqual$2, warning$1, _slicedToArray$1, _objectWithoutPropertiesLoose$2, deepEqual, createContext, ReactResizeDetector, WindowedSelect, regeneratorRuntime, reactDom, exenv, smoothscroll, t, toConsumableArray, AutosizeInput) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -47,6 +47,7 @@
47
47
  var createContext__default = /*#__PURE__*/_interopDefaultLegacy(createContext);
48
48
  var ReactResizeDetector__default = /*#__PURE__*/_interopDefaultLegacy(ReactResizeDetector);
49
49
  var WindowedSelect__default = /*#__PURE__*/_interopDefaultLegacy(WindowedSelect);
50
+ var regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(regeneratorRuntime);
50
51
  var reactDom__default = /*#__PURE__*/_interopDefaultLegacy(reactDom);
51
52
  var exenv__default = /*#__PURE__*/_interopDefaultLegacy(exenv);
52
53
  var smoothscroll__default = /*#__PURE__*/_interopDefaultLegacy(smoothscroll);
@@ -276,7 +277,7 @@
276
277
 
277
278
  /**
278
279
  * Do not edit directly
279
- * Generated on Mon, 06 Jun 2022 21:26:05 GMT
280
+ * Generated on Thu, 01 Dec 2022 21:44:24 GMT
280
281
  */
281
282
 
282
283
  const color_base_black = "#011e38";
@@ -309,7 +310,7 @@
309
310
  const line_height_small_text_base = "1.71428571";
310
311
  const line_height_small_text_compressed = "1.14285714";
311
312
  const line_height_smaller_text = "1.33333333";
312
- const line_height_heading_1 = "1.05";
313
+ const line_height_heading_1 = "1.25";
313
314
  const line_height_heading_2 = "1.33";
314
315
  const line_height_heading_3 = "1.33";
315
316
  const line_height_heading_4 = "1.33";
@@ -340,8 +341,8 @@
340
341
  const size_font_medium = "16px";
341
342
  const size_font_large = "24px";
342
343
  const size_font_larger = "30px";
343
- const size_font_largest = "38px";
344
- const size_font_heading_1 = "38px";
344
+ const size_font_largest = "32px";
345
+ const size_font_heading_1 = "32px";
345
346
  const size_font_heading_2 = "30px";
346
347
  const size_font_heading_3 = "24px";
347
348
  const size_font_heading_4 = "18px";
@@ -11710,7 +11711,20 @@
11710
11711
  componentId: "sc-1whlq91-0"
11711
11712
  })({
11712
11713
  display: "flex"
11713
- }, flexbox);
11714
+ }, system({
11715
+ gap: {
11716
+ property: "gap",
11717
+ scale: "space"
11718
+ },
11719
+ rowGap: {
11720
+ property: "rowGap",
11721
+ scale: "space"
11722
+ },
11723
+ columnGap: {
11724
+ property: "columnGap",
11725
+ scale: "space"
11726
+ }
11727
+ }), flexbox);
11714
11728
 
11715
11729
  /*! *****************************************************************************
11716
11730
  Copyright (c) Microsoft Corporation.
@@ -11737,6 +11751,16 @@
11737
11751
  t[p[i]] = s[p[i]];
11738
11752
  }
11739
11753
  return t;
11754
+ }
11755
+
11756
+ function __awaiter(thisArg, _arguments, P, generator) {
11757
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11758
+ return new (P || (P = Promise))(function (resolve, reject) {
11759
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
11760
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
11761
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11762
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11763
+ });
11740
11764
  }
11741
11765
 
11742
11766
  var prefix = "random-id-";
@@ -22982,6 +23006,8 @@
22982
23006
  }), /*#__PURE__*/React__default['default'].createElement(WindowedSelect.components.Option, Object.assign({}, props)));
22983
23007
  };
22984
23008
 
23009
+ var regenerator = regeneratorRuntime__default['default'];
23010
+
22985
23011
  var getBorderColor = function getBorderColor(_ref) {
22986
23012
  var errored = _ref.errored,
22987
23013
  disabled = _ref.disabled,
@@ -23195,6 +23221,20 @@
23195
23221
  };
23196
23222
  };
23197
23223
 
23224
+ var extractValuesFromCsvString = function extractValuesFromCsvString(csv) {
23225
+ var quoteRegEx = /(["'])(?:(?=(\\?))\2.)*?\1/gim;
23226
+ var matchedValues = csv.match(quoteRegEx) || [];
23227
+ var quotedValues = matchedValues.map(function (str) {
23228
+ return str.replace(/(["',])/g, "");
23229
+ });
23230
+ var values = Array.from(new Set(csv.replace(quoteRegEx, "").split(",").map(function (value) {
23231
+ return value.trim();
23232
+ }).filter(function (str) {
23233
+ return str.length > 0;
23234
+ }).concat(quotedValues)));
23235
+ return values;
23236
+ };
23237
+
23198
23238
  var SelectControl = function SelectControl(props) {
23199
23239
  // eslint-disable-next-line react/prop-types
23200
23240
  var isFocused = props.isFocused;
@@ -23267,61 +23307,7 @@
23267
23307
  components: undefined,
23268
23308
  closeMenuOnSelect: true
23269
23309
  };
23270
-
23271
- var checkOptionsAreValid = function checkOptionsAreValid(options) {
23272
- if (options && process.env.NODE_ENV === "development") {
23273
- var uniq = function uniq(a) {
23274
- return Array.from(new Set(a));
23275
- };
23276
-
23277
- var uniqueValues = uniq(options.map(function (_ref) {
23278
- var value = _ref.value;
23279
- return value === null ? "_null_" : value;
23280
- }));
23281
-
23282
- if (uniqueValues.length < options.length) {
23283
- console.warn("NDS: The options prop passed to Select must have unique values for each option", options);
23284
- }
23285
- }
23286
- };
23287
-
23288
- var getOption = function getOption(options, value) {
23289
- // allows an option with a null value to be matched
23290
- if (options.length > 0 && value !== undefined) {
23291
- var optionWithMatchingValue = options.find(function (o) {
23292
- return o.value === value;
23293
- });
23294
- return optionWithMatchingValue || null;
23295
- }
23296
-
23297
- return value;
23298
- };
23299
-
23300
- var getReactSelectValue = function getReactSelectValue(options, input) {
23301
- if (Array.isArray(input)) {
23302
- return input.map(function (i) {
23303
- return getOption(options, i);
23304
- });
23305
- }
23306
-
23307
- return getOption(options, input);
23308
- };
23309
-
23310
- var extractValue = function extractValue(options, isMulti) {
23311
- if (isMulti) {
23312
- return options && options.length ? options.map(function (o) {
23313
- return o.value;
23314
- }) : [];
23315
- }
23316
-
23317
- if (options == null) {
23318
- return options;
23319
- } else {
23320
- return options.value;
23321
- }
23322
- };
23323
-
23324
- var ReactSelect = /*#__PURE__*/React.forwardRef(function (_a, ref) {
23310
+ var ReactSelect = /*#__PURE__*/React__default['default'].forwardRef(function (_a, ref) {
23325
23311
  var autocomplete = _a.autocomplete,
23326
23312
  options = _a.options,
23327
23313
  labelText = _a.labelText,
@@ -23350,17 +23336,83 @@
23350
23336
  var _useTranslation = useTranslation(),
23351
23337
  t = _useTranslation.t;
23352
23338
 
23353
- var themeContext = React.useContext(styled.ThemeContext);
23339
+ var themeContext = React__default['default'].useContext(styled.ThemeContext);
23354
23340
  var spaceProps = getSubset(props, propTypes.space);
23355
- React.useEffect(function () {
23341
+ var reactSelectRef = React__default['default'].useRef(null);
23342
+ React__default['default'].useEffect(function () {
23356
23343
  checkOptionsAreValid(options);
23357
23344
  }, [options]);
23345
+ var handleChange = React__default['default'].useCallback(function (option) {
23346
+ onChange && onChange(extractValue(option, multiselect));
23347
+ }, [multiselect, onChange]);
23348
+ var handlePaste = React__default['default'].useCallback(function (e) {
23349
+ return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
23350
+ var currentRef, currentValue, clipboardData, values, notExistingOptions, pastedOptions, newValue;
23351
+ return regenerator.wrap(function _callee$(_context) {
23352
+ while (1) {
23353
+ switch (_context.prev = _context.next) {
23354
+ case 0:
23355
+ e.preventDefault();
23356
+ currentRef = reactSelectRef.current;
23357
+ currentValue = currentRef.state.value || [];
23358
+ clipboardData = e.clipboardData.getData("text/plain") || "";
23359
+ values = extractValuesFromCsvString(clipboardData);
23360
+ notExistingOptions = [];
23361
+ pastedOptions = values.map(function (pastedOption) {
23362
+ var existingOption = options.find(function (option) {
23363
+ return option.label === pastedOption || option.value === pastedOption;
23364
+ });
23365
+
23366
+ if (existingOption) {
23367
+ return existingOption;
23368
+ }
23369
+
23370
+ notExistingOptions.push(pastedOption);
23371
+ return null;
23372
+ }).filter(Boolean).filter(function (pastedOption) {
23373
+ return (// ignoring already selected options
23374
+ currentValue.findIndex(function (option) {
23375
+ return pastedOption.value === option.value;
23376
+ }) === -1
23377
+ );
23378
+ });
23379
+ newValue = [].concat(currentValue, pastedOptions);
23380
+ currentRef.setState(function (prevState) {
23381
+ return Object.assign(Object.assign({}, prevState), {
23382
+ value: newValue,
23383
+ inputValue: notExistingOptions.join(", ")
23384
+ });
23385
+ });
23386
+ handleChange(newValue);
23387
+
23388
+ case 10:
23389
+ case "end":
23390
+ return _context.stop();
23391
+ }
23392
+ }
23393
+ }, _callee);
23394
+ }));
23395
+ }, [options]);
23396
+
23397
+ var _SelectInput = React__default['default'].useCallback(function (inputProps) {
23398
+ return /*#__PURE__*/React__default['default'].createElement(SelectInput, Object.assign({}, inputProps, multiselect ? {
23399
+ onPaste: handlePaste
23400
+ } : {}));
23401
+ }, [handlePaste, multiselect]);
23402
+
23403
+ React__default['default'].useEffect(function () {
23404
+ if (ref) {
23405
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
23406
+ // @ts-ignore
23407
+ ref.current = reactSelectRef.current;
23408
+ }
23409
+ }, [reactSelectRef, ref]);
23358
23410
  return /*#__PURE__*/React__default['default'].createElement(Field, Object.assign({}, spaceProps), /*#__PURE__*/React__default['default'].createElement(MaybeFieldLabel, {
23359
23411
  labelText: labelText,
23360
23412
  requirementText: requirementText,
23361
23413
  helpText: helpText
23362
23414
  }, /*#__PURE__*/React__default['default'].createElement(WindowedSelect__default['default'], Object.assign({
23363
- ref: ref,
23415
+ ref: reactSelectRef,
23364
23416
  placeholder: placeholder || t("select ..."),
23365
23417
  windowThreshold: windowThreshold,
23366
23418
  styles: customStyles({
@@ -23375,9 +23427,7 @@
23375
23427
  "aria-invalid": error,
23376
23428
  defaultMenuIsOpen: initialIsOpen,
23377
23429
  inputId: id,
23378
- onChange: onChange && function (option) {
23379
- return onChange(extractValue(option, multiselect));
23380
- },
23430
+ onChange: handleChange,
23381
23431
  defaultValue: getReactSelectValue(options, defaultValue),
23382
23432
  value: getReactSelectValue(options, value),
23383
23433
  isMulti: multiselect,
@@ -23390,7 +23440,7 @@
23390
23440
  DropdownIndicator: SelectDropdownIndicator,
23391
23441
  SelectContainer: SelectContainer$1,
23392
23442
  Menu: SelectMenu,
23393
- Input: SelectInput
23443
+ Input: _SelectInput
23394
23444
  }, components),
23395
23445
  "aria-label": ariaLabel,
23396
23446
  options: options,
@@ -23401,6 +23451,60 @@
23401
23451
  errorList: errorList
23402
23452
  })));
23403
23453
  });
23454
+
23455
+ var checkOptionsAreValid = function checkOptionsAreValid(options) {
23456
+ if (options && process.env.NODE_ENV === "development") {
23457
+ var uniq = function uniq(a) {
23458
+ return Array.from(new Set(a));
23459
+ };
23460
+
23461
+ var uniqueValues = uniq(options.map(function (_ref) {
23462
+ var value = _ref.value;
23463
+ return value === null ? "_null_" : value;
23464
+ }));
23465
+
23466
+ if (uniqueValues.length < options.length) {
23467
+ console.warn("NDS: The options prop passed to Select must have unique values for each option", options);
23468
+ }
23469
+ }
23470
+ };
23471
+
23472
+ var getOption = function getOption(options, value) {
23473
+ // allows an option with a null value to be matched
23474
+ if (options.length > 0 && value !== undefined) {
23475
+ var optionWithMatchingValue = options.find(function (o) {
23476
+ return o.value === value;
23477
+ });
23478
+ return optionWithMatchingValue || null;
23479
+ }
23480
+
23481
+ return value;
23482
+ };
23483
+
23484
+ var getReactSelectValue = function getReactSelectValue(options, input) {
23485
+ if (Array.isArray(input)) {
23486
+ return input.map(function (i) {
23487
+ return getOption(options, i);
23488
+ });
23489
+ }
23490
+
23491
+ return getOption(options, input);
23492
+ };
23493
+
23494
+ var extractValue = function extractValue(options, isMulti) {
23495
+ if (isMulti) {
23496
+ return options && options.length ? options.map(function (o) {
23497
+ return o.value;
23498
+ }) : [];
23499
+ }
23500
+
23501
+ if (options == null) {
23502
+ return options;
23503
+ } else {
23504
+ return options.value;
23505
+ }
23506
+ };
23507
+
23404
23508
  ReactSelect.defaultProps = Object.assign(Object.assign({}, SelectDefaultProps), {
23405
23509
  windowThreshold: 300,
23406
23510
  filterOption: undefined
@@ -42302,7 +42406,10 @@
42302
42406
  listStyle: "none",
42303
42407
  display: "inline-flex",
42304
42408
  alignSelf: "center",
42305
- color: theme.colors.darkGrey,
42409
+ color: theme.colors.midGrey,
42410
+ "a, p": {
42411
+ fontSize: theme.fontSizes.small
42412
+ },
42306
42413
  "a:visited": {
42307
42414
  color: theme.colors.darkBlue
42308
42415
  }
@@ -42311,14 +42418,10 @@
42311
42418
 
42312
42419
  var insertSeparators = function insertSeparators(items, className) {
42313
42420
  return items.reduce(function (acc, current, index) {
42314
- return acc.concat(current,
42315
- /*#__PURE__*/
42316
- // eslint-disable-next-line react/no-array-index-key
42317
- React__default['default'].createElement(BreadcrumbsListItem, {
42421
+ return acc.concat(current, /*#__PURE__*/React__default['default'].createElement(BreadcrumbsListItem, {
42318
42422
  "aria-hidden": true,
42319
42423
  key: "separator-" + index,
42320
- className: className,
42321
- px: "x1"
42424
+ className: className
42322
42425
  }, /*#__PURE__*/React__default['default'].createElement(Icon, {
42323
42426
  icon: "rightArrow"
42324
42427
  })));
@@ -42330,18 +42433,14 @@
42330
42433
  as = _a.as,
42331
42434
  props = __rest(_a, ["children", "as"]);
42332
42435
 
42333
- var childrenArr = Array.isArray(children) ? children : [children];
42334
- var allItems = [].concat(childrenArr).map(function (child, index) {
42335
- return (
42336
- /*#__PURE__*/
42337
- // eslint-disable-next-line react/no-array-index-key
42338
- React__default['default'].createElement(BreadcrumbsListItem, {
42339
- key: "child-" + index
42340
- }, /*#__PURE__*/React__default['default'].cloneElement(child, {
42341
- color: "darkBlue"
42342
- }))
42343
- );
42344
- });
42436
+ var allItems = React__default['default'].Children.map(children, function (child, index) {
42437
+ if (! /*#__PURE__*/React.isValidElement(child)) return null;
42438
+ return /*#__PURE__*/React__default['default'].createElement(BreadcrumbsListItem, {
42439
+ key: "child-" + index
42440
+ }, /*#__PURE__*/React__default['default'].cloneElement(child, {
42441
+ color: "darkBlue"
42442
+ }));
42443
+ }).filter(Boolean);
42345
42444
  return /*#__PURE__*/React__default['default'].createElement(Flex, Object.assign({
42346
42445
  as: as
42347
42446
  }, props), /*#__PURE__*/React__default['default'].createElement(BreadcrumbsList, null, insertSeparators(allItems, "seperator")));
@@ -50647,30 +50746,127 @@
50647
50746
  }, children));
50648
50747
  };
50649
50748
 
50749
+ var useMediaQuery = function useMediaQuery(query) {
50750
+ var _useState = React.useState(window.matchMedia(query).matches),
50751
+ matches = _useState[0],
50752
+ setMatches = _useState[1];
50753
+
50754
+ React.useEffect(function () {
50755
+ var handler = function handler(e) {
50756
+ setMatches(e.matches);
50757
+ };
50758
+
50759
+ window.matchMedia(query).addEventListener("change", handler);
50760
+ return function () {
50761
+ window.removeEventListener("change", handler);
50762
+ };
50763
+ }, []);
50764
+ return matches;
50765
+ };
50766
+
50767
+ var Header = function Header(_a) {
50768
+ var _b, _c;
50769
+
50770
+ var _a$background = _a.background,
50771
+ background = _a$background === void 0 ? "whiteGrey" : _a$background,
50772
+ renderBreadcrumbs = _a.renderBreadcrumbs,
50773
+ title = _a.title,
50774
+ _a$undecorated = _a.undecorated,
50775
+ undecorated = _a$undecorated === void 0 ? false : _a$undecorated,
50776
+ children = _a.children,
50777
+ subtitle = _a.subtitle,
50778
+ breakpoints = _a.breakpoints,
50779
+ renderActions = _a.renderActions,
50780
+ renderSummary = _a.renderSummary,
50781
+ rest = __rest(_a, ["background", "renderBreadcrumbs", "title", "undecorated", "children", "subtitle", "breakpoints", "renderActions", "renderSummary"]);
50782
+
50783
+ var theme = styled.useTheme();
50784
+ var smallBreakpoint = pixelDigitsFrom$1((_b = breakpoints === null || breakpoints === void 0 ? void 0 : breakpoints.small) !== null && _b !== void 0 ? _b : theme.breakpoints.small);
50785
+ var mediumBreakpoint = pixelDigitsFrom$1((_c = breakpoints === null || breakpoints === void 0 ? void 0 : breakpoints.medium) !== null && _c !== void 0 ? _c : theme.breakpoints.medium);
50786
+ var m = useMediaQuery("(max-width: " + mediumBreakpoint + "px)");
50787
+ var sm = useMediaQuery("(max-width: " + smallBreakpoint + "px)");
50788
+ return /*#__PURE__*/React__default['default'].createElement(Flex, Object.assign({
50789
+ py: "x1",
50790
+ px: "x3",
50791
+ gap: "x2",
50792
+ position: "relative",
50793
+ bg: background
50794
+ }, rest), /*#__PURE__*/React__default['default'].createElement(Flex, {
50795
+ flexGrow: 3,
50796
+ justifyContent: "space-between",
50797
+ flexDirection: m || sm ? "column" : "row",
50798
+ zIndex: "content"
50799
+ }, /*#__PURE__*/React__default['default'].createElement(Flex, {
50800
+ flexDirection: "column"
50801
+ }, renderBreadcrumbs && renderBreadcrumbs(), /*#__PURE__*/React__default['default'].createElement(Flex, {
50802
+ gap: !sm ? "x2" : undefined,
50803
+ flexDirection: !sm ? "row" : "column",
50804
+ alignItems: !sm ? "center" : undefined
50805
+ }, /*#__PURE__*/React__default['default'].createElement(Flex, {
50806
+ alignItems: !sm ? "flex-end" : undefined,
50807
+ gap: !sm ? "x2" : undefined,
50808
+ flexDirection: !sm ? "row" : "column"
50809
+ }, title && /*#__PURE__*/React__default['default'].createElement(Heading1, {
50810
+ mb: "0"
50811
+ }, title), subtitle && /*#__PURE__*/React__default['default'].createElement(Text, {
50812
+ pl: !sm ? "x2" : undefined,
50813
+ borderLeft: !sm ? "1px solid" : "none",
50814
+ my: "half",
50815
+ borderColor: "grey"
50816
+ }, subtitle)), children && children)), renderSummary && renderSummary()), renderActions && /*#__PURE__*/React__default['default'].createElement(Flex, {
50817
+ display: "flex",
50818
+ flexGrow: 0,
50819
+ alignItems: "flex-start",
50820
+ zIndex: "content"
50821
+ }, renderActions()), !undecorated && /*#__PURE__*/React__default['default'].createElement(BackgroundTriangles, {
50822
+ zIndex: 1
50823
+ }));
50824
+ };
50825
+
50826
+ var RightAngleTriangle = styled__default['default'](Box).withConfig({
50827
+ displayName: "Header__RightAngleTriangle",
50828
+ componentId: "sc-1kuwqm0-0"
50829
+ })(["position:absolute;bottom:0;right:0;width:100%;clip-path:polygon(100% 0,0 100%,100% 100%);"]);
50830
+
50831
+ var BackgroundTriangles = function BackgroundTriangles(props) {
50832
+ var theme = styled.useTheme();
50833
+ return /*#__PURE__*/React__default['default'].createElement(Box, Object.assign({
50834
+ position: "absolute",
50835
+ bottom: 0,
50836
+ right: 0,
50837
+ height: "100%",
50838
+ minWidth: "55%"
50839
+ }, props), /*#__PURE__*/React__default['default'].createElement(RightAngleTriangle, {
50840
+ height: "33.33%",
50841
+ opacity: "0.5",
50842
+ background: "linear-gradient(178.25deg, rgba(192, 200, 209, 0.5) 62.98%, rgba(225, 235, 250, 0.25) 98.52%)"
50843
+ }), /*#__PURE__*/React__default['default'].createElement(RightAngleTriangle, {
50844
+ height: "17%",
50845
+ opacity: "0.25",
50846
+ background: "linear-gradient(196.88deg, " + theme.colors.grey + " 11.92%, rgba(0, 67, 143, 0) 88.36%)"
50847
+ }));
50848
+ };
50849
+
50650
50850
  var Page = function Page(_a) {
50651
50851
  var breadcrumbs = _a.breadcrumbs,
50652
50852
  title = _a.title,
50653
50853
  children = _a.children,
50654
50854
  headerContent = _a.headerContent,
50655
50855
  fullHeight = _a.fullHeight,
50656
- props = __rest(_a, ["breadcrumbs", "title", "children", "headerContent", "fullHeight"]);
50856
+ renderHeader = _a.renderHeader,
50857
+ rest = __rest(_a, ["breadcrumbs", "title", "children", "headerContent", "fullHeight", "renderHeader"]);
50657
50858
 
50658
50859
  return /*#__PURE__*/React__default['default'].createElement(Flex, Object.assign({
50659
50860
  flexDirection: "column",
50660
- py: "x3",
50661
- px: "x3",
50662
50861
  flexGrow: fullHeight ? 1 : 0
50663
- }, props), breadcrumbs, /*#__PURE__*/React__default['default'].createElement(Flex, {
50664
- alignItems: "center"
50665
- }, title && /*#__PURE__*/React__default['default'].createElement(Heading1, {
50666
- mb: "x6",
50667
- mt: "x2"
50668
- }, title), headerContent && /*#__PURE__*/React__default['default'].createElement(Box, {
50669
- mb: "x6",
50670
- mt: "x2",
50671
- flexGrow: 1,
50672
- ml: "x1"
50673
- }, headerContent)), children);
50862
+ }, rest), renderHeader ? renderHeader() : (breadcrumbs || title || headerContent) && /*#__PURE__*/React__default['default'].createElement(Header, {
50863
+ renderBreadcrumbs: function renderBreadcrumbs() {
50864
+ return breadcrumbs;
50865
+ },
50866
+ title: title
50867
+ }, headerContent), /*#__PURE__*/React__default['default'].createElement(Box, {
50868
+ p: "x3"
50869
+ }, children));
50674
50870
  };
50675
50871
 
50676
50872
  var focusFirstElement = function focusFirstElement() {
@@ -51007,6 +51203,7 @@
51007
51203
  exports.Flex = Flex;
51008
51204
  exports.Form = Form;
51009
51205
  exports.FormSection = FormSection;
51206
+ exports.Header = Header;
51010
51207
  exports.Heading1 = Heading1;
51011
51208
  exports.Heading2 = Heading2;
51012
51209
  exports.Heading3 = Heading3;