@rjsf/mui 6.5.3 → 6.6.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.
Files changed (69) hide show
  1. package/dist/index.cjs +203 -203
  2. package/dist/index.cjs.map +4 -4
  3. package/dist/mui.esm.js +207 -207
  4. package/dist/mui.esm.js.map +4 -4
  5. package/dist/mui.umd.js +149 -149
  6. package/lib/AddButton/AddButton.js.map +1 -1
  7. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
  8. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
  9. package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -2
  10. package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
  11. package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
  12. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
  13. package/lib/DescriptionField/DescriptionField.js +1 -1
  14. package/lib/DescriptionField/DescriptionField.js.map +1 -1
  15. package/lib/ErrorList/ErrorList.js.map +1 -1
  16. package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +1 -1
  17. package/lib/FieldErrorTemplate/FieldErrorTemplate.js +1 -1
  18. package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
  19. package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +1 -1
  20. package/lib/FieldHelpTemplate/FieldHelpTemplate.js +1 -1
  21. package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
  22. package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
  23. package/lib/IconButton/IconButton.js +2 -2
  24. package/lib/IconButton/IconButton.js.map +1 -1
  25. package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.js.map +1 -1
  26. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
  27. package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js +1 -1
  28. package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js.map +1 -1
  29. package/lib/RadioWidget/RadioWidget.js.map +1 -1
  30. package/lib/RangeWidget/RangeWidget.js.map +1 -1
  31. package/lib/SelectWidget/SelectWidget.js.map +1 -1
  32. package/lib/SubmitButton/SubmitButton.js.map +1 -1
  33. package/lib/Templates/Templates.js +1 -1
  34. package/lib/Templates/Templates.js.map +1 -1
  35. package/lib/Theme/Theme.d.ts +1 -1
  36. package/lib/TitleField/TitleField.js.map +1 -1
  37. package/lib/Widgets/Widgets.js +1 -1
  38. package/lib/Widgets/Widgets.js.map +1 -1
  39. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
  40. package/lib/tsconfig.tsbuildinfo +1 -1
  41. package/lib/util.d.ts +1 -1
  42. package/lib/util.js.map +1 -1
  43. package/package.json +17 -17
  44. package/src/AddButton/AddButton.tsx +1 -0
  45. package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +1 -0
  46. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +1 -0
  47. package/src/BaseInputTemplate/BaseInputTemplate.tsx +4 -3
  48. package/src/CheckboxWidget/CheckboxWidget.tsx +1 -0
  49. package/src/CheckboxesWidget/CheckboxesWidget.tsx +1 -0
  50. package/src/DescriptionField/DescriptionField.tsx +2 -1
  51. package/src/ErrorList/ErrorList.tsx +1 -0
  52. package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +2 -1
  53. package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +2 -1
  54. package/src/FieldTemplate/FieldTemplate.tsx +1 -0
  55. package/src/IconButton/IconButton.tsx +3 -2
  56. package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +1 -0
  57. package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +1 -0
  58. package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +1 -1
  59. package/src/RadioWidget/RadioWidget.tsx +1 -0
  60. package/src/RangeWidget/RangeWidget.tsx +1 -0
  61. package/src/SelectWidget/SelectWidget.tsx +3 -2
  62. package/src/SubmitButton/SubmitButton.tsx +1 -0
  63. package/src/Templates/Templates.ts +1 -1
  64. package/src/Theme/Theme.tsx +1 -1
  65. package/src/TitleField/TitleField.tsx +1 -0
  66. package/src/Widgets/Widgets.ts +1 -1
  67. package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +1 -0
  68. package/src/tsconfig.json +0 -1
  69. package/src/util.ts +1 -2
