@rjsf/daisyui 6.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/README.md +231 -0
  2. package/dist/chakra-ui.esm.js +2192 -0
  3. package/dist/chakra-ui.esm.js.map +7 -0
  4. package/dist/chakra-ui.umd.js +2011 -0
  5. package/dist/index.js +2180 -0
  6. package/dist/index.js.map +7 -0
  7. package/lib/DaisyUIForm.d.ts +5 -0
  8. package/lib/DaisyUIForm.js +8 -0
  9. package/lib/DaisyUIForm.js.map +1 -0
  10. package/lib/DaisyUIFrameProvider.d.ts +35 -0
  11. package/lib/DaisyUIFrameProvider.js +93 -0
  12. package/lib/DaisyUIFrameProvider.js.map +1 -0
  13. package/lib/daisyForm/DaisyForm.d.ts +12 -0
  14. package/lib/daisyForm/DaisyForm.js +15 -0
  15. package/lib/daisyForm/DaisyForm.js.map +1 -0
  16. package/lib/daisyForm/index.d.ts +2 -0
  17. package/lib/daisyForm/index.js +3 -0
  18. package/lib/daisyForm/index.js.map +1 -0
  19. package/lib/index.d.ts +10 -0
  20. package/lib/index.js +11 -0
  21. package/lib/index.js.map +1 -0
  22. package/lib/templates/ArrayFieldDescriptionTemplate/ArrayFieldDescriptionTemplate.d.ts +7 -0
  23. package/lib/templates/ArrayFieldDescriptionTemplate/ArrayFieldDescriptionTemplate.js +11 -0
  24. package/lib/templates/ArrayFieldDescriptionTemplate/ArrayFieldDescriptionTemplate.js.map +1 -0
  25. package/lib/templates/ArrayFieldDescriptionTemplate/index.d.ts +2 -0
  26. package/lib/templates/ArrayFieldDescriptionTemplate/index.js +3 -0
  27. package/lib/templates/ArrayFieldDescriptionTemplate/index.js.map +1 -0
  28. package/lib/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.d.ts +5 -0
  29. package/lib/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.js +20 -0
  30. package/lib/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.js.map +1 -0
  31. package/lib/templates/ArrayFieldItemButtonsTemplate/index.d.ts +2 -0
  32. package/lib/templates/ArrayFieldItemButtonsTemplate/index.js +3 -0
  33. package/lib/templates/ArrayFieldItemButtonsTemplate/index.js.map +1 -0
  34. package/lib/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +14 -0
  35. package/lib/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +27 -0
  36. package/lib/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -0
  37. package/lib/templates/ArrayFieldItemTemplate/index.d.ts +2 -0
  38. package/lib/templates/ArrayFieldItemTemplate/index.js +3 -0
  39. package/lib/templates/ArrayFieldItemTemplate/index.js.map +1 -0
  40. package/lib/templates/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +15 -0
  41. package/lib/templates/ArrayFieldTemplate/ArrayFieldTemplate.js +37 -0
  42. package/lib/templates/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -0
  43. package/lib/templates/ArrayFieldTemplate/index.d.ts +2 -0
  44. package/lib/templates/ArrayFieldTemplate/index.js +3 -0
  45. package/lib/templates/ArrayFieldTemplate/index.js.map +1 -0
  46. package/lib/templates/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.d.ts +7 -0
  47. package/lib/templates/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.js +11 -0
  48. package/lib/templates/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.js.map +1 -0
  49. package/lib/templates/ArrayFieldTitleTemplate/index.d.ts +2 -0
  50. package/lib/templates/ArrayFieldTitleTemplate/index.js +3 -0
  51. package/lib/templates/ArrayFieldTitleTemplate/index.js.map +1 -0
  52. package/lib/templates/BaseInputTemplate/BaseInputTemplate.d.ts +16 -0
  53. package/lib/templates/BaseInputTemplate/BaseInputTemplate.js +33 -0
  54. package/lib/templates/BaseInputTemplate/BaseInputTemplate.js.map +1 -0
  55. package/lib/templates/BaseInputTemplate/index.d.ts +2 -0
  56. package/lib/templates/BaseInputTemplate/index.js +3 -0
  57. package/lib/templates/BaseInputTemplate/index.js.map +1 -0
  58. package/lib/templates/ButtonTemplates/AddButton.d.ts +6 -0
  59. package/lib/templates/ButtonTemplates/AddButton.js +15 -0
  60. package/lib/templates/ButtonTemplates/AddButton.js.map +1 -0
  61. package/lib/templates/ButtonTemplates/DaisyUIButton.d.ts +18 -0
  62. package/lib/templates/ButtonTemplates/DaisyUIButton.js +15 -0
  63. package/lib/templates/ButtonTemplates/DaisyUIButton.js.map +1 -0
  64. package/lib/templates/ButtonTemplates/IconButton.d.ts +5 -0
  65. package/lib/templates/ButtonTemplates/IconButton.js +21 -0
  66. package/lib/templates/ButtonTemplates/IconButton.js.map +1 -0
  67. package/lib/templates/ButtonTemplates/SubmitButton.d.ts +4 -0
  68. package/lib/templates/ButtonTemplates/SubmitButton.js +12 -0
  69. package/lib/templates/ButtonTemplates/SubmitButton.js.map +1 -0
  70. package/lib/templates/ButtonTemplates/index.d.ts +15 -0
  71. package/lib/templates/ButtonTemplates/index.js +17 -0
  72. package/lib/templates/ButtonTemplates/index.js.map +1 -0
  73. package/lib/templates/DescriptionField/DescriptionField.d.ts +8 -0
  74. package/lib/templates/DescriptionField/DescriptionField.js +16 -0
  75. package/lib/templates/DescriptionField/DescriptionField.js.map +1 -0
  76. package/lib/templates/DescriptionField/index.d.ts +2 -0
  77. package/lib/templates/DescriptionField/index.js +3 -0
  78. package/lib/templates/DescriptionField/index.js.map +1 -0
  79. package/lib/templates/ErrorList/ErrorList.d.ts +7 -0
  80. package/lib/templates/ErrorList/ErrorList.js +11 -0
  81. package/lib/templates/ErrorList/ErrorList.js.map +1 -0
  82. package/lib/templates/ErrorList/index.d.ts +2 -0
  83. package/lib/templates/ErrorList/index.js +3 -0
  84. package/lib/templates/ErrorList/index.js.map +1 -0
  85. package/lib/templates/FieldErrorTemplate/FieldErrorTemplate.d.ts +10 -0
  86. package/lib/templates/FieldErrorTemplate/FieldErrorTemplate.js +15 -0
  87. package/lib/templates/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -0
  88. package/lib/templates/FieldErrorTemplate/index.d.ts +2 -0
  89. package/lib/templates/FieldErrorTemplate/index.js +3 -0
  90. package/lib/templates/FieldErrorTemplate/index.js.map +1 -0
  91. package/lib/templates/FieldHelpTemplate/FieldHelpTemplate.d.ts +11 -0
  92. package/lib/templates/FieldHelpTemplate/FieldHelpTemplate.js +15 -0
  93. package/lib/templates/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -0
  94. package/lib/templates/FieldHelpTemplate/index.d.ts +2 -0
  95. package/lib/templates/FieldHelpTemplate/index.js +3 -0
  96. package/lib/templates/FieldHelpTemplate/index.js.map +1 -0
  97. package/lib/templates/FieldTemplate/FieldTemplate.d.ts +15 -0
  98. package/lib/templates/FieldTemplate/FieldTemplate.js +23 -0
  99. package/lib/templates/FieldTemplate/FieldTemplate.js.map +1 -0
  100. package/lib/templates/FieldTemplate/index.d.ts +2 -0
  101. package/lib/templates/FieldTemplate/index.js +3 -0
  102. package/lib/templates/FieldTemplate/index.js.map +1 -0
  103. package/lib/templates/GridTemplate/GridTemplate.d.ts +7 -0
  104. package/lib/templates/GridTemplate/GridTemplate.js +16 -0
  105. package/lib/templates/GridTemplate/GridTemplate.js.map +1 -0
  106. package/lib/templates/GridTemplate/index.d.ts +2 -0
  107. package/lib/templates/GridTemplate/index.js +3 -0
  108. package/lib/templates/GridTemplate/index.js.map +1 -0
  109. package/lib/templates/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +13 -0
  110. package/lib/templates/ObjectFieldTemplate/ObjectFieldTemplate.js +25 -0
  111. package/lib/templates/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -0
  112. package/lib/templates/ObjectFieldTemplate/index.d.ts +2 -0
  113. package/lib/templates/ObjectFieldTemplate/index.js +3 -0
  114. package/lib/templates/ObjectFieldTemplate/index.js.map +1 -0
  115. package/lib/templates/Templates.d.ts +19 -0
  116. package/lib/templates/Templates.js +56 -0
  117. package/lib/templates/Templates.js.map +1 -0
  118. package/lib/templates/TitleField/TitleField.d.ts +13 -0
  119. package/lib/templates/TitleField/TitleField.js +19 -0
  120. package/lib/templates/TitleField/TitleField.js.map +1 -0
  121. package/lib/templates/TitleField/index.d.ts +2 -0
  122. package/lib/templates/TitleField/index.js +3 -0
  123. package/lib/templates/TitleField/index.js.map +1 -0
  124. package/lib/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +7 -0
  125. package/lib/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +20 -0
  126. package/lib/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -0
  127. package/lib/templates/WrapIfAdditionalTemplate/index.d.ts +2 -0
  128. package/lib/templates/WrapIfAdditionalTemplate/index.js +3 -0
  129. package/lib/templates/WrapIfAdditionalTemplate/index.js.map +1 -0
  130. package/lib/templates/index.d.ts +19 -0
  131. package/lib/templates/index.js +20 -0
  132. package/lib/templates/index.js.map +1 -0
  133. package/lib/theme/Theme.d.ts +43 -0
  134. package/lib/theme/Theme.js +68 -0
  135. package/lib/theme/Theme.js.map +1 -0
  136. package/lib/theme/index.d.ts +2 -0
  137. package/lib/theme/index.js +3 -0
  138. package/lib/theme/index.js.map +1 -0
  139. package/lib/tsconfig.tsbuildinfo +1 -0
  140. package/lib/types/DaisyProps.d.ts +5 -0
  141. package/lib/types/DaisyProps.js +2 -0
  142. package/lib/types/DaisyProps.js.map +1 -0
  143. package/lib/utils.d.ts +13 -0
  144. package/lib/utils.js +5 -0
  145. package/lib/utils.js.map +1 -0
  146. package/lib/widgets/AltDateTimeWidget/AltDateTimeWidget.d.ts +6 -0
  147. package/lib/widgets/AltDateTimeWidget/AltDateTimeWidget.js +10 -0
  148. package/lib/widgets/AltDateTimeWidget/AltDateTimeWidget.js.map +1 -0
  149. package/lib/widgets/AltDateTimeWidget/index.d.ts +2 -0
  150. package/lib/widgets/AltDateTimeWidget/index.js +3 -0
  151. package/lib/widgets/AltDateTimeWidget/index.js.map +1 -0
  152. package/lib/widgets/AltDateWidget/AltDateWidget.d.ts +15 -0
  153. package/lib/widgets/AltDateWidget/AltDateWidget.js +138 -0
  154. package/lib/widgets/AltDateWidget/AltDateWidget.js.map +1 -0
  155. package/lib/widgets/AltDateWidget/index.d.ts +2 -0
  156. package/lib/widgets/AltDateWidget/index.js +3 -0
  157. package/lib/widgets/AltDateWidget/index.js.map +1 -0
  158. package/lib/widgets/CheckboxWidget/CheckboxWidget.d.ts +13 -0
  159. package/lib/widgets/CheckboxWidget/CheckboxWidget.js +43 -0
  160. package/lib/widgets/CheckboxWidget/CheckboxWidget.js.map +1 -0
  161. package/lib/widgets/CheckboxWidget/index.d.ts +2 -0
  162. package/lib/widgets/CheckboxWidget/index.js +3 -0
  163. package/lib/widgets/CheckboxWidget/index.js.map +1 -0
  164. package/lib/widgets/CheckboxesWidget/CheckboxesWidget.d.ts +16 -0
  165. package/lib/widgets/CheckboxesWidget/CheckboxesWidget.js +73 -0
  166. package/lib/widgets/CheckboxesWidget/CheckboxesWidget.js.map +1 -0
  167. package/lib/widgets/CheckboxesWidget/index.d.ts +2 -0
  168. package/lib/widgets/CheckboxesWidget/index.js +3 -0
  169. package/lib/widgets/CheckboxesWidget/index.js.map +1 -0
  170. package/lib/widgets/DateTimeWidget/DateTimeWidget.d.ts +14 -0
  171. package/lib/widgets/DateTimeWidget/DateTimeWidget.js +207 -0
  172. package/lib/widgets/DateTimeWidget/DateTimeWidget.js.map +1 -0
  173. package/lib/widgets/DateTimeWidget/index.d.ts +2 -0
  174. package/lib/widgets/DateTimeWidget/index.js +3 -0
  175. package/lib/widgets/DateTimeWidget/index.js.map +1 -0
  176. package/lib/widgets/DateWidget/DateWidget.d.ts +14 -0
  177. package/lib/widgets/DateWidget/DateWidget.js +274 -0
  178. package/lib/widgets/DateWidget/DateWidget.js.map +1 -0
  179. package/lib/widgets/DateWidget/index.d.ts +2 -0
  180. package/lib/widgets/DateWidget/index.js +3 -0
  181. package/lib/widgets/DateWidget/index.js.map +1 -0
  182. package/lib/widgets/FileWidget/FileWidget.d.ts +12 -0
  183. package/lib/widgets/FileWidget/FileWidget.js +57 -0
  184. package/lib/widgets/FileWidget/FileWidget.js.map +1 -0
  185. package/lib/widgets/FileWidget/index.d.ts +2 -0
  186. package/lib/widgets/FileWidget/index.js +3 -0
  187. package/lib/widgets/FileWidget/index.js.map +1 -0
  188. package/lib/widgets/RadioWidget/RadioWidget.d.ts +14 -0
  189. package/lib/widgets/RadioWidget/RadioWidget.js +67 -0
  190. package/lib/widgets/RadioWidget/RadioWidget.js.map +1 -0
  191. package/lib/widgets/RadioWidget/index.d.ts +2 -0
  192. package/lib/widgets/RadioWidget/index.js +3 -0
  193. package/lib/widgets/RadioWidget/index.js.map +1 -0
  194. package/lib/widgets/RangeWidget/RangeWidget.d.ts +13 -0
  195. package/lib/widgets/RangeWidget/RangeWidget.js +42 -0
  196. package/lib/widgets/RangeWidget/RangeWidget.js.map +1 -0
  197. package/lib/widgets/RangeWidget/index.d.ts +2 -0
  198. package/lib/widgets/RangeWidget/index.js +3 -0
  199. package/lib/widgets/RangeWidget/index.js.map +1 -0
  200. package/lib/widgets/RatingWidget/RatingWidget.d.ts +17 -0
  201. package/lib/widgets/RatingWidget/RatingWidget.js +64 -0
  202. package/lib/widgets/RatingWidget/RatingWidget.js.map +1 -0
  203. package/lib/widgets/RatingWidget/index.d.ts +2 -0
  204. package/lib/widgets/RatingWidget/index.js +3 -0
  205. package/lib/widgets/RatingWidget/index.js.map +1 -0
  206. package/lib/widgets/SelectWidget/SelectWidget.d.ts +14 -0
  207. package/lib/widgets/SelectWidget/SelectWidget.js +74 -0
  208. package/lib/widgets/SelectWidget/SelectWidget.js.map +1 -0
  209. package/lib/widgets/SelectWidget/index.d.ts +2 -0
  210. package/lib/widgets/SelectWidget/index.js +3 -0
  211. package/lib/widgets/SelectWidget/index.js.map +1 -0
  212. package/lib/widgets/TextareaWidget/TextareaWidget.d.ts +12 -0
  213. package/lib/widgets/TextareaWidget/TextareaWidget.js +44 -0
  214. package/lib/widgets/TextareaWidget/TextareaWidget.js.map +1 -0
  215. package/lib/widgets/TextareaWidget/index.d.ts +2 -0
  216. package/lib/widgets/TextareaWidget/index.js +3 -0
  217. package/lib/widgets/TextareaWidget/index.js.map +1 -0
  218. package/lib/widgets/TimeWidget/TimeWidget.d.ts +12 -0
  219. package/lib/widgets/TimeWidget/TimeWidget.js +42 -0
  220. package/lib/widgets/TimeWidget/TimeWidget.js.map +1 -0
  221. package/lib/widgets/TimeWidget/index.d.ts +2 -0
  222. package/lib/widgets/TimeWidget/index.js +3 -0
  223. package/lib/widgets/TimeWidget/index.js.map +1 -0
  224. package/lib/widgets/ToggleWidget/ToggleWidget.d.ts +13 -0
  225. package/lib/widgets/ToggleWidget/ToggleWidget.js +40 -0
  226. package/lib/widgets/ToggleWidget/ToggleWidget.js.map +1 -0
  227. package/lib/widgets/ToggleWidget/index.d.ts +2 -0
  228. package/lib/widgets/ToggleWidget/index.js +3 -0
  229. package/lib/widgets/ToggleWidget/index.js.map +1 -0
  230. package/lib/widgets/Widgets.d.ts +18 -0
  231. package/lib/widgets/Widgets.js +35 -0
  232. package/lib/widgets/Widgets.js.map +1 -0
  233. package/lib/widgets/index.d.ts +2 -0
  234. package/lib/widgets/index.js +3 -0
  235. package/lib/widgets/index.js.map +1 -0
  236. package/package.json +95 -0
  237. package/src/DaisyUIForm.tsx +9 -0
  238. package/src/DaisyUIFrameProvider.tsx +107 -0
  239. package/src/daisyForm/DaisyForm.tsx +20 -0
  240. package/src/daisyForm/index.ts +2 -0
  241. package/src/index.ts +13 -0
  242. package/src/styles.css +9 -0
  243. package/src/templates/ArrayFieldDescriptionTemplate/ArrayFieldDescriptionTemplate.tsx +19 -0
  244. package/src/templates/ArrayFieldDescriptionTemplate/index.ts +2 -0
  245. package/src/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.tsx +89 -0
  246. package/src/templates/ArrayFieldItemButtonsTemplate/index.ts +2 -0
  247. package/src/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +55 -0
  248. package/src/templates/ArrayFieldItemTemplate/index.ts +2 -0
  249. package/src/templates/ArrayFieldTemplate/ArrayFieldTemplate.tsx +120 -0
  250. package/src/templates/ArrayFieldTemplate/index.ts +2 -0
  251. package/src/templates/ArrayFieldTitleTemplate/ArrayFieldTitleTemplate.tsx +15 -0
  252. package/src/templates/ArrayFieldTitleTemplate/index.ts +2 -0
  253. package/src/templates/BaseInputTemplate/BaseInputTemplate.tsx +104 -0
  254. package/src/templates/BaseInputTemplate/index.ts +2 -0
  255. package/src/templates/ButtonTemplates/AddButton.tsx +38 -0
  256. package/src/templates/ButtonTemplates/DaisyUIButton.tsx +31 -0
  257. package/src/templates/ButtonTemplates/IconButton.tsx +62 -0
  258. package/src/templates/ButtonTemplates/SubmitButton.tsx +25 -0
  259. package/src/templates/ButtonTemplates/index.ts +19 -0
  260. package/src/templates/DescriptionField/DescriptionField.tsx +26 -0
  261. package/src/templates/DescriptionField/index.ts +2 -0
  262. package/src/templates/ErrorList/ErrorList.tsx +21 -0
  263. package/src/templates/ErrorList/index.ts +2 -0
  264. package/src/templates/FieldErrorTemplate/FieldErrorTemplate.tsx +22 -0
  265. package/src/templates/FieldErrorTemplate/index.ts +2 -0
  266. package/src/templates/FieldHelpTemplate/FieldHelpTemplate.tsx +23 -0
  267. package/src/templates/FieldHelpTemplate/index.ts +2 -0
  268. package/src/templates/FieldTemplate/FieldTemplate.tsx +66 -0
  269. package/src/templates/FieldTemplate/index.ts +2 -0
  270. package/src/templates/GridTemplate/GridTemplate.tsx +26 -0
  271. package/src/templates/GridTemplate/index.ts +2 -0
  272. package/src/templates/ObjectFieldTemplate/ObjectFieldTemplate.tsx +108 -0
  273. package/src/templates/ObjectFieldTemplate/index.ts +2 -0
  274. package/src/templates/Templates.tsx +63 -0
  275. package/src/templates/TitleField/TitleField.tsx +26 -0
  276. package/src/templates/TitleField/index.ts +2 -0
  277. package/src/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +74 -0
  278. package/src/templates/WrapIfAdditionalTemplate/index.ts +2 -0
  279. package/src/templates/index.ts +22 -0
  280. package/src/theme/Theme.tsx +93 -0
  281. package/src/theme/index.ts +2 -0
  282. package/src/tsconfig.json +26 -0
  283. package/src/types/DaisyProps.ts +5 -0
  284. package/src/types.d.ts +4 -0
  285. package/src/utils.ts +18 -0
  286. package/src/widgets/AltDateTimeWidget/AltDateTimeWidget.tsx +14 -0
  287. package/src/widgets/AltDateTimeWidget/index.ts +2 -0
  288. package/src/widgets/AltDateWidget/AltDateWidget.tsx +328 -0
  289. package/src/widgets/AltDateWidget/index.ts +2 -0
  290. package/src/widgets/CheckboxWidget/CheckboxWidget.tsx +108 -0
  291. package/src/widgets/CheckboxWidget/index.ts +2 -0
  292. package/src/widgets/CheckboxesWidget/CheckboxesWidget.tsx +124 -0
  293. package/src/widgets/CheckboxesWidget/index.ts +2 -0
  294. package/src/widgets/DateTimeWidget/DateTimeWidget.tsx +343 -0
  295. package/src/widgets/DateTimeWidget/index.ts +2 -0
  296. package/src/widgets/DateWidget/DateWidget.tsx +393 -0
  297. package/src/widgets/DateWidget/index.ts +2 -0
  298. package/src/widgets/FileWidget/FileWidget.tsx +86 -0
  299. package/src/widgets/FileWidget/index.ts +2 -0
  300. package/src/widgets/RadioWidget/RadioWidget.tsx +114 -0
  301. package/src/widgets/RadioWidget/index.ts +2 -0
  302. package/src/widgets/RangeWidget/RangeWidget.tsx +78 -0
  303. package/src/widgets/RangeWidget/index.ts +2 -0
  304. package/src/widgets/RatingWidget/RatingWidget.tsx +120 -0
  305. package/src/widgets/RatingWidget/index.ts +2 -0
  306. package/src/widgets/SelectWidget/SelectWidget.tsx +161 -0
  307. package/src/widgets/SelectWidget/index.ts +2 -0
  308. package/src/widgets/TextareaWidget/TextareaWidget.tsx +77 -0
  309. package/src/widgets/TextareaWidget/index.ts +2 -0
  310. package/src/widgets/TimeWidget/TimeWidget.tsx +72 -0
  311. package/src/widgets/TimeWidget/index.ts +2 -0
  312. package/src/widgets/ToggleWidget/ToggleWidget.tsx +70 -0
  313. package/src/widgets/ToggleWidget/index.ts +2 -0
  314. package/src/widgets/Widgets.tsx +58 -0
  315. package/src/widgets/index.ts +2 -0
