generated from vtex-sites/base.store
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Adds tokens to
ImageGallery
(#125)
* Feat: Adds tokens to `ImageGallery` (#143) * Removes unused icons file * Removes unnecessary data-attr * Adds default stories mdx * Renames data-store-image to data-fs-image * Moves image styles to layout.scss * Adjusts tokens for image-gallery * Renames `data-thumbnail-button` to `data-fs-image-gallery-selector-thumbnail` * Adds `data-fs-image-gallery-selector-control-button` data-attr` * Adds image-gallery-selector-elements tokens * Adds tokens data-fs-image-gallery-selector-thumbnail data-attr * Adds tokens documentation * Removes unused args paramenter * Convert px to rem * Updates title * Adds `-mobile` * Updates description * Updates changelog * Updates tokens variables with global tokens * Renames thumbnail selected border color token * Adding Variants section * Reorders Variants section place * Updates Changelog * Removes Image styles import from `Layout` * Fixes `OutOfStock` bug Co-authored-by: Fanny Chien <fannychienn@gmail.com>
- Loading branch information
1 parent
8c61614
commit c9ff10c
Showing
12 changed files
with
299 additions
and
128 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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
167 changes: 167 additions & 0 deletions
167
src/components/ui/ImageGallery/ImageGallery.stories.mdx
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,167 @@ | ||
import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs' | ||
|
||
import { ImageGallery } from '.' | ||
|
||
import { | ||
TokenTable, | ||
TokenRow, | ||
TokenDivider, | ||
} from 'src/../.storybook/components' | ||
|
||
<Meta title="Organisms/ImageGallery" /> | ||
|
||
export const Template = () => { | ||
const productImages = [ | ||
{ | ||
url: 'https://storeframework.vtexassets.com/arquivos/ids/190902/unsplash-magic-mouse.jpg?v=637800136963870000', | ||
alternateName: 'Magicwhite', | ||
}, | ||
{ | ||
url: 'https://storeframework.vtexassets.com/arquivos/ids/190923/lena-de-fanti-nQ_j5d-klVU-unsplash.jpg?v=637867501523500000', | ||
alternateName: 'magicbox', | ||
}, | ||
{ | ||
url: 'https://storeframework.vtexassets.com/arquivos/ids/190924/anthony-choren-e7dG26YCrZU-unsplash.jpg?v=637867501835430000', | ||
alternateName: 'magicblackwhite', | ||
}, | ||
{ | ||
url: 'https://storeframework.vtexassets.com/arquivos/ids/190925/maheshkumar-painam-GZdfLeL-MDk-unsplash.jpg?v=637867502064000000', | ||
alternateName: 'magiccombo', | ||
}, | ||
{ | ||
url: 'https://storeframework.vtexassets.com/arquivos/ids/190926/math-0U9fBLGP3EY-unsplash.jpg?v=637867502325830000', | ||
alternateName: 'magicback', | ||
}, | ||
{ | ||
url: 'https://storeframework.vtexassets.com/arquivos/ids/190927/marek-levak-YPeqMN_wfw0-unsplash.jpg?v=637867502641430000', | ||
alternateName: 'magictable', | ||
}, | ||
{ | ||
url: 'https://storeframework.vtexassets.com/arquivos/ids/190928/mouse8.jpg?v=637867504048970000', | ||
alternateName: 'magichand', | ||
}, | ||
{ | ||
url: 'https://storeframework.vtexassets.com/arquivos/ids/190929/harpal-singh-KuvEVL7lXYQ-unsplash.jpg?v=637867509459130000', | ||
alternateName: 'magicstyle', | ||
}, | ||
{ | ||
url: 'https://storeframework.vtexassets.com/arquivos/ids/190930/chris-hardy-182PzOtcmWc-unsplash.jpg?v=637867509778300000', | ||
alternateName: 'magicscale', | ||
}, | ||
] | ||
return <ImageGallery images={productImages} /> | ||
} | ||
|
||
export const TemplateWithoutSelector = () => { | ||
const productImages = [ | ||
{ | ||
url: 'https://storeframework.vtexassets.com/arquivos/ids/190902/unsplash-magic-mouse.jpg?v=637800136963870000', | ||
alternateName: 'Magicwhite', | ||
}, | ||
] | ||
return <ImageGallery images={productImages} /> | ||
} | ||
|
||
<header> | ||
|
||
# Image Gallery | ||
|
||
An `ImageGallery` is used when you want to display a series of photos in a gallery on a post or page. | ||
|
||
</header> | ||
|
||
## Overview | ||
|
||
According to the quantity of `Image` to be displayed, the `ImageGallerySelector` will be displayed. | ||
|
||
--- | ||
|
||
## Usage | ||
|
||
`import { ImageGallery } from 'src/components/ui/ImageGallery'` | ||
|
||
<Canvas> | ||
<Story name="default">{Template.bind({})}</Story> | ||
</Canvas> | ||
|
||
<TokenTable> | ||
<TokenRow | ||
token="--fs-image-gallery-width" | ||
value="calc(100% + (2 * var(--fs-grid-padding)))" | ||
/> | ||
<TokenRow | ||
token="--fs-image-gallery-image-border-radius" | ||
value="var(--fs-border-radius)" | ||
/> | ||
<TokenDivider /> | ||
<TokenRow token="--fs-image-gallery-gap-mobile" value="var(--fs-spacing-2)" /> | ||
<TokenRow | ||
token="--fs-image-gallery-gap-notebook" | ||
value="var(--fs-spacing-3)" | ||
/> | ||
</TokenTable> | ||
|
||
--- | ||
|
||
## Nested Elements | ||
|
||
### Selector | ||
|
||
<TokenTable> | ||
<TokenRow token="--fs-image-gallery-selector-max-height" value="33.125rem" /> | ||
</TokenTable> | ||
|
||
### Selector Elements | ||
|
||
<TokenTable> | ||
<TokenRow | ||
token="--fs-image-gallery-selector-elements-gap" | ||
value="var(--fs-spacing-1)" | ||
/> | ||
<TokenRow | ||
token="--fs-image-gallery-selector-elements-gap-notebook" | ||
value="var(--fs-spacing-2)" | ||
/> | ||
<TokenRow | ||
token="--fs-image-gallery-selector-elements-padding" | ||
value="var(--fs-spacing-0)" | ||
/> | ||
</TokenTable> | ||
|
||
### Selector Thumbnail | ||
|
||
<TokenTable> | ||
<TokenRow | ||
token="--fs-image-gallery-selector-thumbnail-width-mobile" | ||
value="3.5rem" | ||
/> | ||
<TokenRow | ||
token="--fs-image-gallery-selector-thumbnail-width-notebook" | ||
value="4.5rem" | ||
/> | ||
<TokenRow | ||
token="--fs-image-gallery-selector-thumbnail-border-radius" | ||
value="var(--fs-border-radius)" | ||
/> | ||
<TokenRow | ||
token="--fs-image-gallery-selector-thumbnail-selected-border-color" | ||
value="var(--fs-border-color-active)" | ||
isColor | ||
/> | ||
</TokenTable> | ||
|
||
--- | ||
|
||
## Variants | ||
|
||
### With Selector (More than 1 Image) | ||
|
||
<Canvas> | ||
<Story name="overview-default">{Template.bind({})}</Story> | ||
</Canvas> | ||
|
||
### Without Selector | ||
|
||
<Canvas> | ||
<Story name="overview-default-2">{TemplateWithoutSelector.bind({})}</Story> | ||
</Canvas> |
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
Oops, something went wrong.
c9ff10c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
gatsby-store-storybook – ./
gatsby-store-storybook-git-main-faststore.vercel.app
gatsby-store-pi.vercel.app
gatsby-store-storybook-faststore.vercel.app