@nextbridgehq/payload-block-builder 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,393 @@
1
+ /* ── Block Data Field — Payload-native styles ────────────────────────────── */
2
+
3
+ /* Container — mirrors Payload's group/array field outer wrapper */
4
+ .bdf-wrap {
5
+ border: 1px solid var(--theme-elevation-200);
6
+ border-radius: 4px;
7
+ overflow: hidden;
8
+ /* Space between this component and the next native Payload field below */
9
+ margin-bottom: calc(var(--base, 16px) * 0.5);
10
+ }
11
+
12
+ /* Header bar — like Payload's array-field header */
13
+ .bdf-heading {
14
+ display: flex;
15
+ align-items: center;
16
+ padding: 8px 16px;
17
+ background: var(--theme-elevation-50);
18
+ border-bottom: 1px solid var(--theme-elevation-150);
19
+ font-size: 11px;
20
+ font-weight: 600;
21
+ letter-spacing: 0.08em;
22
+ text-transform: uppercase;
23
+ color: var(--theme-elevation-600);
24
+ font-family: var(--font-body);
25
+ user-select: none;
26
+ }
27
+
28
+ /* Body */
29
+ .bdf-body {
30
+ background: var(--theme-elevation-0);
31
+ padding: var(--base, 16px);
32
+ display: flex;
33
+ flex-direction: column;
34
+ gap: calc(var(--base, 16px) * 0.75);
35
+ }
36
+
37
+ /* Per-field wrapper */
38
+ .bdf-field {
39
+ display: flex;
40
+ flex-direction: column;
41
+ }
42
+
43
+ /* Label — exact Payload .field-label */
44
+ .bdf-label {
45
+ display: flex;
46
+ align-items: center;
47
+ padding-bottom: 5px;
48
+ color: var(--theme-elevation-800);
49
+ font-family: var(--font-body);
50
+ font-size: 13px;
51
+ line-height: 20px;
52
+ font-weight: 400;
53
+ }
54
+
55
+ .bdf-required {
56
+ color: var(--theme-error-500, #ef4444);
57
+ margin-left: 3px;
58
+ }
59
+
60
+ /* Input — exact .sbf-input mirror */
61
+ .bdf-input {
62
+ box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
63
+ font-family: var(--font-body);
64
+ width: 100%;
65
+ border: 1px solid var(--theme-elevation-150);
66
+ border-radius: var(--style-radius-s, 4px);
67
+ background: var(--theme-input-bg, var(--theme-elevation-0));
68
+ color: var(--theme-elevation-800);
69
+ font-size: 1rem;
70
+ height: 40px;
71
+ line-height: 20px;
72
+ padding: 8px 15px;
73
+ -webkit-appearance: none;
74
+ transition-property: border, box-shadow, background-color;
75
+ transition-duration: 0.1s, 0.1s, 0.5s;
76
+ transition-timing-function: cubic-bezier(0, 0.2, 0.2, 1);
77
+ box-sizing: border-box;
78
+ }
79
+ .bdf-input:hover:not(:disabled) {
80
+ box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.2);
81
+ border-color: var(--theme-elevation-250);
82
+ }
83
+ .bdf-input:focus {
84
+ border-color: var(--theme-elevation-400);
85
+ outline: 0;
86
+ }
87
+ .bdf-input::placeholder {
88
+ color: var(--theme-elevation-400);
89
+ font-size: 1rem;
90
+ }
91
+
92
+ /* Textarea extends input, auto height */
93
+ .bdf-textarea {
94
+ height: auto;
95
+ min-height: 80px;
96
+ resize: vertical;
97
+ line-height: 1.5;
98
+ }
99
+
100
+ /* Select with caret */
101
+ .bdf-select {
102
+ cursor: pointer;
103
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
104
+ background-repeat: no-repeat;
105
+ background-position: right 12px center;
106
+ padding-right: 32px;
107
+ }
108
+
109
+ /* Monospace (JSON) */
110
+ .bdf-mono {
111
+ font-family: var(--font-mono, 'Courier New', monospace);
112
+ font-size: 0.875rem;
113
+ }
114
+
115
+ /* Checkbox row */
116
+ .bdf-checkbox-row {
117
+ display: flex;
118
+ align-items: center;
119
+ gap: 10px;
120
+ cursor: pointer;
121
+ padding: 4px 0;
122
+ }
123
+ .bdf-checkbox-row input[type='checkbox'] {
124
+ width: 16px;
125
+ height: 16px;
126
+ flex-shrink: 0;
127
+ cursor: pointer;
128
+ accent-color: var(--theme-success-500, #22c55e);
129
+ border: 1px solid var(--theme-elevation-300);
130
+ border-radius: 2px;
131
+ }
132
+ .bdf-checkbox-label {
133
+ font-size: 13px;
134
+ line-height: 20px;
135
+ color: var(--theme-elevation-800);
136
+ font-family: var(--font-body);
137
+ }
138
+
139
+ /* Multiselect / array / group fieldset */
140
+ .bdf-fieldset {
141
+ border: 1px solid var(--theme-elevation-150);
142
+ border-radius: 4px;
143
+ overflow: hidden;
144
+ margin: 0;
145
+ padding: 0;
146
+ }
147
+ .bdf-fieldset__header {
148
+ display: flex;
149
+ align-items: center;
150
+ padding: 6px 12px;
151
+ background: var(--theme-elevation-50);
152
+ border-bottom: 1px solid var(--theme-elevation-100);
153
+ font-size: 13px;
154
+ font-weight: 400;
155
+ color: var(--theme-elevation-800);
156
+ font-family: var(--font-body);
157
+ line-height: 20px;
158
+ }
159
+ .bdf-fieldset__body {
160
+ padding: 12px;
161
+ background: var(--theme-elevation-0);
162
+ display: flex;
163
+ flex-direction: column;
164
+ gap: calc(var(--base, 16px) * 0.75);
165
+ }
166
+
167
+ /* Multiselect option */
168
+ .bdf-multiselect-opt {
169
+ display: flex;
170
+ align-items: center;
171
+ gap: 8px;
172
+ cursor: pointer;
173
+ padding: 3px 0;
174
+ font-size: 13px;
175
+ color: var(--theme-elevation-800);
176
+ font-family: var(--font-body);
177
+ }
178
+ .bdf-multiselect-opt input[type='checkbox'] {
179
+ width: 15px;
180
+ height: 15px;
181
+ flex-shrink: 0;
182
+ accent-color: var(--theme-success-500, #22c55e);
183
+ cursor: pointer;
184
+ }
185
+
186
+ /* Array row */
187
+ .bdf-array-row {
188
+ border: 1px solid var(--theme-elevation-150);
189
+ border-radius: 4px;
190
+ padding: 12px;
191
+ background: var(--theme-elevation-0);
192
+ display: flex;
193
+ flex-direction: column;
194
+ gap: calc(var(--base, 16px) * 0.75);
195
+ }
196
+
197
+ /* Remove row button */
198
+ .bdf-remove-btn {
199
+ display: inline-flex;
200
+ align-items: center;
201
+ gap: 5px;
202
+ padding: 0;
203
+ font-size: 12px;
204
+ color: var(--theme-error-500, #ef4444);
205
+ background: none;
206
+ border: none;
207
+ cursor: pointer;
208
+ font-family: var(--font-body);
209
+ line-height: 20px;
210
+ opacity: 0.8;
211
+ transition: opacity 0.1s;
212
+ }
213
+ .bdf-remove-btn:hover {
214
+ opacity: 1;
215
+ }
216
+
217
+ /* Add row / add item button — mirrors .sbf-add-btn */
218
+ .bdf-add-btn {
219
+ display: inline-flex;
220
+ align-items: center;
221
+ gap: 6px;
222
+ padding: 0;
223
+ background: none;
224
+ border: none;
225
+ cursor: pointer;
226
+ color: var(--theme-elevation-400);
227
+ font-size: 13px;
228
+ font-family: var(--font-body);
229
+ line-height: 24px;
230
+ transition: color 0.1s;
231
+ }
232
+ .bdf-add-btn:hover {
233
+ color: var(--theme-elevation-800);
234
+ }
235
+ .bdf-add-btn__icon {
236
+ display: flex;
237
+ align-items: center;
238
+ justify-content: center;
239
+ width: 22px;
240
+ height: 22px;
241
+ border: 1px solid currentColor;
242
+ border-radius: 50%;
243
+ font-size: 14px;
244
+ font-weight: 600;
245
+ flex-shrink: 0;
246
+ line-height: 1;
247
+ }
248
+
249
+ /* ── Media / Upload picker ───────────────────────────────────────────────── */
250
+
251
+ .bdf-upload-area {
252
+ display: flex;
253
+ flex-direction: column;
254
+ gap: 8px;
255
+ }
256
+
257
+ /* When media is already selected */
258
+ .bdf-upload-selected {
259
+ display: flex;
260
+ align-items: center;
261
+ gap: 10px;
262
+ padding: 6px 8px 6px 6px;
263
+ background: var(--theme-elevation-50);
264
+ border: 1px solid var(--theme-elevation-150);
265
+ border-radius: 4px;
266
+ }
267
+
268
+ .bdf-thumb {
269
+ width: 44px;
270
+ height: 44px;
271
+ object-fit: cover;
272
+ border-radius: 3px;
273
+ background: var(--theme-elevation-100);
274
+ flex-shrink: 0;
275
+ border: 1px solid var(--theme-elevation-150);
276
+ display: block;
277
+ }
278
+
279
+ .bdf-thumb-placeholder {
280
+ width: 44px;
281
+ height: 44px;
282
+ border-radius: 3px;
283
+ background: var(--theme-elevation-100);
284
+ flex-shrink: 0;
285
+ border: 1px solid var(--theme-elevation-150);
286
+ display: flex;
287
+ align-items: center;
288
+ justify-content: center;
289
+ font-size: 18px;
290
+ color: var(--theme-elevation-400);
291
+ }
292
+
293
+ .bdf-upload-name {
294
+ flex: 1;
295
+ font-size: 13px;
296
+ color: var(--theme-elevation-800);
297
+ font-family: var(--font-body);
298
+ white-space: nowrap;
299
+ overflow: hidden;
300
+ text-overflow: ellipsis;
301
+ min-width: 0;
302
+ }
303
+
304
+ .bdf-upload-actions {
305
+ display: flex;
306
+ align-items: center;
307
+ gap: 4px;
308
+ flex-shrink: 0;
309
+ }
310
+
311
+ /* Browse / choose button */
312
+ .bdf-upload-btn {
313
+ display: inline-flex;
314
+ align-items: center;
315
+ gap: 6px;
316
+ height: 40px;
317
+ padding: 0 14px;
318
+ background: var(--theme-elevation-100);
319
+ border: 1px solid var(--theme-elevation-150);
320
+ border-radius: var(--style-radius-s, 4px);
321
+ color: var(--theme-elevation-800);
322
+ font-size: 13px;
323
+ font-family: var(--font-body);
324
+ cursor: pointer;
325
+ transition: background 0.1s, border-color 0.1s;
326
+ white-space: nowrap;
327
+ box-sizing: border-box;
328
+ line-height: 1;
329
+ }
330
+ .bdf-upload-btn:hover {
331
+ background: var(--theme-elevation-150);
332
+ border-color: var(--theme-elevation-250);
333
+ }
334
+
335
+ /* Icon-only button (remove / swap) */
336
+ .bdf-icon-btn {
337
+ display: flex;
338
+ align-items: center;
339
+ justify-content: center;
340
+ width: 26px;
341
+ height: 26px;
342
+ background: transparent;
343
+ border: none;
344
+ border-radius: 4px;
345
+ cursor: pointer;
346
+ color: var(--theme-elevation-500);
347
+ font-size: 12px;
348
+ padding: 0;
349
+ flex-shrink: 0;
350
+ font-family: var(--font-body);
351
+ transition: background 0.1s, color 0.1s;
352
+ line-height: 1;
353
+ }
354
+ .bdf-icon-btn:hover {
355
+ background: var(--theme-elevation-150);
356
+ color: var(--theme-elevation-900);
357
+ }
358
+ .bdf-icon-btn--danger:hover {
359
+ background: var(--theme-error-50, rgba(239, 68, 68, 0.08));
360
+ color: var(--theme-error-500, #ef4444);
361
+ }
362
+
363
+ /* ── States ──────────────────────────────────────────────────────────────── */
364
+
365
+ .bdf-empty {
366
+ padding: calc(var(--base, 16px) * 1.5) var(--base, 16px);
367
+ border: 1px dashed var(--theme-elevation-200);
368
+ border-radius: 4px;
369
+ text-align: center;
370
+ color: var(--theme-elevation-400);
371
+ font-size: 13px;
372
+ font-family: var(--font-body);
373
+ line-height: 20px;
374
+ }
375
+
376
+ .bdf-loading {
377
+ padding: 12px var(--base, 16px);
378
+ color: var(--theme-elevation-400);
379
+ font-size: 13px;
380
+ font-family: var(--font-body);
381
+ }
382
+
383
+ .bdf-error {
384
+ padding: 10px 14px;
385
+ color: var(--theme-error-500, #ef4444);
386
+ font-size: 13px;
387
+ font-family: var(--font-body);
388
+ background: var(--theme-error-50, rgba(239, 68, 68, 0.05));
389
+ border: 1px solid var(--theme-error-100, rgba(239, 68, 68, 0.15));
390
+ border-radius: 4px;
391
+ }
392
+
393
+