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: Adds tokens to Filter #139

Merged
merged 37 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0c75060
Extracts FilterSlider components and uses CSS Modules and tokens
eduardoformiga Jun 16, 2022
eed198a
Adds CSS Modules to Accordion
eduardoformiga Jun 16, 2022
bc7aa5a
Adds Accordion theming tokens
eduardoformiga Jun 16, 2022
f08a6a3
Adds Changelog Entry
eduardoformiga Jun 16, 2022
adc743d
Moves styles to accordion component
eduardoformiga Jun 17, 2022
2ecf693
Creates Accordion stories
eduardoformiga Jun 17, 2022
86447ea
Adds Accordion stories
eduardoformiga Jun 17, 2022
8d10918
Merge branch 'feat/theming-accordion-fsss-372' into feat/theming-filt…
eduardoformiga Jun 20, 2022
a89bdc9
Adds tokens to facets
eduardoformiga Jun 20, 2022
6093ae5
Adds tokens to Filter Slider
eduardoformiga Jun 20, 2022
39424ba
Creates Filter Stories
eduardoformiga Jun 21, 2022
a2a159c
Removes unused imports from Filter stories
eduardoformiga Jun 21, 2022
2395f8a
Adds Filter facet description
eduardoformiga Jun 21, 2022
3abad91
Creates facets stories
eduardoformiga Jun 21, 2022
6701736
Removes unused import from facets stories
eduardoformiga Jun 21, 2022
5887dc0
Crestes FilterSlider stories
eduardoformiga Jun 21, 2022
e1787e8
Adds CHANGELOG entry
eduardoformiga Jun 21, 2022
38c68e8
Merge branch 'main' into feat/theming-filter-fsss-380 and resolves co…
eduardoformiga Jun 22, 2022
def9536
Updates Filter related stories with PriceRange changes
eduardoformiga Jun 22, 2022
0edd873
Updates Filter related components links on storybook
eduardoformiga Jun 22, 2022
9986828
Update src/components/search/Filter/Facets.stories.mdx
eduardoformiga Jun 23, 2022
ceee86b
Merge branch 'main' of https://github.com/vtex-sites/nextjs.store int…
renatamottam Jun 28, 2022
159edac
Fixes merge glitch
renatamottam Jun 28, 2022
47fa33d
Fixes `Filter` Overview doc naming
renatamottam Jun 28, 2022
a692b7a
Improves `Filter` Overview doc page
renatamottam Jun 28, 2022
1099db9
Creates `SectionList` Storybook component
renatamottam Jun 28, 2022
f5d4dcc
Improves `Facets` and `FilterSlider` doc pages
renatamottam Jun 28, 2022
a4c1204
Adds extra links for Related Components
renatamottam Jun 28, 2022
a1f9775
Adds components links
renatamottam Jun 28, 2022
5417fe2
Merge branch 'main' into feat/theming-filter-fsss-380
eduardoformiga Jun 28, 2022
a053358
Merge branch 'main' into feat/theming-filter-fsss-380
eduardoformiga Jun 29, 2022
2f2f65b
Disable control for facets stories
eduardoformiga Jun 29, 2022
e3c423f
Merge branch 'feat/theming-filter-fsss-380' of https://github.com/vte…
eduardoformiga Jun 29, 2022
ab1a5e2
Disable controls for FilterSliders stories
eduardoformiga Jun 29, 2022
31b4ca2
Update src/components/search/Filter/Filter.stories.mdx
eduardoformiga Jun 29, 2022
e56b4d9
Update src/components/search/Filter/Filter.stories.mdx
eduardoformiga Jun 29, 2022
b2633e7
Update src/components/search/Filter/Filter.stories.mdx
eduardoformiga Jun 29, 2022
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
39 changes: 39 additions & 0 deletions .storybook/components/SectionItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React, { PropsWithChildren, ReactNode } from 'react'

import ButtonLink from '../../src/components/ui/Button/ButtonLink'
import Icon from '../../src/components/ui/Icon'

type SectionItemProps = {
title: string
description: string | ReactNode
actionPath?: string
}

const SectionItem = ({
title,
description,
children,
actionPath,
}: PropsWithChildren<SectionItemProps>) => {
return (
<li className="sbdocs-li">
<div className="sbdocs-div">{children}</div>
<article className="sbdocs-list-text">
<h3 className="sbdocs sbdocs-h3">{title}</h3>
<p>{description}</p>
{actionPath && (
<ButtonLink
variant="tertiary"
href={actionPath}
data-fs-button-size="small"
>
See more
<Icon name="ArrowRight" width="18" height="18" weight="bold" />
</ButtonLink>
)}
</article>
</li>
)
}

