@rjsf/shadcn 6.6.1 → 6.6.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.
Files changed (134) hide show
  1. package/dist/index.cjs +117 -100
  2. package/dist/index.cjs.map +3 -3
  3. package/dist/rjsf-shadcn.esm.js +105 -124
  4. package/dist/rjsf-shadcn.esm.js.map +3 -3
  5. package/dist/rjsf-shadcn.umd.js +96 -80
  6. package/lib/AddButton/AddButton.d.ts +1 -1
  7. package/lib/AddButton/AddButton.js.map +1 -1
  8. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +1 -1
  9. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +1 -1
  10. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
  11. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +1 -1
  12. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +1 -1
  13. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
  14. package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +1 -1
  15. package/lib/BaseInputTemplate/BaseInputTemplate.js +6 -6
  16. package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
  17. package/lib/CheckboxWidget/CheckboxWidget.d.ts +1 -1
  18. package/lib/CheckboxWidget/CheckboxWidget.js +5 -5
  19. package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
  20. package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +1 -1
  21. package/lib/CheckboxesWidget/CheckboxesWidget.js +4 -4
  22. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
  23. package/lib/DescriptionField/DescriptionField.d.ts +1 -1
  24. package/lib/ErrorList/ErrorList.d.ts +1 -1
  25. package/lib/ErrorList/ErrorList.js +1 -3
  26. package/lib/ErrorList/ErrorList.js.map +1 -1
  27. package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +1 -1
  28. package/lib/FieldErrorTemplate/FieldErrorTemplate.js +1 -3
  29. package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
  30. package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +1 -1
  31. package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
  32. package/lib/FieldTemplate/FieldTemplate.d.ts +1 -1
  33. package/lib/FieldTemplate/FieldTemplate.js +1 -1
  34. package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
  35. package/lib/Form/Form.d.ts +3 -3
  36. package/lib/Form/Form.js.map +1 -1
  37. package/lib/GridTemplate/GridTemplate.d.ts +1 -1
  38. package/lib/IconButton/IconButton.d.ts +15 -8
  39. package/lib/IconButton/IconButton.js +14 -6
  40. package/lib/IconButton/IconButton.js.map +1 -1
  41. package/lib/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.d.ts +1 -1
  42. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +1 -1
  43. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
  44. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
  45. package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.d.ts +1 -1
  46. package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js +1 -1
  47. package/lib/OptionalDataControlsTemplate/OptionalDataControlsTemplate.js.map +1 -1
  48. package/lib/RadioWidget/RadioWidget.d.ts +1 -1
  49. package/lib/RadioWidget/RadioWidget.js +6 -6
  50. package/lib/RadioWidget/RadioWidget.js.map +1 -1
  51. package/lib/RangeWidget/RangeWidget.d.ts +2 -2
  52. package/lib/RangeWidget/RangeWidget.js +2 -2
  53. package/lib/RangeWidget/RangeWidget.js.map +1 -1
  54. package/lib/SelectWidget/SelectWidget.d.ts +1 -1
  55. package/lib/SelectWidget/SelectWidget.js +8 -8
  56. package/lib/SelectWidget/SelectWidget.js.map +1 -1
  57. package/lib/SubmitButton/SubmitButton.d.ts +1 -1
  58. package/lib/SubmitButton/SubmitButton.js.map +1 -1
  59. package/lib/Templates/Templates.d.ts +1 -1
  60. package/lib/TextareaWidget/TextareaWidget.d.ts +1 -1
  61. package/lib/TextareaWidget/TextareaWidget.js +4 -4
  62. package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
  63. package/lib/Theme/Theme.d.ts +2 -2
  64. package/lib/TitleField/TitleField.d.ts +1 -1
  65. package/lib/TitleField/TitleField.js.map +1 -1
  66. package/lib/Widgets/Widgets.d.ts +1 -1
  67. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +1 -1
  68. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +1 -1
  69. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
  70. package/lib/components/ui/alert.d.ts +1 -1
  71. package/lib/components/ui/badge.d.ts +1 -1
  72. package/lib/components/ui/button.d.ts +1 -1
  73. package/lib/components/ui/checkbox.d.ts +1 -1
  74. package/lib/components/ui/command.d.ts +1 -1
  75. package/lib/components/ui/command.js +1 -3
  76. package/lib/components/ui/command.js.map +1 -1
  77. package/lib/components/ui/dialog.d.ts +1 -1
  78. package/lib/components/ui/fancy-multi-select.d.ts +3 -3
  79. package/lib/components/ui/fancy-multi-select.js +2 -2
  80. package/lib/components/ui/fancy-multi-select.js.map +1 -1
  81. package/lib/components/ui/fancy-select.d.ts +3 -3
  82. package/lib/components/ui/fancy-select.js +1 -1
  83. package/lib/components/ui/fancy-select.js.map +1 -1
  84. package/lib/components/ui/input.d.ts +1 -1
  85. package/lib/components/ui/label.d.ts +1 -1
  86. package/lib/components/ui/radio-group.d.ts +1 -1
  87. package/lib/components/ui/separator.d.ts +1 -1
  88. package/lib/components/ui/slider.d.ts +1 -1
  89. package/lib/components/ui/slider.js +10 -2
  90. package/lib/components/ui/slider.js.map +1 -1
  91. package/lib/components/ui/textarea.d.ts +1 -1
  92. package/lib/tsconfig.tsbuildinfo +1 -1
  93. package/package.json +6 -7
  94. package/src/AddButton/AddButton.tsx +2 -1
  95. package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +2 -8
  96. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +2 -9
  97. package/src/BaseInputTemplate/BaseInputTemplate.tsx +13 -19
  98. package/src/CheckboxWidget/CheckboxWidget.tsx +8 -17
  99. package/src/CheckboxesWidget/CheckboxesWidget.tsx +7 -10
  100. package/src/DescriptionField/DescriptionField.tsx +1 -1
  101. package/src/ErrorList/ErrorList.tsx +6 -4
  102. package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +8 -8
  103. package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +2 -1
  104. package/src/FieldTemplate/FieldTemplate.tsx +2 -8
  105. package/src/Form/Form.tsx +4 -3
  106. package/src/GridTemplate/GridTemplate.tsx +1 -1
  107. package/src/IconButton/IconButton.tsx +19 -9
  108. package/src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx +1 -1
  109. package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +4 -14
  110. package/src/OptionalDataControlsTemplate/OptionalDataControlsTemplate.tsx +3 -2
  111. package/src/RadioWidget/RadioWidget.tsx +10 -13
  112. package/src/RangeWidget/RangeWidget.tsx +5 -4
  113. package/src/SelectWidget/SelectWidget.tsx +11 -14
  114. package/src/SubmitButton/SubmitButton.tsx +2 -1
  115. package/src/Templates/Templates.ts +1 -1
  116. package/src/TextareaWidget/TextareaWidget.tsx +10 -9
  117. package/src/Theme/Theme.tsx +2 -2
  118. package/src/TitleField/TitleField.tsx +2 -1
  119. package/src/Widgets/Widgets.ts +1 -1
  120. package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +2 -9
  121. package/src/components/ui/alert.tsx +1 -1
  122. package/src/components/ui/badge.tsx +1 -1
  123. package/src/components/ui/button.tsx +1 -1
  124. package/src/components/ui/checkbox.tsx +1 -1
  125. package/src/components/ui/command.tsx +13 -14
  126. package/src/components/ui/dialog.tsx +1 -1
  127. package/src/components/ui/fancy-multi-select.tsx +5 -13
  128. package/src/components/ui/fancy-select.tsx +7 -3
  129. package/src/components/ui/input.tsx +1 -1
  130. package/src/components/ui/label.tsx +1 -1
  131. package/src/components/ui/radio-group.tsx +1 -1
  132. package/src/components/ui/separator.tsx +1 -1
  133. package/src/components/ui/slider.tsx +12 -6
  134. package/src/components/ui/textarea.tsx +1 -1
