@carbonplan/components 13.4.0-develop.3 → 13.4.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.
package/dst/index.mjs CHANGED
@@ -1702,7 +1702,7 @@ var navigation_menu_default = NavigationMenu;
1702
1702
  import React19 from "react";
1703
1703
  import { Search as SearchIcon } from "@carbonplan/icons";
1704
1704
  var Search = (props) => {
1705
- return /* @__PURE__ */ React19.createElement(header_icon_default, __spreadProps(__spreadValues({}, props), { label: "Toggle Search" }), /* @__PURE__ */ React19.createElement(SearchIcon, { width: 50, height: 30, x: 8 }));
1705
+ return /* @__PURE__ */ React19.createElement(header_icon_default, __spreadProps(__spreadValues({}, props), { label: "Toggle Search" }), /* @__PURE__ */ React19.createElement(SearchIcon, { width: 50, height: 30, x: 8, y: 1 }));
1706
1706
  };
1707
1707
  var search_default = Search;
1708
1708
 
@@ -1794,13 +1794,17 @@ var sx2 = {
1794
1794
  }
1795
1795
  };
1796
1796
  var SearchMenu = ({
1797
- setExpanded
1797
+ setExpanded,
1798
+ mode
1798
1799
  }) => {
1799
1800
  const [value, setValue] = useState2("");
1800
1801
  const [resources, setResources] = useState2(RESOURCES);
1801
- const destination = `/search?query=${value.trim()}`;
1802
+ const baseUrl = mode === "remote" ? "https://carbonplan.org" : "";
1803
+ const destination = `${baseUrl}/search?query=${encodeURIComponent(
1804
+ value.trim()
1805
+ )}`;
1802
1806
  useEffect3(() => {
1803
- fetch("/resources.json").then((res) => res.json()).then((res) => {
1807
+ fetch(`${baseUrl}/resources.json`).then((res) => res.json()).then((res) => {
1804
1808
  if (res.every((el) => el.label && Array.isArray(el.links))) {
1805
1809
  setResources(res);
1806
1810
  }
@@ -2066,7 +2070,7 @@ var Header = ({ status, mode, nav, menuItems }) => {
2066
2070
  mode,
2067
2071
  setExpanded: setMenuExpanded
2068
2072
  }
2069
- ))), searchExpanded && !menuExpanded && /* @__PURE__ */ React22.createElement(column_default, { start: [1, 2, 2, 2], width: [6, 6, 10, 10] }, /* @__PURE__ */ React22.createElement(search_menu_default, { setExpanded: setSearchExpanded }))))
2073
+ ))), searchExpanded && !menuExpanded && /* @__PURE__ */ React22.createElement(column_default, { start: [1, 2, 2, 2], width: [6, 6, 10, 10] }, /* @__PURE__ */ React22.createElement(search_menu_default, { mode, setExpanded: setSearchExpanded }))))
2070
2074
  )
2071
2075
  );
2072
2076
  };
@@ -2532,7 +2536,7 @@ var FadeIn = (_a) => {
2532
2536
  animationDelay: delay + "ms",
2533
2537
  animationName: fade.toString(),
2534
2538
  animationFillMode: "backwards",
2535
- WebkitTransform: "translateZ(0)"
2539
+ willChange: "opacity"
2536
2540
  }
2537
2541
  }),
2538
2542
  children