Skip to content

Commit 29c9655

Browse files
bogdaniculaervanoordCopilotCopilotjasverix
authored
Foundations docs (#362)
* docs: colors — rewrite foundations page with visual ramps and copy support * config: storybook — add tippy, minimal decorator, doc stories support * docs: colors — rewrite with Vue stories and Tailwind tokens * config: tippy — tailwind copy, smart display, font fix * docs: border — Atlassian-style rewrite with real components * docs: radius — Atlassian-style rewrite, remove Palette * docs: cleanup — shared helpers, link color, font consistency * docs: elevation — add page with real token usage * docs: cleanup — inline token styling, remove dead helpers * docs: typography — add page with scale and examples * docs: fix mockup specs, replace inline hex with tokens * config: spacing indicators — purple stripes, danger variant * docs: spacing — add page with ruler, examples, guidelines * docs: cleanup — shared helpers, purple preview color * config: copyable code block styles * docs: icons — add page with sizing, color, guidelines * config: remove custom code block styles, fix Do/Don't card height * docs: icons — use Storybook built-in code blocks * docs: logos — add page with downloads and guidelines * docs: visual identity — add page with brand rules and profile colors * docs: foundations overview — card grid with accent colors * docs: token reference — complete semantic token catalog with visual previews * docs: token reference — larger shadow preview boxes * refactor: docs cleanup — rename files, fix aliases, extract shared constants * fix: doc links — use Storybook channel for iframe navigation * config: enable docs TOC, auto-generate heading IDs, restore Unstyled * fix: add hover state to all doc text links * docs: colors — make Do/Don't color role example more obvious * docs: spacing — add code usage section and single-value copy tooltip * docs: spacing — reorder sections, rename usage headings * docs: foundations — fix links, add code usage and intros * Update component-library/docs/foundations/Elevation.stories.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update component-library/docs/foundations/Elevation.mdx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update component-library/docs/foundations/Elevation.mdx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update component-library/docs/foundations/Spacing.stories.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: address review comments — guard duplicate listener, fix overflow typo, add missing tokens Agent-Logs-Url: https://github.com/bcc-code/bcc-design/sessions/0eb3e78a-503c-4638-9d3a-e0a42ecfaeae Co-authored-by: rvanoord <1876625+rvanoord@users.noreply.github.com> * fix: remove accidentally committed package-lock.json Agent-Logs-Url: https://github.com/bcc-code/bcc-design/sessions/0eb3e78a-503c-4638-9d3a-e0a42ecfaeae Co-authored-by: rvanoord <1876625+rvanoord@users.noreply.github.com> * refactor: make .default optional in token display names, add data-css override support Agent-Logs-Url: https://github.com/bcc-code/bcc-design/sessions/0eb3e78a-503c-4638-9d3a-e0a42ecfaeae Co-authored-by: rvanoord <1876625+rvanoord@users.noreply.github.com> * revert: restore .default in token display names for consistency Agent-Logs-Url: https://github.com/bcc-code/bcc-design/sessions/878d482f-0b8a-41ed-81a4-21c99b23b9b9 Co-authored-by: rvanoord <1876625+rvanoord@users.noreply.github.com> * fix: address review — data-css override, clipboard .catch(), Element guards Agent-Logs-Url: https://github.com/bcc-code/bcc-design/sessions/feb73c92-dd47-4333-903a-62e35eb5cf4c Co-authored-by: rvanoord <1876625+rvanoord@users.noreply.github.com> * test: add Playwright e2e smoke tests for foundations docs Agent-Logs-Url: https://github.com/bcc-code/bcc-design/sessions/feb73c92-dd47-4333-903a-62e35eb5cf4c Co-authored-by: rvanoord <1876625+rvanoord@users.noreply.github.com> * Update storybook * fix: token reference — correct 23 wrong hex values and primitive labels * fix: exclude e2e tests from vitest, use forEach in playwright * read tokens from CSS (#363) * read tokens from CSS * fix: make dark block extraction accept .dark and [data-theme=dark] in any order or individually Agent-Logs-Url: https://github.com/bcc-code/bcc-design/sessions/47950389-7c6b-4863-9f57-68a8f87033fe Co-authored-by: jasverix <22839684+jasverix@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jasverix <22839684+jasverix@users.noreply.github.com> --------- Co-authored-by: Reng van Oord <rvanoord@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rvanoord <1876625+rvanoord@users.noreply.github.com> Co-authored-by: Jan-Sverre Riksfjord <jan.sverre.riksfjord@bcc.no> Co-authored-by: jasverix <22839684+jasverix@users.noreply.github.com>
1 parent 73efa0b commit 29c9655

116 files changed

Lines changed: 5253 additions & 1263 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

component-library/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ coverage
2626
*.local
2727
storybook-static
2828

29+
# Playwright
30+
test-results/
31+
playwright-report/
32+
2933
/cypress/videos/
3034
/cypress/screenshots/
3135

component-library/.storybook/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { StorybookConfig } from '@storybook/vue3-vite';
22
import remarkGfm from 'remark-gfm';
33

44
const config: StorybookConfig = {
5-
stories: ['../docs/**/*.mdx', '../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5+
stories: ['../docs/**/*.mdx', '../docs/**/*.stories.@(js|jsx|mjs|ts|tsx)', '../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
66
addons: [
77
{
88
name: '@storybook/addon-docs',
@@ -15,6 +15,7 @@ const config: StorybookConfig = {
1515
},
1616
},
1717
],
18+
staticDirs: ['../docs/assets'],
1819
framework: {
1920
name: '@storybook/vue3-vite',
2021
options: {},

component-library/.storybook/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addons } from '@storybook/manager-api';
1+
import { addons } from 'storybook/manager-api';
22

33
import theme from './theme';
44

Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
<link rel="stylesheet" href="https://design.bcc.no/fonts/stylesheet.css">
2+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,500,1,0" />
3+
<style>
4+
body, .sbdocs-content, .docs-story {
5+
font-family: 'Archivo', sans-serif !important;
6+
}
7+
8+
/* Reset Storybook's 14px font-size override on docs content */
9+
.sbdocs.sbdocs-content :where(p:not(.sb-anchor, .sb-unstyled, .sb-unstyled p)),
10+
.sbdocs.sbdocs-content :where(li:not(.sb-anchor, .sb-unstyled, .sb-unstyled li)) {
11+
font-size: 1em;
12+
line-height: 1.5;
13+
}
14+
.sbdocs.sbdocs-content :where(p:not(.sb-anchor, .sb-unstyled, .sb-unstyled p)) code,
15+
.sbdocs.sbdocs-content :where(li:not(.sb-anchor, .sb-unstyled, .sb-unstyled li)) code {
16+
font-size: 1em;
17+
}
18+
19+
20+
/* Lightbox */
21+
.lightbox-overlay {
22+
display: none;
23+
position: fixed;
24+
inset: 0;
25+
z-index: 9999;
26+
background: var(--color-blanket-default);
27+
align-items: center;
28+
justify-content: center;
29+
cursor: zoom-out;
30+
}
31+
.lightbox-overlay.active {
32+
display: flex;
33+
}
34+
.lightbox-overlay img {
35+
max-width: 90vw;
36+
max-height: 90vh;
37+
border-radius: 8px;
38+
box-shadow: var(--shadow-overlay);
39+
}
40+
.lightbox-trigger {
41+
cursor: zoom-in;
42+
}
43+
44+
/* Spacing indicator — striped overlay to visualize spacing in docs */
45+
.spacing-indicator {
46+
background: repeating-linear-gradient(
47+
-45deg,
48+
rgba(154, 130, 218, 0.18),
49+
rgba(154, 130, 218, 0.18) 2px,
50+
rgba(154, 130, 218, 0.06) 2px,
51+
rgba(154, 130, 218, 0.06) 6px
52+
);
53+
border: 1px solid rgba(154, 130, 218, 0.35);
54+
border-radius: 2px;
55+
position: relative;
56+
display: flex;
57+
align-items: center;
58+
justify-content: center;
59+
}
60+
.spacing-indicator .spacing-px {
61+
font-size: 10px;
62+
font-weight: 600;
63+
color: #8360c3;
64+
white-space: nowrap;
65+
}
66+
.spacing-indicator .spacing-label {
67+
position: absolute;
68+
right: 0;
69+
top: 50%;
70+
transform: translate(calc(100% + 24px), -50%);
71+
font-size: 10px;
72+
font-weight: 600;
73+
color: #8360c3;
74+
white-space: nowrap;
75+
background: #fff;
76+
border: 1px solid rgba(154, 130, 218, 0.35);
77+
border-radius: 999px;
78+
padding: 2px 8px;
79+
}
80+
.spacing-indicator .spacing-label::before {
81+
content: '';
82+
position: absolute;
83+
right: 100%;
84+
top: 50%;
85+
transform: translateY(-50%);
86+
width: 24px;
87+
height: 1px;
88+
background: #292a2e;
89+
}
90+
/* Danger variant for Don't examples */
91+
.spacing-indicator-danger {
92+
background: repeating-linear-gradient(
93+
-45deg,
94+
rgba(202, 65, 78, 0.18),
95+
rgba(202, 65, 78, 0.18) 2px,
96+
rgba(202, 65, 78, 0.06) 2px,
97+
rgba(202, 65, 78, 0.06) 6px
98+
);
99+
border-color: rgba(202, 65, 78, 0.35);
100+
}
101+
.spacing-indicator-danger .spacing-px { color: #ca414e; }
102+
.spacing-indicator-danger .spacing-label {
103+
color: #ca414e;
104+
border-color: rgba(202, 65, 78, 0.35);
105+
}
106+
107+
.spacing-indicator .spacing-label-bottom {
108+
position: absolute;
109+
bottom: -24px;
110+
left: 50%;
111+
transform: translateX(-50%) translateY(100%);
112+
font-size: 10px;
113+
font-weight: 600;
114+
color: #8360c3;
115+
white-space: nowrap;
116+
background: #fff;
117+
border: 1px solid rgba(154, 130, 218, 0.35);
118+
border-radius: 999px;
119+
padding: 2px 8px;
120+
}
121+
.spacing-indicator .spacing-label-bottom::before {
122+
content: '';
123+
position: absolute;
124+
bottom: 100%;
125+
left: 50%;
126+
transform: translateX(-50%);
127+
width: 1px;
128+
height: 24px;
129+
background: #292a2e;
130+
}
131+
132+
/* Copy toast */
133+
.copy-toast {
134+
position: fixed;
135+
bottom: 24px;
136+
left: 50%;
137+
transform: translateX(-50%);
138+
background: #1e1f21;
139+
color: #fff;
140+
font-size: 13px;
141+
font-family: 'Archivo', monospace;
142+
padding: 8px 16px;
143+
border-radius: 8px;
144+
z-index: 10000;
145+
opacity: 0;
146+
pointer-events: none;
147+
transition: opacity 0.15s;
148+
}
149+
.copy-toast.show {
150+
opacity: 1;
151+
}
152+
153+
/* Clickable color swatches */
154+
.color-swatch {
155+
cursor: pointer;
156+
}
157+
.color-swatch[data-hex] {
158+
transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), outline 0.25s cubic-bezier(0.2, 0, 0, 1);
159+
}
160+
.color-swatch[data-hex]:hover {
161+
outline: 1.5px solid rgba(0, 0, 0, 0.2);
162+
outline-offset: -1.5px;
163+
transform: scale(1.05);
164+
z-index: 1;
165+
position: relative;
166+
}
167+
.color-swatch-no-hover[data-hex] {
168+
transition: none;
169+
}
170+
.color-swatch-no-hover[data-hex]:hover {
171+
outline: none;
172+
transform: none;
173+
}
174+
175+
/* Tippy popover theme */
176+
.tippy-box[data-theme~='color-copy'] {
177+
background: #ffffff;
178+
border: 1px solid #dddee1;
179+
border-radius: 10px;
180+
box-shadow: 0 4px 16px rgba(0,0,0,0.12);
181+
padding: 4px;
182+
}
183+
.tippy-box[data-theme~='color-copy'] .tippy-arrow {
184+
color: #ffffff;
185+
}
186+
.tippy-box[data-theme~='color-copy'] .tippy-arrow::before {
187+
border-bottom-color: #dddee1;
188+
top: -1px;
189+
}
190+
.color-copy-row {
191+
display: flex;
192+
align-items: center;
193+
gap: 12px;
194+
padding: 8px 12px;
195+
font-family: 'Archivo', sans-serif;
196+
}
197+
.color-copy-row + .color-copy-row {
198+
border-top: 1px solid #eee;
199+
margin-top: 2px;
200+
padding-top: 10px;
201+
}
202+
.color-copy-label {
203+
font-size: 12px;
204+
color: #6b6e76;
205+
font-weight: 500;
206+
flex-shrink: 0;
207+
width: 52px;
208+
}
209+
.color-copy-btn {
210+
display: inline-flex;
211+
border: none;
212+
background: none;
213+
border-radius: 4px;
214+
cursor: pointer;
215+
padding: 4px 8px;
216+
margin: -4px -8px;
217+
font-family: monospace;
218+
font-size: 12px;
219+
color: #292a2e;
220+
}
221+
.color-copy-btn:hover {
222+
background: #f0f1f2;
223+
}
224+
.color-copy-icon {
225+
font-family: 'Material Symbols Outlined';
226+
font-size: 14px;
227+
opacity: 0;
228+
margin-left: 4px;
229+
transition: opacity 0.15s;
230+
}
231+
.color-copy-btn:hover .color-copy-icon {
232+
opacity: 0.5;
233+
}
234+
235+
</style>
236+
<script>
237+
function openLightbox(src) {
238+
var el = document.getElementById('docs-lightbox');
239+
if (!el) {
240+
el = document.createElement('div');
241+
el.id = 'docs-lightbox';
242+
el.className = 'lightbox-overlay';
243+
el.innerHTML = '<img />';
244+
el.addEventListener('click', function() { el.classList.remove('active'); });
245+
document.body.appendChild(el);
246+
}
247+
el.querySelector('img').src = src;
248+
el.classList.add('active');
249+
}
250+
document.addEventListener('keydown', function(e) {
251+
if (e.key === 'Escape') {
252+
var el = document.getElementById('docs-lightbox');
253+
if (el) el.classList.remove('active');
254+
}
255+
});
256+
257+
// Auto-generate IDs for JSX headings (needed for TOC in custom MDX pages)
258+
document.addEventListener('DOMContentLoaded', function() {
259+
new MutationObserver(function() {
260+
document.querySelectorAll('h1:not([id]), h2:not([id]), h3:not([id])').forEach(function(h) {
261+
h.id = h.textContent.trim().toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '');
262+
});
263+
}).observe(document.body, { childList: true, subtree: true });
264+
});
265+
266+
// Intercept internal doc links and navigate via Storybook channel
267+
document.addEventListener('click', function(e) {
268+
var target = e.target;
269+
if (!(target instanceof Element)) return;
270+
var link = target.closest('a[href*="path=/docs/"]');
271+
if (!link) return;
272+
e.preventDefault();
273+
var match = link.getAttribute('href').match(/path=\/docs\/(.+?)--docs/);
274+
if (match && window.__STORYBOOK_ADDONS_CHANNEL__) {
275+
window.__STORYBOOK_ADDONS_CHANNEL__.emit('setCurrentStory', { storyId: match[1] + '--docs' });
276+
}
277+
});
278+
</script>

0 commit comments

Comments
 (0)