@faststore/core 0.3.14 → 0.3.16

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 (38) hide show
  1. package/.eslintrc.json +3 -0
  2. package/CHANGELOG.md +19 -0
  3. package/README.md +1 -1
  4. package/cypress/integration/analytics.test.js +24 -5
  5. package/cypress/integration/cart.test.js +4 -2
  6. package/cypress/integration/plp.test.js +1 -1
  7. package/cypress/integration/search.test.js +6 -1
  8. package/package.json +6 -7
  9. package/src/components/cms/RenderPageSections.tsx +0 -1
  10. package/src/components/common/Footer/Footer.tsx +9 -9
  11. package/src/components/sections/Hero/Hero.tsx +28 -77
  12. package/src/components/sections/ProducDetailsContent/ProductDetailsContent.tsx +15 -17
  13. package/src/components/ui/Price/Price.tsx +2 -3
  14. package/src/components/ui/ShippingSimulation/ShippingSimulation.stories.mdx +0 -27
  15. package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +6 -13
  16. package/src/components/ui/ShippingSimulation/shipping-simulation.module.scss +0 -39
  17. package/src/components/ui/ShippingSimulation/useShippingSimulation.ts +1 -1
  18. package/src/customizations/components/index.ts +1 -0
  19. package/src/pages/[...slug].tsx +8 -8
  20. package/src/pages/s.tsx +2 -2
  21. package/src/sdk/error/ErrorBoundary/ErrorBoundary.tsx +0 -1
  22. package/src/sdk/ui/useOnClickOutside.ts +0 -1
  23. package/src/server/cms.ts +0 -1
  24. package/vtex.env +2 -2
  25. package/.eslintignore +0 -8
  26. package/.eslintrc +0 -21
  27. package/bun.lockb +0 -0
  28. package/renovate.json +0 -5
  29. package/src/components/sections/Hero/Hero.stories.mdx +0 -277
  30. package/src/components/sections/Hero/hero.module.scss +0 -180
  31. package/src/components/sections/ProducDetailsContent/product-details-content.module.scss +0 -41
  32. package/src/components/ui/SROnly/SROnly.tsx +0 -20
  33. package/src/components/ui/SROnly/index.ts +0 -1
  34. package/src/components/ui/SROnly/sr-only.module.scss +0 -15
  35. package/src/components/ui/Toggle/Toggle.stories.mdx +0 -604
  36. package/src/components/ui/Toggle/Toggle.tsx +0 -75
  37. package/src/components/ui/Toggle/index.ts +0 -2
  38. package/src/components/ui/Toggle/toggle.module.scss +0 -200
