|
| 1 | +import { DxcHeading, DxcFlex, DxcTable, DxcParagraph, DxcBulletedList } from "@dxc-technology/halstack-react"; |
| 2 | +import Image from "@/common/Image"; |
| 3 | +import Code from "@/common/Code"; |
| 4 | +import QuickNavContainer from "@/common/QuickNavContainer"; |
| 5 | +import PageHeading from "@/common/PageHeading"; |
| 6 | +import DocFooter from "@/common/DocFooter"; |
| 7 | +import QuickNavContainerLayout from "@/common/QuickNavContainerLayout"; |
| 8 | +import shadows from "./images/shadows.jpg"; |
| 9 | +import Figure from "@/common/Figure"; |
| 10 | + |
| 11 | +const sections = [ |
| 12 | + { |
| 13 | + title: "Introduction", |
| 14 | + content: ( |
| 15 | + <> |
| 16 | + <DxcParagraph> |
| 17 | + Shadows are a fundamental part of visual design systems. In Halstack, we use them, along with colors, to{" "} |
| 18 | + <strong>create depth and layering on the interface</strong>. They help users distinguish between surfaces, |
| 19 | + understand component hierarchy, and focus their attention on key elements. |
| 20 | + </DxcParagraph> |
| 21 | + <DxcParagraph> |
| 22 | + By simulating how light interacts with objects, shadows reinforce a clear spatial structure in digital |
| 23 | + interfaces, much like in the physical world. Whether it's emphasizing a modal over a background or giving |
| 24 | + subtle prominence to a card, elevation contributes both aesthetically and functionally to the user experience. |
| 25 | + </DxcParagraph> |
| 26 | + </> |
| 27 | + ), |
| 28 | + }, |
| 29 | + { |
| 30 | + title: "Shadow tokens", |
| 31 | + content: ( |
| 32 | + <> |
| 33 | + <DxcParagraph> |
| 34 | + Halstack provides a set of predefined shadow tokens optimized for clarity and performance across our products. |
| 35 | + Each token corresponds to a specific elevation level with calibrated values for offset, blur, and color |
| 36 | + transparency. |
| 37 | + </DxcParagraph> |
| 38 | + <DxcTable> |
| 39 | + <thead> |
| 40 | + <tr> |
| 41 | + <th>Token</th> |
| 42 | + <th>X position</th> |
| 43 | + <th>Y position</th> |
| 44 | + <th>Blur</th> |
| 45 | + <th>Spread</th> |
| 46 | + <th>color</th> |
| 47 | + </tr> |
| 48 | + </thead> |
| 49 | + <tbody> |
| 50 | + <tr> |
| 51 | + <td> |
| 52 | + <Code>shadow-100</Code> |
| 53 | + </td> |
| 54 | + <td>0px</td> |
| 55 | + <td>2px</td> |
| 56 | + <td>2px</td> |
| 57 | + <td>0px</td> |
| 58 | + <td> |
| 59 | + <Code>color-grey-400-a</Code> |
| 60 | + </td> |
| 61 | + </tr> |
| 62 | + <tr> |
| 63 | + <td> |
| 64 | + <Code>shadow-200</Code> |
| 65 | + </td> |
| 66 | + <td>0px</td> |
| 67 | + <td>12px</td> |
| 68 | + <td>12px</td> |
| 69 | + <td>0px</td> |
| 70 | + <td> |
| 71 | + <Code>color-grey-300-a</Code> |
| 72 | + </td> |
| 73 | + </tr> |
| 74 | + <tr> |
| 75 | + <td> |
| 76 | + <Code>shadow-300</Code> |
| 77 | + </td> |
| 78 | + <td>0px</td> |
| 79 | + <td>24px</td> |
| 80 | + <td>24px</td> |
| 81 | + <td>0px</td> |
| 82 | + <td> |
| 83 | + <Code>color-grey-300-a</Code> |
| 84 | + </td> |
| 85 | + </tr> |
| 86 | + <tr> |
| 87 | + <td> |
| 88 | + <Code>shadow-400</Code> |
| 89 | + </td> |
| 90 | + <td>0px</td> |
| 91 | + <td>48px</td> |
| 92 | + <td>48px</td> |
| 93 | + <td>0px</td> |
| 94 | + <td> |
| 95 | + <Code>color-grey-300-a</Code> |
| 96 | + </td> |
| 97 | + </tr> |
| 98 | + </tbody> |
| 99 | + </DxcTable> |
| 100 | + <Figure caption="Halstack shadows applied to containers"> |
| 101 | + <Image src={shadows} alt="Halstack shadows applied to containers" /> |
| 102 | + </Figure> |
| 103 | + </> |
| 104 | + ), |
| 105 | + }, |
| 106 | + { |
| 107 | + title: "Shadow guidelines by scale", |
| 108 | + content: ( |
| 109 | + <> |
| 110 | + <DxcParagraph> |
| 111 | + Each shadow style is designed to serve a different level of emphasis or structural role in the UI. Below are |
| 112 | + some typical use cases per shadow level: |
| 113 | + </DxcParagraph> |
| 114 | + <DxcBulletedList> |
| 115 | + <DxcBulletedList.Item> |
| 116 | + <strong>shadow-100</strong>: creates subtle separation from the background without drawing too much |
| 117 | + attention, such as small UI elements like buttons, input fields, or lightweight cards. |
| 118 | + </DxcBulletedList.Item> |
| 119 | + <DxcBulletedList.Item> |
| 120 | + <strong>shadow-200</strong>: signals a slight lift and draws more attention than shadow-100, especially |
| 121 | + useful for elements that temporarily appear above the rest of the UI; such as cards, dashboard, popovers, or |
| 122 | + dropdowns. |
| 123 | + </DxcBulletedList.Item> |
| 124 | + <DxcBulletedList.Item> |
| 125 | + <strong>shadow-300</strong>: used for modals, bottom sheets, or floating panels; as it clearly separates |
| 126 | + important, interactive components from the rest of the content. |
| 127 | + </DxcBulletedList.Item> |
| 128 | + <DxcBulletedList.Item> |
| 129 | + <strong>shadow-400</strong>: provides the strongest visual depth to ensure clear hierarchy and focus in the |
| 130 | + UI. A few examples where this shadow can be applied are full-screen overlays, onboarding dialogs, or focused |
| 131 | + system alerts. |
| 132 | + </DxcBulletedList.Item> |
| 133 | + </DxcBulletedList> |
| 134 | + </> |
| 135 | + ), |
| 136 | + }, |
| 137 | + { |
| 138 | + title: "Best practices", |
| 139 | + content: ( |
| 140 | + <DxcBulletedList> |
| 141 | + <DxcBulletedList.Item> |
| 142 | + <strong>Use elevation purposefully</strong>: shadows are not decorative. Apply them to communicate visual |
| 143 | + hierarchy and component behavior. |
| 144 | + </DxcBulletedList.Item> |
| 145 | + <DxcBulletedList.Item> |
| 146 | + <strong>Don’t overlay too much</strong>: avoid stacking multiple shadows or using high-intensity shadows on |
| 147 | + too many components, as this leads to visual clutter. |
| 148 | + </DxcBulletedList.Item> |
| 149 | + <DxcBulletedList.Item> |
| 150 | + <strong>Stay within the core scale</strong>: Use only the defined shadow tokens unless there's a validated |
| 151 | + need for a custom elevation. |
| 152 | + </DxcBulletedList.Item> |
| 153 | + <DxcBulletedList.Item> |
| 154 | + <strong>Avoid using shadows as borders</strong>: If you need to separate elements or define boundaries, use |
| 155 | + spacing or a border token instead. |
| 156 | + </DxcBulletedList.Item> |
| 157 | + <DxcBulletedList.Item> |
| 158 | + <strong>Consistency across themes</strong>: Our shadow tokens are designed to adapt well across themes and |
| 159 | + backgrounds. Avoid tweaking individual values unless strictly necessary. |
| 160 | + </DxcBulletedList.Item> |
| 161 | + </DxcBulletedList> |
| 162 | + ), |
| 163 | + }, |
| 164 | +]; |
| 165 | + |
| 166 | +export default function ElevationPage() { |
| 167 | + return ( |
| 168 | + <DxcFlex direction="column" gap="4rem"> |
| 169 | + <PageHeading> |
| 170 | + <DxcFlex direction="column" gap="var(--spacing-gap-xl)"> |
| 171 | + <DxcHeading level={1} text="Elevation" /> |
| 172 | + </DxcFlex> |
| 173 | + </PageHeading> |
| 174 | + <QuickNavContainerLayout> |
| 175 | + <QuickNavContainer sections={sections} startHeadingLevel={2} /> |
| 176 | + </QuickNavContainerLayout> |
| 177 | + <DocFooter githubLink="https://github.com/dxc-technology/halstack-react/blob/master/apps/website/screens/foundations/elevation/ElevationPage.tsx" /> |
| 178 | + </DxcFlex> |
| 179 | + ); |
| 180 | +} |
0 commit comments