@faststore/core 0.3.17 → 2.0.65-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.
Files changed (94) hide show
  1. package/.storybook/storybook.css +1 -0
  2. package/.turbo/turbo-build.log +50 -0
  3. package/.turbo/turbo-lint.log +2 -0
  4. package/@generated/graphql/index.ts +27 -3
  5. package/@generated/graphql/persisted.json +1 -1
  6. package/CHANGELOG.md +116 -180
  7. package/README.md +2 -2
  8. package/cypress/integration/analytics.test.js +3 -3
  9. package/cypress/integration/cart.test.js +2 -2
  10. package/cypress/integration/plp.test.js +8 -8
  11. package/package.json +8 -9
  12. package/src/Layout.tsx +1 -1
  13. package/src/components/cart/CartItem/CartItem.tsx +30 -71
  14. package/src/components/cart/CartSidebar/CartSidebar.stories.mdx +1 -1
  15. package/src/components/cart/CartSidebar/CartSidebar.tsx +9 -12
  16. package/src/components/common/Footer/Footer.tsx +5 -38
  17. package/src/components/common/Footer/FooterFlags.tsx +23 -0
  18. package/src/components/common/Footer/footer.module.scss +2 -28
  19. package/src/components/common/Footer/index.ts +1 -0
  20. package/src/components/common/Navbar/NavLinks.stories.mdx +1 -1
  21. package/src/components/common/Navbar/Navbar.stories.mdx +1 -1
  22. package/src/components/common/Navbar/Navbar.tsx +1 -1
  23. package/src/components/common/Navbar/NavbarSlider.stories.mdx +1 -1
  24. package/src/components/common/Navbar/NavbarSlider.tsx +2 -2
  25. package/src/components/common/Toast/Toast.tsx +1 -1
  26. package/src/components/product/ProductCard/ProductCard.tsx +44 -59
  27. package/src/components/product/ProductGrid/ProductGrid.tsx +7 -1
  28. package/src/components/regionalization/Regionalization.stories.mdx +24 -6
  29. package/src/components/regionalization/RegionalizationBar/RegionalizationBar.stories.mdx +1 -1
  30. package/src/components/regionalization/RegionalizationBar/RegionalizationBar.tsx +1 -1
  31. package/src/components/regionalization/RegionalizationButton/RegionalizationButton.tsx +1 -1
  32. package/src/components/regionalization/RegionalizationModal/RegionalizationModal.stories.mdx +17 -4
  33. package/src/components/regionalization/RegionalizationModal/RegionalizationModal.tsx +4 -5
  34. package/src/components/regionalization/RegionalizationModal/RegionalizationModalContent.tsx +19 -26
  35. package/src/components/regionalization/RegionalizationModal/regionalization-modal-body.module.scss +25 -0
  36. package/src/components/search/Filter/Facets.stories.mdx +1 -1
  37. package/src/components/search/Filter/Filter.stories.mdx +1 -1
  38. package/src/components/search/Filter/Filter.tsx +1 -1
  39. package/src/components/search/Filter/FilterSlider.stories.mdx +1 -1
  40. package/src/components/search/Filter/FilterSlider.tsx +2 -2
  41. package/src/components/sections/Newsletter/Newsletter.stories.mdx +1 -1
  42. package/src/components/sections/Newsletter/Newsletter.tsx +1 -1
  43. package/src/components/sections/ProductDetails/ProductDetails.tsx +2 -2
  44. package/src/components/sections/ProductGallery/ProductGallery.tsx +18 -18
  45. package/src/components/sections/ProductShelf/ProductShelf.tsx +10 -2
  46. package/src/components/sections/ProductTiles/ProductTiles.tsx +2 -2
  47. package/src/components/skeletons/FilterSkeleton/FilterSkeleton.stories.mdx +1 -1
  48. package/src/components/skeletons/FilterSkeleton/FilterSkeleton.tsx +20 -8
  49. package/src/components/skeletons/FilterSkeleton/filter-skeleton.module.scss +2 -2
  50. package/src/components/skeletons/ProductCardSkeleton/ProductCardSkeleton.stories.mdx +6 -69
  51. package/src/components/skeletons/ProductCardSkeleton/ProductCardSkeleton.tsx +36 -9
  52. package/src/components/skeletons/ProductCardSkeleton/product-card-skeleton.module.scss +16 -55
  53. package/src/components/skeletons/ProductGridSkeleton/ProductGridSkeleton.tsx +3 -1
  54. package/src/components/skeletons/ProductShelfSkeleton/ProductShelfSkeleton.tsx +3 -1
  55. package/src/components/skeletons/ProductTilesSkeleton/ProductTileSkeleton/ProductTileSkeleton.tsx +18 -17
  56. package/src/components/skeletons/ProductTilesSkeleton/ProductTileSkeleton/product-tile-skeleton.module.scss +37 -174
  57. package/src/components/skeletons/ProductTilesSkeleton/ProductTilesSkeleton.tsx +18 -3
  58. package/src/components/ui/Gift/Gift.tsx +12 -15
  59. package/src/components/ui/SlideOver/SlideOver.stories.mdx +2 -2
  60. package/src/components/ui/SlideOver/SlideOver.tsx +1 -0
  61. package/src/components/ui/Tiles/Tiles.stories.mdx +1 -3
  62. package/src/components/ui/Tiles/tiles.module.scss +11 -13
  63. package/src/components/ui/Toast/Toast.stories.mdx +1 -1
  64. package/src/components/ui/Toast/Toast.tsx +1 -1
  65. package/src/pages/_app.tsx +1 -1
  66. package/src/sdk/cart/index.ts +5 -0
  67. package/src/sdk/cart/useBuyButton.ts +1 -1
  68. package/src/sdk/cart/useCartToggleButton.ts +1 -1
  69. package/src/styles/vendors/include-media.scss +1 -1
  70. package/tsconfig.json +3 -5
  71. package/.eslintrc.json +0 -3
  72. package/.github/CODEOWNERS +0 -2
  73. package/.github/workflows/release.yml +0 -42
  74. package/.release-it.json +0 -32
  75. package/src/components/cart/CartItem/cart-item.module.scss +0 -68
  76. package/src/components/product/ProductCard/product-card.module.scss +0 -254
  77. package/src/components/regionalization/RegionalizationModal/regionalization-modal-content.module.scss +0 -79
  78. package/src/components/skeletons/Shimmer/Shimmer.tsx +0 -11
  79. package/src/components/skeletons/Shimmer/index.ts +0 -1
  80. package/src/components/skeletons/Shimmer/shimmer.module.scss +0 -43
  81. package/src/components/skeletons/Skeleton/Skeleton.tsx +0 -49
  82. package/src/components/skeletons/Skeleton/index.ts +0 -1
  83. package/src/components/skeletons/Skeleton/skeleton.module.scss +0 -77
  84. package/src/components/skeletons/Skeletons.stories.mdx +0 -177
  85. package/src/components/ui/Modal/Modal.stories.mdx +0 -144
  86. package/src/components/ui/Modal/Modal.tsx +0 -43
  87. package/src/components/ui/Modal/index.ts +0 -1
  88. package/src/components/ui/Modal/modal.module.scss +0 -46
  89. package/src/components/ui/ProductTitle/ProductTitle.stories.mdx +0 -105
  90. package/src/components/ui/ProductTitle/ProductTitle.tsx +0 -11
  91. package/src/components/ui/ProductTitle/index.ts +0 -1
  92. package/src/components/ui/ProductTitle/product-title.module.scss +0 -48
  93. package/src/sdk/ui/Provider.tsx +0 -151
  94. package/src/sdk/ui/useFadeEffect.ts +0 -21