package/dist/mui.esm.js CHANGED
@@ -215,15 +215,15 @@ function ArrayFieldTemplate(props) {
215
215
 
216
216
  // src/BaseInputTemplate/BaseInputTemplate.tsx
217
217
  import { useCallback } from "react";
218
- import TextField from "@mui/material/TextField";
219
218
  import InputAdornment from "@mui/material/InputAdornment";
219
+ import TextField from "@mui/material/TextField";
220
+ import { SchemaExamples } from "@rjsf/core";
220
221
  import {
221
222
  ariaDescribedByIds,
222
223
  examplesId,
223
224
  getInputProps,
224
225
  labelValue
225
226
  } from "@rjsf/utils";
226
- import { SchemaExamples } from "@rjsf/core";
227
227
  import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
228
228
  var TYPES_THAT_SHRINK_LABEL = ["date", "datetime-local", "file", "time"];
229
229
  function BaseInputTemplate(props) {
@@ -324,10 +324,10 @@ function BaseInputTemplate(props) {
324
324
 
325
325
  // src/DescriptionField/DescriptionField.tsx
326
326
  import Typography from "@mui/material/Typography";
327
+ import { RichDescription } from "@rjsf/core";
327
328
  import {
328
329
  getUiOptions as getUiOptions4
329
330
  } from "@rjsf/utils";
330
- import { RichDescription } from "@rjsf/core";
331
331
  import { jsx as jsx5 } from "react/jsx-runtime";
332
332
  function DescriptionField(props) {
333
333
  const { id, description, registry, uiSchema } = props;
@@ -391,146 +391,52 @@ function ErrorList({
391
391
  ] }) });
392
392
  }
393
393
 
394
- // src/IconButton/IconButton.tsx
395
- import IconButton2 from "@mui/material/IconButton";
396
- import ArrowDownwardIcon from "@mui/icons-material/ArrowDownward";
397
- import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward";
398
- import CopyIcon from "@mui/icons-material/ContentCopy";
399
- import RemoveIcon from "@mui/icons-material/Remove";
400
- import ClearIcon from "@mui/icons-material/Clear";
401
- import {
402
- TranslatableString as TranslatableString3,
403
- getUiOptions as getUiOptions6
404
- } from "@rjsf/utils";
405
- import { jsx as jsx7 } from "react/jsx-runtime";
406
- function MuiIconButton(props) {
407
- const { icon, color, uiSchema, registry, ...otherProps } = props;
408
- const uiOptions = getUiOptions6(uiSchema);
409
- const muiProps = getMuiProps(uiOptions, [
410
- "color",
411
- "disableFocusRipple",
412
- "disableRipple",
413
- "edge",
414
- "size",
415
- "sx"
416
- ]);
417
- return /* @__PURE__ */ jsx7(IconButton2, { ...muiProps, ...otherProps, size: "small", color, children: icon });
418
- }
419
- function CopyButton(props) {
420
- const {
421
- registry: { translateString }
422
- } = props;
423
- return /* @__PURE__ */ jsx7(
424
- MuiIconButton,
425
- {
426
- title: translateString(TranslatableString3.CopyButton),
427
- ...props,
428
- icon: /* @__PURE__ */ jsx7(CopyIcon, { fontSize: "small" })
429
- }
430
- );
431
- }
432
- function MoveDownButton(props) {
433
- const {
434
- registry: { translateString }
435
- } = props;
436
- return /* @__PURE__ */ jsx7(
437
- MuiIconButton,
438
- {
439
- title: translateString(TranslatableString3.MoveDownButton),
440
- ...props,
441
- icon: /* @__PURE__ */ jsx7(ArrowDownwardIcon, { fontSize: "small" })
442
- }
443
- );
444
- }
445
- function MoveUpButton(props) {
446
- const {
447
- registry: { translateString }
448
- } = props;
449
- return /* @__PURE__ */ jsx7(
450
- MuiIconButton,
451
- {
452
- title: translateString(TranslatableString3.MoveUpButton),
453
- ...props,
454
- icon: /* @__PURE__ */ jsx7(ArrowUpwardIcon, { fontSize: "small" })
455
- }
456
- );
457
- }
458
- function RemoveButton(props) {
459
- const { iconType, ...otherProps } = props;
460
- const {
461
- registry: { translateString }
462
- } = otherProps;
463
- return /* @__PURE__ */ jsx7(
464
- MuiIconButton,
465
- {
466
- title: translateString(TranslatableString3.RemoveButton),
467
- ...otherProps,
468
- color: "error",
469
- icon: /* @__PURE__ */ jsx7(RemoveIcon, { fontSize: iconType === "default" ? void 0 : "small" })
470
- }
471
- );
472
- }
473
- function ClearButton(props) {
474
- const { iconType, ...otherProps } = props;
475
- const {
476
- registry: { translateString }
477
- } = otherProps;
478
- return /* @__PURE__ */ jsx7(
479
- MuiIconButton,
480
- {
481
- title: translateString(TranslatableString3.ClearButton),
482
- ...otherProps,
483
- icon: /* @__PURE__ */ jsx7(ClearIcon, { fontSize: iconType === "default" ? void 0 : "small" })
484
- }
485
- );
486
- }
487
-
488
394
  // src/FieldErrorTemplate/FieldErrorTemplate.tsx
