@faststore/core 2.0.110-alpha.0 → 2.0.113-alpha.0
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +21 -21
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- package/.next/cache/next-server.js.nft.json +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +3 -3
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/3746.js +25 -12
- package/.next/server/chunks/4312.js +1 -1
- package/.next/server/chunks/4371.js +1 -17
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.js.nft.json +1 -1
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js +415 -341
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +2 -2
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/account.html +2 -2
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages/s.js.nft.json +1 -1
- package/.next/static/{Hvk4r07gh33rCEJoX5uZS → FoOP4frMbgwDj5doLKiqK}/_buildManifest.js +1 -1
- package/.next/static/chunks/170.79b2f8527e327bca.js +1 -0
- package/.next/static/chunks/{264-f45c6dcd6b439926.js → 264-5b07911df63b8601.js} +1 -1
- package/.next/static/chunks/{996.0cec637399d0f543.js → 996.98e590872c51f815.js} +1 -1
- package/.next/static/chunks/pages/[slug]/{p-9b24055cb30ee7a8.js → p-74cef56b58dadbab.js} +1 -1
- package/.next/static/chunks/pages/_app-501ccc46c846c040.js +1 -0
- package/.next/static/chunks/pages/{index-218f29b878a08dc6.js → index-3aae9f104d28d1a1.js} +1 -1
- package/.next/static/chunks/{webpack-561abbd401db03bc.js → webpack-855ba0986bd6023a.js} +1 -1
- package/.next/static/css/1f987650dd4e39d0.css +1 -0
- package/.next/static/css/231b8c31105a684a.css +1 -0
- package/.next/static/css/6f4d3e91f1d161a8.css +1 -0
- package/.next/trace +64 -64
- package/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +12 -0
- package/package.json +4 -4
- package/src/Layout.tsx +1 -1
- package/src/components/{common → navigation}/Navbar/Navbar.tsx +35 -26
- package/src/components/navigation/Navbar/index.ts +1 -0
- package/src/components/{common/Navbar/NavLinks.tsx → navigation/NavbarLinks/NavbarLinks.tsx} +18 -12
- package/src/components/navigation/NavbarLinks/index.ts +1 -0
- package/src/components/{common/Navbar → navigation/NavbarSlider}/NavbarSlider.tsx +18 -21
- package/src/components/navigation/NavbarSlider/index.ts +1 -0
- package/src/components/product/ProductGrid/ProductGrid.tsx +10 -5
- package/src/components/skeletons/ProductGridSkeleton/ProductGridSkeleton.tsx +1 -2
- package/.next/static/chunks/686.0136918bcab42e72.js +0 -1
- package/.next/static/chunks/pages/_app-9d067ed89f7a4001.js +0 -1
- package/.next/static/css/117ce6f20b7a2e6c.css +0 -1
- package/.next/static/css/70ac3b88af168a4b.css +0 -1
- package/.next/static/css/cf4c6e7294227fd7.css +0 -1
- package/src/components/common/Navbar/NavLinks.stories.mdx +0 -122
- package/src/components/common/Navbar/Navbar.stories.mdx +0 -179
- package/src/components/common/Navbar/NavbarSlider.stories.mdx +0 -108
- package/src/components/common/Navbar/index.ts +0 -3
- package/src/components/common/Navbar/navbar-slider.module.scss +0 -53
- package/src/components/common/Navbar/navbar.module.scss +0 -204
- package/src/components/common/Navbar/navlinks.module.scss +0 -96
- package/src/components/product/ProductGrid/ProductGrid.stories.mdx +0 -96
- package/src/components/product/ProductGrid/product-grid.module.scss +0 -39
- package/src/sdk/ui/useScrollDirection.ts +0 -31
- /package/.next/static/{Hvk4r07gh33rCEJoX5uZS → FoOP4frMbgwDj5doLKiqK}/_ssgManifest.js +0 -0
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
|
|
2
|
-
import { SearchProvider } from '@faststore/sdk'
|
|
3
|
-
import Sentinel from 'src/sdk/search/Sentinel'
|
|
4
|
-
import { productGridItems } from 'src/../.storybook/mocks'
|
|
5
|
-
|
|
6
|
-
import { useProducts } from '../../sections/ProductGallery/usePageProducts'
|
|
7
|
-
|
|
8
|
-
import ProductGrid from '.'
|
|
9
|
-
import {
|
|
10
|
-
TokenTable,
|
|
11
|
-
TokenRow,
|
|
12
|
-
TokenDivider,
|
|
13
|
-
BestPractices,
|
|
14
|
-
BestPracticesRule,
|
|
15
|
-
} from 'src/../.storybook/components'
|
|
16
|
-
|
|
17
|
-
<Meta
|
|
18
|
-
title="Organisms/ProductGrid"
|
|
19
|
-
component={ProductGrid}
|
|
20
|
-
argTypes={{
|
|
21
|
-
/* TODO: Enable these after items per page is fixed */
|
|
22
|
-
page: {
|
|
23
|
-
table: {
|
|
24
|
-
disable: true,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
pageSize: {
|
|
28
|
-
table: {
|
|
29
|
-
disable: true,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
}}
|
|
33
|
-
/>
|
|
34
|
-
|
|
35
|
-
export const Template = (args) => {
|
|
36
|
-
return (
|
|
37
|
-
<ProductGrid {...args} />
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
<header>
|
|
42
|
-
|
|
43
|
-
# ProductGrid
|
|
44
|
-
|
|
45
|
-
It's a section generally used on PLP pages to list the products available in the store.
|
|
46
|
-
|
|
47
|
-
</header>
|
|
48
|
-
|
|
49
|
-
## Usage
|
|
50
|
-
|
|
51
|
-
`import ProductGrid from '../components/product/ProductGrid'`
|
|
52
|
-
|
|
53
|
-
<Canvas isColumn>
|
|
54
|
-
<Story
|
|
55
|
-
name="default"
|
|
56
|
-
args={{
|
|
57
|
-
products: productGridItems,
|
|
58
|
-
page: 0,
|
|
59
|
-
pageSize: 4,
|
|
60
|
-
}}
|
|
61
|
-
>
|
|
62
|
-
{Template.bind({})}
|
|
63
|
-
</Story>
|
|
64
|
-
</Canvas>
|
|
65
|
-
|
|
66
|
-
<ArgsTable story="default" />
|
|
67
|
-
|
|
68
|
-
<TokenTable>
|
|
69
|
-
<TokenRow token="--fs-product-grid-gap-mobile" value="var(--fs-grid-gap-0)" />
|
|
70
|
-
<TokenRow
|
|
71
|
-
token="--fs-product-grid-gap-desktop"
|
|
72
|
-
value="var(--fs-grid-gap-2)"
|
|
73
|
-
/>
|
|
74
|
-
<TokenDivider />
|
|
75
|
-
<TokenRow token="--fs-product-grid-columns-mobile" value="2" />
|
|
76
|
-
<TokenRow token="--fs-product-grid-columns-desktop" value="4" />
|
|
77
|
-
</TokenTable>
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
<BestPractices>
|
|
82
|
-
<BestPracticesRule
|
|
83
|
-
recommendedDescription={
|
|
84
|
-
<>
|
|
85
|
-
Respect <code>ProductCard</code> content's width considering the space
|
|
86
|
-
available on the page.
|
|
87
|
-
</>
|
|
88
|
-
}
|
|
89
|
-
discouragedDescription={
|
|
90
|
-
<>
|
|
91
|
-
Avoid using a lot of <code>ProductCards</code> on the same row, this
|
|
92
|
-
could lead to unwanted horizontal scroll.
|
|
93
|
-
</>
|
|
94
|
-
}
|
|
95
|
-
/>
|
|
96
|
-
</BestPractices>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
@import "src/styles/scaffold";
|
|
2
|
-
|
|
3
|
-
.fs-product-grid {
|
|
4
|
-
// --------------------------------------------------------
|
|
5
|
-
// Design Tokens for ProductGrid
|
|
6
|
-
// --------------------------------------------------------
|
|
7
|
-
|
|
8
|
-
// Default properties
|
|
9
|
-
--fs-product-grid-gap-mobile : var(--fs-grid-gap-0);
|
|
10
|
-
--fs-product-grid-gap-tablet : var(--fs-product-grid-gap-mobile);
|
|
11
|
-
--fs-product-grid-gap-desktop : var(--fs-grid-gap-2);
|
|
12
|
-
|
|
13
|
-
--fs-product-grid-columns-mobile : 2;
|
|
14
|
-
--fs-product-grid-columns-tablet : 4;
|
|
15
|
-
--fs-product-grid-columns-desktop : var(--fs-product-grid-columns-tablet);
|
|
16
|
-
|
|
17
|
-
// --------------------------------------------------------
|
|
18
|
-
// Structural Styles
|
|
19
|
-
// --------------------------------------------------------
|
|
20
|
-
|
|
21
|
-
display: grid;
|
|
22
|
-
grid-template-columns: repeat(var(--fs-product-grid-columns-mobile), 1fr);
|
|
23
|
-
grid-gap: var(--fs-product-grid-gap-mobile);
|
|
24
|
-
|
|
25
|
-
@include media(">=tablet") {
|
|
26
|
-
$pagination-start-index: 2;
|
|
27
|
-
|
|
28
|
-
grid-template-columns: repeat(var(--fs-product-grid-columns-desktop), 1fr);
|
|
29
|
-
grid-gap: var(--fs-product-grid-gap-tablet);
|
|
30
|
-
|
|
31
|
-
&:nth-of-type(n + #{$pagination-start-index}) {
|
|
32
|
-
margin-top: var(--fs-product-grid-gap-desktop);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@include media(">=notebook") {
|
|
37
|
-
grid-gap: var(--fs-product-grid-gap-desktop);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState, useTransition } from 'react'
|
|
2
|
-
|
|
3
|
-
export default function useScrollDirection() {
|
|
4
|
-
const [scrollDirection, setScrollDirection] = useState<string>('')
|
|
5
|
-
const [isPending, startTransition] = useTransition()
|
|
6
|
-
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
let lastScrollY = window.scrollY
|
|
9
|
-
|
|
10
|
-
const updateScrollDirection = () => {
|
|
11
|
-
const { scrollY } = window
|
|
12
|
-
const direction = scrollY > lastScrollY ? 'down' : 'up'
|
|
13
|
-
|
|
14
|
-
if (
|
|
15
|
-
!isPending &&
|
|
16
|
-
direction !== scrollDirection &&
|
|
17
|
-
(scrollY - lastScrollY > 10 || scrollY - lastScrollY < -10)
|
|
18
|
-
) {
|
|
19
|
-
startTransition(() => setScrollDirection(direction))
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
lastScrollY = scrollY > 0 ? scrollY : 0
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
window.addEventListener('scroll', updateScrollDirection)
|
|
26
|
-
|
|
27
|
-
return () => window.removeEventListener('scroll', updateScrollDirection)
|
|
28
|
-
}, [isPending, scrollDirection])
|
|
29
|
-
|
|
30
|
-
return scrollDirection
|
|
31
|
-
}
|
|
File without changes
|