package/.eslintrc.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "next/core-web-vitals"
3
+ }
package/CHANGELOG.md CHANGED
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Conventional Changelog](https://github.com/conventional-changelog/conventional-changelog),
6
6
  and this project adheres to [Calendar Versioning](https://calver.org/).
7
7
 
8
+ ### [0.3.16](https://github.com/vtex-sites/nextjs.store/compare/0.3.15...0.3.16) (2023-01-09)
9
+
10
+
11
+ ### Chores
12
+
13
+ * Replace `Table` using FSUI ([#341](https://github.com/vtex-sites/nextjs.store/issues/341)) ([cccf3d5](https://github.com/vtex-sites/nextjs.store/commit/cccf3d5cb1fccc1440b2b019ebc06ddc474fb25f))
14
+
15
+ ### 0.3.15 (2023-01-03)
16
+
17
+
18
+ ### Features
19
+
20
+ * Replaces SROnly & Toggle & ToggleField FSUI ([#335](https://github.com/vtex-sites/nextjs.store/issues/335)) ([b096874](https://github.com/vtex-sites/nextjs.store/commit/b096874cae5e24fb4bfbdfd612f6bcc1f2f6bb25))
21
+
22
+
23
+ ### Chores
24
+
25
+ * Replaces `Hero` FSUI ([#324](https://github.com/vtex-sites/nextjs.store/issues/324)) ([ff40590](https://github.com/vtex-sites/nextjs.store/commit/ff40590e07716ab5d1a2b2020d9b668f73b24c90))
26
+
8
27
  ### [0.3.14](https://github.com/vtex-sites/nextjs.store/compare/0.3.13...0.3.14) (2022-12-19)
9
28
 
10
29
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <p align="center">
1
+ <p align="center">
2
2
  <a href="https://github.com/vtex/faststore">
3
3
  <img alt="Store Framework" src="https://emoji.slack-edge.com/T02BCPD0X/store-framework/7547b127e929c376.png" width="75" />
4
4
  </a>
@@ -73,6 +73,8 @@ describe('add_to_cart event', () => {
73
73
 
74
74
  // Add to cart
75
75
  cy.getById('buy-button')
76
+ .should('be.visible')
77
+ .scrollIntoView({ duration: 500 })
76
78
  .click()
77
79
  .then(($btn) => {
78
80
  cy.itemsInCart(1)
@@ -92,6 +94,8 @@ describe('add_to_cart event', () => {
92
94
 
93
95
  // Add to cart
94
96
  cy.getById('buy-button')
97
+ .should('be.visible')
98
+ .scrollIntoView({ duration: 500 })
95
99
  .click()
96
100
  .then(($btn) => {
97
101
  cy.itemsInCart(1)
@@ -143,7 +147,7 @@ describe('remove_from_cart event', () => {
143
147
 
144
148
  context('when removing a product from cart', () => {
145
149
  beforeEach(() => {
146
- cy.getById('remove-from-cart-button').click()
150
+ cy.getById('remove-from-cart-button').should('be.visible').click()
147
151
  })
148
152
 
149
153
  it('adds remove_from_cart event in the data layer', () => {
@@ -154,10 +158,14 @@ describe('remove_from_cart event', () => {
154
158
 
155
159
  // Add item to cart
156
160
  cy.getById('buy-button')
161
+ .should('be.visible')
162
+ .scrollIntoView({ duration: 500 })
157
163
  .click()
158
164
  .then(() => {
159
165
  cy.itemsInCart(1)
160
- cy.getById('checkout-button').should('be.enabled')
166
+ cy.getById('checkout-button')
167
+ .should('be.visible')
168
+ .should('be.enabled')
161
169
  cy.itemsInCart(1)
162
170
 
163
171
  // Remove the added item
@@ -189,10 +197,14 @@ describe('remove_from_cart event', () => {
189
197
  .click()
190
198
  .then(() => {
191
199
  cy.getById('buy-button')
200
+ .should('be.visible')
201
+ .scrollIntoView({ duration: 500 })
192
202
  .click()
193
203
  .then(($btn) => {
194
204
  cy.itemsInCart(2)
195
- cy.getById('checkout-button').should('be.enabled')
205
+ cy.getById('checkout-button')
206
+ .should('be.visible')
207
+ .should('be.enabled')
196
208
  cy.itemsInCart(2)
197
209
 
198
210
  // Remove the added item
@@ -202,7 +214,9 @@ describe('remove_from_cart event', () => {
202
214
  .click()
203
215
  .then(() => {
204
216
  cy.itemsInCart(1)
205
- cy.getById('checkout-button').should('be.enabled')
217
+ cy.getById('checkout-button')
218
+ .should('be.visible')
219
+ .should('be.enabled')
206
220
  cy.itemsInCart(1)
207
221
  const skuId = $btn.attr('data-sku')
208
222
 
@@ -242,6 +256,8 @@ describe('select_item event', () => {
242
256
 
243
257
  cy.getById('store-product-card').first().click()
244
258
  cy.getById('buy-button')
259
+ .should('be.visible')
260
+ .scrollIntoView({ duration: 500 })
245
261
  .then(($btn) => {
246
262
  skuId = $btn.attr('data-sku')
247
263
  })
@@ -364,7 +380,10 @@ describe('view_cart event', () => {
364
380
  cy.visit(pages.pdp, options)
365
381
  cy.waitForHydration()
366
382
 
367
- cy.getById('buy-button').click()
383
+ cy.getById('buy-button')
384
+ .should('be.visible')
385
+ .scrollIntoView({ duration: 500 })
386
+ .click()
368
387
  cy.getById('cart-sidebar').should('be.visible')
369
388
 
370
389
  dataLayerHasEvent('view_cart')
@@ -63,7 +63,9 @@ describe('On product description pages', () => {
63
63
  const sellerId = $btn.attr('data-seller')
64
64
 
65
65
  // Wait for optimistic cart to kick in
66
- cy.getById('checkout-button').should('be.enabled')
66
+ cy.getById('checkout-button')
67
+ .should('be.visible')
68
+ .should('be.enabled')
67
69
 
68
70
  cy.getById('cart-item').should(($item) => {
69
71
  expect($item.attr('data-sku')).to.eq(skuId)
@@ -86,7 +88,7 @@ describe('On product description pages', () => {
86
88
 
87
89
  cy.itemsInCart(1)
88
90
 
89
- cy.getById('checkout-button').should('be.enabled')
91
+ cy.getById('checkout-button').should('be.visible').should('be.enabled')
90
92
 
91
93
  cy.itemsInCart(1)
92
94
 
@@ -211,7 +211,7 @@ describe('Infinite Scroll pagination', () => {
211
211
 
212
212
  cy.getById('show-more').should('exist').click()
213
213
 
214
- cy.scrollTo('top')
214
+ cy.scrollTo('top', { duration: 500 })
215
215
  .location('search')
216
216
  .should('match', /page=0$/)
217
217
 
@@ -21,9 +21,14 @@ describe('Search input', () => {
21
21
  cy.visit(pages.home, options)
22
22
  cy.waitForHydration()
23
23
 
24
- cy.getById('store-input-mobile-button').click({ force: true })
24
+ cy.getById('store-input-mobile-button')
25
+ .should('exist')
26
+ .scrollIntoView({ duration: 500 })
27
+ .click({ force: true })
25
28
 
26
29
  cy.getById('store-input-mobile')
30
+ .should('exist')
31
+ .scrollIntoView({ duration: 500 })
27
32
  .click()
28
33
  .type(term)
29
34
  .within(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "license": "MIT",
5
5
  "browserslist": "supports es6-module and not dead",
6
6
  "scripts": {
@@ -12,7 +12,7 @@
12
12
  "test": "cypress open",
13
13
  "lhci": "lhci autorun",
14
14
  "format": "prettier --write \"**/*.{ts,js,tsx,jsx,json}\"",
15
- "lint": "eslint --ext js,ts,jsx,tsx .",
15
+ "lint": "next lint",
16
16
  "stylelint": "stylelint \"**/*.scss\"",
17
17
  "stylelint:fix": "stylelint \"**/*.scss\" --fix",
18
18
  "postinstall": "node postinstall.js && (is-ci || husky install) || echo Skipped postinstall step for @faststore/core",
@@ -31,18 +31,15 @@
31
31
  "@envelop/parser-cache": "^2.2.0",
32
32
  "@envelop/validation-cache": "^2.2.0",
33
33
  "@faststore/api": "^2.0.3-alpha.0",
34
- "@faststore/components": "^2.0.18-alpha.0",
34
+ "@faststore/components": "2.0.30-alpha.0",
35
35
  "@faststore/graphql-utils": "^2.0.3-alpha.0",
36
36
  "@faststore/sdk": "^2.0.3-alpha.0",
37
- "@faststore/ui": "^2.0.17-alpha.0",
37
+ "@faststore/ui": "2.0.37-alpha.0",
38
38
  "@types/react": "^18.0.14",
39
39
  "@vtex/client-cms": "^0.2.12",
40
40
  "autoprefixer": "^10.4.0",
41
41
  "chalk": "^5.2.0",
42
42
  "css-loader": "^6.7.1",
43
- "eslint": "^7.22.0",
44
- "eslint-config-next": "12.1.5",
45
- "eslint-config-vtex-react": "^9.0.0",
46
43
  "graphql": "^15.0.0",
47
44
  "include-media": "^1.4.10",
48
45
  "msw": "^0.43.1",
@@ -83,6 +80,8 @@
83
80
  "cypress-axe": "^0.13.0",
84
81
  "cypress-wait-until": "^1.7.2",
85
82
  "dotenv": "^8.2.0",
83
+ "eslint": "^8.30.0",
84
+ "eslint-config-next": "^13.0.7",
86
85
  "husky": "^5.2.0",
87
86
  "is-ci": "^3.0.0",
88
87
  "lint-staged": "^10.5.4",
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
1
  import chalk from 'chalk'
3
2
  import type { ComponentType } from 'react'
4
3
 
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  List as UIList,
3
3
  PaymentMethods as UIPaymentMethods,
4
+ SROnly as UISROnly,
4
5
  } from '@faststore/ui'
5
6
 
6
7
  import Logo from 'src/components/ui/Logo'
7
8
  import IncentivesFooter from 'src/components/sections/Incentives/IncentivesFooter'
8
9
  import Icon from 'src/components/ui/Icon'
9
10
  import Link from 'src/components/ui/Link'
10
- import SROnly from 'src/components/ui/SROnly'
11
11
  import { mark } from 'src/sdk/tests/mark'
12
12
 
13
13
  import styles from './footer.module.scss'
@@ -112,35 +112,35 @@ export function Footer({
112
112
  <UIList>
113
113
  <li>
114
114
  <Icon width="34px" height="24px" name="Visa" />
115
- <SROnly text="Visa" />
115
+ <UISROnly text="Visa" />
116
116
  </li>
117
117
  <li>
118
118
  <Icon width="34px" height="24px" name="Diners" />
119
- <SROnly text="Diners Club" />
119
+ <UISROnly text="Diners Club" />
120
120
  </li>
121
121
  <li>
122
122
  <Icon width="34px" height="24px" name="Mastercard" />
123
- <SROnly text="Mastercard" />
123
+ <UISROnly text="Mastercard" />
124
124
  </li>
125
125
  <li>
126
126
  <Icon width="34px" height="24px" name="EloCard" />
127
- <SROnly text="Elo Card" />
127
+ <UISROnly text="Elo Card" />
128
128
  </li>
129
129
  <li>
130
130
  <Icon width="34px" height="24px" name="PayPal" />
131
- <SROnly text="PayPal" />
131
+ <UISROnly text="PayPal" />
132
132
  </li>
133
133
  <li>
134
134
  <Icon width="34px" height="24px" name="Stripe" />
135
- <SROnly text="Stripe" />
135
+ <UISROnly text="Stripe" />
136
136
  </li>
137
137
  <li>
138
138
  <Icon width="34px" height="24px" name="GooglePay" />
139
- <SROnly text="Google Pay" />
139
+ <UISROnly text="Google Pay" />
140
140
  </li>
141
141
  <li>
142
142
  <Icon width="34px" height="24px" name="ApplePay" />
143
- <SROnly text="Apple Pay" />
143
+ <UISROnly text="Apple Pay" />
144
144
  </li>
145
145
  </UIList>
146
146
  </UIPaymentMethods>
@@ -1,78 +1,43 @@
1
- import type { ReactNode } from 'react'
1
+ import type {
2
+ HeroHeadingProps as UIHeroHeadingProps,
3
+ HeroImageProps as UIHeroImageProps,
4
+ HeroProps as UIHeroProps,
5
+ } from '@faststore/ui'
2
6
  import {
3
7
  Hero as UIHero,
4
8
  HeroHeading as UIHeroHeading,
5
9
  HeroImage as UIHeroImage,
6
- LinkButton as UILinkButton,
7
10
  } from '@faststore/ui'
8
11
 
9
- import Icon from 'src/components/ui/Icon'
10
- import Image from 'src/components/ui/Image/Image'
12
+ import { Image } from 'src/components/ui/Image'
11
13
 
12
14
  import Section from '../Section'
13
- import styles from './hero.module.scss'
14
-
15
- type Variant = 'primary' | 'secondary'
16
- type ColorVariant = 'main' | 'light' | 'accent'
17
15
 
18
- export interface HeroProps {
19
- /**
20
- * Content for the h1 tag.
21
- */
22
- title: string
23
- /**
24
- * Content for the p tag.
25
- */
26
- subtitle: string
27
- /**
28
- * Specifies the component variant.
29
- */
30
- variant?: Variant
31
- /**
32
- * Specifies the component's color variant combination.
33
- */
34
- colorVariant?: ColorVariant
35
- /**
36
- * Specifies the URL the action button goes to.
37
- */
38
- link?: string
39
- /**
40
- * Specifies the action button's content.
41
- */
42
- linkText?: string
43
- /**
44
- * Icon component for additional customization.
45
- */
46
- icon?: ReactNode
47
- /**
48
- * Specifies the image URL.
49
- */
50
- imageSrc: string
51
- /**
52
- * Alternative description of the image.
53
- */
54
- imageAlt: string
55
- }
16
+ export type HeroProps = UIHeroProps &
17
+ UIHeroHeadingProps &
18
+ UIHeroImageProps & {
19
+ /**
20
+ * Specifies the image URL.
21
+ */
22
+ imageSrc: string
23
+ /**
24
+ * Alternative description of the image.
25
+ */
26
+ imageAlt: string
27
+ }
56
28
 
57
29
  const Hero = ({
30
+ icon,
31
+ link,
58
32
  title,
59
33
  subtitle,
60
- variant = 'primary',
61
- colorVariant = 'main',
62
34
  linkText,
63
- link,
64
- icon,
65
35
  imageAlt,
66
36
  imageSrc,
67
37
  }: HeroProps) => {
68
38
  return (
69
39
  <Section>
70
- <UIHero
71
- className={styles.fsHero}
72
- data-fs-hero
73
- data-fs-hero-variant={variant}
74
- data-fs-hero-color-variant={colorVariant}
75
- >
40
+ <UIHero>
76
41
  <UIHeroImage data-fs-hero-image>
77
42
  <Image
78
43
  preload
@@ -85,27 +50,13 @@ const Hero = ({
85
50
  sizes="(max-width: 768px) 70vw, 50vw"
86
51
  />
87
52
  </UIHeroImage>
88
- <UIHeroHeading data-fs-hero-heading aria-labelledby="hero-heading">
89
- <div data-fs-hero-wrapper className="layout__content">
90
- <div data-fs-hero-info>
91
- <h1 data-fs-hero-title>{title}</h1>
92
- <p data-fs-hero-subtitle>{subtitle}</p>
93
- {!!link && (
94
- <UILinkButton
95
- href={link}
96
- inverse={colorVariant === 'main'}
97
- icon={<Icon name="ArrowRight" width={24} height={24} />}
98
- iconPosition="right"
99
- >
100
- {linkText}
101
- </UILinkButton>
102
- )}
103
- </div>
104
- {icon && variant === 'secondary' && (
105
- <div data-fs-hero-icon>{icon}</div>
106
- )}
107
- </div>
108
- </UIHeroHeading>
53
+ <UIHeroHeading
54
+ title={title}
55
+ subtitle={subtitle}
56
+ link={link}
57
+ linkText={linkText}
58
+ icon={icon}
59
+ />
109
60
  </UIHero>
110
61
  </Section>
111
62
  )
@@ -11,7 +11,6 @@ import {
11
11
  import Accordion, { AccordionItem } from 'src/components/ui/Accordion'
12
12
  import Icon from 'src/components/ui/Icon'
13
13
 
14
- import styles from './product-details-content.module.scss'
15
14
  import Section from '../Section'
16
15
 
17
16
  interface ArticleLabels {
@@ -100,10 +99,7 @@ function ProductDetailsContent({
100
99
  const labels = { ...DEFAULT_LABELS, ...propLabels }
101
100
 
102
101
  return (
103
- <Section
104
- className={styles.fsProductDetailsContent}
105
- data-fs-product-details-content
106
- >
102
+ <Section data-fs-product-details-content>
107
103
  <Accordion
108
104
  expandedIndices={indices}
109
105
  onChange={onChange}
@@ -141,47 +137,49 @@ function ProductDetailsContent({
141
137
  >
142
138
  <UITableBody>
143
139
  <UITableRow>
144
- <UITableCell variant="header">
140
+ <UITableCell variant="header" align="left">
145
141
  <UIIcon
146
142
  data-fs-accordion-item-button-icon
147
143
  component={<Icon name="Ruler" width={18} height={18} />}
148
144
  />
149
145
  <span>Width</span>
150
146
  </UITableCell>
151
- <UITableCell>1.50m</UITableCell>
147
+ <UITableCell align="right">1.50m</UITableCell>
152
148
  </UITableRow>
153
149
  <UITableRow>
154
- <UITableCell variant="header">
150
+ <UITableCell variant="header" align="left">
155
151
  <UIIcon
156
152
  data-fs-accordion-item-button-icon
157
153
  component={<Icon name="Ruler" width={18} height={18} />}
158
154
  />
159
155
  Height
160
156
  </UITableCell>
161
- <UITableCell>1.50m</UITableCell>
157
+ <UITableCell align="right">1.50m</UITableCell>
162
158
  </UITableRow>
163
159
  <UITableRow>
164
- <UITableCell variant="header">
160
+ <UITableCell variant="header" align="left">
165
161
  <UIIcon
166
162
  data-fs-accordion-item-button-icon
167
163
  component={<Icon name="Ruler" width={18} height={18} />}
168
164
  />
169
165
  Dimensions
170
166
  </UITableCell>
171
- <UITableCell>7.27 x 3.03 x 9.94 inches</UITableCell>
167
+ <UITableCell align="right">
168
+ 7.27 x 3.03 x 9.94 inches
169
+ </UITableCell>
172
170
  </UITableRow>
173
171
  <UITableRow>
174
- <UITableCell variant="header">
172
+ <UITableCell variant="header" align="left">
175
173
  <UIIcon
176
174
  data-fs-accordion-item-button-icon
177
175
  component={<Icon name="Bag" width={18} height={18} />}
178
176
  />
179
177
  Weight
180
178
  </UITableCell>
181
- <UITableCell>12oz</UITableCell>
179
+ <UITableCell align="right">12oz</UITableCell>
182
180
  </UITableRow>
183
181
  <UITableRow>
184
- <UITableCell variant="header">
182
+ <UITableCell variant="header" align="left">
185
183
  <UIIcon
186
184
  data-fs-accordion-item-button-icon
187
185
  component={
@@ -190,10 +188,10 @@ function ProductDetailsContent({
190
188
  />
191
189
  Days to ship
192
190
  </UITableCell>
193
- <UITableCell>11 Days</UITableCell>
191
+ <UITableCell align="right">11 Days</UITableCell>
194
192
  </UITableRow>
195
193
  <UITableRow>
196
- <UITableCell variant="header">
194
+ <UITableCell variant="header" align="left">
197
195
  <UIIcon
198
196
  data-fs-accordion-item-button-icon
199
197
  component={
@@ -202,7 +200,7 @@ function ProductDetailsContent({
202
200
  />
203
201
  Estimated
204
202
  </UITableCell>
205
- <UITableCell>Nov 10th</UITableCell>
203
+ <UITableCell align="right">Nov 10th</UITableCell>
206
204
  </UITableRow>
207
205
  </UITableBody>
208
206
  </UITable>
@@ -1,8 +1,7 @@
1
- import { Price as UIPrice } from '@faststore/ui'
1
+ import { Price as UIPrice, SROnly as UISROnly } from '@faststore/ui'
2
2
  import { memo } from 'react'
3
3
  import type { PriceProps } from '@faststore/ui'
4
4
 
5
- import SROnly from '../SROnly'
6
5
  import styles from './price.module.scss'
7
6
 
8
7
  type Props = PriceProps & {
@@ -19,7 +18,7 @@ type Props = PriceProps & {
19
18
  function Price({ classes = '', SRText, ...props }: Props) {
20
19
  return (
21
20
  <>
22
- <SROnly text={SRText} />
21
+ <UISROnly text={SRText} />
23
22
  <UIPrice
24
23
  data-fs-price
25
24
  className={`${styles.fsPrice} ${classes}`}
@@ -111,30 +111,3 @@ The `ShippingSimulation` component uses [FastStore UI Table](https://www.faststo
111
111
  value="var(--fs-spacing-2)"
112
112
  />
113
113
  </TokenTable>
114
-
115
- ### Table
116
-
117
- <TokenTable>
118
- <TokenRow
119
- token="--fs-shipping-simulation-table-row-bkg-color"
120
- value="var(--fs-color-main-0)"
121
- isColor
122
- />
123
- <TokenRow
124
- token="--fs-shipping-simulation-table-row-even-bkg-color"
125
- value="transparent"
126
- />
127
- <TokenDivider />
128
- <TokenRow
129
- token="--fs-shipping-simulation-table-cell-padding"
130
- value="var(--fs-spacing-2)"
131
- />
132
- <TokenRow
133
- token="--fs-shipping-simulation-table-cell-text-size"
134
- value="var(--fs-text-size-2)"
135
- />
136
- <TokenRow
137
- token="--fs-shipping-simulation-table-cell-border-radius"
138
- value="var(--fs-border-radius)"
139
- />
140
- </TokenTable>
@@ -73,7 +73,7 @@ function ShippingSimulation({
73
73
  displayClearButton={displayClearButton}
74
74
  />
75
75
 
76
- <Link href="/" data-fs-shipping-simulation-link>
76
+ <Link href="/" data-fs-shipping-simulation-link size="small">
77
77
  {"I don't know my Postal Code"}
78
78
  <Icon name="ArrowSquareOut" width={18} height={18} />
79
79
  </Link>
@@ -87,20 +87,13 @@ function ShippingSimulation({
87
87
  </p>
88
88
  </header>
89
89
 
90
- <Table data-fs-shipping-simulation-table>
90
+ <Table>
91
91
  <TableBody>
92
92
  {shippingOptions.map((option) => (
93
- <TableRow
94
- key={option.carrier}
95
- data-fs-shipping-simulation-table-row
96
- >
97
- <TableCell data-fs-shipping-simulation-table-cell>
98
- {option.carrier}
99
- </TableCell>
100
- <TableCell data-fs-shipping-simulation-table-cell>
101
- {option.localizedEstimates}
102
- </TableCell>
103
- <TableCell data-fs-shipping-simulation-table-cell>
93
+ <TableRow key={option.carrier}>
94
+ <TableCell align="left">{option.carrier}</TableCell>
95
+ <TableCell>{option.localizedEstimates}</TableCell>
96
+ <TableCell align="right">
104
97
  {option.price && (
105
98
  <Price
106
99
  formatter={formatter}
@@ -23,20 +23,10 @@
23
23
  // Location
24
24
  --fs-shipping-simulation-location-padding-bottom : var(--fs-spacing-2);
25
25
 
26
- // Table
27
- --fs-shipping-simulation-table-row-bkg-color : var(--fs-color-main-0);
28
- --fs-shipping-simulation-table-row-even-bkg-color : transparent;
29
-
30
- --fs-shipping-simulation-table-cell-padding : var(--fs-spacing-2);
31
- --fs-shipping-simulation-table-cell-text-size : var(--fs-text-size-2);
32
- --fs-shipping-simulation-table-cell-border-radius : var(--fs-border-radius);
33
-
34
26
  // --------------------------------------------------------
35
27
  // Structural Styles
36
28
  // --------------------------------------------------------
37
29
 
38
- font-size: var(--fs-shipping-simulation-text-size);
39
-
40
30
  [data-fs-shipping-simulation-title] {
41
31
  padding-bottom: var(--fs-shipping-simulation-title-padding-bottom);
42
32
  }
@@ -64,33 +54,4 @@
64
54
  [data-fs-shipping-simulation-location] {
65
55
  padding-bottom: var(--fs-shipping-simulation-location-padding-bottom);
66
56
  }
67
-
68
- [data-fs-shipping-simulation-table] {
69
- width: 100%;
70
- border-collapse: collapse;
71
- }
72
-
73
- [data-fs-shipping-simulation-table-row] {
74
- background-color: var(--fs-shipping-simulation-table-row-bkg-color);
75
-
76
- &:nth-child(even) {
77
- background-color: var(--fs-shipping-simulation-table-row-even-bkg-color);
78
- }
79
- }
80
-
81
- [data-fs-shipping-simulation-table-cell] {
82
- padding: var(--fs-shipping-simulation-table-cell-padding);
83
- font-size: var(--fs-shipping-simulation-table-cell-text-size);
84
-
85
- &:first-child {
86
- border-top-left-radius: var(--fs-shipping-simulation-table-cell-border-radius);
87
- border-bottom-left-radius: var(--fs-shipping-simulation-table-cell-border-radius);
88
- }
89
-
90
- &:last-child {
91
- text-align: right;
92
- border-top-right-radius: var(--fs-shipping-simulation-table-cell-border-radius);
93
- border-bottom-right-radius: var(--fs-shipping-simulation-table-cell-border-radius);
94
- }
95
- }
96
57
  }