carbon-design-system / carbon-website

The website for the Carbon Design System.
https://www.carbondesignsystem.com
Apache License 2.0
278 stars 778 forks source link

[Design] Component demo — ready #357

Closed aagonzales closed 4 years ago

aagonzales commented 5 years ago

As a user I want to be able to view the live demo component in the 4 different themes as well as be able to see the different variants and modifiers in one window instead of multiple.

aagonzales commented 5 years ago

Feature priorities:

Concepts:

Option 1: content switcher

image

Option 2: tabs & variants in list

image

Option 3: All in right panel

image

Option 4: theme and variant tabs at top

image

High contrast panel

image

Left panel

image

Basic fields

image

aagonzales commented 5 years ago

Here is the direction we're trending.

Component_Demo

Code panel expanded

Component_Demo-2

View in full page concept WIP Experimental_Component_Template_Overview-3

aagonzales commented 5 years ago

Possible components

components

vpicone commented 5 years ago

Seeing the code update in real time is pretty essential towards making this usable. One of the big issues with storybook is how our code snippets aren't usable.

I don't think having a copy button makes sense without also having the live code that you're copying displayed. I think polaris's live update example for this is a solid example. Something like the basic fields example above is what I imagined (maybe without those framework links).

The show more is tough here since it'd also pull down the sidebar with all the knobs, I think it might be better just to make that area scrollable. One thing to keep in mind is that since the components are in isolation, there's going to be way lose code than as-is, so we might be able to ditch the show more.

aagonzales commented 5 years ago

OK in order to make some decisions around the code block I need a little more insights into what users would want to do with it. Keep in mind this demo window is also for dev and design to showcase what's possible with the component. eventually code, usage and style will all liver harmoniously on one long page together.

Dev needs I'm currently understanding:

Questions (for dev):

See https://github.com/carbon-design-system/carbon-website/issues/357#issuecomment-535098372 for context.

aagonzales commented 5 years ago

Code block options - WIP

image

jnm2377 commented 5 years ago

@aagonzales These are my thoughts on your questions:

Do we need to show props (like on Polaris?) What are they?

Yes. This is something that needs work in our storybook, as well. We've heard time and time again from users that they don't know where to find the props. We don't really do a good job of surfacing them, and they are very essential for React, not just for different variations but also for a11y and state related props.

Would it be ok to completely hide the code by default or would you want to see it up.

I'd want to see it up by default but having an option to hide it would be ok.

Where is the primary place we want users looking at component code?

I think existing React users primarily look for code in Storybook, which tbh needs a lot of work because we can do better in a lot of ways. Since we're now React-first, though, I think moving our website to be React and aiming for this to be the main place for users to find code would be ideal because we can better customize this experience than what Storybook currently offers.

Will/should this component demo replace the React sandbox?

No. We still need sandboxes for users to reproduce bugs and stuff.

Window will only ever show react code?

Yes. We're moving towards deprecating vanilla, and the core team will only maintain React. So my take is yes.

Is the react code useful to see if you're not a react user?

No, it's not. But the vanilla code is not useful if you're not a vanilla user. And we're React-first now, so I think if there's any code that we should be showing it should be this.

mjabbink commented 5 years ago

@aagonzales in the case above under Documentation I think the icons would work better on the left. or as in the right side in a column just as a visual cue that you’re leaving the site (not clickable but maybe also clickable?) Could not hurt in this case.

or

no icon and a link on the right side (column) that says something like Go to location or visit location. Maybe cleaner and avoid icons.

joshblack commented 5 years ago

Do we need to show props (like on Polaris?) What are they?

I think it can be helpful, being able to update the props inline and have the control change is always fun. I do think some have such a large surface area of props that it can easily make the page feel overwhelming (I'm looking at you, DataTable).

I think, because of that, keeping the demoes isolated to ideal use-cases might be preferred and then launch our or redirect to a dedicated page might be the best bang for our buck.

When it comes to what a prop represents, it's analogous to a symbol override in Sketch (roughly) in that you can change text, style, variant, etc.

Would it be ok to completely hide the code by default or would you want to see it up.

I think having the code block visible at the beginning would be helpful

Where is the primary place we want users looking at component code?

Most folks look at the storybook as they tend to give the largest amount of info

Will/should this component demo replace the React sandbox?

I think it can replace if we fully document all the props, however this might mean having to recreate parts of storybook that folks find valuable. For context, folks often request our storybook stories for PALs/add-ons such that they can use them, as well.

Window will only ever show react code?

I think this would be the best bet for now.

Is the react code useful to see if you're not a react user?

Not at all 😞

vpicone commented 5 years ago

I think being able to edit the code block isn’t super essential, but seeing the code react to changes in props before copying it is.

I’m also on the side of showing the code by default, I don’t think there’s much to be gained from hiding it but it just adds an extra click to see the component updating every time.

aagonzales commented 4 years ago

Final designs for development ✅

Sketch file: https://ibm.box.com/s/u0om4lkl4u3vm9v7j9vlfq6moarqufb4

Component_Demo

Basic spec

image

Theme Switcher

A content switcher at the top of the window changes the theme appearance. The background of the window also changes and has a 8px white border around the edge.

image image

Responsive behavior

>large break point Window grows proportionally with 12 columns above large breakpoint image

Medium and small breakpoints Right panel becomes collapsible/expandable and is collapsed by default. Once open panel is only collapsible by clicking the x or clicking outside of the panel. image

image

Full page mode

By clicking the maximize arrows the component window takes over the whole page. This allows the user to have a bigger working area. image

Example of other components

image image

vpicone commented 4 years ago

@aagonzales could you clarify what you mean by 'state'? Is that hover/focus type interactions?

aagonzales commented 4 years ago

States in this context would be something that the user can't see by interacting with the component like: disabled, skeleton, invalid.

States that should just be viewed through interacting with the component itself (these don't need extras controls):

vpicone commented 4 years ago

@aagonzales if you have a spec a little info icon or something next to the knobs that'd be great

Screen Shot 2019-11-05 at 3 12 13 PM

It could also be a dashed underline on the knob name or something maybe?

jeanservaas commented 4 years ago

@vpicone mike made the point that this could be a Gatsby component potentially too right?

mjabbink commented 4 years ago

I don’t see why not and also should be something we focus on this cycle since it has huge impact on user experience. Will also resolve some issues we currently have in Carbon when displaying a component in the demo window. But Gatsby or not we should totally rock this.

mjabbink commented 4 years ago

Wait a second. Isn’t the Carbon site Gatsby theme? It’s no different to BC, IDL, Design for AI, etc. I wonder if there are some components we do not want the entire Design Ecosystem to use can they be hidden? Or is that anti open source community. I’m fine either way but then I’m think it’s a Gatsby component for sure.

mjabbink commented 4 years ago

Can’t wait to see this in action

mjabbink commented 4 years ago

From what I see in above visual specs this needs adjusting so snippet goes full width under demo window and side panel