-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8178737
Showing
361 changed files
with
35,437 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# The hash visible in the subject store's URL when signed in to the store control panel. | ||
# The control panel URL is of the form `https://store-{hash}.mybigcommerce.com`. | ||
BIGCOMMERCE_STORE_HASH= | ||
|
||
# The access token from a store-level API account. The only scope required to run Catalyst is Carts `manage`. | ||
# See https://developer.bigcommerce.com/docs/start/authentication/api-accounts#store-level-api-accounts | ||
BIGCOMMERCE_ACCESS_TOKEN= | ||
|
||
# A bearer token that authorizes server-to-server requests to the GraphQL Storefront API | ||
# See https://developer.bigcommerce.com/docs/rest-authentication/tokens/customer-impersonation-token | ||
BIGCOMMERCE_CUSTOMER_IMPERSONATION_TOKEN= | ||
|
||
# The Channel ID for the selling channel being serviced by this Catalyst storefront. | ||
# Channel ID 1 will allow you to load the same data being used on the default Stencil storefront on your store, | ||
# but it is strongly recommended to create a new channel instead for production. | ||
# The CLI can do this for you. | ||
BIGCOMMERCE_CHANNEL_ID=1 | ||
|
||
# Set to true to allow the /admin route to redirect to the BigCommerce control panel. | ||
# `false` is recommended for production. Defaults to false when not specified. | ||
# You may also delete /admin/route.ts if you wish. | ||
ENABLE_ADMIN_ROUTE=true | ||
|
||
# Used by Auth.js, formerly NextAuth. To generate, run `openssl rand -hex 32` in your terminal. | ||
AUTH_SECRET= | ||
|
||
# Recommended so that you can use Turborepo's Remote Cache feature with signed artifacts | ||
# https://turbo.build/repo/docs/core-concepts/remote-caching#artifact-integrity-and-authenticity-verification | ||
# This can also be generated with `openssl rand -hex 32`, but do not re-use the value from AUTH_SECRET | ||
TURBO_REMOTE_CACHE_SIGNATURE_KEY= | ||
|
||
# NextJS will persists cached queries in Data Cache | ||
# The time persisted is not defined | ||
# https://nextjs.org/docs/app/building-your-application/caching#data-cache | ||
# This sets a sensible revalidation target for cached requests | ||
NEXT_PUBLIC_DEFAULT_REVALIDATE_TARGET=3600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// @ts-check | ||
|
||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
require('@bigcommerce/eslint-config/patch'); | ||
|
||
/** @type {import('eslint').Linter.Config} */ | ||
const config = { | ||
root: true, | ||
extends: [ | ||
'@bigcommerce/catalyst/base', | ||
'@bigcommerce/catalyst/react', | ||
'@bigcommerce/catalyst/next', | ||
'@bigcommerce/catalyst/prettier', | ||
], | ||
rules: { | ||
'@typescript-eslint/naming-convention': 'off', | ||
'@next/next/no-html-link-for-pages': 'off', | ||
'import/dynamic-import-chunkname': 'off', | ||
'no-underscore-dangle': ['error', { allow: ['__typename'] }], | ||
'@typescript-eslint/prefer-nullish-coalescing': 'off', | ||
'@typescript-eslint/no-unsafe-enum-comparison': 'off', | ||
'@typescript-eslint/no-restricted-imports': [ | ||
'error', | ||
{ | ||
paths: [ | ||
{ | ||
name: 'next/link', | ||
message: "Please import 'Link' from '~/components/Link' instead.", | ||
}, | ||
], | ||
}, | ||
], | ||
'check-file/folder-naming-convention': [ | ||
'error', | ||
{ | ||
'**': 'NEXT_JS_APP_ROUTER_CASE', | ||
}, | ||
], | ||
}, | ||
ignorePatterns: ['client/generated/**/*.ts', ], | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
# generated | ||
client/generated | ||
schema.graphql | ||
|
||
# secrets | ||
.catalyst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<a href="https://catalyst.dev" target="_blank" rel="noopener norerrer"> | ||
<img src="https://storage.googleapis.com/bigcommerce-developers/images/catalyst_readme_banner.png" alt="Catalyst for Composable Commerce Image Banner" title="Catalyst"> | ||
</a> | ||
|
||
<br /> | ||
|
||
**Catalyst** is the composable, fully customizable headless ecommerce storefront framework for | ||
[BigCommerce](https://www.bigcommerce.com/). Catalyst is built with [Next.js](https://nextjs.org/), uses | ||
our [React](https://react.dev/) storefront components, and is backed by the | ||
[GraphQL Storefront API](https://developer.bigcommerce.com/docs/storefront/graphql). | ||
|
||
By choosing Catalyst, you'll have a fully-functional storefront within a few seconds, and spend zero time on wiring | ||
up APIs or building SEO, Accessibility, and Performance-optimized ecommerce components you've probably written many | ||
times before. You can instead go straight to work building your brand and making this your own. | ||
|
||
<div align="center"> | ||
|
||
![-----------------------------------------------------](https://storage.googleapis.com/bigcommerce-developers/images/catalyst_readme_hr.png) | ||
|
||
</div> | ||
|
||
<p align="center"> | ||
<a href="https://www.catalyst.dev">🚀 catalyst.dev</a> • | ||
<a href="https://developer.bigcommerce.com/community">🤗 BigCommerce Developer Community</a> • | ||
<a href="https://github.com/bigcommerce/catalyst/discussions">💬 GitHub Discussions</a> | ||
</p> | ||
|
||
<div align="center"> | ||
|
||
![-----------------------------------------------------](https://storage.googleapis.com/bigcommerce-developers/images/catalyst_readme_hr.png) | ||
|
||
</div> | ||
|
||
## Requirements | ||
|
||
- Node.js 20+ | ||
- `npm` (or `pnpm`/`yarn`) | ||
|
||
## Getting started | ||
|
||
If this installation of Catalyst was created using the `catalyst` CLI, you should already be connected to a store and can get started immediately by running: | ||
|
||
```shell | ||
npm run dev | ||
``` | ||
|
||
If you want to connect to another store or channel, you can run the setup process again by running: | ||
|
||
```shell | ||
npx @bigcommerce/create-catalyst@latest init | ||
``` | ||
|
||
Learn more about Catalyst at [catalyst.dev](https://catalyst.dev). | ||
|
||
## Resources | ||
|
||
- [GraphQL Storefront API Playground](https://developer.bigcommerce.com/graphql-storefront/playground) | ||
- [GraphQL Storefront API Explorer](https://developer.bigcommerce.com/graphql-storefront/explorer) | ||
- [BigCommerce DevDocs](https://developer.bigcommerce.com/docs/build) |
33 changes: 33 additions & 0 deletions
33
app/[locale]/(default)/(faceted)/_components/faceted-search.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { useTranslations } from 'next-intl'; | ||
import { ComponentPropsWithoutRef, PropsWithChildren } from 'react'; | ||
|
||
import { Props as FacetProps, Facets } from './facets'; | ||
import { RefineBy, Props as RefineByProps } from './refine-by'; | ||
|
||
interface Props extends FacetProps, RefineByProps, ComponentPropsWithoutRef<'aside'> { | ||
headingId: string; | ||
} | ||
|
||
export const FacetedSearch = ({ | ||
facets, | ||
headingId, | ||
pageType, | ||
children, | ||
...props | ||
}: PropsWithChildren<Props>) => { | ||
const t = useTranslations('FacetedGroup.FacetedSearch'); | ||
|
||
return ( | ||
<aside aria-labelledby={headingId} {...props}> | ||
<h2 className="sr-only" id={headingId}> | ||
{t('filters')} | ||
</h2> | ||
|
||
{children} | ||
|
||
<RefineBy facets={facets} pageType={pageType} /> | ||
|
||
<Facets facets={facets} pageType={pageType} /> | ||
</aside> | ||
); | ||
}; |
Oops, something went wrong.