@nnc-digital/nnc-design-system 1.0.0-beta5 → 1.0.0-beta6
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.js +20 -4
- package/build/index.js.map +1 -1
- package/build/index.mjs.js +20 -4
- package/build/index.mjs.js.map +1 -1
- 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
|
/**
|
|
@@ -24292,6 +24304,10 @@ var Input = function (_a) {
|
|
|
24292
24304
|
var RoadworksList = function (_a) {
|
|
24293
24305
|
var roadworks = _a.roadworks, title = _a.title;
|
|
24294
24306
|
var _b = useState(roadworks), filteredRoadworks = _b[0], setFilteredRoadworks = _b[1];
|
|
24307
|
+
// Helper function to remove trailing dot if it's the last character
|
|
24308
|
+
var removeTrailingDot = function (text) {
|
|
24309
|
+
return (text === null || text === void 0 ? void 0 : text.endsWith('.')) ? text.slice(0, -1) : text;
|
|
24310
|
+
};
|
|
24295
24311
|
var handleSearch = function (e) {
|
|
24296
24312
|
var searchTerm = e.target.value.toLowerCase();
|
|
24297
24313
|
if (searchTerm != '') {
|
|
@@ -24353,7 +24369,7 @@ var RoadworksList = function (_a) {
|
|
|
24353
24369
|
React.createElement(IconContainer$2, null,
|
|
24354
24370
|
React.createElement(DynamicIcon, { icon: "mappin" }),
|
|
24355
24371
|
React.createElement(IconText, null,
|
|
24356
|
-
React.createElement(Heading, { text: roadwork.detailedLocation, level: 3 }))),
|
|
24372
|
+
React.createElement(Heading, { text: removeTrailingDot(roadwork.detailedLocation), level: 3 }))),
|
|
24357
24373
|
React.createElement(IconContainer$2, null,
|
|
24358
24374
|
React.createElement(DynamicIcon, { icon: "events" }),
|
|
24359
24375
|
React.createElement(IconText, null,
|
|
@@ -24361,11 +24377,11 @@ var RoadworksList = function (_a) {
|
|
|
24361
24377
|
React.createElement(IconContainer$2, null,
|
|
24362
24378
|
React.createElement(DynamicIcon, { icon: "roadworks" }),
|
|
24363
24379
|
React.createElement(IconText, null,
|
|
24364
|
-
React.createElement("span", null, roadwork.description))),
|
|
24380
|
+
React.createElement("span", null, removeTrailingDot(roadwork.description)))),
|
|
24365
24381
|
React.createElement(IconContainer$2, null,
|
|
24366
24382
|
React.createElement(DynamicIcon, { icon: "bollard" }),
|
|
24367
24383
|
React.createElement(IconText, null,
|
|
24368
|
-
React.createElement("span", null, roadwork.trafficManagement)))));
|
|
24384
|
+
React.createElement("span", null, removeTrailingDot(roadwork.trafficManagement))))));
|
|
24369
24385
|
})),
|
|
24370
24386
|
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
24387
|
roadworks.length == 0 && (React.createElement(NoMatches, null, "Sorry, we're not able to find any results at the moment. Please try again later."))));
|