@mittwald/flow-react-components 0.2.0-alpha.786 → 0.2.0-alpha.788

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 (216) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/assets/doc-properties.json +3714 -3193
  3. package/dist/js/_virtual/_.locale.json@16189d7d260d7331b0e0a1936d5c7c52.mjs +11 -7
  4. package/dist/js/_virtual/_.locale.json@16189d7d260d7331b0e0a1936d5c7c52.mjs.map +1 -1
  5. package/dist/js/_virtual/_.locale.json@162914df08c90e5e10d2f78b03d9d768.mjs +7 -3
  6. package/dist/js/_virtual/_.locale.json@162914df08c90e5e10d2f78b03d9d768.mjs.map +1 -1
  7. package/dist/js/_virtual/_.locale.json@24b745a6ce9353be513d1f98e927d8d3.mjs +15 -11
  8. package/dist/js/_virtual/_.locale.json@24b745a6ce9353be513d1f98e927d8d3.mjs.map +1 -1
  9. package/dist/js/_virtual/_.locale.json@24d7079ce80a619bbdda6dfcc8289f94.mjs +7 -3
  10. package/dist/js/_virtual/_.locale.json@24d7079ce80a619bbdda6dfcc8289f94.mjs.map +1 -1
  11. package/dist/js/_virtual/_.locale.json@3b9d9e153ad753f427f375d1275fbcad.mjs +7 -3
  12. package/dist/js/_virtual/_.locale.json@3b9d9e153ad753f427f375d1275fbcad.mjs.map +1 -1
  13. package/dist/js/_virtual/_.locale.json@3ed2dc50f997451bdd85a713c54e1025.mjs +9 -5
  14. package/dist/js/_virtual/_.locale.json@3ed2dc50f997451bdd85a713c54e1025.mjs.map +1 -1
  15. package/dist/js/_virtual/_.locale.json@4119db69ca94e24d796b8e08482bc927.mjs +13 -9
  16. package/dist/js/_virtual/_.locale.json@4119db69ca94e24d796b8e08482bc927.mjs.map +1 -1
  17. package/dist/js/_virtual/_.locale.json@48bdcfec6dd32df5dc9f6fa222d33240.mjs +7 -3
  18. package/dist/js/_virtual/_.locale.json@48bdcfec6dd32df5dc9f6fa222d33240.mjs.map +1 -1
  19. package/dist/js/_virtual/_.locale.json@51592c7dce2c58889664b6822f25f6d1.mjs +7 -3
  20. package/dist/js/_virtual/_.locale.json@51592c7dce2c58889664b6822f25f6d1.mjs.map +1 -1
  21. package/dist/js/_virtual/_.locale.json@51dcf4944c990e2cbe26472300dae78d.mjs +7 -3
  22. package/dist/js/_virtual/_.locale.json@51dcf4944c990e2cbe26472300dae78d.mjs.map +1 -1
  23. package/dist/js/_virtual/_.locale.json@656bcfe2b7d48c4324cbdf14a4866b19.mjs +17 -13
  24. package/dist/js/_virtual/_.locale.json@656bcfe2b7d48c4324cbdf14a4866b19.mjs.map +1 -1
  25. package/dist/js/_virtual/_.locale.json@6922640321d6c379322b09cbcf0dcdb3.mjs +7 -3
  26. package/dist/js/_virtual/_.locale.json@6922640321d6c379322b09cbcf0dcdb3.mjs.map +1 -1
  27. package/dist/js/_virtual/_.locale.json@72ba2ce40f190df671686fec50c04ddf.mjs +17 -13
  28. package/dist/js/_virtual/_.locale.json@72ba2ce40f190df671686fec50c04ddf.mjs.map +1 -1
  29. package/dist/js/_virtual/_.locale.json@774f50b2495c87d6d13911bcd596e720.mjs +7 -3
  30. package/dist/js/_virtual/_.locale.json@774f50b2495c87d6d13911bcd596e720.mjs.map +1 -1
  31. package/dist/js/_virtual/_.locale.json@849e6f494125ee27df10a461562fa893.mjs +7 -3
  32. package/dist/js/_virtual/_.locale.json@849e6f494125ee27df10a461562fa893.mjs.map +1 -1
  33. package/dist/js/_virtual/_.locale.json@8b26c19d587a90f821a2307c8122f6d1.mjs +13 -9
  34. package/dist/js/_virtual/_.locale.json@8b26c19d587a90f821a2307c8122f6d1.mjs.map +1 -1
  35. package/dist/js/_virtual/_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs +53 -49
  36. package/dist/js/_virtual/_.locale.json@8d5024994f97657f895a4e2a188d2d8a.mjs.map +1 -1
  37. package/dist/js/_virtual/_.locale.json@95341064edeb0e38b66d786dbd62955c.mjs +81 -77
  38. package/dist/js/_virtual/_.locale.json@95341064edeb0e38b66d786dbd62955c.mjs.map +1 -1
  39. package/dist/js/_virtual/_.locale.json@bb0db7b5021f874310cbe5b6cc3d9cac.mjs +25 -21
  40. package/dist/js/_virtual/_.locale.json@bb0db7b5021f874310cbe5b6cc3d9cac.mjs.map +1 -1
  41. package/dist/js/_virtual/_.locale.json@bcca9730cf4e50042f33f85088c4be64.mjs +509 -503
  42. package/dist/js/_virtual/_.locale.json@bcca9730cf4e50042f33f85088c4be64.mjs.map +1 -1
  43. package/dist/js/_virtual/_.locale.json@c33938a00f4bfb40e033ada6b54e38f9.mjs +7 -3
  44. package/dist/js/_virtual/_.locale.json@c33938a00f4bfb40e033ada6b54e38f9.mjs.map +1 -1
  45. package/dist/js/_virtual/_.locale.json@d7a4ca29c343fa700bb5aa84d322958b.mjs +9 -5
  46. package/dist/js/_virtual/_.locale.json@d7a4ca29c343fa700bb5aa84d322958b.mjs.map +1 -1
  47. package/dist/js/_virtual/_.locale.json@df0c8534e2e4f7c6c3d4365218df7347.mjs +7 -3
  48. package/dist/js/_virtual/_.locale.json@df0c8534e2e4f7c6c3d4365218df7347.mjs.map +1 -1
  49. package/dist/js/_virtual/_.locale.json@df7be47291f95407e99e7159090958cc.mjs +9 -5
  50. package/dist/js/_virtual/_.locale.json@df7be47291f95407e99e7159090958cc.mjs.map +1 -1
  51. package/dist/js/_virtual/_.locale.json@e940efc6da10fdf09417eb079b65a343.mjs +7 -3
  52. package/dist/js/_virtual/_.locale.json@e940efc6da10fdf09417eb079b65a343.mjs.map +1 -1
  53. package/dist/js/default.mjs +1 -1
  54. package/dist/js/flr-universal.mjs +7 -4
  55. package/dist/js/flr-universal.mjs.map +1 -1
  56. package/dist/js/packages/components/src/components/Action/lib/ariaLive.mjs +3 -3
  57. package/dist/js/packages/components/src/components/Action/lib/ariaLive.mjs.map +1 -1
  58. package/dist/js/packages/components/src/components/Action/models/getExecutionFunction.mjs +5 -1
  59. package/dist/js/packages/components/src/components/Action/models/getExecutionFunction.mjs.map +1 -1
  60. package/dist/js/packages/components/src/components/AlertIcon/AlertIcon.mjs +3 -3
  61. package/dist/js/packages/components/src/components/AlertIcon/AlertIcon.mjs.map +1 -1
  62. package/dist/js/packages/components/src/components/Badge/Badge.mjs +3 -3
  63. package/dist/js/packages/components/src/components/Badge/Badge.mjs.map +1 -1
  64. package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs +3 -3
  65. package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
  66. package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs +5 -2
  67. package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs.map +1 -1
  68. package/dist/js/packages/components/src/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.mjs +4 -1
  69. package/dist/js/packages/components/src/components/ContextMenu/components/ContextMenuSection/ContextMenuSection.mjs.map +1 -1
  70. package/dist/js/packages/components/src/components/ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.mjs +6 -5
  71. package/dist/js/packages/components/src/components/ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.mjs.map +1 -1
  72. package/dist/js/packages/components/src/components/CopyButton/CopyButton.mjs +3 -3
  73. package/dist/js/packages/components/src/components/CopyButton/CopyButton.mjs.map +1 -1
  74. package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs +21 -13
  75. package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs.map +1 -1
  76. package/dist/js/packages/components/src/components/FileCard/components/DeleteButton/DeleteButton.mjs +3 -3
  77. package/dist/js/packages/components/src/components/FileCard/components/DeleteButton/DeleteButton.mjs.map +1 -1
  78. package/dist/js/packages/components/src/components/ImageCropper/ImageCropper.mjs +2 -2
  79. package/dist/js/packages/components/src/components/ImageCropper/ImageCropper.mjs.map +1 -1
  80. package/dist/js/packages/components/src/components/Kbd/Kbd.mjs +4 -4
  81. package/dist/js/packages/components/src/components/Kbd/Kbd.mjs.map +1 -1
  82. package/dist/js/packages/components/src/components/Label/Label.mjs +3 -3
  83. package/dist/js/packages/components/src/components/Label/Label.mjs.map +1 -1
  84. package/dist/js/packages/components/src/components/Link/components/LinkIcon/LinkIcon.mjs +4 -4
  85. package/dist/js/packages/components/src/components/Link/components/LinkIcon/LinkIcon.mjs.map +1 -1
  86. package/dist/js/packages/components/src/components/List/components/Footer/components/PaginationInfos/PaginationInfos.mjs +3 -3
  87. package/dist/js/packages/components/src/components/List/components/Footer/components/PaginationInfos/PaginationInfos.mjs.map +1 -1
  88. package/dist/js/packages/components/src/components/List/components/Footer/components/ShowNextBatchButton/ShowNextBatchButton.mjs +3 -3
  89. package/dist/js/packages/components/src/components/List/components/Footer/components/ShowNextBatchButton/ShowNextBatchButton.mjs.map +1 -1
  90. package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs +7 -8
  91. package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs.map +1 -1
  92. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs +7 -7
  93. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs.map +1 -1
  94. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs +3 -3
  95. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs.map +1 -1
  96. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup.mjs +3 -3
  97. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup.mjs.map +1 -1
  98. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/SortingAccordion.mjs +3 -3
  99. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/SortingAccordion.mjs.map +1 -1
  100. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion.mjs +4 -4
  101. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion.mjs.map +1 -1
  102. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs +3 -3
  103. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs.map +1 -1
  104. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.mjs +4 -1
  105. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.mjs.map +1 -1
  106. package/dist/js/packages/components/src/components/List/components/Header/components/SortingContextMenu/SortingContextMenu.mjs +4 -2
  107. package/dist/js/packages/components/src/components/List/components/Header/components/SortingContextMenu/SortingContextMenu.mjs.map +1 -1
  108. package/dist/js/packages/components/src/components/List/components/Header/components/SortingContextMenu/SortingMenuItem.mjs +4 -1
  109. package/dist/js/packages/components/src/components/List/components/Header/components/SortingContextMenu/SortingMenuItem.mjs.map +1 -1
  110. package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeContextMenu.mjs +4 -4
  111. package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeContextMenu.mjs.map +1 -1
  112. package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeMenuItem.mjs +3 -3
  113. package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeMenuItem.mjs.map +1 -1
  114. package/dist/js/packages/components/src/components/List/components/Header/lib.mjs +4 -1
  115. package/dist/js/packages/components/src/components/List/components/Header/lib.mjs.map +1 -1
  116. package/dist/js/packages/components/src/components/List/components/Items/Items.mjs +4 -1
  117. package/dist/js/packages/components/src/components/List/components/Items/Items.mjs.map +1 -1
  118. package/dist/js/packages/components/src/components/List/components/Items/components/Item/components/AccordionButton.mjs +3 -3
  119. package/dist/js/packages/components/src/components/List/components/Items/components/Item/components/AccordionButton.mjs.map +1 -1
  120. package/dist/js/packages/components/src/components/List/components/Items/components/Item/components/OptionsButton/OptionsButton.mjs +3 -3
  121. package/dist/js/packages/components/src/components/List/components/Items/components/Item/components/OptionsButton/OptionsButton.mjs.map +1 -1
  122. package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs +4 -1
  123. package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs.map +1 -1
  124. package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.mjs +4 -1
  125. package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.mjs.map +1 -1
  126. package/dist/js/packages/components/src/components/List/components/Table/Table.mjs +4 -1
  127. package/dist/js/packages/components/src/components/List/components/Table/Table.mjs.map +1 -1
  128. package/dist/js/packages/components/src/components/List/hooks/useAriaAnnounceSearchState.mjs +3 -3
  129. package/dist/js/packages/components/src/components/List/hooks/useAriaAnnounceSearchState.mjs.map +1 -1
  130. package/dist/js/packages/components/src/components/List/views/EmptyView/EmptyView.mjs +4 -4
  131. package/dist/js/packages/components/src/components/List/views/EmptyView/EmptyView.mjs.map +1 -1
  132. package/dist/js/packages/components/src/components/MarkdownEditor/components/ModeButton.mjs +5 -2
  133. package/dist/js/packages/components/src/components/MarkdownEditor/components/ModeButton.mjs.map +1 -1
  134. package/dist/js/packages/components/src/components/MarkdownEditor/components/ToolbarButton.mjs +5 -2
  135. package/dist/js/packages/components/src/components/MarkdownEditor/components/ToolbarButton.mjs.map +1 -1
  136. package/dist/js/packages/components/src/components/Modal/Modal.mjs +4 -1
  137. package/dist/js/packages/components/src/components/Modal/Modal.mjs.map +1 -1
  138. package/dist/js/packages/components/src/components/Modal/components/ConfirmUnsavedChangesModal/ConfirmUnsavedChangesModal.mjs +2 -2
  139. package/dist/js/packages/components/src/components/Modal/components/ConfirmUnsavedChangesModal/ConfirmUnsavedChangesModal.mjs.map +1 -1
  140. package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +5 -3
  141. package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
  142. package/dist/js/packages/components/src/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.mjs +5 -2
  143. package/dist/js/packages/components/src/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.mjs.map +1 -1
  144. package/dist/js/packages/components/src/components/PasswordCreationField/components/TogglePasswordVisibilityButton/TogglePasswordVisibilityButton.mjs +5 -2
  145. package/dist/js/packages/components/src/components/PasswordCreationField/components/TogglePasswordVisibilityButton/TogglePasswordVisibilityButton.mjs.map +1 -1
  146. package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.mjs +5 -2
  147. package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.mjs.map +1 -1
  148. package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.mjs +5 -2
  149. package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.mjs.map +1 -1
  150. package/dist/js/packages/components/src/components/Rating/components/RatingSegment/RatingSegment.mjs +3 -3
  151. package/dist/js/packages/components/src/components/Rating/components/RatingSegment/RatingSegment.mjs.map +1 -1
  152. package/dist/js/packages/components/src/components/SearchField/SearchField.mjs +3 -3
  153. package/dist/js/packages/components/src/components/SearchField/SearchField.mjs.map +1 -1
  154. package/dist/js/packages/components/src/components/Slider/Slider.mjs +4 -4
  155. package/dist/js/packages/components/src/components/Slider/Slider.mjs.map +1 -1
  156. package/dist/js/packages/components/src/components/TextArea/TextArea.mjs +3 -3
  157. package/dist/js/packages/components/src/components/TextArea/TextArea.mjs.map +1 -1
  158. package/dist/js/packages/components/src/components/TextField/TextField.mjs +8 -10
  159. package/dist/js/packages/components/src/components/TextField/TextField.mjs.map +1 -1
  160. package/dist/js/packages/components/src/components/TranslationProvider/TranslationProvider.mjs +9 -5
  161. package/dist/js/packages/components/src/components/TranslationProvider/TranslationProvider.mjs.map +1 -1
  162. package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedStringFormatter.mjs +54 -0
  163. package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedStringFormatter.mjs.map +1 -0
  164. package/dist/js/packages/components/src/components/propTypes/index.mjs +2 -1
  165. package/dist/js/packages/components/src/components/propTypes/index.mjs.map +1 -1
  166. package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs +11 -8
  167. package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs.map +1 -1
  168. package/dist/js/packages/components/src/integrations/react-hook-form/components/FormAction/FormResetAction.mjs +5 -1
  169. package/dist/js/packages/components/src/integrations/react-hook-form/components/FormAction/FormResetAction.mjs.map +1 -1
  170. package/dist/js/packages/components/src/integrations/react-hook-form/components/FormAction/FormSubmitAction.mjs +5 -1
  171. package/dist/js/packages/components/src/integrations/react-hook-form/components/FormAction/FormSubmitAction.mjs.map +1 -1
  172. package/dist/js/packages/components/src/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.mjs +5 -1
  173. package/dist/js/packages/components/src/integrations/react-hook-form/components/FormContextProvider/useFormSubmitAction.mjs.map +1 -1
  174. package/dist/types/components/ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.d.ts.map +1 -1
  175. package/dist/types/components/CountryOptions/CountryOptions.d.ts +4 -3
  176. package/dist/types/components/CountryOptions/CountryOptions.d.ts.map +1 -1
  177. package/dist/types/components/List/components/Header/components/ActiveFilters/ActiveFilters.d.ts.map +1 -1
  178. package/dist/types/components/List/components/Header/components/AllFiltersModal/ViewModeAccordion.d.ts.map +1 -1
  179. package/dist/types/components/List/components/Header/components/SortingContextMenu/SortingContextMenu.d.ts.map +1 -1
  180. package/dist/types/components/List/hooks/useAriaAnnounceSearchState.d.ts.map +1 -1
  181. package/dist/types/components/MarkdownEditor/components/ModeButton.d.ts.map +1 -1
  182. package/dist/types/components/MarkdownEditor/components/ToolbarButton.d.ts.map +1 -1
  183. package/dist/types/components/PasswordCreationField/PasswordCreationField.d.ts.map +1 -1
  184. package/dist/types/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.d.ts.map +1 -1
  185. package/dist/types/components/PasswordCreationField/components/TogglePasswordVisibilityButton/TogglePasswordVisibilityButton.d.ts.map +1 -1
  186. package/dist/types/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.d.ts.map +1 -1
  187. package/dist/types/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.d.ts.map +1 -1
  188. package/dist/types/components/TextField/TextField.d.ts.map +1 -1
  189. package/dist/types/components/TranslationProvider/TranslationProvider.d.ts +17 -8
  190. package/dist/types/components/TranslationProvider/TranslationProvider.d.ts.map +1 -1
  191. package/dist/types/components/TranslationProvider/index.d.ts +3 -3
  192. package/dist/types/components/TranslationProvider/index.d.ts.map +1 -1
  193. package/dist/types/components/TranslationProvider/stories/Default.stories.d.ts +2 -2
  194. package/dist/types/components/TranslationProvider/stories/Default.stories.d.ts.map +1 -1
  195. package/dist/types/components/TranslationProvider/useLocalizedStringFormatter.d.ts +12 -0
  196. package/dist/types/components/TranslationProvider/useLocalizedStringFormatter.d.ts.map +1 -0
  197. package/dist/types/components/TranslationProvider/view.d.ts +8 -0
  198. package/dist/types/components/TranslationProvider/view.d.ts.map +1 -0
  199. package/dist/types/components/propTypes/index.d.ts +2 -0
  200. package/dist/types/components/propTypes/index.d.ts.map +1 -1
  201. package/dist/types/index/flr-universal.d.ts +1 -1
  202. package/dist/types/index/flr-universal.d.ts.map +1 -1
  203. package/dist/types/integrations/react-hook-form/components/Field/Field.d.ts.map +1 -1
  204. package/dist/types/views/TranslationProviderView.d.ts +5 -0
  205. package/dist/types/views/TranslationProviderView.d.ts.map +1 -0
  206. package/package.json +10 -7
  207. package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedContextStringFormatter.mjs +0 -16
  208. package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedContextStringFormatter.mjs.map +0 -1
  209. package/dist/js/packages/components/src/lib/react/components/Translate/Translate.mjs +0 -12
  210. package/dist/js/packages/components/src/lib/react/components/Translate/Translate.mjs.map +0 -1
  211. package/dist/types/components/TranslationProvider/useLocalizedContextStringFormatter.d.ts +0 -7
  212. package/dist/types/components/TranslationProvider/useLocalizedContextStringFormatter.d.ts.map +0 -1
  213. package/dist/types/lib/react/components/Translate/Translate.d.ts +0 -10
  214. package/dist/types/lib/react/components/Translate/Translate.d.ts.map +0 -1
  215. package/dist/types/lib/react/components/Translate/index.d.ts +0 -3
  216. package/dist/types/lib/react/components/Translate/index.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"RatingSegment.mjs","sources":["../../../../../../../../../src/components/Rating/components/RatingSegment/RatingSegment.tsx"],"sourcesContent":["import React, { type FC } from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"@/components/Rating/Rating.module.scss\";\nimport * as Aria from \"react-aria-components\";\nimport type { RatingProps } from \"@/components/Rating\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"../../locales/*.locale.json\";\nimport { RatingStar } from \"@/components/Rating/components/RatingSegment/RatingStar\";\nimport { RatingStarFilled } from \"@/components/Rating/components/RatingSegment/RatingStarFilled\";\n\ninterface Props {\n index: number;\n selectedValue: number;\n size: RatingProps[\"size\"];\n}\nexport const RatingSegment: FC<Props> = (props) => {\n const { index, selectedValue, size } = props;\n\n const value = index + 1;\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n return (\n <Aria.Radio\n aria-label={stringFormatter.format(`rating.${value}`)}\n value={value.toString()}\n className={clsx(\n styles.ratingSegment,\n value === selectedValue && styles.current,\n )}\n >\n <RatingStarFilled size={size} />\n <RatingStar size={size} />\n </Aria.Radio>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAeO,MAAM,aAAA,GAA2B,CAAC,KAAA,KAAU;AACjD,EAAA,MAAM,EAAE,KAAA,EAAO,aAAA,EAAe,IAAA,EAAK,GAAI,KAAA;AAEvC,EAAA,MAAM,QAAQ,KAAA,GAAQ,CAAA;AAEtB,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA,CAAK,KAAA;AAAA,IAAL;AAAA,MACC,YAAA,EAAY,eAAA,CAAgB,MAAA,CAAO,CAAA,OAAA,EAAU,KAAK,CAAA,CAAE,CAAA;AAAA,MACpD,KAAA,EAAO,MAAM,QAAA,EAAS;AAAA,MACtB,SAAA,EAAW,IAAA;AAAA,QACT,MAAA,CAAO,aAAA;AAAA,QACP,KAAA,KAAU,iBAAiB,MAAA,CAAO;AAAA,OACpC;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,oBAAiB,IAAA,EAAY,CAAA;AAAA,wBAC9B,GAAA,CAAC,cAAW,IAAA,EAAY;AAAA;AAAA;AAAA,GAC1B;AAEJ;;;;"}
1
+ {"version":3,"file":"RatingSegment.mjs","sources":["../../../../../../../../../src/components/Rating/components/RatingSegment/RatingSegment.tsx"],"sourcesContent":["import React, { type FC } from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"@/components/Rating/Rating.module.scss\";\nimport * as Aria from \"react-aria-components\";\nimport type { RatingProps } from \"@/components/Rating\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"../../locales/*.locale.json\";\nimport { RatingStar } from \"@/components/Rating/components/RatingSegment/RatingStar\";\nimport { RatingStarFilled } from \"@/components/Rating/components/RatingSegment/RatingStarFilled\";\n\ninterface Props {\n index: number;\n selectedValue: number;\n size: RatingProps[\"size\"];\n}\nexport const RatingSegment: FC<Props> = (props) => {\n const { index, selectedValue, size } = props;\n\n const value = index + 1;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"Rating\");\n\n return (\n <Aria.Radio\n aria-label={stringFormatter.format(`segment.${value}`)}\n value={value.toString()}\n className={clsx(\n styles.ratingSegment,\n value === selectedValue && styles.current,\n )}\n >\n <RatingStarFilled size={size} />\n <RatingStar size={size} />\n </Aria.Radio>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAeO,MAAM,aAAA,GAA2B,CAAC,KAAA,KAAU;AACjD,EAAA,MAAM,EAAE,KAAA,EAAO,aAAA,EAAe,IAAA,EAAK,GAAI,KAAA;AAEvC,EAAA,MAAM,QAAQ,KAAA,GAAQ,CAAA;AAEtB,EAAA,MAAM,eAAA,GAAkB,2BAAA,CAA4B,OAAA,EAAS,QAAQ,CAAA;AAErE,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA,CAAK,KAAA;AAAA,IAAL;AAAA,MACC,YAAA,EAAY,eAAA,CAAgB,MAAA,CAAO,CAAA,QAAA,EAAW,KAAK,CAAA,CAAE,CAAA;AAAA,MACrD,KAAA,EAAO,MAAM,QAAA,EAAS;AAAA,MACtB,SAAA,EAAW,IAAA;AAAA,QACT,MAAA,CAAO,aAAA;AAAA,QACP,KAAA,KAAU,iBAAiB,MAAA,CAAO;AAAA,OACpC;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,oBAAiB,IAAA,EAAY,CAAA;AAAA,wBAC9B,GAAA,CAAC,cAAW,IAAA,EAAY;AAAA;AAAA;AAAA,GAC1B;AAEJ;;;;"}
@@ -17,7 +17,7 @@ import '../../views/IconView.mjs';
17
17
  import { IconClose } from '../Icon/components/icons/IconClose.mjs';
18
18
  import { IconSearch } from '../Icon/components/icons/IconSearch.mjs';
19
19
  import locales from '../../../../../_virtual/_.locale.json@e940efc6da10fdf09417eb079b65a343.mjs';
20
- import { useLocalizedStringFormatter } from 'react-aria';
20
+ import { useLocalizedStringFormatter } from '../TranslationProvider/useLocalizedStringFormatter.mjs';
21
21
  import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
22
22
  import { useControlledHostValueProps } from '../../lib/remote/useControlledHostValueProps.mjs';
23
23
  import { TunnelProvider, TunnelExit } from '@mittwald/react-tunnel';
@@ -35,8 +35,8 @@ const SearchField = flowComponent("SearchField", (props) => {
35
35
  styles.searchField,
36
36
  className
37
37
  );
38
- const stringFormatter = useLocalizedStringFormatter(locales);
39
- const searchText = stringFormatter.format(`searchField.search`);
38
+ const stringFormatter = useLocalizedStringFormatter(locales, "SearchField");
39
+ const searchText = stringFormatter.format(`search`);
40
40
  const propsContext = {
41
41
  Kbd: {
42
42
  isDisabled: props.isDisabled,
@@ -1 +1 @@
1
- {"version":3,"file":"SearchField.mjs","sources":["../../../../../../../src/components/SearchField/SearchField.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport formFieldStyles from \"../FormField/FormField.module.scss\";\nimport styles from \"./SearchField.module.scss\";\nimport clsx from \"clsx\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { Button } from \"@/components/Button\";\nimport { IconClose, IconSearch } from \"@/components/Icon/components/icons\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\n\nexport interface SearchFieldProps\n extends\n PropsWithChildren<Omit<Aria.SearchFieldProps, \"children\">>,\n FlowComponentProps<HTMLInputElement> {}\n\n/** @flr-generate all */\nexport const SearchField = flowComponent(\"SearchField\", (props) => {\n const { children, className, ref, ...rest } =\n useControlledHostValueProps(props);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props);\n\n const rootClassName = clsx(\n formFieldStyles.formField,\n styles.searchField,\n className,\n );\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n const searchText = stringFormatter.format(`searchField.search`);\n\n const propsContext: PropsContext = {\n Kbd: {\n isDisabled: props.isDisabled,\n tunnelId: \"kbd\",\n className: styles.kbd,\n },\n ...fieldPropsContext,\n };\n\n return (\n <Aria.SearchField\n {...rest}\n {...fieldProps}\n aria-label={searchText}\n className={clsx(rootClassName, fieldProps.className)}\n >\n <TunnelProvider>\n <PropsContextProvider props={propsContext}>\n <FieldErrorCaptureContext>{children}</FieldErrorCaptureContext>\n\n <div className={styles.inputContainer}>\n <IconSearch className={styles.searchIcon} />\n <Aria.Input\n placeholder={searchText}\n className={styles.input}\n ref={ref}\n />\n <TunnelExit id=\"kbd\" />\n <Button\n className={styles.clearButton}\n variant=\"plain\"\n color=\"secondary\"\n >\n <IconClose />\n </Button>\n </div>\n </PropsContextProvider>\n <FieldErrorView />\n </TunnelProvider>\n </Aria.SearchField>\n );\n});\n\nexport default SearchField;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBO,MAAM,WAAA,GAAc,aAAA,CAAc,aAAA,EAAe,CAAC,KAAA,KAAU;AACjE,EAAA,MAAM,EAAE,UAAU,SAAA,EAAW,GAAA,EAAK,GAAG,IAAA,EAAK,GACxC,4BAA4B,KAAK,CAAA;AAEnC,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,kBAAkB,KAAK,CAAA;AAE3B,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,eAAA,CAAgB,SAAA;AAAA,IAChB,MAAA,CAAO,WAAA;AAAA,IACP;AAAA,GACF;AAEA,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAC3D,EAAA,MAAM,UAAA,GAAa,eAAA,CAAgB,MAAA,CAAO,CAAA,kBAAA,CAAoB,CAAA;AAE9D,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,GAAA,EAAK;AAAA,MACH,YAAY,KAAA,CAAM,UAAA;AAAA,MAClB,QAAA,EAAU,KAAA;AAAA,MACV,WAAW,MAAA,CAAO;AAAA,KACpB;AAAA,IACA,GAAG;AAAA,GACL;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA,CAAK,WAAA;AAAA,IAAL;AAAA,MACE,GAAG,IAAA;AAAA,MACH,GAAG,UAAA;AAAA,MACJ,YAAA,EAAY,UAAA;AAAA,MACZ,SAAA,EAAW,IAAA,CAAK,aAAA,EAAe,UAAA,CAAW,SAAS,CAAA;AAAA,MAEnD,+BAAC,cAAA,EAAA,EACC,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,oBAAA,EAAA,EAAqB,OAAO,YAAA,EAC3B,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,4BAA0B,QAAA,EAAS,CAAA;AAAA,0BAEpC,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,cAAA,EACrB,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,UAAA,EAAA,EAAW,SAAA,EAAW,MAAA,CAAO,UAAA,EAAY,CAAA;AAAA,4BAC1C,GAAA;AAAA,cAAC,IAAA,CAAK,KAAA;AAAA,cAAL;AAAA,gBACC,WAAA,EAAa,UAAA;AAAA,gBACb,WAAW,MAAA,CAAO,KAAA;AAAA,gBAClB;AAAA;AAAA,aACF;AAAA,4BACA,GAAA,CAAC,UAAA,EAAA,EAAW,EAAA,EAAG,KAAA,EAAM,CAAA;AAAA,4BACrB,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,WAAW,MAAA,CAAO,WAAA;AAAA,gBAClB,OAAA,EAAQ,OAAA;AAAA,gBACR,KAAA,EAAM,WAAA;AAAA,gBAEN,8BAAC,SAAA,EAAA,EAAU;AAAA;AAAA;AACb,WAAA,EACF;AAAA,SAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"SearchField.mjs","sources":["../../../../../../../src/components/SearchField/SearchField.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport formFieldStyles from \"../FormField/FormField.module.scss\";\nimport styles from \"./SearchField.module.scss\";\nimport clsx from \"clsx\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { Button } from \"@/components/Button\";\nimport { IconClose, IconSearch } from \"@/components/Icon/components/icons\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\n\nexport interface SearchFieldProps\n extends\n PropsWithChildren<Omit<Aria.SearchFieldProps, \"children\">>,\n FlowComponentProps<HTMLInputElement> {}\n\n/** @flr-generate all */\nexport const SearchField = flowComponent(\"SearchField\", (props) => {\n const { children, className, ref, ...rest } =\n useControlledHostValueProps(props);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props);\n\n const rootClassName = clsx(\n formFieldStyles.formField,\n styles.searchField,\n className,\n );\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"SearchField\");\n const searchText = stringFormatter.format(`search`);\n\n const propsContext: PropsContext = {\n Kbd: {\n isDisabled: props.isDisabled,\n tunnelId: \"kbd\",\n className: styles.kbd,\n },\n ...fieldPropsContext,\n };\n\n return (\n <Aria.SearchField\n {...rest}\n {...fieldProps}\n aria-label={searchText}\n className={clsx(rootClassName, fieldProps.className)}\n >\n <TunnelProvider>\n <PropsContextProvider props={propsContext}>\n <FieldErrorCaptureContext>{children}</FieldErrorCaptureContext>\n\n <div className={styles.inputContainer}>\n <IconSearch className={styles.searchIcon} />\n <Aria.Input\n placeholder={searchText}\n className={styles.input}\n ref={ref}\n />\n <TunnelExit id=\"kbd\" />\n <Button\n className={styles.clearButton}\n variant=\"plain\"\n color=\"secondary\"\n >\n <IconClose />\n </Button>\n </div>\n </PropsContextProvider>\n <FieldErrorView />\n </TunnelProvider>\n </Aria.SearchField>\n );\n});\n\nexport default SearchField;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBO,MAAM,WAAA,GAAc,aAAA,CAAc,aAAA,EAAe,CAAC,KAAA,KAAU;AACjE,EAAA,MAAM,EAAE,UAAU,SAAA,EAAW,GAAA,EAAK,GAAG,IAAA,EAAK,GACxC,4BAA4B,KAAK,CAAA;AAEnC,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,kBAAkB,KAAK,CAAA;AAE3B,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,eAAA,CAAgB,SAAA;AAAA,IAChB,MAAA,CAAO,WAAA;AAAA,IACP;AAAA,GACF;AAEA,EAAA,MAAM,eAAA,GAAkB,2BAAA,CAA4B,OAAA,EAAS,aAAa,CAAA;AAC1E,EAAA,MAAM,UAAA,GAAa,eAAA,CAAgB,MAAA,CAAO,CAAA,MAAA,CAAQ,CAAA;AAElD,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,GAAA,EAAK;AAAA,MACH,YAAY,KAAA,CAAM,UAAA;AAAA,MAClB,QAAA,EAAU,KAAA;AAAA,MACV,WAAW,MAAA,CAAO;AAAA,KACpB;AAAA,IACA,GAAG;AAAA,GACL;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA,CAAK,WAAA;AAAA,IAAL;AAAA,MACE,GAAG,IAAA;AAAA,MACH,GAAG,UAAA;AAAA,MACJ,YAAA,EAAY,UAAA;AAAA,MACZ,SAAA,EAAW,IAAA,CAAK,aAAA,EAAe,UAAA,CAAW,SAAS,CAAA;AAAA,MAEnD,+BAAC,cAAA,EAAA,EACC,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,oBAAA,EAAA,EAAqB,OAAO,YAAA,EAC3B,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,4BAA0B,QAAA,EAAS,CAAA;AAAA,0BAEpC,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,cAAA,EACrB,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,UAAA,EAAA,EAAW,SAAA,EAAW,MAAA,CAAO,UAAA,EAAY,CAAA;AAAA,4BAC1C,GAAA;AAAA,cAAC,IAAA,CAAK,KAAA;AAAA,cAAL;AAAA,gBACC,WAAA,EAAa,UAAA;AAAA,gBACb,WAAW,MAAA,CAAO,KAAA;AAAA,gBAClB;AAAA;AAAA,aACF;AAAA,4BACA,GAAA,CAAC,UAAA,EAAA,EAAW,EAAA,EAAG,KAAA,EAAM,CAAA;AAAA,4BACrB,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,WAAW,MAAA,CAAO,WAAA;AAAA,gBAClB,OAAA,EAAQ,OAAA;AAAA,gBACR,KAAA,EAAM,WAAA;AAAA,gBAEN,8BAAC,SAAA,EAAA,EAAU;AAAA;AAAA;AACb,WAAA,EACF;AAAA,SAAA,EACF,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
@@ -16,7 +16,7 @@ import '../../views/IconView.mjs';
16
16
  import { IconMinus } from '../Icon/components/icons/IconMinus.mjs';
17
17
  import { IconPlus } from '../Icon/components/icons/IconPlus.mjs';
18
18
  import locales from '../../../../../_virtual/_.locale.json@3ed2dc50f997451bdd85a713c54e1025.mjs';
19
- import { useLocalizedStringFormatter } from 'react-aria';
19
+ import { useLocalizedStringFormatter } from '../TranslationProvider/useLocalizedStringFormatter.mjs';
20
20
  import { TunnelProvider, TunnelExit } from '@mittwald/react-tunnel';
21
21
  import { useObjectRef } from '@react-aria/utils';
22
22
  import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
@@ -46,7 +46,7 @@ const Slider = flowComponent("Slider", (props) => {
46
46
  fieldPropsContext,
47
47
  fieldProps
48
48
  } = useFieldComponent(props);
49
- const stringFormatter = useLocalizedStringFormatter(locales);
49
+ const stringFormatter = useLocalizedStringFormatter(locales, "Slider");
50
50
  const objectRef = useObjectRef(ref);
51
51
  const propsContext = {
52
52
  ...fieldPropsContext,
@@ -93,7 +93,7 @@ const Slider = flowComponent("Slider", (props) => {
93
93
  Button,
94
94
  {
95
95
  onPress: () => state.decrementThumb(0, step),
96
- "aria-label": stringFormatter.format("slider.decrement"),
96
+ "aria-label": stringFormatter.format("decrement"),
97
97
  className: styles.decrement,
98
98
  children: /* @__PURE__ */ jsx(IconMinus, {})
99
99
  }
@@ -102,7 +102,7 @@ const Slider = flowComponent("Slider", (props) => {
102
102
  Button,
103
103
  {
104
104
  onPress: () => state.incrementThumb(0, step),
105
- "aria-label": stringFormatter.format("slider.increment"),
105
+ "aria-label": stringFormatter.format("increment"),
106
106
  className: styles.increment,
107
107
  children: /* @__PURE__ */ jsx(IconPlus, {})
108
108
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.mjs","sources":["../../../../../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"./Slider.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { Button } from \"@/components/Button\";\nimport { IconMinus, IconPlus } from \"@/components/Icon/components/icons\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface SliderProps\n extends\n FlowComponentProps<HTMLInputElement>,\n PropsWithChildren<Aria.SliderProps>,\n Pick<Aria.SliderThumbProps, \"name\"> {\n /** Whether the marker for the initial value should be visible */\n showInitialMarker?: boolean;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n /** Whether the component is invalid. */\n isInvalid?: boolean;\n /** Hide Buttons, Label and Value */\n sliderOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const Slider = flowComponent(\"Slider\", (props) => {\n const {\n className,\n children,\n name,\n isDisabled,\n defaultValue,\n showInitialMarker,\n isReadOnly,\n ref,\n step,\n sliderOnly,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.slider,\n isDisabled && styles.disabled,\n className,\n );\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props);\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const objectRef = useObjectRef(ref);\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Label: {\n unstyled: true,\n tunnelId: \"label\",\n ...fieldPropsContext.Label,\n className: styles.label,\n },\n };\n\n return (\n <div {...fieldProps}>\n <Aria.Slider\n {...rest}\n className={rootClassName}\n isDisabled={isDisabled}\n defaultValue={defaultValue}\n step={step}\n >\n <TunnelProvider>\n <PropsContextProvider props={propsContext}>\n <FieldErrorCaptureContext>{children}</FieldErrorCaptureContext>\n\n {!sliderOnly && (\n <div className={styles.text}>\n <Aria.SliderOutput className={styles.value} />{\" \"}\n <TunnelExit id=\"label\" />\n </div>\n )}\n\n <Aria.SliderTrack className={styles.track}>\n {({ state }) => (\n <PropsContextProvider\n props={{\n Button: {\n isPending: false,\n isFailed: false,\n isSucceeded: false,\n isReadOnly: isReadOnly,\n excludeFromTabOrder: true,\n isDisabled,\n variant: \"plain\",\n color: \"secondary\",\n },\n }}\n >\n {!sliderOnly && (\n <>\n <Button\n onPress={() => state.decrementThumb(0, step)}\n aria-label={stringFormatter.format(\"slider.decrement\")}\n className={styles.decrement}\n >\n <IconMinus />\n </Button>\n <Button\n onPress={() => state.incrementThumb(0, step)}\n aria-label={stringFormatter.format(\"slider.increment\")}\n className={styles.increment}\n >\n <IconPlus />\n </Button>\n </>\n )}\n\n <div\n className={styles.fill}\n style={{ width: state.getThumbPercent(0) * 100 + \"%\" }}\n />\n\n {showInitialMarker &&\n defaultValue &&\n typeof defaultValue === \"number\" && (\n <div\n className={styles.initialMarker}\n style={{\n left: `calc(${state.getValuePercent(defaultValue) * 100}% - 2px)`,\n }}\n />\n )}\n <Aria.SliderThumb\n inputRef={objectRef}\n name={name}\n className={styles.handle}\n isDisabled={isReadOnly}\n />\n </PropsContextProvider>\n )}\n </Aria.SliderTrack>\n <FieldErrorView />\n </PropsContextProvider>\n </TunnelProvider>\n </Aria.Slider>\n </div>\n );\n});\n\nexport default Slider;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgCO,MAAM,MAAA,GAAS,aAAA,CAAc,QAAA,EAAU,CAAC,KAAA,KAAU;AACvD,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,QAAA;AAAA,IACA,IAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,iBAAA;AAAA,IACA,UAAA;AAAA,IACA,GAAA;AAAA,IACA,IAAA;AAAA,IACA,UAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,MAAA,CAAO,MAAA;AAAA,IACP,cAAc,MAAA,CAAO,QAAA;AAAA,IACrB;AAAA,GACF;AAEA,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,iBAAA;AAAA,IACA;AAAA,GACF,GAAI,kBAAkB,KAAK,CAAA;AAE3B,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAAA,MAAM,SAAA,GAAY,a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,KAAA,EAAQ,KAAA,CAAM,eAAA,CAAgB,YAAY,IAAI,GAAG,CAAA,QAAA;AAAA;AACzD;AAAA,eACF;AAAA,8BAEJ,GAAA;AAAA,gBAAC,IAAA,CAAK,WAAA;AAAA,gBAAL;AAAA,kBACC,QAAA,EAAU,SAAA;AAAA,kBACV,IAAA;AAAA,kBACA,WAAW,MAAA,CAAO,MAAA;AAAA,kBAClB,UAAA,EAAY;AAAA;AAAA;AACd;AAAA;AAAA,SACF,EAEJ,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB,CAAA,EACF;AAAA;AAAA,GACF,EACF,CAAA;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"Slider.mjs","sources":["../../../../../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"./Slider.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { Button } from \"@/components/Button\";\nimport { IconMinus, IconPlus } from \"@/components/Icon/components/icons\";\nimport locales from \"./locales/*.locale.json\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface SliderProps\n extends\n FlowComponentProps<HTMLInputElement>,\n PropsWithChildren<Aria.SliderProps>,\n Pick<Aria.SliderThumbProps, \"name\"> {\n /** Whether the marker for the initial value should be visible */\n showInitialMarker?: boolean;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n /** Whether the component is invalid. */\n isInvalid?: boolean;\n /** Hide Buttons, Label and Value */\n sliderOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const Slider = flowComponent(\"Slider\", (props) => {\n const {\n className,\n children,\n name,\n isDisabled,\n defaultValue,\n showInitialMarker,\n isReadOnly,\n ref,\n step,\n sliderOnly,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.slider,\n isDisabled && styles.disabled,\n className,\n );\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props);\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"Slider\");\n\n const objectRef = useObjectRef(ref);\n\n const propsContext: PropsContext = {\n ...fieldPropsContext,\n Label: {\n unstyled: true,\n tunnelId: \"label\",\n ...fieldPropsContext.Label,\n className: styles.label,\n },\n };\n\n return (\n <div {...fieldProps}>\n <Aria.Slider\n {...rest}\n className={rootClassName}\n isDisabled={isDisabled}\n defaultValue={defaultValue}\n step={step}\n >\n <TunnelProvider>\n <PropsContextProvider props={propsContext}>\n <FieldErrorCaptureContext>{children}</FieldErrorCaptureContext>\n\n {!sliderOnly && (\n <div className={styles.text}>\n <Aria.SliderOutput className={styles.value} />{\" \"}\n <TunnelExit id=\"label\" />\n </div>\n )}\n\n <Aria.SliderTrack className={styles.track}>\n {({ state }) => (\n <PropsContextProvider\n props={{\n Button: {\n isPending: false,\n isFailed: false,\n isSucceeded: false,\n isReadOnly: isReadOnly,\n excludeFromTabOrder: true,\n isDisabled,\n variant: \"plain\",\n color: \"secondary\",\n },\n }}\n >\n {!sliderOnly && (\n <>\n <Button\n onPress={() => state.decrementThumb(0, step)}\n aria-label={stringFormatter.format(\"decrement\")}\n className={styles.decrement}\n >\n <IconMinus />\n </Button>\n <Button\n onPress={() => state.incrementThumb(0, step)}\n aria-label={stringFormatter.format(\"increment\")}\n className={styles.increment}\n >\n <IconPlus />\n </Button>\n </>\n )}\n\n <div\n className={styles.fill}\n style={{ width: state.getThumbPercent(0) * 100 + \"%\" }}\n />\n\n {showInitialMarker &&\n defaultValue &&\n typeof defaultValue === \"number\" && (\n <div\n className={styles.initialMarker}\n style={{\n left: `calc(${state.getValuePercent(defaultValue) * 100}% - 2px)`,\n }}\n />\n )}\n <Aria.SliderThumb\n inputRef={objectRef}\n name={name}\n className={styles.handle}\n isDisabled={isReadOnly}\n />\n </PropsContextProvider>\n )}\n </Aria.SliderTrack>\n <FieldErrorView />\n </PropsContextProvider>\n </TunnelProvider>\n </Aria.Slider>\n </div>\n );\n});\n\nexport default Slider;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgCO,MAAM,MAAA,GAAS,aAAA,CAAc,QAAA,EAAU,CAAC,KAAA,KAAU;AACvD,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,QAAA;AAAA,IACA,IAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,iBAAA;AAAA,IACA,UAAA;AAAA,IACA,GAAA;AAAA,IACA,IAAA;AAAA,IACA,UAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,MAAA,CAAO,MAAA;AAAA,IACP,cAAc,MAAA,CAAO,QAAA;AAAA,IACrB;AAAA,GACF;AAEA,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,iBAAA;AAAA,IACA;AAAA,GACF,GAAI,kBAAkB,KAAK,CAAA;AAE3B,EAAA,MAAM,eAAA,GAAkB,2BAAA,CAA4B,OAAA,EAAS,QAAQ,CAAA;AAErE,EAAA,MAAM,SAAA,GAAY,aAAa,GAAG,CAAA;AAElC,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,GAAG,iBAAA;AAAA,IACH,KAAA,EAAO;AAAA,MACL,QAAA,EAAU,IAAA;AAAA,MACV,QAAA,EAAU,OAAA;AAAA,MACV,GAAG,iBAAA,CAAkB,KAAA;AAAA,MACrB,WAAW,MAAA,CAAO;AAAA;AACpB,GACF;AAEA,EAAA,uBACE,G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,EAAY;AAAA;AAAA;AACd;AAAA;AAAA,SACF,EAEJ,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB,CAAA,EACF;AAAA;AAAA,GACF,EACF,CAAA;AAEJ,CAAC;;;;"}
@@ -11,7 +11,7 @@ import { PropsContextProvider } from '../../lib/propsContext/components/PropsCon
11
11
  import clsx from 'clsx';
12
12
  import { useState, useEffect } from 'react';
13
13
  import { useControlledHostValueProps } from '../../lib/remote/useControlledHostValueProps.mjs';
14
- import { useLocalizedStringFormatter } from 'react-aria';
14
+ import { useLocalizedStringFormatter } from '../TranslationProvider/useLocalizedStringFormatter.mjs';
15
15
  import locales from '../../../../../_virtual/_.locale.json@6922640321d6c379322b09cbcf0dcdb3.mjs';
16
16
  import { FieldDescription } from '../FieldDescription/FieldDescription.mjs';
17
17
 
@@ -58,8 +58,8 @@ const TextArea = flowComponent("TextArea", (props) => {
58
58
  onChange(v);
59
59
  }
60
60
  };
61
- const translation = useLocalizedStringFormatter(locales);
62
- const charactersCountDescription = translation.format("textArea.characters", {
61
+ const translation = useLocalizedStringFormatter(locales, "TextArea");
62
+ const charactersCountDescription = translation.format("characters", {
63
63
  count: charactersCount,
64
64
  maxCount: props.maxLength ?? 0
65
65
  });
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.mjs","sources":["../../../../../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport styles from \"./TextArea.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport { type PropsWithChildren, useEffect, useState } from \"react\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\nimport { FieldDescription } from \"@/components/FieldDescription\";\n\nexport interface TextAreaProps\n extends\n PropsWithChildren<Omit<Aria.TextFieldProps, \"children\">>,\n Pick<Aria.TextAreaProps, \"placeholder\" | \"rows\" | \"aria-hidden\">,\n FlowComponentProps<HTMLTextAreaElement> {\n /** Whether a character count should be displayed inside the field description. */\n showCharacterCount?: boolean;\n /**\n * Whether the text area should grow if its content gets longer than its\n * initial height.\n */\n autoResizeMaxRows?: number;\n /** Allows the user to manually resize the textArea horizontally. */\n allowResize?: boolean | \"horizontal\" | \"vertical\";\n /** @deprecated Use `allowResize` instead. */\n allowHorizontalResize?: boolean;\n /** @deprecated Use `allowResize` instead. */\n allowVerticalResize?: boolean;\n}\n\n/** @flr-generate all */\nexport const TextArea = flowComponent(\"TextArea\", (props) => {\n const {\n children,\n placeholder,\n rows = 5,\n autoResizeMaxRows = rows,\n ref,\n allowVerticalResize,\n allowHorizontalResize,\n showCharacterCount,\n className,\n onChange,\n ...rest\n } = useControlledHostValueProps(props);\n\n const [charactersCount, setCharactersCount] = useState(\n props.defaultValue?.length ?? props.value?.length ?? 0,\n );\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props);\n\n let { allowResize } = props;\n if (allowVerticalResize) {\n allowResize = \"vertical\";\n } else if (allowHorizontalResize) {\n allowResize = \"horizontal\";\n }\n\n const rootClassName = clsx(fieldProps.className, className);\n\n const inputClassName = clsx(\n styles.input,\n typeof allowResize === \"boolean\" && allowResize ? styles.resize : null,\n allowResize === \"horizontal\"\n ? styles.horizontalResize\n : allowResize === \"vertical\"\n ? styles.verticalResize\n : null,\n );\n\n const handleChange = (v: string) => {\n if (showCharacterCount) {\n setCharactersCount(v.length);\n }\n if (onChange) {\n onChange(v);\n }\n };\n\n const translation = useLocalizedStringFormatter(locales);\n\n const charactersCountDescription = translation.format(\"textArea.characters\", {\n count: charactersCount,\n maxCount: props.maxLength ?? 0,\n });\n\n const localRef = useObjectRef(ref);\n\n const getHeight = (rows: number) => {\n return `calc(var(--line-height--m) * ${rows} + (var(--form-control--padding-y) * 2))`;\n };\n\n const [resized, setResized] = useState(false);\n\n const autoResizable = rows !== autoResizeMaxRows;\n\n const verticallyResizable =\n allowResize && (!autoResizable || (autoResizable && resized));\n\n useEffect(() => {\n const textarea = localRef.current;\n if (!textarea) return;\n\n const startHeight = textarea.offsetHeight;\n let tracking = false;\n\n const handleMouseDown = () => {\n tracking = true;\n };\n\n const handleMouseMove = () => {\n if (!tracking || resized) return;\n\n const currentHeight = textarea.offsetHeight;\n\n if (currentHeight !== startHeight) {\n setResized(true);\n tracking = false;\n }\n };\n\n const handleMouseUp = () => {\n tracking = false;\n };\n\n window.addEventListener(\"mousedown\", handleMouseDown);\n window.addEventListener(\"mousemove\", handleMouseMove);\n window.addEventListener(\"mouseup\", handleMouseUp);\n\n return () => {\n window.removeEventListener(\"mousedown\", handleMouseDown);\n window.removeEventListener(\"mousemove\", handleMouseMove);\n window.removeEventListener(\"mouseup\", handleMouseUp);\n };\n }, [resized]);\n\n const updateHeight = () => {\n if (localRef.current && autoResizable && !verticallyResizable) {\n // https://stackoverflow.com/a/60795884\n localRef.current.style.height = \"0px\";\n const scrollHeight = localRef.current.scrollHeight;\n // + 2 to add border height\n localRef.current.style.height = scrollHeight + 2 + \"px\";\n }\n };\n\n return (\n <Aria.TextField\n {...rest}\n {...fieldProps}\n className={rootClassName}\n onChange={handleChange}\n >\n <PropsContextProvider props={fieldPropsContext}>\n <FieldErrorCaptureContext>{children}</FieldErrorCaptureContext>\n <Aria.TextArea\n rows={rows}\n aria-hidden={props[\"aria-hidden\"]}\n placeholder={placeholder}\n className={inputClassName}\n ref={localRef}\n onChange={updateHeight}\n style={{\n minHeight: getHeight(rows),\n maxHeight: verticallyResizable\n ? undefined\n : getHeight(autoResizeMaxRows),\n }}\n />\n {showCharacterCount && (\n <FieldDescription>{charactersCountDescription}</FieldDescription>\n )}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AA;AAAA,wBAAA,GAAA,CAAC,4BAA0B,QAAA,EAAS,CAAA;AAAA,wBACpC,GAAA;AAAA,UAAC,IAAA,CAAK,QAAA;AAAA,UAAL;AAAA,YACC,IAAA;AAAA,YACA,aAAA,EAAa,MAAM,aAAa,CAAA;AAAA,YAChC,WAAA;AAAA,YACA,SAAA,EAAW,cAAA;AAAA,YACX,GAAA,EAAK,QAAA;AAAA,YACL,QAAA,EAAU,YAAA;AAAA,YACV,KAAA,EAAO;AAAA,cACL,SAAA,EAAW,UAAU,IAAI,CAAA;AAAA,cACzB,SAAA,EAAW,mBAAA,GACP,MAAA,GACA,SAAA,CAAU,iBAAiB;AAAA;AACjC;AAAA,SACF;AAAA,QACC,kBAAA,oBACC,GAAA,CAAC,gBAAA,EAAA,EAAkB,QAAA,EAAA,0BAAA,EAA2B,CAAA;AAAA,4BAE/C,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"TextArea.mjs","sources":["../../../../../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport styles from \"./TextArea.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport { type PropsWithChildren, useEffect, useState } from \"react\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"./locales/*.locale.json\";\nimport { FieldDescription } from \"@/components/FieldDescription\";\n\nexport interface TextAreaProps\n extends\n PropsWithChildren<Omit<Aria.TextFieldProps, \"children\">>,\n Pick<Aria.TextAreaProps, \"placeholder\" | \"rows\" | \"aria-hidden\">,\n FlowComponentProps<HTMLTextAreaElement> {\n /** Whether a character count should be displayed inside the field description. */\n showCharacterCount?: boolean;\n /**\n * Whether the text area should grow if its content gets longer than its\n * initial height.\n */\n autoResizeMaxRows?: number;\n /** Allows the user to manually resize the textArea horizontally. */\n allowResize?: boolean | \"horizontal\" | \"vertical\";\n /** @deprecated Use `allowResize` instead. */\n allowHorizontalResize?: boolean;\n /** @deprecated Use `allowResize` instead. */\n allowVerticalResize?: boolean;\n}\n\n/** @flr-generate all */\nexport const TextArea = flowComponent(\"TextArea\", (props) => {\n const {\n children,\n placeholder,\n rows = 5,\n autoResizeMaxRows = rows,\n ref,\n allowVerticalResize,\n allowHorizontalResize,\n showCharacterCount,\n className,\n onChange,\n ...rest\n } = useControlledHostValueProps(props);\n\n const [charactersCount, setCharactersCount] = useState(\n props.defaultValue?.length ?? props.value?.length ?? 0,\n );\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props);\n\n let { allowResize } = props;\n if (allowVerticalResize) {\n allowResize = \"vertical\";\n } else if (allowHorizontalResize) {\n allowResize = \"horizontal\";\n }\n\n const rootClassName = clsx(fieldProps.className, className);\n\n const inputClassName = clsx(\n styles.input,\n typeof allowResize === \"boolean\" && allowResize ? styles.resize : null,\n allowResize === \"horizontal\"\n ? styles.horizontalResize\n : allowResize === \"vertical\"\n ? styles.verticalResize\n : null,\n );\n\n const handleChange = (v: string) => {\n if (showCharacterCount) {\n setCharactersCount(v.length);\n }\n if (onChange) {\n onChange(v);\n }\n };\n\n const translation = useLocalizedStringFormatter(locales, \"TextArea\");\n\n const charactersCountDescription = translation.format(\"characters\", {\n count: charactersCount,\n maxCount: props.maxLength ?? 0,\n });\n\n const localRef = useObjectRef(ref);\n\n const getHeight = (rows: number) => {\n return `calc(var(--line-height--m) * ${rows} + (var(--form-control--padding-y) * 2))`;\n };\n\n const [resized, setResized] = useState(false);\n\n const autoResizable = rows !== autoResizeMaxRows;\n\n const verticallyResizable =\n allowResize && (!autoResizable || (autoResizable && resized));\n\n useEffect(() => {\n const textarea = localRef.current;\n if (!textarea) return;\n\n const startHeight = textarea.offsetHeight;\n let tracking = false;\n\n const handleMouseDown = () => {\n tracking = true;\n };\n\n const handleMouseMove = () => {\n if (!tracking || resized) return;\n\n const currentHeight = textarea.offsetHeight;\n\n if (currentHeight !== startHeight) {\n setResized(true);\n tracking = false;\n }\n };\n\n const handleMouseUp = () => {\n tracking = false;\n };\n\n window.addEventListener(\"mousedown\", handleMouseDown);\n window.addEventListener(\"mousemove\", handleMouseMove);\n window.addEventListener(\"mouseup\", handleMouseUp);\n\n return () => {\n window.removeEventListener(\"mousedown\", handleMouseDown);\n window.removeEventListener(\"mousemove\", handleMouseMove);\n window.removeEventListener(\"mouseup\", handleMouseUp);\n };\n }, [resized]);\n\n const updateHeight = () => {\n if (localRef.current && autoResizable && !verticallyResizable) {\n // https://stackoverflow.com/a/60795884\n localRef.current.style.height = \"0px\";\n const scrollHeight = localRef.current.scrollHeight;\n // + 2 to add border height\n localRef.current.style.height = scrollHeight + 2 + \"px\";\n }\n };\n\n return (\n <Aria.TextField\n {...rest}\n {...fieldProps}\n className={rootClassName}\n onChange={handleChange}\n >\n <PropsContextProvider props={fieldPropsContext}>\n <FieldErrorCaptureContext>{children}</FieldErrorCaptureContext>\n <Aria.TextArea\n rows={rows}\n aria-hidden={props[\"aria-hidden\"]}\n placeholder={placeholder}\n className={inputClassName}\n ref={localRef}\n onChange={updateHeight}\n style={{\n minHeight: getHeight(rows),\n maxHeight: verticallyResizable\n ? undefined\n : getHeight(autoResizeMaxRows),\n }}\n />\n {showCharacterCount && (\n <FieldDescription>{charactersCountDescription}</FieldDescription>\n )}\n <FieldErrorView />\n </PropsContextProvider>\n </Aria.TextField>\n );\n});\n\nexport default TextArea;\n"],"names":["rows"],"mappings":";;;;;;;;;;;;;;;AAmCO,MAAM,QAAA,GAAW,aAAA,CAAc,UAAA,EAAY,CAA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YACA,aAAA,EAAa,MAAM,aAAa,CAAA;AAAA,YAChC,WAAA;AAAA,YACA,SAAA,EAAW,cAAA;AAAA,YACX,GAAA,EAAK,QAAA;AAAA,YACL,QAAA,EAAU,YAAA;AAAA,YACV,KAAA,EAAO;AAAA,cACL,SAAA,EAAW,UAAU,IAAI,CAAA;AAAA,cACzB,SAAA,EAAW,mBAAA,GACP,MAAA,GACA,SAAA,CAAU,iBAAiB;AAAA;AACjC;AAAA,SACF;AAAA,QACC,kBAAA,oBACC,GAAA,CAAC,gBAAA,EAAA,EAAkB,QAAA,EAAA,0BAAA,EAA2B,CAAA;AAAA,4BAE/C,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
@@ -10,7 +10,6 @@ import { PropsContextProvider } from '../../lib/propsContext/components/PropsCon
10
10
  import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
11
11
  import styles from './TextField.module.scss.mjs';
12
12
  import { FieldDescription } from '../FieldDescription/FieldDescription.mjs';
13
- import { useLocalizedStringFormatter } from 'react-aria';
14
13
  import locales from '../../../../../_virtual/_.locale.json@16189d7d260d7331b0e0a1936d5c7c52.mjs';
15
14
  import { Button } from '../Button/Button.mjs';
16
15
  import '@mittwald/flow-icons';
@@ -21,6 +20,8 @@ import { IconHide } from '../Icon/components/icons/IconHide.mjs';
21
20
  import { IconShow } from '../Icon/components/icons/IconShow.mjs';
22
21
  import clsx from 'clsx';
23
22
  import { TunnelProvider, TunnelExit } from '@mittwald/react-tunnel';
23
+ import '../TranslationProvider/TranslationProvider.mjs';
24
+ import { useLocalizedStringFormatter } from '../TranslationProvider/useLocalizedStringFormatter.mjs';
24
25
 
25
26
  const TextField = flowComponent("TextField", (props) => {
26
27
  const {
@@ -63,14 +64,11 @@ const TextField = flowComponent("TextField", (props) => {
63
64
  onChange(v);
64
65
  }
65
66
  };
66
- const translation = useLocalizedStringFormatter(locales);
67
- const charactersCountDescription = translation.format(
68
- "textField.characters",
69
- {
70
- count: charactersCount,
71
- maxCount: props.maxLength ?? 0
72
- }
73
- );
67
+ const translation = useLocalizedStringFormatter(locales, "TextField");
68
+ const charactersCountDescription = translation.format("characters", {
69
+ count: charactersCount,
70
+ maxCount: props.maxLength ?? 0
71
+ });
74
72
  return /* @__PURE__ */ jsx(
75
73
  Aria.TextField,
76
74
  {
@@ -101,7 +99,7 @@ const TextField = flowComponent("TextField", (props) => {
101
99
  className: styles.button,
102
100
  onPress: () => setType(type === "password" ? "text" : "password"),
103
101
  "aria-label": translation.format(
104
- `textField.password.${type === "password" ? "show" : "hide"}`
102
+ `password.${type === "password" ? "show" : "hide"}`
105
103
  ),
106
104
  children: type === "password" ? /* @__PURE__ */ jsx(IconShow, {}) : /* @__PURE__ */ jsx(IconHide, {})
107
105
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.mjs","sources":["../../../../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport { type PropsWithChildren, useState } from \"react\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./TextField.module.scss\";\nimport { FieldDescription } from \"@/components/FieldDescription\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\nimport { Button } from \"@/components/Button\";\nimport { IconHide, IconShow } from \"@/components/Icon/components/icons\";\nimport clsx from \"clsx\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\n\nexport interface TextFieldProps\n extends\n PropsWithChildren<Omit<Aria.TextFieldProps, \"children\">>,\n Pick<Aria.InputProps, \"placeholder\">,\n FlowComponentProps<HTMLInputElement> {\n /** Whether a character count should be displayed inside the field description. */\n showCharacterCount?: boolean;\n}\n\n/** @flr-generate all */\nexport const TextField = flowComponent(\"TextField\", (props) => {\n const {\n className,\n showCharacterCount,\n form,\n placeholder,\n ref,\n type: typeFromProps,\n children,\n onChange,\n ...rest\n } = useControlledHostValueProps(props);\n\n const [charactersCount, setCharactersCount] = useState(\n props.defaultValue?.length ?? props.value?.length ?? 0,\n );\n\n const [type, setType] = useState(typeFromProps);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props);\n\n const rootClassName = clsx(fieldProps.className, className);\n\n const propsContext: PropsContext = {\n Button: {\n className: styles.button,\n variant: \"plain\",\n color: \"secondary\",\n tunnelId: \"button\",\n },\n CopyButton: { className: styles.button, tunnelId: \"button\" },\n ...fieldPropsContext,\n };\n\n const handleChange = (v: string) => {\n if (showCharacterCount) {\n setCharactersCount(v.length);\n }\n if (onChange) {\n onChange(v);\n }\n };\n\n const translation = useLocalizedStringFormatter(locales);\n\n const charactersCountDescription = translation.format(\n \"textField.characters\",\n {\n count: charactersCount,\n maxCount: props.maxLength ?? 0,\n },\n );\n\n return (\n <Aria.TextField\n {...rest}\n {...fieldProps}\n className={rootClassName}\n onChange={handleChange}\n type={type}\n >\n <TunnelProvider>\n <PropsContextProvider props={propsContext}>\n <FieldErrorCaptureContext>\n {children}\n <div className={styles.inputContainer}>\n <Aria.Input\n form={form}\n placeholder={placeholder}\n className={styles.input}\n ref={ref}\n />\n <TunnelExit id=\"button\" />\n {typeFromProps === \"password\" && (\n <Button\n color=\"secondary\"\n variant=\"plain\"\n className={styles.button}\n onPress={() =>\n setType(type === \"password\" ? \"text\" : \"password\")\n }\n aria-label={translation.format(\n `textField.password.${type === \"password\" ? \"show\" : \"hide\"}`,\n )}\n >\n {type === \"password\" ? <IconShow /> : <IconHide />}\n </Button>\n )}\n </div>\n {showCharacterCount && (\n <FieldDescription>{charactersCountDescription}</FieldDescription>\n )}\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </PropsContextProvider>\n </Tunn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Q,IAAA,KAAS,UAAA,GAAa,SAAS,UAAU,CAAA;AAAA,gBAEnD,cAAY,WAAA,CAAY,MAAA;AAAA,kBACtB,CAAA,mBAAA,EAAsB,IAAA,KAAS,UAAA,GAAa,MAAA,GAAS,MAAM,CAAA;AAAA,iBAC7D;AAAA,gBAEC,mBAAS,UAAA,mBAAa,GAAA,CAAC,QAAA,EAAA,EAAS,CAAA,uBAAM,QAAA,EAAA,EAAS;AAAA;AAAA;AAClD,WAAA,EAEJ,CAAA;AAAA,UACC,kBAAA,oBACC,GAAA,CAAC,gBAAA,EAAA,EAAkB,QAAA,EAAA,0BAAA,EAA2B;AAAA,SAAA,EAElD,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB,CAAA,EACF;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"TextField.mjs","sources":["../../../../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport { type PropsWithChildren, useState } from \"react\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./TextField.module.scss\";\nimport { FieldDescription } from \"@/components/FieldDescription\";\nimport locales from \"./locales/*.locale.json\";\nimport { Button } from \"@/components/Button\";\nimport { IconHide, IconShow } from \"@/components/Icon/components/icons\";\nimport clsx from \"clsx\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider\";\n\nexport interface TextFieldProps\n extends\n PropsWithChildren<Omit<Aria.TextFieldProps, \"children\">>,\n Pick<Aria.InputProps, \"placeholder\">,\n FlowComponentProps<HTMLInputElement> {\n /** Whether a character count should be displayed inside the field description. */\n showCharacterCount?: boolean;\n}\n\n/** @flr-generate all */\nexport const TextField = flowComponent(\"TextField\", (props) => {\n const {\n className,\n showCharacterCount,\n form,\n placeholder,\n ref,\n type: typeFromProps,\n children,\n onChange,\n ...rest\n } = useControlledHostValueProps(props);\n\n const [charactersCount, setCharactersCount] = useState(\n props.defaultValue?.length ?? props.value?.length ?? 0,\n );\n\n const [type, setType] = useState(typeFromProps);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props);\n\n const rootClassName = clsx(fieldProps.className, className);\n\n const propsContext: PropsContext = {\n Button: {\n className: styles.button,\n variant: \"plain\",\n color: \"secondary\",\n tunnelId: \"button\",\n },\n CopyButton: { className: styles.button, tunnelId: \"button\" },\n ...fieldPropsContext,\n };\n\n const handleChange = (v: string) => {\n if (showCharacterCount) {\n setCharactersCount(v.length);\n }\n if (onChange) {\n onChange(v);\n }\n };\n\n const translation = useLocalizedStringFormatter(locales, \"TextField\");\n\n const charactersCountDescription = translation.format(\"characters\", {\n count: charactersCount,\n maxCount: props.maxLength ?? 0,\n });\n\n return (\n <Aria.TextField\n {...rest}\n {...fieldProps}\n className={rootClassName}\n onChange={handleChange}\n type={type}\n >\n <TunnelProvider>\n <PropsContextProvider props={propsContext}>\n <FieldErrorCaptureContext>\n {children}\n <div className={styles.inputContainer}>\n <Aria.Input\n form={form}\n placeholder={placeholder}\n className={styles.input}\n ref={ref}\n />\n <TunnelExit id=\"button\" />\n {typeFromProps === \"password\" && (\n <Button\n color=\"secondary\"\n variant=\"plain\"\n className={styles.button}\n onPress={() =>\n setType(type === \"password\" ? \"text\" : \"password\")\n }\n aria-label={translation.format(\n `password.${type === \"password\" ? \"show\" : \"hide\"}`,\n )}\n >\n {type === \"password\" ? <IconShow /> : <IconHide />}\n </Button>\n )}\n </div>\n {showCharacterCount && (\n <FieldDescription>{charactersCountDescription}</FieldDescription>\n )}\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </PropsContextProvider>\n </T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,MACP,OAAA,CAAQ,IAAA,KAAS,UAAA,GAAa,SAAS,UAAU,CAAA;AAAA,gBAEnD,cAAY,WAAA,CAAY,MAAA;AAAA,kBACtB,CAAA,SAAA,EAAY,IAAA,KAAS,UAAA,GAAa,MAAA,GAAS,MAAM,CAAA;AAAA,iBACnD;AAAA,gBAEC,mBAAS,UAAA,mBAAa,GAAA,CAAC,QAAA,EAAA,EAAS,CAAA,uBAAM,QAAA,EAAA,EAAS;AAAA;AAAA;AAClD,WAAA,EAEJ,CAAA;AAAA,UACC,kBAAA,oBACC,GAAA,CAAC,gBAAA,EAAA,EAAkB,QAAA,EAAA,0BAAA,EAA2B;AAAA,SAAA,EAElD,CAAA;AAAA,4BACC,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB,CAAA,EACF;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
@@ -1,14 +1,18 @@
1
1
  "use client"
2
2
  /* */
3
3
  import { jsx } from 'react/jsx-runtime';
4
- import { createContext, useContext, useMemo } from 'react';
4
+ import { createContext, useContext } from 'react';
5
+ import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
5
6
 
6
7
  const context = createContext({});
7
8
  const useTranslationProvider = () => useContext(context);
8
- const TranslationProvider = (props) => {
9
- const { children, translations } = props;
10
- return /* @__PURE__ */ jsx(context.Provider, { value: useMemo(() => translations, [translations]), children });
11
- };
9
+ const TranslationProvider = flowComponent(
10
+ "TranslationProvider",
11
+ (props) => {
12
+ const { children, translations, translate } = props;
13
+ return /* @__PURE__ */ jsx(context.Provider, { value: { translations, translate }, children });
14
+ }
15
+ );
12
16
 
13
17
  export { TranslationProvider, useTranslationProvider };
14
18
  //# sourceMappingURL=TranslationProvider.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TranslationProvider.mjs","sources":["../../../../../../../src/components/TranslationProvider/TranslationProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport React, { createContext, useContext, useMemo } from \"react\";\n\nexport interface Translations {\n \"de-DE\"?: Record<string, string>;\n \"en-US\"?: Record<string, string>;\n}\n\ntype Props = PropsWithChildren & {\n translations: Translations;\n};\n\nconst context = createContext<Translations>({});\n\nexport const useTranslationProvider = () => useContext(context);\n\nexport const TranslationProvider: FC<Props> = (props) => {\n const { children, translations } = props;\n\n return (\n <context.Provider value={useMemo(() => translations, [translations])}>\n {children}\n </context.Provider>\n );\n};\n\nexport default TranslationProvider;\n"],"names":[],"mappings":";;;AAYA,MAAM,OAAA,GAAU,aAAA,CAA4B,EAAE,CAAA;AAEvC,MAAM,sBAAA,GAAyB,MAAM,UAAA,CAAW,OAAO;AAEvD,MAAM,mBAAA,GAAiC,CAAC,KAAA,KAAU;AACvD,EAAA,MAAM,EAAE,QAAA,EAAU,YAAA,EAAa,GAAI,KAAA;AAEnC,EAAA,uBACE,GAAA,CAAC,OAAA,CAAQ,QAAA,EAAR,EAAiB,KAAA,EAAO,OAAA,CAAQ,MAAM,YAAA,EAAc,CAAC,YAAY,CAAC,CAAA,EAChE,QAAA,EACH,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"TranslationProvider.mjs","sources":["../../../../../../../src/components/TranslationProvider/TranslationProvider.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React, { createContext, useContext } from \"react\";\nimport type {\n LocalizedComponentName,\n TranslationFunction,\n} from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\n\ntype ComponentTranslationDictionary = Record<\n LocalizedComponentName,\n Record<string, string>\n>;\n\nexport interface Translations {\n [locale: string]: ComponentTranslationDictionary | undefined;\n \"de-DE\"?: ComponentTranslationDictionary;\n \"en-US\"?: ComponentTranslationDictionary;\n}\n\nexport interface TranslationContext {\n translations?: Translations;\n translate?: TranslationFunction;\n}\n\nexport type TranslationProviderProps = PropsWithChildren &\n TranslationContext &\n FlowComponentProps<never>;\n\nconst context = createContext<TranslationContext>({});\n\nexport const useTranslationProvider = () => useContext(context);\n\n/** @flr-generate all */\nexport const TranslationProvider = flowComponent(\n \"TranslationProvider\",\n (props) => {\n const { children, translations, translate } = props;\n\n return (\n <context.Provider value={{ translations, translate }}>\n {children}\n </context.Provider>\n );\n },\n);\n\nexport default TranslationProvider;\n"],"names":[],"mappings":";;;;AA6BA,MAAM,OAAA,GAAU,aAAA,CAAkC,EAAE,CAAA;AAE7C,MAAM,sBAAA,GAAyB,MAAM,UAAA,CAAW,OAAO;AAGvD,MAAM,mBAAA,GAAsB,aAAA;AAAA,EACjC,qBAAA;AAAA,EACA,CAAC,KAAA,KAAU;AACT,IAAA,MAAM,EAAE,QAAA,EAAU,YAAA,EAAc,SAAA,EAAU,GAAI,KAAA;AAE9C,IAAA,uBACE,GAAA,CAAC,QAAQ,QAAA,EAAR,EAAiB,OAAO,EAAE,YAAA,EAAc,SAAA,EAAU,EAChD,QAAA,EACH,CAAA;AAAA,EAEJ;AACF;;;;"}
@@ -0,0 +1,54 @@
1
+ "use client"
2
+ /* */
3
+ import { useTranslationProvider } from './TranslationProvider.mjs';
4
+ import { mergeDeep, mapValues, pick } from 'remeda';
5
+ import { useLocale } from 'react-aria-components';
6
+ import IntlMessageFormat from 'intl-messageformat';
7
+ import { useLocalizedStringDictionary } from '@react-aria/i18n';
8
+ import { useMemo, useCallback } from 'react';
9
+
10
+ const pickComponentTranslations = (componentName, data) => {
11
+ if (!data) {
12
+ return {};
13
+ }
14
+ return mapValues(data, (components) => {
15
+ const picked = pick(components ?? {}, [componentName]);
16
+ return picked[componentName] ?? {};
17
+ });
18
+ };
19
+ const useLocalizedStringFormatter = (strings, componentName) => {
20
+ const { locale } = useLocale();
21
+ const { translations, translate } = useTranslationProvider();
22
+ const mergedStrings = useMemo(
23
+ () => mergeDeep(
24
+ strings,
25
+ pickComponentTranslations(componentName, translations)
26
+ ),
27
+ [strings, translations, componentName]
28
+ );
29
+ const dictionary = useLocalizedStringDictionary(mergedStrings, componentName);
30
+ const formatFunction = useCallback(
31
+ (key, variables) => {
32
+ if (translate) {
33
+ const customTranslated = translate(key, variables, {
34
+ component: componentName,
35
+ locale
36
+ });
37
+ if (customTranslated !== void 0) {
38
+ return customTranslated;
39
+ }
40
+ }
41
+ const translationString = dictionary.getStringForLocale(key, locale);
42
+ const translationMessage = new IntlMessageFormat(
43
+ translationString,
44
+ locale
45
+ );
46
+ return String(translationMessage.format(variables));
47
+ },
48
+ [translate, locale, componentName, dictionary]
49
+ );
50
+ return useMemo(() => ({ format: formatFunction }), [formatFunction]);
51
+ };
52
+
53
+ export { useLocalizedStringFormatter };
54
+ //# sourceMappingURL=useLocalizedStringFormatter.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLocalizedStringFormatter.mjs","sources":["../../../../../../../src/components/TranslationProvider/useLocalizedStringFormatter.ts"],"sourcesContent":["import {\n type Translations,\n useTranslationProvider,\n} from \"@/components/TranslationProvider/TranslationProvider\";\nimport { mergeDeep } from \"remeda\";\nimport type { FlowComponentName } from \"@/components/propTypes\";\nimport { mapValues, pick } from \"remeda\";\nimport { useLocale } from \"react-aria-components\";\nimport type {\n Variables,\n LocalizedStrings as LocalizedStringsIntl,\n} from \"@internationalized/string\";\nimport IntlMessageFormat from \"intl-messageformat\";\nimport { useLocalizedStringDictionary } from \"@react-aria/i18n\";\nimport { useCallback, useMemo } from \"react\";\n\nexport type LocalizedStrings = LocalizedStringsIntl<string, string>;\nexport type LocalizedComponentName = FlowComponentName | string;\n\nexport type TranslationFunction = (\n key: string,\n variables: Variables,\n meta: {\n component: string;\n locale: string;\n },\n) => string | undefined;\n\nconst pickComponentTranslations = (\n componentName: LocalizedComponentName,\n data?: Translations,\n) => {\n if (!data) {\n return {};\n }\n\n return mapValues(data, (components) => {\n const picked = pick(components ?? {}, [componentName]);\n return picked[componentName] ?? {};\n });\n};\n\nexport const useLocalizedStringFormatter = (\n strings: LocalizedStrings,\n componentName: LocalizedComponentName,\n) => {\n const { locale } = useLocale();\n const { translations, translate } = useTranslationProvider();\n\n const mergedStrings = useMemo(\n () =>\n mergeDeep(\n strings,\n pickComponentTranslations(componentName, translations),\n ),\n [strings, translations, componentName],\n );\n\n const dictionary = useLocalizedStringDictionary(mergedStrings, componentName);\n const formatFunction = useCallback(\n (key: string, variables?: Variables): string => {\n if (translate) {\n const customTranslated = translate(key, variables, {\n component: componentName,\n locale,\n });\n\n if (customTranslated !== undefined) {\n return customTranslated;\n }\n }\n\n const translationString = dictionary.getStringForLocale(key, locale);\n const translationMessage = new IntlMessageFormat(\n translationString,\n locale,\n );\n\n return String(translationMessage.format(variables));\n },\n [translate, locale, componentName, dictionary],\n );\n\n return useMemo(() => ({ format: formatFunction }), [formatFunction]);\n};\n"],"names":[],"mappings":";;;;;;;AA4BA,MAAM,yBAAA,GAA4B,CAChC,aAAA,EACA,IAAA,KACG;AACH,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,OAAO,EAAC;AAAA,EACV;AAEA,EAAA,OAAO,SAAA,CAAU,IAAA,EAAM,CAAC,UAAA,KAAe;AACrC,IAAA,MAAM,SAAS,IAAA,CAAK,UAAA,IAAc,EAAC,EAAG,CAAC,aAAa,CAAC,CAAA;AACrD,IAAA,OAAO,MAAA,CAAO,aAAa,CAAA,IAAK,EAAC;AAAA,EACnC,CAAC,CAAA;AACH,CAAA;AAEO,MAAM,2BAAA,GAA8B,CACzC,OAAA,EACA,aAAA,KACG;AACH,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,EAAE,YAAA,EAAc,SAAA,EAAU,GAAI,sBAAA,EAAuB;AAE3D,EAAA,MAAM,aAAA,GAAgB,OAAA;AAAA,IACpB,MACE,SAAA;AAAA,MACE,OAAA;AAAA,MACA,yBAAA,CAA0B,eAAe,YAAY;AAAA,KACvD;AAAA,IACF,CAAC,OAAA,EAAS,YAAA,EAAc,aAAa;AAAA,GACvC;AAEA,EAAA,MAAM,UAAA,GAAa,4BAAA,CAA6B,aAAA,EAAe,aAAa,CAAA;AAC5E,EAAA,MAAM,cAAA,GAAiB,WAAA;AAAA,IACrB,CAAC,KAAa,SAAA,KAAkC;AAC9C,MAAA,IAAI,SAAA,EAAW;AACb,QAAA,MAAM,gBAAA,GAAmB,SAAA,CAAU,GAAA,EAAK,SAAA,EAAW;AAAA,UACjD,SAAA,EAAW,aAAA;AAAA,UACX;AAAA,SACD,CAAA;AAED,QAAA,IAAI,qBAAqB,MAAA,EAAW;AAClC,UAAA,OAAO,gBAAA;AAAA,QACT;AAAA,MACF;AAEA,MAAA,MAAM,iBAAA,GAAoB,UAAA,CAAW,kBAAA,CAAmB,GAAA,EAAK,MAAM,CAAA;AACnE,MAAA,MAAM,qBAAqB,IAAI,iBAAA;AAAA,QAC7B,iBAAA;AAAA,QACA;AAAA,OACF;AAEA,MAAA,OAAO,MAAA,CAAO,kBAAA,CAAmB,MAAA,CAAO,SAAS,CAAC,CAAA;AAAA,IACpD,CAAA;AAAA,IACA,CAAC,SAAA,EAAW,MAAA,EAAQ,aAAA,EAAe,UAAU;AAAA,GAC/C;AAEA,EAAA,OAAO,OAAA,CAAQ,OAAO,EAAE,MAAA,EAAQ,gBAAe,CAAA,EAAI,CAAC,cAAc,CAAC,CAAA;AACrE;;;;"}
@@ -79,7 +79,8 @@ const propsContextSupportingComponentsMap = {
79
79
  Text: true,
80
80
  TextArea: true,
81
81
  TextField: true,
82
- TimeField: true
82
+ TimeField: true,
83
+ TranslationProvider: true
83
84
  };
84
85
  const propsContextSupportingComponents = Object.keys(
85
86
  propsContextSupportingComponentsMap
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../../../src/components/propTypes/index.ts"],"sourcesContent":["import type { TextProps } from \"@/components/Text\";\nimport type { ButtonProps } from \"@/components/Button\";\nimport type { IconProps } from \"@/components/Icon\";\nimport type { LabelProps } from \"@/components/Label\";\nimport type { ContentProps } from \"@/components/Content\";\nimport type { LayoutCardProps } from \"@/components/LayoutCard\";\nimport type { LinkProps } from \"@/components/Link\";\nimport type { LightBoxProps } from \"@/components/LightBox\";\nimport type { FieldErrorProps } from \"@/components/FieldError\";\nimport type { FieldDescriptionProps } from \"@/components/FieldDescription\";\nimport type { AlertProps } from \"@/components/Alert\";\nimport type { HeadingProps } from \"@/components/Heading\";\nimport type { InitialsProps } from \"@/components/Initials\";\nimport type { ImageProps } from \"@/components/Image\";\nimport type { CopyButtonProps } from \"@/components/CopyButton\";\nimport type { HeaderProps } from \"@/components/Header/\";\nimport type { SwitchProps } from \"@/components/Switch\";\nimport type { AlertBadgeProps } from \"@/components/AlertBadge\";\nimport type { ActionGroupProps } from \"@/components/ActionGroup\";\nimport type { AvatarProps } from \"@/components/Avatar\";\nimport type { ActionProps } from \"@/components/Action\";\nimport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n MenuItemProps,\n} from \"@/components/ContextMenu\";\nimport type { SelectProps } from \"@/components/Select\";\nimport type {\n RadioButtonProps,\n RadioGroupProps,\n RadioProps,\n} from \"@/components/RadioGroup\";\nimport type { TextFieldProps } from \"@/components/TextField\";\nimport type { NumberFieldProps } from \"@/components/NumberField\";\nimport type { TextAreaProps } from \"@/components/TextArea\";\nimport type { CheckboxGroupProps } from \"@/components/CheckboxGroup\";\nimport type { CheckboxProps } from \"@/components/Checkbox\";\nimport type { CheckboxButtonProps } from \"@/components/CheckboxButton\";\nimport type { TabsProps } from \"@/components/Tabs\";\nimport type { ModalProps } from \"@/components/Modal\";\nimport type { SectionProps } from \"@/components/Section\";\nimport type { SliderProps } from \"@/components/Slider\";\nimport type { CounterBadgeProps } from \"@/components/CounterBadge\";\nimport type { FlowComponentName } from \"@/components/propTypes/types\";\nimport type {\n ContextualHelpProps,\n ContextualHelpTriggerProps,\n} from \"@/components/ContextualHelp\";\nimport type { PopoverProps, PopoverTriggerProps } from \"@/components/Popover\";\nimport type { ContextMenuSectionProps } from \"@/components/ContextMenu/components/ContextMenuSection\";\nimport type { ListProps } from \"@/components/List\";\nimport type { PasswordCreationFieldProps } from \"@/components/PasswordCreationField\";\nimport type { SearchFieldProps } from \"@/components/SearchField\";\nimport type { BadgeProps } from \"@/components/Badge\";\nimport type { DatePickerProps } from \"@/components/DatePicker\";\nimport type * as Aria from \"react-aria-components\";\nimport type { DateRangePickerProps } from \"@/components/DateRangePicker\";\nimport type { TimeFieldProps } from \"@/components/TimeField\";\nimport type { AlertIconProps } from \"@/components/AlertIcon\";\nimport type { ListSummaryProps } from \"@/components/List/components/ListSummary/ListSummary\";\nimport type { SegmentedControlProps } from \"@/components/SegmentedControl\";\nimport type { SegmentProps } from \"@/components/SegmentedControl/components/Segment\";\nimport type { FileCardProps } from \"@/components/FileCard\";\nimport type { FileFieldProps } from \"@/components/FileField\";\nimport type { AlignProps } from \"@/components/Align\";\nimport type { CountryOptionsProps } from \"src/components/CountryOptions\";\nimport type { ComboBoxProps } from \"@/components/ComboBox\";\nimport type { OptionProps } from \"@/components/Option\";\nimport type { MessageProps } from \"@/components/Message\";\nimport type { MessageThreadProps } from \"@/components/MessageThread\";\nimport type { FileCardListProps } from \"@/components/FileCardList\";\nimport type { AccentBoxProps } from \"@/components/AccentBox\";\nimport type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\nimport type { MenuTriggerProps } from \"@/components/OverlayTrigger\";\nimport type { ProgressBarProps } from \"@/components/ProgressBar\";\nimport type { FileDropZoneProps } from \"@/components/FileDropZone\";\nimport type { NavigationProps } from \"@/components/Navigation\";\nimport type { NavigationGroupProps } from \"@/components/Navigation/components/NavigationGroup\";\nimport type { AutocompleteProps } from \"@/components/Autocomplete/Autocomplete\";\nimport type { OptionsProps } from \"@/components/Options/Options\";\nimport type { MarkdownEditorProps } from \"@/components/MarkdownEditor\";\nimport type { AlertTextProps } from \"@/components/AlertText\";\nimport type { IllustratedMessageProps } from \"@/components/IllustratedMessage\";\nimport type { RatingProps } from \"@/components/Rating\";\nimport type { CodeEditorProps } from \"@/components/CodeEditor\";\nimport type { KbdProps } from \"@/components/Kbd/Kbd\";\n\nexport * from \"./types\";\n\nexport interface FlowComponentPropsTypes {\n AccentBox: AccentBoxProps;\n Action: ActionProps;\n ActionGroup: ActionGroupProps;\n Alert: AlertProps;\n AlertBadge: AlertBadgeProps;\n AlertIcon: AlertIconProps;\n AlertText: AlertTextProps;\n Align: AlignProps;\n Avatar: AvatarProps;\n Autocomplete: AutocompleteProps;\n Badge: BadgeProps;\n Button: ButtonProps;\n CodeEditor: CodeEditorProps;\n Checkbox: CheckboxProps;\n CheckboxButton: CheckboxButtonProps;\n CheckboxGroup: CheckboxGroupProps;\n ColumnLayout: ColumnLayoutProps;\n ComboBox: ComboBoxProps;\n Content: ContentProps;\n ContextMenu: ContextMenuProps;\n ContextMenuSection: ContextMenuSectionProps;\n ContextMenuTrigger: ContextMenuTriggerProps;\n ContextualHelp: ContextualHelpProps;\n ContextualHelpTrigger: ContextualHelpTriggerProps;\n CopyButton: CopyButtonProps;\n CounterBadge: CounterBadgeProps;\n CountryOptions: CountryOptionsProps;\n DatePicker: DatePickerProps<Aria.DateValue>;\n DateRangePicker: DateRangePickerProps<Aria.DateValue>;\n FieldDescription: FieldDescriptionProps;\n FieldError: FieldErrorProps;\n FileCard: FileCardProps;\n FileCardList: FileCardListProps;\n FileField: FileFieldProps;\n FileDropZone: FileDropZoneProps;\n Header: HeaderProps;\n Heading: HeadingProps;\n Icon: IconProps;\n IllustratedMessage: IllustratedMessageProps;\n Image: ImageProps;\n Initials: InitialsProps;\n Label: LabelProps;\n LayoutCard: LayoutCardProps;\n LightBox: LightBoxProps;\n Link: LinkProps;\n List: ListProps<never>;\n ListSummary: ListSummaryProps;\n MarkdownEditor: MarkdownEditorProps;\n MenuItem: MenuItemProps;\n MenuTrigger: MenuTriggerProps;\n Message: MessageProps;\n MessageThread: MessageThreadProps;\n Modal: ModalProps;\n Navigation: NavigationProps;\n NavigationGroup: NavigationGroupProps;\n NumberField: NumberFieldProps;\n Option: OptionProps;\n Options: OptionsProps;\n Popover: PopoverProps;\n PopoverTrigger: PopoverTriggerProps;\n PasswordCreationField: PasswordCreationFieldProps;\n ProgressBar: ProgressBarProps;\n Radio: RadioProps;\n RadioButton: RadioButtonProps;\n RadioGroup: RadioGroupProps;\n Rating: RatingProps;\n SearchField: SearchFieldProps;\n Section: SectionProps;\n Segment: SegmentProps;\n SegmentedControl: SegmentedControlProps;\n Select: SelectProps;\n Kbd: KbdProps;\n Slider: SliderProps;\n Switch: SwitchProps;\n Tabs: TabsProps;\n TabTitle: TabsProps;\n Text: TextProps;\n TextArea: TextAreaProps;\n TextField: TextFieldProps;\n TimeField: TimeFieldProps;\n}\n\nconst propsContextSupportingComponentsMap: Record<\n keyof FlowComponentPropsTypes,\n true\n> = {\n AccentBox: true,\n Action: true,\n ActionGroup: true,\n Avatar: true,\n Autocomplete: true,\n Alert: true,\n AlertBadge: true,\n AlertIcon: true,\n AlertText: true,\n Align: true,\n Badge: true,\n Button: true,\n CodeEditor: true,\n Checkbox: true,\n CheckboxButton: true,\n CheckboxGroup: true,\n ColumnLayout: true,\n ComboBox: true,\n Content: true,\n ContextMenu: true,\n ContextMenuSection: true,\n ContextMenuTrigger: true,\n ContextualHelp: true,\n ContextualHelpTrigger: true,\n CopyButton: true,\n CounterBadge: true,\n CountryOptions: true,\n DatePicker: true,\n DateRangePicker: true,\n FieldDescription: true,\n FieldError: true,\n FileCard: true,\n FileCardList: true,\n FileField: true,\n FileDropZone: true,\n Header: true,\n Heading: true,\n Icon: true,\n IllustratedMessage: true,\n Image: true,\n Initials: true,\n Kbd: true,\n Label: true,\n LayoutCard: true,\n LightBox: true,\n Link: true,\n List: true,\n ListSummary: true,\n MarkdownEditor: true,\n MenuItem: true,\n MenuTrigger: true,\n Message: true,\n MessageThread: true,\n Modal: true,\n Navigation: true,\n NavigationGroup: true,\n NumberField: true,\n Radio: true,\n Option: true,\n Options: true,\n Popover: true,\n PopoverTrigger: true,\n PasswordCreationField: true,\n ProgressBar: true,\n RadioButton: true,\n RadioGroup: true,\n Rating: true,\n SearchField: true,\n Section: true,\n Segment: true,\n SegmentedControl: true,\n Select: true,\n Slider: true,\n Switch: true,\n Tabs: true,\n TabTitle: true,\n TestComponent: true,\n Text: true,\n TextArea: true,\n TextField: true,\n TimeField: true,\n};\n\nexport const propsContextSupportingComponents = Object.keys(\n propsContextSupportingComponentsMap,\n) as FlowComponentName[];\n"],"names":[],"mappings":"AA4KA,MAAM,mCAAA,GAGF;AAAA,EACF,SAAA,EAAW,IAAA;AAAA,EACX,MAAA,EAAQ,IAAA;AAAA,EACR,WAAA,EAAa,IAAA;AAAA,EACb,MAAA,EAAQ,IAAA;AAAA,EACR,YAAA,EAAc,IAAA;AAAA,EACd,KAAA,EAAO,IAAA;AAAA,EACP,UAAA,EAAY,IAAA;AAAA,EACZ,SAAA,EAAW,IAAA;AAAA,EACX,SAAA,EAAW,IAAA;AAAA,EACX,KAAA,EAAO,IAAA;AAAA,EACP,KAAA,EAAO,IAAA;AAAA,EACP,MAAA,EAAQ,IAAA;AAAA,EACR,UAAA,EAAY,IAAA;AAAA,EACZ,QAAA,EAAU,IAAA;AAAA,EACV,cAAA,EAAgB,IAAA;AAAA,EAChB,aAAA,EAAe,IAAA;AAAA,EACf,YAAA,EAAc,IAAA;AAAA,EACd,QAAA,EAAU,IAAA;AAAA,EACV,OAAA,EAAS,IAAA;AAAA,EACT,WAAA,EAAa,IAAA;AAAA,EACb,kBAAA,EAAoB,IAAA;AAAA,EACpB,kBAAA,EAAoB,IAAA;AAAA,EACpB,cAAA,EAAgB,IAAA;AAAA,EAChB,qBAAA,EAAuB,IAAA;AAAA,EACvB,UAAA,EAAY,IAAA;AAAA,EACZ,YAAA,EAAc,IAAA;AAAA,EACd,cAAA,EAAgB,IAAA;AAAA,EAChB,UAAA,EAAY,IAAA;AAAA,EACZ,eAAA,EAAiB,IAAA;AAAA,EACjB,gBAAA,EAAkB,IAAA;AAAA,EAClB,UAAA,EAAY,IAAA;AAAA,EACZ,QAAA,EAAU,IAAA;AAAA,EACV,Y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AA,EACR,IAAA,EAAM,IAAA;AAAA,EACN,QAAA,EAAU,IAAA;AAAA,EACV,aAAA,EAAe,IAAA;AAAA,EACf,IAAA,EAAM,IAAA;AAAA,EACN,QAAA,EAAU,IAAA;AAAA,EACV,SAAA,EAAW,IAAA;AAAA,EACX,SAAA,EAAW;AACb,CAAA;AAEO,MAAM,mCAAmC,MAAA,CAAO,IAAA;AAAA,EACrD;AACF;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../../../src/components/propTypes/index.ts"],"sourcesContent":["import type { TextProps } from \"@/components/Text\";\nimport type { ButtonProps } from \"@/components/Button\";\nimport type { IconProps } from \"@/components/Icon\";\nimport type { LabelProps } from \"@/components/Label\";\nimport type { ContentProps } from \"@/components/Content\";\nimport type { LayoutCardProps } from \"@/components/LayoutCard\";\nimport type { LinkProps } from \"@/components/Link\";\nimport type { LightBoxProps } from \"@/components/LightBox\";\nimport type { FieldErrorProps } from \"@/components/FieldError\";\nimport type { FieldDescriptionProps } from \"@/components/FieldDescription\";\nimport type { AlertProps } from \"@/components/Alert\";\nimport type { HeadingProps } from \"@/components/Heading\";\nimport type { InitialsProps } from \"@/components/Initials\";\nimport type { ImageProps } from \"@/components/Image\";\nimport type { CopyButtonProps } from \"@/components/CopyButton\";\nimport type { HeaderProps } from \"@/components/Header/\";\nimport type { SwitchProps } from \"@/components/Switch\";\nimport type { AlertBadgeProps } from \"@/components/AlertBadge\";\nimport type { ActionGroupProps } from \"@/components/ActionGroup\";\nimport type { AvatarProps } from \"@/components/Avatar\";\nimport type { ActionProps } from \"@/components/Action\";\nimport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n MenuItemProps,\n} from \"@/components/ContextMenu\";\nimport type { SelectProps } from \"@/components/Select\";\nimport type {\n RadioButtonProps,\n RadioGroupProps,\n RadioProps,\n} from \"@/components/RadioGroup\";\nimport type { TextFieldProps } from \"@/components/TextField\";\nimport type { NumberFieldProps } from \"@/components/NumberField\";\nimport type { TextAreaProps } from \"@/components/TextArea\";\nimport type { CheckboxGroupProps } from \"@/components/CheckboxGroup\";\nimport type { CheckboxProps } from \"@/components/Checkbox\";\nimport type { CheckboxButtonProps } from \"@/components/CheckboxButton\";\nimport type { TabsProps } from \"@/components/Tabs\";\nimport type { ModalProps } from \"@/components/Modal\";\nimport type { SectionProps } from \"@/components/Section\";\nimport type { SliderProps } from \"@/components/Slider\";\nimport type { CounterBadgeProps } from \"@/components/CounterBadge\";\nimport type { FlowComponentName } from \"@/components/propTypes/types\";\nimport type {\n ContextualHelpProps,\n ContextualHelpTriggerProps,\n} from \"@/components/ContextualHelp\";\nimport type { PopoverProps, PopoverTriggerProps } from \"@/components/Popover\";\nimport type { ContextMenuSectionProps } from \"@/components/ContextMenu/components/ContextMenuSection\";\nimport type { ListProps } from \"@/components/List\";\nimport type { PasswordCreationFieldProps } from \"@/components/PasswordCreationField\";\nimport type { SearchFieldProps } from \"@/components/SearchField\";\nimport type { BadgeProps } from \"@/components/Badge\";\nimport type { DatePickerProps } from \"@/components/DatePicker\";\nimport type * as Aria from \"react-aria-components\";\nimport type { DateRangePickerProps } from \"@/components/DateRangePicker\";\nimport type { TimeFieldProps } from \"@/components/TimeField\";\nimport type { AlertIconProps } from \"@/components/AlertIcon\";\nimport type { ListSummaryProps } from \"@/components/List/components/ListSummary/ListSummary\";\nimport type { SegmentedControlProps } from \"@/components/SegmentedControl\";\nimport type { SegmentProps } from \"@/components/SegmentedControl/components/Segment\";\nimport type { FileCardProps } from \"@/components/FileCard\";\nimport type { FileFieldProps } from \"@/components/FileField\";\nimport type { AlignProps } from \"@/components/Align\";\nimport type { CountryOptionsProps } from \"src/components/CountryOptions\";\nimport type { ComboBoxProps } from \"@/components/ComboBox\";\nimport type { OptionProps } from \"@/components/Option\";\nimport type { MessageProps } from \"@/components/Message\";\nimport type { MessageThreadProps } from \"@/components/MessageThread\";\nimport type { FileCardListProps } from \"@/components/FileCardList\";\nimport type { AccentBoxProps } from \"@/components/AccentBox\";\nimport type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\nimport type { MenuTriggerProps } from \"@/components/OverlayTrigger\";\nimport type { ProgressBarProps } from \"@/components/ProgressBar\";\nimport type { FileDropZoneProps } from \"@/components/FileDropZone\";\nimport type { NavigationProps } from \"@/components/Navigation\";\nimport type { NavigationGroupProps } from \"@/components/Navigation/components/NavigationGroup\";\nimport type { AutocompleteProps } from \"@/components/Autocomplete/Autocomplete\";\nimport type { OptionsProps } from \"@/components/Options/Options\";\nimport type { MarkdownEditorProps } from \"@/components/MarkdownEditor\";\nimport type { AlertTextProps } from \"@/components/AlertText\";\nimport type { IllustratedMessageProps } from \"@/components/IllustratedMessage\";\nimport type { RatingProps } from \"@/components/Rating\";\nimport type { CodeEditorProps } from \"@/components/CodeEditor\";\nimport type { KbdProps } from \"@/components/Kbd/Kbd\";\nimport type { TranslationProviderProps } from \"@/components/TranslationProvider/TranslationProvider\";\n\nexport * from \"./types\";\n\nexport interface FlowComponentPropsTypes {\n AccentBox: AccentBoxProps;\n Action: ActionProps;\n ActionGroup: ActionGroupProps;\n Alert: AlertProps;\n AlertBadge: AlertBadgeProps;\n AlertIcon: AlertIconProps;\n AlertText: AlertTextProps;\n Align: AlignProps;\n Avatar: AvatarProps;\n Autocomplete: AutocompleteProps;\n Badge: BadgeProps;\n Button: ButtonProps;\n CodeEditor: CodeEditorProps;\n Checkbox: CheckboxProps;\n CheckboxButton: CheckboxButtonProps;\n CheckboxGroup: CheckboxGroupProps;\n ColumnLayout: ColumnLayoutProps;\n ComboBox: ComboBoxProps;\n Content: ContentProps;\n ContextMenu: ContextMenuProps;\n ContextMenuSection: ContextMenuSectionProps;\n ContextMenuTrigger: ContextMenuTriggerProps;\n ContextualHelp: ContextualHelpProps;\n ContextualHelpTrigger: ContextualHelpTriggerProps;\n CopyButton: CopyButtonProps;\n CounterBadge: CounterBadgeProps;\n CountryOptions: CountryOptionsProps;\n DatePicker: DatePickerProps<Aria.DateValue>;\n DateRangePicker: DateRangePickerProps<Aria.DateValue>;\n FieldDescription: FieldDescriptionProps;\n FieldError: FieldErrorProps;\n FileCard: FileCardProps;\n FileCardList: FileCardListProps;\n FileField: FileFieldProps;\n FileDropZone: FileDropZoneProps;\n Header: HeaderProps;\n Heading: HeadingProps;\n Icon: IconProps;\n IllustratedMessage: IllustratedMessageProps;\n Image: ImageProps;\n Initials: InitialsProps;\n Label: LabelProps;\n LayoutCard: LayoutCardProps;\n LightBox: LightBoxProps;\n Link: LinkProps;\n List: ListProps<never>;\n ListSummary: ListSummaryProps;\n MarkdownEditor: MarkdownEditorProps;\n MenuItem: MenuItemProps;\n MenuTrigger: MenuTriggerProps;\n Message: MessageProps;\n MessageThread: MessageThreadProps;\n Modal: ModalProps;\n Navigation: NavigationProps;\n NavigationGroup: NavigationGroupProps;\n NumberField: NumberFieldProps;\n Option: OptionProps;\n Options: OptionsProps;\n Popover: PopoverProps;\n PopoverTrigger: PopoverTriggerProps;\n PasswordCreationField: PasswordCreationFieldProps;\n ProgressBar: ProgressBarProps;\n Radio: RadioProps;\n RadioButton: RadioButtonProps;\n RadioGroup: RadioGroupProps;\n Rating: RatingProps;\n SearchField: SearchFieldProps;\n Section: SectionProps;\n Segment: SegmentProps;\n SegmentedControl: SegmentedControlProps;\n Select: SelectProps;\n Kbd: KbdProps;\n Slider: SliderProps;\n Switch: SwitchProps;\n Tabs: TabsProps;\n TabTitle: TabsProps;\n Text: TextProps;\n TextArea: TextAreaProps;\n TextField: TextFieldProps;\n TimeField: TimeFieldProps;\n TranslationProvider: TranslationProviderProps;\n}\n\nconst propsContextSupportingComponentsMap: Record<\n keyof FlowComponentPropsTypes,\n true\n> = {\n AccentBox: true,\n Action: true,\n ActionGroup: true,\n Avatar: true,\n Autocomplete: true,\n Alert: true,\n AlertBadge: true,\n AlertIcon: true,\n AlertText: true,\n Align: true,\n Badge: true,\n Button: true,\n CodeEditor: true,\n Checkbox: true,\n CheckboxButton: true,\n CheckboxGroup: true,\n ColumnLayout: true,\n ComboBox: true,\n Content: true,\n ContextMenu: true,\n ContextMenuSection: true,\n ContextMenuTrigger: true,\n ContextualHelp: true,\n ContextualHelpTrigger: true,\n CopyButton: true,\n CounterBadge: true,\n CountryOptions: true,\n DatePicker: true,\n DateRangePicker: true,\n FieldDescription: true,\n FieldError: true,\n FileCard: true,\n FileCardList: true,\n FileField: true,\n FileDropZone: true,\n Header: true,\n Heading: true,\n Icon: true,\n IllustratedMessage: true,\n Image: true,\n Initials: true,\n Kbd: true,\n Label: true,\n LayoutCard: true,\n LightBox: true,\n Link: true,\n List: true,\n ListSummary: true,\n MarkdownEditor: true,\n MenuItem: true,\n MenuTrigger: true,\n Message: true,\n MessageThread: true,\n Modal: true,\n Navigation: true,\n NavigationGroup: true,\n NumberField: true,\n Radio: true,\n Option: true,\n Options: true,\n Popover: true,\n PopoverTrigger: true,\n PasswordCreationField: true,\n ProgressBar: true,\n RadioButton: true,\n RadioGroup: true,\n Rating: true,\n SearchField: true,\n Section: true,\n Segment: true,\n SegmentedControl: true,\n Select: true,\n Slider: true,\n Switch: true,\n Tabs: true,\n TabTitle: true,\n TestComponent: true,\n Text: true,\n TextArea: true,\n TextField: true,\n TimeField: true,\n TranslationProvider: true,\n};\n\nexport const propsContextSupportingComponents = Object.keys(\n propsContextSupportingComponentsMap,\n) as FlowComponentName[];\n"],"names":[],"mappings":"AA8KA,MAAM,mCAAA,GAGF;AAAA,EACF,SAAA,EAAW,IAAA;AAAA,EACX,MAAA,EAAQ,IAAA;AAAA,EACR,WAAA,EAAa,IAAA;AAAA,EACb,MAAA,EAAQ,IAAA;AAAA,EACR,YAAA,EAAc,IAAA;AAAA,EACd,KAAA,EAAO,IAAA;AAAA,EACP,UAAA,EAAY,IAAA;AAAA,EACZ,SAAA,EAAW,IAAA;AAAA,EACX,SAAA,EAAW,IAAA;AAAA,EACX,KAAA,EAAO,IAAA;AAAA,EACP,KAAA,EAAO,IAAA;AAAA,EACP,MAAA,EAAQ,IAAA;AAAA,EACR,UAAA,EAAY,IAAA;AAAA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,EAAY,IAAA;AAAA,EACZ,eAAA,EAAiB,IAAA;AAAA,EACjB,WAAA,EAAa,IAAA;AAAA,EACb,KAAA,EAAO,IAAA;AAAA,EACP,MAAA,EAAQ,IAAA;AAAA,EACR,OAAA,EAAS,IAAA;AAAA,EACT,OAAA,EAAS,IAAA;AAAA,EACT,cAAA,EAAgB,IAAA;AAAA,EAChB,qBAAA,EAAuB,IAAA;AAAA,EACvB,WAAA,EAAa,IAAA;AAAA,EACb,WAAA,EAAa,IAAA;AAAA,EACb,UAAA,EAAY,IAAA;AAAA,EACZ,MAAA,EAAQ,IAAA;AAAA,EACR,WAAA,EAAa,IAAA;AAAA,EACb,OAAA,EAAS,IAAA;AAAA,EACT,OAAA,EAAS,IAAA;AAAA,EACT,gBAAA,EAAkB,IAAA;AAAA,EAClB,MAAA,EAAQ,IAAA;AAAA,EACR,MAAA,EAAQ,IAAA;AAAA,EACR,MAAA,EAAQ,IAAA;AAAA,EACR,IAAA,EAAM,IAAA;AAAA,EACN,QAAA,EAAU,IAAA;AAAA,EACV,aAAA,EAAe,IAAA;AAAA,EACf,IAAA,EAAM,IAAA;AAAA,EACN,QAAA,EAAU,IAAA;AAAA,EACV,SAAA,EAAW,IAAA;AAAA,EACX,SAAA,EAAW,IAAA;AAAA,EACX,mBAAA,EAAqB;AACvB,CAAA;AAEO,MAAM,mCAAmC,MAAA,CAAO,IAAA;AAAA,EACrD;AACF;;;;"}
@@ -7,46 +7,49 @@ import '../../../../lib/propsContext/propsContext.mjs';
7
7
  import { PropsContextProvider } from '../../../../lib/propsContext/components/PropsContextProvider.mjs';
8
8
  import 'react';
9
9
  import { useController, useWatch } from 'react-hook-form';
10
- import { useLocalizedStringFormatter } from 'react-aria';
10
+ import { useLocalizedStringFormatter } from '../../../../components/TranslationProvider/useLocalizedStringFormatter.mjs';
11
11
  import locales from '../../../../../../../_virtual/_.locale.json@72ba2ce40f190df671686fec50c04ddf.mjs';
12
12
  import FieldErrorView from '../../../../views/FieldErrorView.mjs';
13
13
  import { useUpdateFormDefaultValue } from './hooks/useUpdateFormDefaultValue.mjs';
14
14
 
15
15
  function Field(props) {
16
16
  const { children, name, defaultValue, ...rest } = props;
17
- const stringFormatter = useLocalizedStringFormatter(locales);
17
+ const stringFormatter = useLocalizedStringFormatter(
18
+ locales,
19
+ "ReactHookForm.Field"
20
+ );
18
21
  const controller = useController({
19
22
  ...props,
20
23
  rules: {
21
24
  ...props.rules,
22
25
  min: typeof rest.rules?.min === "number" ? {
23
26
  value: rest.rules.min,
24
- message: stringFormatter.format("min", {
27
+ message: stringFormatter.format("validation.min", {
25
28
  number: rest.rules.min
26
29
  })
27
30
  } : rest.rules?.min,
28
31
  max: typeof rest.rules?.max === "number" ? {
29
32
  value: rest.rules.max,
30
- message: stringFormatter.format("max", {
33
+ message: stringFormatter.format("validation.max", {
31
34
  number: rest.rules.max
32
35
  })
33
36
  } : rest.rules?.max,
34
- required: typeof rest.rules?.required === "boolean" ? stringFormatter.format("required") : rest.rules?.required,
37
+ required: typeof rest.rules?.required === "boolean" ? stringFormatter.format("validation.required") : rest.rules?.required,
35
38
  pattern: rest.rules?.pattern instanceof RegExp ? {
36
39
  value: rest.rules.pattern,
37
- message: stringFormatter.format("pattern", {
40
+ message: stringFormatter.format("validation.pattern", {
38
41
  pattern: rest.rules.pattern.source
39
42
  })
40
43
  } : rest.rules?.pattern,
41
44
  minLength: typeof rest.rules?.minLength === "number" ? {
42
45
  value: rest.rules.minLength,
43
- message: stringFormatter.format("minLength", {
46
+ message: stringFormatter.format("validation.minLength", {
44
47
  number: rest.rules.minLength
45
48
  })
46
49
  } : rest.rules?.minLength,
47
50
  maxLength: typeof rest.rules?.maxLength === "number" ? {
48
51
  value: rest.rules.maxLength,
49
- message: stringFormatter.format("maxLength", {
52
+ message: stringFormatter.format("validation.maxLength", {
50
53
  number: rest.rules.maxLength
51
54
  })
52
55
  } : rest.rules?.maxLength
@@ -1 +1 @@
1
- {"version":3,"file":"Field.mjs","sources":["../../../../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import { useFormContext } from \"@/integrations/react-hook-form/components/FormContextProvider/FormContextProvider\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { type PropsWithChildren } from \"react\";\nimport {\n type ControllerProps,\n type FieldValues,\n useController,\n type UseFormReturn,\n useWatch,\n} from \"react-hook-form\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\nimport { useUpdateFormDefaultValue } from \"@/integrations/react-hook-form/components/Field/hooks/useUpdateFormDefaultValue\";\n\nexport interface FieldProps<T extends FieldValues>\n extends Omit<ControllerProps<T>, \"render\">, PropsWithChildren {}\n\nexport function Field<T extends FieldValues>(props: FieldProps<T>) {\n const { children, name, defaultValue, ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const controller = useController({\n ...props,\n rules: {\n ...props.rules,\n min:\n typeof rest.rules?.min === \"number\"\n ? {\n value: rest.rules.min,\n message: stringFormatter.format(\"min\", {\n number: rest.rules.min,\n }),\n }\n : rest.rules?.min,\n max:\n typeof rest.rules?.max === \"number\"\n ? {\n value: rest.rules.max,\n message: stringFormatter.format(\"max\", {\n number: rest.rules.max,\n }),\n }\n : rest.rules?.max,\n required:\n typeof rest.rules?.required === \"boolean\"\n ? stringFormatter.format(\"required\")\n : rest.rules?.required,\n pattern:\n rest.rules?.pattern instanceof RegExp\n ? {\n value: rest.rules.pattern,\n message: stringFormatter.format(\"pattern\", {\n pattern: rest.rules.pattern.source,\n }),\n }\n : rest.rules?.pattern,\n minLength:\n typeof rest.rules?.minLength === \"number\"\n ? {\n value: rest.rules.minLength,\n message: stringFormatter.format(\"minLength\", {\n number: rest.rules.minLength,\n }),\n }\n : rest.rules?.minLength,\n maxLength:\n typeof rest.rules?.maxLength === \"number\"\n ? {\n value: rest.rules.maxLength,\n message: stringFormatter.format(\"maxLength\", {\n number: rest.rules.maxLength,\n }),\n }\n : rest.rules?.maxLength,\n },\n });\n const formContext = useFormContext<T>();\n\n useUpdateFormDefaultValue(props, formContext.form);\n\n /**\n * We don't use controller.field.value here, because it doesn't update when\n * the form value is updated outside of this field (e.g. when setting values\n * with form.setValue or resetting the form), and the Field unmounts in\n * between. This is generally a feature of React Hook Form, but this breaks\n * dynamic forms where fields are conditionally rendered.\n *\n * By using formContext.form.watch(name), we ensure that the field value is\n * always in sync with the form state. See:\n * https://react-hook-form.com/api/usecontroller/controller/\n */\n const value =\n useWatch({\n control: formContext.form.control,\n name,\n }) ?? controller.field.value;\n\n const isFieldInvalid = controller.fieldState.invalid;\n\n const fieldProps = {\n ...controller.field,\n value,\n name,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n isReadOnly: formContext.isReadOnly,\n validationBehavior: \"aria\" as const,\n defaultValue,\n isInvalid: isFieldInvalid,\n children: dynamic((p) => {\n return (\n <>\n {p.children}\n <FieldErrorView>\n {controller.fieldState.error?.message}\n </FieldErrorView>\n </>\n );\n }),\n };\n\n const propsContext: PropsContext = {\n Autocomplete: {\n SearchField: fieldProps,\n TextField: fieldProps,\n },\n SearchField: fieldProps,\n TextField: fieldProps,\n TextArea: fieldProps,\n MarkdownEditor: fieldProps,\n CodeEditor: fieldProps,\n Checkbox: {\n ...fieldProps,\n isSelected: value,\n },\n CheckboxGroup: {\n ...fieldProps,\n },\n CheckboxButton: {\n ...fieldProps,\n isSelected: value,\n },\n FileField: fieldProps,\n FileDropZone: fieldProps,\n NumberField: fieldProps,\n RadioGroup: fieldProps,\n Switch: {\n ...fieldProps,\n isSelected: value,\n },\n Slider: fieldProps,\n PasswordCreationField: fieldProps,\n DatePicker: fieldProps,\n DateRangePicker: fieldProps,\n TimeField: fieldProps,\n SegmentedControl: fieldProps,\n Select: {\n ...fieldProps,\n selectedKey: value,\n },\n ComboBox: {\n ...fieldProps,\n selectedKey: value,\n },\n Rating: fieldProps,\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[\n controller.fieldState,\n controller.field,\n value,\n formContext.isReadOnly,\n ]}\n >\n {children}\n </PropsContextProvider>\n );\n}\n\nexport const typedField = <T extends FieldValues>(\n ignoredForm: UseFormReturn<T> | UseFormReturn<T>[\"control\"],\n): typeof Field<T> => Field;\n\nexport default Field;\n"],"names":[],"mappings":";;;;;;;;;;;;AAsBO,SAAS,MAA6B,KAAA,EAAsB;AACjE,EAAA,MAAM,EAAE,QAAA,EAAU,IAAA,EAAM,YAAA,EAAc,GAAG,MAAK,GAAI,KAAA;AAElD,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAAA,MAAM,aAAa,aAAA,CAAc;AAAA,IAC/B,GAAG,KAAA;AAAA,IACH,KAAA,EAAO;AAAA,MACL,GAAG,KAAA,CAAM,KAAA;AAAA,MACT,GAAA,EACE,OAAO,IAAA,CAAK,KAAA,EAAO,QAAQ,QAAA,GACvB;AAAA,QACE,KAAA,EAAO,KAAK,KAAA,CAAM,GAAA;AAAA,QAClB,OAAA,EAAS,eAAA,CAAgB,MAAA,CAAO,KAAA,EAAO;AAAA,UACrC,MAAA,EAAQ,KAAK,KAAA,CAAM;AAAA,SACpB;AAAA,OACH,GACA,KAAK,KAAA,EAAO,GAAA;AAAA,MAClB,GAAA,EACE,OAAO,IAAA,CAAK,KAAA,EAAO,QAAQ,QAAA,GACvB;AAAA,QACE,KAAA,EAAO,KAAK,KAAA,CAAM,GAAA;AAAA,QAClB,OAAA,EAAS,eAAA,CAAgB,MAAA,CAAO,KAAA,EAAO;AAAA,UACrC,MAAA,EAAQ,KAAK,KAAA,CAAM;AAAA,SACpB;AAAA,OACH,GACA,KAAK,KAAA,EAAO,GAAA;AAAA,MAClB,QAAA,EACE,OAAO,IAAA,CAAK,KAAA,EAAO,QAAA,KAAa,SAAA,GAC5B,eAAA,CAAgB,MAAA,CAAO,UAAU,CAAA,GACjC,IAAA,CAAK,KAAA,EAAO,QAAA;AAAA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AAQ,UAAA;AAAA,IACR,qBAAA,EAAuB,UAAA;AAAA,IACvB,UAAA,EAAY,UAAA;AAAA,IACZ,eAAA,EAAiB,UAAA;AAAA,IACjB,SAAA,EAAW,UAAA;AAAA,IACX,gBAAA,EAAkB,UAAA;AAAA,IAClB,MAAA,EAAQ;AAAA,MACN,GAAG,UAAA;AAAA,MACH,WAAA,EAAa;AAAA,KACf;AAAA,IACA,QAAA,EAAU;AAAA,MACR,GAAG,UAAA;AAAA,MACH,WAAA,EAAa;AAAA,KACf;AAAA,IACA,MAAA,EAAQ;AAAA,GACV;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,YAAA;AAAA,MACP,YAAA,EAAc;AAAA,QACZ,UAAA,CAAW,UAAA;AAAA,QACX,UAAA,CAAW,KAAA;AAAA,QACX,KAAA;AAAA,QACA,WAAA,CAAY;AAAA,OACd;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;AAEO,MAAM,UAAA,GAAa,CACxB,WAAA,KACoB;;;;"}
1
+ {"version":3,"file":"Field.mjs","sources":["../../../../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import { useFormContext } from \"@/integrations/react-hook-form/components/FormContextProvider/FormContextProvider\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { type PropsWithChildren } from \"react\";\nimport {\n type ControllerProps,\n type FieldValues,\n useController,\n type UseFormReturn,\n useWatch,\n} from \"react-hook-form\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"./locales/*.locale.json\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\nimport { useUpdateFormDefaultValue } from \"@/integrations/react-hook-form/components/Field/hooks/useUpdateFormDefaultValue\";\n\nexport interface FieldProps<T extends FieldValues>\n extends Omit<ControllerProps<T>, \"render\">, PropsWithChildren {}\n\nexport function Field<T extends FieldValues>(props: FieldProps<T>) {\n const { children, name, defaultValue, ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(\n locales,\n \"ReactHookForm.Field\",\n );\n\n const controller = useController({\n ...props,\n rules: {\n ...props.rules,\n min:\n typeof rest.rules?.min === \"number\"\n ? {\n value: rest.rules.min,\n message: stringFormatter.format(\"validation.min\", {\n number: rest.rules.min,\n }),\n }\n : rest.rules?.min,\n max:\n typeof rest.rules?.max === \"number\"\n ? {\n value: rest.rules.max,\n message: stringFormatter.format(\"validation.max\", {\n number: rest.rules.max,\n }),\n }\n : rest.rules?.max,\n required:\n typeof rest.rules?.required === \"boolean\"\n ? stringFormatter.format(\"validation.required\")\n : rest.rules?.required,\n pattern:\n rest.rules?.pattern instanceof RegExp\n ? {\n value: rest.rules.pattern,\n message: stringFormatter.format(\"validation.pattern\", {\n pattern: rest.rules.pattern.source,\n }),\n }\n : rest.rules?.pattern,\n minLength:\n typeof rest.rules?.minLength === \"number\"\n ? {\n value: rest.rules.minLength,\n message: stringFormatter.format(\"validation.minLength\", {\n number: rest.rules.minLength,\n }),\n }\n : rest.rules?.minLength,\n maxLength:\n typeof rest.rules?.maxLength === \"number\"\n ? {\n value: rest.rules.maxLength,\n message: stringFormatter.format(\"validation.maxLength\", {\n number: rest.rules.maxLength,\n }),\n }\n : rest.rules?.maxLength,\n },\n });\n const formContext = useFormContext<T>();\n\n useUpdateFormDefaultValue(props, formContext.form);\n\n /**\n * We don't use controller.field.value here, because it doesn't update when\n * the form value is updated outside of this field (e.g. when setting values\n * with form.setValue or resetting the form), and the Field unmounts in\n * between. This is generally a feature of React Hook Form, but this breaks\n * dynamic forms where fields are conditionally rendered.\n *\n * By using formContext.form.watch(name), we ensure that the field value is\n * always in sync with the form state. See:\n * https://react-hook-form.com/api/usecontroller/controller/\n */\n const value =\n useWatch({\n control: formContext.form.control,\n name,\n }) ?? controller.field.value;\n\n const isFieldInvalid = controller.fieldState.invalid;\n\n const fieldProps = {\n ...controller.field,\n value,\n name,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n isReadOnly: formContext.isReadOnly,\n validationBehavior: \"aria\" as const,\n defaultValue,\n isInvalid: isFieldInvalid,\n children: dynamic((p) => {\n return (\n <>\n {p.children}\n <FieldErrorView>\n {controller.fieldState.error?.message}\n </FieldErrorView>\n </>\n );\n }),\n };\n\n const propsContext: PropsContext = {\n Autocomplete: {\n SearchField: fieldProps,\n TextField: fieldProps,\n },\n SearchField: fieldProps,\n TextField: fieldProps,\n TextArea: fieldProps,\n MarkdownEditor: fieldProps,\n CodeEditor: fieldProps,\n Checkbox: {\n ...fieldProps,\n isSelected: value,\n },\n CheckboxGroup: {\n ...fieldProps,\n },\n CheckboxButton: {\n ...fieldProps,\n isSelected: value,\n },\n FileField: fieldProps,\n FileDropZone: fieldProps,\n NumberField: fieldProps,\n RadioGroup: fieldProps,\n Switch: {\n ...fieldProps,\n isSelected: value,\n },\n Slider: fieldProps,\n PasswordCreationField: fieldProps,\n DatePicker: fieldProps,\n DateRangePicker: fieldProps,\n TimeField: fieldProps,\n SegmentedControl: fieldProps,\n Select: {\n ...fieldProps,\n selectedKey: value,\n },\n ComboBox: {\n ...fieldProps,\n selectedKey: value,\n },\n Rating: fieldProps,\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[\n controller.fieldState,\n controller.field,\n value,\n formContext.isReadOnly,\n ]}\n >\n {children}\n </PropsContextProvider>\n );\n}\n\nexport const typedField = <T extends FieldValues>(\n ignoredForm: UseFormReturn<T> | UseFormReturn<T>[\"control\"],\n): typeof Field<T> => Field;\n\nexport default Field;\n"],"names":[],"mappings":";;;;;;;;;;;;AAsBO,SAAS,MAA6B,KAAA,EAAsB;AACjE,EAAA,MAAM,EAAE,QAAA,EAAU,IAAA,EAAM,YAAA,EAAc,GAAG,MAAK,GAAI,KAAA;AAElD,EAAA,MAAM,eAAA,GAAkB,2BAAA;AAAA,IACtB,OAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,aAAa,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