@repobit/dex-system-design 0.25.12 → 1.0.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 +204 -0
- package/README.md +131 -8
- package/package.json +96 -13
- package/schemas/component-manifest.json +3294 -405
- package/schemas/manifest-omissions.json +173 -0
- package/src/blog/src/breakpoints.js +6 -6
- package/src/blog/src/content/blog-atoms-showcase.js +1 -1
- package/src/blog/src/content/blog-page-layout.js +2 -2
- package/src/blog/src/lib/article-toc.js +7 -7
- package/src/blog/src/shell/blog-shell.js +1 -1
- package/src/blog/src/tokens/blog.js +2 -2
- package/src/blog/src/tokens/core.js +34 -35
- package/src/blog/src/tokens/legacy.js +0 -9
- package/src/blog/tokens/blog.js +2 -2
- package/src/blog/tokens/core.js +34 -35
- package/src/blog/tokens/legacy.js +0 -9
- package/src/blog/tokens.css +36 -46
- package/src/components/accordion/accordion-bg.css.js +83 -59
- package/src/components/accordion/accordion-bg.js +29 -10
- package/src/components/accordion/accordion-bg.stories.js +67 -67
- package/src/components/accordion/accordion-keyboard.js +80 -0
- package/src/components/accordion/accordion.css.js +142 -80
- package/src/components/accordion/accordion.js +37 -10
- package/src/components/accordion/accordion.stories.js +7 -7
- package/src/components/agent-endpoints/agent-endpoints.css.js +36 -39
- package/src/components/agent-endpoints/agent-endpoints.js +30 -20
- package/src/components/agent-endpoints/agent-endpoints.stories.js +1 -1
- package/src/components/ai-guardian-demo.stories.js +91 -91
- package/src/components/alert/alert.css.js +198 -0
- package/src/components/alert/alert.js +103 -0
- package/src/components/alert/alert.stories.js +206 -0
- package/src/components/anchor/anchor-nav.css.js +213 -101
- package/src/components/anchor/anchor-nav.js +26 -40
- package/src/components/anchor/anchor.stories.js +22 -12
- package/src/components/annotation/annotation.css.js +58 -0
- package/src/components/annotation/annotation.js +67 -0
- package/src/components/annotation/annotation.stories.js +63 -0
- package/src/components/architecture.stories.js +285 -0
- package/src/components/atoms.stories.js +342 -0
- package/src/components/avatar/avatar.css.js +67 -0
- package/src/components/avatar/avatar.js +42 -0
- package/src/components/avatar/avatar.stories.js +95 -0
- package/src/components/awards/awards-flex.css.js +209 -23
- package/src/components/awards/awards-flex.js +66 -7
- package/src/components/awards/awards-flex.stories.js +1 -1
- package/src/components/awards/{awards-light.stories.js → awards-summary.stories.js} +54 -64
- package/src/components/awards/awards.css.js +116 -58
- package/src/components/awards/awards.js +102 -28
- package/src/components/awards/awards.stories.js +1 -1
- package/src/components/back/back.css.js +51 -22
- package/src/components/back/back.js +28 -7
- package/src/components/back/back.stories.js +9 -3
- package/src/components/badge/badge.css.js +158 -46
- package/src/components/badge/badge.js +62 -74
- package/src/components/badge/badge.stories.js +176 -248
- package/src/components/bento-grid/bento-grid.css.js +21 -16
- package/src/components/bento-grid/bento-grid.js +16 -4
- package/src/components/bento-grid/bento-grid.stories.js +19 -18
- package/src/components/bento-grid/bento-item.css.js +52 -28
- package/src/components/bento-grid/bento-item.js +2 -2
- package/src/components/blockquote/blockquote.css.js +47 -0
- package/src/components/blockquote/blockquote.js +29 -0
- package/src/components/blockquote/blockquote.stories.js +62 -0
- package/src/components/breadcrumb/breadcrumb.css.js +92 -22
- package/src/components/breadcrumb/breadcrumb.js +56 -11
- package/src/components/button/button.css.js +531 -161
- package/src/components/button/button.js +206 -214
- package/src/components/button/button.stories.js +322 -174
- package/src/components/caption/caption.css.js +21 -0
- package/src/components/caption/caption.js +31 -0
- package/src/components/caption/caption.stories.js +62 -0
- package/src/components/card-features/card-features.css.js +14 -22
- package/src/components/card-features/card-features.js +68 -9
- package/src/components/card-features/card-features.stories.js +11 -11
- package/src/components/cards/card.css.js +60 -81
- package/src/components/cards/card.js +56 -25
- package/src/components/cards/card.stories.js +39 -39
- package/src/components/carousel/carousel.css.js +93 -99
- package/src/components/carousel/carousel.js +32 -4
- package/src/components/checkbox/checkbox.css.js +111 -93
- package/src/components/checkbox/checkbox.js +64 -90
- package/src/components/checkbox/checkbox.stories.js +96 -29
- package/src/components/code/code.css.js +70 -0
- package/src/components/code/code.js +40 -0
- package/src/components/code/code.stories.js +73 -0
- package/src/components/compare/compare.css.js +179 -43
- package/src/components/compare/compare.js +52 -25
- package/src/components/compare/compare.stories.js +61 -4
- package/src/components/comparison-panel/comparison-panel.css.js +38 -51
- package/src/components/comparison-panel/comparison-panel.js +5 -4
- package/src/components/comparison-panel/comparison-panel.stories.js +1 -1
- package/src/components/compatibility-table/compatibility-table.css.js +180 -80
- package/src/components/compatibility-table/compatibility-table.js +37 -9
- package/src/components/control-alignment.stories.js +393 -0
- package/src/components/cta-banner/cta-banner.css.js +41 -13
- package/src/components/cta-banner/cta-banner.js +6 -5
- package/src/components/cta-banner/cta-banner.stories.js +43 -98
- package/src/components/display/display.css.js +25 -1
- package/src/components/display/display.js +46 -13
- package/src/components/display/display.stories.js +270 -40
- package/src/components/divider/divider-horizontal.js +21 -5
- package/src/components/divider/divider-vertical.js +15 -7
- package/src/components/divider/divider.css.js +2 -2
- package/src/components/divider/divider.stories.js +38 -34
- package/src/components/dropdown/dropdown.css.js +93 -126
- package/src/components/dropdown/dropdown.js +114 -34
- package/src/components/dropdown/dropdown.stories.js +56 -24
- package/src/components/features/features.css.js +24 -11
- package/src/components/features/features.js +7 -3
- package/src/components/features/features.stories.js +37 -37
- package/src/components/features-tab/features-tab.css.js +19 -8
- package/src/components/features-tab/features-tab.js +6 -5
- package/src/components/features-tab/features-tab.stories.js +23 -23
- package/src/components/fieldset/fieldset.css.js +30 -0
- package/src/components/fieldset/fieldset.js +28 -0
- package/src/components/fieldset/fieldset.stories.js +84 -0
- package/src/components/footer/footer-links-group.css.js +10 -14
- package/src/components/footer/footer-links-group.js +4 -3
- package/src/components/footer/footer-lp.css.js +59 -30
- package/src/components/footer/footer-lp.js +17 -12
- package/src/components/footer/footer-lp.stories.js +63 -75
- package/src/components/footer/footer-nav-menu.css.js +26 -4
- package/src/components/footer/footer-nav-menu.js +3 -2
- package/src/components/footer/footer.css.js +146 -264
- package/src/components/footer/footer.js +176 -106
- package/src/components/footer/footer.stories.js +9 -9
- package/src/components/footer/localeMap.js +1 -1
- package/src/components/grid/grid.css.js +1 -1
- package/src/components/grid/grid.js +49 -7
- package/src/components/grid/grid.stories.js +111 -0
- package/src/components/header/header-code.css.js +61 -51
- package/src/components/header/header-code.js +28 -14
- package/src/components/header/header-code.stories.js +5 -5
- package/src/components/header/header.css.js +655 -176
- package/src/components/header/header.js +269 -36
- package/src/components/header/header.stories.js +841 -18
- package/src/components/heading/heading.css.js +14 -17
- package/src/components/heading/heading.js +48 -33
- package/src/components/heading/heading.stories.js +27 -25
- package/src/components/help-text/help-text.css.js +21 -0
- package/src/components/help-text/help-text.js +25 -0
- package/src/components/help-text/help-text.stories.js +66 -0
- package/src/components/highlight/highlight.css.js +86 -64
- package/src/components/highlight/highlight.js +18 -27
- package/src/components/highlight/highlight.stories.js +14 -3
- package/src/components/icons/analysis-icon.js +6 -16
- package/src/components/icons/arrow-down-icon.js +6 -19
- package/src/components/icons/arrow-icon.js +44 -0
- package/src/components/icons/arrow-right-icon.js +30 -23
- package/src/components/icons/arrow-up-icon.js +19 -18
- package/src/components/icons/bd-ai-icon.js +1 -1
- package/src/components/icons/brand-marks.stories.js +279 -0
- package/src/components/icons/brand-signature-icon.js +42 -0
- package/src/components/icons/check-icon.js +27 -0
- package/src/components/icons/circle-info-icon.js +33 -0
- package/src/components/icons/close-icon.js +6 -18
- package/src/components/icons/family-icon.js +8 -20
- package/src/components/icons/globe-icon.js +6 -18
- package/src/components/icons/guide-icon.js +6 -18
- package/src/components/icons/icon-element.js +99 -0
- package/src/components/icons/icons.js +36 -0
- package/src/components/icons/icons.stories.js +184 -52
- package/src/components/icons/individual-icon.js +6 -18
- package/src/components/icons/laurel-icon.js +9 -19
- package/src/components/icons/machine-learning-icon.js +6 -17
- package/src/components/icons/marks.js +41 -0
- package/src/components/icons/minus-icon.js +7 -21
- package/src/components/icons/missing-icon.js +52 -0
- package/src/components/icons/plus-icon.js +7 -21
- package/src/components/icons/quote-icon.js +19 -19
- package/src/components/image/image.css.js +72 -25
- package/src/components/image/image.js +11 -6
- package/src/components/image/image.stories.js +2 -2
- package/src/components/input/custom-form.stories.js +214 -62
- package/src/components/input/input-clipboard.css.js +51 -144
- package/src/components/input/input-clipboard.js +31 -15
- package/src/components/input/input.css.js +8 -146
- package/src/components/input/input.js +93 -38
- package/src/components/install-options/install-options.css.js +84 -77
- package/src/components/install-options/install-options.js +33 -30
- package/src/components/install-options/install-options.stories.js +3 -3
- package/src/components/label/label.css.js +35 -0
- package/src/components/label/label.js +38 -0
- package/src/components/label/label.stories.js +82 -0
- package/src/components/light-carousel/light-carousel.css.js +111 -63
- package/src/components/light-carousel/light-carousel.js +85 -11
- package/src/components/light-carousel/light-carousel.stories.js +126 -82
- package/src/components/link/link.css.js +150 -99
- package/src/components/link/link.js +86 -11
- package/src/components/link/link.stories.js +124 -30
- package/src/components/list/list-item/list-item.css.js +74 -22
- package/src/components/list/list-item/list-item.js +32 -10
- package/src/components/list/list-item/list-item.stories.js +23 -23
- package/src/components/list/list.css.js +8 -2
- package/src/components/list/list.js +3 -2
- package/src/components/list/list.stories.js +222 -0
- package/src/components/modal/modal.css.js +114 -24
- package/src/components/modal/modal.js +83 -7
- package/src/components/modal/modal.stories.js +9 -9
- package/src/components/overview/overview.css.js +19 -14
- package/src/components/overview/overview.js +6 -5
- package/src/components/overview/overview.stories.js +10 -10
- package/src/components/page-switcher/page-switcher.css.js +97 -40
- package/src/components/page-switcher/page-switcher.js +28 -5
- package/src/components/page-switcher/page-switcher.stories.js +95 -0
- package/src/components/paragraph/paragraph.css.js +15 -10
- package/src/components/paragraph/paragraph.js +41 -44
- package/src/components/paragraph/paragraph.stories.js +56 -21
- package/src/components/picture/picture.css.js +103 -44
- package/src/components/picture/picture.js +100 -30
- package/src/components/picture/picture.stories.js +1 -1
- package/src/components/pricing-cards/new-pricing-card.js +3 -3
- package/src/components/pricing-cards/new-pricing.css.js +24 -15
- package/src/components/pricing-cards/pricing-card-actions.css.js +1 -1
- package/src/components/pricing-cards/pricing-card-actions.js +3 -4
- package/src/components/pricing-cards/pricing-card-container.css.js +3 -3
- package/src/components/pricing-cards/pricing-card-container.js +3 -2
- package/src/components/pricing-cards/pricing-card-header.css.js +10 -8
- package/src/components/pricing-cards/pricing-card-header.js +6 -7
- package/src/components/pricing-cards/pricing-card-pricing.css.js +16 -9
- package/src/components/pricing-cards/pricing-card-pricing.js +8 -6
- package/src/components/pricing-cards/pricing-card-show-more.css.js +11 -3
- package/src/components/pricing-cards/pricing-card-show-more.js +8 -3
- package/src/components/pricing-cards/pricing-card.css.js +244 -190
- package/src/components/pricing-cards/pricing-card.js +54 -70
- package/src/components/pricing-cards/pricing-feature-item.css.js +25 -8
- package/src/components/pricing-cards/pricing-feature-item.js +8 -3
- package/src/components/process-steps/process-steps.css.js +26 -14
- package/src/components/process-steps/process-steps.js +23 -6
- package/src/components/process-steps/process-steps.stories.js +1 -1
- package/src/components/progress/progress.css.js +80 -0
- package/src/components/progress/progress.js +42 -0
- package/src/components/progress/progress.stories.js +79 -0
- package/src/components/quick-answer/quick-answer.css.js +75 -13
- package/src/components/quick-answer/quick-answer.js +8 -3
- package/src/components/radio/radio.css.js +92 -128
- package/src/components/radio/radio.js +106 -127
- package/src/components/radio/radio.stories.js +54 -19
- package/src/components/review/review-grid.css.js +5 -6
- package/src/components/review/review-grid.js +14 -11
- package/src/components/review/review.css.js +11 -6
- package/src/components/review/review.js +3 -8
- package/src/components/shared/ensemble.css.js +93 -0
- package/src/components/shared/form-field.css.js +206 -0
- package/src/components/shared/prop-vocabulary.js +48 -0
- package/src/components/shared/token-scales.js +306 -0
- package/src/components/skeleton/skeleton.css.js +34 -0
- package/src/components/skeleton/skeleton.js +32 -0
- package/src/components/skeleton/skeleton.stories.js +70 -0
- package/src/components/spinner/spinner.css.js +62 -0
- package/src/components/spinner/spinner.js +38 -0
- package/src/components/spinner/spinner.stories.js +92 -0
- package/src/components/spotlight-section/spotlight-section.css.js +14 -13
- package/src/components/spotlight-section/spotlight-section.js +42 -39
- package/src/components/switch/switch.css.js +103 -0
- package/src/components/switch/switch.js +44 -0
- package/src/components/switch/switch.stories.js +86 -0
- package/src/components/tab-list/content-switcher.stories.js +189 -0
- package/src/components/tab-list/tab-list.css.js +250 -0
- package/src/components/tab-list/tab-list.js +184 -0
- package/src/components/tab-list/tab-list.stories.js +221 -0
- package/src/components/tabs/tabs.css.js +14 -123
- package/src/components/tabs/tabs.js +16 -19
- package/src/components/tabs/tabs.stories.js +95 -95
- package/src/components/tag/tag.css.js +54 -0
- package/src/components/tag/tag.js +32 -0
- package/src/components/tag/tag.stories.js +126 -0
- package/src/components/terminal/terminal-message.css.js +164 -60
- package/src/components/terminal/terminal-message.js +5 -5
- package/src/components/terminal/terminal-message.stories.js +70 -1
- package/src/components/termsOfUse/terms.css.js +25 -20
- package/src/components/termsOfUse/terms.js +13 -9
- package/src/components/termsOfUse/terms.stories.js +1 -1
- package/src/components/textarea/textarea.css.js +51 -0
- package/src/components/textarea/textarea.js +136 -0
- package/src/components/textarea/textarea.stories.js +191 -0
- package/src/components/tooltip/tooltip.css.js +75 -0
- package/src/components/tooltip/tooltip.js +156 -0
- package/src/components/tooltip/tooltip.stories.js +161 -0
- package/src/components/trust-panel/trust-panel.css.js +85 -33
- package/src/components/trust-panel/trust-panel.js +18 -10
- package/src/components/trust-panel/trust-panel.stories.js +1 -1
- package/src/components/ultimate-security-demo.stories.js +431 -0
- package/src/components/video/video.css.js +17 -0
- package/src/components/video/video.js +40 -0
- package/src/components/video/video.stories.js +106 -0
- package/src/components/video-player/video-player.css.js +67 -11
- package/src/components/video-player/video-player.js +35 -4
- package/src/components/video-player/video-player.stories.js +1 -1
- package/src/components/visual-alignment.stories.js +411 -0
- package/src/components/visually-hidden/visually-hidden.css.js +24 -0
- package/src/components/visually-hidden/visually-hidden.js +16 -0
- package/src/components/visually-hidden/visually-hidden.stories.js +56 -0
- package/src/stories/Button.stories.js +17 -17
- package/src/stories/Header.stories.js +10 -10
- package/src/stories/Page.js +1 -1
- package/src/stories/Page.stories.js +6 -6
- package/src/tokens/borders.stories.js +339 -0
- package/src/tokens/color-responsibilities.stories.js +227 -0
- package/src/tokens/dark-derivation.js +309 -0
- package/src/tokens/dark-findings.js +197 -0
- package/src/tokens/dark-mode.stories.js +207 -0
- package/src/tokens/dimension.stories.js +251 -0
- package/src/tokens/elevation.stories.js +143 -0
- package/src/tokens/focus.stories.js +276 -0
- package/src/tokens/fonts.css +20 -20
- package/src/tokens/fonts.stories.js +354 -374
- package/src/tokens/layout.css +25 -11
- package/src/tokens/motion.stories.js +231 -0
- package/src/tokens/shape.stories.js +272 -0
- package/src/tokens/spacing-rhythm.stories.js +359 -0
- package/src/tokens/spacing.stories.js +208 -703
- package/src/tokens/story-chrome.js +503 -0
- package/src/tokens/surfaces.stories.js +224 -0
- package/src/tokens/text-on-surface.stories.js +164 -0
- package/src/tokens/token-map.js +220 -0
- package/src/tokens/token-map.stories.js +257 -0
- package/src/tokens/token-purposes.js +266 -0
- package/src/tokens/tokens-grid.stories.js +388 -900
- package/src/tokens/tokens.css +1633 -1045
- package/src/tokens/tokens.js +1130 -492
- package/src/tokens/tokens.stories.js +137 -47
- package/src/tokens/type-ceiling-words.js +299 -0
- package/src/tokens/typography.stories.js +1003 -965
- package/src/tokens/vertical-rhythm.stories.js +224 -0
- package/src/components/awards/awards-icon.js +0 -56
- package/src/components/awards/awards-light.js +0 -240
- package/src/components/banner/banner.js +0 -60
- package/src/components/banner/banner.stories.js +0 -51
- package/src/components/button/icons.js +0 -24
- package/src/components/input/index.js +0 -0
- package/src/components/light-carousel/light-carousel-simple.css.js +0 -183
- package/src/components/light-carousel/light-carousel-simple.js +0 -74
- package/src/tokens/colors.js +0 -121
- package/src/tokens/typography.css.js +0 -207
- package/src/tokens/typography.js +0 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { docsPage, refSection } from './story-chrome.js';
|
|
3
|
+
/* The registry itself, not a copy of it — the same rule the typography pages
|
|
4
|
+
follow. A table transcribed by hand drifts from the thing it documents the
|
|
5
|
+
first time either one changes. */
|
|
6
|
+
import sizeSites from '../../scripts/spacing-as-size.json';
|
|
7
|
+
|
|
8
|
+
import '../components/cards/card.js';
|
|
9
|
+
import '../components/heading/heading.js';
|
|
10
|
+
import '../components/paragraph/paragraph.js';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: 'Foundations/Spacing/Rhythm',
|
|
14
|
+
tags : ['autodocs']
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/* ------------------------------------------------------------------ chrome - */
|
|
18
|
+
|
|
19
|
+
/* A relationship, shown rather than described: two real elements with the token
|
|
20
|
+
between them, and the measurement beside it. The samples are built from the
|
|
21
|
+
tokens, so a token change moves the sample with it. */
|
|
22
|
+
const relationship = ({ name, kind, token, measured, responsibility, exceptions, avoid, sample }) => html`
|
|
23
|
+
<div style="padding:var(--spacing-24) 0;border-top:var(--border-width-1) solid var(--color-border-subtle)">
|
|
24
|
+
<p style="margin:0 0 var(--spacing-8);font-family:var(--typography-fontFamily-mono);font-size:var(--typography-fontSize-xs);color:var(--color-text-muted)">
|
|
25
|
+
<b style="color:var(--color-text-primary)">${name}</b>
|
|
26
|
+
· ${kind}
|
|
27
|
+
· <code>${token}</code>
|
|
28
|
+
· measured ${measured}
|
|
29
|
+
</p>
|
|
30
|
+
<p style="margin:0 0 var(--spacing-16);color:var(--color-text-secondary);max-width:70ch">
|
|
31
|
+
${responsibility}
|
|
32
|
+
</p>
|
|
33
|
+
<div style="background:var(--color-surface-muted);padding:var(--spacing-24);border-radius:var(--radius-lg);margin-bottom:var(--spacing-16)">
|
|
34
|
+
${sample}
|
|
35
|
+
</div>
|
|
36
|
+
<p style="margin:0 0 var(--spacing-4);font-size:var(--typography-fontSize-sm);max-width:70ch">
|
|
37
|
+
<b>Legitimate exceptions.</b> ${exceptions}
|
|
38
|
+
</p>
|
|
39
|
+
<p style="margin:0;font-size:var(--typography-fontSize-sm);color:var(--color-text-secondary);max-width:70ch">
|
|
40
|
+
<b>Do not reach for it when…</b> ${avoid}
|
|
41
|
+
</p>
|
|
42
|
+
</div>`;
|
|
43
|
+
|
|
44
|
+
/* ------------------------------------------------------- the relationships - */
|
|
45
|
+
|
|
46
|
+
const RELATIONSHIPS = [
|
|
47
|
+
{
|
|
48
|
+
name : 'card inset',
|
|
49
|
+
kind : 'OBSERVED COMPONENT-FAMILY CONTRACT',
|
|
50
|
+
token : '--spacing-32',
|
|
51
|
+
measured : '32/32/32/32 in 38 places',
|
|
52
|
+
responsibility: `The padding between a self-contained object and its own contents. Every
|
|
53
|
+
card in the family agrees on it: Card, CardFeatures, LightCarousel, Bento,
|
|
54
|
+
the Awards card and the Trust Panel card all measure 32 on all four sides.`,
|
|
55
|
+
exceptions: html`Panels that are not cards. The Terminal panel measures 20/20/28/20 —
|
|
56
|
+
asymmetric because its content is a scrolling transcript with its own
|
|
57
|
+
bottom affordance.`,
|
|
58
|
+
avoid: html`…the object is not self-contained. A row inside a table is bounded by
|
|
59
|
+
the table, not by itself, and takes the table's cell padding.`,
|
|
60
|
+
sample: html`
|
|
61
|
+
<bd-card-item title="Machine Learning">
|
|
62
|
+
<bd-p variant="small">32px on every side, and no resting shadow.</bd-p>
|
|
63
|
+
</bd-card-item>`
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name : 'item title → its content',
|
|
67
|
+
kind : 'OBSERVED COMPONENT-FAMILY CONTRACT',
|
|
68
|
+
token : '--spacing-8',
|
|
69
|
+
measured : '8px, 9 components',
|
|
70
|
+
responsibility: `The gap between the title of one item — a card, a step, a feature — and the
|
|
71
|
+
copy underneath it. The pair reads as one object, so the gap is small enough
|
|
72
|
+
to bind them.`,
|
|
73
|
+
exceptions: html`The Trust Panel card measures 12 for exactly this relationship at
|
|
74
|
+
exactly this type size. See the unresolved section below.`,
|
|
75
|
+
avoid: html`…the title labels a region of the page rather than one object. That is
|
|
76
|
+
the section relationship, and it is 16.`,
|
|
77
|
+
sample: html`
|
|
78
|
+
<bd-h as="h3" visual-level="h5" fontWeight="bold" paddingBottom="8">Machine Learning</bd-h>
|
|
79
|
+
<bd-p variant="small">Behaviour learned from millions of daily threats.</bd-p>`
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name : 'section title → its content',
|
|
83
|
+
kind : 'OBSERVED COMPONENT-FAMILY CONTRACT',
|
|
84
|
+
token : '--spacing-16',
|
|
85
|
+
measured : '16px, 7 components',
|
|
86
|
+
responsibility: `The gap between the title of a page section and the standfirst or content
|
|
87
|
+
it introduces. Larger than the item gap because the title is anchoring a
|
|
88
|
+
region rather than labelling an object.`,
|
|
89
|
+
exceptions: html`Compatibility Table and Process Steps measure 12 for this relationship
|
|
90
|
+
at identical type sizes. See below.`,
|
|
91
|
+
avoid: html`…the title belongs to one card. Copying the section value into a card
|
|
92
|
+
is how a 36px title and a 20px title came to share a gap.`,
|
|
93
|
+
sample: html`
|
|
94
|
+
<bd-h as="h2" visual-level="h2" paddingBottom="16">What is AI Guardian?</bd-h>
|
|
95
|
+
<bd-p variant="small">The standfirst that introduces the region below it.</bd-p>`
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name : 'icon ↔ text',
|
|
99
|
+
kind : 'OBSERVED COMPONENT-FAMILY CONTRACT',
|
|
100
|
+
token : '--spacing-16',
|
|
101
|
+
measured : '16px in 18 places, 12px in 9',
|
|
102
|
+
responsibility: `The horizontal distance between a glyph and the text it belongs to. 16 is
|
|
103
|
+
the majority; 12 is the denser variant, and both occur inside single
|
|
104
|
+
components, so this is the least settled of the horizontal relationships.`,
|
|
105
|
+
exceptions: html`Dense rows — the Comparison Panel's icon list runs at 12 because its
|
|
106
|
+
rows are a scan target rather than reading matter.`,
|
|
107
|
+
avoid: html`…the icon is the control. A button's glyph is inset by the button's own
|
|
108
|
+
padding, not by this gap.`,
|
|
109
|
+
sample: html`
|
|
110
|
+
<div style="display:flex;align-items:center;gap:var(--spacing-16)">
|
|
111
|
+
<span style="width:var(--spacing-20);height:var(--spacing-20);border-radius:var(--radius-full);background:var(--color-blue-500);flex-shrink:0"></span>
|
|
112
|
+
<bd-p variant="small">16px from the glyph to the text it belongs to.</bd-p>
|
|
113
|
+
</div>`
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name : 'label → control',
|
|
117
|
+
kind : 'FOUNDATION TOKEN',
|
|
118
|
+
token : '--form-label-*-marginBottom',
|
|
119
|
+
measured : '4px',
|
|
120
|
+
responsibility: `The only one of these relationships that is already a token rather than an
|
|
121
|
+
observation: the form label tokens carry their own marginBottom, so the
|
|
122
|
+
label and the control cannot drift apart component by component.`,
|
|
123
|
+
exceptions: html`None measured. Every form label in the package resolves through the
|
|
124
|
+
same tokens.`,
|
|
125
|
+
avoid: html`…the text under a control is help text rather than a label. That is a
|
|
126
|
+
different relationship with a different owner.`,
|
|
127
|
+
sample: html`
|
|
128
|
+
<div>
|
|
129
|
+
<label style="display:block;margin-bottom:var(--form-label-default-marginBottom);font-size:var(--form-label-default-fontSize);font-weight:var(--form-label-default-fontWeight);color:var(--form-label-default-color)">Email address</label>
|
|
130
|
+
<input style="display:block;width:100%;max-width:320px;box-sizing:border-box;padding:var(--spacing-12);border:var(--border-width-1) solid var(--color-border-subtle);border-radius:var(--radius-lg);font:inherit" />
|
|
131
|
+
</div>`
|
|
132
|
+
}
|
|
133
|
+
];
|
|
134
|
+
|
|
135
|
+
/* --------------------------------------------------------------- the page - */
|
|
136
|
+
|
|
137
|
+
const SIZE_ROWS = Object.entries(sizeSites.sites);
|
|
138
|
+
|
|
139
|
+
export const SpacingRhythm = () =>
|
|
140
|
+
docsPage({
|
|
141
|
+
title: 'Spacing rhythm',
|
|
142
|
+
lede : `The distances between things, as opposed to the scale the distances come from.
|
|
143
|
+
Foundations/Spacing lists the steps; this page is about which step means which
|
|
144
|
+
relationship, and which relationships the package has actually agreed on.`,
|
|
145
|
+
note: html`<b>Three different kinds of thing appear on this page, and only one of them is
|
|
146
|
+
a token.</b><br />
|
|
147
|
+
A <b>FOUNDATION TOKEN</b> is declared in <code>tokens.js</code> and a component
|
|
148
|
+
asks for it by name.
|
|
149
|
+
An <b>OBSERVED COMPONENT-FAMILY CONTRACT</b> is a value several components
|
|
150
|
+
independently agree on, measured rather than declared — it is documentation, and
|
|
151
|
+
nothing enforces it.
|
|
152
|
+
A <b>SEMANTIC SPACING ROLE</b> would be a named token for a relationship
|
|
153
|
+
(<code>--stack-tight</code>, <code>--inset-card</code>). <b>There are none, and
|
|
154
|
+
that is deliberate:</b> forty-nine of them were declared here once —
|
|
155
|
+
<code>--space-*</code>, <code>--inset-*</code>, <code>--stack-*</code>,
|
|
156
|
+
<code>--inline-*</code> and more — and every one was a duplicate of a live scale
|
|
157
|
+
under a different name with no component referencing it. They were deleted. The
|
|
158
|
+
8 and 16 below are <i>observations</i>, not a proposal to declare them again.`,
|
|
159
|
+
children: html`
|
|
160
|
+
${refSection({
|
|
161
|
+
name : 'Relationships the package agrees on',
|
|
162
|
+
meta : `${RELATIONSHIPS.length} relationships, measured against the built Storybook`,
|
|
163
|
+
children: html`
|
|
164
|
+
<p style="max-width:70ch">
|
|
165
|
+
Each block gives the responsibility, the value measured across the components that
|
|
166
|
+
share it, a rendered example built from the tokens, and — the part that stops a
|
|
167
|
+
contract turning into a rule — where it legitimately does not apply.
|
|
168
|
+
</p>
|
|
169
|
+
${RELATIONSHIPS.map(relationship)}`
|
|
170
|
+
})}
|
|
171
|
+
|
|
172
|
+
${refSection({
|
|
173
|
+
name : 'The unresolved 12',
|
|
174
|
+
meta : 'classified, not resolved',
|
|
175
|
+
children: html`
|
|
176
|
+
<p style="border-left:var(--border-width-4) solid var(--color-border-brand);padding-left:var(--spacing-16);max-width:70ch">
|
|
177
|
+
<b>Three components use 12 where their peers use 8 or 16, and the type is identical
|
|
178
|
+
in every case.</b> That rules out the explanation that would have made 12 a third
|
|
179
|
+
responsibility: there is no size difference for the extra 4px to be compensating for.
|
|
180
|
+
</p>
|
|
181
|
+
<div class="table-scroll">
|
|
182
|
+
<table>
|
|
183
|
+
<caption>
|
|
184
|
+
Every title → its own description pair in the package, measured at 1440.
|
|
185
|
+
Optical ratio is (gap + half-leading either side) ÷ title size — the metric that
|
|
186
|
+
showed the 8 and 16 tiers are closer than their declared values look.
|
|
187
|
+
</caption>
|
|
188
|
+
<thead>
|
|
189
|
+
<tr>
|
|
190
|
+
<th scope="col">Component</th>
|
|
191
|
+
<th scope="col">Level</th>
|
|
192
|
+
<th scope="col">Gap</th>
|
|
193
|
+
<th scope="col">Title</th>
|
|
194
|
+
<th scope="col">Leading</th>
|
|
195
|
+
<th scope="col">Ratio</th>
|
|
196
|
+
</tr>
|
|
197
|
+
</thead>
|
|
198
|
+
<tbody>
|
|
199
|
+
${[
|
|
200
|
+
['Agent Endpoints', 'section', 16, 36, 49.5, 0.743, false],
|
|
201
|
+
['Comparison Panel', 'section', 16, 36, 49.5, 0.743, false],
|
|
202
|
+
['Trust Panel', 'section', 16, 36, 49.5, 0.743, false],
|
|
203
|
+
['Compatibility Table', 'section', 12, 36, 49.5, 0.632, true],
|
|
204
|
+
['Process Steps', 'section', 12, 36, 49.5, 0.632, true],
|
|
205
|
+
['Trust Panel card', 'item', 12, 24, 33, 0.854, true],
|
|
206
|
+
['Process Steps step', 'item', 8, 24, 33, 0.688, false]
|
|
207
|
+
].map(([c, lv, gap, size, lh, ratio, odd]) => html`
|
|
208
|
+
<tr style="${odd ? 'background:var(--color-surface-muted)' : ''}">
|
|
209
|
+
<td>${odd ? html`<b>${c}</b>` : c}</td>
|
|
210
|
+
<td>${lv}</td>
|
|
211
|
+
<td class="num">${gap}px</td>
|
|
212
|
+
<td class="num">${size}px</td>
|
|
213
|
+
<td class="num">${lh}px</td>
|
|
214
|
+
<td class="num">${ratio}</td>
|
|
215
|
+
</tr>`)}
|
|
216
|
+
</tbody>
|
|
217
|
+
</table>
|
|
218
|
+
</div>
|
|
219
|
+
<h3 style="font-size:var(--typography-fontSize-base);margin:var(--spacing-32) 0 var(--spacing-8)">
|
|
220
|
+
Classification: drift, in two directions, and not a third tier
|
|
221
|
+
</h3>
|
|
222
|
+
<p style="max-width:70ch">
|
|
223
|
+
<b>Compatibility Table and Process Steps section titles — drift toward 16.</b> Same
|
|
224
|
+
relationship, same 36px title at the same 49.5px leading, same 16px description as
|
|
225
|
+
the three components that use 16. Nothing distinguishes them but the number.
|
|
226
|
+
</p>
|
|
227
|
+
<p style="max-width:70ch">
|
|
228
|
+
<b>Trust Panel card title — drift toward 8.</b> Same relationship as the Process
|
|
229
|
+
Steps step title at the same 24px and the same 33px leading. At 0.854 it is the
|
|
230
|
+
loosest heading-to-body relationship measured anywhere in the package.
|
|
231
|
+
</p>
|
|
232
|
+
<p style="max-width:70ch">
|
|
233
|
+
<b>How it happened is visible in the pairs.</b> Trust Panel runs 16 at section level
|
|
234
|
+
and 12 in its card; Process Steps runs 12 at section level and 8 in its step. Each
|
|
235
|
+
component steps down by exactly 4px inside itself, so each is internally coherent —
|
|
236
|
+
the two ladders simply start a rung apart. That is why neither looks wrong on its
|
|
237
|
+
own screen, and why this was invisible until they were measured side by side.
|
|
238
|
+
</p>
|
|
239
|
+
<p style="max-width:70ch">
|
|
240
|
+
<b>Nothing here has been changed.</b> The measurements establish that the components
|
|
241
|
+
disagree; they do not establish which value is right, and a majority is not an
|
|
242
|
+
argument — this package already learned that when one section title meant 48, 36, 32
|
|
243
|
+
and 24 at once. Converging them is a design decision about three visible section
|
|
244
|
+
headers, recorded here rather than made quietly. <b>It is not a case for a token:</b>
|
|
245
|
+
a semantic role for a relationship whose value is under dispute would freeze the
|
|
246
|
+
dispute rather than settle it.
|
|
247
|
+
</p>`
|
|
248
|
+
})}
|
|
249
|
+
|
|
250
|
+
${refSection({
|
|
251
|
+
name : 'Responsive density',
|
|
252
|
+
meta : 'three cases, none of them drift',
|
|
253
|
+
children: html`
|
|
254
|
+
<p style="max-width:70ch">
|
|
255
|
+
A gap that changes with the viewport is usually density. Three cases looked like
|
|
256
|
+
something else when read from the declared values alone, and all three turned out to
|
|
257
|
+
be a layout changing rather than a value drifting — which is the reason a spacing
|
|
258
|
+
rule cannot be written against declared numbers.
|
|
259
|
+
</p>
|
|
260
|
+
<div class="table-scroll">
|
|
261
|
+
<table>
|
|
262
|
+
<caption>Gaps that change across the breakpoints, and what is actually changing</caption>
|
|
263
|
+
<thead>
|
|
264
|
+
<tr>
|
|
265
|
+
<th scope="col">Where</th>
|
|
266
|
+
<th scope="col">Measured</th>
|
|
267
|
+
<th scope="col">What it is</th>
|
|
268
|
+
</tr>
|
|
269
|
+
</thead>
|
|
270
|
+
<tbody>
|
|
271
|
+
<tr>
|
|
272
|
+
<td>Awards intro</td>
|
|
273
|
+
<td class="num">8 → 16 at sm</td>
|
|
274
|
+
<td>Density. One relationship, loosened once there is room for it.</td>
|
|
275
|
+
</tr>
|
|
276
|
+
<tr>
|
|
277
|
+
<td>Header container</td>
|
|
278
|
+
<td class="num">32 below 1024, 30 above</td>
|
|
279
|
+
<td>
|
|
280
|
+
Two layouts, not one value. Below 1024 it is a column stack and the gap is
|
|
281
|
+
vertical; above it, a two-column grid and the gap is horizontal. Different
|
|
282
|
+
axis, different relationship. <b>30px is off the scale</b> and 32 is on it —
|
|
283
|
+
that is raw-literal debt, not a responsive anomaly.
|
|
284
|
+
</td>
|
|
285
|
+
</tr>
|
|
286
|
+
<tr>
|
|
287
|
+
<td>Footer links</td>
|
|
288
|
+
<td class="num">8 → 0 → 32</td>
|
|
289
|
+
<td>
|
|
290
|
+
Three layouts. Mobile is a column at 8; 768–1024 is a column at
|
|
291
|
+
<code>gap: 0</code> because a <code>bd-divider-horizontal</code> with 16px
|
|
292
|
+
margins sits between the groups and carries the separation itself; desktop is
|
|
293
|
+
a row at 32. The zero is correct — using both the gap and the divider would
|
|
294
|
+
count the distance twice.
|
|
295
|
+
</td>
|
|
296
|
+
</tr>
|
|
297
|
+
<tr>
|
|
298
|
+
<td>Pricing Cards</td>
|
|
299
|
+
<td class="num">52 → 24 at xl</td>
|
|
300
|
+
<td>
|
|
301
|
+
<b>PRODUCT_FROZEN.</b> Pricing Cards runs its own em-derived scale off the
|
|
302
|
+
token scale entirely; its architecture is frozen by product decision and is
|
|
303
|
+
reported rather than migrated, as with its typography.
|
|
304
|
+
</td>
|
|
305
|
+
</tr>
|
|
306
|
+
</tbody>
|
|
307
|
+
</table>
|
|
308
|
+
</div>`
|
|
309
|
+
})}
|
|
310
|
+
|
|
311
|
+
${refSection({
|
|
312
|
+
name : 'Spacing steps used as sizes',
|
|
313
|
+
meta : `${SIZE_ROWS.length} registered sites · scripts/spacing-as-size.json`,
|
|
314
|
+
children: html`
|
|
315
|
+
<p style="border-left:var(--border-width-4) solid var(--color-border-brand);padding-left:var(--spacing-16);max-width:70ch">
|
|
316
|
+
<b><code>--spacing-*</code> is rem and <code>--dimension-*</code> is px.</b>
|
|
317
|
+
They carry the same numbers and are not the same value: <code>--spacing-44</code>
|
|
318
|
+
renders 44px at a 16px root and <b>66px at a 24px root</b>, where
|
|
319
|
+
<code>--dimension-44</code> is 44px at both.
|
|
320
|
+
</p>
|
|
321
|
+
<p style="max-width:70ch">
|
|
322
|
+
So a spacing step used as a size is not simply the wrong category name. Renaming it
|
|
323
|
+
is a decision to stop that box growing when a reader enlarges their text — measured
|
|
324
|
+
on the carousel arrow, a <code>role="button"</code> target that would go from 66px
|
|
325
|
+
back to 44px for exactly the reader a larger target helps. The question at each site
|
|
326
|
+
is <b>should this box grow when the reader's text grows</b>, and
|
|
327
|
+
<code>skeleton.css.js</code> answers it both ways in one file: the bone standing in
|
|
328
|
+
for a line of text is <code>--spacing-16</code>, and the avatar circle two rules
|
|
329
|
+
below is <code>--dimension-40</code>.
|
|
330
|
+
</p>
|
|
331
|
+
<div class="table-scroll">
|
|
332
|
+
<table>
|
|
333
|
+
<caption>
|
|
334
|
+
Read from scripts/spacing-as-size.json at build time, so this table cannot drift
|
|
335
|
+
from what lint:tokens enforces. An entry whose token stops appearing in its file
|
|
336
|
+
is reported as spacing-as-size-stale.
|
|
337
|
+
</caption>
|
|
338
|
+
<thead>
|
|
339
|
+
<tr>
|
|
340
|
+
<th scope="col">Site</th>
|
|
341
|
+
<th scope="col">Step</th>
|
|
342
|
+
<th scope="col">Kind</th>
|
|
343
|
+
<th scope="col">Why it stays</th>
|
|
344
|
+
</tr>
|
|
345
|
+
</thead>
|
|
346
|
+
<tbody>
|
|
347
|
+
${SIZE_ROWS.map(([name, s]) => html`
|
|
348
|
+
<tr>
|
|
349
|
+
<td><code>${name}</code><br /><span style="color:var(--color-text-muted)">${s.file.split('/').pop()}</span></td>
|
|
350
|
+
<td class="num">${s.token.replace('--spacing-', '')}</td>
|
|
351
|
+
<td class="num">${s.kind}</td>
|
|
352
|
+
<td>${s.reason}</td>
|
|
353
|
+
</tr>`)}
|
|
354
|
+
</tbody>
|
|
355
|
+
</table>
|
|
356
|
+
</div>`
|
|
357
|
+
})}
|
|
358
|
+
`
|
|
359
|
+
});
|