@nnc-digital/nnc-design-system 1.0.0-beta5 → 1.0.0-beta7
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.d.ts +2 -1
- package/build/index.js +46 -5
- package/build/index.js.map +1 -1
- package/build/index.mjs.js +46 -5
- package/build/index.mjs.js.map +1 -1
- package/build/library/events/Event/Event.d.ts +4 -0
- package/build/library/events/Event/Event.storydata.d.ts +4 -0
- package/build/library/events/Event/Event.types.d.ts +206 -0
- package/build/library/events/Event/index.d.ts +3 -0
- package/build/library/events/EventList/EventList.d.ts +4 -0
- package/build/library/events/EventList/EventList.storydata.d.ts +3 -0
- package/build/library/events/EventList/EventList.types.d.ts +152 -0
- package/build/library/events/EventList/index.d.ts +3 -0
- package/build/library/events/index.d.ts +5 -0
- package/build/library/events/utils/EventFilters.d.ts +57 -0
- package/build/library/events/utils/index.d.ts +1 -0
- package/build/library/pages/EventPage/EventPage.d.ts +13 -0
- package/build/library/pages/EventPage/index.d.ts +1 -0
- package/build/library/slices/RoadworksList/RoadworksList.types.d.ts +4 -0
- package/build/src/library/events/Event/Event.d.ts +4 -0
- package/build/src/library/events/Event/Event.storydata.d.ts +4 -0
- package/build/src/library/events/Event/Event.types.d.ts +206 -0
- package/build/src/library/events/Event/index.d.ts +3 -0
- package/build/src/library/events/EventList/EventList.d.ts +4 -0
- package/build/src/library/events/EventList/EventList.storydata.d.ts +3 -0
- package/build/src/library/events/EventList/EventList.types.d.ts +152 -0
- package/build/src/library/events/EventList/index.d.ts +3 -0
- package/build/src/library/events/index.d.ts +5 -0
- package/build/src/library/events/utils/EventFilters.d.ts +57 -0
- package/build/src/library/events/utils/index.d.ts +1 -0
- package/build/src/library/pages/EventPage/EventPage.d.ts +13 -0
- package/build/src/library/pages/EventPage/index.d.ts +1 -0
- package/build/src/library/slices/RoadworksList/RoadworksList.types.d.ts +4 -0
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -26,11 +26,12 @@ import Image from './library/slices/Image/Image';
|
|
|
26
26
|
import ImageAndText from './library/slices/ImageAndText/ImageAndText';
|
|
27
27
|
import InquestSchedule from './library/slices/InquestSchedule/InquestSchedule';
|
|
28
28
|
import Promotions from './library/slices/Promotions/Promotions';
|
|
29
|
+
import RoadworksList from './library/slices/RoadworksList/RoadworksList';
|
|
29
30
|
import SearchBox from './library/slices/SearchBox/SearchBox';
|
|
30
31
|
import Video from './library/slices/Video/Video';
|
|
31
32
|
import WarningText from './library/slices/WarningText/WarningText';
|
|
32
33
|
import WarningTextDisclaimer from './library/slices/WarningTextDisclaimer/WarningTextDisclaimer';
|
|
33
|
-
export { Accordion, BlockQuote, CallToAction, Cards, CouncilTaxAlphabeticalDirectory, Divider, DownloadableFiles, GoogleMap, Image, ImageAndText, InquestSchedule, Promotions, SearchBox, Video, WarningText, WarningTextDisclaimer, };
|
|
34
|
+
export { Accordion, BlockQuote, CallToAction, Cards, CouncilTaxAlphabeticalDirectory, Divider, DownloadableFiles, GoogleMap, Image, ImageAndText, InquestSchedule, Promotions, RoadworksList, SearchBox, Video, WarningText, WarningTextDisclaimer, };
|
|
34
35
|
export * from './library/structure/PageStructures';
|
|
35
36
|
export { GDS_theme, north_theme, west_theme, lb_theme_north, lb_theme_west } from './themes/theme_generator';
|
|
36
37
|
export { GlobalStyleReset } from './themes/GlobalStyleReset.jsx';
|
package/build/index.js
CHANGED
|
@@ -23814,7 +23814,19 @@ const formatDate = (dateString) => {
|
|
|
23814
23814
|
*/
|
|
23815
23815
|
const formatTime = (dateString) => {
|
|
23816
23816
|
const date = new Date(dateString);
|
|
23817
|
-
|
|
23817
|
+
const hours = date.getHours();
|
|
23818
|
+
const minutes = date.getMinutes();
|
|
23819
|
+
|
|
23820
|
+
// Convert to 12-hour format
|
|
23821
|
+
const hour12 = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours;
|
|
23822
|
+
const ampm = hours < 12 ? 'am' : 'pm';
|
|
23823
|
+
|
|
23824
|
+
// Only show minutes if not zero
|
|
23825
|
+
if (minutes === 0) {
|
|
23826
|
+
return `${hour12}${ampm}`;
|
|
23827
|
+
} else {
|
|
23828
|
+
return `${hour12}:${minutes.toString().padStart(2, '0')}${ampm}`;
|
|
23829
|
+
}
|
|
23818
23830
|
};
|
|
23819
23831
|
|
|
23820
23832
|
/**
|
|
@@ -24288,6 +24300,31 @@ const NoMatches = styled__default.default.p`
|
|
|
24288
24300
|
padding: ${(props) => props.theme.theme_vars.spacingSizes.small} 0;
|
|
24289
24301
|
`;
|
|
24290
24302
|
|
|
24303
|
+
const RoadworkLink = styled__default.default.a`
|
|
24304
|
+
color: ${(props) => props.theme.theme_vars.colours.action};
|
|
24305
|
+
text-decoration: underline;
|
|
24306
|
+
|
|
24307
|
+
&:hover {
|
|
24308
|
+
text-decoration: none;
|
|
24309
|
+
}
|
|
24310
|
+
|
|
24311
|
+
&:focus {
|
|
24312
|
+
outline: 3px solid ${(props) => props.theme.theme_vars.colours.focus};
|
|
24313
|
+
outline-offset: 0;
|
|
24314
|
+
background-color: ${(props) => props.theme.theme_vars.colours.focus};
|
|
24315
|
+
color: ${(props) => props.theme.theme_vars.colours.black};
|
|
24316
|
+
text-decoration: none;
|
|
24317
|
+
}
|
|
24318
|
+
|
|
24319
|
+
&:visited {
|
|
24320
|
+
color: ${(props) => props.theme.theme_vars.colours.action_dark};
|
|
24321
|
+
}
|
|
24322
|
+
|
|
24323
|
+
h3 {
|
|
24324
|
+
color: inherit;
|
|
24325
|
+
}
|
|
24326
|
+
`;
|
|
24327
|
+
|
|
24291
24328
|
/**
|
|
24292
24329
|
* Primary UI component for user interaction
|
|
24293
24330
|
* If value is set then treat as controlled component
|
|
@@ -24305,6 +24342,10 @@ var Input = function (_a) {
|
|
|
24305
24342
|
var RoadworksList = function (_a) {
|
|
24306
24343
|
var roadworks = _a.roadworks, title = _a.title;
|
|
24307
24344
|
var _b = React.useState(roadworks), filteredRoadworks = _b[0], setFilteredRoadworks = _b[1];
|
|
24345
|
+
// Helper function to remove trailing dot if it's the last character
|
|
24346
|
+
var removeTrailingDot = function (text) {
|
|
24347
|
+
return (text === null || text === void 0 ? void 0 : text.endsWith('.')) ? text.slice(0, -1) : text;
|
|
24348
|
+
};
|
|
24308
24349
|
var handleSearch = function (e) {
|
|
24309
24350
|
var searchTerm = e.target.value.toLowerCase();
|
|
24310
24351
|
if (searchTerm != '') {
|
|
@@ -24365,8 +24406,8 @@ var RoadworksList = function (_a) {
|
|
|
24365
24406
|
return (React__default.default.createElement(Roadwork, { key: index },
|
|
24366
24407
|
React__default.default.createElement(IconContainer$2, null,
|
|
24367
24408
|
React__default.default.createElement(DynamicIcon, { icon: "mappin" }),
|
|
24368
|
-
React__default.default.createElement(IconText, null,
|
|
24369
|
-
React__default.default.createElement(Heading, { text: roadwork.detailedLocation, level: 3 }))),
|
|
24409
|
+
React__default.default.createElement(IconText, null, roadwork.urlLinkAddress ? (React__default.default.createElement(RoadworkLink, { href: roadwork.urlLinkAddress, target: "_blank", rel: "noopener noreferrer" },
|
|
24410
|
+
React__default.default.createElement(Heading, { text: removeTrailingDot(roadwork.detailedLocation), level: 3 }))) : (React__default.default.createElement(Heading, { text: removeTrailingDot(roadwork.detailedLocation), level: 3 })))),
|
|
24370
24411
|
React__default.default.createElement(IconContainer$2, null,
|
|
24371
24412
|
React__default.default.createElement(DynamicIcon, { icon: "events" }),
|
|
24372
24413
|
React__default.default.createElement(IconText, null,
|
|
@@ -24374,11 +24415,11 @@ var RoadworksList = function (_a) {
|
|
|
24374
24415
|
React__default.default.createElement(IconContainer$2, null,
|
|
24375
24416
|
React__default.default.createElement(DynamicIcon, { icon: "roadworks" }),
|
|
24376
24417
|
React__default.default.createElement(IconText, null,
|
|
24377
|
-
React__default.default.createElement("span", null, roadwork.description))),
|
|
24418
|
+
React__default.default.createElement("span", null, removeTrailingDot(roadwork.description)))),
|
|
24378
24419
|
React__default.default.createElement(IconContainer$2, null,
|
|
24379
24420
|
React__default.default.createElement(DynamicIcon, { icon: "bollard" }),
|
|
24380
24421
|
React__default.default.createElement(IconText, null,
|
|
24381
|
-
React__default.default.createElement("span", null, roadwork.trafficManagement)))));
|
|
24422
|
+
React__default.default.createElement("span", null, removeTrailingDot(roadwork.trafficManagement))))));
|
|
24382
24423
|
})),
|
|
24383
24424
|
roadworks.length > 0 && filteredRoadworks.length === 0 && (React__default.default.createElement(NoMatches, null, "We couldn't find any results for your search term. Please try a different search.")),
|
|
24384
24425
|
roadworks.length == 0 && (React__default.default.createElement(NoMatches, null, "Sorry, we're not able to find any results at the moment. Please try again later."))));
|