@profpowell/vb-project-planning 0.1.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 (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +93 -0
  3. package/dist/vb-project-planning.css +1603 -0
  4. package/dist/vb-project-planning.js +11138 -0
  5. package/dist/vb-project-planning.min.css +1 -0
  6. package/dist/vb-project-planning.min.js +3312 -0
  7. package/package.json +80 -0
  8. package/src/index.css +14 -0
  9. package/src/index.js +26 -0
  10. package/src/lib/bundle-registry.js +156 -0
  11. package/src/lib/diff-by-key.js +86 -0
  12. package/src/lib/portrait-url.js +87 -0
  13. package/src/lib/vb-collection.js +122 -0
  14. package/src/lib/vb-element.js +96 -0
  15. package/src/lib/vb-store.js +200 -0
  16. package/src/lib/vb-view-transition.js +44 -0
  17. package/src/utils/copy-init.js +287 -0
  18. package/src/web-components/_ux-base.js +106 -0
  19. package/src/web-components/adr-wc/README.md +77 -0
  20. package/src/web-components/adr-wc/api.json +26 -0
  21. package/src/web-components/adr-wc/logic.js +376 -0
  22. package/src/web-components/adr-wc/static.html +17 -0
  23. package/src/web-components/adr-wc/styles.js +338 -0
  24. package/src/web-components/burndown-chart/api.json +74 -0
  25. package/src/web-components/burndown-chart/logic.js +198 -0
  26. package/src/web-components/burndown-chart/static.html +31 -0
  27. package/src/web-components/burndown-chart/styles.css +59 -0
  28. package/src/web-components/capacity-plan/_capacity-utils.js +56 -0
  29. package/src/web-components/capacity-plan/api.json +20 -0
  30. package/src/web-components/capacity-plan/logic.js +222 -0
  31. package/src/web-components/capacity-plan/static.html +24 -0
  32. package/src/web-components/capacity-plan/styles.css +84 -0
  33. package/src/web-components/empathy-map/api.json +31 -0
  34. package/src/web-components/empathy-map/logic.js +502 -0
  35. package/src/web-components/empathy-map/static.html +32 -0
  36. package/src/web-components/empathy-map/styles.js +534 -0
  37. package/src/web-components/gantt-chart/README.md +91 -0
  38. package/src/web-components/gantt-chart/api.json +20 -0
  39. package/src/web-components/gantt-chart/logic.js +812 -0
  40. package/src/web-components/gantt-chart/static.html +60 -0
  41. package/src/web-components/gantt-chart/styles.css +391 -0
  42. package/src/web-components/impact-effort/api.json +21 -0
  43. package/src/web-components/impact-effort/logic.js +392 -0
  44. package/src/web-components/impact-effort/static.html +23 -0
  45. package/src/web-components/impact-effort/styles.css +193 -0
  46. package/src/web-components/iron-triangle/_capacity.js +83 -0
  47. package/src/web-components/iron-triangle/_triangle-geometry.js +322 -0
  48. package/src/web-components/iron-triangle/api.json +26 -0
  49. package/src/web-components/iron-triangle/logic.js +474 -0
  50. package/src/web-components/iron-triangle/static.html +28 -0
  51. package/src/web-components/iron-triangle/styles.css +158 -0
  52. package/src/web-components/kanban-board/api.json +24 -0
  53. package/src/web-components/kanban-board/logic.js +698 -0
  54. package/src/web-components/kanban-board/static.html +20 -0
  55. package/src/web-components/kanban-board/styles.css +242 -0
  56. package/src/web-components/product-roadmap/api.json +118 -0
  57. package/src/web-components/product-roadmap/logic.js +460 -0
  58. package/src/web-components/product-roadmap/static.html +44 -0
  59. package/src/web-components/product-roadmap/styles.css +158 -0
  60. package/src/web-components/quadrant-grid/api.json +125 -0
  61. package/src/web-components/quadrant-grid/logic.js +397 -0
  62. package/src/web-components/quadrant-grid/static.html +49 -0
  63. package/src/web-components/quadrant-grid/styles.css +184 -0
  64. package/src/web-components/quality-target/_quality-utils.js +460 -0
  65. package/src/web-components/quality-target/api.json +30 -0
  66. package/src/web-components/quality-target/logic.js +516 -0
  67. package/src/web-components/quality-target/static.html +22 -0
  68. package/src/web-components/quality-target/styles.css +203 -0
  69. package/src/web-components/requirement-card/api.json +25 -0
  70. package/src/web-components/requirement-card/logic.js +166 -0
  71. package/src/web-components/requirement-card/static.html +36 -0
  72. package/src/web-components/requirement-card/styles.js +114 -0
  73. package/src/web-components/review-surface/README.md +178 -0
  74. package/src/web-components/review-surface/api.json +30 -0
  75. package/src/web-components/review-surface/logic.js +807 -0
  76. package/src/web-components/review-surface/static.html +33 -0
  77. package/src/web-components/review-surface/styles.js +459 -0
  78. package/src/web-components/risk-register/api.json +47 -0
  79. package/src/web-components/risk-register/logic.js +180 -0
  80. package/src/web-components/risk-register/static.html +46 -0
  81. package/src/web-components/risk-register/styles.css +37 -0
  82. package/src/web-components/story-map/api.json +22 -0
  83. package/src/web-components/story-map/logic.js +445 -0
  84. package/src/web-components/story-map/static.html +35 -0
  85. package/src/web-components/story-map/styles.css +169 -0
  86. package/src/web-components/traceability-matrix/api.json +84 -0
  87. package/src/web-components/traceability-matrix/logic.js +243 -0
  88. package/src/web-components/traceability-matrix/static.html +41 -0
  89. package/src/web-components/traceability-matrix/styles.css +94 -0
  90. package/src/web-components/user-journey/api.json +84 -0
  91. package/src/web-components/user-journey/logic.js +368 -0
  92. package/src/web-components/user-journey/static.html +14 -0
  93. package/src/web-components/user-journey/styles.js +317 -0
  94. package/src/web-components/user-persona/api.json +35 -0
  95. package/src/web-components/user-persona/logic.js +502 -0
  96. package/src/web-components/user-persona/static.html +20 -0
  97. package/src/web-components/user-persona/styles.js +299 -0
  98. package/src/web-components/user-story/api.json +35 -0
  99. package/src/web-components/user-story/logic.js +567 -0
  100. package/src/web-components/user-story/static.html +27 -0
  101. package/src/web-components/user-story/styles.js +332 -0
  102. package/src/web-components/work-item/README.md +85 -0
  103. package/src/web-components/work-item/api.json +30 -0
  104. package/src/web-components/work-item/logic.js +414 -0
  105. package/src/web-components/work-item/static.html +24 -0
  106. package/src/web-components/work-item/styles.js +376 -0
@@ -0,0 +1,178 @@
1
+ ---
2
+ title: "Review Surface Specification"
3
+ component: review-surface
4
+ version: 1.0.0
5
+ status: stable
6
+ ---
7
+
8
+ # Review Surface
9
+
10
+ Pin-based annotation overlay for collaborative design review.
11
+
12
+ ## Table of Contents
13
+ - [Purpose](#purpose)
14
+ - [Static HTML Form](#static-html-form)
15
+ - [Enhanced Form](#enhanced-form)
16
+ - [Attributes and API](#attributes-and-api)
17
+ - [Adapters](#adapters)
18
+ - [Accessibility](#accessibility)
19
+ - [CSS Tokens](#css-tokens)
20
+
21
+ ## Purpose
22
+
23
+ Wraps any HTML content and adds a transparent overlay for placing review
24
+ comment pins. Supports pluggable persistence (memory, localStorage, REST)
25
+ for solo and team workflows.
26
+
27
+ Part of the **UX Planning Pack** — completes the feedback loop alongside
28
+ user-persona, user-story, user-journey, empathy-map, and other planning
29
+ components.
30
+
31
+ ## Static HTML Form
32
+
33
+ Without JavaScript, the component renders its slotted content unchanged.
34
+ An optional `<ol slot="pins-fallback">` provides a text-based pin list.
35
+
36
+ ```html
37
+ <review-surface>
38
+ <img src="/comp.png" alt="Design comp" />
39
+ <ol slot="pins-fallback">
40
+ <li><strong>Sarah</strong> (42%, 18%): Fix alignment</li>
41
+ </ol>
42
+ </review-surface>
43
+ ```
44
+
45
+ ## Enhanced Form
46
+
47
+ ```html
48
+ <review-surface editable adapter="local" storage-key="sprint-4" author="Sarah">
49
+ <empathy-map src="/data/empathy.json"></empathy-map>
50
+ </review-surface>
51
+ ```
52
+
53
+ With JavaScript:
54
+ - Transparent overlay captures clicks in annotate mode
55
+ - Numbered pin markers placed at percentage coordinates
56
+ - Click a pin to open a comment popover with reply thread
57
+ - Toolbar for mode toggle, pin count, and JSON export
58
+
59
+ ## Attributes and API
60
+
61
+ | Attribute | Type | Default | Description |
62
+ |-----------|------|---------|-------------|
63
+ | `src` | string | — | JSON URL containing pin data |
64
+ | `editable` | boolean | — | Enables annotate mode and toolbar |
65
+ | `adapter` | string | `"memory"` | Persistence: `memory`, `local`, `rest` |
66
+ | `endpoint` | string | — | REST endpoint (when adapter=rest) |
67
+ | `storage-key` | string | `"review-surface"` | localStorage key |
68
+ | `author` | string | `"Anonymous"` | Default author name |
69
+ | `compact` | boolean | — | Reduced spacing variant |
70
+ | `show-resolved` | boolean | — | Show resolved pins |
71
+ | `pin-count` | number | 0 | Reflected visible pin count (read-only) |
72
+
73
+ **JS API:**
74
+
75
+ | Method | Description |
76
+ |--------|-------------|
77
+ | `addPin({ x, y, text, author })` | Create a pin |
78
+ | `removePin(id)` | Delete a pin |
79
+ | `resolvePin(id)` | Mark resolved |
80
+ | `unresolvePin(id)` | Re-open resolved pin |
81
+ | `exportPins()` | Return pins as JSON array |
82
+ | `importPins(data)` | Load pins (replaces current) |
83
+
84
+ **Properties:**
85
+
86
+ | Property | Type | Description |
87
+ |----------|------|-------------|
88
+ | `.pins` | Pin[] | Get/set pin data |
89
+ | `.adapter` | Object | Get/set adapter instance |
90
+
91
+ **Events:**
92
+
93
+ | Event | Detail | Description |
94
+ |-------|--------|-------------|
95
+ | `review-surface:ready` | `{ pinCount }` | After render |
96
+ | `review-surface:add` | `{ pin }` | Pin created |
97
+ | `review-surface:update` | `{ pin, changes }` | Pin modified |
98
+ | `review-surface:remove` | `{ pin }` | Pin deleted |
99
+ | `review-surface:resolve` | `{ pin }` | Pin resolved |
100
+ | `review-surface:select` | `{ pin }` | Popover opened |
101
+ | `review-surface:mode` | `{ mode }` | Mode toggled |
102
+
103
+ ## Adapters
104
+
105
+ ### Memory (default)
106
+ Ephemeral — pins are lost on page refresh.
107
+
108
+ ### LocalStorage
109
+ ```html
110
+ <review-surface adapter="local" storage-key="my-review">
111
+ ```
112
+
113
+ ### REST
114
+ ```html
115
+ <review-surface adapter="rest" endpoint="/api/reviews/page-1">
116
+ ```
117
+ Expects standard REST: `GET /`, `POST /`, `PATCH /:id`, `DELETE /:id`.
118
+
119
+ ### Custom
120
+ Set via property:
121
+ ```js
122
+ document.querySelector('review-surface').adapter = myCustomAdapter;
123
+ ```
124
+ Must implement: `load()`, `save(pin)`, `update(id, changes)`, `remove(id)`.
125
+
126
+ ## Failure Modes
127
+
128
+ - **No JavaScript:** Child content renders normally; pins are not shown.
129
+ - **No CSS:** Shadow DOM styles are self-contained; layout degrades gracefully.
130
+ - **Keyboard Only:** Tab navigates pins; Enter opens popover; Escape closes.
131
+ - **Screen Reader:** Pin markers announced as "Pin N: [text preview]";
132
+ live region announces create/delete/resolve actions.
133
+
134
+ ## Accessibility
135
+
136
+ - Pin markers are `<button>` with `aria-label`, `aria-expanded`, `aria-haspopup="dialog"`
137
+ - Popover uses `role="dialog"` with `aria-labelledby`
138
+ - Toolbar uses `role="toolbar"` with `aria-label`
139
+ - `aria-live="polite"` region announces pin actions
140
+ - All transitions respect `prefers-reduced-motion: reduce`
141
+
142
+ ## CSS Tokens
143
+
144
+ | Token | Fallback | Purpose |
145
+ |-------|----------|---------|
146
+ | `--review-surface-bg` | `--color-surface` | Background |
147
+ | `--review-surface-card` | `--color-surface-raised` | Popover/toolbar bg |
148
+ | `--review-surface-border` | `--color-border` | Borders |
149
+ | `--review-surface-text` | `--color-text` | Text color |
150
+ | `--review-surface-muted` | `--color-text-muted` | Secondary text |
151
+ | `--review-surface-accent` | `--color-interactive` | Focus/active |
152
+ | `--review-surface-pin-bg` | `--color-interactive` | Pin marker bg |
153
+ | `--review-surface-pin-text` | `#ffffff` | Pin marker text |
154
+ | `--review-surface-pin-size` | `28px` | Pin marker diameter |
155
+ | `--review-surface-resolved` | `--color-success` | Resolved pin color |
156
+
157
+ ## Examples
158
+
159
+ ### Annotating an empathy map
160
+ ```html
161
+ <review-surface editable adapter="local" storage-key="sprint-4-empathy">
162
+ <empathy-map src="/data/sarah.json"></empathy-map>
163
+ </review-surface>
164
+ ```
165
+
166
+ ### Annotating a browser window demo
167
+ ```html
168
+ <review-surface editable author="Design Lead">
169
+ <browser-window src="/demos/landing.html" shadow></browser-window>
170
+ </review-surface>
171
+ ```
172
+
173
+ ### Loading saved pins from JSON
174
+ ```html
175
+ <review-surface src="/data/review-pins.json">
176
+ <img src="/comp.png" alt="Design comp" />
177
+ </review-surface>
178
+ ```
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "../../../schemas/api.schema.json",
3
+ "element": "review-surface",
4
+ "type": "web-component",
5
+ "description": "Pin-based annotation overlay for design review — wraps any content and adds interactive comment pins with pluggable persistence",
6
+ "htmlvalidate": { "flow": true, "permittedContent": ["@flow"] },
7
+ "attributes": [
8
+ { "name": "src", "kind": "host-api", "purpose": "config", "type": "string", "description": "URL to JSON file containing pin data" },
9
+ { "name": "editable", "kind": "host-api", "purpose": "config", "type": "boolean", "description": "Enables annotate mode toolbar and pin creation" },
10
+ { "name": "adapter", "kind": "host-api", "purpose": "config", "type": "string", "description": "Persistence backend: memory | local | rest" },
11
+ { "name": "endpoint", "kind": "host-api", "purpose": "config", "type": "string", "description": "REST endpoint URL (when adapter=rest)" },
12
+ { "name": "storage-key", "kind": "host-api", "purpose": "config", "type": "string", "description": "VBStore key under namespace 'reviews' (when adapter=local)" },
13
+ { "name": "author", "kind": "host-api", "purpose": "config", "type": "string", "description": "Default author name for new pins" },
14
+ { "name": "compact", "kind": "host-api", "purpose": "config", "type": "boolean", "description": "Reduced spacing variant" },
15
+ { "name": "show-resolved", "kind": "host-api", "purpose": "config", "type": "boolean", "description": "Display resolved pins (hidden by default)" },
16
+ { "name": "pin-count", "kind": "host-api", "purpose": "config", "type": "number", "description": "Reflected count of visible pins (read-only)" }
17
+ ],
18
+ "slots": [
19
+ { "name": "(default)", "description": "The content to annotate (any HTML)" }
20
+ ],
21
+ "events": [
22
+ { "name": "review-surface:ready", "detail": "{ pinCount }", "description": "Fired after initial render" },
23
+ { "name": "review-surface:add", "detail": "{ pin }", "description": "Fired when a pin is created" },
24
+ { "name": "review-surface:update", "detail": "{ pin, changes }", "description": "Fired when a pin is modified" },
25
+ { "name": "review-surface:remove", "detail": "{ pin }", "description": "Fired when a pin is deleted" },
26
+ { "name": "review-surface:resolve", "detail": "{ pin }", "description": "Fired when a pin is marked resolved" },
27
+ { "name": "review-surface:select", "detail": "{ pin }", "description": "Fired when a pin popover is opened" },
28
+ { "name": "review-surface:mode", "detail": "{ mode }", "description": "Fired when view/annotate mode toggles" }
29
+ ]
30
+ }