Skip to content

Conversation

zfarhad
Copy link
Contributor

@zfarhad zfarhad commented Apr 11, 2025

Reasons for making this change

[Please describe them here]

Added a new theme using Mantine UI library (@mantine/core, @mantine/hooks, @mantine/dates) for react-jsonschema-form v6, following the PR #4496 and addressing rjsf-v6.
This theme provides a modern, customizable UI component set that integrates well with RJSF's form generation capabilities.

The Mantine theme offers:

Modern, clean UI components
Built-in dark mode support
Responsive design
Accessible components
Customizable styling through Mantine's theming system

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@zfarhad zfarhad mentioned this pull request Apr 11, 2025
8 tasks
@zfarhad
Copy link
Contributor Author

zfarhad commented Apr 14, 2025

@heath-freenome All requested changes have been applied, please check and let me know if there is anything else

@heath-freenome
Copy link
Member

@zfarhad Can you also fix the build issues

@zfarhad
Copy link
Contributor Author

zfarhad commented Apr 17, 2025

@heath-freenome All the code cleanups applied

I tried to fix the build, but I get this error for all packages, not just mantine:

`
> @rjsf/[email protected] build
> npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd

  > @rjsf/[email protected] build:ts
  > tsc -b tsconfig.build.json && tsc-alias -p tsconfig.build.json
  
  ../utils/src/ErrorSchemaBuilder.ts(43,45): error TS2590: Expression produces a union type that is too complex to represent.
  ../utils/src/getOptionMatchingSimpleDiscriminator.ts(31,25): error TS2339: Property 'type' does not exist on type 'JSONSchema7Definition | {}'.
    Property 'type' does not exist on type 'false'.
  ../utils/src/getOptionMatchingSimpleDiscriminator.ts(31,60): error TS2339: Property 'type' does not exist on type 'JSONSchema7Definition | {}'.
    Property 'type' does not exist on type 'false'.
  ../utils/src/getOptionMatchingSimpleDiscriminator.ts(35,25): error TS2339: Property 'const' does not exist on type 'JSONSchema7Definition | {}'.
    Property 'const' does not exist on type 'false'.
  ../utils/src/getOptionMatchingSimpleDiscriminator.ts(39,25): error TS2339: Property 'enum' does not exist on type 'JSONSchema7Definition | {}'.
    Property 'enum' does not exist on type 'false'.
  ../utils/src/schema/getMatchingOption.ts(50,29): error TS2345: Argument of type '{} | Exclude<NonNullable<S["properties"]>[string], undefined>' is not assignable to parameter of type 'S'.
    'S' could be instantiated with an arbitrary type which could be unrelated to '{} | Exclude<NonNullable<S["properties"]>[string], undefined>'.
  ../utils/src/optionsList.ts(73,15): error TS2322: Type 'NonNullable<S["properties"]>[string] | undefined' is not assignable to type 'S'.
    'S' could be instantiated with an arbitrary type which could be unrelated to 'NonNullable<S["properties"]>[string] | undefined'.
  ../utils/src/schema/getDefaultFormState.ts(444,54): error TS2322: Type 'NonNullable<S["properties"]>[string]' is not assignable to type 'object'.
    Type 'JSONSchema7Definition' is not assignable to type 'object'.
      Type 'boolean' is not assignable to type 'object'.
  ../utils/src/schema/getDefaultFormState.ts(444,54): error TS18048: 'propertySchema' is possibly 'undefined'.
  ../utils/src/schema/getDefaultFormState.ts(446,36): error TS2345: Argument of type 'JSONSchema7Definition | undefined' is not assignable to parameter of type 'JSONSchema7'.
    Type 'undefined' is not assignable to type 'JSONSchema7'.
  ../utils/src/schema/getDefaultFormState.ts(449,69): error TS2345: Argument of type 'NonNullable<S["properties"]>[string] | undefined' is not assignable to parameter of type 'S'.
    'S' could be instantiated with an arbitrary type which could be unrelated to 'NonNullable<S["properties"]>[string] | undefined'.
  ../utils/src/schema/sanitizeDataForNewSchema.ts(96,11): error TS2322: Type '{} | Exclude<NonNullable<S["properties"]>[string], undefined>' is not assignable to type 'S'.
    'S' could be instantiated with an arbitrary type which could be unrelated to '{} | Exclude<NonNullable<S["properties"]>[string], undefined>'.
  ../utils/src/schema/sanitizeDataForNewSchema.ts(97,11): error TS2322: Type '{} | Exclude<NonNullable<(S & { properties: Record<string, unknown> extends S | undefined ? (S | undefined)[never] : unknown; } & { [uniqueSymbol]: unknown; })["properties"]>[string], undefined>' is not assignable to type 'S'.
    'S' could be instantiated with an arbitrary type which could be unrelated to '{} | Exclude<NonNullable<(S & { properties: Record<string, unknown> extends S | undefined ? (S | undefined)[never] : unknown; } & { [uniqueSymbol]: unknown; })["properties"]>[string], undefined>'.
  ../utils/src/schema/toIdSchema.ts(81,9): error TS2345: Argument of type 'NonNullable<S["properties"]>[string] | {} | undefined' is not assignable to parameter of type 'S'.
    'S' could be instantiated with an arbitrary type which could be unrelated to 'NonNullable<S["properties"]>[string] | {} | undefined'.
  ../utils/src/schema/toPathSchema.ts(149,9): error TS2345: Argument of type 'NonNullable<S["properties"]>[string] | undefined' is not assignable to parameter of type 'S'.
    'S' could be instantiated with an arbitrary type which could be unrelated to 'NonNullable<S["properties"]>[string] | undefined'.
  ../validator-ajv8/src/createAjvInstance.ts(4,75): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../validator-ajv8/src/createAjvInstance.ts(43,16): error TS2345: Argument of type 'import("/projects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/ajv").default' is not assignable to parameter of type 'import("/projects/react-jsonschema-form/node_modules/ajv-formats/node_modules/ajv/dist/core").default'.
    Types of property 'opts' are incompatible.
      Type 'import("/projects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/core").InstanceOptions' is not assignable to type 'import("/projects/react-jsonschema-form/node_modules/ajv-formats/node_modules/ajv/dist/core").InstanceOptions'.
        Type 'InstanceOptions' is not assignable to type 'CurrentOptions'.
          Types of property 'keywords' are incompatible.
            Type 'import("/projects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/types/index").Vocabulary | undefined' is not assignable to type 'import("/projects/react-jsonschema-form/node_modules/ajv-formats/node_modules/ajv/dist/types/index").Vocabulary | undefined'.
              Type 'Vocabulary' is not assignable to type '(string | KeywordDefinition)[]'.
                Type 'string | import("/projects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/types/index").KeywordDefinition' is not assignable to type 'string | import("/projects/react-jsonschema-form/node_modules/ajv-formats/node_modules/ajv/dist/types/index").KeywordDefinition'.
                  Type 'CodeKeywordDefinition' is not assignable to type 'string | KeywordDefinition'.
                    Type 'import("/projects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/types/index").CodeKeywordDefinition' is not assignable to type 'import("/projects/react-jsonschema-form/node_modules/ajv-formats/node_modules/ajv/dist/types/index").CodeKeywordDefinition'.
                      Types of property 'code' are incompatible.
                        Type '(cxt: import("/projects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/compile/validate/index").KeywordCxt, ruleType?: string | undefined) => void' is not assignable to type '(cxt: import("/projects/react-jsonschema-form/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index").KeywordCxt, ruleType?: string | undefined) => void'.
                          Types of parameters 'cxt' and 'cxt' are incompatible.
                            Type 'import("/projects/react-jsonschema-form/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index").KeywordCxt' is not assignable to type 'import("/projects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/compile/validate/index").KeywordCxt'.
                              The types of 'gen._scope' are incompatible between these types.
                                Type 'import("/projects/react-jsonschema-form/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope").Scope' is not assignable to type 'import("/projects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/compile/codegen/scope").Scope'.
                                  Property '_names' is protected but type 'Scope' is not a class derived from 'Scope'.
  ../validator-ajv8/src/createAjvInstance.ts(45,16): error TS2345: Argument of type 'import("/projects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/ajv").default' is not assignable to parameter of type 'import("/projects/react-jsonschema-form/node_modules/ajv-formats/node_modules/ajv/dist/core").default'.
  ../validator-ajv8/src/compileSchemaValidatorsCode.ts(2,60): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../validator-ajv8/src/compileSchemaValidatorsCode.ts(31,71): error TS2345: Argument of type '{ code: { source: boolean; es5?: boolean | undefined; esm?: boolean | undefined; lines: boolean; optimize?: number | boolean | undefined; formats?: Code | undefined; process?: ((code: string, schema?: SchemaEnv | undefined) => string) | undefined; regExp?: RegExpEngine | undefined; }; ... 46 more ...; unicode?: bool...' is not assignable to parameter of type 'Options'.
    Type '{ code: { source: boolean; es5?: boolean | undefined; esm?: boolean | undefined; lines: boolean; optimize?: number | boolean | undefined; formats?: Code | undefined; process?: ((code: string, schema?: SchemaEnv | undefined) => string) | undefined; regExp?: RegExpEngine | undefined; }; ... 46 more ...; unicode?: bool...' is not assignable to type 'CurrentOptions'.
      Types of property 'schemas' are incompatible.
        Type 'unknown[]' is not assignable to type 'AnySchema[] | { [x: string]: AnySchema | undefined; } | undefined'.
          Type 'unknown[]' is not assignable to type 'AnySchema[]'.
            Type 'unknown' is not assignable to type 'AnySchema'.
  ../validator-ajv8/src/compileSchemaValidators.ts(2,46): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../validator-ajv8/src/processRawValidationErrors.ts(19,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../validator-ajv8/src/precompiledValidator.ts(19,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../validator-ajv8/src/createPrecompiledValidator.ts(1,78): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../validator-ajv8/src/validator.ts(18,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../validator-ajv8/src/customizeValidator.ts(1,63): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/fields/ArrayField.tsx(20,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/fields/BooleanField.tsx(11,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/fields/BooleanField.tsx(58,17): error TS7006: Parameter 'option' implicitly has an 'any' type.
  ../core/src/components/fields/BooleanField.tsx(62,31): error TS2339: Property 'title' does not exist on type 'object'.
  ../core/src/components/fields/BooleanField.tsx(62,48): error TS2339: Property 'const' does not exist on type 'object'.
  ../core/src/components/fields/LayoutGridField.tsx(26,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/fields/LayoutGridField.tsx(470,38): error TS2322: Type '{ className: any; }' is not assignable to type 'GridProps'.
    Object literal may only specify known properties, and 'className' does not exist in type 'GridProps'.
  ../core/src/components/fields/LayoutGridField.tsx(536,43): error TS18048: 'schema' is possibly 'undefined'.
  ../core/src/components/fields/LayoutGridField.tsx(542,9): error TS2322: Type 'S[[any, string]]' is not assignable to type 'S'.
    'S[[any, string]]' is assignable to the constraint of type 'S', but 'S' could be instantiated with a different subtype of constraint 'StrictRJSFSchema'.
  ../core/src/components/fields/LayoutGridField.tsx(564,39): error TS18048: 'schema' is possibly 'undefined'.
  ../core/src/components/fields/LayoutGridField.tsx(583,65): error TS2339: Property 'required' does not exist on type 'S & ({} | null)'.
    Property 'required' does not exist on type 'S & null'.
  ../core/src/components/fields/LayoutGridField.tsx(583,94): error TS2339: Property 'required' does not exist on type 'S & ({} | null)'.
    Property 'required' does not exist on type 'S & null'.
  ../core/src/components/fields/LayoutGridField.tsx(683,15): error TS2339: Property 'onChange' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(683,25): error TS2339: Property 'errorSchema' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(683,38): error TS2339: Property 'formData' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(704,13): error TS2339: Property 'formData' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(704,23): error TS2339: Property 'registry' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(726,13): error TS2339: Property 'registry' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(726,23): error TS2339: Property 'uiSchema' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(750,13): error TS2339: Property 'registry' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(750,23): error TS2339: Property 'uiSchema' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(779,13): error TS2339: Property 'registry' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(779,23): error TS2339: Property 'uiSchema' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(805,13): error TS2339: Property 'registry' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(805,23): error TS2339: Property 'schema' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(805,42): error TS2339: Property 'formData' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(813,9): error TS2322: Type '{ key: string; schema: any; layoutGridSchema: LayoutGridSchemaType; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<LayoutGridField<T, S, F>> & Pick<Readonly<LayoutGridFieldProps<T, S, F>>, never> & InexactPartial<...> & InexactPartial<...>'.
    Property 'schema' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<LayoutGridField<T, S, F>> & Pick<Readonly<LayoutGridFieldProps<T, S, F>>, never> & InexactPartial<...> & InexactPartial<...>'.
  ../core/src/components/fields/LayoutGridField.tsx(836,7): error TS2339: Property 'schema' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(837,7): error TS2339: Property 'uiSchema' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(838,7): error TS2339: Property 'errorSchema' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(839,7): error TS2339: Property 'idSchema' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(840,7): error TS2339: Property 'onBlur' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(841,7): error TS2339: Property 'onFocus' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(842,7): error TS2339: Property 'formData' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(843,7): error TS2339: Property 'readonly' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(844,7): error TS2339: Property 'registry' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(845,7): error TS2339: Property 'idSeparator' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutGridField.tsx(944,13): error TS2339: Property 'uiSchema' does not exist on type 'Readonly<LayoutGridFieldProps<T, S, F>>'.
  ../core/src/components/fields/LayoutHeaderField.tsx(10,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/fields/LayoutMultiSchemaField.tsx(23,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/fields/MultiSchemaField.tsx(20,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/fields/NumberField.tsx(2,98): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/fields/ObjectField.tsx(19,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/fields/SchemaField.tsx(22,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/fields/SchemaField.tsx(316,40): error TS7006: Parameter '_schema' implicitly has an 'any' type.
  ../core/src/components/fields/SchemaField.tsx(340,40): error TS7006: Parameter '_schema' implicitly has an 'any' type.
  ../core/src/components/fields/StringField.tsx(10,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/fields/NullField.tsx(2,75): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/fields/index.ts(1,90): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/ArrayFieldDescriptionTemplate.tsx(9,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/ArrayFieldItemTemplate.tsx(9,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/ArrayFieldItemButtonsTemplate.tsx(8,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/ArrayFieldTemplate.tsx(10,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/ArrayFieldTitleTemplate.tsx(10,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/BaseInputTemplate.tsx(10,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/ButtonTemplates/SubmitButton.tsx(1,106): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/ButtonTemplates/IconButton.tsx(1,100): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/ButtonTemplates/AddButton.tsx(1,100): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/ButtonTemplates/index.ts(1,78): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/DescriptionField.tsx(1,86): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/ErrorList.tsx(8,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/FieldTemplate/FieldTemplate.tsx(8,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/FieldErrorTemplate.tsx(1,89): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/FieldErrorTemplate.tsx(22,20): error TS7006: Parameter 'elem' implicitly has an 'any' type.
  ../core/src/components/templates/FieldErrorTemplate.tsx(23,17): error TS7006: Parameter 'error' implicitly has an 'any' type.
  ../core/src/components/templates/FieldHelpTemplate.tsx(1,87): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/GridTemplate.tsx(1,35): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/ObjectFieldTemplate.tsx(13,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/TitleField.tsx(1,80): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/UnsupportedField.tsx(1,106): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/WrapIfAdditionalTemplate.tsx(9,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/templates/index.ts(1,78): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/AltDateWidget.tsx(15,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/AltDateWidget.tsx(138,14): error TS7006: Parameter 'elemProps' implicitly has an 'any' type.
  ../core/src/components/widgets/AltDateWidget.tsx(138,25): error TS7006: Parameter 'i' implicitly has an 'any' type.
  ../core/src/components/widgets/AltDateTimeWidget.tsx(1,76): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/CheckboxWidget.tsx(12,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/CheckboxesWidget.tsx(13,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/ColorWidget.tsx(1,89): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/DateWidget.tsx(2,89): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/DateTimeWidget.tsx(9,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/DateTimeWidget.tsx(28,18): error TS7006: Parameter 'value' implicitly has an 'any' type.
  ../core/src/components/widgets/EmailWidget.tsx(1,89): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/FileWidget.tsx(12,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/HiddenWidget.tsx(1,76): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/PasswordWidget.tsx(1,89): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/RadioWidget.tsx(11,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/RangeWidget.tsx(1,76): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/SelectWidget.tsx(10,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/TextareaWidget.tsx(2,96): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/TextWidget.tsx(1,89): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/TimeWidget.tsx(2,89): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/URLWidget.tsx(1,89): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/UpDownWidget.tsx(1,89): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/widgets/index.ts(1,84): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/getDefaultRegistry.ts(1,98): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/components/Form.tsx(40,8): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/withTheme.tsx(3,63): error TS2307: Cannot find module '@rjsf/utils' or its corresponding type declarations.
  ../core/src/withTheme.tsx(17,3): error TS2322: Type 'ForwardRefExoticComponent<Omit<FormProps<T, S, F>, "ref"> & RefAttributes<Form<T, S, F>>>' is not assignable to type 'ComponentType<FormProps<T, S, F>>'.
    Type 'ForwardRefExoticComponent<Omit<FormProps<T, S, F>, "ref"> & RefAttributes<Form<T, S, F>>>' is not assignable to type 'FunctionComponent<FormProps<T, S, F>>'.
      Types of property 'propTypes' are incompatible.
        Type 'WeakValidationMap<Omit<FormProps<T, S, F>, "ref"> & RefAttributes<Form<T, S, F>>> | undefined' is not assignable to type 'WeakValidationMap<FormProps<T, S, F>> | undefined'.
          Type 'WeakValidationMap<Omit<FormProps<T, S, F>, "ref"> & RefAttributes<Form<T, S, F>>>' is not assignable to type 'WeakValidationMap<FormProps<T, S, F>>'.
            Types of property 'ref' are incompatible.
              Type 'Validator<LegacyRef<Form<T, S, F>> | undefined> | undefined' is not assignable to type 'Validator<Ref<Form<T, S, F>> | undefined> | undefined'.
                Type 'Validator<LegacyRef<Form<T, S, F>> | undefined>' is not assignable to type 'Validator<Ref<Form<T, S, F>> | undefined>'.
                  Type 'LegacyRef<Form<T, S, F>> | undefined' is not assignable to type 'Ref<Form<T, S, F>> | undefined'.
  ../../node_modules/@mantine/core/lib/components/Modal/use-modals-stack.d.ts(13,40): error TS1139: Type parameter declaration expected.
  ../../node_modules/@mantine/core/lib/components/Modal/use-modals-stack.d.ts(13,48): error TS1005: ',' expected.
  ../../node_modules/@mantine/core/lib/components/Modal/use-modals-stack.d.ts(13,62): error TS1005: ',' expected.
  ../../node_modules/@mantine/core/lib/components/Modal/use-modals-stack.d.ts(13,70): error TS1005: ')' expected.
  ../../node_modules/@mantine/core/lib/components/Modal/use-modals-stack.d.ts(13,74): error TS1011: An element access expression should take an argument.
  ../../node_modules/@mantine/core/lib/components/Modal/use-modals-stack.d.ts(13,75): error TS1005: ';' expected.
  ../../node_modules/@mantine/core/lib/components/Modal/use-modals-stack.d.ts(13,76): error TS1128: Declaration or statement expected.
  npm error Lifecycle script `build:ts` failed with error:
  npm error code 1
  npm error path /projects/react-jsonschema-form/packages/mantine
  npm error workspace @rjsf/[email protected]
  npm error location /projects/react-jsonschema-form/packages/mantine
  npm error command failed
  npm error command sh -c tsc -b tsconfig.build.json && tsc-alias -p tsconfig.build.json
  npm error Lifecycle script `build` failed with error:
  npm error code 1
  npm error path /projects/react-jsonschema-form/packages/mantine
  npm error workspace @rjsf/[email protected]
  npm error location /projects/react-jsonschema-form/packages/mantine
  npm error command failed
  npm error command sh -c npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd

`