@@ -5,37 +5,11 @@
5
5
  // Design Tokens for Product Tile Skeleton
6
6
  // --------------------------------------------------------
7
7
 
8
- // Image
9
- --fs-product-tile-skeleton-image-height-mobile : 60%;
10
- --fs-product-tile-skeleton-image-min-height-mobile : var(--fs-product-tile-skeleton-image-height-mobile);
11
- --fs-product-tile-skeleton-image-height-tablet : 70%;
12
- --fs-product-tile-skeleton-image-min-height-tablet : var(--fs-product-tile-skeleton-image-height-tablet);
13
- --fs-product-tile-skeleton-image-height-desktop : 80%;
14
- --fs-product-tile-skeleton-image-min-height-desktop : var(--fs-product-tile-skeleton-image-height-desktop);
15
- --fs-product-tile-skeleton-image-border-radius : var(--fs-border-radius) var(--fs-border-radius) 0 0;
8
+ // Default properties
9
+ --fs-product-tile-skeleton-gap : var(--fs-spacing-1);
16
10
 
17
11
  // Content
18
- --fs-product-tile-skeleton-content-height-mobile : 40%;
19
- --fs-product-tile-skeleton-content-height-tablet : 30%;
20
- --fs-product-tile-skeleton-content-height-desktop : 20%;
21
12
  --fs-product-tile-skeleton-content-padding : var(--fs-spacing-3);
