feat(frontend): switch to the dark graphite design system with a Lincodex wordmark
This commit is contained in:
1 parent
945ab6d6a9
commit
3c4acff803
81 files changed
+3187
-619
No files matched your search
@@ -1,45 +0,0 @@
|
||||
.root {
|
||||
display: inline-flex;
|
||||
gap: var(--space-3);
|
||||
align-items: center;
|
||||
min-height: 2.75rem;
|
||||
border-radius: var(--radius-s);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: auto;
|
||||
height: 1.75rem;
|
||||
}
|
||||
|
||||
.divider {
|
||||
align-self: stretch;
|
||||
width: var(--line-thin);
|
||||
margin-block: var(--space-2);
|
||||
background: currentcolor;
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.name {
|
||||
display: grid;
|
||||
font-size: var(--font-size-m);
|
||||
font-weight: var(--font-weight-bold);
|
||||
letter-spacing: -0.01em;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.context {
|
||||
font-size: var(--font-size-xs);
|
||||
font-weight: var(--font-weight-medium);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
/* Graphite on white 17.01:1. */
|
||||
.light {
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
/* Light grey on graphite 14.53:1. */
|
||||
.dark {
|
||||
color: var(--palette-light);
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
import { Link } from "react-router-dom";
|
||||
import logoOnDark from "./fsp-logo-on-dark.svg";
|
||||
import logoOnLight from "./fsp-logo-on-light.svg";
|
||||
import styles from "./brand-logo.module.css";
|
||||
|
||||
type BrandLogoProps = {
|
||||
/** Background the logo sits on; selects the brandbook color variant. */
|
||||
tone?: "light" | "dark";
|
||||
/** Destination of the home link. */
|
||||
to?: string;
|
||||
/** Cabinet name shown after the product name. */
|
||||
context?: string | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Brandbook FSP logo (logo_02w for light, logo_01 for dark backgrounds)
|
||||
* followed by the product name. The whole block is one link home.
|
||||
*/
|
||||
export function BrandLogo({ tone = "light", to = "/", context }: BrandLogoProps) {
|
||||
return (
|
||||
<Link to={to} className={`${styles.root} ${styles[tone]}`}>
|
||||
<img
|
||||
className={styles.logo}
|
||||
src={tone === "dark" ? logoOnDark : logoOnLight}
|
||||
alt="ФСП"
|
||||
width="345"
|
||||
height="116"
|
||||
/>
|
||||
<span className={styles.divider} aria-hidden="true" />
|
||||
<span className={styles.name}>
|
||||
Lincodex
|
||||
{context ? <span className={styles.context}>{context}</span> : null}
|
||||
</span>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<svg width="345.000000" height="117.000000" viewBox="0 0 345 117" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<desc>
|
||||
Created with Pixso.
|
||||
</desc>
|
||||
<defs/>
|
||||
<path id="Vector" d="M36.42 96.37C35.54 95.73 34.88 94.83 34.54 93.79C34.2 92.76 34.2 91.64 34.53 90.61L35.61 86.15C35.81 85.36 36.16 84.63 36.66 83.99C37.15 83.35 37.78 82.82 38.49 82.44L42.03 80.58C44.22 79.45 45.97 77.62 47 75.38C48.02 73.15 48.28 70.63 47.72 68.24L47.67 68.01C47.01 65.33 45.38 62.99 43.08 61.45C40.79 59.9 38 59.27 35.27 59.67L31.3 60.24C30.5 60.35 29.68 60.3 28.89 60.07C28.11 59.85 27.39 59.46 26.76 58.94L23.26 55.97C22.39 55.32 21.75 54.41 21.41 53.38C21.08 52.35 21.08 51.24 21.41 50.21C22.15 47.92 22.13 45.45 21.34 43.17C20.56 40.89 19.05 38.93 17.05 37.59C15.05 36.24 12.67 35.58 10.26 35.71C7.85 35.84 5.55 36.74 3.71 38.29C1.86 39.84 0.57 41.95 0.03 44.3C-0.51 46.64 -0.27 49.1 0.72 51.3C1.7 53.5 3.37 55.32 5.48 56.48C7.59 57.65 10.03 58.09 12.41 57.75C12.8 57.7 13.18 57.61 13.56 57.52L14.59 57.32C15.45 57.16 16.33 57.18 17.17 57.4C18.02 57.62 18.8 58.03 19.46 58.6L24.22 62.72C24.95 63.35 25.51 64.16 25.84 65.07C26.17 65.98 26.27 66.95 26.13 67.91L26.01 68.63L25.91 69.27L25.91 69.32C25.76 70.64 25.84 71.98 26.16 73.27C26.16 73.35 26.16 73.42 26.22 73.49L26.22 73.57C26.67 75.32 27.56 76.93 28.79 78.26C28.94 78.42 29.09 78.57 29.24 78.71L29.76 79.23C30.45 79.93 30.95 80.78 31.21 81.72C31.47 82.66 31.5 83.65 31.27 84.6L29.82 90.7C29.62 91.54 29.23 92.33 28.68 93.01C28.12 93.68 27.42 94.22 26.63 94.58L25.74 94.99C25.38 95.13 25.02 95.3 24.68 95.48C23.06 96.33 21.67 97.58 20.66 99.1C18.97 101.51 18.32 104.49 18.83 107.38C19.35 110.27 21 112.84 23.41 114.52C25.82 116.2 28.8 116.86 31.7 116.34C34.6 115.83 37.17 114.18 38.85 111.77C39.85 110.41 40.52 108.84 40.81 107.17C40.88 106.8 40.93 106.42 40.96 106.04L41.08 105.07C41.01 103.36 40.56 101.69 39.75 100.18C38.94 98.67 37.81 97.37 36.42 96.37Z" fill="#EDEDED" fill-opacity="1.000000" fill-rule="nonzero"/>
|
||||
<path id="Vector" d="M121.18 43.37C120.59 41.59 119.56 39.98 118.18 38.7C116.81 37.42 115.12 36.51 113.3 36.05C111.47 35.6 109.56 35.62 107.74 36.1C105.92 36.59 104.26 37.53 102.9 38.83C102.61 39.09 102.34 39.37 102.08 39.66L101.41 40.38C100.82 41.02 100.09 41.52 99.28 41.83C98.47 42.15 97.6 42.28 96.73 42.21L90.47 41.7C89.5 41.62 88.56 41.3 87.75 40.76C86.93 40.22 86.27 39.48 85.82 38.61L85.49 37.96C85.39 37.76 85.3 37.57 85.19 37.39L85.19 37.33C84.54 36.17 83.69 35.14 82.66 34.28L82.5 34.15L82.42 34.08C81.02 32.94 79.36 32.16 77.59 31.8L77.52 31.8L76.89 31.7L76.15 31.64C75.19 31.48 74.28 31.08 73.52 30.48C72.75 29.88 72.15 29.09 71.77 28.19L69.35 22.43C69.01 21.63 68.87 20.76 68.92 19.89C68.97 19.02 69.22 18.17 69.64 17.41L70.13 16.59C70.34 16.26 70.53 15.92 70.7 15.58C71.44 14.06 71.83 12.4 71.83 10.71C71.75 7.82 70.54 5.08 68.47 3.07C66.4 1.05 63.62 -0.07 60.73 -0.07C57.84 -0.07 55.06 1.05 52.99 3.07C50.92 5.08 49.71 7.82 49.63 10.71C49.63 12.4 50.02 14.06 50.76 15.58C50.94 15.92 51.13 16.26 51.33 16.59L51.82 17.41C52.25 18.17 52.49 19.02 52.54 19.89C52.59 20.76 52.45 21.63 52.11 22.43L49.69 28.19C49.32 29.09 48.72 29.87 47.96 30.47C47.2 31.08 46.3 31.48 45.34 31.64L44.62 31.75L43.98 31.86L43.92 31.86C42.61 32.12 41.36 32.62 40.23 33.33L40.07 33.43C40.03 33.45 40 33.47 39.98 33.49C38.45 34.47 37.19 35.81 36.31 37.4L36.31 37.46C36.21 37.64 36.11 37.84 36.02 38.03C31.52 47.67 41.37 53.02 42.61 53.35C44.13 53.81 45.73 53.95 47.31 53.77C48.89 53.59 50.41 53.09 51.78 52.3L51.99 52.16C54.34 50.71 56.06 48.43 56.81 45.77C57.56 43.12 57.29 40.28 56.05 37.81L54.25 34.19C53.89 33.46 53.69 32.66 53.66 31.85C53.63 31.04 53.78 30.23 54.08 29.48L55.8 25.23C56.15 24.2 56.81 23.31 57.69 22.68C58.57 22.05 59.63 21.71 60.71 21.71C61.79 21.71 62.85 22.05 63.73 22.68C64.61 23.31 65.27 24.2 65.62 25.23L67.37 29.48C67.68 30.23 67.82 31.04 67.8 31.85C67.77 32.66 67.57 33.46 67.21 34.19L65.44 37.78C64.34 39.99 64 42.5 64.5 44.92C64.99 47.34 66.28 49.52 68.16 51.12L68.33 51.28C69.77 52.49 71.5 53.31 73.35 53.67C75.2 54.03 77.11 53.92 78.9 53.33C80.54 52.81 82.03 51.9 83.26 50.69L86.13 47.9C86.71 47.33 87.41 46.88 88.17 46.6C88.94 46.31 89.76 46.2 90.58 46.26L95.16 46.6C96.24 46.62 97.29 46.97 98.17 47.6C99.05 48.24 99.7 49.14 100.04 50.16C100.75 52.32 102.52 56.46 109 57.7C110.87 57.97 112.77 57.75 114.53 57.08C116.28 56.41 117.84 55.3 119.05 53.86C120.27 52.42 121.09 50.7 121.45 48.85C121.81 47 121.7 45.1 121.12 43.31L121.18 43.37Z" fill="#EC1D35" fill-opacity="1.000000" fill-rule="nonzero"/>
|
||||
<path id="Vector" d="M81.12 60.1C79.62 60.62 78.24 61.44 77.07 62.51C75.9 63.59 74.96 64.89 74.32 66.34C74.32 66.42 74.25 66.49 74.23 66.57C73.2 69.12 73.16 71.97 74.11 74.56C75.07 77.15 76.96 79.28 79.41 80.56L82.96 82.42C83.68 82.8 84.31 83.33 84.81 83.97C85.31 84.61 85.66 85.35 85.86 86.14L86.95 90.6C87.28 91.63 87.27 92.75 86.94 93.78C86.6 94.81 85.94 95.71 85.06 96.35C84.18 96.99 83.12 97.33 82.03 97.33C80.94 97.34 79.88 96.99 79 96.36L75.09 93.95C74.39 93.53 73.8 92.97 73.33 92.3C72.88 91.63 72.56 90.87 72.42 90.07L71.74 86.13C71.34 83.7 70.14 81.47 68.32 79.79C66.5 78.12 64.18 77.11 61.72 76.9L61.48 76.9C58.72 76.7 55.99 77.54 53.82 79.25C51.65 80.96 50.19 83.41 49.74 86.14C48.17 95.52 56.62 98.57 59.89 98.99L60.2 98.99C62 99.09 63.81 98.75 65.45 98L65.51 98L66.09 97.71L66.74 97.38C67.61 96.94 68.58 96.73 69.56 96.77C70.53 96.8 71.48 97.09 72.32 97.59L77.68 100.88C78.43 101.34 79.06 101.95 79.53 102.69C80 103.42 80.3 104.25 80.39 105.11L80.51 106.09C80.54 106.47 80.58 106.86 80.65 107.25C80.97 109.1 81.76 110.84 82.94 112.31C84.13 113.77 85.66 114.92 87.41 115.62C89.16 116.33 91.06 116.58 92.93 116.35C94.8 116.13 96.58 115.43 98.11 114.32C99.63 113.21 100.85 111.74 101.65 110.03C102.44 108.33 102.79 106.45 102.66 104.57C102.53 102.69 101.92 100.88 100.89 99.3C99.86 97.72 98.44 96.43 96.78 95.55C96.43 95.37 96.08 95.21 95.71 95.07L94.82 94.65C94.03 94.29 93.33 93.76 92.78 93.09C92.23 92.41 91.83 91.62 91.63 90.78L90.18 84.67C89.96 83.72 89.98 82.73 90.25 81.79C90.51 80.86 91.01 80 91.69 79.31L92.21 78.79C92.37 78.64 92.52 78.49 92.66 78.33L92.66 78.29C93.57 77.31 94.29 76.18 94.79 74.94L94.86 74.76L94.86 74.66C95.52 72.98 95.75 71.16 95.54 69.36L95.54 69.3C94.07 58.58 83.49 59.22 81.12 60.1Z" fill="#402FFF" fill-opacity="1.000000" fill-rule="nonzero"/>
|
||||
<path id="Vector" d="M174.15 98.32L174.15 89.57L163.44 89.57C161 89.52 158.61 88.83 156.52 87.58C154.21 86.22 150.12 81.72 148.86 79.94C147.62 78 147 75.74 147.08 73.44L147.08 41.91C146.99 39.58 147.61 37.28 148.86 35.32C150.12 33.68 154.21 29.14 156.52 27.78C158.61 26.53 161 25.85 163.44 25.79L174.15 25.79L174.15 17.3L185.8 17.3L185.8 25.78L196.26 25.78C198.69 25.84 201.07 26.53 203.18 27.76C205.49 29.13 209.47 33.63 210.84 35.31C212.09 37.27 212.71 39.57 212.62 41.89L212.62 73.43C212.7 75.72 212.08 77.99 210.84 79.92C209.47 81.71 205.49 86.21 203.18 87.56C201.08 88.8 198.69 89.49 196.26 89.56L185.8 89.56L185.8 98.3L174.15 98.32ZM163.69 77.32L174.15 77.32L174.15 38.03L163.8 38.03C162.33 39.17 161.02 40.51 159.92 42.01L159.92 73.44C160.99 74.91 162.26 76.21 163.69 77.32ZM199.82 41.93C198.82 40.42 197.54 39.1 196.05 38.05L185.8 38.05L185.8 77.34L195.94 77.34C197.37 76.19 198.67 74.89 199.82 73.47L199.82 41.93Z" fill="#EDEDED" fill-opacity="1.000000" fill-rule="nonzero"/>
|
||||
<path id="Vector" d="M268.09 44.63C266.94 41.93 265 39.63 262.53 38.05L243.89 38.05C242.31 39.23 240.92 40.64 239.77 42.24L239.77 73.46C240.82 75.05 242.23 76.38 243.89 77.33L262.73 77.33C264.99 75.69 266.83 73.54 268.09 71.05L280.05 73.99C279.18 76.37 277.98 78.63 276.48 80.68C273.96 84.25 269.06 89.59 262.64 89.59L243.36 89.59C240.92 89.52 238.54 88.84 236.44 87.6C234.24 86.24 230.25 82.05 228.78 80.06C227.6 78.1 226.98 75.85 226.99 73.57L226.99 41.8C226.9 39.5 227.52 37.23 228.78 35.31C230.03 33.66 234.13 29.23 236.54 27.76C238.62 26.56 240.96 25.88 243.36 25.78L262.64 25.78C269.04 25.78 273.87 31.12 276.38 34.57C277.87 36.62 279.07 38.87 279.95 41.25L268.09 44.63Z" fill="#EDEDED" fill-opacity="1.000000" fill-rule="nonzero"/>
|
||||
<path id="Vector" d="M332.05 89.05L332.05 38.45L305.54 38.45L305.54 89.05L292.74 89.05L292.74 29.73C292.74 28.8 293.11 27.91 293.77 27.26C294.43 26.6 295.31 26.23 296.24 26.23L341.35 26.23C342.27 26.23 343.16 26.6 343.82 27.26C344.47 27.91 344.84 28.8 344.85 29.73L344.85 89.1L332.05 89.05Z" fill="#EDEDED" fill-opacity="1.000000" fill-rule="nonzero"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 8.2 KiB |
@@ -1,12 +0,0 @@
|
||||
<svg width="345.000000" height="116.000000" viewBox="0 0 345 116" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<desc>
|
||||
Created with Pixso.
|
||||
</desc>
|
||||
<defs/>
|
||||
<path id="Vector" d="M36.42 95.22C35.54 94.59 34.88 93.7 34.54 92.67C34.2 91.65 34.2 90.54 34.53 89.51L35.61 85.09C35.81 84.32 36.16 83.59 36.66 82.96C37.15 82.33 37.78 81.8 38.49 81.42L42.03 79.58C44.22 78.46 45.97 76.64 47 74.43C48.02 72.21 48.28 69.72 47.72 67.35L47.67 67.13C47.01 64.47 45.38 62.15 43.08 60.62C40.79 59.09 38 58.46 35.27 58.86L31.3 59.42C30.5 59.54 29.68 59.48 28.89 59.26C28.11 59.04 27.39 58.65 26.76 58.13L23.26 55.19C22.39 54.55 21.75 53.65 21.41 52.63C21.08 51.61 21.08 50.51 21.41 49.48C22.15 47.21 22.13 44.76 21.34 42.51C20.56 40.25 19.05 38.31 17.05 36.98C15.05 35.64 12.67 34.99 10.26 35.11C7.85 35.24 5.55 36.14 3.71 37.68C1.86 39.21 0.57 41.3 0.03 43.63C-0.51 45.95 -0.27 48.39 0.72 50.57C1.7 52.74 3.37 54.55 5.48 55.7C7.59 56.85 10.03 57.3 12.41 56.96C12.8 56.9 13.18 56.82 13.56 56.73L14.59 56.54C15.45 56.37 16.33 56.39 17.17 56.61C18.02 56.83 18.8 57.24 19.46 57.8L24.22 61.88C24.95 62.51 25.51 63.31 25.84 64.21C26.17 65.11 26.27 66.08 26.13 67.02L26.01 67.74L25.91 68.37L25.91 68.43C25.76 69.73 25.84 71.06 26.16 72.34C26.16 72.41 26.16 72.49 26.22 72.55L26.22 72.63C26.67 74.37 27.56 75.97 28.79 77.28C28.94 77.44 29.09 77.58 29.24 77.73L29.76 78.24C30.45 78.93 30.95 79.78 31.21 80.71C31.47 81.64 31.5 82.62 31.27 83.56L29.82 89.6C29.62 90.44 29.23 91.23 28.68 91.9C28.12 92.56 27.42 93.1 26.63 93.45L25.74 93.86C25.38 94 25.02 94.16 24.68 94.34C23.06 95.19 21.67 96.42 20.66 97.93C18.97 100.32 18.32 103.27 18.83 106.14C19.35 109 21 111.55 23.41 113.21C25.82 114.88 28.8 115.53 31.7 115.02C34.6 114.51 37.17 112.88 38.85 110.49C39.85 109.14 40.52 107.58 40.81 105.93C40.88 105.56 40.93 105.18 40.96 104.81L41.08 103.84C41.01 102.15 40.56 100.5 39.75 99C38.94 97.51 37.81 96.22 36.42 95.22Z" fill="#C8C9CA" fill-opacity="1.000000" fill-rule="nonzero"/>
|
||||
<path id="Vector" d="M121.18 42.71C120.59 40.94 119.56 39.35 118.18 38.08C116.81 36.81 115.12 35.91 113.3 35.46C111.47 35.01 109.56 35.02 107.74 35.51C105.92 35.99 104.26 36.92 102.9 38.21C102.61 38.47 102.34 38.74 102.08 39.03L101.41 39.74C100.82 40.38 100.09 40.87 99.28 41.18C98.47 41.5 97.6 41.63 96.73 41.56L90.47 41.06C89.5 40.98 88.56 40.65 87.75 40.12C86.93 39.58 86.27 38.85 85.82 37.99L85.49 37.35C85.39 37.15 85.3 36.96 85.19 36.78L85.19 36.73C84.54 35.57 83.69 34.55 82.66 33.7L82.5 33.57L82.42 33.5C81.02 32.37 79.36 31.6 77.59 31.25L77.52 31.25L76.89 31.14L76.15 31.08C75.19 30.93 74.28 30.53 73.52 29.93C72.75 29.34 72.15 28.56 71.77 27.67L69.35 21.96C69.01 21.16 68.87 20.3 68.92 19.44C68.97 18.57 69.22 17.74 69.64 16.98L70.13 16.17C70.34 15.84 70.53 15.51 70.7 15.16C71.44 13.67 71.83 12.02 71.83 10.34C71.75 7.48 70.54 4.77 68.47 2.77C66.4 0.78 63.62 -0.34 60.73 -0.34C57.84 -0.34 55.06 0.78 52.99 2.77C50.92 4.77 49.71 7.48 49.63 10.34C49.63 12.02 50.02 13.67 50.76 15.16C50.94 15.51 51.13 15.84 51.33 16.17L51.82 16.98C52.25 17.74 52.49 18.57 52.54 19.44C52.59 20.3 52.45 21.16 52.11 21.96L49.69 27.67C49.32 28.55 48.72 29.33 47.96 29.93C47.2 30.52 46.3 30.92 45.34 31.08L44.62 31.2L43.98 31.3L43.92 31.3C42.61 31.56 41.36 32.05 40.23 32.75L40.07 32.86C40.03 32.87 40 32.89 39.98 32.92C38.45 33.89 37.19 35.22 36.31 36.79L36.31 36.85C36.21 37.03 36.11 37.22 36.02 37.41C31.52 46.97 41.37 52.27 42.61 52.6C44.13 53.05 45.73 53.19 47.31 53.01C48.89 52.83 50.41 52.34 51.78 51.55L51.99 51.42C54.34 49.98 56.06 47.72 56.81 45.09C57.56 42.46 57.29 39.64 56.05 37.2L54.25 33.61C53.89 32.89 53.69 32.1 53.66 31.29C53.63 30.49 53.78 29.68 54.08 28.94L55.8 24.73C56.15 23.71 56.81 22.83 57.69 22.2C58.57 21.58 59.63 21.24 60.71 21.24C61.79 21.24 62.85 21.58 63.73 22.2C64.61 22.83 65.27 23.71 65.62 24.73L67.37 28.94C67.68 29.68 67.82 30.49 67.8 31.29C67.77 32.1 67.57 32.89 67.21 33.61L65.44 37.17C64.34 39.35 64 41.84 64.5 44.24C64.99 46.64 66.28 48.8 68.16 50.39L68.33 50.54C69.77 51.74 71.5 52.56 73.35 52.92C75.2 53.27 77.11 53.16 78.9 52.58C80.54 52.06 82.03 51.16 83.26 49.96L86.13 47.2C86.71 46.63 87.41 46.19 88.17 45.91C88.94 45.62 89.76 45.51 90.58 45.57L95.16 45.91C96.24 45.92 97.29 46.27 98.17 46.9C99.05 47.54 99.7 48.42 100.04 49.44C100.75 51.58 102.52 55.68 109 56.91C110.87 57.17 112.77 56.96 114.53 56.29C116.28 55.63 117.84 54.53 119.05 53.1C120.27 51.67 121.09 49.97 121.45 48.14C121.81 46.31 121.7 44.42 121.12 42.65L121.18 42.71Z" fill="#EC1D35" fill-opacity="1.000000" fill-rule="nonzero"/>
|
||||
<path id="Vector" d="M81.12 59.28C79.62 59.8 78.24 60.61 77.07 61.68C75.9 62.74 74.96 64.03 74.32 65.47C74.32 65.55 74.25 65.62 74.23 65.69C73.2 68.23 73.16 71.05 74.11 73.61C75.07 76.18 76.96 78.3 79.41 79.56L82.96 81.4C83.68 81.78 84.31 82.3 84.81 82.94C85.31 83.57 85.66 84.3 85.86 85.09L86.95 89.51C87.28 90.53 87.27 91.64 86.94 92.66C86.6 93.68 85.94 94.57 85.06 95.21C84.18 95.84 83.12 96.18 82.03 96.18C80.94 96.18 79.88 95.85 79 95.22L75.09 92.83C74.39 92.41 73.8 91.86 73.33 91.19C72.88 90.53 72.56 89.78 72.42 88.98L71.74 85.08C71.34 82.67 70.14 80.46 68.32 78.8C66.5 77.15 64.18 76.14 61.72 75.94L61.48 75.94C58.72 75.74 55.99 76.57 53.82 78.26C51.65 79.95 50.19 82.39 49.74 85.09C48.17 94.38 56.62 97.41 59.89 97.82L60.2 97.82C62 97.93 63.81 97.59 65.45 96.84L65.51 96.84L66.09 96.55L66.74 96.23C67.61 95.79 68.58 95.58 69.56 95.62C70.53 95.66 71.48 95.94 72.32 96.44L77.68 99.7C78.43 100.15 79.06 100.76 79.53 101.49C80 102.21 80.3 103.04 80.39 103.89L80.51 104.85C80.54 105.24 80.58 105.62 80.65 106C80.97 107.84 81.76 109.57 82.94 111.02C84.13 112.47 85.67 113.6 87.41 114.31C89.16 115.01 91.06 115.26 92.93 115.03C94.8 114.81 96.58 114.11 98.11 113.02C99.63 111.92 100.85 110.46 101.65 108.77C102.44 107.07 102.79 105.21 102.66 103.35C102.53 101.49 101.92 99.69 100.89 98.13C99.86 96.57 98.44 95.29 96.78 94.42C96.43 94.24 96.08 94.08 95.71 93.93L94.82 93.53C94.03 93.17 93.33 92.64 92.78 91.97C92.23 91.31 91.83 90.52 91.63 89.69L90.18 83.63C89.96 82.69 89.98 81.71 90.25 80.78C90.51 79.85 91.01 79.01 91.69 78.32L92.21 77.8C92.37 77.66 92.52 77.51 92.66 77.36L92.66 77.31C93.57 76.34 94.29 75.22 94.79 74L94.86 73.81L94.86 73.72C95.52 72.05 95.75 70.25 95.54 68.47L95.54 68.4C94.07 57.78 83.49 58.41 81.12 59.28Z" fill="#402FFF" fill-opacity="1.000000" fill-rule="nonzero"/>
|
||||
<path id="Vector" d="M174.15 97.16L174.15 88.49L163.44 88.49C161 88.44 158.61 87.76 156.52 86.52C154.21 85.17 150.12 80.71 148.86 78.94C147.62 77.03 147 74.78 147.08 72.51L147.08 41.26C146.99 38.95 147.61 36.68 148.86 34.73C150.12 33.1 154.21 28.61 156.52 27.25C158.61 26.02 161 25.34 163.44 25.29L174.15 25.29L174.15 16.87L185.8 16.87L185.8 25.27L196.26 25.27C198.69 25.34 201.07 26.02 203.18 27.24C205.49 28.59 209.47 33.05 210.84 34.72C212.09 36.66 212.71 38.94 212.62 41.24L212.62 72.49C212.7 74.76 212.08 77.01 210.84 78.93C209.47 80.69 205.49 85.16 203.18 86.5C201.08 87.73 198.69 88.41 196.26 88.47L185.8 88.47L185.8 97.14L174.15 97.16ZM163.69 76.35L174.15 76.35L174.15 37.42L163.8 37.42C162.33 38.54 161.02 39.87 159.92 41.36L159.92 72.51C160.99 73.96 162.26 75.25 163.69 76.35ZM199.82 41.28C198.82 39.78 197.54 38.48 196.05 37.44L185.8 37.44L185.8 76.37L195.94 76.37C197.37 75.23 198.67 73.94 199.82 72.53L199.82 41.28Z" fill="#1B1C21" fill-opacity="1.000000" fill-rule="nonzero"/>
|
||||
<path id="Vector" d="M268.09 43.96C266.94 41.28 265 39 262.53 37.43L243.89 37.43C242.31 38.6 240.92 40 239.77 41.58L239.77 72.52C240.82 74.1 242.23 75.41 243.89 76.36L262.73 76.36C264.99 74.74 266.83 72.6 268.09 70.13L280.05 73.05C279.18 75.41 277.98 77.65 276.48 79.68C273.96 83.21 269.06 88.51 262.64 88.51L243.36 88.51C240.92 88.44 238.54 87.76 236.44 86.53C234.24 85.19 230.25 81.04 228.78 79.06C227.6 77.12 226.98 74.9 226.99 72.63L226.99 41.15C226.9 38.87 227.52 36.62 228.78 34.72C230.03 33.09 234.13 28.7 236.54 27.24C238.62 26.05 240.96 25.38 243.36 25.27L262.64 25.27C269.04 25.27 273.87 30.57 276.38 33.99C277.87 36.02 279.07 38.25 279.95 40.6L268.09 43.96Z" fill="#1B1C21" fill-opacity="1.000000" fill-rule="nonzero"/>
|
||||
<path id="Vector" d="M332.05 87.98L332.05 37.83L305.54 37.83L305.54 87.98L292.74 87.98L292.74 29.19C292.74 28.27 293.11 27.39 293.77 26.74C294.43 26.09 295.31 25.73 296.24 25.72L341.35 25.72C342.27 25.73 343.16 26.09 343.82 26.74C344.47 27.39 344.84 28.27 344.85 29.19L344.85 88.02L332.05 87.98Z" fill="#1B1C21" fill-opacity="1.000000" fill-rule="nonzero"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 8.2 KiB |
@@ -0,0 +1,73 @@
|
||||
.root {
|
||||
display: inline-flex;
|
||||
gap: var(--space-3);
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.link {
|
||||
display: inline-flex;
|
||||
gap: 0.14em;
|
||||
align-items: center;
|
||||
min-height: var(--control-height);
|
||||
padding-inline: var(--space-1);
|
||||
margin-inline: calc(-1 * var(--space-1));
|
||||
border-radius: var(--radius-xs);
|
||||
color: var(--color-text-strong);
|
||||
font-size: 1.3125rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.root[data-size="s"] .link {
|
||||
font-size: 1.0625rem;
|
||||
}
|
||||
|
||||
/* Wide geometric display face with tight tracking: the name reads as one
|
||||
* mark, not as a word in a sentence. */
|
||||
.word {
|
||||
font-family: var(--font-display);
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.045em;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* Terminal caret: a bar in the action color, cap height tall. It blinks a
|
||||
* few times after the page loads and then stays lit. */
|
||||
.caret {
|
||||
flex: none;
|
||||
width: 0.2em;
|
||||
height: 0.78em;
|
||||
margin-top: 0.02em;
|
||||
border-radius: 1px;
|
||||
background: var(--color-action);
|
||||
animation: caret-blink 1.1s steps(1, end) 3;
|
||||
}
|
||||
|
||||
.link:hover .caret {
|
||||
background: var(--color-accent);
|
||||
}
|
||||
|
||||
/* Cabinet name: a mono label separated by a hairline. */
|
||||
.context {
|
||||
padding-left: var(--space-3);
|
||||
border-left: var(--line-thin) solid var(--color-divider);
|
||||
color: var(--color-text-secondary);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-xs);
|
||||
font-weight: var(--font-weight-medium);
|
||||
letter-spacing: 0.02em;
|
||||
line-height: var(--line-height-snug);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@keyframes caret-blink {
|
||||
50% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.caret {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { Link } from "react-router-dom";
|
||||
import styles from "./wordmark.module.css";
|
||||
|
||||
const productName = "Lincodex";
|
||||
|
||||
type WordmarkProps = {
|
||||
/** Destination of the home link. */
|
||||
to?: string;
|
||||
/** Cabinet name shown next to the wordmark, outside the link. */
|
||||
context?: string | undefined;
|
||||
/** Compact size for footers and narrow headers. */
|
||||
size?: "m" | "s";
|
||||
};
|
||||
|
||||
/**
|
||||
* The Lincodex wordmark: the product name set in Unbounded with a terminal
|
||||
* caret in the action blue. It is text, so the link's accessible name is
|
||||
* exactly "Lincodex"; the caret is decoration. The cabinet name sits beside
|
||||
* the link and does not change that name.
|
||||
*/
|
||||
export function Wordmark({ to = "/", context, size = "m" }: WordmarkProps) {
|
||||
return (
|
||||
<span className={styles.root} data-size={size}>
|
||||
<Link to={to} className={styles.link}>
|
||||
<span className={styles.word}>{productName}</span>
|
||||
<span className={styles.caret} aria-hidden="true" />
|
||||
</Link>
|
||||
{context ? <span className={styles.context}>{context}</span> : null}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
@@ -1,63 +1,97 @@
|
||||
/* Every control is a capsule. Labels are set in JetBrains Mono. */
|
||||
.root {
|
||||
display: inline-flex;
|
||||
gap: var(--space-2);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 2.75rem;
|
||||
min-height: var(--control-height);
|
||||
padding: var(--space-2) var(--space-5);
|
||||
border: var(--line-strong) solid transparent;
|
||||
border: var(--line-thin) solid transparent;
|
||||
border-radius: var(--radius-pill);
|
||||
font-size: var(--font-size-m);
|
||||
font-weight: var(--font-weight-bold);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.9375rem;
|
||||
font-weight: var(--font-weight-medium);
|
||||
letter-spacing: -0.005em;
|
||||
line-height: var(--line-height-snug);
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
background-color var(--duration-fast) var(--easing-standard),
|
||||
color var(--duration-fast) var(--easing-standard),
|
||||
background-color var(--duration-base) var(--easing-standard),
|
||||
border-color var(--duration-fast) var(--easing-standard),
|
||||
color var(--duration-base) var(--easing-standard),
|
||||
transform var(--duration-fast) var(--easing-standard);
|
||||
}
|
||||
|
||||
.root:active {
|
||||
transform: translateY(1px);
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.root[aria-disabled="true"] {
|
||||
cursor: progress;
|
||||
}
|
||||
|
||||
/* White on violet: 6.84:1. */
|
||||
/* A busy button keeps its label and shows a running underline. */
|
||||
.root[aria-busy="true"] {
|
||||
background-image: linear-gradient(currentcolor, currentcolor);
|
||||
background-position: -40% calc(100% - 0.5rem);
|
||||
background-repeat: no-repeat;
|
||||
background-size: 30% 1px;
|
||||
animation: busy 1.1s var(--easing-standard) infinite;
|
||||
}
|
||||
|
||||
/* White on blue 6.84:1. Hover inverts: blue on paper 5.85:1. */
|
||||
.primary {
|
||||
color: var(--color-on-accent);
|
||||
background: var(--color-accent);
|
||||
color: var(--color-on-action);
|
||||
background-color: var(--color-action);
|
||||
}
|
||||
|
||||
.primary:hover {
|
||||
background: var(--palette-graphite);
|
||||
color: var(--color-on-action-hover);
|
||||
background-color: var(--color-action-hover);
|
||||
}
|
||||
|
||||
/* Graphite border and text on white: 17.01:1. */
|
||||
.primary:active {
|
||||
color: var(--color-on-action);
|
||||
background-color: var(--color-action-pressed);
|
||||
}
|
||||
|
||||
/* Paper on the elevated graphite 11.52:1; hover white on line 9.9:1. */
|
||||
.secondary {
|
||||
border-color: var(--color-border-strong);
|
||||
border-color: var(--color-border-hover);
|
||||
color: var(--color-text);
|
||||
background: var(--color-surface);
|
||||
background-color: var(--color-surface-elevated);
|
||||
}
|
||||
|
||||
.secondary:hover {
|
||||
border-color: var(--color-accent);
|
||||
color: var(--color-accent);
|
||||
border-color: var(--color-border-strong);
|
||||
color: var(--color-text-strong);
|
||||
background-color: var(--color-surface-hover);
|
||||
}
|
||||
|
||||
/* Violet text on white 6.84:1, on light grey 5.85:1. */
|
||||
/* Link-like action: violet 6.42:1 on canvas, 6.05:1 on surface. */
|
||||
.quiet {
|
||||
padding-inline: var(--space-3);
|
||||
color: var(--color-link);
|
||||
background: transparent;
|
||||
background-color: transparent;
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 0.2em;
|
||||
text-decoration-thickness: var(--line-thin);
|
||||
text-underline-offset: 0.25em;
|
||||
}
|
||||
|
||||
.quiet:hover {
|
||||
text-decoration-thickness: var(--line-strong);
|
||||
color: var(--color-link-hover);
|
||||
}
|
||||
|
||||
@keyframes busy {
|
||||
to {
|
||||
background-position: 140% calc(100% - 0.5rem);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.root[aria-busy="true"] {
|
||||
animation: none;
|
||||
background-position: center calc(100% - 0.5rem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
.root {
|
||||
display: grid;
|
||||
gap: var(--space-3);
|
||||
min-width: 0;
|
||||
padding: var(--space-5);
|
||||
border: var(--line-thin) solid var(--color-divider);
|
||||
border-radius: var(--radius-m);
|
||||
background: var(--color-surface);
|
||||
}
|
||||
|
||||
.root[data-tone="inset"] {
|
||||
padding: var(--space-4);
|
||||
border-radius: var(--radius-s);
|
||||
background: var(--color-canvas);
|
||||
}
|
||||
|
||||
.root[data-tone="panel"] {
|
||||
padding: var(--space-6) var(--space-5);
|
||||
border-radius: var(--radius-l);
|
||||
}
|
||||
|
||||
@media (width >= 48rem) {
|
||||
.root[data-tone="panel"] {
|
||||
padding: var(--space-7);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import type { ReactNode } from "react";
|
||||
import styles from "./card.module.css";
|
||||
|
||||
type CardProps = {
|
||||
/** Element to render; a card in a list is an li. */
|
||||
as?: "div" | "section" | "article" | "li";
|
||||
/**
|
||||
* raised - a container on the canvas (radius 24);
|
||||
* inset - a surface nested inside a card (radius 16);
|
||||
* panel - a large page section (radius 32).
|
||||
*/
|
||||
tone?: "raised" | "inset" | "panel";
|
||||
/** Id of the heading that names a section or article card. */
|
||||
labelledBy?: string | undefined;
|
||||
className?: string | undefined;
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
/** Content container: graphite step plus a hairline, no shadow. */
|
||||
export function Card({ as = "div", tone = "raised", labelledBy, className, children }: CardProps) {
|
||||
const Element = as;
|
||||
return (
|
||||
<Element
|
||||
className={className ? `${styles.root} ${className}` : styles.root}
|
||||
data-tone={tone}
|
||||
aria-labelledby={labelledBy}
|
||||
>
|
||||
{children}
|
||||
</Element>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
.root {
|
||||
display: block;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.line {
|
||||
stroke: var(--color-trace);
|
||||
stroke-dasharray: 1;
|
||||
stroke-dashoffset: 1;
|
||||
stroke-linecap: round;
|
||||
stroke-width: 1.5;
|
||||
vector-effect: non-scaling-stroke;
|
||||
animation: draw 1.2s ease-out forwards;
|
||||
}
|
||||
|
||||
.late {
|
||||
animation-delay: 150ms;
|
||||
}
|
||||
|
||||
.later {
|
||||
animation-delay: 300ms;
|
||||
}
|
||||
|
||||
.node {
|
||||
fill: var(--color-canvas);
|
||||
stroke: var(--color-trace);
|
||||
stroke-width: 1.5;
|
||||
vector-effect: non-scaling-stroke;
|
||||
}
|
||||
|
||||
/* One lit node in the readable accent marks the live end of the trace. */
|
||||
.lit {
|
||||
fill: var(--color-accent);
|
||||
}
|
||||
|
||||
@keyframes draw {
|
||||
to {
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.line {
|
||||
stroke-dashoffset: 0;
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import styles from "./circuit-trace.module.css";
|
||||
|
||||
type CircuitTraceProps = {
|
||||
className?: string | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decorative circuit traces: thin lines with rounded turns and 8px nodes at
|
||||
* their ends, the decor of the design system. The lines draw themselves once
|
||||
* when they appear; reduced motion shows them drawn. Hidden from assistive
|
||||
* technology.
|
||||
*/
|
||||
export function CircuitTrace({ className }: CircuitTraceProps) {
|
||||
return (
|
||||
<svg
|
||||
className={className ? `${styles.root} ${className}` : styles.root}
|
||||
viewBox="0 0 240 140"
|
||||
fill="none"
|
||||
aria-hidden="true"
|
||||
focusable="false"
|
||||
preserveAspectRatio="xMaxYMid meet"
|
||||
>
|
||||
<path className={styles.line} pathLength={1} d="M4 36H132a24 24 0 0 1 24 24V136" />
|
||||
<path
|
||||
className={`${styles.line} ${styles.late}`}
|
||||
pathLength={1}
|
||||
d="M60 112H84a24 24 0 0 0 24-24V64a24 24 0 0 1 24-24h104"
|
||||
/>
|
||||
<path className={`${styles.line} ${styles.later}`} pathLength={1} d="M196 4V76" />
|
||||
<circle className={styles.node} cx="4" cy="36" r="4" />
|
||||
<circle className={styles.node} cx="60" cy="112" r="4" />
|
||||
<circle className={styles.node} cx="196" cy="80" r="4" />
|
||||
<circle className={styles.lit} cx="236" cy="40" r="4" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/* The frame spans the window and holds the inset; the plate floats in it. */
|
||||
.frame {
|
||||
padding: var(--chrome-inset) var(--chrome-inset) 0;
|
||||
}
|
||||
|
||||
/* Dark variant of the design system's floating plate: a light bar would be
|
||||
* the brightest object on every dark screen and compete with the one action
|
||||
* color. The graphite glass keeps the plate's shape and inset. */
|
||||
.plate {
|
||||
position: relative;
|
||||
display: flex;
|
||||
gap: var(--space-3);
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
max-width: calc(var(--content-width-wide) + 2 * var(--gutter));
|
||||
min-height: var(--header-height);
|
||||
margin-inline: auto;
|
||||
padding: var(--space-1) var(--space-2) var(--space-1) var(--space-4);
|
||||
border: var(--line-thin) solid var(--color-divider);
|
||||
border-radius: var(--radius-m);
|
||||
background: rgb(32 33 41 / 88%);
|
||||
backdrop-filter: blur(14px) saturate(140%);
|
||||
}
|
||||
|
||||
@supports not (backdrop-filter: blur(1px)) {
|
||||
.plate {
|
||||
background: var(--color-surface);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import type { ReactNode } from "react";
|
||||
import styles from "./header-plate.module.css";
|
||||
|
||||
type HeaderPlateProps = {
|
||||
/** Classes of the shell that lay out the plate's content. */
|
||||
className?: string | undefined;
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
/**
|
||||
* The floating header plate of every shell: a dark glass bar with radius 24,
|
||||
* inset from the window edges and sticky at the top. Shells place the
|
||||
* wordmark, navigation, and menu button inside it.
|
||||
*/
|
||||
export function HeaderPlate({ className, children }: HeaderPlateProps) {
|
||||
return (
|
||||
<div className={styles.frame}>
|
||||
<div className={className ? `${styles.plate} ${className}` : styles.plate}>{children}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +1,19 @@
|
||||
export { BrandLogo } from "./brand/brand-logo";
|
||||
export { Wordmark } from "./brand/wordmark";
|
||||
export { Button, ButtonLink, type ButtonVariant } from "./button/button";
|
||||
export { Card } from "./card/card";
|
||||
export { CircuitTrace } from "./decor/circuit-trace";
|
||||
export { HeaderPlate } from "./header-plate/header-plate";
|
||||
export { Page } from "./layout/page";
|
||||
export { Section } from "./layout/section";
|
||||
export { Stack } from "./layout/stack";
|
||||
export { NavItem, TextLink, type NavItemTone } from "./link/text-link";
|
||||
export { NavItem, TextLink, type NavItemLayout } from "./link/text-link";
|
||||
export { MainRegion, mainContentId } from "./main-region/main-region";
|
||||
export { MenuButton } from "./menu-button/menu-button";
|
||||
export { useMenuToggle } from "./menu-button/use-menu-toggle";
|
||||
export { Mono } from "./mono/mono";
|
||||
export { Notice, type NoticeTone } from "./notice/notice";
|
||||
export { SegmentedControl, type SegmentedOption } from "./segmented-control/segmented-control";
|
||||
export { Skeleton } from "./skeleton/skeleton";
|
||||
export { SkipLink } from "./skip-link/skip-link";
|
||||
export { describeError, isAccessDenied, type ErrorDescription } from "./status-view/describe-error";
|
||||
export { QueryView, type QueryViewSource } from "./status-view/query-view";
|
||||
@@ -19,6 +27,11 @@ export {
|
||||
type SavingStatusValue,
|
||||
type StatusKind,
|
||||
} from "./status-view/status-view";
|
||||
export { buildSteps, type StepStatus, type StepperStep } from "./stepper/build-steps";
|
||||
export { Stepper } from "./stepper/stepper";
|
||||
export { tabKeyTarget } from "./tabs/tab-keys";
|
||||
export { Tabs, type TabItem } from "./tabs/tabs";
|
||||
export { AttentionDot, Tag, type TagTone } from "./tag/tag";
|
||||
export { TrustLevel } from "./trust-level/trust-level";
|
||||
export { trustLevelLabels, type TrustLevelValue } from "./trust-level/trust-level-labels";
|
||||
export { VisuallyHidden } from "./visually-hidden/visually-hidden";
|
||||
@@ -12,43 +12,61 @@
|
||||
max-width: calc(var(--content-width-wide) + 2 * var(--gutter));
|
||||
}
|
||||
|
||||
/* The header closes with a hairline trace that starts at a node. */
|
||||
.page-header {
|
||||
position: relative;
|
||||
display: grid;
|
||||
gap: var(--space-3);
|
||||
padding-bottom: var(--space-5);
|
||||
border-bottom: var(--line-thin) solid var(--color-divider);
|
||||
}
|
||||
|
||||
.page-header::after {
|
||||
position: absolute;
|
||||
bottom: -0.25rem;
|
||||
left: 0;
|
||||
width: 0.5rem;
|
||||
height: 0.5rem;
|
||||
border-radius: 50%;
|
||||
content: "";
|
||||
background: var(--color-accent);
|
||||
}
|
||||
|
||||
/* Mono label above the title, steel on canvas 6.19:1. */
|
||||
.eyebrow {
|
||||
color: var(--color-accent);
|
||||
color: var(--color-text-secondary);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-xs);
|
||||
font-weight: var(--font-weight-bold);
|
||||
font-weight: var(--font-weight-medium);
|
||||
letter-spacing: var(--letter-spacing-label);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: var(--font-size-display);
|
||||
font-weight: var(--font-weight-bold);
|
||||
color: var(--color-text-strong);
|
||||
font-size: var(--font-size-title);
|
||||
font-weight: var(--font-weight-medium);
|
||||
letter-spacing: var(--letter-spacing-display);
|
||||
line-height: var(--line-height-tight);
|
||||
line-height: 1.25;
|
||||
overflow-wrap: anywhere;
|
||||
hyphens: auto;
|
||||
}
|
||||
|
||||
.lead {
|
||||
max-width: 38rem;
|
||||
max-width: 42rem;
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--font-size-l);
|
||||
font-size: 1.0625rem;
|
||||
line-height: var(--line-height-body);
|
||||
}
|
||||
|
||||
.page-body {
|
||||
display: grid;
|
||||
gap: var(--space-6);
|
||||
gap: var(--space-7);
|
||||
padding-top: var(--space-6);
|
||||
}
|
||||
|
||||
/* A section hangs on a circuit trace: a node at the heading and a hairline
|
||||
* down the left edge that turns with a rounded corner. */
|
||||
.section {
|
||||
position: relative;
|
||||
display: grid;
|
||||
@@ -56,31 +74,33 @@
|
||||
padding-left: var(--space-5);
|
||||
}
|
||||
|
||||
/* Node at the heading plus a thin line down the section. */
|
||||
.connector {
|
||||
position: absolute;
|
||||
top: 0.55em;
|
||||
top: 0.7em;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
left: 0.1875rem;
|
||||
width: var(--space-3);
|
||||
border-left: var(--line-thin) solid var(--color-accent);
|
||||
border-bottom-left-radius: var(--radius-m);
|
||||
border-bottom-left-radius: var(--radius-s);
|
||||
border-left: var(--line-thin) solid var(--color-divider);
|
||||
}
|
||||
|
||||
.connector::before {
|
||||
position: absolute;
|
||||
top: -0.3rem;
|
||||
left: calc(-0.3rem - 0.5px);
|
||||
width: 0.6rem;
|
||||
height: 0.6rem;
|
||||
top: -0.25rem;
|
||||
left: calc(-0.25rem - 0.5px);
|
||||
width: 0.5rem;
|
||||
height: 0.5rem;
|
||||
border: var(--line-thin) solid var(--color-accent);
|
||||
border-radius: 50%;
|
||||
content: "";
|
||||
background: var(--color-accent);
|
||||
background: var(--color-canvas);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
color: var(--color-text-strong);
|
||||
font-size: var(--font-size-xl);
|
||||
font-weight: var(--font-weight-bold);
|
||||
font-weight: var(--font-weight-medium);
|
||||
letter-spacing: -0.015em;
|
||||
}
|
||||
|
||||
.section-description {
|
||||
|
||||
@@ -1,67 +1,54 @@
|
||||
/* Violet on canvas 6.42:1, on surface 6.05:1, on the elevated surface 5.09:1.
|
||||
* Links are underlined so color is not the only cue. */
|
||||
.link {
|
||||
border-radius: var(--radius-xs);
|
||||
color: var(--color-link);
|
||||
text-decoration: underline;
|
||||
text-decoration-color: color-mix(in srgb, currentcolor 55%, transparent);
|
||||
text-decoration-thickness: var(--line-thin);
|
||||
text-underline-offset: 0.2em;
|
||||
text-underline-offset: 0.22em;
|
||||
transition:
|
||||
color var(--duration-fast) var(--easing-standard),
|
||||
text-decoration-color var(--duration-fast) var(--easing-standard);
|
||||
}
|
||||
|
||||
.link:hover {
|
||||
text-decoration-thickness: var(--line-strong);
|
||||
color: var(--color-link-hover);
|
||||
text-decoration-color: currentcolor;
|
||||
}
|
||||
|
||||
/* Cabinet navigation: a mono capsule. The current section is inverted to
|
||||
* paper with graphite text (14.53:1), the "you are here" signal of the
|
||||
* design system; the fill change does not rely on hue. */
|
||||
.nav {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 2.75rem;
|
||||
padding: var(--space-2) var(--space-3);
|
||||
border-radius: var(--radius-s);
|
||||
min-height: 2.5rem;
|
||||
padding: var(--space-2) 0.875rem;
|
||||
border-radius: var(--radius-pill);
|
||||
color: var(--color-text-secondary);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-s);
|
||||
font-weight: var(--font-weight-medium);
|
||||
line-height: var(--line-height-snug);
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
transition:
|
||||
background-color var(--duration-fast) var(--easing-standard),
|
||||
color var(--duration-fast) var(--easing-standard);
|
||||
}
|
||||
|
||||
/* Active marker: a bar under the label plus bold text. */
|
||||
.nav::after {
|
||||
position: absolute;
|
||||
right: var(--space-3);
|
||||
bottom: var(--space-1);
|
||||
left: var(--space-3);
|
||||
height: var(--line-strong);
|
||||
border-radius: var(--radius-pill);
|
||||
content: "";
|
||||
background: currentcolor;
|
||||
transform: scaleX(0);
|
||||
transform-origin: left;
|
||||
transition: transform var(--duration-base) var(--easing-standard);
|
||||
.nav:hover {
|
||||
color: var(--color-text);
|
||||
background-color: var(--color-surface-tint-hover);
|
||||
}
|
||||
|
||||
.nav[aria-current="page"] {
|
||||
font-weight: var(--font-weight-bold);
|
||||
color: var(--color-on-inverse);
|
||||
background-color: var(--color-inverse);
|
||||
}
|
||||
|
||||
.nav[aria-current="page"]::after {
|
||||
transform: scaleX(1);
|
||||
}
|
||||
|
||||
/* Graphite on white 17.01:1; active violet on white 6.84:1. */
|
||||
.light {
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.light:hover,
|
||||
.light[aria-current="page"] {
|
||||
color: var(--color-accent);
|
||||
}
|
||||
|
||||
/* Light grey on graphite 14.53:1; white on graphite 17.01:1. */
|
||||
.dark {
|
||||
color: var(--palette-light);
|
||||
}
|
||||
|
||||
.dark:hover,
|
||||
.dark[aria-current="page"] {
|
||||
color: var(--palette-white);
|
||||
/* Rail layout: full-width items in a vertical list. */
|
||||
.rail {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -10,21 +10,23 @@ export function TextLink({ className, ...rest }: TextLinkProps) {
|
||||
return <Link {...rest} className={className ? `${styles.link} ${className}` : styles.link} />;
|
||||
}
|
||||
|
||||
export type NavItemTone = "light" | "dark";
|
||||
export type NavItemLayout = "row" | "rail";
|
||||
|
||||
type NavItemProps = Omit<NavLinkProps, "className" | "children"> & {
|
||||
tone?: NavItemTone;
|
||||
/** "rail" stretches the item to the width of a vertical list. */
|
||||
layout?: NavItemLayout;
|
||||
children: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Navigation link of a cabinet. NavLink sets aria-current="page" on the
|
||||
* active item; the active state is shown by a bar and a heavier weight, not
|
||||
* by color alone.
|
||||
* Navigation link of a shell. NavLink sets aria-current="page" on the active
|
||||
* item; the active item is an inverted capsule, a change of fill rather than
|
||||
* of hue alone.
|
||||
*/
|
||||
export function NavItem({ tone = "light", children, ...rest }: NavItemProps) {
|
||||
export function NavItem({ layout = "row", children, ...rest }: NavItemProps) {
|
||||
const className = layout === "rail" ? `${styles.nav} ${styles.rail}` : (styles.nav ?? "");
|
||||
return (
|
||||
<NavLink {...rest} className={`${styles.nav} ${styles[tone]}`}>
|
||||
<NavLink {...rest} className={className}>
|
||||
{children}
|
||||
</NavLink>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
.root {
|
||||
display: inline-flex;
|
||||
gap: var(--space-2);
|
||||
align-items: center;
|
||||
min-height: 2.5rem;
|
||||
padding: var(--space-2) var(--space-4);
|
||||
border: var(--line-thin) solid var(--color-border-hover);
|
||||
border-radius: var(--radius-pill);
|
||||
color: var(--color-text);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-s);
|
||||
font-weight: var(--font-weight-medium);
|
||||
cursor: pointer;
|
||||
background: var(--color-surface-elevated);
|
||||
}
|
||||
|
||||
.root:hover {
|
||||
border-color: var(--color-border-strong);
|
||||
}
|
||||
|
||||
.root[aria-expanded="true"] {
|
||||
color: var(--color-on-inverse);
|
||||
background: var(--color-inverse);
|
||||
}
|
||||
|
||||
/* Two bars that turn into a cross when the menu is open. */
|
||||
.icon {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 0.875rem;
|
||||
height: 0.625rem;
|
||||
}
|
||||
|
||||
.icon span {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 1.5px;
|
||||
border-radius: 1px;
|
||||
background: currentcolor;
|
||||
transition: transform var(--duration-base) var(--easing-emphasized);
|
||||
}
|
||||
|
||||
.icon span:first-child {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.icon span:last-child {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.icon[data-open] span:first-child {
|
||||
transform: translateY(0.28rem) rotate(45deg);
|
||||
}
|
||||
|
||||
.icon[data-open] span:last-child {
|
||||
transform: translateY(-0.28rem) rotate(-45deg);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import type { RefObject } from "react";
|
||||
import styles from "./menu-button.module.css";
|
||||
|
||||
type MenuButtonProps = {
|
||||
menuId: string;
|
||||
isOpen: boolean;
|
||||
onToggle: () => void;
|
||||
buttonRef: RefObject<HTMLButtonElement | null>;
|
||||
className?: string | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Button that shows or hides a collapsed navigation menu. The visible label
|
||||
* stays "Меню"; aria-expanded tells whether the menu is open.
|
||||
*/
|
||||
export function MenuButton({ menuId, isOpen, onToggle, buttonRef, className }: MenuButtonProps) {
|
||||
return (
|
||||
<button
|
||||
ref={buttonRef}
|
||||
type="button"
|
||||
className={className ? `${styles.root} ${className}` : styles.root}
|
||||
aria-expanded={isOpen}
|
||||
aria-controls={menuId}
|
||||
onClick={onToggle}
|
||||
>
|
||||
<span className={styles.icon} aria-hidden="true" data-open={isOpen || undefined}>
|
||||
<span />
|
||||
<span />
|
||||
</span>
|
||||
Меню
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
||||
import { useLocation } from "react-router-dom";
|
||||
|
||||
/**
|
||||
* State of a navigation menu that collapses behind a button on narrow
|
||||
* screens. The menu closes after a navigation and on Escape; Escape returns
|
||||
* focus to the button so keyboard users keep their place.
|
||||
*/
|
||||
export function useMenuToggle() {
|
||||
const menuId = useId();
|
||||
const buttonRef = useRef<HTMLButtonElement>(null);
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const { pathname } = useLocation();
|
||||
const [openedAt, setOpenedAt] = useState(pathname);
|
||||
|
||||
// A navigation closes the menu. Comparing during render avoids an effect
|
||||
// that would set state after the new page has painted.
|
||||
if (isOpen && openedAt !== pathname) {
|
||||
setIsOpen(false);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen) return undefined;
|
||||
function handleKeyDown(event: KeyboardEvent) {
|
||||
if (event.key !== "Escape") return;
|
||||
setIsOpen(false);
|
||||
buttonRef.current?.focus();
|
||||
}
|
||||
document.addEventListener("keydown", handleKeyDown);
|
||||
return () => document.removeEventListener("keydown", handleKeyDown);
|
||||
}, [isOpen]);
|
||||
|
||||
const toggle = useCallback(() => {
|
||||
setOpenedAt(pathname);
|
||||
setIsOpen((open) => !open);
|
||||
}, [pathname]);
|
||||
|
||||
return { menuId, buttonRef, isOpen, toggle };
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
.root {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.94em;
|
||||
font-variant-ligatures: none;
|
||||
font-variant-numeric: tabular-nums slashed-zero;
|
||||
font-weight: var(--font-weight-regular);
|
||||
letter-spacing: 0;
|
||||
@@ -8,5 +9,6 @@
|
||||
}
|
||||
|
||||
.strong {
|
||||
color: var(--color-text-strong);
|
||||
font-weight: var(--font-weight-bold);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
.root {
|
||||
display: grid;
|
||||
gap: var(--space-2);
|
||||
padding: var(--space-3) var(--space-4);
|
||||
border: var(--line-thin) solid var(--color-divider);
|
||||
border-left: var(--line-strong) solid var(--color-accent);
|
||||
border-radius: var(--radius-s);
|
||||
background: var(--color-canvas);
|
||||
}
|
||||
|
||||
.root[data-tone="success"] {
|
||||
border-left-color: var(--color-success);
|
||||
}
|
||||
|
||||
.root[data-tone="danger"] {
|
||||
border-color: var(--color-danger);
|
||||
}
|
||||
|
||||
.root[data-tone="neutral"] {
|
||||
border-left-color: var(--color-border-strong);
|
||||
}
|
||||
|
||||
.title {
|
||||
color: var(--color-text-strong);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.9375rem;
|
||||
font-weight: var(--font-weight-medium);
|
||||
line-height: var(--line-height-snug);
|
||||
}
|
||||
|
||||
.root[data-tone="danger"] .title {
|
||||
color: var(--color-danger);
|
||||
}
|
||||
|
||||
.body {
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--font-size-s);
|
||||
}
|
||||
|
||||
.action {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
padding-top: var(--space-1);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import type { ReactNode } from "react";
|
||||
import styles from "./notice.module.css";
|
||||
|
||||
export type NoticeTone = "info" | "success" | "danger" | "neutral";
|
||||
|
||||
type NoticeProps = {
|
||||
tone?: NoticeTone;
|
||||
title?: ReactNode;
|
||||
/** "status" or "alert" when the notice appears in response to an action. */
|
||||
role?: "status" | "alert" | undefined;
|
||||
action?: ReactNode;
|
||||
children?: ReactNode;
|
||||
};
|
||||
|
||||
/**
|
||||
* Inline message inside a page or a card: a nested surface with a state
|
||||
* stripe. The title and text carry the meaning; the stripe repeats it.
|
||||
*/
|
||||
export function Notice({ tone = "info", title, role, action, children }: NoticeProps) {
|
||||
return (
|
||||
<div className={styles.root} data-tone={tone} role={role}>
|
||||
{title ? <p className={styles.title}>{title}</p> : null}
|
||||
{children ? <div className={styles.body}>{children}</div> : null}
|
||||
{action ? <div className={styles.action}>{action}</div> : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { MemoryRouter } from "react-router-dom";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { Wordmark } from "./brand/wordmark";
|
||||
import { SegmentedControl } from "./segmented-control/segmented-control";
|
||||
import { Skeleton } from "./skeleton/skeleton";
|
||||
import { buildSteps } from "./stepper/build-steps";
|
||||
import { Stepper } from "./stepper/stepper";
|
||||
import { tabKeyTarget } from "./tabs/tab-keys";
|
||||
import { Tabs } from "./tabs/tabs";
|
||||
import { AttentionDot, Tag } from "./tag/tag";
|
||||
|
||||
function text(html: string): string {
|
||||
return html
|
||||
.replace(/<[^>]+>/g, " ")
|
||||
.replace(/\s+/g, " ")
|
||||
.trim();
|
||||
}
|
||||
|
||||
describe("Wordmark", () => {
|
||||
it("names the home link exactly Lincodex and keeps the cabinet name outside it", () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<MemoryRouter>
|
||||
<Wordmark to="/candidate" context="Кабинет кандидата" />
|
||||
</MemoryRouter>,
|
||||
);
|
||||
const link = html.match(/<a[^>]*>(.*?)<\/a>/);
|
||||
|
||||
expect(link?.[0]).toContain('href="/candidate"');
|
||||
expect(text(link?.[1] ?? "")).toBe("Lincodex");
|
||||
expect(link?.[1]).toMatch(/aria-hidden="true"/);
|
||||
expect(text(html)).toBe("Lincodex Кабинет кандидата");
|
||||
expect(html).not.toContain("<img");
|
||||
});
|
||||
});
|
||||
|
||||
describe("Stepper", () => {
|
||||
const steps = [
|
||||
{ id: "account", label: "Данные аккаунта" },
|
||||
{ id: "code", label: "Код из письма" },
|
||||
{ id: "profile", label: "Профиль" },
|
||||
];
|
||||
|
||||
it("marks steps before the current one complete and the rest upcoming", () => {
|
||||
expect(buildSteps(steps, 1).map((step) => step.status)).toEqual([
|
||||
"complete",
|
||||
"current",
|
||||
"upcoming",
|
||||
]);
|
||||
expect(buildSteps(steps, 3).every((step) => step.status === "complete")).toBe(true);
|
||||
});
|
||||
|
||||
it("states the position and each status in text, with aria-current on the current step", () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<Stepper label="Шаги регистрации" steps={buildSteps(steps, 1)} />,
|
||||
);
|
||||
|
||||
expect(html).toMatch(/<ol[^>]*aria-label="Шаги регистрации"/);
|
||||
expect(text(html)).toContain("Шаг 2 из 3");
|
||||
expect(text(html)).toContain("Данные аккаунта , выполнен");
|
||||
expect(text(html)).toContain("Код из письма , текущий шаг");
|
||||
expect(text(html)).toContain("Профиль , впереди");
|
||||
expect(html.match(/aria-current="step"/g)).toHaveLength(1);
|
||||
expect(html).toMatch(/<li[^>]*data-status="current"[^>]*aria-current="step"/);
|
||||
});
|
||||
|
||||
it("reports a finished flow", () => {
|
||||
const html = renderToStaticMarkup(<Stepper label="Шаги" steps={buildSteps(steps, 3)} />);
|
||||
|
||||
expect(text(html)).toContain("Все шаги выполнены: 3 из 3");
|
||||
expect(html).not.toContain('aria-current="step"');
|
||||
});
|
||||
});
|
||||
|
||||
describe("Tabs", () => {
|
||||
const items = [
|
||||
{ id: "basis", label: "Основание", content: <p>Первая панель</p> },
|
||||
{ id: "filters", label: "Фильтры", content: <p>Вторая панель</p> },
|
||||
];
|
||||
|
||||
it("links each tab to its panel and keeps only the selected tab in the tab order", () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<Tabs label="Параметры поиска" items={items} defaultValue="filters" />,
|
||||
);
|
||||
|
||||
expect(html).toMatch(/role="tablist" aria-label="Параметры поиска"/);
|
||||
const tabs = [...html.matchAll(/<button[^>]*role="tab"[^>]*>/g)].map((match) => match[0]);
|
||||
expect(tabs).toHaveLength(2);
|
||||
expect(tabs[0]).toContain('aria-selected="false"');
|
||||
expect(tabs[0]).toContain('tabindex="-1"');
|
||||
expect(tabs[1]).toContain('aria-selected="true"');
|
||||
expect(tabs[1]).toContain('tabindex="0"');
|
||||
// Inactive panels stay mounted so form state in them survives.
|
||||
expect(html).toMatch(/<div role="tabpanel"[^>]*hidden=""[^>]*><p>Первая панель<\/p>/);
|
||||
expect(html).toMatch(/<div role="tabpanel"(?![^>]*hidden)[^>]*><p>Вторая панель<\/p>/);
|
||||
const firstControls = tabs[0]?.match(/aria-controls="([^"]+)"/)?.[1];
|
||||
expect(html).toContain(`id="${firstControls}"`);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["ArrowRight", 2, 0],
|
||||
["ArrowLeft", 0, 2],
|
||||
["Home", 1, 0],
|
||||
["End", 0, 2],
|
||||
["ArrowRight", 0, 1],
|
||||
] as const)("moves %s from tab %i to tab %i of three", (key, from, to) => {
|
||||
expect(tabKeyTarget(key, from, 3)).toBe(to);
|
||||
});
|
||||
|
||||
it("ignores other keys and empty lists", () => {
|
||||
expect(tabKeyTarget("Enter", 0, 3)).toBeNull();
|
||||
expect(tabKeyTarget("ArrowRight", 0, 0)).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("SegmentedControl", () => {
|
||||
it("is a native radio group named by its legend", () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<SegmentedControl
|
||||
legend="Основание поиска"
|
||||
name="basis"
|
||||
options={[
|
||||
{ value: "need", label: "По потребности" },
|
||||
{ value: "all", label: "По всем профилям" },
|
||||
]}
|
||||
value="all"
|
||||
onChange={() => undefined}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(html).toMatch(/<fieldset[^>]*><legend[^>]*>Основание поиска<\/legend>/);
|
||||
expect(html.match(/type="radio"/g)).toHaveLength(2);
|
||||
const inputs = [...html.matchAll(/<input[^>]*>/g)].map((match) => match[0]);
|
||||
expect(inputs.find((input) => input.includes('value="all"'))).toContain('checked=""');
|
||||
expect(inputs.find((input) => input.includes('value="need"'))).not.toContain("checked");
|
||||
});
|
||||
});
|
||||
|
||||
describe("Tag, AttentionDot, Skeleton", () => {
|
||||
it("keeps tag text visible and the dot decorative", () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<Tag tone="success" dot>
|
||||
Грейд подтвержден
|
||||
</Tag>,
|
||||
);
|
||||
|
||||
expect(text(html)).toBe("Грейд подтвержден");
|
||||
expect(html).toMatch(/data-tone="success"/);
|
||||
expect(html).toMatch(/<span[^>]*aria-hidden="true"/);
|
||||
});
|
||||
|
||||
it("gives the red dot a text alternative", () => {
|
||||
expect(text(renderToStaticMarkup(<AttentionDot label="Новое" />))).toBe("Новое");
|
||||
});
|
||||
|
||||
it("hides skeleton shapes from assistive technology", () => {
|
||||
const html = renderToStaticMarkup(<Skeleton lines={2} shape="card" />);
|
||||
|
||||
expect(html).toMatch(/^<div[^>]*aria-hidden="true"/);
|
||||
expect(text(html)).toBe("");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,80 @@
|
||||
.root {
|
||||
min-width: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.legend {
|
||||
margin-bottom: var(--space-2);
|
||||
padding: 0;
|
||||
font-weight: var(--font-weight-bold);
|
||||
}
|
||||
|
||||
.legend-hidden {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
clip-path: inset(50%);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.track {
|
||||
display: inline-flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-1);
|
||||
max-width: 100%;
|
||||
padding: var(--space-1);
|
||||
border: var(--line-thin) solid var(--color-border-strong);
|
||||
border-radius: 1.5rem;
|
||||
background: var(--color-surface);
|
||||
}
|
||||
|
||||
.segment {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
/* The radio stays in the accessibility tree and takes focus; the label
|
||||
* draws the capsule. */
|
||||
.input {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 2.5rem;
|
||||
padding: var(--space-2) var(--space-4);
|
||||
border-radius: var(--radius-pill);
|
||||
color: var(--color-text-secondary);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-s);
|
||||
font-weight: var(--font-weight-medium);
|
||||
white-space: nowrap;
|
||||
transition:
|
||||
background-color var(--duration-fast) var(--easing-standard),
|
||||
color var(--duration-fast) var(--easing-standard);
|
||||
}
|
||||
|
||||
.segment:hover .label {
|
||||
color: var(--color-text);
|
||||
background: var(--color-surface-tint-hover);
|
||||
}
|
||||
|
||||
.input:checked + .label {
|
||||
color: var(--color-on-inverse);
|
||||
background: var(--color-inverse);
|
||||
}
|
||||
|
||||
.input:focus-visible + .label {
|
||||
outline: var(--focus-ring-width) solid var(--color-focus-ring);
|
||||
outline-offset: var(--focus-ring-offset);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import styles from "./segmented-control.module.css";
|
||||
|
||||
export type SegmentedOption<TValue extends string> = {
|
||||
value: TValue;
|
||||
label: string;
|
||||
};
|
||||
|
||||
type SegmentedControlProps<TValue extends string> = {
|
||||
/** Visible group label; the fieldset legend. */
|
||||
legend: string;
|
||||
/** Hides the legend visually; it stays the accessible name. */
|
||||
hideLegend?: boolean;
|
||||
name: string;
|
||||
options: readonly SegmentedOption<TValue>[];
|
||||
/** Selected value; an empty string selects nothing. */
|
||||
value: TValue | "";
|
||||
onChange: (value: TValue) => void;
|
||||
};
|
||||
|
||||
/**
|
||||
* One choice out of a few, shown as a capsule track. It is a native radio
|
||||
* group, so arrow keys, form semantics, and screen reader announcements come
|
||||
* from the browser. The selected segment is inverted to paper.
|
||||
*/
|
||||
export function SegmentedControl<TValue extends string>({
|
||||
legend,
|
||||
hideLegend = false,
|
||||
name,
|
||||
options,
|
||||
value,
|
||||
onChange,
|
||||
}: SegmentedControlProps<TValue>) {
|
||||
return (
|
||||
<fieldset className={styles.root}>
|
||||
<legend className={hideLegend ? styles["legend-hidden"] : styles.legend}>{legend}</legend>
|
||||
<div className={styles.track}>
|
||||
{options.map((option) => (
|
||||
<label key={option.value} className={styles.segment}>
|
||||
<input
|
||||
className={styles.input}
|
||||
type="radio"
|
||||
name={name}
|
||||
value={option.value}
|
||||
checked={option.value === value}
|
||||
onChange={() => onChange(option.value)}
|
||||
/>
|
||||
<span className={styles.label}>{option.label}</span>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
</fieldset>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
.root {
|
||||
display: grid;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.root[data-shape="card"] {
|
||||
padding: var(--space-5);
|
||||
border: var(--line-thin) solid var(--color-divider);
|
||||
border-radius: var(--radius-m);
|
||||
background: var(--color-surface);
|
||||
}
|
||||
|
||||
.title,
|
||||
.line {
|
||||
display: block;
|
||||
height: 0.75rem;
|
||||
border-radius: var(--radius-pill);
|
||||
background:
|
||||
linear-gradient(90deg, transparent 0%, var(--color-surface-tint-hover) 50%, transparent 100%) 0
|
||||
0 / 200% 100% no-repeat,
|
||||
var(--color-surface-elevated);
|
||||
animation: shimmer 1.6s linear infinite;
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 40%;
|
||||
height: 1.125rem;
|
||||
margin-bottom: var(--space-2);
|
||||
}
|
||||
|
||||
.line[data-last] {
|
||||
width: 65%;
|
||||
}
|
||||
|
||||
@keyframes shimmer {
|
||||
from {
|
||||
background-position:
|
||||
150% 0,
|
||||
0 0;
|
||||
}
|
||||
|
||||
to {
|
||||
background-position:
|
||||
-50% 0,
|
||||
0 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.title,
|
||||
.line {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import styles from "./skeleton.module.css";
|
||||
|
||||
type SkeletonProps = {
|
||||
/** Number of text lines; the last one is shorter. */
|
||||
lines?: number;
|
||||
/** "card" adds a title bar and a container around the lines. */
|
||||
shape?: "lines" | "card";
|
||||
};
|
||||
|
||||
/**
|
||||
* Placeholder shapes while content loads. It is decoration only: pair it with
|
||||
* LoadingState or another status message that announces the loading.
|
||||
*/
|
||||
export function Skeleton({ lines = 3, shape = "lines" }: SkeletonProps) {
|
||||
return (
|
||||
<div className={styles.root} data-shape={shape} aria-hidden="true">
|
||||
{shape === "card" ? <span className={styles.title} /> : null}
|
||||
{Array.from({ length: lines }, (_, index) => (
|
||||
<span key={index} className={styles.line} data-last={index === lines - 1 || undefined} />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -3,20 +3,21 @@
|
||||
z-index: 100;
|
||||
top: var(--space-2);
|
||||
left: var(--space-2);
|
||||
padding: var(--space-3) var(--space-4);
|
||||
border-radius: var(--radius-s);
|
||||
color: var(--palette-white);
|
||||
font-weight: var(--font-weight-bold);
|
||||
padding: var(--space-3) var(--space-5);
|
||||
border-radius: var(--radius-pill);
|
||||
color: var(--color-on-action);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-s);
|
||||
font-weight: var(--font-weight-medium);
|
||||
text-decoration: none;
|
||||
background: var(--palette-violet);
|
||||
background: var(--color-action);
|
||||
transform: translateY(calc(-100% - var(--space-4)));
|
||||
transition: transform var(--duration-fast) var(--easing-standard);
|
||||
}
|
||||
|
||||
/* A white inner and graphite outer ring stay visible on light and dark headers. */
|
||||
/* White on blue 6.84:1; the violet ring sits outside on the graphite canvas. */
|
||||
.root:focus {
|
||||
outline: var(--focus-ring-width) solid var(--palette-white);
|
||||
outline-offset: 0;
|
||||
box-shadow: 0 0 0 calc(var(--focus-ring-width) * 2) var(--palette-graphite);
|
||||
outline: var(--focus-ring-width) solid var(--color-focus-ring);
|
||||
outline-offset: var(--focus-ring-offset);
|
||||
transform: translateY(0);
|
||||
}
|
||||
@@ -1,20 +1,58 @@
|
||||
.root {
|
||||
position: relative;
|
||||
display: flex;
|
||||
gap: var(--space-4);
|
||||
align-items: flex-start;
|
||||
padding: var(--space-5);
|
||||
border: var(--line-thin) solid var(--color-divider);
|
||||
border-radius: var(--radius-m);
|
||||
overflow: hidden;
|
||||
background: var(--color-surface);
|
||||
}
|
||||
|
||||
/* Error blocks add a red edge; the triangle and the title carry meaning too. */
|
||||
/* Error blocks get a red boundary and tint; the triangle and the title carry
|
||||
* the meaning too. Signal red on the tinted surface stays above 4.5:1. */
|
||||
.root[data-kind="error"] {
|
||||
border-color: var(--color-danger);
|
||||
box-shadow: inset var(--space-1) 0 0 var(--color-danger);
|
||||
background:
|
||||
linear-gradient(var(--color-danger-wash), var(--color-danger-wash)), var(--color-surface);
|
||||
}
|
||||
|
||||
/* The empty box is a size container for its decor; the explicit width keeps
|
||||
* it from collapsing in a shrink-to-fit parent. */
|
||||
.root[data-kind="empty"] {
|
||||
width: 100%;
|
||||
min-height: 8.5rem;
|
||||
container-type: inline-size;
|
||||
border-style: dashed;
|
||||
border-color: var(--color-border-hover);
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Circuit-trace decor of the empty state. It takes the right end of a wide
|
||||
* box only, so it never runs under the text. */
|
||||
.decor {
|
||||
position: absolute;
|
||||
right: var(--space-4);
|
||||
bottom: 0;
|
||||
display: none;
|
||||
width: 13rem;
|
||||
height: 100%;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
@container (width >= 40rem) {
|
||||
.decor {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.root[data-kind="empty"] .content {
|
||||
max-width: calc(100% - 15rem);
|
||||
}
|
||||
}
|
||||
|
||||
.mark {
|
||||
position: relative;
|
||||
flex: none;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
@@ -38,12 +76,20 @@
|
||||
.outline {
|
||||
fill: none;
|
||||
stroke: var(--color-text);
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
.root[data-kind="empty"] .outline {
|
||||
stroke-dasharray: 4 4;
|
||||
.node {
|
||||
fill: none;
|
||||
stroke: var(--color-accent);
|
||||
stroke-dasharray: 3 3;
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
.node-start {
|
||||
fill: var(--color-text);
|
||||
}
|
||||
|
||||
.danger {
|
||||
@@ -53,22 +99,26 @@
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
/* Graphite glyph on signal red 5.61:1. */
|
||||
.danger-glyph {
|
||||
fill: none;
|
||||
stroke: var(--palette-white);
|
||||
stroke: var(--color-on-inverse);
|
||||
stroke-linecap: round;
|
||||
stroke-width: 3;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: relative;
|
||||
display: grid;
|
||||
gap: var(--space-2);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: var(--font-size-l);
|
||||
font-weight: var(--font-weight-bold);
|
||||
color: var(--color-text-strong);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 1.0625rem;
|
||||
font-weight: var(--font-weight-medium);
|
||||
line-height: var(--line-height-snug);
|
||||
}
|
||||
|
||||
@@ -86,18 +136,20 @@
|
||||
|
||||
.details summary {
|
||||
width: fit-content;
|
||||
border-radius: var(--radius-s);
|
||||
border-radius: var(--radius-xs);
|
||||
color: var(--color-link);
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 0.2em;
|
||||
cursor: pointer;
|
||||
text-underline-offset: 0.22em;
|
||||
}
|
||||
|
||||
.facts {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
|
||||
gap: var(--space-1) var(--space-4);
|
||||
padding-top: var(--space-3);
|
||||
margin-top: var(--space-3);
|
||||
padding: var(--space-3) var(--space-4);
|
||||
border-radius: var(--radius-s);
|
||||
background: var(--color-canvas);
|
||||
}
|
||||
|
||||
.facts dt {
|
||||
@@ -110,16 +162,38 @@
|
||||
|
||||
.saving {
|
||||
min-height: 1.6em;
|
||||
color: var(--color-text-secondary);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-s);
|
||||
}
|
||||
|
||||
.saving[data-state="saved"] {
|
||||
color: var(--color-success);
|
||||
}
|
||||
|
||||
.saving[data-state="saved"]::before,
|
||||
.saving[data-state="saving"]::before {
|
||||
display: inline-block;
|
||||
width: 0.5rem;
|
||||
height: 0.5rem;
|
||||
margin-right: var(--space-2);
|
||||
border-radius: 50%;
|
||||
content: "";
|
||||
background: currentcolor;
|
||||
vertical-align: 0.1em;
|
||||
}
|
||||
|
||||
.saving[data-state="failed"] {
|
||||
color: var(--color-danger);
|
||||
}
|
||||
|
||||
.saving[data-state="failed"]::before {
|
||||
display: inline-block;
|
||||
width: 0.6em;
|
||||
height: 0.6em;
|
||||
width: 0.55em;
|
||||
height: 0.55em;
|
||||
margin-right: var(--space-2);
|
||||
content: "";
|
||||
background: var(--color-danger);
|
||||
background: currentcolor;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { Button } from "../button/button";
|
||||
import { CircuitTrace } from "../decor/circuit-trace";
|
||||
import { Mono } from "../mono/mono";
|
||||
import { describeError, isAccessDenied } from "./describe-error";
|
||||
import styles from "./status-view.module.css";
|
||||
@@ -24,7 +25,14 @@ function StatusMark({ kind }: { kind: StatusKind }) {
|
||||
<path className={styles.spinner} d="M20 5a15 15 0 0 1 15 15" />
|
||||
</>
|
||||
) : null}
|
||||
{kind === "empty" ? <circle className={styles.outline} cx="20" cy="20" r="15" /> : null}
|
||||
{kind === "empty" ? (
|
||||
<>
|
||||
{/* A trace that ends at an open node: nothing is connected yet. */}
|
||||
<path className={styles.outline} d="M4 30h10a6 6 0 0 0 6-6v-6" />
|
||||
<circle className={styles.node} cx="20" cy="13" r="5" />
|
||||
<circle className={styles["node-start"]} cx="4" cy="30" r="2.5" />
|
||||
</>
|
||||
) : null}
|
||||
{kind === "error" ? (
|
||||
<>
|
||||
<path className={styles.danger} d="M20 4 37 34H3Z" />
|
||||
@@ -33,7 +41,7 @@ function StatusMark({ kind }: { kind: StatusKind }) {
|
||||
) : null}
|
||||
{kind === "forbidden" ? (
|
||||
<>
|
||||
<rect className={styles.outline} x="8" y="17" width="24" height="18" rx="3" />
|
||||
<rect className={styles.outline} x="8" y="17" width="24" height="18" rx="6" />
|
||||
<path className={styles.outline} d="M13 17v-4a7 7 0 0 1 14 0v4" />
|
||||
</>
|
||||
) : null}
|
||||
@@ -54,6 +62,7 @@ export function StatusView({ kind, title, description, action, children }: Statu
|
||||
role={kind === "error" ? "alert" : "status"}
|
||||
aria-busy={kind === "loading" || undefined}
|
||||
>
|
||||
{kind === "empty" ? <CircuitTrace className={styles.decor} /> : null}
|
||||
<StatusMark kind={kind} />
|
||||
<div className={styles.content}>
|
||||
<p className={styles.title}>{title}</p>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
export type StepStatus = "complete" | "current" | "upcoming";
|
||||
|
||||
export type StepperStep = {
|
||||
id: string;
|
||||
label: string;
|
||||
status: StepStatus;
|
||||
};
|
||||
|
||||
/**
|
||||
* Builds the statuses of a linear flow: steps before the current one are
|
||||
* complete, the rest are upcoming. A current index past the end marks every
|
||||
* step complete.
|
||||
*/
|
||||
export function buildSteps(
|
||||
steps: readonly { id: string; label: string }[],
|
||||
currentIndex: number,
|
||||
): StepperStep[] {
|
||||
return steps.map((step, index) => ({
|
||||
...step,
|
||||
status: index < currentIndex ? "complete" : index === currentIndex ? "current" : "upcoming",
|
||||
}));
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
.root {
|
||||
display: grid;
|
||||
gap: var(--space-3);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.summary {
|
||||
color: var(--color-text-secondary);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-xs);
|
||||
font-weight: var(--font-weight-medium);
|
||||
letter-spacing: var(--letter-spacing-label);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
/* Steps sit in a row joined by a hairline trace; a completed segment lights
|
||||
* up in the readable accent. On a phone the labels wrap under the markers. */
|
||||
.list {
|
||||
display: grid;
|
||||
grid-auto-columns: minmax(0, 1fr);
|
||||
grid-auto-flow: column;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.step {
|
||||
position: relative;
|
||||
display: grid;
|
||||
gap: var(--space-2);
|
||||
align-content: start;
|
||||
justify-items: start;
|
||||
min-width: 0;
|
||||
padding-right: var(--space-2);
|
||||
}
|
||||
|
||||
/* Trace from this marker to the next one. */
|
||||
.step:not(:last-child)::after {
|
||||
position: absolute;
|
||||
top: 0.875rem;
|
||||
right: 0;
|
||||
left: 2rem;
|
||||
height: var(--line-thin);
|
||||
content: "";
|
||||
background: var(--color-divider);
|
||||
}
|
||||
|
||||
.step[data-status="complete"]:not(:last-child)::after {
|
||||
background: var(--color-accent);
|
||||
}
|
||||
|
||||
.marker {
|
||||
display: inline-grid;
|
||||
place-items: center;
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
border: var(--line-thin) solid var(--color-border-strong);
|
||||
border-radius: 50%;
|
||||
color: var(--color-text-secondary);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-xs);
|
||||
font-weight: var(--font-weight-medium);
|
||||
background: var(--color-canvas);
|
||||
}
|
||||
|
||||
.step[data-status="complete"] .marker {
|
||||
border-color: var(--color-accent);
|
||||
color: var(--color-on-accent);
|
||||
background: var(--color-accent);
|
||||
}
|
||||
|
||||
/* The current step is inverted: paper with graphite, "you are here". */
|
||||
.step[data-status="current"] .marker {
|
||||
border-color: var(--color-inverse);
|
||||
color: var(--color-on-inverse);
|
||||
background: var(--color-inverse);
|
||||
}
|
||||
|
||||
.label {
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--font-size-s);
|
||||
line-height: var(--line-height-snug);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.step[data-status="current"] .label {
|
||||
color: var(--color-text-strong);
|
||||
font-weight: var(--font-weight-bold);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import { VisuallyHidden } from "../visually-hidden/visually-hidden";
|
||||
import styles from "./stepper.module.css";
|
||||
|
||||
import type { StepStatus, StepperStep } from "./build-steps";
|
||||
|
||||
const statusText: Readonly<Record<StepStatus, string>> = {
|
||||
complete: "выполнен",
|
||||
current: "текущий шаг",
|
||||
upcoming: "впереди",
|
||||
};
|
||||
|
||||
type StepperProps = {
|
||||
/** Accessible name of the step list, for example "Шаги регистрации". */
|
||||
label: string;
|
||||
steps: readonly StepperStep[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Progress through a multi-step flow: a visible "step N of M" line and an
|
||||
* ordered list joined by a trace. The current step has aria-current="step";
|
||||
* each step states its status in text, so the shape and color only repeat it.
|
||||
*/
|
||||
export function Stepper({ label, steps }: StepperProps) {
|
||||
const currentIndex = steps.findIndex((step) => step.status === "current");
|
||||
const completed = steps.filter((step) => step.status === "complete").length;
|
||||
const position = currentIndex === -1 ? completed : currentIndex + 1;
|
||||
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
<p className={styles.summary}>
|
||||
{currentIndex === -1 && completed === steps.length
|
||||
? `Все шаги выполнены: ${steps.length} из ${steps.length}`
|
||||
: `Шаг ${position} из ${steps.length}`}
|
||||
</p>
|
||||
<ol className={styles.list} aria-label={label}>
|
||||
{steps.map((step, index) => (
|
||||
<li
|
||||
key={step.id}
|
||||
className={styles.step}
|
||||
data-status={step.status}
|
||||
aria-current={step.status === "current" ? "step" : undefined}
|
||||
>
|
||||
<span className={styles.marker} aria-hidden="true">
|
||||
{step.status === "complete" ? "✓" : index + 1}
|
||||
</span>
|
||||
<span className={styles.label}>
|
||||
{step.label}
|
||||
<VisuallyHidden>{`, ${statusText[step.status]}`}</VisuallyHidden>
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Index of the tab that a key moves focus to in a horizontal tab list, or
|
||||
* null when the key is not a tab-list key. Arrows wrap around; Home and End
|
||||
* jump to the ends (WAI-ARIA Authoring Practices, tabs pattern).
|
||||
*/
|
||||
export function tabKeyTarget(key: string, index: number, count: number): number | null {
|
||||
if (count <= 0) return null;
|
||||
switch (key) {
|
||||
case "ArrowRight":
|
||||
return (index + 1) % count;
|
||||
case "ArrowLeft":
|
||||
return (index - 1 + count) % count;
|
||||
case "Home":
|
||||
return 0;
|
||||
case "End":
|
||||
return count - 1;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
.root {
|
||||
display: grid;
|
||||
gap: var(--space-4);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/* A capsule track of pill tabs; it scrolls sideways on a phone. */
|
||||
.list {
|
||||
display: flex;
|
||||
gap: var(--space-1);
|
||||
width: fit-content;
|
||||
max-width: 100%;
|
||||
padding: var(--space-1);
|
||||
border: var(--line-thin) solid var(--color-divider);
|
||||
border-radius: var(--radius-pill);
|
||||
overflow-x: auto;
|
||||
background: var(--color-surface);
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
.tab {
|
||||
flex: none;
|
||||
min-height: 2.5rem;
|
||||
padding: var(--space-2) var(--space-4);
|
||||
border: 0;
|
||||
border-radius: var(--radius-pill);
|
||||
color: var(--color-text-secondary);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-s);
|
||||
font-weight: var(--font-weight-medium);
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
transition:
|
||||
background-color var(--duration-fast) var(--easing-standard),
|
||||
color var(--duration-fast) var(--easing-standard);
|
||||
}
|
||||
|
||||
.tab:hover {
|
||||
color: var(--color-text);
|
||||
background: var(--color-surface-tint-hover);
|
||||
}
|
||||
|
||||
/* Selected tab: inverted paper capsule, graphite text 14.53:1. */
|
||||
.tab[aria-selected="true"] {
|
||||
color: var(--color-on-inverse);
|
||||
background: var(--color-inverse);
|
||||
}
|
||||
|
||||
.tab:focus-visible {
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
.panel:focus-visible {
|
||||
border-radius: var(--radius-s);
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import { useId, useRef, useState, type KeyboardEvent, type ReactNode } from "react";
|
||||
import { tabKeyTarget } from "./tab-keys";
|
||||
import styles from "./tabs.module.css";
|
||||
|
||||
export type TabItem = {
|
||||
id: string;
|
||||
label: string;
|
||||
content: ReactNode;
|
||||
};
|
||||
|
||||
type TabsProps = {
|
||||
/** Accessible name of the tab list. */
|
||||
label: string;
|
||||
items: readonly TabItem[];
|
||||
/** Controlled selection; omit to let the component keep it. */
|
||||
value?: string | undefined;
|
||||
defaultValue?: string | undefined;
|
||||
onChange?: ((id: string) => void) | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Tabs (WAI-ARIA tabs pattern with automatic activation). Only the selected
|
||||
* tab is in the tab order; arrow keys, Home, and End move between tabs.
|
||||
* Inactive panels stay mounted with the hidden attribute, so form state in a
|
||||
* panel survives switching tabs.
|
||||
*/
|
||||
export function Tabs({ label, items, value, defaultValue, onChange }: TabsProps) {
|
||||
const baseId = useId();
|
||||
const [ownValue, setOwnValue] = useState(defaultValue ?? items[0]?.id);
|
||||
const selected = value ?? ownValue;
|
||||
const tabRefs = useRef<(HTMLButtonElement | null)[]>([]);
|
||||
|
||||
function select(id: string) {
|
||||
if (value === undefined) setOwnValue(id);
|
||||
onChange?.(id);
|
||||
}
|
||||
|
||||
function handleKeyDown(event: KeyboardEvent<HTMLButtonElement>, index: number) {
|
||||
const target = tabKeyTarget(event.key, index, items.length);
|
||||
const item = target === null ? undefined : items[target];
|
||||
if (target === null || !item) return;
|
||||
event.preventDefault();
|
||||
select(item.id);
|
||||
tabRefs.current[target]?.focus();
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
<div className={styles.list} role="tablist" aria-label={label}>
|
||||
{items.map((item, index) => {
|
||||
const isSelected = item.id === selected;
|
||||
return (
|
||||
<button
|
||||
key={item.id}
|
||||
ref={(element) => {
|
||||
tabRefs.current[index] = element;
|
||||
}}
|
||||
type="button"
|
||||
role="tab"
|
||||
id={`${baseId}-tab-${item.id}`}
|
||||
className={styles.tab}
|
||||
aria-selected={isSelected}
|
||||
aria-controls={`${baseId}-panel-${item.id}`}
|
||||
tabIndex={isSelected ? 0 : -1}
|
||||
onClick={() => select(item.id)}
|
||||
onKeyDown={(event) => handleKeyDown(event, index)}
|
||||
>
|
||||
{item.label}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
{items.map((item) => (
|
||||
<div
|
||||
key={item.id}
|
||||
role="tabpanel"
|
||||
id={`${baseId}-panel-${item.id}`}
|
||||
className={styles.panel}
|
||||
aria-labelledby={`${baseId}-tab-${item.id}`}
|
||||
hidden={item.id !== selected}
|
||||
tabIndex={0}
|
||||
>
|
||||
{item.content}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/* Contrast after the tint is laid over the surface #202129 is listed in
|
||||
* frontend/README.en.md; every tone stays above 4.5:1. */
|
||||
.root {
|
||||
display: inline-flex;
|
||||
gap: 0.375rem;
|
||||
align-items: center;
|
||||
min-height: 1.5rem;
|
||||
padding: 0.125rem 0.625rem;
|
||||
border-radius: var(--radius-pill);
|
||||
color: var(--color-text-secondary);
|
||||
font-size: 0.75rem;
|
||||
font-weight: var(--font-weight-medium);
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
background: var(--color-surface-tint);
|
||||
}
|
||||
|
||||
.root[data-tone="grade"],
|
||||
.root[data-tone="stack"] {
|
||||
color: var(--color-text);
|
||||
font-family: var(--font-mono);
|
||||
font-variant-ligatures: none;
|
||||
}
|
||||
|
||||
.root[data-tone="grade"] {
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
background: var(--color-surface-elevated);
|
||||
}
|
||||
|
||||
.root[data-tone="stack"] {
|
||||
background: var(--color-surface-tint-hover);
|
||||
}
|
||||
|
||||
.root[data-tone="accent"] {
|
||||
color: var(--color-accent);
|
||||
background: var(--color-accent-tint);
|
||||
}
|
||||
|
||||
.root[data-tone="success"] {
|
||||
color: var(--color-success);
|
||||
background: var(--color-success-tint);
|
||||
}
|
||||
|
||||
.root[data-tone="danger"] {
|
||||
color: var(--color-danger);
|
||||
background: var(--color-danger-tint);
|
||||
}
|
||||
|
||||
.dot {
|
||||
flex: none;
|
||||
width: 0.375rem;
|
||||
height: 0.375rem;
|
||||
border-radius: 50%;
|
||||
background: currentcolor;
|
||||
}
|
||||
|
||||
.attention {
|
||||
display: inline-block;
|
||||
flex: none;
|
||||
width: 0.5rem;
|
||||
height: 0.5rem;
|
||||
border-radius: 50%;
|
||||
background: var(--color-attention);
|
||||
vertical-align: 0.1em;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { VisuallyHidden } from "../visually-hidden/visually-hidden";
|
||||
import styles from "./tag.module.css";
|
||||
|
||||
/**
|
||||
* neutral - meta label; grade - category such as BACKEND · MIDDLE (mono caps);
|
||||
* stack - technology; accent - a match or a highlighted fact; success and
|
||||
* danger - outcomes. The text always states the meaning; the tone repeats it.
|
||||
*/
|
||||
export type TagTone = "neutral" | "grade" | "stack" | "accent" | "success" | "danger";
|
||||
|
||||
type TagProps = {
|
||||
tone?: TagTone;
|
||||
/** A 6px dot before the text in the tag's own color. */
|
||||
dot?: boolean;
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
/** Capsule label for grades, stack, statuses, and meta. */
|
||||
export function Tag({ tone = "neutral", dot = false, children }: TagProps) {
|
||||
return (
|
||||
<span className={styles.root} data-tone={tone}>
|
||||
{dot ? <span className={styles.dot} aria-hidden="true" /> : null}
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
type AttentionDotProps = {
|
||||
/** Text for assistive technology, for example "Новое". */
|
||||
label: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* The red 8px dot of the design system: "new", "live", "unread". Red never
|
||||
* carries text, so the meaning is given to assistive technology as text and
|
||||
* should also be visible nearby in words.
|
||||
*/
|
||||
export function AttentionDot({ label }: AttentionDotProps) {
|
||||
return (
|
||||
<span className={styles.attention}>
|
||||
<VisuallyHidden>{label}</VisuallyHidden>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
@@ -1,20 +1,32 @@
|
||||
/*
|
||||
* JetBrains Mono 2.304, SIL Open Font License 1.1.
|
||||
* The license and authors list are next to the font files in ./fonts/.
|
||||
* Only the regular and bold weights are shipped; no external font CDN.
|
||||
* Self-hosted fonts, SIL Open Font License 1.1. Licenses, authors, sources,
|
||||
* and subset ranges are listed in ./fonts/SOURCES.txt. No external font CDN:
|
||||
* the CSP allows fonts from the same origin only.
|
||||
*
|
||||
* Inter - paragraphs, meta, form text (variable weight 400-700).
|
||||
* JetBrains - headings, labels, buttons, numbers, grades, stack, codes.
|
||||
* Unbounded - the Lincodex wordmark only (Latin subset).
|
||||
*/
|
||||
@font-face {
|
||||
font-family: "JetBrains Mono";
|
||||
font-family: Inter;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-weight: 400 700;
|
||||
font-display: swap;
|
||||
src: url("./fonts/JetBrainsMono-Regular.woff2") format("woff2");
|
||||
src: url("./fonts/Inter-Variable.woff2") format("woff2");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "JetBrains Mono";
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-weight: 400 700;
|
||||
font-display: swap;
|
||||
src: url("./fonts/JetBrainsMono-Bold.woff2") format("woff2");
|
||||
src: url("./fonts/JetBrainsMono-Variable.woff2") format("woff2");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: Unbounded;
|
||||
font-style: normal;
|
||||
font-weight: 500 800;
|
||||
font-display: block;
|
||||
src: url("./fonts/Unbounded-Variable.woff2") format("woff2");
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,31 @@
|
||||
Font files served by the frontend. All three families are licensed under the
|
||||
SIL Open Font License 1.1 (see the *-OFL.txt file of each family). None of the
|
||||
licenses declares a Reserved Font Name, so the subset files keep the family
|
||||
names. The files are subsets made with fontTools (varLib.instancer and
|
||||
pyftsubset) and are served from the same origin (CSP font-src 'self').
|
||||
|
||||
JetBrainsMono-Variable.woff2
|
||||
Family: JetBrains Mono 2.304, Philipp Nurullin and Konstantin Bulenkov (JetBrains).
|
||||
Source: JetBrainsMono-2.304.zip, fonts/variable/JetBrainsMono[wght].ttf
|
||||
(https://github.com/JetBrains/JetBrainsMono, release v2.304).
|
||||
Instance: wght 400-700.
|
||||
License and authors: JetBrainsMono-OFL.txt, JetBrainsMono-AUTHORS.txt.
|
||||
|
||||
Inter-Variable.woff2
|
||||
Family: Inter 4.001, Rasmus Andersson and The Inter Project Authors.
|
||||
Source: https://github.com/google/fonts, ofl/inter/Inter[opsz,wght].ttf
|
||||
(commit 0b58fb370093f9a9f4ff785d94405710b79de67c; upstream https://github.com/rsms/inter).
|
||||
Instance: opsz pinned to 14, wght 400-700.
|
||||
License and authors: Inter-OFL.txt (the copyright line names the authors).
|
||||
|
||||
Unbounded-Variable.woff2
|
||||
Family: Unbounded 1.701, NaN (Luke Prowse, Jean-Baptiste Morizot, Fatima Lazaro, Florian Runge).
|
||||
Source: https://github.com/google/fonts, ofl/unbounded/Unbounded[wght].ttf
|
||||
(commit 8b0a1d0f5983c89bc2b93f1b5fb55f9e252744b5; upstream https://github.com/googlefonts/unbounded).
|
||||
Instance: wght 500-800, printable ASCII only. Used only for the Lincodex wordmark.
|
||||
License and authors: Unbounded-OFL.txt (the copyright line names the authors).
|
||||
|
||||
Character set of JetBrains Mono and Inter: Basic Latin, Latin-1, Greek,
|
||||
basic Cyrillic with Ukrainian and Kazakh additions, general punctuation, the
|
||||
ruble and numero signs, arrows, common math operators, box drawing, block
|
||||
elements, geometric shapes, check marks, and keyboard symbols.
|
||||
@@ -0,0 +1,93 @@
|
||||
Copyright 2022 The Unbounded Project Authors (https://github.com/googlefonts/unbounded)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Binary file not shown.
@@ -1,68 +1,118 @@
|
||||
/*
|
||||
* Design tokens of the Lincodex interface.
|
||||
* Design tokens of the Lincodex interface: the dark graphite system from
|
||||
* docs/other/design/DESIGN.md. Dark is the default and the only theme.
|
||||
*
|
||||
* Palette values come from the product requirements (section 5). Only the
|
||||
* light theme exists: dark surfaces are local regions (for example the
|
||||
* employer header) that override the text, link, and focus tokens with
|
||||
* checked pairs. A dark theme must define and check its own pairs instead of
|
||||
* inheriting the light accents. See frontend/README.en.md for the contrast
|
||||
* table of every text and background pair in use.
|
||||
* Contrast rules (every pair is listed in frontend/README.en.md):
|
||||
* - Text tokens reach 4.5:1 on canvas and surface. --color-text-muted and
|
||||
* --color-danger are for canvas and surface only (they drop below 4.5:1 on
|
||||
* the elevated surface).
|
||||
* - The action blue #402fff never carries text on graphite (2.49:1). Text,
|
||||
* rings, strokes, and selected markers use --color-accent (#9a92ff).
|
||||
* - Signal red --color-attention is for 6-8px dots only.
|
||||
* - --color-divider is a decorative hairline. A control whose boundary
|
||||
* identifies it uses --color-border-strong (3:1 on canvas and surface).
|
||||
*
|
||||
* Breakpoints cannot be custom properties inside media queries, so they are
|
||||
* fixed values used directly by components:
|
||||
* 360px - smallest supported width (body min-width: 20rem)
|
||||
* 700px - phone layout ends: (width >= 43.75rem)
|
||||
* 768px - tablet: (width >= 48rem)
|
||||
* 1024px - desktop navigation: (width >= 64rem)
|
||||
* 1280px - wide desktop, verified layout width
|
||||
*/
|
||||
:root {
|
||||
/* Brand palette. Use the semantic tokens below in components. */
|
||||
--palette-violet: #402fff;
|
||||
--palette-red: #ec1d35;
|
||||
color-scheme: dark;
|
||||
|
||||
/* Palette. Components use the semantic tokens below. */
|
||||
--palette-graphite: #1b1c21;
|
||||
--palette-graphite-soft: #2d2e37;
|
||||
--palette-light: #ededed;
|
||||
--palette-grey: #c8c9ca;
|
||||
--palette-graphite-raised: #202129;
|
||||
--palette-graphite-elevated: #2d2e37;
|
||||
--palette-graphite-line: #414246;
|
||||
--palette-graphite-edge: #73757f;
|
||||
--palette-paper: #ededed;
|
||||
--palette-silver: #c8c9ca;
|
||||
--palette-white: #fff;
|
||||
--palette-steel: #9b9c9e;
|
||||
--palette-slate: #878994;
|
||||
--palette-blue: #402fff;
|
||||
--palette-blue-pressed: #3324e0;
|
||||
--palette-violet: #9a92ff;
|
||||
--palette-red: #ec1d35;
|
||||
--palette-signal-red: #ff5a6a;
|
||||
--palette-green: #3ccf7e;
|
||||
|
||||
/* Semantic colors for the light theme. */
|
||||
--color-canvas: var(--palette-light);
|
||||
--color-surface: var(--palette-white);
|
||||
--color-text: var(--palette-graphite);
|
||||
--color-text-secondary: var(--palette-graphite-soft);
|
||||
/* Surfaces: depth comes from steps and hairlines, not from shadows. */
|
||||
--color-canvas: var(--palette-graphite);
|
||||
--color-surface: var(--palette-graphite-raised);
|
||||
--color-surface-elevated: var(--palette-graphite-elevated);
|
||||
--color-surface-hover: var(--palette-graphite-line);
|
||||
--color-surface-tint: rgb(237 237 237 / 6%);
|
||||
--color-surface-tint-hover: rgb(237 237 237 / 10%);
|
||||
--color-inverse: var(--palette-paper);
|
||||
--color-on-inverse: var(--palette-graphite);
|
||||
|
||||
/* Text. */
|
||||
--color-text: var(--palette-paper);
|
||||
--color-text-strong: var(--palette-white);
|
||||
--color-text-secondary: var(--palette-steel);
|
||||
--color-text-muted: var(--palette-slate);
|
||||
|
||||
/* The single action color: primary buttons and active filters. Hover
|
||||
* inverts the button to paper with blue text. */
|
||||
--color-action: var(--palette-blue);
|
||||
--color-action-pressed: var(--palette-blue-pressed);
|
||||
--color-on-action: var(--palette-white);
|
||||
--color-action-hover: var(--palette-paper);
|
||||
--color-on-action-hover: var(--palette-blue);
|
||||
|
||||
/* Readable accent of the action color: text, rings, strokes, stripes,
|
||||
* selected markers. --color-on-accent is text on an accent fill. */
|
||||
--color-accent: var(--palette-violet);
|
||||
--color-on-accent: var(--palette-white);
|
||||
--color-on-accent: var(--palette-graphite);
|
||||
--color-link: var(--palette-violet);
|
||||
--color-link-hover: var(--palette-paper);
|
||||
|
||||
/* Red is reserved for errors and problems. It reaches only 4.38:1 on white,
|
||||
* so it marks error graphics (borders, icons) and never carries body text. */
|
||||
--color-danger: var(--palette-red);
|
||||
/* States. Danger text is the lightened red; the brand red is a dot. */
|
||||
--color-danger: var(--palette-signal-red);
|
||||
--color-danger-tint: rgb(236 29 53 / 16%);
|
||||
--color-danger-wash: rgb(236 29 53 / 8%);
|
||||
--color-success: var(--palette-green);
|
||||
--color-success-tint: rgb(60 207 126 / 14%);
|
||||
--color-attention: var(--palette-red);
|
||||
--color-accent-tint: rgb(64 47 255 / 18%);
|
||||
|
||||
/* Decorative dividers only: grey does not reach 3:1 and must not be the
|
||||
* only boundary of an interactive control. */
|
||||
--color-divider: var(--palette-grey);
|
||||
--color-border-strong: var(--palette-graphite);
|
||||
/* Lines. */
|
||||
--color-divider: var(--palette-graphite-elevated);
|
||||
--color-border-hover: var(--palette-graphite-line);
|
||||
--color-border-strong: var(--palette-graphite-edge);
|
||||
--color-focus-ring: var(--palette-violet);
|
||||
|
||||
/* Typography. Text uses the system stack; JetBrains Mono is self-hosted for
|
||||
* numbers, scores, codes, and pseudonyms. */
|
||||
--font-text:
|
||||
ui-sans-serif, system-ui, -apple-system, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif;
|
||||
/* Circuit-trace decor: silver at half opacity, as in the design system. */
|
||||
--color-trace: rgb(200 201 202 / 50%);
|
||||
|
||||
/* The only shadow: popovers, menus, and dialogs. */
|
||||
--shadow-popover: 0 16px 40px rgb(0 0 0 / 45%);
|
||||
|
||||
/* Typography. Inter for paragraphs and meta, JetBrains Mono for headings,
|
||||
* labels, buttons, numbers, grades, and stack, Unbounded for the wordmark. */
|
||||
--font-text: inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", roboto, sans-serif;
|
||||
--font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", menlo, consolas, monospace;
|
||||
--font-display: unbounded, var(--font-text);
|
||||
--font-size-xs: 0.8125rem;
|
||||
--font-size-s: 0.9375rem;
|
||||
--font-size-m: 1.0625rem;
|
||||
--font-size-s: 0.875rem;
|
||||
--font-size-m: 1rem;
|
||||
--font-size-l: 1.25rem;
|
||||
--font-size-xl: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
|
||||
--font-size-display: clamp(2rem, 1.45rem + 2.4vw, 3.25rem);
|
||||
--font-size-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
|
||||
--font-size-title: clamp(1.625rem, 1.45rem + 0.8vw, 2rem);
|
||||
--font-size-display: clamp(2rem, 1.3rem + 3vw, 3.375rem);
|
||||
--font-weight-regular: 400;
|
||||
--font-weight-medium: 500;
|
||||
--font-weight-bold: 700;
|
||||
--line-height-tight: 1.1;
|
||||
--font-weight-bold: 600;
|
||||
--line-height-tight: 1.15;
|
||||
--line-height-snug: 1.3;
|
||||
--line-height-body: 1.6;
|
||||
--letter-spacing-display: -0.03em;
|
||||
--letter-spacing-label: 0.08em;
|
||||
--letter-spacing-display: -0.02em;
|
||||
--letter-spacing-label: 0.06em;
|
||||
|
||||
/* Spacing scale with a 4px base. */
|
||||
--space-1: 0.25rem;
|
||||
@@ -75,29 +125,43 @@
|
||||
--space-8: 4rem;
|
||||
--space-9: 6rem;
|
||||
|
||||
/* Radii follow the rounded corners of the brand connector lines. */
|
||||
--radius-s: 0.375rem;
|
||||
--radius-m: 0.75rem;
|
||||
--radius-l: 1.25rem;
|
||||
/* Radii, one rule per element type: controls and tags are capsules,
|
||||
* containers 24, panels 32, surfaces nested in a card 16, objects up to
|
||||
* 24px (checkboxes, keycaps) 6. */
|
||||
--radius-xs: 0.375rem;
|
||||
--radius-s: 1rem;
|
||||
--radius-m: 1.5rem;
|
||||
--radius-l: 2rem;
|
||||
--radius-pill: 999px;
|
||||
|
||||
/* Lines. */
|
||||
/* Lines: hairlines everywhere, the strong line for state stripes. */
|
||||
--line-thin: 1px;
|
||||
--line-strong: 2px;
|
||||
|
||||
/* Focus indicator: 3px ring outside the element. */
|
||||
--focus-ring-width: 3px;
|
||||
/* Focus indicator: 2px violet ring outside the element. */
|
||||
--focus-ring-width: 2px;
|
||||
--focus-ring-offset: 2px;
|
||||
|
||||
/* Layout widths. */
|
||||
/* Layout. */
|
||||
--content-width-narrow: 40rem;
|
||||
--content-width-wide: 80rem;
|
||||
--content-width-wide: 77.5rem;
|
||||
--gutter: var(--space-4);
|
||||
--chrome-inset: 0.625rem;
|
||||
--header-height: 3.5rem;
|
||||
--control-height: 2.75rem;
|
||||
|
||||
/* Motion. Reduced motion collapses durations below. */
|
||||
--duration-fast: 120ms;
|
||||
--duration-base: 220ms;
|
||||
--easing-standard: cubic-bezier(0.2, 0, 0, 1);
|
||||
--duration-fast: 150ms;
|
||||
--duration-base: 200ms;
|
||||
--duration-slow: 400ms;
|
||||
--easing-standard: cubic-bezier(0.25, 0.1, 0.25, 1);
|
||||
--easing-emphasized: cubic-bezier(0.4, 0.24, 0, 1);
|
||||
}
|
||||
|
||||
@media (width >= 43.75rem) {
|
||||
:root {
|
||||
--header-height: 4rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (width >= 48rem) {
|
||||
@@ -106,9 +170,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (width >= 80rem) {
|
||||
:root {
|
||||
--gutter: 2.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
:root {
|
||||
--duration-fast: 0ms;
|
||||
--duration-base: 0ms;
|
||||
--duration-slow: 0ms;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
height: 1.25rem;
|
||||
}
|
||||
|
||||
/* Graphics need 3:1: graphite 17.01:1 and violet 6.84:1 on white. */
|
||||
/* Graphics need 3:1: paper 13.68:1 and violet 6.05:1 on the surface. */
|
||||
.empty {
|
||||
fill: none;
|
||||
stroke: var(--color-text);
|
||||
|
||||
Reference in new issue
Block a user