auth0 / cosmos

🔭 Auth0 Design System
https://auth0-cosmos.now.sh/
MIT License
545 stars 114 forks source link

Proposal: Content component #1084

Closed landitus closed 1 year ago

landitus commented 6 years ago

Use a Content when creating an area of text. Wrap other typography components to create a good vertical rhythm.

Usage:

37725965-f808387a-2d12-11e8-85da-ae24c7324e13

Example:

<Content>
  <Heading size={2}>About Universal Login</Heading>
  <Paragraph>Auth0's Universal Login is the most secure way to authenticate users for your applications. Universal Login centers around your Auth0 login page. The login page appearance and behavior is customizable right from the Dashboard. By default, the login page internally uses Auth0's Lock Widget to authenticate your users, but the code of the login page can be customized to replace the standard Lock widget with the Lock (Passwordless Mode) widget, or an entirely custom UI can be built in its place, using the Auth0.js SDK for authentication.</Paragraph>
  <Image caption="This is a caption" src="" alt="" />

  <Heading size={3}>How does Universal Login work</Heading> 
  <Paragraph>Auth0 shows the login page whenever something (or someone) triggers an authentication request, such as calling the /authorize endpoint (OIDC/OAuth) or sending a SAML login request.</Paragraph>
  <Paragraph>Users will see the login page, typically with either the Lock widget or with your custom UI. Once they log in, they will be redirected back to your application.</Paragraph>
  <Paragraph>However if the incoming authentication request includes a connection parameter that uses an external identity provider (such as a social provider), the login page will not display. Instead, Auth0 will direct the user to the identity provider's login page.</Paragraph>
  <Alert type="information">If, after looking at the page code and customization options, you decide not to customize your login page, you should disable the Customize Login Page toggle, to allow your page to receive the automatic updates it might need from Auth0.</Alert>
  <List>
    <List.item>List item</List.item>
    <List.item>List item</List.item>
    <List.item>List item</List.item>
  </List>

  <Heading size={3}>This is a sub-heading</Heading>
  <Paragraph></Paragraph>
  <CodeBlock caption="This is a caption"></CodeBlock>
  <Paragraph></Paragraph>
</Content>

Note: to use a proper List, we need to change the name of the List component (which is a simple Table)

andresgalante commented 6 years ago

If possible I'd change size={3} on Headings for type={3}.

We should not encourage authors to think about sizes but the hierarchy of header they want to use.

Here is a good example of a content component: https://bulma.io/documentation/elements/content/

siddharthkp commented 5 years ago

Nitpick: Do we have a whitelist of components that goes inside Content? I see Image is used, not sure if it fits the definition

Use a Content when creating an area of text. Wrap other typography components to create a good vertical rhythm.

Real question: How does a developer make the decision what goes inside a content vs what doesn't. Is it the spacing / indentation / type of component?

Example - There are multiple ways of slicing a UI into contents:

big

(big picture, click to zoom)

andresgalante commented 5 years ago

Do we have a whitelist of components that go inside Content? I see Image is used, not sure if it fits the definition

👍 yeap! that'd be ideal

andresgalante commented 5 years ago

I'll add another example of a content component for reference

https://polaris.shopify.com/components/titles-and-text/text-container#navigation

siddharthkp commented 5 years ago

Do we have a whitelist of components that go inside Content? I see Image is used, not sure if it fits the definition

👍 yeap! that'd be ideal

@landitus Can you add the whitelist here? Let's close the spec before we jump into implementation

andresgalante commented 5 years ago

If we are going to remove margins on v1, I think it's good timing to do this component.

landitus commented 5 years ago

Indeed!