analytica-frontend-lib 1.1.2 → 1.1.4

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/dist/index.mjs CHANGED
@@ -6253,7 +6253,7 @@ var useMenuStore = (externalStore) => {
6253
6253
  var VARIANT_CLASSES5 = {
6254
6254
  menu: "bg-background shadow-soft-shadow-1 px-6",
6255
6255
  menu2: "",
6256
- breadcrumb: ""
6256
+ breadcrumb: "bg-transparent shadow-none !px-0 !-ml-2"
6257
6257
  };
6258
6258
  var Menu = forwardRef17(
6259
6259
  ({
@@ -6367,7 +6367,7 @@ var MenuItem = forwardRef17(
6367
6367
  "data-variant": "menu2",
6368
6368
  className: `
6369
6369
  w-full flex flex-col items-center px-2 pt-4 gap-3 cursor-pointer focus:rounded-sm justify-center hover:bg-background-100 rounded-lg
6370
- focus:outline-none focus:border-indicator-info focus:border-2
6370
+ focus:outline-none focus:border-indicator-info focus:border-2
6371
6371
  ${selectedValue === value ? "" : "pb-4"}
6372
6372
  `,
6373
6373
  ...commonProps,
@@ -6522,13 +6522,16 @@ var Breadcrumb = forwardRef17(
6522
6522
  const handleBackToParent = useCallback(() => {
6523
6523
  onBackClick();
6524
6524
  }, [onBackClick]);
6525
- const breadcrumbClassName = `bg-transparent shadow-none !px-0 py-4 !-ml-2 ${typeof className === "string" ? className : ""}`;
6526
- return /* @__PURE__ */ jsx33("div", { ref, ...props, children: /* @__PURE__ */ jsx33(
6525
+ const breadcrumbClassName = `py-4 ${typeof className === "string" ? className : ""}`;
6526
+ const { defaultValue: _unused, ...menuProps } = props;
6527
+ return /* @__PURE__ */ jsx33(
6527
6528
  Menu,
6528
6529
  {
6530
+ ref,
6529
6531
  variant: "breadcrumb",
6530
- defaultValue: "",
6532
+ defaultValue: currentPage.toLowerCase(),
6531
6533
  className: breadcrumbClassName,
6534
+ ...menuProps,
6532
6535
  children: /* @__PURE__ */ jsxs27(MenuContent, { variant: "breadcrumb", children: [
6533
6536
  /* @__PURE__ */ jsx33(
6534
6537
  MenuItem,
@@ -6537,7 +6540,6 @@ var Breadcrumb = forwardRef17(
6537
6540
  value: parentPageName.toLowerCase(),
6538
6541
  onClick: handleBackToParent,
6539
6542
  separator: true,
6540
- className: "text-text-600 underline cursor-pointer hover:text-text-950",
6541
6543
  children: parentPageName
6542
6544
  }
6543
6545
  ),
@@ -6546,14 +6548,13 @@ var Breadcrumb = forwardRef17(
6546
6548
  {
6547
6549
  variant: "breadcrumb",
6548
6550
  value: currentPage.toLowerCase(),
6549
- className: "text-text-950 font-bold",
6550
6551
  disabled: true,
6551
6552
  children: currentPage
6552
6553
  }
6553
6554
  )
6554
6555
  ] })
6555
6556
  }
6556
- ) });
6557
+ );
6557
6558
  }
6558
6559
  );
6559
6560
  Breadcrumb.displayName = "Breadcrumb";
@@ -7050,6 +7051,25 @@ var handleProfileSelection = (responseData, setSelectedProfile) => {
7050
7051
  });
7051
7052
  }
7052
7053
  };
7054
+ var handleUserData = (responseData, setUser) => {
7055
+ if (!setUser) return;
7056
+ if (!hasValidProfileData(responseData)) return;
7057
+ const userId = responseData.userId;
7058
+ const userName = responseData.userName;
7059
+ const userEmail = responseData.userEmail;
7060
+ if (userId) {
7061
+ const userData = {
7062
+ id: userId
7063
+ };
7064
+ if (userName) {
7065
+ userData.name = userName;
7066
+ }
7067
+ if (userEmail) {
7068
+ userData.email = userEmail;
7069
+ }
7070
+ setUser(userData);
7071
+ }
7072
+ };
7053
7073
  function useUrlAuthentication(options) {
7054
7074
  const location = useLocation2();
7055
7075
  useEffect12(() => {
@@ -7070,6 +7090,7 @@ function useUrlAuthentication(options) {
7070
7090
  });
7071
7091
  options.setSessionInfo(response.data.data);
7072
7092
  handleProfileSelection(response.data.data, options.setSelectedProfile);
7093
+ handleUserData(response.data.data, options.setUser);
7073
7094
  options.clearParamsFromURL?.();
7074
7095
  } catch (error) {
7075
7096
  console.error("Erro ao obter informa\xE7\xF5es da sess\xE3o:", error);
@@ -7080,6 +7101,7 @@ function useUrlAuthentication(options) {
7080
7101
  location.search,
7081
7102
  options.setSessionInfo,
7082
7103
  options.setSelectedProfile,
7104
+ options.setUser,
7083
7105
  options.setTokens,
7084
7106
  options.api,
7085
7107
  options.endpoint,