Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add search use cases to the search code sample #44

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This repository holds code samples that demonstrate how to implement the various

| Name | Tech stack | Preview |
|-------------------------------------------------------------------|-----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Search](./examples/search/README.md) | TypeScript, Tailwind CSS, Limitless UI, React | [![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/github/bloomreach/web-code-samples/tree/main/examples/search) |
| [Search & Search Usecases](./examples/search/README.md) | TypeScript, Tailwind CSS, Limitless UI, React | [![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/github/bloomreach/web-code-samples/tree/main/examples/search) |
| [Autosuggest](./examples/autosuggest/README.md) | TypeScript, Tailwind CSS, React | [![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/github/bloomreach/web-code-samples/tree/main/examples/autosuggest) |
| [Recommendations](./examples/recommendations/README.md) | JavaScript, Tailwind CSS, React | [![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/github/bloomreach/web-code-samples/tree/main/examples/recommendations) |
| [Facets](./examples/facets/README.md) | JavaScript, Tailwind CSS, React | [![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/github/bloomreach/web-code-samples/tree/main/examples/facets) |
Expand Down
13 changes: 11 additions & 2 deletions examples/autosuggest/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
InputField,
SearchIcon,
LoaderIcon,
ExternalLinkIcon,
TabPanel,
Tab,
Tabs,
Expand Down Expand Up @@ -85,17 +86,25 @@ export default function App() {
<ToggleField
className="text-slate-300 toggle-field"
label="Show JSON"
inputProps={{ id: "show-json-toggle" }}
inputProps={{id: "show-json-toggle"}}
checked={showJson}
onChange={() => setShowJson(!showJson)}
/>
<a
href="https://github.com/bloomreach/web-code-samples/discussions/new"
target="_blank"
className="flex gap-2 items-center font-semibold bg-amber-300 text-slate-800 mx-2 px-2 rounded"
>
Feedback
<ExternalLinkIcon size={10}/>
</a>
</div>
</div>
<div className="app p-2 max-w-5xl w-full mx-auto grow">
<div className="flex gap-2 items-center mt-4 mb-8">
<div className="flex gap-2 items-center grow">
<a href="https://bloomreach.com" target="_blank">
<img src={BrLogo} width={150} />
<img src={BrLogo} width={150}/>
</a>
<span>✨</span>
<div className="text-lg font-semibold text-[#002840]">Autosuggest</div>
Expand Down
28 changes: 14 additions & 14 deletions examples/autosuggest/src/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export const Footer = () => {
<div className="my-2 text-sm">
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://github.com/bloomreach/web-code-samples/tree/main/examples/autosuggest"
>
See the source on Github <ExternalLinkIcon size={12}/>
See the source on Github <ExternalLinkIcon className="inline" size={12}/>
</a>
</div>
</div>
Expand All @@ -42,23 +42,23 @@ export const Footer = () => {
<li>
<a
target="_blank"
className="text-slate-500 flex flex-row gap-2 items-center hover:underline"
className="text-slate-500 hover:underline"
href="https://documentation.bloomreach.com/discovery/docs/autosuggest"
>
Autosuggest
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
<li>
<a
target="_blank"
className="text-slate-500 flex flex-row gap-2 items-center hover:underline"
className="text-slate-500 hover:underline"
href="https://documentation.bloomreach.com/discovery/reference/autosuggest-api"
>
Autosuggest API reference
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
</ul>
Expand All @@ -71,49 +71,49 @@ export const Footer = () => {
<li>
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://documentation.bloomreach.com/discovery/docs/discovery-sdks"
rel="noreferrer"
>
Bloomreach SDK
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
<li>
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://bloomreach.github.io/limitless-ui-react"
rel="noreferrer"
>
Limitless commerce UI kit
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
<li>
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://documentation.bloomreach.com/discovery/docs/discovery-web-code-samples"
rel="noreferrer"
>
Web code samples
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
<li>
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://github.com/bloomreach/sample-catalogs"
rel="noreferrer"
>
Sample catalogs
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
</ul>
Expand Down
9 changes: 9 additions & 0 deletions examples/categories/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import JsonView from "@uiw/react-json-view";
import {
ToggleField,
LoaderIcon,
ExternalLinkIcon,
} from "@bloomreach/react-banana-ui";
import "@bloomreach/react-banana-ui/style.css";

Expand Down Expand Up @@ -91,6 +92,14 @@ export default function App() {
checked={showJson}
onChange={() => setShowJson(!showJson)}
/>
<a
href="https://github.com/bloomreach/web-code-samples/discussions/new"
target="_blank"
className="flex gap-2 items-center font-semibold bg-amber-300 text-slate-800 mx-2 px-2 rounded"
>
Feedback
<ExternalLinkIcon size={10}/>
</a>
</div>
</div>
<div className="app p-2 max-w-5xl w-full mx-auto grow">
Expand Down
26 changes: 14 additions & 12 deletions examples/categories/src/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ export const Footer = () => {
<div className="my-2 text-sm">
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://github.com/bloomreach/web-code-samples/tree/main/examples/categories"
>
See the source on Github <ExternalLinkIcon size={12}/>
See the source on Github
{' '}
<ExternalLinkIcon className="inline" size={12}/>
</a>
</div>
</div>
Expand All @@ -42,12 +44,12 @@ export const Footer = () => {
<li>
<a
target="_blank"
className="text-slate-500 flex flex-row gap-2 items-center hover:underline"
className="text-slate-500 hover:underline"
href="https://documentation.bloomreach.com/discovery/reference/search-category-trees"
>
Search category trees
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
</ul>
Expand All @@ -60,49 +62,49 @@ export const Footer = () => {
<li>
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://documentation.bloomreach.com/discovery/docs/discovery-sdks"
rel="noreferrer"
>
Bloomreach SDK
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
<li>
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://bloomreach.github.io/limitless-ui-react"
rel="noreferrer"
>
Limitless commerce UI kit
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
<li>
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://documentation.bloomreach.com/discovery/docs/discovery-web-code-samples"
rel="noreferrer"
>
Web code samples
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
<li>
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://github.com/bloomreach/sample-catalogs"
rel="noreferrer"
>
Sample catalogs
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
</ul>
Expand Down
9 changes: 9 additions & 0 deletions examples/dynamic-grouping/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
SearchIcon,
Pagination,
LoaderIcon,
ExternalLinkIcon,
} from "@bloomreach/react-banana-ui";
import { useEffect, useMemo, useState } from "react";
import _ from "lodash";
Expand Down Expand Up @@ -83,6 +84,14 @@ export default function App() {
checked={showJson}
onChange={() => setShowJson(!showJson)}
/>
<a
href="https://github.com/bloomreach/web-code-samples/discussions/new"
target="_blank"
className="flex gap-2 items-center font-semibold bg-amber-300 text-slate-800 mx-2 px-2 rounded"
>
Feedback
<ExternalLinkIcon size={10}/>
</a>
</div>
</div>
<div className="app p-2 max-w-5xl w-full mx-auto grow">
Expand Down
34 changes: 18 additions & 16 deletions examples/dynamic-grouping/src/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ export const Footer = () => {
<div className="my-2 text-sm">
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://github.com/bloomreach/web-code-samples/tree/main/examples/dynamic-grouping"
>
See the source on Github <ExternalLinkIcon size={12}/>
See the source on Github
{' '}
<ExternalLinkIcon className="inline" size={12}/>
</a>
</div>
</div>
Expand All @@ -43,34 +45,34 @@ export const Footer = () => {
<li>
<a
target="_blank"
className="text-slate-500 flex flex-row gap-2 items-center hover:underline"
className="text-slate-500 hover:underline"
href="https://documentation.bloomreach.com/discovery/docs/dynamic-grouping"
>
Dynamic Grouping
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
<li>
<a
target="_blank"
className="text-slate-500 flex flex-row gap-2 items-center hover:underline"
className="text-slate-500 hover:underline"
href="https://documentation.bloomreach.com/discovery/reference/dynamic-grouping-api"
>
Dynamic Grouping API
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
<li>
<a
target="_blank"
className="text-slate-500 flex flex-row gap-2 items-center hover:underline"
className="text-slate-500 hover:underline"
href="https://documentation.bloomreach.com/discovery/reference/dynamic-grouping-api"
>
Group merchandising
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
</ul>
Expand All @@ -83,49 +85,49 @@ export const Footer = () => {
<li>
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://documentation.bloomreach.com/discovery/docs/discovery-sdks"
rel="noreferrer"
>
Bloomreach SDK
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
<li>
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://bloomreach.github.io/limitless-ui-react"
rel="noreferrer"
>
Limitless commerce UI kit
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
<li>
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://documentation.bloomreach.com/discovery/docs/discovery-web-code-samples"
rel="noreferrer"
>
Web code samples
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
<li>
<a
target="_blank"
className="text-slate-500 hover:underline flex flex-row gap-2 items-center"
className="text-slate-500 hover:underline"
href="https://github.com/bloomreach/sample-catalogs"
rel="noreferrer"
>
Sample catalogs
{' '}
<ExternalLinkIcon size={12}/>
<ExternalLinkIcon className="inline" size={12}/>
</a>
</li>
</ul>
Expand Down
Loading