@carbon-labs/wc-global-header 0.49.0 → 0.51.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.
@@ -0,0 +1,95 @@
1
+ import E from "react";
2
+ import { l as A } from "./HybridIpaasHeader-CWaLkLGi.mjs";
3
+ /**
4
+ * @license
5
+ * Copyright 2018 Google LLC
6
+ * SPDX-License-Identifier: BSD-3-Clause
7
+ */
8
+ const S = /* @__PURE__ */ new Set(["children", "localName", "ref", "style", "className"]), k = /* @__PURE__ */ new WeakMap(), f = (t, o, r, i, b) => {
9
+ const d = b == null ? void 0 : b[o];
10
+ d === void 0 ? (t[o] = r, r == null && o in HTMLElement.prototype && t.removeAttribute(o)) : r !== i && ((u, l, a) => {
11
+ let s = k.get(u);
12
+ s === void 0 && k.set(u, s = /* @__PURE__ */ new Map());
13
+ let n = s.get(l);
14
+ a !== void 0 ? n === void 0 ? (s.set(l, n = { handleEvent: a }), u.addEventListener(l, n)) : n.handleEvent = a : n !== void 0 && (s.delete(l), u.removeEventListener(l, n));
15
+ })(t, d, r);
16
+ }, g = ({ react: t, tagName: o, elementClass: r, events: i, displayName: b }) => {
17
+ const d = new Set(Object.keys(i ?? {})), u = t.forwardRef((l, a) => {
18
+ const s = t.useRef(/* @__PURE__ */ new Map()), n = t.useRef(null), C = {}, p = {};
19
+ for (const [e, c] of Object.entries(l)) S.has(e) ? C[e === "className" ? "class" : e] = c : d.has(e) || e in r.prototype ? p[e] = c : C[e] = c;
20
+ return t.useLayoutEffect(() => {
21
+ if (n.current === null) return;
22
+ const e = /* @__PURE__ */ new Map();
23
+ for (const c in p) f(n.current, c, l[c], s.current.get(c), i), s.current.delete(c), e.set(c, l[c]);
24
+ for (const [c, N] of s.current) f(n.current, c, void 0, N, i);
25
+ s.current = e;
26
+ }), t.useLayoutEffect(() => {
27
+ var e;
28
+ (e = n.current) == null || e.removeAttribute("defer-hydration");
29
+ }, []), C.suppressHydrationWarning = !0, t.createElement(o, { ...C, ref: t.useCallback((e) => {
30
+ n.current = e, typeof a == "function" ? a(e) : a !== null && (a.current = e);
31
+ }, [a]) });
32
+ });
33
+ return u.displayName = b ?? r.name, u;
34
+ };
35
+ /**
36
+ * @license
37
+ *
38
+ * Copyright IBM Corp. 2025
39
+ *
40
+ * This source code is licensed under the Apache-2.0 license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */
43
+ const h = "clabs-hybrid-ipaas-header-ai-callback", m = "clabs-hybrid-ipaas-header-notification-open-callback", v = "clabs-hybrid-ipaas-logout-callback", y = "clabs-hybrid-ipaas-search-callback", L = "clabs-hybrid-ipaas-search-submit-callback", O = g({
44
+ tagName: "clabs-global-header-hybrid-ipaas",
45
+ elementClass: A,
46
+ react: E,
47
+ events: {
48
+ onaiCallback: h,
49
+ onNotificationOpenCallback: m,
50
+ onLogoutCallback: v,
51
+ onSearchCallback: y,
52
+ onSearchSubmitCallback: L
53
+ }
54
+ }), T = (t) => {
55
+ const {
56
+ aiCallback: o,
57
+ notificationOpenCallback: r,
58
+ logoutCallback: i,
59
+ searchCallback: b,
60
+ searchSubmitCallback: d,
61
+ ...u
62
+ } = t;
63
+ return /* @__PURE__ */ E.createElement(
64
+ O,
65
+ {
66
+ role: "banner",
67
+ onaiCallback: o && (() => {
68
+ o();
69
+ }),
70
+ aiCallbackEvent: o && h,
71
+ onNotificationOpenCallback: r && (() => {
72
+ r();
73
+ }),
74
+ notificationOpenCallbackEvent: r && m,
75
+ onLogoutCallback: i && (() => {
76
+ i();
77
+ }),
78
+ logoutCallbackEvent: i && v,
79
+ onSearchCallback: b && ((l) => {
80
+ var a;
81
+ b(((a = l.detail) == null ? void 0 : a.value) || "");
82
+ }),
83
+ searchCallbackEvent: b && y,
84
+ onSearchSubmitCallback: d && ((l) => {
85
+ var a;
86
+ d(((a = l.detail) == null ? void 0 : a.value) || "");
87
+ }),
88
+ searchSubmitCallbackEvent: d && L,
89
+ ...u
90
+ }
91
+ );
92
+ };
93
+ export {
94
+ T as HybridIpaasHeaderReactWrapper
95
+ };