@rjsf/chakra-ui 5.11.1 → 5.12.0

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 (251) hide show
  1. package/dist/chakra-ui.esm.js +845 -946
  2. package/dist/chakra-ui.esm.js.map +7 -1
  3. package/dist/chakra-ui.umd.js +1339 -0
  4. package/dist/index.js +1500 -5
  5. package/dist/index.js.map +7 -0
  6. package/lib/AddButton/AddButton.d.ts +3 -0
  7. package/lib/AddButton/AddButton.js +11 -0
  8. package/lib/AddButton/AddButton.js.map +1 -0
  9. package/lib/AddButton/index.d.ts +2 -0
  10. package/lib/AddButton/index.js +3 -0
  11. package/lib/AddButton/index.js.map +1 -0
  12. package/lib/AltDateTimeWidget/AltDateTimeWidget.d.ts +15 -0
  13. package/lib/AltDateTimeWidget/AltDateTimeWidget.js +9 -0
  14. package/lib/AltDateTimeWidget/AltDateTimeWidget.js.map +1 -0
  15. package/lib/AltDateTimeWidget/index.d.ts +2 -0
  16. package/lib/AltDateTimeWidget/index.js +3 -0
  17. package/lib/AltDateTimeWidget/index.js.map +1 -0
  18. package/lib/AltDateWidget/AltDateWidget.d.ts +15 -0
  19. package/lib/AltDateWidget/AltDateWidget.js +80 -0
  20. package/lib/AltDateWidget/AltDateWidget.js.map +1 -0
  21. package/lib/AltDateWidget/index.d.ts +2 -0
  22. package/lib/AltDateWidget/index.js +3 -0
  23. package/lib/AltDateWidget/index.js.map +1 -0
  24. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +3 -0
  25. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +13 -0
  26. package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -0
  27. package/lib/ArrayFieldItemTemplate/index.d.ts +2 -0
  28. package/lib/ArrayFieldItemTemplate/index.js +3 -0
  29. package/lib/ArrayFieldItemTemplate/index.js.map +1 -0
  30. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +3 -0
  31. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +19 -0
  32. package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -0
  33. package/lib/ArrayFieldTemplate/index.d.ts +2 -0
  34. package/lib/ArrayFieldTemplate/index.js +3 -0
  35. package/lib/ArrayFieldTemplate/index.js.map +1 -0
  36. package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +3 -0
  37. package/lib/BaseInputTemplate/BaseInputTemplate.js +18 -0
  38. package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -0
  39. package/lib/BaseInputTemplate/index.d.ts +2 -0
  40. package/lib/BaseInputTemplate/index.js +3 -0
  41. package/lib/BaseInputTemplate/index.js.map +1 -0
  42. package/lib/ChakraFrameProvider.d.ts +2 -0
  43. package/lib/ChakraFrameProvider.js +28 -0
  44. package/lib/ChakraFrameProvider.js.map +1 -0
  45. package/lib/CheckboxWidget/CheckboxWidget.d.ts +3 -0
  46. package/lib/CheckboxWidget/CheckboxWidget.js +19 -0
  47. package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -0
  48. package/lib/CheckboxWidget/index.d.ts +2 -0
  49. package/lib/CheckboxWidget/index.js +3 -0
  50. package/lib/CheckboxWidget/index.js.map +1 -0
  51. package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +3 -0
  52. package/lib/CheckboxesWidget/CheckboxesWidget.js +21 -0
  53. package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -0
  54. package/lib/CheckboxesWidget/index.d.ts +2 -0
  55. package/lib/CheckboxesWidget/index.js +3 -0
  56. package/lib/CheckboxesWidget/index.js.map +1 -0
  57. package/lib/CssReset.d.ts +24 -0
  58. package/lib/CssReset.js +266 -0
  59. package/lib/CssReset.js.map +1 -0
  60. package/lib/DescriptionField/DescriptionField.d.ts +3 -0
  61. package/lib/DescriptionField/DescriptionField.js +12 -0
  62. package/lib/DescriptionField/DescriptionField.js.map +1 -0
  63. package/lib/DescriptionField/index.d.ts +2 -0
  64. package/lib/DescriptionField/index.js +3 -0
  65. package/lib/DescriptionField/index.js.map +1 -0
  66. package/lib/ErrorList/ErrorList.d.ts +3 -0
  67. package/lib/ErrorList/ErrorList.js +9 -0
  68. package/lib/ErrorList/ErrorList.js.map +1 -0
  69. package/lib/ErrorList/index.d.ts +2 -0
  70. package/lib/ErrorList/index.js +3 -0
  71. package/lib/ErrorList/index.js.map +1 -0
  72. package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +7 -0
  73. package/lib/FieldErrorTemplate/FieldErrorTemplate.js +18 -0
  74. package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -0
  75. package/lib/FieldErrorTemplate/index.d.ts +2 -0
  76. package/lib/FieldErrorTemplate/index.js +3 -0
  77. package/lib/FieldErrorTemplate/index.js.map +1 -0
  78. package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +7 -0
  79. package/lib/FieldHelpTemplate/FieldHelpTemplate.js +16 -0
  80. package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -0
  81. package/lib/FieldHelpTemplate/index.d.ts +2 -0
  82. package/lib/FieldHelpTemplate/index.js +3 -0
  83. package/lib/FieldHelpTemplate/index.js.map +1 -0
  84. package/lib/FieldTemplate/FieldTemplate.d.ts +3 -0
  85. package/lib/FieldTemplate/FieldTemplate.js +13 -0
  86. package/lib/FieldTemplate/FieldTemplate.js.map +1 -0
  87. package/lib/FieldTemplate/index.d.ts +2 -0
  88. package/lib/FieldTemplate/index.js +3 -0
  89. package/lib/FieldTemplate/index.js.map +1 -0
  90. package/lib/Form/Form.d.ts +6 -0
  91. package/lib/Form/Form.js +7 -0
  92. package/lib/Form/Form.js.map +1 -0
  93. package/lib/Form/index.d.ts +2 -0
  94. package/lib/Form/index.js +3 -0
  95. package/lib/Form/index.js.map +1 -0
  96. package/lib/IconButton/ChakraIconButton.d.ts +8 -0
  97. package/lib/IconButton/ChakraIconButton.js +11 -0
  98. package/lib/IconButton/ChakraIconButton.js.map +1 -0
  99. package/lib/IconButton/IconButton.d.ts +6 -0
  100. package/lib/IconButton/IconButton.js +21 -0
  101. package/lib/IconButton/IconButton.js.map +1 -0
  102. package/lib/IconButton/index.d.ts +2 -0
  103. package/lib/IconButton/index.js +3 -0
  104. package/lib/IconButton/index.js.map +1 -0
  105. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +3 -0
  106. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +13 -0
  107. package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -0
  108. package/lib/ObjectFieldTemplate/index.d.ts +2 -0
  109. package/lib/ObjectFieldTemplate/index.js +3 -0
  110. package/lib/ObjectFieldTemplate/index.js.map +1 -0
  111. package/lib/RadioWidget/RadioWidget.d.ts +3 -0
  112. package/lib/RadioWidget/RadioWidget.js +20 -0
  113. package/lib/RadioWidget/RadioWidget.js.map +1 -0
  114. package/lib/RadioWidget/index.d.ts +2 -0
  115. package/lib/RadioWidget/index.js +3 -0
  116. package/lib/RadioWidget/index.js.map +1 -0
  117. package/lib/RangeWidget/RangeWidget.d.ts +3 -0
  118. package/lib/RangeWidget/RangeWidget.js +13 -0
  119. package/lib/RangeWidget/RangeWidget.js.map +1 -0
  120. package/lib/RangeWidget/index.d.ts +2 -0
  121. package/lib/RangeWidget/index.js +3 -0
  122. package/lib/RangeWidget/index.js.map +1 -0
  123. package/lib/SelectWidget/SelectWidget.d.ts +3 -0
  124. package/lib/SelectWidget/SelectWidget.js +47 -0
  125. package/lib/SelectWidget/SelectWidget.js.map +1 -0
  126. package/lib/SelectWidget/index.d.ts +2 -0
  127. package/lib/SelectWidget/index.js +3 -0
  128. package/lib/SelectWidget/index.js.map +1 -0
  129. package/lib/SubmitButton/SubmitButton.d.ts +3 -0
  130. package/lib/SubmitButton/SubmitButton.js +11 -0
  131. package/lib/SubmitButton/SubmitButton.js.map +1 -0
  132. package/lib/SubmitButton/index.d.ts +2 -0
  133. package/lib/SubmitButton/index.js +3 -0
  134. package/lib/SubmitButton/index.js.map +1 -0
  135. package/lib/Templates/Templates.d.ts +4 -0
  136. package/lib/Templates/Templates.js +39 -0
  137. package/lib/Templates/Templates.js.map +1 -0
  138. package/lib/Templates/index.d.ts +2 -0
  139. package/lib/Templates/index.js +3 -0
  140. package/lib/Templates/index.js.map +1 -0
  141. package/lib/TextareaWidget/TextareaWidget.d.ts +3 -0
  142. package/lib/TextareaWidget/TextareaWidget.js +12 -0
  143. package/lib/TextareaWidget/TextareaWidget.js.map +1 -0
  144. package/lib/TextareaWidget/index.d.ts +2 -0
  145. package/lib/TextareaWidget/index.js +3 -0
  146. package/lib/TextareaWidget/index.js.map +1 -0
  147. package/lib/Theme/Theme.d.ts +5 -0
  148. package/lib/Theme/Theme.js +10 -0
  149. package/lib/Theme/Theme.js.map +1 -0
  150. package/lib/Theme/index.d.ts +2 -0
  151. package/lib/Theme/index.js +3 -0
  152. package/lib/Theme/index.js.map +1 -0
  153. package/lib/TitleField/TitleField.d.ts +3 -0
  154. package/lib/TitleField/TitleField.js +6 -0
  155. package/lib/TitleField/TitleField.js.map +1 -0
  156. package/lib/TitleField/index.d.ts +2 -0
  157. package/lib/TitleField/index.js +3 -0
  158. package/lib/TitleField/index.js.map +1 -0
  159. package/lib/UpDownWidget/UpDownWidget.d.ts +3 -0
  160. package/lib/UpDownWidget/UpDownWidget.js +13 -0
  161. package/lib/UpDownWidget/UpDownWidget.js.map +1 -0
  162. package/lib/UpDownWidget/index.d.ts +2 -0
  163. package/lib/UpDownWidget/index.js +3 -0
  164. package/lib/UpDownWidget/index.js.map +1 -0
  165. package/lib/Widgets/Widgets.d.ts +4 -0
  166. package/lib/Widgets/Widgets.js +24 -0
  167. package/lib/Widgets/Widgets.js.map +1 -0
  168. package/lib/Widgets/index.d.ts +2 -0
  169. package/lib/Widgets/index.js +3 -0
  170. package/lib/Widgets/index.js.map +1 -0
  171. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +3 -0
  172. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +17 -0
  173. package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -0
  174. package/lib/WrapIfAdditionalTemplate/index.d.ts +2 -0
  175. package/lib/WrapIfAdditionalTemplate/index.js +3 -0
  176. package/lib/WrapIfAdditionalTemplate/index.js.map +1 -0
  177. package/lib/index.d.ts +8 -0
  178. package/lib/index.js +8 -0
  179. package/lib/index.js.map +1 -0
  180. package/lib/utils.d.ts +13 -0
  181. package/lib/utils.js +18 -0
  182. package/lib/utils.js.map +1 -0
  183. package/package.json +22 -14
  184. package/src/AddButton/AddButton.tsx +16 -0
  185. package/src/AddButton/index.ts +2 -0
  186. package/src/AltDateTimeWidget/AltDateTimeWidget.tsx +16 -0
  187. package/src/AltDateTimeWidget/index.ts +2 -0
  188. package/src/AltDateWidget/AltDateWidget.tsx +165 -0
  189. package/src/AltDateWidget/index.ts +2 -0
  190. package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +78 -0
  191. package/src/ArrayFieldItemTemplate/index.ts +2 -0
  192. package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +79 -0
  193. package/src/ArrayFieldTemplate/index.ts +2 -0
  194. package/src/BaseInputTemplate/BaseInputTemplate.tsx +87 -0
  195. package/src/BaseInputTemplate/index.ts +2 -0
  196. package/src/ChakraFrameProvider.tsx +40 -0
  197. package/src/CheckboxWidget/CheckboxWidget.tsx +77 -0
  198. package/src/CheckboxWidget/index.ts +2 -0
  199. package/src/CheckboxesWidget/CheckboxesWidget.tsx +93 -0
  200. package/src/CheckboxesWidget/index.ts +2 -0
  201. package/src/CssReset.tsx +270 -0
  202. package/src/DescriptionField/DescriptionField.tsx +22 -0
  203. package/src/DescriptionField/index.ts +2 -0
  204. package/src/ErrorList/ErrorList.tsx +23 -0
  205. package/src/ErrorList/index.ts +2 -0
  206. package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +30 -0
  207. package/src/FieldErrorTemplate/index.ts +2 -0
  208. package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +19 -0
  209. package/src/FieldHelpTemplate/index.ts +2 -0
  210. package/src/FieldTemplate/FieldTemplate.tsx +72 -0
  211. package/src/FieldTemplate/index.ts +2 -0
  212. package/src/Form/Form.tsx +14 -0
  213. package/src/Form/index.ts +2 -0
  214. package/src/IconButton/ChakraIconButton.tsx +15 -0
  215. package/src/IconButton/IconButton.tsx +60 -0
  216. package/src/IconButton/index.ts +2 -0
  217. package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +88 -0
  218. package/src/ObjectFieldTemplate/index.ts +2 -0
  219. package/src/RadioWidget/RadioWidget.tsx +78 -0
  220. package/src/RadioWidget/index.ts +2 -0
  221. package/src/RangeWidget/RangeWidget.tsx +56 -0
  222. package/src/RangeWidget/index.ts +2 -0
  223. package/src/SelectWidget/SelectWidget.tsx +121 -0
  224. package/src/SelectWidget/index.ts +2 -0
  225. package/src/SubmitButton/SubmitButton.tsx +21 -0
  226. package/src/SubmitButton/index.ts +2 -0
  227. package/src/Templates/Templates.ts +45 -0
  228. package/src/Templates/index.ts +2 -0
  229. package/src/TextareaWidget/TextareaWidget.tsx +64 -0
  230. package/src/TextareaWidget/index.ts +2 -0
  231. package/src/Theme/Theme.tsx +18 -0
  232. package/src/Theme/index.ts +2 -0
  233. package/src/TitleField/TitleField.tsx +14 -0
  234. package/src/TitleField/index.ts +2 -0
  235. package/src/UpDownWidget/UpDownWidget.tsx +58 -0
  236. package/src/UpDownWidget/index.ts +2 -0
  237. package/src/Widgets/Widgets.ts +30 -0
  238. package/src/Widgets/index.ts +2 -0
  239. package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +76 -0
  240. package/src/WrapIfAdditionalTemplate/index.ts +2 -0
  241. package/src/index.ts +11 -0
  242. package/src/utils.ts +31 -0
  243. package/dist/chakra-ui.cjs.development.js +0 -1657
  244. package/dist/chakra-ui.cjs.development.js.map +0 -1
  245. package/dist/chakra-ui.cjs.production.min.js +0 -2
  246. package/dist/chakra-ui.cjs.production.min.js.map +0 -1
  247. package/dist/chakra-ui.umd.development.js +0 -1652
  248. package/dist/chakra-ui.umd.development.js.map +0 -1
  249. package/dist/chakra-ui.umd.production.min.js +0 -2
  250. package/dist/chakra-ui.umd.production.min.js.map +0 -1
  251. package/dist/index.d.ts +0 -28
