@velocity-astro/cms-ui 0.1.0-beta.6 → 0.1.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/component-registry.json +50 -3
- package/dist/components/Grid/Grid.variants.d.ts +1 -0
- package/dist/components/Grid/Grid.variants.d.ts.map +1 -1
- package/dist/components/Grid/Grid.variants.js +4 -3
- package/dist/components/Grid/Grid.variants.js.map +1 -1
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logo/Logo.d.ts.map +1 -1
- package/dist/components/Logo/Logo.js +3 -3
- package/dist/components/Logo/Logo.js.map +1 -1
- package/dist/components/Logo/Logo.variants.d.ts +5 -2
- package/dist/components/Logo/Logo.variants.d.ts.map +1 -1
- package/dist/components/Logo/Logo.variants.js +10 -1
- package/dist/components/Logo/Logo.variants.js.map +1 -1
- package/dist/components/Meter/Meter.d.ts +13 -0
- package/dist/components/Meter/Meter.d.ts.map +1 -0
- package/dist/components/Meter/Meter.js +8 -0
- package/dist/components/Meter/Meter.js.map +1 -0
- package/dist/components/Meter/Meter.variants.d.ts +14 -0
- package/dist/components/Meter/Meter.variants.d.ts.map +1 -0
- package/dist/components/Meter/Meter.variants.js +39 -0
- package/dist/components/Meter/Meter.variants.js.map +1 -0
- package/dist/components/Meter/index.d.ts +2 -0
- package/dist/components/Meter/index.d.ts.map +1 -0
- package/dist/components/Meter/index.js +2 -0
- package/dist/components/Meter/index.js.map +1 -0
- package/dist/components/Segmented/Segmented.d.ts +9 -1
- package/dist/components/Segmented/Segmented.d.ts.map +1 -1
- package/dist/components/Segmented/Segmented.js +8 -5
- package/dist/components/Segmented/Segmented.js.map +1 -1
- package/dist/components/Segmented/Segmented.variants.d.ts +7 -0
- package/dist/components/Segmented/Segmented.variants.d.ts.map +1 -1
- package/dist/components/Segmented/Segmented.variants.js +9 -1
- package/dist/components/Segmented/Segmented.variants.js.map +1 -1
- package/dist/components/Table/Table.d.ts +9 -2
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Table/Table.js +14 -2
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/Table.variants.d.ts.map +1 -1
- package/dist/components/Table/Table.variants.js +4 -1
- package/dist/components/Table/Table.variants.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/scales.d.ts +2 -2
- package/dist/components/scales.d.ts.map +1 -1
- package/dist/components/scales.js +4 -2
- package/dist/components/scales.js.map +1 -1
- package/dist/patterns/AppShell/AppShell.d.ts +33 -7
- package/dist/patterns/AppShell/AppShell.d.ts.map +1 -1
- package/dist/patterns/AppShell/AppShell.js +29 -7
- package/dist/patterns/AppShell/AppShell.js.map +1 -1
- package/dist/patterns/AppShell/AppShell.variants.d.ts +63 -20
- package/dist/patterns/AppShell/AppShell.variants.d.ts.map +1 -1
- package/dist/patterns/AppShell/AppShell.variants.js +97 -23
- package/dist/patterns/AppShell/AppShell.variants.js.map +1 -1
- package/dist/patterns/AppShell/index.d.ts +1 -1
- package/dist/patterns/AppShell/index.d.ts.map +1 -1
- package/dist/patterns/AppShell/index.js.map +1 -1
- package/dist/patterns/CommandPalette/CommandPalette.d.ts +36 -0
- package/dist/patterns/CommandPalette/CommandPalette.d.ts.map +1 -0
- package/dist/patterns/CommandPalette/CommandPalette.js +18 -0
- package/dist/patterns/CommandPalette/CommandPalette.js.map +1 -0
- package/dist/patterns/CommandPalette/CommandPalette.variants.d.ts +18 -0
- package/dist/patterns/CommandPalette/CommandPalette.variants.d.ts.map +1 -0
- package/dist/patterns/CommandPalette/CommandPalette.variants.js +21 -0
- package/dist/patterns/CommandPalette/CommandPalette.variants.js.map +1 -0
- package/dist/patterns/CommandPalette/index.d.ts +2 -0
- package/dist/patterns/CommandPalette/index.d.ts.map +1 -0
- package/dist/patterns/CommandPalette/index.js +2 -0
- package/dist/patterns/CommandPalette/index.js.map +1 -0
- package/dist/patterns/ImagePicker/ImagePicker.d.ts +9 -1
- package/dist/patterns/ImagePicker/ImagePicker.d.ts.map +1 -1
- package/dist/patterns/ImagePicker/ImagePicker.js +13 -8
- package/dist/patterns/ImagePicker/ImagePicker.js.map +1 -1
- package/dist/patterns/Outline/Outline.d.ts +26 -0
- package/dist/patterns/Outline/Outline.d.ts.map +1 -0
- package/dist/patterns/Outline/Outline.js +21 -0
- package/dist/patterns/Outline/Outline.js.map +1 -0
- package/dist/patterns/Outline/Outline.variants.d.ts +11 -0
- package/dist/patterns/Outline/Outline.variants.d.ts.map +1 -0
- package/dist/patterns/Outline/Outline.variants.js +21 -0
- package/dist/patterns/Outline/Outline.variants.js.map +1 -0
- package/dist/patterns/Outline/index.d.ts +2 -0
- package/dist/patterns/Outline/index.d.ts.map +1 -0
- package/dist/patterns/Outline/index.js +2 -0
- package/dist/patterns/Outline/index.js.map +1 -0
- package/dist/patterns/PageHeader/PageHeader.variants.d.ts +3 -2
- package/dist/patterns/PageHeader/PageHeader.variants.d.ts.map +1 -1
- package/dist/patterns/PageHeader/PageHeader.variants.js +3 -2
- package/dist/patterns/PageHeader/PageHeader.variants.js.map +1 -1
- package/dist/patterns/PagePreview/PagePreview.d.ts +76 -3
- package/dist/patterns/PagePreview/PagePreview.d.ts.map +1 -1
- package/dist/patterns/PagePreview/PagePreview.js +111 -12
- package/dist/patterns/PagePreview/PagePreview.js.map +1 -1
- package/dist/patterns/PagePreview/PagePreview.variants.d.ts +11 -1
- package/dist/patterns/PagePreview/PagePreview.variants.d.ts.map +1 -1
- package/dist/patterns/PagePreview/PagePreview.variants.js +17 -5
- package/dist/patterns/PagePreview/PagePreview.variants.js.map +1 -1
- package/dist/patterns/PagePreview/index.d.ts +1 -1
- package/dist/patterns/PagePreview/index.d.ts.map +1 -1
- package/dist/patterns/PagePreview/index.js.map +1 -1
- package/dist/patterns/SaveBar/SaveBar.variants.d.ts +3 -2
- package/dist/patterns/SaveBar/SaveBar.variants.d.ts.map +1 -1
- package/dist/patterns/SaveBar/SaveBar.variants.js +5 -4
- package/dist/patterns/SaveBar/SaveBar.variants.js.map +1 -1
- package/dist/patterns/SiteWindow/SiteWindow.d.ts +20 -0
- package/dist/patterns/SiteWindow/SiteWindow.d.ts.map +1 -0
- package/dist/patterns/SiteWindow/SiteWindow.js +8 -0
- package/dist/patterns/SiteWindow/SiteWindow.js.map +1 -0
- package/dist/patterns/SiteWindow/SiteWindow.variants.d.ts +24 -0
- package/dist/patterns/SiteWindow/SiteWindow.variants.d.ts.map +1 -0
- package/dist/patterns/SiteWindow/SiteWindow.variants.js +25 -0
- package/dist/patterns/SiteWindow/SiteWindow.variants.js.map +1 -0
- package/dist/patterns/SiteWindow/index.d.ts +2 -0
- package/dist/patterns/SiteWindow/index.d.ts.map +1 -0
- package/dist/patterns/SiteWindow/index.js +2 -0
- package/dist/patterns/SiteWindow/index.js.map +1 -0
- package/dist/patterns/Welcome/Welcome.d.ts +18 -0
- package/dist/patterns/Welcome/Welcome.d.ts.map +1 -0
- package/dist/patterns/Welcome/Welcome.js +14 -0
- package/dist/patterns/Welcome/Welcome.js.map +1 -0
- package/dist/patterns/Welcome/Welcome.variants.d.ts +12 -0
- package/dist/patterns/Welcome/Welcome.variants.d.ts.map +1 -0
- package/dist/patterns/Welcome/Welcome.variants.js +12 -0
- package/dist/patterns/Welcome/Welcome.variants.js.map +1 -0
- package/dist/patterns/Welcome/index.d.ts +2 -0
- package/dist/patterns/Welcome/index.d.ts.map +1 -0
- package/dist/patterns/Welcome/index.js +2 -0
- package/dist/patterns/Welcome/index.js.map +1 -0
- package/dist/patterns/Workbench/Workbench.d.ts +8 -4
- package/dist/patterns/Workbench/Workbench.d.ts.map +1 -1
- package/dist/patterns/Workbench/Workbench.js +7 -6
- package/dist/patterns/Workbench/Workbench.js.map +1 -1
- package/dist/patterns/Workbench/Workbench.variants.d.ts +6 -1
- package/dist/patterns/Workbench/Workbench.variants.d.ts.map +1 -1
- package/dist/patterns/Workbench/Workbench.variants.js +8 -3
- package/dist/patterns/Workbench/Workbench.variants.js.map +1 -1
- package/dist/patterns/index.d.ts +4 -0
- package/dist/patterns/index.d.ts.map +1 -1
- package/dist/patterns/index.js +4 -0
- package/dist/patterns/index.js.map +1 -1
- package/package.json +1 -1
- package/src/styles.css +38 -0
- package/src/tokens/tokens.css +21 -1
|
@@ -1,35 +1,48 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useId, useRef } from 'react';
|
|
2
|
+
import { useEffect, useId, useRef, useState } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
-
import { pagePreviewBarClass, pagePreviewVariants, pagePreviewEmptyClass, pagePreviewFrameVariants, pagePreviewNoteClass,
|
|
4
|
+
import { pagePreviewBarClass, pagePreviewVariants, pagePreviewEmptyClass, pagePreviewFrameVariants, pagePreviewNoteClass, pagePreviewStageVariants, pagePreviewWidths, } from './PagePreview.variants.js';
|
|
5
5
|
/** How long the page waits after the last change before it is drawn again, in milliseconds. */
|
|
6
6
|
const PAUSE = 500;
|
|
7
7
|
/** The name both sides put on what they say to each other, so nothing else is taken for it. */
|
|
8
8
|
const SOURCE = 'velocity-cms';
|
|
9
9
|
/** How long after words were typed on the page a change of the draft is taken to be those words, in milliseconds. */
|
|
10
10
|
const OWN = 250;
|
|
11
|
+
/** How close a change of the draft and a section asked for must be to be one act, such as a section moved, in milliseconds. */
|
|
12
|
+
const TOGETHER = 100;
|
|
13
|
+
/** How much of a screen's width a pane must have for the page to be shown at the pane's own width. */
|
|
14
|
+
const NEARLY = 0.9;
|
|
11
15
|
/** What can be done to a section from the page itself. */
|
|
12
16
|
const ACTIONS = ['up', 'down', 'duplicate', 'remove', 'addBefore', 'addAfter'];
|
|
17
|
+
const ITEM_ACTIONS = ['up', 'down', 'duplicate', 'remove'];
|
|
13
18
|
/**
|
|
14
19
|
* A page of the site as it would look with what is in a form now, in a frame. The page is drawn
|
|
15
20
|
* by the site itself, so it looks exactly as it will; nothing of it is drawn here.
|
|
16
21
|
*/
|
|
17
|
-
export function PagePreview({ label, address, draft, note, toolbar, action, emptyText, onSectionPress, shownSectionId, typable, onWords, tools, onSectionAction, onSectionMove, isBare = false, width }) {
|
|
22
|
+
export function PagePreview({ label, address, draft, note, toolbar, action, emptyText, onSectionPress, shownSectionId, typable, onWords, tools, onSectionAction, onSectionMove, onSectionPicture, onSectionLink, onSectionItem, onSectionSwatch, onSectionSlot, onTextLink, onUndo, onRedo, onSave, isBare = false, width }) {
|
|
18
23
|
const name = `preview-${useId().replaceAll(':', '')}`;
|
|
19
24
|
const form = useRef(null);
|
|
20
25
|
const frame = useRef(null);
|
|
21
26
|
const hasSent = useRef(false);
|
|
22
27
|
const places = typable === undefined ? undefined : JSON.stringify(typable);
|
|
23
28
|
const offered = tools === undefined ? undefined : JSON.stringify(tools);
|
|
24
|
-
const latest = useRef({ onSectionPress, shownSectionId, onWords, places, offered, onSectionAction, onSectionMove });
|
|
29
|
+
const latest = useRef({ onSectionPress, shownSectionId, onWords, places, offered, onSectionAction, onSectionMove, onSectionPicture, onSectionLink, onSectionItem, onSectionSwatch, onSectionSlot, onTextLink, onUndo, onRedo, onSave });
|
|
25
30
|
useEffect(() => {
|
|
26
|
-
latest.current = { onSectionPress, shownSectionId, onWords, places, offered, onSectionAction, onSectionMove };
|
|
31
|
+
latest.current = { onSectionPress, shownSectionId, onWords, places, offered, onSectionAction, onSectionMove, onSectionPicture, onSectionLink, onSectionItem, onSectionSwatch, onSectionSlot, onTextLink, onUndo, onRedo, onSave };
|
|
27
32
|
});
|
|
28
33
|
// When words were last typed on the page, and whether the page lacks a change made in the form.
|
|
29
34
|
const typedAt = useRef(0);
|
|
35
|
+
// When a button of the page's own tools was last pressed there.
|
|
36
|
+
const pressedAt = useRef(0);
|
|
30
37
|
const isBehind = useRef(false);
|
|
38
|
+
// When a section was last asked to be shown, and when the draft last changed. A page drawn again
|
|
39
|
+
// stays where the person left it, unless the change itself asked for a section: one just moved or added.
|
|
40
|
+
const askedAt = useRef(0);
|
|
41
|
+
const changedAt = useRef(0);
|
|
42
|
+
const hasDrawn = useRef(false);
|
|
31
43
|
// The first page is asked for at once. After that, a pause in the typing asks for the next.
|
|
32
44
|
useEffect(() => {
|
|
45
|
+
changedAt.current = Date.now();
|
|
33
46
|
if (address === undefined)
|
|
34
47
|
return;
|
|
35
48
|
const send = () => {
|
|
@@ -45,12 +58,50 @@ export function PagePreview({ label, address, draft, note, toolbar, action, empt
|
|
|
45
58
|
if (Date.now() - typedAt.current < OWN && !isBehind.current)
|
|
46
59
|
return;
|
|
47
60
|
isBehind.current = true;
|
|
61
|
+
// A button pressed on the page is one change, made: there is no typing to wait out.
|
|
62
|
+
if (Date.now() - pressedAt.current < TOGETHER * 5) {
|
|
63
|
+
pressedAt.current = 0;
|
|
64
|
+
send();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
48
67
|
const waiting = setTimeout(send, PAUSE);
|
|
49
68
|
return () => clearTimeout(waiting);
|
|
50
69
|
}, [address, draft]);
|
|
51
|
-
|
|
70
|
+
// The page is drawn at the width of the screen it is tried on, whatever room the pane has: one
|
|
71
|
+
// wider than the pane is shown smaller, whole, never as the narrower layout that would fit.
|
|
72
|
+
const stage = useRef(null);
|
|
73
|
+
const [room, setRoom] = useState(null);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
const element = stage.current;
|
|
76
|
+
if (!element || typeof ResizeObserver === 'undefined')
|
|
77
|
+
return;
|
|
78
|
+
const measure = () => setRoom({ width: element.clientWidth, height: element.clientHeight });
|
|
79
|
+
const watching = new ResizeObserver(measure);
|
|
80
|
+
watching.observe(element);
|
|
81
|
+
measure();
|
|
82
|
+
return () => watching.disconnect();
|
|
83
|
+
}, [address === undefined]);
|
|
84
|
+
const wanted = pagePreviewWidths[width ?? 'full'];
|
|
85
|
+
// A pane nearly as wide shows the page at its own width instead: a little narrower reads better than a little smaller.
|
|
86
|
+
const fits = room === null || room.width <= 0 || room.width >= wanted * NEARLY;
|
|
87
|
+
const scale = fits ? 1 : room.width / wanted;
|
|
88
|
+
const isFitted = scale < 1;
|
|
89
|
+
// A page takes itself to be shown at its own size, so it is told only when that is not so, or no longer so.
|
|
90
|
+
const told = useRef(1);
|
|
91
|
+
const zoom = (to) => {
|
|
92
|
+
if (to === told.current)
|
|
93
|
+
return;
|
|
94
|
+
told.current = to;
|
|
95
|
+
frame.current?.contentWindow?.postMessage({ source: SOURCE, type: 'zoom', scale: to }, window.location.origin);
|
|
96
|
+
};
|
|
97
|
+
const scaleNow = useRef(scale);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
scaleNow.current = scale;
|
|
100
|
+
zoom(scale);
|
|
101
|
+
}, [scale]);
|
|
102
|
+
const show = (id, still = false) => {
|
|
52
103
|
if (id !== undefined)
|
|
53
|
-
frame.current?.contentWindow?.postMessage({ source: SOURCE, type: 'show', id }, window.location.origin);
|
|
104
|
+
frame.current?.contentWindow?.postMessage({ source: SOURCE, type: 'show', id, ...(still && { still }) }, window.location.origin);
|
|
54
105
|
};
|
|
55
106
|
const tell = (said) => {
|
|
56
107
|
if (said !== undefined)
|
|
@@ -70,7 +121,7 @@ export function PagePreview({ label, address, draft, note, toolbar, action, empt
|
|
|
70
121
|
return;
|
|
71
122
|
if (said.type === 'section' && typeof said.id === 'string') {
|
|
72
123
|
if (typeof said.field === 'string')
|
|
73
|
-
latest.current.onSectionPress?.(said.id, said.field);
|
|
124
|
+
latest.current.onSectionPress?.(said.id, said.field, said.form === true);
|
|
74
125
|
else
|
|
75
126
|
latest.current.onSectionPress?.(said.id);
|
|
76
127
|
}
|
|
@@ -78,26 +129,74 @@ export function PagePreview({ label, address, draft, note, toolbar, action, empt
|
|
|
78
129
|
typedAt.current = Date.now();
|
|
79
130
|
latest.current.onWords?.(said.id, said.field, said.words);
|
|
80
131
|
}
|
|
132
|
+
if (said.type === 'act' || said.type === 'move' || said.type === 'item' || said.type === 'swatch' || said.type === 'undo' || said.type === 'redo')
|
|
133
|
+
pressedAt.current = Date.now();
|
|
81
134
|
if (said.type === 'act' && typeof said.id === 'string') {
|
|
82
135
|
const action = ACTIONS.find((candidate) => candidate === said.action);
|
|
83
136
|
if (action)
|
|
84
137
|
latest.current.onSectionAction?.(said.id, action);
|
|
85
138
|
}
|
|
86
139
|
if (said.type === 'move' && typeof said.id === 'string' && (typeof said.before === 'string' || said.before === null)) {
|
|
87
|
-
|
|
140
|
+
if (typeof said.into === 'string')
|
|
141
|
+
latest.current.onSectionMove?.(said.id, said.before, said.into);
|
|
142
|
+
else
|
|
143
|
+
latest.current.onSectionMove?.(said.id, said.before);
|
|
144
|
+
}
|
|
145
|
+
if (said.type === 'slot' && typeof said.id === 'string' && typeof said.field === 'string') {
|
|
146
|
+
latest.current.onSectionSlot?.(said.id, said.field);
|
|
88
147
|
}
|
|
148
|
+
if (said.type === 'picture' && typeof said.id === 'string' && typeof said.field === 'string') {
|
|
149
|
+
latest.current.onSectionPicture?.(said.id, said.field);
|
|
150
|
+
}
|
|
151
|
+
if (said.type === 'link' && typeof said.id === 'string' && typeof said.field === 'string') {
|
|
152
|
+
latest.current.onSectionLink?.(said.id, said.field);
|
|
153
|
+
}
|
|
154
|
+
if (said.type === 'item' && typeof said.id === 'string' && typeof said.field === 'string' && typeof said.at === 'number') {
|
|
155
|
+
const action = ITEM_ACTIONS.find((candidate) => candidate === said.action);
|
|
156
|
+
if (action)
|
|
157
|
+
latest.current.onSectionItem?.(said.id, said.field, said.at, action);
|
|
158
|
+
}
|
|
159
|
+
if (said.type === 'swatch' && typeof said.id === 'string' && typeof said.field === 'string' && typeof said.value === 'string') {
|
|
160
|
+
latest.current.onSectionSwatch?.(said.id, said.field, said.value);
|
|
161
|
+
}
|
|
162
|
+
if (said.type === 'linkAsk' && typeof said.href === 'string') {
|
|
163
|
+
const page = frame.current?.contentWindow;
|
|
164
|
+
const answer = (href) => page?.postMessage({ source: SOURCE, type: 'linkAnswer', href }, window.location.origin);
|
|
165
|
+
if (latest.current.onTextLink)
|
|
166
|
+
latest.current.onTextLink(said.href, answer);
|
|
167
|
+
else
|
|
168
|
+
answer(null);
|
|
169
|
+
}
|
|
170
|
+
if (said.type === 'undo' || said.type === 'redo') {
|
|
171
|
+
// What the form holds next is not what the page shows, however lately words were typed there.
|
|
172
|
+
typedAt.current = 0;
|
|
173
|
+
if (said.type === 'undo')
|
|
174
|
+
latest.current.onUndo?.();
|
|
175
|
+
else
|
|
176
|
+
latest.current.onRedo?.();
|
|
177
|
+
}
|
|
178
|
+
if (said.type === 'save')
|
|
179
|
+
latest.current.onSave?.();
|
|
89
180
|
if (said.type === 'ready') {
|
|
181
|
+
told.current = 1;
|
|
182
|
+
zoom(scaleNow.current);
|
|
90
183
|
tell(latest.current.places);
|
|
91
184
|
offer(latest.current.offered);
|
|
92
|
-
|
|
185
|
+
// Outlined again, and brought into view only on the first page or when the change that drew this one asked for it.
|
|
186
|
+
show(latest.current.shownSectionId, hasDrawn.current && Math.abs(askedAt.current - changedAt.current) > TOGETHER);
|
|
187
|
+
hasDrawn.current = true;
|
|
188
|
+
askedAt.current = 0;
|
|
93
189
|
}
|
|
94
190
|
};
|
|
95
191
|
window.addEventListener('message', hear);
|
|
96
192
|
return () => window.removeEventListener('message', hear);
|
|
97
193
|
}, []);
|
|
98
|
-
useEffect(() =>
|
|
194
|
+
useEffect(() => {
|
|
195
|
+
askedAt.current = Date.now();
|
|
196
|
+
show(shownSectionId);
|
|
197
|
+
}, [shownSectionId]);
|
|
99
198
|
useEffect(() => tell(places), [places]);
|
|
100
199
|
useEffect(() => offer(offered), [offered]);
|
|
101
|
-
return (_jsxs("div", { className: pagePreviewVariants({ isBare }), children: [(note !== undefined || toolbar !== undefined || action !== undefined) && (_jsxs("div", { className: pagePreviewBarClass, children: [action ?? _jsx("span", { className: pagePreviewNoteClass, children: note }), toolbar] })), _jsx("div", { className:
|
|
200
|
+
return (_jsxs("div", { className: pagePreviewVariants({ isBare }), children: [(note !== undefined || toolbar !== undefined || action !== undefined) && (_jsxs("div", { className: pagePreviewBarClass, children: [action ?? _jsx("span", { className: pagePreviewNoteClass, children: note }), toolbar] })), _jsx("div", { ref: stage, className: pagePreviewStageVariants({ isFitted }), children: address === undefined ? (_jsx("p", { className: pagePreviewEmptyClass, children: emptyText })) : (_jsxs(_Fragment, { children: [createPortal(_jsx("form", { ref: form, method: "post", action: address, target: name, hidden: true, children: _jsx("input", { type: "hidden", name: "draft", value: draft, readOnly: true }) }), document.body), _jsx("iframe", { ref: frame, name: name, title: label, className: pagePreviewFrameVariants({ width, isFitted }), ...(isFitted && room !== null && { style: { width: `${wanted}px`, height: `${room.height / scale}px`, transform: `scale(${scale})` } }) })] })) })] }));
|
|
102
201
|
}
|
|
103
202
|
//# sourceMappingURL=PagePreview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PagePreview.js","sourceRoot":"","sources":["../../../src/patterns/PagePreview/PagePreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,GAEtB,MAAM,2BAA2B,CAAC;AAEnC,+FAA+F;AAC/F,MAAM,KAAK,GAAG,GAAG,CAAC;AAClB,+FAA+F;AAC/F,MAAM,MAAM,GAAG,cAAc,CAAC;AAC9B,qHAAqH;AACrH,MAAM,GAAG,GAAG,GAAG,CAAC;AAYhB,0DAA0D;AAC1D,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAU,CAAC;AA6DxF;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,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,aAChC,MAAM,IAAI,eAAM,SAAS,EAAE,oBAAoB,YAAG,IAAI,GAAQ,EAC9D,OAAO,IACJ,CACP,EACD,cAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,wBAAwB,CAAC,EAAE,QAAQ,EAAE,CAAC,YAC/D,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CACvB,YAAG,SAAS,EAAE,qBAAqB,YAAG,SAAS,GAAK,CACrD,CAAC,CAAC,CAAC,CACF,8BAEG,YAAY,CACX,eAAM,GAAG,EAAE,IAAI,EAAE,MAAM,EAAC,MAAM,EAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAClE,gBAAO,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,SAAG,GACtD,EACP,QAAQ,CAAC,IAAI,CACd,EACD,iBACE,GAAG,EAAE,KAAK,EACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,wBAAwB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,KAEpD,CAAC,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE,SAAS,EAAE,SAAS,KAAK,GAAG,EAAE,EAAE,CAAC,GACxI,IACD,CACJ,GACG,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -5,11 +5,21 @@ export declare const pagePreviewVariants: (props?: ({
|
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export declare const pagePreviewBarClass = "flex flex-wrap items-center justify-between gap-3 border-b border-border bg-background px-3 py-2";
|
|
7
7
|
export declare const pagePreviewNoteClass = "min-w-0 truncate text-sm text-foreground-muted";
|
|
8
|
-
|
|
8
|
+
/** A page shown smaller than it is starts at the pane's corner, and what it leaves over is cut off. */
|
|
9
|
+
export declare const pagePreviewStageVariants: (props?: ({
|
|
10
|
+
isFitted?: boolean | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
/** The width, in pixels, of the screen each choice stands for. A pane narrower than that shows the page smaller. */
|
|
13
|
+
export declare const pagePreviewWidths: {
|
|
14
|
+
readonly phone: 384;
|
|
15
|
+
readonly tablet: 768;
|
|
16
|
+
readonly full: 1280;
|
|
17
|
+
};
|
|
9
18
|
export declare const pagePreviewEmptyClass = "m-auto max-w-sm px-6 text-center text-sm text-foreground-muted";
|
|
10
19
|
/** The page at the width of the screen it is tried on. Narrower than the pane, it stands in the middle with an edge each side. */
|
|
11
20
|
export declare const pagePreviewFrameVariants: (props?: ({
|
|
12
21
|
width?: "full" | "phone" | "tablet" | null | undefined;
|
|
22
|
+
isFitted?: boolean | null | undefined;
|
|
13
23
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
24
|
export type PagePreviewVariants = VariantProps<typeof pagePreviewFrameVariants>;
|
|
15
25
|
//# sourceMappingURL=PagePreview.variants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PagePreview.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/PagePreview/PagePreview.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB;;8EAG9B,CAAC;AACH,eAAO,MAAM,mBAAmB,qGAAqG,CAAC;AACtI,eAAO,MAAM,oBAAoB,mDAAmD,CAAC;AACrF,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"PagePreview.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/PagePreview/PagePreview.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB;;8EAG9B,CAAC;AACH,eAAO,MAAM,mBAAmB,qGAAqG,CAAC;AACtI,eAAO,MAAM,oBAAoB,mDAAmD,CAAC;AACrF,uGAAuG;AACvG,eAAO,MAAM,wBAAwB;;8EAGnC,CAAC;AAEH,oHAAoH;AACpH,eAAO,MAAM,iBAAiB;;;;CAAmD,CAAC;AAClF,eAAO,MAAM,qBAAqB,mEAAmE,CAAC;AAEtG,kIAAkI;AAClI,eAAO,MAAM,wBAAwB;;;8EAenC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -6,17 +6,29 @@ export const pagePreviewVariants = cva('flex h-full min-h-0 flex-col overflow-hi
|
|
|
6
6
|
});
|
|
7
7
|
export const pagePreviewBarClass = 'flex flex-wrap items-center justify-between gap-3 border-b border-border bg-background px-3 py-2';
|
|
8
8
|
export const pagePreviewNoteClass = 'min-w-0 truncate text-sm text-foreground-muted';
|
|
9
|
-
|
|
9
|
+
/** A page shown smaller than it is starts at the pane's corner, and what it leaves over is cut off. */
|
|
10
|
+
export const pagePreviewStageVariants = cva('flex min-h-0 flex-1', {
|
|
11
|
+
variants: { isFitted: { true: 'justify-start overflow-hidden', false: 'justify-center' } },
|
|
12
|
+
defaultVariants: { isFitted: false },
|
|
13
|
+
});
|
|
14
|
+
/** The width, in pixels, of the screen each choice stands for. A pane narrower than that shows the page smaller. */
|
|
15
|
+
export const pagePreviewWidths = { phone: 384, tablet: 768, full: 1280 };
|
|
10
16
|
export const pagePreviewEmptyClass = 'm-auto max-w-sm px-6 text-center text-sm text-foreground-muted';
|
|
11
17
|
/** The page at the width of the screen it is tried on. Narrower than the pane, it stands in the middle with an edge each side. */
|
|
12
|
-
export const pagePreviewFrameVariants = cva('
|
|
18
|
+
export const pagePreviewFrameVariants = cva('bg-background', {
|
|
13
19
|
variants: {
|
|
14
20
|
width: {
|
|
15
|
-
phone: '
|
|
16
|
-
tablet: '
|
|
21
|
+
phone: 'border-x border-border',
|
|
22
|
+
tablet: 'border-x border-border',
|
|
17
23
|
full: '',
|
|
18
24
|
},
|
|
25
|
+
// Fitted, its size is the screen's own and it is shown smaller from its corner.
|
|
26
|
+
isFitted: { true: 'max-w-none shrink-0 origin-top-left', false: 'h-full w-full transition-all motion-base' },
|
|
19
27
|
},
|
|
20
|
-
|
|
28
|
+
compoundVariants: [
|
|
29
|
+
{ width: 'phone', isFitted: false, class: 'max-w-sm' },
|
|
30
|
+
{ width: 'tablet', isFitted: false, class: 'max-w-3xl' },
|
|
31
|
+
],
|
|
32
|
+
defaultVariants: { width: 'full', isFitted: false },
|
|
21
33
|
});
|
|
22
34
|
//# sourceMappingURL=PagePreview.variants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PagePreview.variants.js","sourceRoot":"","sources":["../../../src/patterns/PagePreview/PagePreview.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,8EAA8E;AAC9E,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC,sEAAsE,EAAE;IAC7G,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,iCAAiC,EAAE,EAAE;IAC5E,eAAe,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;CACnC,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,kGAAkG,CAAC;AACtI,MAAM,CAAC,MAAM,oBAAoB,GAAG,gDAAgD,CAAC;AACrF,MAAM,CAAC,MAAM,qBAAqB,GAAG,
|
|
1
|
+
{"version":3,"file":"PagePreview.variants.js","sourceRoot":"","sources":["../../../src/patterns/PagePreview/PagePreview.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,8EAA8E;AA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AK,EAAE,KAAK,EAAE,WAAW,EAAE;KACzD;IACD,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;CACpD,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { PagePreview, type PagePreviewProps, type PageSectionAction, type PageSectionTools } from './PagePreview.js';
|
|
1
|
+
export { PagePreview, type PageItemAction, type PagePreviewProps, type PageSectionAction, type PageSectionSwatches, type PageSectionTools } from './PagePreview.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/PagePreview/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/PagePreview/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/PagePreview/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/PagePreview/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuH,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/** On a screen the bar stays at the top of the screen's panel. Across a whole window it is the window's top edge. */
|
|
2
|
+
/** The buttons go under the title when the window has no room for them beside it, and never off its edge. */
|
|
2
3
|
export declare const saveBarVariants: (props?: ({
|
|
3
4
|
across?: "screen" | "window" | null | undefined;
|
|
4
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
6
|
export declare const saveBarBackClass: string;
|
|
6
|
-
export declare const saveBarHeadingClass = "flex min-w-0 flex-1 flex-col gap-0.5";
|
|
7
|
+
export declare const saveBarHeadingClass = "flex min-w-0 flex-1 basis-48 flex-col gap-0.5";
|
|
7
8
|
export declare const saveBarTitleClass = "truncate text-lg font-semibold text-foreground";
|
|
8
9
|
export declare const saveBarStatusClass = "flex min-w-0 items-center gap-2";
|
|
9
|
-
export declare const saveBarActionsClass = "flex shrink-0 items-center gap-2";
|
|
10
|
+
export declare const saveBarActionsClass = "flex max-w-full shrink-0 flex-wrap items-center gap-2";
|
|
10
11
|
/** The size of the arrow on the way back, in pixels. */
|
|
11
12
|
export declare const saveBarBackIconSize = 16;
|
|
12
13
|
//# sourceMappingURL=SaveBar.variants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveBar.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/SaveBar/SaveBar.variants.ts"],"names":[],"mappings":"AAEA,qHAAqH;AACrH,eAAO,MAAM,eAAe;;8EAQ1B,CAAC;AAEH,eAAO,MAAM,gBAAgB,QAIlB,CAAC;AAEZ,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"SaveBar.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/SaveBar/SaveBar.variants.ts"],"names":[],"mappings":"AAEA,qHAAqH;AACrH,6GAA6G;AAC7G,eAAO,MAAM,eAAe;;8EAQ1B,CAAC;AAEH,eAAO,MAAM,gBAAgB,QAIlB,CAAC;AAEZ,eAAO,MAAM,mBAAmB,kDAAkD,CAAC;AACnF,eAAO,MAAM,iBAAiB,mDAAmD,CAAC;AAClF,eAAO,MAAM,kBAAkB,oCAAoC,CAAC;AACpE,eAAO,MAAM,mBAAmB,0DAA0D,CAAC;AAE3F,wDAAwD;AACxD,eAAO,MAAM,mBAAmB,KAAK,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
2
|
/** On a screen the bar stays at the top of the screen's panel. Across a whole window it is the window's top edge. */
|
|
3
|
-
|
|
3
|
+
/** The buttons go under the title when the window has no room for them beside it, and never off its edge. */
|
|
4
|
+
export const saveBarVariants = cva('flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-border bg-background py-3', {
|
|
4
5
|
variants: {
|
|
5
6
|
across: {
|
|
6
|
-
screen: 'sticky top-0 layer-sticky rounded-t-2xl px-6',
|
|
7
|
+
screen: 'sticky top-0 layer-sticky px-4 md:rounded-t-2xl md:px-6',
|
|
7
8
|
window: 'shrink-0 px-4',
|
|
8
9
|
},
|
|
9
10
|
},
|
|
@@ -14,10 +15,10 @@ export const saveBarBackClass = [
|
|
|
14
15
|
'transition-colors motion-fast',
|
|
15
16
|
'outline-none data-hovered:bg-background-secondary data-focus-visible:ring-2 data-focus-visible:ring-ring',
|
|
16
17
|
].join(' ');
|
|
17
|
-
export const saveBarHeadingClass = 'flex min-w-0 flex-1 flex-col gap-0.5';
|
|
18
|
+
export const saveBarHeadingClass = 'flex min-w-0 flex-1 basis-48 flex-col gap-0.5';
|
|
18
19
|
export const saveBarTitleClass = 'truncate text-lg font-semibold text-foreground';
|
|
19
20
|
export const saveBarStatusClass = 'flex min-w-0 items-center gap-2';
|
|
20
|
-
export const saveBarActionsClass = 'flex shrink-0 items-center gap-2';
|
|
21
|
+
export const saveBarActionsClass = 'flex max-w-full shrink-0 flex-wrap items-center gap-2';
|
|
21
22
|
/** The size of the arrow on the way back, in pixels. */
|
|
22
23
|
export const saveBarBackIconSize = 16;
|
|
23
24
|
//# sourceMappingURL=SaveBar.variants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveBar.variants.js","sourceRoot":"","sources":["../../../src/patterns/SaveBar/SaveBar.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,qHAAqH;AACrH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"SaveBar.variants.js","sourceRoot":"","sources":["../../../src/patterns/SaveBar/SaveBar.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,qHAAqH;AACrH,6GAA6G;AAC7G,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC,uFAAuF,EAAE;IAC1H,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,MAAM,EAAE,yDAAyD;YACjE,MAAM,EAAE,eAAe;SACxB;KACF;IACD,eAAe,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;CACtC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,kJAAkJ;IAClJ,+BAA+B;IAC/B,0GAA0G;CAC3G,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,mBAAmB,GAAG,+CAA+C,CAAC;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,gDAAgD,CAAC;AAClF,MAAM,CAAC,MAAM,kBAAkB,GAAG,iCAAiC,CAAC;AACpE,MAAM,CAAC,MAAM,mBAAmB,GAAG,uDAAuD,CAAC;AAE3F,wDAAwD;AACxD,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type SiteWindowVariants } from './SiteWindow.variants.js';
|
|
2
|
+
export interface SiteWindowProps extends SiteWindowVariants {
|
|
3
|
+
/** The site's address, shown where a browser shows it: "lakeshore.example". */
|
|
4
|
+
readonly address: string;
|
|
5
|
+
/** The page to show, as visitors see it: a path on the site, such as "/". */
|
|
6
|
+
readonly src: string;
|
|
7
|
+
/** What the page is, for screen readers: "The home page of Lakeshore Realty". */
|
|
8
|
+
readonly title: string;
|
|
9
|
+
/** What pressing the card does, at its foot: "Edit the home page". */
|
|
10
|
+
readonly label: string;
|
|
11
|
+
/** A few words at the foot before it: when the page was last published, and by whom. */
|
|
12
|
+
readonly meta?: string;
|
|
13
|
+
/** Where pressing the card leads. */
|
|
14
|
+
readonly href?: string;
|
|
15
|
+
/** What pressing the card does, when it leads nowhere by itself. */
|
|
16
|
+
readonly onPress?: () => void;
|
|
17
|
+
}
|
|
18
|
+
/** A page of the site in a small browser window, as visitors see it now. The whole card is one link. */
|
|
19
|
+
export declare function SiteWindow({ address, src, title, label, meta, href, onPress, size }: SiteWindowProps): import("react").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=SiteWindow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SiteWindow.d.ts","sourceRoot":"","sources":["../../../src/patterns/SiteWindow/SiteWindow.tsx"],"names":[],"mappings":"AACA,OAAO,EAYL,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,6EAA6E;IAC7E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,qCAAqC;IACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,wGAAwG;AACxG,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,eAAe,+BAuBpG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Link } from 'react-aria-components';
|
|
3
|
+
import { siteWindowAddressClass, siteWindowBarClass, siteWindowClass, siteWindowDotClass, siteWindowDotsClass, siteWindowFootClass, siteWindowFrameVariants, siteWindowLinkClass, siteWindowMetaClass, siteWindowSpacerClass, siteWindowViewVariants, } from './SiteWindow.variants.js';
|
|
4
|
+
/** A page of the site in a small browser window, as visitors see it now. The whole card is one link. */
|
|
5
|
+
export function SiteWindow({ address, src, title, label, meta, href, onPress, size }) {
|
|
6
|
+
return (_jsxs("div", { className: siteWindowClass, children: [_jsxs("div", { "aria-hidden": true, className: siteWindowBarClass, children: [_jsxs("span", { className: siteWindowDotsClass, children: [_jsx("span", { className: siteWindowDotClass }), _jsx("span", { className: siteWindowDotClass }), _jsx("span", { className: siteWindowDotClass })] }), _jsx("span", { className: siteWindowAddressClass, children: address }), _jsx("span", { className: siteWindowSpacerClass })] }), _jsx("div", { className: siteWindowViewVariants({ size }), children: _jsx("iframe", { src: src, title: title, loading: "lazy", tabIndex: -1, "aria-hidden": true, className: siteWindowFrameVariants({ size }) }) }), _jsxs("div", { className: siteWindowFootClass, children: [meta !== undefined && _jsx("span", { className: siteWindowMetaClass, children: meta }), _jsx(Link, { className: siteWindowLinkClass, ...(href !== undefined && { href }), ...(onPress !== undefined && { onPress }), children: label })] })] }));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=SiteWindow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SiteWindow.js","sourceRoot":"","sources":["../../../src/patterns/SiteWindow/SiteWindow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,e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
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
/** `relative`, so the link at its foot can stretch over the whole card and make all of it one thing to press. */
|
|
3
|
+
export declare const siteWindowClass = "group relative w-full min-w-0 max-w-xl overflow-hidden rounded-xl border border-border bg-card shadow-xl transition-colors motion-base has-data-hovered:border-border-strong has-data-focus-visible:ring-2 has-data-focus-visible:ring-ring";
|
|
4
|
+
export declare const siteWindowBarClass = "flex items-center gap-3 border-b border-border bg-background-secondary px-3.5 py-2.5";
|
|
5
|
+
export declare const siteWindowDotsClass = "flex shrink-0 gap-1.5";
|
|
6
|
+
export declare const siteWindowDotClass = "h-2.5 w-2.5 rounded-full bg-border-strong";
|
|
7
|
+
export declare const siteWindowAddressClass = "min-w-0 flex-1 truncate text-center font-mono text-xs text-foreground-subtle";
|
|
8
|
+
export declare const siteWindowSpacerClass = "w-10 shrink-0";
|
|
9
|
+
/**
|
|
10
|
+
* The page is drawn at twice the card's width and shown at half its size, so it looks as it does on
|
|
11
|
+
* a desktop. It cannot be pressed or reached by the keyboard: the card is a way to edit the page, not the page.
|
|
12
|
+
*/
|
|
13
|
+
export declare const siteWindowViewVariants: (props?: ({
|
|
14
|
+
size?: "sm" | "md" | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
+
/** `sm` draws the page wider still and shows it at a fifth of its size, for a narrow column. */
|
|
17
|
+
export declare const siteWindowFrameVariants: (props?: ({
|
|
18
|
+
size?: "sm" | "md" | null | undefined;
|
|
19
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
20
|
+
export type SiteWindowVariants = VariantProps<typeof siteWindowViewVariants>;
|
|
21
|
+
export declare const siteWindowFootClass = "flex items-center gap-3 border-t border-border px-4 py-3 text-sm";
|
|
22
|
+
export declare const siteWindowMetaClass = "min-w-0 flex-1 truncate text-foreground-muted";
|
|
23
|
+
export declare const siteWindowLinkClass = "shrink-0 font-semibold text-foreground outline-none after:absolute after:inset-0 group-hover:underline";
|
|
24
|
+
//# sourceMappingURL=SiteWindow.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SiteWindow.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/SiteWindow/SiteWindow.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,iHAAiH;AACjH,eAAO,MAAM,eAAe,gPACmN,CAAC;AAChP,eAAO,MAAM,kBAAkB,yFAAyF,CAAC;AACzH,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAC3D,eAAO,MAAM,kBAAkB,8CAA8C,CAAC;AAC9E,eAAO,MAAM,sBAAsB,iFAAiF,CAAC;AACrH,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AACrD;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;8EAGjC,CAAC;AACH,gGAAgG;AAChG,eAAO,MAAM,uBAAuB;;8EAGlC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC7E,eAAO,MAAM,mBAAmB,qEAAqE,CAAC;AACtG,eAAO,MAAM,mBAAmB,kDAAkD,CAAC;AACnF,eAAO,MAAM,mBAAmB,2GAA2G,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
/** `relative`, so the link at its foot can stretch over the whole card and make all of it one thing to press. */
|
|
3
|
+
export const siteWindowClass = 'group relative w-full min-w-0 max-w-xl overflow-hidden rounded-xl border border-border bg-card shadow-xl transition-colors motion-base has-data-hovered:border-border-strong has-data-focus-visible:ring-2 has-data-focus-visible:ring-ring';
|
|
4
|
+
export const siteWindowBarClass = 'flex items-center gap-3 border-b border-border bg-background-secondary px-3.5 py-2.5';
|
|
5
|
+
export const siteWindowDotsClass = 'flex shrink-0 gap-1.5';
|
|
6
|
+
export const siteWindowDotClass = 'h-2.5 w-2.5 rounded-full bg-border-strong';
|
|
7
|
+
export const siteWindowAddressClass = 'min-w-0 flex-1 truncate text-center font-mono text-xs text-foreground-subtle';
|
|
8
|
+
export const siteWindowSpacerClass = 'w-10 shrink-0';
|
|
9
|
+
/**
|
|
10
|
+
* The page is drawn at twice the card's width and shown at half its size, so it looks as it does on
|
|
11
|
+
* a desktop. It cannot be pressed or reached by the keyboard: the card is a way to edit the page, not the page.
|
|
12
|
+
*/
|
|
13
|
+
export const siteWindowViewVariants = cva('relative overflow-hidden bg-background', {
|
|
14
|
+
variants: { size: { md: 'h-72', sm: 'h-40' } },
|
|
15
|
+
defaultVariants: { size: 'md' },
|
|
16
|
+
});
|
|
17
|
+
/** `sm` draws the page wider still and shows it at a fifth of its size, for a narrow column. */
|
|
18
|
+
export const siteWindowFrameVariants = cva('pointer-events-none absolute top-0 left-0 origin-top-left border-0', {
|
|
19
|
+
variants: { size: { md: 'h-144 w-288 scale-50', sm: 'h-200 w-320 scale-20' } },
|
|
20
|
+
defaultVariants: { size: 'md' },
|
|
21
|
+
});
|
|
22
|
+
export const siteWindowFootClass = 'flex items-center gap-3 border-t border-border px-4 py-3 text-sm';
|
|
23
|
+
export const siteWindowMetaClass = 'min-w-0 flex-1 truncate text-foreground-muted';
|
|
24
|
+
export const siteWindowLinkClass = 'shrink-0 font-semibold text-foreground outline-none after:absolute after:inset-0 group-hover:underline';
|
|
25
|
+
//# sourceMappingURL=SiteWindow.variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SiteWindow.variants.js","sourceRoot":"","sources":["../../../src/patterns/SiteWindow/SiteWindow.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,iHAAiH;AACjH,MAAM,CAAC,MAAM,eAAe,GAC1B,6OAA6O,CAAC;AAChP,MAAM,CAAC,MAAM,kBAAkB,GAAG,sFAAsF,CAAC;AACzH,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAC3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,2CAA2C,CAAC;AAC9E,MAAM,CAAC,MAAM,sBAAsB,GAAG,8EAA8E,CAAC;AACrH,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAAC;AACrD;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC,wCAAwC,EAAE;IAClF,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;IAC9C,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;CAChC,CAAC,CAAC;AACH,gGAAgG;AAChG,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC,oEAAoE,EAAE;IAC/G,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,sBAAsB,EAAE,EAAE,EAAE,sBAAsB,EAAE,EAAE;IAC9E,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;CAChC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,kEAAkE,CAAC;AACtG,MAAM,CAAC,MAAM,mBAAmB,GAAG,+CAA+C,CAAC;AACnF,MAAM,CAAC,MAAM,mBAAmB,GAAG,wGAAwG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/SiteWindow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/SiteWindow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface WelcomeProps {
|
|
3
|
+
/** A few words over the title, such as today's date. */
|
|
4
|
+
readonly eyebrow?: string;
|
|
5
|
+
/** The screen's one heading: "Good morning, Dana. 3 drafts are waiting." */
|
|
6
|
+
readonly title: string;
|
|
7
|
+
/** Words inside the title to set apart, such as "3 drafts". Its first appearance is marked. */
|
|
8
|
+
readonly highlight?: string;
|
|
9
|
+
/** One or two sentences under the title. */
|
|
10
|
+
readonly description?: string;
|
|
11
|
+
/** What to do first: one main `Button` and one or two others. */
|
|
12
|
+
readonly actions?: ReactNode;
|
|
13
|
+
/** Beside the words, from a tablet's width up: a `SiteWindow`. A phone leaves it out. */
|
|
14
|
+
readonly aside?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/** The top of a screen that greets the person: what matters now in large words, what to do about it, and the site beside it. */
|
|
17
|
+
export declare function Welcome({ eyebrow, title, highlight, description, actions, aside }: WelcomeProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=Welcome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Welcome.d.ts","sourceRoot":"","sources":["../../../src/patterns/Welcome/Welcome.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAavC,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,+FAA+F;IAC/F,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,4CAA4C;IAC5C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,yFAAyF;IACzF,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;CAC5B;AAeD,gIAAgI;AAChI,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,YAAY,+BAc/F"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { welcomeActionsClass, welcomeAsideClass, welcomeClass, welcomeDescriptionClass, welcomeEyebrowClass, welcomeInnerClass, welcomeMarkClass, welcomeTextClass, welcomeTitleClass, } from './Welcome.variants.js';
|
|
3
|
+
/** The title with the highlighted words marked, where they appear in it. */
|
|
4
|
+
function marked(title, highlight) {
|
|
5
|
+
const at = highlight === undefined || highlight === '' ? -1 : title.indexOf(highlight);
|
|
6
|
+
if (highlight === undefined || at < 0)
|
|
7
|
+
return title;
|
|
8
|
+
return (_jsxs(_Fragment, { children: [title.slice(0, at), _jsx("mark", { className: welcomeMarkClass, children: highlight }), title.slice(at + highlight.length)] }));
|
|
9
|
+
}
|
|
10
|
+
/** The top of a screen that greets the person: what matters now in large words, what to do about it, and the site beside it. */
|
|
11
|
+
export function Welcome({ eyebrow, title, highlight, description, actions, aside }) {
|
|
12
|
+
return (_jsx("section", { className: welcomeClass, children: _jsxs("div", { className: welcomeInnerClass, children: [_jsxs("div", { className: welcomeTextClass, children: [eyebrow !== undefined && _jsx("p", { className: welcomeEyebrowClass, children: eyebrow }), _jsx("h1", { className: welcomeTitleClass, children: marked(title, highlight) }), description !== undefined && _jsx("p", { className: welcomeDescriptionClass, children: description }), actions !== undefined && _jsx("div", { className: welcomeActionsClass, children: actions })] }), aside !== undefined && _jsx("div", { className: welcomeAsideClass, children: aside })] }) }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=Welcome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Welcome.js","sourceRoot":"","sources":["../../../src/patterns/Welcome/Welcome.tsx"],"names":[],"mappings":";AACA,OAAO,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,SAAS,IAAI,cAAK,SAAS,EAAE,iBAAiB,YAAG,KAAK,GAAO,IACpE,GACE,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const welcomeClass = "border-b border-border bg-background bg-grid";
|
|
2
|
+
export declare const welcomeInnerClass = "mx-auto flex max-w-7xl flex-wrap items-center gap-10 px-4 py-8 sm:px-6 md:px-12 md:py-12";
|
|
3
|
+
export declare const welcomeTextClass = "flex min-w-0 flex-1 basis-96 flex-col gap-4";
|
|
4
|
+
export declare const welcomeEyebrowClass = "text-xs font-semibold tracking-widest text-foreground-subtle uppercase";
|
|
5
|
+
export declare const welcomeTitleClass = "max-w-2xl font-display text-4xl font-bold tracking-tight text-balance text-foreground md:text-5xl";
|
|
6
|
+
/** The one phrase that matters on the screen, on the brand's colour: the only orange there. */
|
|
7
|
+
export declare const welcomeMarkClass = "rounded-md bg-brand-fill px-1.5 text-brand-ink box-decoration-clone";
|
|
8
|
+
export declare const welcomeDescriptionClass = "max-w-xl text-lg text-foreground-muted";
|
|
9
|
+
export declare const welcomeActionsClass = "flex flex-wrap gap-2 pt-2";
|
|
10
|
+
/** On a phone the words come first and alone: what stands beside them would push the screen's content far down. */
|
|
11
|
+
export declare const welcomeAsideClass = "hidden min-w-0 flex-1 basis-96 justify-center md:flex lg:justify-end";
|
|
12
|
+
//# sourceMappingURL=Welcome.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Welcome.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/Welcome/Welcome.variants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,iDAAiD,CAAC;AAC3E,eAAO,MAAM,iBAAiB,6FAA6F,CAAC;AAC5H,eAAO,MAAM,gBAAgB,gDAAgD,CAAC;AAC9E,eAAO,MAAM,mBAAmB,2EAA2E,CAAC;AAC5G,eAAO,MAAM,iBAAiB,sGAAsG,CAAC;AACrI,+FAA+F;AAC/F,eAAO,MAAM,gBAAgB,wEAAwE,CAAC;AACtG,eAAO,MAAM,uBAAuB,2CAA2C,CAAC;AAChF,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAC/D,mHAAmH;AACnH,eAAO,MAAM,iBAAiB,yEAAyE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const welcomeClass = 'border-b border-border bg-background bg-grid';
|
|
2
|
+
export const welcomeInnerClass = 'mx-auto flex max-w-7xl flex-wrap items-center gap-10 px-4 py-8 sm:px-6 md:px-12 md:py-12';
|
|
3
|
+
export const welcomeTextClass = 'flex min-w-0 flex-1 basis-96 flex-col gap-4';
|
|
4
|
+
export const welcomeEyebrowClass = 'text-xs font-semibold tracking-widest text-foreground-subtle uppercase';
|
|
5
|
+
export const welcomeTitleClass = 'max-w-2xl font-display text-4xl font-bold tracking-tight text-balance text-foreground md:text-5xl';
|
|
6
|
+
/** The one phrase that matters on the screen, on the brand's colour: the only orange there. */
|
|
7
|
+
export const welcomeMarkClass = 'rounded-md bg-brand-fill px-1.5 text-brand-ink box-decoration-clone';
|
|
8
|
+
export const welcomeDescriptionClass = 'max-w-xl text-lg text-foreground-muted';
|
|
9
|
+
export const welcomeActionsClass = 'flex flex-wrap gap-2 pt-2';
|
|
10
|
+
/** On a phone the words come first and alone: what stands beside them would push the screen's content far down. */
|
|
11
|
+
export const welcomeAsideClass = 'hidden min-w-0 flex-1 basis-96 justify-center md:flex lg:justify-end';
|
|
12
|
+
//# sourceMappingURL=Welcome.variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Welcome.variants.js","sourceRoot":"","sources":["../../../src/patterns/Welcome/Welcome.variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,8CAA8C,CAAC;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,0FAA0F,CAAC;AAC5H,MAAM,CAAC,MAAM,gBAAgB,GAAG,6CAA6C,CAAC;AAC9E,MAAM,CAAC,MAAM,mBAAmB,GAAG,wEAAwE,CAAC;AAC5G,MAAM,CAAC,MAAM,iBAAiB,GAAG,mGAAmG,CAAC;AACrI,+FAA+F;AAC/F,MAAM,CAAC,MAAM,gBAAgB,GAAG,qEAAqE,CAAC;AACtG,MAAM,CAAC,MAAM,uBAAuB,GAAG,wCAAwC,CAAC;AAChF,MAAM,CAAC,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AAC/D,mHAAmH;AACnH,MAAM,CAAC,MAAM,iBAAiB,GAAG,sEAAsE,CAAC"}
|