-
Notifications
You must be signed in to change notification settings - Fork 14
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(components): create post-list component #3812
base: main
Are you sure you want to change the base?
Conversation
…ss-to-attribute-in-stencil-config
…drated attribute selector in snapshot e2e tests
…drated instead of the hydrated class
…y use the attribute data-hydrated instead of the hydrated class
…nstead of the hydrated class
…napshots`, so they use the attribute data-hydrated instead of the hydrated class
…ss-to-attribute-in-stencil-config
🦋 Changeset detectedLatest commit: 00f1c2e The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Related Previews |
Co-authored-by: Alizé Debray <[email protected]>
…em.tsx Co-authored-by: Alizé Debray <[email protected]>
Co-authored-by: Alizé Debray <[email protected]>
…ot.stories.ts Co-authored-by: Alizé Debray <[email protected]>
…s.ts Co-authored-by: Alizé Debray <[email protected]>
…s.ts Co-authored-by: Alizé Debray <[email protected]>
bd0bf11
to
e8b9e27
Compare
packages/documentation/src/stories/components/list/list.docs.mdx
Outdated
Show resolved
Hide resolved
packages/documentation/src/stories/components/list/list.stories.ts
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
## `<post-list>` | ||
|
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.
## `<post-list>` |
render: args => | ||
html`<post-list | ||
title-hidden="${args.titleHidden ? args.titleHidden : nothing}" | ||
horizontal="${args.horizontal ? args.horizontal : nothing}" | ||
style="${args.listTitleGap !== null | ||
? `--post-list-title-gap: ${args.listTitleGap}rem;` | ||
: ''}${args.listItemGap !== null ? ` --post-list-item-gap: ${args.listItemGap}rem` : ''}" | ||
> | ||
<h3>Title</h3> | ||
<post-list-item>List Item 1</post-list-item> | ||
<post-list-item>List Item 2</post-list-item> | ||
<post-list-item>List Item 3</post-list-item> | ||
</post-list> `, |
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.
render: args => | |
html`<post-list | |
title-hidden="${args.titleHidden ? args.titleHidden : nothing}" | |
horizontal="${args.horizontal ? args.horizontal : nothing}" | |
style="${args.listTitleGap !== null | |
? `--post-list-title-gap: ${args.listTitleGap}rem;` | |
: ''}${args.listItemGap !== null ? ` --post-list-item-gap: ${args.listItemGap}rem` : ''}" | |
> | |
<h3>Title</h3> | |
<post-list-item>List Item 1</post-list-item> | |
<post-list-item>List Item 2</post-list-item> | |
<post-list-item>List Item 3</post-list-item> | |
</post-list> `, | |
render: args => { | |
let styles; | |
if (args.listTitleGap) styles += `--post-list-title-gap: ${args.listTitleGap};`; | |
if (args.listItemGap) styles += `--post-list-item-gap: ${args.listItemGap};`; | |
return html`<post-list | |
title-hidden="${args.titleHidden ? args.titleHidden : nothing}" | |
horizontal="${args.horizontal ? args.horizontal : nothing}" | |
style="${styles ? styles : nothing}" | |
> | |
<h3>Title</h3> | |
<post-list-item>List Item 1</post-list-item> | |
<post-list-item>List Item 2</post-list-item> | |
<post-list-item>List Item 3</post-list-item> | |
</post-list> `; | |
}, |
listItemGap: { | ||
name: '--post-list-item-gap', | ||
description: 'Defines the gap between list items.', | ||
control: { type: 'number', min: 0, max: 10, step: 1 }, |
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.
control: { type: 'number', min: 0, max: 10, step: 1 }, | |
control: { type: 'text' }, |
listTitleGap: { | ||
name: '--post-list-title-gap', | ||
description: 'Defines the gap between the title and the list items.', | ||
control: { type: 'number', min: 0, max: 10, step: 1 }, |
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.
control: { type: 'number', min: 0, max: 10, step: 1 }, | |
control: { type: 'text' }, |
/** | ||
* The unique title of the list that is also referenced in the labelledby | ||
*/ | ||
@State() uuid: string; |
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.
@State() uuid: string; | |
@State() titleId: string; |
/** | ||
* Get the id set on the host element or use a random id by default | ||
*/ | ||
this.uuid = `list-${crypto.randomUUID()}`; |
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.
this.uuid = `list-${crypto.randomUUID()}`; | |
this.titleId= `list-title-${crypto.randomUUID()}`; |
<Host data-version={version}> | ||
<div | ||
ref={el => (this.titleEl = el)} | ||
id={this.uuid} |
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.
id={this.uuid} | |
id={this.titleId} |
> | ||
<slot></slot> | ||
</div> | ||
<div role="list" aria-labelledby={this.uuid}> |
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.
<div role="list" aria-labelledby={this.uuid}> | |
<div role="list" aria-labelledby={this.titleId}> |
No description provided.