@vtex/faststore-plugin-buyer-portal 1.0.2 → 1.0.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.
Files changed (34) hide show
  1. package/package.json +6 -9
  2. package/plugin.config.js +1 -1
  3. package/src/components/AddressesCard/AddressesCard.tsx +87 -0
  4. package/src/components/Card/Card.scss +159 -0
  5. package/src/components/Card/Card.tsx +16 -0
  6. package/src/components/Card/CardBody.tsx +7 -0
  7. package/src/components/Card/CardFooter.tsx +5 -0
  8. package/src/components/Card/CardHeader.tsx +7 -0
  9. package/src/components/Card/index.ts +4 -0
  10. package/src/components/ContractsCard/ContractsCard.tsx +88 -0
  11. package/src/components/CustomerSwitch/CustomerSwitchDrawer.tsx +10 -16
  12. package/src/components/Icons/Link.tsx +17 -0
  13. package/src/components/{CustomerSwitch/CustomerSwitchLoad.tsx → Icons/Load.tsx} +4 -7
  14. package/src/components/Icons/Profile.tsx +15 -0
  15. package/src/components/Icons/index.ts +8 -0
  16. package/src/components/Logo/Logo.tsx +18 -0
  17. package/src/components/Navbar/Navbar.tsx +37 -0
  18. package/src/components/Navbar/navbar.scss +50 -0
  19. package/src/components/OrganizationalUnitsCard/OrganizationalUnitsCard.tsx +66 -0
  20. package/src/components/ProfileCard/ProfileCard.tsx +48 -0
  21. package/src/components/ProfileSummary/ProfileSummary.tsx +49 -0
  22. package/src/components/ProfileSummary/profile-summary.scss +73 -0
  23. package/src/components/SelfManagementDrawer/SelfManagementDrawer.tsx +9 -8
  24. package/src/components/SelfManagementDrawer/SelfManagementDrawerHeader.tsx +5 -30
  25. package/src/components/SelfManagementDrawer/index.ts +0 -1
  26. package/src/components/SelfManagementDrawer/self-management-drawer.scss +86 -0
  27. package/src/components/SelfManagementSignInButton/SelfManagementSignInButton.tsx +3 -2
  28. package/src/components/UsersCard/UsersCard.tsx +89 -0
  29. package/src/components/index.ts +6 -1
  30. package/src/mock/profile-data.ts +55 -0
  31. package/src/pages/buyer-portal.tsx +27 -1
  32. package/src/themes/index.scss +81 -174
  33. package/tsconfig.json +1 -1
  34. package/src/components/SelfManagementDrawer/SelfManagementDrawerFooter.tsx +0 -44
package/package.json CHANGED
@@ -1,22 +1,19 @@
1
1
  {
2
2
  "name": "@vtex/faststore-plugin-buyer-portal",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "A plugin for faststore with buyer portal",
5
5
  "main": "index.js",
6
- "dependencies": {
7
- "react": "^18.2.0",
8
- "react-dom": "^18.2.0"
9
- },
6
+ "dependencies": {},
10
7
  "devDependencies": {
11
8
  "@faststore/core": "^3.0.147",
12
- "@types/react": "^18.3.12",
13
- "@types/react-dom": "^18.3.1",
9
+ "@faststore/ui": "^3.0.147",
10
+ "@types/react": "^18.2.42",
14
11
  "next": "13.5.6",
15
12
  "typescript": "4.7.3"
16
13
  },
17
14
  "peerDependencies": {
18
- "@faststore/core": "^3.0.147",
19
- "next": "13.5.6"
15
+ "react": "^18.2.0",
16
+ "react-dom": "^18.2.0"
20
17
  },
21
18
  "license": "MIT"
22
19
  }
package/plugin.config.js CHANGED
@@ -3,7 +3,7 @@ module.exports = {
3
3
  pages: {
4
4
  "buyer-portal": {
5
5
  path: "/buyer-portal",
6
- appLayout: false,
6
+ appLayout: false
7
7
  },
8
8
  },
9
9
  };
