@lark-apaas/coding-registry-buildless 0.1.0 → 0.1.2-alpha.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/README.md +16 -11
- package/components/android-frame.jsx +189 -0
- package/components/animations.jsx +680 -0
- package/components/browser-window.jsx +122 -0
- package/components/design-canvas.jsx +1125 -0
- package/components/ios-frame.jsx +270 -0
- package/components/macos-window.jsx +197 -0
- package/components/tweaks-panel.jsx +724 -71
- package/package.json +14 -3
- package/scripts/deck-stage.js +1795 -85
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/* BEGIN USAGE */
|
|
2
|
+
// Chrome.jsx — Simplified Chrome browser window (dark theme, macOS)
|
|
3
|
+
// No dependencies, no image assets. All inline styles + inline SVG.
|
|
4
|
+
// Exports (to window): ChromeWindow, ChromeTabBar, ChromeToolbar, ChromeTab, ChromeTrafficLights
|
|
5
|
+
//
|
|
6
|
+
// Usage — wrap your page content in <ChromeWindow> to get the tab bar + URL bar:
|
|
7
|
+
//
|
|
8
|
+
// <ChromeWindow width={1100} height={680} url="acme.design/pricing">
|
|
9
|
+
// ...your page content...
|
|
10
|
+
// </ChromeWindow>
|
|
11
|
+
/* END USAGE */
|
|
12
|
+
|
|
13
|
+
const CHROME_C = {
|
|
14
|
+
barBg: '#202124',
|
|
15
|
+
tabBg: '#35363a',
|
|
16
|
+
text: '#e8eaed',
|
|
17
|
+
dim: '#9aa0a6',
|
|
18
|
+
urlBg: '#282a2d',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function ChromeTrafficLights() {
|
|
22
|
+
return (
|
|
23
|
+
<div style={{ display: 'flex', gap: 8, padding: '0 14px' }}>
|
|
24
|
+
<div style={{ width: 12, height: 12, borderRadius: '50%', background: '#ff5f57' }} />
|
|
25
|
+
<div style={{ width: 12, height: 12, borderRadius: '50%', background: '#febc2e' }} />
|
|
26
|
+
<div style={{ width: 12, height: 12, borderRadius: '50%', background: '#28c840' }} />
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Single tab (active has curved scoops)
|
|
32
|
+
function ChromeTab({ title = 'New Tab', active = false }) {
|
|
33
|
+
const curve = (flip) => (
|
|
34
|
+
<svg width="8" height="10" viewBox="0 0 8 10"
|
|
35
|
+
style={{ position: 'absolute', bottom: 0, [flip ? 'right' : 'left']: -8, transform: flip ? 'scaleX(-1)' : 'none' }}>
|
|
36
|
+
<path d="M0 10C2 9 6 8 8 0V10H0Z" fill={CHROME_C.tabBg}/>
|
|
37
|
+
</svg>
|
|
38
|
+
);
|
|
39
|
+
return (
|
|
40
|
+
<div style={{
|
|
41
|
+
position: 'relative', height: 34, alignSelf: 'flex-end',
|
|
42
|
+
padding: '0 12px', display: 'flex', alignItems: 'center', gap: 8,
|
|
43
|
+
background: active ? CHROME_C.tabBg : 'transparent',
|
|
44
|
+
borderRadius: '8px 8px 0 0', minWidth: 120, maxWidth: 220,
|
|
45
|
+
fontFamily: 'system-ui, sans-serif', fontSize: 12,
|
|
46
|
+
color: active ? CHROME_C.text : CHROME_C.dim,
|
|
47
|
+
}}>
|
|
48
|
+
{active && curve(false)}
|
|
49
|
+
{active && curve(true)}
|
|
50
|
+
<div style={{ width: 14, height: 14, borderRadius: '50%', background: '#5f6368', flexShrink: 0 }} />
|
|
51
|
+
<span style={{ flex: 1, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{title}</span>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function ChromeTabBar({ tabs = [{ title: 'New Tab' }], activeIndex = 0 }) {
|
|
57
|
+
return (
|
|
58
|
+
<div style={{
|
|
59
|
+
display: 'flex', alignItems: 'center', height: 44,
|
|
60
|
+
background: CHROME_C.barBg, paddingRight: 8,
|
|
61
|
+
}}>
|
|
62
|
+
<ChromeTrafficLights />
|
|
63
|
+
<div style={{ display: 'flex', alignItems: 'flex-end', height: '100%', paddingLeft: 4, flex: 1 }}>
|
|
64
|
+
{tabs.map((t, i) => <ChromeTab key={i} title={t.title} active={i === activeIndex} />)}
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function ChromeToolbar({ url = 'example.com' }) {
|
|
71
|
+
const iconDot = (
|
|
72
|
+
<div style={{
|
|
73
|
+
width: 28, height: 28, display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
74
|
+
}}>
|
|
75
|
+
<div style={{ width: 16, height: 16, borderRadius: '50%', background: CHROME_C.dim, opacity: 0.4 }} />
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
return (
|
|
79
|
+
<div style={{
|
|
80
|
+
height: 40, background: CHROME_C.tabBg,
|
|
81
|
+
display: 'flex', alignItems: 'center', gap: 4, padding: '0 8px',
|
|
82
|
+
}}>
|
|
83
|
+
{iconDot}
|
|
84
|
+
{/* url bar */}
|
|
85
|
+
<div style={{
|
|
86
|
+
flex: 1, height: 30, borderRadius: 15, background: CHROME_C.urlBg,
|
|
87
|
+
display: 'flex', alignItems: 'center', gap: 8, padding: '0 14px',
|
|
88
|
+
margin: '0 6px',
|
|
89
|
+
}}>
|
|
90
|
+
<div style={{ width: 12, height: 12, borderRadius: '50%', background: CHROME_C.dim, opacity: 0.4 }} />
|
|
91
|
+
<span style={{
|
|
92
|
+
flex: 1, color: CHROME_C.text, fontSize: 13,
|
|
93
|
+
fontFamily: 'system-ui, sans-serif',
|
|
94
|
+
}}>{url}</span>
|
|
95
|
+
</div>
|
|
96
|
+
{iconDot}
|
|
97
|
+
</div>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function ChromeWindow({
|
|
102
|
+
tabs = [{ title: 'New Tab' }], activeIndex = 0, url = 'example.com',
|
|
103
|
+
width = 900, height = 600, children,
|
|
104
|
+
}) {
|
|
105
|
+
return (
|
|
106
|
+
<div style={{
|
|
107
|
+
width, height, borderRadius: 10, overflow: 'hidden',
|
|
108
|
+
boxShadow: '0 24px 80px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.1)',
|
|
109
|
+
display: 'flex', flexDirection: 'column', background: CHROME_C.tabBg,
|
|
110
|
+
}}>
|
|
111
|
+
<ChromeTabBar tabs={tabs} activeIndex={activeIndex} />
|
|
112
|
+
<ChromeToolbar url={url} />
|
|
113
|
+
<div style={{ flex: 1, background: '#fff', overflow: 'auto' }}>
|
|
114
|
+
{children}
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
Object.assign(window, {
|
|
121
|
+
ChromeWindow, ChromeTabBar, ChromeToolbar, ChromeTab, ChromeTrafficLights,
|
|
122
|
+
});
|