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