@@ -0,0 +1,87 @@
1
+ import {
2
+ IconButton, Icon, Toggle, Dropdown,
3
+ DropdownItem,
4
+ DropdownMenu,
5
+ DropdownButton,
6
+ } from '@faststore/ui'
7
+
8
+ import { Card, CardBody, CardFooter, CardHeader } from '../Card'
9
+ import Link from "next/link";
10
+
11
+ export type AddressInformation = {
12
+ addressId: string,
13
+ street: string,
14
+ addressType: string,
15
+ isActive: boolean,
16
+ }
17
+
18
+ type AddressesCardProps = {
19
+ addresses: AddressInformation[]
20
+ }
21
+
22
+ export default function AddressesCard({ addresses }: AddressesCardProps) {
23
+ return (
24
+ <section data-fs-home-card>
25
+ <Card>
26
+ <CardHeader>
27
+ <div data-fs-card-title>Addresses <span data-fs-card-title-counter>{addresses.length}</span></div>
28
+ <IconButton icon={<Icon name="PlusCircle" width={20} height={20} />}
29
+ aria-label={`$addresses action`} onClick={() => { }} />
30
+ </CardHeader>
31
+ <CardBody>
32
+ {addresses.length && addresses.map((address: AddressInformation) => {
33
+ return (
34
+ <div>
35
+ <hr data-fs-divider />
36
+
37
+ <div data-fs-card-row key={address.addressId}>
38
+ <div data-fs-card-information-row>
39
+ <Icon name="House" weight='bold' data-fs-card-information-icon />
40
+ <span data-fs-card-information-title>{address.street}</span>
41
+ <div data-fs-card-information-type>
42
+ <span data-fs-shipping-tag>{address.addressType}</span>
43
+ </div>
44
+ </div>
45
+ <div data-fs-card-action-row>
46
+ <Toggle id="addressActive" defaultChecked={address.isActive} />
47
+
48
+ <Dropdown>
49
+ <DropdownButton><Icon name='DotsThree' data-fs-menu-action-button /></DropdownButton>
50
+ <DropdownMenu>
51
+ <DropdownItem>
52
+ <Icon name="ArrowSquareOut" />Open
53
+ </DropdownItem>
54
+ <DropdownItem>
55
+ {/* TODO: Replace Icon */}
56
+ <Icon name='User' />Edit
57
+ </DropdownItem>
58
+ <DropdownItem>
59
+ {/* TODO: Replace Icon */}
60
+ <Icon name="XCircle" /> Delete
61
+ </DropdownItem>
62
+ {/* TODO: Replace Icon */}
63
+ <DropdownItem>
64
+ <div data-fs-dropdown-active-item>
65
+ <div data-fs-dropdown-active-item-label>
66
+ <Icon name="Checked" />Active
67
+ </div>
68
+ <Toggle id="addressActiveMenu" defaultChecked={address.isActive} data-fs-internal-toggle />
69
+ </div>
70
+ </DropdownItem>
71
+ </DropdownMenu>
72
+ </Dropdown>
73
+ </div>
74
+ </div>
75
+ </div>)
76
+ })}
77
+ </CardBody>
78
+ <CardFooter>
79
+ <Link href="/" data-fs-card-footer-link>
80
+ <span>Manage addresses</span>
81
+ </Link>
82
+ <IconButton icon={<Icon name="CaretRight" data-fs-card-footer-icon />} aria-label="manage-addresses" />
83
+ </CardFooter>
84
+ </Card>
85
+ </section>
86
+ )
87
+ }
@@ -0,0 +1,159 @@
1
+ [data-fs-card] {
2
+ // --------------------------------------------------------
3
+ // Design Tokens for Card
4
+ // --------------------------------------------------------
5
+
6
+ // Default properties
7
+ --fs-card-border-width : var(--fs-border-width);
8
+
9
+ // Header
10
+ --fs-card-header-padding : var(--fs-spacing-3);
11
+ --fs-card-header-bkg-color : var(--fs-color-neutral-bkg);
12
+ --fs-card-header-font-weight : var(--fs-text-weight-bold);
13
+ --fs-card-header-icon-color : var(--fs-color-main-2);
14
+
15
+ // Body
16
+ --fs-card-body-padding : var(--fs-spacing-3);
17
+
18
+ // --------------------------------------------------------
19
+ // Structural Styles
20
+ // --------------------------------------------------------
21
+ border: var(--fs-card-border-width) solid rgba(224, 224, 224, 1);
22
+ border-radius: 12px;
23
+
24
+ [data-fs-card-header] {
25
+ border-top-left-radius: 12px;
26
+ border-top-right-radius: 12px;
27
+ padding-bottom: 0px !important;
28
+ background-color: white;
29
+ align-items: center;
30
+
31
+ padding: var(--fs-card-header-padding);
32
+ font-weight: var(--fs-card-header-font-weight);
33
+ display: flex;
34
+ justify-content: space-between;
35
+
36
+ [data-fs-button]{
37
+ --fs-button-height: var(--fs-spacing-4);
38
+ }
39
+
40
+ [data-fs-icon]{
41
+ color: var(--fs-card-header-icon-color);
42
+ }
43
+
44
+ [data-fs-card-title-counter]{
45
+ font-weight: 600;
46
+ margin-left: 0.75rem;
47
+ color: #ADADAD;
48
+ }
49
+ }
50
+
51
+ [data-fs-card-body] {
52
+ padding: var(--fs-card-body-padding);
53
+ padding-bottom: 0px;
54
+
55
+
56
+ [data-fs-profile-card-row] {
57
+ display: flex;
58
+ flex-direction: row;
59
+ gap: 2.5rem;
60
+ padding-top: 1.25rem;
61
+ padding-bottom: 1.25rem;
62
+
63
+ [data-fs-card-row-label]{
64
+ font-weight: 500;
65
+ width: 100px;
66
+ color: gray;
67
+ }
68
+ }
69
+
70
+ [data-fs-card-row]{
71
+ display: flex;
72
+ flex-direction: row;
73
+ gap: 2.5rem;
74
+ padding-top: 0.5rem;
75
+ padding-bottom: 0.5rem;
76
+
77
+ [data-fs-card-row-label]{
78
+ font-weight: 500;
79
+ width: 100px;
80
+ color: gray;
81
+ }
82
+ }
83
+
84
+ [data-fs-card-information-row] {
85
+ display: flex;
86
+ align-items: center;
87
+ width: 70%;
88
+ justify-content: space-around;
89
+
90
+ [data-fs-card-information-icon] {
91
+ width: 50px
92
+ }
93
+
94
+ [data-fs-card-information-title] {
95
+ width: 200px
96
+ }
97
+
98
+ [data-fs-card-information-type] {
99
+ width: 100px;
100
+ }
101
+ }
102
+
103
+ [data-fs-card-action-row] {
104
+ display: flex;
105
+ width: 50%;
106
+ justify-content: flex-end;
107
+ align-items: center;
108
+ }
109
+
110
+
111
+ [data-fs-menu-action-button] {
112
+ rotate: 90deg;
113
+ }
114
+
115
+ [data-fs-shipping-tag] {
116
+ background: #C2C2C2;
117
+ padding: 5px 10px 5px 10px;
118
+ border-radius: 100px;
119
+ font-weight: 500;
120
+ }
121
+
122
+ [data-fs-card-body-empty-state] {
123
+ display: flex;
124
+ flex-direction: column;
125
+ align-items: center;
126
+ gap: 10px;
127
+ padding: 100px;
128
+
129
+ [data-fs-button]{
130
+ --fs-border-radius: 999px;
131
+ }
132
+ }
133
+ }
134
+
135
+ [data-fs-divider] {
136
+ border: 1px solid #E0E0E0
137
+ }
138
+
139
+ [data-fs-card-footer] {
140
+ border-top-width: var(--fs-card-border-width);
141
+ border-top-color: rgba(224, 224, 224, 1);
142
+ border-top-style: solid;
143
+ padding: var(--fs-spacing-1) var(--fs-spacing-3);
144
+ display: flex;
145
+ justify-content: space-between;
146
+ align-items: center;
147
+
148
+ [data-fs-card-footer-link] {
149
+ font-weight: 500;
150
+ line-height: 14px;
151
+ color: #0366DD;
152
+ text-decoration: none;
153
+ }
154
+
155
+ [data-fs-card-footer-icon] {
156
+ color: grey
157
+ }
158
+ }
159
+ }
@@ -0,0 +1,16 @@
1
+ import type { HTMLAttributes } from "react";
2
+ import React, { forwardRef } from 'react'
3
+
4
+ export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {
5
+ }
6
+
7
+ export const Card = forwardRef<HTMLDivElement, CardProps>(function Card({
8
+ children,
9
+ ...otherProps
10
+ }, ref) {
11
+ return (
12
+ <section data-testid="fs-card" ref={ref} data-fs-card {...otherProps}>
13
+ {children}
14
+ </section >
15
+ )
16
+ })
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from "react"
2
+
3
+ export const CardBody = ({ children }: { children: ReactNode }) => (
4
+ <div data-fs-card-body>
5
+ {children}
6
+ </div>
7
+ )
@@ -0,0 +1,5 @@
1
+ import type { ReactNode } from "react"
2
+
3
+ export const CardFooter = ({ children }: { children: ReactNode }) => (
4
+ <footer data-fs-card-footer>{children}</footer>
5
+ )
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react'
2
+
3
+
4
+ export const CardHeader = ({ children }: { children: ReactNode }) => (
5
+ <header data-fs-card-header>{children}</header>
6
+ )
7
+
@@ -0,0 +1,4 @@
1
+ export { CardBody } from './CardBody'
2
+ export { Card } from './Card'
3
+ export { CardHeader } from './CardHeader'
4
+ export { CardFooter } from './CardFooter'
@@ -0,0 +1,88 @@
1
+ import {
2
+ Icon, IconButton, Toggle, Dropdown,
3
+ DropdownItem,
4
+ DropdownMenu,
5
+ DropdownButton,
6
+ } from '@faststore/ui'
7
+
8
+ import { Card, CardBody, CardFooter, CardHeader } from '../Card'
9
+ import Link from "next/link";
10
+
11
+ export type ContractInformation = {
12
+ id: string
13
+ name: string
14
+ isActive: boolean
15
+ }
16
+
17
+ type ContractsCardProps = {
18
+ contracts: ContractInformation[]
19
+ }
20
+
21
+
22
+ export default function ContractsCard({ contracts }: ContractsCardProps) {
23
+ return (
24
+ <section data-fs-home-card>
25
+ <Card>
26
+ <CardHeader>
27
+ <div data-fs-card-title>Contracts <span data-fs-card-title-counter>{contracts.length}</span></div>
28
+ {/* TODO: CHANGE ICON */}
29
+ <IconButton icon={<Icon name="PlusCircle" width={20} height={20} />}
30
+ aria-label={`$profile action`} onClick={() => { }} />
31
+ </CardHeader>
32
+ <CardBody>
33
+ {contracts.length && contracts.map((contract: ContractInformation) => {
34
+ return (
35
+ <div>
36
+ <hr data-fs-divider />
37
+
38
+ <div data-fs-card-row key={contract.id}>
39
+ <div data-fs-card-information-row>
40
+ <Icon data-fs-card-information-icon name="User" weight='bold' />
41
+ <h1 data-fs-card-information-title>{contract.name}</h1>
42
+ </div>
43
+ <div data-fs-card-action-row>
44
+ <Toggle id="contractActive" defaultChecked={contract.isActive} />
45
+
46
+ <Dropdown>
47
+ <DropdownButton>
48
+ <Icon name="DotsThree" data-fs-menu-action-button />
49
+ </DropdownButton>
50
+ <DropdownMenu align="right" data-fs-dropdown-menu>
51
+ <DropdownItem>
52
+ <Icon name="ArrowSquareOut" />Open
53
+ </DropdownItem>
54
+ <DropdownItem>
55
+ {/* TODO: Replace Icon */}
56
+ <Icon name='User' />Edit
57
+ </DropdownItem>
58
+ <DropdownItem>
59
+ {/* TODO: Replace Icon */}
60
+ <Icon name="XCircle" /> Delete
61
+ </DropdownItem>
62
+ {/* TODO: Replace Icon */}
63
+ <DropdownItem>
64
+ <div data-fs-dropdown-active-item>
65
+ <div data-fs-dropdown-active-item-label>
66
+ <Icon name="Checked" />Active
67
+ </div>
68
+ <Toggle id="contractActiveMenu" defaultChecked={contract.isActive} data-fs-internal-toggle />
69
+ </div>
70
+ </DropdownItem>
71
+ </DropdownMenu>
72
+ </Dropdown>
73
+ </div>
74
+
75
+ </div>
76
+ </div>)
77
+ })}
78
+ </CardBody>
79
+ <CardFooter>
80
+ <Link href="/" data-fs-card-footer-link>
81
+ <span>View contracts</span>
82
+ </Link>
83
+ <IconButton icon={<Icon name="CaretRight" data-fs-card-footer-icon />} aria-label="view-contracts" />
84
+ </CardFooter>
85
+ </Card>
86
+ </section>
87
+ )
88
+ }
@@ -4,7 +4,7 @@ import { CustomerSwitchSearch } from "./CustomerSwitchSearch";
4
4
  import { CustomerSwitchOptionsList } from "./CustomerSwitchOptionsList";