package/dist/index.cjs CHANGED
@@ -267,10 +267,10 @@ function BaseInputTemplate({
267
267
  ...extraProps,
268
268
  ...(0, import_utils7.getInputProps)(schema, type, options)
269
269
  };
270
- const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
271
- const _onBlur = ({ target }) => onBlur(id, target && target.value);
272
- const _onFocus = ({ target }) => onFocus(id, target && target.value);
273
- const _onClear = (0, import_react.useCallback)(
270
+ const handleChange = ({ target: { value: newValue } }) => onChange(newValue === "" ? options.emptyValue : newValue);
271
+ const handleBlur = ({ target }) => onBlur(id, target && target.value);
272
+ const handleFocus = ({ target }) => onFocus(id, target && target.value);
273
+ const handleClear = (0, import_react.useCallback)(
274
274
  (e) => {
275
275
  e.preventDefault();
276
276
  e.stopPropagation();
@@ -294,13 +294,13 @@ function BaseInputTemplate({
294
294
  list: schema.examples ? (0, import_utils7.examplesId)(id) : void 0,
295
295
  ...inputProps,
296
296
  value: value || value === 0 ? value : "",
297
- onChange: onChangeOverride || _onChange,
298
- onBlur: _onBlur,
299
- onFocus: _onFocus,
297
+ onChange: onChangeOverride || handleChange,
298
+ onBlur: handleBlur,
299
+ onFocus: handleFocus,
300
300
  "aria-describedby": (0, import_utils7.ariaDescribedByIds)(id, !!schema.examples)
301
301
  }
302
302
  ),
303
- options.allowClearTextInputs && !readonly && !disabled && value && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ClearButton2, { onClick: _onClear, registry }),
303
+ options.allowClearTextInputs && !readonly && !disabled && value && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ClearButton2, { onClick: handleClear, registry }),
304
304
  children,
305
305
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core.SchemaExamples, { id, schema })
306
306
  ] });
