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.esm.js
CHANGED
|
@@ -5998,43 +5998,43 @@ var TextInput = function (_a) {
|
|
|
5998
5998
|
// Accordion
|
|
5999
5999
|
|
|
6000
6000
|
const Container$A = styled.div`
|
|
6001
|
-
${props => props.theme.fontStyles}
|
|
6001
|
+
${(props) => props.theme.fontStyles}
|
|
6002
6002
|
margin-bottom: 20px;
|
|
6003
|
-
border-bottom: 1px solid ${props => props.theme.theme_vars.colours.grey};
|
|
6003
|
+
border-bottom: 1px solid ${(props) => props.theme.theme_vars.colours.grey};
|
|
6004
6004
|
|
|
6005
6005
|
@media (min-width: 40.0625em) {
|
|
6006
|
-
|
|
6006
|
+
margin-bottom: 30px;
|
|
6007
6007
|
}
|
|
6008
6008
|
`;
|
|
6009
6009
|
|
|
6010
6010
|
const AccordionControls = styled.div`
|
|
6011
|
-
|
|
6011
|
+
text-align: right;
|
|
6012
6012
|
`;
|
|
6013
6013
|
|
|
6014
6014
|
const OpenAllButton = styled.button`
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6015
|
+
font-size: ${(props) => props.theme.theme_vars.fontSizes.extra_small};
|
|
6016
|
+
position: relative;
|
|
6017
|
+
z-index: 1;
|
|
6018
|
+
margin: 0;
|
|
6019
|
+
margin-bottom: 15px;
|
|
6020
|
+
padding: 0;
|
|
6021
|
+
border-width: 0;
|
|
6022
|
+
color: ${(props) => props.theme.theme_vars.colours.action};
|
|
6023
|
+
background: none;
|
|
6024
|
+
cursor: pointer;
|
|
6025
|
+
&:hover {
|
|
6026
|
+
${(props) => props.theme.linkStylesHover};
|
|
6027
|
+
}
|
|
6028
|
+
&:focus {
|
|
6029
|
+
${(props) => props.theme.linkStylesFocus};
|
|
6030
|
+
}
|
|
6031
|
+
&:active {
|
|
6032
|
+
${(props) => props.theme.linkStylesActive};
|
|
6033
|
+
}
|
|
6034
6034
|
`;
|
|
6035
6035
|
|
|
6036
6036
|
const VisuallyHidden = styled.span`
|
|
6037
|
-
|
|
6037
|
+
${(props) => props.theme.visuallyHidden}
|
|
6038
6038
|
`;
|
|
6039
6039
|
|
|
6040
6040
|
// AccordionSection
|
|
@@ -6044,186 +6044,179 @@ const Section = styled.div`
|
|
|
6044
6044
|
`;
|
|
6045
6045
|
|
|
6046
6046
|
const SectionHeader = styled.div`
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6047
|
+
${(props) => props.theme.headingStyles}
|
|
6048
|
+
position: relative;
|
|
6049
|
+
padding-right: 40px;
|
|
6050
|
+
border-top: 1px solid ${(props) => props.theme.theme_vars.colours.grey};
|
|
6051
|
+
color: ${(props) => props.theme.theme_vars.colours.action};
|
|
6052
|
+
cursor: pointer;
|
|
6053
|
+
padding-bottom: 15px;
|
|
6054
6054
|
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6055
|
+
&:hover {
|
|
6056
|
+
border-top-color: ${(props) => props.theme.theme_vars.colours.action};
|
|
6057
|
+
-webkit-box-shadow: inset 0 2px 0 0 ${(props) => props.theme.theme_vars.colours.action};
|
|
6058
|
+
box-shadow: inset 0 2px 0 0 ${(props) => props.theme.theme_vars.colours.action};
|
|
6059
|
+
}
|
|
6060
6060
|
`;
|
|
6061
6061
|
|
|
6062
6062
|
const SectionHeading = styled.div`
|
|
6063
|
-
|
|
6064
|
-
|
|
6063
|
+
margin-top: 10px;
|
|
6064
|
+
margin-bottom: 5px;
|
|
6065
6065
|
`;
|
|
6066
6066
|
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
}
|
|
6067
|
+
const SectionButtonIsFilteredStyles = (props) => {
|
|
6068
|
+
if (props.isFilter) {
|
|
6069
|
+
return css`
|
|
6070
|
+
${(props) => props.theme.theme_vars.h4}
|
|
6071
|
+
`;
|
|
6072
|
+
} else {
|
|
6073
|
+
return css`
|
|
6074
|
+
${(props) => props.theme.theme_vars.h3}
|
|
6075
|
+
`;
|
|
6076
|
+
}
|
|
6078
6077
|
};
|
|
6079
6078
|
|
|
6080
|
-
|
|
6081
6079
|
const SectionButton = styled.button`
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6080
|
+
display: inline-block;
|
|
6081
|
+
margin-top: 0;
|
|
6082
|
+
margin-bottom: 0;
|
|
6083
|
+
margin-left: 0;
|
|
6084
|
+
padding: 0;
|
|
6085
|
+
border-width: 0;
|
|
6086
|
+
color: inherit;
|
|
6087
|
+
background: none;
|
|
6088
|
+
text-align: left;
|
|
6089
|
+
cursor: pointer;
|
|
6090
|
+
-webkit-appearance: none;
|
|
6091
|
+
text-decoration: underline;
|
|
6094
6092
|
|
|
6095
|
-
|
|
6093
|
+
${SectionButtonIsFilteredStyles}
|
|
6096
6094
|
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6095
|
+
&:focus {
|
|
6096
|
+
outline: 3px solid transparent;
|
|
6097
|
+
color: ${(props) => props.theme.theme_vars.colours.black};
|
|
6098
|
+
background-color: ${(props) => props.theme.theme_vars.colours.focus};
|
|
6099
|
+
-webkit-box-shadow: 0 -2px ${(props) => props.theme.theme_vars.colours.focus},
|
|
6100
|
+
0 4px ${(props) => props.theme.theme_vars.colours.black};
|
|
6101
|
+
box-shadow: 0 -2px ${(props) => props.theme.theme_vars.colours.focus},
|
|
6102
|
+
0 4px ${(props) => props.theme.theme_vars.colours.black};
|
|
6103
|
+
text-decoration: none;
|
|
6104
|
+
}
|
|
6105
6105
|
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6106
|
+
&::-moz-focus-inner {
|
|
6107
|
+
padding: 0;
|
|
6108
|
+
border: 0;
|
|
6109
|
+
}
|
|
6110
6110
|
|
|
6111
|
-
|
|
6112
|
-
content:
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6111
|
+
&:after {
|
|
6112
|
+
content: '';
|
|
6113
|
+
position: absolute;
|
|
6114
|
+
top: 0;
|
|
6115
|
+
right: 0;
|
|
6116
|
+
bottom: 0;
|
|
6117
|
+
left: 0;
|
|
6118
|
+
}
|
|
6119
6119
|
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6120
|
+
&:hover:not(:focus) {
|
|
6121
|
+
text-decoration: underline;
|
|
6122
|
+
text-decoration-style: dotted;
|
|
6123
|
+
}
|
|
6124
6124
|
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6125
|
+
&:hover {
|
|
6126
|
+
text-decoration: none;
|
|
6127
|
+
}
|
|
6128
6128
|
`;
|
|
6129
6129
|
|
|
6130
6130
|
const ReadMore = styled.button`
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6131
|
+
${(props) => props.theme.linkStyles}
|
|
6132
|
+
background: none;
|
|
6133
|
+
border: none;
|
|
6134
|
+
margin-top: 15px;
|
|
6135
|
+
margin-bottom: 10px;
|
|
6136
|
+
padding: 0;
|
|
6137
|
+
font-size: ${(props) => props.theme.theme_vars.fontSizes.extra_small};
|
|
6138
6138
|
`;
|
|
6139
6139
|
const ShowLessButton = styled.button`
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
&:hover {
|
|
6149
|
-
${props => props.theme.linkStylesHover}
|
|
6150
|
-
}
|
|
6151
|
-
&:focus {
|
|
6152
|
-
${props => props.theme.linkStylesFocus}
|
|
6153
|
-
}
|
|
6154
|
-
&:active {
|
|
6155
|
-
${props => props.theme.linkStylesActive}
|
|
6156
|
-
}
|
|
6157
|
-
`;
|
|
6140
|
+
${(props) => props.theme.linkStyles}
|
|
6141
|
+
background: none;
|
|
6142
|
+
border: none;
|
|
6143
|
+
margin-top: 15px;
|
|
6144
|
+
padding: 0;
|
|
6145
|
+
font-size: ${(props) => props.theme.theme_vars.fontSizes.extra_small};
|
|
6146
|
+
cursor: pointer;
|
|
6158
6147
|
|
|
6148
|
+
&:hover {
|
|
6149
|
+
${(props) => props.theme.linkStylesHover}
|
|
6150
|
+
}
|
|
6151
|
+
&:focus {
|
|
6152
|
+
${(props) => props.theme.linkStylesFocus}
|
|
6153
|
+
}
|
|
6154
|
+
&:active {
|
|
6155
|
+
${(props) => props.theme.linkStylesActive}
|
|
6156
|
+
}
|
|
6157
|
+
`;
|
|
6159
6158
|
|
|
6160
6159
|
const AccordionIcon = styled.span`
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
margin-top: -8px;
|
|
6167
|
-
|
|
6168
|
-
&:after,
|
|
6169
|
-
&:before {
|
|
6170
|
-
content: "";
|
|
6171
|
-
-webkit-box-sizing: border-box;
|
|
6172
|
-
box-sizing: border-box;
|
|
6173
|
-
position: absolute;
|
|
6174
|
-
top: 0;
|
|
6175
|
-
right: 0;
|
|
6176
|
-
bottom: 0;
|
|
6177
|
-
left: 0;
|
|
6178
|
-
width: 25%;
|
|
6179
|
-
height: 25%;
|
|
6180
|
-
margin: auto;
|
|
6181
|
-
border: 2px solid transparent;
|
|
6182
|
-
background-color: ${props => props.theme.theme_vars.colours.black};
|
|
6183
|
-
}
|
|
6184
|
-
|
|
6185
|
-
&:before {
|
|
6186
|
-
width: 100%;
|
|
6187
|
-
}
|
|
6160
|
+
position: absolute;
|
|
6161
|
+
top: 22px;
|
|
6162
|
+
right: 4px;
|
|
6163
|
+
width: 34px;
|
|
6164
|
+
height: 32px;
|
|
6188
6165
|
|
|
6189
|
-
|
|
6190
|
-
|
|
6166
|
+
&:before {
|
|
6167
|
+
border-style: solid;
|
|
6168
|
+
border-width: 4px 4px 0 0;
|
|
6169
|
+
content: '';
|
|
6170
|
+
display: inline-block;
|
|
6171
|
+
height: 12px;
|
|
6172
|
+
position: relative;
|
|
6173
|
+
vertical-align: top;
|
|
6174
|
+
width: 12px;
|
|
6175
|
+
border-color: ${(props) => props.theme.theme_vars.colours.black};
|
|
6176
|
+
top: 0;
|
|
6177
|
+
left: 6px;
|
|
6178
|
+
transform: rotate(135deg);
|
|
6179
|
+
}
|
|
6191
6180
|
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6181
|
+
&:before {
|
|
6182
|
+
.accordion__section--expanded & {
|
|
6183
|
+
transform: rotate(-45deg);
|
|
6184
|
+
top: 10px;
|
|
6196
6185
|
}
|
|
6186
|
+
}
|
|
6197
6187
|
`;
|
|
6198
6188
|
|
|
6199
6189
|
const SectionSummary = styled.div`
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6190
|
+
margin-top: 10px;
|
|
6191
|
+
margin-bottom: 0;
|
|
6192
|
+
color: ${(props) => props.theme.theme_vars.colours.black};
|
|
6203
6193
|
`;
|
|
6204
6194
|
|
|
6205
6195
|
const SectionContent = styled.div`
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6196
|
+
display: none;
|
|
6197
|
+
padding-top: 5px;
|
|
6198
|
+
padding-bottom: 15px;
|
|
6209
6199
|
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6200
|
+
h2,
|
|
6201
|
+
h3,
|
|
6202
|
+
h4,
|
|
6203
|
+
h5 {
|
|
6204
|
+
&:first-child {
|
|
6205
|
+
margin-top: 0;
|
|
6214
6206
|
}
|
|
6207
|
+
}
|
|
6215
6208
|
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6209
|
+
@media (min-width: 40.0625em) {
|
|
6210
|
+
padding-bottom: 25px;
|
|
6211
|
+
}
|
|
6219
6212
|
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6213
|
+
> :last-child {
|
|
6214
|
+
margin-bottom: 0;
|
|
6215
|
+
}
|
|
6223
6216
|
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6217
|
+
.accordion__section--expanded & {
|
|
6218
|
+
display: block;
|
|
6219
|
+
}
|
|
6227
6220
|
`;
|
|
6228
6221
|
|
|
6229
6222
|
const uniqueID = () => {
|
|
@@ -6235,22 +6228,21 @@ const uniqueID = () => {
|
|
|
6235
6228
|
|
|
6236
6229
|
var AccordionSection = function (_a) {
|
|
6237
6230
|
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;
|
|
6238
|
-
var onSectionToggle = function () {
|
|
6239
|
-
|
|
6240
|
-
|
|
6231
|
+
var onSectionToggle = function () {
|
|
6232
|
+
return isExpanded === true ? onToggle(accordionSectionId, false) : onToggle(accordionSectionId, true);
|
|
6233
|
+
};
|
|
6234
|
+
var thisSectionId = sectionId === false ? "accordion_section".concat(uniqueID()) : sectionId;
|
|
6235
|
+
return (React.createElement(Section, { id: thisSectionId, className: isExpanded && 'accordion__section--expanded' },
|
|
6241
6236
|
React.createElement(SectionHeader, { onClick: onSectionToggle },
|
|
6242
|
-
React.createElement(SectionHeading, { as: isFilter ?
|
|
6243
|
-
React.createElement(SectionButton, { title: isExpanded ?
|
|
6237
|
+
React.createElement(SectionHeading, { as: isFilter ? 'h3' : 'h2' },
|
|
6238
|
+
React.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' },
|
|
6244
6239
|
title,
|
|
6245
6240
|
React.createElement(AccordionIcon, { "aria-hidden": "true" }))),
|
|
6246
|
-
summary &&
|
|
6247
|
-
|
|
6248
|
-
!isExpanded && withReadMore &&
|
|
6249
|
-
React.createElement(ReadMore, { title: "Read more about " + title }, "Read more")),
|
|
6241
|
+
summary && (React.createElement(SectionSummary, { id: "".concat(thisSectionId, "_").concat(accordionSectionId, "-summary") }, summary)),
|
|
6242
|
+
!isExpanded && withReadMore && React.createElement(ReadMore, { title: 'Read more about ' + title }, "Read more")),
|
|
6250
6243
|
React.createElement(SectionContent, { id: "".concat(thisSectionId, "_").concat(accordionSectionId, "-content"), "aria-labelledby": "".concat(thisSectionId, "_").concat(accordionSectionId, "-heading") },
|
|
6251
6244
|
content,
|
|
6252
|
-
isExpanded && withReadMore &&
|
|
6253
|
-
React.createElement(ShowLessButton, { onClick: onSectionToggle }, "Show less"))));
|
|
6245
|
+
isExpanded && withReadMore && (React.createElement(ShowLessButton, { onClick: onSectionToggle }, "Show less")))));
|
|
6254
6246
|
};
|
|
6255
6247
|
|
|
6256
6248
|
var Accordion = function (_a) {
|
|
@@ -6947,7 +6939,7 @@ var AlertBannerService = function (_a) {
|
|
|
6947
6939
|
var title = _a.title, _b = _a.alertType, alertType = _b === void 0 ? 'alert' : _b, children = _a.children;
|
|
6948
6940
|
return (React.createElement(Container$v, { alertType: alertType, "data-testid": "AlertBannerService" },
|
|
6949
6941
|
React.createElement(InnerContainer, { "data-testid": "AlertBannerServiceInner" },
|
|
6950
|
-
React.createElement(Heading, { text: title }),
|
|
6942
|
+
(title === null || title === void 0 ? void 0 : title.trim()) && React.createElement(Heading, { text: title }),
|
|
6951
6943
|
children)));
|
|
6952
6944
|
};
|
|
6953
6945
|
|