northants-design-system 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.esm.js +171 -179
- package/build/index.esm.js.map +1 -1
- package/build/index.js +171 -179
- package/build/index.js.map +1 -1
- package/build/library/slices/Accordion/Accordion.types.d.ts +6 -6
- package/build/library/slices/Accordion/AccordionSection.d.ts +3 -3
- package/build/library/structure/AlertBannerService/AlertBannerService.types.d.ts +7 -7
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -6019,43 +6019,43 @@ var TextInput = function (_a) {
|
|
|
6019
6019
|
// Accordion
|
|
6020
6020
|
|
|
6021
6021
|
const Container$A = styled__default["default"].div`
|
|
6022
|
-
${props => props.theme.fontStyles}
|
|
6022
|
+
${(props) => props.theme.fontStyles}
|
|
6023
6023
|
margin-bottom: 20px;
|
|
6024
|
-
border-bottom: 1px solid ${props => props.theme.theme_vars.colours.grey};
|
|
6024
|
+
border-bottom: 1px solid ${(props) => props.theme.theme_vars.colours.grey};
|
|
6025
6025
|
|
|
6026
6026
|
@media (min-width: 40.0625em) {
|
|
6027
|
-
|
|
6027
|
+
margin-bottom: 30px;
|
|
6028
6028
|
}
|
|
6029
6029
|
`;
|
|
6030
6030
|
|
|
6031
6031
|
const AccordionControls = styled__default["default"].div`
|
|
6032
|
-
|
|
6032
|
+
text-align: right;
|
|
6033
6033
|
`;
|
|
6034
6034
|
|
|
6035
6035
|
const OpenAllButton = styled__default["default"].button`
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6036
|
+
font-size: ${(props) => props.theme.theme_vars.fontSizes.extra_small};
|
|
6037
|
+
position: relative;
|
|
6038
|
+
z-index: 1;
|
|
6039
|
+
margin: 0;
|
|
6040
|
+
margin-bottom: 15px;
|
|
6041
|
+
padding: 0;
|
|
6042
|
+
border-width: 0;
|
|
6043
|
+
color: ${(props) => props.theme.theme_vars.colours.action};
|
|
6044
|
+
background: none;
|
|
6045
|
+
cursor: pointer;
|
|
6046
|
+
&:hover {
|
|
6047
|
+
${(props) => props.theme.linkStylesHover};
|
|
6048
|
+
}
|
|
6049
|
+
&:focus {
|
|
6050
|
+
${(props) => props.theme.linkStylesFocus};
|
|
6051
|
+
}
|
|
6052
|
+
&:active {
|
|
6053
|
+
${(props) => props.theme.linkStylesActive};
|
|
6054
|
+
}
|
|
6055
6055
|
`;
|
|
6056
6056
|
|
|
6057
6057
|
const VisuallyHidden = styled__default["default"].span`
|
|
6058
|
-
|
|
6058
|
+
${(props) => props.theme.visuallyHidden}
|
|
6059
6059
|
`;
|
|
6060
6060
|
|
|
6061
6061
|
// AccordionSection
|
|
@@ -6065,186 +6065,179 @@ const Section = styled__default["default"].div`
|
|
|
6065
6065
|
`;
|
|
6066
6066
|
|
|
6067
6067
|
const SectionHeader = styled__default["default"].div`
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6068
|
+
${(props) => props.theme.headingStyles}
|
|
6069
|
+
position: relative;
|
|
6070
|
+
padding-right: 40px;
|
|
6071
|
+
border-top: 1px solid ${(props) => props.theme.theme_vars.colours.grey};
|
|
6072
|
+
color: ${(props) => props.theme.theme_vars.colours.action};
|
|
6073
|
+
cursor: pointer;
|
|
6074
|
+
padding-bottom: 15px;
|
|
6075
6075
|
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6076
|
+
&:hover {
|
|
6077
|
+
border-top-color: ${(props) => props.theme.theme_vars.colours.action};
|
|
6078
|
+
-webkit-box-shadow: inset 0 2px 0 0 ${(props) => props.theme.theme_vars.colours.action};
|
|
6079
|
+
box-shadow: inset 0 2px 0 0 ${(props) => props.theme.theme_vars.colours.action};
|
|
6080
|
+
}
|
|
6081
6081
|
`;
|
|
6082
6082
|
|
|
6083
6083
|
const SectionHeading = styled__default["default"].div`
|
|
6084
|
-
|
|
6085
|
-
|
|
6084
|
+
margin-top: 10px;
|
|
6085
|
+
margin-bottom: 5px;
|
|
6086
6086
|
`;
|
|
6087
6087
|
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
}
|
|
6088
|
+
const SectionButtonIsFilteredStyles = (props) => {
|
|
6089
|
+
if (props.isFilter) {
|
|
6090
|
+
return styled.css`
|
|
6091
|
+
${(props) => props.theme.theme_vars.h4}
|
|
6092
|
+
`;
|
|
6093
|
+
} else {
|
|
6094
|
+
return styled.css`
|
|
6095
|
+
${(props) => props.theme.theme_vars.h3}
|
|
6096
|
+
`;
|
|
6097
|
+
}
|
|
6099
6098
|
};
|
|
6100
6099
|
|
|
6101
|
-
|
|
6102
6100
|
const SectionButton = styled__default["default"].button`
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6101
|
+
display: inline-block;
|
|
6102
|
+
margin-top: 0;
|
|
6103
|
+
margin-bottom: 0;
|
|
6104
|
+
margin-left: 0;
|
|
6105
|
+
padding: 0;
|
|
6106
|
+
border-width: 0;
|
|
6107
|
+
color: inherit;
|
|
6108
|
+
background: none;
|
|
6109
|
+
text-align: left;
|
|
6110
|
+
cursor: pointer;
|
|
6111
|
+
-webkit-appearance: none;
|
|
6112
|
+
text-decoration: underline;
|
|
6115
6113
|
|
|
6116
|
-
|
|
6114
|
+
${SectionButtonIsFilteredStyles}
|
|
6117
6115
|
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6116
|
+
&:focus {
|
|
6117
|
+
outline: 3px solid transparent;
|
|
6118
|
+
color: ${(props) => props.theme.theme_vars.colours.black};
|
|
6119
|
+
background-color: ${(props) => props.theme.theme_vars.colours.focus};
|
|
6120
|
+
-webkit-box-shadow: 0 -2px ${(props) => props.theme.theme_vars.colours.focus},
|
|
6121
|
+
0 4px ${(props) => props.theme.theme_vars.colours.black};
|
|
6122
|
+
box-shadow: 0 -2px ${(props) => props.theme.theme_vars.colours.focus},
|
|
6123
|
+
0 4px ${(props) => props.theme.theme_vars.colours.black};
|
|
6124
|
+
text-decoration: none;
|
|
6125
|
+
}
|
|
6126
6126
|
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6127
|
+
&::-moz-focus-inner {
|
|
6128
|
+
padding: 0;
|
|
6129
|
+
border: 0;
|
|
6130
|
+
}
|
|
6131
6131
|
|
|
6132
|
-
|
|
6133
|
-
content:
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6132
|
+
&:after {
|
|
6133
|
+
content: '';
|
|
6134
|
+
position: absolute;
|
|
6135
|
+
top: 0;
|
|
6136
|
+
right: 0;
|
|
6137
|
+
bottom: 0;
|
|
6138
|
+
left: 0;
|
|
6139
|
+
}
|
|
6140
6140
|
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6141
|
+
&:hover:not(:focus) {
|
|
6142
|
+
text-decoration: underline;
|
|
6143
|
+
text-decoration-style: dotted;
|
|
6144
|
+
}
|
|
6145
6145
|
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6146
|
+
&:hover {
|
|
6147
|
+
text-decoration: none;
|
|
6148
|
+
}
|
|
6149
6149
|
`;
|
|
6150
6150
|
|
|
6151
6151
|
const ReadMore = styled__default["default"].button`
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6152
|
+
${(props) => props.theme.linkStyles}
|
|
6153
|
+
background: none;
|
|
6154
|
+
border: none;
|
|
6155
|
+
margin-top: 15px;
|
|
6156
|
+
margin-bottom: 10px;
|
|
6157
|
+
padding: 0;
|
|
6158
|
+
font-size: ${(props) => props.theme.theme_vars.fontSizes.extra_small};
|
|
6159
6159
|
`;
|
|
6160
6160
|
const ShowLessButton = styled__default["default"].button`
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
&:hover {
|
|
6170
|
-
${props => props.theme.linkStylesHover}
|
|
6171
|
-
}
|
|
6172
|
-
&:focus {
|
|
6173
|
-
${props => props.theme.linkStylesFocus}
|
|
6174
|
-
}
|
|
6175
|
-
&:active {
|
|
6176
|
-
${props => props.theme.linkStylesActive}
|
|
6177
|
-
}
|
|
6178
|
-
`;
|
|
6161
|
+
${(props) => props.theme.linkStyles}
|
|
6162
|
+
background: none;
|
|
6163
|
+
border: none;
|
|
6164
|
+
margin-top: 15px;
|
|
6165
|
+
padding: 0;
|
|
6166
|
+
font-size: ${(props) => props.theme.theme_vars.fontSizes.extra_small};
|
|
6167
|
+
cursor: pointer;
|
|
6179
6168
|
|
|
6169
|
+
&:hover {
|
|
6170
|
+
${(props) => props.theme.linkStylesHover}
|
|
6171
|
+
}
|
|
6172
|
+
&:focus {
|
|
6173
|
+
${(props) => props.theme.linkStylesFocus}
|
|
6174
|
+
}
|
|
6175
|
+
&:active {
|
|
6176
|
+
${(props) => props.theme.linkStylesActive}
|
|
6177
|
+
}
|
|
6178
|
+
`;
|
|
6180
6179
|
|
|
6181
6180
|
const AccordionIcon = styled__default["default"].span`
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
margin-top: -8px;
|
|
6188
|
-
|
|
6189
|
-
&:after,
|
|
6190
|
-
&:before {
|
|
6191
|
-
content: "";
|
|
6192
|
-
-webkit-box-sizing: border-box;
|
|
6193
|
-
box-sizing: border-box;
|
|
6194
|
-
position: absolute;
|
|
6195
|
-
top: 0;
|
|
6196
|
-
right: 0;
|
|
6197
|
-
bottom: 0;
|
|
6198
|
-
left: 0;
|
|
6199
|
-
width: 25%;
|
|
6200
|
-
height: 25%;
|
|
6201
|
-
margin: auto;
|
|
6202
|
-
border: 2px solid transparent;
|
|
6203
|
-
background-color: ${props => props.theme.theme_vars.colours.black};
|
|
6204
|
-
}
|
|
6205
|
-
|
|
6206
|
-
&:before {
|
|
6207
|
-
width: 100%;
|
|
6208
|
-
}
|
|
6181
|
+
position: absolute;
|
|
6182
|
+
top: 22px;
|
|
6183
|
+
right: 4px;
|
|
6184
|
+
width: 34px;
|
|
6185
|
+
height: 32px;
|
|
6209
6186
|
|
|
6210
|
-
|
|
6211
|
-
|
|
6187
|
+
&:before {
|
|
6188
|
+
border-style: solid;
|
|
6189
|
+
border-width: 4px 4px 0 0;
|
|
6190
|
+
content: '';
|
|
6191
|
+
display: inline-block;
|
|
6192
|
+
height: 12px;
|
|
6193
|
+
position: relative;
|
|
6194
|
+
vertical-align: top;
|
|
6195
|
+
width: 12px;
|
|
6196
|
+
border-color: ${(props) => props.theme.theme_vars.colours.black};
|
|
6197
|
+
top: 0;
|
|
6198
|
+
left: 6px;
|
|
6199
|
+
transform: rotate(135deg);
|
|
6200
|
+
}
|
|
6212
6201
|
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6202
|
+
&:before {
|
|
6203
|
+
.accordion__section--expanded & {
|
|
6204
|
+
transform: rotate(-45deg);
|
|
6205
|
+
top: 10px;
|
|
6217
6206
|
}
|
|
6207
|
+
}
|
|
6218
6208
|
`;
|
|
6219
6209
|
|
|
6220
6210
|
const SectionSummary = styled__default["default"].div`
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6211
|
+
margin-top: 10px;
|
|
6212
|
+
margin-bottom: 0;
|
|
6213
|
+
color: ${(props) => props.theme.theme_vars.colours.black};
|
|
6224
6214
|
`;
|
|
6225
6215
|
|
|
6226
6216
|
const SectionContent = styled__default["default"].div`
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6217
|
+
display: none;
|
|
6218
|
+
padding-top: 5px;
|
|
6219
|
+
padding-bottom: 15px;
|
|
6230
6220
|
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6221
|
+
h2,
|
|
6222
|
+
h3,
|
|
6223
|
+
h4,
|
|
6224
|
+
h5 {
|
|
6225
|
+
&:first-child {
|
|
6226
|
+
margin-top: 0;
|
|
6235
6227
|
}
|
|
6228
|
+
}
|
|
6236
6229
|
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6230
|
+
@media (min-width: 40.0625em) {
|
|
6231
|
+
padding-bottom: 25px;
|
|
6232
|
+
}
|
|
6240
6233
|
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6234
|
+
> :last-child {
|
|
6235
|
+
margin-bottom: 0;
|
|
6236
|
+
}
|
|
6244
6237
|
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6238
|
+
.accordion__section--expanded & {
|
|
6239
|
+
display: block;
|
|
6240
|
+
}
|
|
6248
6241
|
`;
|
|
6249
6242
|
|
|
6250
6243
|
const uniqueID = () => {
|
|
@@ -6256,22 +6249,21 @@ const uniqueID = () => {
|
|
|
6256
6249
|
|
|
6257
6250
|
var AccordionSection = function (_a) {
|
|
6258
6251
|
var title = _a.title, content = _a.content, summary = _a.summary, isExpanded = _a.isExpanded, accordionSectionId = _a.accordionSectionId, onToggle = _a.onToggle, _b = _a.isFilter, isFilter = _b === void 0 ? false : _b, withReadMore = _a.withReadMore, _c = _a.sectionId, sectionId = _c === void 0 ? false : _c;
|
|
6259
|
-
var onSectionToggle = function () {
|
|
6260
|
-
|
|
6261
|
-
|
|
6252
|
+
var onSectionToggle = function () {
|
|
6253
|
+
return isExpanded === true ? onToggle(accordionSectionId, false) : onToggle(accordionSectionId, true);
|
|
6254
|
+
};
|
|
6255
|
+
var thisSectionId = sectionId === false ? "accordion_section".concat(uniqueID()) : sectionId;
|
|
6256
|
+
return (React__default["default"].createElement(Section, { id: thisSectionId, className: isExpanded && 'accordion__section--expanded' },
|
|
6262
6257
|
React__default["default"].createElement(SectionHeader, { onClick: onSectionToggle },
|
|
6263
|
-
React__default["default"].createElement(SectionHeading, { as: isFilter ?
|
|
6264
|
-
React__default["default"].createElement(SectionButton, { title: isExpanded ?
|
|
6258
|
+
React__default["default"].createElement(SectionHeading, { as: isFilter ? 'h3' : 'h2' },
|
|
6259
|
+
React__default["default"].createElement(SectionButton, { title: isExpanded ? 'Minimise ' + title : title, isFilter: isFilter, type: "button", id: "".concat(thisSectionId, "_").concat(accordionSectionId, "-heading"), "aria-controls": "".concat(thisSectionId, "_").concat(accordionSectionId, "-content"), "aria-expanded": isExpanded ? 'true' : 'false' },
|
|
6265
6260
|
title,
|
|
6266
6261
|
React__default["default"].createElement(AccordionIcon, { "aria-hidden": "true" }))),
|
|
6267
|
-
summary &&
|
|
6268
|
-
|
|
6269
|
-
!isExpanded && withReadMore &&
|
|
6270
|
-
React__default["default"].createElement(ReadMore, { title: "Read more about " + title }, "Read more")),
|
|
6262
|
+
summary && (React__default["default"].createElement(SectionSummary, { id: "".concat(thisSectionId, "_").concat(accordionSectionId, "-summary") }, summary)),
|
|
6263
|
+
!isExpanded && withReadMore && React__default["default"].createElement(ReadMore, { title: 'Read more about ' + title }, "Read more")),
|
|
6271
6264
|
React__default["default"].createElement(SectionContent, { id: "".concat(thisSectionId, "_").concat(accordionSectionId, "-content"), "aria-labelledby": "".concat(thisSectionId, "_").concat(accordionSectionId, "-heading") },
|
|
6272
6265
|
content,
|
|
6273
|
-
isExpanded && withReadMore &&
|
|
6274
|
-
React__default["default"].createElement(ShowLessButton, { onClick: onSectionToggle }, "Show less"))));
|
|
6266
|
+
isExpanded && withReadMore && (React__default["default"].createElement(ShowLessButton, { onClick: onSectionToggle }, "Show less")))));
|
|
6275
6267
|
};
|
|
6276
6268
|
|
|
6277
6269
|
var Accordion = function (_a) {
|
|
@@ -6968,7 +6960,7 @@ var AlertBannerService = function (_a) {
|
|
|
6968
6960
|
var title = _a.title, _b = _a.alertType, alertType = _b === void 0 ? 'alert' : _b, children = _a.children;
|
|
6969
6961
|
return (React__default["default"].createElement(Container$v, { alertType: alertType, "data-testid": "AlertBannerService" },
|
|
6970
6962
|
React__default["default"].createElement(InnerContainer, { "data-testid": "AlertBannerServiceInner" },
|
|
6971
|
-
React__default["default"].createElement(Heading, { text: title }),
|
|
6963
|
+
(title === null || title === void 0 ? void 0 : title.trim()) && React__default["default"].createElement(Heading, { text: title }),
|
|
6972
6964
|
children)));
|
|
6973
6965
|
};
|
|
6974
6966
|
|