22
- --fs-product-tile-skeleton-content-border-bottom-left-radius : var(--fs-border-radius);
23
- --fs-product-tile-skeleton-content-border-bottom-right-radius : var(--fs-product-tile-skeleton-content-border-bottom-left-radius);
24
-
25
- // Text
26
- --fs-product-tile-skeleton-text-width-mobile : 70%;
27
- --fs-product-tile-skeleton-text-width-tablet : 50%;
28
- --fs-product-tile-skeleton-text-width-desktop : 60%;
29
- --fs-product-tile-skeleton-text-margin-bottom : var(--fs-spacing-1);
30
-
31
- // Price
32
- --fs-product-tile-skeleton-price-width-mobile : 60%;
33
- --fs-product-tile-skeleton-price-width-tablet : 100%;
34
-
35
- // Badge
36
- --fs-product-tile-skeleton-badge-width-mobile : 20%;
37
- --fs-product-tile-skeleton-badge-width-tablet : var(--fs-product-tile-skeleton-badge-width-mobile);
38
- --fs-product-tile-skeleton-badge-position-right : var(--fs-product-tile-skeleton-text-margin-bottom);
39
13
 
40
14
  // Wide
41
15
  --fs-product-tile-skeleton-wide-padding : var(--fs-spacing-2) var(--fs-spacing-3) var(--fs-spacing-3);
@@ -46,173 +20,62 @@
46
20
  // --------------------------------------------------------
47
21
 
48
22
  position: relative;
23
+ display: flex;
24
+ flex-direction: column;
49
25
  width: 100%;
50
26
  height: 100%;
51
27
  padding: 0;
52
28
  overflow: hidden;
53
29
 