@@ -1,29 +1,24 @@
1
- import { withTheme } from '@rjsf/core';
2
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
- import { TranslatableString, getUiOptions, getTemplate, getInputProps, labelValue, examplesId, ariaDescribedByIds, errorId, helpId, titleId, descriptionId, canExpand, getSubmitButtonOptions, ADDITIONAL_PROPERTY_FLAG, parseDateString, toDateString, pad, schemaRequiresTrueValue, enumOptionsIndexForValue, enumOptionsValueForIndex, enumOptionsIsSelected, optionId, rangeSpec } from '@rjsf/utils';
4
- import { Button, HStack, Box, ButtonGroup, Grid, GridItem, shouldForwardProp, FormControl, FormLabel, Input, Text, Alert, AlertTitle, List, ListItem, ListIcon, IconButton, FormErrorMessage, FormHelperText, Heading, Divider, Checkbox, CheckboxGroup, Stack, RadioGroup, Radio, Slider, SliderTrack, SliderFilledTrack, SliderThumb, Textarea, NumberInput, NumberInputField, NumberInputStepper, NumberIncrementStepper, NumberDecrementStepper, ChakraProvider } from '@chakra-ui/react';
5
- import { AddIcon, WarningIcon, CopyIcon, ArrowDownIcon, ArrowUpIcon, DeleteIcon } from '@chakra-ui/icons';
6
- import { useMemo, memo, useState, useEffect } from 'react';
7
- import { Select } from 'chakra-react-select';
8
- import { Global, CacheProvider } from '@emotion/react';
9
- import createCache from '@emotion/cache';
10
- import weakMemoize from '@emotion/weak-memoize';
1
+ // src/Form/Form.tsx
2
+ import { withTheme } from "@rjsf/core";
11
3
 
4
+ // src/AddButton/AddButton.tsx
5
+ import { TranslatableString } from "@rjsf/utils";
6
+ import { Button } from "@chakra-ui/react";
7
+ import { AddIcon } from "@chakra-ui/icons";
8
+ import { jsx } from "react/jsx-runtime";
12
9
  function AddButton({
13
10
  uiSchema,
14
11
  registry,
15
12
  ...props
16
13
  }) {
17
- const {
18
- translateString
19
- } = registry;
20
- return jsx(Button, {
21
- leftIcon: jsx(AddIcon, {}),
22
- ...props,
23
- children: translateString(TranslatableString.AddItemButton)
24
- });
14
+ const { translateString } = registry;
15
+ return /* @__PURE__ */ jsx(Button, { leftIcon: /* @__PURE__ */ jsx(AddIcon, {}), ...props, children: translateString(TranslatableString.AddItemButton) });
25
16
  }
26
17
 
