-
Notifications
You must be signed in to change notification settings - Fork 21
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 related prompts list component #1680
base: main
Are you sure you want to change the base?
Conversation
packages/x-components/src/x-modules/related-prompts/components/related-prompts-tag-list.vue
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/related-prompts/components/related-prompts-tag-list.vue
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/related-prompts/components/related-prompt.vue
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/related-prompts/components/related-prompt.vue
Outdated
Show resolved
Hide resolved
:class="[{ 'x-related-prompt-selected__button': isSelected(index) }]" | ||
> | ||
<slot name="related-prompt-button-info"> | ||
<div class="x-related-prompt__button-info"> |
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.
Hi, can we convert this div into a span
?
A div
is not allowed inside a button
, it can lead to accessibility issues, e.g. for screen readers
Or maybe the right approach is not using a button tag above, otherwise, we can't grant that the content inside the slot is an HTML allowed one.
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.
with a div
element instead of a button
seems to work fine
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.
Then I would add there a role=button
and an aria-pressed
attributes for assistive technologies
</span> | ||
</div> | ||
<CrossTinyIcon v-if="isSelected(index)" class="x-icon-lg" /> | ||
<PlusIcon v-else class="x-icon-neutral-80 x-icon-lg" /> |
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.
Maybe colors should be customizable for customers
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.
yes, it was a mistake, that class should not be there
packages/x-components/src/x-modules/related-prompts/components/related-prompt.vue
Outdated
Show resolved
Hide resolved
packages/x-components/src/x-modules/related-prompts/components/related-prompt.vue
Outdated
Show resolved
Hide resolved
Hi, I miss the |
nextQueryButtonClass: { | ||
type: String, | ||
default: 'x-button-outlined' |
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.
I think we should keep this level of customization, so we can add a class to modify spacing or add background colors as per customer's requirements.
Pull request template
We need to simplify the implementation of related prompts in new setups. Copy-pasting the same components and logic in every setup is not a good practice, so we have added a new component (
RelatedPromptsTagList
) to the base project.Motivation and context
Type of change
What is the destination branch of this PR?
Main
How has this been tested?
Tests performed according to testing guidelines:
Checklist: