@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 +301 -104
- package/dist/main.module.js +297 -101
- package/dist/src/BrandedNavBar/NavBarBackground.d.ts +1 -1
- package/dist/src/Breadcrumbs/Breadcrumbs.d.ts +2 -11
- package/dist/src/Flex/Flex.d.ts +7 -3
- package/dist/src/Layout/Header.d.ts +17 -0
- package/dist/src/Layout/Header.story.d.ts +16 -0
- package/dist/src/Layout/Page.d.ts +2 -1
- package/dist/src/Layout/Page.story.d.ts +1 -0
- package/dist/src/Layout/index.d.ts +1 -0
- package/dist/src/NavBar/NavBar.d.ts +1 -1
- package/dist/src/Select/Select.d.ts +1 -1
- package/dist/src/Select/Select.story.d.ts +1 -0
- package/dist/src/Select/selectHelpers.d.ts +1 -0
- package/dist/src/Select/selectHelpers.spec.d.ts +1 -0
- package/dist/src/StatusIndicator/StatusIndicator.d.ts +7 -2
- package/dist/src/Summary/Summary.d.ts +6 -0
- package/dist/src/Summary/Summary.story.d.ts +16 -0
- package/dist/src/Summary/SummaryContext.d.ts +7 -0
- package/dist/src/Summary/SummaryDivider.d.ts +3 -0
- package/dist/src/Summary/SummaryItem.d.ts +7 -0
- package/dist/src/Summary/index.d.ts +1 -0
- package/dist/src/hooks/useMediaQuery.d.ts +2 -0
- package/dist/src/index.d.ts +1 -1
- package/package.json +3 -2
package/dist/main.module.js
CHANGED
|
@@ -19,6 +19,7 @@ import deepEqual from 'deep-equal';
|
|
|
19
19
|
import createContext$1 from 'create-react-context';
|
|
20
20
|
import ReactResizeDetector from 'react-resize-detector';
|
|
21
21
|
import WindowedSelect, { components as components$1 } from 'react-windowed-select';
|
|
22
|
+
import regeneratorRuntime from 'regenerator-runtime';
|
|
22
23
|
import reactDom, { findDOMNode, createPortal } from 'react-dom';
|
|
23
24
|
import exenv from 'exenv';
|
|
24
25
|
import smoothscroll from 'smoothscroll-polyfill';
|
|
@@ -250,7 +251,7 @@ function I18nextProvider(_ref) {
|
|
|
250
251
|
|
|
251
252
|
/**
|
|
252
253
|
* Do not edit directly
|
|
253
|
-
* Generated on
|
|
254
|
+
* Generated on Thu, 01 Dec 2022 21:44:24 GMT
|
|
254
255
|
*/
|
|
255
256
|
|
|
256
257
|
const color_base_black = "#011e38";
|
|
@@ -283,7 +284,7 @@ const line_height_base = "1.5";
|
|
|
283
284
|
const line_height_small_text_base = "1.71428571";
|
|
284
285
|
const line_height_small_text_compressed = "1.14285714";
|
|
285
286
|
const line_height_smaller_text = "1.33333333";
|
|
286
|
-
const line_height_heading_1 = "1.
|
|
287
|
+
const line_height_heading_1 = "1.25";
|
|
287
288
|
const line_height_heading_2 = "1.33";
|
|
288
289
|
const line_height_heading_3 = "1.33";
|
|
289
290
|
const line_height_heading_4 = "1.33";
|
|
@@ -314,8 +315,8 @@ const size_font_small = "14px";
|
|
|
314
315
|
const size_font_medium = "16px";
|
|
315
316
|
const size_font_large = "24px";
|
|
316
317
|
const size_font_larger = "30px";
|
|
317
|
-
const size_font_largest = "
|
|
318
|
-
const size_font_heading_1 = "
|
|
318
|
+
const size_font_largest = "32px";
|
|
319
|
+
const size_font_heading_1 = "32px";
|
|
319
320
|
const size_font_heading_2 = "30px";
|
|
320
321
|
const size_font_heading_3 = "24px";
|
|
321
322
|
const size_font_heading_4 = "18px";
|
|
@@ -11684,7 +11685,20 @@ var Flex = styled(Box).withConfig({
|
|
|
11684
11685
|
componentId: "sc-1whlq91-0"
|
|
11685
11686
|
})({
|
|
11686
11687
|
display: "flex"
|
|
11687
|
-
},
|
|
11688
|
+
}, system({
|
|
11689
|
+
gap: {
|
|
11690
|
+
property: "gap",
|
|
11691
|
+
scale: "space"
|
|
11692
|
+
},
|
|
11693
|
+
rowGap: {
|
|
11694
|
+
property: "rowGap",
|
|
11695
|
+
scale: "space"
|
|
11696
|
+
},
|
|
11697
|
+
columnGap: {
|
|
11698
|
+
property: "columnGap",
|
|
11699
|
+
scale: "space"
|
|
11700
|
+
}
|
|
11701
|
+
}), flexbox);
|
|
11688
11702
|
|
|
11689
11703
|
/*! *****************************************************************************
|
|
11690
11704
|
Copyright (c) Microsoft Corporation.
|
|
@@ -11711,6 +11725,16 @@ function __rest(s, e) {
|
|
|
11711
11725
|
t[p[i]] = s[p[i]];
|
|
11712
11726
|
}
|
|
11713
11727
|
return t;
|
|
11728
|
+
}
|
|
11729
|
+
|
|
11730
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
11731
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
11732
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11733
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11734
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11735
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11736
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11737
|
+
});
|
|
11714
11738
|
}
|
|
11715
11739
|
|
|
11716
11740
|
var prefix = "random-id-";
|
|
@@ -22956,6 +22980,8 @@ var SelectOption = function SelectOption(props) {
|
|
|
22956
22980
|
}), /*#__PURE__*/React__default.createElement(components$1.Option, Object.assign({}, props)));
|
|
22957
22981
|
};
|
|
22958
22982
|
|
|
22983
|
+
var regenerator = regeneratorRuntime;
|
|
22984
|
+
|
|
22959
22985
|
var getBorderColor = function getBorderColor(_ref) {
|
|
22960
22986
|
var errored = _ref.errored,
|
|
22961
22987
|
disabled = _ref.disabled,
|
|
@@ -23169,6 +23195,20 @@ var customStyles = function customStyles(_ref4) {
|
|
|
23169
23195
|
};
|
|
23170
23196
|
};
|
|
23171
23197
|
|
|
23198
|
+
var extractValuesFromCsvString = function extractValuesFromCsvString(csv) {
|
|
23199
|
+
var quoteRegEx = /(["'])(?:(?=(\\?))\2.)*?\1/gim;
|
|
23200
|
+
var matchedValues = csv.match(quoteRegEx) || [];
|
|
23201
|
+
var quotedValues = matchedValues.map(function (str) {
|
|
23202
|
+
return str.replace(/(["',])/g, "");
|
|
23203
|
+
});
|
|
23204
|
+
var values = Array.from(new Set(csv.replace(quoteRegEx, "").split(",").map(function (value) {
|
|
23205
|
+
return value.trim();
|
|
23206
|
+
}).filter(function (str) {
|
|
23207
|
+
return str.length > 0;
|
|
23208
|
+
}).concat(quotedValues)));
|
|
23209
|
+
return values;
|
|
23210
|
+
};
|
|
23211
|
+
|
|
23172
23212
|
var SelectControl = function SelectControl(props) {
|
|
23173
23213
|
// eslint-disable-next-line react/prop-types
|
|
23174
23214
|
var isFocused = props.isFocused;
|
|
@@ -23241,61 +23281,7 @@ var SelectDefaultProps = {
|
|
|
23241
23281
|
components: undefined,
|
|
23242
23282
|
closeMenuOnSelect: true
|
|
23243
23283
|
};
|
|
23244
|
-
|
|
23245
|
-
var checkOptionsAreValid = function checkOptionsAreValid(options) {
|
|
23246
|
-
if (options && process.env.NODE_ENV === "development") {
|
|
23247
|
-
var uniq = function uniq(a) {
|
|
23248
|
-
return Array.from(new Set(a));
|
|
23249
|
-
};
|
|
23250
|
-
|
|
23251
|
-
var uniqueValues = uniq(options.map(function (_ref) {
|
|
23252
|
-
var value = _ref.value;
|
|
23253
|
-
return value === null ? "_null_" : value;
|
|
23254
|
-
}));
|
|
23255
|
-
|
|
23256
|
-
if (uniqueValues.length < options.length) {
|
|
23257
|
-
console.warn("NDS: The options prop passed to Select must have unique values for each option", options);
|
|
23258
|
-
}
|
|
23259
|
-
}
|
|
23260
|
-
};
|
|
23261
|
-
|
|
23262
|
-
var getOption = function getOption(options, value) {
|
|
23263
|
-
// allows an option with a null value to be matched
|
|
23264
|
-
if (options.length > 0 && value !== undefined) {
|
|
23265
|
-
var optionWithMatchingValue = options.find(function (o) {
|
|
23266
|
-
return o.value === value;
|
|
23267
|
-
});
|
|
23268
|
-
return optionWithMatchingValue || null;
|
|
23269
|
-
}
|
|
23270
|
-
|
|
23271
|
-
return value;
|
|
23272
|
-
};
|
|
23273
|
-
|
|
23274
|
-
var getReactSelectValue = function getReactSelectValue(options, input) {
|
|
23275
|
-
if (Array.isArray(input)) {
|
|
23276
|
-
return input.map(function (i) {
|
|
23277
|
-
return getOption(options, i);
|
|
23278
|
-
});
|
|
23279
|
-
}
|
|
23280
|
-
|
|
23281
|
-
return getOption(options, input);
|
|
23282
|
-
};
|
|
23283
|
-
|
|
23284
|
-
var extractValue = function extractValue(options, isMulti) {
|
|
23285
|
-
if (isMulti) {
|
|
23286
|
-
return options && options.length ? options.map(function (o) {
|
|
23287
|
-
return o.value;
|
|
23288
|
-
}) : [];
|
|
23289
|
-
}
|
|
23290
|
-
|
|
23291
|
-
if (options == null) {
|
|
23292
|
-
return options;
|
|
23293
|
-
} else {
|
|
23294
|
-
return options.value;
|
|
23295
|
-
}
|
|
23296
|
-
};
|
|
23297
|
-
|
|
23298
|
-
var ReactSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
23284
|
+
var ReactSelect = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
|
|
23299
23285
|
var autocomplete = _a.autocomplete,
|
|
23300
23286
|
options = _a.options,
|
|
23301
23287
|
labelText = _a.labelText,
|
|
@@ -23324,17 +23310,83 @@ var ReactSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
23324
23310
|
var _useTranslation = useTranslation(),
|
|
23325
23311
|
t = _useTranslation.t;
|
|
23326
23312
|
|
|
23327
|
-
var themeContext = useContext(ThemeContext$1);
|
|
23313
|
+
var themeContext = React__default.useContext(ThemeContext$1);
|
|
23328
23314
|
var spaceProps = getSubset(props, propTypes.space);
|
|
23329
|
-
|
|
23315
|
+
var reactSelectRef = React__default.useRef(null);
|
|
23316
|
+
React__default.useEffect(function () {
|
|
23330
23317
|
checkOptionsAreValid(options);
|
|
23331
23318
|
}, [options]);
|
|
23319
|
+
var handleChange = React__default.useCallback(function (option) {
|
|
23320
|
+
onChange && onChange(extractValue(option, multiselect));
|
|
23321
|
+
}, [multiselect, onChange]);
|
|
23322
|
+
var handlePaste = React__default.useCallback(function (e) {
|
|
23323
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
23324
|
+
var currentRef, currentValue, clipboardData, values, notExistingOptions, pastedOptions, newValue;
|
|
23325
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
23326
|
+
while (1) {
|
|
23327
|
+
switch (_context.prev = _context.next) {
|
|
23328
|
+
case 0:
|
|
23329
|
+
e.preventDefault();
|
|
23330
|
+
currentRef = reactSelectRef.current;
|
|
23331
|
+
currentValue = currentRef.state.value || [];
|
|
23332
|
+
clipboardData = e.clipboardData.getData("text/plain") || "";
|
|
23333
|
+
values = extractValuesFromCsvString(clipboardData);
|
|
23334
|
+
notExistingOptions = [];
|
|
23335
|
+
pastedOptions = values.map(function (pastedOption) {
|
|
23336
|
+
var existingOption = options.find(function (option) {
|
|
23337
|
+
return option.label === pastedOption || option.value === pastedOption;
|
|
23338
|
+
});
|
|
23339
|
+
|
|
23340
|
+
if (existingOption) {
|
|
23341
|
+
return existingOption;
|
|
23342
|
+
}
|
|
23343
|
+
|
|
23344
|
+
notExistingOptions.push(pastedOption);
|
|
23345
|
+
return null;
|
|
23346
|
+
}).filter(Boolean).filter(function (pastedOption) {
|
|
23347
|
+
return (// ignoring already selected options
|
|
23348
|
+
currentValue.findIndex(function (option) {
|
|
23349
|
+
return pastedOption.value === option.value;
|
|
23350
|
+
}) === -1
|
|
23351
|
+
);
|
|
23352
|
+
});
|
|
23353
|
+
newValue = [].concat(currentValue, pastedOptions);
|
|
23354
|
+
currentRef.setState(function (prevState) {
|
|
23355
|
+
return Object.assign(Object.assign({}, prevState), {
|
|
23356
|
+
value: newValue,
|
|
23357
|
+
inputValue: notExistingOptions.join(", ")
|
|
23358
|
+
});
|
|
23359
|
+
});
|
|
23360
|
+
handleChange(newValue);
|
|
23361
|
+
|
|
23362
|
+
case 10:
|
|
23363
|
+
case "end":
|
|
23364
|
+
return _context.stop();
|
|
23365
|
+
}
|
|
23366
|
+
}
|
|
23367
|
+
}, _callee);
|
|
23368
|
+
}));
|
|
23369
|
+
}, [options]);
|
|
23370
|
+
|
|
23371
|
+
var _SelectInput = React__default.useCallback(function (inputProps) {
|
|
23372
|
+
return /*#__PURE__*/React__default.createElement(SelectInput, Object.assign({}, inputProps, multiselect ? {
|
|
23373
|
+
onPaste: handlePaste
|
|
23374
|
+
} : {}));
|
|
23375
|
+
}, [handlePaste, multiselect]);
|
|
23376
|
+
|
|
23377
|
+
React__default.useEffect(function () {
|
|
23378
|
+
if (ref) {
|
|
23379
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
23380
|
+
// @ts-ignore
|
|
23381
|
+
ref.current = reactSelectRef.current;
|
|
23382
|
+
}
|
|
23383
|
+
}, [reactSelectRef, ref]);
|
|
23332
23384
|
return /*#__PURE__*/React__default.createElement(Field, Object.assign({}, spaceProps), /*#__PURE__*/React__default.createElement(MaybeFieldLabel, {
|
|
23333
23385
|
labelText: labelText,
|
|
23334
23386
|
requirementText: requirementText,
|
|
23335
23387
|
helpText: helpText
|
|
23336
23388
|
}, /*#__PURE__*/React__default.createElement(WindowedSelect, Object.assign({
|
|
23337
|
-
ref:
|
|
23389
|
+
ref: reactSelectRef,
|
|
23338
23390
|
placeholder: placeholder || t("select ..."),
|
|
23339
23391
|
windowThreshold: windowThreshold,
|
|
23340
23392
|
styles: customStyles({
|
|
@@ -23349,9 +23401,7 @@ var ReactSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
23349
23401
|
"aria-invalid": error,
|
|
23350
23402
|
defaultMenuIsOpen: initialIsOpen,
|
|
23351
23403
|
inputId: id,
|
|
23352
|
-
onChange:
|
|
23353
|
-
return onChange(extractValue(option, multiselect));
|
|
23354
|
-
},
|
|
23404
|
+
onChange: handleChange,
|
|
23355
23405
|
defaultValue: getReactSelectValue(options, defaultValue),
|
|
23356
23406
|
value: getReactSelectValue(options, value),
|
|
23357
23407
|
isMulti: multiselect,
|
|
@@ -23364,7 +23414,7 @@ var ReactSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
23364
23414
|
DropdownIndicator: SelectDropdownIndicator,
|
|
23365
23415
|
SelectContainer: SelectContainer$1,
|
|
23366
23416
|
Menu: SelectMenu,
|
|
23367
|
-
Input:
|
|
23417
|
+
Input: _SelectInput
|
|
23368
23418
|
}, components),
|
|
23369
23419
|
"aria-label": ariaLabel,
|
|
23370
23420
|
options: options,
|
|
@@ -23375,6 +23425,60 @@ var ReactSelect = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
23375
23425
|
errorList: errorList
|
|
23376
23426
|
})));
|
|
23377
23427
|
});
|
|
23428
|
+
|
|
23429
|
+
var checkOptionsAreValid = function checkOptionsAreValid(options) {
|
|
23430
|
+
if (options && process.env.NODE_ENV === "development") {
|
|
23431
|
+
var uniq = function uniq(a) {
|
|
23432
|
+
return Array.from(new Set(a));
|
|
23433
|
+
};
|
|
23434
|
+
|
|
23435
|
+
var uniqueValues = uniq(options.map(function (_ref) {
|
|
23436
|
+
var value = _ref.value;
|
|
23437
|
+
return value === null ? "_null_" : value;
|
|
23438
|
+
}));
|
|
23439
|
+
|
|
23440
|
+
if (uniqueValues.length < options.length) {
|
|
23441
|
+
console.warn("NDS: The options prop passed to Select must have unique values for each option", options);
|
|
23442
|
+
}
|
|
23443
|
+
}
|
|
23444
|
+
};
|
|
23445
|
+
|
|
23446
|
+
var getOption = function getOption(options, value) {
|
|
23447
|
+
// allows an option with a null value to be matched
|
|
23448
|
+
if (options.length > 0 && value !== undefined) {
|
|
23449
|
+
var optionWithMatchingValue = options.find(function (o) {
|
|
23450
|
+
return o.value === value;
|
|
23451
|
+
});
|
|
23452
|
+
return optionWithMatchingValue || null;
|
|
23453
|
+
}
|
|
23454
|
+
|
|
23455
|
+
return value;
|
|
23456
|
+
};
|
|
23457
|
+
|
|
23458
|
+
var getReactSelectValue = function getReactSelectValue(options, input) {
|
|
23459
|
+
if (Array.isArray(input)) {
|
|
23460
|
+
return input.map(function (i) {
|
|
23461
|
+
return getOption(options, i);
|
|
23462
|
+
});
|
|
23463
|
+
}
|
|
23464
|
+
|
|
23465
|
+
return getOption(options, input);
|
|
23466
|
+
};
|
|
23467
|
+
|
|
23468
|
+
var extractValue = function extractValue(options, isMulti) {
|
|
23469
|
+
if (isMulti) {
|
|
23470
|
+
return options && options.length ? options.map(function (o) {
|
|
23471
|
+
return o.value;
|
|
23472
|
+
}) : [];
|
|
23473
|
+
}
|
|
23474
|
+
|
|
23475
|
+
if (options == null) {
|
|
23476
|
+
return options;
|
|
23477
|
+
} else {
|
|
23478
|
+
return options.value;
|
|
23479
|
+
}
|
|
23480
|
+
};
|
|
23481
|
+
|
|
23378
23482
|
ReactSelect.defaultProps = Object.assign(Object.assign({}, SelectDefaultProps), {
|
|
23379
23483
|
windowThreshold: 300,
|
|
23380
23484
|
filterOption: undefined
|
|
@@ -42276,7 +42380,10 @@ var BreadcrumbsListItem = styled.li.withConfig({
|
|
|
42276
42380
|
listStyle: "none",
|
|
42277
42381
|
display: "inline-flex",
|
|
42278
42382
|
alignSelf: "center",
|
|
42279
|
-
color: theme.colors.
|
|
42383
|
+
color: theme.colors.midGrey,
|
|
42384
|
+
"a, p": {
|
|
42385
|
+
fontSize: theme.fontSizes.small
|
|
42386
|
+
},
|
|
42280
42387
|
"a:visited": {
|
|
42281
42388
|
color: theme.colors.darkBlue
|
|
42282
42389
|
}
|
|
@@ -42285,14 +42392,10 @@ var BreadcrumbsListItem = styled.li.withConfig({
|
|
|
42285
42392
|
|
|
42286
42393
|
var insertSeparators = function insertSeparators(items, className) {
|
|
42287
42394
|
return items.reduce(function (acc, current, index) {
|
|
42288
|
-
return acc.concat(current,
|
|
42289
|
-
/*#__PURE__*/
|
|
42290
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
42291
|
-
React__default.createElement(BreadcrumbsListItem, {
|
|
42395
|
+
return acc.concat(current, /*#__PURE__*/React__default.createElement(BreadcrumbsListItem, {
|
|
42292
42396
|
"aria-hidden": true,
|
|
42293
42397
|
key: "separator-" + index,
|
|
42294
|
-
className: className
|
|
42295
|
-
px: "x1"
|
|
42398
|
+
className: className
|
|
42296
42399
|
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
42297
42400
|
icon: "rightArrow"
|
|
42298
42401
|
})));
|
|
@@ -42304,18 +42407,14 @@ var Breadcrumbs = function Breadcrumbs(_a) {
|
|
|
42304
42407
|
as = _a.as,
|
|
42305
42408
|
props = __rest(_a, ["children", "as"]);
|
|
42306
42409
|
|
|
42307
|
-
var
|
|
42308
|
-
|
|
42309
|
-
return (
|
|
42310
|
-
|
|
42311
|
-
|
|
42312
|
-
|
|
42313
|
-
|
|
42314
|
-
|
|
42315
|
-
color: "darkBlue"
|
|
42316
|
-
}))
|
|
42317
|
-
);
|
|
42318
|
-
});
|
|
42410
|
+
var allItems = React__default.Children.map(children, function (child, index) {
|
|
42411
|
+
if (! /*#__PURE__*/isValidElement(child)) return null;
|
|
42412
|
+
return /*#__PURE__*/React__default.createElement(BreadcrumbsListItem, {
|
|
42413
|
+
key: "child-" + index
|
|
42414
|
+
}, /*#__PURE__*/React__default.cloneElement(child, {
|
|
42415
|
+
color: "darkBlue"
|
|
42416
|
+
}));
|
|
42417
|
+
}).filter(Boolean);
|
|
42319
42418
|
return /*#__PURE__*/React__default.createElement(Flex, Object.assign({
|
|
42320
42419
|
as: as
|
|
42321
42420
|
}, props), /*#__PURE__*/React__default.createElement(BreadcrumbsList, null, insertSeparators(allItems, "seperator")));
|
|
@@ -50621,30 +50720,127 @@ var ApplicationFrame = function ApplicationFrame(_a) {
|
|
|
50621
50720
|
}, children));
|
|
50622
50721
|
};
|
|
50623
50722
|
|
|
50723
|
+
var useMediaQuery = function useMediaQuery(query) {
|
|
50724
|
+
var _useState = useState(window.matchMedia(query).matches),
|
|
50725
|
+
matches = _useState[0],
|
|
50726
|
+
setMatches = _useState[1];
|
|
50727
|
+
|
|
50728
|
+
useEffect(function () {
|
|
50729
|
+
var handler = function handler(e) {
|
|
50730
|
+
setMatches(e.matches);
|
|
50731
|
+
};
|
|
50732
|
+
|
|
50733
|
+
window.matchMedia(query).addEventListener("change", handler);
|
|
50734
|
+
return function () {
|
|
50735
|
+
window.removeEventListener("change", handler);
|
|
50736
|
+
};
|
|
50737
|
+
}, []);
|
|
50738
|
+
return matches;
|
|
50739
|
+
};
|
|
50740
|
+
|
|
50741
|
+
var Header = function Header(_a) {
|
|
50742
|
+
var _b, _c;
|
|
50743
|
+
|
|
50744
|
+
var _a$background = _a.background,
|
|
50745
|
+
background = _a$background === void 0 ? "whiteGrey" : _a$background,
|
|
50746
|
+
renderBreadcrumbs = _a.renderBreadcrumbs,
|
|
50747
|
+
title = _a.title,
|
|
50748
|
+
_a$undecorated = _a.undecorated,
|
|
50749
|
+
undecorated = _a$undecorated === void 0 ? false : _a$undecorated,
|
|
50750
|
+
children = _a.children,
|
|
50751
|
+
subtitle = _a.subtitle,
|
|
50752
|
+
breakpoints = _a.breakpoints,
|
|
50753
|
+
renderActions = _a.renderActions,
|
|
50754
|
+
renderSummary = _a.renderSummary,
|
|
50755
|
+
rest = __rest(_a, ["background", "renderBreadcrumbs", "title", "undecorated", "children", "subtitle", "breakpoints", "renderActions", "renderSummary"]);
|
|
50756
|
+
|
|
50757
|
+
var theme = useTheme();
|
|
50758
|
+
var smallBreakpoint = pixelDigitsFrom$1((_b = breakpoints === null || breakpoints === void 0 ? void 0 : breakpoints.small) !== null && _b !== void 0 ? _b : theme.breakpoints.small);
|
|
50759
|
+
var mediumBreakpoint = pixelDigitsFrom$1((_c = breakpoints === null || breakpoints === void 0 ? void 0 : breakpoints.medium) !== null && _c !== void 0 ? _c : theme.breakpoints.medium);
|
|
50760
|
+
var m = useMediaQuery("(max-width: " + mediumBreakpoint + "px)");
|
|
50761
|
+
var sm = useMediaQuery("(max-width: " + smallBreakpoint + "px)");
|
|
50762
|
+
return /*#__PURE__*/React__default.createElement(Flex, Object.assign({
|
|
50763
|
+
py: "x1",
|
|
50764
|
+
px: "x3",
|
|
50765
|
+
gap: "x2",
|
|
50766
|
+
position: "relative",
|
|
50767
|
+
bg: background
|
|
50768
|
+
}, rest), /*#__PURE__*/React__default.createElement(Flex, {
|
|
50769
|
+
flexGrow: 3,
|
|
50770
|
+
justifyContent: "space-between",
|
|
50771
|
+
flexDirection: m || sm ? "column" : "row",
|
|
50772
|
+
zIndex: "content"
|
|
50773
|
+
}, /*#__PURE__*/React__default.createElement(Flex, {
|
|
50774
|
+
flexDirection: "column"
|
|
50775
|
+
}, renderBreadcrumbs && renderBreadcrumbs(), /*#__PURE__*/React__default.createElement(Flex, {
|
|
50776
|
+
gap: !sm ? "x2" : undefined,
|
|
50777
|
+
flexDirection: !sm ? "row" : "column",
|
|
50778
|
+
alignItems: !sm ? "center" : undefined
|
|
50779
|
+
}, /*#__PURE__*/React__default.createElement(Flex, {
|
|
50780
|
+
alignItems: !sm ? "flex-end" : undefined,
|
|
50781
|
+
gap: !sm ? "x2" : undefined,
|
|
50782
|
+
flexDirection: !sm ? "row" : "column"
|
|
50783
|
+
}, title && /*#__PURE__*/React__default.createElement(Heading1, {
|
|
50784
|
+
mb: "0"
|
|
50785
|
+
}, title), subtitle && /*#__PURE__*/React__default.createElement(Text, {
|
|
50786
|
+
pl: !sm ? "x2" : undefined,
|
|
50787
|
+
borderLeft: !sm ? "1px solid" : "none",
|
|
50788
|
+
my: "half",
|
|
50789
|
+
borderColor: "grey"
|
|
50790
|
+
}, subtitle)), children && children)), renderSummary && renderSummary()), renderActions && /*#__PURE__*/React__default.createElement(Flex, {
|
|
50791
|
+
display: "flex",
|
|
50792
|
+
flexGrow: 0,
|
|
50793
|
+
alignItems: "flex-start",
|
|
50794
|
+
zIndex: "content"
|
|
50795
|
+
}, renderActions()), !undecorated && /*#__PURE__*/React__default.createElement(BackgroundTriangles, {
|
|
50796
|
+
zIndex: 1
|
|
50797
|
+
}));
|
|
50798
|
+
};
|
|
50799
|
+
|
|
50800
|
+
var RightAngleTriangle = styled(Box).withConfig({
|
|
50801
|
+
displayName: "Header__RightAngleTriangle",
|
|
50802
|
+
componentId: "sc-1kuwqm0-0"
|
|
50803
|
+
})(["position:absolute;bottom:0;right:0;width:100%;clip-path:polygon(100% 0,0 100%,100% 100%);"]);
|
|
50804
|
+
|
|
50805
|
+
var BackgroundTriangles = function BackgroundTriangles(props) {
|
|
50806
|
+
var theme = useTheme();
|
|
50807
|
+
return /*#__PURE__*/React__default.createElement(Box, Object.assign({
|
|
50808
|
+
position: "absolute",
|
|
50809
|
+
bottom: 0,
|
|
50810
|
+
right: 0,
|
|
50811
|
+
height: "100%",
|
|
50812
|
+
minWidth: "55%"
|
|
50813
|
+
}, props), /*#__PURE__*/React__default.createElement(RightAngleTriangle, {
|
|
50814
|
+
height: "33.33%",
|
|
50815
|
+
opacity: "0.5",
|
|
50816
|
+
background: "linear-gradient(178.25deg, rgba(192, 200, 209, 0.5) 62.98%, rgba(225, 235, 250, 0.25) 98.52%)"
|
|
50817
|
+
}), /*#__PURE__*/React__default.createElement(RightAngleTriangle, {
|
|
50818
|
+
height: "17%",
|
|
50819
|
+
opacity: "0.25",
|
|
50820
|
+
background: "linear-gradient(196.88deg, " + theme.colors.grey + " 11.92%, rgba(0, 67, 143, 0) 88.36%)"
|
|
50821
|
+
}));
|
|
50822
|
+
};
|
|
50823
|
+
|
|
50624
50824
|
var Page = function Page(_a) {
|
|
50625
50825
|
var breadcrumbs = _a.breadcrumbs,
|
|
50626
50826
|
title = _a.title,
|
|
50627
50827
|
children = _a.children,
|
|
50628
50828
|
headerContent = _a.headerContent,
|
|
50629
50829
|
fullHeight = _a.fullHeight,
|
|
50630
|
-
|
|
50830
|
+
renderHeader = _a.renderHeader,
|
|
50831
|
+
rest = __rest(_a, ["breadcrumbs", "title", "children", "headerContent", "fullHeight", "renderHeader"]);
|
|
50631
50832
|
|
|
50632
50833
|
return /*#__PURE__*/React__default.createElement(Flex, Object.assign({
|
|
50633
50834
|
flexDirection: "column",
|
|
50634
|
-
py: "x3",
|
|
50635
|
-
px: "x3",
|
|
50636
50835
|
flexGrow: fullHeight ? 1 : 0
|
|
50637
|
-
},
|
|
50638
|
-
|
|
50639
|
-
|
|
50640
|
-
|
|
50641
|
-
|
|
50642
|
-
},
|
|
50643
|
-
|
|
50644
|
-
|
|
50645
|
-
flexGrow: 1,
|
|
50646
|
-
ml: "x1"
|
|
50647
|
-
}, headerContent)), children);
|
|
50836
|
+
}, rest), renderHeader ? renderHeader() : (breadcrumbs || title || headerContent) && /*#__PURE__*/React__default.createElement(Header, {
|
|
50837
|
+
renderBreadcrumbs: function renderBreadcrumbs() {
|
|
50838
|
+
return breadcrumbs;
|
|
50839
|
+
},
|
|
50840
|
+
title: title
|
|
50841
|
+
}, headerContent), /*#__PURE__*/React__default.createElement(Box, {
|
|
50842
|
+
p: "x3"
|
|
50843
|
+
}, children));
|
|
50648
50844
|
};
|
|
50649
50845
|
|
|
50650
50846
|
var focusFirstElement = function focusFirstElement() {
|
|
@@ -50947,4 +51143,4 @@ var SortingTable = function SortingTable(_a) {
|
|
|
50947
51143
|
}, props));
|
|
50948
51144
|
};
|
|
50949
51145
|
|
|
50950
|
-
export { ALL_NDS_LOCALES, Alert, AnimatedBox, ApplicationFrame, AsyncSelect, Box, BrandLogoContainer, NavBar as BrandedNavBar, Branding, Breadcrumbs, Button, ButtonGroup, Card, CardSet, Checkbox, CheckboxGroup, ControlIcon, DangerButton, DatePicker, DateRange, DesktopMenu, Divider, DropdownButton, DropdownItem, DropdownLink, DropdownMenu, DropdownText, EnvironmentBanner, Field, FieldLabel, Fieldset, Flex, Form, FormSection, Heading1, Heading2, Heading3, Heading4, HelpText, Icon, IconicButton, InlineIcon, InlineValidation, Input$1 as Input, Link, List, ListItem, LoadingAnimation, MenuTrigger, Modal, NDSProvider, NavBar$1 as NavBar, NavBarBackground, Overlay, Page, Pagination, PrimaryButton, QuietButton, Radio, RadioGroup, RangeContainer, RequirementText, ReactSelect as Select, SelectClearIndicator, SelectContainer$1 as SelectContainer, SelectControl, SelectDropdownIndicator, SelectInput, SelectMenu, SelectMultiValue, SelectOption, Sidebar, SmallNavBar, SortingTable, StatusIndicator, Switch, Switcher, Tab, Table, Tabs, Text, Textarea, TimePicker, TimeRange, Toast, ToggleComponent as Toggle, Tooltip, TruncatedText, addStyledProps, Theme as theme, useWindowDimensions };
|
|
51146
|
+
export { ALL_NDS_LOCALES, Alert, AnimatedBox, ApplicationFrame, AsyncSelect, Box, BrandLogoContainer, NavBar as BrandedNavBar, Branding, Breadcrumbs, Button, ButtonGroup, Card, CardSet, Checkbox, CheckboxGroup, ControlIcon, DangerButton, DatePicker, DateRange, DesktopMenu, Divider, DropdownButton, DropdownItem, DropdownLink, DropdownMenu, DropdownText, EnvironmentBanner, Field, FieldLabel, Fieldset, Flex, Form, FormSection, Header, Heading1, Heading2, Heading3, Heading4, HelpText, Icon, IconicButton, InlineIcon, InlineValidation, Input$1 as Input, Link, List, ListItem, LoadingAnimation, MenuTrigger, Modal, NDSProvider, NavBar$1 as NavBar, NavBarBackground, Overlay, Page, Pagination, PrimaryButton, QuietButton, Radio, RadioGroup, RangeContainer, RequirementText, ReactSelect as Select, SelectClearIndicator, SelectContainer$1 as SelectContainer, SelectControl, SelectDropdownIndicator, SelectInput, SelectMenu, SelectMultiValue, SelectOption, Sidebar, SmallNavBar, SortingTable, StatusIndicator, Switch, Switcher, Tab, Table, Tabs, Text, Textarea, TimePicker, TimeRange, Toast, ToggleComponent as Toggle, Tooltip, TruncatedText, addStyledProps, Theme as theme, useWindowDimensions };
|
|
@@ -4,5 +4,5 @@ import { StyledProps } from "../StyledProps";
|
|
|
4
4
|
export declare type NavBarBackgroundProps = {
|
|
5
5
|
theme?: DefaultNDSThemeType;
|
|
6
6
|
} & StyledProps;
|
|
7
|
-
declare const NavBarBackground: import("styled-components").StyledComponent<import("react").
|
|
7
|
+
declare const NavBarBackground: import("styled-components").StyledComponent<import("react").FC<import("../Flex/Flex").FlexProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
8
8
|
export default NavBarBackground;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { FlexProps } from "../Flex/Flex";
|
|
3
|
-
declare
|
|
4
|
-
children: any;
|
|
5
|
-
as?: string | undefined;
|
|
6
|
-
};
|
|
7
|
-
declare const Breadcrumbs: {
|
|
8
|
-
({ children, as, ...props }: BreadcrumbsProps): JSX.Element;
|
|
9
|
-
defaultProps: {
|
|
10
|
-
as: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
3
|
+
declare const Breadcrumbs: React.FC<FlexProps>;
|
|
13
4
|
export default Breadcrumbs;
|
package/dist/src/Flex/Flex.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
2
|
import { BoxProps } from "../Box/Box";
|
|
3
|
-
export declare type FlexProps = BoxProps
|
|
4
|
-
|
|
3
|
+
export declare type FlexProps = BoxProps & {
|
|
4
|
+
gap?: CSSProperties["gap"];
|
|
5
|
+
rowGap?: CSSProperties["rowGap"];
|
|
6
|
+
columnGap?: CSSProperties["columnGap"];
|
|
7
|
+
};
|
|
8
|
+
declare const Flex: React.FC<FlexProps>;
|
|
5
9
|
export default Flex;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { BoxProps } from "../Box/Box";
|
|
3
|
+
declare type Breakpoint = string | number;
|
|
4
|
+
declare type HeaderProps = BoxProps & {
|
|
5
|
+
renderBreadcrumbs?: () => React.ReactNode;
|
|
6
|
+
title?: string;
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
undecorated?: boolean;
|
|
9
|
+
renderActions?: () => React.ReactNode;
|
|
10
|
+
renderSummary?: () => React.ReactNode;
|
|
11
|
+
breakpoints?: {
|
|
12
|
+
small?: Breakpoint;
|
|
13
|
+
medium?: Breakpoint;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
declare const Header: React.FC<HeaderProps>;
|
|
17
|
+
export default Header;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const DefaultBackground: () => JSX.Element;
|
|
3
|
+
export declare const WithAnUndecoratedBackground: () => JSX.Element;
|
|
4
|
+
export declare const WithActions: () => JSX.Element;
|
|
5
|
+
export declare const WithCustomBackground: () => JSX.Element;
|
|
6
|
+
export declare const WithSubTitle: () => JSX.Element;
|
|
7
|
+
export declare const WithContent: () => JSX.Element;
|
|
8
|
+
export declare const WithSummary: () => JSX.Element;
|
|
9
|
+
export declare const WithEverything: () => JSX.Element;
|
|
10
|
+
declare const _default: {
|
|
11
|
+
title: string;
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -6,6 +6,7 @@ declare type PageProps = FlexProps & {
|
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
headerContent?: React.ReactNode;
|
|
8
8
|
fullHeight?: boolean;
|
|
9
|
+
renderHeader?: () => JSX.Element;
|
|
9
10
|
};
|
|
10
|
-
export declare const Page:
|
|
11
|
+
export declare const Page: React.FC<PageProps>;
|
|
11
12
|
export default Page;
|
|
@@ -9,4 +9,5 @@ export default _default;
|
|
|
9
9
|
export declare const _Page: () => JSX.Element;
|
|
10
10
|
export declare const NoPageTitle: () => JSX.Element;
|
|
11
11
|
export declare const NoBreadcrumbs: () => JSX.Element;
|
|
12
|
+
export declare const NoBackground: () => JSX.Element;
|
|
12
13
|
export declare const WithFullHeight: () => JSX.Element;
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { DefaultNDSThemeType } from "../theme.type";
|
|
4
4
|
export declare const getThemeColor: (themeColor: any) => any;
|
|
5
|
-
export declare const NavBarBackground: import("styled-components").StyledComponent<React.
|
|
5
|
+
export declare const NavBarBackground: import("styled-components").StyledComponent<React.FC<import("../Flex/Flex").FlexProps>, import("styled-components").DefaultTheme, {
|
|
6
6
|
backgroundColor: string;
|
|
7
7
|
theme?: DefaultNDSThemeType;
|
|
8
8
|
}, never>;
|
|
@@ -66,6 +66,6 @@ export declare const SelectDefaultProps: {
|
|
|
66
66
|
components: any;
|
|
67
67
|
closeMenuOnSelect: boolean;
|
|
68
68
|
};
|
|
69
|
-
export declare const getOption: (options: any, value: any) => any;
|
|
70
69
|
declare const ReactSelect: React.ForwardRefExoticComponent<Pick<SelectProps, React.ReactText> & React.RefAttributes<unknown>>;
|
|
70
|
+
export declare const getOption: (options: any, value: any) => any;
|
|
71
71
|
export default ReactSelect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const extractValuesFromCsvString: (csv: string) => string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|