@vtex/faststore-plugin-buyer-portal 2.0.34 → 2.0.36

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.
Files changed (19) hide show
  1. package/package.json +1 -1
  2. package/public/buyer-portal-icons.svg +30 -3
  3. package/src/features/contracts/layouts/ContractInformationLayout/ContractInformationLayout.tsx +0 -1
  4. package/src/features/contracts/layouts/ContractListingLayout/ContractListingLayout.tsx +0 -1
  5. package/src/features/org-units/components/OrgUnitDetailsNavbar/LocalizationIconButtonTrigger.tsx +112 -0
  6. package/src/features/org-units/components/OrgUnitDetailsNavbar/OrgUnitDetailsNavbar.tsx +56 -51
  7. package/src/features/org-units/components/OrgUnitDetailsNavbar/org-unit-details-navbar.scss +159 -55
  8. package/src/features/org-units/components/OrgUnitHeaderNav/OrgUnitHeaderNav.tsx +12 -19
  9. package/src/features/org-units/components/OrgUnitHeaderNav/org-unit-header-nav.scss +78 -7
  10. package/src/features/org-units/layouts/OrgUnitDetailsLayout/OrgUnitDetailsLayout.tsx +0 -1
  11. package/src/features/profile/components/ProfileSummary/ProfileSummary.tsx +38 -20
  12. package/src/features/profile/components/ProfileSummary/profile-summary.scss +80 -13
  13. package/src/features/shared/layouts/BaseTabsLayout/Navbar.tsx +19 -118
  14. package/src/features/shared/layouts/BaseTabsLayout/base-tabs-layout.scss +0 -106
  15. package/src/features/shared/layouts/ContractTabsLayout/ContractTabsLayout.tsx +0 -1
  16. package/src/features/shared/layouts/ErrorTabsLayout/ErrorTabsLayout.tsx +0 -1
  17. package/src/features/shared/layouts/SumaPageLayout/SumaPageLayout.tsx +0 -1
  18. package/src/features/shared/utils/constants.ts +1 -1
  19. package/src/pages/user-details.tsx +12 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtex/faststore-plugin-buyer-portal",
3
- "version": "2.0.34",
3
+ "version": "2.0.36",
4
4
  "description": "A plugin for faststore with buyer portal",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -1,4 +1,16 @@
1
1
  <svg style="display:none">
2
+ <!-- Material Icons "language" (24-grid) cropped to its 20x20 bounding box, same as AccountCircle. -->
3
+ <symbol
4
+ id="Globe"
5
+ viewBox="2 2 20 20"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ >
9
+ <path
10
+ d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
11
+ fill="currentColor" />
12
+ </symbol>
13
+
2
14
  <symbol
3
15
  id="Shapes"
4
16
  viewBox="0 0 19 20"
@@ -423,9 +435,24 @@
423
435
  </g>
424
436
  </symbol>
425
437
 
426
- <svg id="Menu" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 12" fill="none">
427
- <path d="M0 12V10H18V12H0ZM0 7V5H18V7H0ZM0 2V0H18V2H0Z" fill="#1F1F1F" />
428
- </svg>
438
+ <symbol
439
+ id="Menu"
440
+ viewBox="0 -960 960 960"
441
+ fill="currentColor"
442
+ xmlns="http://www.w3.org/2000/svg"
443
+ >
444
+ <path d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z" />
445
+ </symbol>
446
+
447
+ <!-- Material Symbols Outlined "logout" (wght 400, 24-grid). -->
448
+ <symbol
449
+ id="Logout"
450
+ viewBox="0 -960 960 960"
451
+ fill="currentColor"
452
+ xmlns="http://www.w3.org/2000/svg"
453
+ >
454
+ <path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h280v80H200Zm440-160-55-58 102-102H360v-80h327L585-622l55-58 200 200-200 200Z" />
455
+ </symbol>
429
456
 
430
457
  <symbol id="TableEdit" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
431
458
  <path