@@ -374,27 +374,29 @@ function ErrorList({
374
374
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Alert, { variant: "destructive", className: "mb-2", children: [
375
375
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react2.AlertCircle, { className: "h-4 w-4" }),
376
376
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AlertTitle, { children: translateString(import_utils10.TranslatableString.ErrorsLabel) }),
377
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AlertDescription, { className: "flex flex-col gap-1", children: errors.map((error, i) => {
378
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
377
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AlertDescription, { className: "flex flex-col gap-1", children: errors.map((error, i) => (
378
+ // oxlint-disable-next-line react/no-array-index-key
379
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
379
380
  "\u2022 ",
380
381
  error.stack
381
- ] }, i);
382
- }) })
382
+ ] }, i)
383
+ )) })
383
384
  ] });
384
385
  }
385
386
 
386
387
  // src/FieldErrorTemplate/FieldErrorTemplate.tsx
387
388
  var import_utils11 = require("@rjsf/utils");
388
- var import_jsx_runtime10 = require("react/jsx-runtime");
389
+ var import_jsx_runtime10 = (
390
+ // oxlint-disable-next-line react/no-array-index-key
391
+ require("react/jsx-runtime")
392
+ );
389
393
  function FieldErrorTemplate(props) {
390
394
  const { errors = [], fieldPathId } = props;
391
395
  if (errors.length === 0) {
392
396
  return null;
393
397
  }
394
398
  const id = (0, import_utils11.errorId)(fieldPathId);
395
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col gap-1", id, children: errors.map((error, i) => {
396
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs font-medium text-destructive mb-1", children: error }, i);
397
- }) });
399
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col gap-1", id, children: errors.map((error, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs font-medium text-destructive mb-1", children: error }, i)) });
398
400
  }
399
401
 
400
402
  // src/FieldHelpTemplate/FieldHelpTemplate.tsx
@@ -508,20 +510,24 @@ function GridTemplate(props) {
508
510
  }
509
511
 
510
512
  // src/IconButton/IconButton.tsx
513
+ var import_react2 = require("react");
511
514
  var import_utils17 = require("@rjsf/utils");
512
515
  var import_lucide_react3 = require("lucide-react");
513
516
  var import_jsx_runtime14 = require("react/jsx-runtime");
514
- function IconButton(props) {
517
+ function IconButtonFn(props) {
515
518
  const { icon, iconType, className, uiSchema, registry, ...otherProps } = props;
516
519
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { size: "icon", variant: "outline", className, ...otherProps, type: "button", children: icon });
517
520
  }
518
- function CopyButton(props) {
521
+ var IconButton = (0, import_react2.memo)(IconButtonFn);
522
+ var IconButton_default = IconButton;
523
+ function CopyButtonFn(props) {
519
524
  const {
520
525
  registry: { translateString }
521
526
  } = props;
522
527
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IconButton, { title: translateString(import_utils17.TranslatableString.CopyButton), ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react3.Copy, { className: "h-4 w-4" }) });
523
528
  }
