Skip to content
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

Update file anatomy to not use slots #805

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions site/src/components/anatomy-components.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React from 'react'
import './anatomy-component.css'

export const AnatomyWrapper = ({ children }) => (
export const AnatomyWrapper = ({ children, showToggle = true }) => (
<div className="component-anatomy-wrapper">
<input type="checkbox" id="show-slots" />
<label htmlFor="show-slots"> Show slots</label>
{showToggle && (
<>
<input type="checkbox" id="show-slots" />
<label htmlFor="show-slots"> Show slots</label>
</>
)}
<div className="component-anatomy">{children}</div>
</div>
)
Expand Down
10 changes: 3 additions & 7 deletions site/src/components/file-anatomy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ import { AnatomyWrapper, Host, Part, Slot } from './anatomy-components'

const FileAnatomy = () => {
return (
<AnatomyWrapper>
<AnatomyWrapper showToggle={false}>
<Host name="openui-file">
<Part name="file-selector-button">
<Slot name="button" />
</Part>
<Part name="label">
<Slot name="label" />
</Part>
<Part name="file-selector-button" />
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be button type=file-selector to match selectlist? If so should anatomy show pseudos? Or should they be part of the explainer instead?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we wait for selectlist to settle down and progress further before we should really copy anything it did or is doing? I hate to see you adjust this many many times and it's tricky because I feel like we can't say we really know the answer.

<Part name="label" />
</Host>
</AnatomyWrapper>
)
Expand Down