@factorialco/rjsf-f0 2.2.0 → 2.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 +1 -1
- package/dist/rjsf-f0.cjs.js +2 -2
- package/dist/rjsf-f0.cjs.js.map +1 -1
- package/dist/rjsf-f0.es.js +1 -2
- package/dist/rjsf-f0.es.js.map +1 -1
- package/dist/src/templates/misc-templates.d.ts +6 -4
- package/dist/src/widgets/f0-field.d.ts +7 -5
- package/dist/styles.css +14 -2
- package/package.json +1 -1
|
@@ -5,11 +5,13 @@ export declare function TitleFieldTemplate({ id, title, uiSchema, optionalDataCo
|
|
|
5
5
|
/** Section (object/array level) description. */
|
|
6
6
|
export declare function DescriptionFieldTemplate({ id, description, }: DescriptionFieldProps): React.JSX.Element | null;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Every error message RJSF has for a field, and the only place they render.
|
|
9
9
|
*
|
|
10
|
-
* f0
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* f0 form fields are told they are in an error state but not what to say
|
|
11
|
+
* (`f0-field.tsx`), because half of what this theme renders is not an f0 form
|
|
12
|
+
* field at all — checkboxes, file inputs, the SDK's own fields, and the object
|
|
13
|
+
* and array levels a global form error lands on — and each of those swallowed
|
|
14
|
+
* its message when the control was trusted to show it.
|
|
13
15
|
*/
|
|
14
16
|
export declare function FieldErrorTemplate({ errors, fieldPathId, }: FieldErrorProps): React.JSX.Element | null;
|
|
15
17
|
/** Renders a `ui:help` directive under the control. */
|
|
@@ -3,11 +3,13 @@ import { WidgetProps } from '@rjsf/utils';
|
|
|
3
3
|
/**
|
|
4
4
|
* Shared bridge from an RJSF widget to `F0FormField`.
|
|
5
5
|
*
|
|
6
|
-
* RJSF keeps ownership of validation: the
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* the
|
|
10
|
-
* the control
|
|
6
|
+
* RJSF keeps ownership of validation: the control is told it is in an error
|
|
7
|
+
* state rather than letting f0 (which validates with zod) derive its own, and
|
|
8
|
+
* the messages themselves are rendered by `FieldErrorTemplate`, the one place
|
|
9
|
+
* that also covers the controls f0 does not render. The label is hidden because
|
|
10
|
+
* `FieldTemplate` renders it above the control to support markdown; the
|
|
11
|
+
* plain-text label is still handed to f0 so the control keeps an accessible
|
|
12
|
+
* name.
|
|
11
13
|
*/
|
|
12
14
|
export interface F0FieldBridgeProps extends WidgetProps {
|
|
13
15
|
/** The f0 field descriptor minus the parts derived from the RJSF props. */
|
package/dist/styles.css
CHANGED
|
@@ -135,14 +135,26 @@
|
|
|
135
135
|
margin-top: 0.125rem;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
+
/*
|
|
139
|
+
* Matches what f0 draws under a field in error (`text-base font-medium
|
|
140
|
+
* text-f1-foreground-critical`), minus its icon: this list carries the single
|
|
141
|
+
* message of an ordinary invalid field, not just the rare pile-up, so a marker
|
|
142
|
+
* and its indent would set it apart from every f0 field error on the page.
|
|
143
|
+
*/
|
|
138
144
|
.rjsf-f0-errors {
|
|
139
145
|
margin: 0;
|
|
140
|
-
|
|
141
|
-
|
|
146
|
+
padding-left: 0;
|
|
147
|
+
list-style: none;
|
|
142
148
|
font-size: 0.875rem;
|
|
149
|
+
font-weight: 500;
|
|
143
150
|
color: hsl(var(--critical-70, 3 71% 41%));
|
|
144
151
|
}
|
|
145
152
|
|
|
153
|
+
.rjsf-f0-errors li + li {
|
|
154
|
+
/* f0 `0.5`. */
|
|
155
|
+
margin-top: 0.125rem;
|
|
156
|
+
}
|
|
157
|
+
|
|
146
158
|
.rjsf-f0-object,
|
|
147
159
|
.rjsf-f0-array {
|
|
148
160
|
display: flex;
|
package/package.json
CHANGED