export default SectionItem
25 changes: 25 additions & 0 deletions .storybook/components/SectionList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react'
import type { PropsWithChildren } from 'react'

type SectionListProps = {
grid?: 'row' | 'grid'
}

const SectionList = ({
children,
grid = 'row',
}: PropsWithChildren<SectionListProps>) => {
return (
<section className="sbdocs-list">
<ul
className={`sbdocs-ul ${
grid === 'grid' ? 'sbdocs-ul-grid' : 'sbdocs-ul-row'
}`}
>
{children}
</ul>
</section>
)
}

export default SectionList
2 changes: 2 additions & 0 deletions .storybook/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ export { default as TokenRow } from './TokenRow'
export { default as BestPractices } from './BestPractices'
export { default as BestPracticesRule } from './BestPracticesRule'
export { default as TokenDivider } from './TokenDivider'
export { default as SectionList } from './SectionList'
export { default as SectionItem } from './SectionItem'
export { default as Callout } from './Callout'
61 changes: 47 additions & 14 deletions .storybook/storybook.css
Original file line number Diff line number Diff line change
Expand Up @@ -210,40 +210,30 @@ h3.sbdocs.sbdocs-h3 {

.sbdocs-list .sbdocs-ul {
display: flex;
flex-direction: column;
row-gap: var(--fs-spacing-4);
column-gap: var(--fs-spacing-4);
justify-content: center;
width: 100%;
padding: 0;
margin-top: var(--fs-spacing-4);
}

.sbdocs-list .sbdocs-li {
display: flex;
flex-basis: 100%;
column-gap: var(--fs-spacing-4);
align-items: center;
justify-content: space-between;
}

.sbdocs-list .sbdocs-li > * {
flex-shrink: 0;
width: 48%;
}

.sbdocs-list .sbdocs-li > div {
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
min-height: 140px;
max-height: 300px;
padding: var(--fs-spacing-3);
background-color: var(--fs-color-neutral-1);
border-radius: var(--fs-border-radius);
}

.sbdocs-list .sbdocs-div > img {
width: auto;
max-height: 100%;
border-radius: var(--fs-border-radius);
}
Expand All @@ -264,6 +254,49 @@ h3.sbdocs.sbdocs-h3 {
margin-left: calc(-1 * var(--fs-spacing-1));
}

.sbdocs-list .sbdocs-li {
display: flex;
flex-basis: 100%;
row-gap: var(--fs-spacing-4);
column-gap: var(--fs-spacing-4);
}

/* List Row */

.sbdocs-ul.sbdocs-ul-row {
flex-direction: column;
}

.sbdocs-ul.sbdocs-ul-row .sbdocs-li {
align-items: center;
justify-content: space-between;
}

.sbdocs-ul.sbdocs-ul-row .sbdocs-li > * {
flex-shrink: 0;
width: 48%;
}

/* List Grid */

.sbdocs-ul.sbdocs-ul-grid .sbdocs-li {
flex-direction: column;
align-items: baseline;
}

.sbdocs-ul.sbdocs-ul-grid .sbdocs-list-text {
display: flex;
flex-basis: 40%;
flex-direction: column;
align-items: baseline;
}

.sbdocs-ul.sbdocs-ul-grid .sbdocs-list-text p { margin-bottom: var(--fs-spacing-3); }

.sbdocs-ul.sbdocs-ul-grid .sbdocs-list-text [data-fs-button] {
margin-top: auto;
}

/* Callout */

.sbdocs-callout {
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Applies new local tokens to `Filter` ([#139](https://github.com/vtex-sites/nextjs.store/pull/139))
- Applies new local tokens to `Tiles` ([#134](https://github.com/vtex-sites/nextjs.store/pull/134))
- Applies new local tokens to `ProductGrid` ([#144](https://github.com/vtex-sites/nextjs.store/pull/144))
- Applies new local tokens to `Accordion` ([#130](https://github.com/vtex-sites/nextjs.store/pull/130))
renatamottam marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/plp.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Search page Filters and Sorting options', () => {
const value = $checkbox.attr('data-value')
// const quantity = $checkbox.attr('data-quantity')

cy.getById('filter-modal-button-apply')
cy.getById('filter-slider-button-apply')
.click()

.then(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/regionalization/Regionalization.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ With the Regionalization feature enabled, if a customer enters their ZIP code wh
## Components

<section className="sbdocs-list">
<ul>
<ul className="sbdocs-ul-row">
<li>
<div>
<SessionProvider>
Expand Down
Loading