create-murasaki 0.2.0 → 0.3.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-murasaki",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Scaffolder for Murasaki apps. Run with `npm create murasaki@latest`.",
5
5
  "keywords": [
6
6
  "murasaki",
@@ -7,6 +7,9 @@
7
7
  "dev": "murasaki dev"
8
8
  },
9
9
  "dependencies": {
10
- "murasaki": "^0.2.0"
10
+ "murasaki": "^0.3.0"
11
+ },
12
+ "devDependencies": {
13
+ "typescript": "^5.7.0"
11
14
  }
12
15
  }
@@ -61,3 +61,37 @@ 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); }
@@ -1,15 +1,34 @@
1
1
  // src/app/page.tsx — the "/" route.
2
+ //
3
+ // useState comes from murasaki/jsx/dom and runs inside the WebView
4
+ // after the client bundle hydrates the SSR shell.
2
5
 
3
6
  import { Link } from 'murasaki'
7
+ import { useState } from 'murasaki/jsx/dom'
4
8
 
5
9
  export default function HomePage() {
10
+ const [count, setCount] = useState(0)
6
11
  return (
7
12
  <main>
8
13
  <h1>Hello, Murasaki 🦋</h1>
9
14
  <p>
10
15
  This view lives in <code>src/app/page.tsx</code>.
11
16
  </p>
12
- <p className="hint">Edit the file and the window reloads instantly.</p>
17
+
18
+ <div className="counter">
19
+ <button onClick={() => setCount(count - 1)} aria-label="decrement">
20
+
21
+ </button>
22
+ <strong>{count}</strong>
23
+ <button onClick={() => setCount(count + 1)} aria-label="increment">
24
+ +
25
+ </button>
26
+ </div>
27
+
28
+ <p className="hint">
29
+ Edit the file — the window reloads instantly.
30
+ </p>
31
+
13
32
  <nav className="links">
14
33
  <Link href="/about">About →</Link>
15
34
  </nav>