@blueshed/joined 0.1.20 → 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 (71) hide show
  1. package/.claude/skills/joined/SKILL.md +1 -1
  2. package/.claude/skills/joined/reference.md +96 -17
  3. package/docs/design.md +31 -8
  4. package/examples/cafe/kitchen.ts +2 -2
  5. package/examples/desk/card.ts +43 -0
  6. package/examples/desk/desk.css +17 -0
  7. package/examples/desk/desk.json +41 -0
  8. package/examples/desk/generated/elements.ts +69 -0
  9. package/examples/desk/generated/queries.ts +33 -0
  10. package/examples/desk/generated/rules.ts +94 -0
  11. package/examples/desk/index.html +34 -0
  12. package/examples/desk/lanes.css +126 -0
  13. package/examples/desk/lanes.ts +133 -0
  14. package/examples/desk/migrations/001-desk.ts +8 -0
  15. package/examples/desk/page.ts +29 -0
  16. package/examples/desk/pulse.ts +20 -0
  17. package/examples/desk/routes.ts +9 -0
  18. package/examples/desk/steps.ts +32 -0
  19. package/examples/desk/stories.jsonl +18 -0
  20. package/examples/desk/tally.css +62 -0
  21. package/examples/desk/tally.ts +76 -0
  22. package/examples/desk/thumbs.ts +45 -0
  23. package/examples/desk/trust.ts +24 -0
  24. package/examples/desk/words.ts +17 -0
  25. package/examples/trip/bar.ts +1 -1
  26. package/examples/trip/calendar-map.css +2 -0
  27. package/examples/trip/drags.ts +3 -3
  28. package/examples/trip/drawer.ts +5 -5
  29. package/examples/trip/event-form.ts +8 -7
  30. package/examples/trip/holding.ts +1 -1
  31. package/examples/trip/ics.ts +22 -112
  32. package/examples/trip/line-stops.ts +1 -1
  33. package/examples/trip/line-words.ts +1 -1
  34. package/examples/trip/line.ts +1 -1
  35. package/examples/trip/map.ts +1 -1
  36. package/examples/trip/month.ts +1 -1
  37. package/examples/trip/other-weeks.ts +1 -1
  38. package/examples/trip/page.ts +2 -2
  39. package/examples/trip/peek.ts +1 -1
  40. package/examples/trip/routes.ts +3 -3
  41. package/examples/trip/shell.ts +3 -3
  42. package/examples/trip/stays.ts +1 -1
  43. package/examples/trip/week.ts +1 -1
  44. package/examples/trip/writes.ts +1 -1
  45. package/examples/trips/card.ts +1 -1
  46. package/examples/trips/map.ts +1 -1
  47. package/examples/weeks/derive.ts +1 -1
  48. package/package.json +7 -1
  49. package/src/attachment.ts +7 -2
  50. package/src/demo.css +29 -26
  51. package/src/demo.ts +2 -2
  52. package/src/draft.ts +23 -8
  53. package/src/files.ts +24 -8
  54. package/{examples/trip/mercator.ts → src/geo.ts} +13 -3
  55. package/src/icon-names.ts +4 -0
  56. package/src/ics.ts +130 -0
  57. package/src/members/panel.css +208 -201
  58. package/src/members/panel.ts +17 -8
  59. package/src/outbox.ts +70 -0
  60. package/src/page.css +76 -70
  61. package/src/page.ts +79 -14
  62. package/src/parts.css +575 -428
  63. package/src/parts.ts +18 -5
  64. package/{examples/trip → src}/place-search.ts +5 -5
  65. package/{examples/trip → src}/places.ts +9 -7
  66. package/src/rank.ts +20 -0
  67. package/src/scrim.ts +81 -0
  68. package/src/server.ts +28 -1
  69. package/{examples/trip → src}/time.ts +37 -5
  70. package/src/tokens.css +5 -0
  71. package/src/tokens.json +35 -0
package/src/parts.css CHANGED
@@ -1,7 +1,8 @@
1
1
  /* joined's parts, once: fewer's tool, field, label, drawer, modal and sheet (docs/design.md, "The parts").
2
2
  Adopted by the page and by every display's shadow (src/parts.ts), so a part looks the same wherever
3
3
  it's drawn; never linked, and never a part's look written beside it (its own sheet says only how it
4
- sits, or what it alone has). Its colours are src/tokens.css's.
4
+ sits, or what it alone has). A layer, joined, beneath any rule of an app's, which wins whatever its
5
+ specificity. Its colours and its motion are src/tokens.css's.
5
6
 
6
7
  .act a button with words, its icon before them: 13px, 32px tall (44px under a finger)
7
8
  .ink the one that makes or keeps (Add, Save)
@@ -18,454 +19,600 @@
18
19
  (or a phone zooms in); a textarea the same, taller. A field drawn otherwise (a name changed
19
20
  in place) says so in its own sheet: these weigh nothing, so any rule there wins.
20
21
  a label over its field: 13px, 600, in plain case
21
- .drawer where a thing is changed: docked at the right, 320px; on a phone a sheet from the foot.
22
- Its head the thing's name (h2, 17px) and its ×; its deeds at its foot, removing first.
22
+ .drawer where a thing is changed: docked at the right, 320px, sliding in from it; on a phone a
23
+ sheet risen from the foot. Its head the thing's name (h2, 17px) and its ×; its deeds at its
24
+ foot, removing first.
23
25
  dialog a modal, new or delete: its title (h2, 17px) and its × if it has one, a line saying what
24
- follows, its deeds. A drawer rises in 200ms, a modal in 160ms; under reduced motion, neither
26
+ follows, its deeds. It settles in from a little larger.
25
27
  .sheet a popover that holds a list (the group, People): its head a title and its ×; on a phone,
26
- a sheet from the foot */
28
+ a sheet risen from the foot.
29
+ On a phone a drawer and a sheet are a phone's sheet: rounded at the top, a grabber, the page dimmed
30
+ behind by its one scrim (src/scrim.ts), which a modal dims by anywhere. Under reduced motion,
31
+ nothing moves.
32
+ .j-foot a foot fixed at the screen's foot, run on past it, so nothing shows under it in Safari */
27
33
 
