anentrypoint-design 0.0.121 → 0.0.124
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/README.md +253 -253
- package/app-shell.css +931 -594
- package/colors_and_type.css +226 -226
- package/community.css +817 -1222
- package/dist/247420.css +2202 -2084
- package/dist/247420.js +13 -13
- package/package.json +80 -80
- package/src/bootstrap.js +25 -25
- package/src/components/chat.js +199 -199
- package/src/components/community.js +190 -208
- package/src/components/content.js +269 -269
- package/src/components/editor-primitives.js +100 -0
- package/src/components/files-modals.js +107 -107
- package/src/components/files.js +118 -118
- package/src/components/freddie/helpers.js +50 -50
- package/src/components/freddie.js +33 -33
- package/src/components/shell.js +117 -117
- package/src/components/theme-toggle.js +70 -70
- package/src/components.js +59 -57
- package/src/debug.js +30 -30
- package/src/deck-stage.js +21 -21
- package/src/highlight.js +65 -32
- package/src/index.js +86 -86
- package/src/kits/os/about-app.js +52 -52
- package/src/kits/os/app-panes.css +152 -152
- package/src/kits/os/browser-app.js +58 -58
- package/src/kits/os/files-app.js +44 -44
- package/src/kits/os/freddie/helpers.js +59 -59
- package/src/kits/os/freddie/pages-chat.js +143 -143
- package/src/kits/os/freddie/pages-core.js +101 -101
- package/src/kits/os/freddie/pages-os.js +51 -51
- package/src/kits/os/freddie/pages-tools.js +183 -183
- package/src/kits/os/freddie/routes.js +24 -24
- package/src/kits/os/freddie-dashboard.css +51 -51
- package/src/kits/os/freddie-dashboard.js +101 -101
- package/src/kits/os/icons.js +17 -17
- package/src/kits/os/index.js +17 -17
- package/src/kits/os/launcher.css +61 -61
- package/src/kits/os/launcher.js +79 -79
- package/src/kits/os/monitor-app.js +34 -34
- package/src/kits/os/shell.js +214 -214
- package/src/kits/os/terminal-app.js +45 -45
- package/src/kits/os/theme.css +450 -450
- package/src/kits/os/validate.css +19 -19
- package/src/kits/os/validator-app.js +55 -55
- package/src/kits/os/wm.css +115 -115
- package/src/kits/os/wm.js +111 -111
- package/src/markdown.js +39 -39
- package/src/motion.js +35 -35
- package/src/page-html.js +196 -196
- package/src/styles.js +25 -25
- package/src/theme.js +99 -99
- package/src/web-components/ds-chat.js +116 -116
- package/dist/.nojekyll +0 -0
- package/dist/app-shell.css +0 -594
- package/dist/colors_and_type.css +0 -197
- package/dist/favicon.svg +0 -1
- package/dist/index.html +0 -308
- package/dist/preview/buttons.html +0 -28
- package/dist/preview/colors-core.html +0 -45
- package/dist/preview/colors-lore.html +0 -28
- package/dist/preview/colors-semantic.html +0 -34
- package/dist/preview/dateline.html +0 -19
- package/dist/preview/dropzone.html +0 -30
- package/dist/preview/file-grid.html +0 -19
- package/dist/preview/file-row.html +0 -20
- package/dist/preview/file-toolbar.html +0 -40
- package/dist/preview/file-viewer.html +0 -31
- package/dist/preview/header.html +0 -24
- package/dist/preview/icons-unicode.html +0 -26
- package/dist/preview/index-row.html +0 -25
- package/dist/preview/inputs.html +0 -22
- package/dist/preview/manifesto.html +0 -52
- package/dist/preview/motion-default.js +0 -106
- package/dist/preview/rules.html +0 -16
- package/dist/preview/spacing.html +0 -18
- package/dist/preview/stamps-lore.html +0 -20
- package/dist/preview/stamps.html +0 -14
- package/dist/preview/theme-ink.html +0 -15
- package/dist/preview/type-display.html +0 -16
- package/dist/preview/type-mono.html +0 -15
- package/dist/preview/type-prose.html +0 -11
- package/dist/preview/type-scale.html +0 -20
- package/dist/preview/wordmarks.html +0 -28
- package/dist/robots.txt +0 -8
- package/dist/site/content/globals/navigation.yaml +0 -5
- package/dist/site/content/globals/site.yaml +0 -16
- package/dist/site/content/pages/freddie.yaml +0 -88
- package/dist/site/content/pages/home.yaml +0 -190
- package/dist/site/theme.mjs +0 -368
- package/dist/sitemap.xml +0 -31
- package/dist/slides/deck-stage-overlay.js +0 -63
- package/dist/slides/deck-stage-state.js +0 -81
- package/dist/slides/deck-stage-style.js +0 -117
- package/dist/slides/deck-stage.js +0 -159
- package/dist/slides/index.html +0 -276
- package/dist/src/bootstrap.js +0 -25
- package/dist/src/components/chat.js +0 -199
- package/dist/src/components/community.js +0 -167
- package/dist/src/components/content.js +0 -213
- package/dist/src/components/files-modals.js +0 -107
- package/dist/src/components/files.js +0 -118
- package/dist/src/components/freddie/helpers.js +0 -50
- package/dist/src/components/freddie.js +0 -33
- package/dist/src/components/shell.js +0 -117
- package/dist/src/components/theme-toggle.js +0 -70
- package/dist/src/components.js +0 -52
- package/dist/src/debug.js +0 -30
- package/dist/src/deck-stage.js +0 -21
- package/dist/src/highlight.js +0 -32
- package/dist/src/index.js +0 -86
- package/dist/src/kits/os/about-app.js +0 -52
- package/dist/src/kits/os/app-panes.css +0 -152
- package/dist/src/kits/os/browser-app.js +0 -58
- package/dist/src/kits/os/files-app.js +0 -44
- package/dist/src/kits/os/freddie/helpers.js +0 -59
- package/dist/src/kits/os/freddie/pages-chat.js +0 -143
- package/dist/src/kits/os/freddie/pages-core.js +0 -101
- package/dist/src/kits/os/freddie/pages-os.js +0 -51
- package/dist/src/kits/os/freddie/pages-tools.js +0 -183
- package/dist/src/kits/os/freddie/routes.js +0 -24
- package/dist/src/kits/os/freddie-dashboard.css +0 -51
- package/dist/src/kits/os/freddie-dashboard.js +0 -101
- package/dist/src/kits/os/icons.js +0 -17
- package/dist/src/kits/os/index.js +0 -5
- package/dist/src/kits/os/launcher.css +0 -61
- package/dist/src/kits/os/launcher.js +0 -79
- package/dist/src/kits/os/monitor-app.js +0 -34
- package/dist/src/kits/os/shell.js +0 -214
- package/dist/src/kits/os/terminal-app.js +0 -45
- package/dist/src/kits/os/theme.css +0 -412
- package/dist/src/kits/os/validate.css +0 -19
- package/dist/src/kits/os/validator-app.js +0 -55
- package/dist/src/kits/os/wm.css +0 -115
- package/dist/src/kits/os/wm.js +0 -111
- package/dist/src/markdown.js +0 -39
- package/dist/src/motion.js +0 -35
- package/dist/src/page-html.js +0 -196
- package/dist/src/styles.js +0 -25
- package/dist/src/theme.js +0 -99
- package/dist/src/web-components/ds-chat.js +0 -45
- package/dist/ui_kits/aicat/README.md +0 -7
- package/dist/ui_kits/aicat/app.js +0 -156
- package/dist/ui_kits/aicat/index.html +0 -26
- package/dist/ui_kits/aicat/sample-square.png +0 -0
- package/dist/ui_kits/aicat/sample-svg.svg +0 -1
- package/dist/ui_kits/aicat/sample.pdf +0 -32
- package/dist/ui_kits/blog/README.md +0 -3
- package/dist/ui_kits/blog/index.html +0 -90
- package/dist/ui_kits/chat/README.md +0 -5
- package/dist/ui_kits/chat/app.js +0 -110
- package/dist/ui_kits/chat/index.html +0 -26
- package/dist/ui_kits/chat/sample-square.png +0 -0
- package/dist/ui_kits/chat/sample-svg.svg +0 -1
- package/dist/ui_kits/chat/sample.pdf +0 -32
- package/dist/ui_kits/community/app.js +0 -134
- package/dist/ui_kits/community/index.html +0 -24
- package/dist/ui_kits/dashboard/app.js +0 -92
- package/dist/ui_kits/dashboard/index.html +0 -26
- package/dist/ui_kits/docs/README.md +0 -3
- package/dist/ui_kits/docs/index.html +0 -123
- package/dist/ui_kits/error_404/app.js +0 -56
- package/dist/ui_kits/error_404/index.html +0 -26
- package/dist/ui_kits/file_browser/README.md +0 -48
- package/dist/ui_kits/file_browser/app.js +0 -231
- package/dist/ui_kits/file_browser/index.html +0 -33
- package/dist/ui_kits/gallery/app.js +0 -121
- package/dist/ui_kits/gallery/index.html +0 -26
- package/dist/ui_kits/homepage/README.md +0 -7
- package/dist/ui_kits/homepage/app.js +0 -167
- package/dist/ui_kits/homepage/index.html +0 -46
- package/dist/ui_kits/project_page/README.md +0 -3
- package/dist/ui_kits/project_page/app.js +0 -154
- package/dist/ui_kits/project_page/index.html +0 -45
- package/dist/ui_kits/search/app.js +0 -107
- package/dist/ui_kits/search/index.html +0 -26
- package/dist/ui_kits/settings/app.js +0 -133
- package/dist/ui_kits/settings/index.html +0 -26
- package/dist/ui_kits/signin/app.js +0 -115
- package/dist/ui_kits/signin/index.html +0 -26
- package/dist/ui_kits/slide_deck/app.js +0 -174
- package/dist/ui_kits/slide_deck/index.html +0 -26
- package/dist/ui_kits/system_primer/app.js +0 -152
- package/dist/ui_kits/system_primer/index.html +0 -26
- package/dist/ui_kits/terminal/app.js +0 -150
- package/dist/ui_kits/terminal/index.html +0 -26
- package/dist/vendor/webjsx/applyDiff.js +0 -182
- package/dist/vendor/webjsx/attributes.js +0 -154
- package/dist/vendor/webjsx/constants.js +0 -4
- package/dist/vendor/webjsx/createDOMElement.js +0 -52
- package/dist/vendor/webjsx/createElement.js +0 -75
- package/dist/vendor/webjsx/elementTags.js +0 -115
- package/dist/vendor/webjsx/factory.js +0 -6
- package/dist/vendor/webjsx/index.js +0 -6
- package/dist/vendor/webjsx/jsx-dev-runtime.js +0 -2
- package/dist/vendor/webjsx/jsx-runtime.js +0 -30
- package/dist/vendor/webjsx/jsx.js +0 -2
- package/dist/vendor/webjsx/package.json +0 -39
- package/dist/vendor/webjsx/renderSuspension.js +0 -25
- package/dist/vendor/webjsx/types.js +0 -5
- package/dist/vendor/webjsx/utils.js +0 -84
- package/src/components/overlays.js +0 -151
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import * as webjsx from 'webjsx';
|
|
2
|
-
import { Topbar, Crumb, Status, Side, AppShell, Panel, Heading, Lede, Chip, Btn, ThemeToggle } from 'ds/components.js';
|
|
3
|
-
import { mountKit } from 'ds/bootstrap.js';
|
|
4
|
-
const h = webjsx.createElement;
|
|
5
|
-
|
|
6
|
-
const root = document.getElementById('root');
|
|
7
|
-
|
|
8
|
-
const PALETTE = [
|
|
9
|
-
{ name: 'paper', v: 'var(--paper)' },
|
|
10
|
-
{ name: 'paper-2', v: 'var(--paper-2)' },
|
|
11
|
-
{ name: 'paper-3', v: 'var(--paper-3)' },
|
|
12
|
-
{ name: 'ink', v: 'var(--ink)' },
|
|
13
|
-
{ name: 'ink-2', v: 'var(--ink-2)' },
|
|
14
|
-
{ name: 'ink-3', v: 'var(--ink-3)' },
|
|
15
|
-
{ name: 'green', v: 'var(--green)' },
|
|
16
|
-
{ name: 'green-2', v: 'var(--green-2)' },
|
|
17
|
-
{ name: 'purple', v: 'var(--purple)' },
|
|
18
|
-
{ name: 'purple-2', v: 'var(--purple-2)' },
|
|
19
|
-
{ name: 'mascot', v: 'var(--mascot)' },
|
|
20
|
-
{ name: 'mascot-2', v: 'var(--mascot-2)' },
|
|
21
|
-
{ name: 'sun', v: 'var(--sun)' },
|
|
22
|
-
{ name: 'flame', v: 'var(--flame)' },
|
|
23
|
-
{ name: 'sky', v: 'var(--sky)' },
|
|
24
|
-
{ name: 'warn', v: 'var(--warn)' }
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
const SEMANTIC = [
|
|
28
|
-
{ name: '--bg', v: 'var(--bg)' },
|
|
29
|
-
{ name: '--bg-2', v: 'var(--bg-2)' },
|
|
30
|
-
{ name: '--bg-3', v: 'var(--bg-3)' },
|
|
31
|
-
{ name: '--fg', v: 'var(--fg)' },
|
|
32
|
-
{ name: '--fg-2', v: 'var(--fg-2)' },
|
|
33
|
-
{ name: '--fg-3', v: 'var(--fg-3)' },
|
|
34
|
-
{ name: '--accent', v: 'var(--accent)' }
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
const TYPE_SCALE = [
|
|
38
|
-
{ name: 'mega', cls: 't-hero', size: 'var(--fs-mega)' },
|
|
39
|
-
{ name: 'hero', cls: 't-hero', size: 'var(--fs-hero)' },
|
|
40
|
-
{ name: 'h1', cls: '', size: 'var(--fs-h1)' },
|
|
41
|
-
{ name: 'h2', cls: '', size: 'var(--fs-h2)' },
|
|
42
|
-
{ name: 'h3', cls: '', size: 'var(--fs-h3)' },
|
|
43
|
-
{ name: 'h4', cls: '', size: 'var(--fs-h4)' },
|
|
44
|
-
{ name: 'lede', cls: 't-lede', size: 'var(--fs-xl)' },
|
|
45
|
-
{ name: 'body', cls: '', size: 'var(--fs-body)' },
|
|
46
|
-
{ name: 'sm', cls: '', size: 'var(--fs-sm)' },
|
|
47
|
-
{ name: 'micro', cls: 't-micro', size: 'var(--fs-micro)' }
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
function Swatch(name, v, big) {
|
|
51
|
-
return h('div', { class: 'ds-swatch', style: 'display:flex;flex-direction:column;gap:6px' },
|
|
52
|
-
h('div', {
|
|
53
|
-
style: 'height:' + (big ? '64px' : '48px') +
|
|
54
|
-
';background:' + v +
|
|
55
|
-
';border-radius:10px;border:1px solid var(--rule)'
|
|
56
|
-
}),
|
|
57
|
-
h('div', { style: 'font-family:var(--ff-mono);font-size:11px;color:var(--fg-3)' }, name)
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function PaletteGrid() {
|
|
62
|
-
return Panel({ title: 'lore palette', style: 'margin:8px 0', children:
|
|
63
|
-
h('div', { style: 'display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:12px;padding:14px 18px' },
|
|
64
|
-
...PALETTE.map(p => Swatch(p.name, p.v, false))
|
|
65
|
-
)
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function SemanticGrid() {
|
|
70
|
-
return Panel({ title: 'semantic tokens — invert with theme', count: '7', style: 'margin:8px 0', children:
|
|
71
|
-
h('div', { style: 'display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;padding:14px 18px' },
|
|
72
|
-
...SEMANTIC.map(p => Swatch(p.name, p.v, true))
|
|
73
|
-
)
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function TypeScalePanel() {
|
|
78
|
-
return Panel({ title: 'type scale', style: 'margin:8px 0', children:
|
|
79
|
-
h('div', { style: 'padding:14px 18px;display:flex;flex-direction:column;gap:14px' },
|
|
80
|
-
...TYPE_SCALE.map(t =>
|
|
81
|
-
h('div', { style: 'display:flex;align-items:baseline;gap:14px;border-bottom:1px solid var(--rule);padding-bottom:8px' },
|
|
82
|
-
h('span', { style: 'flex:0 0 64px;font-family:var(--ff-mono);font-size:11px;color:var(--fg-3)' }, t.name),
|
|
83
|
-
h('div', { class: t.cls, style: 'font-size:' + t.size + ';line-height:var(--lh-tight);color:var(--fg)' }, 'two-four-seven four-twenty')
|
|
84
|
-
)
|
|
85
|
-
)
|
|
86
|
-
)
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function PrimitivesPanel() {
|
|
91
|
-
return Panel({ title: 'primitives', style: 'margin:8px 0', children:
|
|
92
|
-
h('div', { style: 'padding:14px 18px;display:flex;flex-direction:column;gap:18px' },
|
|
93
|
-
h('div', { style: 'display:flex;gap:10px;flex-wrap:wrap;align-items:center' },
|
|
94
|
-
h('span', { style: 'font-family:var(--ff-mono);font-size:11px;color:var(--fg-3);flex:0 0 64px' }, 'chips'),
|
|
95
|
-
Chip({ tone: 'accent', children: 'accent' }),
|
|
96
|
-
Chip({ tone: 'dim', children: 'dim' }),
|
|
97
|
-
Chip({ tone: '', children: 'plain' })
|
|
98
|
-
),
|
|
99
|
-
h('div', { style: 'display:flex;gap:10px;flex-wrap:wrap;align-items:center' },
|
|
100
|
-
h('span', { style: 'font-family:var(--ff-mono);font-size:11px;color:var(--fg-3);flex:0 0 64px' }, 'buttons'),
|
|
101
|
-
Btn({ primary: true, children: 'primary' }),
|
|
102
|
-
Btn({ children: 'default' }),
|
|
103
|
-
Btn({ ghost: true, children: 'ghost' })
|
|
104
|
-
),
|
|
105
|
-
h('div', { style: 'display:flex;gap:10px;flex-wrap:wrap;align-items:center' },
|
|
106
|
-
h('span', { style: 'font-family:var(--ff-mono);font-size:11px;color:var(--fg-3);flex:0 0 64px' }, 'theme'),
|
|
107
|
-
ThemeToggle(),
|
|
108
|
-
ThemeToggle({ compact: true })
|
|
109
|
-
)
|
|
110
|
-
)
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function App() {
|
|
115
|
-
return AppShell({
|
|
116
|
-
topbar: Topbar({
|
|
117
|
-
brand: '247420',
|
|
118
|
-
leaf: 'system primer',
|
|
119
|
-
items: [['index', '../../'], ['terminal', '../terminal/']]
|
|
120
|
-
}),
|
|
121
|
-
crumb: Crumb({ trail: ['247420', 'kits'], leaf: 'system primer' }),
|
|
122
|
-
side: Side({
|
|
123
|
-
sections: [
|
|
124
|
-
{ group: 'sections', items: [
|
|
125
|
-
{ glyph: '◐', label: 'palette', key: 'p' },
|
|
126
|
-
{ glyph: '◑', label: 'semantic', key: 's' },
|
|
127
|
-
{ glyph: '◒', label: 'type scale', key: 't' },
|
|
128
|
-
{ glyph: '◓', label: 'primitives', key: 'r' }
|
|
129
|
-
] }
|
|
130
|
-
]
|
|
131
|
-
}),
|
|
132
|
-
main: [
|
|
133
|
-
h('div', { class: 'ds-section', style: 'padding:8px' },
|
|
134
|
-
h('div', { style: 'display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap' },
|
|
135
|
-
h('div', {}, Heading({ level: 1, children: 'system primer' })),
|
|
136
|
-
ThemeToggle()
|
|
137
|
-
),
|
|
138
|
-
Lede({ children: 'one page showing palette, semantic tokens, type scale, and primitives. flip the theme toggle — semantic tokens invert, lore palette stays put.' }),
|
|
139
|
-
PaletteGrid(),
|
|
140
|
-
SemanticGrid(),
|
|
141
|
-
TypeScalePanel(),
|
|
142
|
-
PrimitivesPanel()
|
|
143
|
-
)
|
|
144
|
-
],
|
|
145
|
-
status: Status({
|
|
146
|
-
left: ['system primer', '• ' + PALETTE.length + ' lore colors', '• ' + SEMANTIC.length + ' semantic'],
|
|
147
|
-
right: ['247420 / mmxxvi']
|
|
148
|
-
})
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
mountKit({ root, view: App, screen: '16 System Primer' });
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en" data-theme="auto" class="ds-247420"><head>
|
|
3
|
-
<meta charset="utf-8">
|
|
4
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
|
-
<meta name="theme-color" content="#247420" media="(prefers-color-scheme: light)">
|
|
6
|
-
<meta name="theme-color" content="#3A9A34" media="(prefers-color-scheme: dark)">
|
|
7
|
-
<meta name="color-scheme" content="light dark">
|
|
8
|
-
<title>system primer / 247420</title>
|
|
9
|
-
<meta name="description" content="design system showcase — palette swatches, type scale, primitives in one page.">
|
|
10
|
-
<link rel="canonical" href="https://anentrypoint.github.io/design/ui_kits/system_primer/">
|
|
11
|
-
<link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
|
12
|
-
<link rel="stylesheet" href="../../colors_and_type.css">
|
|
13
|
-
<link rel="stylesheet" href="../../app-shell.css">
|
|
14
|
-
<script type="importmap">
|
|
15
|
-
{ "imports": {
|
|
16
|
-
"webjsx": "../../vendor/webjsx/index.js",
|
|
17
|
-
"webjsx/": "../../vendor/webjsx/",
|
|
18
|
-
"webjsx/jsx-runtime": "../../vendor/webjsx/jsx-runtime.js",
|
|
19
|
-
"ds/": "../../src/"
|
|
20
|
-
} }
|
|
21
|
-
</script>
|
|
22
|
-
</head>
|
|
23
|
-
<body data-screen-label="16 System Primer">
|
|
24
|
-
<div id="root"></div>
|
|
25
|
-
<script type="module" src="./app.js"></script>
|
|
26
|
-
</body></html>
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import * as webjsx from 'webjsx';
|
|
2
|
-
import { Topbar, Crumb, Status, Side, AppShell, Panel, Heading, Lede, Chip, ThemeToggle } from 'ds/components.js';
|
|
3
|
-
import { mountKit } from 'ds/bootstrap.js';
|
|
4
|
-
const h = webjsx.createElement;
|
|
5
|
-
|
|
6
|
-
const root = document.getElementById('root');
|
|
7
|
-
|
|
8
|
-
// Live terminal — instant output, no fake reveal animation. This is the
|
|
9
|
-
// usable surface; anything typed appears immediately, anything emitted by
|
|
10
|
-
// the (stubbed) backend appears immediately.
|
|
11
|
-
const liveTranscript = [
|
|
12
|
-
{ kind: 'cmt', text: '# live session · ~/dev/design' },
|
|
13
|
-
{ kind: 'cmd', text: 'echo "ready"' },
|
|
14
|
-
{ kind: 'out', text: 'ready' }
|
|
15
|
-
];
|
|
16
|
-
const live = { input: '', cwd: '~/dev/design' };
|
|
17
|
-
|
|
18
|
-
// Demo loop — decorative showcase of the .cli row primitives playing back
|
|
19
|
-
// a build-pipeline transcript. Clearly separated from the live terminal.
|
|
20
|
-
// Honors prefers-reduced-motion: when the user opts out of motion we just
|
|
21
|
-
// show the full transcript statically.
|
|
22
|
-
const demoScript = [
|
|
23
|
-
{ d: 0, kind: 'cmt', text: '# build pipeline · main' },
|
|
24
|
-
{ d: 280, kind: 'cmd', text: 'npm install' },
|
|
25
|
-
{ d: 600, kind: 'out', text: 'added 412 packages in 6.2s' },
|
|
26
|
-
{ d: 220, kind: 'cmd', text: 'npm run build' },
|
|
27
|
-
{ d: 180, kind: 'out', text: '> 247420-design build' },
|
|
28
|
-
{ d: 180, kind: 'out', text: '[247420] css gzip+base64: 18.4kb (raw 96.1kb)' },
|
|
29
|
-
{ d: 220, kind: 'ok', text: '✓ bundle written to dist/247420.js (84.0 kb)' },
|
|
30
|
-
{ d: 280, kind: 'cmd', text: 'npm test' },
|
|
31
|
-
{ d: 500, kind: 'out', text: '116 assertions, 0 failures' },
|
|
32
|
-
{ d: 200, kind: 'ok', text: '✓ all tests passed' },
|
|
33
|
-
{ d: 320, kind: 'cmd', text: 'git push' },
|
|
34
|
-
{ d: 240, kind: 'out', text: 'remote: Deploying to gh-pages…' },
|
|
35
|
-
{ d: 900, kind: 'ok', text: '✓ deploy in 11s' }
|
|
36
|
-
];
|
|
37
|
-
const reduced = typeof matchMedia !== 'undefined'
|
|
38
|
-
&& matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
39
|
-
const demo = { visible: reduced ? demoScript.slice() : [], looping: !reduced };
|
|
40
|
-
|
|
41
|
-
function Line(l, i, opts = {}) {
|
|
42
|
-
const cursor = opts.cursor;
|
|
43
|
-
const baseChildren = (prompt, text, promptStyle, textStyle) => [
|
|
44
|
-
h('span', { class: 'prompt', style: promptStyle || '' }, prompt),
|
|
45
|
-
h('span', { class: 'cmd', style: textStyle || '' }, text),
|
|
46
|
-
cursor ? h('span', { class: 'cursor-blink' }, '') : null
|
|
47
|
-
];
|
|
48
|
-
if (l.kind === 'cmt') return h('div', { key: 'l' + i, class: 'cli' }, ...baseChildren('#', l.text, '', 'color:var(--fg-3)'));
|
|
49
|
-
if (l.kind === 'cmd') return h('div', { key: 'l' + i, class: 'cli' }, ...baseChildren('$', l.text));
|
|
50
|
-
if (l.kind === 'out') return h('div', { key: 'l' + i, class: 'cli' }, ...baseChildren('·', l.text, '', 'color:var(--fg-2)'));
|
|
51
|
-
if (l.kind === 'ok') return h('div', { key: 'l' + i, class: 'cli' }, ...baseChildren('✓', l.text, 'color:var(--accent)', 'color:var(--accent)'));
|
|
52
|
-
if (l.kind === 'warn') return h('div', { key: 'l' + i, class: 'cli' }, ...baseChildren('!', l.text, 'color:var(--mascot)', 'color:var(--mascot)'));
|
|
53
|
-
if (l.kind === 'log') return h('div', { key: 'l' + i, class: 'cli' }, ...baseChildren('·', l.text, 'color:var(--fg-3)', 'color:var(--fg-2);font-family:var(--ff-mono)'));
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function App() {
|
|
58
|
-
return AppShell({
|
|
59
|
-
topbar: Topbar({
|
|
60
|
-
brand: '247420',
|
|
61
|
-
leaf: 'terminal',
|
|
62
|
-
items: [['index', '../../'], ['dashboard', '../dashboard/']]
|
|
63
|
-
}),
|
|
64
|
-
crumb: Crumb({ trail: ['247420', 'kits'], leaf: 'terminal' }),
|
|
65
|
-
side: Side({
|
|
66
|
-
sections: [
|
|
67
|
-
{ group: 'sessions', items: [
|
|
68
|
-
{ glyph: '◆', label: 'live', count: 'on', key: 'l' },
|
|
69
|
-
{ glyph: '◇', label: 'demo loop', count: demo.looping ? 'play' : 'still', key: 'd' }
|
|
70
|
-
] },
|
|
71
|
-
{ group: 'shortcuts', items: [
|
|
72
|
-
{ glyph: '·', label: 'clear (⌘k)', key: 'c' },
|
|
73
|
-
{ glyph: '·', label: 'history (↑)', key: 'h' }
|
|
74
|
-
] }
|
|
75
|
-
]
|
|
76
|
-
}),
|
|
77
|
-
main: [
|
|
78
|
-
h('div', { class: 'ds-section', style: 'padding:8px' },
|
|
79
|
-
h('div', { style: 'display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap' },
|
|
80
|
-
h('div', {}, Heading({ level: 1, children: 'terminal' })),
|
|
81
|
-
ThemeToggle()
|
|
82
|
-
),
|
|
83
|
-
Lede({ children: 'two surfaces — a live shell (instant, no fake reveal) and a decorative demo loop that plays the .cli row primitives. respects prefers-reduced-motion.' }),
|
|
84
|
-
|
|
85
|
-
// Live terminal — usable, no reveal delays.
|
|
86
|
-
Panel({
|
|
87
|
-
title: 'live · ' + live.cwd,
|
|
88
|
-
count: liveTranscript.length,
|
|
89
|
-
style: 'margin:8px 0',
|
|
90
|
-
children: h('div', { style: 'padding:14px 18px;display:flex;flex-direction:column;gap:4px;background:var(--bg-2);border-radius:10px' },
|
|
91
|
-
...liveTranscript.map((l, i) => Line(l, i)),
|
|
92
|
-
h('div', { class: 'cli', style: 'margin-top:6px' },
|
|
93
|
-
h('span', { class: 'prompt' }, '$'),
|
|
94
|
-
h('input', {
|
|
95
|
-
value: live.input,
|
|
96
|
-
placeholder: 'type a command and press enter…',
|
|
97
|
-
style: 'flex:1;background:transparent;border:0;outline:0;font-family:var(--ff-mono);font-size:13px;color:var(--fg)',
|
|
98
|
-
oninput: (e) => { live.input = e.target.value; },
|
|
99
|
-
onkeydown: (e) => {
|
|
100
|
-
if (e.key === 'Enter' && live.input.trim()) {
|
|
101
|
-
liveTranscript.push({ kind: 'cmd', text: live.input });
|
|
102
|
-
liveTranscript.push({ kind: 'out', text: '(stub) ran: ' + live.input });
|
|
103
|
-
live.input = '';
|
|
104
|
-
kit.render();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
})
|
|
108
|
-
)
|
|
109
|
-
)
|
|
110
|
-
}),
|
|
111
|
-
|
|
112
|
-
// Demo loop — decorative showcase only.
|
|
113
|
-
Panel({
|
|
114
|
-
title: 'demo · build pipeline',
|
|
115
|
-
count: demo.visible.length + '/' + demoScript.length,
|
|
116
|
-
style: 'margin:8px 0',
|
|
117
|
-
children: h('div', { style: 'padding:14px 18px;display:flex;flex-direction:column;gap:4px;background:var(--bg-2);border-radius:10px;min-height:280px' },
|
|
118
|
-
...demo.visible.map((l, i) => Line(l, i, { cursor: i === demo.visible.length - 1 && demo.looping }))
|
|
119
|
-
)
|
|
120
|
-
}),
|
|
121
|
-
|
|
122
|
-
Panel({ title: 'about this kit', style: 'margin:8px 0', children: h('div', { class: 'ds-pattern-notes' },
|
|
123
|
-
h('p', {}, '· ', Chip({ tone: 'accent', children: '.cli' }), ' rows pair ', h('code', {}, '.prompt'), ' + ', h('code', {}, '.cmd'), '.'),
|
|
124
|
-
h('p', {}, '· six line kinds: ', Chip({ tone: 'dim', children: 'cmt' }), ' ', Chip({ tone: 'dim', children: 'cmd' }), ' ', Chip({ tone: 'dim', children: 'out' }), ' ', Chip({ tone: 'accent', children: 'ok' }), ' ', Chip({ tone: '', children: 'warn' }), ' ', Chip({ tone: 'dim', children: 'log' }), '.'),
|
|
125
|
-
h('p', {}, '· live panel is instant; demo panel reveals lines on a loop for the showcase only — never fake-animate output a user is waiting on.')
|
|
126
|
-
) })
|
|
127
|
-
)
|
|
128
|
-
],
|
|
129
|
-
status: Status({
|
|
130
|
-
left: ['terminal', '• live ' + liveTranscript.length + ' lines', demo.looping ? '• demo playing' : '• demo still'],
|
|
131
|
-
right: ['247420 / mmxxvi']
|
|
132
|
-
})
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const kit = mountKit({ root, view: App, screen: '09 Terminal' });
|
|
137
|
-
|
|
138
|
-
// Demo loop animation. Stays off when prefers-reduced-motion is on.
|
|
139
|
-
if (demo.looping) {
|
|
140
|
-
let i = 0;
|
|
141
|
-
function tick() {
|
|
142
|
-
if (i >= demoScript.length) {
|
|
143
|
-
setTimeout(() => { demo.visible = []; i = 0; kit.render(); tick(); }, 2500);
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const step = demoScript[i++];
|
|
147
|
-
setTimeout(() => { demo.visible.push(step); kit.render(); tick(); }, step.d);
|
|
148
|
-
}
|
|
149
|
-
tick();
|
|
150
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en" data-theme="auto" class="ds-247420"><head>
|
|
3
|
-
<meta charset="utf-8">
|
|
4
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
|
-
<meta name="theme-color" content="#247420" media="(prefers-color-scheme: light)">
|
|
6
|
-
<meta name="theme-color" content="#3A9A34" media="(prefers-color-scheme: dark)">
|
|
7
|
-
<meta name="color-scheme" content="light dark">
|
|
8
|
-
<title>terminal / 247420</title>
|
|
9
|
-
<meta name="description" content="terminal ui kit — cli prompt, command lines, log viewer.">
|
|
10
|
-
<link rel="canonical" href="https://anentrypoint.github.io/design/ui_kits/terminal/">
|
|
11
|
-
<link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
|
12
|
-
<link rel="stylesheet" href="../../colors_and_type.css">
|
|
13
|
-
<link rel="stylesheet" href="../../app-shell.css">
|
|
14
|
-
<script type="importmap">
|
|
15
|
-
{ "imports": {
|
|
16
|
-
"webjsx": "../../vendor/webjsx/index.js",
|
|
17
|
-
"webjsx/": "../../vendor/webjsx/",
|
|
18
|
-
"webjsx/jsx-runtime": "../../vendor/webjsx/jsx-runtime.js",
|
|
19
|
-
"ds/": "../../src/"
|
|
20
|
-
} }
|
|
21
|
-
</script>
|
|
22
|
-
</head>
|
|
23
|
-
<body data-screen-label="09 Terminal">
|
|
24
|
-
<div id="root"></div>
|
|
25
|
-
<script type="module" src="./app.js"></script>
|
|
26
|
-
</body></html>
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { updateAttributes } from "./attributes.js";
|
|
2
|
-
import { createDOMElement } from "./createDOMElement.js";
|
|
3
|
-
import { assignRef, flattenVNodes, getChildNodes, getNamespaceURI, getWebJSXChildNodeCache, getWebJSXProps, isNonBooleanPrimitive, isVElement, setWebJSXChildNodeCache, setWebJSXProps, } from "./utils.js";
|
|
4
|
-
export function applyDiff(parent, vnodes) {
|
|
5
|
-
const newVNodes = flattenVNodes(vnodes);
|
|
6
|
-
const newNodes = diffChildren(parent, newVNodes);
|
|
7
|
-
const props = getWebJSXProps(parent);
|
|
8
|
-
props.children = newVNodes;
|
|
9
|
-
setWebJSXChildNodeCache(parent, newNodes);
|
|
10
|
-
}
|
|
11
|
-
function diffChildren(parent, newVNodes) {
|
|
12
|
-
const parentProps = getWebJSXProps(parent);
|
|
13
|
-
const oldVNodes = parentProps.children ?? [];
|
|
14
|
-
if (newVNodes.length === 0) {
|
|
15
|
-
if (oldVNodes.length > 0) {
|
|
16
|
-
parent.innerHTML = "";
|
|
17
|
-
return [];
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
// If the parent
|
|
21
|
-
// a) never had any nodes
|
|
22
|
-
// b) OR was managing content via dangerouslySetInnerHTML
|
|
23
|
-
// we must not set parent.innerHTML = "";
|
|
24
|
-
return [];
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const changes = [];
|
|
28
|
-
let keyedMap = null;
|
|
29
|
-
const originalChildNodes = getWebJSXChildNodeCache(parent) ?? getChildNodes(parent);
|
|
30
|
-
let hasKeyedNodes = false;
|
|
31
|
-
let nodeOrderUnchanged = true;
|
|
32
|
-
for (let i = 0; i < newVNodes.length; i++) {
|
|
33
|
-
const newVNode = newVNodes[i];
|
|
34
|
-
const oldVNode = oldVNodes[i];
|
|
35
|
-
const currentNode = originalChildNodes[i];
|
|
36
|
-
const newKey = isVElement(newVNode) ? newVNode.props.key : undefined;
|
|
37
|
-
if (newKey !== undefined) {
|
|
38
|
-
if (!keyedMap) {
|
|
39
|
-
hasKeyedNodes = true;
|
|
40
|
-
keyedMap = new Map();
|
|
41
|
-
for (let j = 0; j < oldVNodes.length; j++) {
|
|
42
|
-
const matchingVNode = oldVNodes[j];
|
|
43
|
-
const key = matchingVNode.props.key;
|
|
44
|
-
if (key !== undefined) {
|
|
45
|
-
const node = originalChildNodes[j];
|
|
46
|
-
keyedMap.set(key, { node, oldVNode: matchingVNode });
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
const keyedNode = keyedMap.get(newKey);
|
|
51
|
-
if (keyedNode) {
|
|
52
|
-
if (keyedNode.oldVNode !== oldVNode) {
|
|
53
|
-
nodeOrderUnchanged = false;
|
|
54
|
-
}
|
|
55
|
-
changes.push({
|
|
56
|
-
type: "update",
|
|
57
|
-
node: keyedNode.node,
|
|
58
|
-
newVNode,
|
|
59
|
-
oldVNode: keyedNode.oldVNode,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
nodeOrderUnchanged = false;
|
|
64
|
-
changes.push({ type: "create", vnode: newVNode });
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
if (!hasKeyedNodes &&
|
|
69
|
-
canUpdateVNodes(newVNode, oldVNode) &&
|
|
70
|
-
currentNode) {
|
|
71
|
-
changes.push({
|
|
72
|
-
type: "update",
|
|
73
|
-
node: currentNode,
|
|
74
|
-
newVNode,
|
|
75
|
-
oldVNode,
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
nodeOrderUnchanged = false;
|
|
80
|
-
changes.push({ type: "create", vnode: newVNode });
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (changes.length) {
|
|
85
|
-
const { nodes, lastNode: lastPlacedNode } = applyChanges(parent, changes, originalChildNodes, nodeOrderUnchanged);
|
|
86
|
-
// Remove any remaining nodes
|
|
87
|
-
while (lastPlacedNode?.nextSibling) {
|
|
88
|
-
parent.removeChild(lastPlacedNode.nextSibling);
|
|
89
|
-
}
|
|
90
|
-
return nodes;
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
return originalChildNodes;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
function canUpdateVNodes(newVNode, oldVNode) {
|
|
97
|
-
if (oldVNode === undefined)
|
|
98
|
-
return false;
|
|
99
|
-
if (isNonBooleanPrimitive(newVNode) && isNonBooleanPrimitive(oldVNode)) {
|
|
100
|
-
return true;
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
if (isVElement(oldVNode) && isVElement(newVNode)) {
|
|
104
|
-
const oldKey = oldVNode.props.key;
|
|
105
|
-
const newKey = newVNode.props.key;
|
|
106
|
-
return (oldVNode.tagName === newVNode.tagName &&
|
|
107
|
-
((oldKey === undefined && newKey === undefined) ||
|
|
108
|
-
(oldKey !== undefined && newKey !== undefined && oldKey === newKey)));
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
function applyChanges(parent, changes, originalNodes, nodeOrderUnchanged) {
|
|
116
|
-
const nodes = [];
|
|
117
|
-
let lastPlacedNode = null;
|
|
118
|
-
for (const change of changes) {
|
|
119
|
-
if (change.type === "create") {
|
|
120
|
-
let node = undefined;
|
|
121
|
-
if (isVElement(change.vnode)) {
|
|
122
|
-
node = createDOMElement(change.vnode, getNamespaceURI(parent));
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
node = document.createTextNode(`${change.vnode}`);
|
|
126
|
-
}
|
|
127
|
-
if (!lastPlacedNode) {
|
|
128
|
-
parent.prepend(node);
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
parent.insertBefore(node, lastPlacedNode.nextSibling ?? null);
|
|
132
|
-
}
|
|
133
|
-
lastPlacedNode = node;
|
|
134
|
-
nodes.push(node);
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
const { node, newVNode, oldVNode } = change;
|
|
138
|
-
if (isVElement(newVNode)) {
|
|
139
|
-
const oldProps = oldVNode?.props || {};
|
|
140
|
-
const newProps = newVNode.props;
|
|
141
|
-
updateAttributes(node, newProps, oldProps);
|
|
142
|
-
if (newVNode.props.key !== undefined) {
|
|
143
|
-
node.__webjsx_key = newVNode.props.key;
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
if (oldVNode.props?.key) {
|
|
147
|
-
delete node.__webjsx_key;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
if (newVNode.props.ref) {
|
|
151
|
-
assignRef(node, newVNode.props.ref);
|
|
152
|
-
}
|
|
153
|
-
if (!newProps.dangerouslySetInnerHTML && newProps.children != null) {
|
|
154
|
-
const childNodes = diffChildren(node, newProps.children);
|
|
155
|
-
setWebJSXProps(node, newProps);
|
|
156
|
-
setWebJSXChildNodeCache(node, childNodes);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
if (newVNode !== oldVNode) {
|
|
161
|
-
node.textContent = `${newVNode}`;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
if (!nodeOrderUnchanged) {
|
|
165
|
-
if (!lastPlacedNode) {
|
|
166
|
-
if (node !== originalNodes[0]) {
|
|
167
|
-
parent.prepend(node);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
if (lastPlacedNode.nextSibling !== node) {
|
|
172
|
-
parent.insertBefore(node, lastPlacedNode.nextSibling ?? null);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
lastPlacedNode = node;
|
|
177
|
-
nodes.push(node);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return { nodes, lastNode: lastPlacedNode };
|
|
181
|
-
}
|
|
182
|
-
//# sourceMappingURL=applyDiff.js.map
|