@@ -218,7 +218,6 @@ export const ContractInformationLayout = ({
218
218
  <GlobalLayout>
219
219
  <OrgUnitDetailsNavbar
220
220
  orgId={orgUnit.id}
221
- orgName={orgUnit.name}
222
221
  contractId={contractId}
223
222
  person={{ name: "" }}
224
223
  />
@@ -360,7 +360,6 @@ export const ContractListingLayout = ({
360
360
  <GlobalLayout>
361
361
  <OrgUnitDetailsNavbar
362
362
  orgId={orgUnit.id}
363
- orgName={orgUnit.name}
364
363
  contractId=""
365
364
  person={{
366
365
  name: user?.name ?? "",
@@ -0,0 +1,112 @@
1
+ import { type HTMLAttributes, useRef, useState } from "react";
2
+
3
+ import storeConfig from "discovery.config";
4
+
5
+ import {
6
+ useBindingSelector_unstable as useBindingSelector,
7
+ useLocalizedProduct_unstable as useLocalizedProduct,
8
+ } from "@faststore/core/experimental";
9
+ import { Button, IconButton, Popover, SelectField } from "@faststore/ui";
10
+
11
+ import { Icon } from "../../../shared/components";
12
+ import { useLocalization } from "../../../shared/localization/LocalizationContext";
13
+
14
+ // The wrapper scopes the vendor styles imported in the navbar SCSS (the portal
15
+ // renders outside the header).
16
+ const popoverWrapperProps: HTMLAttributes<HTMLDivElement> & {
17
+ "data-fs-bp-org-unit-details-navbar-localization": string;
18
+ } = { "data-fs-bp-org-unit-details-navbar-localization": "" };
19
+
20
+ /**
21
+ * Renders the vendor Popover directly instead of `LocalizationSelector`, which
22
+ * switches to a bottom SlideOver below 1280px — the header keeps the same
23
+ * dropdown at every breakpoint, like the Unit and User Account menus.
24
+ */
25
+ export const LocalizationIconButtonTrigger = () => {
26
+ const { t } = useLocalization();
27
+ const [isSelectorOpen, setIsSelectorOpen] = useState(false);
28
+ const buttonRef = useRef<HTMLButtonElement>(null);
29
+
30
+ const otherLocales = useLocalizedProduct()?.otherLocales ?? undefined;
31
+ const urlSuffix = useLocalizedProduct()?.urlSuffix ?? "/p";
32
+
33
+ const {
34
+ languages,
35
+ currencies,
36
+ localeCode,
37
+ currencyCode,
38
+ setLocaleCode,
39
+ setCurrencyCode,
40
+ save,
41
+ reset,
42
+ isSaveEnabled,
43
+ error,
44
+ } = useBindingSelector(otherLocales, urlSuffix);
45
+
46
+ if (!storeConfig.localization?.enabled) {
47
+ return null;
48
+ }
49
+
50
+ const close = () => {
51
+ setIsSelectorOpen(false);
52
+ reset();
53
+ };
54
+
55
+ return (
56
+ <>
57
+ <IconButton
58
+ ref={buttonRef}
59
+ data-fs-bp-org-unit-details-navbar-localization-trigger
60
+ icon={<Icon name="Globe" width={20} height={20} weight="regular" />}
61
+ aria-label={t("layouts.labels.language")}
62
+ onClick={() => setIsSelectorOpen(!isSelectorOpen)}
63
+ />
64
+
65
+ <Popover
66
+ isOpen={isSelectorOpen}
67
+ onDismiss={close}
68
+ triggerRef={buttonRef}
69
+ // Anchored by its right side so it opens leftward, inside the
70
+ // viewport, from a trigger near the header's right edge.
71
+ placement="bottom-end"
72
+ enablePortal
73
+ wrapperProps={popoverWrapperProps}
74
+ data-fs-localization-selector
75
+ content={
76
+ <div data-fs-localization-selector-content>
77
+ <SelectField
78
+ id="localization-selector-language"
79
+ label={t("layouts.labels.language")}
80
+ options={languages}
81
+ value={localeCode ?? ""}
82
+ onChange={(event) => setLocaleCode(event.currentTarget.value)}
83
+ />
84
+ <SelectField
85
+ id="localization-selector-currency"
86
+ label={t("layouts.labels.currency")}
87
+ options={currencies}
88
+ value={currencyCode ?? ""}
89
+ onChange={(event) => setCurrencyCode(event.currentTarget.value)}
90
+ disabled={Object.keys(currencies).length === 0}
91
+ />
92
+ {error && (
93
+ <div data-fs-localization-selector-error role="alert">
94
+ <Icon name="Warning" width={18} height={18} />
95
+ <span>{t("shared.errors.generic")}</span>
96
+ </div>
97
+ )}
98
+ <div data-fs-localization-selector-actions>
99
+ <Button
100
+ variant="primary"
101
+ onClick={save}
102
+ disabled={!isSaveEnabled}
103
+ >
104
+ {t("shared.buttons.save")}
105
+ </Button>
106
+ </div>
107
+ </div>
108
+ }
109
+ />
110
+ </>
111
+ );
112
+ };
@@ -6,12 +6,20 @@ import dynamic from "next/dynamic";
6
6
  import { useRouter } from "next/router";
7
7
 
8
8
  import { useLink_unstable as useLink } from "@faststore/core/experimental";
9
- import { Dropdown, DropdownMenu, IconButton, Link } from "@faststore/ui";
9
+ import {
10
+ Dropdown,
11
+ DropdownMenu,
12
+ IconButton,
13
+ Link,
14
+ Tooltip,
15
+ } from "@faststore/ui";
10
16
 
11
- const LocalizationButton = dynamic(
17
+ const LocalizationIconButtonTrigger = dynamic(
12
18
  () =>
13
- import("@faststore/core/experimental").then(
14
- (m) => m.LocalizationButton_unstable
19
+ // @ts-expect-error TS2835: tsc (node16) wants a ".js" suffix, which the
20
+ // host store's bundler can't resolve.
21
+ import("./LocalizationIconButtonTrigger").then(
22
+ (m) => m.LocalizationIconButtonTrigger
15
23
  ),
16
24
  { ssr: false }
17
25
  );
@@ -24,10 +32,12 @@ import {
24
32
  ABOUT_QUERY_PARAM,
25
33
  shouldOpenAboutDrawer,
26
34
  } from "../../../shared/layouts/BaseTabsLayout/about-drawer/aboutQueryParam";
35
+ import { SidebarDrawer } from "../../../shared/layouts/BaseTabsLayout/sidebar-drawer/SidebarDrawer";
27
36
  import { SumaSidebarDrawer } from "../../../shared/layouts/SumaPageLayout/SumaSidebarDrawer";
28
37
  import { useLocalization } from "../../../shared/localization/LocalizationContext";
29
38
  import { doLogout } from "../../../shared/utils";
30
39
  import { buyerPortalRoutes } from "../../../shared/utils/buyerPortalRoutes";
40
+ import { useOrgUnitByUser } from "../../hooks";
31
41
  import { OrgUnitHeaderNav } from "../OrgUnitHeaderNav/OrgUnitHeaderNav";
32
42
 
33
43
  import type { SumaSidebarVariant } from "../../../shared/layouts/SumaPageLayout/sumaSidebarConfig";
@@ -35,7 +45,6 @@ import type { SumaSidebarVariant } from "../../../shared/layouts/SumaPageLayout/
35
45
  export type OrgUnitDetailsNavbarProps = {
36
46
  orgId: string;
37
47
  contractId?: string;
38
- orgName: string;
39
48
  person: {
40
49
  image?: string;
41
50
  name: string;
@@ -43,23 +52,34 @@ export type OrgUnitDetailsNavbarProps = {
43
52
  email?: string;
44
53
  };
45
54
  loading?: boolean;
46
- sidebarVariant?: SumaSidebarVariant;
55
+ /**
56
+ * Navigation shown by the mobile Menu drawer: a SUMA sidebar variant, or
57
+ * `"full"` for the pages that render `BaseTabsLayout.SidebarMenu`. No
58
+ * value, no Menu button.
59
+ */
60
+ sidebarVariant?: SumaSidebarVariant | "full";
47
61
  showBackLink?: boolean;
62
+ /** Page name shown by the `"full"` drawer. */
63
+ pageName?: string;
48
64
  };
49
65
 
50
66
  export const OrgUnitDetailsNavbar = ({
51
67
  person,
52
- orgName,
53
68
  orgId,
54
69
  contractId = "",
55
70
  sidebarVariant,
56
71
  showBackLink = false,
72
+ pageName = "",
57
73
  }: OrgUnitDetailsNavbarProps) => {
58
74
  const { t } = useLocalization();
59
75
  const { resolveLink } = useLink();
60
76
  const router = useRouter();
61
- const { currentOrgUnit, currentUser, featureFlags } = useBuyerPortal();
62
- const isSuma = Boolean(featureFlags?.suma);
77
+ // Same header for every account, with or without SUMA: nothing here
78
+ // depends on `featureFlags.suma`.
79
+ const { currentOrgUnit, currentUser } = useBuyerPortal();
80
+ // The unit the user belongs to — not the one being viewed. Feeds both the
81
+ // unit navigation (how far up the user may go) and the account dropdown.
82
+ const { orgUnit: userOrgUnit } = useOrgUnitByUser(currentUser?.id ?? "");
63
83
  const {
64
84
  open: openAboutMenu,
65
85
  isOpen: isOpenAboutMenu,
@@ -73,8 +93,8 @@ export const OrgUnitDetailsNavbar = ({
73
93
  } = useDrawerProps();
74
94
 
75
95
  // `?about=1` opens the About/version drawer and is stripped from the URL.
76
- // Under SUMA there is no visible trigger (QA-11), so this is the way to
77
- // read the installed versions on any Organization Account page.
96
+ // The header has no visible trigger (QA-11), so this is the way to read
97
+ // the installed versions on any Organization Account page.
78
98
  const aboutParam = router.query[ABOUT_QUERY_PARAM];
79
99
  useEffect(() => {
80
100
  if (!shouldOpenAboutDrawer(aboutParam)) return;
@@ -94,7 +114,7 @@ export const OrgUnitDetailsNavbar = ({
94
114
  {sidebarVariant && (
95
115
  <IconButton
96
116
  data-fs-bp-org-unit-details-navbar-menu-btn
97
- icon={<Icon name="Menu" width={18} height={12} />}
117
+ icon={<Icon name="Menu" width={20} height={20} weight="regular" />}
98
118
  aria-label={"open sidebar menu"}
99
119
  onClick={openSidebarMenu}
100
120
  />
@@ -103,61 +123,38 @@ export const OrgUnitDetailsNavbar = ({
103
123
  {storeConfig.seo.title}
104
124
  </Link>
105
125
  </div>
106
- {isSuma && currentOrgUnit && (
126
+ {currentOrgUnit && (
107
127
  <div data-fs-bp-org-unit-details-navbar-unit>
108
128
  <OrgUnitHeaderNav
109
129
  orgUnit={currentOrgUnit}
110
- userId={currentUser?.id ?? ""}
111
- userUnitId={currentUser?.orgUnit?.id}
130
+ userUnitId={currentUser?.orgUnit?.id ?? userOrgUnit?.id}
112
131
  userRoles={currentUser?.roles ?? []}
113
132
  />
114
133
  </div>
115
134
  )}
116
135
  <div data-fs-bp-org-unit-details-navbar-actions>
117
- <Link
118
- href={buyerPortalRoutes.b2bAgent}
119
- data-fs-bp-org-unit-details-navbar-agent-link
136
+ <Tooltip
137
+ // TODO: switch to "shared.navigation.askOrganizationManager" ("Ask
138
+ // Organization Manager") once that key is published in the CMS.
139
+ content={t("shared.navigation.organizationManager")}
140
+ placement="bottom-center"
120
141
  >
121
- <Icon name="Sparkle" width={20} height={20} weight="regular" />
122
- {t("shared.navigation.organizationManager")}
123
- </Link>
124
-
125
- <LocalizationButton
126
- saveLabel={t("shared.buttons.save")}
127
- currencyLabel={t("layouts.labels.currency")}
128
- languageLabel={t("layouts.labels.language")}
129
- icon="Globe"
130
- />
131
- {!isSuma && (
132
142
  <Link
133
- target="_blank"
134
- href={resolveLink("/")}
135
- data-fs-bp-org-unit-details-navbar-start-shopping-link
143
+ href={buyerPortalRoutes.b2bAgent}
144
+ data-fs-bp-org-unit-details-navbar-agent-link
145
+ aria-label={t("shared.navigation.organizationManager")}
136
146
  >
137
- {t("layouts.navigation.startShopping")}
147
+ <Icon name="Sparkle" width={20} height={20} weight="regular" />
138
148
  </Link>
139
- )}
140
- {!isSuma && (
141
- <IconButton
142
- data-fs-bp-nav-about-trigger
143
- icon={
144
- <Icon
145
- name="CircleQuestionMark"
146
- width={24}
147
- height={24}
148
- weight="regular"
149
- />
150
- }
151
- aria-label={"open about menu"}
152
- onClick={openAboutMenu}
153
- />
154
- )}
149
+ </Tooltip>
150
+
151
+ <LocalizationIconButtonTrigger />
155
152
  <Dropdown>
156
153
  <BasicDropdownMenu.Trigger iconSize={20} iconName="AccountCircle" />
157
154
  <DropdownMenu align="right" data-fs-bp-org-unit-details-navbar-menu>
158
155
  <ProfileSummary
159
156
  onLogoutClick={doLogout}
160
- orgName={orgName}
157
+ orgName={userOrgUnit?.name ?? ""}
161
158
  person={person}
162
159
  />
163
160
  </DropdownMenu>
@@ -171,7 +168,15 @@ export const OrgUnitDetailsNavbar = ({
171
168
  unitId={orgId}
172
169
  />
173
170
  )}
174
- {sidebarVariant && isOpenSidebarMenu && (
171
+ {sidebarVariant === "full" && isOpenSidebarMenu && (
172
+ <SidebarDrawer
173
+ orgUnitName={currentOrgUnit?.name ?? ""}
174
+ pageName={pageName}
175
+ {...sidebarMenuDrawerProps}
176
+ isOpen={isOpenSidebarMenu}
177
+ />
178
+ )}
179
+ {sidebarVariant && sidebarVariant !== "full" && isOpenSidebarMenu && (
175
180
  <SumaSidebarDrawer
176
181
  orgUnitId={orgId}
177
182
  contractId={contractId}
@@ -1,66 +1,93 @@
1
+ @use "sass:meta";
1
2
  @use "~@faststore/ui/src/styles/base/utilities" as u;
2
3
 
3
4
  [data-fs-bp-org-unit-details-navbar] {
5
+ @import "@faststore/ui/src/components/molecules/Tooltip/styles.scss";
6
+
4
7
  position: relative;
5
8
  display: flex;
6
9
  justify-content: space-between;
7
10
  align-items: center;
8
11
  background-color: var(--fs-bp-color-neutral-0);
9
- padding: var(--fs-bp-padding-3) var(--fs-bp-padding-5);
12
+ padding: 0 var(--fs-bp-padding-5);
10
13
  border-bottom: 1px solid var(--fs-bp-color-neutral-2);
11
- min-height: 4.25rem;
14
+ min-height: var(--fs-bp-spacing-12);
15
+
16
+ // Phones: keeps the in-flow unit control (see `-unit` below) off its
17
+ // neighbors' edges.
18
+ @include u.media("<tablet") {
19
+ column-gap: var(--fs-bp-gap-1);
20
+ }
12
21
 
13
22
  @include u.media(">=tablet") {
14
- padding-left: var(--fs-bp-padding-10);
15
- padding-right: var(--fs-bp-padding-10);
23
+ padding-left: var(--fs-bp-padding-9);
24
+ padding-right: var(--fs-bp-padding-9);
16
25
  }
17
26
 
18
27
  [data-fs-bp-org-unit-details-navbar-heading] {
19
28
  display: flex;
20
29
  align-items: center;
21
- gap: var(--fs-bp-gap-2);
30
+ gap: var(--fs-bp-gap-1);
22
31
  }
23
32
 
24
- // Current unit control: sits between the store name and the actions on
25
- // small screens and is centered on the header (prototype) from notebook up.
33
+ // Centered on the header itself, regardless of the siblings' widths.
26
34
  [data-fs-bp-org-unit-details-navbar-unit] {
27
35
  display: flex;
28
- flex: 1 1 auto;
36
+ position: absolute;
37
+ top: 50%;
38
+ left: 50%;
29
39
  align-items: center;
30
40
  justify-content: center;
31
41
  min-width: 0;
32
- padding: 0 var(--fs-bp-padding-3);
33
-
34
- @include u.media(">=notebook") {
35
- position: absolute;
36
- top: 50%;
37
- left: 50%;
38
- flex: none;
39
- max-width: 40%;
40
- padding: 0;
41
- transform: translate(-50%, -50%);
42
+ max-width: 40%;
43
+ transform: translate(-50%, -50%);
44
+
45
+ // Phones: no room to center it between the heading and the actions, so it
46
+ // takes the logo's place (the logo is hidden below) and fills the space
47
+ // left before the actions, truncating the unit name if needed.
48
+ @include u.media("<tablet") {
49
+ position: static;
50
+ flex: 1 1 auto;
51
+ justify-content: flex-start;
52
+ max-width: none;
53
+ transform: none;
42
54
  }
43
55
  }
44
56
 
45
- [data-fs-localization-button] {
46
- [data-fs-button-wrapper] {
47
- span {
48
- display: inline-flex;
49
- align-items: center;
50
- gap: var(--fs-bp-gap-3);
51
- }
52
- }
57
+ // Same box and states as [data-fs-bp-basic-dropdown-menu-trigger].
58
+ [data-fs-bp-org-unit-details-navbar-localization-trigger] {
59
+ --fs-button-height: var(--fs-bp-spacing-9);
60
+ --fs-button-border-radius: var(--fs-bp-border-radius-full);
61
+ --fs-button-tertiary-text-color: var(--fs-bp-color-neutral-8);
62
+ --fs-button-tertiary-text-color-active: var(--fs-bp-color-neutral-8);
63
+ --fs-button-tertiary-bkg-color-hover: var(--fs-bp-color-transparent-0);
64
+ --fs-button-tertiary-bkg-color-active: var(--fs-bp-color-transparent-1);
53
65
  }
54
66
 
55
67
  [data-fs-bp-org-unit-details-navbar-link] {
56
68
  color: var(--fs-bp-color-brand);
57
69
  @include text-style('display-6');
58
70
  font-weight: var(--fs-bp-weight-bold);
71
+ letter-spacing: var(--fs-bp-letter-spacing-3);
59
72
  text-decoration: none;
60
73
  }
61
74
 
75
+ // Phones: the unit control takes the logo's place (see `-unit` above). Only
76
+ // when that control renders (a current unit, or its loading placeholder) —
77
+ // otherwise the logo stays.
78
+ &:has([data-fs-bp-org-unit-details-navbar-unit]) [data-fs-bp-org-unit-details-navbar-link] {
79
+ @include u.media("<tablet") {
80
+ display: none;
81
+ }
82
+ }
83
+
62
84
  [data-fs-bp-org-unit-details-navbar-menu-btn] {
63
85
  --fs-button-height: var(--fs-bp-spacing-9);
86
+ --fs-button-border-radius: var(--fs-bp-border-radius-full);
87
+ --fs-button-tertiary-text-color: var(--fs-bp-color-neutral-8);
88
+ --fs-button-tertiary-text-color-active: var(--fs-bp-color-neutral-8);
89
+ --fs-button-tertiary-bkg-color-hover: var(--fs-bp-color-transparent-0);
90
+ --fs-button-tertiary-bkg-color-active: var(--fs-bp-color-transparent-1);
64
91
 
65
92
  @include u.media(">=notebook") {
66
93
  display: none;
@@ -70,20 +97,19 @@
70
97
  [data-fs-bp-org-unit-details-navbar-actions] {
71
98
  display: flex;
72
99
  align-items: center;
73
- gap: var(--fs-bp-gap-4);
100
+ gap: var(--fs-bp-gap-1);
74
101
  }
75
102
 
103
+ // Brand-colored icon flags the AI entry point.
76
104
  [data-fs-bp-org-unit-details-navbar-agent-link] {
77
105
  display: inline-flex;
78
106
  align-items: center;
79
- gap: var(--fs-bp-gap-2);
80
- padding: 0 var(--fs-bp-padding-5);
107
+ justify-content: center;
108
+ width: var(--fs-bp-spacing-9);
81
109
  height: var(--fs-bp-spacing-9);
82
- @include text-style('action');
83
110
  color: var(--fs-bp-color-brand);
84
111
  border-radius: var(--fs-bp-border-radius-full);
85
112
  text-decoration: none;
86
- white-space: nowrap;
87
113
 
88
114
  &:hover {
89
115
  background-color: var(--fs-bp-color-transparent-0);
@@ -94,47 +120,125 @@
94
120
  }
95
121
  }
96
122
 
97
- [data-fs-bp-org-unit-details-navbar-start-shopping-link] {
98
- display: none;
99
-
100
- padding: 0 var(--fs-bp-padding-5);
101
- @include text-style('action');
102
- color: var(--fs-bp-color-neutral-8);
103
- border-radius: var(--fs-bp-border-radius-full);
104
-
105
- height: var(--fs-bp-spacing-9);
106
- justify-content: center;
107
- align-items: center;
108
- text-decoration: none;
123
+ // Prototype's header tooltip: black, 12px, pill-ish radius, soft shadow.
124
+ [data-fs-tooltip] {
125
+ --fs-tooltip-background: var(--fs-bp-color-black);
126
+ --fs-tooltip-text-color: var(--fs-bp-color-white);
127
+ --fs-tooltip-border-radius: var(--fs-bp-border-radius-2);
128
+ --fs-tooltip-padding: 0.375rem var(--fs-bp-padding-3);
109
129
 
110
- &:hover {
111
- background-color: var(--fs-bp-color-transparent-0);
130
+ [data-fs-tooltip-wrapper] {
131
+ box-shadow: var(--fs-bp-elevation-4);
132
+ pointer-events: none;
112
133
  }
113
134
 
114
- &:active {
115
- background-color: var(--fs-bp-color-transparent-1);
135
+ [data-fs-tooltip-content] {
136
+ @include text-style('caption');
137
+ font-weight: var(--fs-bp-weight-regular);
138
+ line-height: 1.32;
139
+ white-space: nowrap;
116
140
  }
141
+ }
142
+ }
117
143
 
118
- @include u.media(">=tablet") {
119
- display: inline-flex;
120
- }
144
+ // Same entrance as the Unit dropdown; `align="right"` sets no inline transform.
145
+ @keyframes fs-bp-org-unit-details-navbar-menu-in {
146
+ from {
147
+ opacity: 0;
148
+ transform: translateY(-8px) scale(0.96);
121
149
  }
122
150
 
123
- [data-fs-bp-nav-about-trigger] {
124
- --fs-button-height: var(--fs-bp-spacing-9);
125
- --fs-button-border-radius: var(--fs-bp-border-radius-full);
126
- --fs-button-tertiary-text-color: var(--fs-bp-color-black);
151
+ to {
152
+ opacity: 1;
153
+ transform: translateY(0) scale(1);
127
154
  }
128
155
  }
129
156
 
130
157
  [data-fs-bp-org-unit-details-navbar-menu][data-fs-dropdown-menu] {
158
+ --fs-dropdown-menu-border-radius: var(--fs-bp-border-radius-3);
159
+
131
160
  width: calc(100vw - (var(--fs-bp-spacing-5) * 2));
132
161
  max-width: 22.5rem;
133
162
  min-width: unset;
163
+ // ProfileSummary's rows carry their own padding.
164
+ padding: 0;
134
165
  background-color: var(--fs-bp-color-white);
166
+ border: 1px solid var(--fs-bp-color-neutral-2);
167
+ transform-origin: top right;
168
+ animation: fs-bp-org-unit-details-navbar-menu-in 0.2s cubic-bezier(0, 0, 0.2, 1) forwards;
169
+ }
170
+
171
+ // Portal wrapper of LocalizationIconButtonTrigger's Popover. Loads the same
172
+ // vendor styles `LocalizationSelector`'s CSS module does, since the component
173
+ // is no longer rendered through it.
174
+ [data-fs-bp-org-unit-details-navbar-localization] {
175
+ @include meta.load-css("~@faststore/ui/src/components/molecules/Popover/styles.scss");
176
+ @include meta.load-css("~@faststore/ui/src/components/atoms/Icon/styles.scss");
177
+ @include meta.load-css("~@faststore/ui/src/components/atoms/Select/styles.scss");
178
+ @include meta.load-css("~@faststore/ui/src/components/atoms/Button/styles.scss");
179
+ @include meta.load-css("~@faststore/ui/src/components/molecules/SelectField/styles.scss");
180
+ @include meta.load-css("~@faststore/ui/src/components/organisms/LocalizationSelector/styles.scss");
135
181
  }
136
182
 
137
- // !important para vencer a especificidade do CSS module do selector (portal).
183
+ // `!important` below beats those scoped vendor rules (attribute + attribute).
138
184
  [data-fs-localization-selector] {
139
185
  --fs-localization-selector-max-width: 20rem !important;
140
186
  }
187
+
188
+ // Same red as the portal's other inline errors ([data-fs-bp-error-message]).
189
+ [data-fs-localization-selector-error] {
190
+ --fs-color-danger-text: var(--fs-bp-color-danger-2);
191
+ }
192
+
193
+ // Same entrance as the Unit dropdown; keeps the inline `translateX(-100%)`
194
+ // that `bottom-end` sets in portal mode.
195
+ @keyframes fs-bp-org-unit-details-navbar-localization-in {
196
+ from {
197
+ opacity: 0;
198
+ transform: translate(-100%, -8px) scale(0.96);
199
+ }
200
+
201
+ to {
202
+ opacity: 1;
203
+ transform: translate(-100%, 0) scale(1);
204
+ }
205
+ }
206
+
207
+ [data-fs-popover][data-fs-localization-selector] {
208
+ --fs-popover-border-radius: var(--fs-bp-border-radius-3) !important;
209
+ --fs-popover-box-shadow: var(--fs-bp-elevation-dropdown) !important;
210
+ --fs-popover-bkg-color: var(--fs-bp-color-white) !important;
211
+
212
+ border: 1px solid var(--fs-bp-color-neutral-2) !important;
213
+ transform-origin: top right;
214
+ animation: fs-bp-org-unit-details-navbar-localization-in 0.2s cubic-bezier(0, 0, 0.2, 1) forwards;
215
+ }
216
+
217
+ // Save button in the prototype's primary pill style. Three attributes already
218
+ // outrank the scoped vendor `[data-fs-button]` token declarations.
219
+ [data-fs-localization-selector] [data-fs-button][data-fs-button-variant="primary"] {
220
+ --fs-button-height: var(--fs-bp-spacing-9);
221
+ --fs-button-padding: 0 var(--fs-bp-padding-8);
222
+ --fs-button-border-radius: var(--fs-bp-border-radius-full);
223
+ --fs-button-text-size: var(--fs-bp-text-size-1);
224
+ --fs-button-text-weight: var(--fs-bp-weight-semibold);
225
+ --fs-button-shadow: none;
226
+ --fs-button-primary-text-color: var(--fs-bp-color-white);
227
+ --fs-button-primary-bkg-color: var(--fs-bp-color-brand);
228
+ --fs-button-primary-bkg-color-hover: color-mix(in srgb, var(--fs-bp-color-brand), black 15%);
229
+ --fs-button-primary-bkg-color-active: color-mix(in srgb, var(--fs-bp-color-brand), black 15%);
230
+
231
+ min-width: 6.25rem;
232
+ transition: transform 0.2s;
233
+
234
+ &:active:not(:disabled) {
235
+ transform: scale(0.95);
236
+ }
237
+ }
238
+
239
+ // In portal mode the Popover is placed by inline `left`; the vendor's
240
+ // non-portal `inset-inline-end: 0` would also pin `right` and collapse the
241
+ // width.
242
+ [data-fs-localization-selector][data-fs-popover-placement="bottom-end"] {
243
+ inset-inline-end: auto !important;
244
+ }