@guard-rail/core 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -3
- package/dist/cli/seed-user.d.ts +1 -0
- package/dist/cli/seed-user.js +105 -0
- package/dist/cli/seed-user.js.map +1 -0
- package/dist/react/Admin.d.ts +6 -1
- package/dist/react/Admin.js +14 -6
- package/dist/react/Admin.js.map +1 -1
- package/dist/react/GRail/client.js +87 -16
- package/dist/react/GRail/client.js.map +1 -1
- package/dist/react/Icons.d.ts +2 -1
- package/dist/react/Icons.js +5 -0
- package/dist/react/Icons.js.map +1 -1
- package/dist/react/MediaPicker.js +3 -3
- package/dist/react/MediaPicker.js.map +1 -1
- package/dist/react/Repeater/client.js +2 -2
- package/dist/react/Repeater/client.js.map +1 -1
- package/dist/react/Team.js +6 -6
- package/dist/react/Team.js.map +1 -1
- package/dist/react/styles.d.ts +104 -30
- package/dist/react/styles.js +154 -65
- package/dist/react/styles.js.map +1 -1
- package/dist/react/useAnchorRect.js +1 -0
- package/dist/react/useAnchorRect.js.map +1 -1
- package/package.json +9 -3
- package/scripts/postinstall.mjs +48 -0
- package/supabase/migrations/20260911000000_guardrail_init.sql +17 -8
package/dist/react/styles.js
CHANGED
|
@@ -1,14 +1,64 @@
|
|
|
1
|
+
const LIGHT = {
|
|
2
|
+
bg: "#ffffff",
|
|
3
|
+
"bg-glass": "rgba(255,255,255,0.97)",
|
|
4
|
+
fg: "#111827",
|
|
5
|
+
fg2: "#4b5563",
|
|
6
|
+
muted: "#6b7280",
|
|
7
|
+
subtle: "#9ca3af",
|
|
8
|
+
border: "#e5e7eb",
|
|
9
|
+
"border-strong": "#d1d5db",
|
|
10
|
+
"border-soft": "#f3f4f6",
|
|
11
|
+
"input-bg": "#ffffff",
|
|
12
|
+
soft: "#f3f4f6",
|
|
13
|
+
accent: "#2563eb",
|
|
14
|
+
"accent-soft": "#eff6ff",
|
|
15
|
+
"accent-text": "#1d4ed8",
|
|
16
|
+
"primary-bg": "#111827",
|
|
17
|
+
"primary-fg": "#ffffff",
|
|
18
|
+
danger: "#dc2626",
|
|
19
|
+
label: "#1e3a8a",
|
|
20
|
+
shadow: "rgba(0,0,0,0.25)"
|
|
21
|
+
};
|
|
22
|
+
const DARK = {
|
|
23
|
+
bg: "#0f1b2d",
|
|
24
|
+
"bg-glass": "rgba(15,27,45,0.97)",
|
|
25
|
+
fg: "#e6edf7",
|
|
26
|
+
fg2: "#b6c4d8",
|
|
27
|
+
muted: "#9fb0c7",
|
|
28
|
+
subtle: "#7d8ea6",
|
|
29
|
+
border: "rgba(148,163,184,0.22)",
|
|
30
|
+
"border-strong": "rgba(148,163,184,0.35)",
|
|
31
|
+
"border-soft": "rgba(148,163,184,0.14)",
|
|
32
|
+
"input-bg": "#14243b",
|
|
33
|
+
soft: "#1a2d49",
|
|
34
|
+
accent: "#3b82f6",
|
|
35
|
+
"accent-soft": "rgba(59,130,246,0.16)",
|
|
36
|
+
"accent-text": "#93c5fd",
|
|
37
|
+
"primary-bg": "#3b82f6",
|
|
38
|
+
"primary-fg": "#ffffff",
|
|
39
|
+
danger: "#f87171",
|
|
40
|
+
label: "#dbeafe",
|
|
41
|
+
shadow: "rgba(0,0,0,0.5)"
|
|
42
|
+
};
|
|
43
|
+
const v = (name) => `var(--gr-${name}, ${LIGHT[name]})`;
|
|
44
|
+
const declare = (t) => Object.entries(t).map(([k, val]) => `--gr-${k}: ${val};`).join(" ");
|
|
45
|
+
const THEME_CSS = `:root { ${declare(LIGHT)} }
|
|
46
|
+
[data-guardrail] { color-scheme: light; }
|
|
47
|
+
@media (prefers-color-scheme: dark) {
|
|
48
|
+
:root { ${declare(DARK)} }
|
|
49
|
+
[data-guardrail] { color-scheme: dark; }
|
|
50
|
+
}`;
|
|
1
51
|
const S = {
|
|
2
52
|
banner: {
|
|
3
53
|
position: "fixed",
|
|
4
54
|
bottom: 0,
|
|
5
55
|
left: 0,
|
|
6
56
|
width: "100%",
|
|
7
|
-
background: "
|
|
8
|
-
color: "
|
|
57
|
+
background: v("bg"),
|
|
58
|
+
color: v("fg"),
|
|
9
59
|
padding: "12px 16px",
|
|
10
60
|
zIndex: 1e4,
|
|
11
|
-
borderTop:
|
|
61
|
+
borderTop: `1px solid ${v("border")}`,
|
|
12
62
|
fontFamily: "system-ui, -apple-system, sans-serif"
|
|
13
63
|
},
|
|
14
64
|
bannerForm: {
|
|
@@ -33,19 +83,19 @@ const S = {
|
|
|
33
83
|
alignItems: "flex-start",
|
|
34
84
|
gap: 2
|
|
35
85
|
},
|
|
36
|
-
error: { color: "
|
|
86
|
+
error: { color: v("danger"), fontSize: 12, fontWeight: 700 },
|
|
37
87
|
input: {
|
|
38
|
-
border:
|
|
88
|
+
border: `1px solid ${v("border-strong")}`,
|
|
39
89
|
borderRadius: 4,
|
|
40
90
|
padding: "6px 8px",
|
|
41
91
|
fontSize: 13,
|
|
42
|
-
color: "
|
|
43
|
-
background: "
|
|
92
|
+
color: v("fg"),
|
|
93
|
+
background: v("input-bg"),
|
|
44
94
|
outline: "none"
|
|
45
95
|
},
|
|
46
96
|
primaryBtn: {
|
|
47
|
-
background: "
|
|
48
|
-
color: "
|
|
97
|
+
background: v("primary-bg"),
|
|
98
|
+
color: v("primary-fg"),
|
|
49
99
|
padding: "7px 16px",
|
|
50
100
|
borderRadius: 4,
|
|
51
101
|
fontSize: 12,
|
|
@@ -59,16 +109,16 @@ const S = {
|
|
|
59
109
|
left: "50%",
|
|
60
110
|
transform: "translateX(-50%)",
|
|
61
111
|
zIndex: 9999,
|
|
62
|
-
background: "
|
|
112
|
+
background: v("bg-glass"),
|
|
63
113
|
backdropFilter: "blur(8px)",
|
|
64
|
-
color: "
|
|
114
|
+
color: v("fg"),
|
|
65
115
|
padding: "12px 20px",
|
|
66
116
|
borderRadius: 9999,
|
|
67
|
-
boxShadow:
|
|
117
|
+
boxShadow: `0 20px 40px ${v("shadow")}`,
|
|
68
118
|
display: "flex",
|
|
69
119
|
alignItems: "center",
|
|
70
120
|
gap: 20,
|
|
71
|
-
border:
|
|
121
|
+
border: `1px solid ${v("border")}`,
|
|
72
122
|
fontFamily: "system-ui, -apple-system, sans-serif"
|
|
73
123
|
},
|
|
74
124
|
dot: {
|
|
@@ -76,22 +126,22 @@ const S = {
|
|
|
76
126
|
width: 8,
|
|
77
127
|
height: 8,
|
|
78
128
|
borderRadius: "50%",
|
|
79
|
-
background: "
|
|
129
|
+
background: v("accent")
|
|
80
130
|
},
|
|
81
131
|
toolbarLabel: {
|
|
82
132
|
fontSize: 10,
|
|
83
133
|
fontWeight: 900,
|
|
84
134
|
textTransform: "uppercase",
|
|
85
135
|
letterSpacing: "0.2em",
|
|
86
|
-
color: "
|
|
136
|
+
color: v("label")
|
|
87
137
|
},
|
|
88
|
-
divider: { width: 1, height: 16, background: "
|
|
138
|
+
divider: { width: 1, height: 16, background: v("border-strong") },
|
|
89
139
|
linkBtn: {
|
|
90
140
|
fontSize: 10,
|
|
91
141
|
fontWeight: 700,
|
|
92
142
|
textTransform: "uppercase",
|
|
93
143
|
letterSpacing: "0.15em",
|
|
94
|
-
color: "
|
|
144
|
+
color: v("muted"),
|
|
95
145
|
background: "none",
|
|
96
146
|
border: "none",
|
|
97
147
|
cursor: "pointer"
|
|
@@ -102,11 +152,12 @@ const S = {
|
|
|
102
152
|
left: "50%",
|
|
103
153
|
transform: "translateX(-50%)",
|
|
104
154
|
zIndex: 10001,
|
|
105
|
-
background: "
|
|
155
|
+
background: v("bg"),
|
|
156
|
+
color: v("fg"),
|
|
106
157
|
padding: 16,
|
|
107
158
|
borderRadius: 8,
|
|
108
|
-
boxShadow:
|
|
109
|
-
border:
|
|
159
|
+
boxShadow: `0 20px 40px ${v("shadow")}`,
|
|
160
|
+
border: `1px solid ${v("border")}`,
|
|
110
161
|
minWidth: 300,
|
|
111
162
|
cursor: "default",
|
|
112
163
|
fontFamily: "system-ui, -apple-system, sans-serif"
|
|
@@ -115,17 +166,17 @@ const S = {
|
|
|
115
166
|
display: "block",
|
|
116
167
|
fontSize: 10,
|
|
117
168
|
fontWeight: 700,
|
|
118
|
-
color: "
|
|
169
|
+
color: v("subtle"),
|
|
119
170
|
marginBottom: 4,
|
|
120
171
|
textTransform: "uppercase"
|
|
121
172
|
},
|
|
122
173
|
field: {
|
|
123
|
-
border:
|
|
174
|
+
border: `1px solid ${v("border-strong")}`,
|
|
124
175
|
borderRadius: 4,
|
|
125
176
|
padding: "6px 8px",
|
|
126
177
|
fontSize: 13,
|
|
127
|
-
color: "
|
|
128
|
-
background: "
|
|
178
|
+
color: v("fg"),
|
|
179
|
+
background: v("input-bg"),
|
|
129
180
|
width: "100%",
|
|
130
181
|
marginBottom: 8,
|
|
131
182
|
boxSizing: "border-box"
|
|
@@ -135,11 +186,11 @@ const S = {
|
|
|
135
186
|
gap: 8,
|
|
136
187
|
marginTop: 8,
|
|
137
188
|
paddingTop: 8,
|
|
138
|
-
borderTop:
|
|
189
|
+
borderTop: `1px solid ${v("border-soft")}`
|
|
139
190
|
},
|
|
140
191
|
cancelBtn: {
|
|
141
|
-
background: "
|
|
142
|
-
color: "
|
|
192
|
+
background: v("soft"),
|
|
193
|
+
color: v("fg2"),
|
|
143
194
|
padding: "7px 14px",
|
|
144
195
|
borderRadius: 4,
|
|
145
196
|
fontSize: 12,
|
|
@@ -153,12 +204,13 @@ const S = {
|
|
|
153
204
|
display: "flex",
|
|
154
205
|
alignItems: "center",
|
|
155
206
|
gap: 4,
|
|
156
|
-
background: "
|
|
207
|
+
background: v("bg-glass"),
|
|
208
|
+
color: v("fg"),
|
|
157
209
|
backdropFilter: "blur(8px)",
|
|
158
210
|
padding: 4,
|
|
159
211
|
borderRadius: 8,
|
|
160
|
-
boxShadow:
|
|
161
|
-
border:
|
|
212
|
+
boxShadow: `0 8px 24px ${v("shadow")}`,
|
|
213
|
+
border: `1px solid ${v("border")}`,
|
|
162
214
|
fontFamily: "system-ui, -apple-system, sans-serif"
|
|
163
215
|
},
|
|
164
216
|
anchoredPanel: {
|
|
@@ -166,11 +218,12 @@ const S = {
|
|
|
166
218
|
zIndex: 10001,
|
|
167
219
|
maxHeight: "calc(100vh - 24px)",
|
|
168
220
|
overflowY: "auto",
|
|
169
|
-
background: "
|
|
221
|
+
background: v("bg"),
|
|
222
|
+
color: v("fg"),
|
|
170
223
|
padding: 12,
|
|
171
224
|
borderRadius: 8,
|
|
172
|
-
boxShadow:
|
|
173
|
-
border:
|
|
225
|
+
boxShadow: `0 12px 32px ${v("shadow")}`,
|
|
226
|
+
border: `1px solid ${v("border")}`,
|
|
174
227
|
minWidth: 260,
|
|
175
228
|
maxWidth: "min(340px, calc(100vw - 16px))",
|
|
176
229
|
cursor: "default",
|
|
@@ -185,7 +238,7 @@ const S = {
|
|
|
185
238
|
borderRadius: 6,
|
|
186
239
|
border: "none",
|
|
187
240
|
background: "transparent",
|
|
188
|
-
color: "
|
|
241
|
+
color: v("fg"),
|
|
189
242
|
cursor: "pointer",
|
|
190
243
|
padding: 0
|
|
191
244
|
},
|
|
@@ -197,7 +250,7 @@ const S = {
|
|
|
197
250
|
height: 26,
|
|
198
251
|
borderRadius: 6,
|
|
199
252
|
border: "none",
|
|
200
|
-
background: "
|
|
253
|
+
background: v("accent"),
|
|
201
254
|
color: "#fff",
|
|
202
255
|
cursor: "pointer",
|
|
203
256
|
padding: 0
|
|
@@ -214,10 +267,10 @@ const S = {
|
|
|
214
267
|
right: 0,
|
|
215
268
|
height: "100%",
|
|
216
269
|
width: "min(420px, 100vw)",
|
|
217
|
-
background: "
|
|
218
|
-
color: "
|
|
270
|
+
background: v("bg"),
|
|
271
|
+
color: v("fg"),
|
|
219
272
|
zIndex: 10003,
|
|
220
|
-
boxShadow:
|
|
273
|
+
boxShadow: `-12px 0 32px ${v("shadow")}`,
|
|
221
274
|
display: "flex",
|
|
222
275
|
flexDirection: "column",
|
|
223
276
|
fontFamily: "system-ui, -apple-system, sans-serif"
|
|
@@ -227,7 +280,7 @@ const S = {
|
|
|
227
280
|
alignItems: "center",
|
|
228
281
|
justifyContent: "space-between",
|
|
229
282
|
padding: "16px 20px",
|
|
230
|
-
borderBottom:
|
|
283
|
+
borderBottom: `1px solid ${v("border")}`
|
|
231
284
|
},
|
|
232
285
|
drawerTitle: { fontSize: 14, fontWeight: 800, margin: 0 },
|
|
233
286
|
drawerBody: { padding: 20, overflowY: "auto", flex: 1 },
|
|
@@ -236,7 +289,7 @@ const S = {
|
|
|
236
289
|
alignItems: "center",
|
|
237
290
|
gap: 8,
|
|
238
291
|
padding: "10px 0",
|
|
239
|
-
borderBottom:
|
|
292
|
+
borderBottom: `1px solid ${v("border-soft")}`
|
|
240
293
|
},
|
|
241
294
|
memberEmail: {
|
|
242
295
|
flex: 1,
|
|
@@ -246,12 +299,12 @@ const S = {
|
|
|
246
299
|
whiteSpace: "nowrap"
|
|
247
300
|
},
|
|
248
301
|
select: {
|
|
249
|
-
border:
|
|
302
|
+
border: `1px solid ${v("border-strong")}`,
|
|
250
303
|
borderRadius: 4,
|
|
251
304
|
padding: "4px 6px",
|
|
252
305
|
fontSize: 12,
|
|
253
|
-
background: "
|
|
254
|
-
color: "
|
|
306
|
+
background: v("input-bg"),
|
|
307
|
+
color: v("fg")
|
|
255
308
|
},
|
|
256
309
|
badge: {
|
|
257
310
|
fontSize: 9,
|
|
@@ -268,7 +321,7 @@ const S = {
|
|
|
268
321
|
fontWeight: 800,
|
|
269
322
|
textTransform: "uppercase",
|
|
270
323
|
letterSpacing: "0.15em",
|
|
271
|
-
color: "
|
|
324
|
+
color: v("subtle"),
|
|
272
325
|
margin: "20px 0 8px"
|
|
273
326
|
},
|
|
274
327
|
pickerScrim: {
|
|
@@ -284,11 +337,11 @@ const S = {
|
|
|
284
337
|
transform: "translate(-50%, -50%)",
|
|
285
338
|
width: "min(720px, calc(100vw - 32px))",
|
|
286
339
|
maxHeight: "min(640px, calc(100vh - 32px))",
|
|
287
|
-
background: "
|
|
288
|
-
color: "
|
|
340
|
+
background: v("bg"),
|
|
341
|
+
color: v("fg"),
|
|
289
342
|
borderRadius: 12,
|
|
290
343
|
zIndex: 10011,
|
|
291
|
-
boxShadow:
|
|
344
|
+
boxShadow: `0 24px 64px ${v("shadow")}`,
|
|
292
345
|
display: "flex",
|
|
293
346
|
flexDirection: "column",
|
|
294
347
|
overflow: "hidden",
|
|
@@ -305,11 +358,11 @@ const S = {
|
|
|
305
358
|
borderRadius: 8,
|
|
306
359
|
overflow: "hidden",
|
|
307
360
|
border: "2px solid transparent",
|
|
308
|
-
background: "
|
|
361
|
+
background: v("soft"),
|
|
309
362
|
cursor: "pointer",
|
|
310
363
|
padding: 0
|
|
311
364
|
},
|
|
312
|
-
pickerTileActive: { borderColor: "
|
|
365
|
+
pickerTileActive: { borderColor: v("accent") },
|
|
313
366
|
pickerThumb: {
|
|
314
367
|
width: "100%",
|
|
315
368
|
height: "100%",
|
|
@@ -317,19 +370,19 @@ const S = {
|
|
|
317
370
|
display: "block"
|
|
318
371
|
},
|
|
319
372
|
dropzone: {
|
|
320
|
-
border:
|
|
373
|
+
border: `1.5px dashed ${v("border-strong")}`,
|
|
321
374
|
borderRadius: 8,
|
|
322
375
|
padding: 16,
|
|
323
376
|
textAlign: "center",
|
|
324
377
|
fontSize: 13,
|
|
325
|
-
color: "
|
|
378
|
+
color: v("muted"),
|
|
326
379
|
marginBottom: 14,
|
|
327
380
|
cursor: "pointer"
|
|
328
381
|
},
|
|
329
382
|
dropzoneActive: {
|
|
330
|
-
borderColor: "
|
|
331
|
-
background: "
|
|
332
|
-
color: "
|
|
383
|
+
borderColor: v("accent"),
|
|
384
|
+
background: v("accent-soft"),
|
|
385
|
+
color: v("accent-text")
|
|
333
386
|
},
|
|
334
387
|
previewThumb: {
|
|
335
388
|
// maxWidth also caps what the image contributes to the panel's width. The
|
|
@@ -340,14 +393,14 @@ const S = {
|
|
|
340
393
|
height: "auto",
|
|
341
394
|
maxHeight: 200,
|
|
342
395
|
objectFit: "contain",
|
|
343
|
-
background: "
|
|
396
|
+
background: v("soft"),
|
|
344
397
|
borderRadius: 6,
|
|
345
398
|
display: "block",
|
|
346
399
|
marginBottom: 8
|
|
347
400
|
},
|
|
348
401
|
secondaryBtn: {
|
|
349
|
-
background: "
|
|
350
|
-
color: "
|
|
402
|
+
background: v("soft"),
|
|
403
|
+
color: v("fg"),
|
|
351
404
|
padding: "7px 12px",
|
|
352
405
|
borderRadius: 4,
|
|
353
406
|
fontSize: 12,
|
|
@@ -357,6 +410,38 @@ const S = {
|
|
|
357
410
|
width: "100%",
|
|
358
411
|
marginBottom: 10
|
|
359
412
|
},
|
|
413
|
+
/**
|
|
414
|
+
* Edit affordance for image fields, drawn as separate fixed elements instead
|
|
415
|
+
* of styling the <img> itself. Backgrounds (next/image `fill` behind
|
|
416
|
+
* overlaid content) can't take an in-place affordance: it either sits under
|
|
417
|
+
* the content and can't be clicked, or gets lifted over it and hides it.
|
|
418
|
+
* The outline ignores the pointer so overlaid content stays interactive;
|
|
419
|
+
* the handle is the one clickable piece.
|
|
420
|
+
*/
|
|
421
|
+
markerOutline: {
|
|
422
|
+
position: "fixed",
|
|
423
|
+
zIndex: 9990,
|
|
424
|
+
pointerEvents: "none",
|
|
425
|
+
boxSizing: "border-box",
|
|
426
|
+
borderRadius: 2
|
|
427
|
+
},
|
|
428
|
+
markerHandle: {
|
|
429
|
+
position: "fixed",
|
|
430
|
+
zIndex: 9991,
|
|
431
|
+
display: "inline-flex",
|
|
432
|
+
alignItems: "center",
|
|
433
|
+
gap: 5,
|
|
434
|
+
padding: "4px 9px 4px 7px",
|
|
435
|
+
borderRadius: 6,
|
|
436
|
+
border: "none",
|
|
437
|
+
background: v("accent"),
|
|
438
|
+
color: "#fff",
|
|
439
|
+
fontSize: 11,
|
|
440
|
+
fontWeight: 700,
|
|
441
|
+
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
442
|
+
cursor: "pointer",
|
|
443
|
+
boxShadow: `0 4px 12px ${v("shadow")}`
|
|
444
|
+
},
|
|
360
445
|
repeaterItem: {
|
|
361
446
|
position: "relative",
|
|
362
447
|
outline: "1px dashed #60a5fa",
|
|
@@ -369,11 +454,13 @@ const S = {
|
|
|
369
454
|
zIndex: 20,
|
|
370
455
|
display: "flex",
|
|
371
456
|
gap: 2,
|
|
372
|
-
background: "
|
|
457
|
+
background: v("bg-glass"),
|
|
458
|
+
color: v("fg"),
|
|
373
459
|
backdropFilter: "blur(6px)",
|
|
374
460
|
padding: 3,
|
|
375
461
|
borderRadius: 6,
|
|
376
|
-
boxShadow:
|
|
462
|
+
boxShadow: `0 4px 12px ${v("shadow")}`,
|
|
463
|
+
border: `1px solid ${v("border")}`
|
|
377
464
|
},
|
|
378
465
|
repeaterAddRow: {
|
|
379
466
|
display: "flex",
|
|
@@ -388,24 +475,26 @@ const S = {
|
|
|
388
475
|
gap: 6,
|
|
389
476
|
padding: "8px 14px",
|
|
390
477
|
borderRadius: 6,
|
|
391
|
-
border:
|
|
478
|
+
border: `1.5px dashed ${v("accent")}`,
|
|
392
479
|
background: "transparent",
|
|
393
|
-
color: "
|
|
480
|
+
color: v("accent"),
|
|
394
481
|
fontSize: 12,
|
|
395
482
|
fontWeight: 700,
|
|
396
483
|
cursor: "pointer"
|
|
397
484
|
},
|
|
398
485
|
repeaterSlugInput: {
|
|
399
|
-
border:
|
|
486
|
+
border: `1px solid ${v("border-strong")}`,
|
|
400
487
|
borderRadius: 4,
|
|
401
488
|
padding: "7px 9px",
|
|
402
489
|
fontSize: 13,
|
|
403
|
-
color: "
|
|
404
|
-
background: "
|
|
490
|
+
color: v("fg"),
|
|
491
|
+
background: v("input-bg"),
|
|
405
492
|
minWidth: 180
|
|
406
493
|
}
|
|
407
494
|
};
|
|
408
495
|
export {
|
|
409
|
-
S
|
|
496
|
+
S,
|
|
497
|
+
THEME_CSS,
|
|
498
|
+
v
|
|
410
499
|
};
|
|
411
500
|
//# sourceMappingURL=styles.js.map
|
package/dist/react/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/styles.ts"],"sourcesContent":["import type { CSSProperties } from \"react\";\n\n/**\n * Guardrail's own chrome is styled with inline styles on purpose. Utility\n * classes would make the package depend on the consumer having Tailwind *and*\n * adding node_modules/guardrail to their content globs — it would render\n * unstyled on a clean install. Developer-authored content is never touched.\n */\nexport const S = {\n banner: {\n position: \"fixed\",\n bottom: 0,\n left: 0,\n width: \"100%\",\n background: \"#fff\",\n color: \"#000\",\n padding: \"12px 16px\",\n zIndex: 10000,\n borderTop: \"1px solid #e5e7eb\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n bannerForm: {\n display: \"flex\",\n gap: 12,\n justifyContent: \"center\",\n alignItems: \"center\",\n flexWrap: \"wrap\",\n },\n brand: {\n fontWeight: 900,\n letterSpacing: \"0.15em\",\n fontSize: 12,\n textTransform: \"uppercase\",\n },\n /** Brand plus any status/error text under it, stacked instead of sharing\n * the form's row — otherwise a login error reads as if it's labeling the\n * next field over, not feedback about the brand's own sign-in attempt. */\n brandStack: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: 2,\n },\n error: { color: \"#dc2626\", fontSize: 12, fontWeight: 700 },\n input: {\n border: \"1px solid #d1d5db\",\n borderRadius: 4,\n padding: \"6px 8px\",\n fontSize: 13,\n color: \"#000\",\n background: \"#fff\",\n outline: \"none\",\n },\n primaryBtn: {\n background: \"#111827\",\n color: \"#fff\",\n padding: \"7px 16px\",\n borderRadius: 4,\n fontSize: 12,\n fontWeight: 700,\n border: \"none\",\n cursor: \"pointer\",\n },\n toolbar: {\n position: \"fixed\",\n bottom: 24,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n zIndex: 9999,\n background: \"rgba(17,24,39,0.95)\",\n backdropFilter: \"blur(8px)\",\n color: \"#fff\",\n padding: \"12px 20px\",\n borderRadius: 9999,\n boxShadow: \"0 20px 40px rgba(0,0,0,0.35)\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 20,\n border: \"1px solid rgba(255,255,255,0.1)\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n dot: {\n display: \"inline-block\",\n width: 8,\n height: 8,\n borderRadius: \"50%\",\n background: \"#3b82f6\",\n },\n toolbarLabel: {\n fontSize: 10,\n fontWeight: 900,\n textTransform: \"uppercase\",\n letterSpacing: \"0.2em\",\n color: \"#dbeafe\",\n },\n divider: { width: 1, height: 16, background: \"rgba(255,255,255,0.2)\" },\n linkBtn: {\n fontSize: 10,\n fontWeight: 700,\n textTransform: \"uppercase\",\n letterSpacing: \"0.15em\",\n color: \"#9ca3af\",\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n },\n popover: {\n position: \"fixed\",\n bottom: 90,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n zIndex: 10001,\n background: \"#fff\",\n padding: 16,\n borderRadius: 8,\n boxShadow: \"0 20px 40px rgba(0,0,0,0.25)\",\n border: \"1px solid #e5e7eb\",\n minWidth: 300,\n cursor: \"default\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n label: {\n display: \"block\",\n fontSize: 10,\n fontWeight: 700,\n color: \"#9ca3af\",\n marginBottom: 4,\n textTransform: \"uppercase\",\n },\n field: {\n border: \"1px solid #d1d5db\",\n borderRadius: 4,\n padding: \"6px 8px\",\n fontSize: 13,\n color: \"#000\",\n background: \"#fff\",\n width: \"100%\",\n marginBottom: 8,\n boxSizing: \"border-box\",\n },\n row: {\n display: \"flex\",\n gap: 8,\n marginTop: 8,\n paddingTop: 8,\n borderTop: \"1px solid #f3f4f6\",\n },\n cancelBtn: {\n background: \"#f3f4f6\",\n color: \"#4b5563\",\n padding: \"7px 14px\",\n borderRadius: 4,\n fontSize: 12,\n border: \"none\",\n cursor: \"pointer\",\n },\n\n /** Anchored to the element's rect at runtime; top/left are set inline. */\n anchoredBar: {\n position: \"fixed\",\n zIndex: 10001,\n display: \"flex\",\n alignItems: \"center\",\n gap: 4,\n background: \"rgba(17,24,39,0.97)\",\n backdropFilter: \"blur(8px)\",\n padding: 4,\n borderRadius: 8,\n boxShadow: \"0 8px 24px rgba(0,0,0,0.3)\",\n border: \"1px solid rgba(255,255,255,0.12)\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n anchoredPanel: {\n position: \"fixed\",\n zIndex: 10001,\n maxHeight: \"calc(100vh - 24px)\",\n overflowY: \"auto\",\n background: \"#fff\",\n padding: 12,\n borderRadius: 8,\n boxShadow: \"0 12px 32px rgba(0,0,0,0.25)\",\n border: \"1px solid #e5e7eb\",\n minWidth: 260,\n maxWidth: \"min(340px, calc(100vw - 16px))\",\n cursor: \"default\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n iconBtn: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 26,\n height: 26,\n borderRadius: 6,\n border: \"none\",\n background: \"transparent\",\n color: \"#e5e7eb\",\n cursor: \"pointer\",\n padding: 0,\n },\n iconBtnPrimary: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 26,\n height: 26,\n borderRadius: 6,\n border: \"none\",\n background: \"#2563eb\",\n color: \"#fff\",\n cursor: \"pointer\",\n padding: 0,\n },\n\n scrim: {\n position: \"fixed\",\n inset: 0,\n background: \"rgba(0,0,0,0.4)\",\n zIndex: 10002,\n },\n drawer: {\n position: \"fixed\",\n top: 0,\n right: 0,\n height: \"100%\",\n width: \"min(420px, 100vw)\",\n background: \"#fff\",\n color: \"#111827\",\n zIndex: 10003,\n boxShadow: \"-12px 0 32px rgba(0,0,0,0.2)\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n drawerHead: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"16px 20px\",\n borderBottom: \"1px solid #e5e7eb\",\n },\n drawerTitle: { fontSize: 14, fontWeight: 800, margin: 0 },\n drawerBody: { padding: 20, overflowY: \"auto\", flex: 1 },\n memberRow: {\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"10px 0\",\n borderBottom: \"1px solid #f3f4f6\",\n },\n memberEmail: {\n flex: 1,\n fontSize: 13,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n select: {\n border: \"1px solid #d1d5db\",\n borderRadius: 4,\n padding: \"4px 6px\",\n fontSize: 12,\n background: \"#fff\",\n color: \"#111827\",\n },\n badge: {\n fontSize: 9,\n fontWeight: 800,\n textTransform: \"uppercase\",\n letterSpacing: \"0.1em\",\n padding: \"2px 6px\",\n borderRadius: 999,\n background: \"#fef3c7\",\n color: \"#92400e\",\n },\n sectionLabel: {\n fontSize: 10,\n fontWeight: 800,\n textTransform: \"uppercase\",\n letterSpacing: \"0.15em\",\n color: \"#9ca3af\",\n margin: \"20px 0 8px\",\n },\n\n pickerScrim: {\n position: \"fixed\",\n inset: 0,\n background: \"rgba(0,0,0,0.5)\",\n zIndex: 10010,\n },\n picker: {\n position: \"fixed\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: \"min(720px, calc(100vw - 32px))\",\n maxHeight: \"min(640px, calc(100vh - 32px))\",\n background: \"#fff\",\n color: \"#111827\",\n borderRadius: 12,\n zIndex: 10011,\n boxShadow: \"0 24px 64px rgba(0,0,0,0.35)\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n pickerGrid: {\n display: \"grid\",\n gridTemplateColumns: \"repeat(auto-fill, minmax(120px, 1fr))\",\n gap: 10,\n },\n pickerTile: {\n position: \"relative\",\n aspectRatio: \"1\",\n borderRadius: 8,\n overflow: \"hidden\",\n border: \"2px solid transparent\",\n background: \"#f3f4f6\",\n cursor: \"pointer\",\n padding: 0,\n },\n pickerTileActive: { borderColor: \"#2563eb\" },\n pickerThumb: {\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n display: \"block\",\n },\n dropzone: {\n border: \"1.5px dashed #d1d5db\",\n borderRadius: 8,\n padding: 16,\n textAlign: \"center\",\n fontSize: 13,\n color: \"#6b7280\",\n marginBottom: 14,\n cursor: \"pointer\",\n },\n dropzoneActive: {\n borderColor: \"#2563eb\",\n background: \"#eff6ff\",\n color: \"#1d4ed8\",\n },\n previewThumb: {\n // maxWidth also caps what the image contributes to the panel's width. The\n // panel shrink-wraps its content, so an uncapped width: 100% image grew\n // the whole panel to the picture's natural size.\n width: \"100%\",\n maxWidth: 300,\n height: \"auto\",\n maxHeight: 200,\n objectFit: \"contain\",\n background: \"#f3f4f6\",\n borderRadius: 6,\n display: \"block\",\n marginBottom: 8,\n },\n secondaryBtn: {\n background: \"#f3f4f6\",\n color: \"#111827\",\n padding: \"7px 12px\",\n borderRadius: 4,\n fontSize: 12,\n fontWeight: 600,\n border: \"none\",\n cursor: \"pointer\",\n width: \"100%\",\n marginBottom: 10,\n },\n\n repeaterItem: {\n position: \"relative\",\n outline: \"1px dashed #60a5fa\",\n outlineOffset: 2,\n },\n repeaterToolbar: {\n position: \"absolute\",\n top: 4,\n right: 4,\n zIndex: 20,\n display: \"flex\",\n gap: 2,\n background: \"rgba(17,24,39,0.9)\",\n backdropFilter: \"blur(6px)\",\n padding: 3,\n borderRadius: 6,\n boxShadow: \"0 4px 12px rgba(0,0,0,0.25)\",\n },\n repeaterAddRow: {\n display: \"flex\",\n gap: 8,\n alignItems: \"center\",\n marginTop: 8,\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n repeaterAddBtn: {\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"8px 14px\",\n borderRadius: 6,\n border: \"1.5px dashed #93c5fd\",\n background: \"transparent\",\n color: \"#2563eb\",\n fontSize: 12,\n fontWeight: 700,\n cursor: \"pointer\",\n },\n repeaterSlugInput: {\n border: \"1px solid #d1d5db\",\n borderRadius: 4,\n padding: \"7px 9px\",\n fontSize: 13,\n color: \"#000\",\n background: \"#fff\",\n minWidth: 180,\n },\n} satisfies Record<string, CSSProperties>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;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,EACjB;AAAA,EACA,iBAAiB;AAAA,IACf,UAAU;AAAA,IACV,KAAK;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,SAAS;AAAA,IACT,cAAc;AAAA,IACd,WAAW;AAAA,EACb;AAAA,EACA,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EACA,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,KAAK;AAAA,IACL,SAAS;AAAA,IACT,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,QAAQ;AAAA,EACV;AAAA,EACA,mBAAmB;AAAA,IACjB,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,SAAS;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/react/styles.ts"],"sourcesContent":["import type { CSSProperties } from \"react\";\n\n/**\n * Guardrail's own chrome is styled with inline styles on purpose. Utility\n * classes would make the package depend on the consumer having Tailwind *and*\n * adding node_modules/guardrail to their content globs — it would render\n * unstyled on a clean install. Developer-authored content is never touched.\n *\n * Colors are CSS variables so the chrome can follow the visitor's OS light/dark\n * preference — inline styles can't express a media query, but they can read a\n * variable that one defines. THEME_CSS (rendered once by <GRailAdmin>) sets the\n * variables; every use below carries the light value as its fallback, so the\n * chrome still renders correctly if that stylesheet is ever absent.\n */\nconst LIGHT = {\n bg: \"#ffffff\",\n \"bg-glass\": \"rgba(255,255,255,0.97)\",\n fg: \"#111827\",\n fg2: \"#4b5563\",\n muted: \"#6b7280\",\n subtle: \"#9ca3af\",\n border: \"#e5e7eb\",\n \"border-strong\": \"#d1d5db\",\n \"border-soft\": \"#f3f4f6\",\n \"input-bg\": \"#ffffff\",\n soft: \"#f3f4f6\",\n accent: \"#2563eb\",\n \"accent-soft\": \"#eff6ff\",\n \"accent-text\": \"#1d4ed8\",\n \"primary-bg\": \"#111827\",\n \"primary-fg\": \"#ffffff\",\n danger: \"#dc2626\",\n label: \"#1e3a8a\",\n shadow: \"rgba(0,0,0,0.25)\",\n} as const;\n\nconst DARK: Record<keyof typeof LIGHT, string> = {\n bg: \"#0f1b2d\",\n \"bg-glass\": \"rgba(15,27,45,0.97)\",\n fg: \"#e6edf7\",\n fg2: \"#b6c4d8\",\n muted: \"#9fb0c7\",\n subtle: \"#7d8ea6\",\n border: \"rgba(148,163,184,0.22)\",\n \"border-strong\": \"rgba(148,163,184,0.35)\",\n \"border-soft\": \"rgba(148,163,184,0.14)\",\n \"input-bg\": \"#14243b\",\n soft: \"#1a2d49\",\n accent: \"#3b82f6\",\n \"accent-soft\": \"rgba(59,130,246,0.16)\",\n \"accent-text\": \"#93c5fd\",\n \"primary-bg\": \"#3b82f6\",\n \"primary-fg\": \"#ffffff\",\n danger: \"#f87171\",\n label: \"#dbeafe\",\n shadow: \"rgba(0,0,0,0.5)\",\n};\n\n/** A themed color: reads the variable, falls back to the light value. */\nexport const v = (name: keyof typeof LIGHT) => `var(--gr-${name}, ${LIGHT[name]})`;\n\nconst declare = (t: Record<string, string>) =>\n Object.entries(t).map(([k, val]) => `--gr-${k}: ${val};`).join(\" \");\n\n/**\n * Rendered once by <GRailAdmin>. Variables go on :root so portaled chrome\n * inherits them. `color-scheme` is deliberately scoped to Guardrail's own\n * elements, never :root — that would flip the host site's form controls and\n * scrollbars too. It's what makes native controls inside the chrome (the\n * team drawer's role <select>, its dropdown list) match the palette.\n */\nexport const THEME_CSS = `:root { ${declare(LIGHT)} }\n[data-guardrail] { color-scheme: light; }\n@media (prefers-color-scheme: dark) {\n :root { ${declare(DARK)} }\n [data-guardrail] { color-scheme: dark; }\n}`;\n\nexport const S = {\n banner: {\n position: \"fixed\",\n bottom: 0,\n left: 0,\n width: \"100%\",\n background: v(\"bg\"),\n color: v(\"fg\"),\n padding: \"12px 16px\",\n zIndex: 10000,\n borderTop: `1px solid ${v(\"border\")}`,\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n bannerForm: {\n display: \"flex\",\n gap: 12,\n justifyContent: \"center\",\n alignItems: \"center\",\n flexWrap: \"wrap\",\n },\n brand: {\n fontWeight: 900,\n letterSpacing: \"0.15em\",\n fontSize: 12,\n textTransform: \"uppercase\",\n },\n /** Brand plus any status/error text under it, stacked instead of sharing\n * the form's row — otherwise a login error reads as if it's labeling the\n * next field over, not feedback about the brand's own sign-in attempt. */\n brandStack: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: 2,\n },\n error: { color: v(\"danger\"), fontSize: 12, fontWeight: 700 },\n input: {\n border: `1px solid ${v(\"border-strong\")}`,\n borderRadius: 4,\n padding: \"6px 8px\",\n fontSize: 13,\n color: v(\"fg\"),\n background: v(\"input-bg\"),\n outline: \"none\",\n },\n primaryBtn: {\n background: v(\"primary-bg\"),\n color: v(\"primary-fg\"),\n padding: \"7px 16px\",\n borderRadius: 4,\n fontSize: 12,\n fontWeight: 700,\n border: \"none\",\n cursor: \"pointer\",\n },\n toolbar: {\n position: \"fixed\",\n bottom: 24,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n zIndex: 9999,\n background: v(\"bg-glass\"),\n backdropFilter: \"blur(8px)\",\n color: v(\"fg\"),\n padding: \"12px 20px\",\n borderRadius: 9999,\n boxShadow: `0 20px 40px ${v(\"shadow\")}`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 20,\n border: `1px solid ${v(\"border\")}`,\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n dot: {\n display: \"inline-block\",\n width: 8,\n height: 8,\n borderRadius: \"50%\",\n background: v(\"accent\"),\n },\n toolbarLabel: {\n fontSize: 10,\n fontWeight: 900,\n textTransform: \"uppercase\",\n letterSpacing: \"0.2em\",\n color: v(\"label\"),\n },\n divider: { width: 1, height: 16, background: v(\"border-strong\") },\n linkBtn: {\n fontSize: 10,\n fontWeight: 700,\n textTransform: \"uppercase\",\n letterSpacing: \"0.15em\",\n color: v(\"muted\"),\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n },\n popover: {\n position: \"fixed\",\n bottom: 90,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n zIndex: 10001,\n background: v(\"bg\"),\n color: v(\"fg\"),\n padding: 16,\n borderRadius: 8,\n boxShadow: `0 20px 40px ${v(\"shadow\")}`,\n border: `1px solid ${v(\"border\")}`,\n minWidth: 300,\n cursor: \"default\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n label: {\n display: \"block\",\n fontSize: 10,\n fontWeight: 700,\n color: v(\"subtle\"),\n marginBottom: 4,\n textTransform: \"uppercase\",\n },\n field: {\n border: `1px solid ${v(\"border-strong\")}`,\n borderRadius: 4,\n padding: \"6px 8px\",\n fontSize: 13,\n color: v(\"fg\"),\n background: v(\"input-bg\"),\n width: \"100%\",\n marginBottom: 8,\n boxSizing: \"border-box\",\n },\n row: {\n display: \"flex\",\n gap: 8,\n marginTop: 8,\n paddingTop: 8,\n borderTop: `1px solid ${v(\"border-soft\")}`,\n },\n cancelBtn: {\n background: v(\"soft\"),\n color: v(\"fg2\"),\n padding: \"7px 14px\",\n borderRadius: 4,\n fontSize: 12,\n border: \"none\",\n cursor: \"pointer\",\n },\n\n /** Anchored to the element's rect at runtime; top/left are set inline. */\n anchoredBar: {\n position: \"fixed\",\n zIndex: 10001,\n display: \"flex\",\n alignItems: \"center\",\n gap: 4,\n background: v(\"bg-glass\"),\n color: v(\"fg\"),\n backdropFilter: \"blur(8px)\",\n padding: 4,\n borderRadius: 8,\n boxShadow: `0 8px 24px ${v(\"shadow\")}`,\n border: `1px solid ${v(\"border\")}`,\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n anchoredPanel: {\n position: \"fixed\",\n zIndex: 10001,\n maxHeight: \"calc(100vh - 24px)\",\n overflowY: \"auto\",\n background: v(\"bg\"),\n color: v(\"fg\"),\n padding: 12,\n borderRadius: 8,\n boxShadow: `0 12px 32px ${v(\"shadow\")}`,\n border: `1px solid ${v(\"border\")}`,\n minWidth: 260,\n maxWidth: \"min(340px, calc(100vw - 16px))\",\n cursor: \"default\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n iconBtn: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 26,\n height: 26,\n borderRadius: 6,\n border: \"none\",\n background: \"transparent\",\n color: v(\"fg\"),\n cursor: \"pointer\",\n padding: 0,\n },\n iconBtnPrimary: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 26,\n height: 26,\n borderRadius: 6,\n border: \"none\",\n background: v(\"accent\"),\n color: \"#fff\",\n cursor: \"pointer\",\n padding: 0,\n },\n\n scrim: {\n position: \"fixed\",\n inset: 0,\n background: \"rgba(0,0,0,0.4)\",\n zIndex: 10002,\n },\n drawer: {\n position: \"fixed\",\n top: 0,\n right: 0,\n height: \"100%\",\n width: \"min(420px, 100vw)\",\n background: v(\"bg\"),\n color: v(\"fg\"),\n zIndex: 10003,\n boxShadow: `-12px 0 32px ${v(\"shadow\")}`,\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n drawerHead: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"16px 20px\",\n borderBottom: `1px solid ${v(\"border\")}`,\n },\n drawerTitle: { fontSize: 14, fontWeight: 800, margin: 0 },\n drawerBody: { padding: 20, overflowY: \"auto\", flex: 1 },\n memberRow: {\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"10px 0\",\n borderBottom: `1px solid ${v(\"border-soft\")}`,\n },\n memberEmail: {\n flex: 1,\n fontSize: 13,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n select: {\n border: `1px solid ${v(\"border-strong\")}`,\n borderRadius: 4,\n padding: \"4px 6px\",\n fontSize: 12,\n background: v(\"input-bg\"),\n color: v(\"fg\"),\n },\n badge: {\n fontSize: 9,\n fontWeight: 800,\n textTransform: \"uppercase\",\n letterSpacing: \"0.1em\",\n padding: \"2px 6px\",\n borderRadius: 999,\n background: \"#fef3c7\",\n color: \"#92400e\",\n },\n sectionLabel: {\n fontSize: 10,\n fontWeight: 800,\n textTransform: \"uppercase\",\n letterSpacing: \"0.15em\",\n color: v(\"subtle\"),\n margin: \"20px 0 8px\",\n },\n\n pickerScrim: {\n position: \"fixed\",\n inset: 0,\n background: \"rgba(0,0,0,0.5)\",\n zIndex: 10010,\n },\n picker: {\n position: \"fixed\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: \"min(720px, calc(100vw - 32px))\",\n maxHeight: \"min(640px, calc(100vh - 32px))\",\n background: v(\"bg\"),\n color: v(\"fg\"),\n borderRadius: 12,\n zIndex: 10011,\n boxShadow: `0 24px 64px ${v(\"shadow\")}`,\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n pickerGrid: {\n display: \"grid\",\n gridTemplateColumns: \"repeat(auto-fill, minmax(120px, 1fr))\",\n gap: 10,\n },\n pickerTile: {\n position: \"relative\",\n aspectRatio: \"1\",\n borderRadius: 8,\n overflow: \"hidden\",\n border: \"2px solid transparent\",\n background: v(\"soft\"),\n cursor: \"pointer\",\n padding: 0,\n },\n pickerTileActive: { borderColor: v(\"accent\") },\n pickerThumb: {\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n display: \"block\",\n },\n dropzone: {\n border: `1.5px dashed ${v(\"border-strong\")}`,\n borderRadius: 8,\n padding: 16,\n textAlign: \"center\",\n fontSize: 13,\n color: v(\"muted\"),\n marginBottom: 14,\n cursor: \"pointer\",\n },\n dropzoneActive: {\n borderColor: v(\"accent\"),\n background: v(\"accent-soft\"),\n color: v(\"accent-text\"),\n },\n previewThumb: {\n // maxWidth also caps what the image contributes to the panel's width. The\n // panel shrink-wraps its content, so an uncapped width: 100% image grew\n // the whole panel to the picture's natural size.\n width: \"100%\",\n maxWidth: 300,\n height: \"auto\",\n maxHeight: 200,\n objectFit: \"contain\",\n background: v(\"soft\"),\n borderRadius: 6,\n display: \"block\",\n marginBottom: 8,\n },\n secondaryBtn: {\n background: v(\"soft\"),\n color: v(\"fg\"),\n padding: \"7px 12px\",\n borderRadius: 4,\n fontSize: 12,\n fontWeight: 600,\n border: \"none\",\n cursor: \"pointer\",\n width: \"100%\",\n marginBottom: 10,\n },\n\n /**\n * Edit affordance for image fields, drawn as separate fixed elements instead\n * of styling the <img> itself. Backgrounds (next/image `fill` behind\n * overlaid content) can't take an in-place affordance: it either sits under\n * the content and can't be clicked, or gets lifted over it and hides it.\n * The outline ignores the pointer so overlaid content stays interactive;\n * the handle is the one clickable piece.\n */\n markerOutline: {\n position: \"fixed\",\n zIndex: 9990,\n pointerEvents: \"none\",\n boxSizing: \"border-box\",\n borderRadius: 2,\n },\n markerHandle: {\n position: \"fixed\",\n zIndex: 9991,\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 5,\n padding: \"4px 9px 4px 7px\",\n borderRadius: 6,\n border: \"none\",\n background: v(\"accent\"),\n color: \"#fff\",\n fontSize: 11,\n fontWeight: 700,\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n cursor: \"pointer\",\n boxShadow: `0 4px 12px ${v(\"shadow\")}`,\n },\n\n repeaterItem: {\n position: \"relative\",\n outline: \"1px dashed #60a5fa\",\n outlineOffset: 2,\n },\n repeaterToolbar: {\n position: \"absolute\",\n top: 4,\n right: 4,\n zIndex: 20,\n display: \"flex\",\n gap: 2,\n background: v(\"bg-glass\"),\n color: v(\"fg\"),\n backdropFilter: \"blur(6px)\",\n padding: 3,\n borderRadius: 6,\n boxShadow: `0 4px 12px ${v(\"shadow\")}`,\n border: `1px solid ${v(\"border\")}`,\n },\n repeaterAddRow: {\n display: \"flex\",\n gap: 8,\n alignItems: \"center\",\n marginTop: 8,\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n repeaterAddBtn: {\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"8px 14px\",\n borderRadius: 6,\n border: `1.5px dashed ${v(\"accent\")}`,\n background: \"transparent\",\n color: v(\"accent\"),\n fontSize: 12,\n fontWeight: 700,\n cursor: \"pointer\",\n },\n repeaterSlugInput: {\n border: `1px solid ${v(\"border-strong\")}`,\n borderRadius: 4,\n padding: \"7px 9px\",\n fontSize: 13,\n color: v(\"fg\"),\n background: v(\"input-bg\"),\n minWidth: 180,\n },\n} satisfies Record<string, CSSProperties>;\n"],"mappings":"AAcA,MAAM,QAAQ;AAAA,EACZ,IAAI;AAAA,EACJ,YAAY;AAAA,EACZ,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,eAAe;AAAA,EACf,cAAc;AAAA,EACd,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,MAAM,OAA2C;AAAA,EAC/C,IAAI;AAAA,EACJ,YAAY;AAAA,EACZ,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,eAAe;AAAA,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,IACT,YAAY;AAAA,IACZ,KAAK;AAAA,IACL,SAAS;AAAA,IACT,cAAc;AAAA,IACd,QAAQ,gBAAgB,EAAE,QAAQ,CAAC;AAAA,IACnC,YAAY;AAAA,IACZ,OAAO,EAAE,QAAQ;AAAA,IACjB,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,QAAQ;AAAA,EACV;AAAA,EACA,mBAAmB;AAAA,IACjB,QAAQ,aAAa,EAAE,eAAe,CAAC;AAAA,IACvC,cAAc;AAAA,IACd,SAAS;AAAA,IACT,UAAU;AAAA,IACV,OAAO,EAAE,IAAI;AAAA,IACb,YAAY,EAAE,UAAU;AAAA,IACxB,UAAU;AAAA,EACZ;AACF;","names":[]}
|
|
@@ -18,6 +18,7 @@ function useAnchorRect(ref, active) {
|
|
|
18
18
|
window.addEventListener("resize", measure);
|
|
19
19
|
const observer = typeof ResizeObserver !== "undefined" ? new ResizeObserver(measure) : null;
|
|
20
20
|
if (observer && ref.current) observer.observe(ref.current);
|
|
21
|
+
if (observer) observer.observe(document.body);
|
|
21
22
|
return () => {
|
|
22
23
|
window.removeEventListener("scroll", measure, true);
|
|
23
24
|
window.removeEventListener("resize", measure);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/useAnchorRect.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useState, type RefObject } from \"react\";\n\nexport interface AnchorRect {\n top: number;\n left: number;\n bottom: number;\n width: number;\n}\n\n/**\n * Tracks an element's viewport rect so editing chrome can sit against it.\n *\n * Listens on the capture phase so scrolling inside any ancestor container\n * repositions the chrome, not just window scroll.\n */\nexport function useAnchorRect(\n ref: RefObject<HTMLElement | null>,\n active: boolean,\n): AnchorRect | null {\n const [rect, setRect] = useState<AnchorRect | null>(null);\n\n const measure = useCallback(() => {\n const el = ref.current;\n if (!el) return;\n const r = el.getBoundingClientRect();\n setRect({ top: r.top, left: r.left, bottom: r.bottom, width: r.width });\n }, [ref]);\n\n useEffect(() => {\n if (!active) {\n setRect(null);\n return;\n }\n\n measure();\n window.addEventListener(\"scroll\", measure, true);\n window.addEventListener(\"resize\", measure);\n\n // Catches layout shifts from the edit itself (text reflowing the element).\n const observer =\n typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(measure) : null;\n if (observer && ref.current) observer.observe(ref.current);\n\n return () => {\n window.removeEventListener(\"scroll\", measure, true);\n window.removeEventListener(\"resize\", measure);\n observer?.disconnect();\n };\n }, [active, measure, ref]);\n\n return rect;\n}\n"],"mappings":";AAEA,SAAS,aAAa,WAAW,gBAAgC;AAe1D,SAAS,cACd,KACA,QACmB;AACnB,QAAM,CAAC,MAAM,OAAO,IAAI,SAA4B,IAAI;AAExD,QAAM,UAAU,YAAY,MAAM;AAChC,UAAM,KAAK,IAAI;AACf,QAAI,CAAC,GAAI;AACT,UAAM,IAAI,GAAG,sBAAsB;AACnC,YAAQ,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,EAAE,QAAQ,OAAO,EAAE,MAAM,CAAC;AAAA,EACxE,GAAG,CAAC,GAAG,CAAC;AAER,YAAU,MAAM;AACd,QAAI,CAAC,QAAQ;AACX,cAAQ,IAAI;AACZ;AAAA,IACF;AAEA,YAAQ;AACR,WAAO,iBAAiB,UAAU,SAAS,IAAI;AAC/C,WAAO,iBAAiB,UAAU,OAAO;AAGzC,UAAM,WACJ,OAAO,mBAAmB,cAAc,IAAI,eAAe,OAAO,IAAI;AACxE,QAAI,YAAY,IAAI,QAAS,UAAS,QAAQ,IAAI,OAAO;
|
|
1
|
+
{"version":3,"sources":["../../src/react/useAnchorRect.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useState, type RefObject } from \"react\";\n\nexport interface AnchorRect {\n top: number;\n left: number;\n bottom: number;\n width: number;\n}\n\n/**\n * Tracks an element's viewport rect so editing chrome can sit against it.\n *\n * Listens on the capture phase so scrolling inside any ancestor container\n * repositions the chrome, not just window scroll.\n */\nexport function useAnchorRect(\n ref: RefObject<HTMLElement | null>,\n active: boolean,\n): AnchorRect | null {\n const [rect, setRect] = useState<AnchorRect | null>(null);\n\n const measure = useCallback(() => {\n const el = ref.current;\n if (!el) return;\n const r = el.getBoundingClientRect();\n setRect({ top: r.top, left: r.left, bottom: r.bottom, width: r.width });\n }, [ref]);\n\n useEffect(() => {\n if (!active) {\n setRect(null);\n return;\n }\n\n measure();\n window.addEventListener(\"scroll\", measure, true);\n window.addEventListener(\"resize\", measure);\n\n // Catches layout shifts from the edit itself (text reflowing the element).\n const observer =\n typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(measure) : null;\n if (observer && ref.current) observer.observe(ref.current);\n // Content changing size above or beside the element moves it without\n // resizing it, which observing the element alone never sees. The body's\n // own height changes in most of those cases.\n if (observer) observer.observe(document.body);\n\n return () => {\n window.removeEventListener(\"scroll\", measure, true);\n window.removeEventListener(\"resize\", measure);\n observer?.disconnect();\n };\n }, [active, measure, ref]);\n\n return rect;\n}\n"],"mappings":";AAEA,SAAS,aAAa,WAAW,gBAAgC;AAe1D,SAAS,cACd,KACA,QACmB;AACnB,QAAM,CAAC,MAAM,OAAO,IAAI,SAA4B,IAAI;AAExD,QAAM,UAAU,YAAY,MAAM;AAChC,UAAM,KAAK,IAAI;AACf,QAAI,CAAC,GAAI;AACT,UAAM,IAAI,GAAG,sBAAsB;AACnC,YAAQ,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,EAAE,QAAQ,OAAO,EAAE,MAAM,CAAC;AAAA,EACxE,GAAG,CAAC,GAAG,CAAC;AAER,YAAU,MAAM;AACd,QAAI,CAAC,QAAQ;AACX,cAAQ,IAAI;AACZ;AAAA,IACF;AAEA,YAAQ;AACR,WAAO,iBAAiB,UAAU,SAAS,IAAI;AAC/C,WAAO,iBAAiB,UAAU,OAAO;AAGzC,UAAM,WACJ,OAAO,mBAAmB,cAAc,IAAI,eAAe,OAAO,IAAI;AACxE,QAAI,YAAY,IAAI,QAAS,UAAS,QAAQ,IAAI,OAAO;AAIzD,QAAI,SAAU,UAAS,QAAQ,SAAS,IAAI;AAE5C,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,SAAS,IAAI;AAClD,aAAO,oBAAoB,UAAU,OAAO;AAC5C,gBAAU,WAAW;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,QAAQ,SAAS,GAAG,CAAC;AAEzB,SAAO;AACT;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guard-rail/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Lightweight inline content editing for developer-owned Next.js sites.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"type": "module",
|
|
@@ -19,8 +19,12 @@
|
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
21
|
"dist",
|
|
22
|
-
"supabase"
|
|
22
|
+
"supabase",
|
|
23
|
+
"scripts"
|
|
23
24
|
],
|
|
25
|
+
"bin": {
|
|
26
|
+
"guardrail-seed-user": "dist/cli/seed-user.js"
|
|
27
|
+
},
|
|
24
28
|
"publishConfig": {
|
|
25
29
|
"access": "public"
|
|
26
30
|
},
|
|
@@ -29,7 +33,8 @@
|
|
|
29
33
|
"dev": "tsup --watch",
|
|
30
34
|
"typecheck": "tsc --noEmit",
|
|
31
35
|
"prepare": "npm run build",
|
|
32
|
-
"prepublishOnly": "npm run build"
|
|
36
|
+
"prepublishOnly": "npm run build",
|
|
37
|
+
"postinstall": "node scripts/postinstall.mjs"
|
|
33
38
|
},
|
|
34
39
|
"peerDependencies": {
|
|
35
40
|
"@supabase/ssr": "^0.8.0",
|
|
@@ -50,6 +55,7 @@
|
|
|
50
55
|
"@supabase/supabase-js": "^2.93.3",
|
|
51
56
|
"@types/node": "^25.1.0",
|
|
52
57
|
"@types/react": "^19.2.10",
|
|
58
|
+
"@types/react-dom": "^19.3.0",
|
|
53
59
|
"next": "16.1.6",
|
|
54
60
|
"react": "^19.2.4",
|
|
55
61
|
"tsup": "^8.5.1",
|