524
- function MoveDownButton(props) {
529
+ var CopyButton = (0, import_react2.memo)(CopyButtonFn);
530
+ function MoveDownButtonFn(props) {
525
531
  const {
526
532
  registry: { translateString }
527
533
  } = props;
@@ -534,7 +540,8 @@ function MoveDownButton(props) {
534
540
  }
535
541
  );
536
542
  }
537
- function MoveUpButton(props) {
543
+ var MoveDownButton = (0, import_react2.memo)(MoveDownButtonFn);
544
+ function MoveUpButtonFn(props) {
538
545
  const {
539
546
  registry: { translateString }
540
547
  } = props;
@@ -547,7 +554,8 @@ function MoveUpButton(props) {
547
554
  }
548
555
  );
549
556
  }
550
- function RemoveButton(props) {
557
+ var MoveUpButton = (0, import_react2.memo)(MoveUpButtonFn);
558
+ function RemoveButtonFn(props) {
551
559
  const {
552
560
  registry: { translateString }
553
561
  } = props;
@@ -561,12 +569,14 @@ function RemoveButton(props) {
561
569
  }
562
570
  );
563
571
  }
564
- function ClearButton(props) {
572
+ var RemoveButton = (0, import_react2.memo)(RemoveButtonFn);
573
+ function ClearButtonFn(props) {
565
574
  const {
566
575
  registry: { translateString }
567
576
  } = props;
568
577
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IconButton, { title: translateString(import_utils17.TranslatableString.ClearButton), ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react3.X, {}) });
569
578
  }
579
+ var ClearButton = (0, import_react2.memo)(ClearButtonFn);
570
580
 
571
581
  // src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
572
582
  var import_jsx_runtime15 = require("react/jsx-runtime");
