@otmc/ui 0.0.0-stage → 0.1.2

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/LICENSE ADDED
@@ -0,0 +1,12 @@
1
+ OTMC License
2
+ Copyright (c) 2026 OTMC Softwares. All rights reserved.
3
+
4
+ Contributors:
5
+ * Nguyen Van Trung
6
+ * OTMC Contributors
7
+
8
+ This software and all related source code, assets, and documentation are the
9
+ property of OTMC Softwares. Unauthorized copying, modification, distribution,
10
+ or use of this software is prohibited without prior written permission from
11
+ OTMC Softwares.
12
+
package/README.md CHANGED
@@ -1,3 +1,2 @@
1
- # Temporary Holding Version
2
1
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
2
+
package/dist/index.cjs ADDED
@@ -0,0 +1,493 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ DEFAULT_AUTHOR: () => DEFAULT_AUTHOR,
24
+ DEFAULT_AUTHOR_HREF: () => DEFAULT_AUTHOR_HREF,
25
+ DEFAULT_COPYRIGHT: () => DEFAULT_COPYRIGHT,
26
+ DEFAULT_LICENSE: () => DEFAULT_LICENSE,
27
+ DEFAULT_LOCATION: () => DEFAULT_LOCATION,
28
+ DEFAULT_VERSION_TYPE: () => DEFAULT_VERSION_TYPE,
29
+ Footer: () => Footer,
30
+ InformationContent: () => InformationContent,
31
+ InformationModal: () => InformationModal,
32
+ UNKNOWN: () => UNKNOWN,
33
+ calculateRemainingTime: () => calculateRemainingTime,
34
+ copyToClipboard: () => copyToClipboard,
35
+ formatAbsolute: () => formatAbsolute,
36
+ formatAbsoluteAndRelativeTime: () => formatAbsoluteAndRelativeTime,
37
+ formatHumanDate: () => formatHumanDate,
38
+ formatRelativeTime: () => formatRelativeTime,
39
+ normalizeDate: () => normalizeDate,
40
+ pad: () => pad
41
+ });
42
+ module.exports = __toCommonJS(index_exports);
43
+
44
+ // src/branding/Footer.tsx
45
+ var import_core = require("@mantine/core");
46
+ var import_icons_react = require("@tabler/icons-react");
47
+
48
+ // src/utils/constants.ts
49
+ var DEFAULT_AUTHOR = "Nguyen Van Trung, OTMC Contributors.";
50
+ var DEFAULT_AUTHOR_HREF = "https://github.com/otmc-sw";
51
+ var DEFAULT_COPYRIGHT = "OTMC Softwares. All rights reserved.";
52
+ var DEFAULT_LICENSE = "OTMC License.";
53
+ var DEFAULT_LOCATION = "An Nhon, Gia Lai, Viet Nam.";
54
+ var DEFAULT_VERSION_TYPE = "Internal";
55
+ var UNKNOWN = "Unknown";
56
+
57
+ // src/branding/Footer.tsx
58
+ var import_jsx_runtime = require("react/jsx-runtime");
59
+ var DEFAULT_SOCIAL_LINKS = [
60
+ {
61
+ label: "Facebook",
62
+ href: "https://www.facebook.com",
63
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_react.IconBrandFacebook, { size: 20 }),
64
+ color: "blue.8",
65
+ external: true
66
+ },
67
+ {
68
+ label: "GitHub",
69
+ href: "https://github.com",
70
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_react.IconBrandGithub, { size: 20 }),
71
+ color: "gray.6",
72
+ external: true
73
+ },
74
+ {
75
+ label: "Gmail",
76
+ href: "mailto:test@gmail.com",
77
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_react.IconMail, { size: 20 }),
78
+ color: "red.8",
79
+ external: false
80
+ }
81
+ ];
82
+ function Footer({
83
+ copyright = DEFAULT_COPYRIGHT,
84
+ author = DEFAULT_AUTHOR,
85
+ authorHref = DEFAULT_AUTHOR_HREF,
86
+ socialLinks = DEFAULT_SOCIAL_LINKS,
87
+ showSocialLinks = true
88
+ }) {
89
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Stack, { gap: "sm", mt: "md", align: "center", children: [
90
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Stack, { gap: 2, align: "center", children: [
91
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Group, { gap: 4, wrap: "nowrap", children: [
92
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Text, { c: "dimmed", size: "xs", children: [
93
+ "Copyright",
94
+ " "
95
+ ] }),
96
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_react.IconCopyright, { size: 15 }),
97
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Text, { size: "xs", c: "dimmed", children: [
98
+ (/* @__PURE__ */ new Date()).getFullYear(),
99
+ " ",
100
+ copyright
101
+ ] })
102
+ ] }),
103
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Group, { gap: 4, wrap: "nowrap", children: [
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Text, { size: "xs", c: "dimmed", children: "Built with" }),
105
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
106
+ import_icons_react.IconHeart,
107
+ {
108
+ size: 15,
109
+ style: { color: "var(--mantine-color-red-7)" }
110
+ }
111
+ ),
112
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Text, { size: "xs", c: "dimmed", children: "by" }),
113
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
114
+ import_core.Anchor,
115
+ {
116
+ href: authorHref,
117
+ size: "xs",
118
+ fw: 500,
119
+ target: "_blank",
120
+ children: author
121
+ }
122
+ )
123
+ ] })
124
+ ] }),
125
+ showSocialLinks && socialLinks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Group, { gap: "sm", children: socialLinks.map((link) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Tooltip, { label: link.label, withArrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
126
+ import_core.ActionIcon,
127
+ {
128
+ variant: "subtle",
129
+ color: link.color,
130
+ component: "a",
131
+ href: link.href,
132
+ target: link.external ? "_blank" : void 0,
133
+ rel: link.external ? "noopener noreferrer" : void 0,
134
+ children: link.icon
135
+ }
136
+ ) }, link.href)) })
137
+ ] });
138
+ }
139
+
140
+ // src/modals/Information.tsx
141
+ var import_react = require("react");
142
+ var import_core2 = require("@mantine/core");
143
+ var import_icons_react2 = require("@tabler/icons-react");
144
+
145
+ // src/utils/commonUtils.ts
146
+ var copyToClipboard = async (text) => {
147
+ try {
148
+ if (navigator.clipboard && window.isSecureContext) {
149
+ await navigator.clipboard.writeText(text);
150
+ return true;
151
+ }
152
+ const textarea = document.createElement("textarea");
153
+ textarea.value = text;
154
+ textarea.style.position = "fixed";
155
+ textarea.style.left = "-9999px";
156
+ textarea.style.top = "-9999px";
157
+ textarea.style.opacity = "0";
158
+ document.body.appendChild(textarea);
159
+ textarea.focus();
160
+ textarea.select();
161
+ const success = document.execCommand("copy");
162
+ document.body.removeChild(textarea);
163
+ return success;
164
+ } catch (err) {
165
+ console.error("Failed to copy to clipboard:", err);
166
+ return false;
167
+ }
168
+ };
169
+
170
+ // src/utils/timeUtils.ts
171
+ function normalizeDate(dateInput) {
172
+ if (dateInput instanceof Date) {
173
+ return isNaN(dateInput.getTime()) ? null : dateInput;
174
+ }
175
+ if (typeof dateInput === "string") {
176
+ const date = new Date(dateInput);
177
+ return isNaN(date.getTime()) ? null : date;
178
+ }
179
+ if (typeof dateInput === "number") {
180
+ const timestamp = dateInput < 1e12 ? dateInput * 1e3 : dateInput;
181
+ const date = new Date(timestamp);
182
+ return isNaN(date.getTime()) ? null : date;
183
+ }
184
+ return null;
185
+ }
186
+ function pad(n, width = 2) {
187
+ return String(n).padStart(width, "0");
188
+ }
189
+ function formatAbsolute(date) {
190
+ const tz = -date.getTimezoneOffset();
191
+ const sign = tz >= 0 ? "+" : "-";
192
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())} ${sign}${pad(Math.floor(Math.abs(tz) / 60))}:${pad(Math.abs(tz) % 60)}`;
193
+ }
194
+ function formatRelativeTime(date) {
195
+ const normalizedDate = normalizeDate(date);
196
+ if (!normalizedDate) return "Invalid date";
197
+ const now = Date.now();
198
+ const diffMs = now - normalizedDate.getTime();
199
+ const diffSeconds = Math.floor(diffMs / 1e3);
200
+ if (diffSeconds < 0) {
201
+ return "Just now";
202
+ }
203
+ if (diffSeconds < 60) {
204
+ return "Just now";
205
+ }
206
+ const minute = 60;
207
+ const hour = minute * 60;
208
+ const day = hour * 24;
209
+ const week = day * 7;
210
+ const month = day * 30;
211
+ const year = day * 365;
212
+ if (diffSeconds < hour) {
213
+ const mins = Math.floor(diffSeconds / minute);
214
+ return `${mins} min${mins !== 1 ? "s" : ""} ago`;
215
+ } else if (diffSeconds < day) {
216
+ const hours = Math.floor(diffSeconds / hour);
217
+ return `${hours} hour${hours !== 1 ? "s" : ""} ago`;
218
+ } else if (diffSeconds < week) {
219
+ const days = Math.floor(diffSeconds / day);
220
+ return `${days} day${days !== 1 ? "s" : ""} ago`;
221
+ } else if (diffSeconds < month) {
222
+ const weeks = Math.floor(diffSeconds / week);
223
+ return `${weeks} week${weeks !== 1 ? "s" : ""} ago`;
224
+ } else if (diffSeconds < year) {
225
+ const months = Math.floor(diffSeconds / month);
226
+ return `${months} month${months !== 1 ? "s" : ""} ago`;
227
+ } else {
228
+ const years = Math.floor(diffSeconds / year);
229
+ return `${years} year${years !== 1 ? "s" : ""} ago`;
230
+ }
231
+ }
232
+ function formatAbsoluteAndRelativeTime(date) {
233
+ const normalizedDate = normalizeDate(date);
234
+ if (!normalizedDate) return "Invalid date";
235
+ const absoluteTime = formatAbsolute(normalizedDate);
236
+ const relativeTime = formatRelativeTime(normalizedDate);
237
+ return `${absoluteTime} (${relativeTime})`;
238
+ }
239
+ function calculateRemainingTime(targetDate) {
240
+ if (!targetDate) return "Not set";
241
+ const normalizedDate = normalizeDate(targetDate);
242
+ if (!normalizedDate) return "Invalid date";
243
+ const now = /* @__PURE__ */ new Date();
244
+ const diffMs = normalizedDate.getTime() - now.getTime();
245
+ if (diffMs < 0) {
246
+ const daysOverdue = Math.floor(Math.abs(diffMs) / (1e3 * 60 * 60 * 24));
247
+ return `Overdue ${daysOverdue}d`;
248
+ }
249
+ const days = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
250
+ const hours = Math.floor(diffMs % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60));
251
+ if (days > 0) {
252
+ return `${days}d ${hours}h`;
253
+ } else if (hours > 0) {
254
+ return `${hours}h`;
255
+ } else {
256
+ return "< 1h";
257
+ }
258
+ }
259
+ var MONTH_NAMES = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
260
+ function formatHumanDate(date, options) {
261
+ const normalizedDate = normalizeDate(date);
262
+ if (!normalizedDate) return "Invalid date";
263
+ const month = MONTH_NAMES[normalizedDate.getMonth()];
264
+ const day = normalizedDate.getDate();
265
+ const year = normalizedDate.getFullYear();
266
+ if (!options?.showTime) {
267
+ return `${month} ${day}, ${year}`;
268
+ }
269
+ const hours = normalizedDate.getHours();
270
+ const minutes = normalizedDate.getMinutes();
271
+ const seconds = normalizedDate.getSeconds();
272
+ const ampm = hours >= 12 ? "PM" : "AM";
273
+ const hours12 = hours % 12 || 12;
274
+ let timeStr = `${hours12}:${pad(minutes)}`;
275
+ if (options.showSeconds) {
276
+ timeStr += `:${pad(seconds)}`;
277
+ }
278
+ timeStr += ` ${ampm}`;
279
+ return `${month} ${day}, ${year} ${timeStr}`;
280
+ }
281
+
282
+ // src/modals/Information.tsx
283
+ var import_jsx_runtime2 = require("react/jsx-runtime");
284
+ var DEFAULT_TITLE = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Group, { gap: "xs", wrap: "nowrap", children: [
285
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_react2.IconCpu, { size: 20 }),
286
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "System Information" })
287
+ ] });
288
+ function InformationContent({ info }) {
289
+ const colorScheme = (0, import_core2.useComputedColorScheme)();
290
+ const author = info.author ?? DEFAULT_AUTHOR;
291
+ const versionType = info.versionType ?? DEFAULT_VERSION_TYPE;
292
+ const cards = [
293
+ {
294
+ icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_react2.IconUser, { size: 18 }),
295
+ label: "Author",
296
+ value: author,
297
+ color: "blue"
298
+ },
299
+ {
300
+ icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_react2.IconLicense, { size: 18 }),
301
+ label: "License",
302
+ value: info.license ?? DEFAULT_LICENSE,
303
+ color: "orange"
304
+ },
305
+ {
306
+ icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_react2.IconMapPin, { size: 18 }),
307
+ label: "Location",
308
+ value: info.location ?? DEFAULT_LOCATION,
309
+ color: "teal"
310
+ },
311
+ {
312
+ icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_react2.IconTag, { size: 18 }),
313
+ label: "Version Type",
314
+ value: versionType,
315
+ color: "red"
316
+ },
317
+ {
318
+ icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_react2.IconCalendar, { size: 18 }),
319
+ label: "Build Time",
320
+ value: info.buildTime !== void 0 ? formatAbsoluteAndRelativeTime(info.buildTime) : UNKNOWN,
321
+ color: "green"
322
+ },
323
+ ...info.metadata ?? []
324
+ ];
325
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Stack, { gap: "lg", children: [
326
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Stack, { gap: "xs", align: "center", children: [
327
+ info.logo,
328
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Stack, { gap: 2, align: "center", children: [
329
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Title, { order: 2, children: info.name }),
330
+ info.tagline && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Text, { size: "sm", c: "dimmed", w: 600, ta: "center", children: info.tagline })
331
+ ] }),
332
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Group, { gap: "xs", children: [
333
+ info.version && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
334
+ import_core2.Badge,
335
+ {
336
+ size: "lg",
337
+ color: "blue",
338
+ variant: "outline",
339
+ mt: "sm",
340
+ tt: "none",
341
+ fw: 600,
342
+ children: [
343
+ "\u2728 v",
344
+ info.version
345
+ ]
346
+ }
347
+ ),
348
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
349
+ import_core2.Badge,
350
+ {
351
+ size: "lg",
352
+ color: "teal",
353
+ variant: "light",
354
+ mt: "sm",
355
+ tt: "none",
356
+ fw: 600,
357
+ children: [
358
+ "\u{1F9E9} ",
359
+ versionType
360
+ ]
361
+ }
362
+ )
363
+ ] })
364
+ ] }),
365
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Divider, { label: "System Information", labelPosition: "center" }),
366
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.SimpleGrid, { cols: { base: 1, sm: 2 }, children: [
367
+ cards.map((card) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
368
+ InfoCard,
369
+ {
370
+ icon: card.icon ?? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_react2.IconAward, { size: 18 }),
371
+ label: card.label,
372
+ value: card.value,
373
+ color: card.color ?? "gray"
374
+ },
375
+ card.label
376
+ )),
377
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
378
+ import_core2.Paper,
379
+ {
380
+ withBorder: true,
381
+ p: "sm",
382
+ radius: "18px",
383
+ bg: colorScheme === "dark" ? "gray.9" : "gray.0",
384
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Group, { justify: "space-between", wrap: "nowrap", children: [
385
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Group, { gap: "sm", flex: 1, children: [
386
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.ThemeIcon, { variant: "light", color: "yellow", size: "lg", radius: "14px", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_react2.IconHash, { size: 18 }) }),
387
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Stack, { gap: 2, children: [
388
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Text, { size: "xs", c: "dimmed", fw: 700, tt: "uppercase", children: "Build ID" }),
389
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Text, { size: "sm", fw: 500, truncate: true, children: info.buildId ?? UNKNOWN })
390
+ ] })
391
+ ] }),
392
+ info.buildId && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CopyBuildIdButton, { buildId: info.buildId })
393
+ ] })
394
+ }
395
+ )
396
+ ] }),
397
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
398
+ Footer,
399
+ {
400
+ copyright: info.copyright,
401
+ author,
402
+ authorHref: info.authorHref,
403
+ socialLinks: info.socialLinks
404
+ }
405
+ )
406
+ ] });
407
+ }
408
+ function InformationModal({
409
+ opened,
410
+ onClose,
411
+ info,
412
+ title = DEFAULT_TITLE
413
+ }) {
414
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
415
+ import_core2.Modal,
416
+ {
417
+ opened,
418
+ onClose,
419
+ withCloseButton: true,
420
+ centered: true,
421
+ radius: "lg",
422
+ size: "60%",
423
+ styles: {
424
+ content: {
425
+ maxHeight: "90vh",
426
+ height: "90vh"
427
+ },
428
+ body: {
429
+ flex: 1,
430
+ overflow: "auto"
431
+ }
432
+ },
433
+ title,
434
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InformationContent, { info })
435
+ }
436
+ );
437
+ }
438
+ function CopyBuildIdButton({ buildId }) {
439
+ const [copied, setCopied] = (0, import_react.useState)(false);
440
+ const handleCopy = async () => {
441
+ const success = await copyToClipboard(buildId);
442
+ if (success) {
443
+ setCopied(true);
444
+ setTimeout(() => setCopied(false), 2e3);
445
+ }
446
+ };
447
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Tooltip, { label: copied ? "Copied!" : "Copy ID", withArrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
448
+ import_core2.ActionIcon,
449
+ {
450
+ variant: "subtle",
451
+ color: copied ? "teal" : "gray",
452
+ onClick: handleCopy,
453
+ children: copied ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_react2.IconCheck, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_react2.IconCopy, { size: 16 })
454
+ }
455
+ ) });
456
+ }
457
+ function InfoCard({
458
+ icon,
459
+ label,
460
+ value,
461
+ color
462
+ }) {
463
+ const colorScheme = (0, import_core2.useComputedColorScheme)();
464
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Paper, { withBorder: true, p: "md", radius: "18px", h: "100%", bg: colorScheme === "dark" ? "gray.9" : "gray.0", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Group, { gap: "sm", align: "flex-start", children: [
465
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.ThemeIcon, { color, variant: "light", size: "lg", radius: "14px", children: icon }),
466
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Stack, { gap: 2, flex: 1, children: [
467
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Text, { size: "xs", c: "dimmed", fw: 700, tt: "uppercase", children: label }),
468
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Text, { size: "sm", fw: 500, lineClamp: 1, children: value })
469
+ ] })
470
+ ] }) });
471
+ }
472
+ // Annotate the CommonJS export names for ESM import in node:
473
+ 0 && (module.exports = {
474
+ DEFAULT_AUTHOR,
475
+ DEFAULT_AUTHOR_HREF,
476
+ DEFAULT_COPYRIGHT,
477
+ DEFAULT_LICENSE,
478
+ DEFAULT_LOCATION,
479
+ DEFAULT_VERSION_TYPE,
480
+ Footer,
481
+ InformationContent,
482
+ InformationModal,
483
+ UNKNOWN,
484
+ calculateRemainingTime,
485
+ copyToClipboard,
486
+ formatAbsolute,
487
+ formatAbsoluteAndRelativeTime,
488
+ formatHumanDate,
489
+ formatRelativeTime,
490
+ normalizeDate,
491
+ pad
492
+ });
493
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/branding/Footer.tsx","../src/utils/constants.ts","../src/modals/Information.tsx","../src/utils/commonUtils.ts","../src/utils/timeUtils.ts"],"sourcesContent":["/*\r\n * OTMC License.\r\n * Copyright (c) 2026 OTMC Softwares. All rights reserved.\r\n * Contributors: Nguyen Van Trung, OTMC Authors.\r\n */\r\n\r\nexport * from './branding';\r\nexport * from './modals';\r\nexport * from './utils';\r\n","/***\r\n * OTMC License.\r\n * Copyright (c) 2026 OTMC Softwares. All rights reserved.\r\n * Contributors: Nguyen Van Trung, OTMC Contributors.\r\n***/\r\n\r\nimport { Stack, Group, Text, Anchor, Tooltip, ActionIcon } from '@mantine/core';\r\nimport {\r\n IconCopyright,\r\n IconHeart,\r\n IconBrandFacebook,\r\n IconBrandGithub,\r\n IconMail,\r\n} from '@tabler/icons-react';\r\nimport { ReactNode } from 'react';\r\n\r\nimport {\r\n DEFAULT_AUTHOR,\r\n DEFAULT_AUTHOR_HREF,\r\n DEFAULT_COPYRIGHT,\r\n} from '../utils/constants';\r\n\r\nexport interface FooterSocialLink {\r\n label: string;\r\n href: string;\r\n icon: ReactNode;\r\n color?: string;\r\n external?: boolean;\r\n}\r\n\r\nexport interface FooterProps {\r\n copyright?: string;\r\n author?: string;\r\n authorHref?: string;\r\n socialLinks?: FooterSocialLink[];\r\n showCopyright?: boolean;\r\n showAuthor?: boolean;\r\n showSocialLinks?: boolean;\r\n}\r\n\r\nconst DEFAULT_SOCIAL_LINKS: FooterSocialLink[] = [\r\n {\r\n label: 'Facebook',\r\n href: 'https://www.facebook.com',\r\n icon: <IconBrandFacebook size={20} />,\r\n color: 'blue.8',\r\n external: true,\r\n },\r\n {\r\n label: 'GitHub',\r\n href: 'https://github.com',\r\n icon: <IconBrandGithub size={20} />,\r\n color: 'gray.6',\r\n external: true,\r\n },\r\n {\r\n label: 'Gmail',\r\n href: 'mailto:test@gmail.com',\r\n icon: <IconMail size={20} />,\r\n color: 'red.8',\r\n external: false,\r\n },\r\n];\r\n\r\nexport function Footer({\r\n copyright = DEFAULT_COPYRIGHT,\r\n author = DEFAULT_AUTHOR,\r\n authorHref = DEFAULT_AUTHOR_HREF,\r\n socialLinks = DEFAULT_SOCIAL_LINKS,\r\n showSocialLinks = true,\r\n}: FooterProps) {\r\n\r\n return (\r\n <Stack gap=\"sm\" mt=\"md\" align=\"center\">\r\n <Stack gap={2} align=\"center\">\r\n <Group gap={4} wrap=\"nowrap\">\r\n <Text c=\"dimmed\" size=\"xs\">\r\n Copyright{' '}\r\n </Text>\r\n <IconCopyright size={15} />\r\n <Text size=\"xs\" c=\"dimmed\">\r\n {new Date().getFullYear()} {copyright}\r\n </Text>\r\n </Group>\r\n <Group gap={4} wrap=\"nowrap\">\r\n <Text size=\"xs\" c=\"dimmed\">\r\n Built with\r\n </Text>\r\n <IconHeart\r\n size={15}\r\n style={{ color: 'var(--mantine-color-red-7)' }}\r\n />\r\n <Text size=\"xs\" c=\"dimmed\">\r\n by\r\n </Text>\r\n <Anchor\r\n href={authorHref}\r\n size=\"xs\"\r\n fw={500}\r\n target=\"_blank\"\r\n >\r\n {author}\r\n </Anchor>\r\n </Group>\r\n </Stack>\r\n\r\n {showSocialLinks && socialLinks.length > 0 && (\r\n <Group gap=\"sm\">\r\n {socialLinks.map((link) => (\r\n <Tooltip key={link.href} label={link.label} withArrow>\r\n <ActionIcon\r\n variant=\"subtle\"\r\n color={link.color}\r\n component=\"a\"\r\n href={link.href}\r\n target={link.external ? '_blank' : undefined}\r\n rel={link.external ? 'noopener noreferrer' : undefined}\r\n >\r\n {link.icon}\r\n </ActionIcon>\r\n </Tooltip>\r\n ))}\r\n </Group>\r\n )}\r\n </Stack>\r\n );\r\n}\r\n\r\n","/**\r\n * @License OTMC License\r\n * @Copyright (c) 2026 OTMC Softwares. All rights reserved.\r\n * @Contributors Trung Ng, OTMC Authors.\r\n**/\r\n\r\nexport const DEFAULT_AUTHOR = 'Nguyen Van Trung, OTMC Contributors.';\r\nexport const DEFAULT_AUTHOR_HREF = 'https://github.com/otmc-sw';\r\nexport const DEFAULT_COPYRIGHT = 'OTMC Softwares. All rights reserved.';\r\nexport const DEFAULT_LICENSE = 'OTMC License.';\r\nexport const DEFAULT_LOCATION = 'An Nhon, Gia Lai, Viet Nam.';\r\nexport const DEFAULT_VERSION_TYPE = 'Internal';\r\nexport const UNKNOWN = 'Unknown';\r\n","/***\n * OTMC License.\n * Copyright (c) 2026 OTMC Softwares. All rights reserved.\n * Contributors: Nguyen Van Trung, OTMC Contributors.\n***/\n\nimport { useState, type ReactNode } from 'react';\nimport {\n Modal,\n Stack,\n Title,\n Text,\n Group,\n Divider,\n Badge,\n ThemeIcon,\n SimpleGrid,\n Paper,\n ActionIcon,\n Tooltip,\n useComputedColorScheme,\n} from '@mantine/core';\nimport {\n IconAward,\n IconCalendar,\n IconCheck,\n IconCopy,\n IconCpu,\n IconHash,\n IconLicense,\n IconMapPin,\n IconTag,\n IconUser,\n} from '@tabler/icons-react';\n\nimport { Footer, type FooterSocialLink } from '../branding';\nimport { copyToClipboard } from '../utils/commonUtils';\nimport {\n DEFAULT_AUTHOR,\n DEFAULT_LICENSE,\n DEFAULT_LOCATION,\n DEFAULT_VERSION_TYPE,\n UNKNOWN,\n} from '../utils/constants';\nimport { formatAbsoluteAndRelativeTime } from '../utils/timeUtils';\n\nexport interface InformationMetadata {\n icon?: ReactNode;\n label: string;\n value: string;\n color?: string;\n}\n\nexport interface ApplicationInfo {\n name: string;\n version?: string;\n versionType?: string;\n tagline?: string;\n logo?: ReactNode;\n author?: string;\n authorHref?: string;\n license?: string;\n location?: string;\n copyright?: string;\n buildId?: string;\n buildTime?: string | number | Date;\n metadata?: InformationMetadata[];\n socialLinks?: FooterSocialLink[];\n}\n\nexport interface InformationContentProps {\n info: ApplicationInfo;\n}\n\nexport interface InformationModalProps {\n opened: boolean;\n onClose: () => void;\n info: ApplicationInfo;\n title?: ReactNode;\n}\n\nconst DEFAULT_TITLE = (\n <Group gap=\"xs\" wrap=\"nowrap\">\n <IconCpu size={20} />\n <span>System Information</span>\n </Group>\n);\n\n\nexport function InformationContent({ info }: InformationContentProps) {\n const colorScheme = useComputedColorScheme();\n\n const author = info.author ?? DEFAULT_AUTHOR;\n const versionType = info.versionType ?? DEFAULT_VERSION_TYPE;\n\n const cards: InformationMetadata[] = [\n {\n icon: <IconUser size={18} />,\n label: 'Author',\n value: author,\n color: 'blue',\n },\n {\n icon: <IconLicense size={18} />,\n label: 'License',\n value: info.license ?? DEFAULT_LICENSE,\n color: 'orange',\n },\n {\n icon: <IconMapPin size={18} />,\n label: 'Location',\n value: info.location ?? DEFAULT_LOCATION,\n color: 'teal',\n },\n {\n icon: <IconTag size={18} />,\n label: 'Version Type',\n value: versionType,\n color: 'red',\n },\n {\n icon: <IconCalendar size={18} />,\n label: 'Build Time',\n value:\n info.buildTime !== undefined\n ? formatAbsoluteAndRelativeTime(info.buildTime)\n : UNKNOWN,\n color: 'green',\n },\n ...(info.metadata ?? []),\n ];\n\n return (\n <Stack gap=\"lg\">\n <Stack gap=\"xs\" align=\"center\">\n {info.logo}\n\n <Stack gap={2} align=\"center\">\n <Title order={2}>{info.name}</Title>\n {info.tagline && (\n <Text size=\"sm\" c=\"dimmed\" w={600} ta=\"center\">\n {info.tagline}\n </Text>\n )}\n </Stack>\n\n <Group gap=\"xs\">\n {info.version && (\n <Badge\n size=\"lg\"\n color=\"blue\"\n variant=\"outline\"\n mt=\"sm\"\n tt=\"none\"\n fw={600}\n >\n ✨ v{info.version}\n </Badge>\n )}\n <Badge\n size=\"lg\"\n color=\"teal\"\n variant=\"light\"\n mt=\"sm\"\n tt=\"none\"\n fw={600}\n >\n 🧩 {versionType}\n </Badge>\n </Group>\n </Stack>\n\n <Divider label=\"System Information\" labelPosition=\"center\" />\n\n <SimpleGrid cols={{ base: 1, sm: 2 }}>\n {cards.map((card) => (\n <InfoCard\n key={card.label}\n icon={card.icon ?? <IconAward size={18} />}\n label={card.label}\n value={card.value}\n color={card.color ?? 'gray'}\n />\n ))}\n\n <Paper\n withBorder\n p=\"sm\"\n radius=\"18px\"\n bg={colorScheme === 'dark' ? 'gray.9' : 'gray.0'}\n >\n <Group justify=\"space-between\" wrap=\"nowrap\">\n <Group gap=\"sm\" flex={1}>\n <ThemeIcon variant=\"light\" color=\"yellow\" size=\"lg\" radius=\"14px\">\n <IconHash size={18} />\n </ThemeIcon>\n\n <Stack gap={2}>\n <Text size=\"xs\" c=\"dimmed\" fw={700} tt=\"uppercase\">\n Build ID\n </Text>\n <Text size=\"sm\" fw={500} truncate>\n {info.buildId ?? UNKNOWN}\n </Text>\n </Stack>\n </Group>\n\n {info.buildId && <CopyBuildIdButton buildId={info.buildId} />}\n </Group>\n </Paper>\n </SimpleGrid>\n\n <Footer\n copyright={info.copyright}\n author={author}\n authorHref={info.authorHref}\n socialLinks={info.socialLinks}\n />\n </Stack>\n );\n}\n\nexport function InformationModal({\n opened,\n onClose,\n info,\n title = DEFAULT_TITLE,\n}: InformationModalProps) {\n return (\n <Modal\n opened={opened}\n onClose={onClose}\n withCloseButton\n centered\n radius=\"lg\"\n size=\"60%\"\n styles={{\n content: {\n maxHeight: '90vh',\n height: '90vh',\n },\n body: {\n flex: 1,\n overflow: 'auto',\n },\n }}\n title={title}\n >\n <InformationContent info={info} />\n </Modal>\n );\n}\n\nfunction CopyBuildIdButton({ buildId }: { buildId: string }) {\n const [copied, setCopied] = useState(false);\n\n const handleCopy = async () => {\n const success = await copyToClipboard(buildId);\n if (success) {\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n }\n };\n\n return (\n <Tooltip label={copied ? 'Copied!' : 'Copy ID'} withArrow>\n <ActionIcon\n variant=\"subtle\"\n color={copied ? 'teal' : 'gray'}\n onClick={handleCopy}\n >\n {copied ? <IconCheck size={16} /> : <IconCopy size={16} />}\n </ActionIcon>\n </Tooltip>\n );\n}\n\nfunction InfoCard({\n icon,\n label,\n value,\n color,\n}: {\n icon: ReactNode;\n label: string;\n value: string;\n color: string;\n}) {\n const colorScheme = useComputedColorScheme();\n return (\n <Paper withBorder p=\"md\" radius=\"18px\" h=\"100%\" bg={colorScheme === 'dark' ? 'gray.9' : 'gray.0'}>\n <Group gap=\"sm\" align=\"flex-start\">\n <ThemeIcon color={color} variant=\"light\" size=\"lg\" radius=\"14px\">\n {icon}\n </ThemeIcon>\n\n <Stack gap={2} flex={1}>\n <Text size=\"xs\" c=\"dimmed\" fw={700} tt=\"uppercase\">\n {label}\n </Text>\n <Text size=\"sm\" fw={500} lineClamp={1}>\n {value}\n </Text>\n </Stack>\n </Group>\n </Paper>\n );\n}\n\n","/**\n * @License OTMC License\n * @Copyright (c) 2026 OTMC Softwares. All rights reserved.\n * @Contributors Trung Ng, OTMC Authors.\n**/\nexport const copyToClipboard = async (text: string): Promise<boolean> => {\n try {\n if (navigator.clipboard && window.isSecureContext) {\n await navigator.clipboard.writeText(text);\n return true;\n }\n \n const textarea = document.createElement('textarea');\n textarea.value = text;\n textarea.style.position = 'fixed';\n textarea.style.left = '-9999px';\n textarea.style.top = '-9999px';\n textarea.style.opacity = '0';\n document.body.appendChild(textarea);\n textarea.focus();\n textarea.select();\n \n const success = document.execCommand('copy');\n document.body.removeChild(textarea);\n \n return success;\n } catch (err) {\n console.error('Failed to copy to clipboard:', err);\n return false;\n }\n};\n","/**\n * @License OTMC License\n * @Copyright (c) 2026 OTMC Softwares. All rights reserved.\n * @Contributors Trung Ng, OTMC Authors.\n**/\n\nexport type TimestampFormatType = \"absolute\" | \"relative\";\n\n\nexport function normalizeDate(dateInput: string | number | Date): Date | null {\n if (dateInput instanceof Date) {\n return isNaN(dateInput.getTime()) ? null : dateInput;\n }\n\n if (typeof dateInput === 'string') {\n const date = new Date(dateInput);\n return isNaN(date.getTime()) ? null : date;\n }\n\n if (typeof dateInput === 'number') {\n const timestamp = dateInput < 1e12 ? dateInput * 1000 : dateInput;\n const date = new Date(timestamp);\n return isNaN(date.getTime()) ? null : date;\n }\n\n return null;\n}\n\nexport function pad(n: number, width: number = 2): string {\n return String(n).padStart(width, \"0\");\n}\n\nexport function formatAbsolute(date: Date): string {\n const tz = -date.getTimezoneOffset();\n const sign = tz >= 0 ? \"+\" : \"-\";\n \n return (\n `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ` +\n `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())} ` +\n `${sign}${pad(Math.floor(Math.abs(tz) / 60))}:${pad(Math.abs(tz) % 60)}`\n );\n}\n\nexport function formatRelativeTime(date: string | number | Date): string {\n const normalizedDate = normalizeDate(date);\n if (!normalizedDate) return \"Invalid date\";\n\n const now = Date.now();\n const diffMs = now - normalizedDate.getTime();\n const diffSeconds = Math.floor(diffMs / 1000);\n\n if (diffSeconds < 0) {\n return \"Just now\";\n }\n\n if (diffSeconds < 60) {\n return \"Just now\";\n }\n\n const minute = 60;\n const hour = minute * 60;\n const day = hour * 24;\n const week = day * 7;\n const month = day * 30;\n const year = day * 365;\n\n if (diffSeconds < hour) {\n const mins = Math.floor(diffSeconds / minute);\n return `${mins} min${mins !== 1 ? 's' : ''} ago`;\n } else if (diffSeconds < day) {\n const hours = Math.floor(diffSeconds / hour);\n return `${hours} hour${hours !== 1 ? 's' : ''} ago`;\n } else if (diffSeconds < week) {\n const days = Math.floor(diffSeconds / day);\n return `${days} day${days !== 1 ? 's' : ''} ago`;\n } else if (diffSeconds < month) {\n const weeks = Math.floor(diffSeconds / week);\n return `${weeks} week${weeks !== 1 ? 's' : ''} ago`;\n } else if (diffSeconds < year) {\n const months = Math.floor(diffSeconds / month);\n return `${months} month${months !== 1 ? 's' : ''} ago`;\n } else {\n const years = Math.floor(diffSeconds / year);\n return `${years} year${years !== 1 ? 's' : ''} ago`;\n }\n}\n\nexport function formatAbsoluteAndRelativeTime(date: string | number | Date): string {\n const normalizedDate = normalizeDate(date);\n if (!normalizedDate) return \"Invalid date\";\n\n const absoluteTime = formatAbsolute(normalizedDate);\n const relativeTime = formatRelativeTime(normalizedDate);\n\n return `${absoluteTime} (${relativeTime})`;\n}\n\nexport function calculateRemainingTime(targetDate: string | number | Date | undefined): string {\n if (!targetDate) return 'Not set';\n\n const normalizedDate = normalizeDate(targetDate);\n if (!normalizedDate) return 'Invalid date';\n\n const now = new Date();\n const diffMs = normalizedDate.getTime() - now.getTime();\n\n if (diffMs < 0) {\n const daysOverdue = Math.floor(Math.abs(diffMs) / (1000 * 60 * 60 * 24));\n return `Overdue ${daysOverdue}d`;\n }\n\n const days = Math.floor(diffMs / (1000 * 60 * 60 * 24));\n const hours = Math.floor((diffMs % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\n\n if (days > 0) {\n return `${days}d ${hours}h`;\n } else if (hours > 0) {\n return `${hours}h`;\n } else {\n return '< 1h';\n }\n}\n\nconst MONTH_NAMES = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\nexport function formatHumanDate(date: string | number | Date, options?: { showTime?: boolean; showSeconds?: boolean }): string {\n const normalizedDate = normalizeDate(date);\n if (!normalizedDate) return 'Invalid date';\n\n const month = MONTH_NAMES[normalizedDate.getMonth()];\n const day = normalizedDate.getDate();\n const year = normalizedDate.getFullYear();\n\n if (!options?.showTime) {\n return `${month} ${day}, ${year}`;\n }\n\n const hours = normalizedDate.getHours();\n const minutes = normalizedDate.getMinutes();\n const seconds = normalizedDate.getSeconds();\n const ampm = hours >= 12 ? 'PM' : 'AM';\n const hours12 = hours % 12 || 12;\n\n let timeStr = `${hours12}:${pad(minutes)}`;\n if (options.showSeconds) {\n timeStr += `:${pad(seconds)}`;\n }\n timeStr += ` ${ampm}`;\n\n return `${month} ${day}, ${year} ${timeStr}`;\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,kBAAgE;AAChE,yBAMO;;;ACPA,IAAM,iBAAiB;AACvB,IAAM,sBAAsB;AAC5B,IAAM,oBAAoB;AAC1B,IAAM,kBAAkB;AACxB,IAAM,mBAAmB;AACzB,IAAM,uBAAuB;AAC7B,IAAM,UAAU;;;ADgCb;AAJV,IAAM,uBAA2C;AAAA,EAC/C;AAAA,IACE,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM,4CAAC,wCAAkB,MAAM,IAAI;AAAA,IACnC,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM,4CA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AM,kBAAc,qCAAuB;AAC3C,SACE,6CAAC,sBAAM,YAAU,MAAC,GAAE,MAAK,QAAO,QAAO,GAAE,QAAO,IAAI,gBAAgB,SAAS,WAAW,UACtF,wDAAC,sBAAM,KAAI,MAAK,OAAM,cACpB;AAAA,iDAAC,0BAAU,OAAc,SAAQ,SAAQ,MAAK,MAAK,QAAO,QACvD,gBACH;AAAA,IAEA,8CAAC,sBAAM,KAAK,GAAG,MAAM,GACnB;AAAA,mDAAC,qBAAK,MAAK,MAAK,GAAE,UAAS,IAAI,KAAK,IAAG,aACpC,iBACH;AAAA,MACA,6CAAC,qBAAK,MAAK,MAAK,IAAI,KAAK,WAAW,GACjC,iBACH;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":["import_core","import_icons_react","import_jsx_runtime"]}
@@ -0,0 +1,93 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface FooterSocialLink {
5
+ label: string;
6
+ href: string;
7
+ icon: ReactNode;
8
+ color?: string;
9
+ external?: boolean;
10
+ }
11
+ interface FooterProps {
12
+ copyright?: string;
13
+ author?: string;
14
+ authorHref?: string;
15
+ socialLinks?: FooterSocialLink[];
16
+ showCopyright?: boolean;
17
+ showAuthor?: boolean;
18
+ showSocialLinks?: boolean;
19
+ }
20
+ declare function Footer({ copyright, author, authorHref, socialLinks, showSocialLinks, }: FooterProps): react.JSX.Element;
21
+
22
+ interface InformationMetadata {
23
+ icon?: ReactNode;
24
+ label: string;
25
+ value: string;
26
+ color?: string;
27
+ }
28
+ interface ApplicationInfo {
29
+ name: string;
30
+ version?: string;
31
+ versionType?: string;
32
+ tagline?: string;
33
+ logo?: ReactNode;
34
+ author?: string;
35
+ authorHref?: string;
36
+ license?: string;
37
+ location?: string;
38
+ copyright?: string;
39
+ buildId?: string;
40
+ buildTime?: string | number | Date;
41
+ metadata?: InformationMetadata[];
42
+ socialLinks?: FooterSocialLink[];
43
+ }
44
+ interface InformationContentProps {
45
+ info: ApplicationInfo;
46
+ }
47
+ interface InformationModalProps {
48
+ opened: boolean;
49
+ onClose: () => void;
50
+ info: ApplicationInfo;
51
+ title?: ReactNode;
52
+ }
53
+ declare function InformationContent({ info }: InformationContentProps): react.JSX.Element;
54
+ declare function InformationModal({ opened, onClose, info, title, }: InformationModalProps): react.JSX.Element;
55
+
56
+ /**
57
+ * @License OTMC License
58
+ * @Copyright (c) 2026 OTMC Softwares. All rights reserved.
59
+ * @Contributors Trung Ng, OTMC Authors.
60
+ **/
61
+ declare const copyToClipboard: (text: string) => Promise<boolean>;
62
+
63
+ /**
64
+ * @License OTMC License
65
+ * @Copyright (c) 2026 OTMC Softwares. All rights reserved.
66
+ * @Contributors Trung Ng, OTMC Authors.
67
+ **/
68
+ declare const DEFAULT_AUTHOR = "Nguyen Van Trung, OTMC Contributors.";
69
+ declare const DEFAULT_AUTHOR_HREF = "https://github.com/otmc-sw";
70
+ declare const DEFAULT_COPYRIGHT = "OTMC Softwares. All rights reserved.";
71
+ declare const DEFAULT_LICENSE = "OTMC License.";
72
+ declare const DEFAULT_LOCATION = "An Nhon, Gia Lai, Viet Nam.";
73
+ declare const DEFAULT_VERSION_TYPE = "Internal";
74
+ declare const UNKNOWN = "Unknown";
75
+
76
+ /**
77
+ * @License OTMC License
78
+ * @Copyright (c) 2026 OTMC Softwares. All rights reserved.
79
+ * @Contributors Trung Ng, OTMC Authors.
80
+ **/
81
+ type TimestampFormatType = "absolute" | "relative";
82
+ declare function normalizeDate(dateInput: string | number | Date): Date | null;
83
+ declare function pad(n: number, width?: number): string;
84
+ declare function formatAbsolute(date: Date): string;
85
+ declare function formatRelativeTime(date: string | number | Date): string;
86
+ declare function formatAbsoluteAndRelativeTime(date: string | number | Date): string;
87
+ declare function calculateRemainingTime(targetDate: string | number | Date | undefined): string;
88
+ declare function formatHumanDate(date: string | number | Date, options?: {
89
+ showTime?: boolean;
90
+ showSeconds?: boolean;
91
+ }): string;
92
+
93
+ export { type ApplicationInfo, DEFAULT_AUTHOR, DEFAULT_AUTHOR_HREF, DEFAULT_COPYRIGHT, DEFAULT_LICENSE, DEFAULT_LOCATION, DEFAULT_VERSION_TYPE, Footer, type FooterProps, type FooterSocialLink, InformationContent, type InformationContentProps, type InformationMetadata, InformationModal, type InformationModalProps, type TimestampFormatType, UNKNOWN, calculateRemainingTime, copyToClipboard, formatAbsolute, formatAbsoluteAndRelativeTime, formatHumanDate, formatRelativeTime, normalizeDate, pad };