54
- &[data-fs-product-tile-skeleton-index="1"] {
55
- min-width: 9rem;
56
- height: 24rem;
57
-
58
- @include media(">=tablet") { height: 28rem; }
30
+ @include media(">=tablet") {
31
+ display: grid;
32
+ grid-auto-rows: 62% auto;
33
+ [data-fs-product-card-image] { height: 100%; }
59
34
  }
60
35
 
61
- [data-fs-product-tile-skeleton-image] {
62
- height: var(--fs-product-tile-skeleton-image-height-mobile);
63
- min-height: var(--fs-product-tile-skeleton-image-min-height-mobile);
64
- border-radius: var(--fs-product-tile-skeleton-image-border-radius);
65
-
66
- @include media(">=tablet") {
67
- height: var(--fs-product-tile-skeleton-image-height-tablet);
68
- min-height: var(--fs-product-tile-skeleton-image-min-height-tablet);
69
- }
70
-
71
- @include media(">=notebook") {
72
- height: var(--fs-product-tile-skeleton-image-height-desktop);
73
- min-height: var(--fs-product-tile-skeleton-image-min-height-desktop);
74
- }
75
-
76
- &[data-fs-product-tile-skeleton-index="1"] {
77
- height: 80%;
78
-
79
- @include media(">=tablet") {
80
- height: 70%;
81
- min-height: 70%;
82
- }
83
-
84
- @include media(">=notebook") {
85
- height: 80%;
86
- min-height: 80%;
87
- }
88
- }
89
-
90
- [data-fs-skeleton-wrapper] { height: 100%; }
91
-
92
- [data-fs-skeleton-variant="image"] {
93
- width: 100%;
94
- height: 100%;
95
- border-bottom-right-radius: 0;
96
- border-bottom-left-radius: 0;
97
- }
98
- }
36
+ @include media(">=notebook") { grid-auto-rows: 80% auto; }
99
37
 
100
38
  [data-fs-product-tile-skeleton-content] {
101
39
  display: flex;
102
- flex-direction: row;
103
- align-items: flex-start;
104
- height: var(--fs-product-tile-skeleton-content-height-mobile);
40
+ flex-direction: column;
41
+ row-gap: var(--fs-product-tile-skeleton-gap);
105
42
  padding: var(--fs-product-tile-skeleton-content-padding);
106
- border-bottom-right-radius: var(--fs-product-tile-skeleton-content-border-bottom-right-radius);
107
- border-bottom-left-radius: var(--fs-product-tile-skeleton-content-border-bottom-left-radius);
108
-
109
- @include media(">=tablet") {
110
- flex-flow: row wrap;
111
- height: var(--fs-product-tile-skeleton-content-height-tablet);
112
- }
43
+ background-color: var(--fs-product-tile-skeleton-wide-bkg-color);
113
44
 
114
45
  @include media(">=notebook") {
115
- flex-flow: row wrap;
116
- height: var(--fs-product-tile-skeleton-content-height-desktop);
117
- }
118
-
119
- &[data-fs-product-tile-skeleton-index="1"] {
120
- height: 20%;
121
- padding: var(--fs-spacing-2) var(--fs-spacing-3);
122
-
123
- @include media(">=tablet") {
124
- flex-flow: row wrap;
125
- height: 30%;
126
- }
127
-
128
- @include media(">=notebook") { height: 20%; }
46
+ flex-direction: row;
47
+ justify-content: space-between;
48
+ height: 100%;
129
49
  }
50
+ }
130
51
 
131
- [data-fs-product-tile-skeleton-text] {
132
- width: var(--fs-product-tile-skeleton-text-width-mobile);
133
-
134
- @include media(">=tablet") {
135
- width: var(--fs-product-tile-skeleton-text-width-tablet);
136
-
137
- &[data-fs-product-tile-skeleton-index="2"],
138
- &[data-fs-product-tile-skeleton-index="3"] { width: 100%; }
139
- }
140
-
141
- @include media(">=notebook") {
142
- width: var(--fs-product-tile-skeleton-text-width-desktop);
143
-
144
- &[data-fs-product-tile-skeleton-index="2"],
145
- &[data-fs-product-tile-skeleton-index="3"] { width: 60%; }
146
- }
52
+ [data-fs-product-tile-skeleton-heading] {
53
+ display: flex;
54
+ flex-direction: column;
55
+ row-gap: var(--fs-product-tile-skeleton-gap);
56
+ width: 100%;
57
+ }
147
58
 
148
- [data-fs-skeleton-variant="text"] {
149
- margin-bottom: var(--fs-product-tile-skeleton-text-margin-bottom);
150
- }
59
+ [data-fs-product-tile-skeleton-badge] {
60
+ max-width: 100%;
61
+ }
151
62
 
152
- [data-fs-product-tile-skeleton-price] {
153
- width: var(--fs-product-tile-skeleton-price-width-mobile);
63
+ [data-fs-product-tile-skeleton-image] {
64
+ width: 100%;
65
+ aspect-ratio: var(--fs-product-tile-skeleton-image-aspect-ratio);
66
+ overflow: hidden;
154
67
 
155
- @include media(">=tablet") { width: var(--fs-product-tile-skeleton-price-width-tablet); }
156
- }
157
- }
68
+ [data-fs-skeleton-variant="image"] { border-radius: 0; }
158
69
 
159
- [data-fs-product-tile-skeleton-badge] {
160
- position: absolute;
161
- right: var(--fs-product-tile-skeleton-badge-position-right);
162
- width: var(--fs-product-tile-skeleton-badge-width-mobile);
163
-
164
- @include media(">=tablet") { width: var(--fs-product-tile-skeleton-badge-width-tablet); }
165
-
166
- &[data-fs-product-tile-skeleton-index="2"],
167
- &[data-fs-product-tile-skeleton-index="3"] {
168
- bottom: var(--fs-spacing-2);
169
- left: var(--fs-spacing-3);
170
- width: 30%;
171
-
172
- @include media(">=tablet") {
173
- position: relative;
174
- bottom: 0;
175
- left: var(--fs-spacing-2);
176
- width: 50%;
177
- }
178
-
179
- @include media(">=notebook") {
180
- position: absolute;
181
- right: var(--fs-spacing-1);
182
- bottom: unset;
183
- left: unset;
184
- width: 30%;
185
- }
186
- }
187
-
188
- [data-fs-skeleton-variant="badge"] {
189
- width: 100%;
190
- height: var(--fs-spacing-4);
191
-
192
- @include media(">=tablet") {
193
- position: absolute;
194
- right: var(--fs-spacing-1);
195
- }
196
-
197
- @include media(">=notebook") {
198
- position: relative;
199
- right: var(--fs-spacing-0);
200
- }
201
- }
202
- }
70
+ @include media(">=tablet") { height: 100%; }
203
71
  }
204
72
 
205
- // --------------------------------------------------------
206
- // Variants Styles
207
- // --------------------------------------------------------
208
-
209
- &[data-fs-product-tile-skeleton-variant="wide"] {
210
- [data-fs-product-tile-skeleton-content] {
211
- background-color: var(--fs-product-tile-skeleton-wide-bkg-color);
212
-
213
- @include media(">=tablet") {
214
- padding: var(--fs-product-tile-skeleton-wide-padding);
215
- }
73
+ [data-fs-product-tile-skeleton-image],
74
+ [data-fs-product-tile-skeleton-badge] {
75
+ [data-fs-skeleton-wrapper],
76
+ [data-fs-skeleton] {
77
+ width: 100%;
78
+ height: 100%;
216
79
  }
217
80
  }
218
81
  }
@@ -6,22 +6,37 @@ import { ProductTileSkeleton } from '.'
6
6
 
7
7
  // TODO: // Replace it when items number become dynamically defined
8
8
  const DEFAULT_ITEMS_NUMBER = 3
9
+ const DEFAULT_ITEMS_NUMBER_TWO = 2
10
+
11
+ const getRatio = (products: number, idx: number) => {
12
+ const expandsFirstTile = products === DEFAULT_ITEMS_NUMBER && idx === 0
13
+
14
+ const expandsFirstTwoTile =
15
+ products === DEFAULT_ITEMS_NUMBER_TWO && (idx === 0 || idx === 1)
16
+
17
+ if (expandsFirstTile || expandsFirstTwoTile) {
18
+ return 5 / 3
19
+ }
20
+
21
+ return 3 / 4
22
+ }
9
23
 
10
24
  interface ProductTilesSkeletonProps {
11
25
  loading?: boolean
12
- variant?: 'wide' | 'default'
13
26
  }
14
27
 
15
28
  function ProductTilesSkeleton({
16
29
  children,
17
30
  loading = true,
18
- variant = 'default',
19
31
  }: PropsWithChildren<ProductTilesSkeletonProps>) {
20
32
  return loading ? (
21
33
  <Tiles>
22
34
  {Array.from({ length: DEFAULT_ITEMS_NUMBER }, (_, index) => (
23
35
  <Tile key={String(index)}>
24
- <ProductTileSkeleton index={index + 1} variant={variant} />
36
+ <ProductTileSkeleton
37
+ index={index + 1}
38
+ aspectRatio={getRatio(DEFAULT_ITEMS_NUMBER, index)}
39
+ />
25
40
  </Tile>
26
41
  ))}
27
42
  </Tiles>
@@ -6,17 +6,17 @@ import {
6
6
  GiftImage as UIGiftImage,
7
7
  } from '@faststore/ui'
8
8
 
9
- import type { ProductSummary_ProductFragment } from '@generated/graphql'
10
9
  import Icon from 'src/components/ui/Icon'
11
10
  import { Image } from 'src/components/ui/Image'
12
11
  import Price from 'src/components/ui/Price'
13
12
  import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
13
+ import type { CartItem as ICartItem } from 'src/sdk/cart'
14
14
 
15
15
  export type Props = GiftProps & {
16
16
  /**
17
17
  * Product to be showed as `Gift`.
18
18
  */
19
- product: ProductSummary_ProductFragment
19
+ item: ICartItem
20
20
  /**
21
21
  * Additional message in the title
22
22
  */
@@ -28,34 +28,31 @@ export type Props = GiftProps & {
28
28
  }
29
29
 
30
30
  function Gift({
31
- product,
31
+ item,
32
32
  titleMessage = 'Get a',
33
33
  badgeLabel = 'Free',
34
34
  ...otherProps
35
35
  }: Props) {
36
- const {
37
- isVariantOf,
38
- image: [img],
39
- offers: {
40
- offers: [{ listPrice }],
41
- },
42
- } = product
43
-
44
36
  return (
45
37
  <UIGift icon={<Icon name="Tag" width={18} height={18} />} {...otherProps}>
46
38
  <UIGiftImage>
47
- <Image src={img.url} alt={img.alternateName} width={89} height={89} />
39
+ <Image
40
+ src={item.itemOffered.image[0].url}
41
+ alt={item.itemOffered.image[0].alternateName}
42
+ width={89}
43
+ height={89}
44
+ />
48
45
  </UIGiftImage>
49
46
  <UIGiftContent>
50
47
  <h3 data-fs-gift-product-title>
51
- {titleMessage} {isVariantOf.name}
48
+ {titleMessage} {item.itemOffered.isVariantOf.name}
52
49
  </h3>
53
50
  <span data-fs-gift-product-summary>
54
51
  <Price
55
- value={listPrice}
52
+ value={item.price}
56
53
  formatter={useFormattedPrice}
57
54
  testId="list-price"
58
- data-value={listPrice}
55
+ data-value={item.price}
59
56
  variant="listing"
60
57
  classes="text__legend"
61
58
  SRText="Original price:"
@@ -1,8 +1,8 @@
1
1
  import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
2
2
 
3
3
  import { SearchProvider, useSearch } from '@faststore/sdk'
4
- import UIProvider, { useUI } from 'src/sdk/ui/Provider'
5
- import { useFadeEffect } from 'src/sdk/ui/useFadeEffect'
4
+ import { UIProvider, useUI } from '@faststore/ui'
5
+ import { useFadeEffect } from '@faststore/ui'
6
6
  import { useCart } from 'src/sdk/cart'
7
7
 
8
8
  import { NavbarSlider } from 'src/components/common/Navbar'
@@ -44,6 +44,7 @@ function SlideOver({
44
44
  <UIModal
45
45
  className={`${styles.fsSlideOver} ${className}`}
46
46
  isOpen={isOpen}
47
+ data-fs-modal={null}
47
48
  data-fs-slide-over
48
49
  data-fs-slide-over-direction={direction}
49
50
  data-fs-slide-over-size={size}
@@ -132,7 +132,7 @@ of items to be displayed, the tiles will be arranged differently.
132
132
 
133
133
  <TokenTable>
134
134
  <TokenRow token="--fs-tiles-gap-mobile" value="var(--fs-grid-gap-2)" />
135
- <TokenRow token="--fs-tiles-gap-tablet" value="var(--fs-grid-gap-3)" />
135
+ <TokenRow token="--fs-tiles-gap-notebook" value="var(--fs-grid-gap-3)" />
136
136
  </TokenTable>
137
137
 
138
138
  ---
@@ -143,8 +143,6 @@ of items to be displayed, the tiles will be arranged differently.
143
143
 
144
144
  <TokenTable>
145
145
  <TokenRow token="--fs-tiles-tile-min-width" value="9rem" />
146
- <TokenRow token="--fs-tiles-tile-height-mobile" value="24rem" />
147
- <TokenRow token="--fs-tiles-tile-height-tablet" value="28rem" />
148
146
  <TokenDivider />
149
147
  <TokenRow
150
148
  token="--fs-tiles-tile-border-radius"
@@ -7,12 +7,10 @@
7
7
 
8
8
  // Default properties
9
9
  --fs-tiles-gap-mobile : var(--fs-grid-gap-2);
10
- --fs-tiles-gap-tablet : var(--fs-grid-gap-3);
10
+ --fs-tiles-gap-notebook : var(--fs-grid-gap-3);
11
11
 
12
12
  // Tile
13
13
  --fs-tiles-tile-min-width : 9rem;
14
- --fs-tiles-tile-height-mobile : 24rem;
15
- --fs-tiles-tile-height-tablet : 28rem;
16
14
  --fs-tiles-tile-border-radius : var(--fs-border-radius);
17
15
 
18
16
  // --------------------------------------------------------
@@ -20,37 +18,37 @@
20
18
  // --------------------------------------------------------
21
19
 
22
20
  display: grid;
23
- grid-template-rows: repeat(2, 1fr);
24
21
  grid-template-columns: repeat(2, 1fr);
25
22
  row-gap: var(--fs-tiles-gap-mobile);
26
23
  column-gap: var(--fs-tiles-gap-mobile);
27
24
 
28
25
  @include media(">=tablet") {
29
- grid-template-rows: repeat(1, 1fr);
30
26
  grid-template-columns: repeat(4, 1fr);
31
- column-gap: var(--fs-tiles-gap-tablet);
32
27
  }
33
28
 
29
+ @include media(">=notebook") { column-gap: var(--fs-tiles-gap-notebook); }
30
+
34
31
  [data-fs-tile] {
35
32
  min-width: var(--fs-tiles-tile-min-width);
36
- height: var(--fs-tiles-tile-height-mobile);
37
33
 
38
34
  > * {
39
35
  overflow: hidden;
40
36
  border-radius: var(--fs-tiles-tile-border-radius);
41
- }
42
37
 
43
- @include media(">=tablet") { height: var(--fs-tiles-tile-height-tablet); }
38
+ @include media(">=tablet") {
39
+ display: grid;
40
+ grid-auto-rows: 62% auto;
41
+ [data-fs-product-card-image] { height: 100%; }
42
+ }
43
+
44
+ @include media(">=notebook") { grid-auto-rows: 80% auto; }
45
+ }
44
46
  }
45
47
 
46
48
  // --------------------------------------------------------
47
49
  // Variants Styles
48
50
  // --------------------------------------------------------
49
51
 
50
- &[data-fs-tiles-variant="expanded-first"], &[data-fs-tiles-variant="expanded-first-two"] {
51
- grid-template-rows: auto 1fr;
52
- }
53
-
54
52
  &[data-fs-tiles-variant="expanded-first"] > [data-fs-tile]:first-child,
55
53
  &[data-fs-tiles-variant="expanded-first-two"] > [data-fs-tile]:first-child,
56
54
  &[data-fs-tiles-variant="expanded-first-two"] > [data-fs-tile]:nth-child(2) {
@@ -5,7 +5,7 @@ import {
5
5
  TokenDivider,
6
6
  } from 'src/../.storybook/components'
7
7
 
8
- import UIProvider, { useUI } from 'src/sdk/ui/Provider'
8
+ import { UIProvider, useUI } from '@faststore/ui'
9
9
 
10
10
  import Toast from '.'
11
11
  import { Button } from '@faststore/ui'
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useRef, useState } from 'react'
2
2
 
3
3
  import Icon from 'src/components/ui/Icon'
4
- import { useUI } from 'src/sdk/ui/Provider'
4
+ import { useUI } from '@faststore/ui'
5
5
 
6
6
  import styles from './toast.module.scss'
7
7
 
@@ -11,7 +11,7 @@ import type { AppProps } from 'next/app'
11
11
  import Layout from 'src/Layout'
12
12
  import AnalyticsHandler from 'src/sdk/analytics'
13
13
  import ErrorBoundary from 'src/sdk/error/ErrorBoundary'
14
- import UIProvider from 'src/sdk/ui/Provider'
14
+ import { UIProvider } from '@faststore/ui'
15
15
 
16
16
  function App({ Component, pageProps }: AppProps) {
17
17
  return (
@@ -66,6 +66,11 @@ export const ValidateCartMutation = gql`
66
66
  isVariantOf {
67
67
  productGroupID
68
68
  name
69
+ skuVariants {
70
+ activeVariations
71
+ slugsMap(dominantVariantName: "Color")
72
+ availableVariations(dominantVariantName: "Color")
73
+ }
69
74
  }
70
75
  gtin
71
76
  additionalProperty {
@@ -6,7 +6,7 @@ import type { AnalyticsItem } from 'src/sdk/analytics/types'
6
6
  import type { CartItem } from 'src/sdk/cart'
7
7
 
8
8
  import { useSession } from '../session'
9
- import { useUI } from '../ui/Provider'
9
+ import { useUI } from '@faststore/ui'
10
10
  import { cartStore } from './index'
11
11
 
12
12
  export const useBuyButton = (item: CartItem | null) => {
@@ -1,6 +1,6 @@
1
1
  import { useCallback } from 'react'
2
2
 
3
- import { useUI } from '../ui/Provider'
3
+ import { useUI } from '@faststore/ui'
4
4
  import { useCart } from './index'
5
5
 
6
6
  export const useCartToggleButton = () => {
@@ -1,4 +1,4 @@
1
1
  // Include Media //////////////////////////
2
2
 
3
- @import "../../../node_modules/include-media/dist/include-media";
3
+ @import "~include-media/dist/include-media";
4
4
  @import "include-media_overwrite";
package/tsconfig.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
+ "extends": "@faststore/shared/tsconfig.json",
2
3
  "compilerOptions": {
3
- "allowSyntheticDefaultImports": true,
4
+ "declaration": false,
4
5
  "moduleResolution": "node",
5
6
  "jsx": "preserve",
6
7
  "jsxImportSource": "react",
@@ -14,14 +15,11 @@
14
15
  "src/*": ["src/*"],
15
16
  "@generated/*": ["@generated/*"]
16
17
  },
17
- "forceConsistentCasingInFileNames": true,
18
18
  "strict": false,
19
19
  "incremental": true,
20
20
  "isolatedModules": true,
21
21
  "target": "es5",
22
- "lib": ["dom", "dom.iterable", "esnext"],
23
- "skipLibCheck": true,
24
- "esModuleInterop": true
22
+ "lib": ["dom", "dom.iterable", "esnext"]
25
23
  },
26
24
  "include": ["*.d.ts", "src/**/*.ts", "src/**/*.tsx", "@generated/**/*.ts"],
27
25
  "exclude": ["node_modules", "public", "src/components/search/searchMock.ts"]
package/.eslintrc.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "next/core-web-vitals"
3
- }
@@ -1,2 +0,0 @@
1
- # Make @vtex-sites/cms-schema default reviewer for all schema changes for CMS
2
- src/@vtex/gatsby-plugin-cms/ @vtex-sites/cms-schema
@@ -1,42 +0,0 @@
1
- # This Action should run on main branch and verify lint, test, and then publish the version on npm
2
- name: CD
3
-
4
- on:
5
- push:
6
- branches:
7
- - evergreen
8
-
9
- jobs:
10
- release:
11
- name: Release
12
- timeout-minutes: 5
13
- runs-on: ubuntu-latest
14
- if: github.repository == 'vtex-sites/nextjs.store' && !startsWith(github.event.head_commit.message, 'chore(release):')
15
-
16
-
17
- steps:
18
- - name: Check out code
19
- uses: actions/checkout@v2
20
- with:
21
- token: ${{ secrets.VTEX_GITHUB_BOT_TOKEN }}
22
- fetch-depth: 2
23
-
24
- - name: Setup Node.js environment
25
- uses: actions/setup-node@v2
26
- with:
27
- node-version: 16
28
- cache: 'yarn'
29
- registry-url: 'https://registry.npmjs.org'
30
-
31
- - name: Configure CI Git User
32
- run: |
33
- git config user.name vtexgithubbot
34
- git config user.email vtexgithubbot@github.com
35
-
36
- - name: Install dependencies
37
- run: yarn install --verbose
38
-
39
- - name: Release
40
- run: npm run release
41
- env:
42
- NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
package/.release-it.json DELETED
@@ -1,32 +0,0 @@
1
- {
2
- "git": {
3
- "commitMessage": "chore(release): ${version}"
4
- },
5
- "npm": {
6
- "publish": true,
7
- "skipChecks": true
8
- },
9
- "publishConfig": {
10
- "access": "public",
11
- "registry": "registry.npmjs.org"
12
- },
13
- "plugins": {
14
- "@release-it/conventional-changelog": {
15
- "preset": {
16
- "name": "conventionalcommits",
17
- "types": [
18
- { "type": "feat", "section": "Features" },
19
- { "type": "fix", "section": "Bug Fixes" },
20
- { "type": "chore", "section": "Chores" },
21
- { "type": "docs", "section": "Documentation" },
22
- { "type": "style", "section": "Style changes" },
23
- { "type": "refactor", "section": "Refactoring" },
24
- { "type": "perf", "section": "Performance" },
25
- { "type": "test", "section": "Tests" }
26
- ]
27
- },
28
- "infile": "CHANGELOG.md",
29
- "header": "# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Conventional Changelog](https://github.com/conventional-changelog/conventional-changelog),\nand this project adheres to [Calendar Versioning](https://calver.org/)."
30
- }
31
- }
32
- }