@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
package/README.md CHANGED
@@ -63,7 +63,7 @@ As of Sep, 2022, this starter is still far from covering most basic cases found
63
63
  Navigate into your new site’s directory and start it up.
64
64
 
65
65
  ```shell
66
- yarn develop
66
+ yarn dev
67
67
  ```
68
68
 
69
69
  4. **Open the source code and start editing!**
@@ -382,7 +382,7 @@ We use [graphql-codegen](https://www.graphql-code-generator.com/) to pre-process
382
382
  This means we can statically analyse your code in search of bugs and secure your graphql server before each deploy. If, however you need to change any GraphQL Fragment, Query or Mutation, you will need to regenerate the whole thing. To do this, open your terminal and type
383
383
 
384
384
  ```sh
385
- $ yarn develop
385
+ $ yarn dev
386
386
  ```
387
387
 
388
388
  Now, after the nextjs development server is up and running, open another terminal and run
@@ -104,7 +104,7 @@ describe('add_to_cart event', () => {
104
104
  testAddToCartEvent({ skuId, numberOfEvents: 1 })
105
105
 
106
106
  cy.get(
107
- '[data-testid=cart-item] [data-testid=fs-quantity-selector-right-button]'
107
+ '[data-testid=fs-cart-item] [data-testid=fs-quantity-selector-right-button]'
108
108
  )
109
109
  .click()
110
110
  .then(() => {
@@ -209,7 +209,7 @@ describe('remove_from_cart event', () => {
209
209
 
210
210
  // Remove the added item
211
211
  cy.get(
212
- '[data-testid=cart-item] [data-testid=fs-quantity-selector-left-button]'
212
+ '[data-testid=fs-cart-item] [data-testid=fs-quantity-selector-left-button]'
213
213
  )
214
214
  .click()
215
215
  .then(() => {
@@ -254,7 +254,7 @@ describe('select_item event', () => {
254
254
 
255
255
  let skuId
256
256
 
257
- cy.getById('store-product-card').first().click()
257
+ cy.getById('fs-product-card').first().click()
258
258
  cy.getById('buy-button')
259
259
  .should('be.visible')
260
260
  .scrollIntoView({ duration: 500 })
@@ -67,7 +67,7 @@ describe('On product description pages', () => {
67
67
  .should('be.visible')
68
68
  .should('be.enabled')
69
69
 
70
- cy.getById('cart-item').should(($item) => {
70
+ cy.getById('fs-cart-item').should(($item) => {
71
71
  expect($item.attr('data-sku')).to.eq(skuId)
72
72
  expect($item.attr('data-seller')).to.eq(sellerId)
73
73
  })
@@ -93,7 +93,7 @@ describe('On product description pages', () => {
93
93
  cy.itemsInCart(1)
94
94
 
95
95
  cy.getById('remove-from-cart-button').click()
96
- cy.getById('cart-item').should('not.exist')
96
+ cy.getById('fs-cart-item').should('not.exist')
97
97
  cy.getById('checkout-button').should('not.exist')
98
98
 
99
99
  cy.itemsInCart(0)
@@ -117,7 +117,7 @@ describe('Infinite Scroll pagination', () => {
117
117
  cy.waitForHydration()
118
118
 
119
119
  cy.getById('product-gallery').within(() => {
120
- cy.getById('store-product-card')
120
+ cy.getById('fs-product-card')
121
121
  .should('exist')
122
122
  .should('have.length.gt', 0)
123
123
  .then(($links) => {
@@ -127,7 +127,7 @@ describe('Infinite Scroll pagination', () => {
127
127
  .should('exist')
128
128
  .click()
129
129
  .then(() => {
130
- cy.getById('store-product-card')
130
+ cy.getById('fs-product-card')
131
131
  .should('have.length.gte', before)
132
132
  .then(($products) => {
133
133
  const after = $products.length
@@ -143,7 +143,7 @@ describe('Infinite Scroll pagination', () => {
143
143
  cy.visit(pages.collection, options)
144
144
  cy.waitForHydration()
145
145
 
146
- cy.get('[data-testid=product-gallery] [data-testid=store-product-card]')
146
+ cy.get('[data-testid=product-gallery] [data-testid=fs-product-card]')
147
147
  .should('exist')
148
148
  .should('have.length.gt', 0)
149
149
  .then(($links) => {
@@ -154,12 +154,12 @@ describe('Infinite Scroll pagination', () => {
154
154
  .should('exist')
155
155
  .click()
156
156
  // Go up the page
157
- .get('[data-testid=product-gallery] [data-testid=store-product-card]')
157
+ .get('[data-testid=product-gallery] [data-testid=fs-product-card]')
158
158
  .first()
159
159
  .scrollIntoView({ duration: 1000 })
160
160
 
161
161
  // Go down the page
162
- .get('[data-testid=product-gallery] [data-testid=store-product-card]')
162
+ .get('[data-testid=product-gallery] [data-testid=fs-product-card]')
163
163
  .last()
164
164
  .scrollIntoView({ duration: 1000 })
165
165
  .then(() => {
@@ -170,7 +170,7 @@ describe('Infinite Scroll pagination', () => {
170
170
  let skuIdBeforeNavigate
171
171
 
172
172
  cy.get(
173
- '[data-testid=product-gallery] [data-testid=store-product-card]'
173
+ '[data-testid=product-gallery] [data-testid=fs-product-card]'
174
174
  )
175
175
  // Number of products after showMore is clicked should be higher
176
176
  .should('have.length.gte', before)
@@ -188,7 +188,7 @@ describe('Infinite Scroll pagination', () => {
188
188
  .then(() => {
189
189
  cy.go('back')
190
190
  .get(
191
- '[data-testid=product-gallery] [data-testid=store-product-card]'
191
+ '[data-testid=product-gallery] [data-testid=fs-product-card]'
192
192
  )
193
193
  .last()
194
194
  .then(($card) => {
@@ -215,7 +215,7 @@ describe('Infinite Scroll pagination', () => {
215
215
  .location('search')
216
216
  .should('match', /page=0$/)
217
217
 
218
- cy.get('[data-testid=product-gallery] [data-testid=store-product-card]')
218
+ cy.get('[data-testid=product-gallery] [data-testid=fs-product-card]')
219
219
  .last()
220
220
  .scrollIntoView({ duration: 1000 })
221
221
  .location('search')
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "0.3.17",
3
+ "version": "2.0.65-alpha.0",
4
4
  "license": "MIT",
5
5
  "browserslist": "supports es6-module and not dead",
6
6
  "scripts": {
7
7
  "generate": "graphql-codegen",
8
8
  "build": "yarn partytown && next build",
9
- "develop": "yarn partytown && next dev",
9
+ "dev": "yarn partytown && next dev",
10
10
  "clean": "rm -r .next",
11
11
  "serve": "next start",
12
12
  "test": "cypress open",
@@ -18,8 +18,7 @@
18
18
  "postinstall": "node postinstall.js && (is-ci || husky install) || echo Skipped postinstall step for @faststore/core",
19
19
  "partytown": "partytown copylib ./public/~partytown",
20
20
  "storybook": "start-storybook --docs -p 6006",
21
- "build-storybook": "build-storybook",
22
- "release": "release-it --ci"
21
+ "build-storybook": "build-storybook"
23
22
  },
24
23
  "engines": {
25
24
  "node": ">=14"
@@ -31,10 +30,10 @@
31
30
  "@envelop/parser-cache": "^2.2.0",
32
31
  "@envelop/validation-cache": "^2.2.0",
33
32
  "@faststore/api": "^2.0.3-alpha.0",
34
- "@faststore/components": "^2.0.54-alpha.0",
33
+ "@faststore/components": "^2.0.65-alpha.0",
35
34
  "@faststore/graphql-utils": "^2.0.3-alpha.0",
36
35
  "@faststore/sdk": "^2.0.3-alpha.0",
37
- "@faststore/ui": "^2.0.54-alpha.0",
36
+ "@faststore/ui": "^2.0.65-alpha.0",
38
37
  "@types/react": "^18.0.14",
39
38
  "@vtex/client-cms": "^0.2.12",
40
39
  "autoprefixer": "^10.4.0",
@@ -59,6 +58,7 @@
59
58
  },
60
59
  "devDependencies": {
61
60
  "@cypress/code-coverage": "^3.9.10",
61
+ "@faststore/eslint-config": "*",
62
62
  "@faststore/lighthouse": "^1.12.32",
63
63
  "@graphql-codegen/cli": "^2.6.2",
64
64
  "@graphql-codegen/typescript": "^2.5.1",
@@ -81,13 +81,11 @@
81
81
  "cypress-wait-until": "^1.7.2",
82
82
  "dotenv": "^8.2.0",
83
83
  "eslint": "^7.32.0",
84
- "eslint-config-next": "^13.0.7",
85
84
  "husky": "^5.2.0",
86
85
  "is-ci": "^3.0.0",
87
86
  "lint-staged": "^10.5.4",
88
87
  "msw-storybook-addon": "^1.6.3",
89
88
  "prettier": "^2.2.0",
90
- "release-it": "^15.2.0",
91
89
  "stylelint": "^14.6.0",
92
90
  "stylelint-config-recess-order": "^3.0.0",
93
91
  "stylelint-config-standard": "^24.0.0",
@@ -109,5 +107,6 @@
109
107
  },
110
108
  "msw": {
111
109
  "workerDirectory": "public"
112
- }
110
+ },
111
+ "gitHead": "05c8f7f46e876406fcae355dbeff243bbf2e1e25"
113
112
  }
package/src/Layout.tsx CHANGED
@@ -6,8 +6,8 @@ import Footer from 'src/components/common/Footer'
6
6
  import Navbar from 'src/components/common/Navbar'
7
7
  import Toast from 'src/components/common/Toast'
8
8
  import RegionalizationBar from 'src/components/regionalization/RegionalizationBar'
9
- import { useUI } from 'src/sdk/ui/Provider'
10
9
  import Icon from 'src/components/ui/Icon'
10
+ import { useUI } from '@faststore/ui'
11
11
 
12
12
  const CartSidebar = lazy(() => import('src/components/cart/CartSidebar'))
13
13
  const RegionModal = lazy(
@@ -1,14 +1,8 @@
1
1
  import { sendAnalyticsEvent } from '@faststore/sdk'
2
2
  import {
3
3
  CartItem as UICartItem,
4
- CartItemActions as UICartItemActions,
5
- CartItemSummary as UICartItemSummary,
6
- CartItemTitle as UICartItemTitle,
7
- CartItemPrices as UICartItemPrices,
8
- CartItemContent as UICartItemContent,
9
4
  CartItemImage as UICartItemImage,
10
- Button as UIButton,
11
- QuantitySelector as UIQuantitySelector,
5
+ CartItemSummary as UICartItemSummary,
12
6
  } from '@faststore/ui'
13
7
  import { useCallback, useMemo } from 'react'
14
8
  import type {
@@ -17,18 +11,14 @@ import type {
17
11
  RemoveFromCartEvent,
18
12
  } from '@faststore/sdk'
19
13
 
20
- import Icon from 'src/components/ui/Icon'
21
14
  import { Image } from 'src/components/ui/Image'
22
- import Price from 'src/components/ui/Price'
23
15
  import { cartStore } from 'src/sdk/cart'
24
- import { useRemoveButton } from 'src/sdk/cart/useRemoveButton'
25
16
  import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
26
17
  import { useSession } from 'src/sdk/session'
18
+ import { useRemoveButton } from 'src/sdk/cart/useRemoveButton'
27
19
  import type { CartItem as ICartItem } from 'src/sdk/cart'
28
20
  import type { AnalyticsItem } from 'src/sdk/analytics/types'
29
21
 
30
- import styles from './cart-item.module.scss'
31
-
32
22
  function useCartItemEvent() {
33
23
  const {
34
24
  currency: { code },
@@ -72,10 +62,9 @@ function useCartItemEvent() {
72
62
 
73
63
  interface Props {
74
64
  item: ICartItem
75
- gift?: boolean
76
65
  }
77
66
 
78
- function CartItem({ item, gift = false }: Props) {
67
+ function CartItem({ item }: Props) {
79
68
  const btnProps = useRemoveButton(item)
80
69
 
81
70
  const { sendCartItemEvent } = useCartItemEvent()
@@ -89,68 +78,38 @@ function CartItem({ item, gift = false }: Props) {
89
78
  [item, sendCartItemEvent]
90
79
  )
91
80
 
81
+ const skuActiveVariants =
82
+ item.itemOffered.isVariantOf.skuVariants.activeVariations
83
+ const activeVariations = Object.keys(skuActiveVariants).map((key) => ({
84
+ label: key,
85
+ option: skuActiveVariants[key],
86
+ }))
87
+
92
88
  return (
93
89
  <UICartItem
94
- className={styles.fsCartItem}
95
- data-testid="cart-item"
90
+ price={{
91
+ value: item.price,
92
+ listPrice: item.listPrice,
93
+ formatter: useFormattedPrice,
94
+ }}
95
+ quantity={item.quantity}
96
+ onQuantityChange={onQuantityChange}
97
+ removeBtnProps={btnProps}
96
98
  data-sku={item.itemOffered.sku}
97
99
  data-seller={item.seller.identifier}
98
100
  >
99
- <UICartItemContent>
100
- <UICartItemImage>
101
- <Image
102
- src={item.itemOffered.image[0].url}
103
- alt={item.itemOffered.image[0].alternateName}
104
- width={72}
105
- height={72}
106
- />
107
- </UICartItemImage>
108
- <UICartItemSummary>
109
- <UICartItemTitle className="text__body">
110
- {item.itemOffered.isVariantOf.name}
111
- </UICartItemTitle>
112
- {!gift && (
113
- <UICartItemPrices>
114
- <Price
115
- value={item.listPrice}
116
- formatter={useFormattedPrice}
117
- testId="list-price"
118
- data-value={item.listPrice}
119
- variant="listing"
120
- classes="text__legend"
121
- SRText="Original price:"
122
- />
123
- <Price
124
- value={item.price}
125
- formatter={useFormattedPrice}
126
- testId="price"
127
- data-value={item.price}
128
- variant="spot"
129
- classes="text__title-subsection"
130
- SRText="Price:"
131
- />
132
- </UICartItemPrices>
133
- )}
134
- </UICartItemSummary>
135
- </UICartItemContent>
136
-
137
- {!gift && (
138
- <UICartItemActions>
139
- <UIButton
140
- icon={<Icon name="XCircle" width={18} height={18} />}
141
- iconPosition="left"
142
- variant="tertiary"
143
- {...btnProps}
144
- >
145
- Remove
146
- </UIButton>
147
- <UIQuantitySelector
148
- min={1}
149
- initial={item.quantity}
150
- onChange={onQuantityChange}
151
- />
152
- </UICartItemActions>
153
- )}
101
+ <UICartItemImage>
102
+ <Image
103
+ src={item.itemOffered.image[0].url}
104
+ alt={item.itemOffered.image[0].alternateName}
105
+ width={56}
106
+ height={56}
107
+ />
108
+ </UICartItemImage>
109
+ <UICartItemSummary
110
+ title={item.itemOffered.isVariantOf.name}
111
+ activeVariations={activeVariations}
112
+ />
154
113
  </UICartItem>
155
114
  )
156
115
  }
@@ -1,6 +1,6 @@
1
1
  import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
2
2
 
3
- import UIProvider, { useUI } from 'src/sdk/ui/Provider'
3
+ import { UIProvider, useUI } from '@faststore/ui'
4
4
  import { useCart } from 'src/sdk/cart'
5
5
 
6
6
  import CartToggle from 'src/components/cart/CartToggle'
@@ -15,10 +15,11 @@ import SlideOver from 'src/components/ui/SlideOver'
15
15
  import { useCart } from 'src/sdk/cart'
16
16
  import { useCheckoutButton } from 'src/sdk/cart/useCheckoutButton'
17
17
  import { useSession } from 'src/sdk/session'
18
- import { useUI } from 'src/sdk/ui/Provider'
19
- import { useFadeEffect } from 'src/sdk/ui/useFadeEffect'
18
+ import { useUI } from '@faststore/ui'
19
+ import { useFadeEffect } from '@faststore/ui'
20
20
 
21
21
  import CartItem from '../CartItem'
22
+ import Gift from '../../ui/Gift'
22
23
  import EmptyCart from '../EmptyCart'
23
24
  import OrderSummary from '../OrderSummary'
24
25
  import styles from './cart-sidebar.module.scss'
@@ -96,20 +97,16 @@ function CartSidebar() {
96
97
  <CartItem item={item} />
97
98
  </li>
98
99
  ))}
99
- </UIList>
100
-
101
- {gifts.length > 0 && (
102
- <>
103
- <UIAlert icon={<Icon name="Gift" />}>Gifts</UIAlert>
104
- <UIList data-fs-cart-sidebar-list>
100
+ {gifts.length > 0 && (
101
+ <>
105
102
  {gifts.map((item) => (
106
103
  <li key={item.id}>
107
- <CartItem gift item={item} />
104
+ <Gift item={item} />
108
105
  </li>
109
106
  ))}
110
- </UIList>
111
- </>
112
- )}
107
+ </>
108
+ )}
109
+ </UIList>
113
110
 
114
111
  <footer data-fs-cart-sidebar-footer>
115
112
  <OrderSummary
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  List as UIList,
3
3
  PaymentMethods as UIPaymentMethods,
4
- SROnly as UISROnly,
5
4
  } from '@faststore/ui'
6
5
 
7
6
  import Logo from 'src/components/ui/Logo'
@@ -12,6 +11,7 @@ import { mark } from 'src/sdk/tests/mark'
12
11
 
13
12
  import styles from './footer.module.scss'
14
13
  import FooterLinks from './FooterLinks'
14
+ import FooterFlags from './FooterFlags'
15
15
 
16
16
  type FooterProps = {
17
17
  /**
@@ -107,43 +107,10 @@ export function Footer({
107
107
  <Logo />
108
108
 
109
109
  {sectionPaymentMethods && (
110
- <UIPaymentMethods data-fs-footer-payment-methods>
111
- <p data-fs-footer-title>Payment Methods</p>
112
- <UIList>
113
- <li>
114
- <Icon width="34px" height="24px" name="Visa" />
115
- <UISROnly text="Visa" />
116
- </li>
117
- <li>
118
- <Icon width="34px" height="24px" name="Diners" />
119
- <UISROnly text="Diners Club" />
120
- </li>
121
- <li>
122
- <Icon width="34px" height="24px" name="Mastercard" />
123
- <UISROnly text="Mastercard" />
124
- </li>
125
- <li>
126
- <Icon width="34px" height="24px" name="EloCard" />
127
- <UISROnly text="Elo Card" />
128
- </li>
129
- <li>
130
- <Icon width="34px" height="24px" name="PayPal" />
131
- <UISROnly text="PayPal" />
132
- </li>
133
- <li>
134
- <Icon width="34px" height="24px" name="Stripe" />
135
- <UISROnly text="Stripe" />
136
- </li>
137
- <li>
138
- <Icon width="34px" height="24px" name="GooglePay" />
139
- <UISROnly text="Google Pay" />
140
- </li>
141
- <li>
142
- <Icon width="34px" height="24px" name="ApplePay" />
143
- <UISROnly text="Apple Pay" />
144
- </li>
145
- </UIList>
146
- </UIPaymentMethods>
110
+ <UIPaymentMethods
111
+ title={<p>Payment Methods</p>}
112
+ flagList={FooterFlags}
113
+ />
147
114
  )}
148
115
 
149
116
  <div data-fs-footer-copyright className="text__legend">
@@ -0,0 +1,23 @@
1
+ import {
2
+ Visa,
3
+ Diners,
4
+ Mastercard,
5
+ EloCard,
6
+ PayPal,
7
+ Stripe,
8
+ GooglePay,
9
+ ApplePay,
10
+ } from '@faststore/components'
11
+
12
+ const FooterFlags = [
13
+ { image: <Visa />, text: 'Visa' },
14
+ { image: <Diners />, text: 'Diners Club' },
15
+ { image: <Mastercard />, text: 'Mastercard' },
16
+ { image: <EloCard />, text: 'Elo Card' },
17
+ { image: <PayPal />, text: 'PayPal' },
18
+ { image: <Stripe />, text: 'Stripe' },
19
+ { image: <GooglePay />, text: 'GooglePay' },
20
+ { image: <ApplePay />, text: 'ApplePay' },
21
+ ]
22
+
23
+ export default FooterFlags
@@ -22,11 +22,6 @@
22
22
  --fs-footer-title-weight : var(--fs-text-weight-bold);
23
23
  --fs-footer-title-margin-bottom : var(--fs-spacing-1);
24
24
 
25
- // Payment Methods
26
- --fs-footer-payment-methods-flags-border-width : var(--fs-border-width);
27
- --fs-footer-payment-methods-flags-border-color : var(--fs-color-neutral-3);
28
- --fs-footer-payment-methods-flags-border-radius : var(--fs-border-radius-small);
29
-
30
25
  // --------------------------------------------------------
31
26
  // Structural Styles
32
27
  // --------------------------------------------------------
@@ -108,7 +103,7 @@
108
103
  }
109
104
 
110
105
  [data-fs-footer-social],
111
- [data-fs-footer-payment-methods] {
106
+ [data-fs-payment-methods] {
112
107
  @include media(">=notebook") {
113
108
  grid-column: 11 / span 2;
114
109
  margin-left: calc(-1 * var(--fs-spacing-3));
@@ -142,7 +137,7 @@
142
137
  }
143
138
  }
144
139
 
145
- [data-fs-footer-payment-methods] {
140
+ [data-fs-payment-methods] {
146
141
  @include media("<notebook") {
147
142
  margin: var(--fs-footer-spacing-vertical-mobile) auto;
148
143
  }
@@ -158,27 +153,6 @@
158
153
  }
159
154
  }
160
155
 
161
- [data-payment-methods-flags] {
162
- svg {
163
- border: var(--fs-footer-payment-methods-flags-border-width) solid var(--fs-footer-payment-methods-flags-border-color);
164
- border-radius: var(--fs-footer-payment-methods-flags-border-radius);
165
- }
166
-
167
- [data-fs-list] {
168
- display: grid;
169
- grid-template-columns: repeat(4, minmax(0, max-content));
170
- row-gap: var(--fs-spacing-1);
171
- justify-content: space-between;
172
- margin-top: var(--fs-spacing-3);
173
-
174
- li { display: flex; }
175
-
176
- @include media("<notebook") {
177
- column-gap: var(--fs-grid-gap-2);
178
- }
179
- }
180
- }
181
-
182
156
  [data-fs-footer-copyright] {
183
157
  p + p {
184
158
  margin: var(--fs-spacing-2) auto;
@@ -1,2 +1,3 @@
1
1
  export { default } from './Footer'
2
2
  export { default as FooterLinks } from './FooterLinks'
3
+ export { default as FooterFlags } from './FooterFlags'
@@ -1,6 +1,6 @@
1
1
  import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
2
2
 
3
- import UIProvider from 'src/sdk/ui/Provider'
3
+ import { UIProvider } from '@faststore/ui'
4
4
 
5
5
  import { NavLinks } from '.'
6
6
 
@@ -1,4 +1,4 @@
1
- import UIProvider from 'src/sdk/ui/Provider'
1
+ import { UIProvider } from '@faststore/ui'
2
2
 
3
3
  import Navbar, { NavLinks } from '.'
4
4
 
@@ -9,7 +9,7 @@ import Icon from 'src/components/ui/Icon'
9
9
  import Link from 'src/components/ui/Link'
10
10
  import Logo from 'src/components/ui/Logo'
11
11
  import { mark } from 'src/sdk/tests/mark'
12
- import { useUI } from 'src/sdk/ui/Provider'
12
+ import { useUI } from '@faststore/ui'
13
13
  import useScrollDirection from 'src/sdk/ui/useScrollDirection'
14
14
 
15
15
  import styles from './navbar.module.scss'
@@ -1,6 +1,6 @@
1
1
  import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
2
2
 
3
- import UIProvider, { useUI } from 'src/sdk/ui/Provider'
3
+ import { UIProvider, useUI } from '@faststore/ui'
4
4
 
5
5
  import { Button } from '@faststore/ui'
6
6
  import Icon from 'src/components/ui/Icon'
@@ -7,8 +7,8 @@ import Link from 'src/components/ui/Link'
7
7
  import Logo from 'src/components/ui/Logo'
8
8
  import SlideOver from 'src/components/ui/SlideOver'
9
9
  import { mark } from 'src/sdk/tests/mark'
10
- import { useUI } from 'src/sdk/ui/Provider'
11
- import { useFadeEffect } from 'src/sdk/ui/useFadeEffect'
10
+ import { useUI } from '@faststore/ui'
11
+ import { useFadeEffect } from '@faststore/ui'
12
12
 
13
13
  import styles from './navbar-slider.module.scss'
14
14
  import NavLinks from './NavLinks'
@@ -1,7 +1,7 @@
1
1
  import { lazy, Suspense, useEffect } from 'react'
2
2
 
3
3
  import { useCart } from 'src/sdk/cart'
4
- import { useUI } from 'src/sdk/ui/Provider'
4
+ import { useUI } from '@faststore/ui'
5
5
 
6
6
  const UIToast = lazy(() => import('src/components/ui/Toast'))
7
7