Skip to content

Commit 747692b

Browse files
authored
Merge branch 'master' into add_max_width
2 parents aa9cfcb + 4f04825 commit 747692b

9 files changed

Lines changed: 216 additions & 7 deletions

File tree

2.35 KB
Loading
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Naman Verma
3+
position: Contributor
4+
image_path: ./naman.jpeg
5+
github: Namanv0509
6+
twitter: explorers_111
7+
linkedin: naman-verma-6948a72a5/
8+
layer5: f6bedf26-411c-474b-89cb-3d7cf9f97ef2
9+
location: Diu, India
10+
bio: Hey everyone, I'm Naman Verma, a student at the Indian Institute of Information Technology, Jabalpur. I'm passionate about diving into all things tech, always eager to explore new ideas. Currently leveling up myself and contributing to the community to make a positive impact.
11+
status: Active
12+
published: true
13+
---
738 KB
Loading

src/collections/members/adeyemi-favour/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ linkedin: adeyemi-favour-adetayo
88
location: Ondo State, Nigeria
99
layer5: 6e035810-bfe6-418d-afc8-0b02daf92cfe
1010
bio: "I'm a mobile engineer with a passion for building awesome mobile experiences and a technical writer who loves sharing knowledge with others. Contributing to open source projects is a big part of what I do, and I'm always looking for ways to collaborate."
11-
status: Active
11+
status: Inactive
1212
badges:
1313
- community
1414
community_manager: yes
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Wyllie Fang
3+
position: Contributor
4+
image_path: ./wyllie-fang.webp
5+
github: Vincamine
6+
linkedin: wyllie-fang
7+
layer5: 150ec67c-7659-4f5b-bfc8-016919392678
8+
location: San Francisco, California, USA
9+
bio: Hi! I'm Wyllie. As an upcoming computer science graduate and a burgeoning software engineer, I’m focused on transforming innovative ideas into efficient, user-centric systems that scale. A perfect cup of coffee and the cutest animal memes is my power combo.
10+
status: Active
11+
published: true
12+
---
704 KB
Loading

src/collections/members/yogendar-singh/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ linkedin: yogendar-singh-241b96214
88
layer5: d96f6f3b-a52e-492e-897a-d84bbfbd47ae
99
location: Uttarakhand, India
1010
bio: I am a DevOps Engineer specializing in Azure, automation, and Infrastructure as Code. I enjoy solving infrastructure challenges, streamlining cloud operations, and contributing to open source as part of continuous learning.
11-
status: Active
11+
status: Inactive
1212
published: true
1313
---

src/pages/projects/sistent/identity/spacing/code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { SpacingCode } from "../../../../../sections/Projects/Sistent/identity/spacing/code";
2+
import SpacingCode from "../../../../../sections/Projects/Sistent/identity/spacing/code";
33