5
5
  import { useMemo, useState } from "react";
6
6
  import { CustomerSwitchOptionData } from "./CustomerSwitchOption";
7
- import { CustomerSwitchLoad } from "./CustomerSwitchLoad";
7
+ import * as Icons from "../Icons";
8
8
 
9
9
  type CustomerSwitchDrawerProps = {
10
10
  isOpen: boolean;
@@ -42,10 +42,8 @@ const options = [
42
42
  "Lighthouse Consulting Group",
43
43
  "Stellar Synergy",
44
44
  "FinanceCore Solutions",
45
- "Nova Finance Advisors"
46
- ].map(
47
- (name, index) => ({ name, id: `id-${index}` })
48
- );
45
+ "Nova Finance Advisors",
46
+ ].map((name, index) => ({ name, id: `id-${index}` }));
49
47
 
50
48
  export const CustomerSwitchDrawer = ({
51
49
  isOpen,
@@ -54,24 +52,24 @@ export const CustomerSwitchDrawer = ({
54
52
  const { fade, fadeOut } = useFadeEffect();
55
53
 
56
54
  const [option, setOption] = useState<CustomerSwitchOptionData>(options[0]);
57
- const [loading, setLoading] = useState(false)
58
- const [searchTerm, setSearchTerm] = useState("")
55
+ const [loading, setLoading] = useState(false);
56
+ const [searchTerm, setSearchTerm] = useState("");
59
57
 
60
58
  const filteredOptions = useMemo(() => {
61
59
  if (!searchTerm) {
62
60
  return options;
63
61
  }
64
- return options.filter(currentOption =>
62
+ return options.filter((currentOption) =>
65
63
  currentOption.name?.toLowerCase().includes(searchTerm.toLowerCase())
66
64
  );
67
65
  }, [options, searchTerm]);
68
66
 
69
67
  const handleSubmitCustomer = () => {
70
68
  console.log(option);
71
- setLoading(true)
69
+ setLoading(true);
72
70
  setTimeout(() => {
73
- setLoading(false)
74
- onCloseDrawer?.()
71
+ setLoading(false);
72
+ onCloseDrawer?.();
75
73
  }, 3000);
76
74
  };
77
75
 
@@ -107,11 +105,7 @@ export const CustomerSwitchDrawer = ({
107
105
  onClick={handleSubmitCustomer}
108
106
  disabled={option.id === options[0].id || loading}
109
107
  >
110
- {
111
- loading ?
112
- <CustomerSwitchLoad /> :
113
- "Confirm"
114
- }
108
+ {loading ? <Icons.Load width={16} height={16} /> : "Confirm"}
115
109
  </Button>
116
110
  </footer>
117
111
  </SlideOver>
@@ -0,0 +1,17 @@
1
+ import { IconProps } from ".";
2
+
3
+ export const Link = ({ ...props }: IconProps) => (
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 0 10 10"
7
+ fill="none"
8
+ {...props}
9
+ >
10
+ <path
11
+ fill-rule="evenodd"
12
+ clip-rule="evenodd"
13
+ d="M1.75 1C1.75 0.585786 2.08579 0.25 2.5 0.25H9C9.41421 0.25 9.75 0.585786 9.75 1V7.5C9.75 7.91421 9.41421 8.25 9 8.25C8.58579 8.25 8.25 7.91421 8.25 7.5V2.81066L1.53033 9.53033C1.23744 9.82322 0.762563 9.82322 0.46967 9.53033C0.176777 9.23744 0.176777 8.76256 0.46967 8.46967L7.18934 1.75H2.5C2.08579 1.75 1.75 1.41421 1.75 1Z"
14
+ fill="#3D3D3D"
15
+ />
16
+ </svg>
17
+ );
@@ -1,10 +1,7 @@
1
- export const CustomerSwitchLoad = () => (
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- width="16px"
5
- height="16px"
6
- viewBox="0 0 24 24"
7
- >
1
+ import { IconProps } from ".";
2
+
3
+ export const Load = ({ ...props }: IconProps) => (
4
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
8
5
  <g stroke="currentColor">
9
6
  <circle
10
7
  cx="12"
@@ -0,0 +1,15 @@
1
+ import { IconProps } from ".";
2
+
3
+ export const Profile = ({ ...props }: IconProps) => (
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 0 14 14"
7
+ fill="none"
8
+ {...props}
9
+ >
10
+ <path
11
+ d="M7.00065 7.00114C6.08398 7.00114 5.29926 6.67475 4.64648 6.02197C3.99371 5.3692 3.66732 4.58447 3.66732 3.66781C3.66732 2.75114 3.99371 1.96642 4.64648 1.31364C5.29926 0.660862 6.08398 0.334473 7.00065 0.334473C7.91732 0.334473 8.70204 0.660862 9.35482 1.31364C10.0076 1.96642 10.334 2.75114 10.334 3.66781C10.334 4.58447 10.0076 5.3692 9.35482 6.02197C8.70204 6.67475 7.91732 7.00114 7.00065 7.00114ZM0.333984 13.6678V11.3345C0.333984 10.8623 0.455512 10.4282 0.698568 10.0324C0.941623 9.63656 1.26454 9.33447 1.66732 9.12614C2.52843 8.69559 3.40343 8.37267 4.29232 8.15739C5.18121 7.94211 6.08398 7.83447 7.00065 7.83447C7.91732 7.83447 8.8201 7.94211 9.70899 8.15739C10.5979 8.37267 11.4729 8.69559 12.334 9.12614C12.7368 9.33447 13.0597 9.63656 13.3027 10.0324C13.5458 10.4282 13.6673 10.8623 13.6673 11.3345V13.6678H0.333984Z"
12
+ fill="#0366DD"
13
+ />
14
+ </svg>
15
+ );
@@ -0,0 +1,8 @@
1
+ export type IconProps = {
2
+ width: number;
3
+ height: number;
4
+ };
5
+
6
+ export { Profile } from "./Profile";
7
+ export { Link } from "./Link";
8
+ export { Load } from "./Load";
@@ -0,0 +1,18 @@
1
+ import { Image_unstable as Image } from "@faststore/core/experimental";
2
+
3
+ const logoSrc =
4
+ "https://b2bfaststoredev.vtexassets.com/unsafe/1440x0/center/middle/https%3A%2F%2Fstoreframework.vtexassets.com%2Fassets%2Fvtex.file-manager-graphql%2Fimages%2Fab9997f4-8fd6-46f5-99d2-9d5af3ef5e34___6d75a203771d7408d8f0d1c660a076dd.png";
5
+
6
+ export const Logo = () => (
7
+ <div data-fs-logo>
8
+ <Image
9
+ alt="Logo"
10
+ src={logoSrc}
11
+ width={0}
12
+ height={0}
13
+ sizes="15vw"
14
+ loading="lazy"
15
+ style={{ width: "100%", height: "auto" }}
16
+ />
17
+ </div>
18
+ );
@@ -0,0 +1,37 @@
1
+ import * as Icons from "../Icons";
2
+ import { Logo } from "../Logo/Logo";
3
+ import Link from "next/link";
4
+
5
+ import { Dropdown, DropdownMenu, DropdownButton } from "@faststore/ui";
6
+ import { ProfileSummary } from "../ProfileSummary/ProfileSummary";
7
+ import { doLogout } from "../../utils/logout";
8
+ import { profileData } from "../../mock/profile-data";
9
+
10
+ export const Navbar = () => {
11
+ return (
12
+ <header data-fs-buyer-portal-navbar>
13
+ <Logo />
14
+ <div data-fs-header-actions>
15
+ <Link href="/" data-fs-start-shopping-link>
16
+ <span>Start Shopping</span>
17
+ <Icons.Link width={10} height={10} />
18
+ </Link>
19
+ <Dropdown>
20
+ <DropdownButton asChild>
21
+ <button data-fs-profile-dropdown-trigger>
22
+ <Icons.Profile width={14} height={14} />
23
+ </button>
24
+ </DropdownButton>
25
+
26
+ <DropdownMenu align="right" data-fs-profile-dropdown-menu>
27
+ <ProfileSummary
28
+ data-fs-profile-dropdown-menu-profile-summary
29
+ onLogoutClick={doLogout}
30
+ {...profileData}
31
+ />
32
+ </DropdownMenu>
33
+ </Dropdown>
34
+ </div>
35
+ </header>
36
+ );
37
+ };
@@ -0,0 +1,50 @@
1
+ [data-fs-buyer-portal-navbar] {
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: #f5f5f5;
7
+
8
+ [data-fs-header-actions] {
9
+ display: flex;
10
+ align-items: center;
11
+ }
12
+
13
+ [data-fs-start-shopping-link] {
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+
18
+ color: #3d3d3d;
19
+ font-weight: var(--fs-text-weight-semibold);
20
+ font-family: "Inter", sans-serif;
21
+ line-height: calc(var(--fs-spacing-3) + var(--fs-spacing-0));
22
+ font-size: var(--fs-text-size-2);
23
+ text-decoration: none;
24
+ margin-right: calc(var(--fs-spacing-3) + var(--fs-spacing-0));
25
+
26
+ span {
27
+ margin-right: var(--fs-spacing-0);
28
+ }
29
+ }
30
+
31
+ [data-fs-profile-dropdown-trigger] {
32
+ display: flex;
33
+ justify-content: center;
34
+ align-items: center;
35
+ border-radius: var(--fs-border-radius-circle);
36
+ background-color: #cbe9ff;
37
+ width: var(--fs-spacing-5);
38
+ height: var(--fs-spacing-5);
39
+ }
40
+ }
41
+
42
+ [data-fs-profile-dropdown-menu] {
43
+ --fs-profile-dropdown-menu-width: 360px;
44
+
45
+ background-color: white;
46
+
47
+ [data-fs-profile-dropdown-menu-profile-summary] {
48
+ min-width: var(--fs-profile-dropdown-menu-width);
49
+ }
50
+ }