@zfarhad zfarhad requested a review from heath-freenome April 17, 2025 07:47
@heath-freenome
Copy link
Member

heath-freenome commented Apr 17, 2025

@zfarhad Just merged another theme. Can you rebase and update? Also, I see the same build errors when I locally do npm update. I'm guessing some internal dependency update is causing this. Hopefully the update to the package-lock.json I made in my last PR helps you. Consider reverting the package-lock.json in your MR and just doing an npm install again after you merge. Also, I updated the linters so you may have to run npm run lint -- --fix in your branch after rebasing

@zfarhad
Copy link
Contributor Author

zfarhad commented Apr 18, 2025

@zfarhad Just merged another theme. Can you rebase and update? Also, I see the same build errors when I locally do npm update. I'm guessing some internal dependency update is causing this. Hopefully the update to the package-lock.json I made in my last PR helps you. Consider reverting the package-lock.json in your MR and just doing an npm install again after you merge. Also, I updated the linters so you may have to run npm run lint -- --fix in your branch after rebasing

I've rebased and updated the branch. Also fixed the lint errors and warnings.

But I still get errors on build! I think the problem comes from the utils package, when I just try to build it I have these errors:
`

@rjsf/[email protected] build
npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd
@rjsf/[email protected] build:ts
npm run compileReplacer && rimraf ./lib && tsc -b tsconfig.build.json && tsc-alias -p tsconfig.build.json
@rjsf/[email protected] compileReplacer
tsc -p tsconfig.replacer.json && move-file lodashReplacer.js lodashReplacer.cjs
src/ErrorSchemaBuilder.ts:43:45 - error TS2590: Expression produces a union type that is too complex to represent.
43 let errorBlock: ErrorSchema = hasPath ? get(this.errorSchema, pathOfError) : this.errorSchema;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/getOptionMatchingSimpleDiscriminator.ts:31:25 - error TS2339: Property 'type' does not exist on type 'JSONSchema7Definition | {}'.
Property 'type' does not exist on type 'false'.
31 if (discriminator.type === 'object' || discriminator.type === 'array') {
~~~~
src/getOptionMatchingSimpleDiscriminator.ts:31:60 - error TS2339: Property 'type' does not exist on type 'JSONSchema7Definition | {}'.
Property 'type' does not exist on type 'false'.
31 if (discriminator.type === 'object' || discriminator.type === 'array') {
~~~~
src/getOptionMatchingSimpleDiscriminator.ts:35:25 - error TS2339: Property 'const' does not exist on type 'JSONSchema7Definition | {}'.
Property 'const' does not exist on type 'false'.
35 if (discriminator.const === value) {
~~~~~
src/getOptionMatchingSimpleDiscriminator.ts:39:25 - error TS2339: Property 'enum' does not exist on type 'JSONSchema7Definition | {}'.
Property 'enum' does not exist on type 'false'.
39 if (discriminator.enum?.includes(value)) {
~~~~
src/schema/getMatchingOption.ts:50:29 - error TS2345: Argument of type '{} | Exclude<NonNullable<S["properties"]>[string], undefined>' is not assignable to parameter of type 'S'.
'S' could be instantiated with an arbitrary type which could be unrelated to '{} | Exclude<NonNullable<S["properties"]>[string], undefined>'.
50 if (validator.isValid(discriminator, value, rootSchema)) {
~~~~~~~~~~~~~
src/optionsList.ts:73:15 - error TS2322: Type 'NonNullable<S["properties"]>[string] | undefined' is not assignable to type 'S'.
'S' could be instantiated with an arbitrary type which could be unrelated to 'NonNullable<S["properties"]>[string] | undefined'.
73 const innerSchema: S = get(aSchema, [PROPERTIES_KEY, selectorField]);
~~~~~~~~~~~
src/schema/getDefaultFormState.ts:444:54 - error TS2322: Type 'NonNullable<S["properties"]>[string]' is not assignable to type 'object'.
Type 'JSONSchema7Definition' is not assignable to type 'object'.
Type 'boolean' is not assignable to type 'object'.
444 ((isObject(propertySchema) && CONST_KEY in propertySchema) || hasParentConst) &&
~~~~~~~~~~~~~~
src/schema/getDefaultFormState.ts:444:54 - error TS18048: 'propertySchema' is possibly 'undefined'.
444 ((isObject(propertySchema) && CONST_KEY in propertySchema) || hasParentConst) &&
~~~~~~~~~~~~~~
src/schema/getDefaultFormState.ts:446:36 - error TS2345: Argument of type 'JSONSchema7Definition | undefined' is not assignable to parameter of type 'JSONSchema7'.
Type 'undefined' is not assignable to type 'JSONSchema7'.
446 !constIsAjvDataReference(propertySchema);
~~~~~~~~~~~~~~
src/schema/getDefaultFormState.ts:449:69 - error TS2345: Argument of type 'NonNullable<S["properties"]>[string] | undefined' is not assignable to parameter of type 'S'.
'S' could be instantiated with an arbitrary type which could be unrelated to 'NonNullable<S["properties"]>[string] | undefined'.
449 const computedDefault = computeDefaults<T, S, F>(validator, propertySchema, {
~~~~~~~~~~~~~~
src/schema/sanitizeDataForNewSchema.ts:96:11 - error TS2322: Type '{} | Exclude<NonNullable<S["properties"]>[string], undefined>' is not assignable to type 'S'.
'S' could be instantiated with an arbitrary type which could be unrelated to '{} | Exclude<NonNullable<S["properties"]>[string], undefined>'.
96 let oldKeyedSchema: S = get(oldSchema, [PROPERTIES_KEY, key], {});
~~~~~~~~~~~~~~
src/schema/sanitizeDataForNewSchema.ts:97:11 - error TS2322: Type '{} | Exclude<NonNullable<(S & { properties: Record<string, unknown> extends S | undefined ? (S | undefined)[never] : unknown; } & { [uniqueSymbol]: unknown; })["properties"]>[string], undefined>' is not assignable to type 'S'.
'S' could be instantiated with an arbitrary type which could be unrelated to '{} | Exclude<NonNullable<(S & { properties: Record<string, unknown> extends S | undefined ? (S | undefined)[never] : unknown; } & { [uniqueSymbol]: unknown; })["properties"]>[string], undefined>'.
97 let newKeyedSchema: S = get(newSchema, [PROPERTIES_KEY, key], {});
~~~~~~~~~~~~~~
src/schema/toIdSchema.ts:81:9 - error TS2345: Argument of type 'NonNullable<S["properties"]>[string] | {} | undefined' is not assignable to parameter of type 'S'.
'S' could be instantiated with an arbitrary type which could be unrelated to 'NonNullable<S["properties"]>[string] | {} | undefined'.
81 isObject(field) ? field : {},
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/schema/toPathSchema.ts:149:9 - error TS2345: Argument of type 'NonNullable<S["properties"]>[string] | undefined' is not assignable to parameter of type 'S'.
'S' could be instantiated with an arbitrary type which could be unrelated to 'NonNullable<S["properties"]>[string] | undefined'.
149 field,
~~~~~
Found 15 errors.
`

