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