@milesroxas/design-hub 0.13.0 → 0.15.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 (101) hide show
  1. package/README.md +38 -33
  2. package/core/catalog.test.ts +28 -1
  3. package/core/catalog.ts +21 -4
  4. package/core/prototype.test.ts +12 -1
  5. package/core/prototype.ts +21 -2
  6. package/core/review/model.ts +71 -6
  7. package/core/review/service.test.ts +536 -1
  8. package/core/review/service.ts +452 -25
  9. package/core/review/store.ts +45 -4
  10. package/dist/core/catalog.d.ts +8 -1
  11. package/dist/core/catalog.js +12 -3
  12. package/dist/core/prototype.d.ts +20 -2
  13. package/dist/core/prototype.js +17 -2
  14. package/dist/core/review/model.d.ts +42 -3
  15. package/dist/core/review/model.js +52 -3
  16. package/dist/core/review/service.d.ts +81 -7
  17. package/dist/core/review/service.js +407 -23
  18. package/dist/core/review/store.d.ts +29 -2
  19. package/dist/core/review/store.js +4 -0
  20. package/dist/scripts/client.d.ts +1 -1
  21. package/dist/scripts/client.js +1 -1
  22. package/dist/scripts/lib/catalog.d.ts +1 -1
  23. package/dist/scripts/lib/catalog.js +3 -3
  24. package/dist/scripts/lib/dns.d.ts +16 -2
  25. package/dist/scripts/lib/dns.js +66 -3
  26. package/dist/scripts/lib/fake-host.d.ts +16 -1
  27. package/dist/scripts/lib/fake-host.js +36 -1
  28. package/dist/scripts/lib/host.d.ts +2 -0
  29. package/dist/scripts/lib/resend.d.ts +36 -0
  30. package/dist/scripts/lib/resend.js +66 -0
  31. package/dist/scripts/lib/studio-deps.d.ts +7 -0
  32. package/dist/scripts/lib/studio-deps.js +6 -1
  33. package/dist/scripts/lib/studios.d.ts +2 -2
  34. package/dist/scripts/lib/studios.js +5 -5
  35. package/dist/scripts/lib/vercel-host.js +6 -0
  36. package/dist/scripts/new.d.ts +8 -3
  37. package/dist/scripts/new.js +15 -4
  38. package/dist/scripts/people.d.ts +16 -4
  39. package/dist/scripts/people.js +67 -17
  40. package/dist/scripts/preflight.js +1 -1
  41. package/dist/scripts/share.js +3 -3
  42. package/dist/scripts/studio.d.ts +19 -3
  43. package/dist/scripts/studio.js +327 -6
  44. package/dist/server/api.d.ts +25 -2
  45. package/dist/server/api.js +77 -17
  46. package/dist/server/dev-studio.d.ts +36 -0
  47. package/dist/server/dev-studio.js +181 -0
  48. package/dist/server/dev.d.ts +16 -1
  49. package/dist/server/dev.js +23 -3
  50. package/dist/server/gate.d.ts +26 -3
  51. package/dist/server/gate.js +323 -52
  52. package/dist/server/mailer.d.ts +60 -0
  53. package/dist/server/mailer.js +104 -0
  54. package/dist/server/mailers/fake.d.ts +8 -0
  55. package/dist/server/mailers/fake.js +16 -0
  56. package/dist/server/mailers/resend.d.ts +21 -0
  57. package/dist/server/mailers/resend.js +49 -0
  58. package/dist/server/session.js +4 -1
  59. package/dist/vercel/proxy.js +10 -3
  60. package/dist/vite/plugin.js +6 -1
  61. package/kit/ViewTools.tsx +9 -0
  62. package/kit/prefs.ts +3 -4
  63. package/kit/ui/Menu.tsx +29 -18
  64. package/kit/ui/layer.ts +41 -0
  65. package/package.json +1 -1
  66. package/shell/Command.tsx +142 -0
  67. package/shell/Index.tsx +902 -400
  68. package/shell/Milestone.tsx +302 -0
  69. package/shell/Sidebar.tsx +236 -0
  70. package/shell/index.css +224 -0
  71. package/shell/milestones.test.ts +157 -0
  72. package/shell/milestones.ts +144 -0
  73. package/shell/registry.ts +4 -3
  74. package/shell/review/Bar.tsx +1 -0
  75. package/shell/review/Card.tsx +17 -7
  76. package/shell/review/People.tsx +908 -134
  77. package/shell/review/Review.tsx +2 -2
  78. package/shell/review/anchor.ts +6 -1
  79. package/shell/review/client.ts +41 -7
  80. package/shell/review/menu-place.test.ts +41 -0
  81. package/shell/review/place.test.ts +26 -1
  82. package/shell/review/place.ts +17 -0
  83. package/shell/review/review.css +97 -11
  84. package/shell/review/view.test.ts +115 -1
  85. package/shell/review/view.ts +92 -2
  86. package/shell/shell.css +8 -175
  87. package/shell/sidebar.css +86 -0
  88. package/shell/studio/ClientHub.tsx +21 -10
  89. package/shell/studio/StudioHub.tsx +121 -45
  90. package/shell/studio/hub.css +118 -27
  91. package/shell/studio/page.tsx +28 -17
  92. package/shell/system.css +12 -0
  93. package/skills/miles-deploy/SKILL.md +25 -4
  94. package/skills/miles-new-feature/SKILL.md +2 -1
  95. package/skills/miles-prototype/SKILL.md +1 -1
  96. package/templates/app/README.md +1 -1
  97. package/templates/brand/README.md +1 -1
  98. package/templates/site/README.md +1 -1
  99. package/templates/space/README.md +1 -1
  100. package/templates/studio/.env.example +6 -0
  101. package/templates/studio/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /* The client hub and the studio hub: one column of project rows in the
1
+ /* The client hub and the studio hub: the sidebar docked left (../sidebar.css), then one column of project rows in the
2
2
  index's measure and rhythm (shell.css, The index), on the hub's neutral
3
3
  system look. The studio hub groups the rows under a head per client. A studio
4
4
  site has no tokens.css, so the few motion values the hub and kit/ui read
@@ -19,7 +19,7 @@
19
19
  body { background: var(--bg-primary); }
20
20
 
21
21
  .hub { width: min(744px, 100% - 8px); margin: 0 auto; padding: 96px 0 128px; display: flex; flex-direction: column; }
22
- .hub-head, .hub-empty, .hub-foot { padding-inline: 12px; }
22
+ .hub-head, .hub-empty { padding-inline: 12px; }
23
23
 
24
24
  .hub-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 40px; }
25
25
  .hub-head h1 { font-size: 18px; line-height: 28px; font-weight: 600; text-wrap: balance; }
@@ -42,10 +42,9 @@ body { background: var(--bg-primary); }
42
42
  .hub-empty h2 { font-size: 14px; line-height: 20px; font-weight: 600; }
43
43
  .hub-empty p { color: var(--text-tertiary); max-width: 52ch; text-wrap: pretty; }
44
44
  .hub-empty .btn { position: relative; margin-top: 12px; }
45
- /* The 38px button reaches 44px to the touch; nothing sits within 3px of it. */
46
- .hub-empty .btn::before { content: ''; position: absolute; inset: -3px 0; }
45
+ /* The 32px button reaches 44px to the touch; nothing sits within 6px of it. */
46
+ .hub-empty .btn::before { content: ''; position: absolute; inset: -6px 0; }
47
47
 
