@vocdoni/skills 0.1.0 → 0.2.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.
Files changed (65) hide show
  1. package/.claude-plugin/marketplace.json +12 -2
  2. package/CHANGELOG.md +19 -0
  3. package/README.md +13 -0
  4. package/package.json +10 -2
  5. package/plugins/agentic-dev/.claude-plugin/plugin.json +1 -1
  6. package/plugins/agentic-dev/skills/subagent-driven-development/SKILL.md +10 -5
  7. package/plugins/agentic-dev/skills/subagent-driven-development/references/dispatch.md +20 -0
  8. package/plugins/agentic-dev/skills/subagent-driven-development/references/ledger.md +1 -0
  9. package/plugins/agentic-dev/skills/subagent-driven-development/scripts/task-brief.sh +2 -0
  10. package/plugins/agentic-dev/skills/subagent-driven-development/templates/plan.md +4 -0
  11. package/plugins/claude-pi-subagent/.claude-plugin/marketplace.json +1 -1
  12. package/plugins/claude-pi-subagent/plugins/pi-subagent/.claude-plugin/plugin.json +1 -1
  13. package/plugins/claude-pi-subagent/plugins/pi-subagent/dist/server.mjs +75 -12
  14. package/plugins/claude-pi-subagent/plugins/pi-subagent/package-lock.json +89 -89
  15. package/plugins/claude-pi-subagent/plugins/pi-subagent/package.json +2 -2
  16. package/plugins/claude-pi-subagent/plugins/pi-subagent/src/server.ts +1 -1
  17. package/plugins/vocdoni-ui-style/.claude-plugin/plugin.json +25 -0
  18. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/SKILL.md +99 -0
  19. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/components/chakra/product.tsx +263 -0
  20. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/components/shadcn/brand.tsx +195 -0
  21. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/components/shadcn/button.tsx +67 -0
  22. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/components/shadcn/status-badge.tsx +93 -0
  23. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/logo/vocdoni-logo-ink.svg +15 -0
  24. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/logo/vocdoni-logo-white.svg +15 -0
  25. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/logo/vocdoni-logo.svg +15 -0
  26. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/logo/vocdoni-mark-ink.svg +7 -0
  27. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/logo/vocdoni-mark-white.svg +7 -0
  28. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/logo/vocdoni-mark.svg +7 -0
  29. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/editorial-footer.webp +0 -0
  30. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/editorial-home-hero.webp +0 -0
  31. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/editorial-mobile.webp +0 -0
  32. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/editorial-stats-and-panels.webp +0 -0
  33. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/editorial-vertical-hero.webp +0 -0
  34. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/editorial-washes-and-comparison.webp +0 -0
  35. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/product-process-results.webp +0 -0
  36. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/product-signin.webp +0 -0
  37. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/tokens/editorial.chakra.ts +285 -0
  38. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/tokens/editorial.css +847 -0
  39. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/tokens/editorial.tailwind.css +352 -0
  40. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/tokens/product.chakra.ts +410 -0
  41. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/tokens/product.css +1116 -0
  42. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/tokens/product.tailwind.css +289 -0
  43. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/examples/editorial-landing.html +358 -0
  44. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/examples/email-vote-invitation.html +58 -0
  45. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/examples/product-auth.html +81 -0
  46. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/examples/product-builder.html +147 -0
  47. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/examples/product-dashboard.html +185 -0
  48. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/examples/product-voting.html +326 -0
  49. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/references/brand-core.md +166 -0
  50. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/references/editorial.md +198 -0
  51. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/references/product.md +173 -0
  52. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/references/recipes.md +264 -0
  53. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/references/stacks.md +196 -0
  54. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/references/ux-flows.md +110 -0
  55. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/bad-editorial.tsx +15 -0
  56. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/bad-product.tsx +9 -0
  57. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/doc.md +10 -0
  58. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/escaped.json +1 -0
  59. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/good-editorial.tsx +16 -0
  60. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/good-product.css +6 -0
  61. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/locale.json +1 -0
  62. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/multiline-attr.tsx +8 -0
  63. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/multiline-copy.tsx +10 -0
  64. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/regex-literal.tsx +5 -0
  65. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style.mjs +436 -0
