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.js CHANGED
@@ -6301,7 +6301,7 @@ var useMenuStore = (externalStore) => {
6301
6301
  var VARIANT_CLASSES5 = {
6302
6302
  menu: "bg-background shadow-soft-shadow-1 px-6",
6303
6303
  menu2: "",
6304
- breadcrumb: ""
6304
+ breadcrumb: "bg-transparent shadow-none !px-0 !-ml-2"
6305
6305
  };
6306
6306
  var Menu = (0, import_react20.forwardRef)(
6307
6307
  ({
@@ -6415,7 +6415,7 @@ var MenuItem = (0, import_react20.forwardRef)(
6415
6415
  "data-variant": "menu2",
6416
6416
  className: `
6417
6417
  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
6418
- focus:outline-none focus:border-indicator-info focus:border-2
6418
+ focus:outline-none focus:border-indicator-info focus:border-2
6419
6419
  ${selectedValue === value ? "" : "pb-4"}
6420
6420
  `,
6421
6421
  ...commonProps,
@@ -6570,13 +6570,16 @@ var Breadcrumb = (0, import_react20.forwardRef)(
6570
6570
  const handleBackToParent = (0, import_react20.useCallback)(() => {
6571
6571
  onBackClick();
6572
6572
  }, [onBackClick]);
6573
- const breadcrumbClassName = `bg-transparent shadow-none !px-0 py-4 !-ml-2 ${typeof className === "string" ? className : ""}`;
6574
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6573
+ const breadcrumbClassName = `py-4 ${typeof className === "string" ? className : ""}`;
6574
+ const { defaultValue: _unused, ...menuProps } = props;
6575
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6575
6576
  Menu,
6576
6577
  {
6578
+ ref,
6577
6579
  variant: "breadcrumb",
6578
- defaultValue: "",
6580
+ defaultValue: currentPage.toLowerCase(),
6579
6581
  className: breadcrumbClassName,
6582
+ ...menuProps,
6580
6583
  children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(MenuContent, { variant: "breadcrumb", children: [
6581
6584
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6582
6585
  MenuItem,
@@ -6585,7 +6588,6 @@ var Breadcrumb = (0, import_react20.forwardRef)(
6585
6588
  value: parentPageName.toLowerCase(),
6586
6589
  onClick: handleBackToParent,
6587
6590
  separator: true,
6588
- className: "text-text-600 underline cursor-pointer hover:text-text-950",
6589
6591
  children: parentPageName
6590
6592
  }
6591
6593
  ),
@@ -6594,14 +6596,13 @@ var Breadcrumb = (0, import_react20.forwardRef)(
6594
6596
  {
6595
6597
  variant: "breadcrumb",
6596
6598
  value: currentPage.toLowerCase(),
6597
- className: "text-text-950 font-bold",
6598
6599
  disabled: true,
6599
6600
  children: currentPage
6600
6601
  }
6601
6602
  )
6602
6603
  ] })
6603
6604
  }
6604
- ) });
6605
+ );
6605
6606
  }
6606
6607
  );
6607
6608
  Breadcrumb.displayName = "Breadcrumb";
@@ -7091,6 +7092,25 @@ var handleProfileSelection = (responseData, setSelectedProfile) => {
7091
7092
  });
7092
7093
  }
7093
7094
  };
7095
+ var handleUserData = (responseData, setUser) => {
7096
+ if (!setUser) return;
7097
+ if (!hasValidProfileData(responseData)) return;
7098
+ const userId = responseData.userId;
7099
+ const userName = responseData.userName;
7100
+ const userEmail = responseData.userEmail;
7101
+ if (userId) {
7102
+ const userData = {
7103
+ id: userId
7104
+ };
7105
+ if (userName) {
7106
+ userData.name = userName;
7107
+ }
7108
+ if (userEmail) {
7109
+ userData.email = userEmail;
7110
+ }
7111
+ setUser(userData);
7112
+ }
7113
+ };
7094
7114
  function useUrlAuthentication(options) {
7095
7115
  const location = (0, import_react_router_dom2.useLocation)();
7096
7116
  (0, import_react23.useEffect)(() => {
@@ -7111,6 +7131,7 @@ function useUrlAuthentication(options) {
7111
7131
  });
7112
7132
  options.setSessionInfo(response.data.data);
7113
7133
  handleProfileSelection(response.data.data, options.setSelectedProfile);
7134
+ handleUserData(response.data.data, options.setUser);
7114
7135
  options.clearParamsFromURL?.();
7115
7136
  } catch (error) {
7116
7137
  console.error("Erro ao obter informa\xE7\xF5es da sess\xE3o:", error);
@@ -7121,6 +7142,7 @@ function useUrlAuthentication(options) {
7121
7142
  location.search,
7122
7143
  options.setSessionInfo,
7123
7144
  options.setSelectedProfile,
7145
+ options.setUser,
7124
7146
  options.setTokens,
7125
7147
  options.api,
7126
7148
  options.endpoint,