bereg-ds 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -1
- package/README.md +34 -4
- package/SKILL.md +6 -3
- package/dist/css/theme-light.css +91 -0
- package/dist/css/tokens.css +1 -1
- package/dist/tokens/tokens-light.json +27 -0
- package/dist/tokens/tokens.js +2 -2
- package/dist/tokens/tokens.json +2 -2
- package/package.json +23 -21
- package/tokens/primitive.json +1 -1
- package/tokens/themes/light/color.json +193 -0
- package/tokens/themes/light/primitive.json +138 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,18 @@
|
|
|
3
3
|
All notable changes to this project are documented here. The project follows [Semantic Versioning](https://semver.org/):
|
|
4
4
|
a breaking change to a token name, a class name or a component prop is a major version.
|
|
5
5
|
|
|
6
|
-
## 1.
|
|
6
|
+
## 1.1.0 (unreleased)
|
|
7
|
+
|
|
8
|
+
- Optional light theme: `bereg-ds/theme-light.css` (not part of `bereg-ds.css`). Follows `prefers-color-scheme`
|
|
9
|
+
unless `<html data-theme="light|dark">` is set. Text contrast 7:1 or more, interactive borders 3:1 or more.
|
|
10
|
+
- Light tokens in `tokens/themes/light/*.json` (DTCG) and `bereg-ds/tokens-light.json`.
|
|
11
|
+
- Dark theme: `--muted` (`--prim-slate-400`) #8ea3bf → #91a6c2, so muted text on `--surface` is 7.2:1 (was 6.9:1).
|
|
12
|
+
- Storybook: docs pages (MDX) follow the theme switch too (before, they followed the system setting); docs links use `--accent`;
|
|
13
|
+
code colors in docs raised to 7:1; contrast table shows border colors as lines, not as text.
|
|
14
|
+
- Tests: contrast for both themes, including hover, selection, header and focus colors.
|
|
15
|
+
- Storybook: theme switch in the toolbar (Dark, Light, System), Foundations / Themes page, contrast computed from tokens.
|
|
16
|
+
|
|
17
|
+
## 1.0.0 (2026-11-17)
|
|
7
18
|
|
|
8
19
|
First release.
|
|
9
20
|
|
package/README.md
CHANGED
|
@@ -5,7 +5,9 @@ Design tokens, CSS components and React components from one source.
|
|
|
5
5
|
|
|
6
6
|
- **Docs and live components:** [ds.bereg.dev](https://ds.bereg.dev) (Storybook)
|
|
7
7
|
- **Figma:** [Bereg DS](https://www.figma.com/design/nWkFlhkomx90UBXw6nFAQj)
|
|
8
|
+
- **npm:** [bereg-ds](https://www.npmjs.com/package/bereg-ds)
|
|
8
9
|
- **Live example:** [bereg.dev](https://bereg.dev)
|
|
10
|
+
- **Case study:** [bereg.dev/projects/bereg-ds](https://bereg.dev/projects/bereg-ds/)
|
|
9
11
|
|
|
10
12
|
## Install
|
|
11
13
|
|
|
@@ -40,8 +42,22 @@ Import only what you need:
|
|
|
40
42
|
| `bereg-ds/fonts.css` | IBM Plex Sans (variable) and Mono 400, metric-matched fallbacks |
|
|
41
43
|
| `bereg-ds/tokens.css` | CSS variables: colors, spacing, radii, type scale, motion |
|
|
42
44
|
| `bereg-ds/base.css` | Page defaults, headings, text-style classes (`.text-h1`, `.text-meta`...), `.blueprint` grid |
|
|
43
|
-
| `bereg-ds/components.css` | Components: `.btn`, `.card`, `.quote`, `.tag`, `.filter-tab`, `.section-head`, `.facts`, `.timeline`, `.posts`, `.site-header`, `.site-footer`, `.prose` |
|
|
45
|
+
| `bereg-ds/components.css` | Components: `.btn`, `.card`, `.quote`, `.tag`, `.filter-tab`, `.section-head`, `.subhead`, `.facts`, `.timeline`, `.posts`, `.book-promo`, `.site-header`, `.site-footer`, `.prose`, `.wrap` |
|
|
44
46
|
| `bereg-ds/hdr.css` | Optional HDR accents (`.hdr-logo`, `.hdr-card`) |
|
|
47
|
+
| `bereg-ds/theme-light.css` | Optional light theme (see below) |
|
|
48
|
+
|
|
49
|
+
## Light theme (optional)
|
|
50
|
+
|
|
51
|
+
Dark is the default. Projects that need a light theme add one file; projects that stay dark do not load it.
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
import 'bereg-ds/bereg-ds.css';
|
|
55
|
+
import 'bereg-ds/theme-light.css';
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
It follows the system setting (`prefers-color-scheme`). `<html data-theme="light">` or `data-theme="dark"` overrides it.
|
|
59
|
+
The switch, `localStorage` and a small inline script against the flash on load are up to the project:
|
|
60
|
+
see [Foundations / Themes](https://ds.bereg.dev/?path=/docs/foundations-themes--docs).
|
|
45
61
|
|
|
46
62
|
## Use with React
|
|
47
63
|
|
|
@@ -70,9 +86,10 @@ Components: `Button`, `Link`, `NavLink`, `Tag`, `Tags`, `Card`, `Quote`, `BookPr
|
|
|
70
86
|
```js
|
|
71
87
|
import { colorAccent, space4 } from 'bereg-ds/tokens'; // px values
|
|
72
88
|
import tokens from 'bereg-ds/tokens.json';
|
|
89
|
+
import light from 'bereg-ds/tokens-light.json'; // light theme colors
|
|
73
90
|
```
|
|
74
91
|
|
|
75
|
-
The source tokens (W3C DTCG format) are in `tokens/*.json`.
|
|
92
|
+
The source tokens (W3C DTCG format) are in `tokens/*.json`, the light theme in `tokens/themes/light/*.json`.
|
|
76
93
|
|
|
77
94
|
## Rules of the system
|
|
78
95
|
|
|
@@ -80,16 +97,19 @@ The source tokens (W3C DTCG format) are in `tokens/*.json`.
|
|
|
80
97
|
Strokes (1/2/3px), corner ticks (11/22px) and breakpoints (640/760px) are separate sizes.
|
|
81
98
|
2. **Tokens only.** No raw colors or pixel spacing in components (a test checks it).
|
|
82
99
|
3. **Units.** Font sizes and spacing in rem, line height without units, letter spacing in em, strokes in px,
|
|
83
|
-
breakpoints in em (`40em`, `47.5em`).
|
|
100
|
+
breakpoints in em in media queries (`40em`, `47.5em`). The `--bp-sm`/`--bp-md` tokens (640/760px) are for reference:
|
|
101
|
+
CSS variables do not work in media queries.
|
|
84
102
|
4. **Accessibility.** Text contrast 7:1 or more. Interactive borders use `--line-strong` (3:1 or more),
|
|
85
103
|
`--line` is decorative only. Visible focus on every interactive element. Links are underlined.
|
|
86
104
|
Respects `prefers-reduced-motion` and `forced-colors`.
|
|
87
|
-
5. **Dark theme
|
|
105
|
+
5. **Dark by default.** The light theme is an optional file with the same token names.
|
|
88
106
|
6. **HDR is an optional accent**, not a default.
|
|
89
107
|
7. **Exceptions belong to the project.** A special case lives in that project's CSS, not in the system.
|
|
90
108
|
|
|
91
109
|
## Develop
|
|
92
110
|
|
|
111
|
+
Node version is pinned in `.nvmrc` (`nvm use`).
|
|
112
|
+
|
|
93
113
|
```sh
|
|
94
114
|
npm install
|
|
95
115
|
npm run build # tokens -> dist/css/tokens.css + dist/tokens, CSS, React
|
|
@@ -99,6 +119,16 @@ npm run storybook # docs and live components on http://localhost:6006
|
|
|
99
119
|
|
|
100
120
|
Change tokens in Figma first, then in `tokens/*.json`, then run `npm run build`.
|
|
101
121
|
|
|
122
|
+
## Release
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
npm login
|
|
126
|
+
npm publish # prepublishOnly runs build and tests
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Update `CHANGELOG.md` and the version in `package.json` first.
|
|
130
|
+
Storybook (ds.bereg.dev) deploys automatically on push to `main`.
|
|
131
|
+
|
|
102
132
|
## License
|
|
103
133
|
|
|
104
134
|
MIT. IBM Plex is licensed under the SIL Open Font License (comes with the Fontsource packages).
|
package/SKILL.md
CHANGED
|
@@ -28,6 +28,7 @@ npm i bereg-ds
|
|
|
28
28
|
import 'bereg-ds/bereg-ds.css'; // fonts + tokens + base + components
|
|
29
29
|
import { Button, Card } from 'bereg-ds/react'; // only in React projects
|
|
30
30
|
// import 'bereg-ds/hdr.css'; // only if an HDR accent is asked for
|
|
31
|
+
// import 'bereg-ds/theme-light.css'; // only if the project needs a light theme
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
Without React, use the same CSS classes in HTML (see README.md).
|
|
@@ -35,18 +36,19 @@ Without React, use the same CSS classes in HTML (see README.md).
|
|
|
35
36
|
## Rules
|
|
36
37
|
|
|
37
38
|
1. **Use components first.** Button, Link, NavLink, Tag/Tags, Card, Quote, BookPromo, FilterTabs, Sections/Section,
|
|
38
|
-
Facts, Timeline, PostList, Subhead, SiteHeader, SiteFooter. Do not restyle them per page.
|
|
39
|
+
Facts, Timeline, PostList, Subhead, SiteHeader, SiteFooter, Wrap. Do not restyle them per page.
|
|
39
40
|
2. **Tokens only.** Colors: `var(--bg)`, `--surface`, `--text`, `--muted`, `--line`, `--line-strong`, `--accent`,
|
|
40
41
|
`--accent-ink`, `--highlight`, `--focus`. Never hard-code hex colors or primitives (`--prim-*`).
|
|
41
42
|
3. **Scale of 4.** Spacing, gaps and radii only from `--space-1` (4px) … `--space-16` (64px) and `--radius-sm|md|lg`.
|
|
42
43
|
No 6px, 10px, 14px. Strokes `--border-thin|medium|thick` in px.
|
|
43
44
|
4. **Type.** Use the text-style classes (`.text-h1`, `.text-h2`, `.text-h3`, `.text-lede`, `.text-body`, `.text-small`,
|
|
44
|
-
`.text-meta`, `.text-label`, `.text-caps`, `.text-tag`, `.text-code`) or `--font-size-*` tokens. Fonts: `var(--font)`,
|
|
45
|
+
`.text-meta`, `.text-label`, `.text-caps`, `.text-tag`, `.text-code`, `.text-footnote`, `.text-caption`, `.text-strong`) or `--font-size-*` tokens. Fonts: `var(--font)`,
|
|
45
46
|
`var(--mono)`. Sizes in rem, line height unitless.
|
|
46
47
|
5. **Accessibility.** Borders that identify an interactive element use `--line-strong`; `--line` is decorative.
|
|
47
48
|
Keep the focus ring (`:focus-visible`, 3px `--focus`, offset 3px). Underline links. Every section has a heading
|
|
48
49
|
(`Section` does it). Respect `prefers-reduced-motion` and `forced-colors`.
|
|
49
|
-
6. **Dark theme only
|
|
50
|
+
6. **Dark by default.** Add `theme-light.css` only if the project asks for a light theme. Never invent colors for
|
|
51
|
+
either theme; use the semantic tokens so both themes work. The theme switch and its storage live in the project.
|
|
50
52
|
7. **HDR only when asked**, for one accent at a time, always with an SDR fallback (`hdr.css`).
|
|
51
53
|
8. **Exceptions stay in the project.** If a design needs a value the system does not have, put it in the project's
|
|
52
54
|
own CSS with a comment, and tell Konstantin. Do not edit the package for one project.
|
|
@@ -55,4 +57,5 @@ Without React, use the same CSS classes in HTML (see README.md).
|
|
|
55
57
|
|
|
56
58
|
- Docs and live components: https://ds.bereg.dev
|
|
57
59
|
- Figma: https://www.figma.com/design/nWkFlhkomx90UBXw6nFAQj
|
|
60
|
+
- npm: https://www.npmjs.com/package/bereg-ds
|
|
58
61
|
- Source: https://github.com/KonstantinBeregovoy/bereg-ds
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bereg DS light theme (optional). Generated from tokens/themes/light/*.json. Do not edit by hand.
|
|
3
|
+
* Import after bereg-ds.css. Follows the system setting unless <html data-theme="light|dark"> is set.
|
|
4
|
+
*/
|
|
5
|
+
@media (prefers-color-scheme: light) {
|
|
6
|
+
:root:not([data-theme="dark"]) {
|
|
7
|
+
color-scheme: light;
|
|
8
|
+
--prim-light-paper: #f5f8fc;
|
|
9
|
+
--prim-light-slate-700: #3d5170;
|
|
10
|
+
--prim-light-blue-700: #08467f;
|
|
11
|
+
--prim-light-amber-800: #7a4300;
|
|
12
|
+
--prim-light-line: #d5deea;
|
|
13
|
+
--prim-light-line-strong: #72859f;
|
|
14
|
+
--prim-light-mix-amber-line: #c19a6b;
|
|
15
|
+
--prim-light-alpha-blue-700-3: rgba(8, 70, 127, 0.03);
|
|
16
|
+
--prim-light-alpha-blue-700-6: rgba(8, 70, 127, 0.06);
|
|
17
|
+
--prim-light-alpha-blue-700-8: rgba(8, 70, 127, 0.08);
|
|
18
|
+
--prim-light-alpha-blue-700-10: rgba(8, 70, 127, 0.1);
|
|
19
|
+
--prim-light-alpha-blue-700-12: rgba(8, 70, 127, 0.12);
|
|
20
|
+
--prim-light-alpha-blue-700-18: rgba(8, 70, 127, 0.18);
|
|
21
|
+
--prim-light-alpha-blue-700-40: rgba(8, 70, 127, 0.4);
|
|
22
|
+
--prim-light-alpha-navy-850-15: rgba(13, 24, 41, 0.15);
|
|
23
|
+
--prim-light-alpha-paper-88: rgba(245, 248, 252, 0.88);
|
|
24
|
+
--bg: var(--prim-light-paper);
|
|
25
|
+
--surface: var(--prim-white);
|
|
26
|
+
--text: var(--prim-navy-850);
|
|
27
|
+
--muted: var(--prim-light-slate-700);
|
|
28
|
+
--line: var(--prim-light-line); /** Decorative lines only. */
|
|
29
|
+
--line-strong: var(--prim-light-line-strong); /** Borders of interactive elements, >=3:1 on bg and surface (WCAG 1.4.11). */
|
|
30
|
+
--line-hover: var(--prim-light-mix-amber-line);
|
|
31
|
+
--accent: var(--prim-light-blue-700); /** Links, primary actions, focus. */
|
|
32
|
+
--accent-ink: var(--prim-white);
|
|
33
|
+
--accent-subtle: var(--prim-light-alpha-blue-700-8);
|
|
34
|
+
--highlight: var(--prim-light-amber-800); /** Hover of primary actions, section numbers, current filter. */
|
|
35
|
+
--focus: var(--prim-light-blue-700);
|
|
36
|
+
--selection: var(--prim-light-alpha-blue-700-18);
|
|
37
|
+
--selection-text: var(--prim-navy-850);
|
|
38
|
+
--header-bg: var(--prim-light-alpha-paper-88);
|
|
39
|
+
--grid: var(--prim-light-alpha-blue-700-6);
|
|
40
|
+
--grid-major: var(--prim-light-alpha-blue-700-10);
|
|
41
|
+
--grid-dot: var(--prim-light-alpha-blue-700-40);
|
|
42
|
+
--lamp-grid: var(--prim-light-alpha-blue-700-12);
|
|
43
|
+
--lamp-grid-major: var(--prim-light-alpha-blue-700-18);
|
|
44
|
+
--lamp-glow: var(--prim-light-alpha-blue-700-3);
|
|
45
|
+
--shadow-color: var(--prim-light-alpha-navy-850-15);
|
|
46
|
+
--glow-color: var(--prim-light-alpha-blue-700-8);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:root[data-theme="light"] {
|
|
51
|
+
color-scheme: light;
|
|
52
|
+
--prim-light-paper: #f5f8fc;
|
|
53
|
+
--prim-light-slate-700: #3d5170;
|
|
54
|
+
--prim-light-blue-700: #08467f;
|
|
55
|
+
--prim-light-amber-800: #7a4300;
|
|
56
|
+
--prim-light-line: #d5deea;
|
|
57
|
+
--prim-light-line-strong: #72859f;
|
|
58
|
+
--prim-light-mix-amber-line: #c19a6b;
|
|
59
|
+
--prim-light-alpha-blue-700-3: rgba(8, 70, 127, 0.03);
|
|
60
|
+
--prim-light-alpha-blue-700-6: rgba(8, 70, 127, 0.06);
|
|
61
|
+
--prim-light-alpha-blue-700-8: rgba(8, 70, 127, 0.08);
|
|
62
|
+
--prim-light-alpha-blue-700-10: rgba(8, 70, 127, 0.1);
|
|
63
|
+
--prim-light-alpha-blue-700-12: rgba(8, 70, 127, 0.12);
|
|
64
|
+
--prim-light-alpha-blue-700-18: rgba(8, 70, 127, 0.18);
|
|
65
|
+
--prim-light-alpha-blue-700-40: rgba(8, 70, 127, 0.4);
|
|
66
|
+
--prim-light-alpha-navy-850-15: rgba(13, 24, 41, 0.15);
|
|
67
|
+
--prim-light-alpha-paper-88: rgba(245, 248, 252, 0.88);
|
|
68
|
+
--bg: var(--prim-light-paper);
|
|
69
|
+
--surface: var(--prim-white);
|
|
70
|
+
--text: var(--prim-navy-850);
|
|
71
|
+
--muted: var(--prim-light-slate-700);
|
|
72
|
+
--line: var(--prim-light-line); /** Decorative lines only. */
|
|
73
|
+
--line-strong: var(--prim-light-line-strong); /** Borders of interactive elements, >=3:1 on bg and surface (WCAG 1.4.11). */
|
|
74
|
+
--line-hover: var(--prim-light-mix-amber-line);
|
|
75
|
+
--accent: var(--prim-light-blue-700); /** Links, primary actions, focus. */
|
|
76
|
+
--accent-ink: var(--prim-white);
|
|
77
|
+
--accent-subtle: var(--prim-light-alpha-blue-700-8);
|
|
78
|
+
--highlight: var(--prim-light-amber-800); /** Hover of primary actions, section numbers, current filter. */
|
|
79
|
+
--focus: var(--prim-light-blue-700);
|
|
80
|
+
--selection: var(--prim-light-alpha-blue-700-18);
|
|
81
|
+
--selection-text: var(--prim-navy-850);
|
|
82
|
+
--header-bg: var(--prim-light-alpha-paper-88);
|
|
83
|
+
--grid: var(--prim-light-alpha-blue-700-6);
|
|
84
|
+
--grid-major: var(--prim-light-alpha-blue-700-10);
|
|
85
|
+
--grid-dot: var(--prim-light-alpha-blue-700-40);
|
|
86
|
+
--lamp-grid: var(--prim-light-alpha-blue-700-12);
|
|
87
|
+
--lamp-grid-major: var(--prim-light-alpha-blue-700-18);
|
|
88
|
+
--lamp-glow: var(--prim-light-alpha-blue-700-3);
|
|
89
|
+
--shadow-color: var(--prim-light-alpha-navy-850-15);
|
|
90
|
+
--glow-color: var(--prim-light-alpha-blue-700-8);
|
|
91
|
+
}
|
package/dist/css/tokens.css
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"color": {
|
|
3
|
+
"bg": "#f5f8fc",
|
|
4
|
+
"surface": "#ffffff",
|
|
5
|
+
"text": "#0d1829",
|
|
6
|
+
"muted": "#3d5170",
|
|
7
|
+
"line": "#d5deea",
|
|
8
|
+
"line-strong": "#72859f",
|
|
9
|
+
"line-hover": "#c19a6b",
|
|
10
|
+
"accent": "#08467f",
|
|
11
|
+
"accent-ink": "#ffffff",
|
|
12
|
+
"accent-subtle": "rgba(8, 70, 127, 0.08)",
|
|
13
|
+
"highlight": "#7a4300",
|
|
14
|
+
"focus": "#08467f",
|
|
15
|
+
"selection": "rgba(8, 70, 127, 0.18)",
|
|
16
|
+
"selection-text": "#0d1829",
|
|
17
|
+
"header-bg": "rgba(245, 248, 252, 0.88)",
|
|
18
|
+
"grid": "rgba(8, 70, 127, 0.06)",
|
|
19
|
+
"grid-major": "rgba(8, 70, 127, 0.1)",
|
|
20
|
+
"grid-dot": "rgba(8, 70, 127, 0.4)",
|
|
21
|
+
"lamp-grid": "rgba(8, 70, 127, 0.12)",
|
|
22
|
+
"lamp-grid-major": "rgba(8, 70, 127, 0.18)",
|
|
23
|
+
"lamp-glow": "rgba(8, 70, 127, 0.03)",
|
|
24
|
+
"shadow": "rgba(13, 24, 41, 0.15)",
|
|
25
|
+
"glow": "rgba(8, 70, 127, 0.08)"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/dist/tokens/tokens.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export const colorBg = "#0a1220";
|
|
7
7
|
export const colorSurface = "#0d1829";
|
|
8
8
|
export const colorText = "#dbe6f5";
|
|
9
|
-
export const colorMuted = "#
|
|
9
|
+
export const colorMuted = "#91a6c2";
|
|
10
10
|
export const colorLine = "#1f3350"; // Decorative lines only (1.47:1 on bg).
|
|
11
11
|
export const colorLineStrong = "#4d6a8f"; // Borders of interactive elements, >=3:1 on bg and surface (WCAG 1.4.11).
|
|
12
12
|
export const colorLineHover = "#7e6d56";
|
|
@@ -91,7 +91,7 @@ export const primitiveColorNavy850 = "#0d1829";
|
|
|
91
91
|
export const primitiveColorNavy900 = "#0a1220";
|
|
92
92
|
export const primitiveColorNavy950 = "#06101d";
|
|
93
93
|
export const primitiveColorSlate100 = "#dbe6f5";
|
|
94
|
-
export const primitiveColorSlate400 = "#
|
|
94
|
+
export const primitiveColorSlate400 = "#91a6c2";
|
|
95
95
|
export const primitiveColorBlue300 = "#78c2ff";
|
|
96
96
|
export const primitiveColorAmber300 = "#f2b45e";
|
|
97
97
|
export const primitiveColorWhite = "#ffffff";
|
package/dist/tokens/tokens.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"bg": "#0a1220",
|
|
4
4
|
"surface": "#0d1829",
|
|
5
5
|
"text": "#dbe6f5",
|
|
6
|
-
"muted": "#
|
|
6
|
+
"muted": "#91a6c2",
|
|
7
7
|
"line": "#1f3350",
|
|
8
8
|
"line-strong": "#4d6a8f",
|
|
9
9
|
"line-hover": "#7e6d56",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
},
|
|
121
121
|
"slate": {
|
|
122
122
|
"100": "#dbe6f5",
|
|
123
|
-
"400": "#
|
|
123
|
+
"400": "#91a6c2"
|
|
124
124
|
},
|
|
125
125
|
"blue": {
|
|
126
126
|
"300": "#78c2ff"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bereg-ds",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Bereg DS: the Engineering Blueprint design system by Konstantin Beregovoy. Design tokens, CSS components and React components.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Konstantin Beregovoy (https://bereg.dev)",
|
|
@@ -38,12 +38,14 @@
|
|
|
38
38
|
"./base.css": "./dist/css/base.css",
|
|
39
39
|
"./components.css": "./dist/css/components.css",
|
|
40
40
|
"./hdr.css": "./dist/css/hdr.css",
|
|
41
|
+
"./theme-light.css": "./dist/css/theme-light.css",
|
|
41
42
|
"./bereg-ds.css": "./dist/css/bereg-ds.css",
|
|
42
43
|
"./tokens": {
|
|
43
44
|
"types": "./dist/tokens/tokens.d.ts",
|
|
44
45
|
"default": "./dist/tokens/tokens.js"
|
|
45
46
|
},
|
|
46
47
|
"./tokens.json": "./dist/tokens/tokens.json",
|
|
48
|
+
"./tokens-light.json": "./dist/tokens/tokens-light.json",
|
|
47
49
|
"./react": {
|
|
48
50
|
"types": "./dist/react/index.d.ts",
|
|
49
51
|
"default": "./dist/react/index.js"
|
|
@@ -58,7 +60,7 @@
|
|
|
58
60
|
"test": "vitest run",
|
|
59
61
|
"typecheck": "tsc --noEmit",
|
|
60
62
|
"storybook": "storybook dev -p 6006",
|
|
61
|
-
"build-storybook": "npm run build && storybook build -o storybook-static",
|
|
63
|
+
"build-storybook": "npm run build && storybook build -o storybook-static && node scripts/seo-head.mjs",
|
|
62
64
|
"prepublishOnly": "npm run build && npm test"
|
|
63
65
|
},
|
|
64
66
|
"dependencies": {
|
|
@@ -77,24 +79,24 @@
|
|
|
77
79
|
"node": ">=20"
|
|
78
80
|
},
|
|
79
81
|
"devDependencies": {
|
|
80
|
-
"@storybook/addon-a11y": "10.6.7",
|
|
81
|
-
"@storybook/addon-docs": "10.6.7",
|
|
82
|
-
"@storybook/react-vite": "10.6.7",
|
|
83
|
-
"@testing-library/jest-dom": "7.0.1",
|
|
84
|
-
"@testing-library/react": "16.3.3",
|
|
85
|
-
"@types/node": "26.6.6",
|
|
86
|
-
"@types/react": "19.3.0",
|
|
87
|
-
"@types/react-dom": "19.3.0",
|
|
88
|
-
"@vitejs/plugin-react": "6.3.0",
|
|
89
|
-
"jsdom": "31.0.1",
|
|
90
|
-
"lightningcss": "1.33.0",
|
|
91
|
-
"react": "19.3.1",
|
|
92
|
-
"react-dom": "19.3.1",
|
|
93
|
-
"storybook": "10.6.7",
|
|
94
|
-
"style-dictionary": "5.8.0",
|
|
95
|
-
"tsup": "9.0.0",
|
|
96
|
-
"typescript": "6.0.3",
|
|
97
|
-
"vite": "8.3.8",
|
|
98
|
-
"vitest": "5.1.0"
|
|
82
|
+
"@storybook/addon-a11y": "^10.6.7",
|
|
83
|
+
"@storybook/addon-docs": "^10.6.7",
|
|
84
|
+
"@storybook/react-vite": "^10.6.7",
|
|
85
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
86
|
+
"@testing-library/react": "^16.3.3",
|
|
87
|
+
"@types/node": "^26.6.6",
|
|
88
|
+
"@types/react": "^19.3.0",
|
|
89
|
+
"@types/react-dom": "^19.3.0",
|
|
90
|
+
"@vitejs/plugin-react": "^6.3.0",
|
|
91
|
+
"jsdom": "^31.0.1",
|
|
92
|
+
"lightningcss": "^1.33.0",
|
|
93
|
+
"react": "^19.3.1",
|
|
94
|
+
"react-dom": "^19.3.1",
|
|
95
|
+
"storybook": "^10.6.7",
|
|
96
|
+
"style-dictionary": "^5.8.0",
|
|
97
|
+
"tsup": "^9.0.0",
|
|
98
|
+
"typescript": "^6.0.3",
|
|
99
|
+
"vite": "^8.3.8",
|
|
100
|
+
"vitest": "^5.1.0"
|
|
99
101
|
}
|
|
100
102
|
}
|
package/tokens/primitive.json
CHANGED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
{
|
|
2
|
+
"color": {
|
|
3
|
+
"$type": "color",
|
|
4
|
+
"bg": {
|
|
5
|
+
"$value": "{primitive.light.paper}",
|
|
6
|
+
"$extensions": {
|
|
7
|
+
"bds": {
|
|
8
|
+
"css": "bg"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"surface": {
|
|
13
|
+
"$value": "{primitive.color.white}",
|
|
14
|
+
"$extensions": {
|
|
15
|
+
"bds": {
|
|
16
|
+
"css": "surface"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"text": {
|
|
21
|
+
"$value": "{primitive.color.navy.850}",
|
|
22
|
+
"$extensions": {
|
|
23
|
+
"bds": {
|
|
24
|
+
"css": "text"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"muted": {
|
|
29
|
+
"$value": "{primitive.light.slate-700}",
|
|
30
|
+
"$extensions": {
|
|
31
|
+
"bds": {
|
|
32
|
+
"css": "muted"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"line": {
|
|
37
|
+
"$value": "{primitive.light.line}",
|
|
38
|
+
"$extensions": {
|
|
39
|
+
"bds": {
|
|
40
|
+
"css": "line"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"$description": "Decorative lines only."
|
|
44
|
+
},
|
|
45
|
+
"line-strong": {
|
|
46
|
+
"$value": "{primitive.light.line-strong}",
|
|
47
|
+
"$extensions": {
|
|
48
|
+
"bds": {
|
|
49
|
+
"css": "line-strong"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"$description": "Borders of interactive elements, >=3:1 on bg and surface (WCAG 1.4.11)."
|
|
53
|
+
},
|
|
54
|
+
"line-hover": {
|
|
55
|
+
"$value": "{primitive.light.mix-amber-line}",
|
|
56
|
+
"$extensions": {
|
|
57
|
+
"bds": {
|
|
58
|
+
"css": "line-hover"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"accent": {
|
|
63
|
+
"$value": "{primitive.light.blue-700}",
|
|
64
|
+
"$extensions": {
|
|
65
|
+
"bds": {
|
|
66
|
+
"css": "accent"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"$description": "Links, primary actions, focus."
|
|
70
|
+
},
|
|
71
|
+
"accent-ink": {
|
|
72
|
+
"$value": "{primitive.color.white}",
|
|
73
|
+
"$extensions": {
|
|
74
|
+
"bds": {
|
|
75
|
+
"css": "accent-ink"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"accent-subtle": {
|
|
80
|
+
"$value": "{primitive.light.alpha.blue-700-8}",
|
|
81
|
+
"$extensions": {
|
|
82
|
+
"bds": {
|
|
83
|
+
"css": "accent-subtle"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"highlight": {
|
|
88
|
+
"$value": "{primitive.light.amber-800}",
|
|
89
|
+
"$extensions": {
|
|
90
|
+
"bds": {
|
|
91
|
+
"css": "highlight"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"$description": "Hover of primary actions, section numbers, current filter."
|
|
95
|
+
},
|
|
96
|
+
"focus": {
|
|
97
|
+
"$value": "{primitive.light.blue-700}",
|
|
98
|
+
"$extensions": {
|
|
99
|
+
"bds": {
|
|
100
|
+
"css": "focus"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"selection": {
|
|
105
|
+
"$value": "{primitive.light.alpha.blue-700-18}",
|
|
106
|
+
"$extensions": {
|
|
107
|
+
"bds": {
|
|
108
|
+
"css": "selection"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"selection-text": {
|
|
113
|
+
"$value": "{primitive.color.navy.850}",
|
|
114
|
+
"$extensions": {
|
|
115
|
+
"bds": {
|
|
116
|
+
"css": "selection-text"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"header-bg": {
|
|
121
|
+
"$value": "{primitive.light.alpha.paper-88}",
|
|
122
|
+
"$extensions": {
|
|
123
|
+
"bds": {
|
|
124
|
+
"css": "header-bg"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"grid": {
|
|
129
|
+
"$value": "{primitive.light.alpha.blue-700-6}",
|
|
130
|
+
"$extensions": {
|
|
131
|
+
"bds": {
|
|
132
|
+
"css": "grid"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"grid-major": {
|
|
137
|
+
"$value": "{primitive.light.alpha.blue-700-10}",
|
|
138
|
+
"$extensions": {
|
|
139
|
+
"bds": {
|
|
140
|
+
"css": "grid-major"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"grid-dot": {
|
|
145
|
+
"$value": "{primitive.light.alpha.blue-700-40}",
|
|
146
|
+
"$extensions": {
|
|
147
|
+
"bds": {
|
|
148
|
+
"css": "grid-dot"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"lamp-grid": {
|
|
153
|
+
"$value": "{primitive.light.alpha.blue-700-12}",
|
|
154
|
+
"$extensions": {
|
|
155
|
+
"bds": {
|
|
156
|
+
"css": "lamp-grid"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"lamp-grid-major": {
|
|
161
|
+
"$value": "{primitive.light.alpha.blue-700-18}",
|
|
162
|
+
"$extensions": {
|
|
163
|
+
"bds": {
|
|
164
|
+
"css": "lamp-grid-major"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"lamp-glow": {
|
|
169
|
+
"$value": "{primitive.light.alpha.blue-700-3}",
|
|
170
|
+
"$extensions": {
|
|
171
|
+
"bds": {
|
|
172
|
+
"css": "lamp-glow"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"shadow": {
|
|
177
|
+
"$value": "{primitive.light.alpha.navy-850-15}",
|
|
178
|
+
"$extensions": {
|
|
179
|
+
"bds": {
|
|
180
|
+
"css": "shadow-color"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"glow": {
|
|
185
|
+
"$value": "{primitive.light.alpha.blue-700-8}",
|
|
186
|
+
"$extensions": {
|
|
187
|
+
"bds": {
|
|
188
|
+
"css": "glow-color"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
{
|
|
2
|
+
"primitive": {
|
|
3
|
+
"light": {
|
|
4
|
+
"$type": "color",
|
|
5
|
+
"$description": "Light theme palette. Ships only in theme-light.css.",
|
|
6
|
+
"paper": {
|
|
7
|
+
"$value": "#f5f8fc",
|
|
8
|
+
"$extensions": {
|
|
9
|
+
"bds": {
|
|
10
|
+
"css": "prim-light-paper"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"slate-700": {
|
|
15
|
+
"$value": "#3d5170",
|
|
16
|
+
"$extensions": {
|
|
17
|
+
"bds": {
|
|
18
|
+
"css": "prim-light-slate-700"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"blue-700": {
|
|
23
|
+
"$value": "#08467f",
|
|
24
|
+
"$extensions": {
|
|
25
|
+
"bds": {
|
|
26
|
+
"css": "prim-light-blue-700"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"amber-800": {
|
|
31
|
+
"$value": "#7a4300",
|
|
32
|
+
"$extensions": {
|
|
33
|
+
"bds": {
|
|
34
|
+
"css": "prim-light-amber-800"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"line": {
|
|
39
|
+
"$value": "#d5deea",
|
|
40
|
+
"$extensions": {
|
|
41
|
+
"bds": {
|
|
42
|
+
"css": "prim-light-line"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"line-strong": {
|
|
47
|
+
"$value": "#72859f",
|
|
48
|
+
"$extensions": {
|
|
49
|
+
"bds": {
|
|
50
|
+
"css": "prim-light-line-strong"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"mix-amber-line": {
|
|
55
|
+
"$value": "#c19a6b",
|
|
56
|
+
"$extensions": {
|
|
57
|
+
"bds": {
|
|
58
|
+
"css": "prim-light-mix-amber-line"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"alpha": {
|
|
63
|
+
"blue-700-3": {
|
|
64
|
+
"$value": "#08467f08",
|
|
65
|
+
"$extensions": {
|
|
66
|
+
"bds": {
|
|
67
|
+
"css": "prim-light-alpha-blue-700-3"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"blue-700-6": {
|
|
72
|
+
"$value": "#08467f0f",
|
|
73
|
+
"$extensions": {
|
|
74
|
+
"bds": {
|
|
75
|
+
"css": "prim-light-alpha-blue-700-6"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"blue-700-8": {
|
|
80
|
+
"$value": "#08467f14",
|
|
81
|
+
"$extensions": {
|
|
82
|
+
"bds": {
|
|
83
|
+
"css": "prim-light-alpha-blue-700-8"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"blue-700-10": {
|
|
88
|
+
"$value": "#08467f1a",
|
|
89
|
+
"$extensions": {
|
|
90
|
+
"bds": {
|
|
91
|
+
"css": "prim-light-alpha-blue-700-10"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"blue-700-12": {
|
|
96
|
+
"$value": "#08467f1f",
|
|
97
|
+
"$extensions": {
|
|
98
|
+
"bds": {
|
|
99
|
+
"css": "prim-light-alpha-blue-700-12"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"blue-700-18": {
|
|
104
|
+
"$value": "#08467f2e",
|
|
105
|
+
"$extensions": {
|
|
106
|
+
"bds": {
|
|
107
|
+
"css": "prim-light-alpha-blue-700-18"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"blue-700-40": {
|
|
112
|
+
"$value": "#08467f66",
|
|
113
|
+
"$extensions": {
|
|
114
|
+
"bds": {
|
|
115
|
+
"css": "prim-light-alpha-blue-700-40"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"navy-850-15": {
|
|
120
|
+
"$value": "#0d182926",
|
|
121
|
+
"$extensions": {
|
|
122
|
+
"bds": {
|
|
123
|
+
"css": "prim-light-alpha-navy-850-15"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"paper-88": {
|
|
128
|
+
"$value": "#f5f8fce0",
|
|
129
|
+
"$extensions": {
|
|
130
|
+
"bds": {
|
|
131
|
+
"css": "prim-light-alpha-paper-88"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|