@@ -0,0 +1,264 @@
1
+ # Recipes: from blank file to a passing check
2
+
3
+ Two worked compositions, one per mode, in the stacks the real products use. Both files typecheck against `@chakra-ui/react` v3 / shadcn and pass `scripts/check-style.mjs` with zero findings. Use them as the shape of a first draft; the HTML examples show more patterns, and the table at the end translates their classes into each stack.
4
+
5
+ ## Contents
6
+
7
+ - [Product: an admin page in Chakra UI v3](#product-an-admin-page-in-chakra-ui-v3)
8
+ - [Editorial: a vertical page in Tailwind v4 + shadcn](#editorial-a-vertical-page-in-tailwind-v4--shadcn)
9
+ - [Translating the HTML examples into a stack](#translating-the-html-examples-into-a-stack)
10
+ - [What a first draft usually gets wrong](#what-a-first-draft-usually-gets-wrong)
11
+
12
+ ## Product: an admin page in Chakra UI v3
13
+
14
+ Steps:
15
+
16
+ 1. Copy `assets/tokens/product.chakra.ts` to `src/theme/system.ts` and `assets/components/chakra/product.tsx` to `src/components/vocdoni/product.tsx`.
17
+ 2. Wire the provider (`references/stacks.md`, Chakra UI v3): Inter 300-600, `next-themes` with `attribute='class'`, `createVocdoniProductSystem()` (no argument = Vocdoni's monochrome look; pass the organization's hex for white-label).
18
+ 3. Compose the page from the kit: `PageHeader` (24px title, muted subtitle, one primary action top right), `Tabs.Root` (defaults to the gray pill rail), a bordered `DashboardBox` with the table, `DataListCard`s below 768px, `StatusBadge` for status, a kebab `Menu` for row actions, `ConfirmDialog` for anything irreversible.
19
+ 4. Copy through i18n in a real app (`t('process.list.title', 'Voting processes')`); kept literal here for brevity.
20
+ 5. Check: `node scripts/check-style.mjs --mode product src/` and render at 1440px and 390px next to `assets/reference/product-*.webp`.
21
+
22
+ ```tsx
23
+ import { Box, Button, Link, Menu, Portal, Stack, Table, Tabs, Text, useBreakpointValue } from '@chakra-ui/react'
24
+ import { useState } from 'react'
25
+ import { LuEllipsisVertical, LuPlus } from 'react-icons/lu'
26
+ import {
27
+ ConfirmDialog,
28
+ DashboardBox,
29
+ DataListCard,
30
+ type ElectionStatus,
31
+ PageHeader,
32
+ StatusBadge,
33
+ } from '@/components/vocdoni/product' // assets/components/chakra/product.tsx
34
+
35
+ type Process = { id: string; title: string; ends: string; status: ElectionStatus; votes: number }
36
+
37
+ const PROCESSES: Process[] = [
38
+ { id: '1', title: 'General assembly 2026', ends: '30 Oct 2026', status: 'ongoing', votes: 711 },
39
+ { id: '2', title: 'Board renewal', ends: '9 Nov 2026', status: 'upcoming', votes: 0 },
40
+ { id: '3', title: '2026 budget approval', ends: '8 Sept 2026', status: 'results', votes: 602 },
41
+ ]
42
+
43
+ export function ProcessesPage() {
44
+ const isMobile = useBreakpointValue({ base: true, md: false })
45
+ const [ending, setEnding] = useState<Process | null>(null)
46
+
47
+ const actions = (p: Process) => (
48
+ <Menu.Root>
49
+ <Menu.Trigger asChild>
50
+ <Button variant='ghost' size='xs' aria-label={`Actions for ${p.title}`}>
51
+ <LuEllipsisVertical />
52
+ </Button>
53
+ </Menu.Trigger>
54
+ <Portal>
55
+ <Menu.Positioner>
56
+ <Menu.Content>
57
+ <Menu.Item value='open'>Public voting page</Menu.Item>
58
+ <Menu.Item value='end' color='fg.error' onClick={() => setEnding(p)}>
59
+ End vote
60
+ </Menu.Item>
61
+ </Menu.Content>
62
+ </Menu.Positioner>
63
+ </Portal>
64
+ </Menu.Root>
65
+ )
66
+
67
+ return (
68
+ <Box p={6}>
69
+ <PageHeader
70
+ title='Voting processes'
71
+ subtitle='Every vote of your organization, past and present.'
72
+ actions={
73
+ <Button size='sm'>
74
+ <LuPlus /> New vote
75
+ </Button>
76
+ }
77
+ />
78
+ {/* Tabs default to the "settings" pill rail in product.chakra.ts: no variant prop needed */}
79
+ <Tabs.Root defaultValue='all' mb={4}>
80
+ <Tabs.List>
81
+ <Tabs.Trigger value='all'>All</Tabs.Trigger>
82
+ <Tabs.Trigger value='ended'>Ended</Tabs.Trigger>
83
+ <Tabs.Trigger value='drafts'>Drafts</Tabs.Trigger>
84
+ </Tabs.List>
85
+ </Tabs.Root>
86
+
87
+ {isMobile ? (
88
+ <Stack gap={3}>
89
+ {PROCESSES.map((p) => (
90
+ <DataListCard key={p.id} title={<Link href={`/admin/process/${p.id}`}>{p.title}</Link>} menu={actions(p)}>
91
+ <Box>
92
+ <StatusBadge status={p.status} />
93
+ </Box>
94
+ <Text>Ends: {p.ends}</Text>
95
+ <Text>Votes: {p.votes}</Text>
96
+ </DataListCard>
97
+ ))}
98
+ </Stack>
99
+ ) : (
100
+ <DashboardBox p={0} overflow='hidden'>
101
+ <Table.Root>
102
+ <Table.Header>
103
+ <Table.Row bg='bg.subtle'>
104
+ <Table.ColumnHeader>Title</Table.ColumnHeader>
105
+ <Table.ColumnHeader>End date</Table.ColumnHeader>
106
+ <Table.ColumnHeader>Status</Table.ColumnHeader>
107
+ <Table.ColumnHeader textAlign='end'>Votes</Table.ColumnHeader>
108
+ <Table.ColumnHeader w='1'>
109
+ <Box srOnly>Actions</Box>
110
+ </Table.ColumnHeader>
111
+ </Table.Row>
112
+ </Table.Header>
113
+ <Table.Body>
114
+ {PROCESSES.map((p) => (
115
+ <Table.Row key={p.id}>
116
+ <Table.Cell>
117
+ <Link href={`/admin/process/${p.id}`}>{p.title}</Link>
118
+ </Table.Cell>
119
+ <Table.Cell>{p.ends}</Table.Cell>
120
+ <Table.Cell>
121
+ <StatusBadge status={p.status} />
122
+ </Table.Cell>
123
+ <Table.Cell textAlign='end' fontVariantNumeric='tabular-nums'>
124
+ {p.votes}
125
+ </Table.Cell>
126
+ <Table.Cell>{actions(p)}</Table.Cell>
127
+ </Table.Row>
128
+ ))}
129
+ </Table.Body>
130
+ </Table.Root>
131
+ </DashboardBox>
132
+ )}
133
+
134
+ <ConfirmDialog
135
+ open={!!ending}
136
+ onOpenChange={(open) => !open && setEnding(null)}
137
+ title='End vote'
138
+ description={`Ending "${ending?.title}" is irreversible. Voters will no longer be able to vote.`}
139
+ confirmLabel='End vote'
140
+ onConfirm={() => setEnding(null)}
141
+ />
142
+ </Box>
143
+ )
144
+ }
145
+ ```
146
+
147
+ Why it looks right: weight 400 everywhere except Chakra's own semibold on menu/dialog titles, 6px controls, 8px boxes, zinc hairlines, black primary button, status as subtle badges with text, the destructive action named and explained in a red confirm, cards instead of a squeezed table on phones.
148
+
149
+ ## Editorial: a vertical page in Tailwind v4 + shadcn
150
+
151
+ Steps:
152
+
153
+ 1. Make `assets/tokens/editorial.tailwind.css` the global stylesheet (mind its 5px spacing base) and load Hanken Grotesk, Fraunces `full.css` and JetBrains Mono.
154
+ 2. Copy `assets/components/shadcn/button.tsx` over `components/ui/button.tsx` and `brand.tsx` to `components/brand.tsx`.
155
+ 3. Compose with `Section` (32/64/96px rhythm) + `Container`, open every band with `SectionHeader` (eyebrow, serif title, muted lede), alternate plain and `bg-muted/50` bands, use `Panel surface='raised'` only on tinted bands.
156
+ 4. One green in-page CTA plus a quiet text link; the dark CTA stays in the navbar.
157
+ 5. Check: `node scripts/check-style.mjs --mode editorial app/ components/` and compare with `assets/reference/editorial-*.webp`.
158
+
159
+ ```tsx
160
+ import { ArrowRight, EyeOff, ScanSearch, ShieldCheck, Users } from 'lucide-react'
161
+ import { Container, Eyebrow, IconTile, Panel, Section, SectionHeader } from '@/components/brand' // assets/components/shadcn/brand.tsx
162
+ import { Button } from '@/components/ui/button' // assets/components/shadcn/button.tsx
163
+
164
+ const GUARANTEES = [
165
+ { icon: EyeOff, title: 'A secret ballot', text: 'Identity and ballot are separated by the system itself, not by policy.' },
166
+ { icon: ScanSearch, title: 'A result anyone can check', text: 'Members and auditors verify the count without seeing any vote.' },
167
+ { icon: ShieldCheck, title: 'Evidence for your minutes', text: 'Every vote closes with an audit trail and a certified results document.' },
168
+ ]
169
+
170
+ export function VerticalPage() {
171
+ return (
172
+ <main>
173
+ {/* Hero: eyebrow with sector icon, serif headline, green CTA + quiet link, reassurance line */}
174
+ <Section>
175
+ <Container className='grid items-center gap-12 lg:grid-cols-2'>
176
+ <div className='flex flex-col items-start gap-6'>
177
+ <Eyebrow>
178
+ <Users className='size-4' aria-hidden='true' />
179
+ For cooperatives
180
+ </Eyebrow>
181
+ <h1 className='text-4xl sm:text-5xl lg:text-6xl'>General assemblies your members can verify</h1>
182
+ <p className='max-w-xl text-lg leading-relaxed text-muted-foreground'>
183
+ One member, one vote or weighted by shares, run remotely or hybrid, closed with a record that shows how the
184
+ result was reached.
185
+ </p>
186
+ <div className='flex flex-wrap items-center gap-x-4 gap-y-3'>
187
+ <Button size='lg' className='group'>
188
+ Set up a test vote
189
+ <ArrowRight className='transition-transform duration-200 group-hover:translate-x-0.5' aria-hidden='true' />
190
+ </Button>
191
+ <Button variant='link' className='text-muted-foreground hover:text-foreground'>
192
+ Talk to an election expert
193
+ </Button>
194
+ </div>
195
+ <p className='text-sm text-muted-foreground'>Free account, no credit card.</p>
196
+ </div>
197
+ <Panel surface='inset' padding='lg' aria-hidden='true' className='min-h-80' />
198
+ </Container>
199
+ </Section>
200
+
201
+ {/* Tinted band with raised panels: raised only on a tinted section */}
202
+ <Section className='bg-muted/50'>
203
+ <Container className='max-w-5xl'>
204
+ <SectionHeader
205
+ size='section'
206
+ eyebrow='What you can prove'
207
+ title='Guarantees that hold without trusting us'
208
+ lede='Each one is a property of the system, checkable by anyone.'
209
+ />
210
+ <ul className='mt-12 grid gap-4 sm:mt-16 md:grid-cols-3'>
211
+ {GUARANTEES.map(({ icon: Icon, title, text }) => (
212
+ <Panel as='li' key={title} surface='raised' padding='lg' className='flex flex-col gap-3'>
213
+ <IconTile>
214
+ <Icon className='size-5' aria-hidden='true' />
215
+ </IconTile>
216
+ <h3 className='font-sans text-lg leading-snug font-semibold tracking-normal'>{title}</h3>
217
+ <p className='text-sm leading-relaxed text-muted-foreground'>{text}</p>
218
+ </Panel>
219
+ ))}
220
+ </ul>
221
+ </Container>
222
+ </Section>
223
+ </main>
224
+ )
225
+ }
226
+ ```
227
+
228
+ Why it looks right: serif headings at weight 400 with the SOFT axis come from the base layer (no classes needed), the only yellow is the eyebrow dot, cards are sans 18px semibold titles over muted 14px text, panels follow the raised-on-tinted rule, and the hero's reassurance line sits under the CTA.
229
+
230
+ ## Translating the HTML examples into a stack
231
+
232
+ | Example class | Tailwind + shadcn (editorial) | Chakra v3 (product) |
233
+ | --- | --- | --- |
234
+ | `vd-section` / `--muted` | `<Section className='bg-muted'>` | - |
235
+ | `vd-section-header` + `eyebrow` | `<SectionHeader eyebrow title lede />` | - |
236
+ | `vd-btn--dark` / `--primary` / `--outline` | `<Button variant='dark'>` / `<Button>` / `<Button variant='outline'>` | - |
237
+ | `vd-panel--raised` | `<Panel surface='raised' padding='lg'>` | - |
238
+ | `vd-icon-tile` | `<IconTile>` | - |
239
+ | `vp-btn` / `--outline` / `--subtle` / `--ghost` / `--danger` | - | `<Button>` / `variant='outline'` / `variant='subtle'` / `variant='ghost'` / `colorPalette='red'` |
240
+ | `vp-badge--green` (etc.) | `<Tag tone='green'>` (`status-badge.tsx`) | `<Badge colorPalette='green' variant='subtle'>` or `<StatusBadge>` |
241
+ | `vp-box` / `vp-section` | `rounded-md border p-4` / `rounded-md bg-muted p-4` | `<DashboardBox>` / `<DashboardSection>` |
242
+ | `vp-tabs` + `vp-tab` | shadcn `Tabs` with `bg-muted p-1 rounded-sm`, active `bg-background shadow-xs` | `<Tabs.Root>` (default variant) |
243
+ | `vp-tabs-line` | shadcn `Tabs` underline style | `<Tabs.Root variant='line' fitted>` |
244
+ | `vp-choice` | `label` card: `flex gap-3 rounded-md border p-3 has-[:checked]:border-foreground` | `RadioGroup`/`CheckboxGroup` items in a bordered `Box`, or `@vocdoni/react-components` |
245
+ | `vp-dialog` + footer | shadcn `AlertDialog` | `<ConfirmDialog>` |
246
+ | `vp-nav-item` | `rounded-sm px-2 h-8 text-sm hover:bg-muted aria-[current=page]:bg-brand-muted` | `<NavItem>` |
247
+ | `vp-security` | three equal pills, only the active one colored | `<SecurityLevel level>` |
248
+
249
+ ## What a first draft usually gets wrong
250
+
251
+ Run the checker; these are the findings it raises most on a first pass, and the fix:
252
+
253
+ | Finding | Fix |
254
+ | --- | --- |
255
+ | `sentence-case` on buttons and dialog titles ("Add Member") | "Add member"; only the first word and proper nouns capitalized |
256
+ | `no-em-dash` in copy | " - ", a colon, or two sentences |
257
+ | `editorial-no-gray` / `editorial-no-white` | `text-muted-foreground`, `border-border`, `bg-background` |
258
+ | `editorial-serif-weight` | Drop `font-bold` from `h1`/`h2`; the base layer sets 400 |
259
+ | `fraunces-full` | `@fontsource-variable/fraunces/full.css` |
260
+ | `product-light-weights` | `fontWeight='normal'` on headings and buttons (renders 400) |
261
+ | `product-no-editorial` | No serif, eyebrow or dark CTA inside the app |
262
+ | `no-transition-all` | `transition-[color,background-color,box-shadow]` or Chakra `transitionProperty` |
263
+
264
+ And the things no checker sees: more than one primary action per view, a disabled button without the reason next to it, a destructive action without a confirm, a vote cast without the summary step, status shown by color alone.
@@ -0,0 +1,196 @@
1
+ # Wiring the look into a stack
2
+
3
+ Pick the mode first (see SKILL.md), then follow the section for the stack. All paths are relative to this skill directory; copy files into the project rather than importing from the skill.
4
+
5
+ ## Contents
6
+
7
+ - [Tailwind v4 + shadcn/ui (React, Next.js, Vite, Vike)](#tailwind-v4--shadcnui)
8
+ - [Chakra UI v3](#chakra-ui-v3)
9
+ - [Plain CSS (any framework or none)](#plain-css)
10
+ - [Both modes in one codebase](#both-modes-in-one-codebase)
11
+ - [Class inventory (plain CSS)](#class-inventory-plain-css)
12
+ - [Email, PDF, slides, native](#email-pdf-slides-native)
13
+ - [Favicon, social images, print](#favicon-social-images-print)
14
+ - [Verify the result](#verify-the-result)
15
+
16
+ ## Tailwind v4 + shadcn/ui
17
+
18
+ Editorial:
19
+
20
+ ```sh
21
+ pnpm add tailwindcss @tailwindcss/vite tw-animate-css class-variance-authority clsx tailwind-merge @radix-ui/react-slot lucide-react
22
+ pnpm add @fontsource-variable/hanken-grotesk @fontsource-variable/fraunces @fontsource-variable/jetbrains-mono
23
+ ```
24
+
25
+ ```ts
26
+ // entry (main.tsx / layout.tsx), before the stylesheet
27
+ import '@fontsource-variable/hanken-grotesk/wght.css'
28
+ import '@fontsource-variable/fraunces/full.css' // NOT wght.css: the SOFT axis lives in "full"
29
+ import '@fontsource-variable/jetbrains-mono/wght.css'
30
+ import './globals.css'
31
+ ```
32
+
33
+ 1. Replace the project's global stylesheet with `assets/tokens/editorial.tailwind.css` (it starts with `@import 'tailwindcss'`). Mind the 5px spacing base noted at its top.
34
+ 2. `npx shadcn@latest init` if shadcn is not set up (CSS variables on; the base color is irrelevant, the token file overrides it). shadcn primitives then pick up cream, ink and green automatically.
35
+ 3. Copy `assets/components/shadcn/button.tsx` over `components/ui/button.tsx` (adds the `dark` variant, press scale, shadow-button) and `brand.tsx` to `components/brand.tsx` (Container, Section, Eyebrow, SectionHeader, Panel, IconTile, Badge, VocdoniLogo).
36
+ 4. Shadcn `Card`: change its root classes to `rounded-card border bg-card text-card-foreground shadow-sm`.
37
+
38
+ Next.js with `next/font` instead of fontsource:
39
+
40
+ ```ts
41
+ import { Fraunces, Hanken_Grotesk, JetBrains_Mono } from 'next/font/google'
42
+ const serif = Fraunces({ subsets: ['latin'], axes: ['SOFT', 'WONK', 'opsz'], variable: '--font-fraunces' })
43
+ const sans = Hanken_Grotesk({ subsets: ['latin'], variable: '--font-hanken' })
44
+ const mono = JetBrains_Mono({ subsets: ['latin'], variable: '--font-jetbrains' })
45
+ // <html className={`${serif.variable} ${sans.variable} ${mono.variable}`}>
46
+ ```
47
+
48
+ Then in the token file set `--font-serif: var(--font-fraunces), Georgia, serif;` (same for sans and mono), because `next/font` renames the families.
49
+
50
+ Product:
51
+
52
+ ```sh
53
+ pnpm add @fontsource/inter
54
+ ```
55
+
56
+ ```ts
57
+ import '@fontsource/inter/300.css'
58
+ import '@fontsource/inter/400.css'
59
+ import '@fontsource/inter/500.css'
60
+ import '@fontsource/inter/600.css'
61
+ ```
62
+
63
+ Use `assets/tokens/product.tailwind.css` as the global stylesheet (default 4px spacing). Stock shadcn components work; then:
64
+
65
+ - Button: `rounded-sm` (6px), `h-10 px-4 text-sm font-normal`; variants `default` (bg-primary), `outline`, `secondary` (subtle gray), `ghost`, `destructive`.
66
+ - Input: `h-10 rounded-sm border-input bg-transparent text-base md:text-sm placeholder:text-placeholder`.
67
+ - Card / Dialog: `rounded-md` (8px), border, no shadow on cards, `shadow-lg` on dialogs.
68
+ - Labels: `text-sm font-light`.
69
+ - Status: `assets/components/shadcn/status-badge.tsx`.
70
+ - Color mode: `next-themes` with `attribute="class"`, `defaultTheme="system"`, `storageKey="theme-preference"`.
71
+ - White-label: `<html data-brand style={{ '--brand': org.color, '--brand-foreground': contrastColor(org.color) }}>` (use `contrastColor` from `product.chakra.ts`; it is plain TS).
72
+
73
+ ## Chakra UI v3
74
+
75
+ ```sh
76
+ pnpm add @chakra-ui/react @emotion/react next-themes
77
+ ```
78
+
79
+ Product (the native stack of vocdoni-app):
80
+
81
+ ```tsx
82
+ // theme/system.ts <- copy assets/tokens/product.chakra.ts here
83
+ // Provider.tsx
84
+ import '@fontsource/inter/300.css'
85
+ import '@fontsource/inter/400.css'
86
+ import '@fontsource/inter/500.css'
87
+ import '@fontsource/inter/600.css'
88
+ import { ChakraProvider } from '@chakra-ui/react'
89
+ import { ThemeProvider } from 'next-themes'
90
+ import { createVocdoniProductSystem } from './theme/system'
91
+
92
+ const system = createVocdoniProductSystem(import.meta.env.VITE_PRIMARY_COLOR) // undefined = monochrome
93
+
94
+ export function Provider({ children }: { children: React.ReactNode }) {
95
+ return (
96
+ <ThemeProvider attribute='class' defaultTheme='system' enableSystem disableTransitionOnChange storageKey='theme-preference'>
97
+ <ChakraProvider value={system}>{children}</ChakraProvider>
98
+ </ThemeProvider>
99
+ )
100
+ }
101
+ ```
102
+
103
+ Memoize the system per color if the color can change at runtime (building one is not free). Copy `assets/components/chakra/product.tsx` for PageHeader, DashboardBox, DashboardSection, NavItem, DataListCard, StatusBadge, ResultsTag, ResultBar, SecurityLevel and ConfirmDialog; they use only built-in variant names, so they compile without typegen, and `Tabs.Root` already defaults to the settings rail. If you use the custom variant names directly (`variant='listmenu'`, `'settings'`, `'data-list-item'`), run `npx @chakra-ui/cli typegen ./theme/system.ts` first or `tsc` rejects them. A full page: `references/recipes.md`.
104
+
105
+ If the app renders `@vocdoni/react-components` (ballot, results, confirm modal), theme them through that package's component overrides with the recipes in `product.chakra.ts`; the vocdoni-integrator-sdk skill documents the component API.
106
+
107
+ Editorial on Chakra: copy `assets/tokens/editorial.chakra.ts`, wrap in `<ChakraProvider value={editorialSystem}>`, load Hanken Grotesk / Fraunces full / JetBrains Mono as above. Use `<Button variant='dark'>`, `textStyle='eyebrow'` with a `layerStyle='eyebrowDot'` span, `textStyle='display'` on headings, `<Card.Root surface='raised'>`.
108
+
109
+ ## Plain CSS
110
+
111
+ For Vue, Svelte, Astro, Django/Rails templates, static HTML, or anything without Tailwind/Chakra:
112
+
113
+ ```html
114
+ <!-- editorial -->
115
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,100..900,0..100,0..1&family=Hanken+Grotesk:wght@100..900&family=JetBrains+Mono:wght@400;500&display=swap" />
116
+ <link rel="stylesheet" href="/css/editorial.css" />
117
+
118
+ <!-- product -->
119
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap" />
120
+ <link rel="stylesheet" href="/css/product.css" />
121
+ ```
122
+
123
+ Classes: editorial `vd-*` (plus `.eyebrow`, `.eyebrow-dot`, `.press-scale`, `.card-hover`, `.image-outline`), product `vp-*`. The `examples/*.html` files show every class in context; start a page by copying the closest example. Self-host the fonts (fontsource or downloaded woff2) when the project forbids third-party requests or has a strict CSP.
124
+
125
+ With another component library (Vuetify, PrimeVue, Bootstrap, MUI): map its theme to the token values in `editorial.md` / `product.md` (surface, text, primary, border, radius, font), then override button/card/input shapes to match. Do not mix its default palette with these tokens.
126
+
127
+ ## Both modes in one codebase
128
+
129
+ Typical when a marketing site and an app share a repo. Keep one mode per route tree:
130
+
131
+ - Separate global stylesheets per layout (Next.js route groups `(marketing)` / `(app)`, separate Vite entries, or Vike `+Layout` per section).
132
+ - If both must load on one page, scope the token blocks: replace `:root` with `[data-mode='editorial']` / `[data-mode='product']` and set the attribute on each layout root.
133
+ - Never mix within one screen: no Fraunces headings in the dashboard, no Inter-light zinc cards on the landing page. The shared pieces are the logo, copy rules, status mapping and icons.
134
+
135
+ ## Class inventory (plain CSS)
136
+
137
+ What `editorial.css` and `product.css` provide, so a Vue/Svelte/Astro/template project can compose pages without reading the stylesheets. Modifiers use `--`, parts use `__`.
138
+
139
+ **Editorial** (`vd-*`, plus vocdoni.io's own utility names):
140
+
141
+ | Group | Classes |
142
+ | --- | --- |
143
+ | Layout | `vd-container` (`--narrow`), `vd-section` (`--muted`, `--tint`), `vd-section-header` (`--center`) |
144
+ | Type | `vd-hero-measure` + `vd-hero-title`, `vd-display`, `vd-h-section`, `vd-lede`, `vd-card-title`, `vd-label`, `vd-muted`, `vd-stat` |
145
+ | Eyebrow | `eyebrow`, `eyebrow-dot`, `eyebrow-dot-halo` |
146
+ | Buttons | `vd-btn` + `--dark`, `--primary`, `--outline`, `--secondary`, `--ghost`, `--link`, `--quiet`; sizes `--sm`, `--lg`, `--icon`; `--pill` |
147
+ | Surfaces | `vd-card` (`__body`), `vd-panel` + `--raised`, `--outline`, `--inset`, `--ledger`, `--pad`, `--pad-lg`; `vd-icon-tile` |
148
+ | Badges | `vd-badge` + `--primary`, `--secondary`, `--outline`, `--success`, `--warning`; `vd-chip` |
149
+ | Forms | `vd-field`, `vd-input`, `vd-textarea`, `vd-select`, `vd-field-error` |
150
+ | Navigation | `vd-navbar` (`__inner`, `__links`, `__link`, `__divider`), `vd-menu-panel` (`__intro`, `__intro-title`, `__items`), `vd-menu-item` (`__title`, `__desc`) |
151
+ | Other | `vd-faq` (on `<details>`), `vd-footer` (`__heading`, `__legal`), `vd-progress`, `vd-code`, `vd-sr-only`, `press-scale`, `card-hover`, `image-outline`, `mask-gradient-x` |
152
+
153
+ **Product** (`vp-*`):
154
+
155
+ | Group | Classes |
156
+ | --- | --- |
157
+ | Shell | `vp-shell`, `vp-sidebar` (`__section-title`), `vp-nav-item` (`aria-current="page"`), `vp-content`, `vp-page-header`, `vp-topbar` |
158
+ | Type | `vp-title-4xl`, `-2xl`, `-xl`, `-lg`, `vp-subtitle`, `vp-text-sm`, `vp-text-xs`, `vp-muted`, `vp-overline`, `vp-link` |
159
+ | Buttons | `vp-btn` + `--outline`, `--subtle`, `--ghost`, `--danger`, `--danger-outline`; sizes `--xs`, `--sm`, `--lg`, `--icon`, `--block` |
160
+ | Forms | `vp-field`, `vp-label`, `vp-input` (`--borderless`), `vp-select`, `vp-textarea`, `vp-helper`, `vp-field-error`, `vp-check`, `vp-switch`, `vp-radio-card`, `vp-dropzone`, `vp-step` (`data-state`), `vp-or` |
161
+ | Status | `vp-badge` + `--green`, `--teal`, `--yellow`, `--orange`, `--red`, `--purple`, `--blue`, `--md`; `vp-alert` + `--info`, `--success`, `--warning`, `--error` (`__title`) |
162
+ | Surfaces | `vp-card` (`__body`), `vp-box`, `vp-section`, `vp-table-wrap` + `vp-table`, `vp-tabs` + `vp-tab` (`aria-selected`), `vp-tabs-line` |
163
+ | Voting | `vp-choice` (`__label`, `__desc`), `vp-progress` (`--teal`, `--orange`, `--red`), `vp-security` (`data-level`, `data-active`) |
164
+ | Overlays | `vp-backdrop`, `vp-dialog` (`__header`, `__body`, `__footer`), `vp-toaster` + `vp-toast` (`--success`, `--error`, `__title`) |
165
+ | Auth | `vp-auth` (`__form`, `__showcase`, `__quote`, `__rule`) |
166
+ | Utility | `vp-sr-only` (skip links become visible on focus) |
167
+
168
+ ## Email, PDF, slides, native
169
+
170
+ No OKLCH, no variable fonts. Use hex and fallbacks:
171
+
172
+ | Role | Editorial | Product |
173
+ | --- | --- | --- |
174
+ | Background | #fdfbf3 | #ffffff |
175
+ | Text | #202019 | #09090b |
176
+ | Muted text | #706f67 | #52525b |
177
+ | Border | #e7e5dd | #e4e4e7 |
178
+ | Accent | #296948 (green) / #1f1f18 (dark CTA) | #18181b |
179
+ | Tinted band | #f0ead2 | #f5f5f5 |
180
+ | Signal dot | #f6eb93 | - |
181
+
182
+ Fonts: Fraunces and Hanken Grotesk are Google Fonts and embed in PDFs and slides; in email use `Georgia, serif` for headings and `Helvetica, Arial, sans-serif` for body.
183
+
184
+ Email: start from `examples/email-vote-invitation.html` (600px table, inline styles, hex colors, preheader, bulletproof button, plain-text fallback, "uses the Vocdoni platform" footer line). Transactional mail (invitations, codes, receipts, reminders) is product mode and sent in the organization's name; marketing mail is editorial (cream band, serif headline in `Georgia` fallback, one green or dark button). Results PDFs and certificates follow the document spec in `product.md`. Logos: `assets/logo/*-ink.svg` / `*-white.svg` (rasterize for email clients that block SVG).
185
+
186
+ ## Favicon, social images, print
187
+
188
+ - **Favicon**: the mark (`assets/logo/vocdoni-mark-ink.svg`) as SVG favicon plus a 32px PNG and a 180px apple-touch icon, ink on transparent (editorial) or black (product). White-label product pages use the organization's own icon.
189
+ - **Social images (Open Graph, 1200x630)**: editorial look. Cream background, eyebrow (dot + label) top left, the page's serif headline at 64-72px over at most three lines, logo bottom left, optional product screenshot right with `image-outline` and a 20px radius. vocdoni.io renders blog covers from a template script (`scripts/blog-cover/`); follow the same layout rather than designing per post.
190
+ - **Print** (results pages, receipts): white background, black text, hide navigation, sidebars and buttons (`@media print`), keep status labels and the verification link or process id visible, expand collapsed descriptions.
191
+
192
+ ## Verify the result
193
+
194
+ 1. Render the page and compare it with `assets/reference/*.webp` at 1440px and 390px.
195
+ 2. Run `node scripts/check-style.mjs --mode editorial|product <src dirs>` and fix every error.
196
+ 3. Check: one primary CTA per view, sentence case, no em dashes, focus ring visible on Tab, reduced motion respected, contrast AA, inputs 16px on mobile.
@@ -0,0 +1,110 @@
1
+ # UX flows
2
+
3
+ How Vocdoni products behave, step by step, distilled from vocdoni-app and vocdoni.io. Use these as the default shape of any voting, onboarding or admin flow; adapt copy and fields, keep the order and the safeguards. Visual specs live in `product.md` / `editorial.md`; copy rules in `brand-core.md`.
4
+
5
+ Quoted strings are vocdoni-app's English copy, normalized to the copy rules (sentence case, no exclamation marks, no em dashes). Where the app has no string, the quote is marked as a recommendation.
6
+
7
+ ## Contents
8
+
9
+ - [Principles](#principles)
10
+ - [1. Voter: cast a vote](#1-voter-cast-a-vote)
11
+ - [2. Organizer: sign up and onboard](#2-organizer-sign-up-and-onboard)
12
+ - [3. Organizer: build and publish a vote](#3-organizer-build-and-publish-a-vote)
13
+ - [4. Organizer: run and close a vote](#4-organizer-run-and-close-a-vote)
14
+ - [5. Members and census](#5-members-and-census)
15
+ - [6. Plans and limits](#6-plans-and-limits)
16
+ - [7. Marketing to product handoff](#7-marketing-to-product-handoff)
17
+ - [Cross-cutting patterns](#cross-cutting-patterns)
18
+
19
+ ## Principles
20
+
21
+ - **Voters have no account.** They open a link, prove they are in the census, vote, and leave with a receipt. Never ask a voter to sign up.
22
+ - **Confirm before cast, prove after cast.** Every vote goes through a summary confirmation and ends with a verifiable receipt.
23
+ - **Irreversible means confirmed.** Ending, canceling, deleting: dialog naming the object and the consequence, red confirm.
24
+ - **Nothing silently lost.** Drafts auto-save; leaving with unsaved changes asks; long jobs survive closing the tab.
25
+ - **Explain disabled things.** A disabled control comes with the reason and the way to unlock it.
26
+ - **One primary action per view**, placed where the eye ends: full width at the bottom of a form, top right of a dashboard page, sticky at the bottom of a ballot.
27
+
28
+ ## 1. Voter: cast a vote
29
+
30
+ Public page `/processes/:id` (`examples/product-voting.html`).
31
+
32
+ 1. **Land.** Header: optional 3:1 banner, status badge (+ results-visibility tag), title (36px, left), schedule line "Voting from {start} to {end}", markdown description collapsed at ~600px with a gradient fade and "Read more". Sidebar (xl+) or stacked block: relative time ("Ends in 3 days"), anonymity card ("Anonymous vote" / "Private vote" + one plain sentence), "Census: N people", organization, "Follow the process". Aside box: uppercase status overline, big count ("711 votes", hidden while results are secret), the **Identify** button.
33
+ 2. **Identify** (dialog titled "Authentication"). Step A: one required input per field the organizer configured (member number, name, national ID, birth date...), plus the 2FA contact field when enabled with the helper "Important: must match the one registered in the system", and a terms checkbox. Submit reads "Receive code" with 2FA, "Identify" without. Step B (2FA): "Enter the verification code", 6-digit pin input that auto-submits, "Didn't receive the code? Resend it", "Wrong details? Start over", footer "If you experience any issues, contact your organization." Errors are toasts with the server reason ("The voter is not listed in the census, or the provided credentials are incorrect."). Success has **no toast**: the Vote button appearing is the confirmation. Not eligible: "You are not in the census".
34
+ 3. **Choose.** Tabs "Questions | Results" (Results hidden when canceled, auto-selected when results exist). Each question is a fieldset: 18px semibold title, optional description, choice cards. Multi-choice shows the rule ("Select up to 2") and a live counter. Ranked: a select per option. Ballot DOM is excluded from session replay.
35
+ 4. **Vote.** Sticky full-width 50px "Vote" button at the bottom of the questions (with "Your voting power is: N" for weighted votes). Invalid submit scrolls smoothly to the first invalid question and shows the rule inline ("Select at least one option", "Select between {min} and {max} options", "Rank all {count} options").
36
+ 5. **Confirm** (dialog). Title: the election title (or "Confirm your vote", recommended); lead "Your vote will be recorded for:"; one bordered card per question with a check icon, the question in medium weight and the chosen answers muted. Footer: ghost "Cancel", primary "Confirm vote".
37
+ 6. **Processing** (blocking dialog, no Escape, no backdrop close): spinner, "We are processing your vote. This takes a few seconds. Please do not close or refresh this page." Failure: "Your vote could not be cast" + Close. Partial: "Some answers were not registered. Vote again to send the remaining ones."
38
+ 7. **Receipt** (dialog "Vote submitted"): "Your vote has been securely cast. You can verify it here." linking to the explorer by vote id. Anonymous votes add a warning: "Save this receipt now. The platform cannot show it to you again." Single "Close".
39
+ 8. **After.** Sidebar shows green "Your vote is properly cast"; a success alert lists "Your vote id for {question} is {id}" with explorer links. If vote overwrite is allowed, the button becomes "Vote again" and copy states "only your last vote counts".
40
+ 9. **Results.** When available: per question, choice label, "votes · percent", thin bar. While hidden: "The results will be made public when the process finishes on {date}." Summary page `/summary`: countdown badge (`3d : 04h : 12m`, "Time remaining to vote"), "Current participation" % with a blue striped bar, three stat cards (census, votes received, participation), results or the encrypted notice, and a dark "Voting guarantees" card (privacy, integrity, verifiability).
41
+
42
+ ## 2. Organizer: sign up and onboard
43
+
44
+ 1. **Sign up** (split auth card). Fields in order: first name, last name, email, password ("Min. 8 characters", eye toggle), optional marketing consent, required "I agree to the Terms of Service and Privacy Policy". Full-width primary "Create my account", "or continue with" divider, outline "Sign in with Google", footer "Already have an account? Log in". Invite links prefill and lock the email and skip verification.
45
+ 2. **Verify email.** Title "Account created", subtitle "We sent a verification email to:", the address in medium weight, an info alert "Check your spam folder if you don't see the email in your inbox.", 6-cell code input (auto-submit), full-width "Verify" (disabled while empty), outline "Resend email". Magic links auto-verify behind a spinner. Success toast "Email verified", then onboarding.
46
+ 3. **Tell us about your organization.** Minimal form inside the auth layout: name (required), membership size, organization type, country, default language (inferred from country until chosen). Primary "Create organization"; borderless secondary "Do it later" goes to the dashboard. Help line: "If your organization already has a profile, access the dashboard and contact the administrator to invite you."
47
+ 4. **Dashboard home.** "Welcome to Vocdoni, {name}" card with plan summary, primary "+ New vote", a "talk to us" secondary and a tutorial video; usage meters; quick actions (outline, icon + label); recent processes list (title link, "Ends on {date}", status badge, vote count, "View all processes ↗").
48
+ 5. **Sign in / recover.** Email, password, right-aligned small "Forgot your password?" link, full-width "Log in", Google option, "Don't have an account? Sign up". Recovery: one email field, "Email password reset link", toast "Recovery email sent", then reset form (email and code prefilled from the link, new + confirm password, "Reset password"). After sign-in return to the page that required it.
49
+
50
+ ## 3. Organizer: build and publish a vote
51
+
52
+ The builder is **one document-style page, not a wizard** (`/admin/processes/create`). Writing the vote feels like writing a document; configuration lives in a side panel.
53
+
54
+ 1. **Canvas.** Sticky top bar: "Draft" pill when editing a draft, reset icon (only when dirty), settings toggle, **Publish** (primary), **Save** (outline). Then a borderless 24px title input ("Voting process title"), optional "Attach video" accordion, borderless rich-text description ("Add a description...").
55
+ 2. **Questions.** Each question is a bordered box labeled "Question {n} of {total}" with drag handle, borderless bold title, optional description, and a settings cluster (top right on desktop): type select (Single choice / Multiple choice) and an "Extended info" switch (turns options into image cards with descriptions). Options are choice cards with a preview radio/checkbox, placeholder "Option {n}", sortable, removable when more than two remain; ghost "+ Add option". Multiple choice adds a sentence with inline selects: "Voters must select at least [1] and at most [3] options." Full-width outline "+ Add question" at the end. Deleting a question asks first.
56
+ 3. **Settings panel** (slides in from the right; full screen on mobile):
57
+ - Basic: "Start immediately" switch (on by default; off reveals start date and time), end date and time (required). Inline validation ("End date must be greater than start date."), plan-limit alert with a contact link.
58
+ - Extra: result visibility (Live results / Hidden until the end, default hidden), voting power (One person, one vote / Weighted), "Anonymous voting" switch (plan-gated), each with a help tooltip.
59
+ - Census: badge "{n} steps left" (orange) or "Ready" (green). Step 1 "Select a group of members" (searchable select with member counts). Step 2 "Set how voters prove who they are", disabled until a group is picked, with the reason shown. Numbered circular step markers: gray idle, orange current, red error, green done with a check.
60
+ 4. **Voter authentication** (dialog, three tabs, each unlocked by the previous; ghost "Back", primary "Next" then "Confirm"):
61
+ - Credentials: checkboxes over member fields, max 3, counter "2/3 credentials selected", inline advice (info at 1: "For better security, select at least 2 credentials."; success at 2+).
62
+ - Two-factor: switch, then radio cards Email / SMS / Voter's choice. Next validates the census server-side and lists duplicates or missing data with links to fix them.
63
+ - Summary: chosen credentials with checks, 2FA method, the Weak/Mid/Strong security pills, and a matching alert (error with recommendations / warning / success). Strong = 2FA on; Mid = 3 credentials without 2FA; Weak otherwise.
64
+ - On confirm: toast "Voter authentication configured"; the panel shows a summary card and "Edit voter authentication". Changing the group later resets authentication with an info toast that explains what was kept.
65
+ 5. **Drafts and leaving.** Auto-save on blur, every 30s and before unload; manual Save toasts "Draft saved". Leaving with changes opens a dialog, "You have unsaved changes. Are you sure you want to leave?", with Cancel (left), red "Discard and leave", primary "Save and leave". The app titles it "Saving draft"; "Unsaved changes" reads better (recommended).
66
+ 6. **Publish.** Invalid fields show inline; if any is in the settings panel the panel opens; census problems raise one updatable toast with an action ("Voter authentication isn't set up" / "Choose how voters will identify themselves, then publish again." [Set it up]). Publishing shows the button's loading state (no modal), then toast "Voting process successfully created" / "Redirecting you to the voting process page..." and navigates to the admin view.
67
+
68
+ ## 4. Organizer: run and close a vote
69
+
70
+ Admin process view (`/admin/process/:id`):
71
+
72
+ - Main column: status badge, title, description; "Schedule" card (2x2 icon tiles: start date, start time, end date, end time); "Voting link" card (read-only input + copy + preview buttons); tabs "Questions | Results" with the results-disclosure badge (blue "Live results", orange "Awaiting results", teal "Results available"; the app currently paints the last one green, see `brand-core.md`).
73
+ - Sidebar "Vote information": control panel (outline buttons with colored icons: Pause orange, Resume green, End vote red, Cancel vote red), voting status (total votes, turnout bar, census size, voter lookup "Voted / Not voted"), voting settings tiles (results type, visibility, anonymity, overwrite), additional actions (explorer, PDF report).
74
+ - Destructive actions use the confirm dialog (title "End vote" / "Cancel vote", consequence sentence, ghost Cancel, red confirm). On-chain progress shows a persistent, non-closable toast ("Waiting for transaction confirmation...") until it settles.
75
+ - Process list (`/admin/processes/{all,ended,drafts}`): tab rail, table (Title, Start, End, Type, Status, Votes, Results, kebab: More info, Public voting page, Explorer, PDF report, Clone as draft), cards under 768px, pagination footer.
76
+
77
+ ## 5. Members and census
78
+
79
+ - Memberbase page: heading + subtitle; tabs "Members (count)" / "Groups".
80
+ - Members toolbar (bordered box): search (debounced), bulk-action row that appears on selection ("Selected: 3 members" + Create group / Add to group / Add to census + red outline Delete), right side outline "Import" and primary "+ Add member". Table with checkbox column, column manager, kebab per row; cards on mobile.
81
+ - Add/edit member: end drawer with the form; toast "Member added".
82
+ - Import (end drawer, closes only by its buttons): A) choose columns and "Download template", or drop a file (.csv, .xlsx, .xls, .ods); B) map columns (one select per field, used columns removed from the others, warning that unmapped columns are not imported); C) data preview (first rows); footer "Reset import" (outline, left) / "Import data" (primary, right). Runs in the background with a banner "Import in progress. You can close this page; we will email you when it finishes." Ends as success, completed with errors (link to the errors), or error.
83
+ - Groups: card grid (title, kebab, "Created {date}", "{n} members", description, full-width `xs` primary "Create a vote"). "All members" is a read-only automatic group. Delete asks: "Are you sure you want to delete {title}? This cannot be undone."
84
+
85
+ ## 6. Plans and limits
86
+
87
+ - Pricing: Monthly | Annual tabs (Annual tagged "Save 40%" in green), plan cards in a 1/2/4 grid (name, one-line audience, price "/month" or "Price on request", feature list with icons, CTA "Upgrade to {plan}" / disabled outline "Current plan" / "Schedule a call"), then a comparison table and FAQ.
88
+ - Checkout: back arrow, two columns: order summary (total due today, then price/period, promotion code) and the payment form with "Subscribe".
89
+ - Hitting a limit: dialog "Upgrade to increase your plan limits" / "Your current plan limits this action to {limit}. Upgrade your plan to continue and unlock advanced features." with Cancel / "See plans". Specific limits get specific titles ("Upgrade to add more members to your memberbase").
90
+ - Gated feature in place: the control is shown blurred under an overlay with a lock icon, "Your current {plan} plan does not include {feature}", "Available in:" plan tags, and "Unlock {feature}". Never hide a gated feature entirely.
91
+
92
+ ## 7. Marketing to product handoff
93
+
94
+ - Editorial CTAs go to the app: "Start for free" / "Set up a test vote" to sign-up, navbar "Sign in" to sign-in. Vertical pages pass the sector (`?type=associations`) so the auth showcase and trust bar speak to that sector; the forms never change.
95
+ - Every vertical page offers a human path next to the self-serve one ("Talk to an election expert": booking dialog or WhatsApp), and a reassurance microline under the CTA ("Free account, no credit card.").
96
+ - Developer pages swap the navbar CTA to "API Dashboard".
97
+
98
+ ## Cross-cutting patterns
99
+
100
+ | Pattern | Rule |
101
+ | --- | --- |
102
+ | Validation | Inline under the field, on submit; no browser popups (`noValidate`). If the error is off-screen, scroll to it and/or toast. |
103
+ | Toasts | Bottom center. Past-tense success titles. Errors: short title + server message. Fixed ids for repeatable ones. Persistent for connection loss ("Connection issues detected", then "Connection restored"). |
104
+ | Confirmation | Dialog for decisions, drawer for entity forms, toast for acknowledgment. Cancel left (ghost/outline), confirm right; red when destructive. |
105
+ | Loading | Button `loading` for mutations; thin indeterminate bar for lists; skeletons only for images; blocking dialog only for vote casting. |
106
+ | Empty | Icon, title, one sentence, one CTA. Different copy for "nothing yet" vs "no matches for this search". |
107
+ | Errors | Page level: icon, "Something went wrong", "Reload the page or go back to the dashboard.", outline "Reload" + primary "Go to dashboard". Section level: "This section could not be loaded" without breaking the page. 404: "404", "Page not found", one-line explanation, primary home button. |
108
+ | Responsive | Tables become cards below 768px; sidebars become drawers; voting sidebar stacks below 1280px; sticky primary actions on mobile. |
109
+ | Privacy | `ph-no-capture` on ballots, member data and receipts. Never log or replay vote content. |
110
+ | Copy | Sentence case; explain consequences; no em dashes. |
@@ -0,0 +1,15 @@
1
+ // EXPECT mode=editorial rules=editorial-no-gray,editorial-no-white,editorial-serif-weight,editorial-signal-dot-only,fraunces-full,no-em-dash,no-transition-all,sentence-case
2
+ import '@fontsource-variable/fraunces/wght.css'
3
+
4
+ export const Bad = () => (
5
+ <section className='bg-white text-gray-600 transition-all'>
6
+ <h1 className='text-5xl font-bold'>{t('hero.title', 'Secure Voting For Everyone')}</h1>
7
+ <p>
8
+ {t(
9
+ 'hero.lede',
10
+ 'Fast — and secure'
11
+ )}
12
+ </p>
13
+ <div className='bg-signal p-8 rounded-xl'>Promo</div>
14
+ </section>
15
+ )
@@ -0,0 +1,9 @@
1
+ // EXPECT mode=product rules=product-control-radius,product-light-weights,product-no-editorial,sentence-case
2
+ export const P = () => (
3
+ <div className='font-serif'>
4
+ <h1 className='text-2xl font-bold'>Voting processes</h1>
5
+ <Button className='rounded-xl'>
6
+ Add Member
7
+ </Button>
8
+ </div>
9
+ )
@@ -0,0 +1,10 @@
1
+ <!-- EXPECT mode=both rules=no-em-dash -->
2
+ # Using the tokens
3
+
4
+ Never write `transition-all` in a component, and avoid `text-gray-500`.
5
+
6
+ ```tsx
7
+ <div className='transition-all bg-white text-gray-500' />
8
+ ```
9
+
10
+ This sentence has an em dash — which the copy rules reject.
@@ -0,0 +1 @@
1
+ {"_": "EXPECT mode=both rules=no-em-dash", "escaped": "Request sent \u2014 we will reply"}