Comment on lines 77 to 78
"@babel/preset-typescript": "^7.23.3",
"@rjsf/core": "^6.0.0-alpha.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you have the three @mantine libraries included here as dev dependencies?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need them for the tests right?

@heath-freenome
Copy link
Member

@zfarhad what version of node are you using? What happens if you first checkout rjsf-v6, do npm refresh-node-modules and then switch to your branch, remove the package-lock.json and then do npm install again? Does this solve the issue?

Comment on lines 81 to 98
"@rjsf/validator-ajv8": "^6.0.0-alpha.0",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.14.202",
"@types/react": "^18.2.58",
"@types/react-dom": "^18.2.19",
"@types/react-test-renderer": "^18.0.7",
"atob": "^2.1.2",
"babel-jest": "^29.7.0",
"eslint": "^8.56.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"nanoid": "^3.3.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-test-renderer": "^18.2.0",
"rimraf": "^5.0.5",
"rollup": "^3.29.4",
"typescript": "^4.9.5"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just merged a package.json cleanup PR that eliminates the need for these:

Suggested change
"@rjsf/validator-ajv8": "^6.0.0-alpha.0",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.14.202",
"@types/react": "^18.2.58",
"@types/react-dom": "^18.2.19",
"@types/react-test-renderer": "^18.0.7",
"atob": "^2.1.2",
"babel-jest": "^29.7.0",
"eslint": "^8.56.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"nanoid": "^3.3.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-test-renderer": "^18.2.0",
"rimraf": "^5.0.5",
"rollup": "^3.29.4",
"typescript": "^4.9.5"
"@rjsf/validator-ajv8": "^6.0.0-alpha.0",
"atob": "^2.1.2",
"eslint": "^8.56.0",
"nanoid": "^5.1.5"

