@factorialco/rjsf-f0 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -1
- package/dist/rjsf-f0.cjs.js +23 -23
- package/dist/rjsf-f0.cjs.js.map +1 -1
- package/dist/rjsf-f0.es.js +3715 -3542
- package/dist/rjsf-f0.es.js.map +1 -1
- package/dist/src/markdown/alert-blockquote.d.ts +18 -0
- package/dist/src/markdown/alert-blockquote.test.d.ts +1 -0
- package/dist/src/theme.d.ts +3 -5
- package/dist/src/widgets/file-widget.d.ts +38 -0
- package/dist/styles.css +357 -26
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from '../../node_modules/@types/react';
|
|
2
|
+
export interface AlertBlockquoteProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
/** f0's own blockquote renderer, used when this is an ordinary quote. */
|
|
5
|
+
fallback?: React.ComponentType<any>;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Renders a GitHub-style alert as an f0-toned callout, and anything else as
|
|
10
|
+
* f0's ordinary blockquote.
|
|
11
|
+
*
|
|
12
|
+
* Deliberately *not* `F0Alert`: its `title` and `description` are plain
|
|
13
|
+
* `string`s, so routing a blockquote through it would flatten the body and
|
|
14
|
+
* silently drop the bold, links, lists and code an author is free to put in a
|
|
15
|
+
* markdown block. The callout below keeps the real markdown children and
|
|
16
|
+
* borrows f0's semantic colour scale instead, so it still flips in dark mode.
|
|
17
|
+
*/
|
|
18
|
+
export declare function AlertBlockquote({ children, fallback: Fallback, node: _node, ...rest }: AlertBlockquoteProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/src/theme.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { FieldTemplate } from './templates/field-template';
|
|
|
3
3
|
import { DescriptionFieldTemplate, ErrorListTemplate, FieldErrorTemplate, FieldHelpTemplate, TitleFieldTemplate, WrapIfAdditionalTemplate } from './templates/misc-templates';
|
|
4
4
|
import { ArrayFieldItemButtonsTemplate, ArrayFieldItemTemplate, ArrayFieldTemplate, GridTemplate, MultiSchemaFieldTemplate, ObjectFieldTemplate } from './templates/layout-templates';
|
|
5
5
|
import { BaseInputTemplate, TextareaWidget } from './widgets/input-widgets';
|
|
6
|
+
import { FileWidget } from './widgets/file-widget';
|
|
6
7
|
import { CheckboxWidget, CheckboxesWidget, RadioWidget, SelectWidget } from './widgets/choice-widgets';
|
|
7
8
|
import { Multistep } from './multistep';
|
|
8
9
|
export declare const Templates: {
|
|
@@ -33,6 +34,7 @@ export declare const Templates: {
|
|
|
33
34
|
export declare const Widgets: {
|
|
34
35
|
CheckboxWidget: typeof CheckboxWidget;
|
|
35
36
|
CheckboxesWidget: typeof CheckboxesWidget;
|
|
37
|
+
FileWidget: typeof FileWidget;
|
|
36
38
|
RadioWidget: typeof RadioWidget;
|
|
37
39
|
SelectWidget: typeof SelectWidget;
|
|
38
40
|
TextareaWidget: typeof TextareaWidget;
|
|
@@ -55,10 +57,6 @@ export declare function generateTheme(): F0RjsfTheme;
|
|
|
55
57
|
* The f0 theme for react-jsonschema-form.
|
|
56
58
|
*
|
|
57
59
|
* Anything not listed in `Templates`/`Widgets` falls through to `@rjsf/core`'s
|
|
58
|
-
* own implementation.
|
|
59
|
-
* this theme's `BaseInputTemplate`, which keeps a native `<input type="file">`
|
|
60
|
-
* for it (see `FileInput` in `widgets/input-widgets.tsx`): the surrounding SDK
|
|
61
|
-
* exchanges uploads as `data:` URLs, and f0's file field is built around an
|
|
62
|
-
* upload hook instead.
|
|
60
|
+
* own implementation.
|
|
63
61
|
*/
|
|
64
62
|
export declare const Theme: F0RjsfTheme;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React } from '../../node_modules/@types/react';
|
|
2
|
+
import { WidgetProps } from '@rjsf/utils';
|
|
3
|
+
/**
|
|
4
|
+
* Bytes as a short human-readable size.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately not `toLocaleString`: that formats against the *browser's*
|
|
7
|
+
* locale, which is exactly the mismatch this widget exists to remove (a form
|
|
8
|
+
* rendered in Spanish must not pick up separators from an English browser).
|
|
9
|
+
* Sizes are rendered with a plain decimal point until a form-level locale is
|
|
10
|
+
* available to this package.
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatFileSize(bytes: number): string;
|
|
13
|
+
/**
|
|
14
|
+
* The f0 file control.
|
|
15
|
+
*
|
|
16
|
+
* Replaces core's `FileWidget`, which renders a bare `<input type="file">`
|
|
17
|
+
* through `BaseInputTemplate`. That input is unfixable by CSS in two ways that
|
|
18
|
+
* both give away a non-native dialog: its "No file chosen" text cannot be
|
|
19
|
+
* removed, and its button label is drawn by the *browser* in the browser's
|
|
20
|
+
* locale — English chrome inside a Spanish form, which no amount of locale
|
|
21
|
+
* propagation on our side can reach.
|
|
22
|
+
*
|
|
23
|
+
* The file/`data:` URL exchange is untouched: `useFileWidgetProps` (core's own
|
|
24
|
+
* hook) still owns reading the `File`, encoding it and accumulating the list,
|
|
25
|
+
* so the value RJSF sees is byte-identical to before.
|
|
26
|
+
*
|
|
27
|
+
* The native input is kept — transparent, stretched over the whole dropzone —
|
|
28
|
+
* rather than hidden behind a JS click handler. It stays the labelled control
|
|
29
|
+
* (`FieldTemplate` renders `<label htmlFor>`), it keeps `accept` as the raw
|
|
30
|
+
* HTML string the schema authored, and click and keyboard stay the platform's.
|
|
31
|
+
*
|
|
32
|
+
* Drag-and-drop is NOT the platform's, and assuming it was is what broke it
|
|
33
|
+
* once: a file input accepts a dropped file by itself only while no handler
|
|
34
|
+
* claims the drag, and the `dragover` handler that highlights the box does
|
|
35
|
+
* exactly that. Highlighting and handling the drop are therefore one decision —
|
|
36
|
+
* see `handleDrop`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function FileWidget(props: WidgetProps): React.JSX.Element;
|
package/dist/styles.css
CHANGED
|
@@ -8,6 +8,53 @@
|
|
|
8
8
|
*
|
|
9
9
|
* There is deliberately no `all: revert` reset here: unlike the SDK's standalone
|
|
10
10
|
* stylesheet, this theme renders inside an app that already owns its styles.
|
|
11
|
+
*
|
|
12
|
+
* ── Colour variables ─────────────────────────────────────────────────────────
|
|
13
|
+
* Read f0's NUMBERED scales — `--neutral-50`, `--critical-70`, `--warning-50` —
|
|
14
|
+
* never an `--f1-*` name. f0 names its semantic tokens `f1-foreground-secondary`
|
|
15
|
+
* and so on, but exposes them as Tailwind classes built ON TOP of the numbered
|
|
16
|
+
* scales; there is no `--f1-foreground-secondary` CSS variable to read. Rules
|
|
17
|
+
* here once did, and because every one carried a fallback they failed silently:
|
|
18
|
+
* `var(--f1-foreground-secondary, inherit)` simply resolved to `inherit`, so
|
|
19
|
+
* "secondary" text was never dimmed and the error colour never applied.
|
|
20
|
+
*
|
|
21
|
+
* The mapping, from f0's `packages/core/src/tokens/colors.ts`:
|
|
22
|
+
*
|
|
23
|
+
* f1-foreground -> --neutral-100
|
|
24
|
+
* f1-foreground-secondary -> --neutral-50
|
|
25
|
+
* f1-foreground-critical -> --critical-70
|
|
26
|
+
* f1-border-secondary -> --neutral-20
|
|
27
|
+
* f1-background-secondary -> --neutral-10
|
|
28
|
+
*
|
|
29
|
+
* Every `var()` below still carries f0's light-mode value as its fallback, for
|
|
30
|
+
* the (unsupported) case of rendering without f0's stylesheet. Keep them: they
|
|
31
|
+
* are the reason a missing variable degrades instead of rendering transparent
|
|
32
|
+
* text — but pick the fallback so the rule still LOOKS right, since a wrong
|
|
33
|
+
* variable name can no longer be spotted by the page looking broken.
|
|
34
|
+
*
|
|
35
|
+
* ── Type scale ───────────────────────────────────────────────────────────────
|
|
36
|
+
* f0 REDEFINES Tailwind's scale, shifted one step down. `text-base` is 14px
|
|
37
|
+
* here, where stock Tailwind makes it 16px. Writing `1rem` for "base" is
|
|
38
|
+
* therefore a step too large, and it is the mistake this file already made
|
|
39
|
+
* once: `.rjsf-f0-label` shipped at `text-lg`, rendering a field label larger
|
|
40
|
+
* than the `###` section heading above it.
|
|
41
|
+
*
|
|
42
|
+
* text-xs 0.625rem / 0.75rem
|
|
43
|
+
* text-sm 0.75rem / 1rem
|
|
44
|
+
* text-base 0.875rem / 1.25rem letter-spacing -0.005em <- body, labels, help
|
|
45
|
+
* text-lg 1rem / 1.5rem letter-spacing -0.01em <- headings
|
|
46
|
+
* text-xl 1.125rem / 1.75rem letter-spacing -0.01em
|
|
47
|
+
* text-2xl 1.375rem / 1.75rem letter-spacing -0.01em
|
|
48
|
+
*
|
|
49
|
+
* Take the line-height with the size — f0 pairs a rem value with each step, not
|
|
50
|
+
* a ratio, so `line-height: 1.5` beside a 14px font is 1px off its step.
|
|
51
|
+
* `letter-spacing` needs no declaring: it inherits, f0's container sets the
|
|
52
|
+
* `text-base` value, and it is only ever wrong on a rule whose size is wrong.
|
|
53
|
+
*
|
|
54
|
+
* The values must stay hardcoded — this package cannot use the classes, because
|
|
55
|
+
* the host's Tailwind `content` globs do not include it and the utilities would
|
|
56
|
+
* arrive inert. They just have to be f0's values. `styles.test.ts` fails on a
|
|
57
|
+
* `font-size` that is not one of the steps above.
|
|
11
58
|
*/
|
|
12
59
|
|
|
13
60
|
/*
|
|
@@ -28,11 +75,23 @@
|
|
|
28
75
|
gap: 0.5rem;
|
|
29
76
|
}
|
|
30
77
|
|
|
78
|
+
/*
|
|
79
|
+
* f0's `label-input`: `text-base font-medium text-f1-foreground-secondary`.
|
|
80
|
+
*
|
|
81
|
+
* This declared `1rem`/`1.5`, which is f0's `text-lg` — a step up, and the
|
|
82
|
+
* whole recipe, so it was written against stock Tailwind where `text-base` is
|
|
83
|
+
* 1rem. It made a field label render LARGER than a `###` section heading above
|
|
84
|
+
* it, which is what flattened the hierarchy on a form.
|
|
85
|
+
*
|
|
86
|
+
* No `letter-spacing` here on purpose: it inherits, f0's container sets
|
|
87
|
+
* `-0.005em`, and at 14px that is already the right value. It was only wrong
|
|
88
|
+
* before because the size was — a 16px label inherited 14px's tracking.
|
|
89
|
+
*/
|
|
31
90
|
.rjsf-f0-label {
|
|
32
|
-
font-size:
|
|
91
|
+
font-size: 0.875rem;
|
|
33
92
|
font-weight: 500;
|
|
34
|
-
line-height: 1.
|
|
35
|
-
color: var(--
|
|
93
|
+
line-height: 1.25rem;
|
|
94
|
+
color: hsl(var(--neutral-50, 217 96% 11% / 0.61));
|
|
36
95
|
}
|
|
37
96
|
|
|
38
97
|
.rjsf-f0-label p,
|
|
@@ -44,7 +103,7 @@
|
|
|
44
103
|
.rjsf-f0-help,
|
|
45
104
|
.rjsf-f0-section-description {
|
|
46
105
|
font-size: 0.875rem;
|
|
47
|
-
color: var(--
|
|
106
|
+
color: hsl(var(--neutral-50, 217 96% 11% / 0.61));
|
|
48
107
|
}
|
|
49
108
|
|
|
50
109
|
/*
|
|
@@ -78,9 +137,10 @@
|
|
|
78
137
|
|
|
79
138
|
.rjsf-f0-errors {
|
|
80
139
|
margin: 0;
|
|
81
|
-
|
|
140
|
+
/* f0 `5`; 1.1rem was not on the spacing scale. Matches the help lists. */
|
|
141
|
+
padding-left: 1.25rem;
|
|
82
142
|
font-size: 0.875rem;
|
|
83
|
-
color: var(--
|
|
143
|
+
color: hsl(var(--critical-70, 3 71% 41%));
|
|
84
144
|
}
|
|
85
145
|
|
|
86
146
|
.rjsf-f0-object,
|
|
@@ -186,26 +246,166 @@
|
|
|
186
246
|
}
|
|
187
247
|
|
|
188
248
|
/*
|
|
189
|
-
* The file
|
|
190
|
-
*
|
|
191
|
-
* gets its box from here rather than from
|
|
192
|
-
* f0
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
249
|
+
* The file control.
|
|
250
|
+
*
|
|
251
|
+
* Unlike every other control this one gets its box from here rather than from
|
|
252
|
+
* f0: f0's file field is driven by an upload hook returning an opaque id, while
|
|
253
|
+
* the SDK exchanges uploads as `data:` URLs and its `accept` is a raw HTML
|
|
254
|
+
* accept string (`.msj`), which f0's `MimeType` allowlist cannot express. So the
|
|
255
|
+
* box is drawn against f0's variables instead — they flip in dark mode, and the
|
|
256
|
+
* fallbacks are the light-mode values for the (unsupported) case of rendering
|
|
257
|
+
* without f0's stylesheet.
|
|
196
258
|
*/
|
|
197
259
|
.rjsf-f0-file {
|
|
260
|
+
display: flex;
|
|
261
|
+
flex-direction: column;
|
|
262
|
+
gap: 0.5rem;
|
|
263
|
+
font-size: 0.875rem;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/*
|
|
267
|
+
* The dropzone stacks the native input on top of the decorative body, so the
|
|
268
|
+
* platform keeps ownership of click, keyboard and drag-and-drop. `isolation`
|
|
269
|
+
* keeps that stacking out of the host app's z-index space.
|
|
270
|
+
*/
|
|
271
|
+
.rjsf-f0-dropzone {
|
|
272
|
+
position: relative;
|
|
273
|
+
isolation: isolate;
|
|
274
|
+
display: flex;
|
|
275
|
+
align-items: center;
|
|
276
|
+
justify-content: center;
|
|
277
|
+
min-height: 6rem;
|
|
278
|
+
padding: 1.25rem 1rem;
|
|
279
|
+
border: 1px dashed hsl(var(--neutral-30, 213 87% 15% / 0.2));
|
|
280
|
+
border-radius: 0.625rem;
|
|
281
|
+
background-color: hsl(var(--neutral-3, 219 88% 17% / 0.02));
|
|
282
|
+
transition:
|
|
283
|
+
border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
|
|
284
|
+
background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.rjsf-f0-dropzone:not([data-disabled]):hover,
|
|
288
|
+
.rjsf-f0-dropzone[data-dragging] {
|
|
289
|
+
border-color: hsl(var(--ring, 184 92% 35%));
|
|
290
|
+
background-color: hsl(var(--neutral-10, 216 89% 18% / 0.06));
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/*
|
|
294
|
+
* Focus is shown by turning the box's own dashed border into a solid accent
|
|
295
|
+
* one, not by drawing a ring outside it.
|
|
296
|
+
*
|
|
297
|
+
* An `outline` with an offset paints beyond the element — the previous rule
|
|
298
|
+
* bled 4px, twice what f0's own fields do (`ring-1`/`ring-2` at
|
|
299
|
+
* `ring-offset-0`/`1`) — and anything painted outside can be clipped by an
|
|
300
|
+
* ancestor that scrolls or hides its overflow, which is what a dialog body is.
|
|
301
|
+
* Recolouring the border cannot be clipped, because it is inside the box.
|
|
302
|
+
*
|
|
303
|
+
* `focus-within`, not `focus-visible`: the input is the first focusable element
|
|
304
|
+
* in a dialog, so it receives focus programmatically when one opens.
|
|
305
|
+
*/
|
|
306
|
+
.rjsf-f0-dropzone:focus-within {
|
|
307
|
+
border-style: solid;
|
|
308
|
+
border-color: hsl(var(--ring, 184 92% 35%));
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/*
|
|
312
|
+
* Stretched over the whole box and transparent — not `display: none`, which
|
|
313
|
+
* would take the control out of the accessibility tree and off the tab order.
|
|
314
|
+
*
|
|
315
|
+
* `-1px`, not `0`: an absolutely positioned box resolves `inset` against its
|
|
316
|
+
* container's *padding* box, so `inset: 0` stopped inside the 1px border and
|
|
317
|
+
* left a dead ring around the perimeter where a click landed on nothing.
|
|
318
|
+
*/
|
|
319
|
+
.rjsf-f0-dropzone-input {
|
|
320
|
+
position: absolute;
|
|
321
|
+
inset: -1px;
|
|
322
|
+
z-index: 1;
|
|
323
|
+
opacity: 0;
|
|
324
|
+
cursor: pointer;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.rjsf-f0-dropzone-input:disabled {
|
|
328
|
+
cursor: default;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.rjsf-f0-dropzone-body {
|
|
332
|
+
display: flex;
|
|
333
|
+
flex-direction: column;
|
|
334
|
+
align-items: center;
|
|
335
|
+
gap: 0.25rem;
|
|
336
|
+
text-align: center;
|
|
337
|
+
color: hsl(var(--neutral-50, 217 96% 11% / 0.61));
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.rjsf-f0-dropzone-text {
|
|
341
|
+
font-weight: 500;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.rjsf-f0-dropzone-hint {
|
|
345
|
+
font-size: 0.75rem;
|
|
346
|
+
opacity: 0.7;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.rjsf-f0-dropzone[data-disabled] .rjsf-f0-dropzone-body {
|
|
350
|
+
opacity: 0.5;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/* The picked files, one f0-styled chip per file. */
|
|
354
|
+
.rjsf-f0-files {
|
|
355
|
+
display: flex;
|
|
356
|
+
flex-direction: column;
|
|
357
|
+
gap: 0.25rem;
|
|
358
|
+
margin: 0;
|
|
359
|
+
padding: 0;
|
|
360
|
+
list-style: none;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.rjsf-f0-file-chip {
|
|
364
|
+
display: flex;
|
|
365
|
+
align-items: center;
|
|
366
|
+
gap: 0.5rem;
|
|
367
|
+
padding: 0.375rem 0.5rem;
|
|
368
|
+
border: 1px solid hsl(var(--neutral-10, 216 89% 18% / 0.06));
|
|
369
|
+
border-radius: 0.625rem;
|
|
370
|
+
background-color: hsl(var(--neutral-3, 219 88% 17% / 0.02));
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/* Long names truncate rather than pushing the remove button out of the row. */
|
|
374
|
+
.rjsf-f0-file-name {
|
|
375
|
+
flex: 1;
|
|
376
|
+
min-width: 0;
|
|
377
|
+
overflow: hidden;
|
|
378
|
+
font-weight: 500;
|
|
379
|
+
text-overflow: ellipsis;
|
|
380
|
+
white-space: nowrap;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.rjsf-f0-file-size {
|
|
384
|
+
flex-shrink: 0;
|
|
385
|
+
color: hsl(var(--neutral-50, 217 96% 11% / 0.61));
|
|
386
|
+
font-variant-numeric: tabular-nums;
|
|
387
|
+
opacity: 0.7;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/*
|
|
391
|
+
* The fallback native input kept by `BaseInputTemplate` for anything still
|
|
392
|
+
* rendering core's `FileWidget`. Its browse button is drawn as an f0 neutral
|
|
393
|
+
* button (md: h-8, 10px radius, 14px/500 text); the "No file chosen" text
|
|
394
|
+
* beside it is browser chrome and cannot be reached from here — which is why
|
|
395
|
+
* the theme's own `FileWidget` above replaces the control outright.
|
|
396
|
+
*/
|
|
397
|
+
.rjsf-f0-native-file {
|
|
198
398
|
font-size: 0.875rem;
|
|
199
|
-
color: var(--
|
|
399
|
+
color: hsl(var(--neutral-50, 217 96% 11% / 0.61));
|
|
200
400
|
}
|
|
201
401
|
|
|
202
|
-
.rjsf-f0-file:focus-visible {
|
|
402
|
+
.rjsf-f0-native-file:focus-visible {
|
|
203
403
|
outline: 2px solid hsl(var(--ring, 184 92% 35%));
|
|
204
404
|
outline-offset: 2px;
|
|
205
405
|
border-radius: 0.625rem;
|
|
206
406
|
}
|
|
207
407
|
|
|
208
|
-
.rjsf-f0-file::file-selector-button {
|
|
408
|
+
.rjsf-f0-native-file::file-selector-button {
|
|
209
409
|
height: 2rem;
|
|
210
410
|
margin-right: 0.75rem;
|
|
211
411
|
padding: 0 1rem;
|
|
@@ -220,19 +420,19 @@
|
|
|
220
420
|
transition: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
|
|
221
421
|
}
|
|
222
422
|
|
|
223
|
-
.rjsf-f0-file:not(:disabled)::file-selector-button:hover {
|
|
423
|
+
.rjsf-f0-native-file:not(:disabled)::file-selector-button:hover {
|
|
224
424
|
background-color: hsl(var(--neutral-20, 214 70% 20% / 0.1));
|
|
225
425
|
}
|
|
226
426
|
|
|
227
|
-
.rjsf-f0-file:disabled::file-selector-button {
|
|
427
|
+
.rjsf-f0-native-file:disabled::file-selector-button {
|
|
228
428
|
background-color: hsl(var(--neutral-3, 219 88% 17% / 0.02));
|
|
229
429
|
color: hsl(var(--neutral-30, 213 87% 15% / 0.2));
|
|
230
430
|
cursor: default;
|
|
231
431
|
}
|
|
232
432
|
|
|
233
433
|
/*
|
|
234
|
-
* The list
|
|
235
|
-
* core's, so it can only be scoped by nesting under the theme's
|
|
434
|
+
* The list core's `FileWidget` renders under that fallback input (its class
|
|
435
|
+
* name is core's, so it can only be scoped by nesting under the theme's row).
|
|
236
436
|
*/
|
|
237
437
|
.rjsf-f0-field .file-info {
|
|
238
438
|
display: flex;
|
|
@@ -401,24 +601,154 @@
|
|
|
401
601
|
display: flex;
|
|
402
602
|
flex-direction: column;
|
|
403
603
|
gap: 0.75rem;
|
|
404
|
-
color: var(--
|
|
604
|
+
color: hsl(var(--neutral-100, 218 48% 10%));
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/*
|
|
608
|
+
* A `markdown.before` / `markdown.after` block and the field it belongs to are
|
|
609
|
+
* siblings inside one `.rjsf-f0-row` — `FieldTemplate` returns them as a
|
|
610
|
+
* fragment and `ObjectFieldTemplate` wraps the lot. That row is a plain block
|
|
611
|
+
* box with no gap of its own, so the two rendered flush against each other: a
|
|
612
|
+
* section heading sat directly on top of the control below it, with the 16px
|
|
613
|
+
* field-to-field gap above it and nothing at all beneath.
|
|
614
|
+
*
|
|
615
|
+
* 8px is f0's label-to-control gap (`gap-2`), used here for the same reason: a
|
|
616
|
+
* `before` block introduces the field under it the way a label introduces its
|
|
617
|
+
* control. What communicates the grouping is the ratio, not the number — 16
|
|
618
|
+
* above against 8 below reads as "this belongs to what follows", where 16/0
|
|
619
|
+
* read as one glued lump.
|
|
620
|
+
*
|
|
621
|
+
* Scoped to `.rjsf-f0-row >` rather than set on the class: the submit result
|
|
622
|
+
* message carries `.fcode-form-markdown` too (`fcode-form.tsx`), and it is not
|
|
623
|
+
* a field row — a margin there would be arbitrary.
|
|
624
|
+
*
|
|
625
|
+
* Margins rather than making the row a flex container with a gap: the row is a
|
|
626
|
+
* flex *item* of `.rjsf-f0-object`, so it establishes a block formatting
|
|
627
|
+
* context and these cannot collapse out of it. Changing the row's layout model
|
|
628
|
+
* would touch every field in every form to fix a rule that applies to few.
|
|
629
|
+
*/
|
|
630
|
+
.rjsf-f0-row > .fcode-form-markdown:first-child {
|
|
631
|
+
margin-bottom: 0.5rem;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.rjsf-f0-row > .fcode-form-markdown:last-child {
|
|
635
|
+
margin-top: 0.5rem;
|
|
405
636
|
}
|
|
406
637
|
|
|
407
638
|
.fcode-form-markdown p {
|
|
408
639
|
margin: 0;
|
|
409
640
|
}
|
|
410
641
|
|
|
642
|
+
/*
|
|
643
|
+
* f0 renders `h1`–`h3` itself; `h4`–`h6` arrive as plain tags (see
|
|
644
|
+
* `markdown/markdown-components.ts` for why they are not given renderers) and
|
|
645
|
+
* get the f0 scale here, continuing below f0's `h3` (`text-base`/600) at
|
|
646
|
+
* `text-sm`. The three used to be identical, which flattened every level past
|
|
647
|
+
* `###` into one — the weight and colour steps below are what separates them,
|
|
648
|
+
* since f0 does not shrink headings past the body size.
|
|
649
|
+
*/
|
|
411
650
|
.fcode-form-markdown h4,
|
|
412
651
|
.fcode-form-markdown h5,
|
|
413
652
|
.fcode-form-markdown h6 {
|
|
414
653
|
margin: 0;
|
|
415
654
|
font-size: 0.875rem;
|
|
655
|
+
/* f0 pairs `text-base` with a 1.25rem line-height, not a 1.5 ratio. */
|
|
656
|
+
line-height: 1.25rem;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
.fcode-form-markdown h4 {
|
|
416
660
|
font-weight: 600;
|
|
417
|
-
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
.fcode-form-markdown h5 {
|
|
664
|
+
font-weight: 500;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.fcode-form-markdown h6 {
|
|
668
|
+
font-weight: 500;
|
|
669
|
+
color: hsl(var(--neutral-50, 217 96% 11% / 0.61));
|
|
418
670
|
}
|
|
419
671
|
|
|
420
672
|
.fcode-form-markdown del {
|
|
421
|
-
color: var(--
|
|
673
|
+
color: hsl(var(--neutral-50, 217 96% 11% / 0.61));
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/*
|
|
677
|
+
* The callout a GitHub alert blockquote (`> [!NOTE]`) renders as.
|
|
678
|
+
*
|
|
679
|
+
* Not `F0Alert`: its `title`/`description` are plain strings, so routing a
|
|
680
|
+
* markdown blockquote through it would flatten the body and drop the bold,
|
|
681
|
+
* links and lists an author may put there. This keeps the real markdown
|
|
682
|
+
* children and borrows f0's semantic colour scale instead — `--<variant>-50`
|
|
683
|
+
* tinted for the surface, `--<variant>-70` for the icon, both of which f0's
|
|
684
|
+
* stylesheet flips in dark mode. The fallbacks are f0's light-mode values, for
|
|
685
|
+
* the (unsupported) case of rendering without that stylesheet.
|
|
686
|
+
*/
|
|
687
|
+
.rjsf-f0-callout {
|
|
688
|
+
display: flex;
|
|
689
|
+
align-items: flex-start;
|
|
690
|
+
gap: 0.625rem;
|
|
691
|
+
padding: 0.75rem;
|
|
692
|
+
border-radius: 0.625rem;
|
|
693
|
+
font-size: 0.875rem;
|
|
694
|
+
/* f0 pairs `text-base` with a 1.25rem line-height, not a 1.5 ratio. */
|
|
695
|
+
line-height: 1.25rem;
|
|
696
|
+
color: hsl(var(--neutral-100, 218 48% 10%));
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
.rjsf-f0-callout-body {
|
|
700
|
+
display: flex;
|
|
701
|
+
min-width: 0;
|
|
702
|
+
flex: 1;
|
|
703
|
+
flex-direction: column;
|
|
704
|
+
gap: 0.5rem;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.rjsf-f0-callout-body > :first-child {
|
|
708
|
+
margin-top: 0;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
.rjsf-f0-callout-body > :last-child {
|
|
712
|
+
margin-bottom: 0;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/* Authored content can carry lists; hosts on Tailwind reset their padding. */
|
|
716
|
+
.rjsf-f0-callout-body ul,
|
|
717
|
+
.rjsf-f0-callout-body ol {
|
|
718
|
+
margin: 0;
|
|
719
|
+
padding-left: 1.25rem;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.rjsf-f0-callout[data-variant='info'] {
|
|
723
|
+
background-color: hsl(var(--info-50, 216 90% 65%) / 0.1);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.rjsf-f0-callout[data-variant='info'] svg {
|
|
727
|
+
color: hsl(var(--info-70, 216 48% 44%));
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.rjsf-f0-callout[data-variant='warning'] {
|
|
731
|
+
background-color: hsl(var(--warning-50, 25 95% 53%) / 0.1);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
.rjsf-f0-callout[data-variant='warning'] svg {
|
|
735
|
+
color: hsl(var(--warning-70, 24 69% 40%));
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
.rjsf-f0-callout[data-variant='critical'] {
|
|
739
|
+
background-color: hsl(var(--critical-50, 5 100% 65%) / 0.1);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
.rjsf-f0-callout[data-variant='critical'] svg {
|
|
743
|
+
color: hsl(var(--critical-70, 3 71% 41%));
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.rjsf-f0-callout[data-variant='positive'] {
|
|
747
|
+
background-color: hsl(var(--positive-50, 160 84% 39%) / 0.1);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
.rjsf-f0-callout[data-variant='positive'] svg {
|
|
751
|
+
color: hsl(var(--positive-70, 161 84% 27%));
|
|
422
752
|
}
|
|
423
753
|
|
|
424
754
|
.fcode-form-markdown img {
|
|
@@ -461,7 +791,8 @@
|
|
|
461
791
|
padding: 0.5rem 0.75rem;
|
|
462
792
|
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
463
793
|
font-size: 0.875rem;
|
|
464
|
-
line-height
|
|
794
|
+
/* f0 pairs `text-base` with a 1.25rem line-height, not a 1.5 ratio. */
|
|
795
|
+
line-height: 1.25rem;
|
|
465
796
|
white-space: pre;
|
|
466
797
|
}
|
|
467
798
|
|
|
@@ -501,7 +832,7 @@
|
|
|
501
832
|
gap: 0.25rem;
|
|
502
833
|
margin-bottom: 1.5rem;
|
|
503
834
|
padding-bottom: 0.5rem;
|
|
504
|
-
border-bottom: 1px solid var(--
|
|
835
|
+
border-bottom: 1px solid hsl(var(--neutral-20, 214 70% 20% / 0.1));
|
|
505
836
|
}
|
|
506
837
|
|
|
507
838
|
/* Wraps to a stacked layout on narrow widths via the main column's min-width. */
|
|
@@ -535,7 +866,7 @@
|
|
|
535
866
|
.rjsf-f0-steps-description {
|
|
536
867
|
margin: 0;
|
|
537
868
|
font-size: 0.875rem;
|
|
538
|
-
color: var(--
|
|
869
|
+
color: hsl(var(--neutral-50, 217 96% 11% / 0.61));
|
|
539
870
|
}
|
|
540
871
|
|
|
541
872
|
/*
|
package/package.json
CHANGED