Skip to content

Commit b527d25

Browse files
authored
Merge pull request #2269 from dxc-technology/rarrojolopez/elevation-foundations
Add Elevation foundations documentation to the site
2 parents c513eca + 240a767 commit b527d25

File tree

18 files changed

+211
-43
lines changed

18 files changed

+211
-43
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Head from "next/head";
2+
import ElevationPage from "screens/foundations/elevation/ElevationPage";
3+
4+
const Elevation = () => (
5+
<>
6+
<Head>
7+
<title>Elevation — Halstack Design System</title>
8+
</Head>
9+
<ElevationPage />
10+
</>
11+
);
12+
13+
export default Elevation;

apps/website/screens/common/pagesList.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const principlesLinks: LinkDetails[] = [
4040

4141
const foundationsLinks: LinkDetails[] = [
4242
{ label: "Color", path: "/foundations/color" },
43+
{ label: "Elevation", path: "/foundations/elevation" },
4344
{ label: "Height", path: "/foundations/height" },
4445
{ label: "Iconography", path: "/foundations/iconography" },
4546
{ label: "Spacing", path: "/foundations/spacing" },

apps/website/screens/components/container/code/examples/listbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const code = `() => {
1313
width: "var(--border-width-s)"
1414
}}
1515
borderRadius="var(--border-radius-s)"
16-
boxShadow="var(--shadow-mid-x-position) var(--shadow-mid-y-position) var(--shadow-mid-blur) var(--shadow-mid-spread) var(--shadow-light)"
16+
boxShadow="var(--shadow-200)"
1717
boxSizing="border-box"
1818
maxHeight="304px"
1919
overflow={{ x: "hidden", y: "auto" }}
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
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+
}
365 KB
Loading

apps/website/screens/foundations/spacing/SpacingPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export default function SpacingPage() {
309309
<QuickNavContainerLayout>
310310
<QuickNavContainer sections={sections} startHeadingLevel={2} />
311311
</QuickNavContainerLayout>
312-
<DocFooter githubLink="https://github.com/dxc-technology/halstack-react/blob/master/apps/website/screens/foundations/SpacingPage.tsx" />
312+
<DocFooter githubLink="https://github.com/dxc-technology/halstack-react/blob/master/apps/website/screens/foundations/spacing/SpacingPage.tsx" />
313313
</DxcFlex>
314314
);
315315
}

packages/lib/src/accordion/AccordionItem.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ const AccordionContainer = styled.div`
1212
flex-direction: column;
1313
background-color: var(--color-bg-neutral-lightest);
1414
border-radius: var(--border-radius-s);
15-
box-shadow: var(--shadow-mid-x-position) var(--shadow-mid-y-position) var(--shadow-mid-blur) var(--shadow-mid-spread)
16-
var(--shadow-light);
15+
box-shadow: var(--shadow-200);
1716
min-width: 280px;
1817
width: 100%;
1918
`;

packages/lib/src/card/Card.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ const Card = styled.div<{
2626
}`}
2727
border-radius: var(--border-radius-s);
2828
box-shadow: ${({ shadowDepth }) =>
29-
shadowDepth === 1
30-
? "var(--shadow-low-x-position) var(--shadow-low-y-position) var(--shadow-low-blur) var(--shadow-low-spread) var(--shadow-dark)"
31-
: shadowDepth === 2
32-
? "var(--shadow-mid-x-position) var(--shadow-mid-y-position) var(--shadow-mid-blur) var(--shadow-mid-spread) var(--shadow-light)"
33-
: "none"};
29+
shadowDepth === 1 ? "var(--shadow-100)" : shadowDepth === 2 ? "var(--shadow-200)" : "none"};
3430
`;
3531

3632
const CardContainer = styled.div<{

packages/lib/src/container/Container.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const Listbox = ({ suggestions = [] }: { suggestions: string[] }): JSX.Element =
1818
style: "var(--border-style-default)",
1919
}}
2020
borderRadius="var(--border-radius-s)"
21-
boxShadow="var(--shadow-mid-x-position) var(--shadow-mid-y-position) var(--shadow-mid-blur) var(--shadow-mid-spread) var(--shadow-light)"
21+
boxShadow="var(--shadow-200)"
2222
boxSizing="border-box"
2323
maxHeight="304px"
2424
overflow={{ x: "hidden", y: "auto" }}

packages/lib/src/date-input/DatePicker.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import { HalstackLanguageContext } from "../HalstackContext";
1111
const DatePickerContainer = styled.div`
1212
padding: var(--spacing-padding-m) var(--spacing-padding-xs) var(--spacing-padding-xs) var(--spacing-padding-xs);
1313
background-color: var(--color-bg-neutral-lightest);
14-
box-shadow: var(--shadow-mid-x-position) var(--shadow-mid-y-position) var(--shadow-mid-blur) var(--shadow-mid-spread)
15-
var(--shadow-light);
14+
box-shadow: var(--shadow-200);
1615
border: var(--border-width-s) var(--border-style-default) var(--border-color-neutral-medium);
1716
border-radius: var(--border-radius-s);
1817
width: fit-content;

0 commit comments

Comments
 (0)