create-murasaki 0.2.1 → 0.4.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/package.json
CHANGED
|
@@ -61,3 +61,64 @@ code {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.links a:hover { border-bottom-color: #A855F7; }
|
|
64
|
+
|
|
65
|
+
.counter {
|
|
66
|
+
margin-top: 32px;
|
|
67
|
+
display: inline-flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 20px;
|
|
70
|
+
padding: 12px 24px;
|
|
71
|
+
border-radius: 12px;
|
|
72
|
+
background: rgba(168, 85, 247, 0.08);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.counter strong {
|
|
76
|
+
font-variant-numeric: tabular-nums;
|
|
77
|
+
font-size: 32px;
|
|
78
|
+
min-width: 56px;
|
|
79
|
+
text-align: center;
|
|
80
|
+
color: #A855F7;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.counter button {
|
|
84
|
+
width: 40px;
|
|
85
|
+
height: 40px;
|
|
86
|
+
border-radius: 999px;
|
|
87
|
+
border: 1px solid rgba(168, 85, 247, 0.3);
|
|
88
|
+
background: transparent;
|
|
89
|
+
color: #A855F7;
|
|
90
|
+
font-size: 18px;
|
|
91
|
+
font-weight: 600;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
transition: background 0.12s, transform 0.06s;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.counter button:hover { background: rgba(168, 85, 247, 0.15); }
|
|
97
|
+
.counter button:active { transform: scale(0.94); }
|
|
98
|
+
|
|
99
|
+
.actions {
|
|
100
|
+
margin-top: 24px;
|
|
101
|
+
display: flex;
|
|
102
|
+
gap: 12px;
|
|
103
|
+
flex-wrap: wrap;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.actions button {
|
|
108
|
+
padding: 10px 18px;
|
|
109
|
+
border-radius: 10px;
|
|
110
|
+
border: 1px solid rgba(168, 85, 247, 0.25);
|
|
111
|
+
background: rgba(168, 85, 247, 0.05);
|
|
112
|
+
color: #5B21B6;
|
|
113
|
+
font-size: 14px;
|
|
114
|
+
font-weight: 600;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
transition: background 0.12s, transform 0.06s;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media (prefers-color-scheme: dark) {
|
|
120
|
+
.actions button { color: #d8b4fe; }
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.actions button:hover { background: rgba(168, 85, 247, 0.15); }
|
|
124
|
+
.actions button:active { transform: scale(0.97); }
|
|
@@ -1,15 +1,53 @@
|
|
|
1
1
|
// src/app/page.tsx — the "/" route.
|
|
2
|
+
//
|
|
3
|
+
// Demonstrates client-side hooks (useState) and the native bridge
|
|
4
|
+
// (useNotification / useClipboard / useShell) from murasaki/jsx/dom.
|
|
2
5
|
|
|
3
6
|
import { Link } from 'murasaki'
|
|
7
|
+
import {
|
|
8
|
+
useClipboard,
|
|
9
|
+
useNotification,
|
|
10
|
+
useShell,
|
|
11
|
+
useState,
|
|
12
|
+
} from 'murasaki/jsx/dom'
|
|
4
13
|
|
|
5
14
|
export default function HomePage() {
|
|
15
|
+
const [count, setCount] = useState(0)
|
|
16
|
+
const notify = useNotification()
|
|
17
|
+
const clipboard = useClipboard()
|
|
18
|
+
const shell = useShell()
|
|
19
|
+
|
|
6
20
|
return (
|
|
7
21
|
<main>
|
|
8
22
|
<h1>Hello, Murasaki 🦋</h1>
|
|
9
23
|
<p>
|
|
10
24
|
This view lives in <code>src/app/page.tsx</code>.
|
|
11
25
|
</p>
|
|
12
|
-
|
|
26
|
+
|
|
27
|
+
<div className="counter">
|
|
28
|
+
<button onClick={() => setCount(count - 1)} aria-label="decrement">
|
|
29
|
+
−
|
|
30
|
+
</button>
|
|
31
|
+
<strong>{count}</strong>
|
|
32
|
+
<button onClick={() => setCount(count + 1)} aria-label="increment">
|
|
33
|
+
+
|
|
34
|
+
</button>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div className="actions">
|
|
38
|
+
<button onClick={() => notify({ title: 'Hello', body: `Count: ${count}` })}>
|
|
39
|
+
🔔 Notify
|
|
40
|
+
</button>
|
|
41
|
+
<button onClick={() => clipboard.write(`Count: ${count}`)}>
|
|
42
|
+
📋 Copy to clipboard
|
|
43
|
+
</button>
|
|
44
|
+
<button onClick={() => shell.openExternal('https://github.com/murasakijs/murasaki')}>
|
|
45
|
+
🔗 Open repo
|
|
46
|
+
</button>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<p className="hint">Edit this file — the window reloads instantly.</p>
|
|
50
|
+
|
|
13
51
|
<nav className="links">
|
|
14
52
|
<Link href="/about">About →</Link>
|
|
15
53
|
</nav>
|