@abgov/react-components 5.0.0-alpha.4 → 5.0.0-alpha.6

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/index.js CHANGED
@@ -537,7 +537,8 @@ function GoADatePicker({
537
537
  }
538
538
  const current = ref.current;
539
539
  const handleChange = (e) => {
540
- onChange(name || "", e.detail.value);
540
+ const newValue = e.detail.value;
541
+ onChange(name || "", newValue ? new Date(newValue) : void 0);
541
542
  };
542
543
  current.addEventListener("_change", handleChange);
543
544
  return () => {
@@ -549,7 +550,7 @@ function GoADatePicker({
549
550
  {
550
551
  ref,
551
552
  name,
552
- value: value == null ? void 0 : value.toISOString(),
553
+ value: (value == null ? void 0 : value.toISOString()) || "",
553
554
  error,
554
555
  disabled,
555
556
  min: min == null ? void 0 : min.toISOString(),
@@ -2859,11 +2860,30 @@ function GoAMicrositeHeader({
2859
2860
  maxContentWidth,
2860
2861
  feedbackUrlTarget,
2861
2862
  headerUrlTarget,
2862
- testId
2863
+ testId,
2864
+ onFeedbackClick
2863
2865
  }) {
2866
+ const el = react.useRef(null);
2867
+ react.useEffect(() => {
2868
+ if (!el.current) {
2869
+ return;
2870
+ }
2871
+ if (!onFeedbackClick) {
2872
+ return;
2873
+ }
2874
+ const current = el.current;
2875
+ const listener = () => {
2876
+ onFeedbackClick();
2877
+ };
2878
+ current.addEventListener("_feedbackClick", listener);
2879
+ return () => {
2880
+ current.removeEventListener("_feedbackClick", listener);
2881
+ };
2882
+ }, [el, onFeedbackClick]);
2864
2883
  return /* @__PURE__ */ jsxRuntime.jsx(
2865
2884
  "goa-microsite-header",
2866
2885
  {
2886
+ ref: el,
2867
2887
  type,
2868
2888
  version: typeof version === "string" ? version : void 0,
2869
2889
  feedbackurl: feedbackUrl,
@@ -2871,6 +2891,7 @@ function GoAMicrositeHeader({
2871
2891
  maxcontentwidth: maxContentWidth,
2872
2892
  feedbackurltarget: feedbackUrlTarget,
2873
2893
  headerurltarget: headerUrlTarget,
2894
+ hasfeedbackhandler: !!onFeedbackClick,
2874
2895
  children: version && typeof version !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "version", children: version })
2875
2896
  }
2876
2897
  );