package/dist/index.js ADDED
@@ -0,0 +1,2180 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Form: () => DaisyUIForm_default,
24
+ GridTemplate: () => GridTemplate,
25
+ Templates: () => Templates_default,
26
+ Theme: () => Theme_default,
27
+ ThemeProvider: () => ThemeProvider,
28
+ Widgets: () => Widgets_default,
29
+ __createDaisyUIFrameProvider: () => __createDaisyUIFrameProvider,
30
+ default: () => index_default,
31
+ useTheme: () => useTheme
32
+ });
33
+ module.exports = __toCommonJS(index_exports);
34
+ var import_core4 = require("@rjsf/core");
35
+
36
+ // src/theme/Theme.tsx
37
+ var import_react19 = require("react");
38
+ var import_core2 = require("@rjsf/core");
39
+
40
+ // src/templates/ArrayFieldItemButtonsTemplate/ArrayFieldItemButtonsTemplate.tsx
41
+ var import_react = require("react");
42
+ var import_utils = require("@rjsf/utils");
43
+ var import_jsx_runtime = require("react/jsx-runtime");
44
+ function ArrayFieldItemButtonsTemplate(props) {
45
+ const {
46
+ disabled,
47
+ hasCopy,
48
+ hasMoveDown,
49
+ hasMoveUp,
50
+ hasRemove,
51
+ idSchema,
52
+ index,
53
+ onCopyIndexClick,
54
+ onDropIndexClick,
55
+ onReorderClick,
56
+ readonly,
57
+ registry,
58
+ uiSchema
59
+ } = props;
60
+ const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
61
+ const onCopyClick = (0, import_react.useMemo)(() => onCopyIndexClick(index), [index, onCopyIndexClick]);
62
+ const onRemoveClick = (0, import_react.useMemo)(() => onDropIndexClick(index), [index, onDropIndexClick]);
63
+ const onArrowUpClick = (0, import_react.useMemo)(() => onReorderClick(index, index - 1), [index, onReorderClick]);
64
+ const onArrowDownClick = (0, import_react.useMemo)(() => onReorderClick(index, index + 1), [index, onReorderClick]);
65
+ const renderMany = [hasMoveUp || hasMoveDown, hasCopy, hasRemove].filter(Boolean).length > 1;
66
+ const btnClass = renderMany ? "join-item btn btn-sm px-2" : "btn btn-sm px-2 rounded-sm";
67
+ const removeBtnClass = renderMany ? "join-item btn btn-sm btn-error px-2" : "btn btn-sm btn-error px-2 rounded-sm";
68
+ const buttons = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
69
+ (hasMoveUp || hasMoveDown) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
70
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
71
+ MoveUpButton2,
72
+ {
73
+ id: (0, import_utils.buttonId)(idSchema, "moveUp"),
74
+ className: `rjsf-array-item-move-up ${btnClass}`,
75
+ disabled: disabled || readonly || !hasMoveUp,
76
+ onClick: onArrowUpClick,
77
+ uiSchema,
78
+ registry
79
+ }
80
+ ),
81
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
82
+ MoveDownButton2,
83
+ {
84
+ id: (0, import_utils.buttonId)(idSchema, "moveDown"),
85
+ className: `rjsf-array-item-move-down ${btnClass}`,
86
+ disabled: disabled || readonly || !hasMoveDown,
87
+ onClick: onArrowDownClick,
88
+ uiSchema,
89
+ registry
90
+ }
91
+ )
92
+ ] }),
93
+ hasCopy && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
94
+ CopyButton2,
95
+ {
96
+ id: (0, import_utils.buttonId)(idSchema, "copy"),
97
+ className: `rjsf-array-item-copy ${btnClass}`,
98
+ disabled: disabled || readonly,
99
+ onClick: onCopyClick,
100
+ uiSchema,
101
+ registry
102
+ }
103
+ ),
104
+ hasRemove && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
105
+ RemoveButton2,
106
+ {
107
+ id: (0, import_utils.buttonId)(idSchema, "remove"),
108
+ className: `rjsf-array-item-remove ${removeBtnClass}`,
109
+ disabled: disabled || readonly,
110
+ onClick: onRemoveClick,
111
+ uiSchema,
112
+ registry
113
+ }
114
+ )
115
+ ] });
116
+ return renderMany ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "join", children: buttons }) : buttons;
117
+ }
118
+
119
+ // src/templates/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
120
+ var import_utils2 = require("@rjsf/utils");
121
+ var import_jsx_runtime2 = require("react/jsx-runtime");
122
+ function ArrayFieldItemTemplate(props) {
123
+ const { children, buttonsProps, hasToolbar, registry, uiSchema, index, totalItems } = props;
124
+ const uiOptions = (0, import_utils2.getUiOptions)(uiSchema);
125
+ const ArrayFieldItemButtonsTemplate2 = (0, import_utils2.getTemplate)(
126
+ "ArrayFieldItemButtonsTemplate",
127
+ registry,
128
+ uiOptions
129
+ );
130
+ const isFirstItem = index === 0;
131
+ const isLastItem = index === totalItems - 1;
132
+ const borderRadius = isFirstItem ? "rounded-t-lg" : isLastItem ? "rounded-b-lg" : "";
133
+ const marginBottom = isLastItem ? "" : "mb-[-1px]";
134
+ const zIndex = index === void 0 ? "" : "z-" + (10 - Math.min(index, 9));
135
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("fieldset", { className: `fieldset bg-base-100 border border-base-300 p-4 ${borderRadius} ${marginBottom} ${zIndex}`, children: [
136
+ children,
137
+ hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex justify-end mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ArrayFieldItemButtonsTemplate2, { ...buttonsProps }) })
138
+ ] });
139
+ }
140
+
141
+ // src/templates/ArrayFieldTemplate/ArrayFieldTemplate.tsx
142
+ var import_react2 = require("react");
143
+ var import_utils3 = require("@rjsf/utils");
144
+ var import_jsx_runtime3 = require("react/jsx-runtime");
145
+ function ArrayFieldTemplate(props) {
146
+ const {
147
+ canAdd,
148
+ className,
149
+ disabled,
150
+ idSchema,
151
+ items,
152
+ onAddClick,
153
+ readonly,
154
+ registry,
155
+ required,
156
+ schema,
157
+ title,
158
+ uiSchema
159
+ } = props;
160
+ const uiOptions = (0, import_utils3.getUiOptions)(uiSchema);
161
+ const ArrayFieldDescriptionTemplate = (0, import_utils3.getTemplate)(
162
+ "ArrayFieldDescriptionTemplate",
163
+ registry,
164
+ uiOptions
165
+ );
166
+ const ArrayFieldItemTemplate2 = (0, import_utils3.getTemplate)(
167
+ "ArrayFieldItemTemplate",
168
+ registry,
169
+ uiOptions
170
+ );
171
+ const ArrayFieldTitleTemplate = (0, import_utils3.getTemplate)(
172
+ "ArrayFieldTitleTemplate",
173
+ registry,
174
+ uiOptions
175
+ );
176
+ const {
177
+ ButtonTemplates: { AddButton: AddButton2 }
178
+ } = registry.templates;
179
+ const handleAddClick = (0, import_react2.useCallback)(
180
+ (e) => {
181
+ e.preventDefault();
182
+ e.stopPropagation();
183
+ onAddClick(e);
184
+ },
185
+ [onAddClick]
186
+ );
187
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: `array-field-template ${className}`, children: [
188
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
189
+ ArrayFieldTitleTemplate,
190
+ {
191
+ idSchema,
192
+ title: uiOptions.title || title,
193
+ schema,
194
+ uiSchema,
195
+ required,
196
+ registry
197
+ }
198
+ ),
199
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
200
+ ArrayFieldDescriptionTemplate,
201
+ {
202
+ idSchema,
203
+ description: uiOptions.description || schema.description,
204
+ schema,
205
+ uiSchema,
206
+ registry
207
+ }
208
+ ),
209
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col gap-4", children: [
210
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "rjsf-array-item-list", children: [
211
+ items && items.map(({ key, ...itemProps }, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ArrayFieldItemTemplate2, { ...itemProps, index, totalItems: items.length }, key)),
212
+ items && items.length === 0 && canAdd && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "text-center italic text-base-content/70", children: import_utils3.TranslatableString.EmptyArray })
213
+ ] }),
214
+ canAdd && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
215
+ AddButton2,
216
+ {
217
+ id: (0, import_utils3.buttonId)(idSchema, "add"),
218
+ className: "rjsf-array-item-add btn btn-primary btn-sm",
219
+ onClick: handleAddClick,
220
+ disabled: disabled || readonly,
221
+ uiSchema,
222
+ registry
223
+ }
224
+ ) })
225
+ ] })
226
+ ] });
227
+ }
228
+
229
+ // src/templates/BaseInputTemplate/BaseInputTemplate.tsx
230
+ var import_react3 = require("react");
231
+ var import_utils4 = require("@rjsf/utils");
232
+ var import_jsx_runtime4 = require("react/jsx-runtime");
233
+ function BaseInputTemplate(props) {
234
+ const {
235
+ id,
236
+ value,
237
+ required,
238
+ disabled,
239
+ readonly,
240
+ autofocus,
241
+ onChange,
242
+ onBlur,
243
+ onFocus,
244
+ onChangeOverride,
245
+ options,
246
+ schema,
247
+ type,
248
+ label,
249
+ placeholder
250
+ } = props;
251
+ const inputProps = (0, import_utils4.getInputProps)(schema, type, options);
252
+ const { step, min, max, accept, ...rest } = inputProps;
253
+ const htmlInputProps = { step, min, max, accept, ...schema.examples ? { list: (0, import_utils4.examplesId)(id) } : void 0 };
254
+ const _onChange = (0, import_react3.useCallback)(
255
+ ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2),
256
+ [onChange, options]
257
+ );
258
+ const _onBlur = (0, import_react3.useCallback)(
259
+ ({ target }) => onBlur && onBlur(id, target.value),
260
+ [onBlur, id]
261
+ );
262
+ const _onFocus = (0, import_react3.useCallback)(
263
+ ({ target }) => onFocus && onFocus(id, target.value),
264
+ [onFocus, id]
265
+ );
266
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
267
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "form-control", children: [
268
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: id, className: "label hidden", style: { display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "label-text", children: label }) }),
269
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
270
+ "input",
271
+ {
272
+ id,
273
+ name: id,
274
+ value: value || value === 0 ? value : "",
275
+ placeholder,
276
+ required,
277
+ disabled: disabled || readonly,
278
+ autoFocus: autofocus,
279
+ className: "input input-bordered",
280
+ ...rest,
281
+ ...htmlInputProps,
282
+ onChange: onChangeOverride || _onChange,
283
+ onBlur: _onBlur,
284
+ onFocus: _onFocus,
285
+ "aria-describedby": (0, import_utils4.ariaDescribedByIds)(id, !!schema.examples)
286
+ }
287
+ )
288
+ ] }),
289
+ Array.isArray(schema.examples) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("datalist", { id: (0, import_utils4.examplesId)(id), children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map((example) => {
290
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: example }, example);
291
+ }) })
292
+ ] });
293
+ }
294
+
295
+ // src/templates/ButtonTemplates/AddButton.tsx
296
+ var import_utils5 = require("@rjsf/utils");
297
+ var import_fontawesome_svg_core = require("@fortawesome/fontawesome-svg-core");
298
+ var import_free_solid_svg_icons = require("@fortawesome/free-solid-svg-icons");
299
+
300
+ // src/templates/ButtonTemplates/DaisyUIButton.tsx
301
+ var import_react4 = require("react");
302
+ var import_react_fontawesome = require("@fortawesome/react-fontawesome");
303
+ var import_jsx_runtime5 = require("react/jsx-runtime");
304
+ function DaisyUIButton(props) {
305
+ const { icon, iconType, uiSchema, registry, className, ...otherProps } = props;
306
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", className, "aria-label": props.title, ...otherProps, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_fontawesome.FontAwesomeIcon, { icon, className: "h-5 w-5" }) });
307
+ }
308
+ DaisyUIButton.displayName = "DaisyUIButton";
309
+ var DaisyUIButton_default = (0, import_react4.memo)(DaisyUIButton);
310
+
311
+ // src/templates/ButtonTemplates/AddButton.tsx
312
+ var import_jsx_runtime6 = require("react/jsx-runtime");
313
+ import_fontawesome_svg_core.library.add(import_free_solid_svg_icons.faPlus, import_free_solid_svg_icons.faCopy, import_free_solid_svg_icons.faArrowDown, import_free_solid_svg_icons.faArrowUp, import_free_solid_svg_icons.faTrash);
314
+ function AddButton({
315
+ className,
316
+ onClick,
317
+ disabled,
318
+ registry,
319
+ ...otherProps
320
+ }) {
321
+ const { translateString } = registry;
322
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: `col-xs-3 col-xs-offset-9 text-right ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
323
+ DaisyUIButton_default,
324
+ {
325
+ ...otherProps,
326
+ iconType: "info",
327
+ icon: import_free_solid_svg_icons.faPlus,
328
+ className: "btn-add col-xs-12 btn-primary btn-primary-content",
329
+ title: translateString(import_utils5.TranslatableString.AddButton),
330
+ onClick,
331
+ disabled,
332
+ registry
333
+ }
334
+ ) }) });
335
+ }
336
+
337
+ // src/templates/ButtonTemplates/SubmitButton.tsx
338
+ var import_utils6 = require("@rjsf/utils");
339
+ var import_jsx_runtime7 = require("react/jsx-runtime");
340
+ function SubmitButton({ uiSchema }) {
341
+ const { submitText, norender, props: submitButtonProps = {} } = (0, import_utils6.getSubmitButtonOptions)(uiSchema);
342
+ if (norender) {
343
+ return null;
344
+ }
345
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
346
+ "button",
347
+ {
348
+ type: "submit",
349
+ ...submitButtonProps,
350
+ className: `btn btn-primary btn-primary-content ${submitButtonProps.className || ""}`,
351
+ children: submitText
352
+ }
353
+ ) });
354
+ }
355
+
356
+ // src/templates/ButtonTemplates/IconButton.tsx
357
+ var import_utils7 = require("@rjsf/utils");
358
+ var import_free_solid_svg_icons2 = require("@fortawesome/free-solid-svg-icons");
359
+ var import_jsx_runtime8 = require("react/jsx-runtime");
360
+ function CopyButton(props) {
361
+ const {
362
+ registry: { translateString }
363
+ } = props;
364
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DaisyUIButton_default, { ...props, title: translateString(import_utils7.TranslatableString.CopyButton), icon: import_free_solid_svg_icons2.faCopy });
365
+ }
366
+ function MoveDownButton(props) {
367
+ const {
368
+ registry: { translateString }
369
+ } = props;
370
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
371
+ DaisyUIButton_default,
372
+ {
373
+ ...props,
374
+ title: translateString(import_utils7.TranslatableString.MoveDownButton),
375
+ icon: import_free_solid_svg_icons2.faArrowDown
376
+ }
377
+ );
378
+ }
379
+ function MoveUpButton(props) {
380
+ const {
381
+ registry: { translateString }
382
+ } = props;
383
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
384
+ DaisyUIButton_default,
385
+ {
386
+ ...props,
387
+ title: translateString(import_utils7.TranslatableString.MoveUpButton),
388
+ icon: import_free_solid_svg_icons2.faArrowUp
389
+ }
390
+ );
391
+ }
392
+ function RemoveButton(props) {
393
+ const {
394
+ registry: { translateString }
395
+ } = props;
396
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
397
+ DaisyUIButton_default,
398
+ {
399
+ ...props,
400
+ title: translateString(import_utils7.TranslatableString.RemoveButton),
401
+ iconType: "danger",
402
+ icon: import_free_solid_svg_icons2.faTrash
403
+ }
404
+ );
405
+ }
406
+
407
+ // src/templates/DescriptionField/DescriptionField.tsx
408
+ var import_core = require("@rjsf/core");
409
+ var import_jsx_runtime9 = require("react/jsx-runtime");
410
+ function DescriptionField(props) {
411
+ const { id, description, registry, uiSchema } = props;
412
+ if (!description) {
413
+ return null;
414
+ }
415
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { id, className: "description-field my-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-sm text-base-content/80", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core.RichDescription, { description, registry, uiSchema }) }) });
416
+ }
417
+
418
+ // src/templates/ErrorList/ErrorList.tsx
419
+ var import_jsx_runtime10 = require("react/jsx-runtime");
420
+ function ErrorList(props) {
421
+ const { errors } = props;
422
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "error-list", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "list-disc list-inside text-red-600", children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: error.stack }, index)) }) });
423
+ }
424
+
425
+ // src/templates/FieldErrorTemplate/FieldErrorTemplate.tsx
426
+ var import_jsx_runtime11 = require("react/jsx-runtime");
427
+ function FieldErrorTemplate(props) {
428
+ const { errors } = props;
429
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "rjsf-field-error-template text-red-600", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("ul", { className: "list-disc list-inside", children: errors?.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", { children: error }, index)) ?? [] }) });
430
+ }
431
+
432
+ // src/templates/FieldHelpTemplate/FieldHelpTemplate.tsx
433
+ var import_jsx_runtime12 = require("react/jsx-runtime");
434
+ function FieldHelpTemplate(props) {
435
+ const { help } = props;
436
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "rjsf-field-help-template text-gray-500 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { children: help }) });
437
+ }
438
+
439
+ // src/templates/FieldTemplate/FieldTemplate.tsx
440
+ var import_jsx_runtime13 = require("react/jsx-runtime");
441
+ function FieldTemplate(props) {
442
+ const {
443
+ id,
444
+ label,
445
+ children,
446
+ errors,
447
+ formContext,
448
+ formData,
449
+ help,
450
+ hideError,
451
+ displayLabel,
452
+ classNames,
453
+ // Destructure props we don't want to pass to div
454
+ onKeyChange,
455
+ onDropPropertyClick,
456
+ uiSchema,
457
+ schema,
458
+ readonly,
459
+ required,
460
+ rawErrors,
461
+ rawHelp,
462
+ rawDescription,
463
+ hidden,
464
+ onChange,
465
+ registry,
466
+ ...divProps
467
+ } = props;
468
+ const isCheckbox = schema.type === "boolean";
469
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: `field-template mb-3 ${classNames || ""}`, ...divProps, children: [
470
+ displayLabel && !isCheckbox && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: id, className: "label", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "label-text font-medium", children: [
471
+ label,
472
+ required && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-error ml-1", children: "*" })
473
+ ] }) }),
474
+ children,
475
+ errors,
476
+ help
477
+ ] });
478
+ }
479
+
480
+ // src/templates/GridTemplate/GridTemplate.tsx
481
+ var import_jsx_runtime14 = require("react/jsx-runtime");
482
+ function GridTemplate(props) {
483
+ const { children, column, ...rest } = props;
484
+ if (column) {
485
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex-grow", ...rest, children });
486
+ }
487
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-wrap gap-4", ...rest, children });
488
+ }
489
+
490
+ // src/templates/ObjectFieldTemplate/ObjectFieldTemplate.tsx
491
+ var import_utils8 = require("@rjsf/utils");
492
+ var import_jsx_runtime15 = require("react/jsx-runtime");
493
+ function ObjectFieldTemplate(props) {
494
+ const {
495
+ description,
496
+ title,
497
+ properties,
498
+ required,
499
+ disabled,
500
+ readonly,
501
+ uiSchema,
502
+ idSchema,
503
+ schema,
504
+ formData,
505
+ onAddClick,
506
+ registry
507
+ } = props;
508
+ const uiOptions = (0, import_utils8.getUiOptions)(uiSchema);
509
+ const TitleFieldTemplate = (0, import_utils8.getTemplate)("TitleFieldTemplate", registry, uiOptions);
510
+ const DescriptionFieldTemplate = (0, import_utils8.getTemplate)(
511
+ "DescriptionFieldTemplate",
512
+ registry,
513
+ uiOptions
514
+ );
515
+ const {
516
+ ButtonTemplates: { AddButton: AddButton2 }
517
+ } = registry.templates;
518
+ const isRoot = idSchema.$id === "root";
519
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: `form-control ${isRoot ? "bg-base-100 p-6 rounded-xl shadow-lg" : ""}`, children: [
520
+ title && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
521
+ TitleFieldTemplate,
522
+ {
523
+ id: (0, import_utils8.titleId)(idSchema),
524
+ title,
525
+ required,
526
+ schema,
527
+ uiSchema,
528
+ registry
529
+ }
530
+ ),
531
+ description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
532
+ DescriptionFieldTemplate,
533
+ {
534
+ id: (0, import_utils8.descriptionId)(idSchema),
535
+ description,
536
+ schema,
537
+ uiSchema,
538
+ registry
539
+ }
540
+ ),
541
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: `grid grid-cols-1 gap-${description ? 3 : 4} ${isRoot ? "" : "mb-4"}`, children: [
542
+ properties.map(
543
+ (element, index) => element.hidden ? element.content : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
544
+ "div",
545
+ {
546
+ className: idSchema.$id === "root" && element.name === "tasks" ? "mt-2" : "",
547
+ children: element.content
548
+ },
549
+ `${idSchema.$id}-${element.name}-${index}`
550
+ )
551
+ ),
552
+ (0, import_utils8.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
553
+ AddButton2,
554
+ {
555
+ id: (0, import_utils8.buttonId)(idSchema, "add"),
556
+ className: "rjsf-object-property-expand btn btn-primary btn-sm",
557
+ onClick: onAddClick(schema),
558
+ disabled: disabled || readonly,
559
+ uiSchema,
560
+ registry
561
+ }
562
+ ) })
563
+ ] })
564
+ ] });
565
+ }
566
+
567
+ // src/templates/TitleField/TitleField.tsx
568
+ var import_utils9 = require("@rjsf/utils");
569
+ var import_jsx_runtime16 = require("react/jsx-runtime");
570
+ function TitleField(props) {
571
+ const { id, title, uiSchema } = props;
572
+ const uiOptions = (0, import_utils9.getUiOptions)(uiSchema);
573
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id, className: "title-field mb-6", children: [
574
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { className: "text-3xl font-bold text-primary mb-2", children: uiOptions.title || title }),
575
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "divider divider-primary" })
576
+ ] });
577
+ }
578
+
579
+ // src/templates/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
580
+ var import_react5 = require("react");
581
+ var import_utils10 = require("@rjsf/utils");
582
+ var import_jsx_runtime17 = require("react/jsx-runtime");
583
+ function WrapIfAdditionalTemplate(props) {
584
+ const {
585
+ children,
586
+ classNames,
587
+ disabled,
588
+ id,
589
+ label,
590
+ readonly,
591
+ required,
592
+ schema,
593
+ onKeyChange,
594
+ onDropPropertyClick,
595
+ registry,
596
+ ...rest
597
+ } = props;
598
+ const { translateString } = registry;
599
+ const handleBlur = (0, import_react5.useCallback)(
600
+ (event) => {
601
+ onKeyChange(event.target.value);
602
+ },
603
+ [onKeyChange]
604
+ );
605
+ const handleRemove = (0, import_react5.useCallback)(() => {
606
+ onDropPropertyClick(label)();
607
+ }, [onDropPropertyClick, label]);
608
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: `wrap-if-additional-template ${classNames}`, ...rest, children: [
609
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center", children: [
610
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
611
+ "input",
612
+ {
613
+ type: "text",
614
+ className: "input input-bordered",
615
+ id: `${id}-key`,
616
+ onBlur: handleBlur,
617
+ defaultValue: label,
618
+ disabled: disabled || readonly
619
+ }
620
+ ),
621
+ schema.additionalProperties && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
622
+ "button",
623
+ {
624
+ id: (0, import_utils10.buttonId)(id, "remove"),
625
+ className: "rjsf-array-item-remove btn btn-danger ml-2",
626
+ onClick: handleRemove,
627
+ disabled: disabled || readonly,
628
+ children: translateString(import_utils10.TranslatableString.RemoveButton)
629
+ }
630
+ )
631
+ ] }),
632
+ children
633
+ ] });
634
+ }
635
+
636
+ // src/templates/Templates.tsx
637
+ function generateTemplates() {
638
+ return {
639
+ ArrayFieldItemTemplate,
640
+ ArrayFieldTemplate,
641
+ ArrayFieldItemButtonsTemplate,
642
+ BaseInputTemplate,
643
+ ButtonTemplates: {
644
+ AddButton,
645
+ SubmitButton,
646
+ CopyButton,
647
+ MoveDownButton,
648
+ MoveUpButton,
649
+ RemoveButton
650
+ },
651
+ DescriptionFieldTemplate: DescriptionField,
652
+ ErrorListTemplate: ErrorList,
653
+ FieldErrorTemplate,
654
+ FieldHelpTemplate,
655
+ FieldTemplate,
656
+ GridTemplate,
657
+ ObjectFieldTemplate,
658
+ TitleFieldTemplate: TitleField,
659
+ WrapIfAdditionalTemplate
660
+ };
661
+ }
662
+ var Templates_default = generateTemplates();
663
+
664
+ // src/widgets/AltDateTimeWidget/AltDateTimeWidget.tsx
665
+ var import_jsx_runtime18 = require("react/jsx-runtime");
666
+ function AltDateTimeWidget({
667
+ time = true,
668
+ ...props
669
+ }) {
670
+ const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
671
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AltDateWidget2, { time, ...props });
672
+ }
673
+ var AltDateTimeWidget_default = AltDateTimeWidget;
674
+
675
+ // src/widgets/AltDateWidget/AltDateWidget.tsx
676
+ var import_react6 = require("react");
677
+ var import_utils11 = require("@rjsf/utils");
678
+ var import_jsx_runtime19 = require("react/jsx-runtime");
679
+ function readyForChange(state, time = false) {
680
+ return state.year && state.month && state.day && (!time || state.hour && state.minute && state.second);
681
+ }
682
+ function getDateElementProps(state, time, yearsRange, format3 = "YMD") {
683
+ const rangeOptions = yearsRange ?? [1900, (/* @__PURE__ */ new Date()).getFullYear() + 2];
684
+ const formats = {
685
+ YMD: ["year", "month", "day"],
686
+ MDY: ["month", "day", "year"],
687
+ DMY: ["day", "month", "year"]
688
+ };
689
+ const dateElements = formats[format3].map((key) => ({
690
+ type: key,
691
+ value: state[key],
692
+ range: key === "year" ? rangeOptions : key === "month" ? [1, 12] : key === "day" ? [1, 31] : [0, 59]
693
+ }));
694
+ if (time) {
695
+ dateElements.push(
696
+ { type: "hour", value: state.hour, range: [0, 23] },
697
+ { type: "minute", value: state.minute, range: [0, 59] },
698
+ { type: "second", value: state.second, range: [0, 59] }
699
+ );
700
+ }
701
+ return dateElements;
702
+ }
703
+ function DateElement({
704
+ type,
705
+ range,
706
+ value,
707
+ select,
708
+ rootId,
709
+ name,
710
+ disabled,
711
+ readonly,
712
+ autofocus,
713
+ registry,
714
+ onBlur,
715
+ onFocus
716
+ }) {
717
+ const id = `${rootId}_${type}`;
718
+ const { SelectWidget: SelectWidget2 } = registry.widgets;
719
+ const handleChange = (0, import_react6.useCallback)(
720
+ (value2) => {
721
+ select(type, value2);
722
+ },
723
+ [select, type]
724
+ );
725
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
726
+ SelectWidget2,
727
+ {
728
+ schema: { type: "integer" },
729
+ id,
730
+ name,
731
+ className: "select select-bordered select-sm w-full",
732
+ options: { enumOptions: (0, import_utils11.dateRangeOptions)(range[0], range[1]) },
733
+ placeholder: type,
734
+ value,
735
+ disabled,
736
+ readonly,
737
+ autofocus,
738
+ onChange: handleChange,
739
+ onBlur,
740
+ onFocus,
741
+ registry,
742
+ label: "",
743
+ "aria-describedby": (0, import_utils11.ariaDescribedByIds)(rootId),
744
+ required: false
745
+ }
746
+ );
747
+ }
748
+ function convertToRJSFDateObject(dateObj) {
749
+ return {
750
+ year: dateObj.year ? parseInt(dateObj.year) : 0,
751
+ month: dateObj.month ? parseInt(dateObj.month) : 0,
752
+ day: dateObj.day ? parseInt(dateObj.day) : 0,
753
+ hour: dateObj.hour ? parseInt(dateObj.hour) : 0,
754
+ minute: dateObj.minute ? parseInt(dateObj.minute) : 0,
755
+ second: dateObj.second ? parseInt(dateObj.second) : 0
756
+ };
757
+ }
758
+ function AltDateWidget({
759
+ time = false,
760
+ disabled = false,
761
+ readonly = false,
762
+ autofocus = false,
763
+ options = {},
764
+ id,
765
+ name,
766
+ registry,
767
+ onBlur,
768
+ onFocus,
769
+ onChange,
770
+ value
771
+ }) {
772
+ const { translateString } = registry;
773
+ const [lastValue, setLastValue] = (0, import_react6.useState)(value);
774
+ const initialState = (0, import_utils11.parseDateString)(value, time);
775
+ const dateReducer = (state2, action) => {
776
+ return { ...state2, ...action };
777
+ };
778
+ const [state, setState] = (0, import_react6.useReducer)(dateReducer, initialState);
779
+ (0, import_react6.useEffect)(() => {
780
+ const rjsfDateObj = convertToRJSFDateObject(state);
781
+ const stateValue = (0, import_utils11.toDateString)(rjsfDateObj, time);
782
+ if (readyForChange(state, time) && stateValue !== value) {
783
+ onChange(stateValue);
784
+ } else if (lastValue !== value) {
785
+ setLastValue(value);
786
+ setState((0, import_utils11.parseDateString)(value, time));
787
+ }
788
+ }, [time, value, onChange, state, lastValue]);
789
+ const handleChange = (0, import_react6.useCallback)((property, value2) => {
790
+ setState({ [property]: value2 });
791
+ }, []);
792
+ const handleSetNow = (0, import_react6.useCallback)(
793
+ (event) => {
794
+ event.preventDefault();
795
+ if (disabled || readonly) {
796
+ return;
797
+ }
798
+ const nextState = (0, import_utils11.parseDateString)((/* @__PURE__ */ new Date()).toJSON(), time);
799
+ const rjsfDateObj = convertToRJSFDateObject(nextState);
800
+ onChange((0, import_utils11.toDateString)(rjsfDateObj, time));
801
+ },
802
+ [disabled, readonly, time, onChange]
803
+ );
804
+ const handleClear = (0, import_react6.useCallback)(
805
+ (event) => {
806
+ event.preventDefault();
807
+ if (disabled || readonly) {
808
+ return;
809
+ }
810
+ onChange(void 0);
811
+ },
812
+ [disabled, readonly, onChange]
813
+ );
814
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-3", children: [
815
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "grid grid-cols-3 gap-2", children: getDateElementProps(
816
+ state,
817
+ time,
818
+ options.yearsRange,
819
+ options.format
820
+ ).map((elemProps, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "form-control", children: [
821
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { className: "label", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "label-text capitalize", children: elemProps.type }) }),
822
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
823
+ DateElement,
824
+ {
825
+ rootId: id,
826
+ name,
827
+ select: handleChange,
828
+ type: elemProps.type,
829
+ range: elemProps.range,
830
+ value: elemProps.value,
831
+ disabled,
832
+ readonly,
833
+ registry,
834
+ onBlur,
835
+ onFocus,
836
+ autofocus: autofocus && i === 0
837
+ }
838
+ )
839
+ ] }, i)) }),
840
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex justify-start space-x-2", children: [
841
+ (options.hideNowButton !== void 0 ? !options.hideNowButton : true) && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
842
+ "button",
843
+ {
844
+ type: "button",
845
+ className: "btn btn-sm btn-primary",
846
+ onClick: handleSetNow,
847
+ disabled: disabled || readonly,
848
+ children: translateString(import_utils11.TranslatableString.NowLabel)
849
+ }
850
+ ),
851
+ (options.hideClearButton !== void 0 ? !options.hideClearButton : true) && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
852
+ "button",
853
+ {
854
+ type: "button",
855
+ className: "btn btn-sm btn-secondary",
856
+ onClick: handleClear,
857
+ disabled: disabled || readonly,
858
+ children: translateString(import_utils11.TranslatableString.ClearLabel)
859
+ }
860
+ )
861
+ ] })
862
+ ] });
863
+ }
864
+
865
+ // src/widgets/CheckboxWidget/CheckboxWidget.tsx
866
+ var import_react7 = require("react");
867
+ var import_utils12 = require("@rjsf/utils");
868
+ var import_jsx_runtime20 = require("react/jsx-runtime");
869
+ function CheckboxWidget(props) {
870
+ const {
871
+ id,
872
+ value,
873
+ required,
874
+ disabled,
875
+ hideLabel,
876
+ label,
877
+ readonly,
878
+ registry,
879
+ options,
880
+ schema,
881
+ uiSchema,
882
+ onChange,
883
+ onFocus,
884
+ onBlur
885
+ } = props;
886
+ const DescriptionFieldTemplate = (0, import_utils12.getTemplate)(
887
+ "DescriptionFieldTemplate",
888
+ registry,
889
+ options
890
+ );
891
+ const description = options.description || schema.description;
892
+ const handleFocus = (0, import_react7.useCallback)(() => {
893
+ if (onFocus) {
894
+ onFocus(id, value);
895
+ }
896
+ }, [onFocus, id, value]);
897
+ const handleBlur = (0, import_react7.useCallback)(() => {
898
+ if (onBlur) {
899
+ onBlur(id, value);
900
+ }
901
+ }, [onBlur, id, value]);
902
+ const handleChange = (0, import_react7.useCallback)(
903
+ (event) => {
904
+ onChange(event.target.checked);
905
+ },
906
+ [onChange]
907
+ );
908
+ const input = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
909
+ "input",
910
+ {
911
+ type: "checkbox",
912
+ id,
913
+ checked: value,
914
+ required,
915
+ disabled: disabled || readonly,
916
+ onChange: handleChange,
917
+ onFocus: handleFocus,
918
+ onBlur: handleBlur,
919
+ className: "checkbox"
920
+ }
921
+ );
922
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "form-control", children: [
923
+ !hideLabel && description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
924
+ DescriptionFieldTemplate,
925
+ {
926
+ id: (0, import_utils12.descriptionId)(id),
927
+ description,
928
+ schema,
929
+ uiSchema,
930
+ registry
931
+ }
932
+ ),
933
+ hideLabel || !label ? input : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { className: "label cursor-pointer justify-start", children: [
934
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "mr-2", children: input }),
935
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "label-text", children: [
936
+ label,
937
+ required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-error ml-1", children: "*" })
938
+ ] })
939
+ ] })
940
+ ] });
941
+ }
942
+
943
+ // src/widgets/CheckboxesWidget/CheckboxesWidget.tsx
944
+ var import_react8 = require("react");
945
+ var import_jsx_runtime21 = require("react/jsx-runtime");
946
+ function CheckboxesWidget({
947
+ id,
948
+ disabled,
949
+ options,
950
+ value,
951
+ readonly,
952
+ required,
953
+ onChange,
954
+ onFocus,
955
+ onBlur
956
+ }) {
957
+ const { enumOptions } = options;
958
+ const isEnumeratedObject = enumOptions && enumOptions[0]?.value && typeof enumOptions[0].value === "object";
959
+ const isChecked = (0, import_react8.useCallback)(
960
+ (option) => {
961
+ if (!Array.isArray(value)) {
962
+ return false;
963
+ }
964
+ if (isEnumeratedObject) {
965
+ return value.some((v) => v.name === option.value.name);
966
+ }
967
+ return value.includes(option.value);
968
+ },
969
+ [value, isEnumeratedObject]
970
+ );
971
+ const handleChange = (0, import_react8.useCallback)(
972
+ (event) => {
973
+ const index = Number(event.target.dataset.index);
974
+ const option = enumOptions?.[index];
975
+ if (!option) {
976
+ return;
977
+ }
978
+ const newValue = Array.isArray(value) ? [...value] : [];
979
+ const optionValue = isEnumeratedObject ? option.value : option.value;
980
+ if (isChecked(option)) {
981
+ onChange(newValue.filter((v) => isEnumeratedObject ? v.name !== optionValue.name : v !== optionValue));
982
+ } else {
983
+ onChange([...newValue, optionValue]);
984
+ }
985
+ },
986
+ [onChange, value, isChecked, isEnumeratedObject, enumOptions]
987
+ );
988
+ const handleFocus = (0, import_react8.useCallback)(
989
+ (event) => {
990
+ if (onFocus) {
991
+ const index = Number(event.target.dataset.index);
992
+ const option = enumOptions?.[index];
993
+ if (option) {
994
+ onFocus(id, option.value);
995
+ }
996
+ }
997
+ },
998
+ [onFocus, id, enumOptions]
999
+ );
1000
+ const handleBlur = (0, import_react8.useCallback)(
1001
+ (event) => {
1002
+ if (onBlur) {
1003
+ const index = Number(event.target.dataset.index);
1004
+ const option = enumOptions?.[index];
1005
+ if (option) {
1006
+ onBlur(id, option.value);
1007
+ }
1008
+ }
1009
+ },
1010
+ [onBlur, id, enumOptions]
1011
+ );
1012
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "form-control", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex flex-col gap-2 mt-1", children: enumOptions?.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "flex items-center cursor-pointer gap-2", children: [
1013
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1014
+ "input",
1015
+ {
1016
+ type: "checkbox",
1017
+ id: `${id}-${option.value}`,
1018
+ className: "checkbox",
1019
+ name: id,
1020
+ checked: isChecked(option),
1021
+ required,
1022
+ disabled: disabled || readonly,
1023
+ "data-index": index,
1024
+ onChange: handleChange,
1025
+ onFocus: handleFocus,
1026
+ onBlur: handleBlur
1027
+ }
1028
+ ),
1029
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "label-text", children: option.label })
1030
+ ] }, option.value)) }) });
1031
+ }
1032
+
1033
+ // src/widgets/DateTimeWidget/DateTimeWidget.tsx
1034
+ var import_react9 = require("react");
1035
+ var import_free_solid_svg_icons3 = require("@fortawesome/free-solid-svg-icons");
1036
+ var import_react_fontawesome2 = require("@fortawesome/react-fontawesome");
1037
+ var import_date_fns = require("date-fns");
1038
+ var import_react_day_picker = require("react-day-picker");
1039
+ var import_style = require("react-day-picker/dist/style.css");
1040
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1041
+ function useDatePickerState(initialDate) {
1042
+ const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
1043
+ const [month, setMonth] = (0, import_react9.useState)(initialDate ?? /* @__PURE__ */ new Date());
1044
+ return { isOpen, setIsOpen, month, setMonth };
1045
+ }
1046
+ function useClickOutside(ref, callback) {
1047
+ (0, import_react9.useEffect)(() => {
1048
+ const handleClickOutside = (event) => {
1049
+ if (ref.current && !ref.current.contains(event.target)) {
1050
+ callback();
1051
+ }
1052
+ };
1053
+ document.addEventListener("mousedown", handleClickOutside);
1054
+ return () => document.removeEventListener("mousedown", handleClickOutside);
1055
+ }, [ref, callback]);
1056
+ }
1057
+ var dayPickerStyles = {
1058
+ classNames: {
1059
+ [import_react_day_picker.UI.Root]: "relative",
1060
+ [import_react_day_picker.UI.Nav]: "hidden",
1061
+ [import_react_day_picker.UI.Chevron]: "hidden",
1062
+ [import_react_day_picker.UI.CaptionLabel]: "hidden",
1063
+ [import_react_day_picker.UI.Dropdowns]: "flex justify-between gap-4 px-4 pb-4",
1064
+ [import_react_day_picker.UI.Dropdown]: "select select-bordered select-sm w-32",
1065
+ [import_react_day_picker.UI.MonthsDropdown]: "select select-bordered select-sm",
1066
+ [import_react_day_picker.UI.YearsDropdown]: "select select-bordered select-sm",
1067
+ [import_react_day_picker.UI.Months]: "flex justify-center",
1068
+ [import_react_day_picker.UI.Month]: "w-full",
1069
+ [import_react_day_picker.UI.MonthCaption]: "flex justify-center",
1070
+ [import_react_day_picker.UI.MonthGrid]: "w-full",
1071
+ [import_react_day_picker.UI.Weekdays]: "grid grid-cols-7 text-center border-b mb-2 pb-1 text-base-content/60 uppercase",
1072
+ [import_react_day_picker.UI.Weekday]: "p-1 font-medium text-base-content/60 text-sm",
1073
+ [import_react_day_picker.UI.Week]: "grid grid-cols-7",
1074
+ [import_react_day_picker.UI.Day]: "w-10 h-8 p-0 relative rounded-md",
1075
+ [import_react_day_picker.UI.DayButton]: "btn btn-ghost absolute inset-0 flex items-center justify-center w-full h-full cursor-pointer rounded-md hover:btn-primary"
1076
+ },
1077
+ modifiers: {
1078
+ selected: "btn btn-accent min-h-0 h-full",
1079
+ outside: "text-base-content/30 hover:btn-ghost",
1080
+ disabled: "opacity-50 cursor-not-allowed hover:btn-disabled"
1081
+ }
1082
+ };
1083
+ function DateTimePickerPopup({ selectedDate, month, onMonthChange, onSelect, onTimeChange }) {
1084
+ const customDayModifiers = {
1085
+ selected: selectedDate,
1086
+ "custom-today": (date) => (0, import_date_fns.isToday)(date) && !(selectedDate && (0, import_date_fns.isSameDay)(date, selectedDate))
1087
+ };
1088
+ const customModifiersClassNames = {
1089
+ ...dayPickerStyles.modifiers,
1090
+ "custom-today": "btn btn-outline btn-info min-h-0 h-full"
1091
+ };
1092
+ const handleClick = (0, import_react9.useCallback)((e) => {
1093
+ e.stopPropagation();
1094
+ }, []);
1095
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "p-3", children: [
1096
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1097
+ import_react_day_picker.DayPicker,
1098
+ {
1099
+ mode: "single",
1100
+ selected: selectedDate,
1101
+ month,
1102
+ onMonthChange,
1103
+ onSelect,
1104
+ captionLayout: "dropdown",
1105
+ fromYear: 1900,
1106
+ toYear: (/* @__PURE__ */ new Date()).getFullYear() + 10,
1107
+ showOutsideDays: true,
1108
+ classNames: dayPickerStyles.classNames,
1109
+ modifiers: customDayModifiers,
1110
+ modifiersClassNames: customModifiersClassNames
1111
+ }
1112
+ ),
1113
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "mt-3 border-t border-base-300 pt-3", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "form-control w-full", children: [
1114
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("label", { className: "label", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "label-text", children: "Time" }) }),
1115
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1116
+ "input",
1117
+ {
1118
+ type: "time",
1119
+ className: "input input-bordered w-full",
1120
+ value: selectedDate ? (0, import_date_fns.format)(selectedDate, "HH:mm") : "",
1121
+ onChange: onTimeChange,
1122
+ onClick: handleClick
1123
+ }
1124
+ )
1125
+ ] }) })
1126
+ ] });
1127
+ }
1128
+ var MemoizedDateTimePickerPopup = (0, import_react9.memo)(DateTimePickerPopup);
1129
+ function DateTimeWidget(props) {
1130
+ const { id, value, onChange, onFocus, onBlur, schema } = props;
1131
+ const initialDate = (0, import_react9.useMemo)(() => value ? new Date(value) : void 0, [value]);
1132
+ const [localDate, setLocalDate] = (0, import_react9.useState)(initialDate);
1133
+ (0, import_react9.useEffect)(() => {
1134
+ setLocalDate(initialDate);
1135
+ }, [initialDate]);
1136
+ const { isOpen, setIsOpen, month, setMonth } = useDatePickerState(initialDate);
1137
+ const containerRef = (0, import_react9.useRef)(null);
1138
+ const inputRef = (0, import_react9.useRef)(null);
1139
+ useClickOutside(containerRef, () => {
1140
+ if (isOpen) {
1141
+ setIsOpen(false);
1142
+ onChange(localDate ? localDate.toISOString() : "");
1143
+ if (onBlur) {
1144
+ onBlur(id, value);
1145
+ }
1146
+ }
1147
+ });
1148
+ (0, import_react9.useEffect)(() => {
1149
+ if (localDate) {
1150
+ setMonth(localDate);
1151
+ }
1152
+ }, [localDate, setMonth]);
1153
+ const handleMonthChange = (0, import_react9.useCallback)((date) => setMonth(date), [setMonth]);
1154
+ const handleSelect = (0, import_react9.useCallback)(
1155
+ (date) => {
1156
+ if (date) {
1157
+ if (localDate) {
1158
+ date.setHours(localDate.getHours(), localDate.getMinutes());
1159
+ }
1160
+ setLocalDate(date);
1161
+ }
1162
+ },
1163
+ [localDate]
1164
+ );
1165
+ const handleTimeChange = (0, import_react9.useCallback)(
1166
+ (e) => {
1167
+ if (localDate) {
1168
+ const [hours, minutes] = e.target.value.split(":");
1169
+ const newDate = new Date(localDate);
1170
+ newDate.setHours(parseInt(hours, 10), parseInt(minutes, 10));
1171
+ setLocalDate(newDate);
1172
+ }
1173
+ },
1174
+ [localDate]
1175
+ );
1176
+ const togglePicker = (0, import_react9.useCallback)(
1177
+ (e) => {
1178
+ e.stopPropagation();
1179
+ setIsOpen((prev) => !prev);
1180
+ if (!isOpen && onFocus) {
1181
+ onFocus(id, value);
1182
+ }
1183
+ },
1184
+ [isOpen, id, onFocus, setIsOpen, value]
1185
+ );
1186
+ const handleFocus = (0, import_react9.useCallback)(() => {
1187
+ if (onFocus) {
1188
+ onFocus(id, value);
1189
+ }
1190
+ }, [id, onFocus, value]);
1191
+ const handleBlur = (0, import_react9.useCallback)(() => {
1192
+ if (!isOpen && onBlur) {
1193
+ onBlur(id, value);
1194
+ }
1195
+ }, [id, onBlur, value, isOpen]);
1196
+ const handleKeyDown = (0, import_react9.useCallback)(
1197
+ (e) => {
1198
+ if (e.key === "Enter" || e.key === " ") {
1199
+ togglePicker(e);
1200
+ }
1201
+ },
1202
+ [togglePicker]
1203
+ );
1204
+ const handleContainerClick = (0, import_react9.useCallback)((e) => {
1205
+ e.stopPropagation();
1206
+ }, []);
1207
+ (0, import_react9.useEffect)(() => {
1208
+ const handleEscape = (e) => {
1209
+ if (e.key === "Escape" && isOpen) {
1210
+ setIsOpen(false);
1211
+ if (onBlur) {
1212
+ onBlur(id, value);
1213
+ }
1214
+ }
1215
+ };
1216
+ document.addEventListener("keydown", handleEscape);
1217
+ return () => document.removeEventListener("keydown", handleEscape);
1218
+ }, [id, isOpen, onBlur, value]);
1219
+ const handleDoneClick = (0, import_react9.useCallback)(() => {
1220
+ setIsOpen(false);
1221
+ onChange(localDate ? localDate.toISOString() : "");
1222
+ if (onBlur) {
1223
+ onBlur(id, value);
1224
+ }
1225
+ inputRef.current?.focus();
1226
+ }, [localDate, onChange, onBlur, id, value]);
1227
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "form-control my-4 w-full relative", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
1228
+ "div",
1229
+ {
1230
+ className: "w-full",
1231
+ tabIndex: 0,
1232
+ onKeyDown: handleKeyDown,
1233
+ onFocus: handleFocus,
1234
+ onBlur: handleBlur,
1235
+ ref: inputRef,
1236
+ children: [
1237
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
1238
+ "div",
1239
+ {
1240
+ id,
1241
+ className: `input input-bordered w-full flex items-center justify-between cursor-pointer ${isOpen ? "ring-2 ring-primary/50" : ""}`,
1242
+ onClick: togglePicker,
1243
+ role: "button",
1244
+ "aria-haspopup": "true",
1245
+ "aria-expanded": isOpen,
1246
+ tabIndex: -1,
1247
+ children: [
1248
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: localDate && (0, import_date_fns.isValid)(localDate) ? "" : "text-base-content/50", children: localDate && (0, import_date_fns.isValid)(localDate) ? (0, import_date_fns.format)(localDate, "PP p") : schema.title }),
1249
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_fontawesome2.FontAwesomeIcon, { icon: import_free_solid_svg_icons3.faCalendar, className: "ml-2 h-4 w-4 text-primary" })
1250
+ ]
1251
+ }
1252
+ ),
1253
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
1254
+ "div",
1255
+ {
1256
+ ref: containerRef,
1257
+ className: "absolute z-[100] mt-2 w-full max-w-xs bg-base-100 border border-base-300 shadow-lg rounded-box",
1258
+ onClick: handleContainerClick,
1259
+ children: [
1260
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1261
+ MemoizedDateTimePickerPopup,
1262
+ {
1263
+ selectedDate: localDate,
1264
+ month,
1265
+ onMonthChange: handleMonthChange,
1266
+ onSelect: handleSelect,
1267
+ onTimeChange: handleTimeChange
1268
+ }
1269
+ ),
1270
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "p-3 flex justify-end border-t border-base-300", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { type: "button", className: "btn btn-sm btn-primary", onClick: handleDoneClick, children: "Done" }) })
1271
+ ]
1272
+ }
1273
+ )
1274
+ ]
1275
+ }
1276
+ ) });
1277
+ }
1278
+
1279
+ // src/widgets/DateWidget/DateWidget.tsx
1280
+ var import_react10 = require("react");
1281
+ var import_free_solid_svg_icons4 = require("@fortawesome/free-solid-svg-icons");
1282
+ var import_react_fontawesome3 = require("@fortawesome/react-fontawesome");
1283
+ var import_date_fns2 = require("date-fns");
1284
+ var import_react_day_picker2 = require("react-day-picker");
1285
+ var import_style2 = require("react-day-picker/dist/style.css");
1286
+ var import_jsx_runtime23 = require("react/jsx-runtime");
1287
+ function useDatePickerState2(initialDate) {
1288
+ const [isOpen, setIsOpen] = (0, import_react10.useState)(false);
1289
+ const [month, setMonth] = (0, import_react10.useState)(initialDate ?? /* @__PURE__ */ new Date());
1290
+ return { isOpen, setIsOpen, month, setMonth };
1291
+ }
1292
+ function useClickOutside2(ref, callback) {
1293
+ (0, import_react10.useEffect)(() => {
1294
+ const handleClickOutside = (event) => {
1295
+ if (ref.current && !ref.current.contains(event.target)) {
1296
+ callback();
1297
+ }
1298
+ };
1299
+ document.addEventListener("mousedown", handleClickOutside);
1300
+ return () => document.removeEventListener("mousedown", handleClickOutside);
1301
+ }, [ref, callback]);
1302
+ }
1303
+ var dayPickerStyles2 = {
1304
+ classNames: {
1305
+ [import_react_day_picker2.UI.Root]: "relative",
1306
+ [import_react_day_picker2.UI.Nav]: "hidden",
1307
+ [import_react_day_picker2.UI.Chevron]: "hidden",
1308
+ [import_react_day_picker2.UI.CaptionLabel]: "hidden",
1309
+ [import_react_day_picker2.UI.Dropdowns]: "flex justify-between gap-4 px-4 pb-4",
1310
+ [import_react_day_picker2.UI.Dropdown]: "select select-bordered select-sm w-32",
1311
+ [import_react_day_picker2.UI.MonthsDropdown]: "select select-bordered select-sm",
1312
+ [import_react_day_picker2.UI.YearsDropdown]: "select select-bordered select-sm",
1313
+ [import_react_day_picker2.UI.Months]: "flex justify-center",
1314
+ [import_react_day_picker2.UI.Month]: "w-full",
1315
+ [import_react_day_picker2.UI.MonthCaption]: "flex justify-center",
1316
+ [import_react_day_picker2.UI.MonthGrid]: "w-full",
1317
+ [import_react_day_picker2.UI.Weekdays]: "grid grid-cols-7 text-center border-b mb-2 pb-1 text-base-content/60 uppercase",
1318
+ [import_react_day_picker2.UI.Weekday]: "p-1 font-medium text-base-content/60 text-sm",
1319
+ [import_react_day_picker2.UI.Week]: "grid grid-cols-7",
1320
+ [import_react_day_picker2.UI.Day]: "w-10 h-8 p-0 relative rounded-md",
1321
+ [import_react_day_picker2.UI.DayButton]: "btn btn-ghost absolute inset-0 flex items-center justify-center w-full h-full cursor-pointer rounded-md hover:btn-primary"
1322
+ },
1323
+ modifiers: {
1324
+ selected: "btn btn-accent min-h-0 h-full",
1325
+ outside: "text-base-content/30 hover:btn-ghost",
1326
+ disabled: "opacity-50 cursor-not-allowed hover:btn-disabled"
1327
+ }
1328
+ };
1329
+ function DatePickerPopup({ selectedDate, month, onMonthChange, onSelect }) {
1330
+ const customDayModifiers = {
1331
+ selected: selectedDate,
1332
+ "custom-today": (date) => (0, import_date_fns2.isToday)(date) && !(selectedDate && (0, import_date_fns2.isSameDay)(date, selectedDate))
1333
+ };
1334
+ const customModifiersClassNames = {
1335
+ ...dayPickerStyles2.modifiers,
1336
+ "custom-today": "btn btn-outline btn-info min-h-0 h-full"
1337
+ };
1338
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "p-3", style: { minWidth: "320px", minHeight: "350px" }, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1339
+ import_react_day_picker2.DayPicker,
1340
+ {
1341
+ mode: "single",
1342
+ selected: selectedDate,
1343
+ month,
1344
+ onMonthChange,
1345
+ onSelect,
1346
+ captionLayout: "dropdown",
1347
+ fromYear: 1900,
1348
+ toYear: (/* @__PURE__ */ new Date()).getFullYear() + 10,
1349
+ showOutsideDays: true,
1350
+ classNames: dayPickerStyles2.classNames,
1351
+ modifiers: customDayModifiers,
1352
+ modifiersClassNames: customModifiersClassNames
1353
+ }
1354
+ ) });
1355
+ }
1356
+ var MemoizedDatePickerPopup = (0, import_react10.memo)(DatePickerPopup);
1357
+ function DateWidget(props) {
1358
+ const { id, value, onChange, onFocus, onBlur, schema } = props;
1359
+ const initialDate = (0, import_react10.useMemo)(() => value ? new Date(value) : void 0, [value]);
1360
+ const [localDate, setLocalDate] = (0, import_react10.useState)(initialDate);
1361
+ (0, import_react10.useEffect)(() => {
1362
+ setLocalDate(initialDate);
1363
+ }, [initialDate]);
1364
+ const { isOpen, setIsOpen, month, setMonth } = useDatePickerState2(initialDate);
1365
+ const containerRef = (0, import_react10.useRef)(null);
1366
+ const inputRef = (0, import_react10.useRef)(null);
1367
+ useClickOutside2(containerRef, () => {
1368
+ if (isOpen) {
1369
+ setIsOpen(false);
1370
+ onChange(localDate ? localDate.toISOString() : "");
1371
+ if (onBlur) {
1372
+ onBlur(id, value);
1373
+ }
1374
+ }
1375
+ });
1376
+ (0, import_react10.useEffect)(() => {
1377
+ if (localDate) {
1378
+ setMonth(localDate);
1379
+ }
1380
+ }, [localDate, setMonth]);
1381
+ const handleMonthChange = (0, import_react10.useCallback)((date) => setMonth(date), [setMonth]);
1382
+ const handleSelect = (0, import_react10.useCallback)((date) => {
1383
+ if (date) {
1384
+ date.setHours(0, 0, 0, 0);
1385
+ setLocalDate(date);
1386
+ }
1387
+ }, []);
1388
+ (0, import_react10.useEffect)(() => {
1389
+ let portalContainer = document.getElementById("date-picker-portal");
1390
+ if (!portalContainer) {
1391
+ portalContainer = document.createElement("div");
1392
+ portalContainer.id = "date-picker-portal";
1393
+ document.body.appendChild(portalContainer);
1394
+ }
1395
+ return () => {
1396
+ const container = document.getElementById("date-picker-portal");
1397
+ if (container && document.querySelectorAll(".date-picker-popup").length === 0) {
1398
+ container.remove();
1399
+ }
1400
+ };
1401
+ }, []);
1402
+ const getDocumentAndWindow = () => {
1403
+ let doc = document;
1404
+ let win = window;
1405
+ try {
1406
+ if (window.frameElement) {
1407
+ const iframe = window.frameElement;
1408
+ if (iframe.contentDocument) {
1409
+ doc = iframe.contentDocument;
1410
+ }
1411
+ if (iframe.contentWindow) {
1412
+ win = iframe.contentWindow;
1413
+ }
1414
+ }
1415
+ } catch (e) {
1416
+ console.log("Unable to access parent frame:", e);
1417
+ }
1418
+ return { doc, win };
1419
+ };
1420
+ const renderCalendar = (0, import_react10.useCallback)(() => {
1421
+ if (!containerRef.current || !inputRef.current) {
1422
+ return;
1423
+ }
1424
+ const { win } = getDocumentAndWindow();
1425
+ const inputRect = inputRef.current.getBoundingClientRect();
1426
+ const containerWidth = 320;
1427
+ containerRef.current.style.position = "fixed";
1428
+ containerRef.current.style.top = `${inputRect.bottom + 5}px`;
1429
+ const rightEdge = inputRect.left + containerWidth;
1430
+ const windowWidth = win.innerWidth;
1431
+ if (rightEdge > windowWidth - 20) {
1432
+ containerRef.current.style.left = `${Math.max(20, windowWidth - 20 - containerWidth)}px`;
1433
+ } else {
1434
+ containerRef.current.style.left = `${inputRect.left}px`;
1435
+ }
1436
+ containerRef.current.style.zIndex = "99999";
1437
+ }, [containerRef, inputRef]);
1438
+ (0, import_react10.useEffect)(() => {
1439
+ if (!isOpen) {
1440
+ return;
1441
+ }
1442
+ renderCalendar();
1443
+ window.addEventListener("resize", renderCalendar);
1444
+ window.addEventListener("scroll", renderCalendar);
1445
+ return () => {
1446
+ window.removeEventListener("resize", renderCalendar);
1447
+ window.removeEventListener("scroll", renderCalendar);
1448
+ };
1449
+ }, [isOpen, renderCalendar]);
1450
+ const togglePicker = (0, import_react10.useCallback)(
1451
+ (e) => {
1452
+ e.stopPropagation();
1453
+ setIsOpen((prev) => !prev);
1454
+ if (!isOpen && onFocus) {
1455
+ onFocus(id, value);
1456
+ }
1457
+ },
1458
+ [isOpen, id, onFocus, setIsOpen, value]
1459
+ );
1460
+ const handleFocus = (0, import_react10.useCallback)(() => {
1461
+ if (onFocus) {
1462
+ onFocus(id, value);
1463
+ }
1464
+ }, [id, onFocus, value]);
1465
+ const handleBlur = (0, import_react10.useCallback)(() => {
1466
+ if (!isOpen && onBlur) {
1467
+ onBlur(id, value);
1468
+ }
1469
+ }, [id, onBlur, value, isOpen]);
1470
+ (0, import_react10.useEffect)(() => {
1471
+ const handleEscape = (e) => {
1472
+ if (e.key === "Escape" && isOpen) {
1473
+ setIsOpen(false);
1474
+ if (onBlur) {
1475
+ onBlur(id, value);
1476
+ }
1477
+ }
1478
+ };
1479
+ document.addEventListener("keydown", handleEscape);
1480
+ return () => document.removeEventListener("keydown", handleEscape);
1481
+ }, [id, isOpen, onBlur, value]);
1482
+ const handleDoneClick = (0, import_react10.useCallback)(() => {
1483
+ setIsOpen(false);
1484
+ onChange(localDate ? localDate.toISOString() : "");
1485
+ if (onBlur) {
1486
+ onBlur(id, value);
1487
+ }
1488
+ inputRef.current?.focus();
1489
+ }, [localDate, onChange, onBlur, id, value]);
1490
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "form-control my-4 w-full relative", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
1491
+ "div",
1492
+ {
1493
+ className: "w-full",
1494
+ tabIndex: 0,
1495
+ onKeyDown: (e) => {
1496
+ if (e.key === "Enter" || e.key === " ") {
1497
+ togglePicker(e);
1498
+ }
1499
+ },
1500
+ onFocus: handleFocus,
1501
+ onBlur: handleBlur,
1502
+ ref: inputRef,
1503
+ children: [
1504
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
1505
+ "div",
1506
+ {
1507
+ id,
1508
+ className: `input input-bordered w-full flex items-center justify-between cursor-pointer ${isOpen ? "ring-2 ring-primary/50" : ""}`,
1509
+ onClick: togglePicker,
1510
+ role: "button",
1511
+ "aria-haspopup": "true",
1512
+ "aria-expanded": isOpen,
1513
+ tabIndex: -1,
1514
+ children: [
1515
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: localDate && (0, import_date_fns2.isValid)(localDate) ? "" : "text-base-content/50", children: localDate && (0, import_date_fns2.isValid)(localDate) ? (0, import_date_fns2.format)(localDate, "PP") : schema.title }),
1516
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_fontawesome3.FontAwesomeIcon, { icon: import_free_solid_svg_icons4.faCalendar, className: "ml-2 h-4 w-4 text-primary" })
1517
+ ]
1518
+ }
1519
+ ),
1520
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
1521
+ "div",
1522
+ {
1523
+ ref: containerRef,
1524
+ className: "date-picker-popup fixed z-[99999] w-full max-w-xs bg-base-100 border border-base-300 shadow-lg rounded-box",
1525
+ style: {
1526
+ maxHeight: "none",
1527
+ overflow: "visible"
1528
+ },
1529
+ onClick: (e) => e.stopPropagation(),
1530
+ children: [
1531
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1532
+ MemoizedDatePickerPopup,
1533
+ {
1534
+ selectedDate: localDate,
1535
+ month,
1536
+ onMonthChange: handleMonthChange,
1537
+ onSelect: handleSelect
1538
+ }
1539
+ ),
1540
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "p-3 flex justify-end border-t border-base-300", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { type: "button", className: "btn btn-sm btn-primary", onClick: handleDoneClick, children: "Done" }) })
1541
+ ]
1542
+ }
1543
+ )
1544
+ ]
1545
+ }
1546
+ ) });
1547
+ }
1548
+
1549
+ // src/widgets/FileWidget/FileWidget.tsx
1550
+ var import_react11 = require("react");
1551
+ var import_jsx_runtime24 = require("react/jsx-runtime");
1552
+ function FileWidget(props) {
1553
+ const { id, required, disabled, readonly, schema, onChange, onFocus, onBlur, options = {} } = props;
1554
+ const isMulti = schema.type === "array" || Boolean(options.multiple);
1555
+ const accept = typeof options.accept === "string" ? options.accept : void 0;
1556
+ const handleChange = (0, import_react11.useCallback)(
1557
+ (event) => {
1558
+ if (!event.target.files) {
1559
+ return;
1560
+ }
1561
+ const fileList = Array.from(event.target.files);
1562
+ if (isMulti) {
1563
+ onChange(fileList);
1564
+ } else {
1565
+ onChange(fileList[0] || null);
1566
+ }
1567
+ },
1568
+ [onChange, isMulti]
1569
+ );
1570
+ const handleFocus = (0, import_react11.useCallback)(
1571
+ (event) => {
1572
+ if (onFocus) {
1573
+ onFocus(id, event.target.files ? Array.from(event.target.files) : null);
1574
+ }
1575
+ },
1576
+ [onFocus, id]
1577
+ );
1578
+ const handleBlur = (0, import_react11.useCallback)(
1579
+ (event) => {
1580
+ if (onBlur) {
1581
+ onBlur(id, event.target.files ? Array.from(event.target.files) : null);
1582
+ }
1583
+ },
1584
+ [onBlur, id]
1585
+ );
1586
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1587
+ "input",
1588
+ {
1589
+ id,
1590
+ type: "file",
1591
+ className: "file-input w-full",
1592
+ required,
1593
+ disabled: disabled || readonly,
1594
+ onChange: handleChange,
1595
+ onFocus: handleFocus,
1596
+ onBlur: handleBlur,
1597
+ multiple: isMulti,
1598
+ accept
1599
+ }
1600
+ );
1601
+ }
1602
+
1603
+ // src/widgets/RadioWidget/RadioWidget.tsx
1604
+ var import_react12 = require("react");
1605
+ var import_jsx_runtime25 = require("react/jsx-runtime");
1606
+ function RadioWidget({
1607
+ id,
1608
+ options,
1609
+ value,
1610
+ required,
1611
+ disabled,
1612
+ readonly,
1613
+ onChange,
1614
+ onFocus,
1615
+ onBlur
1616
+ }) {
1617
+ const { enumOptions } = options;
1618
+ const isEnumeratedObject = enumOptions && enumOptions[0]?.value && typeof enumOptions[0].value === "object";
1619
+ const getValue = (option) => {
1620
+ return option.value;
1621
+ };
1622
+ const isChecked = (option) => {
1623
+ if (isEnumeratedObject) {
1624
+ return value && value.name === option.value.name;
1625
+ }
1626
+ return value === option.value;
1627
+ };
1628
+ const handleFocus = (0, import_react12.useCallback)(
1629
+ (event) => {
1630
+ if (onFocus) {
1631
+ const index = Number(event.target.dataset.index);
1632
+ const optionValue = enumOptions?.[index]?.value;
1633
+ onFocus(id, optionValue);
1634
+ }
1635
+ },
1636
+ [onFocus, id, enumOptions]
1637
+ );
1638
+ const handleBlur = (0, import_react12.useCallback)(
1639
+ (event) => {
1640
+ if (onBlur) {
1641
+ const index = Number(event.target.dataset.index);
1642
+ const optionValue = enumOptions?.[index]?.value;
1643
+ onBlur(id, optionValue);
1644
+ }
1645
+ },
1646
+ [onBlur, id, enumOptions]
1647
+ );
1648
+ const handleChange = (0, import_react12.useCallback)(
1649
+ (event) => {
1650
+ const index = Number(event.target.dataset.index);
1651
+ const option = enumOptions?.[index];
1652
+ if (option) {
1653
+ onChange(isEnumeratedObject ? option.value : option.value);
1654
+ event.target.blur();
1655
+ }
1656
+ },
1657
+ [onChange, isEnumeratedObject, enumOptions]
1658
+ );
1659
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "form-control", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex flex-col gap-2 mt-1", children: enumOptions?.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "flex items-center cursor-pointer gap-2", children: [
1660
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1661
+ "input",
1662
+ {
1663
+ type: "radio",
1664
+ id: `${id}-${option.value}`,
1665
+ className: "radio",
1666
+ name: id,
1667
+ value: getValue(option),
1668
+ checked: isChecked(option),
1669
+ required,
1670
+ disabled: disabled || readonly,
1671
+ "data-index": index,
1672
+ onChange: handleChange,
1673
+ onFocus: handleFocus,
1674
+ onBlur: handleBlur
1675
+ }
1676
+ ),
1677
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "label-text", children: option.label })
1678
+ ] }, option.value)) }) });
1679
+ }
1680
+
1681
+ // src/widgets/RangeWidget/RangeWidget.tsx
1682
+ var import_react13 = require("react");
1683
+ var import_jsx_runtime26 = require("react/jsx-runtime");
1684
+ function RangeWidget({
1685
+ id,
1686
+ value,
1687
+ required,
1688
+ disabled,
1689
+ readonly,
1690
+ onChange,
1691
+ onFocus,
1692
+ onBlur,
1693
+ schema
1694
+ }) {
1695
+ const handleFocus = (event) => {
1696
+ if (onFocus) {
1697
+ onFocus(id, event.target.value);
1698
+ }
1699
+ };
1700
+ const handleBlur = (event) => {
1701
+ if (onBlur) {
1702
+ onBlur(id, event.target.value);
1703
+ }
1704
+ };
1705
+ const handleChange = (0, import_react13.useCallback)(
1706
+ (event) => {
1707
+ onChange(event.target.value);
1708
+ },
1709
+ [onChange]
1710
+ );
1711
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "form-control", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center", children: [
1712
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1713
+ "input",
1714
+ {
1715
+ type: "range",
1716
+ id,
1717
+ className: "range",
1718
+ value: value || schema.default,
1719
+ required,
1720
+ disabled: disabled || readonly,
1721
+ min: schema.minimum,
1722
+ max: schema.maximum,
1723
+ step: schema.multipleOf || 1,
1724
+ onChange: handleChange,
1725
+ onFocus: handleFocus,
1726
+ onBlur: handleBlur
1727
+ }
1728
+ ),
1729
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "label-text ml-4", children: value })
1730
+ ] }) });
1731
+ }
1732
+
1733
+ // src/widgets/RatingWidget/RatingWidget.tsx
1734
+ var import_react14 = require("react");
1735
+ var import_jsx_runtime27 = require("react/jsx-runtime");
1736
+ function RatingWidget({
1737
+ id,
1738
+ value,
1739
+ required,
1740
+ disabled,
1741
+ readonly,
1742
+ autofocus,
1743
+ onChange,
1744
+ onFocus,
1745
+ onBlur,
1746
+ schema,
1747
+ options
1748
+ }) {
1749
+ const { stars = 5, shape = "star", color = "orange", size = "md", colorGradient = false } = options;
1750
+ const numStars = schema.maximum ? Math.min(schema.maximum, 5) : Math.min(Math.max(stars, 1), 5);
1751
+ const min = schema.minimum || 0;
1752
+ const maskClass = shape === "heart" ? "mask-heart" : "mask-star-2";
1753
+ const sizeClass = size === "md" ? "" : `rating-${size}`;
1754
+ const _onChange = (0, import_react14.useCallback)(
1755
+ ({ target: { value: value2 } }) => {
1756
+ onChange(parseInt(value2));
1757
+ },
1758
+ [onChange]
1759
+ );
1760
+ const handleFocus = (0, import_react14.useCallback)(
1761
+ (event) => {
1762
+ if (onFocus) {
1763
+ const starValue = Number(event.target.value);
1764
+ onFocus(id, starValue);
1765
+ }
1766
+ },
1767
+ [onFocus, id]
1768
+ );
1769
+ const handleBlur = (0, import_react14.useCallback)(
1770
+ (event) => {
1771
+ if (onBlur) {
1772
+ const starValue = Number(event.target.value);
1773
+ onBlur(id, starValue);
1774
+ }
1775
+ },
1776
+ [onBlur, id]
1777
+ );
1778
+ const getColorClass = (index) => {
1779
+ if (!colorGradient) {
1780
+ return `bg-${color}-400`;
1781
+ }
1782
+ const colors = ["red", "orange", "yellow", "lime", "green"];
1783
+ const colorIdx = Math.min(index, colors.length - 1);
1784
+ return `bg-${colors[colorIdx]}-400`;
1785
+ };
1786
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "form-control w-full", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: `rating gap-1 ${sizeClass}`, children: [...Array(numStars)].map((_, index) => {
1787
+ const starValue = min + index;
1788
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1789
+ "input",
1790
+ {
1791
+ type: "radio",
1792
+ name: id,
1793
+ value: starValue,
1794
+ checked: value === starValue,
1795
+ onChange: _onChange,
1796
+ onFocus: handleFocus,
1797
+ onBlur: handleBlur,
1798
+ className: `mask ${maskClass} ${getColorClass(index)}`,
1799
+ disabled: disabled || readonly,
1800
+ required,
1801
+ autoFocus: autofocus && index === 0,
1802
+ "aria-label": `${starValue} ${shape === "heart" ? "heart" : "star"}${starValue === 1 ? "" : "s"}`
1803
+ },
1804
+ index
1805
+ );
1806
+ }) }) });
1807
+ }
1808
+
1809
+ // src/widgets/SelectWidget/SelectWidget.tsx
1810
+ var import_react15 = require("react");
1811
+ var import_utils13 = require("@rjsf/utils");
1812
+ var import_jsx_runtime28 = require("react/jsx-runtime");
1813
+ function SelectWidget({
1814
+ schema,
1815
+ id,
1816
+ options,
1817
+ label,
1818
+ disabled,
1819
+ placeholder,
1820
+ readonly,
1821
+ value,
1822
+ multiple,
1823
+ onChange,
1824
+ onBlur,
1825
+ onFocus
1826
+ }) {
1827
+ const { enumOptions, emptyValue: optEmptyVal } = options;
1828
+ multiple = typeof multiple === "undefined" ? false : !!multiple;
1829
+ const getDisplayValue = (val) => {
1830
+ if (!val) {
1831
+ return "";
1832
+ }
1833
+ if (typeof val === "object") {
1834
+ if (val.name) {
1835
+ return val.name;
1836
+ }
1837
+ return val.label || JSON.stringify(val);
1838
+ }
1839
+ return String(val);
1840
+ };
1841
+ const isEnumeratedObject = enumOptions && enumOptions[0]?.value && typeof enumOptions[0].value === "object";
1842
+ const handleOptionClick = (0, import_react15.useCallback)(
1843
+ (event) => {
1844
+ const index = Number(event.currentTarget.dataset.value);
1845
+ if (isNaN(index)) {
1846
+ return;
1847
+ }
1848
+ if (multiple) {
1849
+ const currentValue = Array.isArray(value) ? value : [];
1850
+ const optionValue = isEnumeratedObject ? enumOptions[index].value : (0, import_utils13.enumOptionsValueForIndex)(String(index), enumOptions, optEmptyVal);
1851
+ const newValue = currentValue.includes(optionValue) ? currentValue.filter((v) => v !== optionValue) : [...currentValue, optionValue];
1852
+ onChange(newValue);
1853
+ } else {
1854
+ onChange(
1855
+ isEnumeratedObject ? enumOptions[index].value : (0, import_utils13.enumOptionsValueForIndex)(String(index), enumOptions, optEmptyVal)
1856
+ );
1857
+ }
1858
+ },
1859
+ [value, multiple, isEnumeratedObject, enumOptions, optEmptyVal, onChange]
1860
+ );
1861
+ const _onBlur = (0, import_react15.useCallback)(
1862
+ ({ target }) => {
1863
+ const dataValue = target?.getAttribute("data-value");
1864
+ if (dataValue !== null) {
1865
+ onBlur(id, (0, import_utils13.enumOptionsValueForIndex)(dataValue, enumOptions, optEmptyVal));
1866
+ }
1867
+ },
1868
+ [onBlur, id, enumOptions, optEmptyVal]
1869
+ );
1870
+ const _onFocus = (0, import_react15.useCallback)(
1871
+ ({ target }) => {
1872
+ const dataValue = target?.getAttribute("data-value");
1873
+ if (dataValue !== null) {
1874
+ onFocus(id, (0, import_utils13.enumOptionsValueForIndex)(dataValue, enumOptions, optEmptyVal));
1875
+ }
1876
+ },
1877
+ [onFocus, id, enumOptions, optEmptyVal]
1878
+ );
1879
+ const selectedIndexes = (0, import_utils13.enumOptionsIndexForValue)(value, enumOptions, multiple);
1880
+ const selectedValues = Array.isArray(selectedIndexes) ? selectedIndexes : [selectedIndexes];
1881
+ const optionsList = enumOptions || (Array.isArray(schema.examples) ? schema.examples.map((example) => ({ value: example, label: example })) : []);
1882
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "form-control w-full", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "dropdown w-full", children: [
1883
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
1884
+ "div",
1885
+ {
1886
+ tabIndex: 0,
1887
+ role: "button",
1888
+ className: `btn btn-outline w-full text-left flex justify-between items-center ${disabled || readonly ? "btn-disabled" : ""}`,
1889
+ onBlur: _onBlur,
1890
+ onFocus: _onFocus,
1891
+ children: [
1892
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "truncate", children: selectedValues.length > 0 ? selectedValues.map((index) => optionsList[Number(index)]?.label).join(", ") : placeholder || label || "Select..." }),
1893
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "ml-2", children: "\u25BC" })
1894
+ ]
1895
+ }
1896
+ ),
1897
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("ul", { className: "dropdown-content z-[1] bg-base-100 w-full max-h-60 overflow-auto rounded-box shadow-lg", children: optionsList.map(({ label: label2 }, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1898
+ "li",
1899
+ {
1900
+ role: "button",
1901
+ tabIndex: 0,
1902
+ className: `px-4 py-2 hover:bg-base-200 cursor-pointer ${selectedValues.includes(String(i)) ? "bg-primary/10" : ""}`,
1903
+ onClick: handleOptionClick,
1904
+ "data-value": i,
1905
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2", children: [
1906
+ multiple && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1907
+ "input",
1908
+ {
1909
+ type: "checkbox",
1910
+ className: "checkbox checkbox-sm",
1911
+ checked: selectedValues.includes(String(i)),
1912
+ readOnly: true
1913
+ }
1914
+ ),
1915
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: isEnumeratedObject ? label2 : getDisplayValue(label2) })
1916
+ ] })
1917
+ },
1918
+ i
1919
+ )) })
1920
+ ] }) });
1921
+ }
1922
+
1923
+ // src/widgets/TextareaWidget/TextareaWidget.tsx
1924
+ var import_react16 = require("react");
1925
+ var import_jsx_runtime29 = require("react/jsx-runtime");
1926
+ function TextareaWidget(props) {
1927
+ const { id, value, required, disabled, readonly, onChange, onFocus, onBlur, options } = props;
1928
+ const handleFocus = (0, import_react16.useCallback)(
1929
+ (event) => {
1930
+ if (onFocus) {
1931
+ onFocus(id, event.target.value);
1932
+ }
1933
+ },
1934
+ [onFocus, id]
1935
+ );
1936
+ const handleBlur = (0, import_react16.useCallback)(
1937
+ (event) => {
1938
+ if (onBlur) {
1939
+ onBlur(id, event.target.value);
1940
+ }
1941
+ },
1942
+ [onBlur, id]
1943
+ );
1944
+ const handleChange = (0, import_react16.useCallback)(
1945
+ (event) => {
1946
+ onChange(event.target.value);
1947
+ },
1948
+ [onChange]
1949
+ );
1950
+ const rows = options?.rows || 5;
1951
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "form-control", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1952
+ "textarea",
1953
+ {
1954
+ id,
1955
+ value: value || "",
1956
+ required,
1957
+ disabled: disabled || readonly,
1958
+ readOnly: readonly,
1959
+ rows,
1960
+ onChange: handleChange,
1961
+ onFocus: handleFocus,
1962
+ onBlur: handleBlur,
1963
+ className: "textarea textarea-bordered w-full"
1964
+ }
1965
+ ) });
1966
+ }
1967
+
1968
+ // src/widgets/TimeWidget/TimeWidget.tsx
1969
+ var import_react17 = require("react");
1970
+ var import_jsx_runtime30 = require("react/jsx-runtime");
1971
+ function TimeWidget(props) {
1972
+ const { id, value, onChange, onFocus, onBlur, required, disabled, readonly } = props;
1973
+ const handleFocus = (0, import_react17.useCallback)(
1974
+ (event) => {
1975
+ if (onFocus) {
1976
+ onFocus(id, event.target.value);
1977
+ }
1978
+ },
1979
+ [onFocus, id]
1980
+ );
1981
+ const handleBlur = (0, import_react17.useCallback)(
1982
+ (event) => {
1983
+ if (onBlur) {
1984
+ onBlur(id, event.target.value);
1985
+ }
1986
+ },
1987
+ [onBlur, id]
1988
+ );
1989
+ const handleChange = (0, import_react17.useCallback)(
1990
+ (event) => {
1991
+ onChange(event.target.value);
1992
+ },
1993
+ [onChange]
1994
+ );
1995
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "form-control", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1996
+ "input",
1997
+ {
1998
+ type: "time",
1999
+ id,
2000
+ className: "input input-bordered w-full",
2001
+ value: value || "",
2002
+ required,
2003
+ disabled: disabled || readonly,
2004
+ readOnly: readonly,
2005
+ onChange: handleChange,
2006
+ onFocus: handleFocus,
2007
+ onBlur: handleBlur
2008
+ }
2009
+ ) });
2010
+ }
2011
+
2012
+ // src/widgets/ToggleWidget/ToggleWidget.tsx
2013
+ var import_react18 = require("react");
2014
+ var import_jsx_runtime31 = require("react/jsx-runtime");
2015
+ function ToggleWidget({ id, value, required, disabled, readonly, autofocus, onChange, onFocus, onBlur, options }) {
2016
+ const _onChange = (0, import_react18.useCallback)(
2017
+ ({ target: { checked } }) => onChange(checked),
2018
+ [onChange]
2019
+ );
2020
+ const handleFocus = (0, import_react18.useCallback)(() => {
2021
+ if (onFocus) {
2022
+ onFocus(id, value);
2023
+ }
2024
+ }, [onFocus, id, value]);
2025
+ const handleBlur = (0, import_react18.useCallback)(() => {
2026
+ if (onBlur) {
2027
+ onBlur(id, value);
2028
+ }
2029
+ }, [onBlur, id, value]);
2030
+ const { size = "md" } = options;
2031
+ const sizeClass = size !== "md" ? `toggle-${size}` : "";
2032
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "form-control", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "cursor-pointer label my-auto", children: [
2033
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2034
+ "input",
2035
+ {
2036
+ type: "checkbox",
2037
+ id,
2038
+ checked: value,
2039
+ required,
2040
+ disabled: disabled || readonly,
2041
+ autoFocus: autofocus,
2042
+ onChange: _onChange,
2043
+ onFocus: handleFocus,
2044
+ onBlur: handleBlur,
2045
+ className: `toggle ${sizeClass}`
2046
+ }
2047
+ ),
2048
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "label-text", children: options.label })
2049
+ ] }) });
2050
+ }
2051
+
2052
+ // src/widgets/Widgets.tsx
2053
+ function generateWidgets() {
2054
+ return {
2055
+ AltDateTimeWidget: AltDateTimeWidget_default,
2056
+ AltDateWidget,
2057
+ CheckboxesWidget,
2058
+ CheckboxWidget,
2059
+ DateTimeWidget,
2060
+ DateWidget,
2061
+ FileWidget,
2062
+ RadioWidget,
2063
+ RangeWidget,
2064
+ RatingWidget,
2065
+ SelectWidget,
2066
+ TextareaWidget,
2067
+ TimeWidget,
2068
+ toggle: ToggleWidget
2069
+ };
2070
+ }
2071
+ var Widgets_default = generateWidgets;
2072
+
2073
+ // src/theme/Theme.tsx
2074
+ var import_jsx_runtime32 = require("react/jsx-runtime");
2075
+ function generateTheme() {
2076
+ const { fields } = (0, import_core2.getDefaultRegistry)();
2077
+ const generatedWidgets = generateWidgets();
2078
+ const templates = generateTemplates();
2079
+ return {
2080
+ templates,
2081
+ widgets: {
2082
+ ...generatedWidgets,
2083
+ boolean: generatedWidgets.toggle
2084
+ },
2085
+ fields
2086
+ };
2087
+ }
2088
+ var Theme = generateTheme();
2089
+ var Theme_default = Theme;
2090
+ var ThemeContext = (0, import_react19.createContext)({
2091
+ theme: "night",
2092
+ setTheme: () => {
2093
+ }
2094
+ });
2095
+ function ThemeProvider({ children }) {
2096
+ const [theme, setTheme] = (0, import_react19.useState)(() => {
2097
+ try {
2098
+ return localStorage.getItem("daisyui-theme") || "cupcake";
2099
+ } catch {
2100
+ return "cupcake";
2101
+ }
2102
+ });
2103
+ const handleSetTheme = (0, import_react19.useCallback)((newTheme) => {
2104
+ try {
2105
+ localStorage.setItem("daisyui-theme", newTheme);
2106
+ setTheme(newTheme);
2107
+ } catch {
2108
+ }
2109
+ }, []);
2110
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ThemeContext.Provider, { value: { theme, setTheme: handleSetTheme }, children });
2111
+ }
2112
+ var useTheme = () => (0, import_react19.useContext)(ThemeContext);
2113
+
2114
+ // src/DaisyUIForm.tsx
2115
+ var import_core3 = require("@rjsf/core");
2116
+ var DaisyUIForm = (0, import_core3.withTheme)(Theme_default);
2117
+ var DaisyUIForm_default = DaisyUIForm;
2118
+
2119
+ // src/DaisyUIFrameProvider.tsx
2120
+ var import_react20 = require("react");
2121
+ var import_jsx_runtime33 = require("react/jsx-runtime");
2122
+ function DaisyUIFrameComponent(props) {
2123
+ const { children, subtheme = {}, document: document2 } = props;
2124
+ const theme = (() => {
2125
+ try {
2126
+ if (subtheme?.dataTheme) {
2127
+ localStorage.setItem("daisyui-theme", subtheme.dataTheme);
2128
+ return subtheme.dataTheme;
2129
+ }
2130
+ return localStorage.getItem("daisyui-theme") || "cupcake";
2131
+ } catch {
2132
+ return "cupcake";
2133
+ }
2134
+ })();
2135
+ (0, import_react20.useEffect)(() => {
2136
+ if (document2) {
2137
+ const configScript = document2.createElement("script");
2138
+ configScript.textContent = `
2139
+ window.tailwind = window.tailwind || {};
2140
+ window.tailwind.config = {
2141
+ daisyui: {
2142
+ themes: true,
2143
+ },
2144
+ future: {
2145
+ disableProductionWarning: true
2146
+ }
2147
+ }
2148
+ `;
2149
+ document2.head.appendChild(configScript);
2150
+ const tailwindScript = document2.createElement("script");
2151
+ tailwindScript.src = "https://unpkg.com/@tailwindcss/browser@4.1.3";
2152
+ document2.head.appendChild(tailwindScript);
2153
+ const daisyLink = document2.createElement("link");
2154
+ daisyLink.rel = "stylesheet";
2155
+ daisyLink.href = "https://cdn.jsdelivr.net/npm/daisyui@5.0.20";
2156
+ document2.head.appendChild(daisyLink);
2157
+ const daisyLinkAllThemes = document2.createElement("link");
2158
+ daisyLinkAllThemes.rel = "stylesheet";
2159
+ daisyLinkAllThemes.href = "https://cdn.jsdelivr.net/npm/daisyui@5.0.20/themes.css";
2160
+ document2.head.appendChild(daisyLinkAllThemes);
2161
+ return () => {
2162
+ configScript.remove();
2163
+ tailwindScript.remove();
2164
+ daisyLink.remove();
2165
+ daisyLinkAllThemes.remove();
2166
+ };
2167
+ }
2168
+ return void 0;
2169
+ }, [document2]);
2170
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { "data-theme": theme, className: "daisy-ui-theme", children });
2171
+ }
2172
+ var __createDaisyUIFrameProvider = (props) => {
2173
+ return function DaisyUIFrame({ document: document2 }) {
2174
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DaisyUIFrameComponent, { document: document2, ...props });
2175
+ };
2176
+ };
2177
+
2178
+ // src/index.ts
2179
+ var index_default = (0, import_core4.withTheme)(Theme_default);
2180
+ //# sourceMappingURL=index.js.map