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

Panels #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
104 changes: 104 additions & 0 deletions proposed/panel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Panel

* Author: `Walter Tamboer <[email protected]>`
* Date: `18-12-2016`
* Repository name: `polderknowledge/parsy-panel`

## Goals

The panel pattern can be used to group content together. A page could contain
multiple panels. A panel is a section on a page that can be used to identify
content, it exists out of three parts:

1. A header
2. A body
3. A footer

The body contains the content of the panel, the header can be used to add an
Copy link
Contributor

Choose a reason for hiding this comment

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

Please state that header and footer are both optional.

optional title to the content and the footer can be used to put secondary text
and/or buttons.

## References
- [The Bootstrap library has an implementation of panels.][reference-bootstrap]
- [The Foundation library has an implementation of panels.][reference-foundation]
- [JIRA has an implementation of what I call panels on its dashboard][reference-jira]

## Requirements

- It must be possible to style the component in any way one likes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use a upper-cased must. This improves the readability of the requirements

- The panel component must have three sections, a header, a body and a footer.
- The component is a static component so no interaction is required.
- It must be possible to add options to the panel header. This way it becomes
possible to add tabs or icons on the right side of the panel header.

# Case studies

A great example can be seen in the [template called Avant][avant-panels]. It's
clearly visible how each example is wrapped in a panel. It also shows why options
could be useful in the panel header. The Avant examples show an icon and tabs.

## Existing implementations

The best implementation I've found is the one from [Bootstrap][reference-bootstrap].
It has implemented the header, body and footer like described in this proposal.

## Proof of concept

* https://codepen.io/waltertamboer/pen/PbVobj

## API

Talk primarily about the public API of the components (both in templates and in
component code). The following is an example API format that you can re-use.

## Constraints

It is invalid to create an `<span>` with for example the classes `block spread`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this needs to be removed?

Component

## Classes

Name | Description
----------------|-------------------------------------------------------------
panel-container | The wrapper for a panel.
panel-header | The class that defines a panel header.
panel-options | The class that defines options that can be used in a header.
panel-body | The class that defines the panel body.
panel-footer | The class that defines a panel footer.

## Accessibility

The component will resize according the size of the device' screen. The options
that can be part of the header should be handled separately. On small devices
these options might not be visible correctly but this should be investigated.
Copy link
Contributor

Choose a reason for hiding this comment

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

Depending on the type of options we could add a hamburger like menu? This might work for buttons and dropdown menus.

Copy link
Contributor

@renstah renstah Jan 16, 2017

Choose a reason for hiding this comment

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

I think that is a different pattern, because it has its own behaviour.


### How to use the component with a keyboard only

The only input this component has is the optional buttons or tabs that are placed
in the panel options. When they are present, they should have an according tabindex.

### How a screen-reader user will interact with the component

The component will work out of the box with a screen reader.

### How the component will work without color

* The panel header should have a bigger font size than the panel body.
* The panel footer should have a smaller font size than the panel body.
Copy link
Contributor

Choose a reason for hiding this comment

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

Border of the panel must have a certain amount of contrast contrasting with the background of the webpage. Else the panel will not be a visible panel for someone with colorblindness.


### How the component will enforce any a11y requirements

No additional comments here.
Copy link
Contributor

Choose a reason for hiding this comment

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

It could contain a description of the inputs that are inside of the panel.


## Roadmap

No idea what to add here :)

[this article]: https://www.polymer-project.org/0.5/articles/accessible-web-components.html
[Daltonize]: https://chrome.google.com/webstore/detail/chrome-daltonize/efeladnkafmoofnbagdbfaieabmejfcf
[SEE]: https://chrome.google.com/webstore/detail/see/dkihcccbkkakkbpikjmpnbamkgbjfdcn
[WAI-ARIA Authoring Practices doc]: https://www.polymer-project.org/0.5/articles/accessible-web-components.html
[reference-bootstrap]: https://getbootstrap.com/components/#panels
[reference-foundation]: http://foundation.zurb.com/sites/docs/v/5.5.3/components/panels.html
[reference-jira]: https://jira.atlassian.com/secure/Dashboard.jspa
[avant-panels]: http://avant.redteamux.com/ui-panels.php