48
- .hub-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border-secondary); color: var(--text-tertiary); }
49
48
 
50
49
  :root[data-motion="reduce"] .hub-row:not(.is-static):active { transform: none; }
51
50
  :root[data-motion="reduce"] .hub-row:hover .hub-arrow { translate: none; }
@@ -62,21 +61,19 @@ body { background: var(--bg-primary); }
62
61
  .studio-client-head .badge { flex-shrink: 0; }
63
62
  .studio-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
64
63
  .studio-note { font-size: 13px; line-height: 18px; color: var(--text-tertiary); }
65
- /* The studio's own people sit apart from the clients, under a rule. */
66
- .studio-own { padding-top: 24px; border-top: 1px solid var(--border-secondary); }
67
64
  .studio-open { margin: 0; flex-shrink: 0; }
68
65
  .studio-open .hub-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
69
66
  .studio-project { display: flex; flex-direction: column; min-width: 0; }
70
67
  .studio-none { color: var(--text-tertiary); white-space: nowrap; }
71
68
  .studio-client > .studio-none { padding-inline: 12px; white-space: normal; }
72
- /* Open hub and People are 38px buttons; each reaches 44px to the touch, as the empty state's does. */
69
+ /* Open hub and People are 32px buttons; each reaches 44px to the touch, as the empty state's does. */
73
70
  .studio-client-head .btn { position: relative; }
74
- .studio-client-head .btn::before { content: ''; position: absolute; inset: -3px 0; }
71
+ .studio-client-head .btn::before { content: ''; position: absolute; inset: -6px 0; }
75
72
  /* The project row is a button: its name is "Open <project>", and the base focus ring sits inside its corners. */
76
73
  .studio-open .hub-row:focus-visible { box-shadow: var(--focus-ring); }
77
74
  /* While the list loads: one client's head and two rows at their filled sizes. */
78
75
  .studio-skeleton-name { width: 160px; height: 42px; border-radius: var(--radius-sm); background: var(--bg-tertiary); }
79
- .studio-skeleton-open { width: 90px; height: 38px; border-radius: var(--radius-sm); background: var(--bg-tertiary); }
76
+ .studio-skeleton-open { width: 90px; height: 32px; border-radius: var(--radius-sm); background: var(--bg-tertiary); }
80
77
  .studio-skeleton-row { height: 62px; }
81
78
 
