@vtex/faststore-plugin-buyer-portal 2.0.34 → 2.0.35
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/package.json +1 -1
- package/public/buyer-portal-icons.svg +30 -3
- package/src/features/contracts/layouts/ContractInformationLayout/ContractInformationLayout.tsx +0 -1
- package/src/features/contracts/layouts/ContractListingLayout/ContractListingLayout.tsx +0 -1
- package/src/features/org-units/components/OrgUnitDetailsNavbar/LocalizationIconButtonTrigger.tsx +112 -0
- package/src/features/org-units/components/OrgUnitDetailsNavbar/OrgUnitDetailsNavbar.tsx +33 -22
- package/src/features/org-units/components/OrgUnitDetailsNavbar/org-unit-details-navbar.scss +167 -31
- package/src/features/org-units/components/OrgUnitHeaderNav/OrgUnitHeaderNav.tsx +6 -8
- package/src/features/org-units/components/OrgUnitHeaderNav/org-unit-header-nav.scss +78 -7
- package/src/features/org-units/layouts/OrgUnitDetailsLayout/OrgUnitDetailsLayout.tsx +0 -1
- package/src/features/profile/components/ProfileSummary/ProfileSummary.tsx +38 -20
- package/src/features/profile/components/ProfileSummary/profile-summary.scss +80 -13
- package/src/features/shared/layouts/ContractTabsLayout/ContractTabsLayout.tsx +0 -1
- package/src/features/shared/layouts/ErrorTabsLayout/ErrorTabsLayout.tsx +0 -1
- package/src/features/shared/layouts/SumaPageLayout/SumaPageLayout.tsx +0 -1
- package/src/features/shared/utils/constants.ts +1 -1
package/package.json
CHANGED
|
@@ -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
|
-
<
|
|
427
|
-
|
|
428
|
-
|
|
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
|
package/src/features/org-units/components/OrgUnitDetailsNavbar/LocalizationIconButtonTrigger.tsx
ADDED
|
@@ -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 {
|
|
9
|
+
import {
|
|
10
|
+
Dropdown,
|
|
11
|
+
DropdownMenu,
|
|
12
|
+
IconButton,
|
|
13
|
+
Link,
|
|
14
|
+
Tooltip,
|
|
15
|
+
} from "@faststore/ui";
|
|
10
16
|
|
|
11
|
-
const
|
|
17
|
+
const LocalizationIconButtonTrigger = dynamic(
|
|
12
18
|
() =>
|
|
13
|
-
|
|
14
|
-
|
|
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
|
);
|
|
@@ -28,6 +36,7 @@ import { SumaSidebarDrawer } from "../../../shared/layouts/SumaPageLayout/SumaSi
|
|
|
28
36
|
import { useLocalization } from "../../../shared/localization/LocalizationContext";
|
|
29
37
|
import { doLogout } from "../../../shared/utils";
|
|
30
38
|
import { buyerPortalRoutes } from "../../../shared/utils/buyerPortalRoutes";
|
|
39
|
+
import { useOrgUnitByUser } from "../../hooks";
|
|
31
40
|
import { OrgUnitHeaderNav } from "../OrgUnitHeaderNav/OrgUnitHeaderNav";
|
|
32
41
|
|
|
33
42
|
import type { SumaSidebarVariant } from "../../../shared/layouts/SumaPageLayout/sumaSidebarConfig";
|
|
@@ -35,7 +44,6 @@ import type { SumaSidebarVariant } from "../../../shared/layouts/SumaPageLayout/
|
|
|
35
44
|
export type OrgUnitDetailsNavbarProps = {
|
|
36
45
|
orgId: string;
|
|
37
46
|
contractId?: string;
|
|
38
|
-
orgName: string;
|
|
39
47
|
person: {
|
|
40
48
|
image?: string;
|
|
41
49
|
name: string;
|
|
@@ -49,7 +57,6 @@ export type OrgUnitDetailsNavbarProps = {
|
|
|
49
57
|
|
|
50
58
|
export const OrgUnitDetailsNavbar = ({
|
|
51
59
|
person,
|
|
52
|
-
orgName,
|
|
53
60
|
orgId,
|
|
54
61
|
contractId = "",
|
|
55
62
|
sidebarVariant,
|
|
@@ -60,6 +67,9 @@ export const OrgUnitDetailsNavbar = ({
|
|
|
60
67
|
const router = useRouter();
|
|
61
68
|
const { currentOrgUnit, currentUser, featureFlags } = useBuyerPortal();
|
|
62
69
|
const isSuma = Boolean(featureFlags?.suma);
|
|
70
|
+
// The unit the user belongs to — not the one being viewed. Feeds both the
|
|
71
|
+
// unit navigation (how far up the user may go) and the account dropdown.
|
|
72
|
+
const { orgUnit: userOrgUnit } = useOrgUnitByUser(currentUser?.id ?? "");
|
|
63
73
|
const {
|
|
64
74
|
open: openAboutMenu,
|
|
65
75
|
isOpen: isOpenAboutMenu,
|
|
@@ -94,7 +104,7 @@ export const OrgUnitDetailsNavbar = ({
|
|
|
94
104
|
{sidebarVariant && (
|
|
95
105
|
<IconButton
|
|
96
106
|
data-fs-bp-org-unit-details-navbar-menu-btn
|
|
97
|
-
icon={<Icon name="Menu" width={
|
|
107
|
+
icon={<Icon name="Menu" width={20} height={20} weight="regular" />}
|
|
98
108
|
aria-label={"open sidebar menu"}
|
|
99
109
|
onClick={openSidebarMenu}
|
|
100
110
|
/>
|
|
@@ -107,27 +117,28 @@ export const OrgUnitDetailsNavbar = ({
|
|
|
107
117
|
<div data-fs-bp-org-unit-details-navbar-unit>
|
|
108
118
|
<OrgUnitHeaderNav
|
|
109
119
|
orgUnit={currentOrgUnit}
|
|
110
|
-
|
|
111
|
-
userUnitId={currentUser?.orgUnit?.id}
|
|
120
|
+
userUnitId={currentUser?.orgUnit?.id ?? userOrgUnit?.id}
|
|
112
121
|
userRoles={currentUser?.roles ?? []}
|
|
113
122
|
/>
|
|
114
123
|
</div>
|
|
115
124
|
)}
|
|
116
125
|
<div data-fs-bp-org-unit-details-navbar-actions>
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
126
|
+
<Tooltip
|
|
127
|
+
// TODO: switch to "shared.navigation.askOrganizationManager" ("Ask
|
|
128
|
+
// Organization Manager") once that key is published in the CMS.
|
|
129
|
+
content={t("shared.navigation.organizationManager")}
|
|
130
|
+
placement="bottom-center"
|
|
120
131
|
>
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
|
|
132
|
+
<Link
|
|
133
|
+
href={buyerPortalRoutes.b2bAgent}
|
|
134
|
+
data-fs-bp-org-unit-details-navbar-agent-link
|
|
135
|
+
aria-label={t("shared.navigation.organizationManager")}
|
|
136
|
+
>
|
|
137
|
+
<Icon name="Sparkle" width={20} height={20} weight="regular" />
|
|
138
|
+
</Link>
|
|
139
|
+
</Tooltip>
|
|
124
140
|
|
|
125
|
-
<
|
|
126
|
-
saveLabel={t("shared.buttons.save")}
|
|
127
|
-
currencyLabel={t("layouts.labels.currency")}
|
|
128
|
-
languageLabel={t("layouts.labels.language")}
|
|
129
|
-
icon="Globe"
|
|
130
|
-
/>
|
|
141
|
+
<LocalizationIconButtonTrigger />
|
|
131
142
|
{!isSuma && (
|
|
132
143
|
<Link
|
|
133
144
|
target="_blank"
|
|
@@ -157,7 +168,7 @@ export const OrgUnitDetailsNavbar = ({
|
|
|
157
168
|
<DropdownMenu align="right" data-fs-bp-org-unit-details-navbar-menu>
|
|
158
169
|
<ProfileSummary
|
|
159
170
|
onLogoutClick={doLogout}
|
|
160
|
-
orgName={
|
|
171
|
+
orgName={userOrgUnit?.name ?? ""}
|
|
161
172
|
person={person}
|
|
162
173
|
/>
|
|
163
174
|
</DropdownMenu>
|
|
@@ -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:
|
|
12
|
+
padding: 0 var(--fs-bp-padding-5);
|
|
10
13
|
border-bottom: 1px solid var(--fs-bp-color-neutral-2);
|
|
11
|
-
min-height:
|
|
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-
|
|
15
|
-
padding-right: var(--fs-bp-padding-
|
|
23
|
+
padding-left: var(--fs-bp-padding-8);
|
|
24
|
+
padding-right: var(--fs-bp-padding-8);
|
|
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-
|
|
30
|
+
gap: var(--fs-bp-gap-1);
|
|
22
31
|
}
|
|
23
32
|
|
|
24
|
-
//
|
|
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
|
-
|
|
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
|
-
|
|
42
|
+
max-width: 40%;
|
|
43
|
+
transform: translate(-50%, -50%);
|
|
33
44
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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 (SUMA with a current unit) — otherwise the logo
|
|
77
|
+
// 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-
|
|
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
|
-
|
|
80
|
-
|
|
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);
|
|
@@ -125,16 +151,126 @@
|
|
|
125
151
|
--fs-button-border-radius: var(--fs-bp-border-radius-full);
|
|
126
152
|
--fs-button-tertiary-text-color: var(--fs-bp-color-black);
|
|
127
153
|
}
|
|
154
|
+
|
|
155
|
+
// Prototype's header tooltip: black, 12px, pill-ish radius, soft shadow.
|
|
156
|
+
[data-fs-tooltip] {
|
|
157
|
+
--fs-tooltip-background: var(--fs-bp-color-black);
|
|
158
|
+
--fs-tooltip-text-color: var(--fs-bp-color-white);
|
|
159
|
+
--fs-tooltip-border-radius: var(--fs-bp-border-radius-2);
|
|
160
|
+
--fs-tooltip-padding: 0.375rem var(--fs-bp-padding-3);
|
|
161
|
+
|
|
162
|
+
[data-fs-tooltip-wrapper] {
|
|
163
|
+
box-shadow: var(--fs-bp-elevation-4);
|
|
164
|
+
pointer-events: none;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
[data-fs-tooltip-content] {
|
|
168
|
+
@include text-style('caption');
|
|
169
|
+
font-weight: var(--fs-bp-weight-regular);
|
|
170
|
+
line-height: 1.32;
|
|
171
|
+
white-space: nowrap;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Same entrance as the Unit dropdown; `align="right"` sets no inline transform.
|
|
177
|
+
@keyframes fs-bp-org-unit-details-navbar-menu-in {
|
|
178
|
+
from {
|
|
179
|
+
opacity: 0;
|
|
180
|
+
transform: translateY(-8px) scale(0.96);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
to {
|
|
184
|
+
opacity: 1;
|
|
185
|
+
transform: translateY(0) scale(1);
|
|
186
|
+
}
|
|
128
187
|
}
|
|
129
188
|
|
|
130
189
|
[data-fs-bp-org-unit-details-navbar-menu][data-fs-dropdown-menu] {
|
|
190
|
+
--fs-dropdown-menu-border-radius: var(--fs-bp-border-radius-3);
|
|
191
|
+
|
|
131
192
|
width: calc(100vw - (var(--fs-bp-spacing-5) * 2));
|
|
132
193
|
max-width: 22.5rem;
|
|
133
194
|
min-width: unset;
|
|
195
|
+
// ProfileSummary's rows carry their own padding.
|
|
196
|
+
padding: 0;
|
|
134
197
|
background-color: var(--fs-bp-color-white);
|
|
198
|
+
border: 1px solid var(--fs-bp-color-neutral-2);
|
|
199
|
+
transform-origin: top right;
|
|
200
|
+
animation: fs-bp-org-unit-details-navbar-menu-in 0.2s cubic-bezier(0, 0, 0.2, 1) forwards;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Portal wrapper of LocalizationIconButtonTrigger's Popover. Loads the same
|
|
204
|
+
// vendor styles `LocalizationSelector`'s CSS module does, since the component
|
|
205
|
+
// is no longer rendered through it.
|
|
206
|
+
[data-fs-bp-org-unit-details-navbar-localization] {
|
|
207
|
+
@include meta.load-css("~@faststore/ui/src/components/molecules/Popover/styles.scss");
|
|
208
|
+
@include meta.load-css("~@faststore/ui/src/components/atoms/Icon/styles.scss");
|
|
209
|
+
@include meta.load-css("~@faststore/ui/src/components/atoms/Select/styles.scss");
|
|
210
|
+
@include meta.load-css("~@faststore/ui/src/components/atoms/Button/styles.scss");
|
|
211
|
+
@include meta.load-css("~@faststore/ui/src/components/molecules/SelectField/styles.scss");
|
|
212
|
+
@include meta.load-css("~@faststore/ui/src/components/organisms/LocalizationSelector/styles.scss");
|
|
135
213
|
}
|
|
136
214
|
|
|
137
|
-
//
|
|
215
|
+
// `!important` below beats those scoped vendor rules (attribute + attribute).
|
|
138
216
|
[data-fs-localization-selector] {
|
|
139
217
|
--fs-localization-selector-max-width: 20rem !important;
|
|
140
218
|
}
|
|
219
|
+
|
|
220
|
+
// Same red as the portal's other inline errors ([data-fs-bp-error-message]).
|
|
221
|
+
[data-fs-localization-selector-error] {
|
|
222
|
+
--fs-color-danger-text: var(--fs-bp-color-danger-2);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Same entrance as the Unit dropdown; keeps the inline `translateX(-100%)`
|
|
226
|
+
// that `bottom-end` sets in portal mode.
|
|
227
|
+
@keyframes fs-bp-org-unit-details-navbar-localization-in {
|
|
228
|
+
from {
|
|
229
|
+
opacity: 0;
|
|
230
|
+
transform: translate(-100%, -8px) scale(0.96);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
to {
|
|
234
|
+
opacity: 1;
|
|
235
|
+
transform: translate(-100%, 0) scale(1);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
[data-fs-popover][data-fs-localization-selector] {
|
|
240
|
+
--fs-popover-border-radius: var(--fs-bp-border-radius-3) !important;
|
|
241
|
+
--fs-popover-box-shadow: var(--fs-bp-elevation-dropdown) !important;
|
|
242
|
+
--fs-popover-bkg-color: var(--fs-bp-color-white) !important;
|
|
243
|
+
|
|
244
|
+
border: 1px solid var(--fs-bp-color-neutral-2) !important;
|
|
245
|
+
transform-origin: top right;
|
|
246
|
+
animation: fs-bp-org-unit-details-navbar-localization-in 0.2s cubic-bezier(0, 0, 0.2, 1) forwards;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Save button in the prototype's primary pill style. Three attributes already
|
|
250
|
+
// outrank the scoped vendor `[data-fs-button]` token declarations.
|
|
251
|
+
[data-fs-localization-selector] [data-fs-button][data-fs-button-variant="primary"] {
|
|
252
|
+
--fs-button-height: var(--fs-bp-spacing-9);
|
|
253
|
+
--fs-button-padding: 0 var(--fs-bp-padding-8);
|
|
254
|
+
--fs-button-border-radius: var(--fs-bp-border-radius-full);
|
|
255
|
+
--fs-button-text-size: var(--fs-bp-text-size-1);
|
|
256
|
+
--fs-button-text-weight: var(--fs-bp-weight-semibold);
|
|
257
|
+
--fs-button-shadow: none;
|
|
258
|
+
--fs-button-primary-text-color: var(--fs-bp-color-white);
|
|
259
|
+
--fs-button-primary-bkg-color: var(--fs-bp-color-brand);
|
|
260
|
+
--fs-button-primary-bkg-color-hover: color-mix(in srgb, var(--fs-bp-color-brand), black 15%);
|
|
261
|
+
--fs-button-primary-bkg-color-active: color-mix(in srgb, var(--fs-bp-color-brand), black 15%);
|
|
262
|
+
|
|
263
|
+
min-width: 6.25rem;
|
|
264
|
+
transition: transform 0.2s;
|
|
265
|
+
|
|
266
|
+
&:active:not(:disabled) {
|
|
267
|
+
transform: scale(0.95);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// In portal mode the Popover is placed by inline `left`; the vendor's
|
|
272
|
+
// non-portal `inset-inline-end: 0` would also pin `right` and collapse the
|
|
273
|
+
// width.
|
|
274
|
+
[data-fs-localization-selector][data-fs-popover-placement="bottom-end"] {
|
|
275
|
+
inset-inline-end: auto !important;
|
|
276
|
+
}
|
|
@@ -11,7 +11,6 @@ import { Icon } from "../../../shared/components";
|
|
|
11
11
|
import { useBuyerPortal } from "../../../shared/hooks";
|
|
12
12
|
import { useLocalization } from "../../../shared/localization/LocalizationContext";
|
|
13
13
|
import { buyerPortalRoutes } from "../../../shared/utils/buyerPortalRoutes";
|
|
14
|
-
import { useOrgUnitByUser } from "../../hooks";
|
|
15
14
|
|
|
16
15
|
import { getOrgUnitHeaderNavItems } from "./getOrgUnitHeaderNavItems";
|
|
17
16
|
|
|
@@ -19,9 +18,8 @@ import type { OrgUnitBasicData } from "../../types";
|
|
|
19
18
|
|
|
20
19
|
export type OrgUnitHeaderNavProps = {
|
|
21
20
|
orgUnit: OrgUnitBasicData;
|
|
22
|
-
userId: string;
|
|
23
21
|
userRoles: string[];
|
|
24
|
-
/** The user's own unit id
|
|
22
|
+
/** The user's own unit id (resolved by `OrgUnitDetailsNavbar`). */
|
|
25
23
|
userUnitId?: string;
|
|
26
24
|
};
|
|
27
25
|
|
|
@@ -34,20 +32,16 @@ export type OrgUnitHeaderNavProps = {
|
|
|
34
32
|
*/
|
|
35
33
|
export const OrgUnitHeaderNav = ({
|
|
36
34
|
orgUnit,
|
|
37
|
-
userId,
|
|
38
35
|
userRoles,
|
|
39
36
|
userUnitId,
|
|
40
37
|
}: OrgUnitHeaderNavProps) => {
|
|
41
38
|
const { t } = useLocalization();
|
|
42
39
|
const { push } = useRouter();
|
|
43
40
|
const { featureFlags } = useBuyerPortal();
|
|
44
|
-
const { orgUnit: fetchedUserUnit } = useOrgUnitByUser(userId, {
|
|
45
|
-
lazy: Boolean(userUnitId),
|
|
46
|
-
});
|
|
47
41
|
|
|
48
42
|
const { ancestors, canNavigate } = getOrgUnitHeaderNavItems({
|
|
49
43
|
orgUnit,
|
|
50
|
-
userUnitId
|
|
44
|
+
userUnitId,
|
|
51
45
|
userRoles,
|
|
52
46
|
buildLink: (orgUnitId) =>
|
|
53
47
|
featureFlags?.suma
|
|
@@ -89,6 +83,10 @@ export const OrgUnitHeaderNav = ({
|
|
|
89
83
|
key={ancestor.unitId}
|
|
90
84
|
data-fs-bp-org-unit-header-nav-item
|
|
91
85
|
onClick={() => push(ancestor.item)}
|
|
86
|
+
// The library focuses an item on `mouseenter` (roving-tabindex
|
|
87
|
+
// nav) but never blurs it on `mouseleave`, so its hover-look
|
|
88
|
+
// would otherwise linger after the cursor moves away.
|
|
89
|
+
onMouseLeave={(event) => event.currentTarget.blur()}
|
|
92
90
|
>
|
|
93
91
|
<Icon name="Folder" width={20} height={20} />
|
|
94
92
|
<span data-fs-bp-org-unit-header-nav-item-name>
|
|
@@ -9,24 +9,31 @@
|
|
|
9
9
|
[data-fs-bp-org-unit-header-nav-trigger] {
|
|
10
10
|
display: inline-flex;
|
|
11
11
|
align-items: center;
|
|
12
|
-
gap: var(--fs-bp-gap-2);
|
|
13
12
|
height: var(--fs-bp-spacing-9);
|
|
14
13
|
max-width: 100%;
|
|
15
14
|
padding: 0 var(--fs-bp-padding-4);
|
|
16
15
|
@include text-style('action');
|
|
16
|
+
font-weight: var(--fs-bp-weight-medium);
|
|
17
17
|
color: var(--fs-bp-color-neutral-8);
|
|
18
18
|
background: transparent;
|
|
19
19
|
border: 0;
|
|
20
20
|
border-radius: var(--fs-bp-border-radius-full);
|
|
21
21
|
cursor: pointer;
|
|
22
22
|
white-space: nowrap;
|
|
23
|
-
transition: background-color 0.2s;
|
|
23
|
+
transition: background-color 0.2s, transform 0.2s;
|
|
24
|
+
transform-origin: center;
|
|
25
|
+
// Keeps the text from snapping during the press-scale.
|
|
26
|
+
will-change: transform;
|
|
24
27
|
|
|
25
28
|
&:hover:not(:disabled) {
|
|
26
29
|
background-color: var(--fs-bp-color-neutral-1);
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
&:active:not(:disabled)
|
|
32
|
+
&:active:not(:disabled) {
|
|
33
|
+
background-color: var(--fs-bp-color-neutral-1);
|
|
34
|
+
transform: scale(0.98);
|
|
35
|
+
}
|
|
36
|
+
|
|
30
37
|
&[aria-expanded="true"] {
|
|
31
38
|
background-color: var(--fs-bp-color-neutral-1);
|
|
32
39
|
}
|
|
@@ -37,21 +44,39 @@
|
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
[data-fs-bp-org-unit-header-nav-icon] {
|
|
47
|
+
display: block;
|
|
40
48
|
flex: 0 0 auto;
|
|
41
49
|
color: var(--fs-bp-color-brand);
|
|
50
|
+
margin-right: var(--fs-bp-gap-2);
|
|
51
|
+
|
|
52
|
+
// Phones: dropped to leave the unit name as much room as possible.
|
|
53
|
+
@include u.media("<tablet") {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
42
56
|
}
|
|
43
57
|
|
|
44
58
|
[data-fs-bp-org-unit-header-nav-name] {
|
|
59
|
+
position: relative;
|
|
45
60
|
min-width: 0;
|
|
46
61
|
max-width: 20rem;
|
|
47
62
|
overflow: hidden;
|
|
48
63
|
text-overflow: ellipsis;
|
|
64
|
+
// Tight leading centers the glyphs against the icon; the padding keeps
|
|
65
|
+
// descenders inside the `overflow: hidden` clip; `top` is an optical nudge.
|
|
66
|
+
line-height: 1;
|
|
67
|
+
padding-bottom: 3px;
|
|
68
|
+
top: 1px;
|
|
49
69
|
}
|
|
50
70
|
|
|
51
71
|
[data-fs-bp-org-unit-header-nav-caret] {
|
|
72
|
+
display: block;
|
|
52
73
|
flex: 0 0 auto;
|
|
53
74
|
color: var(--fs-bp-color-neutral-8);
|
|
54
75
|
transition: transform 0.2s;
|
|
76
|
+
margin-left: 2px;
|
|
77
|
+
// The caret glyph has more built-in inset than the folder; balances the
|
|
78
|
+
// trigger's optical padding.
|
|
79
|
+
margin-right: calc(-1 * var(--fs-bp-margin-1));
|
|
55
80
|
}
|
|
56
81
|
|
|
57
82
|
[aria-expanded="true"] [data-fs-bp-org-unit-header-nav-caret] {
|
|
@@ -59,6 +84,31 @@
|
|
|
59
84
|
}
|
|
60
85
|
}
|
|
61
86
|
|
|
87
|
+
// `align="center"` sets an inline `translateX(-50%)`; the keyframes keep it.
|
|
88
|
+
@keyframes fs-bp-org-unit-header-nav-menu-in {
|
|
89
|
+
from {
|
|
90
|
+
opacity: 0;
|
|
91
|
+
transform: translate(-50%, -8px) scale(0.96);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
to {
|
|
95
|
+
opacity: 1;
|
|
96
|
+
transform: translate(-50%, 0) scale(1);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@keyframes fs-bp-org-unit-header-nav-menu-in-start {
|
|
101
|
+
from {
|
|
102
|
+
opacity: 0;
|
|
103
|
+
transform: translateY(-8px) scale(0.96);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
to {
|
|
107
|
+
opacity: 1;
|
|
108
|
+
transform: translateY(0) scale(1);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
62
112
|
// The menu renders in a portal (document.body), so it is styled at the root.
|
|
63
113
|
[data-fs-bp-org-unit-header-nav-menu][data-fs-dropdown-menu] {
|
|
64
114
|
--fs-dropdown-menu-box-shadow: var(--fs-bp-elevation-dropdown);
|
|
@@ -69,6 +119,18 @@
|
|
|
69
119
|
padding: var(--fs-bp-padding-1) 0;
|
|
70
120
|
background-color: var(--fs-bp-color-white);
|
|
71
121
|
border: 1px solid var(--fs-bp-color-neutral-2);
|
|
122
|
+
transform-origin: top center;
|
|
123
|
+
animation: fs-bp-org-unit-header-nav-menu-in 0.2s cubic-bezier(0, 0, 0.2, 1) forwards;
|
|
124
|
+
|
|
125
|
+
// Phones: the trigger sits at the header's left edge (it replaces the logo),
|
|
126
|
+
// so a menu centered on it would overflow the viewport. Pin it to the
|
|
127
|
+
// header's left padding instead — `!important` beats the vendor's inline
|
|
128
|
+
// `left`, and the keyframe drops the centering `-50%` offset.
|
|
129
|
+
@include u.media("<tablet") {
|
|
130
|
+
left: var(--fs-bp-spacing-5) !important;
|
|
131
|
+
transform-origin: top left;
|
|
132
|
+
animation-name: fs-bp-org-unit-header-nav-menu-in-start;
|
|
133
|
+
}
|
|
72
134
|
|
|
73
135
|
[data-fs-bp-org-unit-header-nav-item] {
|
|
74
136
|
display: flex;
|
|
@@ -86,18 +148,27 @@
|
|
|
86
148
|
}
|
|
87
149
|
|
|
88
150
|
svg {
|
|
151
|
+
display: block;
|
|
89
152
|
flex: 0 0 auto;
|
|
90
153
|
color: var(--fs-bp-color-neutral-7);
|
|
91
154
|
}
|
|
92
155
|
|
|
93
156
|
[data-fs-bp-org-unit-header-nav-item-name] {
|
|
157
|
+
position: relative;
|
|
94
158
|
min-width: 0;
|
|
95
159
|
overflow: hidden;
|
|
96
160
|
text-overflow: ellipsis;
|
|
161
|
+
white-space: nowrap;
|
|
162
|
+
// Same as the trigger's `-name` rule above.
|
|
163
|
+
line-height: 1;
|
|
164
|
+
padding-bottom: 3px;
|
|
165
|
+
top: 1px;
|
|
97
166
|
}
|
|
98
167
|
|
|
168
|
+
// `:focus-visible`, not `:focus`: the Dropdown focuses the first item when
|
|
169
|
+
// opened by a click, which shouldn't look hovered.
|
|
99
170
|
&:hover,
|
|
100
|
-
&:focus {
|
|
171
|
+
&:focus-visible {
|
|
101
172
|
color: var(--fs-bp-color-neutral-8);
|
|
102
173
|
background-color: var(--fs-bp-color-neutral-1);
|
|
103
174
|
|
|
@@ -109,8 +180,8 @@
|
|
|
109
180
|
|
|
110
181
|
[data-fs-bp-org-unit-header-nav-item-current] {
|
|
111
182
|
color: var(--fs-bp-color-black);
|
|
112
|
-
font-weight: var(--fs-bp-weight-
|
|
113
|
-
background-color: var(--fs-bp-color-neutral-
|
|
183
|
+
font-weight: var(--fs-bp-weight-semibold);
|
|
184
|
+
background-color: var(--fs-bp-color-neutral-1);
|
|
114
185
|
cursor: default;
|
|
115
186
|
|
|
116
187
|
svg {
|
|
@@ -119,7 +190,7 @@
|
|
|
119
190
|
|
|
120
191
|
&:hover,
|
|
121
192
|
&:focus {
|
|
122
|
-
background-color: var(--fs-bp-color-neutral-
|
|
193
|
+
background-color: var(--fs-bp-color-neutral-1);
|
|
123
194
|
|
|
124
195
|
svg {
|
|
125
196
|
color: var(--fs-bp-color-brand);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
import { useLink_unstable as useLink } from "@faststore/core/experimental";
|
|
4
|
-
import {
|
|
4
|
+
import { Link, Tooltip } from "@faststore/ui";
|
|
5
5
|
|
|
6
6
|
import { Icon } from "../../../shared/components";
|
|
7
7
|
import { useLocalization } from "../../../shared/localization/LocalizationContext";
|
|
@@ -36,30 +36,48 @@ export const ProfileSummary = ({
|
|
|
36
36
|
data-fs-self-profile-summary-bordered={bordered}
|
|
37
37
|
{...otherProps}
|
|
38
38
|
>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
data-fs-self-profile-summary-org
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
{/* Omitted while the user's unit is still unknown (e.g. loading). */}
|
|
40
|
+
{(orgName || showManageLink) && (
|
|
41
|
+
<div data-fs-self-profile-summary-header>
|
|
42
|
+
{orgName && (
|
|
43
|
+
<div data-fs-self-profile-summary-org>
|
|
44
|
+
<Icon
|
|
45
|
+
name="FilledFolder"
|
|
46
|
+
width={20}
|
|
47
|
+
height={20}
|
|
48
|
+
data-fs-self-profile-summary-org-icon
|
|
49
|
+
/>
|
|
50
|
+
<h2 data-fs-self-profile-summary-org-name>{orgName}</h2>
|
|
51
|
+
</div>
|
|
52
|
+
)}
|
|
53
|
+
{showManageLink && (
|
|
54
|
+
<Link
|
|
55
|
+
data-fs-self-profile-summary-org-link
|
|
56
|
+
href={resolveLink("/buyer-portal")}
|
|
57
|
+
>
|
|
58
|
+
{t("shared.actions.manageOrganization")}{" "}
|
|
59
|
+
<Icon name="OpenInNew" width={23} height={23} />
|
|
60
|
+
</Link>
|
|
61
|
+
)}
|
|
62
|
+
</div>
|
|
63
|
+
)}
|
|
51
64
|
<div data-fs-self-profile-summary-person-actions>
|
|
52
65
|
<div data-fs-self-profile-summary-person-data>
|
|
53
66
|
<h2>{name}</h2>
|
|
54
67
|
<p>{email}</p>
|
|
55
68
|
</div>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
{/* Above the button: the dropdown menu clips anything below it
|
|
70
|
+
(`overflow: hidden`), unlike the header's bottom tooltips. */}
|
|
71
|
+
<Tooltip content={t("shared.buttons.logout")} placement="top-center">
|
|
72
|
+
<button
|
|
73
|
+
type="button"
|
|
74
|
+
data-fs-self-profile-summary-logout-button
|
|
75
|
+
onClick={onLogoutClick}
|
|
76
|
+
aria-label={t("shared.buttons.logout")}
|
|
77
|
+
>
|
|
78
|
+
<Icon name="Logout" width={20} height={20} />
|
|
79
|
+
</button>
|
|
80
|
+
</Tooltip>
|
|
63
81
|
</div>
|
|
64
82
|
</section>
|
|
65
83
|
);
|
|
@@ -14,14 +14,36 @@
|
|
|
14
14
|
display: flex;
|
|
15
15
|
align-items: center;
|
|
16
16
|
justify-content: space-between;
|
|
17
|
+
gap: var(--fs-bp-gap-2);
|
|
17
18
|
padding: var(--fs-bp-padding-5);
|
|
18
|
-
padding-top: var(--fs-bp-padding-3);
|
|
19
19
|
border-bottom: 1px solid var(--fs-bp-color-neutral-3);
|
|
20
20
|
|
|
21
|
+
[data-fs-self-profile-summary-org] {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
min-width: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-fs-self-profile-summary-org-icon] {
|
|
28
|
+
display: block;
|
|
29
|
+
flex: 0 0 auto;
|
|
30
|
+
margin-right: var(--fs-bp-gap-2);
|
|
31
|
+
color: var(--fs-bp-color-brand);
|
|
32
|
+
}
|
|
33
|
+
|
|
21
34
|
[data-fs-self-profile-summary-org-name] {
|
|
35
|
+
position: relative;
|
|
36
|
+
min-width: 0;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
text-overflow: ellipsis;
|
|
39
|
+
white-space: nowrap;
|
|
22
40
|
@include text-style('action');
|
|
23
|
-
|
|
24
|
-
color: var(--fs-bp-color-
|
|
41
|
+
font-weight: var(--fs-bp-weight-medium);
|
|
42
|
+
color: var(--fs-bp-color-neutral-8);
|
|
43
|
+
// Same as [data-fs-bp-org-unit-header-nav-name].
|
|
44
|
+
line-height: 1;
|
|
45
|
+
padding-bottom: 3px;
|
|
46
|
+
top: 1px;
|
|
25
47
|
}
|
|
26
48
|
|
|
27
49
|
[data-fs-self-profile-summary-org-link] {
|
|
@@ -44,14 +66,19 @@
|
|
|
44
66
|
}
|
|
45
67
|
|
|
46
68
|
[data-fs-self-profile-summary-person-actions] {
|
|
47
|
-
|
|
48
69
|
display: grid;
|
|
49
70
|
align-items: center;
|
|
50
71
|
grid-template-columns: minmax(15.25rem, 1fr) auto;
|
|
51
72
|
gap: var(--fs-bp-gap-2);
|
|
52
|
-
padding: var(--fs-bp-padding-5)
|
|
73
|
+
padding: var(--fs-bp-padding-5);
|
|
53
74
|
|
|
54
75
|
[data-fs-self-profile-summary-person-data] {
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
gap: var(--fs-bp-gap-1);
|
|
79
|
+
min-width: 0;
|
|
80
|
+
|
|
81
|
+
// Same text style for both lines; only the color tells them apart.
|
|
55
82
|
h2, p {
|
|
56
83
|
overflow: hidden;
|
|
57
84
|
white-space: nowrap;
|
|
@@ -59,22 +86,62 @@
|
|
|
59
86
|
display: block;
|
|
60
87
|
}
|
|
61
88
|
|
|
62
|
-
h2 {
|
|
89
|
+
h2, p {
|
|
90
|
+
margin: 0;
|
|
63
91
|
@include text-style('emphasis');
|
|
64
|
-
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
h2 {
|
|
95
|
+
color: var(--fs-bp-color-neutral-8);
|
|
65
96
|
}
|
|
66
97
|
|
|
67
98
|
p {
|
|
68
|
-
|
|
69
|
-
|
|
99
|
+
color: var(--fs-bp-color-neutral-7);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Repeats the header's tooltip styles: the menu renders in a portal.
|
|
104
|
+
@import "@faststore/ui/src/components/molecules/Tooltip/styles.scss";
|
|
105
|
+
|
|
106
|
+
[data-fs-tooltip] {
|
|
107
|
+
--fs-tooltip-background: var(--fs-bp-color-black);
|
|
108
|
+
--fs-tooltip-text-color: var(--fs-bp-color-white);
|
|
109
|
+
--fs-tooltip-border-radius: var(--fs-bp-border-radius-2);
|
|
110
|
+
--fs-tooltip-padding: 0.375rem var(--fs-bp-padding-3);
|
|
111
|
+
|
|
112
|
+
[data-fs-tooltip-wrapper] {
|
|
113
|
+
box-shadow: var(--fs-bp-elevation-4);
|
|
114
|
+
pointer-events: none;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
[data-fs-tooltip-content] {
|
|
118
|
+
@include text-style('caption');
|
|
119
|
+
font-weight: var(--fs-bp-weight-regular);
|
|
120
|
+
line-height: 1.32;
|
|
121
|
+
white-space: nowrap;
|
|
70
122
|
}
|
|
71
123
|
}
|
|
72
124
|
|
|
73
125
|
[data-fs-self-profile-summary-logout-button] {
|
|
74
|
-
|
|
75
|
-
--fs-control-tap-size: var(--fs-bp-spacing-9);
|
|
126
|
+
display: flex;
|
|
76
127
|
flex: 0 0 auto;
|
|
77
|
-
|
|
78
|
-
|
|
128
|
+
align-items: center;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
width: var(--fs-bp-spacing-9);
|
|
131
|
+
height: var(--fs-bp-spacing-9);
|
|
132
|
+
padding: 0;
|
|
133
|
+
color: var(--fs-bp-color-neutral-8);
|
|
134
|
+
background: transparent;
|
|
135
|
+
border: 0;
|
|
136
|
+
border-radius: var(--fs-bp-border-radius-full);
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
|
|
139
|
+
&:hover {
|
|
140
|
+
background-color: var(--fs-bp-color-transparent-0);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&:active {
|
|
144
|
+
background-color: var(--fs-bp-color-transparent-1);
|
|
145
|
+
}
|
|
79
146
|
}
|
|
80
147
|
}
|
|
@@ -110,7 +110,6 @@ export const ErrorTabsLayout = ({ children, error }: ErrorTabsLayoutProps) => {
|
|
|
110
110
|
<div data-fs-bp-create-user-error-state>
|
|
111
111
|
<OrgUnitDetailsNavbar
|
|
112
112
|
orgId={orgUnit?.id ?? ""}
|
|
113
|
-
orgName={orgUnit?.name ?? ""}
|
|
114
113
|
person={{
|
|
115
114
|
name: user?.name ?? "",
|
|
116
115
|
}}
|