@olenbetong/synergi-react 4.3.0 → 5.0.0

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.
Files changed (81) hide show
  1. package/dist/styles/styles.css +1 -1
  2. package/dist/styles/styles.css.map +1 -1
  3. package/es/components/CodeEditor/CodeEditor.css +6 -6
  4. package/es/components/MergeProgressDialog/MergeProgressDialogDs.d.ts +7 -0
  5. package/es/components/MergeProgressDialog/MergeProgressDialogDs.js +20 -0
  6. package/es/components/MergeProgressDialog/index.d.ts +3 -8
  7. package/es/components/MergeProgressDialog/index.js +4 -113
  8. package/es/components/MergeProgressDialog/useMergeJob.d.ts +36 -0
  9. package/es/components/MergeProgressDialog/useMergeJob.js +141 -0
  10. package/es/components/ProgressBar/index.css +1 -1
  11. package/es/components/Toolbar/Toolbar.css +137 -137
  12. package/es/elements/ElementLookupDialog/BarcodeScanner/BarcodeScanner.css +81 -0
  13. package/es/elements/ElementLookupDialog/BarcodeScanner/DeadIcon.d.ts +2 -2
  14. package/es/elements/ElementLookupDialog/BarcodeScanner/DeadIcon.js +1 -2
  15. package/es/elements/ElementLookupDialog/BarcodeScanner/Error.js +3 -29
  16. package/es/elements/ElementLookupDialog/BarcodeScanner/index.d.ts +1 -0
  17. package/es/elements/ElementLookupDialog/BarcodeScanner/index.js +3 -28
  18. package/es/index.css +1 -1
  19. package/es/index.d.ts +2 -1
  20. package/es/index.js +2 -1
  21. package/es/mui/index.d.ts +1 -0
  22. package/es/mui/index.js +1 -0
  23. package/es/test/setup.d.ts +5 -0
  24. package/package.json +21 -14
  25. package/src/chrome/AppShell/index.tsx +29 -29
  26. package/src/chrome/openReport.ts +34 -34
  27. package/src/colorScheme.ts +125 -125
  28. package/src/components/CodeEditor/CodeEditor.css +6 -6
  29. package/src/components/CodeEditor/CodeEditor.tsx +173 -173
  30. package/src/components/CodeEditor/index.ts +1 -1
  31. package/src/components/DateNavigator/index.tsx +186 -186
  32. package/src/components/FilePond.tsx +312 -312
  33. package/src/components/ImageEditor/ImageEditor.tsx +348 -348
  34. package/src/components/ImageEditor/index.ts +9 -9
  35. package/src/components/ImageEditor/plugins/cropPlugin/CropOverlay.tsx +165 -165
  36. package/src/components/ImageEditor/plugins/cropPlugin/CropToolbar.tsx +48 -48
  37. package/src/components/ImageEditor/plugins/cropPlugin/useCropTool.ts +405 -405
  38. package/src/components/ImageEditor/plugins/redactPlugin/RedactToolbar.tsx +47 -47
  39. package/src/components/ImageEditor/plugins/zoomPlugin/ZoomContext.tsx +23 -23
  40. package/src/components/ImageEditor/plugins/zoomPlugin/ZoomControls.tsx +40 -40
  41. package/src/components/ImageEditor/useActiveTool.ts +21 -21
  42. package/src/components/ImageEditor/useEdgeDetection.ts +319 -319
  43. package/src/components/ImageEditor/useImageHistory.ts +197 -197
  44. package/src/components/ImageEditor/useOpenCV.ts +184 -184
  45. package/src/components/LinkedCardList/index.scss +95 -95
  46. package/src/components/MergeProgressDialog/MergeProgressDialogDs.tsx +91 -0
  47. package/src/components/MergeProgressDialog/index.tsx +5 -136
  48. package/src/components/MergeProgressDialog/useMergeJob.ts +169 -0
  49. package/src/components/PageBanner/index.tsx +80 -80
  50. package/src/components/PdfViewer/PdfViewer.tsx +158 -158
  51. package/src/components/ProgressBar/index.scss +23 -54
  52. package/src/components/SplitContainer/index.tsx +333 -333
  53. package/src/components/Toolbar/Toolbar.css +137 -137
  54. package/src/components/Toolbar/index.tsx +265 -265
  55. package/src/designsystemet-web-types.d.ts +24 -24
  56. package/src/elements/ElementDamage/DamageFormButtons.tsx +35 -35
  57. package/src/elements/ElementDamage/DescriptionInput.tsx +120 -120
  58. package/src/elements/ElementDamage/DuplicateDamage/DesktopView.tsx +82 -82
  59. package/src/elements/ElementDamage/DuplicateDamage/DublicateElementDamageDialog.tsx +67 -67
  60. package/src/elements/ElementDamage/DuplicateDamage/PhoneView.tsx +45 -45
  61. package/src/elements/ElementDamage/ElementNumberTextField.tsx +41 -41
  62. package/src/elements/ElementDamage/RegisterFix.tsx +100 -100
  63. package/src/elements/ElementDamage/SubmitButtons.tsx +40 -40
  64. package/src/elements/ElementDamage/TransportElementSelect.tsx +52 -52
  65. package/src/elements/ElementLookup.tsx +123 -123
  66. package/src/elements/ElementLookupDialog/BarcodeScanner/BarcodeScanner.css +81 -0
  67. package/src/elements/ElementLookupDialog/BarcodeScanner/DeadIcon.tsx +4 -4
  68. package/src/elements/ElementLookupDialog/BarcodeScanner/Error.tsx +7 -36
  69. package/src/elements/ElementLookupDialog/BarcodeScanner/index.tsx +20 -49
  70. package/src/elements/ElementLookupDialog/HIDScanner/index.tsx +67 -67
  71. package/src/elements/ElementLookupDialog/Manual/ManualForm.tsx +141 -141
  72. package/src/elements/ElementLookupDialog/index.tsx +226 -226
  73. package/src/elements/ElementLookupDialog/utils/Giai.ts +209 -209
  74. package/src/elements/ProjectSelect.tsx +130 -130
  75. package/src/elements/index.ts +15 -15
  76. package/src/filter/index.ts +34 -34
  77. package/src/i18n.ts +13 -13
  78. package/src/index.ts +5 -1
  79. package/src/mui/MuiThemeProvider.tsx +135 -135
  80. package/src/mui/index.ts +1 -0
  81. package/src/test/setup.ts +23 -8
