diff --git a/client/patterns/breadcrumb/Details.tsx b/client/patterns/breadcrumb/Details.tsx index 18d008b..909f2df 100644 --- a/client/patterns/breadcrumb/Details.tsx +++ b/client/patterns/breadcrumb/Details.tsx @@ -21,22 +21,27 @@ const Details: React.FC<{}> = () => {
+
... -
/
+
/
...
`} -css={``} +css={` +.container { + /* Content is centered vertically */ + align-items: center; + display: flex; +} +.separator { + margin: 0 8px; +} +`} >
= () => {
+
... -
+
-
+
...
@@ -108,7 +74,46 @@ html={` ...
`} -css={``} +css={` +.container { + position: relative; +} +.item { + /* Position */ + position: absolute; + top: 0; + + /* + 80px is the distance from the item to the trigger element. + Replace 0deg with 60deg, 180deg, 240deg, 300deg for another item + in case you want to have a total of 6 menu items. + The formulation is 360 / numberOfItems * indexOfItem + */ + transform: rotate(0deg) translateX(-80px); + + /* Must have the same size as the trigger element */ + height: 32px; + width: 32px; +} +.inner { + /* + Rotate it to make it displayed vertically + Replace -0deg with -60deg, -180deg, -240deg, -300deg for another item + in case you want to have a total of 6 menu items. + The formulation is -(360 / numberOfItems * indexOfItem) + */ + transform: rotate(-0deg); + + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; + + /* Take full size */ + height: 100%; + width: 100%; +} +`} >
= () => {
+
  • + + + ... +
  • +`} +css={` +.container { /* Center the content */ align-items: center; display: flex; @@ -55,26 +63,24 @@ html={` list-style-type: none; margin: 0; padding: 0; -"> -
  • -
  • + /* OPTIONAL: Spacing between dots */ + margin: 0 4px; +} `} -css={``} >
    = () => {
    + +
    + + + +
    +`} +css={` +.container { /* Container takes full size */ height: 100%; left: 0; @@ -33,39 +44,32 @@ html={` width: 100%; z-index: 9999; -"> - -
    + z-index: -1; +} +.sidebar { + /* Take full height */ + height: 100%; + left: 0; + position: fixed; + top: 0; + width: 200px; - -
    - ... -
    -
    + /* Background */ + background-color: #fff; +} `} -css={``} >
    = () => {
    + +`} +css={` +.dropdown { + position: relative; +} + /* Hide the dropdown's content by default --> .dropdown-content { display: none; + + /* Position it right below the trigger element */ + left: 0; + paddingTop: 4px; + position: absolute; + top: 100%; + + /* It should be on the top of other elements */ + background-color: #FFF; + zIndex: 9999; + + /* Size */ + height: 200px; + width: 200px; } /* Show the content when hover on the container --> .dropdown:hover .dropdown-content { display: block; } - - - `} -css={``} >
    = () => {
    + + + + +
      + ... +
    +
    +`} +css={` +.container { /* Full screen overlay */ height: 100%; left: 0; @@ -33,24 +46,15 @@ html={` align-items: center; display: flex; justify-content: center; -"> - - +} - -
      - ... -
    -
    +.close { + /* Shown at top right corner */ + position: absolute; + right: 16px; + top: 16px; +} `} -css={``} >
    = () => {
    -.p-mega-menu-container { +
    + + ... + + +
    + +
    ...
    + + +
    + ... +
    +
    +
    +`} +css={` +.container { /* Used to position the mega menu */ position: relative; } -.p-mega-menu-content { +.trigger:hover .content { + /* Show the mega menu when hovering the trigger item */ + display: block; +} + +.content { /* Border */ border: 1px solid rgba(0, 0, 0, 0.3); margin-top: -1px; @@ -55,30 +76,7 @@ html={` background: #fff; z-index: 9999; } - -.p-mega-menu-trigger:hover .p-mega-menu-content { - /* Show the mega menu when hovering the trigger item */ - display: block; -} - - -
    - - ... - - -
    - -
    ...
    - - -
    - ... -
    -
    -
    `} -css={``} >
    diff --git a/client/patterns/menu/Details.tsx b/client/patterns/menu/Details.tsx index 5290809..2b9bc04 100644 --- a/client/patterns/menu/Details.tsx +++ b/client/patterns/menu/Details.tsx @@ -25,30 +25,14 @@ const Details: React.FC<{}> = () => {
    +
    -
    +
    ...
    -
    +
    ... @@ -56,16 +40,8 @@ html={`
    -
    -
    +
    +
    ... @@ -77,13 +53,40 @@ html={`
    -
    +
    `} -css={``} +css={` +.container { + display: flex; + flex-direction: column; + + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 4px; +} + +.item { + /* Center the content horizontally */ + align-items: center; + display: flex; +} + +.with-shortcut { + /* Push the hot key to the right */ + justify-content: space-between; +} + +.with-image { + align-items: center; + display: flex; +} + +.divider { + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + height: 1px; +} +`} >
    = () => {
    -/* The root */ -.p-nested-dropdowns { - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); - display: flex; - - /* Reset list styles */ - list-style-type: none; - margin: 0; - padding: 0; -} - -.p-nested-dropdowns li { - /* Spacing */ - padding: 8px; - - /* Used to position the sub dropdown */ - position: relative; -} - -/* The sub dropdown */ -.p-nested-dropdowns ul { - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); - - /* Hidden by default */ - display: none; - - /* Absolute position */ - left: 0; - position: absolute; - top: 100%; - - /* Reset styles */ - list-style-type: none; - margin: 0; - padding: 0; - - /* Width */ - width: 200px; -} - -/* The second level sub dropdown */ -.p-nested-dropdowns ul ul { - left: 100%; - position: absolute; - top: 0; -} - -/* Change background color of list item when being hovered */ -.p-nested-dropdowns li:hover { - background-color: rgba(0, 0, 0, 0.1); -} - -/* Show the direct sub dropdown when hovering the list item */ -.p-nested-dropdowns li:hover > ul { - display: block; -} - - -
      +
      • Home
      • Patterns
        @@ -113,7 +52,65 @@ html={`
      • About
      `} -css={``} +css={` +.container { + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + display: flex; + + /* Reset list styles */ + list-style-type: none; + margin: 0; + padding: 0; +} + +.container li { + /* Spacing */ + padding: 8px; + + /* Used to position the sub dropdown */ + position: relative; +} + +/* The sub dropdown */ +.container ul { + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + + /* Hidden by default */ + display: none; + + /* Absolute position */ + left: 0; + position: absolute; + top: 100%; + + /* Reset styles */ + list-style-type: none; + margin: 0; + padding: 0; + + /* Width */ + width: 200px; +} + +/* The second level sub dropdown */ +.container ul ul { + left: 100%; + position: absolute; + top: 0; +} + +/* Change background color of list item when being hovered */ +.container li:hover { + background-color: rgba(0, 0, 0, 0.1); +} + +/* Show the direct sub dropdown when hovering the list item */ +.container li:hover > ul { + display: block; +} +`} >
      = () => {
      + +
      + ... +
      + + + ... +
      +`} +css={` +.container { display: flex; /* Border */ border: 1px solid rgba(0, 0, 0, 0.3); border-radius: 4px; -"> - -
      - ... -
      +.item { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - -
      - ... -
      -
      + /* Right border */ + border-right: 1px solid rgba(0, 0, 0, 0.3); +} +.item + .item { + /* No right border */ + border-right: none; +} `} -css={``} >
      = () => {
      +
      .. @@ -33,7 +29,13 @@ html={` ..
      `} -css={``} +css={` +.container { + align-items: center; + display: flex; + justify-content: space-between; +} +`} >
      = () => {
      +
      - + -
      +
      - -
      `} -css={``} +css={` +.container { + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 2px; + display: flex; +} + +.input { + border-color: transparent; + margin-right: 4px; + padding: 4px; + width: 100px; +} + +.buttons { + /* Content is centered vertically */ + display: flex; + flex-direction: column; + justify-content: center; +} + +.button { + border-color: transparent; + /* Make buttons have the same height */ + flex: 1, +} +`} >
      = () => {
      + +
    • + ... +
    • + + +
    • + ... +
    • +
    +`} +css={` +.container { /* Content is centered horizontally */ align-items: center; display: flex; @@ -30,22 +43,13 @@ html={` /* Reset styles */ list-style-type: none; margin: 0; -"> - -
  • - ... -
  • +} - -
  • - ... -
  • - +.item-right { + /* Sticks to the right */ + margin-left: auto; +} `} -css={``} >
    = () => {
    + + + + +
    + +
    + + + +
    +`} +css={` +.container { display: flex; /* Border */ @@ -39,40 +53,28 @@ html={` /* Size */ height: 32px; width: 128px; -"> - - +.button { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - -
    - -
    + /* Size */ + width: 32px; +} - - -
    +.input { + /* Take full size of its container */ + height: 100%; + width: 100%; +} `} -css={``} >
    = () => {
    + + + +
    + +`} +css={` +.label { display: flex; /* Rounded border */ @@ -47,26 +55,26 @@ html={` border: 1px solid #357edd; /* Push the circle to the right */ justify-content: flex-end; -"> - - +} - -
    - + background-color: #FFF; + + /* OFF status */ + border: 1px solid rgba(0, 0, 0, .3); +} `} -css={``} >
    = () => {
    +
    -
    +
    ...
    -
    +
    ...
    `} -css={``} +css={` +.tabs { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; +} + +.tab--active { + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + /* Hide the bottom border */ + border-bottom-color: transparent; + + /* Border radius */ + border-top-left-radius: 2px; + border-top-right-radius: 2px; +} + +.tab--inactive { + /* Has only the bottom border */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); +} +`} >
    = () => {
    +
    - +
    `} -css={``} +css={` +.container { + display: flex; + + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); +} + +.input { + border-color: transparent; + /* Take available width */ + flex: 1; +} +`} >
    = () => {
    + + + + +
    ...
    + + + ... +
    +`} +css={` +.container { /* Used to position the input */ position: relative; @@ -34,31 +46,24 @@ html={` /* Border */ border: 1px solid rgba(0, 0, 0, 0.3); -"> - - +.input { + /* Take the full size */ + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; - -
    ...
    + /* Make it transparent */ + opacity: 0; +} - - ... -
    +.icon { + margin-right: 8px +} `} -css={``} >
    = () => {
    +
    -
    -
    +
    +
    -
    +
    -
    +
    ...
    -
    +
    ...
    + + + ...
    `} -css={``} +css={` +.wizard { + display: flex; +} + +.step { + /* Make all steps have the same width */ + flex: 1; +} + +.step__dot { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; +} + +.step__connector { + flex: 1; + height: 1px; + background-color: rgba(0, 0, 0, .3); +} + +.step:first-child .step__connector, +.step:last-child .step__connector { + background-color: transparent; +} + +.step__number { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; + + /* Rounded border */ + background-color: rgba(0, 0, 0, .3); + border-radius: 9999px; + height: 32px; + width: 32px; + + /* OPTIONAL: Spacing between it and connectors */ + margin-left: 4px; + margin-right: 4px; +} +`} >