82
79
  /* A section's people: the review panel's People controls (review/People.tsx)
@@ -89,35 +86,129 @@ body { background: var(--bg-primary); }
89
86
  .studio-people .rv-disclosure { font-size: 13px; line-height: 18px; max-width: 60ch; }
90
87
  .studio-people .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
91
88
  .studio-people .field-label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-secondary); }
92
- .studio-people .btn { position: relative; height: 40px; padding: 0 14px; }
93
- /* Name, access and the button on one line, wide enough; stacked on a phone. */
94
- .studio-people .rv-invite { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 200px) auto; align-items: end; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border-secondary); }
95
- @media (max-width: 600px) { .studio-people .rv-invite { grid-template-columns: minmax(0, 1fr); } }
89
+ .studio-people .btn { position: relative; height: 32px; padding: 0 12px; }
90
+ /* Add person, a quiet row at the end of the list. Its fill runs the row's width and 10px past the text on both
91
+ sides, so the icon stays on the names' left edge. */
92
+ .studio-people .btn.rv-add-person { justify-content: flex-start; width: calc(100% + 20px); margin-inline: -10px; }
93
+ /* The open form: name and address side by side when wide, stacked on a phone; each field is its label, its input
94
+ and what goes under it, so the cells align at the top and a refusal sits under its own field. */
95
+ .studio-people .rv-invite { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px 16px; max-width: 720px; }
96
+ .studio-people .rv-invite > :not(.field) { grid-column: 1 / -1; }
97
+ /* Open, the form keeps its distance from the list it adds to. */
98
+ .studio-people .rv-body > .rv-invite, .studio-people .rv-body > .rv-share { margin-top: 8px; }
99
+ .studio-people .rv-options { display: flex; flex-direction: column; gap: 8px; }
100
+ .studio-people .rv-options > .rv-disclose { align-self: flex-start; margin-inline-start: -11px; gap: 2px; padding-inline-end: 6px; }
101
+ .studio-people .btn.rv-disclose .btn-chevron { width: 16px; height: 16px; }
102
+ /* Open is said by the chevron alone: no resting fill, the fill only under the pointer and on press. */
103
+ .studio-people .btn.rv-disclose[aria-expanded="true"]:not(:active) { background: transparent; }
104
+ @media (hover: hover) and (pointer: fine) { .studio-people .btn.rv-disclose[aria-expanded="true"]:hover:not(:active) { background: var(--button-tertiary-bg_hover); } }
105
+ :root[data-motion="reduce"] .studio-people .btn.rv-disclose .btn-chevron { transition: none; }
106
+ .studio-people .rv-options-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
107
+ .studio-people .rv-form-actions { gap: 8px; }
108
+ .studio-people .rv-invite .field { scroll-margin-block: 16px; }
109
+ /* Email them the link: the box, its words and the gap between are one hit area, 44px tall on touch. */
110
+ .studio-people .rv-check-row { grid-column: 1 / -1; display: flex; align-self: flex-start; justify-self: start; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; color: var(--text-secondary); }
111
+ @media (pointer: coarse) { .studio-people .rv-check-row { min-height: 44px; } }
112
+ /* The ticked box wears the primary button's pair, so its mark shows in both themes. */
113
+ .studio-people .rv-check-row .checkbox:checked { background: var(--button-primary-bg); border-color: var(--button-primary-bg); color: var(--button-primary-fg); }
114
+ /* Before an invite goes: the question and the address as one group, then the answer. */
115
+ .studio-people .rv-check { min-width: 0; margin: 0; padding: 0; border: 0; }
116
+ .studio-people .rv-check:focus-visible { outline: none; box-shadow: none; }
117
+ .studio-people .rv-check-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
118
+ .studio-people .rv-check-question { color: var(--text-secondary); }
119
+ .studio-people .rv-check-address { color: var(--text-primary); font-weight: 600; overflow-wrap: anywhere; }
120
+ /* How people sign in, over the list: one line, and while email is off the quiet action that copies the prompt,
121
+ its text on the line's left edge. While the last sign-in email failed, a second line in the tone that asks for attention. */
122
+ .studio-people .rv-mail { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
123
+ .studio-people .rv-mail > .rv-mail-copy { margin-inline-start: -11px; }
124
+ .studio-people .rv-mail > .rv-mail-prompt { align-self: stretch; max-width: 560px; }
125
+ .studio-people .rv-mail-failing { color: var(--utility-warning-700); }
126
+ @media (max-width: 600px) {
127
+ .studio-people .rv-invite, .studio-people .rv-options-fields { grid-template-columns: minmax(0, 1fr); }
128
+ }
129
+ .studio-people .rv-optional { color: var(--text-tertiary); font-weight: 400; }
96
130
  /* A new link, as the review panel shows one: what it does, the link to copy, and Copy. */
97
- .studio-people .rv-share { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius-md); background: var(--bg-secondary); }
131
+ .studio-people .rv-share { display: flex; flex-direction: column; gap: 8px; max-width: 560px; padding: 12px; border-radius: var(--radius-md); background: var(--bg-secondary); }
98
132
  .studio-people .rv-share-row { display: flex; gap: 8px; }
99
133
  .studio-people .rv-share-row .input { flex: 1; min-width: 0; font-family: var(--sys-font-mono); font-size: 13px; }
100
134
  /* 16px on a touch screen or a phone, as kit/base.css sets every input, so iOS does not zoom into the link. */
101
135
  @media (pointer: coarse), (max-width: 767px) { .studio-people .rv-share-row .input { font-size: 16px; } }
102
136
  .studio-people .btn.rv-copy { flex: none; width: 80px; padding: 0; }