@@ -1,144 +1,13 @@
1
1
  import { Box, Button, DialogActions, LinearProgress, Link, Typography } from "@mui/material";
2
2
  import { ResponsiveDialog } from "@olenbetong/appframe-mui";
3
- import { useEffect, useRef, useState } from "react";
4
3
  import { getLocalizedString } from "../../i18n.js";
4
+ import { type MergeJobOptions, useMergeJob } from "./useMergeJob.js";
5
5
 
6
- export type MergeProgressDialogProps = {
7
- open: boolean;
8
- onClose: () => void;
9
- /** Called once when the dialog opens; should return the merger ID for the start route */
10
- getMergerId: () => Promise<string | number>;
11
- mergeType?: "pdf" | "zip";
12
- };
6
+ export type MergeProgressDialogProps = MergeJobOptions;
13
7
 
14
- type MergePhase =
15
- | { kind: "preparing" }
16
- | { kind: "processing"; completed: number; total: number; currentFile: string; startedAt: number }
17
- | { kind: "completed"; jobId: string; fileName: string }
18
- | { kind: "failed"; error: string };
19
-
20
- function formatRemaining(ms: number) {
21
- if (ms < 60_000) return `~${Math.ceil(ms / 1000)}s`;
22
- let mins = Math.floor(ms / 60_000);
23
- let secs = Math.ceil((ms % 60_000) / 1000);
24
- return secs > 0 ? `~${mins}m ${secs}s` : `~${mins}m`;
25
- }
26
-
27
- export function MergeProgressDialog({ open, onClose, getMergerId, mergeType = "pdf" }: MergeProgressDialogProps) {
28
- let [phase, setPhase] = useState<MergePhase>({ kind: "preparing" });
29
- let [now, setNow] = useState(Date.now);
30
- let esRef = useRef<EventSource | null>(null);
31
- let doneRef = useRef(false);
32
-
33
- // Tick every second while processing to recompute the time estimate
34
- useEffect(() => {
35
- if (phase.kind !== "processing") return;
36
- let timer = setInterval(() => setNow(Date.now()), 1000);
37
- return () => clearInterval(timer);
38
- }, [phase.kind]);
39
-
40
- // Start the merge job each time the dialog opens
41
- // oxlint-disable-next-line react-hooks/exhaustive-deps -- intentionally only re-runs on open change
42
- useEffect(() => {
43
- if (!open) return;
44
-
45
- setPhase({ kind: "preparing" });
46
- doneRef.current = false;
47
-
48
- let cancelled = false;
49
- let es: EventSource | null = null;
50
-
51
- async function start() {
52
- try {
53
- let mergerId = await getMergerId();
54
- if (cancelled) return;
55
-
56
- let response = await fetch(`/api/ob/merger/start/${mergerId}/${mergeType}`, { method: "POST" });
57
- if (!response.ok) throw new Error(`${response.status} ${response.statusText}`);
58
- let { jobId } = await response.json();
59
- if (cancelled) return;
60
-
61
- es = new EventSource(`/api/ob/merger/events/${jobId}`);
62
- esRef.current = es;
63
-
64
- es.addEventListener("progress", (e) => {
65
- let d = JSON.parse((e as MessageEvent).data);
66
- setPhase((prev) => ({
67
- kind: "processing",
68
- completed: d.completed,
69
- total: d.total,
70
- currentFile: d.currentFile ?? "",
71
- startedAt: prev.kind === "processing" ? prev.startedAt : Date.now(),
72
- }));
73
- setNow(Date.now());
74
- });
75
-
76
- es.addEventListener("done", (e) => {
77
- doneRef.current = true;
78
- es?.close();
79
- let d = JSON.parse((e as MessageEvent).data);
80
- setPhase({ kind: "completed", jobId, fileName: d.fileName ?? "" });
81
- window.open(`/api/ob/merger/download/${jobId}`);
82
- });
83
-
84
- // Catches both server-sent "event: error" and connection errors.
85
- // After a "done" event the server closes the stream, which also fires error —
86
- // doneRef guards against treating that as a failure.
87
- es.addEventListener("error", (e) => {
88
- if (doneRef.current) return;
89
- es?.close();
90
- let message = getLocalizedString("Unknown error");
91
- let data = (e as MessageEvent).data;
92
- if (data) {
93
- try {
94
- message = JSON.parse(data).message ?? message;
95
- } catch {}
96
- }
97
- setPhase({ kind: "failed", error: message });
98
- });
99
- } catch (err: unknown) {
100
- if (!cancelled) {
101
- setPhase({ kind: "failed", error: (err as Error)?.message ?? String(err) });
102
- }
103
- }
104
- }
105
-
106
- start();
107
-
108
- return () => {
109
- cancelled = true;
110
- es?.close();
111
- esRef.current = null;
112
- };
113
- }, [open]);
114
-
115
- function handleClose() {
116
- esRef.current?.close();
117
- esRef.current = null;
118
- onClose();
119
- }
120
-
121
- let pct = 0;
122
- let remaining: string | null = null;
123
-
124
- if (phase.kind === "processing" && phase.total > 0) {
125
- pct = Math.round((phase.completed / phase.total) * 100);
126
- if (phase.completed > 0) {
127
- let elapsed = now - phase.startedAt;
128
- let msPerFile = elapsed / phase.completed;
129
- let remainingMs = msPerFile * (phase.total - phase.completed);
130
- remaining = formatRemaining(remainingMs);
131
- }
132
- }
133
-
134
- let title =
135
- phase.kind === "completed"
136
- ? getLocalizedString("Merge complete")
137
- : phase.kind === "failed"
138
- ? getLocalizedString("Merge failed")
139
- : getLocalizedString("Merging drawings");
140
-
141
- let canClose = phase.kind === "completed" || phase.kind === "failed";
8
+ export function MergeProgressDialog(props: MergeProgressDialogProps) {
9
+ let { phase, pct, remaining, title, canClose, handleClose } = useMergeJob(props);
10
+ let { open } = props;
142
11
 
143
12
  return (
144
13
  <ResponsiveDialog
@@ -0,0 +1,169 @@
1
+ import { useEffect, useRef, useState } from "react";
2
+ import { getLocalizedString } from "../../i18n.js";
3
+
4
+ export type MergeJobOptions = {
5
+ open: boolean;
6
+ onClose: () => void;
7
+ /** Called once when the dialog opens; should return the merger ID for the start route */
8
+ getMergerId: () => Promise<string | number>;
9
+ mergeType?: "pdf" | "zip";
10
+ };
11
+
12
+ export type MergePhase =
13
+ | { kind: "preparing" }
14
+ | { kind: "processing"; completed: number; total: number; currentFile: string; startedAt: number }
15
+ | { kind: "completed"; jobId: string; fileName: string }
16
+ | { kind: "failed"; error: string };
17
+
18
+ /** Waits between reconnects; together they cover a server restart of about half a minute. */
19
+ const RECONNECT_DELAYS_MS = [1000, 2000, 3000, 5000, 8000, 13000];
20
+
21
+ function formatRemaining(ms: number) {
22
+ if (ms < 60_000) return `~${Math.ceil(ms / 1000)}s`;
23
+ let mins = Math.floor(ms / 60_000);
24
+ let secs = Math.ceil((ms % 60_000) / 1000);
25
+ return secs > 0 ? `~${mins}m ${secs}s` : `~${mins}m`;
26
+ }
27
+
28
+ /**
29
+ * The merge job behind `MergeProgressDialog`: starts it each time `open` turns true, follows its
30
+ * progress events and opens the download when it is done. Shared by the MUI and the
31
+ * Designsystemet dialog.
32
+ */
33
+ export function useMergeJob({ open, onClose, getMergerId, mergeType = "pdf" }: MergeJobOptions) {
34
+ let [phase, setPhase] = useState<MergePhase>({ kind: "preparing" });
35
+ let [now, setNow] = useState(Date.now);
36
+ let esRef = useRef<EventSource | null>(null);
37
+ let doneRef = useRef(false);
38
+
39
+ // Tick every second while processing to recompute the time estimate
40
+ useEffect(() => {
41
+ if (phase.kind !== "processing") return;
42
+ let timer = setInterval(() => setNow(Date.now()), 1000);
43
+ return () => clearInterval(timer);
44
+ }, [phase.kind]);
45
+
46
+ // Start the merge job each time the dialog opens
47
+ // oxlint-disable-next-line react-hooks/exhaustive-deps -- intentionally only re-runs on open change
48
+ useEffect(() => {
49
+ if (!open) return;
50
+
51
+ setPhase({ kind: "preparing" });
52
+ doneRef.current = false;
53
+
54
+ let cancelled = false;
55
+ let es: EventSource | null = null;
56
+ let retryTimer: ReturnType<typeof setTimeout> | undefined;
57
+
58
+ async function start() {
59
+ try {
60
+ let mergerId = await getMergerId();
61
+ if (cancelled) return;
62
+
63
+ let response = await fetch(`/api/ob/merger/start/${mergerId}/${mergeType}`, { method: "POST" });
64
+ if (!response.ok) throw new Error(`${response.status} ${response.statusText}`);
65
+ let { jobId } = await response.json();
66
+ if (cancelled) return;
67
+
68
+ // The server keeps a job's state on disk and runs it again when the process running it
69
+ // goes away (a deploy or an app pool recycle), so a dropped connection is retried with
70
+ // a backoff before the merge is reported as failed. EventSource only reconnects by
71
+ // itself after a clean drop, not after the 502/503 a restarting server answers with.
72
+ let attempt = 0;
73
+
74
+ function connect() {
75
+ es = new EventSource(`/api/ob/merger/events/${jobId}`);
76
+ esRef.current = es;
77
+
78
+ es.addEventListener("progress", (e) => {
79
+ attempt = 0;
80
+ let d = JSON.parse((e as MessageEvent).data);
81
+ setPhase((prev) => ({
82
+ kind: "processing",
83
+ completed: d.completed,
84
+ total: d.total,
85
+ currentFile: d.currentFile ?? "",
86
+ startedAt: prev.kind === "processing" ? prev.startedAt : Date.now(),
87
+ }));
88
+ setNow(Date.now());
89
+ });
90
+
91
+ es.addEventListener("done", (e) => {
92
+ doneRef.current = true;
93
+ es?.close();
94
+ let d = JSON.parse((e as MessageEvent).data);
95
+ setPhase({ kind: "completed", jobId, fileName: d.fileName ?? "" });
96
+ window.open(`/api/ob/merger/download/${jobId}`);
97
+ });
98
+
99
+ // Catches both server-sent "event: error" (with data) and connection errors.
100
+ // After a "done" event the server closes the stream, which also fires error —
101
+ // doneRef guards against treating that as a failure.
102
+ es.addEventListener("error", (e) => {
103
+ if (doneRef.current) return;
104
+ es?.close();
105
+ let data = (e as MessageEvent).data;
106
+ if (!data && attempt < RECONNECT_DELAYS_MS.length) {
107
+ retryTimer = setTimeout(() => {
108
+ if (!cancelled && !doneRef.current) connect();
109
+ }, RECONNECT_DELAYS_MS[attempt++]);
110
+ return;
111
+ }
112
+ let message = getLocalizedString("Unknown error");
113
+ if (data) {
114
+ try {
115
+ message = JSON.parse(data).message ?? message;
116
+ } catch {}
117
+ }
118
+ setPhase({ kind: "failed", error: message });
119
+ });
120
+ }
121
+
122
+ connect();
123
+ } catch (err: unknown) {
124
+ if (!cancelled) {
125
+ setPhase({ kind: "failed", error: (err as Error)?.message ?? String(err) });
126
+ }
127
+ }
128
+ }
129
+
130
+ start();
131
+
132
+ return () => {
133
+ cancelled = true;
134
+ clearTimeout(retryTimer);
135
+ es?.close();
136
+ esRef.current = null;
137
+ };
138
+ }, [open]);
139
+
140
+ function handleClose() {
141
+ esRef.current?.close();
142
+ esRef.current = null;
143
+ onClose();
144
+ }
145
+
146
+ let pct = 0;
147
+ let remaining: string | null = null;
148
+
149
+ if (phase.kind === "processing" && phase.total > 0) {
150
+ pct = Math.round((phase.completed / phase.total) * 100);
151
+ if (phase.completed > 0) {
152
+ let elapsed = now - phase.startedAt;
153
+ let msPerFile = elapsed / phase.completed;
154
+ let remainingMs = msPerFile * (phase.total - phase.completed);
155
+ remaining = formatRemaining(remainingMs);
156
+ }
157
+ }
158
+
159
+ let title =
160
+ phase.kind === "completed"
161
+ ? getLocalizedString("Merge complete")
162
+ : phase.kind === "failed"
163
+ ? getLocalizedString("Merge failed")
164
+ : getLocalizedString("Merging drawings");
165
+
166
+ let canClose = phase.kind === "completed" || phase.kind === "failed";
167
+
168
+ return { phase, pct, remaining, title, canClose, handleClose };
169
+ }
@@ -1,80 +1,80 @@
1
- import "./index.scss";
2
-
3
- import clsx from "clsx";
4
- import React from "react";
5
-
6
- export type PageBannerProps = React.HTMLProps<HTMLDivElement> & {
7
- as?: "header" | "section" | "div";
8
- };
9
-
10
- export function PageBanner({ as, className, children, ...other }: PageBannerProps) {
11
- const Component = as ? as : "section";
12
-
13
- return (
14
- <Component className={clsx("ObPageBanner-root", className)} {...other}>
15
- <div className="container px-0">
16
- <div className={"ObPageBanner-pageBannerInner"}>{children}</div>
17
- </div>
18
- </Component>
19
- );
20
- }
21
-
22
- export type BannerImageProps = React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
23
-
24
- export const BannerImage = React.forwardRef<HTMLImageElement, BannerImageProps>(function BannerImage(
25
- props: BannerImageProps,
26
- ref,
27
- ) {
28
- const { className, ...other } = props;
29
- return <img ref={ref} className={clsx("ObPageBanner-bannerImage", className)} alt="" {...other} />;
30
- });
31
-
32
- export type TabListProps = Pick<React.HTMLProps<HTMLDivElement>, "id" | "className" | "children"> & {
33
- as?: "ul" | "ol" | "nav" | "div" | "span";
34
- sticky?: boolean;
35
- };
36
-
37
- export function TabList({ as, className, children, sticky, ...other }: TabListProps) {
38
- const Component = as ? as : "nav";
39
-
40
- return (
41
- <Component
42
- className={clsx("ObPageBanner-pageBanner", "ObPageBanner-tabList", sticky && "sticky", className)}
43
- {...other}
44
- >
45
- <div className="container px-0">
46
- <div className={"ObPageBanner-tabListInner"}>{children}</div>
47
- </div>
48
- </Component>
49
- );
50
- }
51
-
52
- export type TabProps = Pick<React.HTMLProps<HTMLDivElement>, "id" | "className" | "children"> &
53
- Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "target" | "rel"> & {
54
- active?: boolean;
55
- as?: "a" | "li" | "div" | "span";
56
- };
57
-
58
- export function Tab({ active, as, className, children, ...other }: TabProps) {
59
- const Component = as ? as : "a";
60
-
61
- return (
62
- <Component className={clsx("ObPageBanner-tab", active && "active", className)} {...other}>
63
- {children}
64
- </Component>
65
- );
66
- }
67
-
68
- export type TitleProps = Pick<React.HTMLProps<HTMLDivElement>, "id" | "className" | "children"> & {
69
- as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span" | "p";
70
- };
71
-
72
- export function Title({ as, className, children, ...other }: TitleProps) {
73
- const Component = as ? as : "h1";
74
-
75
- return (
76
- <Component className={clsx("ObPageBanner-bannerTitle", className)} {...other}>
77
- {children}
78
- </Component>
79
- );
80
- }
1
+ import "./index.scss";
2
+
3
+ import clsx from "clsx";
4
+ import React from "react";
5
+
6
+ export type PageBannerProps = React.HTMLProps<HTMLDivElement> & {
7
+ as?: "header" | "section" | "div";
8
+ };
9
+
10
+ export function PageBanner({ as, className, children, ...other }: PageBannerProps) {
11
+ const Component = as ? as : "section";
12
+
13
+ return (
14
+ <Component className={clsx("ObPageBanner-root", className)} {...other}>
15
+ <div className="container px-0">
16
+ <div className={"ObPageBanner-pageBannerInner"}>{children}</div>
17
+ </div>
18
+ </Component>
19
+ );
20
+ }
21
+
22
+ export type BannerImageProps = React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
23
+
24
+ export const BannerImage = React.forwardRef<HTMLImageElement, BannerImageProps>(function BannerImage(
25
+ props: BannerImageProps,
26
+ ref,
27
+ ) {
28
+ const { className, ...other } = props;
29
+ return <img ref={ref} className={clsx("ObPageBanner-bannerImage", className)} alt="" {...other} />;
30
+ });
31
+
32
+ export type TabListProps = Pick<React.HTMLProps<HTMLDivElement>, "id" | "className" | "children"> & {
33
+ as?: "ul" | "ol" | "nav" | "div" | "span";
34
+ sticky?: boolean;
35
+ };
36
+
37
+ export function TabList({ as, className, children, sticky, ...other }: TabListProps) {
38
+ const Component = as ? as : "nav";
39
+
40
+ return (
41
+ <Component
42
+ className={clsx("ObPageBanner-pageBanner", "ObPageBanner-tabList", sticky && "sticky", className)}
43
+ {...other}
44
+ >
45
+ <div className="container px-0">
46
+ <div className={"ObPageBanner-tabListInner"}>{children}</div>
47
+ </div>
48
+ </Component>
49
+ );
50
+ }
51
+
52
+ export type TabProps = Pick<React.HTMLProps<HTMLDivElement>, "id" | "className" | "children"> &
53
+ Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "target" | "rel"> & {
54
+ active?: boolean;
55
+ as?: "a" | "li" | "div" | "span";
56
+ };
57
+
58
+ export function Tab({ active, as, className, children, ...other }: TabProps) {
59
+ const Component = as ? as : "a";
60
+
61
+ return (
62
+ <Component className={clsx("ObPageBanner-tab", active && "active", className)} {...other}>
63
+ {children}
64
+ </Component>
65
+ );
66
+ }
67
+
68
+ export type TitleProps = Pick<React.HTMLProps<HTMLDivElement>, "id" | "className" | "children"> & {
69
+ as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span" | "p";
70
+ };
71
+
72
+ export function Title({ as, className, children, ...other }: TitleProps) {
73
+ const Component = as ? as : "h1";
74
+
75
+ return (
76
+ <Component className={clsx("ObPageBanner-bannerTitle", className)} {...other}>
77
+ {children}
78
+ </Component>
79
+ );
80
+ }