@vtex/faststore-plugin-buyer-portal 1.0.6 → 1.0.8
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/src/components/Icons/Back.tsx +22 -0
- package/src/components/Icons/Down.tsx +25 -0
- package/src/components/Icons/StarFolder.tsx +19 -0
- package/src/components/Icons/index.ts +3 -0
- package/src/components/InternalTopbar/InternalTopBar.scss +38 -0
- package/src/components/InternalTopbar/InternalTopbar.tsx +52 -0
- package/src/components/Navbar/Navbar.tsx +0 -2
- package/src/pages/buyer-portal.tsx +18 -0
- package/src/themes/index.scss +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IconProps } from ".";
|
|
2
|
+
|
|
3
|
+
/* *
|
|
4
|
+
* Material Symbols - Arrow Back
|
|
5
|
+
*/
|
|
6
|
+
export const Back = ({ ...props }: IconProps) => (
|
|
7
|
+
<svg xmlns="http://www.w3.org/2000/svg" {...props} viewBox="0 -960 960 960" fill="currentColor"><path d="m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z" /></svg>
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IconProps } from ".";
|
|
2
|
+
|
|
3
|
+
/* *
|
|
4
|
+
* Material Symbols - Arrow Drop Down
|
|
5
|
+
*/
|
|
6
|
+
export const Down = ({ ...props }: IconProps) => (
|
|
7
|
+
<svg xmlns="http://www.w3.org/2000/svg" {...props} viewBox="0 -960 960 960" fill="currentColor"><path d="M480-344 246-576h468L480-344Z" /></svg>
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IconProps } from ".";
|
|
2
|
+
|
|
3
|
+
/* *
|
|
4
|
+
* Material Symbols - Folder Special
|
|
5
|
+
*/
|
|
6
|
+
export const StarFolder = ({ ...props }: IconProps) => (
|
|
7
|
+
<svg xmlns="http://www.w3.org/2000/svg" {...props} viewBox="0 -960 960 960" fill="currentColor"><path d="M154-128q-43.72 0-74.86-31.14Q48-190.27 48-234v-492q0-43.72 31.14-74.86T154-832h220l106 106h326q43.72 0 74.86 31.14T912-620v386q0 43.73-31.14 74.86Q849.72-128 806-128H154Zm339.67-136 104.16-79.68L702-264l-38-130 104-84H638l-40-126-40 126H428l104.17 84.23L493.67-264Z" /></svg>
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
@@ -13,3 +13,6 @@ export { Delete } from './Delete';
|
|
|
13
13
|
export { Active } from './Active';
|
|
14
14
|
export { FilledFolder } from './FilledFolder';
|
|
15
15
|
export { Address } from './Address';
|
|
16
|
+
export { Back } from './Back';
|
|
17
|
+
export { StarFolder } from './StarFolder'
|
|
18
|
+
export { Down } from './Down'
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[data-fs-buyer-portal-topbar]{
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
align-items: center;
|
|
5
|
+
padding: var(--fs-spacing-3) calc(var(--fs-spacing-8) + var(--fs-spacing-0));
|
|
6
|
+
background-color: #FFFFFF;
|
|
7
|
+
border-bottom: 1px solid #E0E0E0;
|
|
8
|
+
width: 100%;
|
|
9
|
+
|
|
10
|
+
[data-fs-buyer-portal-topbar-navigation]{
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: var(--fs-spacing-2);
|
|
14
|
+
width: 25%;
|
|
15
|
+
color: #707070;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[data-fs-buyer-portal-topbar-title]{
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: var(--fs-spacing-1);
|
|
22
|
+
font-weight: var(--fs-text-weight-semibold);
|
|
23
|
+
font-size: var(--fs-text-size-3);
|
|
24
|
+
line-height: 28px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-fs-buyer-portal-topbar-actions]{
|
|
28
|
+
width: 25%;
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: flex-end;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: var(--fs-spacing-2);
|
|
33
|
+
|
|
34
|
+
[data-fs-menu-action-button]{
|
|
35
|
+
margin-top: var(--fs-spacing-0);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Icon, IconButton, Dropdown,
|
|
3
|
+
DropdownButton,
|
|
4
|
+
Toggle,
|
|
5
|
+
LinkButton,
|
|
6
|
+
} from "@faststore/ui";
|
|
7
|
+
import type { ReactNode } from "react";
|
|
8
|
+
import type { HTMLAttributes } from "react";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
import * as Icons from "../Icons";
|
|
12
|
+
|
|
13
|
+
interface InternapTopBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {
|
|
14
|
+
rootName: string;
|
|
15
|
+
titleIcon?: ReactNode;
|
|
16
|
+
title: string
|
|
17
|
+
titleDropDownItems?: ReactNode;
|
|
18
|
+
showActions?: boolean
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const InternalTopBar = ({ rootName, titleIcon, title, titleDropDownItems, showActions = true, children }: InternapTopBarProps) => {
|
|
22
|
+
return (
|
|
23
|
+
<header data-fs-buyer-portal-topbar>
|
|
24
|
+
<div data-fs-buyer-portal-topbar-navigation>
|
|
25
|
+
<LinkButton href="/buyer-portal">
|
|
26
|
+
<IconButton icon={<Icons.Back height={24} width={24} />}
|
|
27
|
+
aria-label={`topbar goback`} onClick={() => { }} />
|
|
28
|
+
</LinkButton>
|
|
29
|
+
<Icons.StarFolder height={24} width={24} />
|
|
30
|
+
{rootName}
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div data-fs-buyer-portal-topbar-title>
|
|
34
|
+
{titleIcon && (titleIcon)}
|
|
35
|
+
|
|
36
|
+
<Dropdown>
|
|
37
|
+
<DropdownButton>{title} {titleDropDownItems && (<Icons.Down height={12} width={12} />)}</DropdownButton>
|
|
38
|
+
{titleDropDownItems}
|
|
39
|
+
</Dropdown>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div data-fs-buyer-portal-topbar-actions>
|
|
43
|
+
{children}
|
|
44
|
+
{showActions && (
|
|
45
|
+
<>
|
|
46
|
+
<IconButton icon={<Icon name='DotsThree' data-fs-menu-action-button />} aria-label="topbar options" />
|
|
47
|
+
</>
|
|
48
|
+
)}
|
|
49
|
+
</div>
|
|
50
|
+
</header>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import * as Icons from "../Icons";
|
|
2
2
|
import { Logo } from "../Logo/Logo";
|
|
3
3
|
import Link from "next/link";
|
|
4
|
-
import { ArrowUpRight } from '@phosphor-icons/react'
|
|
5
4
|
|
|
6
5
|
import { Dropdown, DropdownMenu, DropdownButton, Icon } from "@faststore/ui";
|
|
7
6
|
import { ProfileSummary } from "../ProfileSummary/ProfileSummary";
|
|
8
7
|
import { doLogout } from "../../utils/logout";
|
|
9
8
|
import { profileData } from "../../mock/profile-data";
|
|
10
9
|
|
|
11
|
-
|
|
12
10
|
export const Navbar = () => {
|
|
13
11
|
return (
|
|
14
12
|
<header data-fs-buyer-portal-navbar>
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Navbar } from "../components/Navbar/Navbar";
|
|
2
|
+
import { InternalTopBar } from "../components/InternalTopbar/InternalTopbar";
|
|
2
3
|
import AddressesCard from "../components/AddressesCard/AddressesCard";
|
|
3
4
|
import OrganizationalUnitsCard from "../components/OrganizationalUnitsCard/OrganizationalUnitsCard";
|
|
4
5
|
import ProfileCard from "../components/ProfileCard/ProfileCard";
|
|
5
6
|
import UsersCard from "../components/UsersCard/UsersCard";
|
|
7
|
+
import * as Icons from "../components/Icons"
|
|
6
8
|
import ContractsCard from "../components/ContractsCard/ContractsCard";
|
|
7
9
|
import { organizationResponse } from "../mock/profile-data";
|
|
10
|
+
import { DropdownItem, DropdownMenu } from "@faststore/ui";
|
|
8
11
|
|
|
9
12
|
export type PageLoader = { page: string };
|
|
10
13
|
|
|
@@ -13,9 +16,24 @@ export async function loader(): Promise<PageLoader> {
|
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
export default function MyAccount(data: PageLoader) {
|
|
19
|
+
// TODO: Remove this when we have a specific page to use the topbar
|
|
20
|
+
const DropDownItems = (
|
|
21
|
+
<DropdownMenu>
|
|
22
|
+
<DropdownItem>
|
|
23
|
+
Empresa 02
|
|
24
|
+
</DropdownItem>
|
|
25
|
+
<DropdownItem>
|
|
26
|
+
Empresa 03
|
|
27
|
+
</DropdownItem>
|
|
28
|
+
</DropdownMenu>
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
16
32
|
return (
|
|
17
33
|
<section>
|
|
18
34
|
<Navbar />
|
|
35
|
+
{/* TODO: Remove this when we have a specific page to use the topbar */}
|
|
36
|
+
<InternalTopBar rootName="Stars Corp Inc." title="Madureira" titleIcon={<Icons.Profile width={24} height={24} />} titleDropDownItems={DropDownItems} />
|
|
19
37
|
<div data-fs-buyer-portal-home-grid>
|
|
20
38
|
<h1 data-fs-buyer-portal-title>{organizationResponse.displayName}</h1>
|
|
21
39
|
<div data-fs-buyer-portal-home-row>
|
package/src/themes/index.scss
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@import '@faststore/ui/src/components/molecules/Toggle/styles.scss';
|
|
6
6
|
@import "../components/CustomerSwitch/customer-switch.scss";
|
|
7
7
|
@import "../components/Navbar/navbar.scss";
|
|
8
|
+
@import "../components/InternalTopbar/InternalTopBar.scss";
|
|
8
9
|
@import "../components/SelfManagementDrawer/self-management-drawer.scss";
|
|
9
10
|
@import "../components/SelfManagementDrawer/self-management-drawer.scss";
|
|
10
11
|
@import "../components/ProfileSummary/profile-summary.scss";
|