-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into louis-bompart-patch-1
- Loading branch information
Showing
21 changed files
with
657 additions
and
11 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 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
106 changes: 106 additions & 0 deletions
106
...omponents/atomic-product-multi-value-text/atomic-product-multi-value-text.new.stories.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,106 @@ | ||
import {wrapInCommerceInterface} from '@coveo/atomic-storybook-utils/commerce/commerce-interface-wrapper'; | ||
import {wrapInCommerceProductList} from '@coveo/atomic-storybook-utils/commerce/commerce-product-list-wrapper'; | ||
import {wrapInProductTemplate} from '@coveo/atomic-storybook-utils/commerce/commerce-product-template-wrapper'; | ||
import {parameters} from '@coveo/atomic-storybook-utils/common/common-meta-parameters'; | ||
import {renderComponent} from '@coveo/atomic-storybook-utils/common/render-component'; | ||
import {getSampleCommerceEngineConfiguration} from '@coveo/headless/commerce'; | ||
import type {Meta, StoryObj as Story} from '@storybook/web-components'; | ||
import {html} from 'lit/static-html.js'; | ||
|
||
const baseConfiguration = getSampleCommerceEngineConfiguration(); | ||
|
||
const {decorator: productDecorator} = wrapInProductTemplate(); | ||
const {decorator: commerceProductListDecorator} = wrapInCommerceProductList(); | ||
const {decorator: commerceInterfaceDecorator, play} = wrapInCommerceInterface({ | ||
engineConfig: { | ||
...baseConfiguration, | ||
context: { | ||
...baseConfiguration.context, | ||
view: { | ||
url: 'https://sports.barca.group/browse/promotions/ui-kit-testing-product-multi-value-text', | ||
}, | ||
}, | ||
}, | ||
type: 'product-listing', | ||
}); | ||
|
||
const meta: Meta = { | ||
component: 'atomic-product-multi-value-text', | ||
title: 'Atomic-Commerce/Product Template Components/MultiValueText', | ||
id: 'atomic-product-multi-value-text', | ||
render: renderComponent, | ||
parameters, | ||
play, | ||
args: { | ||
'attributes-field': 'cat_available_sizes', | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
export const Default: Story = { | ||
name: 'atomic-product-multi-value-text', | ||
decorators: [ | ||
productDecorator, | ||
commerceProductListDecorator, | ||
commerceInterfaceDecorator, | ||
], | ||
}; | ||
|
||
export const WithDelimiter: Story = { | ||
name: 'With delimiter', | ||
decorators: [ | ||
productDecorator, | ||
commerceProductListDecorator, | ||
commerceInterfaceDecorator, | ||
], | ||
args: { | ||
'attributes-field': 'ec_product_id', | ||
'attributes-delimiter': '_', | ||
}, | ||
}; | ||
|
||
export const WithMaxValuesToDisplaySetToMinimum: Story = { | ||
name: 'With max values to display set to minimum', | ||
decorators: [ | ||
productDecorator, | ||
commerceProductListDecorator, | ||
commerceInterfaceDecorator, | ||
], | ||
args: { | ||
'attributes-max-values-to-display': 1, | ||
}, | ||
}; | ||
|
||
export const WithMaxValuesToDisplaySetToTotalNumberOfValues: Story = { | ||
name: 'With max values to display set to total number of values', | ||
decorators: [ | ||
productDecorator, | ||
commerceProductListDecorator, | ||
commerceInterfaceDecorator, | ||
], | ||
args: { | ||
'attributes-max-values-to-display': 6, | ||
}, | ||
}; | ||
|
||
export const InAPageWithTheCorrespondingFacet: Story = { | ||
name: 'In a page with the corresponding facet', | ||
decorators: [ | ||
productDecorator, | ||
commerceProductListDecorator, | ||
(story) => { | ||
return html` | ||
<atomic-commerce-layout> | ||
<atomic-layout-section section="facets" | ||
><atomic-commerce-facets></atomic-commerce-facets> | ||
</atomic-layout-section> | ||
<atomic-layout-section section="main"> | ||
${story()} | ||
</atomic-layout-section> | ||
</atomic-commerce-layout> | ||
`; | ||
}, | ||
commerceInterfaceDecorator, | ||
], | ||
}; |
19 changes: 19 additions & 0 deletions
19
...-template-components/atomic-product-multi-value-text/atomic-product-multi-value-text.pcss
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,19 @@ | ||
:host { | ||
> ul { | ||
display: flex; | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
|
||
li { | ||
display: inline-block; | ||
} | ||
} | ||
} | ||
|
||
.separator { | ||
&::before { | ||
display: inline; | ||
content: ',\00a0'; | ||
} | ||
} |
Oops, something went wrong.