44
const SpacingCodePage = () => {
55
return <SpacingCode />;

src/sections/Projects/Sistent/identity/spacing/code.js

Lines changed: 188 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,120 @@
1-
import React from "react";
1+
import React, { useState } from "react";
22
import { navigate } from "gatsby";
33
import { useLocation } from "@reach/router";
4-
54
import { SistentLayout } from "../../sistent-layout";
5+
import { Col, Row } from "../../../../../reusecore/Layout";
66
import Button from "../../../../../reusecore/Button";
7+
import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode";
8+
9+
import {
10+
styled,
11+
Table,
12+
TableContainer,
13+
TableCell,
14+
TableRow,
15+
TableHead,
16+
TableBody,
17+
SistentThemeProvider,
18+
CustomTooltip,
19+
Box,
20+
} from "@sistent/sistent";
21+
import { copyToClipboard } from "../../../../../components/CodeBlock/copy-to-clipboard.js";
22+
23+
24+
// Table data
25+
const spacingTokens = [
26+
{ token: "spacing-00", px: "0px (8 × 0)", rem: "0rem", size: 0 },
27+
{ token: "spacing-01", px: "2px (8 × 0.25)", rem: "0.125rem", size: 2 },
28+
{ token: "spacing-02", px: "4px (8 × 0.5)", rem: "0.25rem", size: 4 },
29+
{ token: "spacing-03", px: "8px (8 × 1)", rem: "0.5rem", size: 8 },
30+
{ token: "spacing-04", px: "16px (8 × 2)", rem: "1rem", size: 16 },
31+
{ token: "spacing-05", px: "24px (8 × 3)", rem: "1.5rem", size: 24 },
32+
{ token: "spacing-06", px: "32px (8 × 4)", rem: "2rem", size: 32 },
33+
{ token: "spacing-07", px: "40px (8 × 5)", rem: "2.5rem", size: 40 },
34+
{ token: "spacing-08", px: "48px (8 × 6)", rem: "3rem", size: 48 },
35+
{ token: "spacing-09", px: "56px (8 × 7)", rem: "3.5rem", size: 56 },
36+
{ token: "spacing-10", px: "64px (8 × 8)", rem: "4rem", size: 64 },
37+
{ token: "spacing-11", px: "72px (8 × 9)", rem: "4.5rem", size: 72 },
38+
{ token: "spacing-12", px: "80px (8 × 10)", rem: "5rem", size: 80 },
39+
];
40+
41+
const CopyCell = ({ value }) => {
42+
const [copyText, setCopyText] = useState("Copy");
43+
44+
const handleCopy = async () => {
45+
await copyToClipboard(value);
46+
setCopyText("Copied");
47+
setTimeout(() => setCopyText("Copy"), 1000);
48+
};
49+
50+
return (
51+
<CustomTooltip
52+
title={copyText === "Copied" ? "Copied" : "Copy"}
53+
enterDelay={800}
54+
leaveDelay={10}
55+
placement="right"
56+
>
57+
<Box
58+
sx={{
59+
position: "relative",
60+
display: "inline-flex",
61+
alignItems: "center",
62+
cursor: "pointer",
63+
padding: "2px 4px",
64+
borderRadius: "3px",
65+
transition: "background-color 0.2s ease",
66+
"&:hover": {
67+
backgroundColor: (theme) =>
68+
theme.palette.action?.hover || "rgba(0, 0, 0, 0.04)",
69+
},
70+
}}
71+
onClick={handleCopy}
72+
>
73+
<span>{value}</span>
74+
</Box>
75+
</CustomTooltip>
76+
);
77+
};
78+
79+
const SpacingVisualBox = styled("div")(({ theme, size }) => ({
80+
backgroundColor: theme.palette.brand?.default || "#00B39F",
81+
width: size === 0 ? "0px" : `${Math.max(size, 4)}px`,
82+
height: "20px",
83+
borderRadius: "4px",
84+
border: size === 0 ? "none" : `1px solid ${theme.palette.divider}`,
85+
minWidth: size === 0 ? "0px" : "4px",
86+
}));
787

8-
export const SpacingCode = () => {
88+
const StyledTableRow = styled(TableRow)(({ theme }) => ({
89+
"&:nth-child(odd)": {
90+
backgroundColor: theme.palette.background.default,
91+
},
92+
"&:nth-child(even)": {
93+
backgroundColor: theme.palette.background.secondary,
94+
},
95+
}));
96+
97+
const StyledTableContainer = styled(TableContainer)(() => ({
98+
width: "100%",
99+
backgroundColor: "transparent",
100+
boxShadow: "none",
101+
padding: 0,
102+
}));
103+
104+
const StyledTableCell = styled(TableCell)(({ theme }) => ({
105+
color: theme.palette.text.secondary,
106+
fontSize: "0.975rem",
107+
padding: "0.75rem",
108+
borderBottom: `1px solid ${theme.palette.divider}`,
109+
borderRadius: "4px",
110+
}));
111+
112+
const StyledHeaderCell = styled(StyledTableCell)(() => ({
113+
fontWeight: 600,
114+
}));
115+
116+
const SpacingCode = () => {
117+
const { isDark } = useStyledDarkMode();
9118
const location = useLocation();
10119

11120
return (
@@ -19,6 +128,7 @@ export const SpacingCode = () => {
19128
clear, concise, and consistent arrangement of interface elements
20129
across a screen.
21130
</p>
131+
22132
<div className="filterBtns">
23133
<Button
24134
className={
@@ -51,10 +161,84 @@ export const SpacingCode = () => {
51161
title="Code"
52162
/>
53163
</div>
164+
54165
<div className="main-content">
55-
<p>Sorry, this page is still under work</p>
166+
<p>
167+
The spacing system uses standardized tokens to ensure consistent
168+
spatial relationships across all interface elements. These tokens
169+
are based on an 8-pixel grid system with additional fractional
170+
values for fine-grained control.
171+
</p>
172+
173+
<a id="Spacing Tokens">
174+
<h2>Spacing Tokens</h2>
175+
</a>
176+
177+
<p>
178+
Spacing tokens provide a systematic approach to managing space in
179+
your designs. Built on multiples of 8 pixels, these tokens ensure
180+
visual harmony and consistency across all components and layouts.
181+
The system includes half-step (4px) and quarter-step (2px) values
182+
for precise spacing requirements.
183+
</p>
184+
185+
<SistentThemeProvider initialMode={isDark ? "dark" : "light"}>
186+
<Row className="table-container" $Hcenter>
187+
<Col md={12} sx={{ px: 0 }}>
188+
<StyledTableContainer>
189+
<Table size="small" aria-label="spacing-tokens">
190+
<TableHead>
191+
<TableRow>
192+
<StyledHeaderCell>Token</StyledHeaderCell>
193+
<StyledHeaderCell>Pixel Value</StyledHeaderCell>
194+
<StyledHeaderCell>REM Value</StyledHeaderCell>
195+
<StyledHeaderCell align="center">Visual</StyledHeaderCell>
196+
</TableRow>
197+
</TableHead>
198+
<TableBody>
199+
{spacingTokens.map((spacing) => (
200+
<StyledTableRow key={spacing.token}>
201+
<StyledTableCell sx={{ fontFamily: "monospace" }}>
202+
<CopyCell value={spacing.token} />
203+
</StyledTableCell>
204+
<StyledTableCell>
205+
<CopyCell value={spacing.px} />
206+
</StyledTableCell>
207+
<StyledTableCell>
208+
<CopyCell value={spacing.rem} />
209+
</StyledTableCell>
210+
<StyledTableCell align="center">
211+
<SpacingVisualBox size={spacing.size} />
212+
</StyledTableCell>
213+
</StyledTableRow>
214+
))}
215+
</TableBody>
216+
</Table>
217+
</StyledTableContainer>
218+
</Col>
219+
</Row>
220+
</SistentThemeProvider>
221+
222+
<a id="Implementation">
223+
<h2>Implementation</h2>
224+
</a>
225+
<p>
226+
These spacing tokens can be applied across three primary contexts:
227+
inset (padding), stack (vertical spacing), and inline (horizontal
228+
spacing). Each token maintains the 8-pixel grid relationship to
229+
ensure consistent alignment and visual rhythm throughout your
230+
interface.
231+
</p>
232+
<p>
233+
When implementing spacing in code, reference these tokens by their
234+
semantic names rather than hardcoded pixel values. This approach
235+
maintains design system consistency and makes future updates more
236+
manageable across your entire application.
237+
</p>
56238
</div>
57239
</div>
58240
</SistentLayout>
59241
);
60242
};
243+
244+
export default SpacingCode;

0 commit comments

Comments
 (0)