-
Notifications
You must be signed in to change notification settings - Fork 336
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): Disclosure (fka Accordion) #5873
feat(components): Disclosure (fka Accordion) #5873
Conversation
Port from Accordion to React Aria Disclosure and DisclosureGroup
export const disclosureGroupCss = css` | ||
& > * { | ||
width: 100%; | ||
.react-aria-Heading { | ||
width: 100%; | ||
.react-aria-Button[slot="trigger"] { | ||
width: 100%; | ||
} | ||
} | ||
} | ||
`; |
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'm thinking of just putting this on the disclosure itself and not having any styles for the group.
Right now you have to wrap a single Disclosure in a group if you want it to fill its container, otherwise its only as long as its title.
Either that, or I add a width prop to Disclosure
> | ||
<PlaygroundTemplate | ||
<DisclosureGroup defaultExpandedKeys={["prompts"]}> | ||
<Disclosure id="prompts"> |
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 originally had a size of "L". Stashing and unstashing this, I can't really tell a difference in size
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 you may be right that there's only one size
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.
Turns out L was valuable. It made the accordions on this page all the same height, which matters when one accordion has nested controls
<ModelEmbeddingsTable model={data} /> | ||
</DisclosurePanel> | ||
</Disclosure> | ||
<Disclosure id="dimensions"> |
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.
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 ran through all of the embedding usages before pushing. I honestly can't tell which border is missing from this screenshot 😅
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'd expect there to be a visual separation between the table pagination and the row that says "Dimensions"
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.
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.
Nice one - some minor style nits. LMK if you want another set of eyes
<StopPropagation> | ||
<Flex direction="row" gap="size-100" alignItems="center"> | ||
<TemplateLanguageRadioGroup /> | ||
<AddPromptButton /> | ||
</Flex> | ||
</StopPropagation> |
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.
There's a bit of visual regression here where I think the "actions" should still be right aligned
Also the addition of the nested values causes the trigger hight to grow. Can we use a different sizing strategy so that these triggers stay the same height? I know it looks odd padding wise but it might be the lesser of two evils right now?
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.
<ModelEmbeddingsTable model={data} /> | ||
</DisclosurePanel> | ||
</Disclosure> | ||
<Disclosure id="dimensions"> |
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'd expect there to be a visual separation between the table pagination and the row that says "Dimensions"
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.
Double approved
Port from Accordion to React Aria Disclosure and DisclosureGroup
New.Accordion.mov
Resolves #5855