@nnc-digital/nnc-design-system 0.4.29 → 0.4.30
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/build/index.esm.js +46 -44
- package/build/index.esm.js.map +1 -1
- package/build/index.js +46 -44
- package/build/index.js.map +1 -1
- package/build/library/components/BinCollection/BinCollection.styles.d.ts +1 -0
- package/build/library/components/TextInput/TextInput.types.d.ts +4 -0
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
|
@@ -4028,18 +4028,19 @@ var Button$4 = function (_a) {
|
|
|
4028
4028
|
};
|
|
4029
4029
|
|
|
4030
4030
|
var Container$17 = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n"])));
|
|
4031
|
-
styled.label(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n margin-bottom: 15px;\n"], ["\n display: block;\n margin-bottom: 15px;\n"])));
|
|
4032
|
-
var
|
|
4033
|
-
var
|
|
4031
|
+
var Label$5 = styled.label(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n margin-bottom: 15px;\n"], ["\n display: block;\n margin-bottom: 15px;\n"])));
|
|
4032
|
+
var VisuallyHiddenLabel = styled(Label$5)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n clip-path: inset(50%);\n border: 0;\n white-space: nowrap;\n"], ["\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n clip-path: inset(50%);\n border: 0;\n white-space: nowrap;\n"])));
|
|
4033
|
+
var BinCollectionButtonStyles = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n button {\n margin: 10px 10px 12px 10px;\n }\n"], ["\n button {\n margin: 10px 10px 12px 10px;\n }\n"])));
|
|
4034
|
+
var FormContainer$1 = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n ", "\n"], ["\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n ", "\n"])), function (props) {
|
|
4034
4035
|
return props.isLoading && "\n opacity: 0.5; \n pointer-events: none;\n ";
|
|
4035
4036
|
});
|
|
4036
|
-
var ErrorTextWrapper = styled.div(
|
|
4037
|
-
var DropDownSelectContainer = styled.div(
|
|
4038
|
-
var FormInnerContainer = styled.div(
|
|
4039
|
-
styled.label(
|
|
4040
|
-
styled.div(
|
|
4041
|
-
styled.input(
|
|
4042
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
|
4037
|
+
var ErrorTextWrapper = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: block;\n width: 100%;\n"], ["\n display: block;\n width: 100%;\n"])));
|
|
4038
|
+
var DropDownSelectContainer = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n padding-bottom: 20px;\n width: 90%;\n"], ["\n padding-bottom: 20px;\n width: 90%;\n"])));
|
|
4039
|
+
var FormInnerContainer = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n"], ["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n"])));
|
|
4040
|
+
styled.label(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-right: ", ";\n"], ["\n display: flex;\n align-items: center;\n margin-right: ", ";\n"])), function (props) { return props.theme.theme_vars.spacingSizes.small; });
|
|
4041
|
+
styled.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: flex;\n justify-content: left;\n margin-bottom: .5em;\n width: 100%;\n"], ["\n display: flex;\n justify-content: left;\n margin-bottom: .5em;\n width: 100%;\n"])));
|
|
4042
|
+
styled.input(templateObject_11 || (templateObject_11 = __makeTemplateObject([""], [""])));
|
|
4043
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
4043
4044
|
|
|
4044
4045
|
const Container$16 = styled.div`
|
|
4045
4046
|
display: flex;
|
|
@@ -4085,17 +4086,6 @@ var FormWithLine = function (_a) {
|
|
|
4085
4086
|
children)));
|
|
4086
4087
|
};
|
|
4087
4088
|
|
|
4088
|
-
/**
|
|
4089
|
-
* Primary UI component for user interaction
|
|
4090
|
-
* If value is set then treat as controlled component
|
|
4091
|
-
*/
|
|
4092
|
-
var Input$6 = function (_a) {
|
|
4093
|
-
var _b = _a.type, type = _b === void 0 ? 'text' : _b, _c = _a.placeholder, placeholder = _c === void 0 ? '' : _c, _d = _a.isErrored, isErrored = _d === void 0 ? false : _d, errorText = _a.errorText, name = _a.name, maxLength = _a.maxLength, defaultValue = _a.defaultValue, onChange = _a.onChange, id = _a.id, value = _a.value;
|
|
4094
|
-
return (React.createElement(React.Fragment, null,
|
|
4095
|
-
errorText && React.createElement(ErrorText$1, null, errorText),
|
|
4096
|
-
typeof value !== 'undefined' ? (React.createElement(StyledInput, { onChange: onChange, type: type, placeholder: placeholder, name: name, isErrored: isErrored, maxLength: maxLength, value: value, id: id })) : (React.createElement(StyledInput, { onChange: onChange, type: type, placeholder: placeholder, name: name, isErrored: isErrored, maxLength: maxLength, defaultValue: defaultValue, id: id }))));
|
|
4097
|
-
};
|
|
4098
|
-
|
|
4099
4089
|
const StyledButton = styled.button`
|
|
4100
4090
|
font-weight: 700;
|
|
4101
4091
|
border: none;
|
|
@@ -4491,7 +4481,8 @@ var BinCollection = function (_a) {
|
|
|
4491
4481
|
React.createElement(Heading, { level: 2, text: "Bin collection checker" }),
|
|
4492
4482
|
React.createElement(ErrorTextWrapper, null, errorText && React.createElement(ErrorText$1, null, errorText)),
|
|
4493
4483
|
React.createElement(FormInnerContainer, null,
|
|
4494
|
-
React.createElement(
|
|
4484
|
+
React.createElement(VisuallyHiddenLabel, { id: "postcode-label", htmlFor: "postcode-input" }, "Enter a postcode"),
|
|
4485
|
+
React.createElement(StyledTextInput, { type: "text", placeholder: "Enter a postcode", name: "postcode", id: "postcode-input", isErrored: isError, "aria-labelledby": "postcode-label", autoComplete: "postal-code" }),
|
|
4495
4486
|
React.createElement(BinCollectionButtonStyles, null,
|
|
4496
4487
|
React.createElement(FormButton, { size: "large", type: "submit", "aria-label": "Submit", text: "Find" }))))),
|
|
4497
4488
|
addressOptions.length > 0 && (React.createElement(DropDownSelectContainer, null,
|
|
@@ -13855,10 +13846,10 @@ let pico$1 = picocolors.exports;
|
|
|
13855
13846
|
|
|
13856
13847
|
let tokenizer$1 = tokenize;
|
|
13857
13848
|
|
|
13858
|
-
let Input$
|
|
13849
|
+
let Input$6;
|
|
13859
13850
|
|
|
13860
13851
|
function registerInput(dependant) {
|
|
13861
|
-
Input$
|
|
13852
|
+
Input$6 = dependant;
|
|
13862
13853
|
}
|
|
13863
13854
|
|
|
13864
13855
|
const HIGHLIGHT_THEME = {
|
|
@@ -13899,7 +13890,7 @@ function getTokenType([type, value], processor) {
|
|
|
13899
13890
|
}
|
|
13900
13891
|
|
|
13901
13892
|
function terminalHighlight$2(css) {
|
|
13902
|
-
let processor = tokenizer$1(new Input$
|
|
13893
|
+
let processor = tokenizer$1(new Input$6(css), { ignoreErrors: true });
|
|
13903
13894
|
let result = '';
|
|
13904
13895
|
while (!processor.endOfFile()) {
|
|
13905
13896
|
let token = processor.nextToken();
|
|
@@ -18286,7 +18277,7 @@ let fromOffsetCache = Symbol('fromOffsetCache');
|
|
|
18286
18277
|
let sourceMapAvailable$1 = Boolean(SourceMapConsumer$1 && SourceMapGenerator$1);
|
|
18287
18278
|
let pathAvailable$1 = Boolean(resolve$1 && isAbsolute);
|
|
18288
18279
|
|
|
18289
|
-
class Input$
|
|
18280
|
+
class Input$5 {
|
|
18290
18281
|
constructor(css, opts = {}) {
|
|
18291
18282
|
if (
|
|
18292
18283
|
css === null ||
|
|
@@ -18512,18 +18503,18 @@ class Input$4 {
|
|
|
18512
18503
|
}
|
|
18513
18504
|
}
|
|
18514
18505
|
|
|
18515
|
-
var input = Input$
|
|
18516
|
-
Input$
|
|
18506
|
+
var input = Input$5;
|
|
18507
|
+
Input$5.default = Input$5;
|
|
18517
18508
|
|
|
18518
18509
|
if (terminalHighlight && terminalHighlight.registerInput) {
|
|
18519
|
-
terminalHighlight.registerInput(Input$
|
|
18510
|
+
terminalHighlight.registerInput(Input$5);
|
|
18520
18511
|
}
|
|
18521
18512
|
|
|
18522
18513
|
let { SourceMapConsumer, SourceMapGenerator } = sourceMap;
|
|
18523
18514
|
let { dirname, resolve, relative, sep } = require$$2;
|
|
18524
18515
|
let { pathToFileURL } = require$$1$1;
|
|
18525
18516
|
|
|
18526
|
-
let Input$
|
|
18517
|
+
let Input$4 = input;
|
|
18527
18518
|
|
|
18528
18519
|
let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
|
|
18529
18520
|
let pathAvailable = Boolean(dirname && resolve && relative && sep);
|
|
@@ -18558,7 +18549,7 @@ class MapGenerator$2 {
|
|
|
18558
18549
|
}
|
|
18559
18550
|
});
|
|
18560
18551
|
} else {
|
|
18561
|
-
let input = new Input$
|
|
18552
|
+
let input = new Input$4(this.css, this.opts);
|
|
18562
18553
|
if (input.map) this.previousMaps.push(input.map);
|
|
18563
18554
|
}
|
|
18564
18555
|
}
|
|
@@ -20198,10 +20189,10 @@ var parser = Parser$1;
|
|
|
20198
20189
|
|
|
20199
20190
|
let Container$P = container;
|
|
20200
20191
|
let Parser = parser;
|
|
20201
|
-
let Input$
|
|
20192
|
+
let Input$3 = input;
|
|
20202
20193
|
|
|
20203
20194
|
function parse$3(css, opts) {
|
|
20204
|
-
let input = new Input$
|
|
20195
|
+
let input = new Input$3(css, opts);
|
|
20205
20196
|
let parser = new Parser(input);
|
|
20206
20197
|
try {
|
|
20207
20198
|
parser.parse();
|
|
@@ -20990,7 +20981,7 @@ let Declaration$1 = declaration;
|
|
|
20990
20981
|
let PreviousMap = previousMap;
|
|
20991
20982
|
let Comment$1 = comment;
|
|
20992
20983
|
let AtRule$1 = atRule;
|
|
20993
|
-
let Input$
|
|
20984
|
+
let Input$2 = input;
|
|
20994
20985
|
let Root$1 = root;
|
|
20995
20986
|
let Rule$1 = rule;
|
|
20996
20987
|
|
|
@@ -21001,7 +20992,7 @@ function fromJSON$1(json, inputs) {
|
|
|
21001
20992
|
if (ownInputs) {
|
|
21002
20993
|
inputs = [];
|
|
21003
20994
|
for (let input of ownInputs) {
|
|
21004
|
-
let inputHydrated = { ...input, __proto__: Input$
|
|
20995
|
+
let inputHydrated = { ...input, __proto__: Input$2.prototype };
|
|
21005
20996
|
if (inputHydrated.map) {
|
|
21006
20997
|
inputHydrated.map = {
|
|
21007
20998
|
...inputHydrated.map,
|
|
@@ -21051,7 +21042,7 @@ let Warning = warning;
|
|
|
21051
21042
|
let Comment = comment;
|
|
21052
21043
|
let AtRule = atRule;
|
|
21053
21044
|
let Result$1 = result;
|
|
21054
|
-
let Input = input;
|
|
21045
|
+
let Input$1 = input;
|
|
21055
21046
|
let parse = parse_1;
|
|
21056
21047
|
let list = list_1;
|
|
21057
21048
|
let Rule = rule;
|
|
@@ -21129,7 +21120,7 @@ postcss.Comment = Comment;
|
|
|
21129
21120
|
postcss.Warning = Warning;
|
|
21130
21121
|
postcss.AtRule = AtRule;
|
|
21131
21122
|
postcss.Result = Result$1;
|
|
21132
|
-
postcss.Input = Input;
|
|
21123
|
+
postcss.Input = Input$1;
|
|
21133
21124
|
postcss.Rule = Rule;
|
|
21134
21125
|
postcss.Root = Root;
|
|
21135
21126
|
postcss.Node = Node;
|
|
@@ -23483,6 +23474,17 @@ const SubmitButton = styled.input`
|
|
|
23483
23474
|
}
|
|
23484
23475
|
`;
|
|
23485
23476
|
|
|
23477
|
+
/**
|
|
23478
|
+
* Primary UI component for user interaction
|
|
23479
|
+
* If value is set then treat as controlled component
|
|
23480
|
+
*/
|
|
23481
|
+
var Input = function (_a) {
|
|
23482
|
+
var _b = _a.type, type = _b === void 0 ? 'text' : _b, _c = _a.placeholder, placeholder = _c === void 0 ? '' : _c, _d = _a.isErrored, isErrored = _d === void 0 ? false : _d, errorText = _a.errorText, name = _a.name, maxLength = _a.maxLength, defaultValue = _a.defaultValue, onChange = _a.onChange, id = _a.id, value = _a.value;
|
|
23483
|
+
return (React.createElement(React.Fragment, null,
|
|
23484
|
+
errorText && React.createElement(ErrorText$1, null, errorText),
|
|
23485
|
+
typeof value !== 'undefined' ? (React.createElement(StyledInput, { onChange: onChange, type: type, placeholder: placeholder, name: name, isErrored: isErrored, maxLength: maxLength, value: value, id: id })) : (React.createElement(StyledInput, { onChange: onChange, type: type, placeholder: placeholder, name: name, isErrored: isErrored, maxLength: maxLength, defaultValue: defaultValue, id: id }))));
|
|
23486
|
+
};
|
|
23487
|
+
|
|
23486
23488
|
var CustomSearch = function (_a) {
|
|
23487
23489
|
var method = _a.method, path = _a.path, label = _a.label, _b = _a.hasHiddenLabel, hasHiddenLabel = _b === void 0 ? true : _b, fieldName = _a.fieldName, placeholder = _a.placeholder, searchText = _a.searchText, id = _a.id;
|
|
23488
23490
|
if (!id) {
|
|
@@ -23493,7 +23495,7 @@ var CustomSearch = function (_a) {
|
|
|
23493
23495
|
React.createElement("div", { role: "search" },
|
|
23494
23496
|
React.createElement(Label$3, { htmlFor: id, hasHiddenLabel: hasHiddenLabel }, label),
|
|
23495
23497
|
React.createElement(InputWrapper$1, null,
|
|
23496
|
-
React.createElement(Input
|
|
23498
|
+
React.createElement(Input, { name: fieldName, placeholder: placeholder, id: id }),
|
|
23497
23499
|
React.createElement(SubmitButton, { type: "submit", value: searchText }))))));
|
|
23498
23500
|
};
|
|
23499
23501
|
|
|
@@ -28058,7 +28060,7 @@ var PostCodeSearch = function (_a) {
|
|
|
28058
28060
|
React.createElement(Label$2, { htmlFor: "postcode" },
|
|
28059
28061
|
"Enter your postcode",
|
|
28060
28062
|
React.createElement(HintText, { text: themeContext.cardinal_name === 'north' ? 'For example NN16 0AP' : 'For example NN1 1DE' }),
|
|
28061
|
-
React.createElement(Input
|
|
28063
|
+
React.createElement(Input, { type: "text", placeholder: "Enter a postcode", name: "postcode", errorText: errorText, isErrored: isError, maxLength: 10 })),
|
|
28062
28064
|
React.createElement(FormButton, { type: "submit", "aria-label": "Submit", text: "Find" })))) : (React.createElement(PostcodeResult, null,
|
|
28063
28065
|
React.createElement(Line, null),
|
|
28064
28066
|
isMultiple ? (React.createElement("div", { className: "result" },
|
|
@@ -30316,13 +30318,13 @@ var DirectoryServiceList = function (_a) {
|
|
|
30316
30318
|
React.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
|
|
30317
30319
|
React.createElement(Label$1, { htmlFor: "directorySearch" }, "What are you looking for?"),
|
|
30318
30320
|
React.createElement(HintText, { text: "Enter a search word or phrase" }),
|
|
30319
|
-
React.createElement(Input
|
|
30321
|
+
React.createElement(Input, { name: "directorySearch", type: "text", defaultValue: searchTerm, id: "directorySearch", onChange: function (e) {
|
|
30320
30322
|
setSearchTerm(e.target.value);
|
|
30321
30323
|
} })),
|
|
30322
30324
|
React.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
|
|
30323
30325
|
React.createElement(Label$1, { htmlFor: "postcode" }, "Postcode (optional)"),
|
|
30324
30326
|
React.createElement(HintText, { text: "Enter a postcode" }),
|
|
30325
|
-
React.createElement(Input
|
|
30327
|
+
React.createElement(Input, { name: "postcode", type: "text", defaultValue: postcodeSearch, id: "postcode", onChange: function (e) { return setPostcodeSearch(e.target.value); } })),
|
|
30326
30328
|
React.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
|
|
30327
30329
|
React.createElement(ButtonContainer$1, null,
|
|
30328
30330
|
React.createElement(Button$1, { onClick: submitSearch, type: "submit" },
|
|
@@ -30356,10 +30358,10 @@ var DirectoryServiceList = function (_a) {
|
|
|
30356
30358
|
React.createElement(Row$1, null,
|
|
30357
30359
|
React.createElement(Column, { small: "full", medium: "one-half", large: "one-half" },
|
|
30358
30360
|
React.createElement(Label$1, { htmlFor: "minimum_age" }, "From"),
|
|
30359
|
-
React.createElement(Input
|
|
30361
|
+
React.createElement(Input, { name: "minimum_age", onChange: function (e) { return handleAgeChange(e, 'minimumAge'); }, value: ageInMonths && typeof minimumAge === 'number' ? minimumAge / 12 : minimumAge, id: "minimum_age", type: "number" })),
|
|
30360
30362
|
React.createElement(Column, { small: "full", medium: "one-half", large: "one-half" },
|
|
30361
30363
|
React.createElement(Label$1, { htmlFor: "maximum_age" }, "To"),
|
|
30362
|
-
React.createElement(Input
|
|
30364
|
+
React.createElement(Input, { name: "maximum_age", onChange: function (e) { return handleAgeChange(e, 'maximumAge'); }, value: ageInMonths && typeof maximumAge === 'number' ? maximumAge / 12 : maximumAge, id: "maximum_age", type: "number" })))))), categories === null || categories === void 0 ? void 0 :
|
|
30363
30365
|
categories.map(function (category, categoryIndex) { return (React.createElement(Column, { small: "full", medium: "full", large: "full", key: category.label },
|
|
30364
30366
|
React.createElement(Fieldset$1, null,
|
|
30365
30367
|
React.createElement(Legend$1, null,
|
|
@@ -32092,7 +32094,7 @@ var DirectoryDocumentList = function (_a) {
|
|
|
32092
32094
|
React.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
|
|
32093
32095
|
React.createElement(Label, { htmlFor: "directorySearch" }, "What are you looking for?"),
|
|
32094
32096
|
React.createElement(HintText, { text: "Enter a search word or phrase" }),
|
|
32095
|
-
React.createElement(Input
|
|
32097
|
+
React.createElement(Input, { name: "directorySearch", type: "text", defaultValue: searchTerm, id: "directorySearch", onChange: function (e) {
|
|
32096
32098
|
setSearchTerm(e.target.value);
|
|
32097
32099
|
} })),
|
|
32098
32100
|
React.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
|