├── app ├── static │ ├── robots.txt │ ├── img │ │ ├── hero.png │ │ └── global │ │ │ ├── app-icon-192.png │ │ │ ├── app-icon-512.png │ │ │ └── apple-touch-icon.png │ ├── ico │ │ └── favicon.ico │ └── manifest.json ├── request-processor.js ├── assets │ └── svg │ │ ├── close.svg │ │ ├── plus.svg │ │ ├── lock.svg │ │ ├── file.svg │ │ ├── payment.svg │ │ ├── social-facebook.svg │ │ ├── hamburger.svg │ │ ├── check.svg │ │ ├── chevron-up.svg │ │ ├── chevron-left.svg │ │ ├── chevron-down.svg │ │ ├── chevron-right.svg │ │ ├── heart-solid.svg │ │ ├── alert.svg │ │ ├── info.svg │ │ ├── location.svg │ │ ├── check-circle.svg │ │ ├── dashboard.svg │ │ ├── flag-fr.svg │ │ ├── visibility.svg │ │ ├── social-youtube.svg │ │ ├── brand-logo.svg │ │ ├── account.svg │ │ ├── heart.svg │ │ ├── flag-gb.svg │ │ ├── search.svg │ │ ├── social-twitter.svg │ │ ├── figma-logo.svg │ │ ├── user.svg │ │ ├── plug.svg │ │ ├── flag-cn.svg │ │ ├── basket.svg │ │ ├── signout.svg │ │ ├── social-pinterest.svg │ │ ├── flag-ca.svg │ │ ├── visibility-off.svg │ │ ├── cc-visa.svg │ │ ├── social-instagram.svg │ │ ├── receipt.svg │ │ ├── filter.svg │ │ ├── cc-cvv.svg │ │ ├── cc-mastercard.svg │ │ └── like.svg ├── theme │ ├── foundations │ │ ├── space.js │ │ ├── gradients.js │ │ ├── shadows.js │ │ ├── sizes.js │ │ ├── styles.js │ │ └── layerStyles.js │ └── components │ │ ├── base │ │ ├── modal.js │ │ ├── skeleton.js │ │ ├── formLabel.js │ │ ├── icon.js │ │ ├── select.js │ │ ├── container.js │ │ ├── alert.js │ │ ├── accordion.js │ │ ├── tooltip.js │ │ ├── badge.js │ │ ├── drawer.js │ │ ├── checkbox.js │ │ ├── radio.js │ │ ├── input.js │ │ └── popover.js │ │ └── project │ │ ├── pagination.js │ │ ├── breadcrumb.js │ │ ├── _app.js │ │ ├── offline-banner.js │ │ ├── nested-accordion.js │ │ ├── product-tile.js │ │ ├── checkout-footer.js │ │ ├── locale-selector.js │ │ ├── links-list.js │ │ ├── social-icons.js │ │ ├── drawer-menu.js │ │ └── image-gallery.js ├── utils │ ├── builder.js │ ├── phone-utils.test.js │ ├── queue.js │ ├── phone-utils.js │ ├── password-utils.js │ └── queue.test.js ├── routes.test.js ├── main.jsx ├── hooks │ ├── use-categories.js │ ├── use-currency.js │ ├── use-wishlist.js │ ├── index.js │ ├── use-site.js │ ├── use-locale.js │ ├── use-limit-urls.js │ ├── use-sort-urls.js │ ├── use-page-urls.js │ ├── use-variation-params.js │ ├── use-limit-urls.test.js │ ├── use-variant.js │ ├── use-currency.test.js │ ├── use-page-urls.test.js │ ├── use-sort-urls.test.js │ ├── use-categories.test.js │ ├── use-locale.test.js │ ├── use-navigation.js │ ├── use-site.test.js │ └── use-toast.test.js ├── request-processor.test.js ├── pages │ ├── checkout │ │ └── partials │ │ │ ├── checkout-header.test.js │ │ │ ├── checkout-footer.test.js │ │ │ └── contact-info.test.js │ ├── login-redirect │ │ ├── index.test.js │ │ └── index.jsx │ ├── home │ │ └── index.test.js │ ├── cart │ │ └── partials │ │ │ ├── cart-title.jsx │ │ │ └── cart-cta.jsx │ ├── account │ │ ├── orders.jsx │ │ ├── wishlist │ │ │ └── partials │ │ │ │ └── wishlist-primary-action.test.js │ │ └── constant.js │ ├── page-not-found │ │ └── index.test.js │ ├── product-list │ │ └── partials │ │ │ ├── link-refinements.jsx │ │ │ ├── checkbox-refinements.jsx │ │ │ └── page-header.jsx │ └── marketing-pages │ │ └── index.jsx ├── components │ ├── offline-banner │ │ ├── index.test.js │ │ └── index.jsx │ ├── blocks │ │ ├── product-box │ │ │ └── product-box.builder.jsx │ │ ├── products-grid │ │ │ └── prouducts-grid.builder.js │ │ └── einstein-products-grid │ │ │ ├── index.jsx │ │ │ └── einstein-products-grid.builder.jsx │ ├── basic-tile │ │ └── index.test.js │ ├── icons │ │ └── index.test.js │ ├── breadcrumb │ │ └── index.test.js │ ├── footer │ │ └── index.test.js │ ├── scroll-to-top │ │ ├── index.jsx │ │ └── index.test.js │ ├── address-display │ │ └── index.jsx │ ├── pagination │ │ └── index.test.js │ ├── _app-config │ │ └── index.test.js │ ├── forms │ │ ├── reset-password-fields.jsx │ │ ├── login-fields.jsx │ │ ├── usePromoCodeFields.jsx │ │ ├── useResetPasswordFields.jsx │ │ ├── profile-fields.jsx │ │ ├── registration-fields.jsx │ │ ├── promo-code-fields.jsx │ │ ├── post-checkout-registration-fields.jsx │ │ ├── useLoginFields.jsx │ │ ├── address-fields.jsx │ │ ├── update-password-fields.jsx │ │ └── form-action-buttons.jsx │ ├── item-variant │ │ ├── item-name.jsx │ │ └── index.jsx │ ├── _error │ │ └── index.test.js │ ├── social-icons │ │ └── index.test.js │ ├── seo │ │ └── index.jsx │ ├── responsive │ │ └── index.jsx │ ├── product-item │ │ └── index.test.js │ ├── locale-text │ │ └── index.test.js │ ├── hero │ │ └── index.test.js │ ├── product-tile │ │ └── index.test.js │ ├── loading-spinner │ │ └── index.jsx │ ├── link │ │ └── index.jsx │ ├── locale-selector │ │ └── index.test.js │ ├── search │ │ └── partials │ │ │ ├── suggestions.jsx │ │ │ └── search-suggestions.jsx │ ├── drawer-menu │ │ └── index.test.js │ ├── page-action-placeholder │ │ └── index.jsx │ ├── product-view-modal │ │ ├── index.jsx │ │ └── index.test.js │ └── links-list │ │ └── index.test.js └── commerce-api │ ├── shopper-baskets.js │ ├── mocks │ └── empty-basket.js │ ├── hooks │ ├── useSearchSuggestions.js │ ├── useRefinementToggle.js │ └── useEinstein.js │ ├── pkce.js │ └── __mocks__ │ └── einstein.js ├── .prettierignore ├── .eslintignore ├── .prettierrc.yaml ├── cache-hash-config.json ├── babel.config.js ├── .eslintrc.js ├── .gitignore ├── config ├── sites.js └── .gitignore ├── worker └── main.js ├── jest.config.js ├── LICENSE └── tests └── lighthouserc.js /app/static/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | build 2 | docs 3 | coverage 4 | scripts/generator/assets 5 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | build 2 | coverage 3 | docs 4 | app/static 5 | jest.config.js 6 | webpack 7 | scripts/generator/assets 8 | -------------------------------------------------------------------------------- /app/static/img/hero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/sfcc-composable-storefront-example/main/app/static/img/hero.png -------------------------------------------------------------------------------- /app/static/ico/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/sfcc-composable-storefront-example/main/app/static/ico/favicon.ico -------------------------------------------------------------------------------- /.prettierrc.yaml: -------------------------------------------------------------------------------- 1 | printWidth: 100 2 | singleQuote: true 3 | semi: false 4 | bracketSpacing: false 5 | tabWidth: 4 6 | arrowParens: 'always' 7 | -------------------------------------------------------------------------------- /app/static/img/global/app-icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/sfcc-composable-storefront-example/main/app/static/img/global/app-icon-192.png -------------------------------------------------------------------------------- /app/static/img/global/app-icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/sfcc-composable-storefront-example/main/app/static/img/global/app-icon-512.png -------------------------------------------------------------------------------- /app/request-processor.js: -------------------------------------------------------------------------------- 1 | export const processRequest = ({path, querystring}) => { 2 | return { 3 | path, 4 | querystring 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /app/static/img/global/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/sfcc-composable-storefront-example/main/app/static/img/global/apple-touch-icon.png -------------------------------------------------------------------------------- /cache-hash-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "app/static/**/*" 4 | ], 5 | "baseDir": "app", 6 | "hashLength": 8, 7 | "destinationFolder": "app" 8 | } 9 | -------------------------------------------------------------------------------- /app/assets/svg/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | module.exports = require('pwa-kit-dev/configs/babel/babel-config') 8 | -------------------------------------------------------------------------------- /app/theme/foundations/space.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | 11: '2.75rem' 9 | } 10 | -------------------------------------------------------------------------------- /app/utils/builder.js: -------------------------------------------------------------------------------- 1 | export default { 2 | apiKey: 'd1ed12c3338144da8dd6b63b35d14c30', 3 | announcementBarModel: 'announcement-bar', 4 | categoryHeroModel: 'category-hero', 5 | productFooterModel: 'product-footer', 6 | pageModel: 'page', 7 | cartUpsellModel: 'cart-modal-upsell', 8 | blogArticleModel: 'blog-article' 9 | } 10 | -------------------------------------------------------------------------------- /app/theme/foundations/gradients.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | imageBackground: 'linear(270deg, #E6E5EA, #EEEEEE)' 9 | } 10 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | module.exports = { 9 | extends: require.resolve('pwa-kit-dev/configs/eslint/eslint-config') 10 | } 11 | -------------------------------------------------------------------------------- /app/theme/components/base/modal.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | baseStyle: { 9 | dialog: {borderRadius: 'base'} 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app/theme/foundations/shadows.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | top: '0px -1px 3px rgba(0, 0, 0, 0.1), 0px -1px 2px rgba(0, 0, 0, 0.06)' 9 | } 10 | -------------------------------------------------------------------------------- /app/static/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "start_url": "/?homescreen=1", 3 | "background_color": "#fff", 4 | "theme_color": "#4e439b", 5 | "display": "standalone", 6 | "icons": [ 7 | { 8 | "src": "./img/global/app-icon-192.png", 9 | "sizes": "192x192" 10 | }, 11 | { 12 | "src": "./img/global/app-icon-512.png", 13 | "sizes": "512x512" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /app/theme/components/base/skeleton.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | baseStyle: { 9 | borderRadius: 'base', 10 | opacity: 0.3 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /app/assets/svg/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/svg/lock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/theme/components/base/formLabel.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | baseStyle: { 9 | marginBottom: 1, 10 | fontSize: 'sm', 11 | fontWeight: 'semibold' 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/theme/components/base/icon.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | baseStyle: { 9 | display: 'inline-block', 10 | verticalAlign: 'bottom', 11 | boxSize: 6 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/assets/svg/file.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/theme/components/base/select.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | const mdSize = {height: 11, h: 11, borderRadius: 'base'} 8 | 9 | export default { 10 | sizes: { 11 | md: { 12 | field: mdSize 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/routes.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import routes from './routes' 8 | 9 | describe('Routes', () => { 10 | test('exports a valid react-router configuration', () => { 11 | expect(Array.isArray(routes) || typeof routes === 'function').toBe(true) 12 | }) 13 | }) 14 | -------------------------------------------------------------------------------- /app/theme/components/base/container.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | baseStyle: { 9 | maxWidth: 'container.xxl' 10 | }, 11 | variants: { 12 | form: { 13 | maxWidth: '522px', 14 | px: 0 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/assets/svg/payment.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/theme/foundations/sizes.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | 11: '2.75rem', 9 | 10 | container: { 11 | sm: '640px', 12 | md: '768px', 13 | lg: '1024px', 14 | xl: '1200px', 15 | xxl: '1440px', 16 | xxxl: '1560px' 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/main.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import {start, registerServiceWorker} from 'pwa-kit-react-sdk/ssr/browser/main' 8 | 9 | const main = () => { 10 | // The path to your service worker should match what is set up in ssr.js 11 | return Promise.all([start(), registerServiceWorker('/worker.js')]) 12 | } 13 | 14 | main() 15 | -------------------------------------------------------------------------------- /app/hooks/use-categories.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import {useContext} from 'react' 8 | import {CategoriesContext} from '../contexts' 9 | 10 | /** 11 | * Custom React hook to get the categories 12 | * @returns {{categories: Object, setCategories: function}[]} 13 | */ 14 | export const useCategories = () => useContext(CategoriesContext) 15 | -------------------------------------------------------------------------------- /app/theme/components/base/alert.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | variants: { 9 | subtle: (props) => ({ 10 | container: { 11 | borderColor: `${props.colorScheme || 'green'}.600`, 12 | borderWidth: 1, 13 | borderStyle: 'solid' 14 | } 15 | }) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .nyc_output 2 | build.tar 3 | 4 | coverage 5 | tests/reports 6 | tests/screenshots 7 | tests/lighthouse-reports/ 8 | lighthouse/audit* 9 | .lighthouseci 10 | 11 | .tern-port 12 | app/integration-manager/docs 13 | messaging/*.csr 14 | 15 | # Local App Configuration Files 16 | config/local.* 17 | 18 | # Elastic Beanstalk Files 19 | .elasticbeanstalk/* 20 | !.elasticbeanstalk/*.cfg.yml 21 | !.elasticbeanstalk/*.global.yml 22 | 23 | build/ 24 | tmp/ 25 | *.log 26 | node_modules 27 | 28 | # Generated files 29 | app/cache-hash-manifest.json 30 | app/loader-cache-hash-manifest.json 31 | 32 | .vscode -------------------------------------------------------------------------------- /app/theme/components/base/accordion.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | baseStyle: { 9 | button: { 10 | paddingLeft: 0, 11 | 12 | _hover: { 13 | background: 'none' 14 | } 15 | }, 16 | panel: { 17 | paddingTop: 0, 18 | paddingBottom: 0 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/hooks/use-currency.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import {useContext} from 'react' 8 | import {CurrencyContext} from '../contexts' 9 | 10 | /** 11 | * Custom React hook to get the currency for the active locale and to change it to a different currency 12 | * @returns {{currency: string, setCurrency: function}[]} 13 | */ 14 | export const useCurrency = () => useContext(CurrencyContext) 15 | -------------------------------------------------------------------------------- /app/hooks/use-wishlist.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import useCustomerProductList from '../commerce-api/hooks/useCustomerProductList' 8 | 9 | const PWA_DEFAULT_WISHLIST_NAME = 'PWA wishlist' 10 | const PWA_DEFAULT_WISHLIST_TYPE = 'wish_list' 11 | 12 | const useWishlist = () => 13 | useCustomerProductList(PWA_DEFAULT_WISHLIST_NAME, PWA_DEFAULT_WISHLIST_TYPE) 14 | 15 | export default useWishlist 16 | -------------------------------------------------------------------------------- /app/assets/svg/social-facebook.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/svg/hamburger.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /app/theme/foundations/styles.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | global: { 9 | 'html, body': { 10 | backgroundColor: 'white', 11 | color: 'gray.900' 12 | }, 13 | body: { 14 | minHeight: '100vh' 15 | }, 16 | '.react-target': { 17 | display: 'flex', 18 | minHeight: '100vh' 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/theme/components/base/tooltip.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | baseStyle: { 9 | '--tooltip-bg': `colors.blue.800`, 10 | px: 2, 11 | py: 2, 12 | bg: 'var(--tooltip-bg)', 13 | '--popper-arrow-bg': 'var(--tooltip-bg)', 14 | color: 'whiteAlpha.900', 15 | borderRadius: 'base', 16 | maxW: '280px', 17 | lineHeight: '1.5em' 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/request-processor.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import {processRequest} from './request-processor' 8 | 9 | describe('processRequest', () => { 10 | test('returns valid values', () => { 11 | const result = processRequest({path: 'path', querystring: 'querystring'}) 12 | 13 | expect(result.path).toEqual(expect.any(String)) 14 | expect(result.querystring).toEqual(expect.any(String)) 15 | }) 16 | }) 17 | -------------------------------------------------------------------------------- /app/assets/svg/check.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/pages/checkout/partials/checkout-header.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import React from 'react' 8 | import {screen} from '@testing-library/react' 9 | 10 | import CheckoutHeader from './checkout-header' 11 | import {renderWithProviders} from '../../../utils/test-utils' 12 | 13 | test('renders component', () => { 14 | renderWithProviders() 15 | expect(screen.getByTitle(/back to homepage/i)).toBeInTheDocument() 16 | }) 17 | -------------------------------------------------------------------------------- /app/pages/checkout/partials/checkout-footer.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import React from 'react' 8 | import {screen} from '@testing-library/react' 9 | 10 | import CheckoutFooter from './checkout-footer' 11 | import {renderWithProviders} from '../../../utils/test-utils' 12 | 13 | test('renders component', () => { 14 | renderWithProviders() 15 | expect(screen.getByRole('link', {name: 'Shipping'})).toBeInTheDocument() 16 | }) 17 | -------------------------------------------------------------------------------- /app/assets/svg/chevron-up.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/svg/chevron-left.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/components/offline-banner/index.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import React from 'react' 8 | import {renderWithProviders} from '../../utils/test-utils' 9 | import OfflineBanner from './index' 10 | import {screen} from '@testing-library/react' 11 | 12 | test('OfflineBanner component is rendered appropriately', () => { 13 | renderWithProviders() 14 | expect(screen.getByText("You're currently browsing in offline mode")).toBeInTheDocument() 15 | }) 16 | -------------------------------------------------------------------------------- /app/theme/components/project/pagination.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | baseStyle: { 9 | button: { 10 | color: 'black' 11 | }, 12 | container: {}, 13 | text: { 14 | whiteSpace: 'nowrap', 15 | paddingLeft: 4, 16 | paddingRight: 4, 17 | paddingTop: 2, 18 | paddingBottom: 2 19 | } 20 | }, 21 | parts: ['button', 'container', 'text'] 22 | } 23 | -------------------------------------------------------------------------------- /app/utils/phone-utils.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import * as utils from './phone-utils' 8 | 9 | test('formats a phone number', () => { 10 | expect(utils.formatPhoneNumber()).toBeUndefined() 11 | expect(utils.formatPhoneNumber('')).toEqual('') 12 | expect(utils.formatPhoneNumber('727')).toEqual('727') 13 | expect(utils.formatPhoneNumber('727555')).toEqual('(727) 555') 14 | expect(utils.formatPhoneNumber('7275551234')).toEqual('(727) 555-1234') 15 | }) 16 | -------------------------------------------------------------------------------- /config/sites.js: -------------------------------------------------------------------------------- 1 | // Provide the sites for your app. Each site includes site id, and its localization configuration. 2 | // You can also provide aliases for your locale. They will be used in place of your locale id when generating paths across the app 3 | module.exports = [ 4 | { 5 | id: 'RefArch', 6 | l10n: { 7 | supportedCurrencies: ['USD'], 8 | defaultCurrency: 'USD', 9 | defaultLocale: 'en-US', 10 | supportedLocales: [ 11 | { 12 | id: 'en-US', 13 | // alias: 'us', 14 | preferredCurrency: 'USD' 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /app/assets/svg/chevron-down.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/components/blocks/product-box/product-box.builder.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {Builder} from '@builder.io/react' 3 | import loadable from '@loadable/component' 4 | import {Skeleton} from '@chakra-ui/react' 5 | const fallback = 6 | 7 | const ProductBox = loadable(() => import('./index'), {fallback}) 8 | 9 | Builder.registerComponent(ProductBox, { 10 | name: 'ProductBox', 11 | image: 'https://unpkg.com/css.gg@2.0.0/icons/svg/box.svg', 12 | inputs: [ 13 | { 14 | name: 'productRef', 15 | friendlyName: 'Product', 16 | type: 'SFCommerceProduct', 17 | required: true 18 | } 19 | ] 20 | }) 21 | -------------------------------------------------------------------------------- /app/pages/login-redirect/index.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import React from 'react' 8 | import {renderWithReactIntl} from '../../utils/test-utils' 9 | import LoginRedirect from './index' 10 | 11 | test('Login Redirect renders without errors', () => { 12 | const {getByRole} = renderWithReactIntl() 13 | 14 | expect(getByRole('heading', {name: /login redirect/i})).toBeInTheDocument() 15 | expect(typeof LoginRedirect.getTemplateName()).toEqual('string') 16 | }) 17 | -------------------------------------------------------------------------------- /app/pages/home/index.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import React from 'react' 8 | import {renderWithProviders} from '../../utils/test-utils' 9 | import HomePage from './index' 10 | 11 | jest.mock('../../commerce-api/einstein') 12 | 13 | test('Home Page renders without errors', async () => { 14 | const {getByTestId} = renderWithProviders() 15 | 16 | expect(getByTestId('home-page')).toBeInTheDocument() 17 | expect(typeof HomePage.getTemplateName()).toEqual('string') 18 | }) 19 | -------------------------------------------------------------------------------- /app/theme/components/project/breadcrumb.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | baseStyle: { 9 | container: { 10 | minHeight: 4, 11 | fontSize: 'sm' 12 | }, 13 | icon: { 14 | display: 'flex', 15 | boxSize: 4, 16 | color: 'grey' 17 | }, 18 | link: { 19 | paddingTop: 3, 20 | paddingBottom: 3 21 | } 22 | }, 23 | parts: ['container', 'icon', 'link'] 24 | } 25 | -------------------------------------------------------------------------------- /app/assets/svg/chevron-right.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/components/blocks/products-grid/prouducts-grid.builder.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {Builder} from '@builder.io/react' 3 | import loadable from '@loadable/component' 4 | import {Skeleton} from '@chakra-ui/react' 5 | const fallback = 6 | 7 | const ProductsGrid = loadable(() => import('./index'), {fallback}) 8 | 9 | Builder.registerComponent(ProductsGrid, { 10 | name: 'ProductsGrid', 11 | image: 'https://unpkg.com/css.gg@2.0.0/icons/svg/list.svg', 12 | inputs: [ 13 | { 14 | name: 'productIds', 15 | friendlyName: 'Products', 16 | type: 'SFCommerceProductsList', 17 | required: true 18 | } 19 | ] 20 | }) 21 | -------------------------------------------------------------------------------- /app/assets/svg/heart-solid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/assets/svg/alert.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/svg/info.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/hooks/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | /* istanbul ignore file */ 9 | export {useSearchParams} from './use-search-params' 10 | export {useLimitUrls} from './use-limit-urls' 11 | export {usePageUrls} from './use-page-urls' 12 | export {useSortUrls} from './use-sort-urls' 13 | export {useVariant} from './use-variant' 14 | export {useVariationAttributes} from './use-variation-attributes' 15 | export {useVariationParams} from './use-variation-params' 16 | export {useProduct} from './use-product' 17 | export {useCurrency} from './use-currency' 18 | -------------------------------------------------------------------------------- /app/pages/login-redirect/index.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | // This page is here along witht the `callback` route to handle the redirect 9 | // after a user logs in using the SLAS Implementation 10 | 11 | import React, {Fragment} from 'react' 12 | 13 | const LoginRedirect = () => { 14 | return ( 15 | 16 |

Login Redirect

17 |
18 | ) 19 | } 20 | 21 | LoginRedirect.getTemplateName = () => 'login-redirect' 22 | 23 | export default LoginRedirect 24 | -------------------------------------------------------------------------------- /app/assets/svg/location.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/theme/components/project/_app.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import theme from '@chakra-ui/theme' 8 | 9 | export default { 10 | baseStyle: { 11 | container: { 12 | flex: 1, 13 | display: 'flex', 14 | flexDirection: 'column', 15 | backgroundColor: 'white', 16 | minWidth: '375px' 17 | }, 18 | headerWrapper: { 19 | position: 'sticky', 20 | top: 0, 21 | zIndex: theme.zIndices.sticky 22 | } 23 | }, 24 | parts: ['container'] 25 | } 26 | -------------------------------------------------------------------------------- /app/theme/components/project/offline-banner.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | baseStyle: { 9 | container: { 10 | paddingTop: 4, 11 | paddingBottom: 4, 12 | paddingLeft: [4, 4, 6, 6, 8], 13 | paddingRight: [4, 4, 6, 6, 8] 14 | }, 15 | icon: { 16 | height: 5, 17 | width: 5 18 | }, 19 | message: { 20 | paddingLeft: 2, 21 | fontWeight: 700 22 | } 23 | }, 24 | parts: ['container', 'icon', 'message'] 25 | } 26 | -------------------------------------------------------------------------------- /app/assets/svg/check-circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/components/basic-tile/index.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import React from 'react' 8 | import {renderWithProviders} from '../../utils/test-utils' 9 | import BasicTile from './index' 10 | 11 | test('BasicTile renders without errors', () => { 12 | const data = { 13 | title: 'title', 14 | href: '/category/womens-outfits', 15 | img: { 16 | src: 'src', 17 | alt: 'alt' 18 | } 19 | } 20 | const {getByText} = renderWithProviders() 21 | 22 | expect(getByText('title')).toBeInTheDocument() 23 | }) 24 | -------------------------------------------------------------------------------- /app/components/blocks/einstein-products-grid/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | import RecommendedProducts from '../../recommended-products' 4 | 5 | export function EinsteinProductsGrid({recommender, title, product}) { 6 | return ( 7 |
8 | 14 |
15 | ) 16 | } 17 | 18 | EinsteinProductsGrid.propTypes = { 19 | /** recommender id */ 20 | recommender: PropTypes.string, 21 | product: PropTypes.object, 22 | title: PropTypes.string 23 | } 24 | 25 | export default EinsteinProductsGrid 26 | -------------------------------------------------------------------------------- /app/hooks/use-site.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | import {useLocation} from 'react-router-dom' 9 | import {resolveSiteFromUrl} from '../utils/site-utils' 10 | import {useMemo} from 'react' 11 | 12 | /** 13 | * This hook returns the current site based on current location 14 | * 15 | * @returns {Object} - current site 16 | */ 17 | const useSite = () => { 18 | const {pathname, search} = useLocation() 19 | const site = useMemo(() => { 20 | return resolveSiteFromUrl(`${pathname}${search}`) 21 | }, [pathname, search]) 22 | return site 23 | } 24 | 25 | export default useSite 26 | -------------------------------------------------------------------------------- /app/theme/components/base/badge.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | variants: { 9 | notification: { 10 | display: 'inline-flex', 11 | justifyContent: 'center', 12 | position: 'absolute', 13 | top: 0, 14 | right: 0, 15 | minWidth: 5, 16 | height: 5, 17 | color: 'white', 18 | fontSize: 'xs', 19 | backgroundColor: 'blue.500', 20 | border: '1px solid', 21 | borderColor: 'white', 22 | borderRadius: 'full' 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/theme/components/base/drawer.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | baseStyle: { 9 | header: { 10 | paddingTop: 1, 11 | paddingRight: [4, 4, 6, 6], 12 | paddingBottom: 1, 13 | paddingLeft: [4, 4, 6, 6], 14 | boxShadow: 'base' 15 | }, 16 | body: { 17 | padding: [4, 4, 6, 6] 18 | }, 19 | footer: { 20 | paddingTop: 6, 21 | paddingRight: [4, 4, 6, 6], 22 | paddingBottom: 11, 23 | paddingLest: [4, 4, 6, 6] 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/assets/svg/dashboard.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/assets/svg/flag-fr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/theme/components/project/nested-accordion.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | export default { 8 | baseStyle: { 9 | container: {}, 10 | nestedAccordion: { 11 | paddingLeft: 4 12 | }, 13 | internalButton: {}, 14 | internalButtonIcon: { 15 | color: 'grey', 16 | marginRight: 2 17 | }, 18 | leafButton: { 19 | color: 'black', 20 | paddingLeft: 8, 21 | paddingTop: 2, 22 | paddingBottom: 2 23 | } 24 | }, 25 | parts: ['container', 'nestedAccordion', 'internalButton', 'leafButtonIcon', 'leafButton'] 26 | } 27 | -------------------------------------------------------------------------------- /app/assets/svg/visibility.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/hooks/use-locale.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | import useSite from './use-site' 9 | import {useMemo} from 'react' 10 | import {resolveLocaleFromUrl} from '../utils/utils' 11 | import {useLocation} from 'react-router-dom' 12 | 13 | /** 14 | * This hook returns the locale object based on current location 15 | * @return {object} locale 16 | */ 17 | const useLocale = () => { 18 | const {pathname, search} = useLocation() 19 | const site = useSite() 20 | const locale = useMemo(() => { 21 | return resolveLocaleFromUrl(`${pathname}${search}`) 22 | }, [pathname, search, site]) 23 | 24 | return locale 25 | } 26 | 27 | export default useLocale 28 | -------------------------------------------------------------------------------- /app/components/icons/index.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import React from 'react' 8 | import {within} from '@testing-library/dom' 9 | import {renderWithProviders} from '../../utils/test-utils' 10 | import * as Icons from './index' 11 | 12 | test('renders svg icons with Chakra Icon component', () => { 13 | renderWithProviders() 14 | const svg = document.querySelector('.chakra-icon') 15 | const use = within(svg).getByRole('presentation') 16 | expect(svg).toBeInTheDocument() 17 | expect(use).toBeInTheDocument() 18 | expect(svg).toHaveAttribute('viewBox', '0 0 24 24') 19 | expect(use).toHaveAttribute('xlink:href', '#check') 20 | }) 21 | -------------------------------------------------------------------------------- /app/assets/svg/social-youtube.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /config/.gitignore: -------------------------------------------------------------------------------- 1 | ### macOS ### 2 | # General 3 | .DS_Store 4 | .AppleDouble 5 | .LSOverride 6 | 7 | # Thumbnails 8 | ._* 9 | 10 | ### react ### 11 | .DS_* 12 | *.log 13 | logs 14 | **/*.backup.* 15 | **/*.back.* 16 | 17 | node_modules 18 | bower_components 19 | 20 | *.sublime* 21 | 22 | 23 | ### TortoiseGit ### 24 | # Project-level settings 25 | /.tgitconfig 26 | 27 | ### VisualStudioCode ### 28 | .vscode/* 29 | !.vscode/settings.json 30 | !.vscode/tasks.json 31 | !.vscode/launch.json 32 | !.vscode/extensions.json 33 | *.code-workspace 34 | 35 | 36 | ### Windows ### 37 | # Windows thumbnail cache files 38 | Thumbs.db 39 | Thumbs.db:encryptable 40 | ehthumbs.db 41 | ehthumbs_vista.db 42 | 43 | # Folder config file 44 | [Dd]esktop.ini 45 | 46 | # Recycle Bin used on file shares 47 | $RECYCLE.BIN/ 48 | 49 | # build dist folders 50 | build/ 51 | 52 | # Layer0 generated build directory 53 | .layer0 54 | -------------------------------------------------------------------------------- /app/components/breadcrumb/index.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import React from 'react' 8 | import Breadcrumb from './index' 9 | import {renderWithProviders} from '../../utils/test-utils' 10 | 11 | const mockCategories = [ 12 | { 13 | id: 1, 14 | name: 'Category 1' 15 | }, 16 | { 17 | id: 2, 18 | name: 'Category 2' 19 | }, 20 | { 21 | id: 3, 22 | name: 'Category 3' 23 | } 24 | ] 25 | 26 | test('Renders Breadcrum', () => { 27 | const {getAllByTestId} = renderWithProviders() 28 | 29 | expect(getAllByTestId('sf-crumb-item').length).toEqual(mockCategories.length) 30 | }) 31 | -------------------------------------------------------------------------------- /app/components/footer/index.test.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, salesforce.com, inc. 3 | * All rights reserved. 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | import React from 'react' 8 | import {screen} from '@testing-library/react' 9 | 10 | import Footer from './index' 11 | import {renderWithProviders} from '../../utils/test-utils' 12 | 13 | test('renders component', () => { 14 | renderWithProviders(