28
- .act {
29
- box-sizing: border-box;
30
- min-height: 32px;
31
- display: inline-flex;
32
- align-items: center;
33
- justify-content: center;
34
- gap: 6px;
35
- padding: 0 12px;
36
- border: 1px solid var(--ink);
37
- border-radius: 4px;
38
- background: var(--card);
39
- color: var(--ink);
40
- font: var(--font-tool);
41
- white-space: nowrap;
42
- cursor: pointer;
43
- }
44
- .act.ink {
45
- border-color: var(--add);
46
- background: var(--add);
47
- color: var(--add-ink);
48
- }
49
- .act.ink:hover {
50
- background: var(--add-hover);
51
- }
52
- .act.danger {
53
- border-color: var(--danger);
54
- color: var(--danger);
55
- }
56
- dialog .act.danger {
57
- background: var(--danger);
58
- color: var(--danger-ink);
59
- }
60
- /* what is open (a popover, a sheet), or chosen of a pair (a view), fills with accent, its words in card, while it is */
61
- .act:is([aria-expanded="true"], [aria-pressed="true"]) {
62
- border-color: var(--accent);
63
- background: var(--accent);
64
- color: var(--card);
65
- }
66
- .act.quiet {
67
- border-color: transparent;
68
- background: none;
69
- padding: 0 4px;
70
- color: var(--muted);
71
- }
72
- .icon-only {
73
- box-sizing: border-box;
74
- width: 32px;
75
- height: 32px;
76
- display: inline-flex;
77
- align-items: center;
78
- justify-content: center;
79
- flex: none;
80
- padding: 0;
81
- border: 0;
82
- border-radius: 4px;
83
- background: none;
84
- color: var(--muted);
85
- cursor: pointer;
86
- }
87
- .icon-only:hover,
88
- .icon-only:focus-visible {
89
- color: var(--ink);
90
- background: color-mix(in srgb, var(--ink) 6%, transparent);
91
- }
92
- /* a tool that is its icon alone, filled (the group's Invite) */
93
- .act.icon-only {
94
- min-height: 0;
95
- padding: 0;
96
- }
97
- .act.ink.icon-only {
98
- color: var(--add-ink);
99
- }
100
- /* chosen, it stays filled under the pointer and the keys (the group's invite, read-only) */
101
- .act.icon-only[aria-pressed="true"] {
102
- background: var(--accent);
103
- color: var(--card);
104
- }
105
- :is(.act, .icon-only) > svg.icon {
106
- margin: 0;
107
- }
108
- :is(.act, .icon-only):disabled {
109
- opacity: 0.45;
110
- cursor: default;
111
- }
112
- /* a lesser tool among words, its words small: a way to what links here, to another week */
113
- .act.small {
114
- min-height: 24px;
115
- padding: 0 8px;
116
- border-color: var(--control-edge);
117
- font: var(--font-small);
118
- }
119
- .act.small:hover {
120
- background: var(--card-hover);
121
- }
34
+ /* the layers, named in their order wherever joined's sheets are: an app's resets (button { font: inherit }) in
35
+ reset, beneath joined's parts; anything else of an app's, in no layer, over both */
36
+ @layer reset, joined;
122
37
 