489
- import ListItem2 from "@mui/material/ListItem";
490
395
  import FormHelperText from "@mui/material/FormHelperText";
491
396
  import List2 from "@mui/material/List";
397
+ import ListItem2 from "@mui/material/ListItem";
492
398
  import {
493
399
  errorId,
494
- getUiOptions as getUiOptions7
400
+ getUiOptions as getUiOptions6
495
401
  } from "@rjsf/utils";
496
- import { jsx as jsx8 } from "react/jsx-runtime";
402
+ import { jsx as jsx7 } from "react/jsx-runtime";
497
403
  function FieldErrorTemplate(props) {
498
404
  const { errors = [], fieldPathId, uiSchema } = props;
499
405
  if (errors.length === 0) {
500
406
  return null;
501
407
  }
502
408
  const id = errorId(fieldPathId);
503
- const uiOptions = getUiOptions7(uiSchema);
409
+ const uiOptions = getUiOptions6(uiSchema);
504
410
  const muiProps = getMuiProps(uiOptions);
505
411
  const { rjsfSlotProps: muiSlotProps } = muiProps;
506
- return /* @__PURE__ */ jsx8(List2, { id, dense: true, disablePadding: true, ...muiSlotProps?.fieldErrorList, children: errors.map((error, i) => {
507
- return /* @__PURE__ */ jsx8(ListItem2, { disableGutters: true, ...muiSlotProps?.fieldErrorListItem, children: /* @__PURE__ */ jsx8(FormHelperText, { component: "div", id: `${id}-${i}`, ...muiSlotProps?.fieldErrorFormHelperText, children: error }) }, i);
412
+ return /* @__PURE__ */ jsx7(List2, { id, dense: true, disablePadding: true, ...muiSlotProps?.fieldErrorList, children: errors.map((error, i) => {
413
+ return /* @__PURE__ */ jsx7(ListItem2, { disableGutters: true, ...muiSlotProps?.fieldErrorListItem, children: /* @__PURE__ */ jsx7(FormHelperText, { component: "div", id: `${id}-${i}`, ...muiSlotProps?.fieldErrorFormHelperText, children: error }) }, i);
508
414
  }) });
509
415
  }
510
416
 
511
417
  // src/FieldHelpTemplate/FieldHelpTemplate.tsx
418
+ import FormHelperText2 from "@mui/material/FormHelperText";
512
419
  import { RichHelp } from "@rjsf/core";
513
420
  import {
514
421
  helpId,
515
- getUiOptions as getUiOptions8
422
+ getUiOptions as getUiOptions7
516
423
  } from "@rjsf/utils";
517
- import FormHelperText2 from "@mui/material/FormHelperText";
518
- import { jsx as jsx9 } from "react/jsx-runtime";
424
+ import { jsx as jsx8 } from "react/jsx-runtime";
519
425
  function FieldHelpTemplate(props) {
520
426
  const { fieldPathId, help, uiSchema, registry } = props;
521
427
  if (!help) {
522
428
  return null;
523
429
  }
524
- const uiOptions = getUiOptions8(uiSchema);
430
+ const uiOptions = getUiOptions7(uiSchema);
525
431
  const { rjsfSlotProps: { helpFormHelperText } = {} } = getMuiProps(uiOptions);
526
- return /* @__PURE__ */ jsx9(
432
+ return /* @__PURE__ */ jsx8(
527
433
  FormHelperText2,
528
434
  {
529
435
  component: "div",
530
436
  id: helpId(fieldPathId),
531
437
  ...helpFormHelperText,
532
438
  sx: computeSxProps({ mt: 0.625 }, helpFormHelperText),
533
- children: /* @__PURE__ */ jsx9(RichHelp, { help, registry, uiSchema })
439
+ children: /* @__PURE__ */ jsx8(RichHelp, { help, registry, uiSchema })
534
440
  }
535
441
  );
536
442
  }
@@ -540,9 +446,9 @@ import FormControl from "@mui/material/FormControl";
540
446
  import Typography3 from "@mui/material/Typography";
541
447
  import {
542
448
  getTemplate as getTemplate3,
543
- getUiOptions as getUiOptions9
449
+ getUiOptions as getUiOptions8
544
450
  } from "@rjsf/utils";
545
- import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
451
+ import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
546
452
  function FieldTemplate(props) {
547
453
  const {
548
454
  id,
@@ -567,18 +473,18 @@ function FieldTemplate(props) {
567
473
  uiSchema,
568
474
  registry
569
475
  } = props;
570
- const uiOptions = getUiOptions9(uiSchema);
476
+ const uiOptions = getUiOptions8(uiSchema);
571
477
  const WrapIfAdditionalTemplate2 = getTemplate3(
572
478
  "WrapIfAdditionalTemplate",
573
479
  registry,
574
480
  uiOptions
575
481
  );
576
482
  if (hidden) {
577
- return /* @__PURE__ */ jsx10("div", { style: { display: "none" }, children });
483
+ return /* @__PURE__ */ jsx9("div", { style: { display: "none" }, children });
578
484
  }
579
485
  const isCheckbox = uiOptions.widget === "checkbox";
580
486
  const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(uiOptions);
581
- return /* @__PURE__ */ jsx10(
487
+ return /* @__PURE__ */ jsx9(
582
488
  WrapIfAdditionalTemplate2,
583
489
  {
584
490
  classNames,
@@ -607,7 +513,7 @@ function FieldTemplate(props) {
607
513
  className: otherMuiProps.className,
608
514
  children: [
609
515
  children,
610
- displayLabel && !isCheckbox && rawDescription ? /* @__PURE__ */ jsx10(Typography3, { variant: "caption", color: "textSecondary", ...muiSlotProps?.fieldTypography, children: description }) : null,
516
+ displayLabel && !isCheckbox && rawDescription ? /* @__PURE__ */ jsx9(Typography3, { variant: "caption", color: "textSecondary", ...muiSlotProps?.fieldTypography, children: description }) : null,
611
517
  errors,
612
518
  help
613
519
  ]
@@ -619,10 +525,104 @@ function FieldTemplate(props) {
619
525
 
620
526
  // src/GridTemplate/GridTemplate.tsx
621
527
  import Grid3 from "@mui/material/Grid";
622
- import { jsx as jsx11 } from "react/jsx-runtime";
528
+ import { jsx as jsx10 } from "react/jsx-runtime";
623
529
  function GridTemplate(props) {
624
530
  const { children, column, ...rest } = props;
625
- return /* @__PURE__ */ jsx11(Grid3, { container: !column, ...rest, children });
531
+ return /* @__PURE__ */ jsx10(Grid3, { container: !column, ...rest, children });
532
+ }
533
+
534
+ // src/IconButton/IconButton.tsx
535
+ import ArrowDownwardIcon from "@mui/icons-material/ArrowDownward";
536
+ import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward";
537
+ import ClearIcon from "@mui/icons-material/Clear";
538
+ import CopyIcon from "@mui/icons-material/ContentCopy";
539
+ import RemoveIcon from "@mui/icons-material/Remove";
540
+ import IconButton2 from "@mui/material/IconButton";
541
+ import {
542
+ TranslatableString as TranslatableString3,
543
+ getUiOptions as getUiOptions9
544
+ } from "@rjsf/utils";
545
+ import { jsx as jsx11 } from "react/jsx-runtime";
546
+ function MuiIconButton(props) {
547
+ const { icon, color, uiSchema, registry, ...otherProps } = props;
548
+ const uiOptions = getUiOptions9(uiSchema);
549
+ const muiProps = getMuiProps(uiOptions, [
550
+ "color",
551
+ "disableFocusRipple",
552
+ "disableRipple",
553
+ "edge",
554
+ "size",
555
+ "sx"
556
+ ]);
557
+ return /* @__PURE__ */ jsx11(IconButton2, { ...muiProps, ...otherProps, size: "small", color, children: icon });
558
+ }
559
+ function CopyButton(props) {
560
+ const {
561
+ registry: { translateString }
562
+ } = props;
563
+ return /* @__PURE__ */ jsx11(
564
+ MuiIconButton,
565
+ {
566
+ title: translateString(TranslatableString3.CopyButton),
567
+ ...props,
568
+ icon: /* @__PURE__ */ jsx11(CopyIcon, { fontSize: "small" })
569
+ }
570
+ );
571
+ }
572
+ function MoveDownButton(props) {
573
+ const {
574
+ registry: { translateString }
575
+ } = props;
576
+ return /* @__PURE__ */ jsx11(
577
+ MuiIconButton,
578
+ {
579
+ title: translateString(TranslatableString3.MoveDownButton),
580
+ ...props,
581
+ icon: /* @__PURE__ */ jsx11(ArrowDownwardIcon, { fontSize: "small" })
582
+ }
583
+ );
584
+ }
585
+ function MoveUpButton(props) {
586
+ const {
587
+ registry: { translateString }
588
+ } = props;
589
+ return /* @__PURE__ */ jsx11(
590
+ MuiIconButton,
591
+ {
592
+ title: translateString(TranslatableString3.MoveUpButton),
593
+ ...props,
594
+ icon: /* @__PURE__ */ jsx11(ArrowUpwardIcon, { fontSize: "small" })
595
+ }
596
+ );
597
+ }
598
+ function RemoveButton(props) {
599
+ const { iconType, ...otherProps } = props;
600
+ const {
601
+ registry: { translateString }
602
+ } = otherProps;
603
+ return /* @__PURE__ */ jsx11(
604
+ MuiIconButton,
605
+ {
606
+ title: translateString(TranslatableString3.RemoveButton),
607
+ ...otherProps,
608
+ color: "error",
609
+ icon: /* @__PURE__ */ jsx11(RemoveIcon, { fontSize: iconType === "default" ? void 0 : "small" })
610
+ }
611
+ );
612
+ }
613
+ function ClearButton(props) {
614
+ const { iconType, ...otherProps } = props;
615
+ const {
616
+ registry: { translateString }
617
+ } = otherProps;
618
+ return /* @__PURE__ */ jsx11(
619
+ MuiIconButton,
620
+ {
621
+ title: translateString(TranslatableString3.ClearButton),
622
+ ...otherProps,
623
+ icon: /* @__PURE__ */ jsx11(ClearIcon, { fontSize: iconType === "default" ? void 0 : "small" })
624
+ }
625
+ );
626
626
  }
627
627
 
628
628
  // src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
@@ -978,100 +978,22 @@ function generateTemplates() {
978
978
  }
979
979
  var Templates_default = generateTemplates();
980
980
 
981
- // src/CheckboxWidget/CheckboxWidget.tsx
981
+ // src/CheckboxesWidget/CheckboxesWidget.tsx
982
982
  import Checkbox from "@mui/material/Checkbox";
983
983
  import FormControlLabel from "@mui/material/FormControlLabel";
984
- import {
985
- ariaDescribedByIds as ariaDescribedByIds2,
986
- descriptionId as descriptionId2,
987
- getTemplate as getTemplate5,
988
- labelValue as labelValue2,
989
- schemaRequiresTrueValue
990
- } from "@rjsf/utils";
991
- import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
992
- function CheckboxWidget(props) {
993
- const {
994
- schema,
995
- id,
996
- htmlName,
997
- value,
998
- disabled,
999
- readonly,
1000
- label = "",
1001
- hideLabel,
1002
- autofocus,
1003
- onChange,
1004
- onBlur,
1005
- onFocus,
1006
- registry,
1007
- options,
1008
- uiSchema
1009
- } = props;
1010
- const DescriptionFieldTemplate = getTemplate5(
1011
- "DescriptionFieldTemplate",
1012
- registry,
1013
- options
1014
- );
1015
- const required = schemaRequiresTrueValue(schema);
1016
- const _onChange = (_, checked) => onChange(checked);
1017
- const _onBlur = () => onBlur(id, value);
1018
- const _onFocus = () => onFocus(id, value);
1019
- const description = options.description ?? schema.description;
1020
- const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(options);
1021
- return /* @__PURE__ */ jsxs10(Fragment3, { children: [
1022
- !hideLabel && description && /* @__PURE__ */ jsx18(
1023
- DescriptionFieldTemplate,
1024
- {
1025
- id: descriptionId2(id),
1026
- description,
1027
- schema,
1028
- uiSchema,
1029
- registry
1030
- }
1031
- ),
1032
- /* @__PURE__ */ jsx18(
1033
- FormControlLabel,
1034
- {
1035
- ...otherMuiProps,
1036
- ...muiSlotProps?.formControlLabel,
1037
- control: /* @__PURE__ */ jsx18(
1038
- Checkbox,
1039
- {
1040
- id,
1041
- name: htmlName || id,
1042
- checked: typeof value === "undefined" ? false : Boolean(value),
1043
- required,
1044
- disabled: disabled || readonly,
1045
- autoFocus: autofocus,
1046
- onChange: _onChange,
1047
- onBlur: _onBlur,
1048
- onFocus: _onFocus,
1049
- "aria-describedby": ariaDescribedByIds2(id),
1050
- ...muiSlotProps?.checkbox
1051
- }
1052
- ),
1053
- label: labelValue2(label, hideLabel, false)
1054
- }
1055
- )
1056
- ] });
1057
- }
1058
-
1059
- // src/CheckboxesWidget/CheckboxesWidget.tsx
1060
- import Checkbox2 from "@mui/material/Checkbox";
1061
- import FormControlLabel2 from "@mui/material/FormControlLabel";
1062
984
  import FormGroup from "@mui/material/FormGroup";
1063
985
  import FormLabel from "@mui/material/FormLabel";
1064
986
  import {
1065
- ariaDescribedByIds as ariaDescribedByIds3,
987
+ ariaDescribedByIds as ariaDescribedByIds2,
1066
988
  enumOptionValueDecoder,
1067
989
  enumOptionsDeselectValue,
1068
990
  enumOptionsIsSelected,
1069
991
  enumOptionsSelectValue,
1070
992
  getOptionValueFormat,
1071
- labelValue as labelValue3,
993
+ labelValue as labelValue2,
1072
994
  optionId
1073
995
  } from "@rjsf/utils";
1074
- import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
996
+ import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
1075
997
  import { createElement } from "react";
1076
998
  function CheckboxesWidget(props) {
1077
999
  const {
@@ -1102,16 +1024,16 @@ function CheckboxesWidget(props) {
1102
1024
  const _onBlur = ({ target }) => onBlur(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, emptyValue));
1103
1025
  const _onFocus = ({ target }) => onFocus(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, emptyValue));
1104
1026
  const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(options);
1105
- return /* @__PURE__ */ jsxs11(Fragment4, { children: [
1106
- labelValue3(
1107
- /* @__PURE__ */ jsx19(FormLabel, { required, htmlFor: id, children: label || void 0 }),
1027
+ return /* @__PURE__ */ jsxs10(Fragment3, { children: [
1028
+ labelValue2(
1029
+ /* @__PURE__ */ jsx18(FormLabel, { required, htmlFor: id, children: label || void 0 }),
1108
1030
  hideLabel
1109
1031
  ),
1110
- /* @__PURE__ */ jsx19(FormGroup, { ...otherMuiProps, ...muiSlotProps?.formGroup, id, row: !!inline, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
1032
+ /* @__PURE__ */ jsx18(FormGroup, { ...otherMuiProps, ...muiSlotProps?.formGroup, id, row: !!inline, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
1111
1033
  const checked = enumOptionsIsSelected(option.value, checkboxesValues);
1112
1034
  const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
1113
- const checkbox = /* @__PURE__ */ jsx19(
1114
- Checkbox2,
1035
+ const checkbox = /* @__PURE__ */ jsx18(
1036
+ Checkbox,
1115
1037
  {
1116
1038
  ...muiSlotProps?.checkbox,
1117
1039
  id: optionId(id, index),
@@ -1122,11 +1044,11 @@ function CheckboxesWidget(props) {
1122
1044
  onChange: _onChange(index),
1123
1045
  onBlur: _onBlur,
1124
1046
  onFocus: _onFocus,
1125
- "aria-describedby": ariaDescribedByIds3(id)
1047
+ "aria-describedby": ariaDescribedByIds2(id)
1126
1048
  }
1127
1049
  );
1128
1050
  return /* @__PURE__ */ createElement(
1129
- FormControlLabel2,
1051
+ FormControlLabel,
1130
1052
  {
1131
1053
  ...muiSlotProps?.formControlLabel,
1132
1054
  control: checkbox,
@@ -1138,6 +1060,84 @@ function CheckboxesWidget(props) {
1138
1060
  ] });
1139
1061
  }
1140
1062
 
1063
+ // src/CheckboxWidget/CheckboxWidget.tsx
1064
+ import Checkbox2 from "@mui/material/Checkbox";
1065
+ import FormControlLabel2 from "@mui/material/FormControlLabel";
1066
+ import {
1067
+ ariaDescribedByIds as ariaDescribedByIds3,
1068
+ descriptionId as descriptionId2,
1069
+ getTemplate as getTemplate5,
1070
+ labelValue as labelValue3,
1071
+ schemaRequiresTrueValue
1072
+ } from "@rjsf/utils";
1073
+ import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
1074
+ function CheckboxWidget(props) {
1075
+ const {
1076
+ schema,
1077
+ id,
1078
+ htmlName,
1079
+ value,
1080
+ disabled,
1081
+ readonly,
1082
+ label = "",
1083
+ hideLabel,
1084
+ autofocus,
1085
+ onChange,
1086
+ onBlur,
1087
+ onFocus,
1088
+ registry,
1089
+ options,
1090
+ uiSchema
1091
+ } = props;
1092
+ const DescriptionFieldTemplate = getTemplate5(
1093
+ "DescriptionFieldTemplate",
1094
+ registry,
1095
+ options
1096
+ );
1097
+ const required = schemaRequiresTrueValue(schema);
1098
+ const _onChange = (_, checked) => onChange(checked);
1099
+ const _onBlur = () => onBlur(id, value);
1100
+ const _onFocus = () => onFocus(id, value);
1101
+ const description = options.description ?? schema.description;
1102
+ const { rjsfSlotProps: muiSlotProps, ...otherMuiProps } = getMuiProps(options);
1103
+ return /* @__PURE__ */ jsxs11(Fragment4, { children: [
1104
+ !hideLabel && description && /* @__PURE__ */ jsx19(
1105
+ DescriptionFieldTemplate,
1106
+ {
1107
+ id: descriptionId2(id),
1108
+ description,
1109
+ schema,
1110
+ uiSchema,
1111
+ registry
1112
+ }
1113
+ ),
1114
+ /* @__PURE__ */ jsx19(
1115
+ FormControlLabel2,
1116
+ {
1117
+ ...otherMuiProps,
1118
+ ...muiSlotProps?.formControlLabel,
1119
+ control: /* @__PURE__ */ jsx19(
1120
+ Checkbox2,
1121
+ {
1122
+ id,
1123
+ name: htmlName || id,
1124
+ checked: typeof value === "undefined" ? false : Boolean(value),
1125
+ required,
1126
+ disabled: disabled || readonly,
1127
+ autoFocus: autofocus,
1128
+ onChange: _onChange,
1129
+ onBlur: _onBlur,
1130
+ onFocus: _onFocus,
1131
+ "aria-describedby": ariaDescribedByIds3(id),
1132
+ ...muiSlotProps?.checkbox
1133
+ }
1134
+ ),
1135
+ label: labelValue3(label, hideLabel, false)
1136
+ }
1137
+ )
1138
+ ] });
1139
+ }
1140
+
1141
1141
  // src/RadioWidget/RadioWidget.tsx
1142
1142
  import FormControlLabel3 from "@mui/material/FormControlLabel";
1143
1143
  import FormLabel2 from "@mui/material/FormLabel";