@douglasneuroinformatics/libui 2.5.0 → 2.5.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/dist/components/Form/Form.js +1 -1
- package/dist/components/Form/NumberRecordField.d.ts.map +1 -1
- package/dist/components/Form/NumberRecordField.js +1 -1
- package/dist/components/Form/RecordArrayField.d.ts.map +1 -1
- package/dist/components/Form/RecordArrayField.js +1 -1
- package/dist/components/Heading/Heading.js +1 -1
- package/package.json +1 -1
- package/src/components/Form/Form.tsx +5 -1
- package/src/components/Form/NumberRecordField.tsx +3 -1
- package/src/components/Form/RecordArrayField.tsx +3 -1
- package/src/components/Heading/Heading.tsx +1 -1
|
@@ -70,7 +70,7 @@ const Form = ({ className, content, id, initialValues, onError, onSubmit, preven
|
|
|
70
70
|
isGrouped ? (content.map((fieldGroup, i) => {
|
|
71
71
|
return (React.createElement("div", { className: "space-y-6 [&:not(:first-child)]:pt-8", key: i },
|
|
72
72
|
React.createElement("div", { className: "space-y-1" },
|
|
73
|
-
fieldGroup.title && React.createElement(Heading, { variant: "h4" }, fieldGroup.title),
|
|
73
|
+
fieldGroup.title && React.createElement(Heading, { className: "text-base", variant: "h4" }, fieldGroup.title),
|
|
74
74
|
fieldGroup.description && (React.createElement("p", { className: "text-sm italic leading-tight text-muted-foreground" }, fieldGroup.description))),
|
|
75
75
|
React.createElement(FieldsComponent, { errors: errors, fields: fieldGroup.fields, readOnly: readOnly, setErrors: setErrors, setValues: setValues, values: values })));
|
|
76
76
|
})) : (React.createElement(FieldsComponent, { errors: errors, fields: content, readOnly: readOnly, setErrors: setErrors, setValues: setValues, values: values })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberRecordField.d.ts","sourceRoot":"","sources":["../../../src/components/Form/NumberRecordField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAK1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,sBAAsB,GAAG,sBAAsB,IAAI,QAAQ,CACtG,uBAAuB,CAAC,sBAAsB,CAAC,GAAG,qBAAqB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAC/F,CAAC;AAEF,eAAO,MAAM,iBAAiB,+LAS3B,uBAAuB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"NumberRecordField.d.ts","sourceRoot":"","sources":["../../../src/components/Form/NumberRecordField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAK1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,sBAAsB,GAAG,sBAAsB,IAAI,QAAQ,CACtG,uBAAuB,CAAC,sBAAsB,CAAC,GAAG,qBAAqB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAC/F,CAAC;AAEF,eAAO,MAAM,iBAAiB,+LAS3B,uBAAuB,CAAC,CAAC,6BAoC3B,CAAC"}
|
|
@@ -9,7 +9,7 @@ export const NumberRecordField = ({ error: recordError, items, label, options, r
|
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
11
|
return (React.createElement("div", { className: "space-y-4" },
|
|
12
|
-
React.createElement(Heading, { variant: "h5" }, label),
|
|
12
|
+
React.createElement(Heading, { className: "font-medium", variant: "h5" }, label),
|
|
13
13
|
React.createElement("div", { className: "space-y-6" }, Object.keys(items).map((name) => {
|
|
14
14
|
const item = items[name];
|
|
15
15
|
return (React.createElement(NumberField, { error: recordError?.[name], key: name, kind: "number", name: name, options: options, readOnly: readOnly, setError: (error) => setRecordError({ ...recordError, [name]: error }), setValue: (value) => setRecordValue({ ...recordValue, [name]: value }), value: recordValue?.[name], variant: "radio", ...item }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordArrayField.d.ts","sourceRoot":"","sources":["../../../src/components/Form/RecordArrayField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAG7G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAO1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,oBAAoB,CAAC,CAAC;AAEpH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"RecordArrayField.d.ts","sourceRoot":"","sources":["../../../src/components/Form/RecordArrayField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAG7G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAO1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,oBAAoB,CAAC,CAAC;AAEpH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;EAsF3B,CAAC"}
|
|
@@ -24,7 +24,7 @@ export const RecordArrayField = memo(function RecordArrayField({ error: arrayErr
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
return (React.createElement("div", { className: "space-y-4" },
|
|
27
|
-
React.createElement(Heading, { variant: "h5" }, label),
|
|
27
|
+
React.createElement(Heading, { className: "font-medium", variant: "h5" }, label),
|
|
28
28
|
React.createElement("div", { className: "space-y-6" }, arrayValue.map((fields, i) => (React.createElement("div", { className: "space-y-4", key: i },
|
|
29
29
|
React.createElement(Label, { className: "font-semibold italic" }, label + ' ' + (i + 1)),
|
|
30
30
|
Object.keys(fields).map((name) => {
|
|
@@ -11,7 +11,7 @@ export const Heading = ({ children, className, variant }) => {
|
|
|
11
11
|
case 'h4':
|
|
12
12
|
return React.createElement("h4", { className: cn('text-lg font-semibold tracking-tight', className) }, children);
|
|
13
13
|
case 'h5':
|
|
14
|
-
return React.createElement("
|
|
14
|
+
return React.createElement("h5", { className: cn('text-base font-semibold tracking-tight', className) }, children);
|
|
15
15
|
default:
|
|
16
16
|
throw new Error(`Unhandled heading variant: ${variant}`);
|
|
17
17
|
}
|
package/package.json
CHANGED
|
@@ -130,7 +130,11 @@ const Form = <TSchema extends z.ZodType<FormDataType>, TData extends z.TypeOf<TS
|
|
|
130
130
|
return (
|
|
131
131
|
<div className="space-y-6 [&:not(:first-child)]:pt-8" key={i}>
|
|
132
132
|
<div className="space-y-1">
|
|
133
|
-
{fieldGroup.title &&
|
|
133
|
+
{fieldGroup.title && (
|
|
134
|
+
<Heading className="text-base" variant="h4">
|
|
135
|
+
{fieldGroup.title}
|
|
136
|
+
</Heading>
|
|
137
|
+
)}
|
|
134
138
|
{fieldGroup.description && (
|
|
135
139
|
<p className="text-sm italic leading-tight text-muted-foreground">{fieldGroup.description}</p>
|
|
136
140
|
)}
|
|
@@ -36,7 +36,9 @@ export const NumberRecordField = <T extends NumberRecordFieldValue = NumberRecor
|
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
38
|
<div className="space-y-4">
|
|
39
|
-
<Heading variant="h5">
|
|
39
|
+
<Heading className="font-medium" variant="h5">
|
|
40
|
+
{label}
|
|
41
|
+
</Heading>
|
|
40
42
|
<div className="space-y-6">
|
|
41
43
|
{Object.keys(items).map((name) => {
|
|
42
44
|
const item = items[name];
|
|
@@ -48,7 +48,9 @@ export const RecordArrayField = memo(function RecordArrayField({
|
|
|
48
48
|
|
|
49
49
|
return (
|
|
50
50
|
<div className="space-y-4">
|
|
51
|
-
<Heading variant="h5">
|
|
51
|
+
<Heading className="font-medium" variant="h5">
|
|
52
|
+
{label}
|
|
53
|
+
</Heading>
|
|
52
54
|
<div className="space-y-6">
|
|
53
55
|
{arrayValue.map((fields, i) => (
|
|
54
56
|
<div className="space-y-4" key={i}>
|
|
@@ -19,7 +19,7 @@ export const Heading = ({ children, className, variant }: HeadingProps) => {
|
|
|
19
19
|
case 'h4':
|
|
20
20
|
return <h4 className={cn('text-lg font-semibold tracking-tight', className)}>{children}</h4>;
|
|
21
21
|
case 'h5':
|
|
22
|
-
return <
|
|
22
|
+
return <h5 className={cn('text-base font-semibold tracking-tight', className)}>{children}</h5>;
|
|
23
23
|
default:
|
|
24
24
|
throw new Error(`Unhandled heading variant: ${variant satisfies never}`);
|
|
25
25
|
}
|