Comment on lines 71 to 78
"devDependencies": {
"@babel/core": "^7.23.9",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/preset-env": "^7.23.9",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@rjsf/core": "^6.0.0-alpha.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"devDependencies": {
"@babel/core": "^7.23.9",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/preset-env": "^7.23.9",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@rjsf/core": "^6.0.0-alpha.0",
"devDependencies": {
"@rjsf/core": "^6.0.0-alpha.0",

@heath-freenome
Copy link
Member

heath-freenome commented May 1, 2025

@zfarhad hopefully when you rebase onto the latest rjsf-v6 branch (or main if I merge it down before you respond) then hopefully your build issues will go away since I updated all the libraries and fixed the typing issues

@heath-freenome heath-freenome deleted the branch rjsf-team:main May 1, 2025 22:41
@heath-freenome heath-freenome reopened this May 1, 2025
@heath-freenome
Copy link
Member

heath-freenome commented May 1, 2025

@zfarhad sorry about the close. You'll have to rebase on main now and deal with the conflicts.

@heath-freenome heath-freenome changed the base branch from rjsf-v6 to main May 1, 2025 23:33
@heath-freenome
Copy link
Member

@zfarhad Can you rebase to main and resolve conflicts. In most cases, just pick what is in main (except maybe the CHANGELOG.md. It may be easier to rebase, resolve conflicts and then re-run npm install

nickgros and others added 6 commits May 9, 2025 11:39
Co-authored-by: Heath C <[email protected]>
Co-authored-by: Abdallah Al-Soqatri <[email protected]>
Co-authored-by: Kevin Burnett <[email protected]>
Co-authored-by: Marek Bodinger <[email protected]>
Co-authored-by: Mehdi Salem <[email protected]>
Co-authored-by: Jonasz Wiącek <[email protected]>
Co-authored-by: Bogdan Savluk <[email protected]>
Co-authored-by: Christian Wendt <[email protected]>
Co-authored-by: Ben Lambert <[email protected]>
Co-authored-by: David R. Bild <[email protected]>
Co-authored-by: Ariqun <[email protected]>
Co-authored-by: Shivam Anand Murmu <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shubham Biswas <[email protected]>
Co-authored-by: popmanhe <[email protected]>
Co-authored-by: Yuki Aoki <[email protected]>
Co-authored-by: Xiangcheng Kuo <[email protected]>
Co-authored-by: Bart van Andel <[email protected]>
Co-authored-by: Laurent Direr <[email protected]>
Co-authored-by: Vegard Stenvik <[email protected]>
Co-authored-by: Appie <[email protected]>
Co-authored-by: Oren Forer <[email protected]>
Co-authored-by: Marcus Penn <[email protected]>
Co-authored-by: joachimhagheim <[email protected]>
Co-authored-by: MarekBodingerBA <[email protected]>
Co-authored-by: momesana <[email protected]>
Co-authored-by: Martti Roitto <[email protected]>
fix(utils): direct lodash function import to improve bundling on library client side (rjsf-team#3976)
fix: rjsf-team#3961 resolve all recurse list for object properties (rjsf-team#3981)
fix gap in outline when label is hidden (rjsf-team#3984)
Fix: Expose the internal `ajv` variable in the validator implementation classes (rjsf-team#3991)
Fixes: rjsf-team#3972 indirectly by exposing the `ajv` variable for use in the issue
Fix: Change FormHelperText usage with @mui/material to render divs (rjsf-team#4032)
Fixes rjsf-team#4031 by switching the render component for `FormHelperText` to be `div`
fix: Added support for anyOf/oneOf in uiSchema (rjsf-team#4055)
Fixes rjsf-team#4039 by updating `MultiSchemaField` to properly support `anyOf`/`oneOf` arrays in the `uiSchema`
Fix checkbox with 0 as a value was unselectable in antd (rjsf-team#4068)
Fixed rjsf-team#4067 by properly dealing with enums that have 0 as a value
Fix potential XSS in the preview button of FileWidget (rjsf-team#4065)
Fix: Make 'ui:rows' option work with chakra-ui for textarea elements rjsf-team#4070 (rjsf-team#4078)
Fix typo in ErrorsListTemplate example (rjsf-team#4087)
Fix rjsf-team#4080 by moving `base64` encoder/decoder from `@rjsf/utils` to playground (rjsf-team#4093)
Fix: Error state not resetting when schema changes (rjsf-team#4079) (rjsf-team#4103)
Fix noImplicitAny error (rjsf-team#4106)
Fixes: [WARNING] Duplicate key "include" in object literal [duplicate-object-key] (rjsf-team#4114)
Fixes: Warning: validateDOMNesting(...): <p> cannot appear as a descendant of <p>. (rjsf-team#4117)
Fix documentation to add missing Form imports (rjsf-team#4131)
Fix rjsf-team#4127 to add missing `Form` import in documentation
Fix: filename should be bold (rjsf-team#4125)
Fix: use correct ConfigProvider context by using named imports (rjsf-team#4132)
Fix 4134 by filtering out bad DOM props (rjsf-team#4140)
Fixes: rjsf-team#4134 by updating the spreading of props onto the `TextField` to remove bad DOM fields
Fixed Programmatic submit not working properly in Firefox (rjsf-team#4150)
Fix Maximum call stack size exceeded in findSchemaDefinition (rjsf-team#4123)
Co-authored-by: Heath C <[email protected]>
Co-authored-by: Abdallah Al-Soqatri <[email protected]>
Co-authored-by: Kevin Burnett <[email protected]>
Co-authored-by: Marek Bodinger <[email protected]>
Co-authored-by: Mehdi Salem <[email protected]>
Co-authored-by: Nick Grosenbacher <[email protected]>
Co-authored-by: Abdallah Al-Soqatri <[email protected]>
Co-authored-by: Jonasz Wiącek <[email protected]>
Co-authored-by: Bogdan Savluk <[email protected]>
Co-authored-by: Christian Wendt <[email protected]>
Co-authored-by: Ben Lambert <[email protected]>
Co-authored-by: David R. Bild <[email protected]>
Co-authored-by: Ariqun <[email protected]>
Co-authored-by: Shivam Anand Murmu <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shubham Biswas <[email protected]>
Co-authored-by: popmanhe <[email protected]>
Co-authored-by: Yuki Aoki <[email protected]>
Co-authored-by: Xiangcheng Kuo <[email protected]>
Co-authored-by: Bart van Andel <[email protected]>
Co-authored-by: Laurent Direr <[email protected]>
Co-authored-by: Vegard Stenvik <[email protected]>
Co-authored-by: Appie <[email protected]>
Co-authored-by: Oren Forer <[email protected]>
Co-authored-by: Marcus Penn <[email protected]>
Co-authored-by: joachimhagheim <[email protected]>
Co-authored-by: MarekBodingerBA <[email protected]>
Co-authored-by: momesana <[email protected]>
Co-authored-by: Martti Roitto <[email protected]>
Co-authored-by: Serge van den Oever <[email protected]>
Co-authored-by: Enzo Ferey <[email protected]>
Co-authored-by: Skyf0l <[email protected]>
Co-authored-by: Jaejoon Han <[email protected]>
Co-authored-by: とまとみ <[email protected]>
Co-authored-by: Daniel Todd <[email protected]>
Co-authored-by: Dmitry Dzhus <[email protected]>
Co-authored-by: Alexander Kachkaev <[email protected]>
Co-authored-by: shaddollxz <[email protected]>
Co-authored-by: Changyu Geng <[email protected]>
Co-authored-by: Helen Lin <[email protected]>
Co-authored-by: solimant <[email protected]>
Co-authored-by: David Li <[email protected]>
fix(utils): direct lodash function import to improve bundling on library client side (rjsf-team#3976)
fix: rjsf-team#3961 resolve all recurse list for object properties (rjsf-team#3981)
fix gap in outline when label is hidden (rjsf-team#3984)
Fix: Expose the internal `ajv` variable in the validator implementation classes (rjsf-team#3991)
Fixes: rjsf-team#3972 indirectly by exposing the `ajv` variable for use in the issue
Fix: Change FormHelperText usage with @mui/material to render divs (rjsf-team#4032)
Fixes rjsf-team#4031 by switching the render component for `FormHelperText` to be `div`
fix: Added support for anyOf/oneOf in uiSchema (rjsf-team#4055)
Fixes rjsf-team#4039 by updating `MultiSchemaField` to properly support `anyOf`/`oneOf` arrays in the `uiSchema`
Fix checkbox with 0 as a value was unselectable in antd (rjsf-team#4068)
Fixed rjsf-team#4067 by properly dealing with enums that have 0 as a value
Fix potential XSS in the preview button of FileWidget (rjsf-team#4065)
Fix: Make 'ui:rows' option work with chakra-ui for textarea elements rjsf-team#4070 (rjsf-team#4078)
Fix typo in ErrorsListTemplate example (rjsf-team#4087)
Fix rjsf-team#4080 by moving `base64` encoder/decoder from `@rjsf/utils` to playground (rjsf-team#4093)
Fix: Error state not resetting when schema changes (rjsf-team#4079) (rjsf-team#4103)
Fix noImplicitAny error (rjsf-team#4106)
Fixes: [WARNING] Duplicate key "include" in object literal [duplicate-object-key] (rjsf-team#4114)
Fixes: Warning: validateDOMNesting(...): <p> cannot appear as a descendant of <p>. (rjsf-team#4117)
Fix documentation to add missing Form imports (rjsf-team#4131)
Fix rjsf-team#4127 to add missing `Form` import in documentation
Fix: filename should be bold (rjsf-team#4125)
Fix: use correct ConfigProvider context by using named imports (rjsf-team#4132)
Fix 4134 by filtering out bad DOM props (rjsf-team#4140)
Fixes: rjsf-team#4134 by updating the spreading of props onto the `TextField` to remove bad DOM fields
Fixed Programmatic submit not working properly in Firefox (rjsf-team#4150)
Fix Maximum call stack size exceeded in findSchemaDefinition (rjsf-team#4123)
fix typos in constants.ts, Form.tsx (rjsf-team#4185)
Fix mui imports in docs (rjsf-team#4218)
fix] Resetting number fields should check the entire string when deciding to leave the input text alone (rjsf-team#4202) (rjsf-team#4220)
Fixed performance issue with large schema dependencies and oneOf (rjsf-team#4203) (rjsf-team#4204)
Fixed performance issue rjsf-team#4203
fix(core): field ui-options higher priority (rjsf-team#4212)
fix(antd): disabled property of options of antd theme (rjsf-team#4216)
fix: omitExtraData on submit and on validateForm (rjsf-team#4228)
Fix IdSchema and PathSchema types (rjsf-team#4196)
fixes rjsf-team#4236
Fix rjsf-team#4197 in various themes by showing empty option in SelectWidget when appropriate (rjsf-team#4200)
fix: xss when rendering schema errors (rjsf-team#4256)
fix 4215 and 4260 by updating optionsList() to take a uiSchema (rjsf-team#4263)
Fixes rjsf-team#4215 and rjsf-team#4260 by supporting alternate titles for enums and anyOf/oneOf lists via the uiSchema
Fixed Changelog (rjsf-team#4269)
heath-freenome and others added 19 commits May 9, 2025 11:39
* Implemented the GridTemplate for all themes
- In all themes except `@rjsf/core`:
  - Implemented the `GridTemplate` using the theme specific grid, adding them to the `templates` in the Registry
- In `@rjsf/core` cleaned up the documentation for the already implemented `GridTemplate`
- In `@rjsf/mui` switched to using the `Grid2` component instead of the deprecated `Grid`
- Updated the `CHANGELOG_V6.md` accordingly

* - Fixed the styling for the `mui` `ObjectFieldTemplate`

* - Fixed the MUI snapshots
* Added new utility functions needed by LayoutGridForm
Adding new functions to `@rjsf/utils` to support the upcoming `LayoutGridForm`
- Updated `@rjsf/utils` to add new types and functions in support of the `LayoutGridForm`
- Updated the `utility-functions.md` documentation for the new functions
- Updated the `v6.x upgrade guide.md` documentation for the new functions and types
- Updated the `CHANGELOG_V6.md` for the new functions and types

* - Fixed build and removed console.log

* Update packages/utils/src/schema/findSelectedOptionInXxxOf.ts

- Reviewer feedback
* Add playground examples for LayoutGrid for each theme
Updated the `playground` so that each theme has an example of the `LayoutGridField` usage
- In `@rjsf/utils` added a `browser` section to the `package.json` to support `getTestIds()` working properly in a browser
  - Updated the `getTestIds()` to refactor out `getTestIdsBrowser()` and export it from the new `indexBrowser.ts`
  - Updated `package.json` to build `indexBrowser.js` for each export type
- In `@rjsf/core` made a few changes to support the playground examples:
  - In `LayoutMultiSchemaField` added support for the hiding of labels as well as extracting the `placeholder` from the UiSchema
  - In `GridTemplate` removed the explicit adding of the `row` class, leaving that up to the users of the `UiSchema`
- In `@rjsf/fluentui-rc` made a few changes to support the playground examples:
  - In `GridTemplate` switched to using the `GridShim` displaying it only when `columns` or `rows` are provided, otherwise simply exporting a `div` due to the CSS Grid
  - In `RadioWidget` implemented support for `inline` styling of the radio elements
- In `playground` implemented the `Layout Grid` example with the following changes:
  - Updated the `vite.config.ts` to pull the `utils` classes from the `indexBrowser`
  - Added the new `UiSchemaForTheme` type, overriding the `uiSchema` for `Sample` to be `UiSchema` or `UiSchemaForTheme`
  - Renamed `Selector` to `SampleSelector`, adding the `selectedSample` as a prop, removing the use of the `current` state in favor of `selectedSample`
    - Also changed the `onSelected()` callback to take a `sampleName: string` rather than `data: any`
  - Updated `Header` to replace `load` with `onSampleSelected` adding `sampleName: string`, serializing `sampleName` on share
    - Also, passed `sampleName` as `selectedSample` and `onSampleSelected` to the `SampleSelector`
  - Updated `EditorProps` to take `data: any` for `onChange`
  - Updated `EditorsProps` to take a new `hasUiSchemaGenerator: boolean`, using it to provide a different title for the `UiSchema` section when true
  - Updated `Playground` add two new state variables, `uiSchemaGenerator` and `sampleName`
    - Updated `onThemeSelected()` to update the `uiSchema` to the one generated from the `uiSchemaGenerator(theme)` if that function is defined in state
    - Updated `load()` to take an additional `sampleName` prop, using it to set the currently selected sample and to set the `uiSchemaGenerator` if `samples[sampleName]` has one
      - Also, set the `uiSchema` to a generated one if the incoming `uiSchema` is a function and adding a undefined check for the `validator`
    - Added a new `onSampleSelected()` which calls `load()` with the selected sample and `sampleName`
  - Updated `DemoFrame` and `app.ts` to rename `material-ui-5` to `mui`
  - Added a new `layoutGrid.ts` and exported it from the `samples/index.ts`

* - Fixed test

* Update CHANGELOG_v6.md

* - Fix `MultiSchemaField` to pass `id` in `onChange`

* - Renamed `MuiV5Theme` to `MuiTheme`
* feat: migrated from v5 to v6

* chore: minor style fix for disabled state for select

* chore: rename `shad-lib` to `lib`, also updated test snapshots for adding type to `add button` and `icon button`

* updated package*.json after versioning

* updated package*.json after versioning

* feat: grid template implementation

* feat: migrated from v5 to v6

* chore: rename `shad-lib` to `lib`, also updated test snapshots for adding type to `add button` and `icon button`

* updated package*.json after versioning

* updated package*.json after versioning

* feat: grid template implementation

* chore: update test snapshot

* chore: update README.md for rjsf/core versioning

* chore: improve ESM support (tsconfig.build.json and package.json)

* chore: add missing jsdoc for all component

* chore: remove console.log when finish building css files

* fix: only imports what necessary from React/radix primitive

* chore: rearrange import sort order

* chore: remove blank line in gitignore, lint jest.config, reduce jsdom dep to be on equal ground to project

* updated package*.json after versioning

* Update .gitignore

Co-authored-by: Heath C <[email protected]>

* Update packages/shadcn/src/AddButton/AddButton.tsx

Co-authored-by: Heath C <[email protected]>

* Update packages/shadcn/build-css.cjs

Co-authored-by: Heath C <[email protected]>

* Update packages/shadcn/README.md

Co-authored-by: Heath C <[email protected]>

* chore: add jsdoc for icon button components

* refactor: simplify conditional rendering in SelectWidget component

* chore: rename build-css.cjs to build-css.js and update package.json script

* chore: add JSDoc comments for Alert component

* chore: add JSDoc comments for Badge component

* chore: add JSDoc comments for Button component

* chore: add JSDoc for Checkbox component

* chore: add JSDoc for Command components

* chore: add JSDoc for FancyMultiSelect, FancySelect and default select components

* chore: add JSDoc return type for Alert, Badge, Button, and Command components

* chore: add JSDoc for Input, Label, and Textarea components

* chore: add JSDoc for Dialog, RadioGroup, Separator, and Slider components

* chore: proofreading JSDoc and improve documentation for AddButton, FancyMultiSelect, FancySelect, and FieldTemplate components

* Update packages/shadcn/.gitignore

Co-authored-by: Heath C <[email protected]>

* chore: refine JSDoc for RangeWidget component and adjust type annotations

* Update packages/shadcn/src/AddButton/AddButton.tsx

Co-authored-by: Heath C <[email protected]>

---------

Co-authored-by: tuanminh <[email protected]>
Co-authored-by: Heath C <[email protected]>
…support (rjsf-team#4547)

* Chore: add "type": "module" to all package.json files for better ESM support
To improve ESM support, the `package.json` files for all public repos were updated to add `type: module`
- Installed `tsx` in `package.json` as a dev dependency
- Replaced all `babel.config.js` files with `babel.config.json` since `jest` assumes `.js` files are ESM not CJS
- Replaced all `jest.config.js` files with` `jest.config.json` since `jest` assumes `.js` files are ESM not CJS
- In all `package.json` files where a replacer was compiled, renamed them to `.cjs` to since they are `commonjs`
  - Updated the `tsconfig.build.json` files to change the replace extension to `.cjs`
- Updated the `.gitignore` to ignore replacers with `.cjs` along with `.js`
- In `@rjsf/validator-ajv8` switched the `compileTestSchema.js` to `compileTestSchema.ts` to replace `require` with `import`
  - Used `tsx` to run the file rather than `node`
  - Also generated `.cjs` files rather than `.js` since they are `commonjs`
- In `@rjsf/shadcn` switched `build-css.js` to `build-css.ts`, replacing `require` with `import`
  - Used `tsx` to run the file rather than `node`
  - Also renamed `postcss.config.js` to `postcss.config.json`

* - Switched to cross-build safe `move-file-cli` rather than `mv`

* - Removed antd v4 support

* - Updated `CHANGELOG_v6.md`
…sf-team#4548)

* Feature: Add LayoutHeaderField to support headers in Layout Grids
Sometimes people will want a header for a section in a `LayoutGridField` and this provides support for it
- Added a new `LayoutHeaderField` to the list of fields in `core` that simply renders a `TitleFieldTemplate`
  - Added 100% RTL tests for the component
- Updated the `layoutGrid` example in the `playground` to add an example of using it
- Updated the `shadcn` `GridTemplate` to remove some hard-coded styling that made the `LayoutHeaderField` usage look really bad
  - Updated the `layoutGrid` to add the additional styling to make the example still work for `shadcn`
- Updated the `CHANGELOG_v6.md` and `custom-widgets-fields.md` to document the new fields

* Update packages/core/test/LayoutHeaderField.test.tsx

Co-authored-by: Nick Grosenbacher <[email protected]>

---------

Co-authored-by: Nick Grosenbacher <[email protected]>
* feat(daisyui): enhance UI components with improved visual hierarchy

Redesigned form templates with connected card
styling, consistent spacing, and improved layout.
Added proper visual hierarchy for nested elements,
optimized control button positioning, and
implemented cross-browser date/time widgets.
Applied DaisyUI utility classes consistently for a
cohesive interface while maintaining full RJSF
functionality.

* Making docs truthy.

* PR feedback.

PR feedback.

PR review

* Very close - need to fix calendar rendering

Looking good.

* Build fixes

* Code review comments

* PR comments

* (feat) Adds core/rating widget and demo

Build cleanup

* Lint free

* Addressing PR comments.
Fixes selects.
Uses Fieldsets instead of custom arrays.
Uses join for buttons when appropriate.
Calendar fix

* * Improves default Rating widget
* Updated .github templates to add: fluent-rc, shadcn, daisy
* Addresses all PR comments
* Updates README

* useCallbacks

* Pre-tests

* Tests. Builds.

* MacOS path and file casing issue resolved. Should fix build.

* Button IDs, import ordering, etc.

* Updating Docusaurus and fixing the build.

* Apply suggestions from code review

Last bits

---------

Co-authored-by: Heath C <[email protected]>
* Fixing daisyui build
The daisyui merge broke the build, attempting to fix this
- Updated the `package*.json` to remove the dependencies
- Updated the daisyui snapshots

* - Bumped packages in hope it fixes things

* - Bumped `package-lock.json` by deleting and reinstalling

* - Updated linting and docs for new themes

* - bumped build tools

* - Tried remmoving package-lock.json and `node_modules` for `shadcn`
* Fixed rjsf-team#4564 by checking process type
Fixed rjsf-team#4564 to eliminate typing issue

* - Removed the `indexBrowser` implementation since the typechecking handles it much more simply
 - Review all templates and widgets
 - Add FileWidget
 - Add GridTemplate
@zfarhad
Copy link
Contributor Author

zfarhad commented May 9, 2025

@heath-freenome
I've rebased and updated the branch source to rjsf-team:main
Now all build issues have been solved.

Comment on lines +5 to +7
branches: [main, rjsf-v6]
pull_request:
branches: [main]
branches: [main, rjsf-v6]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can revert these changes now that the rjsf-v6 branch is merged and deleted

Comment on lines +16 to +18
branches: [ "main", "rjsf-v6" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "rjsf-v6" ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can revert these changes now that the rjsf-v6 branch is merged and deleted

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert this file and then add a line for 6.0.0-beta.7 with the addition of your new theme with something like:

# 6.0.0-beta.6

## @rjsf/mantine

- Added new theme!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was deleted, go ahead and remove it

Comment on lines +106 to +112
"dependencies": {
"@restart/hooks": "^0.6.2",
"@restart/ui": "^1.9.4",
"ajv": "^8.17.1",
"ajv-keywords": "^5.1.0",
"uncontrollable": "^9.0.0"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These belong as devDependencies in your theme's package.json. If you need the @restart stuff as dependencies in your theme, do that

Comment on lines +62 to +66
{displayLabel && rawDescription && (
<Text size='sm' mt={5}>
{description}
</Text>
)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SchemaField renders the DescriptionTemplate as description, not sure you want it double wrapped in Text:

Suggested change
{displayLabel && rawDescription && (
<Text size='sm' mt={5}>
{description}
</Text>
)}
{displayLabel && rawDescription && description}

<RemoveButton
id={buttonId<T>(id, 'remove')}
iconType='sm'
className='array-item-remove'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
className='array-item-remove'
className='rjsf-array-item-remove'

onClick={[Function]}
>
<div
aria-controls=":r3:"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did these come from?!

},
},
},
'daisy-ui': {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you delete this since I moved it below and this make it a duplicate

stylesheet: '//cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css',
theme: BootstrapTheme,
},
'react-bootstrap': {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also duplicated right above so just remove it too

@heath-freenome
Copy link
Member

@zfarhad How can we help you get this finished?

@heath-freenome
Copy link
Member

@zfarhad I hope everything is ok. Let us know when you are ready to get this theme merged

@Algirdyz
Copy link
Contributor

Algirdyz commented Jul 4, 2025

I would love to have this too!
Seems like a lot of work was put into it already.
Something we could do to finish up?

@heath-freenome
Copy link
Member

@Algirdyz It looks like the author of the PR disappeared. You are welcome to pick up the work in your own PR to get it over the line.

@Algirdyz Algirdyz mentioned this pull request Jul 17, 2025
8 tasks
@Algirdyz
Copy link
Contributor

I've started a draft PR here:
#4692

@heath-freenome
Copy link
Member

Closing in favor of #4692

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants