@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.mjs.js
CHANGED
|
@@ -23801,7 +23801,19 @@ const formatDate = (dateString) => {
|
|
|
23801
23801
|
*/
|
|
23802
23802
|
const formatTime = (dateString) => {
|
|
23803
23803
|
const date = new Date(dateString);
|
|
23804
|
-
|
|
23804
|
+
const hours = date.getHours();
|
|
23805
|
+
const minutes = date.getMinutes();
|
|
23806
|
+
|
|
23807
|
+
// Convert to 12-hour format
|
|
23808
|
+
const hour12 = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours;
|
|
23809
|
+
const ampm = hours < 12 ? 'am' : 'pm';
|
|
23810
|
+
|
|
23811
|
+
// Only show minutes if not zero
|
|
23812
|
+
if (minutes === 0) {
|
|
23813
|
+
return `${hour12}${ampm}`;
|
|
23814
|
+
} else {
|
|
23815
|
+
return `${hour12}:${minutes.toString().padStart(2, '0')}${ampm}`;
|
|
23816
|
+
}
|
|
23805
23817
|
};
|
|
23806
23818
|
|
|
23807
23819
|
/**
|
|
@@ -24275,6 +24287,31 @@ const NoMatches = styled.p`
|
|
|
24275
24287
|
padding: ${(props) => props.theme.theme_vars.spacingSizes.small} 0;
|
|
24276
24288
|
`;
|
|
24277
24289
|
|
|
24290
|
+
const RoadworkLink = styled.a`
|
|
24291
|
+
color: ${(props) => props.theme.theme_vars.colours.action};
|
|
24292
|
+
text-decoration: underline;
|
|
24293
|
+
|
|
24294
|
+
&:hover {
|
|
24295
|
+
text-decoration: none;
|
|
24296
|
+
}
|
|
24297
|
+
|
|
24298
|
+
&:focus {
|
|
24299
|
+
outline: 3px solid ${(props) => props.theme.theme_vars.colours.focus};
|
|
24300
|
+
outline-offset: 0;
|
|
24301
|
+
background-color: ${(props) => props.theme.theme_vars.colours.focus};
|
|
24302
|
+
color: ${(props) => props.theme.theme_vars.colours.black};
|
|
24303
|
+
text-decoration: none;
|
|
24304
|
+
}
|
|
24305
|
+
|
|
24306
|
+
&:visited {
|
|
24307
|
+
color: ${(props) => props.theme.theme_vars.colours.action_dark};
|
|
24308
|
+
}
|
|
24309
|
+
|
|
24310
|
+
h3 {
|
|
24311
|
+
color: inherit;
|
|
24312
|
+
}
|
|
24313
|
+
`;
|
|
24314
|
+
|
|
24278
24315
|
/**
|
|
24279
24316
|
* Primary UI component for user interaction
|
|
24280
24317
|
* If value is set then treat as controlled component
|
|
@@ -24292,6 +24329,10 @@ var Input = function (_a) {
|
|
|
24292
24329
|
var RoadworksList = function (_a) {
|
|
24293
24330
|
var roadworks = _a.roadworks, title = _a.title;
|
|
24294
24331
|
var _b = useState(roadworks), filteredRoadworks = _b[0], setFilteredRoadworks = _b[1];
|
|
24332
|
+
// Helper function to remove trailing dot if it's the last character
|
|
24333
|
+
var removeTrailingDot = function (text) {
|
|
24334
|
+
return (text === null || text === void 0 ? void 0 : text.endsWith('.')) ? text.slice(0, -1) : text;
|
|
24335
|
+
};
|
|
24295
24336
|
var handleSearch = function (e) {
|
|
24296
24337
|
var searchTerm = e.target.value.toLowerCase();
|
|
24297
24338
|
if (searchTerm != '') {
|
|
@@ -24352,8 +24393,8 @@ var RoadworksList = function (_a) {
|
|
|
24352
24393
|
return (React.createElement(Roadwork, { key: index },
|
|
24353
24394
|
React.createElement(IconContainer$2, null,
|
|
24354
24395
|
React.createElement(DynamicIcon, { icon: "mappin" }),
|
|
24355
|
-
React.createElement(IconText, null,
|
|
24356
|
-
React.createElement(Heading, { text: roadwork.detailedLocation, level: 3 }))),
|
|
24396
|
+
React.createElement(IconText, null, roadwork.urlLinkAddress ? (React.createElement(RoadworkLink, { href: roadwork.urlLinkAddress, target: "_blank", rel: "noopener noreferrer" },
|
|
24397
|
+
React.createElement(Heading, { text: removeTrailingDot(roadwork.detailedLocation), level: 3 }))) : (React.createElement(Heading, { text: removeTrailingDot(roadwork.detailedLocation), level: 3 })))),
|
|
24357
24398
|
React.createElement(IconContainer$2, null,
|
|
24358
24399
|
React.createElement(DynamicIcon, { icon: "events" }),
|
|
24359
24400
|
React.createElement(IconText, null,
|
|
@@ -24361,11 +24402,11 @@ var RoadworksList = function (_a) {
|
|
|
24361
24402
|
React.createElement(IconContainer$2, null,
|
|
24362
24403
|
React.createElement(DynamicIcon, { icon: "roadworks" }),
|
|
24363
24404
|
React.createElement(IconText, null,
|
|
24364
|
-
React.createElement("span", null, roadwork.description))),
|
|
24405
|
+
React.createElement("span", null, removeTrailingDot(roadwork.description)))),
|
|
24365
24406
|
React.createElement(IconContainer$2, null,
|
|
24366
24407
|
React.createElement(DynamicIcon, { icon: "bollard" }),
|
|
24367
24408
|
React.createElement(IconText, null,
|
|
24368
|
-
React.createElement("span", null, roadwork.trafficManagement)))));
|
|
24409
|
+
React.createElement("span", null, removeTrailingDot(roadwork.trafficManagement))))));
|
|
24369
24410
|
})),
|
|
24370
24411
|
roadworks.length > 0 && filteredRoadworks.length === 0 && (React.createElement(NoMatches, null, "We couldn't find any results for your search term. Please try a different search.")),
|
|
24371
24412
|
roadworks.length == 0 && (React.createElement(NoMatches, null, "Sorry, we're not able to find any results at the moment. Please try again later."))));
|