@@ -631,7 +641,7 @@ function ObjectFieldTemplate({
631
641
  ),
632
642
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex flex-col gap-2", children: [
633
643
  !showOptionalDataControlInTitle ? optionalDataControl : void 0,
634
- properties.map((element, index) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: `${element.hidden ? "hidden" : ""} flex`, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w-full", children: element.content }) }, index)),
644
+ properties.map((element) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: `${element.hidden ? "hidden" : ""} flex`, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w-full", children: element.content }) }, element.name)),
635
645
  (0, import_utils19.canExpand)(schema, uiSchema, formData) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mt-2 flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
636
646
  AddButton2,
637
647
  {
@@ -654,7 +664,7 @@ function OptionalDataControlsTemplate(props) {
654
664
  const { id, registry, label, onAddClick, onRemoveClick } = props;
655
665
  if (onAddClick) {
656
666
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
657
- IconButton,
667
+ IconButton_default,
658
668
  {
659
669
  id,
660
670
  registry,
@@ -665,7 +675,8 @@ function OptionalDataControlsTemplate(props) {
665
675
  size: "xs"
666
676
  }
667
677
  );
668
- } else if (onRemoveClick) {
678
+ }
679
+ if (onRemoveClick) {
669
680
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
670
681
  RemoveButton,
671
682
  {
@@ -904,11 +915,11 @@ function CheckboxesWidget({
904
915
  const { enumOptions, enumDisabled, inline, emptyValue } = options;
905
916
  const optionValueFormat = (0, import_utils27.getOptionValueFormat)(options);
906
917
  const checkboxesValues = Array.isArray(value) ? value : [value];
907
- const _onBlur = ({ target }) => onBlur(id, (0, import_utils27.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue));
908
- const _onFocus = ({ target }) => onFocus(id, (0, import_utils27.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue));
918
+ const handleBlur = ({ target }) => onBlur(id, (0, import_utils27.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue));
919
+ const handleFocus = ({ target }) => onFocus(id, (0, import_utils27.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue));
909
920
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cn({ "flex flex-col gap-2": !inline, "flex flex-row gap-4 flex-wrap": inline }), children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
910
921
  const checked = (0, import_utils27.enumOptionsIsSelected)(option.value, checkboxesValues);
911
- const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
922
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);
912
923
  const indexOptionId = (0, import_utils27.optionId)(id, index);
913
924
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2", children: [
914
925
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
@@ -928,8 +939,8 @@ function CheckboxesWidget({
928
939
  className,
929
940
  checked,
930
941
  autoFocus: autofocus && index === 0,
931
- onBlur: _onBlur,
932
- onFocus: _onFocus,
942
+ onBlur: handleBlur,
943
+ onFocus: handleFocus,
933
944
  "aria-describedby": (0, import_utils27.ariaDescribedByIds)(id)
934
945
  }
935
946
  ),
@@ -966,9 +977,9 @@ function CheckboxWidget(props) {
966
977
  registry,
967
978
  options
968
979
  );
969
- const _onChange = (checked) => onChange(checked);
970
- const _onBlur = () => onBlur(id, value);
971
- const _onFocus = () => onFocus(id, value);
980
+ const handleChange = (checked) => onChange(checked);
981
+ const handleBlur = () => onBlur(id, value);
982
+ const handleFocus = () => onFocus(id, value);
972
983
  const description = options.description || schema.description;
973
984
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
974
985
  "div",
@@ -996,9 +1007,9 @@ function CheckboxWidget(props) {
996
1007
  required,
997
1008
  disabled: disabled || readonly,
998
1009
  autoFocus: autofocus,
999
- onCheckedChange: _onChange,
1000
- onBlur: _onBlur,
1001
- onFocus: _onFocus,
1010
+ onCheckedChange: handleChange,
1011
+ onBlur: handleBlur,
1012
+ onFocus: handleFocus,
1002
1013
  className
1003
1014
  }
1004
1015
  ),
@@ -1050,9 +1061,9 @@ function RadioWidget({
1050
1061
  }) {
1051
1062
  const { enumOptions, enumDisabled, emptyValue } = options;
1052
1063
  const optionValueFormat = (0, import_utils31.getOptionValueFormat)(options);
1053
- const _onChange = (value2) => onChange((0, import_utils31.enumOptionValueDecoder)(value2, enumOptions, optionValueFormat, emptyValue));
1054
- const _onBlur = ({ target }) => onBlur(id, (0, import_utils31.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue));
1055
- const _onFocus = ({ target }) => onFocus(id, (0, import_utils31.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue));
1064
+ const handleChange = (enumValue) => onChange((0, import_utils31.enumOptionValueDecoder)(enumValue, enumOptions, optionValueFormat, emptyValue));
1065
+ const handleBlur = ({ target }) => onBlur(id, (0, import_utils31.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue));
1066
+ const handleFocus = ({ target }) => onFocus(id, (0, import_utils31.enumOptionValueDecoder)(target && target.value, enumOptions, optionValueFormat, emptyValue));
1056
1067
  const inline = Boolean(options && options.inline);
1057
1068
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mb-0", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1058
1069
  RadioGroup,
@@ -1061,15 +1072,15 @@ function RadioWidget({
1061
1072
  required,
1062
1073
  disabled: disabled || readonly,
1063
1074
  onValueChange: (e) => {
1064
- _onChange(e);
1075
+ handleChange(e);
1065
1076
  },
1066
- onBlur: _onBlur,
1067
- onFocus: _onFocus,
1077
+ onBlur: handleBlur,
1078
+ onFocus: handleFocus,
1068
1079
  "aria-describedby": (0, import_utils31.ariaDescribedByIds)(id),
1069
1080
  orientation: inline ? "horizontal" : "vertical",
1070
1081
  className: cn("flex flex-wrap", { "flex-col": !inline }, className),
1071
1082
  children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
1072
- const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
1083
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.includes(option.value);
1073
1084
  const checked = (0, import_utils31.enumOptionsIsSelected)(option.value, value);
1074
1085
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-2", children: [
1075
1086
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
@@ -1093,14 +1104,19 @@ var import_utils34 = require("@rjsf/utils");
1093
1104
  var import_pick = __toESM(require("lodash/pick"), 1);
1094
1105
 
1095
1106
  // src/components/ui/slider.tsx
1096
- var import_react2 = require("react");
1107
+ var import_react3 = require("react");
1097
1108
  var import_react_slider = require("@radix-ui/react-slider");
1098
1109
  var import_jsx_runtime28 = require("react/jsx-runtime");
1099
1110
  function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
1100
- const _values = (0, import_react2.useMemo)(
1101
- () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
1102
- [value, defaultValue, min, max]
1103
- );
1111
+ const enumValues = (0, import_react3.useMemo)(() => {
1112
+ if (Array.isArray(value)) {
1113
+ return value;
1114
+ }
1115
+ if (Array.isArray(defaultValue)) {
1116
+ return defaultValue;
1117
+ }
1118
+ return [min, max];
1119
+ }, [value, defaultValue, min, max]);
1104
1120
  return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
1105
1121
  import_react_slider.Root,
1106
1122
  {
@@ -1131,7 +1147,7 @@ function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }
1131
1147
  )
1132
1148
  }
1133
1149
  ),
1134
- Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1150
+ Array.from({ length: enumValues.length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1135
1151
  import_react_slider.Thumb,
1136
1152
  {
1137
1153
  "data-slot": "slider-thumb",
@@ -1171,7 +1187,7 @@ function RangeWidget({
1171
1187
  label,
1172
1188
  id
1173
1189
  }) {
1174
- const _onChange = (value2) => onChange(value2[0]);
1190
+ const handleChange = (newValue) => onChange(newValue[0]);
1175
1191
  const sliderProps = { value, label, id, ...(0, import_utils34.rangeSpec)(schema) };
1176
1192
  const uiProps = { id, ...(0, import_pick.default)(options.props || {}, allowedProps) };
1177
1193
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
@@ -1183,7 +1199,7 @@ function RangeWidget({
1183
1199
  max: sliderProps.max,
1184
1200
  step: sliderProps.step,
1185
1201
  value: [value],
1186
- onValueChange: _onChange,
1202
+ onValueChange: handleChange,
1187
1203
  ...uiProps,
1188
1204
  "aria-describedby": (0, import_utils34.ariaDescribedByIds)(id)
1189
1205
  }
@@ -1196,7 +1212,7 @@ function RangeWidget({
1196
1212
  var import_utils40 = require("@rjsf/utils");
1197
1213
 
1198
1214
  // src/components/ui/fancy-multi-select.tsx
1199
- var import_react4 = require("react");
1215
+ var import_react5 = require("react");
1200
1216
  var import_cmdk2 = require("cmdk");
1201
1217
  var import_isEqual = __toESM(require("lodash/isEqual"), 1);
1202
1218
  var import_lucide_react8 = require("lucide-react");
@@ -1232,7 +1248,7 @@ function Badge({
1232
1248
  }
1233
1249
 
1234
1250
  // src/components/ui/command.tsx
1235
- var import_react3 = require("react");
1251
+ var import_react4 = require("react");
1236
1252
  var import_cmdk = require("cmdk");
1237
1253
  var import_lucide_react7 = require("lucide-react");
1238
1254
 
@@ -1243,23 +1259,21 @@ var import_jsx_runtime31 = require("react/jsx-runtime");
1243
1259
 
1244
1260
  // src/components/ui/command.tsx
1245
1261
  var import_jsx_runtime32 = require("react/jsx-runtime");
1246
- var Command = (0, import_react3.forwardRef)(
1247
- ({ className, ...props }, ref) => {
1248
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1249
- import_cmdk.Command,
1250
- {
1251
- ref,
1252
- "data-slot": "command",
1253
- className: cn(
1254
- "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
1255
- className
1256
- ),
1257
- ...props
1258
- }
1259
- );
1260
- }
1262
+ var Command = (0, import_react4.forwardRef)(
1263
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1264
+ import_cmdk.Command,
1265
+ {
1266
+ ref,
1267
+ "data-slot": "command",
1268
+ className: cn(
1269
+ "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
1270
+ className
1271
+ ),
1272
+ ...props
1273
+ }
1274
+ )
1261
1275
  );
1262
- var CommandInput = (0, import_react3.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center border-b px-3", ...{ "cmdk-input-wrapper": "" }, children: [
1276
+ var CommandInput = (0, import_react4.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center border-b px-3", ...{ "cmdk-input-wrapper": "" }, children: [
1263
1277
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react7.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
1264
1278
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1265
1279
  import_cmdk.Command.Input,
@@ -1327,18 +1341,18 @@ function FancyMultiSelect({
1327
1341
  className,
1328
1342
  id
1329
1343
  }) {
1330
- const inputRef = (0, import_react4.useRef)(null);
1331
- const [open, setOpen] = (0, import_react4.useState)(false);
1332
- const [inputValue, setInputValue] = (0, import_react4.useState)("");
1333
- const selectedItems = (0, import_react4.useMemo)(
1344
+ const inputRef = (0, import_react5.useRef)(null);
1345
+ const [open, setOpen] = (0, import_react5.useState)(false);
1346
+ const [inputValue, setInputValue] = (0, import_react5.useState)("");
1347
+ const selectedItems = (0, import_react5.useMemo)(
1334
1348
  () => items.filter((item) => selected.some((selectedValue) => (0, import_isEqual.default)(item.value, selectedValue))),
1335
1349
  [items, selected]
1336
1350
  );
1337
- const selectables = (0, import_react4.useMemo)(
1351
+ const selectables = (0, import_react5.useMemo)(
1338
1352
  () => items.filter((framework) => !selectedItems.some((item) => (0, import_isEqual.default)(item.value, framework.value))),
1339
1353
  [items, selectedItems]
1340
1354
  );
1341
- const handleUnselect = (0, import_react4.useCallback)(
1355
+ const handleUnselect = (0, import_react5.useCallback)(
1342
1356
  (framework) => {
1343
1357
  if (disabled) {
1344
1358
  return;
@@ -1348,7 +1362,7 @@ function FancyMultiSelect({
1348
1362
  },
1349
1363
  [selectedItems, onValueChange, disabled]
1350
1364
  );
1351
- const handleKeyDown = (0, import_react4.useCallback)(
1365
+ const handleKeyDown = (0, import_react5.useCallback)(
1352
1366
  (e) => {
1353
1367
  if (disabled || !inputRef.current || inputRef.current.value !== "") {
1354
1368
  return;
@@ -1362,18 +1376,18 @@ function FancyMultiSelect({
1362
1376
  },
1363
1377
  [selectedItems, onValueChange, disabled]
1364
1378
  );
1365
- const handleSelect = (0, import_react4.useCallback)(
1379
+ const handleSelect = (0, import_react5.useCallback)(
1366
1380
  (item) => {
1367
1381
  if (disabled) {
1368
1382
  return;
1369
1383
  }
1370
1384
  setInputValue("");
1371
1385
  const newSelected = multiple ? [...selectedItems, item] : [item];
1372
- onValueChange?.(newSelected.map((item2) => item2.index));
1386
+ onValueChange?.(newSelected.map((selectedItem) => selectedItem.index));
1373
1387
  },
1374
1388
  [multiple, selectedItems, onValueChange, disabled]
1375
1389
  );
1376
- const handleFocus = (0, import_react4.useCallback)(
1390
+ const handleFocus = (0, import_react5.useCallback)(
1377
1391
  (e) => {
1378
1392
  if (!disabled) {
1379
1393
  setOpen(true);
@@ -1470,7 +1484,7 @@ function FancyMultiSelect({
1470
1484
  }
1471
1485
 
1472
1486
  // src/components/ui/fancy-select.tsx
1473
- var import_react5 = require("react");
1487
+ var import_react6 = require("react");
1474
1488
  var import_lucide_react9 = require("lucide-react");
1475
1489
  var import_jsx_runtime34 = require("react/jsx-runtime");
1476
1490
  function FancySelect({
@@ -1487,11 +1501,11 @@ function FancySelect({
1487
1501
  onBlur,
1488
1502
  className
1489
1503
  }) {
1490
- const [open, setOpen] = (0, import_react5.useState)(false);
1504
+ const [open, setOpen] = (0, import_react6.useState)(false);
1491
1505
  const selectedItem = items?.find((item) => item.value === selected);
1492
- const selectedRef = (0, import_react5.useRef)(null);
1493
- const containerRef = (0, import_react5.useRef)(null);
1494
- (0, import_react5.useEffect)(() => {
1506
+ const selectedRef = (0, import_react6.useRef)(null);
1507
+ const containerRef = (0, import_react6.useRef)(null);
1508
+ (0, import_react6.useEffect)(() => {
1495
1509
  if (open && selectedRef.current) {
1496
1510
  requestAnimationFrame(() => {
1497
1511
  selectedRef.current?.scrollIntoView({ block: "nearest" });
@@ -1519,7 +1533,10 @@ function FancySelect({
1519
1533
  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
1520
1534
  "div",
1521
1535
  {
1536
+ role: "button",
1537
+ tabIndex: disabled ? -1 : 0,
1522
1538
  onClick: () => !disabled && setOpen(!open),
1539
+ onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && !disabled && setOpen(!open),
1523
1540
  className: cn(
1524
1541
  "flex h-9 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1525
1542
  !selectedItem && required && "border-red-500",
@@ -1590,17 +1607,17 @@ function SelectWidget({
1590
1607
  }) {
1591
1608
  const { enumOptions, enumDisabled, emptyValue: optEmptyValue } = options;
1592
1609
  const optionValueFormat = (0, import_utils40.getOptionValueFormat)(options);
1593
- const _onFancyFocus = () => {
1610
+ const handleFancyFocus = () => {
1594
1611
  onFocus(id, (0, import_utils40.enumOptionValueDecoder)(value, enumOptions, optionValueFormat, optEmptyValue));
1595
1612
  };
1596
- const _onFancyBlur = () => {
1613
+ const handleFancyBlur = () => {
1597
1614
  onBlur(id, (0, import_utils40.enumOptionValueDecoder)(value, enumOptions, optionValueFormat, optEmptyValue));
1598
1615
  };
1599
- const items = enumOptions?.map(({ value: value2, label }, index) => ({
1600
- value: multiple ? value2 : (0, import_utils40.enumOptionValueEncoder)(value2, index, optionValueFormat),
1601
- label,
1616
+ const items = enumOptions?.map(({ value: enumValue, label: enumLabel }, index) => ({
1617
+ value: multiple ? enumValue : (0, import_utils40.enumOptionValueEncoder)(enumValue, index, optionValueFormat),
1618
+ label: enumLabel,
1602
1619
  index,
1603
- disabled: Array.isArray(enumDisabled) && enumDisabled.includes(value2)
1620
+ disabled: Array.isArray(enumDisabled) && enumDisabled.includes(enumValue)
1604
1621
  }));
1605
1622
  const cnClassName = cn({ "border-destructive": rawErrors.length > 0 }, className);
1606
1623
  return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "p-0.5", children: !multiple ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
@@ -1616,8 +1633,8 @@ function SelectWidget({
1616
1633
  required,
1617
1634
  placeholder,
1618
1635
  className: cnClassName,
1619
- onFocus: _onFancyFocus,
1620
- onBlur: _onFancyBlur,
1636
+ onFocus: handleFancyFocus,
1637
+ onBlur: handleFancyBlur,
1621
1638
  ariaDescribedby: (0, import_utils40.ariaDescribedByIds)(id)
1622
1639
  }
1623
1640
  ) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
@@ -1633,8 +1650,8 @@ function SelectWidget({
1633
1650
  onValueChange: (values) => {
1634
1651
  onChange((0, import_utils40.enumOptionValueDecoder)(values.map(String), enumOptions, optionValueFormat, optEmptyValue));
1635
1652
  },
1636
- onFocus: _onFancyFocus,
1637
- onBlur: _onFancyBlur
1653
+ onFocus: handleFancyFocus,
1654
+ onBlur: handleFancyBlur
1638
1655
  }
1639
1656
  ) });
1640
1657
  }
@@ -1675,9 +1692,9 @@ function TextareaWidget({
1675
1692
  options,
1676
1693
  className
1677
1694
  }) {
1678
- const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
1679
- const _onBlur = ({ target }) => onBlur(id, target && target.value);
1680
- const _onFocus = ({ target }) => onFocus(id, target && target.value);
1695
+ const handleChange = ({ target: { value: newValue } }) => onChange(newValue === "" ? options.emptyValue : newValue);
1696
+ const handleBlur = ({ target }) => onBlur(id, target && target.value);
1697
+ const handleFocus = ({ target }) => onFocus(id, target && target.value);
1681
1698
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex p-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1682
1699
  Textarea,
1683
1700
  {
@@ -1690,9 +1707,9 @@ function TextareaWidget({
1690
1707
  required,
1691
1708
  autoFocus: autofocus,
1692
1709
  rows: options.rows || 5,
1693
- onChange: _onChange,
1694
- onBlur: _onBlur,
1695
- onFocus: _onFocus,
1710
+ onChange: handleChange,
1711
+ onBlur: handleBlur,
1712
+ onFocus: handleFocus,
1696
1713
  "aria-describedby": (0, import_utils43.ariaDescribedByIds)(id),
1697
1714
  className
1698
1715
  }