@faststore/core 2.0.101-alpha.0 → 2.0.103-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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +12 -0
- package/cypress/integration/analytics.test.js +2 -2
- package/cypress/integration/cart.test.js +4 -4
- package/package.json +4 -4
- package/src/components/cart/CartSidebar/CartSidebar.tsx +16 -40
- package/src/components/cart/OrderSummary/OrderSummary.tsx +2 -6
- package/src/components/sections/ProductDetails/ProductDetails.tsx +1 -1
- package/src/components/ui/ImageGallery/ImageGallery.tsx +28 -24
- package/src/components/ui/ImageGallery/index.ts +2 -4
- package/.next/BUILD_ID +0 -1
- package/.next/build-manifest.json +0 -99
- package/.next/cache/.tsbuildinfo +0 -1
- package/.next/cache/config.json +0 -7
- package/.next/cache/eslint/.cache_1gneedd +0 -1
- package/.next/cache/next-server.js.nft.json +0 -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/export-marker.json +0 -1
- package/.next/images-manifest.json +0 -1
- package/.next/next-server.js.nft.json +0 -1
- package/.next/package.json +0 -1
- package/.next/prerender-manifest.json +0 -1
- package/.next/react-loadable-manifest.json +0 -44
- package/.next/required-server-files.json +0 -1
- package/.next/routes-manifest.json +0 -1
- package/.next/server/chunks/120.js +0 -435
- package/.next/server/chunks/123.js +0 -58
- package/.next/server/chunks/1394.js +0 -3801
- package/.next/server/chunks/1608.js +0 -515
- package/.next/server/chunks/2154.js +0 -206
- package/.next/server/chunks/247.js +0 -61
- package/.next/server/chunks/2914.js +0 -95
- package/.next/server/chunks/2922.js +0 -7293
- package/.next/server/chunks/3264.js +0 -67
- package/.next/server/chunks/3431.js +0 -7241
- package/.next/server/chunks/350.js +0 -142
- package/.next/server/chunks/3746.js +0 -237
- package/.next/server/chunks/3898.js +0 -240
- package/.next/server/chunks/4312.js +0 -674
- package/.next/server/chunks/4371.js +0 -1473
- package/.next/server/chunks/5098.js +0 -124
- package/.next/server/chunks/5576.js +0 -72
- package/.next/server/chunks/6280.js +0 -322
- package/.next/server/chunks/6465.js +0 -91
- package/.next/server/chunks/676.js +0 -32
- package/.next/server/chunks/6859.js +0 -959
- package/.next/server/chunks/6881.js +0 -320
- package/.next/server/chunks/6898.js +0 -149
- package/.next/server/chunks/7104.js +0 -196
- package/.next/server/chunks/7181.js +0 -658
- package/.next/server/chunks/7183.js +0 -72
- package/.next/server/chunks/7992.js +0 -570
- package/.next/server/chunks/8098.js +0 -246
- package/.next/server/chunks/810.js +0 -432
- package/.next/server/chunks/8287.js +0 -58
- package/.next/server/chunks/9143.js +0 -106
- package/.next/server/chunks/9152.js +0 -213
- package/.next/server/chunks/953.js +0 -646
- package/.next/server/chunks/9557.js +0 -117
- package/.next/server/chunks/9854.js +0 -72
- package/.next/server/chunks/font-manifest.json +0 -1
- package/.next/server/font-manifest.json +0 -1
- package/.next/server/middleware-build-manifest.js +0 -1
- package/.next/server/middleware-manifest.json +0 -6
- package/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/.next/server/pages/404.js.nft.json +0 -1
- package/.next/server/pages/500.js.nft.json +0 -1
- package/.next/server/pages/[...slug].js +0 -671
- package/.next/server/pages/[...slug].js.nft.json +0 -1
- package/.next/server/pages/[slug]/p.js +0 -2393
- package/.next/server/pages/[slug]/p.js.nft.json +0 -1
- package/.next/server/pages/_app.js +0 -2369
- package/.next/server/pages/_app.js.nft.json +0 -1
- package/.next/server/pages/_document.js +0 -304
- package/.next/server/pages/_document.js.nft.json +0 -1
- package/.next/server/pages/_error.js +0 -164
- package/.next/server/pages/_error.js.nft.json +0 -1
- package/.next/server/pages/account.js.nft.json +0 -1
- package/.next/server/pages/api/graphql.js +0 -315
- package/.next/server/pages/api/graphql.js.nft.json +0 -1
- package/.next/server/pages/api/preview.js +0 -118
- package/.next/server/pages/api/preview.js.nft.json +0 -1
- package/.next/server/pages/checkout.js.nft.json +0 -1
- package/.next/server/pages/en-US/404.html +0 -81
- package/.next/server/pages/en-US/500.html +0 -81
- package/.next/server/pages/en-US/account.html +0 -81
- package/.next/server/pages/en-US/checkout.html +0 -81
- package/.next/server/pages/en-US/login.html +0 -81
- package/.next/server/pages/en-US/s.html +0 -81
- package/.next/server/pages/en-US.html +0 -81
- package/.next/server/pages/en-US.json +0 -1
- package/.next/server/pages/index.js +0 -428
- package/.next/server/pages/index.js.nft.json +0 -1
- package/.next/server/pages/login.js.nft.json +0 -1
- package/.next/server/pages/s.js.nft.json +0 -1
- package/.next/server/pages-manifest.json +0 -16
- package/.next/server/webpack-api-runtime.js +0 -229
- package/.next/server/webpack-runtime.js +0 -229
- package/.next/static/V0z729OIqsX7azqcAGJ5Q/_buildManifest.js +0 -1
- package/.next/static/V0z729OIqsX7azqcAGJ5Q/_ssgManifest.js +0 -1
- package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
- package/.next/static/chunks/152.57849458d8337a92.js +0 -1
- package/.next/static/chunks/264-6dc2258a751b3d74.js +0 -1
- package/.next/static/chunks/351-a4e28d64f48c5269.js +0 -1
- package/.next/static/chunks/608.59e69b83f35d9c44.js +0 -1
- package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
- package/.next/static/chunks/686.6c345856d484363b.js +0 -1
- package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
- package/.next/static/chunks/781-7df372b5b56e3f96.js +0 -1
- package/.next/static/chunks/843.e1d0f9260a52f32c.js +0 -1
- package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
- package/.next/static/chunks/996.64460309250b214c.js +0 -1
- package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
- package/.next/static/chunks/main-9746772201fe3ac1.js +0 -1
- package/.next/static/chunks/pages/404-ba608a2a9f0c420a.js +0 -1
- package/.next/static/chunks/pages/500-910883c20541d9ce.js +0 -1
- package/.next/static/chunks/pages/[...slug]-417e3b51bda1f5f3.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-cbb4ca8d57bafa9f.js +0 -1
- package/.next/static/chunks/pages/_app-6dc7b0c168e15d5c.js +0 -1
- package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
- package/.next/static/chunks/pages/account-b8fc5222ffe89b60.js +0 -1
- package/.next/static/chunks/pages/checkout-f8cb7cb22225ef9d.js +0 -1
- package/.next/static/chunks/pages/index-9ea3f7868f5ed138.js +0 -1
- package/.next/static/chunks/pages/login-33954810b200eca8.js +0 -1
- package/.next/static/chunks/pages/s-ba2868e14fedb65b.js +0 -1
- package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
- package/.next/static/chunks/webpack-65b155971f3eac57.js +0 -1
- package/.next/static/css/10db3bc7ecdf0556.css +0 -1
- package/.next/static/css/43d61b402f41569b.css +0 -1
- package/.next/static/css/4899c3cc356704f9.css +0 -1
- package/.next/static/css/6507cb48401e73a4.css +0 -1
- package/.next/static/css/8ea129ea90e49e98.css +0 -1
- package/.next/static/css/b2f16bd4b93e0aca.css +0 -1
- package/.next/static/css/db63ea05e98cb7e8.css +0 -1
- package/.next/static/css/ea60a7e6c07ee644.css +0 -1
- package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
- package/.next/trace +0 -65
- package/public/~partytown/debug/partytown-atomics.js +0 -556
- package/public/~partytown/debug/partytown-media.js +0 -374
- package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
- package/public/~partytown/debug/partytown-sw.js +0 -59
- package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
- package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
- package/public/~partytown/debug/partytown.js +0 -72
- package/public/~partytown/partytown-atomics.js +0 -2
- package/public/~partytown/partytown-media.js +0 -2
- package/public/~partytown/partytown-sw.js +0 -2
- package/public/~partytown/partytown.js +0 -2
- package/src/components/cart/CartItem/CartItem.stories.mdx +0 -134
- package/src/components/cart/CartSidebar/CartSidebar.stories.mdx +0 -105
- package/src/components/cart/CartSidebar/cart-sidebar.module.scss +0 -57
- package/src/components/cart/OrderSummary/order-summary.module.scss +0 -22
- package/src/components/ui/ImageGallery/ImageGallery.stories.mdx +0 -173
- package/src/components/ui/ImageGallery/ImageGallerySelector.tsx +0 -121
- package/src/components/ui/ImageGallery/ImageZoom.tsx +0 -12
- package/src/components/ui/ImageGallery/image-gallery-selector.module.scss +0 -137
- package/src/components/ui/ImageGallery/image-gallery.module.scss +0 -56
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
|
|
2
|
-
|
|
3
|
-
import { ImageGallery } from '.'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
TokenTable,
|
|
7
|
-
TokenRow,
|
|
8
|
-
TokenDivider,
|
|
9
|
-
} from 'src/../.storybook/components'
|
|
10
|
-
|
|
11
|
-
<Meta title="Organisms/ImageGallery" />
|
|
12
|
-
|
|
13
|
-
export const Template = () => {
|
|
14
|
-
const productImages = [
|
|
15
|
-
{
|
|
16
|
-
url: 'https://storeframework.vtexassets.com/arquivos/ids/190902/unsplash-magic-mouse.jpg?v=637800136963870000',
|
|
17
|
-
alternateName: 'Magicwhite',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
url: 'https://storeframework.vtexassets.com/arquivos/ids/190923/lena-de-fanti-nQ_j5d-klVU-unsplash.jpg?v=637867501523500000',
|
|
21
|
-
alternateName: 'magicbox',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
url: 'https://storeframework.vtexassets.com/arquivos/ids/190924/anthony-choren-e7dG26YCrZU-unsplash.jpg?v=637867501835430000',
|
|
25
|
-
alternateName: 'magicblackwhite',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
url: 'https://storeframework.vtexassets.com/arquivos/ids/190925/maheshkumar-painam-GZdfLeL-MDk-unsplash.jpg?v=637867502064000000',
|
|
29
|
-
alternateName: 'magiccombo',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
url: 'https://storeframework.vtexassets.com/arquivos/ids/190926/math-0U9fBLGP3EY-unsplash.jpg?v=637867502325830000',
|
|
33
|
-
alternateName: 'magicback',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
url: 'https://storeframework.vtexassets.com/arquivos/ids/190927/marek-levak-YPeqMN_wfw0-unsplash.jpg?v=637867502641430000',
|
|
37
|
-
alternateName: 'magictable',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
url: 'https://storeframework.vtexassets.com/arquivos/ids/190928/mouse8.jpg?v=637867504048970000',
|
|
41
|
-
alternateName: 'magichand',
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
url: 'https://storeframework.vtexassets.com/arquivos/ids/190929/harpal-singh-KuvEVL7lXYQ-unsplash.jpg?v=637867509459130000',
|
|
45
|
-
alternateName: 'magicstyle',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
url: 'https://storeframework.vtexassets.com/arquivos/ids/190930/chris-hardy-182PzOtcmWc-unsplash.jpg?v=637867509778300000',
|
|
49
|
-
alternateName: 'magicscale',
|
|
50
|
-
},
|
|
51
|
-
]
|
|
52
|
-
return <ImageGallery images={productImages} />
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export const TemplateWithoutSelector = () => {
|
|
56
|
-
const productImages = [
|
|
57
|
-
{
|
|
58
|
-
url: 'https://storeframework.vtexassets.com/arquivos/ids/190902/unsplash-magic-mouse.jpg?v=637800136963870000',
|
|
59
|
-
alternateName: 'Magicwhite',
|
|
60
|
-
},
|
|
61
|
-
]
|
|
62
|
-
return <ImageGallery images={productImages} />
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
<header>
|
|
66
|
-
|
|
67
|
-
# Image Gallery
|
|
68
|
-
|
|
69
|
-
An `ImageGallery` is used when you want to display a series of photos in a gallery on a post or page.
|
|
70
|
-
|
|
71
|
-
</header>
|
|
72
|
-
|
|
73
|
-
## Overview
|
|
74
|
-
|
|
75
|
-
According to the quantity of `Image` to be displayed, the `ImageGallerySelector` will be displayed.
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## Usage
|
|
80
|
-
|
|
81
|
-
`import { ImageGallery } from 'src/components/ui/ImageGallery'`
|
|
82
|
-
|
|
83
|
-
<Canvas className="sbdocs-image-gallery">
|
|
84
|
-
<Story name="default">{Template.bind({})}</Story>
|
|
85
|
-
</Canvas>
|
|
86
|
-
|
|
87
|
-
<TokenTable>
|
|
88
|
-
<TokenRow
|
|
89
|
-
token="--fs-image-gallery-width"
|
|
90
|
-
value="calc(100% + (2 * var(--fs-grid-padding)))"
|
|
91
|
-
/>
|
|
92
|
-
<TokenDivider />
|
|
93
|
-
<TokenRow token="--fs-image-gallery-gap-mobile" value="var(--fs-spacing-2)" />
|
|
94
|
-
<TokenRow
|
|
95
|
-
token="--fs-image-gallery-gap-notebook"
|
|
96
|
-
value="var(--fs-spacing-3)"
|
|
97
|
-
/>
|
|
98
|
-
</TokenTable>
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## Nested Elements
|
|
103
|
-
|
|
104
|
-
### Current Selected Image
|
|
105
|
-
|
|
106
|
-
<TokenTable>
|
|
107
|
-
<TokenRow token="--fs-image-gallery-current-height" value="33.125rem" />
|
|
108
|
-
<TokenRow
|
|
109
|
-
token="--fs-image-gallery-current-border-radius"
|
|
110
|
-
value="var(--fs-border-radius)"
|
|
111
|
-
/>
|
|
112
|
-
</TokenTable>
|
|
113
|
-
|
|
114
|
-
### Selector
|
|
115
|
-
|
|
116
|
-
<TokenTable>
|
|
117
|
-
<TokenRow token="--fs-image-gallery-selector-max-height" value="33.125rem" />
|
|
118
|
-
</TokenTable>
|
|
119
|
-
|
|
120
|
-
### Selector Elements
|
|
121
|
-
|
|
122
|
-
<TokenTable>
|
|
123
|
-
<TokenRow
|
|
124
|
-
token="--fs-image-gallery-selector-elements-gap"
|
|
125
|
-
value="var(--fs-spacing-1)"
|
|
126
|
-
/>
|
|
127
|
-
<TokenRow
|
|
128
|
-
token="--fs-image-gallery-selector-elements-gap-notebook"
|
|
129
|
-
value="var(--fs-spacing-2)"
|
|
130
|
-
/>
|
|
131
|
-
<TokenRow
|
|
132
|
-
token="--fs-image-gallery-selector-elements-padding"
|
|
133
|
-
value="var(--fs-spacing-0)"
|
|
134
|
-
/>
|
|
135
|
-
</TokenTable>
|
|
136
|
-
|
|
137
|
-
### Selector Thumbnail
|
|
138
|
-
|
|
139
|
-
<TokenTable>
|
|
140
|
-
<TokenRow
|
|
141
|
-
token="--fs-image-gallery-selector-thumbnail-width-mobile"
|
|
142
|
-
value="3.5rem"
|
|
143
|
-
/>
|
|
144
|
-
<TokenRow
|
|
145
|
-
token="--fs-image-gallery-selector-thumbnail-width-notebook"
|
|
146
|
-
value="4.5rem"
|
|
147
|
-
/>
|
|
148
|
-
<TokenRow
|
|
149
|
-
token="--fs-image-gallery-selector-thumbnail-border-radius"
|
|
150
|
-
value="var(--fs-border-radius)"
|
|
151
|
-
/>
|
|
152
|
-
<TokenRow
|
|
153
|
-
token="--fs-image-gallery-selector-thumbnail-selected-border-color"
|
|
154
|
-
value="var(--fs-border-color-active)"
|
|
155
|
-
isColor
|
|
156
|
-
/>
|
|
157
|
-
</TokenTable>
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
## Variants
|
|
162
|
-
|
|
163
|
-
### With Selector (More than 1 Image)
|
|
164
|
-
|
|
165
|
-
<Canvas className="sbdocs-image-gallery">
|
|
166
|
-
<Story name="overview-default">{Template.bind({})}</Story>
|
|
167
|
-
</Canvas>
|
|
168
|
-
|
|
169
|
-
### Without Selector
|
|
170
|
-
|
|
171
|
-
<Canvas className="sbdocs-image-gallery">
|
|
172
|
-
<Story name="overview-default-2">{TemplateWithoutSelector.bind({})}</Story>
|
|
173
|
-
</Canvas>
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Button as UIButton,
|
|
3
|
-
Icon,
|
|
4
|
-
IconButton as UIIconButton,
|
|
5
|
-
} from '@faststore/ui'
|
|
6
|
-
import { useRef } from 'react'
|
|
7
|
-
import { useInView } from 'react-intersection-observer'
|
|
8
|
-
|
|
9
|
-
import { Image } from 'src/components/ui/Image'
|
|
10
|
-
import styles from 'src/components/ui/ImageGallery/image-gallery-selector.module.scss'
|
|
11
|
-
|
|
12
|
-
import type { ImageElementData } from './ImageGallery'
|
|
13
|
-
|
|
14
|
-
interface Props {
|
|
15
|
-
images: ImageElementData[]
|
|
16
|
-
onSelect: React.Dispatch<React.SetStateAction<number>>
|
|
17
|
-
currentImageIdx: number
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const SCROLL_MARGIN_VALUE = 400
|
|
21
|
-
|
|
22
|
-
const moveScroll = (container: HTMLDivElement | null, value: number) => {
|
|
23
|
-
if (container) {
|
|
24
|
-
if (container.scrollHeight > container.clientHeight) {
|
|
25
|
-
// TODO: Temporary workaround for scroll-behavior with scrollTop – Safari 15.4) https://developer.apple.com/forums/thread/703294
|
|
26
|
-
container.style.overflow = 'auto'
|
|
27
|
-
window.requestAnimationFrame(() =>
|
|
28
|
-
container.scrollTo({ top: value, behavior: 'smooth' })
|
|
29
|
-
)
|
|
30
|
-
setTimeout(() => (container.style.overflow = 'hidden'), 2000)
|
|
31
|
-
} else {
|
|
32
|
-
container.scrollLeft += value
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const hasScroll = (container: HTMLDivElement | null): boolean => {
|
|
38
|
-
if (container) {
|
|
39
|
-
return (
|
|
40
|
-
container.scrollHeight > container.clientHeight ||
|
|
41
|
-
container.scrollWidth > container.clientWidth
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return false
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function ImageGallerySelector({ images, onSelect, currentImageIdx }: Props) {
|
|
49
|
-
const elementsRef = useRef<HTMLDivElement>(null)
|
|
50
|
-
const elementHasScroll = hasScroll(elementsRef.current)
|
|
51
|
-
const { ref: firstImageRef, inView: firstImageInView } = useInView({
|
|
52
|
-
threshold: 1,
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
const { ref: lastImageRef, inView: lastImageInView } = useInView({
|
|
56
|
-
threshold: 1,
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<section
|
|
61
|
-
data-fs-image-gallery-selector
|
|
62
|
-
className={styles.fsImageGallerySelector}
|
|
63
|
-
aria-roledescription="carousel"
|
|
64
|
-
aria-label="Product images"
|
|
65
|
-
>
|
|
66
|
-
{elementHasScroll && !firstImageInView && (
|
|
67
|
-
<UIIconButton
|
|
68
|
-
data-fs-image-gallery-selector-control-button
|
|
69
|
-
aria-label="backward slide image selector"
|
|
70
|
-
icon={<Icon name="ArrowLeft" width={24} height={24} />}
|
|
71
|
-
onClick={() => moveScroll(elementsRef.current, -SCROLL_MARGIN_VALUE)}
|
|
72
|
-
/>
|
|
73
|
-
)}
|
|
74
|
-
<div data-fs-image-gallery-selector-elements ref={elementsRef}>
|
|
75
|
-
{images.map((image, idx) => {
|
|
76
|
-
const ref =
|
|
77
|
-
idx === 0
|
|
78
|
-
? firstImageRef
|
|
79
|
-
: idx === images.length - 1
|
|
80
|
-
? lastImageRef
|
|
81
|
-
: null
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<UIButton
|
|
85
|
-
key={idx}
|
|
86
|
-
aria-label={`${image.alternateName} - Image ${idx + 1} of ${
|
|
87
|
-
images.length
|
|
88
|
-
}`}
|
|
89
|
-
onClick={() => onSelect(idx)}
|
|
90
|
-
data-fs-image-gallery-selector-thumbnail={
|
|
91
|
-
idx === currentImageIdx ? 'selected' : 'true'
|
|
92
|
-
}
|
|
93
|
-
>
|
|
94
|
-
<Image
|
|
95
|
-
onLoadingComplete={(img) => {
|
|
96
|
-
if (ref) ref(img)
|
|
97
|
-
}}
|
|
98
|
-
src={image.url}
|
|
99
|
-
alt={image.alternateName}
|
|
100
|
-
loading={idx === 0 ? 'eager' : 'lazy'}
|
|
101
|
-
sizes="(max-width: 72px) 25vw, 30vw"
|
|
102
|
-
width={72}
|
|
103
|
-
height={72}
|
|
104
|
-
/>
|
|
105
|
-
</UIButton>
|
|
106
|
-
)
|
|
107
|
-
})}
|
|
108
|
-
</div>
|
|
109
|
-
{elementHasScroll && !lastImageInView && (
|
|
110
|
-
<UIIconButton
|
|
111
|
-
data-fs-image-gallery-selector-control-button
|
|
112
|
-
aria-label="forward slide image selector"
|
|
113
|
-
icon={<Icon name="ArrowLeft" width={24} height={24} />}
|
|
114
|
-
onClick={() => moveScroll(elementsRef.current, +SCROLL_MARGIN_VALUE)}
|
|
115
|
-
/>
|
|
116
|
-
)}
|
|
117
|
-
</section>
|
|
118
|
-
)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export default ImageGallerySelector
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PropsWithChildren } from 'react'
|
|
2
|
-
|
|
3
|
-
interface ImageZoomProps {
|
|
4
|
-
helpMessage?: string
|
|
5
|
-
zoomFactor?: number
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const ImageZoom = ({ children }: PropsWithChildren<ImageZoomProps>) => {
|
|
9
|
-
return <> {children} </>
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default ImageZoom
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
@import "src/styles/scaffold";
|
|
2
|
-
|
|
3
|
-
.fs-image-gallery-selector {
|
|
4
|
-
// --------------------------------------------------------
|
|
5
|
-
// Design Tokens for Image Gallery Selector
|
|
6
|
-
// --------------------------------------------------------
|
|
7
|
-
|
|
8
|
-
// Default properties
|
|
9
|
-
--fs-image-gallery-selector-max-height : 33.125rem; // 530px
|
|
10
|
-
|
|
11
|
-
// Elements
|
|
12
|
-
--fs-image-gallery-selector-elements-gap : var(--fs-spacing-1);
|
|
13
|
-
--fs-image-gallery-selector-elements-gap-notebook : var(--fs-spacing-2);
|
|
14
|
-
--fs-image-gallery-selector-elements-padding : var(--fs-spacing-0);
|
|
15
|
-
|
|
16
|
-
// Thumbnail
|
|
17
|
-
--fs-image-gallery-selector-thumbnail-width-mobile : var(--fs-spacing-8);
|
|
18
|
-
--fs-image-gallery-selector-thumbnail-width-notebook : var(--fs-spacing-10);
|
|
19
|
-
--fs-image-gallery-selector-thumbnail-border-radius : var(--fs-border-radius);
|
|
20
|
-
--fs-image-gallery-selector-thumbnail-selected-border-color : var(--fs-border-color-active);
|
|
21
|
-
|
|
22
|
-
// --------------------------------------------------------
|
|
23
|
-
// Structural Styles
|
|
24
|
-
// --------------------------------------------------------
|
|
25
|
-
position: relative;
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
max-height: var(--fs-image-gallery-selector-max-height);
|
|
30
|
-
|
|
31
|
-
@include media(">=notebook") {
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
grid-row: 1;
|
|
34
|
-
justify-content: space-between;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
[data-fs-image-gallery-selector-elements] {
|
|
38
|
-
display: flex;
|
|
39
|
-
column-gap: var(--fs-image-gallery-selector-elements-gap);
|
|
40
|
-
padding: var(--fs-image-gallery-selector-elements-padding);
|
|
41
|
-
overflow-x: auto;
|
|
42
|
-
scroll-behavior: smooth;
|
|
43
|
-
|
|
44
|
-
&::-webkit-scrollbar {
|
|
45
|
-
display: none;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@include media(">=notebook") {
|
|
49
|
-
flex-direction: column;
|
|
50
|
-
row-gap: var(--fs-image-gallery-selector-elements-gap-notebook);
|
|
51
|
-
overflow-y: hidden;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
[data-fs-image-gallery-selector-thumbnail] {
|
|
56
|
-
flex-shrink: 0;
|
|
57
|
-
width: var(--fs-image-gallery-selector-thumbnail-width-mobile);
|
|
58
|
-
padding: 0;
|
|
59
|
-
overflow: hidden;
|
|
60
|
-
background-color: transparent;
|
|
61
|
-
border: var(--fs-border-width-thick) solid transparent;
|
|
62
|
-
border-radius: var(--fs-image-gallery-selector-thumbnail-border-radius);
|
|
63
|
-
transition: all var(--fs-transition-timing) var(--fs-transition-function);
|
|
64
|
-
|
|
65
|
-
&:hover:not([data-fs-image-gallery-selector-thumbnail="selected"]) {
|
|
66
|
-
border-color: var(--fs-image-gallery-selector-thumbnail-selected-border-color);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
&[data-fs-image-gallery-selector-thumbnail="selected"] {
|
|
70
|
-
border-color: var(--fs-image-gallery-selector-thumbnail-selected-border-color);
|
|
71
|
-
box-shadow: 0 0 0 var(--fs-border-width-thickest) var(--fs-color-focus-ring-outline);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
[data-fs-image] {
|
|
75
|
-
border: var(--fs-border-width-thick) solid var(--fs-color-body-bkg);
|
|
76
|
-
border-radius: var(--fs-image-gallery-selector-thumbnail-border-radius);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
@include focus-ring-visible;
|
|
80
|
-
|
|
81
|
-
@include media(">=notebook") {
|
|
82
|
-
width: var(--fs-image-gallery-selector-thumbnail-width-notebook);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
[data-fs-image-gallery-selector-control-button] {
|
|
87
|
-
position: absolute;
|
|
88
|
-
z-index: 1;
|
|
89
|
-
color: var(--fs-color-text-display);
|
|
90
|
-
background: linear-gradient(90deg, var(--fs-color-body-bkg) 55%, transparent);
|
|
91
|
-
background-color: transparent;
|
|
92
|
-
border: none;
|
|
93
|
-
border-radius: var(--fs-border-radius-circle);
|
|
94
|
-
|
|
95
|
-
&:hover {
|
|
96
|
-
color: var(--fs-color-text-display);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
[data-fs-icon]span {
|
|
100
|
-
display: flex;
|
|
101
|
-
height: fit-content;
|
|
102
|
-
padding: var(--fs-spacing-1);
|
|
103
|
-
background-color: var(--fs-control-bkg);
|
|
104
|
-
border-radius: var(--fs-border-radius-circle);
|
|
105
|
-
box-shadow: var(--fs-shadow);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
@include media("<notebook") {
|
|
109
|
-
height: 100%;
|
|
110
|
-
|
|
111
|
-
&:first-child {
|
|
112
|
-
left: 0;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&:last-child {
|
|
116
|
-
right: 0;
|
|
117
|
-
transform: scaleX(-1);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
@include media(">=notebook") {
|
|
122
|
-
display: flex;
|
|
123
|
-
justify-content: center;
|
|
124
|
-
width: 100%;
|
|
125
|
-
background: linear-gradient(180deg, var(--fs-color-body-bkg) 55%, transparent);
|
|
126
|
-
|
|
127
|
-
[data-fs-icon]span {
|
|
128
|
-
transform: rotate(90deg);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&:last-child {
|
|
132
|
-
bottom: 0;
|
|
133
|
-
transform: scaleY(-1);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
@import "src/styles/scaffold";
|
|
2
|
-
|
|
3
|
-
.fs-image-gallery {
|
|
4
|
-
// --------------------------------------------------------
|
|
5
|
-
// Design Tokens for Image Gallery
|
|
6
|
-
// --------------------------------------------------------
|
|
7
|
-
|
|
8
|
-
// Default properties
|
|
9
|
-
--fs-image-gallery-width : calc(100% + (2 * var(--fs-grid-padding)));
|
|
10
|
-
|
|
11
|
-
--fs-image-gallery-gap-mobile : var(--fs-spacing-2);
|
|
12
|
-
--fs-image-gallery-gap-notebook : var(--fs-spacing-3);
|
|
13
|
-
|
|
14
|
-
// Current Selected Image
|
|
15
|
-
--fs-image-gallery-current-border-radius : var(--fs-border-radius);
|
|
16
|
-
--fs-image-gallery-current-height : 33.125rem; // 530px
|
|
17
|
-
|
|
18
|
-
// --------------------------------------------------------
|
|
19
|
-
// Structural Styles
|
|
20
|
-
// --------------------------------------------------------
|
|
21
|
-
|
|
22
|
-
position: relative;
|
|
23
|
-
left: calc(-1 * var(--fs-grid-padding));
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
row-gap: var(--fs-image-gallery-gap-mobile);
|
|
27
|
-
width: var(--fs-image-gallery-width);
|
|
28
|
-
|
|
29
|
-
@include media(">=tablet") {
|
|
30
|
-
left: 0;
|
|
31
|
-
width: 100%;
|
|
32
|
-
|
|
33
|
-
> [data-fs-image] {
|
|
34
|
-
grid-column: 2 / span 7;
|
|
35
|
-
border-radius: var(--fs-image-gallery-current-border-radius);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@include media(">=notebook") {
|
|
40
|
-
>[data-fs-image] {
|
|
41
|
-
height: var(--fs-image-gallery-current-height);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// --------------------------------------------------------
|
|
46
|
-
// Variants Styles
|
|
47
|
-
// --------------------------------------------------------
|
|
48
|
-
|
|
49
|
-
&[data-fs-image-gallery="with-selector"] {
|
|
50
|
-
@include media(">=notebook") {
|
|
51
|
-
display: grid;
|
|
52
|
-
grid-template-columns: repeat(8, 1fr);
|
|
53
|
-
column-gap: var(--fs-image-gallery-gap-notebook);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|