137
+ /* The list: a row is a person, parted from the next by one hairline. Wide, one line: the name over its address
138
+ on the left, the badges and the one menu on the right edge, the address cut to one line (its full text is
139
+ its title and the editor's). The menu's column is kept on a revoked row too, so every badge ends on one edge.
140
+ On a phone the badges go under the address, which wraps. */
103
141
  .studio-people .rv-people { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
104
- .studio-people .rv-people li { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--border-secondary); }
105
- .studio-people .rv-people li:last-child { border-bottom: 0; padding-bottom: 0; }
106
- .studio-people .rv-person { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
107
- .studio-people .rv-person strong { font-weight: 600; color: var(--text-primary); }
108
- .studio-people .rv-people [data-revoked] { opacity: 0.55; }
109
- /* A row's text actions: 36px, the fill only under the pointer, each reaching 44px to the touch; wrapped lines keep 8px apart. */
142
+ /* A section holds one kind, so its group has no heading; Show more sits under the rows, its text on the names' edge. */
143
+ .studio-people .rv-group { display: flex; flex-direction: column; }
144
+ .studio-people .rv-group > .rv-more { align-self: flex-start; margin-inline-start: -11px; gap: 2px; padding-inline-end: 6px; }
145
+ @media (pointer: coarse) { .studio-people .btn.rv-more { position: relative; } .studio-people .btn.rv-more::before { content: ''; position: absolute; inset: -4px 0; } }
146
+ .studio-people .rv-people li { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(26px, auto); gap: 6px 12px; align-items: start; padding: 12px 0; }
147
+ .studio-people .rv-people li + li { border-top: 1px solid var(--border-secondary); }
148
+ .studio-people .rv-who { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
149
+ .studio-people .rv-name { font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
150
+ .studio-people .rv-email { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
151
+ .studio-people .rv-people [data-revoked] .rv-who { opacity: 0.55; }
152
+ /* A revoked row has no menu: its name cuts before the badge, never wrapping under it (on a phone too, below). */
153
+ .studio-people .rv-people [data-revoked] .rv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
154
+ .studio-people .rv-tags { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: -2px; }
155
+ .studio-people .badge { font-variant-numeric: tabular-nums; }
156
+ /* A running end date is words, not a chip: the badge's line, so it sits where one would, in the quiet tone. */
157
+ .studio-people .rv-until { font-size: 12px; line-height: 24px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; white-space: nowrap; }
158
+ .studio-people .rv-tags .badge + .rv-until { margin-inline-start: 2px; }
159
+ /* The menu's 32px button centres on the name's 20px line, its glyph on the row's right edge; a finger gets 44px. */
160
+ .studio-people .btn.rv-row-menu { grid-column: 3; grid-row: 1; width: 32px; height: 32px; margin: -6px -6px -6px 0; padding: 0; color: var(--text-tertiary); }
161
+ .studio-people .rv-people .btn.rv-row-menu::before { inset: -6px; }
162
+ /* A row with one action shows it by name, its text ending on the edge the menus end on. */
163
+ .studio-people .btn.rv-row-act { grid-column: 3; grid-row: 1; margin: -6px -10px -6px 0; }
164
+ @media (max-width: 600px) {
165
+ .studio-people .rv-people li { grid-template-columns: minmax(0, 1fr) auto; }
166
+ .studio-people .rv-email { white-space: normal; overflow-wrap: anywhere; }
167
+ .studio-people .rv-tags { grid-column: 1; grid-row: 2; justify-content: flex-start; margin-top: -4px; }
168
+ .studio-people .rv-until { line-height: 18px; }
169
+ /* A revoked row keeps its badge on the name's line, in the menu's slot, ending on the menus' edge. */
170
+ .studio-people .rv-people [data-revoked] .rv-tags { grid-column: 2; grid-row: 1; margin: -2px 0; }
171
+ .studio-people .btn.rv-row-menu, .studio-people .btn.rv-row-act { grid-column: 2; }
172
+ }
110
173
  .studio-people .rv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 4px; }
111
- .studio-people .rv-acts { margin-inline: -10px; }
112
- .studio-people .rv-acts .rv-confirm { flex: 1 1 100%; padding: 0 10px; color: var(--text-secondary); }
113
- .studio-people .rv-acts .select { width: auto; min-width: 160px; }
114
- .studio-people .btn.rv-act { height: 36px; padding: 0 10px; color: var(--text-tertiary); font-weight: 500; }
174
+ /* A line that starts with a ghost button steps back by its padding and border (10px + 1px), so its text lines up. */
175
+ .studio-people .rv-inline .rv-row:has(> .rv-act:first-child), .studio-people .rv-form-actions:has(> .rv-act:first-child) { margin-inline-start: -11px; }
176
+ /* What a row opens (an editor, a question, a new link) spans the row, under the name. */
177
+ .studio-people .rv-inline { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 440px; margin: 0; padding: 0; border: 0; }
178
+ .studio-people .rv-inline .rv-confirm { margin: 0; color: var(--text-secondary); }
179
+ .studio-people .rv-inline .select { width: auto; min-width: 160px; }
180
+ .studio-people .rv-email-edit { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
181
+ .studio-people .rv-email-edit .rv-row { gap: 8px; }
182
+ /* A refusal, under the field it names, at the hint's size. */
183
+ .studio-people .rv-form-error { font-size: 13px; line-height: 18px; color: var(--text-error-primary); }
184
+ .studio-people .input[aria-invalid="true"] { border-color: var(--border-error); }
185
+ /* A focused field says so with its edge alone: the border steps up to the ring's own grey (light 3.2:1 against the
186
+ resting border and 4.7:1 against the field; dark 4.9:1 and 7.6:1), no ring. kit/ui draws the ring on every
187
+ focused field, for prototypes too, so it is quieted here for the hub's fields only. Buttons and menu items keep
188
+ the ring. Asked for more contrast, fields get it back; in forced colours the kit's transparent outline is drawn
189
+ in the system colour. */
190
+ .studio-people .input:focus-visible { box-shadow: var(--shadow-xs); border-color: var(--border-brand); }
191
+ .studio-people .input[aria-invalid="true"]:focus-visible { border-color: var(--border-error); }
192
+ @media (prefers-contrast: more) { .studio-people .input:focus-visible { box-shadow: var(--focus-ring), var(--shadow-xs); } }
193
+ /* Every button shows the ring to the keyboard, the primary too, whose own shadow would otherwise win. */
194
+ .studio-people .btn:focus-visible { box-shadow: var(--focus-ring), var(--shadow-xs); }
195
+ /* 16px on a touch screen or a phone, as kit/base.css sets every input, so iOS does not zoom into a field. */
196
+ @media (pointer: coarse), (max-width: 767px) { .studio-people .input { font-size: 16px; } }
197
+ .studio-people .btn.rv-act { height: 32px; padding: 0 10px; color: var(--text-tertiary); font-weight: 500; }
115
198
  .studio-people .btn.rv-act-danger { color: var(--text-error-primary); }
116
199
  @media (hover: hover) and (pointer: fine) {
117
200
  .studio-people .btn.rv-act:hover { color: var(--text-primary); }
118
201
  .studio-people .btn.rv-act-danger:hover { color: var(--text-error-primary_hover); }
119
202
  }
120
- .studio-people .btn::before { content: ''; position: absolute; inset: -4px 0; }
121
- .studio-people .btn:not(.rv-act)::before { inset: -2px 0; }
203
+ /* Every 32px button reaches 44px to the touch. */
204
+ .studio-people .btn::before { content: ''; position: absolute; inset: -6px 0; }
122
205
  .studio-people-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 12px; border-radius: var(--radius-md); background: var(--bg-error-primary); color: var(--text-error-primary); }
123
206
  .studio-people > .hub-empty { padding-inline: 0; }
207
+
208
+ /* The sidebar (../sidebar.css) docks beside the page; a search that leaves nothing says so in the list's place. */
209
+ .hub-none { min-height: 56px; display: flex; align-items: center; padding-inline: 12px; color: var(--text-tertiary); }
210
+ /* A jump lands the client's heading at the top with room above it; the heading takes focus but draws no ring. */
211
+ .studio-client { scroll-margin-top: 32px; }
212
+ .studio-client-name h2:focus { outline: none; box-shadow: none; }
213
+ /* On its own view the studio's people need no frame: the page's head names them. */
214
+ .studio-people.is-page { margin-inline: 0; padding: 0 12px; border: 0; border-radius: 0; }
@@ -1,6 +1,7 @@
1
1
  // What the client hub and the studio hub share: who is signed in with the
2
- // one list the page shows, loaded together, and the page around it (its
3
- // head, its body, and who is signed in at the foot).
2
+ // one list the page shows, loaded together, and the page around it (the
3
+ // sidebar docked to its left, who is signed in at its foot, the page's head
4
+ // and its body).
4
5
  import { type ReactNode, useEffect, useState } from 'react';
5
6
  import { call, type Me } from '../review/client';
6
7
 
@@ -28,30 +29,40 @@ export function useHubData<T extends object>(op: string): HubLoaded<T> {
28
29
  return loaded;
29
30
  }
30
31
 
31
- /** The page: its title and voice, its body, and who is signed in once that is known. */
32
+ /** The page: the sidebar (who is signed in sits at its foot), the page's title and voice, and its body. */
32
33
  export function HubPage({
34
+ sidebar,
33
35
  title,
34
36
  voice,
35
- me,
36
37
  children,
37
38
  }: {
39
+ sidebar: ReactNode;
38
40
  title: string;
39
41
  voice: string;
40
- me: Me | null;
41
42
  children: ReactNode;
42
43
  }) {
43
44
  return (
44
- <main className="hub">
45
- <header className="hub-head">
46
- <h1>{title}</h1>
47
- <p className="hub-voice">{voice}</p>
48
- </header>
49
- {children}
50
- {me ? (
51
- <footer className="hub-foot">
52
- Signed in as {me.name}, {me.team}
53
- </footer>
54
- ) : null}
55
- </main>
45
+ <div className="index-frame">
46
+ {sidebar}
47
+ <main className="hub">
48
+ <header className="hub-head">
49
+ <h1>{title}</h1>
50
+ <p className="hub-voice">{voice}</p>
51
+ </header>
52
+ {children}
53
+ </main>
54
+ </div>
55
+ );
56
+ }
57
+
58
+ /** Whether any of the texts holds the query, already trimmed and lowercased. */
59
+ export const hit = (q: string, ...texts: string[]) => texts.some((t) => t.toLowerCase().includes(q));
60
+
61
+ /** A search that leaves nothing, in the index's words. */
62
+ export function NoMatch({ query }: { query: string }) {
63
+ return (
64
+ <p className="hub-none" role="status">
65
+ Nothing here matches “{query.trim()}”.
66
+ </p>
56
67
  );
57
68
  }
package/shell/system.css CHANGED
@@ -239,5 +239,17 @@
239
239
  --focus-ring-error: 0 0 0 2px oklch(0.145 0 0), 0 0 0 4px oklch(0.704 0.191 22.216);
240
240
  }
241
241
 
242
+ /* Buttons on hub pages are compact, the review panel's size: 32px, and 36px
243
+ for the one primary act on a page. kit/ui's 38 and 42px suit a product
244
+ screen, but here they shouted over the content they act on. Labels drop
245
+ to 500 so a row of them stays quiet. Where a button stands alone, its hub
246
+ stylesheet grows its hit area to 44px for touch. */
247
+ .sys .btn { font-weight: 500; }
248
+ .sys .btn-md { height: 36px; padding: 0 14px; }
249
+ .sys .btn-sm { height: 32px; padding: 0 12px; }
250
+ .sys .btn.btn-icon { width: 32px; height: 32px; padding: 0; }
251
+ .sys .btn.btn-icon.btn-md { width: 36px; height: 36px; }
252
+ .sys .btn-sm:has(> .icon:first-child, > .btn-content > .icon:first-child):not(.btn-icon) { padding-left: 10px; }
253
+
242
254
  /* Code in hub pages takes the mono face. */
243
255
  .sys :is(code, kbd, pre, samp) { font-family: var(--sys-font-mono); }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: miles-deploy
3
- description: "Share the prototypes through a studio and hand out sign-in links: the studio (one site for every client), its clients, linking a project to a client, the pre-flight (pnpm preflight), pnpm share, the handover message, adding people, a second device, signing someone out, how long access lasts, and what needs the studio owner's word first. Load when the user asks to deploy, share, send a link, set up a studio, add a client, add or remove someone, give someone access on another device, change how long access lasts, or check the work before any of those. Triggers on: deploy, share, share link, send to the client, send it to the team, put it online, publish, go live, update the link, push the latest, studio, studio site, new client, add a client, archive a client, client host, subdomain, domain, DNS, project link, Vercel, sign in to Vercel, vercel login, gate, sign-in link, one-time link, new link, another device, link stopped working, sign out everywhere, access length, 3 months, 6 months, open-ended, pre-flight, preflight, ready to send, add someone, invite someone, remove someone."
3
+ description: "Share the prototypes through a studio and hand out sign-in links: the studio (one site for every client), its clients, linking a project to a client, the pre-flight (pnpm preflight), pnpm share, the handover message, adding people, a second device, signing someone out, how long access lasts, email sign-in (turning it on or off), and what needs the studio owner's word first. Load when the user asks to deploy, share, send a link, set up a studio, add a client, add or remove someone, give someone access on another device, change how long access lasts, turn email sign-in on or off, or check the work before any of those. Triggers on: deploy, share, share link, send to the client, send it to the team, put it online, publish, go live, update the link, push the latest, studio, studio site, new client, add a client, archive a client, client host, subdomain, domain, DNS, project link, Vercel, sign in to Vercel, vercel login, gate, sign-in link, one-time link, new link, another device, link stopped working, sign out everywhere, access length, 3 months, 6 months, open-ended, pre-flight, preflight, ready to send, add someone, invite someone, remove someone, email sign-in, sign in by email, sign-in code, Resend, sender address, sign-in emails are failing."
4
4
  ---
5
5
 
6
6
  # Share
@@ -15,7 +15,8 @@ A studio runs on its owner's hosting account. Ask the owner, in one plain questi
15
15
 
16
16
  - **Spending money.** Nothing here should cost anything. If a command stops on a plan, a payment or a limit, stop and tell the owner what it said.
17
17
  - **Creating or deleting anything on the account:** `studio create`, `studio deploy` (it replaces the site and deletes every older deployment), `client add` (it puts a new address on the site), `client archive` (it deletes the client's people, projects, comments and files for good).
18
- - **DNS:** a record `client add` adds or prints, or one `client archive` removes.
18
+ - **DNS:** a record `client add` adds or prints, or one `client archive` removes, and the mail domain's records `studio email` adds or prints.
19
+ - **Turning email sign-in on or off** (`studio email`): it sets or removes two secrets on the site and deploys it.
19
20
  - **Skipping a pre-flight step** with `--skip`.
20
21
 
21
22
  `project link`, `share`, `people` and `comments` act only inside the studio's own store, for the linked project and its client, and `people --studio` for the studio's own people. Run them when the user asks.
@@ -135,7 +136,7 @@ pnpm people --studio <studio> # the studio's people, wit
135
136
  pnpm people link <id> --studio <studio> # a new link for one of them, the owner too
136
137
  ```
137
138
 
138
- `owner` in the studio folder's `studio.json` is the owner's id. A Studio person's link is on `studio.<apex>` once it answers; before then `--studio` refuses `add`, `link` and `sign-out`, changes nothing and says why (`studio_host_waiting`). In a linked project, `--kind studio`, or `add --studio` for the project's own studio, prints a `notice` that they see every client. On `studio.<apex>`, **People** under **Studio people** adds Studio people and gives another Studio person a new link; a person's own row there has no actions, so a user's own new link comes from `pnpm people link <their id> --studio <studio>` or from someone else in the studio. Use the command when the owner lost their link or wants a second device.
139
+ `owner` in the studio folder's `studio.json` is the owner's id. A Studio person's link is on `studio.<apex>` once it answers; before then `--studio` refuses `add`, `link` and `sign-out`, changes nothing and says why (`studio_host_waiting`). In a linked project, `--kind studio`, or `add --studio` for the project's own studio, prints a `notice` that they see every client. On `studio.<apex>`, **Studio people** in the sidebar adds Studio people and gives another Studio person a new link; a person's own row there has no actions, so a user's own new link comes from `pnpm people link <their id> --studio <studio>` or from someone else in the studio. Use the command when the owner lost their link or wants a second device.
139
140
 
140
141
  - **A link signs in one device, then stops working.** Opening it shows who it is for and a Continue button; Continue uses it up. Why: a mail or chat preview opens links too, and must not use one up. An unused link lasts 14 days.
141
142
  - **Another device, or a link that stopped working:** `pnpm people link <id>` gives one more link. Their other devices stay signed in.
@@ -151,6 +152,26 @@ A signed-in device stays signed in until the person's access ends: 3 months, 6 m
151
152
  - One person: `pnpm people access <id> --access 3m|6m|open`, counted from today, or `--access` on `pnpm people add`.
152
153
  - When someone's access ends, their links stop working at once and every device signs out within five minutes. A changed length reaches their signed-in devices within five minutes too. Change their access to let them back in, then send a new link.
153
154
 
155
+ ## Email sign-in
156
+
157
+ Off until the owner turns it on; links work either way. With it on, a person with an email (`pnpm people add --email`, or `pnpm people email <id> --email <address>`) signs in alone with a code mailed to them, and `people add` mails a new person their link. The People tab's prompt to copy sends the owner here.
158
+
159
+ First, the studio folder must be on 0.14.0 or newer: `studio email` refuses an older one and changes nothing. Move it up as in New studio (`pnpm add @milesroxas/design-hub@<version>` in the folder, or `pnpm studio deploy --studio <studio> --package <tgz>`), with the owner's word, then turn email on.
160
+
161
+ Ask the owner for: who mail is from, a name and an address at the apex or below it (default `signin@mail.<apex>`); a file holding a full-access API key of their Resend account (the free plan is enough; it may be one another of their sites sends from); and an address for the test mail. The key comes from resend.com, **API Keys**, **Create API key**, **Full access**, pasted into a plain text file. Never take the key itself in chat. The first run copies it into the folder's `.env` as `RESEND_FULL_KEY`, so the owner may delete the file after it. Then, with their word, in the studio folder or with `--studio`:
162
+
163
+ ```bash
164
+ pnpm studio email --studio <studio> --from "<Name> <signin@mail.<apex>>" \
165
+ --resend-key-file <file> --test <address>
166
+ ```
167
+
168
+ In order, each step safe to run again: the full key into the folder's `.env` (`RESEND_FULL_KEY`; later runs may drop `--resend-key-file`); the sender's domain at Resend, used as it is when it or a parent is verified, with no DNS change; else the domain made, its records added (Cloudflare) or printed (`records`: Vercel DNS and manual, for the owner to add), and verified; a new send-only key; a test mail; and only then `RESEND_API_KEY` and `MAIL_FROM` on the site and in the folder's `.env`, a deploy, and the earlier send-only key removed. `ok: false` says what to do: add the records it lists, or wait for Resend to verify, then run it again. On Vercel DNS and manual, the first run lists the records and stops at once; the run after they are added waits for Resend, up to two minutes. Nothing is on the site until the test mail is sent. The sender's domain is never a host the studio serves.
169
+
170
+ - **Off:** with the owner's word, `pnpm studio email --studio <studio> --off`. It takes the two secrets off and deploys; the full key stays in `.env`, so turning it on again needs only `--from` and `--test`.
171
+ - **"Sign-in emails are failing"** on the People tab: the last mail was refused, often the Resend free plan's 100 a day or 3,000 a month, shared by the whole account. Links still work; send them meanwhile. It clears on the next mail sent.
172
+ - A code form needs Safari 14 or newer. The gate pages run no script, so a press shows no busy state.
173
+ - An optional Vercel Firewall rate-limit rule on `/_gate/` paths stops a flood before the store spends a write on it. The gate's own cap works on every plan; the rule is free on Hobby and billed by usage on Pro, so add it only when the owner asks.
174
+
154
175
  ## Internal and client-facing
155
176
 
156
177
  Every prototype is **Internal** until a Studio person marks it **Client-facing** with the switch beside it on the project's **Prototypes** page. Only then can a Client open it or see it listed. To check, open the project signed in as Studio and turn on **Client view**. A switch flipped under `pnpm dev` changes the dev store only; the studio has its own.
@@ -185,4 +206,4 @@ Only for a project made before studios. It has `proxy.ts`, `api/review.ts` and `
185
206
  - The studio site sends `noindex`, `X-Frame-Options: DENY`, `nosniff`, HSTS and a same-origin referrer on every path. The gate pages add a hash CSP, run no script and send no referrer.
186
207
  - A link is 32 random bytes, and the store keeps only its hash. Of two requests with the same link, only one signs in.
187
208
  - The session cookie carries when the store last said yes. After five minutes the gate asks the store again on the next request, so a revoke, a sign out everywhere or a changed access length reaches every device within five minutes. A store that does not answer gives 503 and signs nobody out.
188
- - The studio folder's `.env` holds the studio's secrets: the gate's signing secret, the database and the file store. Never send it, never commit it, never copy it into a project.
209
+ - The studio folder's `.env` holds the studio's secrets: the gate's signing secret, the database, the file store and, with email on, the Resend keys. The site holds only a key that can send, from the sender's domain. Never send it, never commit it, never copy it into a project.
@@ -13,6 +13,7 @@ One feature is one slug used in two places: `docs/sprints/<slug>/` and the `feat
13
13
  2. **Which kind?** Walk this; the first match wins.
14
14
  - The feature's main prototype, the one its walkthrough opens → `--sprint`. One per feature; `pnpm new` refuses a second.
15
15
  - Another full take on the same flow, to compare against the primary → `--alternate`. Refused until the primary exists.
16
+ - A small app that makes assets for several features (chart skeletons, an icon set) → `--tool`. No feature; it starts In progress and lists under Tools.
16
17
  - A side question about one part (a menu's motion, a loading state) → exploration, the default.
17
18
  3. **Which track?** Read `.design-hub/project.json` (or `pnpm tracks`). A project with one track uses it. A project with several needs `--track product|website|brand`: product is app screens, website is CMS pages, brand is collateral (social posts, slides, print). `pnpm new` refuses a track the project does not have, because the track decides the shell, the sample to read, and how `miles-port` hands it off.
18
19
  4. **Where does it stand?** `--app` when the question is about the feature in context: the track's shell, `AppShell` for product and `SiteShell` for website, as `DESIGN.md`, Shell, describes. Nothing when it is one thing alone in the Space. Brand is always a `Board` of artboards, whatever the flags; `miles-brand` takes over from step 6.
@@ -38,4 +39,4 @@ One feature is one slug used in two places: `docs/sprints/<slug>/` and the `feat
38
39
 
39
40
  ## When done means decided
40
41
 
41
- When the user picks: the Decision section gets what was chosen, its values, what was rejected and why; then the folder is deleted, or `status: archived` when the user wants it kept. A rule the decision made lands in `DESIGN.md` as a named rule the same day.
42
+ When the user picks: the Decision section gets what was chosen, its values, what was rejected and why; then the folder is deleted, or `status: archived` when the user wants it kept. A take the client saw and did not pick gets `status: presented` and `presented: <date>`: it stays in its feature's group, so the studio can show what they weighed. A rule the decision made lands in `DESIGN.md` as a named rule the same day.
@@ -56,7 +56,7 @@ Anything a control would do that the prototype does not build says so: `notInPro
56
56
 
57
57
  ## Who sees it
58
58
 
59
- A new prototype is **Internal**: only Studio can open it, until a Studio person marks it **Client-facing** with the switch beside it on the hub's index (no command reads or sets it). Never tell the user a new prototype is ready for the client before that. Everything in `prototypes/<slug>/` (code, README, styles, fixtures, images) ships only to people who may see that prototype: the deployed site refuses its page and files to a Client while it is internal. Why: an internal prototype stays inside the studio only because nothing of it leaves its folder.
59
+ A new prototype is **Internal**: only Studio can open it, until a Studio person marks it **Client-facing** with the switch beside it in its milestone's home on the hub's index, or on its row there when it has no feature (no command reads or sets it). Never tell the user a new prototype is ready for the client before that. Everything in `prototypes/<slug>/` (code, README, styles, fixtures, images) ships only to people who may see that prototype: the deployed site refuses its page and files to a Client while it is internal. Why: an internal prototype stays inside the studio only because nothing of it leaves its folder.
60
60
 
61
61
  - Never reach into another prototype's folder: an import, a CSS `@import` or `url()`, a `new URL(…, import.meta.url)`. The build refuses each, naming both files: copy the file in, or promote it to `kit/`. A link to another prototype's page is fine; reading its files is not. And nothing in `kit/` may point into a prototype's folder: the build refuses that too.
62
62
  - No web worker in a prototype (`new Worker`, `?worker`, `?worker&inline`): Vite builds it outside the prototype's folder, so the build refuses it. Run the work on the main thread, or build the worker from `kit/` files that use no prototype's.
@@ -3,7 +3,7 @@ title: {{title}}
3
3
  summary: One line on what this explores.
4
4
  context: app
5
5
  track: {{track}}
6
- status: exploring
6
+ status: {{status}}
7
7
  kind: {{kind}}
8
8
  feature: {{feature}}
9
9
  created: {{created}}
@@ -3,7 +3,7 @@ title: {{title}}
3
3
  summary: One line on what this piece is for.
4
4
  context: board
5
5
  track: {{track}}
6
- status: exploring
6
+ status: {{status}}
7
7
  kind: {{kind}}
8
8
  feature: {{feature}}
9
9
  created: {{created}}
@@ -3,7 +3,7 @@ title: {{title}}
3
3
  summary: One line on what this explores.
4
4
  context: app
5
5
  track: {{track}}
6
- status: exploring
6
+ status: {{status}}
7
7
  kind: {{kind}}
8
8
  feature: {{feature}}
9
9
  created: {{created}}
@@ -3,7 +3,7 @@ title: {{title}}
3
3
  summary: One line on what this explores.
4
4
  context: space
5
5
  track: {{track}}
6
- status: exploring
6
+ status: {{status}}
7
7
  kind: {{kind}}
8
8
  feature: {{feature}}
9
9
  created: {{created}}
@@ -10,3 +10,9 @@ POSTGRES_URL=
10
10
  BLOB_READ_WRITE_TOKEN=
11
11
  # Only with Cloudflare DNS: a token with DNS edit on the apex's zone.
12
12
  CLOUDFLARE_API_TOKEN=
13
+ # Only with email sign-in (`design-hub studio email`). The full-access Resend key, kept here for later runs; never on the site.
14
+ RESEND_FULL_KEY=
15
+ # The send-only key the site holds, limited to the sender's domain, made by `studio email`.
16
+ RESEND_API_KEY=
17
+ # Who sign-in mail is from, "<Name> <address>", the same as on the site.
18
+ MAIL_FROM=
@@ -9,7 +9,7 @@
9
9
  "build": "node build.mjs"
10
10
  },
11
11
  "dependencies": {
12
- "@milesroxas/design-hub": "0.13.0",
12
+ "@milesroxas/design-hub": "0.15.0",
13
13
  "react": "^19.3.1",
14
14
  "react-dom": "^19.3.1"
15
15
  }