123
- /* .j-tabs: one of a few, side by side in a well, the chosen raised on card (the group's People and Agents) */
124
- .j-tabs {
125
- display: flex;
126
- gap: 4px;
127
- padding: 2px;
128
- border: 1px solid var(--edge);
129
- border-radius: 4px;
130
- background: var(--paper);
131
- }
132
- .j-tabs > button {
133
- flex: 1;
134
- display: inline-flex;
135
- align-items: center;
136
- justify-content: center;
137
- min-height: 28px;
138
- border: 0;
139
- border-radius: 3px;
140
- background: none;
141
- color: var(--muted);
142
- font: var(--font-small);
143
- cursor: pointer;
144
- }
145
- .j-tabs > [aria-selected="true"] {
146
- background: var(--card);
147
- color: var(--ink);
148
- font-weight: 600;
149
- box-shadow: 0 0 0 1px var(--edge);
150
- }
151
-
152
- /* .j-choices: a list to pick one from, each a row's words, tinted under the pointer (places found, a row's
153
- menu); the one that takes away last, apart, in red */
154
- .j-choices {
155
- display: grid;
156
- }
157
- /* a list in a popover (a row's menu) shows only while it's open */
158
- .j-choices[popover]:not(:popover-open) {
159
- display: none;
160
- }
161
- .j-choices > button {
162
- box-sizing: border-box;
163
- min-height: 32px;
164
- display: flex;
165
- align-items: center;
166
- gap: 6px;
167
- padding: 4px 8px;
168
- border: 0;
169
- border-radius: 3px;
170
- background: none;
171
- color: var(--ink);
172
- font: var(--font-row);
173
- text-align: left;
174
- cursor: pointer;
175
- }
176
- .j-choices > button:is(:hover, :focus-visible) {
177
- background: color-mix(in srgb, var(--ink) 6%, transparent);
178
- }
179
- .j-choices > button.danger {
180
- margin-top: 4px;
181
- border-top: 1px solid var(--line);
182
- border-radius: 0 0 3px 3px;
183
- color: var(--danger);
184
- }
38
+ @layer joined {
39
+ .act {
40
+ box-sizing: border-box;
41
+ min-height: 32px;
42
+ display: inline-flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ gap: 6px;
46
+ padding: 0 12px;
47
+ border: 1px solid var(--ink);
48
+ border-radius: 4px;
49
+ background: var(--card);
50
+ color: var(--ink);
51
+ font: var(--font-tool);
52
+ white-space: nowrap;
53
+ cursor: pointer;
54
+ }
55
+ .act.ink {
56
+ border-color: var(--add);
57
+ background: var(--add);
58
+ color: var(--add-ink);
59
+ }
60
+ .act.ink:hover {
61
+ background: var(--add-hover);
62
+ }
63
+ .act.danger {
64
+ border-color: var(--danger);
65
+ color: var(--danger);
66
+ }
67
+ dialog .act.danger {
68
+ background: var(--danger);
69
+ color: var(--danger-ink);
70
+ }
71
+ /* what is open (a popover, a sheet), or chosen of a pair (a view), fills with accent, its words in card, while it is */
72
+ .act:is([aria-expanded="true"], [aria-pressed="true"]) {
73
+ border-color: var(--accent);
74
+ background: var(--accent);
75
+ color: var(--card);
76
+ }
77
+ .act.quiet {
78
+ border-color: transparent;
79
+ background: none;
80
+ padding: 0 4px;
81
+ color: var(--muted);
82
+ }
83
+ .icon-only {
84
+ box-sizing: border-box;
85
+ width: 32px;
86
+ height: 32px;
87
+ display: inline-flex;
88
+ align-items: center;
89
+ justify-content: center;
90
+ flex: none;
91
+ padding: 0;
92
+ border: 0;
93
+ border-radius: 4px;
94
+ background: none;
95
+ color: var(--muted);
96
+ cursor: pointer;
97
+ }
98
+ .icon-only:hover,
99
+ .icon-only:focus-visible {
100
+ color: var(--ink);
101
+ background: color-mix(in srgb, var(--ink) 6%, transparent);
102
+ }
103
+ /* a tool that is its icon alone, filled (the group's Invite) */
104
+ .act.icon-only {
105
+ min-height: 0;
106
+ padding: 0;
107
+ }
108
+ .act.ink.icon-only {
109
+ color: var(--add-ink);
110
+ }
111
+ /* chosen, it stays filled under the pointer and the keys (the group's invite, read-only) */
112
+ .act.icon-only[aria-pressed="true"] {
113
+ background: var(--accent);
114
+ color: var(--card);
115
+ }
116
+ :is(.act, .icon-only) > svg.icon {
117
+ margin: 0;
118
+ }
119
+ :is(.act, .icon-only):disabled {
120
+ opacity: 0.45;
121
+ cursor: default;
122
+ }
123
+ /* a lesser tool among words, its words small: a way to what links here, to another week */
124
+ .act.small {
125
+ min-height: 24px;
126
+ padding: 0 8px;
127
+ border-color: var(--control-edge);
128
+ font: var(--font-small);
129
+ }
130
+ .act.small:hover {
131
+ background: var(--card-hover);
132
+ }
185
133
 
186
- /* a person (Identity): their face, their initial on a tint of their hue in a ring of it; with no initial, their
187
- dot (on an event's block). A chip is a face and a name: on (the event's, the line's reader) a tint of the hue
188
- over card and a 3px stripe of it, words in ink; off, a plain control. Never solid with white words. */
189
- .j-face {
190
- box-sizing: border-box;
191
- flex: none;
192
- display: inline-grid;
193
- place-items: center;
194
- width: 22px;
195
- height: 22px;
196
- border: 2px solid var(--hue);
197
- border-radius: 50%;
198
- background: color-mix(in srgb, var(--hue) var(--tint-strong), var(--card));
199
- color: var(--ink);
200
- font: var(--font-tiny);
201
- font-weight: 600;
202
- font-style: normal;
203
- }
204
- .j-face::before {
205
- content: attr(data-initial);
206
- }
207
- .j-face:not([data-initial]) {
208
- width: 7px;
209
- height: 7px;
210
- border: 0;
211
- background: var(--hue);
212
- }
213
- .j-chips {
214
- display: flex;
215
- flex-wrap: wrap;
216
- align-items: center;
217
- gap: 6px;
218
- }
219
- :is(.j-chip, .j-chips > button) {
220
- box-sizing: border-box;
221
- display: inline-flex;
222
- align-items: center;
223
- gap: 6px;
224
- min-height: 32px;
225
- padding: 0 10px 0 4px;
226
- border: 1px solid var(--control-edge);
227
- border-radius: 4px;
228
- background: var(--card);
229
- color: var(--muted);
230
- font: var(--font-tool);
231
- }
232
- .j-chips > button {
233
- cursor: pointer;
234
- }
235
- /* one that can be taken off: its × at its end */
236
- .j-chip > .icon-only {
237
- width: 24px;
238
- height: 24px;
239
- margin-right: -6px;
240
- }
241
- :is(.j-chip, .j-chips > button[aria-pressed="true"]) {
242
- border-color: transparent;
243
- border-left: 3px solid var(--hue);
244
- background: color-mix(in srgb, var(--hue) var(--tint), var(--card));
245
- color: var(--ink);
246
- }
247
- .j-chips > button[aria-pressed="true"]:hover {
248
- background: color-mix(in srgb, var(--hue) var(--tint-strong), var(--card));
249
- }
134
+ /* .j-tabs: one of a few, side by side in a well, the chosen raised on card (the group's People and Agents) */
135
+ .j-tabs {
136
+ display: flex;
137
+ gap: 4px;
138
+ padding: 2px;
139
+ border: 1px solid var(--edge);
140
+ border-radius: 4px;
141
+ background: var(--paper);
142
+ }
143
+ .j-tabs > button {
144
+ flex: 1;
145
+ display: inline-flex;
146
+ align-items: center;
147
+ justify-content: center;
148
+ min-height: 28px;
149
+ border: 0;
150
+ border-radius: 3px;
151
+ background: none;
152
+ color: var(--muted);
153
+ font: var(--font-small);
154
+ cursor: pointer;
155
+ }
156
+ .j-tabs > [aria-selected="true"] {
157
+ background: var(--card);
158
+ color: var(--ink);
159
+ font-weight: 600;
160
+ box-shadow: 0 0 0 1px var(--edge);
161
+ }
250
162
 
251
- :where(input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"]), select, textarea) {
252
- box-sizing: border-box;
253
- min-height: 32px;
254
- min-width: 0;
255
- padding: 0 10px;
256
- border: 1px solid var(--control-edge);
257
- border-radius: 4px;
258
- background: var(--card);
259
- color: var(--ink);
260
- font: var(--font-field);
261
- }
262
- :where(textarea) {
263
- min-height: 4.5rem;
264
- padding: 8px 10px;
265
- resize: vertical;
266
- }
267
- :where(form, dialog) label {
268
- display: grid;
269
- gap: 4px;
270
- font: var(--font-label);
271
- }
163
+ /* .j-choices: a list to pick one from, each a row's words, tinted under the pointer (places found, a row's
164
+ menu); the one that takes away last, apart, in red */
165
+ .j-choices {
166
+ display: grid;
167
+ }
168
+ /* a list in a popover (a row's menu) shows only while it's open */
169
+ .j-choices[popover]:not(:popover-open) {
170
+ display: none;
171
+ }
172
+ .j-choices > button {
173
+ box-sizing: border-box;
174
+ min-height: 32px;
175
+ display: flex;
176
+ align-items: center;
177
+ gap: 6px;
178
+ padding: 4px 8px;
179
+ border: 0;
180
+ border-radius: 3px;
181
+ background: none;
182
+ color: var(--ink);
183
+ font: var(--font-row);
184
+ text-align: left;
185
+ cursor: pointer;
186
+ }
187
+ .j-choices > button:is(:hover, :focus-visible) {
188
+ background: color-mix(in srgb, var(--ink) 6%, transparent);
189
+ }
190
+ .j-choices > button.danger {
191
+ margin-top: 4px;
192
+ border-top: 1px solid var(--line);
193
+ border-radius: 0 0 3px 3px;
194
+ color: var(--danger);
195
+ }
272
196
 
273
- /* a request's refusal, said beside what sent it (Said): its why in danger; nothing while there's none */
274
- .said {
275
- margin: 0;
276
- font: var(--font-small);
277
- color: var(--danger);
278
- }
279
- .said:empty {
280
- display: none;
281
- }
197
+ /* a person (Identity): their face, their initial on a tint of their hue in a ring of it; with no initial, their
198
+ dot (on an event's block). A chip is a face and a name: on (the event's, the line's reader) a tint of the hue
199
+ over card and a 3px stripe of it, words in ink; off, a plain control. Never solid with white words. */
200
+ .j-face {
201
+ box-sizing: border-box;
202
+ flex: none;
203
+ display: inline-grid;
204
+ place-items: center;
205
+ width: 22px;
206
+ height: 22px;
207
+ border: 2px solid var(--hue);
208
+ border-radius: 50%;
209
+ background: color-mix(in srgb, var(--hue) var(--tint-strong), var(--card));
210
+ color: var(--ink);
211
+ font: var(--font-tiny);
212
+ font-weight: 600;
213
+ font-style: normal;
214
+ }
215
+ .j-face::before {
216
+ content: attr(data-initial);
217
+ }
218
+ .j-face:not([data-initial]) {
219
+ width: 7px;
220
+ height: 7px;
221
+ border: 0;
222
+ background: var(--hue);
223
+ }
224
+ .j-chips {
225
+ display: flex;
226
+ flex-wrap: wrap;
227
+ align-items: center;
228
+ gap: 6px;
229
+ }
230
+ :is(.j-chip, .j-chips > button) {
231
+ box-sizing: border-box;
232
+ display: inline-flex;
233
+ align-items: center;
234
+ gap: 6px;
235
+ min-height: 32px;
236
+ padding: 0 10px 0 4px;
237
+ border: 1px solid var(--control-edge);
238
+ border-radius: 4px;
239
+ background: var(--card);
240
+ color: var(--muted);
241
+ font: var(--font-tool);
242
+ }
243
+ .j-chips > button {
244
+ cursor: pointer;
245
+ }
246
+ /* one that can be taken off: its × at its end */
247
+ .j-chip > .icon-only {
248
+ width: 24px;
249
+ height: 24px;
250
+ margin-right: -6px;
251
+ }
252
+ :is(.j-chip, .j-chips > button[aria-pressed="true"]) {
253
+ border-color: transparent;
254
+ border-left: 3px solid var(--hue);
255
+ background: color-mix(in srgb, var(--hue) var(--tint), var(--card));
256
+ color: var(--ink);
257
+ }
258
+ .j-chips > button[aria-pressed="true"]:hover {
259
+ background: color-mix(in srgb, var(--hue) var(--tint-strong), var(--card));
260
+ }
282
261
 
283
- /* .j-file: a file field (Attachment, src/attachment.ts): its picture, the width of what holds it, or a link to its
284
- PDF; then a small tool to choose one, its file input inside it, and the × that takes it off */
285
- .j-file {
286
- display: flex;
287
- flex-wrap: wrap;
288
- align-items: center;
289
- gap: 8px;
290
- }
291
- .j-file > [hidden] {
292
- display: none;
293
- }
294
- .j-file > a.act {
295
- text-decoration: none;
296
- }
297
- .j-file-picture {
298
- flex: 1 0 100%;
299
- display: block;
300
- }
301
- .j-file-picture > img {
302
- display: block;
303
- box-sizing: border-box;
304
- width: 100%;
305
- max-height: 240px;
306
- object-fit: cover;
307
- border: 1px solid var(--edge);
308
- border-radius: 4px;
309
- }
310
- .j-file label {
311
- position: relative;
312
- }
313
- .j-file label:focus-within {
314
- outline: 2px solid var(--accent);
315
- }
316
- .j-file input[type="file"] {
317
- position: absolute;
318
- width: 1px;
319
- height: 1px;
320
- opacity: 0;
321
- }
262
+ :where(input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"]), select, textarea) {
263
+ box-sizing: border-box;
264
+ min-height: 32px;
265
+ min-width: 0;
266
+ padding: 0 10px;
267
+ border: 1px solid var(--control-edge);
268
+ border-radius: 4px;
269
+ background: var(--card);
270
+ color: var(--ink);
271
+ font: var(--font-field);
272
+ }
273
+ :where(textarea) {
274
+ min-height: 4.5rem;
275
+ padding: 8px 10px;
276
+ resize: vertical;
277
+ }
278
+ :where(form, dialog) label {
279
+ display: grid;
280
+ gap: 4px;
281
+ font: var(--font-label);
282
+ }
322
283
 
323
- /* the surfaces: the drawer, the modal and the sheet, each a card in a 1px edge, 4px corners, no shadow */
324
- :where(.drawer, dialog, .sheet) {
325
- box-sizing: border-box;
326
- border: 1px solid var(--edge);
327
- border-radius: 4px;
328
- background: var(--card);
329
- color: var(--ink);
330
- font: var(--font-row);
331
- }
332
- :where(.drawer, .sheet, dialog) h2 {
333
- flex: 1;
334
- margin: 0;
335
- font: var(--font-title);
336
- }
337
- :where(.drawer, .sheet, dialog) header {
338
- display: flex;
339
- align-items: center;
340
- gap: 8px;
341
- }
342
- /* its head and its foot always show, what it is and what you may do: only what's between them scrolls (each to its
343
- surface's edge, over what scrolls under it, a band of its card between; held past its padding, which a held thing
344
- stops at, its foot past --pad-end, the padding at its foot where that's more) */
345
- :where(.drawer, .sheet, dialog) > :is(header, h2):first-child,
346
- :where(.drawer, .sheet, dialog) > form > header:first-child {
347
- position: sticky;
348
- top: calc(-1 * var(--pad));
349
- z-index: 1;
350
- margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 0;
351
- padding: var(--pad) var(--pad) var(--space-8);
352
- background: var(--card);
353
- }
354
- :where(.drawer, .sheet, dialog) footer {
355
- position: sticky;
356
- bottom: calc(-1 * var(--pad-end, var(--pad)));
357
- z-index: 1;
358
- margin: 0 calc(-1 * var(--pad)) calc(-1 * var(--pad-end, var(--pad)));
359
- padding: var(--space-8) var(--pad) var(--pad-end, var(--pad));
360
- background: var(--card);
361
- display: flex;
362
- flex-wrap: wrap;
363
- justify-content: flex-end;
364
- gap: 8px;
365
- }
366
- /* removing stands apart, first at the foot */
367
- :where(.drawer, .sheet, dialog) footer > .danger:first-child {
368
- margin-right: auto;
369
- }
370
- .drawer {
371
- position: fixed;
372
- inset: 0 0 0 auto;
373
- z-index: 15;
374
- width: min(320px, 100vw);
375
- overflow: auto;
376
- --pad: 14px;
377
- padding: var(--pad);
378
- border-width: 0 0 0 1px;
379
- border-radius: 0;
380
- }
381
- /* its one column no wider than it, where a scrollbar takes room too (Windows, Linux): a field's least width would
382
- push it sideways */
383
- :where(.drawer, .sheet, dialog) form {
384
- display: grid;
385
- grid-template-columns: minmax(0, 1fr);
386
- gap: 12px;
387
- }
388
- dialog {
389
- width: min(25rem, calc(100vw - 2rem));
390
- --pad: 20px;
391
- padding: var(--pad);
392
- }
393
- dialog[open] {
394
- display: grid;
395
- gap: 14px;
396
- }
397
- dialog::backdrop {
398
- background: var(--scrim);
399
- }
400
- dialog p {
401
- margin: 0;
402
- font: var(--font-small);
403
- color: var(--muted);
404
- }
405
- .sheet {
406
- width: min(22rem, calc(100vw - 2rem));
407
- max-height: calc(100dvh - 2rem);
408
- overflow: auto;
409
- --pad: 12px;
410
- padding: var(--pad);
411
- /* its one column no wider than it: a field (your name, changed in place) would stretch it past its edge */
412
- grid-template-columns: minmax(0, 1fr);
413
- }
414
- .sheet:popover-open {
415
- display: grid;
416
- gap: 10px;
417
- }
284
+ /* a request's refusal, said beside what sent it (Said): its why in danger; nothing while there's none */
285
+ .said {
286
+ margin: 0;
287
+ font: var(--font-small);
288
+ color: var(--danger);
289
+ }
290
+ .said:empty {
291
+ display: none;
292
+ }
418
293
 
419
- /* motion: a drawer rises into place in 200ms, a modal in 160ms; nothing else moves, and under
420
- prefers-reduced-motion nothing does */
421
- @media (prefers-reduced-motion: no-preference) {
422
- .drawer {
423
- animation: rise 200ms ease-out;
294
+ /* .j-file: a file field (Attachment, src/attachment.ts): its picture, the width of what holds it, or a link to its
295
+ PDF; then a small tool to choose one, its file input inside it, and the × that takes it off */
296
+ .j-file {
297
+ display: flex;
298
+ flex-wrap: wrap;
299
+ align-items: center;
300
+ gap: 8px;
424
301
  }
425
- dialog[open] {
426
- animation: rise 160ms ease-out;
302
+ .j-file > [hidden] {
303
+ display: none;
427
304
  }
428
- }
429
- @keyframes rise {
430
- from {
305
+ .j-file > a.act {
306
+ text-decoration: none;
307
+ }
308
+ .j-file-picture {
309
+ flex: 1 0 100%;
310
+ display: block;
311
+ }
312
+ .j-file-picture > img {
313
+ display: block;
314
+ box-sizing: border-box;
315
+ width: 100%;
316
+ max-height: 240px;
317
+ object-fit: cover;
318
+ border: 1px solid var(--edge);
319
+ border-radius: 4px;
320
+ }
321
+ .j-file label {
322
+ position: relative;
323
+ }
324
+ .j-file label:focus-within {
325
+ outline: 2px solid var(--accent);
326
+ }
327
+ .j-file input[type="file"] {
328
+ position: absolute;
329
+ width: 1px;
330
+ height: 1px;
431
331
  opacity: 0;
432
- transform: translateY(8px);
433
332
  }
434
- }
435
333
 
436
- /* on a phone: the drawer and a sheet rise from the foot, the width of the screen */
437
- @media (max-width: 40rem) {
438
- :is(.drawer, .sheet) {
439
- inset: auto 0 0;
440
- width: auto;
441
- max-height: 85dvh;
442
- overflow: auto;
334
+ /* the surfaces: the drawer, the modal and the sheet, each a card in a 1px edge, 4px corners, no shadow */
335
+ :where(.drawer, dialog, .sheet) {
336
+ box-sizing: border-box;
337
+ border: 1px solid var(--edge);
338
+ border-radius: 4px;
339
+ background: var(--card);
340
+ color: var(--ink);
341
+ font: var(--font-row);
342
+ }
343
+ :where(.drawer, .sheet, dialog) h2 {
344
+ flex: 1;
443
345
  margin: 0;
444
- border-width: 1px 0 0;
445
- border-radius: 4px 4px 0 0;
446
- --pad-end: calc(14px + env(safe-area-inset-bottom));
447
- padding-bottom: var(--pad-end);
346
+ font: var(--font-title);
347
+ }
348
+ :where(.drawer, .sheet, dialog) header {
349
+ display: flex;
350
+ align-items: center;
351
+ gap: 8px;
352
+ }
353
+ /* its head and its foot always show, what it is and what you may do: only what's between them scrolls (each to its
354
+ surface's edge, over what scrolls under it, a band of its card between; held past its padding, which a held thing
355
+ stops at, its foot past --pad-end, the padding at its foot where that's more) */
356
+ :where(.drawer, .sheet, dialog) > :is(header, h2):first-child,
357
+ :where(.drawer, .sheet, dialog) > form > header:first-child {
358
+ position: sticky;
359
+ top: calc(-1 * var(--pad));
360
+ z-index: 1;
361
+ margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 0;
362
+ padding: var(--pad) var(--pad) var(--space-8);
363
+ background: var(--card);
364
+ }
365
+ :where(.drawer, .sheet, dialog) footer {
366
+ position: sticky;
367
+ bottom: calc(-1 * var(--pad-end, var(--pad)));
368
+ z-index: 1;
369
+ margin: 0 calc(-1 * var(--pad)) calc(-1 * var(--pad-end, var(--pad)));
370
+ padding: var(--space-8) var(--pad) var(--pad-end, var(--pad));
371
+ background: var(--card);
372
+ display: flex;
373
+ flex-wrap: wrap;
374
+ justify-content: flex-end;
375
+ gap: 8px;
376
+ }
377
+ /* removing stands apart, first at the foot */
378
+ :where(.drawer, .sheet, dialog) footer > .danger:first-child {
379
+ margin-right: auto;
448
380
  }
449
381
  .drawer {
450
- max-height: 70dvh;
382
+ position: fixed;
383
+ inset: 0 0 0 auto;
384
+ z-index: 15;
385
+ width: min(320px, 100vw);
386
+ overflow: auto;
387
+ --pad: 14px;
388
+ padding: var(--pad);
389
+ border-width: 0 0 0 1px;
390
+ border-radius: 0;
451
391
  }
452
- }
453
- @media (max-width: 40rem), (pointer: coarse) {
454
- .act,
455
- :where(input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"]), select) {
456
- min-height: 44px;
392
+ /* its one column no wider than it, where a scrollbar takes room too (Windows, Linux): a field's least width would
393
+ push it sideways */
394
+ :where(.drawer, .sheet, dialog) form {
395
+ display: grid;
396
+ grid-template-columns: minmax(0, 1fr);
397
+ gap: 12px;
457
398
  }
458
- .icon-only {
459
- width: 44px;
460
- height: 44px;
399
+ dialog {
400
+ width: min(25rem, calc(100vw - 2rem));
401
+ --pad: 20px;
402
+ padding: var(--pad);
461
403
  }
462
- :is(.j-choices, .j-chips) > button,
463
- .j-chip:has(> .icon-only) {
464
- min-height: 44px;
404
+ dialog[open] {
405
+ display: grid;
406
+ gap: 14px;
465
407
  }
466
- .j-chip > .icon-only {
467
- width: 44px;
468
- height: 44px;
469
- margin-right: -10px;
408
+ /* a modal dims what's behind it by its own ::backdrop only where src/scrim.ts doesn't watch (a shadow its display
409
+ gave the parts by hand, not by adopt()); where it does, the page's one scrim does, which fades in every browser */
410
+ dialog::backdrop {
411
+ background: var(--scrim);
412
+ }
413
+ dialog p {
414
+ margin: 0;
415
+ font: var(--font-small);
416
+ color: var(--muted);
417
+ }
418
+ .sheet {
419
+ width: min(22rem, calc(100vw - 2rem));
420
+ max-height: calc(100dvh - 2rem);
421
+ overflow: auto;
422
+ --pad: 12px;
423
+ padding: var(--pad);
424
+ /* its one column no wider than it: a field (your name, changed in place) would stretch it past its edge */
425
+ grid-template-columns: minmax(0, 1fr);
426
+ /* over the page's foot, even as it leaves the top layer to go */
427
+ z-index: 20;
428
+ }
429
+ .sheet:popover-open {
430
+ display: grid;
431
+ gap: 10px;
432
+ }
433
+
434
+ /* .j-foot: a foot fixed at the screen's foot (a quick add, a balance), run on past it by 40vh, its words lifted by as
435
+ much, so nothing of the page shows under it, where an iPhone's address bar floats over the page and comes and
436
+ goes; its own padding below its words is --foot-pad, and the safe area's below that. An app sets its sides and its
437
+ top, never its bottom, and leaves the page room for it */
438
+ .j-foot {
439
+ position: fixed;
440
+ inset: auto 0 -40vh;
441
+ z-index: 10;
442
+ box-sizing: border-box;
443
+ padding-bottom: calc(40vh + var(--foot-pad, var(--space-8)) + env(safe-area-inset-bottom));
444
+ border-top: 1px solid var(--edge);
445
+ background: var(--card);
446
+ }
447
+
448
+ /* the scrim (src/scrim.ts): one, on the page, behind what's open (a modal; on a phone, a drawer or a sheet too),
449
+ fading in as it rises and out as it goes; over a drawer while a modal asks over it. A tap on it closes the drawer
450
+ on top, as its × does */
451
+ .j-scrim {
452
+ position: fixed;
453
+ inset: 0;
454
+ z-index: 12;
455
+ background: var(--scrim);
456
+ opacity: 0;
457
+ pointer-events: none;
458
+ transition: opacity var(--fall);
459
+ }
460
+ .j-scrim.j-on {
461
+ opacity: 1;
462
+ pointer-events: auto;
463
+ transition: opacity var(--rise);
464
+ }
465
+ .j-scrim.j-asking {
466
+ z-index: 30;
467
+ }
468
+
469
+ /* motion, as an iPhone's (src/tokens.json, motion): a drawer and a sheet rise into place and go back the way they
470
+ came (from the foot on a phone; wider, a drawer from the right, a sheet a little from below); a modal settles in
471
+ from a little larger and fades as it goes; a menu drops from its button. Under prefers-reduced-motion, nothing
472
+ moves */
473
+ @media (prefers-reduced-motion: no-preference) {
474
+ :is(.drawer, .sheet) {
475
+ transition:
476
+ transform var(--rise),
477
+ opacity var(--rise),
478
+ display var(--rise) allow-discrete,
479
+ overlay var(--rise) allow-discrete;
480
+ }
481
+ .drawer[hidden],
482
+ .sheet:not(:popover-open) {
483
+ transition:
484
+ transform var(--fall),
485
+ opacity var(--fall),
486
+ display var(--fall) allow-discrete,
487
+ overlay var(--fall) allow-discrete;
488
+ }
489
+ .drawer[hidden] {
490
+ transform: translateX(100%);
491
+ }
492
+ @starting-style {
493
+ .drawer:not([hidden]) {
494
+ transform: translateX(100%);
495
+ }
496
+ }
497
+ .sheet:not(:popover-open) {
498
+ opacity: 0;
499
+ transform: translateY(12px);
500
+ }
501
+ @starting-style {
502
+ .sheet:popover-open {
503
+ opacity: 0;
504
+ transform: translateY(12px);
505
+ }
506
+ }
507
+ dialog {
508
+ transition:
509
+ opacity var(--ask),
510
+ transform var(--ask),
511
+ display var(--ask) allow-discrete,
512
+ overlay var(--ask) allow-discrete;
513
+ }
514
+ dialog:not([open]) {
515
+ opacity: 0;
516
+ transform: scale(0.96);
517
+ transition:
518
+ opacity var(--ask-out),
519
+ transform var(--ask-out),
520
+ display var(--ask-out) allow-discrete,
521
+ overlay var(--ask-out) allow-discrete;
522
+ }
523
+ @starting-style {
524
+ dialog[open] {
525
+ opacity: 0;
526
+ transform: scale(1.06);
527
+ }
528
+ }
529
+ .j-choices[popover] {
530
+ transition:
531
+ opacity var(--drop),
532
+ transform var(--drop),
533
+ display var(--drop) allow-discrete,
534
+ overlay var(--drop) allow-discrete;
535
+ }
536
+ .j-choices[popover]:not(:popover-open) {
537
+ opacity: 0;
538
+ transform: translateY(-4px) scale(0.98);
539
+ }
540
+ @starting-style {
541
+ .j-choices[popover]:popover-open {
542
+ opacity: 0;
543
+ transform: translateY(-4px) scale(0.98);
544
+ }
545
+ }
546
+ }
547
+
548
+ /* on a phone, the drawer and a sheet are a phone's sheet: the width of the screen, risen from the foot, rounded at
549
+ the top and edged by nothing but the scrim behind; a grabber on its head, which stays in view as it scrolls */
550
+ @media (max-width: 40rem) {
551
+ :is(.drawer, .sheet) {
552
+ inset: auto 0 0;
553
+ width: auto;
554
+ max-height: 88dvh;
555
+ overflow: auto;
556
+ margin: 0;
557
+ border: 0;
558
+ border-radius: 14px 14px 0 0;
559
+ --pad: var(--space-16);
560
+ --pad-end: calc(var(--space-16) + env(safe-area-inset-bottom));
561
+ padding-bottom: var(--pad-end);
562
+ }
563
+ /* the drawer leaves the page in view above it: what it changes is there */
564
+ .drawer {
565
+ max-height: 70dvh;
566
+ }
567
+ :where(.drawer, .sheet) > :is(header, h2):first-child,
568
+ :where(.drawer, .sheet) > form > header:first-child {
569
+ padding-top: var(--space-20);
570
+ border-radius: 14px 14px 0 0;
571
+ }
572
+ :where(.drawer, .sheet) > :is(header, h2):first-child::before,
573
+ :where(.drawer, .sheet) > form > header:first-child::before {
574
+ content: "";
575
+ position: absolute;
576
+ top: var(--space-6);
577
+ left: 50%;
578
+ width: 36px;
579
+ height: 5px;
580
+ border-radius: 3px;
581
+ background: var(--edge);
582
+ transform: translateX(-50%);
583
+ }
584
+ @media (prefers-reduced-motion: no-preference) {
585
+ .drawer[hidden],
586
+ .sheet:not(:popover-open) {
587
+ opacity: 1;
588
+ transform: translateY(100%);
589
+ }
590
+ @starting-style {
591
+ .drawer:not([hidden]),
592
+ .sheet:popover-open {
593
+ opacity: 1;
594
+ transform: translateY(100%);
595
+ }
596
+ }
597
+ }
598
+ }
599
+ @media (max-width: 40rem), (pointer: coarse) {
600
+ .act,
601
+ :where(input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"]), select) {
602
+ min-height: 44px;
603
+ }
604
+ .icon-only {
605
+ width: 44px;
606
+ height: 44px;
607
+ }
608
+ :is(.j-choices, .j-chips) > button,
609
+ .j-chip:has(> .icon-only) {
610
+ min-height: 44px;
611
+ }
612
+ .j-chip > .icon-only {
613
+ width: 44px;
614
+ height: 44px;
615
+ margin-right: -10px;
616
+ }
470
617
  }
471
618
  }