create-wervt 0.2.4 → 0.2.6
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 +1 -1
- package/template/.claude/skills/nuxt-ui/SKILL.md +334 -0
- package/template/.claude/skills/nuxt-ui/references/components.md +377 -0
- package/template/.claude/skills/nuxt-ui/references/composables.md +127 -0
- package/template/.claude/skills/nuxt-ui/references/layouts/chat.md +195 -0
- package/template/.claude/skills/nuxt-ui/references/layouts/dashboard.md +220 -0
- package/template/.claude/skills/nuxt-ui/references/layouts/docs.md +141 -0
- package/template/.claude/skills/nuxt-ui/references/layouts/editor.md +167 -0
- package/template/.claude/skills/nuxt-ui/references/layouts/page.md +260 -0
- package/template/.claude/skills/nuxt-ui/references/theming.md +427 -0
- package/template/.claude/skills/nuxt-ui-mobile/SKILL.md +92 -0
- package/template/.claude/skills/nuxt-ui-mobile/examples/app/composables/useDemoItems.ts +18 -0
- package/template/.claude/skills/nuxt-ui-mobile/examples/app/pages/index.vue +121 -0
- package/template/.claude/skills/nuxt-ui-mobile/examples/app/pages/items/[id].vue +77 -0
- package/template/.claude/skills/nuxt-ui-mobile/examples/app/pages/settings/index.vue +71 -0
- package/template/.claude/skills/nuxt-ui-mobile/examples/app/pages/settings/sort.vue +23 -0
- package/template/.claude/skills/nuxt-ui-mobile/references/patterns.md +212 -0
- package/template/.claude/skills/nuxt-ui-mobile/references/review-checklist.md +49 -0
- package/template/.claude/skills/nuxt-ui-mobile/references/tokens.md +86 -0
- package/template/.claude/skills/nuxt-ui-mobile/scripts/gen-palette.mjs +58 -0
- package/template/.claude/skills/nuxt-ui-mobile/template/app/app.config.ts +298 -0
- package/template/.claude/skills/nuxt-ui-mobile/template/app/app.vue +8 -0
- package/template/.claude/skills/nuxt-ui-mobile/template/app/assets/css/main.css +331 -0
- package/template/.claude/skills/nuxt-ui-mobile/template/app/components/mobile/ActionSheet.vue +47 -0
- package/template/.claude/skills/nuxt-ui-mobile/template/app/components/mobile/ListRow.vue +73 -0
- package/template/.claude/skills/nuxt-ui-mobile/template/app/components/mobile/ListSection.vue +26 -0
- package/template/.claude/skills/nuxt-ui-mobile/template/app/components/mobile/NavBar.vue +88 -0
- package/template/.claude/skills/nuxt-ui-mobile/template/app/components/mobile/TabBar.vue +45 -0
- package/template/.claude/skills/nuxt-ui-mobile/template/app/layouts/default.vue +16 -0
- package/template/.claude/skills/nuxt-ui-mobile/template/app/layouts/plain.vue +6 -0
- package/template/.claude/skills/nuxt-ui-mobile/template/nuxt.config.ts +27 -0
- package/template/AGENTS.md +33 -1
- package/template/package.json +2 -2
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
@import "@nuxt/ui";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* nuxt-ui-mobile — iOS-flavoured tokens for Nuxt UI.
|
|
6
|
+
* Values follow Apple's HIG (Dynamic Type "Large" defaults, system colors);
|
|
7
|
+
* pt map 1:1 to CSS px.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
@theme static {
|
|
11
|
+
/* system-ui resolves to SF Pro on Apple devices; Safari applies SF's optical tracking itself, so no letter-spacing here */
|
|
12
|
+
--font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
13
|
+
--font-rounded: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
|
|
14
|
+
--font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
|
|
15
|
+
|
|
16
|
+
--text-large-title: 2.125rem;
|
|
17
|
+
--text-large-title--line-height: 2.5625rem;
|
|
18
|
+
--text-large-title--font-weight: 700;
|
|
19
|
+
--text-title-1: 1.75rem;
|
|
20
|
+
--text-title-1--line-height: 2.125rem;
|
|
21
|
+
--text-title-1--font-weight: 700;
|
|
22
|
+
--text-title-2: 1.375rem;
|
|
23
|
+
--text-title-2--line-height: 1.75rem;
|
|
24
|
+
--text-title-2--font-weight: 700;
|
|
25
|
+
--text-title-3: 1.25rem;
|
|
26
|
+
--text-title-3--line-height: 1.5625rem;
|
|
27
|
+
--text-title-3--font-weight: 600;
|
|
28
|
+
--text-headline: 1.0625rem;
|
|
29
|
+
--text-headline--line-height: 1.375rem;
|
|
30
|
+
--text-headline--font-weight: 600;
|
|
31
|
+
--text-body: 1.0625rem;
|
|
32
|
+
--text-body--line-height: 1.375rem;
|
|
33
|
+
--text-callout: 1rem;
|
|
34
|
+
--text-callout--line-height: 1.3125rem;
|
|
35
|
+
--text-subhead: 0.9375rem;
|
|
36
|
+
--text-subhead--line-height: 1.25rem;
|
|
37
|
+
--text-footnote: 0.8125rem;
|
|
38
|
+
--text-footnote--line-height: 1.125rem;
|
|
39
|
+
--text-caption-1: 0.75rem;
|
|
40
|
+
--text-caption-1--line-height: 1rem;
|
|
41
|
+
--text-caption-2: 0.6875rem;
|
|
42
|
+
--text-caption-2--line-height: 0.8125rem;
|
|
43
|
+
|
|
44
|
+
/* blue: 500 = light (increased contrast), 400 = dark */
|
|
45
|
+
--color-ios-blue-50: oklch(97.3% 0.014 244.2);
|
|
46
|
+
--color-ios-blue-100: oklch(93.6% 0.032 247.8);
|
|
47
|
+
--color-ios-blue-200: oklch(88.5% 0.058 252.8);
|
|
48
|
+
--color-ios-blue-300: oklch(81.4% 0.094 256.2);
|
|
49
|
+
--color-ios-blue-400: oklch(65.1% 0.192 251.5);
|
|
50
|
+
--color-ios-blue-500: oklch(57.3% 0.215 260.6);
|
|
51
|
+
--color-ios-blue-600: oklch(49.3% 0.204 260.6);
|
|
52
|
+
--color-ios-blue-700: oklch(42.4% 0.182 260.9);
|
|
53
|
+
--color-ios-blue-800: oklch(35.4% 0.150 260.7);
|
|
54
|
+
--color-ios-blue-900: oklch(29.3% 0.118 260.6);
|
|
55
|
+
--color-ios-blue-950: oklch(21.3% 0.086 260.6);
|
|
56
|
+
/* green: 500 = light (increased contrast), 400 = dark */
|
|
57
|
+
--color-ios-green-50: oklch(97.5% 0.016 147.4);
|
|
58
|
+
--color-ios-green-100: oklch(94.0% 0.036 147.4);
|
|
59
|
+
--color-ios-green-200: oklch(89.0% 0.068 147.4);
|
|
60
|
+
--color-ios-green-300: oklch(82.0% 0.110 147.4);
|
|
61
|
+
--color-ios-green-400: oklch(75.6% 0.208 147.0);
|
|
62
|
+
--color-ios-green-500: oklch(54.9% 0.161 147.4);
|
|
63
|
+
--color-ios-green-600: oklch(47.3% 0.147 145.4);
|
|
64
|
+
--color-ios-green-700: oklch(40.5% 0.129 144.5);
|
|
65
|
+
--color-ios-green-800: oklch(33.4% 0.106 144.5);
|
|
66
|
+
--color-ios-green-900: oklch(27.2% 0.085 145.3);
|
|
67
|
+
--color-ios-green-950: oklch(19.2% 0.061 144.6);
|
|
68
|
+
/* red: 500 = light (increased contrast), 400 = dark */
|
|
69
|
+
--color-ios-red-50: oklch(96.9% 0.015 28.3);
|
|
70
|
+
--color-ios-red-100: oklch(92.8% 0.036 27.2);
|
|
71
|
+
--color-ios-red-200: oklch(87.7% 0.065 25.8);
|
|
72
|
+
--color-ios-red-300: oklch(80.6% 0.110 25.0);
|
|
73
|
+
--color-ios-red-400: oklch(66.2% 0.225 25.1);
|
|
74
|
+
--color-ios-red-500: oklch(59.4% 0.233 24.7);
|
|
75
|
+
--color-ios-red-600: oklch(52.3% 0.213 26.5);
|
|
76
|
+
--color-ios-red-700: oklch(45.6% 0.186 27.4);
|
|
77
|
+
--color-ios-red-800: oklch(38.1% 0.155 26.8);
|
|
78
|
+
--color-ios-red-900: oklch(31.5% 0.127 24.9);
|
|
79
|
+
--color-ios-red-950: oklch(23.4% 0.093 24.7);
|
|
80
|
+
/* orange: 500 = light (increased contrast), 400 = dark */
|
|
81
|
+
--color-ios-orange-50: oklch(97.4% 0.015 49.8);
|
|
82
|
+
--color-ios-orange-100: oklch(93.8% 0.034 47.6);
|
|
83
|
+
--color-ios-orange-200: oklch(88.7% 0.065 47.5);
|
|
84
|
+
--color-ios-orange-300: oklch(81.9% 0.110 46.3);
|
|
85
|
+
--color-ios-orange-400: oklch(76.2% 0.167 57.1);
|
|
86
|
+
--color-ios-orange-500: oklch(58.1% 0.163 46.0);
|
|
87
|
+
--color-ios-orange-600: oklch(50.2% 0.151 42.2);
|
|
88
|
+
--color-ios-orange-700: oklch(43.2% 0.134 40.7);
|
|
89
|
+
--color-ios-orange-800: oklch(36.2% 0.111 41.4);
|
|
90
|
+
--color-ios-orange-900: oklch(30.2% 0.088 43.7);
|
|
91
|
+
--color-ios-orange-950: oklch(22.1% 0.064 44.1);
|
|
92
|
+
/* indigo: 500 = light (increased contrast), 400 = dark */
|
|
93
|
+
--color-ios-indigo-50: oklch(97.3% 0.013 274.7);
|
|
94
|
+
--color-ios-indigo-100: oklch(93.6% 0.031 276.2);
|
|
95
|
+
--color-ios-indigo-200: oklch(88.5% 0.057 277.8);
|
|
96
|
+
--color-ios-indigo-300: oklch(81.4% 0.094 278.9);
|
|
97
|
+
--color-ios-indigo-400: oklch(64.1% 0.193 274.7);
|
|
98
|
+
--color-ios-indigo-500: oklch(51.5% 0.216 279.3);
|
|
99
|
+
--color-ios-indigo-600: oklch(43.5% 0.205 279.3);
|
|
100
|
+
--color-ios-indigo-700: oklch(36.5% 0.183 279.3);
|
|
101
|
+
--color-ios-indigo-800: oklch(29.5% 0.151 279.3);
|
|
102
|
+
--color-ios-indigo-900: oklch(23.5% 0.119 279.3);
|
|
103
|
+
--color-ios-indigo-950: oklch(15.5% 0.086 279.3);
|
|
104
|
+
/* teal: 500 = light (increased contrast), 400 = dark */
|
|
105
|
+
--color-ios-teal-50: oklch(97.5% 0.010 216.1);
|
|
106
|
+
--color-ios-teal-100: oklch(94.0% 0.022 216.1);
|
|
107
|
+
--color-ios-teal-200: oklch(89.0% 0.041 216.1);
|
|
108
|
+
--color-ios-teal-300: oklch(82.0% 0.067 216.1);
|
|
109
|
+
--color-ios-teal-400: oklch(78.7% 0.134 203.3);
|
|
110
|
+
--color-ios-teal-500: oklch(55.6% 0.099 216.1);
|
|
111
|
+
--color-ios-teal-600: oklch(48.0% 0.086 218.2);
|
|
112
|
+
--color-ios-teal-700: oklch(41.1% 0.074 219.2);
|
|
113
|
+
--color-ios-teal-800: oklch(34.0% 0.062 219.1);
|
|
114
|
+
--color-ios-teal-900: oklch(27.8% 0.050 218.1);
|
|
115
|
+
--color-ios-teal-950: oklch(19.8% 0.036 218.6);
|
|
116
|
+
/* purple: 500 = light (increased contrast), 400 = dark */
|
|
117
|
+
--color-ios-purple-50: oklch(97.5% 0.022 324.8);
|
|
118
|
+
--color-ios-purple-100: oklch(94.0% 0.050 322.9);
|
|
119
|
+
--color-ios-purple-200: oklch(88.9% 0.095 323.3);
|
|
120
|
+
--color-ios-purple-300: oklch(82.0% 0.156 322.5);
|
|
121
|
+
--color-ios-purple-400: oklch(65.8% 0.279 322.4);
|
|
122
|
+
--color-ios-purple-500: oklch(56.3% 0.230 322.4);
|
|
123
|
+
--color-ios-purple-600: oklch(48.3% 0.218 322.4);
|
|
124
|
+
--color-ios-purple-700: oklch(41.3% 0.195 322.4);
|
|
125
|
+
--color-ios-purple-800: oklch(34.3% 0.161 322.4);
|
|
126
|
+
--color-ios-purple-900: oklch(28.3% 0.126 322.4);
|
|
127
|
+
--color-ios-purple-950: oklch(20.3% 0.092 322.4);
|
|
128
|
+
/* pink: 500 = light (increased contrast), 400 = dark */
|
|
129
|
+
--color-ios-pink-50: oklch(96.9% 0.015 14.9);
|
|
130
|
+
--color-ios-pink-100: oklch(92.9% 0.036 14.7);
|
|
131
|
+
--color-ios-pink-200: oklch(87.7% 0.066 14.9);
|
|
132
|
+
--color-ios-pink-300: oklch(80.6% 0.112 15.0);
|
|
133
|
+
--color-ios-pink-400: oklch(65.8% 0.232 16.0);
|
|
134
|
+
--color-ios-pink-500: oklch(59.4% 0.231 15.9);
|
|
135
|
+
--color-ios-pink-600: oklch(52.3% 0.209 17.7);
|
|
136
|
+
--color-ios-pink-700: oklch(45.5% 0.183 18.5);
|
|
137
|
+
--color-ios-pink-800: oklch(38.2% 0.153 18.0);
|
|
138
|
+
--color-ios-pink-900: oklch(31.5% 0.126 16.3);
|
|
139
|
+
--color-ios-pink-950: oklch(23.4% 0.093 15.9);
|
|
140
|
+
/* gray: iOS systemGray…systemGray6 (light) continuing into the dark-mode grays */
|
|
141
|
+
--color-ios-gray-50: rgb(242 242 247);
|
|
142
|
+
--color-ios-gray-100: rgb(229 229 234);
|
|
143
|
+
--color-ios-gray-200: rgb(209 209 214);
|
|
144
|
+
--color-ios-gray-300: rgb(199 199 204);
|
|
145
|
+
--color-ios-gray-400: rgb(174 174 178);
|
|
146
|
+
--color-ios-gray-500: rgb(142 142 147);
|
|
147
|
+
--color-ios-gray-600: rgb(99 99 102);
|
|
148
|
+
--color-ios-gray-700: rgb(72 72 74);
|
|
149
|
+
--color-ios-gray-800: rgb(58 58 60);
|
|
150
|
+
--color-ios-gray-900: rgb(44 44 46);
|
|
151
|
+
--color-ios-gray-950: rgb(28 28 30);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@theme inline {
|
|
155
|
+
--color-grouped: var(--app-grouped);
|
|
156
|
+
--color-cell: var(--app-cell);
|
|
157
|
+
--color-fill: var(--app-fill);
|
|
158
|
+
--color-separator: var(--ui-border);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:root {
|
|
162
|
+
--ui-radius: 0.5rem;
|
|
163
|
+
--ui-header-height: 2.75rem;
|
|
164
|
+
--app-tabbar-height: 4.25rem;
|
|
165
|
+
|
|
166
|
+
/* label / secondaryLabel / tertiaryLabel, with secondary nudged from 60% to 72% opacity to pass WCAG AA on white */
|
|
167
|
+
--ui-text-highlighted: #000;
|
|
168
|
+
--ui-text: #000;
|
|
169
|
+
--ui-text-toned: rgb(60 60 67 / 0.85);
|
|
170
|
+
--ui-text-muted: rgb(60 60 67 / 0.72);
|
|
171
|
+
--ui-text-dimmed: rgb(60 60 67 / 0.45);
|
|
172
|
+
--ui-text-inverted: #fff;
|
|
173
|
+
|
|
174
|
+
--ui-bg: #fff;
|
|
175
|
+
--ui-bg-muted: var(--color-ios-gray-50);
|
|
176
|
+
--ui-bg-elevated: var(--color-ios-gray-100);
|
|
177
|
+
--ui-bg-accented: var(--color-ios-gray-200);
|
|
178
|
+
--ui-bg-inverted: #000;
|
|
179
|
+
|
|
180
|
+
--ui-border: rgb(60 60 67 / 0.29);
|
|
181
|
+
--ui-border-muted: rgb(60 60 67 / 0.18);
|
|
182
|
+
--ui-border-accented: rgb(60 60 67 / 0.36);
|
|
183
|
+
--ui-border-inverted: #000;
|
|
184
|
+
|
|
185
|
+
--app-grouped: var(--color-ios-gray-50);
|
|
186
|
+
--app-cell: #fff;
|
|
187
|
+
--app-fill: rgb(118 118 128 / 0.12);
|
|
188
|
+
--app-glass: rgb(255 255 255 / 0.72);
|
|
189
|
+
--app-glass-edge: rgb(0 0 0 / 0.08);
|
|
190
|
+
--app-glass-shadow: 0 8px 32px rgb(0 0 0 / 0.12);
|
|
191
|
+
--app-menu-divider: rgb(60 60 67 / 0.12);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.dark {
|
|
195
|
+
--ui-text-highlighted: #fff;
|
|
196
|
+
--ui-text: #fff;
|
|
197
|
+
--ui-text-toned: rgb(235 235 245 / 0.85);
|
|
198
|
+
--ui-text-muted: rgb(235 235 245 / 0.65);
|
|
199
|
+
--ui-text-dimmed: rgb(235 235 245 / 0.4);
|
|
200
|
+
--ui-text-inverted: #000;
|
|
201
|
+
|
|
202
|
+
/* sheets, popovers and cells sit on the elevated dark surface; the page itself is pure black */
|
|
203
|
+
--ui-bg: var(--color-ios-gray-950);
|
|
204
|
+
--ui-bg-muted: var(--color-ios-gray-900);
|
|
205
|
+
--ui-bg-elevated: var(--color-ios-gray-800);
|
|
206
|
+
--ui-bg-accented: var(--color-ios-gray-700);
|
|
207
|
+
--ui-bg-inverted: #fff;
|
|
208
|
+
|
|
209
|
+
--ui-border: rgb(84 84 88 / 0.65);
|
|
210
|
+
--ui-border-muted: rgb(84 84 88 / 0.45);
|
|
211
|
+
--ui-border-accented: rgb(84 84 88 / 0.85);
|
|
212
|
+
--ui-border-inverted: #fff;
|
|
213
|
+
|
|
214
|
+
--app-grouped: #000;
|
|
215
|
+
--app-cell: var(--color-ios-gray-950);
|
|
216
|
+
--app-fill: rgb(118 118 128 / 0.24);
|
|
217
|
+
--app-glass: rgb(37 37 40 / 0.7);
|
|
218
|
+
--app-glass-edge: rgb(255 255 255 / 0.1);
|
|
219
|
+
--app-glass-shadow: 0 8px 32px rgb(0 0 0 / 0.5);
|
|
220
|
+
--app-menu-divider: rgb(235 235 245 / 0.1);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@media (prefers-contrast: more) {
|
|
224
|
+
:root {
|
|
225
|
+
--ui-text-muted: rgb(60 60 67 / 0.9);
|
|
226
|
+
--ui-border: rgb(60 60 67 / 0.5);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.dark {
|
|
230
|
+
--ui-text-muted: rgb(235 235 245 / 0.85);
|
|
231
|
+
--ui-border: rgb(84 84 88 / 1);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* Floating chrome only (tab bar, scrolled nav bar, floating buttons) — never content cards (HIG: no glass in the content layer) */
|
|
236
|
+
@utility glass {
|
|
237
|
+
background-color: var(--app-glass);
|
|
238
|
+
-webkit-backdrop-filter: blur(24px) saturate(180%);
|
|
239
|
+
backdrop-filter: blur(24px) saturate(180%);
|
|
240
|
+
box-shadow: inset 0 0 0 0.5px var(--app-glass-edge), var(--app-glass-shadow);
|
|
241
|
+
|
|
242
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
243
|
+
background-color: var(--ui-bg);
|
|
244
|
+
-webkit-backdrop-filter: none;
|
|
245
|
+
backdrop-filter: none;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/* Same as glass without the floating shadow — for bars pinned edge to edge */
|
|
250
|
+
@utility glass-bar {
|
|
251
|
+
background-color: var(--app-glass);
|
|
252
|
+
-webkit-backdrop-filter: blur(24px) saturate(180%);
|
|
253
|
+
backdrop-filter: blur(24px) saturate(180%);
|
|
254
|
+
|
|
255
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
256
|
+
background-color: var(--ui-bg);
|
|
257
|
+
-webkit-backdrop-filter: none;
|
|
258
|
+
backdrop-filter: none;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/* Smaller glass for controls sitting on content, e.g. nav bar button groups (iOS 26 puts bar buttons on glass) */
|
|
263
|
+
@utility glass-control {
|
|
264
|
+
background-color: var(--app-glass);
|
|
265
|
+
-webkit-backdrop-filter: blur(16px) saturate(180%);
|
|
266
|
+
backdrop-filter: blur(16px) saturate(180%);
|
|
267
|
+
box-shadow: inset 0 0 0 0.5px var(--app-glass-edge), 0 2px 10px rgb(0 0 0 / 0.08);
|
|
268
|
+
|
|
269
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
270
|
+
background-color: var(--ui-bg);
|
|
271
|
+
-webkit-backdrop-filter: none;
|
|
272
|
+
backdrop-filter: none;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/* Grows the hit area to at least 44×44 without changing the visual size (HIG minimum) */
|
|
277
|
+
@utility touch-target {
|
|
278
|
+
&:where(:not(.absolute, .fixed, .sticky)) {
|
|
279
|
+
position: relative;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
&::after {
|
|
283
|
+
content: "";
|
|
284
|
+
position: absolute;
|
|
285
|
+
top: 50%;
|
|
286
|
+
left: 50%;
|
|
287
|
+
width: max(100%, 2.75rem);
|
|
288
|
+
height: max(100%, 2.75rem);
|
|
289
|
+
transform: translate(-50%, -50%);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
@utility pt-safe {
|
|
294
|
+
padding-top: env(safe-area-inset-top);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
@utility pb-safe {
|
|
298
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
@utility pl-safe {
|
|
302
|
+
padding-left: env(safe-area-inset-left);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
@utility pr-safe {
|
|
306
|
+
padding-right: env(safe-area-inset-right);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
@layer base {
|
|
310
|
+
html {
|
|
311
|
+
-webkit-text-size-adjust: 100%;
|
|
312
|
+
text-size-adjust: 100%;
|
|
313
|
+
-webkit-tap-highlight-color: transparent;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
body {
|
|
317
|
+
@apply bg-grouped text-body text-default;
|
|
318
|
+
min-height: 100dvh;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
a,
|
|
322
|
+
button,
|
|
323
|
+
input,
|
|
324
|
+
label,
|
|
325
|
+
select,
|
|
326
|
+
summary,
|
|
327
|
+
textarea,
|
|
328
|
+
[role="button"] {
|
|
329
|
+
touch-action: manipulation;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup lang="ts" generic="T">
|
|
2
|
+
export interface ActionSheetAction<V> {
|
|
3
|
+
label: string
|
|
4
|
+
value: V
|
|
5
|
+
icon?: string
|
|
6
|
+
destructive?: boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
defineProps<{
|
|
10
|
+
title?: string
|
|
11
|
+
message?: string
|
|
12
|
+
actions: ActionSheetAction<T>[]
|
|
13
|
+
cancelLabel?: string
|
|
14
|
+
}>()
|
|
15
|
+
|
|
16
|
+
// `undefined` means the sheet was cancelled (button, swipe down or tap outside)
|
|
17
|
+
const emit = defineEmits<{ close: [value: T | undefined] }>()
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<UDrawer :title="title" :description="message" @update:open="(open: boolean) => !open && emit('close', undefined)">
|
|
22
|
+
<template #body>
|
|
23
|
+
<div class="flex flex-col gap-2">
|
|
24
|
+
<UButton
|
|
25
|
+
v-for="action in actions"
|
|
26
|
+
:key="action.label"
|
|
27
|
+
:label="action.label"
|
|
28
|
+
:icon="action.icon"
|
|
29
|
+
:color="action.destructive ? 'error' : 'neutral'"
|
|
30
|
+
variant="soft"
|
|
31
|
+
size="lg"
|
|
32
|
+
block
|
|
33
|
+
@click="emit('close', action.value)"
|
|
34
|
+
/>
|
|
35
|
+
<UButton
|
|
36
|
+
:label="cancelLabel ?? 'Cancel'"
|
|
37
|
+
color="neutral"
|
|
38
|
+
variant="ghost"
|
|
39
|
+
size="lg"
|
|
40
|
+
block
|
|
41
|
+
class="font-bold"
|
|
42
|
+
@click="emit('close', undefined)"
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
</UDrawer>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { NuxtLink } from '#components'
|
|
3
|
+
|
|
4
|
+
// Vue casts absent boolean props to false; undefined keeps "not an option row" and "chevron follows `to`" distinguishable
|
|
5
|
+
const props = withDefaults(defineProps<{
|
|
6
|
+
title: string
|
|
7
|
+
subtitle?: string
|
|
8
|
+
/** Trailing secondary text, e.g. the current value of a setting */
|
|
9
|
+
value?: string
|
|
10
|
+
icon?: string
|
|
11
|
+
/** Semantic color of the Settings-style icon tile; without it the icon renders plain */
|
|
12
|
+
iconColor?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral'
|
|
13
|
+
to?: string
|
|
14
|
+
/** Disclosure chevron; defaults to on for rows with `to` (drill-down only, never for actions) */
|
|
15
|
+
chevron?: boolean
|
|
16
|
+
/** Checkmark for option lists — the iOS replacement for radio buttons */
|
|
17
|
+
selected?: boolean
|
|
18
|
+
destructive?: boolean
|
|
19
|
+
}>(), {
|
|
20
|
+
chevron: undefined,
|
|
21
|
+
selected: undefined
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const attrs = useAttrs()
|
|
25
|
+
const interactive = computed(() => !!props.to || !!attrs.onClick)
|
|
26
|
+
const showChevron = computed(() => props.chevron ?? !!props.to)
|
|
27
|
+
|
|
28
|
+
const tileColors = {
|
|
29
|
+
primary: 'bg-primary',
|
|
30
|
+
secondary: 'bg-secondary',
|
|
31
|
+
success: 'bg-success',
|
|
32
|
+
info: 'bg-info',
|
|
33
|
+
warning: 'bg-warning',
|
|
34
|
+
error: 'bg-error',
|
|
35
|
+
neutral: 'bg-ios-gray-500'
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<component
|
|
41
|
+
:is="to ? NuxtLink : interactive ? 'button' : 'div'"
|
|
42
|
+
:to="to"
|
|
43
|
+
:type="!to && interactive ? 'button' : undefined"
|
|
44
|
+
:aria-checked="selected === undefined ? undefined : selected"
|
|
45
|
+
:role="selected === undefined ? undefined : 'radio'"
|
|
46
|
+
class="group/row flex w-full items-center gap-3 ps-4 text-start"
|
|
47
|
+
:class="interactive && 'transition-colors active:bg-elevated'"
|
|
48
|
+
>
|
|
49
|
+
<span
|
|
50
|
+
v-if="icon"
|
|
51
|
+
class="flex shrink-0 items-center justify-center"
|
|
52
|
+
:class="iconColor ? ['size-7 rounded-[7px] text-white', tileColors[iconColor]] : 'size-7 text-primary'"
|
|
53
|
+
>
|
|
54
|
+
<UIcon :name="icon" :class="iconColor ? 'size-[18px]' : 'size-6'" />
|
|
55
|
+
</span>
|
|
56
|
+
|
|
57
|
+
<span
|
|
58
|
+
class="flex min-h-11 min-w-0 flex-1 items-center gap-2 self-stretch border-b-[0.5px] border-separator py-2.5 pe-4 group-last/row:border-b-0"
|
|
59
|
+
>
|
|
60
|
+
<span class="min-w-0 flex-1">
|
|
61
|
+
<span class="block text-body" :class="destructive ? 'text-error' : interactive && !to && selected === undefined ? 'text-primary' : 'text-default'">
|
|
62
|
+
{{ title }}
|
|
63
|
+
</span>
|
|
64
|
+
<span v-if="subtitle" class="block text-subhead text-muted">{{ subtitle }}</span>
|
|
65
|
+
</span>
|
|
66
|
+
|
|
67
|
+
<span v-if="value" class="shrink-0 text-body text-muted">{{ value }}</span>
|
|
68
|
+
<slot name="trailing" />
|
|
69
|
+
<UIcon v-if="selected" name="i-ph-check-bold" class="size-5 shrink-0 text-primary" />
|
|
70
|
+
<UIcon v-if="showChevron" name="i-ph-caret-right-bold" class="size-4 shrink-0 text-dimmed" />
|
|
71
|
+
</span>
|
|
72
|
+
</component>
|
|
73
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
header?: string
|
|
4
|
+
footer?: string
|
|
5
|
+
}>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<section class="mx-4">
|
|
10
|
+
<h2 v-if="header || $slots.header" class="px-4 pb-1.5 text-footnote text-muted uppercase">
|
|
11
|
+
<slot name="header">
|
|
12
|
+
{{ header }}
|
|
13
|
+
</slot>
|
|
14
|
+
</h2>
|
|
15
|
+
|
|
16
|
+
<div class="overflow-hidden rounded-lg bg-cell">
|
|
17
|
+
<slot />
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<p v-if="footer || $slots.footer" class="px-4 pt-1.5 text-footnote text-muted">
|
|
21
|
+
<slot name="footer">
|
|
22
|
+
{{ footer }}
|
|
23
|
+
</slot>
|
|
24
|
+
</p>
|
|
25
|
+
</section>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = withDefaults(defineProps<{
|
|
3
|
+
title: string
|
|
4
|
+
/** Large title that collapses into the bar on scroll — use on top-level (tab root) screens */
|
|
5
|
+
large?: boolean
|
|
6
|
+
/** `true` goes back in history, a string links to that route */
|
|
7
|
+
back?: boolean | string
|
|
8
|
+
}>(), {
|
|
9
|
+
large: false,
|
|
10
|
+
back: false
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
const router = useRouter()
|
|
14
|
+
const bar = useTemplateRef<HTMLElement>('bar')
|
|
15
|
+
const largeTitle = useTemplateRef<HTMLElement>('largeTitle')
|
|
16
|
+
const scrolled = ref(false)
|
|
17
|
+
const collapsed = ref(!props.large)
|
|
18
|
+
|
|
19
|
+
function update() {
|
|
20
|
+
scrolled.value = window.scrollY > 0
|
|
21
|
+
if (props.large && largeTitle.value && bar.value) {
|
|
22
|
+
collapsed.value = largeTitle.value.getBoundingClientRect().bottom <= bar.value.getBoundingClientRect().bottom
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
onMounted(() => {
|
|
27
|
+
update()
|
|
28
|
+
window.addEventListener('scroll', update, { passive: true })
|
|
29
|
+
})
|
|
30
|
+
onBeforeUnmount(() => window.removeEventListener('scroll', update))
|
|
31
|
+
|
|
32
|
+
function goBack() {
|
|
33
|
+
if (typeof props.back === 'string') return router.push(props.back)
|
|
34
|
+
if (window.history.state?.back) return router.back()
|
|
35
|
+
router.push('/')
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<header
|
|
41
|
+
ref="bar"
|
|
42
|
+
class="sticky top-0 z-30 pt-safe transition-[background-color,box-shadow] duration-200 select-none"
|
|
43
|
+
:class="scrolled && collapsed ? 'glass-bar shadow-[0_0.5px_0_var(--ui-border)]' : 'bg-transparent'"
|
|
44
|
+
>
|
|
45
|
+
<div class="grid h-(--ui-header-height) grid-cols-[1fr_auto_1fr] items-center gap-2 px-4">
|
|
46
|
+
<!-- Buttons on each side share one glass capsule; a single icon button becomes a circle -->
|
|
47
|
+
<div class="flex items-center justify-start">
|
|
48
|
+
<div class="flex items-center rounded-full has-[>*]:glass-control">
|
|
49
|
+
<slot name="leading">
|
|
50
|
+
<UButton
|
|
51
|
+
v-if="back"
|
|
52
|
+
icon="i-ph-caret-left-bold"
|
|
53
|
+
color="neutral"
|
|
54
|
+
variant="ghost"
|
|
55
|
+
aria-label="Back"
|
|
56
|
+
@click="goBack"
|
|
57
|
+
/>
|
|
58
|
+
</slot>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<span
|
|
63
|
+
class="max-w-[60vw] truncate text-headline text-highlighted transition-opacity duration-200"
|
|
64
|
+
:class="collapsed ? 'opacity-100' : 'opacity-0'"
|
|
65
|
+
:aria-hidden="large ? 'true' : undefined"
|
|
66
|
+
>
|
|
67
|
+
{{ title }}
|
|
68
|
+
</span>
|
|
69
|
+
|
|
70
|
+
<div class="flex items-center justify-end">
|
|
71
|
+
<div class="flex items-center rounded-full has-[>*]:glass-control">
|
|
72
|
+
<slot name="trailing" />
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</header>
|
|
77
|
+
|
|
78
|
+
<h1 v-if="large" ref="largeTitle" class="px-4 pt-1 pb-2 text-large-title text-highlighted">
|
|
79
|
+
{{ title }}
|
|
80
|
+
</h1>
|
|
81
|
+
<h1 v-else class="sr-only">
|
|
82
|
+
{{ title }}
|
|
83
|
+
</h1>
|
|
84
|
+
|
|
85
|
+
<div v-if="$slots.default" class="px-4 pb-2">
|
|
86
|
+
<slot />
|
|
87
|
+
</div>
|
|
88
|
+
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
export interface TabBarItem {
|
|
3
|
+
label: string
|
|
4
|
+
icon: string
|
|
5
|
+
/** Filled variant shown while the tab is selected (HIG: prefer filled symbols in tab bars) */
|
|
6
|
+
activeIcon?: string
|
|
7
|
+
to: string
|
|
8
|
+
badge?: string | number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = defineProps<{ items: TabBarItem[] }>()
|
|
12
|
+
|
|
13
|
+
if (import.meta.dev && props.items.length > 5) {
|
|
14
|
+
console.warn('[MobileTabBar] More than 5 tabs don\'t fit a phone — move sections into a list on one of the tabs.')
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const route = useRoute()
|
|
18
|
+
|
|
19
|
+
function isActive(item: TabBarItem) {
|
|
20
|
+
return item.to === '/' ? route.path === '/' : route.path === item.to || route.path.startsWith(`${item.to}/`)
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<nav
|
|
26
|
+
aria-label="Tabs"
|
|
27
|
+
class="pointer-events-none fixed inset-x-0 bottom-0 z-40 px-4 pb-[max(0.5rem,env(safe-area-inset-bottom))] select-none"
|
|
28
|
+
>
|
|
29
|
+
<div class="glass pointer-events-auto mx-auto flex max-w-md rounded-full p-1">
|
|
30
|
+
<NuxtLink
|
|
31
|
+
v-for="item in items"
|
|
32
|
+
:key="item.to"
|
|
33
|
+
:to="item.to"
|
|
34
|
+
:aria-current="isActive(item) ? 'page' : undefined"
|
|
35
|
+
class="flex min-h-14 flex-1 flex-col items-center justify-center gap-0.5 rounded-full text-caption-2 font-semibold transition-colors"
|
|
36
|
+
:class="isActive(item) ? 'bg-fill text-primary' : 'text-default active:opacity-60'"
|
|
37
|
+
>
|
|
38
|
+
<UChip :show="item.badge !== undefined" :text="item.badge" color="error" size="3xl" inset>
|
|
39
|
+
<UIcon :name="isActive(item) ? (item.activeIcon ?? item.icon) : item.icon" class="size-6" />
|
|
40
|
+
</UChip>
|
|
41
|
+
<span>{{ item.label }}</span>
|
|
42
|
+
</NuxtLink>
|
|
43
|
+
</div>
|
|
44
|
+
</nav>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TabBarItem } from '~/components/mobile/TabBar.vue'
|
|
3
|
+
|
|
4
|
+
// 2–5 top-level sections; the tab bar stays visible on drill-down pages
|
|
5
|
+
const tabs: TabBarItem[] = [
|
|
6
|
+
{ label: 'Home', icon: 'i-ph-house', activeIcon: 'i-ph-house-fill', to: '/' },
|
|
7
|
+
{ label: 'Settings', icon: 'i-ph-gear-six', activeIcon: 'i-ph-gear-six-fill', to: '/settings' }
|
|
8
|
+
]
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="min-h-dvh pb-[calc(var(--app-tabbar-height)+env(safe-area-inset-bottom)+1rem)]">
|
|
13
|
+
<slot />
|
|
14
|
+
<MobileTabBar :items="tabs" />
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default defineNuxtConfig({
|
|
2
|
+
modules: ['@nuxt/ui'],
|
|
3
|
+
|
|
4
|
+
css: ['~/assets/css/main.css'],
|
|
5
|
+
|
|
6
|
+
// System font stack only — no web-font download
|
|
7
|
+
ui: {
|
|
8
|
+
fonts: false
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
app: {
|
|
12
|
+
head: {
|
|
13
|
+
// viewport-fit=cover: without it every env(safe-area-inset-*) is 0 on iOS
|
|
14
|
+
viewport: 'width=device-width, initial-scale=1, viewport-fit=cover',
|
|
15
|
+
meta: [
|
|
16
|
+
// Match the grouped page background, never the accent color — iOS tints the browser chrome with it
|
|
17
|
+
{ name: 'theme-color', media: '(prefers-color-scheme: light)', content: '#f2f2f7' },
|
|
18
|
+
{ name: 'theme-color', media: '(prefers-color-scheme: dark)', content: '#000000' },
|
|
19
|
+
{ name: 'mobile-web-app-capable', content: 'yes' },
|
|
20
|
+
{ name: 'apple-mobile-web-app-status-bar-style', content: 'default' }
|
|
21
|
+
],
|
|
22
|
+
link: [
|
|
23
|
+
{ rel: 'apple-touch-icon', href: '/apple-touch-icon.png' }
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
})
|