@semplice-studio/pa-design-system 0.1.1 → 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.
- package/README.md +85 -128
- package/dist/components/PaDatePicker/PaDatePicker.vue2.js +1 -1
- package/dist/components/PaRangePicker/PaRangePicker.vue2.js +1 -1
- package/dist/style.css +1 -1
- package/docs/design-system.md +590 -0
- package/docs/layouts.md +297 -0
- package/docs/page-composition-examples.md +286 -0
- package/docs/public-surface.md +68 -0
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,166 +1,123 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @semplice-studio/pa-design-system
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Vue 3 design system for Italian **Pubblica Amministrazione (PA)** web portals — accessible, brand-consistent components and design tokens, by [Semplice](https://semplice.is).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- **41 components** (15 atoms + 26 composed) — forms, navigation, overlays, data display, date/time pickers
|
|
6
|
+
- **Design tokens as CSS custom properties**, with Inter + Roboto Mono bundled via `@font-face`
|
|
7
|
+
- **Accessibility-first**: WAI-ARIA patterns, keyboard navigation, focus management — built toward Italian PA requirements (AgID / Legge Stanca)
|
|
8
|
+
- **ESM-only**, tree-shakeable, typed (`.d.ts` for every component)
|
|
9
|
+
- Italian default labels everywhere, overridable via props for other locales
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
> ⚠️ **Pre-1.0**: minor versions may contain breaking changes until `v1.0.0`.
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
- **One conversation per phase.** Each skill is a guided Q&A that produces one durable artifact (PRD, design system, data model, user story).
|
|
11
|
-
- **Plan first, develop second.** No code is written before a plan is confirmed. Stories are drafted before they're built. Components are mapped before they're composed.
|
|
12
|
-
- **Per-step approval.** The agent never batch-implements. Every user story gets its own approval gate.
|
|
13
|
+
## Requirements
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
- Vue **≥ 3.4**
|
|
16
|
+
- Node **≥ 20** (build tooling)
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
## Installation
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
1. Clone this template → empty repo with .claude/ + docs/ scaffolding
|
|
22
|
-
2. /init-prd → dialog → docs/prd.md + populated CLAUDE.md
|
|
23
|
-
3. /import-design-system → Figma → docs/frontend/design-system.md + tokens
|
|
24
|
-
4. /data-model → dialog → docs/data-model.md + schema sketch
|
|
25
|
-
5. /user-story <topic> → Q&A → docs/user-stories/user-stories-vX.X.md
|
|
26
|
-
6. /user-story implement vX.X → loop: plan → approve → implement → tick AC
|
|
27
|
-
7. git commit → one bundled commit per story
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### Library / npm package project (e.g. a Vue design system)
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
1. Clone this template → empty repo with .claude/ + docs/ scaffolding
|
|
34
|
-
2. /init-library → dialog → docs/prd.md (library spec) + CLAUDE.md
|
|
35
|
-
+ optional package.json + tsconfig + build config
|
|
36
|
-
3. /import-design-system → Figma → docs/frontend/design-system.md + tokens
|
|
37
|
-
4. (skip /data-model — libraries have no data model)
|
|
38
|
-
5. /user-story <component> → Q&A → docs/user-stories/user-stories-vX.X.md
|
|
39
|
-
6. /user-story implement vX.X → loop: plan → approve → /figma-component → tick AC
|
|
40
|
-
7. git commit → one bundled commit per story (or per component)
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @semplice-studio/pa-design-system
|
|
22
|
+
# or: npm install / yarn add
|
|
41
23
|
```
|
|
42
24
|
|
|
43
|
-
|
|
25
|
+
`@phosphor-icons/vue` and `v-calendar` are installed automatically as dependencies; `vue` is a peer.
|
|
44
26
|
|
|
45
|
-
##
|
|
27
|
+
## Quickstart — Nuxt 3/4
|
|
46
28
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
29
|
+
```ts
|
|
30
|
+
// nuxt.config.ts
|
|
31
|
+
export default defineNuxtConfig({
|
|
32
|
+
css: [
|
|
33
|
+
'@semplice-studio/pa-design-system/tokens.css',
|
|
34
|
+
'@semplice-studio/pa-design-system/style.css',
|
|
35
|
+
],
|
|
36
|
+
})
|
|
37
|
+
```
|
|
53
38
|
|
|
54
|
-
|
|
39
|
+
```vue
|
|
40
|
+
<script setup lang="ts">
|
|
41
|
+
import { PaButton, PaInput } from '@semplice-studio/pa-design-system'
|
|
42
|
+
</script>
|
|
55
43
|
|
|
56
|
-
|
|
44
|
+
<template>
|
|
45
|
+
<PaInput v-model="name" label="Nome" />
|
|
46
|
+
<PaButton @click="submit">Invia</PaButton>
|
|
47
|
+
</template>
|
|
48
|
+
```
|
|
57
49
|
|
|
58
|
-
|
|
59
|
-
|---|---|---|---|
|
|
60
|
-
| Requirements / discovery | `/init-prd` (product) or `/init-library` (npm package) | `docs/prd.md` + populated `CLAUDE.md` | Personas/package surface, scope, stack, constraints |
|
|
61
|
-
| UX / visual design | `/import-design-system` | `docs/frontend/design-system.md` + token files + Figma→component recognition rules | Components available, token names, icon registry |
|
|
62
|
-
| System / data design | `/data-model` | `docs/data-model.md` + ORM schema sketch | Entities, relationships, indexes, RLS policies *(skip for library projects)* |
|
|
50
|
+
## Quickstart — plain Vue + Vite
|
|
63
51
|
|
|
64
|
-
|
|
52
|
+
```ts
|
|
53
|
+
// main.ts
|
|
54
|
+
import '@semplice-studio/pa-design-system/tokens.css'
|
|
55
|
+
import '@semplice-studio/pa-design-system/style.css'
|
|
56
|
+
```
|
|
65
57
|
|
|
66
|
-
|
|
58
|
+
Then import components where you use them — no plugin, no global registration.
|
|
67
59
|
|
|
68
|
-
|
|
69
|
-
|---|---|---|---|
|
|
70
|
-
| Sprint planning | `/user-story <topic>` | `docs/user-stories/user-stories-vX.X.md` | One file per release. Stories scoped, AC testable, files listed. |
|
|
71
|
-
| Implementation | `/user-story implement vX.X` | Source code + ticked AC | Per-step approval. Calls `/ui-composer` and `/figma-component` as sub-skills when needed. |
|
|
72
|
-
| Component design (sub-skill) | `/figma-component <Name> <figma-url>` | Component file + design-system.md update (status 🟡 → ✅) | Only when a story needs a new atom. |
|
|
73
|
-
| Page composition (sub-skill) | `/ui-composer` | Page file with mock data, AC checklist | Only when a story scaffolds a page from existing atoms. |
|
|
74
|
-
| Review / merge | (manual) | git commit per story | One bundled commit per story; commit message follows `feat(area): <summary> (US-NN)`. |
|
|
60
|
+
## Imports
|
|
75
61
|
|
|
76
|
-
|
|
62
|
+
```ts
|
|
63
|
+
// barrel — tree-shaken by your bundler
|
|
64
|
+
import { PaButton, PaModal } from '@semplice-studio/pa-design-system'
|
|
77
65
|
|
|
78
|
-
|
|
66
|
+
// or per-component subpath
|
|
67
|
+
import { PaButton } from '@semplice-studio/pa-design-system/components/PaButton'
|
|
68
|
+
```
|
|
79
69
|
|
|
80
|
-
|
|
70
|
+
Every component also exports its prop/option types (`PaButtonProps`, `PaSelectOption`, …).
|
|
81
71
|
|
|
82
|
-
|
|
83
|
-
- `/user-story implement` ticks acceptance criteria (✅) in the story file and proposes commits
|
|
84
|
-
- New conventions discovered during implementation get appended to the relevant `docs/tech/*.md`
|
|
85
|
-
- `/data-model` is re-runnable when entities change — diffs against the existing model
|
|
72
|
+
## Stylesheets
|
|
86
73
|
|
|
87
|
-
|
|
74
|
+
| Entry | Contents |
|
|
75
|
+
|---|---|
|
|
76
|
+
| `tokens.css` | Design tokens (`--pa-color-*`, `--pa-space-*`, `--pa-font-*`, …) + bundled Inter / Roboto Mono `@font-face` — no separate font loading needed. Auto-imports `layout.css`. |
|
|
77
|
+
| `layout.css` | `.pa-*` layout/composition utilities (also importable standalone) |
|
|
78
|
+
| `style.css` | Compiled component styles |
|
|
88
79
|
|
|
89
|
-
|
|
80
|
+
## Theming
|
|
90
81
|
|
|
91
|
-
|
|
82
|
+
All component styling resolves through CSS custom properties — override them at the consumer level, no build-time config:
|
|
92
83
|
|
|
93
|
-
|
|
84
|
+
```css
|
|
85
|
+
:root {
|
|
86
|
+
--pa-color-primary: #0a5fad;
|
|
87
|
+
}
|
|
94
88
|
```
|
|
95
|
-
git clone <template> dx-design-system && cd dx-design-system && claude
|
|
96
|
-
> /init-library
|
|
97
|
-
```
|
|
98
|
-
The agent Q&As through 18 questions (package name, target framework, build tool, peer deps, distribution shape). ~30 min later: `docs/prd.md` is filled with the library spec, `CLAUDE.md` is populated, optional `package.json` + `tsconfig.json` + build config are scaffolded. *Phase: Requirements engineering.*
|
|
99
89
|
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
> /import-design-system
|
|
103
|
-
```
|
|
104
|
-
The agent extracts color/typography/spacing/radius tokens from Figma, enumerates atoms and composed components, builds the icon registry. Output: `docs/frontend/design-system.md` (every component marked 🟡 designed, awaiting implementation), `src/tokens/*.css`, Figma→component recognition rules seeded. *Phase: UX/visual design.*
|
|
90
|
+
## Component reference & agent docs
|
|
105
91
|
|
|
106
|
-
**(
|
|
92
|
+
These docs ship **inside the package** (`node_modules/@semplice-studio/pa-design-system/docs/`), version-locked to the installed release — point your coding agent at them:
|
|
107
93
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
The agent Q&As scope, AC, file paths, dependencies. Output: `docs/user-stories/user-stories-v1.1.md` with ~6 user stories (US-01 → US-06), each with concrete AC and file paths. *Phase: Sprint planning.*
|
|
94
|
+
- [`docs/public-surface.md`](docs/public-surface.md) — export table: every component with its props/v-model/slots/emits summary
|
|
95
|
+
- [`docs/page-composition-examples.md`](docs/page-composition-examples.md) — page skeleton + section patterns distilled from the reference templates
|
|
96
|
+
- [`docs/layouts.md`](docs/layouts.md) — the `.pa-*` layout utility classes
|
|
97
|
+
- [`docs/design-system.md`](docs/design-system.md) — design tokens + component registry
|
|
113
98
|
|
|
114
|
-
|
|
115
|
-
```
|
|
116
|
-
> /user-story implement v1.1
|
|
117
|
-
```
|
|
118
|
-
For each US-NN: agent proposes a plan → user approves → agent calls `/figma-component UiButton <figma-url>` as a sub-skill → component generated → `docs/frontend/design-system.md` updated (status 🟡 → ✅) → AC ticked → commit suggested (`feat(button): add UiButton with primary/outline/ghost variants (US-01)`). Loop continues for each story. *Phase: Implementation, with continuous documentation woven in.*
|
|
99
|
+
For live examples, run the Histoire playground (see Development).
|
|
119
100
|
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
> /user-story Composed components: Card, Header, Sidebar
|
|
123
|
-
```
|
|
124
|
-
The agent reads `CLAUDE.md`, `docs/prd.md`, `docs/frontend/design-system.md` (now with 5 ✅ atoms it can compose with), and the previous user-stories file as structural reference. Phase B repeats — but the knowledge base is bigger and the agent's plans are sharper. *Phase: next iteration of sprint planning + implementation.*
|
|
101
|
+
Conventions that apply across the library:
|
|
125
102
|
|
|
126
|
-
|
|
103
|
+
- **Shared form anatomy**: form components mirror `PaInput`'s `label` / `helperText` / `error` / `valid` / `required` / `disabled` / `readonly` set
|
|
104
|
+
- **Date/time pickers**: values normalized to *local* midnight (never UTC); with `name` set, a hidden input serializes for native form posts
|
|
105
|
+
- **Responsive components use container queries** — they reflow inside narrow sidebars regardless of viewport
|
|
106
|
+
- **SPA routing**: nav components (`PaBreadcrumb`, headers, footer) emit preventable payloads — call `preventDefault()` and route with your router
|
|
127
107
|
|
|
128
|
-
##
|
|
108
|
+
## Development
|
|
129
109
|
|
|
110
|
+
```bash
|
|
111
|
+
pnpm install
|
|
112
|
+
pnpm dev # Histoire playground
|
|
113
|
+
pnpm test # Vitest (watch)
|
|
114
|
+
pnpm build # library build + type emit
|
|
115
|
+
pnpm typecheck
|
|
116
|
+
pnpm lint
|
|
130
117
|
```
|
|
131
|
-
template/
|
|
132
|
-
├── AUDIT.md ← what's reusable methodology vs Sapra-specific
|
|
133
|
-
├── CLAUDE.md ← skeleton with {{TODO}} slots filled by skills
|
|
134
|
-
├── .claude/skills/
|
|
135
|
-
│ ├── init-prd/ ← NEW: bootstrap a product/app project
|
|
136
|
-
│ ├── init-library/ ← NEW: bootstrap a library/npm package project
|
|
137
|
-
│ ├── import-design-system/ ← NEW: Figma → design-system.md + tokens
|
|
138
|
-
│ ├── data-model/ ← NEW: entities + relationships → data-model.md
|
|
139
|
-
│ ├── user-story/ ← LIFTED from Sapra (deparametrized)
|
|
140
|
-
│ ├── ui-composer/ ← LIFTED from Sapra (deparametrized)
|
|
141
|
-
│ └── figma-component/ ← LIFTED from Sapra (deparametrized, now a skill)
|
|
142
|
-
└── docs/
|
|
143
|
-
├── workflow.md ← Plan-first/Develop-second workflow rules
|
|
144
|
-
├── prd.md ← empty template, filled by /init-prd
|
|
145
|
-
├── data-model.md ← empty template, filled by /data-model
|
|
146
|
-
├── frontend/
|
|
147
|
-
│ └── design-system.md ← empty template, filled by /import-design-system
|
|
148
|
-
└── user-stories/ ← created per release by /user-story
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## How to use
|
|
152
|
-
|
|
153
|
-
1. Copy `template/` contents to a fresh repo (the `template/` folder itself is for reference inside Sapra)
|
|
154
|
-
2. Open it in Claude Code — the agent reads `CLAUDE.md` on session start
|
|
155
|
-
3. Decide: is this a **product** or a **library**?
|
|
156
|
-
- Product/app → run `/init-prd`. Q&A through tech stack, product surface, constraints
|
|
157
|
-
- Library (npm package, design system, SDK) → run `/init-library`. Q&A through package surface, peer deps, build, distribution
|
|
158
|
-
4. Run `/import-design-system` once your designer has a Figma file ready
|
|
159
|
-
5. Run `/data-model` to lock down entities before any backend work — **skip for library projects**
|
|
160
|
-
6. From there: `/user-story` per feature/component, then `implement vX.X` per release
|
|
161
118
|
|
|
162
|
-
|
|
119
|
+
Releases use [changesets](https://github.com/changesets/changesets): `pnpm changeset` → `pnpm changeset version` → commit → `pnpm release` → `git push --follow-tags`. Published publicly on npmjs.com (`publishConfig.access: public`); publishing requires npm 2FA.
|
|
163
120
|
|
|
164
|
-
|
|
121
|
+
## License
|
|
165
122
|
|
|
166
|
-
|
|
123
|
+
[EUPL-1.2](LICENSE) © Semplice
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as G, useModel as H, ref as M, computed as n, watch as J, onBeforeUnmount as Q, openBlock as u, createElementBlock as c, normalizeClass as p, createTextVNode as X, toDisplayString as C, createCommentVNode as v, withKeys as S, withModifiers as q, createElementVNode as g, renderSlot as Z, createVNode as y, withDirectives as ee, unref as ae, withCtx as L, vShow as te, mergeModels as ie } from "vue";
|
|
2
2
|
import { DatePicker as ne } from "v-calendar";
|
|
3
|
-
|
|
3
|
+
/* empty css */
|
|
4
4
|
import E from "../PaIcon/PaIcon.vue.js";
|
|
5
5
|
const re = ["for"], le = {
|
|
6
6
|
key: 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as ne, useModel as re, ref as y, computed as o, watch as le, onBeforeUnmount as ie, openBlock as f, createElementBlock as m, normalizeClass as D, createTextVNode as oe, toDisplayString as F, createCommentVNode as k, withKeys as V, withModifiers as _, createElementVNode as w, renderSlot as de, createVNode as M, withDirectives as se, unref as ue, withCtx as W, vShow as ce, mergeModels as ve } from "vue";
|
|
2
2
|
import { DatePicker as ge } from "v-calendar";
|
|
3
|
-
|
|
3
|
+
/* empty css */
|
|
4
4
|
import B from "../PaIcon/PaIcon.vue.js";
|
|
5
5
|
const fe = ["for"], me = {
|
|
6
6
|
key: 0,
|