@rjsf/react-bootstrap 6.0.0-beta.1 → 6.0.0-beta.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rjsf/react-bootstrap",
3
- "version": "6.0.0-beta.1",
3
+ "version": "6.0.0-beta.2",
4
4
  "main": "dist/index.js",
5
5
  "module": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -61,8 +61,8 @@
61
61
  ]
62
62
  },
63
63
  "peerDependencies": {
64
- "@rjsf/core": "^6.x",
65
- "@rjsf/utils": "^6.x",
64
+ "@rjsf/core": "^6.0.0-beta.x",
65
+ "@rjsf/utils": "^6.0.0-beta.x",
66
66
  "react": ">=18",
67
67
  "react-bootstrap": "^2.x"
68
68
  },
@@ -71,10 +71,10 @@
71
71
  "node": ">=20"
72
72
  },
73
73
  "devDependencies": {
74
- "@rjsf/core": "^6.0.0-beta.1",
75
- "@rjsf/snapshot-tests": "^6.0.0-beta.1",
76
- "@rjsf/utils": "^6.0.0-beta.1",
77
- "@rjsf/validator-ajv8": "^6.0.0-beta.1",
74
+ "@rjsf/core": "^6.0.0-beta.2",
75
+ "@rjsf/snapshot-tests": "^6.0.0-beta.2",
76
+ "@rjsf/utils": "^6.0.0-beta.2",
77
+ "@rjsf/validator-ajv8": "^6.0.0-beta.2",
78
78
  "eslint": "^8.56.0",
79
79
  "react-bootstrap": "^2.10.9"
80
80
  },
@@ -49,11 +49,8 @@ export default function CheckboxWidget<
49
49
 
50
50
  const description = options.description || schema.description;
51
51
  return (
52
- <Form.Group
53
- className={`checkbox ${disabled || readonly ? 'disabled' : ''}`}
54
- aria-describedby={ariaDescribedByIds<T>(id)}
55
- >
56
- {!hideLabel && !!description && (
52
+ <Form.Group className={disabled || readonly ? 'disabled' : ''} aria-describedby={ariaDescribedByIds<T>(id)}>
53
+ {!hideLabel && description && (
57
54
  <DescriptionFieldTemplate
58
55
  id={descriptionId<T>(id)}
59
56
  description={description}
@@ -1,19 +1,24 @@
1
1
  import { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ import { RichDescription } from '@rjsf/core';
2
3
 
4
+ /** The `DescriptionField` is the template to use to render the description of a field
5
+ *
6
+ * @param props - The `DescriptionFieldProps` for this component
7
+ */
3
8
  export default function DescriptionField<
4
9
  T = any,
5
10
  S extends StrictRJSFSchema = RJSFSchema,
6
11
  F extends FormContextType = any,
7
- >({ id, description }: DescriptionFieldProps<T, S, F>) {
8
- if (description) {
9
- return (
10
- <div>
11
- <div id={id} className='mb-3'>
12
- {description}
13
- </div>
14
- </div>
15
- );
12
+ >({ id, description, registry, uiSchema }: DescriptionFieldProps<T, S, F>) {
13
+ if (!description) {
14
+ return null;
16
15
  }
17
16
 
18
- return null;
17
+ return (
18
+ <div>
19
+ <div id={id} className='mb-3'>
20
+ <RichDescription description={description} registry={registry} uiSchema={uiSchema} />
21
+ </div>
22
+ </div>
23
+ );
19
24
  }