18
+ // src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
19
+ import { useMemo } from "react";
20
+ import { Box, ButtonGroup, HStack } from "@chakra-ui/react";
21
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
27
22
  function ArrayFieldItemTemplate(props) {
28
23
  const {
29
24
  children,
@@ -41,127 +36,134 @@ function ArrayFieldItemTemplate(props) {
41
36
  uiSchema,
42
37
  registry
43
38
  } = props;
44
- const {
45
- CopyButton,
46
- MoveDownButton,
47
- MoveUpButton,
48
- RemoveButton
49
- } = registry.templates.ButtonTemplates;
39
+ const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
50
40
  const onCopyClick = useMemo(() => onCopyIndexClick(index), [index, onCopyIndexClick]);
51
41
  const onRemoveClick = useMemo(() => onDropIndexClick(index), [index, onDropIndexClick]);
52
42
  const onArrowUpClick = useMemo(() => onReorderClick(index, index - 1), [index, onReorderClick]);
53
43
  const onArrowDownClick = useMemo(() => onReorderClick(index, index + 1), [index, onReorderClick]);
54
- return jsxs(HStack, {
55
- alignItems: 'flex-end',
56
- py: 1,
57
- children: [jsx(Box, {
58
- w: '100%',
59
- children: children
60
- }), hasToolbar && jsx(Box, {
61
- children: jsxs(ButtonGroup, {
62
- isAttached: true,
63
- mb: 1,
64
- children: [(hasMoveUp || hasMoveDown) && jsx(MoveUpButton, {
44
+ return /* @__PURE__ */ jsxs(HStack, { alignItems: "flex-end", py: 1, children: [
45
+ /* @__PURE__ */ jsx2(Box, { w: "100%", children }),
46
+ hasToolbar && /* @__PURE__ */ jsx2(Box, { children: /* @__PURE__ */ jsxs(ButtonGroup, { isAttached: true, mb: 1, children: [
47
+ (hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx2(
48
+ MoveUpButton2,
49
+ {
65
50
  disabled: disabled || readonly || !hasMoveUp,
66
51
  onClick: onArrowUpClick,
67
- uiSchema: uiSchema,
68
- registry: registry
69
- }), (hasMoveUp || hasMoveDown) && jsx(MoveDownButton, {
52
+ uiSchema,
53
+ registry
54
+ }
55
+ ),
56
+ (hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx2(
57
+ MoveDownButton2,
58
+ {
70
59
  disabled: disabled || readonly || !hasMoveDown,
71
60
  onClick: onArrowDownClick,
72
- uiSchema: uiSchema,
73
- registry: registry
74
- }), hasCopy && jsx(CopyButton, {
61
+ uiSchema,
62
+ registry
63
+ }
64
+ ),
65
+ hasCopy && /* @__PURE__ */ jsx2(
66
+ CopyButton2,
67
+ {
75
68
  disabled: disabled || readonly,
76
69
  onClick: onCopyClick,
77
- uiSchema: uiSchema,
78
- registry: registry
79
- }), hasRemove && jsx(RemoveButton, {
70
+ uiSchema,
71
+ registry
72
+ }
73
+ ),
74
+ hasRemove && /* @__PURE__ */ jsx2(
75
+ RemoveButton2,
76
+ {
80
77
  disabled: disabled || readonly,
81
78
  onClick: onRemoveClick,
82
- uiSchema: uiSchema,
83
- registry: registry
84
- })]
85
- })
86
- })]
87
- });
79
+ uiSchema,
80
+ registry
81
+ }
82
+ )
83
+ ] }) })
84
+ ] });
88
85
  }
89
86
 
87
+ // src/ArrayFieldTemplate/ArrayFieldTemplate.tsx
88
+ import { Box as Box2, Grid, GridItem } from "@chakra-ui/react";
89
+ import {
90
+ getTemplate,
91
+ getUiOptions
92
+ } from "@rjsf/utils";
93
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
90
94
  function ArrayFieldTemplate(props) {
91
- const {
92
- canAdd,
93
- disabled,
94
- idSchema,
95
- uiSchema,
96
- items,
97
- onAddClick,
98
- readonly,
99
- registry,
100
- required,
101
- schema,
102
- title
103
- } = props;
95
+ const { canAdd, disabled, idSchema, uiSchema, items, onAddClick, readonly, registry, required, schema, title } = props;
104
96
  const uiOptions = getUiOptions(uiSchema);
105
- const ArrayFieldDescriptionTemplate = getTemplate('ArrayFieldDescriptionTemplate', registry, uiOptions);
106
- const ArrayFieldItemTemplate = getTemplate('ArrayFieldItemTemplate', registry, uiOptions);
107
- const ArrayFieldTitleTemplate = getTemplate('ArrayFieldTitleTemplate', registry, uiOptions);
108
- // Button templates are not overridden in the uiSchema
97
+ const ArrayFieldDescriptionTemplate = getTemplate(
98
+ "ArrayFieldDescriptionTemplate",
99
+ registry,
100
+ uiOptions
101
+ );
102
+ const ArrayFieldItemTemplate2 = getTemplate(
103
+ "ArrayFieldItemTemplate",
104
+ registry,
105
+ uiOptions
106
+ );
107
+ const ArrayFieldTitleTemplate = getTemplate(
108
+ "ArrayFieldTitleTemplate",
109
+ registry,
110
+ uiOptions
111
+ );
109
112
  const {
110
- ButtonTemplates: {
111
- AddButton
112
- }
113
+ ButtonTemplates: { AddButton: AddButton2 }
113
114
  } = registry.templates;
114
- return jsxs(Box, {
115
- children: [jsx(ArrayFieldTitleTemplate, {
116
- idSchema: idSchema,
117
- title: uiOptions.title || title,
118
- schema: schema,
119
- uiSchema: uiSchema,
120
- required: required,
121
- registry: registry
122
- }), jsx(ArrayFieldDescriptionTemplate, {
123
- idSchema: idSchema,
124
- description: uiOptions.description || schema.description,
125
- schema: schema,
126
- uiSchema: uiSchema,
127
- registry: registry
128
- }), jsxs(Grid, {
129
- children: [jsx(GridItem, {
130
- children: items.length > 0 && items.map(({
131
- key,
132
- ...itemProps
133
- }) => jsx(ArrayFieldItemTemplate, {
134
- ...itemProps
135
- }, key))
136
- }), canAdd && jsx(GridItem, {
137
- justifySelf: 'flex-end',
138
- children: jsx(Box, {
139
- mt: 2,
140
- children: jsx(AddButton, {
141
- className: 'array-item-add',
142
- onClick: onAddClick,
143
- disabled: disabled || readonly,
144
- uiSchema: uiSchema,
145
- registry: registry
146
- })
147
- })
148
- })]
149
- }, `array-item-list-${idSchema.$id}`)]
150
- });
115
+ return /* @__PURE__ */ jsxs2(Box2, { children: [
116
+ /* @__PURE__ */ jsx3(
117
+ ArrayFieldTitleTemplate,
118
+ {
119
+ idSchema,
120
+ title: uiOptions.title || title,
121
+ schema,
122
+ uiSchema,
123
+ required,
124
+ registry
125
+ }
126
+ ),
127
+ /* @__PURE__ */ jsx3(
128
+ ArrayFieldDescriptionTemplate,
129
+ {
130
+ idSchema,
131
+ description: uiOptions.description || schema.description,
132
+ schema,
133
+ uiSchema,
134
+ registry
135
+ }
136
+ ),
137
+ /* @__PURE__ */ jsxs2(Grid, { children: [
138
+ /* @__PURE__ */ jsx3(GridItem, { children: items.length > 0 && items.map(({ key, ...itemProps }) => /* @__PURE__ */ jsx3(ArrayFieldItemTemplate2, { ...itemProps }, key)) }),
139
+ canAdd && /* @__PURE__ */ jsx3(GridItem, { justifySelf: "flex-end", children: /* @__PURE__ */ jsx3(Box2, { mt: 2, children: /* @__PURE__ */ jsx3(
140
+ AddButton2,
141
+ {
142
+ className: "array-item-add",
143
+ onClick: onAddClick,
144
+ disabled: disabled || readonly,
145
+ uiSchema,
146
+ registry
147
+ }
148
+ ) }) })
149
+ ] }, `array-item-list-${idSchema.$id}`)
150
+ ] });
151
151
  }
152
152
 
153
- function getChakra({
154
- uiSchema = {}
155
- }) {
156
- const chakraProps = uiSchema['ui:options'] && uiSchema['ui:options'].chakra || {};
157
- Object.keys(chakraProps).forEach(key => {
158
- /**
159
- * Leveraging `shouldForwardProp` to remove props
160
- *
161
- * This is a utility function that's used in `@chakra-ui/react`'s factory function.
162
- * Normally, it prevents ChakraProps from being passed to the DOM.
163
- * In this case we just want to delete the unknown props. So we flip the boolean.
164
- */
153
+ // src/BaseInputTemplate/BaseInputTemplate.tsx
154
+ import { FormControl, FormLabel, Input } from "@chakra-ui/react";
155
+ import {
156
+ ariaDescribedByIds,
157
+ examplesId,
158
+ labelValue,
159
+ getInputProps
160
+ } from "@rjsf/utils";
161
+
162
+ // src/utils.ts
163
+ import { shouldForwardProp } from "@chakra-ui/react";
164
+ function getChakra({ uiSchema = {} }) {
165
+ const chakraProps = uiSchema["ui:options"] && uiSchema["ui:options"].chakra || {};
166
+ Object.keys(chakraProps).forEach((key) => {
165
167
  if (shouldForwardProp(key)) {
166
168
  delete chakraProps[key];
167
169
  }
@@ -169,6 +171,8 @@ function getChakra({
169
171
  return chakraProps;
170
172
  }
171
173
 
174
+ // src/BaseInputTemplate/BaseInputTemplate.tsx
175
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
172
176
  function BaseInputTemplate(props) {
173
177
  const {
174
178
  id,
@@ -191,213 +195,176 @@ function BaseInputTemplate(props) {
191
195
  disabled
192
196
  } = props;
193
197
  const inputProps = getInputProps(schema, type, options);
194
- const chakraProps = getChakra({
195
- uiSchema
196
- });
197
- const _onChange = ({
198
- target: {
199
- value
200
- }
201
- }) => onChange(value === '' ? options.emptyValue : value);
202
- const _onBlur = ({
203
- target: {
204
- value
205
- }
206
- }) => onBlur(id, value);
207
- const _onFocus = ({
208
- target: {
209
- value
198
+ const chakraProps = getChakra({ uiSchema });
199
+ const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
200
+ const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
201
+ const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
202
+ return /* @__PURE__ */ jsxs3(
203
+ FormControl,
204
+ {
205
+ mb: 1,
206
+ ...chakraProps,
207
+ isDisabled: disabled || readonly,
208
+ isRequired: required,
209
+ isReadOnly: readonly,
210
+ isInvalid: rawErrors && rawErrors.length > 0,
211
+ children: [
212
+ labelValue(
213
+ /* @__PURE__ */ jsx4(FormLabel, { htmlFor: id, id: `${id}-label`, children: label }),
214
+ hideLabel || !label
215
+ ),
216
+ /* @__PURE__ */ jsx4(
217
+ Input,
218
+ {
219
+ id,
220
+ name: id,
221
+ value: value || value === 0 ? value : "",
222
+ onChange: onChangeOverride || _onChange,
223
+ onBlur: _onBlur,
224
+ onFocus: _onFocus,
225
+ autoFocus: autofocus,
226
+ placeholder,
227
+ ...inputProps,
228
+ list: schema.examples ? examplesId(id) : void 0,
229
+ "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
230
+ }
231
+ ),
232
+ Array.isArray(schema.examples) ? /* @__PURE__ */ jsx4("datalist", { id: examplesId(id), children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map((example) => {
233
+ return /* @__PURE__ */ jsx4("option", { value: example }, example);
234
+ }) }) : null
235
+ ]
210
236
  }
211
- }) => onFocus(id, value);
212
- return jsxs(FormControl, {
213
- mb: 1,
214
- ...chakraProps,
215
- isDisabled: disabled || readonly,
216
- isRequired: required,
217
- isReadOnly: readonly,
218
- isInvalid: rawErrors && rawErrors.length > 0,
219
- children: [labelValue(jsx(FormLabel, {
220
- htmlFor: id,
221
- id: `${id}-label`,
222
- children: label
223
- }), hideLabel || !label), jsx(Input, {
224
- id: id,
225
- name: id,
226
- value: value || value === 0 ? value : '',
227
- onChange: onChangeOverride || _onChange,
228
- onBlur: _onBlur,
229
- onFocus: _onFocus,
230
- autoFocus: autofocus,
231
- placeholder: placeholder,
232
- ...inputProps,
233
- list: schema.examples ? examplesId(id) : undefined,
234
- "aria-describedby": ariaDescribedByIds(id, !!schema.examples)
235
- }), Array.isArray(schema.examples) ? jsx("datalist", {
236
- id: examplesId(id),
237
- children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map(example => {
238
- return jsx("option", {
239
- value: example
240
- }, example);
241
- })
242
- }) : null]
243
- });
237
+ );
244
238
  }
245
239
 
246
- function DescriptionField({
247
- description,
248
- id
249
- }) {
240
+ // src/DescriptionField/DescriptionField.tsx
241
+ import { Text } from "@chakra-ui/react";
242
+ import { Fragment, jsx as jsx5 } from "react/jsx-runtime";
243
+ function DescriptionField({ description, id }) {
250
244
  if (!description) {
251
245
  return null;
252
246
  }
253
- if (typeof description === 'string') {
254
- return jsx(Text, {
255
- id: id,
256
- mt: 2,
257
- mb: 4,
258
- children: description
259
- });
247
+ if (typeof description === "string") {
248
+ return /* @__PURE__ */ jsx5(Text, { id, mt: 2, mb: 4, children: description });
260
249
  }
261
- return jsx(Fragment, {
262
- children: description
263
- });
250
+ return /* @__PURE__ */ jsx5(Fragment, { children: description });
264
251
  }
265
252
 
253
+ // src/ErrorList/ErrorList.tsx
254
+ import { TranslatableString as TranslatableString2 } from "@rjsf/utils";
255
+ import { List, ListIcon, ListItem, Alert, AlertTitle } from "@chakra-ui/react";
256
+ import { WarningIcon } from "@chakra-ui/icons";
257
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
266
258
  function ErrorList({
267
259
  errors,
268
260
  registry
269
261
  }) {
270
- const {
271
- translateString
272
- } = registry;
273
- return jsxs(Alert, {
274
- flexDirection: 'column',
275
- alignItems: 'flex-start',
276
- gap: 3,
277
- status: 'error',
278
- children: [jsx(AlertTitle, {
279
- children: translateString(TranslatableString.ErrorsLabel)
280
- }), jsx(List, {
281
- children: errors.map((error, i) => jsxs(ListItem, {
282
- children: [jsx(ListIcon, {
283
- as: WarningIcon,
284
- color: 'red.500'
285
- }), error.stack]
286
- }, i))
287
- })]
288
- });
262
+ const { translateString } = registry;
263
+ return /* @__PURE__ */ jsxs4(Alert, { flexDirection: "column", alignItems: "flex-start", gap: 3, status: "error", children: [
264
+ /* @__PURE__ */ jsx6(AlertTitle, { children: translateString(TranslatableString2.ErrorsLabel) }),
265
+ /* @__PURE__ */ jsx6(List, { children: errors.map((error, i) => /* @__PURE__ */ jsxs4(ListItem, { children: [
266
+ /* @__PURE__ */ jsx6(ListIcon, { as: WarningIcon, color: "red.500" }),
267
+ error.stack
268
+ ] }, i)) })
269
+ ] });
289
270
  }
290
271
 
272
+ // src/IconButton/ChakraIconButton.tsx
273
+ import { memo } from "react";
274
+ import { IconButton } from "@chakra-ui/react";
275
+ import { jsx as jsx7 } from "react/jsx-runtime";
291
276
  function ChakraIconButton(props) {
292
- const {
293
- icon,
294
- iconType,
295
- uiSchema,
296
- registry,
297
- ...otherProps
298
- } = props;
299
- return jsx(IconButton, {
300
- "aria-label": props.title,
301
- ...otherProps,
302
- icon: icon
303
- });
277
+ const { icon, iconType, uiSchema, registry, ...otherProps } = props;
278
+ return /* @__PURE__ */ jsx7(IconButton, { "aria-label": props.title, ...otherProps, icon });
304
279
  }
305
- ChakraIconButton.displayName = 'ChakraIconButton';
306
- var ChakraIconButton$1 = /*#__PURE__*/memo(ChakraIconButton);
280
+ ChakraIconButton.displayName = "ChakraIconButton";
281
+ var ChakraIconButton_default = memo(ChakraIconButton);
307
282
 
283
+ // src/IconButton/IconButton.tsx
284
+ import { TranslatableString as TranslatableString3 } from "@rjsf/utils";
285
+ import { ArrowUpIcon, ArrowDownIcon, CopyIcon, DeleteIcon } from "@chakra-ui/icons";
286
+ import { jsx as jsx8 } from "react/jsx-runtime";
308
287
  function CopyButton(props) {
309
288
  const {
310
- registry: {
311
- translateString
312
- }
289
+ registry: { translateString }
313
290
  } = props;
314
- return jsx(ChakraIconButton$1, {
315
- title: translateString(TranslatableString.CopyButton),
316
- ...props,
317
- icon: jsx(CopyIcon, {})
318
- });
291
+ return /* @__PURE__ */ jsx8(ChakraIconButton_default, { title: translateString(TranslatableString3.CopyButton), ...props, icon: /* @__PURE__ */ jsx8(CopyIcon, {}) });
319
292
  }
320
293
  function MoveDownButton(props) {
321
294
  const {
322
- registry: {
323
- translateString
324
- }
295
+ registry: { translateString }
325
296
  } = props;
326
- return jsx(ChakraIconButton$1, {
327
- title: translateString(TranslatableString.MoveDownButton),
328
- ...props,
329
- icon: jsx(ArrowDownIcon, {})
330
- });
297
+ return /* @__PURE__ */ jsx8(
298
+ ChakraIconButton_default,
299
+ {
300
+ title: translateString(TranslatableString3.MoveDownButton),
301
+ ...props,
302
+ icon: /* @__PURE__ */ jsx8(ArrowDownIcon, {})
303
+ }
304
+ );
331
305
  }
332
306
  function MoveUpButton(props) {
333
307
  const {
334
- registry: {
335
- translateString
336
- }
308
+ registry: { translateString }
337
309
  } = props;
338
- return jsx(ChakraIconButton$1, {
339
- title: translateString(TranslatableString.MoveUpButton),
340
- ...props,
341
- icon: jsx(ArrowUpIcon, {})
342
- });
310
+ return /* @__PURE__ */ jsx8(
311
+ ChakraIconButton_default,
312
+ {
313
+ title: translateString(TranslatableString3.MoveUpButton),
314
+ ...props,
315
+ icon: /* @__PURE__ */ jsx8(ArrowUpIcon, {})
316
+ }
317
+ );
343
318
  }
344
319
  function RemoveButton(props) {
345
320
  const {
346
- registry: {
347
- translateString
348
- }
321
+ registry: { translateString }
349
322
  } = props;
350
- return jsx(ChakraIconButton$1, {
351
- title: translateString(TranslatableString.RemoveButton),
352
- ...props,
353
- icon: jsx(DeleteIcon, {})
354
- });
323
+ return /* @__PURE__ */ jsx8(
324
+ ChakraIconButton_default,
325
+ {
326
+ title: translateString(TranslatableString3.RemoveButton),
327
+ ...props,
328
+ icon: /* @__PURE__ */ jsx8(DeleteIcon, {})
329
+ }
330
+ );
355
331
  }
356
332
 
357
- /** The `FieldErrorTemplate` component renders the errors local to the particular field
358
- *
359
- * @param props - The `FieldErrorProps` for the errors being rendered
360
- */
333
+ // src/FieldErrorTemplate/FieldErrorTemplate.tsx
334
+ import { errorId } from "@rjsf/utils";
335
+ import { FormErrorMessage, List as List2, ListItem as ListItem2 } from "@chakra-ui/react";
336
+ import { jsx as jsx9 } from "react/jsx-runtime";
361
337
  function FieldErrorTemplate(props) {
362
- const {
363
- errors = [],
364
- idSchema
365
- } = props;
338
+ const { errors = [], idSchema } = props;
366
339
  if (errors.length === 0) {
367
340
  return null;
368
341
  }
369
342
  const id = errorId(idSchema);
370
- return jsx(List, {
371
- children: errors.map((error, i) => {
372
- return jsx(ListItem, {
373
- children: jsx(FormErrorMessage, {
374
- id: id,
375
- children: error
376
- })
377
- }, i);
378
- })
379
- });
343
+ return /* @__PURE__ */ jsx9(List2, { children: errors.map((error, i) => {
344
+ return /* @__PURE__ */ jsx9(ListItem2, { children: /* @__PURE__ */ jsx9(FormErrorMessage, { id, children: error }) }, i);
345
+ }) });
380
346
  }
381
347
 
382
- /** The `FieldHelpTemplate` component renders any help desired for a field
383
- *
384
- * @param props - The `FieldHelpProps` to be rendered
385
- */
348
+ // src/FieldHelpTemplate/FieldHelpTemplate.tsx
349
+ import { helpId } from "@rjsf/utils";
350
+ import { FormHelperText } from "@chakra-ui/react";
351
+ import { jsx as jsx10 } from "react/jsx-runtime";
386
352
  function FieldHelpTemplate(props) {
387
- const {
388
- idSchema,
389
- help
390
- } = props;
353
+ const { idSchema, help } = props;
391
354
  if (!help) {
392
355
  return null;
393
356
  }
394
357
  const id = helpId(idSchema);
395
- return jsx(FormHelperText, {
396
- id: id,
397
- children: help
398
- });
358
+ return /* @__PURE__ */ jsx10(FormHelperText, { id, children: help });
399
359
  }
400
360
 
361
+ // src/FieldTemplate/FieldTemplate.tsx
362
+ import {
363
+ getTemplate as getTemplate2,
364
+ getUiOptions as getUiOptions2
365
+ } from "@rjsf/utils";
366
+ import { Text as Text2, FormControl as FormControl2 } from "@chakra-ui/react";
367
+ import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
401
368
  function FieldTemplate(props) {
402
369
  const {
403
370
  id,
@@ -421,40 +388,50 @@ function FieldTemplate(props) {
421
388
  schema,
422
389
  uiSchema
423
390
  } = props;
424
- const uiOptions = getUiOptions(uiSchema);
425
- const WrapIfAdditionalTemplate = getTemplate('WrapIfAdditionalTemplate', registry, uiOptions);
391
+ const uiOptions = getUiOptions2(uiSchema);
392
+ const WrapIfAdditionalTemplate2 = getTemplate2(
393
+ "WrapIfAdditionalTemplate",
394
+ registry,
395
+ uiOptions
396
+ );
426
397
  if (hidden) {
427
- return jsx("div", {
428
- style: {
429
- display: 'none'
430
- },
431
- children: children
432
- });
398
+ return /* @__PURE__ */ jsx11("div", { style: { display: "none" }, children });
433
399
  }
434
- return jsx(WrapIfAdditionalTemplate, {
435
- classNames: classNames,
436
- style: style,
437
- disabled: disabled,
438
- id: id,
439
- label: label,
440
- onDropPropertyClick: onDropPropertyClick,
441
- onKeyChange: onKeyChange,
442
- readonly: readonly,
443
- required: required,
444
- schema: schema,
445
- uiSchema: uiSchema,
446
- registry: registry,
447
- children: jsxs(FormControl, {
448
- isRequired: required,
449
- isInvalid: rawErrors && rawErrors.length > 0,
450
- children: [children, displayLabel && rawDescription ? jsx(Text, {
451
- mt: 2,
452
- children: description
453
- }) : null, errors, help]
454
- })
455
- });
400
+ return /* @__PURE__ */ jsx11(
401
+ WrapIfAdditionalTemplate2,
402
+ {
403
+ classNames,
404
+ style,
405
+ disabled,
406
+ id,
407
+ label,
408
+ onDropPropertyClick,
409
+ onKeyChange,
410
+ readonly,
411
+ required,
412
+ schema,
413
+ uiSchema,
414
+ registry,
415
+ children: /* @__PURE__ */ jsxs5(FormControl2, { isRequired: required, isInvalid: rawErrors && rawErrors.length > 0, children: [
416
+ children,
417
+ displayLabel && rawDescription ? /* @__PURE__ */ jsx11(Text2, { mt: 2, children: description }) : null,
418
+ errors,
419
+ help
420
+ ] })
421
+ }
422
+ );
456
423
  }
457
424
 
425
+ // src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
426
+ import { Grid as Grid2, GridItem as GridItem2 } from "@chakra-ui/react";
427
+ import {
428
+ canExpand,
429
+ descriptionId,
430
+ getTemplate as getTemplate3,
431
+ getUiOptions as getUiOptions3,
432
+ titleId
433
+ } from "@rjsf/utils";
434
+ import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
458
435
  function ObjectFieldTemplate(props) {
459
436
  const {
460
437
  description,
@@ -470,85 +447,88 @@ function ObjectFieldTemplate(props) {
470
447
  onAddClick,
471
448
  registry
472
449
  } = props;
473
- const uiOptions = getUiOptions(uiSchema);
474
- const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, uiOptions);
475
- const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, uiOptions);
476
- // Button templates are not overridden in the uiSchema
450
+ const uiOptions = getUiOptions3(uiSchema);
451
+ const TitleFieldTemplate = getTemplate3("TitleFieldTemplate", registry, uiOptions);
452
+ const DescriptionFieldTemplate = getTemplate3(
453
+ "DescriptionFieldTemplate",
454
+ registry,
455
+ uiOptions
456
+ );
477
457
  const {
478
- ButtonTemplates: {
479
- AddButton
480
- }
458
+ ButtonTemplates: { AddButton: AddButton2 }
481
459
  } = registry.templates;
482
- return jsxs(Fragment, {
483
- children: [title && jsx(TitleFieldTemplate, {
484
- id: titleId(idSchema),
485
- title: title,
486
- required: required,
487
- schema: schema,
488
- uiSchema: uiSchema,
489
- registry: registry
490
- }), description && jsx(DescriptionFieldTemplate, {
491
- id: descriptionId(idSchema),
492
- description: description,
493
- schema: schema,
494
- uiSchema: uiSchema,
495
- registry: registry
496
- }), jsxs(Grid, {
497
- gap: description ? 2 : 6,
498
- mb: 4,
499
- children: [properties.map((element, index) => element.hidden ? element.content : jsx(GridItem, {
500
- children: element.content
501
- }, `${idSchema.$id}-${element.name}-${index}`)), canExpand(schema, uiSchema, formData) && jsx(GridItem, {
502
- justifySelf: 'flex-end',
503
- children: jsx(AddButton, {
504
- className: 'object-property-expand',
460
+ return /* @__PURE__ */ jsxs6(Fragment2, { children: [
461
+ title && /* @__PURE__ */ jsx12(
462
+ TitleFieldTemplate,
463
+ {
464
+ id: titleId(idSchema),
465
+ title,
466
+ required,
467
+ schema,
468
+ uiSchema,
469
+ registry
470
+ }
471
+ ),
472
+ description && /* @__PURE__ */ jsx12(
473
+ DescriptionFieldTemplate,
474
+ {
475
+ id: descriptionId(idSchema),
476
+ description,
477
+ schema,
478
+ uiSchema,
479
+ registry
480
+ }
481
+ ),
482
+ /* @__PURE__ */ jsxs6(Grid2, { gap: description ? 2 : 6, mb: 4, children: [
483
+ properties.map(
484
+ (element, index) => element.hidden ? element.content : /* @__PURE__ */ jsx12(GridItem2, { children: element.content }, `${idSchema.$id}-${element.name}-${index}`)
485
+ ),
486
+ canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx12(GridItem2, { justifySelf: "flex-end", children: /* @__PURE__ */ jsx12(
487
+ AddButton2,
488
+ {
489
+ className: "object-property-expand",
505
490
  onClick: onAddClick(schema),
506
491
  disabled: disabled || readonly,
507
- uiSchema: uiSchema,
508
- registry: registry
509
- })
510
- })]
511
- })]
512
- });
492
+ uiSchema,
493
+ registry
494
+ }
495
+ ) })
496
+ ] })
497
+ ] });
513
498
  }
514
499
 
515
- function SubmitButton({
516
- uiSchema
517
- }) {
518
- const {
519
- submitText,
520
- norender,
521
- props: submitButtonProps
522
- } = getSubmitButtonOptions(uiSchema);
500
+ // src/SubmitButton/SubmitButton.tsx
501
+ import { Box as Box3, Button as Button2 } from "@chakra-ui/react";
502
+ import { getSubmitButtonOptions } from "@rjsf/utils";
503
+ import { jsx as jsx13 } from "react/jsx-runtime";
504
+ function SubmitButton({ uiSchema }) {
505
+ const { submitText, norender, props: submitButtonProps } = getSubmitButtonOptions(uiSchema);
523
506
  if (norender) {
524
507
  return null;
525
508
  }
526
- return jsx(Box, {
527
- marginTop: 3,
528
- children: jsx(Button, {
529
- type: 'submit',
530
- variant: 'solid',
531
- ...submitButtonProps,
532
- children: submitText
533
- })
534
- });
509
+ return /* @__PURE__ */ jsx13(Box3, { marginTop: 3, children: /* @__PURE__ */ jsx13(Button2, { type: "submit", variant: "solid", ...submitButtonProps, children: submitText }) });
535
510
  }
536
511
 
512
+ // src/TitleField/TitleField.tsx
513
+ import { Box as Box4, Divider, Heading } from "@chakra-ui/react";
514
+ import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
537
515
  function TitleField({
538
516
  id,
539
517
  title
540
518
  }) {
541
- return jsxs(Box, {
542
- id: id,
543
- mt: 1,
544
- mb: 4,
545
- children: [jsx(Heading, {
546
- as: 'h5',
547
- children: title
548
- }), jsx(Divider, {})]
549
- });
519
+ return /* @__PURE__ */ jsxs7(Box4, { id, mt: 1, mb: 4, children: [
520
+ /* @__PURE__ */ jsx14(Heading, { as: "h5", children: title }),
521
+ /* @__PURE__ */ jsx14(Divider, {})
522
+ ] });
550
523
  }
551
524
 
525
+ // src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
526
+ import {
527
+ ADDITIONAL_PROPERTY_FLAG,
528
+ TranslatableString as TranslatableString4
529
+ } from "@rjsf/utils";
530
+ import { FormControl as FormControl3, FormLabel as FormLabel2, Grid as Grid3, GridItem as GridItem3, Input as Input2 } from "@chakra-ui/react";
531
+ import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
552
532
  function WrapIfAdditionalTemplate(props) {
553
533
  const {
554
534
  children,
@@ -565,61 +545,44 @@ function WrapIfAdditionalTemplate(props) {
565
545
  schema,
566
546
  uiSchema
567
547
  } = props;
568
- const {
569
- templates,
570
- translateString
571
- } = registry;
572
- // Button templates are not overridden in the uiSchema
573
- const {
574
- RemoveButton
575
- } = templates.ButtonTemplates;
576
- const keyLabel = translateString(TranslatableString.KeyLabel, [label]);
577
- const additional = (ADDITIONAL_PROPERTY_FLAG in schema);
548
+ const { templates, translateString } = registry;
549
+ const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
550
+ const keyLabel = translateString(TranslatableString4.KeyLabel, [label]);
551
+ const additional = ADDITIONAL_PROPERTY_FLAG in schema;
578
552
  if (!additional) {
579
- return jsx("div", {
580
- className: classNames,
581
- style: style,
582
- children: children
583
- });
553
+ return /* @__PURE__ */ jsx15("div", { className: classNames, style, children });
584
554
  }
585
- const handleBlur = ({
586
- target
587
- }) => onKeyChange(target.value);
588
- return jsxs(Grid, {
589
- className: classNames,
590
- style: style,
591
- alignItems: 'center',
592
- gap: 2,
593
- children: [jsx(GridItem, {
594
- children: jsxs(FormControl, {
595
- isRequired: required,
596
- children: [jsx(FormLabel, {
597
- htmlFor: `${id}-key`,
598
- id: `${id}-key-label`,
599
- children: keyLabel
600
- }), jsx(Input, {
555
+ const handleBlur = ({ target }) => onKeyChange(target.value);
556
+ return /* @__PURE__ */ jsxs8(Grid3, { className: classNames, style, alignItems: "center", gap: 2, children: [
557
+ /* @__PURE__ */ jsx15(GridItem3, { children: /* @__PURE__ */ jsxs8(FormControl3, { isRequired: required, children: [
558
+ /* @__PURE__ */ jsx15(FormLabel2, { htmlFor: `${id}-key`, id: `${id}-key-label`, children: keyLabel }),
559
+ /* @__PURE__ */ jsx15(
560
+ Input2,
561
+ {
601
562
  defaultValue: label,
602
563
  disabled: disabled || readonly,
603
564
  id: `${id}-key`,
604
565
  name: `${id}-key`,
605
- onBlur: !readonly ? handleBlur : undefined,
606
- type: 'text',
566
+ onBlur: !readonly ? handleBlur : void 0,
567
+ type: "text",
607
568
  mb: 1
608
- })]
609
- })
610
- }), jsx(GridItem, {
611
- children: children
612
- }), jsx(GridItem, {
613
- children: jsx(RemoveButton, {
569
+ }
570
+ )
571
+ ] }) }),
572
+ /* @__PURE__ */ jsx15(GridItem3, { children }),
573
+ /* @__PURE__ */ jsx15(GridItem3, { children: /* @__PURE__ */ jsx15(
574
+ RemoveButton2,
575
+ {
614
576
  disabled: disabled || readonly,
615
577
  onClick: onDropPropertyClick(label),
616
- uiSchema: uiSchema,
617
- registry: registry
618
- })
619
- })]
620
- }, `${id}-key`);
578
+ uiSchema,
579
+ registry
580
+ }
581
+ ) })
582
+ ] }, `${id}-key`);
621
583
  }
622
584
 
585
+ // src/Templates/Templates.ts
623
586
  function generateTemplates() {
624
587
  return {
625
588
  ArrayFieldItemTemplate,
@@ -643,59 +606,52 @@ function generateTemplates() {
643
606
  WrapIfAdditionalTemplate
644
607
  };
645
608
  }
646
- var Templates = /*#__PURE__*/generateTemplates();
609
+ var Templates_default = generateTemplates();
647
610
 
648
- const rangeOptions = (start, stop) => {
611
+ // src/AltDateWidget/AltDateWidget.tsx
612
+ import { useEffect, useState } from "react";
613
+ import {
614
+ ariaDescribedByIds as ariaDescribedByIds2,
615
+ pad,
616
+ parseDateString,
617
+ toDateString,
618
+ TranslatableString as TranslatableString5
619
+ } from "@rjsf/utils";
620
+ import { Box as Box5, Button as Button3 } from "@chakra-ui/react";
621
+ import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
622
+ var rangeOptions = (start, stop) => {
649
623
  const options = [];
650
624
  for (let i = start; i <= stop; i++) {
651
- options.push({
652
- value: i,
653
- label: pad(i, 2)
654
- });
625
+ options.push({ value: i, label: pad(i, 2) });
655
626
  }
656
627
  return options;
657
628
  };
658
629
  function DateElement(props) {
659
- const {
660
- SelectWidget
661
- } = props.registry.widgets;
662
- const value = props.value ? props.value : undefined;
663
- return jsx(SelectWidget, {
664
- ...props,
665
- label: '',
666
- className: 'form-control',
667
- onChange: elemValue => props.select(props.type, elemValue),
668
- options: {
669
- enumOptions: rangeOptions(props.range[0], props.range[1])
670
- },
671
- placeholder: props.type,
672
- schema: {
673
- type: 'integer'
674
- },
675
- value: value,
676
- "aria-describedby": ariaDescribedByIds(props.name)
677
- });
630
+ const { SelectWidget: SelectWidget2 } = props.registry.widgets;
631
+ const value = props.value ? props.value : void 0;
632
+ return /* @__PURE__ */ jsx16(
633
+ SelectWidget2,
634
+ {
635
+ ...props,
636
+ label: "",
637
+ className: "form-control",
638
+ onChange: (elemValue) => props.select(props.type, elemValue),
639
+ options: {
640
+ enumOptions: rangeOptions(props.range[0], props.range[1])
641
+ },
642
+ placeholder: props.type,
643
+ schema: { type: "integer" },
644
+ value,
645
+ "aria-describedby": ariaDescribedByIds2(props.name)
646
+ }
647
+ );
678
648
  }
679
- const readyForChange = state => {
680
- return Object.keys(state).every(key => typeof state[key] !== 'undefined' && state[key] !== -1);
649
+ var readyForChange = (state) => {
650
+ return Object.keys(state).every((key) => typeof state[key] !== "undefined" && state[key] !== -1);
681
651
  };
682
652
  function AltDateWidget(props) {
683
- const {
684
- autofocus,
685
- disabled,
686
- id,
687
- onBlur,
688
- onChange,
689
- onFocus,
690
- options,
691
- readonly,
692
- registry,
693
- showTime,
694
- value
695
- } = props;
696
- const {
697
- translateString
698
- } = registry;
653
+ const { autofocus, disabled, id, onBlur, onChange, onFocus, options, readonly, registry, showTime, value } = props;
654
+ const { translateString } = registry;
699
655
  const [state, setState] = useState(parseDateString(value, showTime));
700
656
  useEffect(() => {
701
657
  setState(parseDateString(value, showTime));
@@ -703,7 +659,7 @@ function AltDateWidget(props) {
703
659
  const handleChange = (property, nextValue) => {
704
660
  const nextState = {
705
661
  ...state,
706
- [property]: typeof nextValue === 'undefined' ? -1 : nextValue
662
+ [property]: typeof nextValue === "undefined" ? -1 : nextValue
707
663
  };
708
664
  if (readyForChange(nextState)) {
709
665
  onChange(toDateString(nextState, showTime));
@@ -711,98 +667,63 @@ function AltDateWidget(props) {
711
667
  setState(nextState);
712
668
  }
713
669
  };
714
- const handleNow = event => {
670
+ const handleNow = (event) => {
715
671
  event.preventDefault();
716
672
  if (disabled || readonly) {
717
673
  return;
718
674
  }
719
- const nextState = parseDateString(new Date().toJSON(), showTime);
675
+ const nextState = parseDateString((/* @__PURE__ */ new Date()).toJSON(), showTime);
720
676
  onChange(toDateString(nextState, showTime));
721
677
  };
722
- const handleClear = event => {
678
+ const handleClear = (event) => {
723
679
  event.preventDefault();
724
680
  if (disabled || readonly) {
725
681
  return;
726
682
  }
727
- onChange(undefined);
683
+ onChange(void 0);
728
684
  };
729
685
  const dateElementProps = () => {
730
- const {
731
- year,
732
- month,
733
- day,
734
- hour,
735
- minute,
736
- second
737
- } = state;
738
- const data = [{
739
- type: 'year',
740
- range: options.yearsRange,
741
- value: year
742
- }, {
743
- type: 'month',
744
- range: [1, 12],
745
- value: month
746
- }, {
747
- type: 'day',
748
- range: [1, 31],
749
- value: day
750
- }];
686
+ const { year, month, day, hour, minute, second } = state;
687
+ const data = [
688
+ { type: "year", range: options.yearsRange, value: year },
689
+ { type: "month", range: [1, 12], value: month },
690
+ { type: "day", range: [1, 31], value: day }
691
+ ];
751
692
  if (showTime) {
752
- data.push({
753
- type: 'hour',
754
- range: [0, 23],
755
- value: hour
756
- }, {
757
- type: 'minute',
758
- range: [0, 59],
759
- value: minute
760
- }, {
761
- type: 'second',
762
- range: [0, 59],
763
- value: second
764
- });
693
+ data.push(
694
+ { type: "hour", range: [0, 23], value: hour },
695
+ { type: "minute", range: [0, 59], value: minute },
696
+ { type: "second", range: [0, 59], value: second }
697
+ );
765
698
  }
766
699
  return data;
767
700
  };
768
- return jsxs(Box, {
769
- children: [jsx(Box, {
770
- display: 'flex',
771
- flexWrap: 'wrap',
772
- alignItems: 'center',
773
- children: dateElementProps().map((elemProps, i) => {
774
- const elemId = id + '_' + elemProps.type;
775
- return jsx(Box, {
776
- mr: '2',
777
- mb: '2',
778
- children: jsx(DateElement, {
779
- ...props,
780
- ...elemProps,
781
- autofocus: autofocus && i === 0,
782
- disabled: disabled,
783
- id: elemId,
784
- name: id,
785
- onBlur: onBlur,
786
- onFocus: onFocus,
787
- readonly: readonly,
788
- registry: registry,
789
- select: handleChange,
790
- value: elemProps.value < 0 ? '' : elemProps.value
791
- })
792
- }, elemId);
793
- })
794
- }), jsxs(Box, {
795
- display: 'flex',
796
- children: [!options.hideNowButton && jsx(Button, {
797
- onClick: e => handleNow(e),
798
- mr: '2',
799
- children: translateString(TranslatableString.NowLabel)
800
- }), !options.hideClearButton && jsx(Button, {
801
- onClick: e => handleClear(e),
802
- children: translateString(TranslatableString.ClearLabel)
803
- })]
804
- })]
805
- });
701
+ return /* @__PURE__ */ jsxs9(Box5, { children: [
702
+ /* @__PURE__ */ jsx16(Box5, { display: "flex", flexWrap: "wrap", alignItems: "center", children: dateElementProps().map((elemProps, i) => {
703
+ const elemId = id + "_" + elemProps.type;
704
+ return /* @__PURE__ */ jsx16(Box5, { mr: "2", mb: "2", children: /* @__PURE__ */ jsx16(
705
+ DateElement,
706
+ {
707
+ ...props,
708
+ ...elemProps,
709
+ autofocus: autofocus && i === 0,
710
+ disabled,
711
+ id: elemId,
712
+ name: id,
713
+ onBlur,
714
+ onFocus,
715
+ readonly,
716
+ registry,
717
+ select: handleChange,
718
+ value: elemProps.value < 0 ? "" : elemProps.value
719
+ }
720
+ ) }, elemId);
721
+ }) }),
722
+ /* @__PURE__ */ jsxs9(Box5, { display: "flex", children: [
723
+ !options.hideNowButton && /* @__PURE__ */ jsx16(Button3, { onClick: (e) => handleNow(e), mr: "2", children: translateString(TranslatableString5.NowLabel) }),
724
+ !options.hideClearButton && /* @__PURE__ */ jsx16(Button3, { onClick: (e) => handleClear(e), children: translateString(TranslatableString5.ClearLabel) })
725
+ ] })
726
+ ] });
806
727
  }
807
728
  AltDateWidget.defaultProps = {
808
729
  autofocus: false,
@@ -810,24 +731,33 @@ AltDateWidget.defaultProps = {
810
731
  readonly: false,
811
732
  showTime: false,
812
733
  options: {
813
- yearsRange: [1900, /*#__PURE__*/new Date().getFullYear() + 2]
734
+ yearsRange: [1900, (/* @__PURE__ */ new Date()).getFullYear() + 2]
814
735
  }
815
736
  };
737
+ var AltDateWidget_default = AltDateWidget;
816
738
 
739
+ // src/AltDateTimeWidget/AltDateTimeWidget.tsx
740
+ import { jsx as jsx17 } from "react/jsx-runtime";
817
741
  function AltDateTimeWidget(props) {
818
- const {
819
- AltDateWidget
820
- } = props.registry.widgets;
821
- return jsx(AltDateWidget, {
822
- ...props,
823
- showTime: true
824
- });
742
+ const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
743
+ return /* @__PURE__ */ jsx17(AltDateWidget2, { ...props, showTime: true });
825
744
  }
826
745
  AltDateTimeWidget.defaultProps = {
827
- ...AltDateWidget.defaultProps,
746
+ ...AltDateWidget_default.defaultProps,
828
747
  showTime: true
829
748
  };
749
+ var AltDateTimeWidget_default = AltDateTimeWidget;
830
750
 
751
+ // src/CheckboxWidget/CheckboxWidget.tsx
752
+ import { Checkbox, FormControl as FormControl4, Text as Text3 } from "@chakra-ui/react";
753
+ import {
754
+ ariaDescribedByIds as ariaDescribedByIds3,
755
+ descriptionId as descriptionId2,
756
+ getTemplate as getTemplate4,
757
+ labelValue as labelValue2,
758
+ schemaRequiresTrueValue
759
+ } from "@rjsf/utils";
760
+ import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
831
761
  function CheckboxWidget(props) {
832
762
  const {
833
763
  id,
@@ -844,56 +774,56 @@ function CheckboxWidget(props) {
844
774
  uiSchema,
845
775
  schema
846
776
  } = props;
847
- const chakraProps = getChakra({
848
- uiSchema
849
- });
850
- // Because an unchecked checkbox will cause html5 validation to fail, only add
851
- // the "required" attribute if the field value must be "true", due to the
852
- // "const" or "enum" keywords
777
+ const chakraProps = getChakra({ uiSchema });
853
778
  const required = schemaRequiresTrueValue(schema);
854
- const DescriptionFieldTemplate = getTemplate('DescriptionFieldTemplate', registry, options);
779
+ const DescriptionFieldTemplate = getTemplate4(
780
+ "DescriptionFieldTemplate",
781
+ registry,
782
+ options
783
+ );
855
784
  const description = options.description || schema.description;
856
- const _onChange = ({
857
- target: {
858
- checked
859
- }
860
- }) => onChange(checked);
861
- const _onBlur = ({
862
- target: {
863
- value
864
- }
865
- }) => onBlur(id, value);
866
- const _onFocus = ({
867
- target: {
868
- value
869
- }
870
- }) => onFocus(id, value);
871
- return jsxs(FormControl, {
872
- mb: 1,
873
- ...chakraProps,
874
- isRequired: required,
875
- children: [!hideLabel && !!description && jsx(DescriptionFieldTemplate, {
876
- id: descriptionId(id),
877
- description: description,
878
- schema: schema,
879
- uiSchema: uiSchema,
880
- registry: registry
881
- }), jsx(Checkbox, {
882
- id: id,
883
- name: id,
884
- isChecked: typeof value === 'undefined' ? false : value,
885
- isDisabled: disabled || readonly,
886
- onChange: _onChange,
887
- onBlur: _onBlur,
888
- onFocus: _onFocus,
889
- "aria-describedby": ariaDescribedByIds(id),
890
- children: labelValue(jsx(Text, {
891
- children: label
892
- }), hideLabel || !label)
893
- })]
894
- });
785
+ const _onChange = ({ target: { checked } }) => onChange(checked);
786
+ const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
787
+ const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
788
+ return /* @__PURE__ */ jsxs10(FormControl4, { mb: 1, ...chakraProps, isRequired: required, children: [
789
+ !hideLabel && !!description && /* @__PURE__ */ jsx18(
790
+ DescriptionFieldTemplate,
791
+ {
792
+ id: descriptionId2(id),
793
+ description,
794
+ schema,
795
+ uiSchema,
796
+ registry
797
+ }
798
+ ),
799
+ /* @__PURE__ */ jsx18(
800
+ Checkbox,
801
+ {
802
+ id,
803
+ name: id,
804
+ isChecked: typeof value === "undefined" ? false : value,
805
+ isDisabled: disabled || readonly,
806
+ onChange: _onChange,
807
+ onBlur: _onBlur,
808
+ onFocus: _onFocus,
809
+ "aria-describedby": ariaDescribedByIds3(id),
810
+ children: labelValue2(/* @__PURE__ */ jsx18(Text3, { children: label }), hideLabel || !label)
811
+ }
812
+ )
813
+ ] });
895
814
  }
896
815
 
816
+ // src/CheckboxesWidget/CheckboxesWidget.tsx
817
+ import { CheckboxGroup, Checkbox as Checkbox2, FormLabel as FormLabel3, FormControl as FormControl5, Text as Text4, Stack } from "@chakra-ui/react";
818
+ import {
819
+ ariaDescribedByIds as ariaDescribedByIds4,
820
+ enumOptionsIndexForValue,
821
+ enumOptionsIsSelected,
822
+ enumOptionsValueForIndex,
823
+ labelValue as labelValue3,
824
+ optionId
825
+ } from "@rjsf/utils";
826
+ import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
897
827
  function CheckboxesWidget(props) {
898
828
  const {
899
829
  id,
@@ -910,65 +840,68 @@ function CheckboxesWidget(props) {
910
840
  uiSchema,
911
841
  rawErrors = []
912
842
  } = props;
913
- const {
914
- enumOptions,
915
- enumDisabled,
916
- emptyValue
917
- } = options;
918
- const chakraProps = getChakra({
919
- uiSchema
920
- });
843
+ const { enumOptions, enumDisabled, emptyValue } = options;
844
+ const chakraProps = getChakra({ uiSchema });
921
845
  const checkboxesValues = Array.isArray(value) ? value : [value];
922
- const _onBlur = ({
923
- target: {
924
- value
925
- }
926
- }) => onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
927
- const _onFocus = ({
928
- target: {
929
- value
930
- }
931
- }) => onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
846
+ const _onBlur = ({ target: { value: value2 } }) => onBlur(id, enumOptionsValueForIndex(value2, enumOptions, emptyValue));
847
+ const _onFocus = ({ target: { value: value2 } }) => onFocus(id, enumOptionsValueForIndex(value2, enumOptions, emptyValue));
932
848
  const row = options ? options.inline : false;
933
849
  const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, true);
934
- return jsxs(FormControl, {
935
- mb: 1,
936
- ...chakraProps,
937
- isDisabled: disabled || readonly,
938
- isRequired: required,
939
- isReadOnly: readonly,
940
- isInvalid: rawErrors && rawErrors.length > 0,
941
- children: [labelValue(jsx(FormLabel, {
942
- htmlFor: id,
943
- id: `${id}-label`,
944
- children: label
945
- }), hideLabel || !label), jsx(CheckboxGroup, {
946
- onChange: option => onChange(enumOptionsValueForIndex(option, enumOptions, emptyValue)),
947
- defaultValue: selectedIndexes,
948
- "aria-describedby": ariaDescribedByIds(id),
949
- children: jsx(Stack, {
950
- direction: row ? 'row' : 'column',
951
- children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
952
- const checked = enumOptionsIsSelected(option.value, checkboxesValues);
953
- const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
954
- return jsx(Checkbox, {
955
- id: optionId(id, index),
956
- name: id,
957
- value: String(index),
958
- isChecked: checked,
959
- isDisabled: disabled || itemDisabled || readonly,
960
- onBlur: _onBlur,
961
- onFocus: _onFocus,
962
- children: option.label && jsx(Text, {
963
- children: option.label
964
- })
965
- }, index);
966
- })
967
- })
968
- })]
969
- });
850
+ return /* @__PURE__ */ jsxs11(
851
+ FormControl5,
852
+ {
853
+ mb: 1,
854
+ ...chakraProps,
855
+ isDisabled: disabled || readonly,
856
+ isRequired: required,
857
+ isReadOnly: readonly,
858
+ isInvalid: rawErrors && rawErrors.length > 0,
859
+ children: [
860
+ labelValue3(
861
+ /* @__PURE__ */ jsx19(FormLabel3, { htmlFor: id, id: `${id}-label`, children: label }),
862
+ hideLabel || !label
863
+ ),
864
+ /* @__PURE__ */ jsx19(
865
+ CheckboxGroup,
866
+ {
867
+ onChange: (option) => onChange(enumOptionsValueForIndex(option, enumOptions, emptyValue)),
868
+ defaultValue: selectedIndexes,
869
+ "aria-describedby": ariaDescribedByIds4(id),
870
+ children: /* @__PURE__ */ jsx19(Stack, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
871
+ const checked = enumOptionsIsSelected(option.value, checkboxesValues);
872
+ const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
873
+ return /* @__PURE__ */ jsx19(
874
+ Checkbox2,
875
+ {
876
+ id: optionId(id, index),
877
+ name: id,
878
+ value: String(index),
879
+ isChecked: checked,
880
+ isDisabled: disabled || itemDisabled || readonly,
881
+ onBlur: _onBlur,
882
+ onFocus: _onFocus,
883
+ children: option.label && /* @__PURE__ */ jsx19(Text4, { children: option.label })
884
+ },
885
+ index
886
+ );
887
+ }) })
888
+ }
889
+ )
890
+ ]
891
+ }
892
+ );
970
893
  }
971
894
 
895
+ // src/RadioWidget/RadioWidget.tsx
896
+ import { FormControl as FormControl6, FormLabel as FormLabel4, Radio, RadioGroup, Stack as Stack2 } from "@chakra-ui/react";
897
+ import {
898
+ ariaDescribedByIds as ariaDescribedByIds5,
899
+ enumOptionsIndexForValue as enumOptionsIndexForValue2,
900
+ enumOptionsValueForIndex as enumOptionsValueForIndex2,
901
+ labelValue as labelValue4,
902
+ optionId as optionId2
903
+ } from "@rjsf/utils";
904
+ import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
972
905
  function RadioWidget({
973
906
  id,
974
907
  options,
@@ -983,60 +916,53 @@ function RadioWidget({
983
916
  onFocus,
984
917
  uiSchema
985
918
  }) {
986
- const {
987
- enumOptions,
988
- enumDisabled,
989
- emptyValue
990
- } = options;
991
- const chakraProps = getChakra({
992
- uiSchema
993
- });
994
- const _onChange = nextValue => onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
995
- const _onBlur = ({
996
- target: {
997
- value
998
- }
999
- }) => onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
1000
- const _onFocus = ({
1001
- target: {
1002
- value
1003
- }
1004
- }) => onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
919
+ const { enumOptions, enumDisabled, emptyValue } = options;
920
+ const chakraProps = getChakra({ uiSchema });
921
+ const _onChange = (nextValue) => onChange(enumOptionsValueForIndex2(nextValue, enumOptions, emptyValue));
922
+ const _onBlur = ({ target: { value: value2 } }) => onBlur(id, enumOptionsValueForIndex2(value2, enumOptions, emptyValue));
923
+ const _onFocus = ({ target: { value: value2 } }) => onFocus(id, enumOptionsValueForIndex2(value2, enumOptions, emptyValue));
1005
924
  const row = options ? options.inline : false;
1006
- const selectedIndex = enumOptionsIndexForValue(value, enumOptions) ?? null;
1007
- return jsxs(FormControl, {
1008
- mb: 1,
1009
- ...chakraProps,
1010
- isDisabled: disabled || readonly,
1011
- isRequired: required,
1012
- isReadOnly: readonly,
1013
- children: [labelValue(jsx(FormLabel, {
1014
- htmlFor: id,
1015
- id: `${id}-label`,
1016
- children: label
1017
- }), hideLabel || !label), jsx(RadioGroup, {
1018
- onChange: _onChange,
1019
- onBlur: _onBlur,
1020
- onFocus: _onFocus,
1021
- value: selectedIndex,
1022
- name: id,
1023
- "aria-describedby": ariaDescribedByIds(id),
1024
- children: jsx(Stack, {
1025
- direction: row ? 'row' : 'column',
1026
- children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
925
+ const selectedIndex = enumOptionsIndexForValue2(value, enumOptions) ?? null;
926
+ return /* @__PURE__ */ jsxs12(FormControl6, { mb: 1, ...chakraProps, isDisabled: disabled || readonly, isRequired: required, isReadOnly: readonly, children: [
927
+ labelValue4(
928
+ /* @__PURE__ */ jsx20(FormLabel4, { htmlFor: id, id: `${id}-label`, children: label }),
929
+ hideLabel || !label
930
+ ),
931
+ /* @__PURE__ */ jsx20(
932
+ RadioGroup,
933
+ {
934
+ onChange: _onChange,
935
+ onBlur: _onBlur,
936
+ onFocus: _onFocus,
937
+ value: selectedIndex,
938
+ name: id,
939
+ "aria-describedby": ariaDescribedByIds5(id),
940
+ children: /* @__PURE__ */ jsx20(Stack2, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
1027
941
  const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
1028
- return jsx(Radio, {
1029
- value: String(index),
1030
- id: optionId(id, index),
1031
- disabled: disabled || itemDisabled || readonly,
1032
- children: option.label
1033
- }, index);
1034
- })
1035
- })
1036
- })]
1037
- });
942
+ return /* @__PURE__ */ jsx20(
943
+ Radio,
944
+ {
945
+ value: String(index),
946
+ id: optionId2(id, index),
947
+ disabled: disabled || itemDisabled || readonly,
948
+ children: option.label
949
+ },
950
+ index
951
+ );
952
+ }) })
953
+ }
954
+ )
955
+ ] });
1038
956
  }
1039
957
 
958
+ // src/RangeWidget/RangeWidget.tsx
959
+ import { FormControl as FormControl7, FormLabel as FormLabel5, Slider, SliderFilledTrack, SliderThumb, SliderTrack } from "@chakra-ui/react";
960
+ import {
961
+ ariaDescribedByIds as ariaDescribedByIds6,
962
+ labelValue as labelValue5,
963
+ rangeSpec
964
+ } from "@rjsf/utils";
965
+ import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
1040
966
  function RangeWidget({
1041
967
  value,
1042
968
  readonly,
@@ -1051,48 +977,43 @@ function RangeWidget({
1051
977
  hideLabel,
1052
978
  id
1053
979
  }) {
1054
- const chakraProps = getChakra({
1055
- uiSchema
1056
- });
1057
- const sliderWidgetProps = {
1058
- value,
1059
- label,
1060
- id,
1061
- ...rangeSpec(schema)
1062
- };
1063
- const _onChange = value => onChange(value === undefined ? options.emptyValue : value);
1064
- const _onBlur = ({
1065
- target: {
1066
- value
1067
- }
1068
- }) => onBlur(id, value);
1069
- const _onFocus = ({
1070
- target: {
1071
- value
1072
- }
1073
- }) => onFocus(id, value);
1074
- return jsxs(FormControl, {
1075
- mb: 1,
1076
- ...chakraProps,
1077
- children: [labelValue(jsx(FormLabel, {
1078
- htmlFor: id,
1079
- children: label
1080
- }), hideLabel || !label), jsxs(Slider, {
1081
- ...sliderWidgetProps,
1082
- id: id,
1083
- name: id,
1084
- isDisabled: disabled || readonly,
1085
- onChange: _onChange,
1086
- onBlur: _onBlur,
1087
- onFocus: _onFocus,
1088
- "aria-describedby": ariaDescribedByIds(id),
1089
- children: [jsx(SliderTrack, {
1090
- children: jsx(SliderFilledTrack, {})
1091
- }), jsx(SliderThumb, {})]
1092
- })]
1093
- });
980
+ const chakraProps = getChakra({ uiSchema });
981
+ const sliderWidgetProps = { value, label, id, ...rangeSpec(schema) };
982
+ const _onChange = (value2) => onChange(value2 === void 0 ? options.emptyValue : value2);
983
+ const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
984
+ const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
985
+ return /* @__PURE__ */ jsxs13(FormControl7, { mb: 1, ...chakraProps, children: [
986
+ labelValue5(/* @__PURE__ */ jsx21(FormLabel5, { htmlFor: id, children: label }), hideLabel || !label),
987
+ /* @__PURE__ */ jsxs13(
988
+ Slider,
989
+ {
990
+ ...sliderWidgetProps,
991
+ id,
992
+ name: id,
993
+ isDisabled: disabled || readonly,
994
+ onChange: _onChange,
995
+ onBlur: _onBlur,
996
+ onFocus: _onFocus,
997
+ "aria-describedby": ariaDescribedByIds6(id),
998
+ children: [
999
+ /* @__PURE__ */ jsx21(SliderTrack, { children: /* @__PURE__ */ jsx21(SliderFilledTrack, {}) }),
1000
+ /* @__PURE__ */ jsx21(SliderThumb, {})
1001
+ ]
1002
+ }
1003
+ )
1004
+ ] });
1094
1005
  }
1095
1006
 
1007
+ // src/SelectWidget/SelectWidget.tsx
1008
+ import { FormControl as FormControl8, FormLabel as FormLabel6 } from "@chakra-ui/react";
1009
+ import {
1010
+ ariaDescribedByIds as ariaDescribedByIds7,
1011
+ enumOptionsIndexForValue as enumOptionsIndexForValue3,
1012
+ enumOptionsValueForIndex as enumOptionsValueForIndex3,
1013
+ labelValue as labelValue6
1014
+ } from "@rjsf/utils";
1015
+ import { Select } from "chakra-react-select";
1016
+ import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
1096
1017
  function SelectWidget(props) {
1097
1018
  const {
1098
1019
  id,
@@ -1112,84 +1033,88 @@ function SelectWidget(props) {
1112
1033
  rawErrors = [],
1113
1034
  uiSchema
1114
1035
  } = props;
1115
- const {
1116
- enumOptions,
1117
- enumDisabled,
1118
- emptyValue
1119
- } = options;
1120
- const chakraProps = getChakra({
1121
- uiSchema
1122
- });
1123
- const _onMultiChange = e => {
1124
- return onChange(enumOptionsValueForIndex(e.map(v => {
1125
- return v.value;
1126
- }), enumOptions, emptyValue));
1036
+ const { enumOptions, enumDisabled, emptyValue } = options;
1037
+ const chakraProps = getChakra({ uiSchema });
1038
+ const _onMultiChange = (e) => {
1039
+ return onChange(
1040
+ enumOptionsValueForIndex3(
1041
+ e.map((v) => {
1042
+ return v.value;
1043
+ }),
1044
+ enumOptions,
1045
+ emptyValue
1046
+ )
1047
+ );
1127
1048
  };
1128
- const _onChange = e => {
1129
- return onChange(enumOptionsValueForIndex(e.value, enumOptions, emptyValue));
1049
+ const _onChange = (e) => {
1050
+ return onChange(enumOptionsValueForIndex3(e.value, enumOptions, emptyValue));
1130
1051
  };
1131
- const _onBlur = ({
1132
- target: {
1133
- value
1134
- }
1135
- }) => onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
1136
- const _onFocus = ({
1137
- target: {
1138
- value
1139
- }
1140
- }) => onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
1052
+ const _onBlur = ({ target: { value: value2 } }) => onBlur(id, enumOptionsValueForIndex3(value2, enumOptions, emptyValue));
1053
+ const _onFocus = ({ target: { value: value2 } }) => onFocus(id, enumOptionsValueForIndex3(value2, enumOptions, emptyValue));
1141
1054
  const _valueLabelMap = {};
1142
1055
  const displayEnumOptions = Array.isArray(enumOptions) ? enumOptions.map((option, index) => {
1143
- const {
1144
- value,
1145
- label
1146
- } = option;
1147
- _valueLabelMap[index] = label || String(value);
1056
+ const { value: value2, label: label2 } = option;
1057
+ _valueLabelMap[index] = label2 || String(value2);
1148
1058
  return {
1149
- label,
1059
+ label: label2,
1150
1060
  value: String(index),
1151
- isDisabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1
1061
+ isDisabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) !== -1
1152
1062
  };
1153
1063
  }) : [];
1154
- const isMultiple = typeof multiple !== 'undefined' && Boolean(enumOptions);
1155
- const selectedIndex = enumOptionsIndexForValue(value, enumOptions, isMultiple);
1156
- const formValue = isMultiple ? (selectedIndex || []).map(i => {
1064
+ const isMultiple = typeof multiple !== "undefined" && Boolean(enumOptions);
1065
+ const selectedIndex = enumOptionsIndexForValue3(value, enumOptions, isMultiple);
1066
+ const formValue = isMultiple ? (selectedIndex || []).map((i) => {
1157
1067
  return {
1158
1068
  label: _valueLabelMap[i],
1159
1069
  value: i
1160
1070
  };
1161
1071
  }) : {
1162
- label: _valueLabelMap[selectedIndex] || '',
1072
+ label: _valueLabelMap[selectedIndex] || "",
1163
1073
  selectedIndex
1164
1074
  };
1165
- return jsxs(FormControl, {
1166
- mb: 1,
1167
- ...chakraProps,
1168
- isDisabled: disabled || readonly,
1169
- isRequired: required,
1170
- isReadOnly: readonly,
1171
- isInvalid: rawErrors && rawErrors.length > 0,
1172
- children: [labelValue(jsx(FormLabel, {
1173
- htmlFor: id,
1174
- id: `${id}-label`,
1175
- children: label
1176
- }), hideLabel || !label), jsx(Select, {
1177
- inputId: id,
1178
- name: id,
1179
- isMulti: isMultiple,
1180
- options: displayEnumOptions,
1181
- placeholder: placeholder,
1182
- closeMenuOnSelect: !isMultiple,
1183
- onBlur: _onBlur,
1184
- onChange: isMultiple ? _onMultiChange : _onChange,
1185
- onFocus: _onFocus,
1186
- autoFocus: autofocus,
1187
- value: formValue,
1188
- "aria-describedby": ariaDescribedByIds(id)
1189
- })]
1190
- });
1075
+ return /* @__PURE__ */ jsxs14(
1076
+ FormControl8,
1077
+ {
1078
+ mb: 1,
1079
+ ...chakraProps,
1080
+ isDisabled: disabled || readonly,
1081
+ isRequired: required,
1082
+ isReadOnly: readonly,
1083
+ isInvalid: rawErrors && rawErrors.length > 0,
1084
+ children: [
1085
+ labelValue6(
1086
+ /* @__PURE__ */ jsx22(FormLabel6, { htmlFor: id, id: `${id}-label`, children: label }),
1087
+ hideLabel || !label
1088
+ ),
1089
+ /* @__PURE__ */ jsx22(
1090
+ Select,
1091
+ {
1092
+ inputId: id,
1093
+ name: id,
1094
+ isMulti: isMultiple,
1095
+ options: displayEnumOptions,
1096
+ placeholder,
1097
+ closeMenuOnSelect: !isMultiple,
1098
+ onBlur: _onBlur,
1099
+ onChange: isMultiple ? _onMultiChange : _onChange,
1100
+ onFocus: _onFocus,
1101
+ autoFocus: autofocus,
1102
+ value: formValue,
1103
+ "aria-describedby": ariaDescribedByIds7(id)
1104
+ }
1105
+ )
1106
+ ]
1107
+ }
1108
+ );
1191
1109
  }
1192
1110
 
1111
+ // src/TextareaWidget/TextareaWidget.tsx
1112
+ import { FormControl as FormControl9, FormLabel as FormLabel7, Textarea } from "@chakra-ui/react";
1113
+ import {
1114
+ ariaDescribedByIds as ariaDescribedByIds8,
1115
+ labelValue as labelValue7
1116
+ } from "@rjsf/utils";
1117
+ import { jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
1193
1118
  function TextareaWidget({
1194
1119
  id,
1195
1120
  placeholder,
@@ -1207,107 +1132,99 @@ function TextareaWidget({
1207
1132
  required,
1208
1133
  rawErrors
1209
1134
  }) {
1210
- const chakraProps = getChakra({
1211
- uiSchema
1212
- });
1213
- const _onChange = ({
1214
- target: {
1215
- value
1216
- }
1217
- }) => onChange(value === '' ? options.emptyValue : value);
1218
- const _onBlur = ({
1219
- target: {
1220
- value
1221
- }
1222
- }) => onBlur(id, value);
1223
- const _onFocus = ({
1224
- target: {
1225
- value
1135
+ const chakraProps = getChakra({ uiSchema });
1136
+ const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
1137
+ const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
1138
+ const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
1139
+ return /* @__PURE__ */ jsxs15(
1140
+ FormControl9,
1141
+ {
1142
+ mb: 1,
1143
+ ...chakraProps,
1144
+ isDisabled: disabled || readonly,
1145
+ isRequired: required,
1146
+ isReadOnly: readonly,
1147
+ isInvalid: rawErrors && rawErrors.length > 0,
1148
+ children: [
1149
+ labelValue7(/* @__PURE__ */ jsx23(FormLabel7, { htmlFor: id, children: label }), hideLabel || !label),
1150
+ /* @__PURE__ */ jsx23(
1151
+ Textarea,
1152
+ {
1153
+ id,
1154
+ name: id,
1155
+ value: value ?? "",
1156
+ placeholder,
1157
+ autoFocus: autofocus,
1158
+ onChange: _onChange,
1159
+ onBlur: _onBlur,
1160
+ onFocus: _onFocus,
1161
+ "aria-describedby": ariaDescribedByIds8(id)
1162
+ }
1163
+ )
1164
+ ]
1226
1165
  }
1227
- }) => onFocus(id, value);
1228
- return jsxs(FormControl, {
1229
- mb: 1,
1230
- ...chakraProps,
1231
- isDisabled: disabled || readonly,
1232
- isRequired: required,
1233
- isReadOnly: readonly,
1234
- isInvalid: rawErrors && rawErrors.length > 0,
1235
- children: [labelValue(jsx(FormLabel, {
1236
- htmlFor: id,
1237
- children: label
1238
- }), hideLabel || !label), jsx(Textarea, {
1239
- id: id,
1240
- name: id,
1241
- value: value ?? '',
1242
- placeholder: placeholder,
1243
- autoFocus: autofocus,
1244
- onChange: _onChange,
1245
- onBlur: _onBlur,
1246
- onFocus: _onFocus,
1247
- "aria-describedby": ariaDescribedByIds(id)
1248
- })]
1249
- });
1166
+ );
1250
1167
  }
1251
1168
 
1169
+ // src/UpDownWidget/UpDownWidget.tsx
1170
+ import {
1171
+ NumberInput,
1172
+ NumberDecrementStepper,
1173
+ NumberIncrementStepper,
1174
+ NumberInputField,
1175
+ NumberInputStepper,
1176
+ FormControl as FormControl10,
1177
+ FormLabel as FormLabel8
1178
+ } from "@chakra-ui/react";
1179
+ import {
1180
+ ariaDescribedByIds as ariaDescribedByIds9,
1181
+ labelValue as labelValue8
1182
+ } from "@rjsf/utils";
1183
+ import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
1252
1184
  function UpDownWidget(props) {
1253
- const {
1254
- id,
1255
- uiSchema,
1256
- readonly,
1257
- disabled,
1258
- label,
1259
- hideLabel,
1260
- value,
1261
- onChange,
1262
- onBlur,
1263
- onFocus,
1264
- rawErrors,
1265
- required
1266
- } = props;
1267
- const chakraProps = getChakra({
1268
- uiSchema
1269
- });
1270
- const _onChange = value => onChange(value);
1271
- const _onBlur = ({
1272
- target: {
1273
- value
1274
- }
1275
- }) => onBlur(id, value);
1276
- const _onFocus = ({
1277
- target: {
1278
- value
1185
+ const { id, uiSchema, readonly, disabled, label, hideLabel, value, onChange, onBlur, onFocus, rawErrors, required } = props;
1186
+ const chakraProps = getChakra({ uiSchema });
1187
+ const _onChange = (value2) => onChange(value2);
1188
+ const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
1189
+ const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
1190
+ return /* @__PURE__ */ jsxs16(
1191
+ FormControl10,
1192
+ {
1193
+ mb: 1,
1194
+ ...chakraProps,
1195
+ isDisabled: disabled || readonly,
1196
+ isRequired: required,
1197
+ isReadOnly: readonly,
1198
+ isInvalid: rawErrors && rawErrors.length > 0,
1199
+ children: [
1200
+ labelValue8(/* @__PURE__ */ jsx24(FormLabel8, { htmlFor: id, children: label }), hideLabel || !label),
1201
+ /* @__PURE__ */ jsxs16(
1202
+ NumberInput,
1203
+ {
1204
+ value: value ?? "",
1205
+ onChange: _onChange,
1206
+ onBlur: _onBlur,
1207
+ onFocus: _onFocus,
1208
+ "aria-describedby": ariaDescribedByIds9(id),
1209
+ children: [
1210
+ /* @__PURE__ */ jsx24(NumberInputField, { id, name: id }),
1211
+ /* @__PURE__ */ jsxs16(NumberInputStepper, { children: [
1212
+ /* @__PURE__ */ jsx24(NumberIncrementStepper, {}),
1213
+ /* @__PURE__ */ jsx24(NumberDecrementStepper, {})
1214
+ ] })
1215
+ ]
1216
+ }
1217
+ )
1218
+ ]
1279
1219
  }
1280
- }) => onFocus(id, value);
1281
- return jsxs(FormControl, {
1282
- mb: 1,
1283
- ...chakraProps,
1284
- isDisabled: disabled || readonly,
1285
- isRequired: required,
1286
- isReadOnly: readonly,
1287
- isInvalid: rawErrors && rawErrors.length > 0,
1288
- children: [labelValue(jsx(FormLabel, {
1289
- htmlFor: id,
1290
- children: label
1291
- }), hideLabel || !label), jsxs(NumberInput, {
1292
- value: value ?? '',
1293
- onChange: _onChange,
1294
- onBlur: _onBlur,
1295
- onFocus: _onFocus,
1296
- "aria-describedby": ariaDescribedByIds(id),
1297
- children: [jsx(NumberInputField, {
1298
- id: id,
1299
- name: id
1300
- }), jsxs(NumberInputStepper, {
1301
- children: [jsx(NumberIncrementStepper, {}), jsx(NumberDecrementStepper, {})]
1302
- })]
1303
- })]
1304
- });
1220
+ );
1305
1221
  }
1306
1222
 
1223
+ // src/Widgets/Widgets.ts
1307
1224
  function generateWidgets() {
1308
1225
  return {
1309
- AltDateTimeWidget,
1310
- AltDateWidget,
1226
+ AltDateTimeWidget: AltDateTimeWidget_default,
1227
+ AltDateWidget: AltDateWidget_default,
1311
1228
  CheckboxWidget,
1312
1229
  CheckboxesWidget,
1313
1230
  RadioWidget,
@@ -1317,44 +1234,36 @@ function generateWidgets() {
1317
1234
  UpDownWidget
1318
1235
  };
1319
1236
  }
1320
- var Widgets = /*#__PURE__*/generateWidgets();
1237
+ var Widgets_default = generateWidgets();
1321
1238
 
1239
+ // src/Theme/Theme.tsx
1322
1240
  function generateTheme() {
1323
1241
  return {
1324
1242
  templates: generateTemplates(),
1325
1243
  widgets: generateWidgets()
1326
1244
  };
1327
1245
  }
1328
- var Theme = /*#__PURE__*/generateTheme();
1246
+ var Theme_default = generateTheme();
1329
1247
 
1248
+ // src/Form/Form.tsx
1330
1249
  function generateForm() {
1331
1250
  return withTheme(generateTheme());
1332
1251
  }
1333
- var Form = /*#__PURE__*/generateForm();
1252
+ var Form_default = generateForm();
1334
1253
 
1335
- /**
1336
- *
1337
- * The reason we need this is for ChakraProvider styling in Playground.
1338
- * The User Developer would be responsible for styling with ChakraProvider in their app.
1339
- *
1340
- * Exact duplicate of `@chakra-ui/react`'s `CSSReset` component. Except for the following:
1341
- *
1342
- ```css
1343
- input {
1344
- border-width: revert;
1345
- border-color: revert;
1346
- border-style: revert;
1347
- }
1348
- .array-item > hr {
1349
- margin-top: 16px;
1350
- margin-bottom: 16px;
1351
- }
1352
- ```
1254
+ // src/ChakraFrameProvider.tsx
1255
+ import { CacheProvider } from "@emotion/react";
1256
+ import createCache from "@emotion/cache";
1257
+ import weakMemoize from "@emotion/weak-memoize";
1258
+ import { ChakraProvider } from "@chakra-ui/react";
1353
1259
 
1354
- It is located at the bottom of the styles string.
1355
- */
1356
- const CSSReset = () => jsx(Global, {
1357
- styles: `
1260
+ // src/CssReset.tsx
1261
+ import { Global } from "@emotion/react";
1262
+ import { jsx as jsx25 } from "react/jsx-runtime";
1263
+ var CSSReset = () => /* @__PURE__ */ jsx25(
1264
+ Global,
1265
+ {
1266
+ styles: `
1358
1267
  html {
1359
1268
  line-height: 1.5;
1360
1269
  -webkit-text-size-adjust: 100%;
@@ -1595,45 +1504,35 @@ const CSSReset = () => jsx(Global, {
1595
1504
  margin-bottom: 16px;
1596
1505
  }
1597
1506
  `
1598
- });
1507
+ }
1508
+ );
1509
+ var CssReset_default = CSSReset;
1599
1510
 
1600
- /**
1601
- * __createChakraFrameProvider is used to ensure that <Global> emotion components
1602
- * can be rendered within an iframe without changing the styles of the parent page.
1603
- * Required for using Chakra UI in the playground.
1604
- *
1605
- * We have to define ChakraFrameProvider in this library, as opposed to the playground,
1606
- * in order to avoid conflicting versions of emotion, which breaks the styling.
1607
- *
1608
- * NOTE: This is an internal component only used by @rjsf/playground (no
1609
- * backwards compatibility guarantees!)
1610
- *
1611
- * From: https://codesandbox.io/s/p98y9o7jz0?file=/src/frame-provider.js:0-650
1612
- * Also see: https://github.com/emotion-js/emotion/issues/760#issuecomment-404353706
1613
- */
1614
- const memoizedCreateCacheWithContainer = /*#__PURE__*/weakMemoize(container => {
1615
- const newCache = createCache({
1616
- container,
1617
- key: 'rjsf'
1618
- });
1511
+ // src/ChakraFrameProvider.tsx
1512
+ import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
1513
+ var memoizedCreateCacheWithContainer = weakMemoize((container) => {
1514
+ const newCache = createCache({ container, key: "rjsf" });
1619
1515
  return newCache;
1620
1516
  });
1621
- const __createChakraFrameProvider = props => ({
1622
- document
1623
- }) => {
1624
- return jsx("div", {
1625
- style: {
1626
- margin: 2
1627
- },
1628
- children: jsx(CacheProvider, {
1629
- value: memoizedCreateCacheWithContainer(document.head),
1630
- children: jsxs(ChakraProvider, {
1631
- resetCSS: false,
1632
- children: [jsx(CSSReset, {}), props.children]
1633
- })
1634
- })
1635
- });
1517
+ var __createChakraFrameProvider = (props) => ({ document }) => {
1518
+ return /* @__PURE__ */ jsx26("div", { style: { margin: 2 }, children: /* @__PURE__ */ jsx26(CacheProvider, { value: memoizedCreateCacheWithContainer(document.head), children: /* @__PURE__ */ jsxs17(ChakraProvider, { resetCSS: false, children: [
1519
+ /* @__PURE__ */ jsx26(CssReset_default, {}),
1520
+ props.children
1521
+ ] }) }) });
1636
1522
  };
1637
1523
 
1638
- export { Form, Templates, Theme, Widgets, __createChakraFrameProvider, Form as default, generateForm, generateTemplates, generateTheme, generateWidgets };
1524
+ // src/index.ts
1525
+ var src_default = Form_default;
1526
+ export {
1527
+ Form_default as Form,
1528
+ Templates_default as Templates,
1529
+ Theme_default as Theme,
1530
+ Widgets_default as Widgets,
1531
+ __createChakraFrameProvider,
1532
+ src_default as default,
1533
+ generateForm,
1534
+ generateTemplates,
1535
+ generateTheme,
1536
+ generateWidgets
1537
+ };
1639
1538
  //# sourceMappingURL=chakra-ui.esm.js.map