@mittwald/flow-react-components 0.2.0-alpha.497 → 0.2.0-alpha.499

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 (419) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/assets/doc-properties.json +19 -0
  3. package/dist/css/all.css +1 -1
  4. package/dist/js/components/src/components/BrowserOnly/BrowserOnly.mjs +2 -8
  5. package/dist/js/components/src/components/BrowserOnly/BrowserOnly.mjs.map +1 -1
  6. package/dist/js/components/src/components/CheckboxGroup/CheckboxGroup.mjs +32 -20
  7. package/dist/js/components/src/components/CheckboxGroup/CheckboxGroup.mjs.map +1 -1
  8. package/dist/js/components/src/components/ComboBox/ComboBox.mjs +5 -1
  9. package/dist/js/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
  10. package/dist/js/components/src/components/DatePicker/DatePicker.mjs +6 -2
  11. package/dist/js/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
  12. package/dist/js/components/src/components/DateRangePicker/DateRangePicker.mjs +5 -1
  13. package/dist/js/components/src/components/DateRangePicker/DateRangePicker.mjs.map +1 -1
  14. package/dist/js/components/src/components/FileField/FileField.mjs +3 -2
  15. package/dist/js/components/src/components/FileField/FileField.mjs.map +1 -1
  16. package/dist/js/components/src/components/FileField/components/FileInput.mjs +1 -1
  17. package/dist/js/components/src/components/FileField/components/FileInput.mjs.map +1 -1
  18. package/dist/js/components/src/components/FileField/components/FileInput.module.scss.mjs +3 -1
  19. package/dist/js/components/src/components/FileField/components/FileInput.module.scss.mjs.map +1 -1
  20. package/dist/js/components/src/components/List/components/Header/components/SearchField/SearchField.mjs +2 -7
  21. package/dist/js/components/src/components/List/components/Header/components/SearchField/SearchField.mjs.map +1 -1
  22. package/dist/js/components/src/components/List/hooks/useAriaAnnounceSearchState.mjs +3 -5
  23. package/dist/js/components/src/components/List/hooks/useAriaAnnounceSearchState.mjs.map +1 -1
  24. package/dist/js/components/src/components/Options/Options.mjs +0 -3
  25. package/dist/js/components/src/components/Options/Options.mjs.map +1 -1
  26. package/dist/js/components/src/components/RadioGroup/RadioGroup.mjs +6 -6
  27. package/dist/js/components/src/components/RadioGroup/RadioGroup.mjs.map +1 -1
  28. package/dist/js/components/src/components/SegmentedControl/SegmentedControl.mjs +6 -1
  29. package/dist/js/components/src/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  30. package/dist/js/components/src/components/Select/Select.mjs +21 -6
  31. package/dist/js/components/src/components/Select/Select.mjs.map +1 -1
  32. package/dist/js/components/src/components/Slider/Slider.mjs +81 -60
  33. package/dist/js/components/src/components/Slider/Slider.mjs.map +1 -1
  34. package/dist/js/components/src/components/Switch/Switch.mjs +40 -7
  35. package/dist/js/components/src/components/Switch/Switch.mjs.map +1 -1
  36. package/dist/js/components/src/components/Table/components/TableCell/TableCell.mjs.map +1 -1
  37. package/dist/js/components/src/components/TimeField/TimeField.mjs +6 -1
  38. package/dist/js/components/src/components/TimeField/TimeField.mjs.map +1 -1
  39. package/dist/js/components/src/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.mjs +5 -1
  40. package/dist/js/components/src/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.mjs.map +1 -1
  41. package/dist/js/components/src/lib/getContainerBreakpointSizeClassName.mjs.map +1 -1
  42. package/dist/js/components/src/lib/hooks/dom/useMakeFocusable.mjs +28 -0
  43. package/dist/js/components/src/lib/hooks/dom/useMakeFocusable.mjs.map +1 -0
  44. package/dist/js/components/src/lib/hooks/useProps.mjs +5 -10
  45. package/dist/js/components/src/lib/hooks/useProps.mjs.map +1 -1
  46. package/dist/js/components/src/lib/propsContext/components/ClearPropsContext.mjs +0 -9
  47. package/dist/js/components/src/lib/propsContext/components/ClearPropsContext.mjs.map +1 -1
  48. package/dist/js/components/src/lib/propsContext/components/ComponentPropsContextProvider.mjs +0 -1
  49. package/dist/js/components/src/lib/propsContext/components/ComponentPropsContextProvider.mjs.map +1 -1
  50. package/dist/js/components/src/lib/propsContext/mergePropsContext.mjs +0 -11
  51. package/dist/js/components/src/lib/propsContext/mergePropsContext.mjs.map +1 -1
  52. package/dist/js/components/src/lib/propsContext/nestedPropsContext/lib.mjs.map +1 -1
  53. package/dist/js/components/src/views/AvatarView.mjs.map +1 -1
  54. package/dist/js/components/src/views/BadgeView.mjs.map +1 -1
  55. package/dist/js/components/src/views/ButtonView.mjs.map +1 -1
  56. package/dist/js/components/src/views/ClearPropsContextView.mjs.map +1 -1
  57. package/dist/js/components/src/views/ComponentPropsContextProviderView.mjs.map +1 -1
  58. package/dist/js/components/src/views/ContextMenuContentView.mjs +0 -4
  59. package/dist/js/components/src/views/ContextMenuContentView.mjs.map +1 -1
  60. package/dist/js/components/src/views/ContextMenuSectionView.mjs +0 -4
  61. package/dist/js/components/src/views/ContextMenuSectionView.mjs.map +1 -1
  62. package/dist/js/components/src/views/ContextMenuTriggerView.mjs +0 -4
  63. package/dist/js/components/src/views/ContextMenuTriggerView.mjs.map +1 -1
  64. package/dist/js/components/src/views/ContextMenuView.mjs +0 -4
  65. package/dist/js/components/src/views/ContextMenuView.mjs.map +1 -1
  66. package/dist/js/components/src/views/DialogTriggerView.mjs +0 -5
  67. package/dist/js/components/src/views/DialogTriggerView.mjs.map +1 -1
  68. package/dist/js/components/src/views/DivView.mjs.map +1 -1
  69. package/dist/js/components/src/views/FieldErrorView.mjs.map +1 -1
  70. package/dist/js/components/src/views/HeadingView.mjs.map +1 -1
  71. package/dist/js/components/src/views/IconView.mjs.map +1 -1
  72. package/dist/js/components/src/views/ItemsGridListItemView.mjs +0 -19
  73. package/dist/js/components/src/views/ItemsGridListItemView.mjs.map +1 -1
  74. package/dist/js/components/src/views/ItemsGridListView.mjs +0 -19
  75. package/dist/js/components/src/views/ItemsGridListView.mjs.map +1 -1
  76. package/dist/js/components/src/views/ListEmptyViewView.mjs +0 -17
  77. package/dist/js/components/src/views/ListEmptyViewView.mjs.map +1 -1
  78. package/dist/js/components/src/views/ListItemViewContentView.mjs +0 -17
  79. package/dist/js/components/src/views/ListItemViewContentView.mjs.map +1 -1
  80. package/dist/js/components/src/views/MenuItemView.mjs.map +1 -1
  81. package/dist/js/components/src/views/MenuTriggerView.mjs +0 -5
  82. package/dist/js/components/src/views/MenuTriggerView.mjs.map +1 -1
  83. package/dist/js/components/src/views/OptionView.mjs.map +1 -1
  84. package/dist/js/components/src/views/OverlayContentView.mjs +0 -4
  85. package/dist/js/components/src/views/OverlayContentView.mjs.map +1 -1
  86. package/dist/js/components/src/views/PopoverContentView.mjs +0 -2
  87. package/dist/js/components/src/views/PopoverContentView.mjs.map +1 -1
  88. package/dist/js/components/src/views/SearchFieldView.mjs.map +1 -1
  89. package/dist/js/components/src/views/SeparatorView.mjs.map +1 -1
  90. package/dist/js/components/src/views/SkeletonTextView.mjs.map +1 -1
  91. package/dist/js/components/src/views/SkeletonView.mjs.map +1 -1
  92. package/dist/js/components/src/views/TableBodyView.mjs +0 -4
  93. package/dist/js/components/src/views/TableBodyView.mjs.map +1 -1
  94. package/dist/js/components/src/views/TableCellView.mjs +0 -4
  95. package/dist/js/components/src/views/TableCellView.mjs.map +1 -1
  96. package/dist/js/components/src/views/TableColumnView.mjs +0 -2
  97. package/dist/js/components/src/views/TableColumnView.mjs.map +1 -1
  98. package/dist/js/components/src/views/TableHeaderView.mjs +0 -4
  99. package/dist/js/components/src/views/TableHeaderView.mjs.map +1 -1
  100. package/dist/js/components/src/views/TableRowView.mjs +0 -4
  101. package/dist/js/components/src/views/TableRowView.mjs.map +1 -1
  102. package/dist/js/components/src/views/TableView.mjs +0 -4
  103. package/dist/js/components/src/views/TableView.mjs.map +1 -1
  104. package/dist/js/components/src/views/TextView.mjs.map +1 -1
  105. package/dist/js/components/src/views/TooltipTriggerView.mjs +0 -3
  106. package/dist/js/components/src/views/TooltipTriggerView.mjs.map +1 -1
  107. package/dist/js/components/src/views/TooltipView.mjs +0 -1
  108. package/dist/js/components/src/views/TooltipView.mjs.map +1 -1
  109. package/dist/js/flr-universal.mjs +2 -5
  110. package/dist/js/flr-universal.mjs.map +1 -1
  111. package/dist/types/components/CheckboxButton/stories/Default.stories.d.ts.map +1 -1
  112. package/dist/types/components/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
  113. package/dist/types/components/ComboBox/ComboBox.d.ts.map +1 -1
  114. package/dist/types/components/DatePicker/DatePicker.d.ts.map +1 -1
  115. package/dist/types/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  116. package/dist/types/components/FileField/FileField.d.ts.map +1 -1
  117. package/dist/types/components/FileField/stories/Default.stories.d.ts +0 -1
  118. package/dist/types/components/FileField/stories/Default.stories.d.ts.map +1 -1
  119. package/dist/types/components/MarkdownEditor/stories/Default.stories.d.ts +0 -1
  120. package/dist/types/components/MarkdownEditor/stories/Default.stories.d.ts.map +1 -1
  121. package/dist/types/components/PasswordCreationField/stories/Default.stories.d.ts +0 -1
  122. package/dist/types/components/PasswordCreationField/stories/Default.stories.d.ts.map +1 -1
  123. package/dist/types/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  124. package/dist/types/components/SegmentedControl/SegmentedControl.d.ts +2 -2
  125. package/dist/types/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  126. package/dist/types/components/Select/Select.d.ts +1 -3
  127. package/dist/types/components/Select/Select.d.ts.map +1 -1
  128. package/dist/types/components/Slider/Slider.d.ts +3 -3
  129. package/dist/types/components/Slider/Slider.d.ts.map +1 -1
  130. package/dist/types/components/Switch/Switch.d.ts.map +1 -1
  131. package/dist/types/components/TextField/stories/Default.stories.d.ts +0 -1
  132. package/dist/types/components/TextField/stories/Default.stories.d.ts.map +1 -1
  133. package/dist/types/components/TimeField/TimeField.d.ts.map +1 -1
  134. package/dist/types/integrations/react-hook-form/components/Field/stories/Autocomplete.stories.d.ts +1 -0
  135. package/dist/types/integrations/react-hook-form/components/Field/stories/Autocomplete.stories.d.ts.map +1 -1
  136. package/dist/types/integrations/react-hook-form/components/Field/stories/Checkbox.stories.d.ts +1 -0
  137. package/dist/types/integrations/react-hook-form/components/Field/stories/Checkbox.stories.d.ts.map +1 -1
  138. package/dist/types/integrations/react-hook-form/components/Field/stories/CheckboxGroup.stories.d.ts +1 -0
  139. package/dist/types/integrations/react-hook-form/components/Field/stories/CheckboxGroup.stories.d.ts.map +1 -1
  140. package/dist/types/integrations/react-hook-form/components/Field/stories/ComboBox.stories.d.ts +1 -0
  141. package/dist/types/integrations/react-hook-form/components/Field/stories/ComboBox.stories.d.ts.map +1 -1
  142. package/dist/types/integrations/react-hook-form/components/Field/stories/DatePicker.stories.d.ts +1 -0
  143. package/dist/types/integrations/react-hook-form/components/Field/stories/DatePicker.stories.d.ts.map +1 -1
  144. package/dist/types/integrations/react-hook-form/components/Field/stories/DateRangePicker.stories.d.ts +1 -0
  145. package/dist/types/integrations/react-hook-form/components/Field/stories/DateRangePicker.stories.d.ts.map +1 -1
  146. package/dist/types/integrations/react-hook-form/components/Field/stories/FileField.stories.d.ts +8 -0
  147. package/dist/types/integrations/react-hook-form/components/Field/stories/FileField.stories.d.ts.map +1 -0
  148. package/dist/types/integrations/react-hook-form/components/Field/stories/MarkdownEditor.stories.d.ts +8 -0
  149. package/dist/types/integrations/react-hook-form/components/Field/stories/MarkdownEditor.stories.d.ts.map +1 -0
  150. package/dist/types/integrations/react-hook-form/components/Field/stories/NumberField.stories.d.ts +1 -0
  151. package/dist/types/integrations/react-hook-form/components/Field/stories/NumberField.stories.d.ts.map +1 -1
  152. package/dist/types/integrations/react-hook-form/components/Field/stories/PasswordCreationField.stories.d.ts +9 -0
  153. package/dist/types/integrations/react-hook-form/components/Field/stories/PasswordCreationField.stories.d.ts.map +1 -0
  154. package/dist/types/integrations/react-hook-form/components/Field/stories/RadioGroup.stories.d.ts +1 -0
  155. package/dist/types/integrations/react-hook-form/components/Field/stories/RadioGroup.stories.d.ts.map +1 -1
  156. package/dist/types/integrations/react-hook-form/components/Field/stories/SearchField.stories.d.ts +8 -0
  157. package/dist/types/integrations/react-hook-form/components/Field/stories/SearchField.stories.d.ts.map +1 -0
  158. package/dist/types/integrations/react-hook-form/components/Field/stories/SegmentedControl.stories.d.ts +8 -0
  159. package/dist/types/integrations/react-hook-form/components/Field/stories/SegmentedControl.stories.d.ts.map +1 -0
  160. package/dist/types/integrations/react-hook-form/components/Field/stories/Select.stories.d.ts +1 -0
  161. package/dist/types/integrations/react-hook-form/components/Field/stories/Select.stories.d.ts.map +1 -1
  162. package/dist/types/integrations/react-hook-form/components/Field/stories/Slider.stories.d.ts +1 -0
  163. package/dist/types/integrations/react-hook-form/components/Field/stories/Slider.stories.d.ts.map +1 -1
  164. package/dist/types/integrations/react-hook-form/components/Field/stories/Switch.stories.d.ts +8 -0
  165. package/dist/types/integrations/react-hook-form/components/Field/stories/Switch.stories.d.ts.map +1 -0
  166. package/dist/types/integrations/react-hook-form/components/Field/stories/TextArea.stories.d.ts +1 -0
  167. package/dist/types/integrations/react-hook-form/components/Field/stories/TextArea.stories.d.ts.map +1 -1
  168. package/dist/types/integrations/react-hook-form/components/Field/stories/TextField.stories.d.ts +1 -0
  169. package/dist/types/integrations/react-hook-form/components/Field/stories/TextField.stories.d.ts.map +1 -1
  170. package/dist/types/integrations/react-hook-form/components/Field/stories/TimeField.stories.d.ts +1 -0
  171. package/dist/types/integrations/react-hook-form/components/Field/stories/TimeField.stories.d.ts.map +1 -1
  172. package/dist/types/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.d.ts.map +1 -1
  173. package/dist/types/lib/getContainerBreakpointSizeClassName.d.ts.map +1 -1
  174. package/dist/types/lib/hooks/dom/useMakeFocusable.d.ts +7 -0
  175. package/dist/types/lib/hooks/dom/useMakeFocusable.d.ts.map +1 -0
  176. package/dist/types/lib/hooks/useProps.d.ts.map +1 -1
  177. package/dist/types/lib/propsContext/components/ComponentPropsContextProvider.d.ts +1 -1
  178. package/dist/types/lib/propsContext/components/ComponentPropsContextProvider.d.ts.map +1 -1
  179. package/dist/types/lib/propsContext/nestedPropsContext/lib.d.ts +1 -1
  180. package/dist/types/lib/propsContext/nestedPropsContext/lib.d.ts.map +1 -1
  181. package/dist/types/views/AccentBoxView.d.ts +1 -1
  182. package/dist/types/views/AccentBoxView.d.ts.map +1 -1
  183. package/dist/types/views/AccordionView.d.ts +1 -1
  184. package/dist/types/views/AccordionView.d.ts.map +1 -1
  185. package/dist/types/views/ActionGroupView.d.ts +1 -1
  186. package/dist/types/views/ActionGroupView.d.ts.map +1 -1
  187. package/dist/types/views/AlertBadgeView.d.ts +1 -1
  188. package/dist/types/views/AlertBadgeView.d.ts.map +1 -1
  189. package/dist/types/views/AlertIconView.d.ts +1 -1
  190. package/dist/types/views/AlertIconView.d.ts.map +1 -1
  191. package/dist/types/views/AlertView.d.ts +1 -1
  192. package/dist/types/views/AlertView.d.ts.map +1 -1
  193. package/dist/types/views/AlignView.d.ts +1 -1
  194. package/dist/types/views/AlignView.d.ts.map +1 -1
  195. package/dist/types/views/AreaView.d.ts +1 -1
  196. package/dist/types/views/AreaView.d.ts.map +1 -1
  197. package/dist/types/views/AutocompleteView.d.ts +1 -1
  198. package/dist/types/views/AutocompleteView.d.ts.map +1 -1
  199. package/dist/types/views/AvatarStackView.d.ts +1 -1
  200. package/dist/types/views/AvatarStackView.d.ts.map +1 -1
  201. package/dist/types/views/AvatarView.d.ts +1 -1
  202. package/dist/types/views/AvatarView.d.ts.map +1 -1
  203. package/dist/types/views/BadgeView.d.ts +1 -1
  204. package/dist/types/views/BadgeView.d.ts.map +1 -1
  205. package/dist/types/views/BigNumberView.d.ts +1 -1
  206. package/dist/types/views/BigNumberView.d.ts.map +1 -1
  207. package/dist/types/views/BreadcrumbView.d.ts +1 -1
  208. package/dist/types/views/BreadcrumbView.d.ts.map +1 -1
  209. package/dist/types/views/ButtonView.d.ts +1 -1
  210. package/dist/types/views/ButtonView.d.ts.map +1 -1
  211. package/dist/types/views/CartesianChartView.d.ts +1 -1
  212. package/dist/types/views/CartesianChartView.d.ts.map +1 -1
  213. package/dist/types/views/CartesianGridView.d.ts +1 -1
  214. package/dist/types/views/CartesianGridView.d.ts.map +1 -1
  215. package/dist/types/views/ChartLegendView.d.ts +1 -1
  216. package/dist/types/views/ChartLegendView.d.ts.map +1 -1
  217. package/dist/types/views/ChartTooltipView.d.ts +1 -1
  218. package/dist/types/views/ChartTooltipView.d.ts.map +1 -1
  219. package/dist/types/views/ChatView.d.ts +1 -1
  220. package/dist/types/views/ChatView.d.ts.map +1 -1
  221. package/dist/types/views/CheckboxButtonView.d.ts +1 -1
  222. package/dist/types/views/CheckboxButtonView.d.ts.map +1 -1
  223. package/dist/types/views/CheckboxGroupView.d.ts +1 -1
  224. package/dist/types/views/CheckboxGroupView.d.ts.map +1 -1
  225. package/dist/types/views/CheckboxView.d.ts +1 -1
  226. package/dist/types/views/CheckboxView.d.ts.map +1 -1
  227. package/dist/types/views/ClearPropsContextView.d.ts +1 -1
  228. package/dist/types/views/ClearPropsContextView.d.ts.map +1 -1
  229. package/dist/types/views/CodeBlockView.d.ts +1 -1
  230. package/dist/types/views/CodeBlockView.d.ts.map +1 -1
  231. package/dist/types/views/ColorView.d.ts +1 -1
  232. package/dist/types/views/ColorView.d.ts.map +1 -1
  233. package/dist/types/views/ColumnLayoutView.d.ts +1 -1
  234. package/dist/types/views/ColumnLayoutView.d.ts.map +1 -1
  235. package/dist/types/views/ComboBoxView.d.ts +1 -1
  236. package/dist/types/views/ComboBoxView.d.ts.map +1 -1
  237. package/dist/types/views/ComponentPropsContextProviderView.d.ts +1 -1
  238. package/dist/types/views/ComponentPropsContextProviderView.d.ts.map +1 -1
  239. package/dist/types/views/ContentView.d.ts +1 -1
  240. package/dist/types/views/ContentView.d.ts.map +1 -1
  241. package/dist/types/views/ContextMenuContentView.d.ts +1 -1
  242. package/dist/types/views/ContextMenuContentView.d.ts.map +1 -1
  243. package/dist/types/views/ContextMenuSectionView.d.ts +1 -1
  244. package/dist/types/views/ContextMenuSectionView.d.ts.map +1 -1
  245. package/dist/types/views/ContextMenuTriggerView.d.ts +1 -1
  246. package/dist/types/views/ContextMenuTriggerView.d.ts.map +1 -1
  247. package/dist/types/views/ContextMenuView.d.ts +1 -1
  248. package/dist/types/views/ContextMenuView.d.ts.map +1 -1
  249. package/dist/types/views/ContextualHelpTriggerView.d.ts +1 -1
  250. package/dist/types/views/ContextualHelpTriggerView.d.ts.map +1 -1
  251. package/dist/types/views/ContextualHelpView.d.ts +1 -1
  252. package/dist/types/views/ContextualHelpView.d.ts.map +1 -1
  253. package/dist/types/views/CopyButtonView.d.ts +1 -1
  254. package/dist/types/views/CopyButtonView.d.ts.map +1 -1
  255. package/dist/types/views/CounterBadgeView.d.ts +1 -1
  256. package/dist/types/views/CounterBadgeView.d.ts.map +1 -1
  257. package/dist/types/views/DatePickerView.d.ts +1 -1
  258. package/dist/types/views/DatePickerView.d.ts.map +1 -1
  259. package/dist/types/views/DateRangePickerView.d.ts +1 -1
  260. package/dist/types/views/DateRangePickerView.d.ts.map +1 -1
  261. package/dist/types/views/DialogTriggerView.d.ts +1 -1
  262. package/dist/types/views/DialogTriggerView.d.ts.map +1 -1
  263. package/dist/types/views/DivView.d.ts +1 -1
  264. package/dist/types/views/DivView.d.ts.map +1 -1
  265. package/dist/types/views/DonutChartView.d.ts +1 -1
  266. package/dist/types/views/DonutChartView.d.ts.map +1 -1
  267. package/dist/types/views/FieldDescriptionView.d.ts +1 -1
  268. package/dist/types/views/FieldDescriptionView.d.ts.map +1 -1
  269. package/dist/types/views/FieldErrorView.d.ts +1 -1
  270. package/dist/types/views/FieldErrorView.d.ts.map +1 -1
  271. package/dist/types/views/FileCardListView.d.ts +1 -1
  272. package/dist/types/views/FileCardListView.d.ts.map +1 -1
  273. package/dist/types/views/FileCardView.d.ts +1 -1
  274. package/dist/types/views/FileCardView.d.ts.map +1 -1
  275. package/dist/types/views/FileDropZoneView.d.ts +1 -1
  276. package/dist/types/views/FileDropZoneView.d.ts.map +1 -1
  277. package/dist/types/views/FileFieldView.d.ts +1 -1
  278. package/dist/types/views/FileFieldView.d.ts.map +1 -1
  279. package/dist/types/views/FlexView.d.ts +1 -1
  280. package/dist/types/views/FlexView.d.ts.map +1 -1
  281. package/dist/types/views/HeaderNavigationView.d.ts +1 -1
  282. package/dist/types/views/HeaderNavigationView.d.ts.map +1 -1
  283. package/dist/types/views/HeaderView.d.ts +1 -1
  284. package/dist/types/views/HeaderView.d.ts.map +1 -1
  285. package/dist/types/views/HeadingView.d.ts +1 -1
  286. package/dist/types/views/HeadingView.d.ts.map +1 -1
  287. package/dist/types/views/IconView.d.ts +1 -1
  288. package/dist/types/views/IconView.d.ts.map +1 -1
  289. package/dist/types/views/IllustratedMessageView.d.ts +1 -1
  290. package/dist/types/views/IllustratedMessageView.d.ts.map +1 -1
  291. package/dist/types/views/ImageView.d.ts +1 -1
  292. package/dist/types/views/ImageView.d.ts.map +1 -1
  293. package/dist/types/views/InitialsView.d.ts +1 -1
  294. package/dist/types/views/InitialsView.d.ts.map +1 -1
  295. package/dist/types/views/InlineCodeView.d.ts +1 -1
  296. package/dist/types/views/InlineCodeView.d.ts.map +1 -1
  297. package/dist/types/views/ItemsGridListItemView.d.ts +1 -1
  298. package/dist/types/views/ItemsGridListItemView.d.ts.map +1 -1
  299. package/dist/types/views/ItemsGridListView.d.ts +1 -1
  300. package/dist/types/views/ItemsGridListView.d.ts.map +1 -1
  301. package/dist/types/views/LabelView.d.ts +1 -1
  302. package/dist/types/views/LabelView.d.ts.map +1 -1
  303. package/dist/types/views/LabeledValueView.d.ts +1 -1
  304. package/dist/types/views/LabeledValueView.d.ts.map +1 -1
  305. package/dist/types/views/LayoutCardView.d.ts +1 -1
  306. package/dist/types/views/LayoutCardView.d.ts.map +1 -1
  307. package/dist/types/views/LegendView.d.ts +1 -1
  308. package/dist/types/views/LegendView.d.ts.map +1 -1
  309. package/dist/types/views/LineView.d.ts +1 -1
  310. package/dist/types/views/LineView.d.ts.map +1 -1
  311. package/dist/types/views/LinkView.d.ts +1 -1
  312. package/dist/types/views/LinkView.d.ts.map +1 -1
  313. package/dist/types/views/ListEmptyViewView.d.ts +1 -1
  314. package/dist/types/views/ListEmptyViewView.d.ts.map +1 -1
  315. package/dist/types/views/ListItemViewContentView.d.ts +1 -1
  316. package/dist/types/views/ListItemViewContentView.d.ts.map +1 -1
  317. package/dist/types/views/ListSummaryView.d.ts +1 -1
  318. package/dist/types/views/ListSummaryView.d.ts.map +1 -1
  319. package/dist/types/views/LoadingSpinnerView.d.ts +1 -1
  320. package/dist/types/views/LoadingSpinnerView.d.ts.map +1 -1
  321. package/dist/types/views/MarkdownEditorView.d.ts +1 -1
  322. package/dist/types/views/MarkdownEditorView.d.ts.map +1 -1
  323. package/dist/types/views/MarkdownView.d.ts +1 -1
  324. package/dist/types/views/MarkdownView.d.ts.map +1 -1
  325. package/dist/types/views/MenuItemView.d.ts +1 -1
  326. package/dist/types/views/MenuItemView.d.ts.map +1 -1
  327. package/dist/types/views/MenuTriggerView.d.ts +1 -1
  328. package/dist/types/views/MenuTriggerView.d.ts.map +1 -1
  329. package/dist/types/views/MessageSeparatorView.d.ts +1 -1
  330. package/dist/types/views/MessageSeparatorView.d.ts.map +1 -1
  331. package/dist/types/views/MessageThreadView.d.ts +1 -1
  332. package/dist/types/views/MessageThreadView.d.ts.map +1 -1
  333. package/dist/types/views/MessageView.d.ts +1 -1
  334. package/dist/types/views/MessageView.d.ts.map +1 -1
  335. package/dist/types/views/NavigationGroupView.d.ts +1 -1
  336. package/dist/types/views/NavigationGroupView.d.ts.map +1 -1
  337. package/dist/types/views/NavigationView.d.ts +1 -1
  338. package/dist/types/views/NavigationView.d.ts.map +1 -1
  339. package/dist/types/views/NotificationView.d.ts +1 -1
  340. package/dist/types/views/NotificationView.d.ts.map +1 -1
  341. package/dist/types/views/NumberFieldView.d.ts +1 -1
  342. package/dist/types/views/NumberFieldView.d.ts.map +1 -1
  343. package/dist/types/views/OptionView.d.ts +1 -1
  344. package/dist/types/views/OptionView.d.ts.map +1 -1
  345. package/dist/types/views/OverlayContentView.d.ts +1 -1
  346. package/dist/types/views/OverlayContentView.d.ts.map +1 -1
  347. package/dist/types/views/PasswordCreationFieldView.d.ts +1 -1
  348. package/dist/types/views/PasswordCreationFieldView.d.ts.map +1 -1
  349. package/dist/types/views/PopoverContentView.d.ts +1 -1
  350. package/dist/types/views/PopoverContentView.d.ts.map +1 -1
  351. package/dist/types/views/ProgressBarView.d.ts +1 -1
  352. package/dist/types/views/ProgressBarView.d.ts.map +1 -1
  353. package/dist/types/views/RadioButtonView.d.ts +1 -1
  354. package/dist/types/views/RadioButtonView.d.ts.map +1 -1
  355. package/dist/types/views/RadioGroupView.d.ts +1 -1
  356. package/dist/types/views/RadioGroupView.d.ts.map +1 -1
  357. package/dist/types/views/RadioView.d.ts +1 -1
  358. package/dist/types/views/RadioView.d.ts.map +1 -1
  359. package/dist/types/views/RatingView.d.ts +1 -1
  360. package/dist/types/views/RatingView.d.ts.map +1 -1
  361. package/dist/types/views/SearchFieldView.d.ts +1 -1
  362. package/dist/types/views/SearchFieldView.d.ts.map +1 -1
  363. package/dist/types/views/SectionView.d.ts +1 -1
  364. package/dist/types/views/SectionView.d.ts.map +1 -1
  365. package/dist/types/views/SegmentView.d.ts +1 -1
  366. package/dist/types/views/SegmentView.d.ts.map +1 -1
  367. package/dist/types/views/SegmentedControlView.d.ts +1 -1
  368. package/dist/types/views/SegmentedControlView.d.ts.map +1 -1
  369. package/dist/types/views/SelectView.d.ts +1 -1
  370. package/dist/types/views/SelectView.d.ts.map +1 -1
  371. package/dist/types/views/SeparatorView.d.ts +1 -1
  372. package/dist/types/views/SeparatorView.d.ts.map +1 -1
  373. package/dist/types/views/SkeletonTextView.d.ts +1 -1
  374. package/dist/types/views/SkeletonTextView.d.ts.map +1 -1
  375. package/dist/types/views/SkeletonView.d.ts +1 -1
  376. package/dist/types/views/SkeletonView.d.ts.map +1 -1
  377. package/dist/types/views/SliderView.d.ts +1 -1
  378. package/dist/types/views/SliderView.d.ts.map +1 -1
  379. package/dist/types/views/SwitchView.d.ts +1 -1
  380. package/dist/types/views/SwitchView.d.ts.map +1 -1
  381. package/dist/types/views/TabTitleView.d.ts +1 -1
  382. package/dist/types/views/TabTitleView.d.ts.map +1 -1
  383. package/dist/types/views/TabView.d.ts +1 -1
  384. package/dist/types/views/TabView.d.ts.map +1 -1
  385. package/dist/types/views/TableBodyView.d.ts +1 -1
  386. package/dist/types/views/TableBodyView.d.ts.map +1 -1
  387. package/dist/types/views/TableCellView.d.ts +1 -1
  388. package/dist/types/views/TableCellView.d.ts.map +1 -1
  389. package/dist/types/views/TableColumnView.d.ts +1 -1
  390. package/dist/types/views/TableColumnView.d.ts.map +1 -1
  391. package/dist/types/views/TableFooterRowView.d.ts +1 -1
  392. package/dist/types/views/TableFooterRowView.d.ts.map +1 -1
  393. package/dist/types/views/TableHeaderView.d.ts +1 -1
  394. package/dist/types/views/TableHeaderView.d.ts.map +1 -1
  395. package/dist/types/views/TableRowView.d.ts +1 -1
  396. package/dist/types/views/TableRowView.d.ts.map +1 -1
  397. package/dist/types/views/TableView.d.ts +1 -1
  398. package/dist/types/views/TableView.d.ts.map +1 -1
  399. package/dist/types/views/TabsView.d.ts +1 -1
  400. package/dist/types/views/TabsView.d.ts.map +1 -1
  401. package/dist/types/views/TextAreaView.d.ts +1 -1
  402. package/dist/types/views/TextAreaView.d.ts.map +1 -1
  403. package/dist/types/views/TextFieldView.d.ts +1 -1
  404. package/dist/types/views/TextFieldView.d.ts.map +1 -1
  405. package/dist/types/views/TextView.d.ts +1 -1
  406. package/dist/types/views/TextView.d.ts.map +1 -1
  407. package/dist/types/views/TimeFieldView.d.ts +1 -1
  408. package/dist/types/views/TimeFieldView.d.ts.map +1 -1
  409. package/dist/types/views/TooltipTriggerView.d.ts +1 -1
  410. package/dist/types/views/TooltipTriggerView.d.ts.map +1 -1
  411. package/dist/types/views/TooltipView.d.ts +1 -1
  412. package/dist/types/views/TooltipView.d.ts.map +1 -1
  413. package/dist/types/views/TunnelEntryView.d.ts +1 -1
  414. package/dist/types/views/TunnelEntryView.d.ts.map +1 -1
  415. package/dist/types/views/XAxisView.d.ts +1 -1
  416. package/dist/types/views/XAxisView.d.ts.map +1 -1
  417. package/dist/types/views/YAxisView.d.ts +1 -1
  418. package/dist/types/views/YAxisView.d.ts.map +1 -1
  419. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.mjs","sources":["../../../../../../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["import {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithContainerBreakpointSize } from \"@/lib/types/props\";\nimport type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport styles from \"./SegmentedControl.module.scss\";\nimport { getContainerBreakpointSizeClassName } from \"@/lib/getContainerBreakpointSizeClassName\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport { FieldError } from \"@/components/FieldError\";\nimport clsx from \"clsx\";\n\nexport interface SegmentedControlProps\n extends PropsWithChildren<Omit<Aria.RadioGroupProps, \"children\">>,\n FlowComponentProps,\n PropsWithContainerBreakpointSize {}\n\n/** @flr-generate all */\nexport const SegmentedControl = flowComponent(\"SegmentedControl\", (props) => {\n const {\n children,\n className,\n containerBreakpointSize = \"m\",\n ref,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n formFieldStyles.formField,\n styles.segmentedControlContainer,\n className,\n styles[getContainerBreakpointSizeClassName(containerBreakpointSize)],\n );\n\n const propsContext: PropsContext = {\n Label: {\n className: formFieldStyles.label,\n },\n FieldDescription: {\n className: formFieldStyles.fieldDescription,\n tunnelId: \"fieldDescription\",\n },\n FieldError: {\n className: formFieldStyles.customFieldError,\n tunnelId: \"fieldError\",\n },\n Segment: {\n tunnelId: \"segments\",\n className: styles.segment,\n },\n };\n\n return (\n <Aria.RadioGroup {...rest} className={rootClassName} ref={ref}>\n <PropsContextProvider dependencies={[\"segment\"]} props={propsContext}>\n <TunnelProvider>\n {children}\n\n <div className={styles.segmentedControl}>\n <div className={styles.segments}>\n <TunnelExit id=\"segments\" />\n </div>\n </div>\n\n <TunnelExit id=\"fieldDescription\" />\n <TunnelExit id=\"fieldError\" />\n </TunnelProvider>\n </PropsContextProvider>\n <FieldError className={formFieldStyles.fieldError} />\n </Aria.RadioGroup>\n );\n});\n\nexport default SegmentedControl;\n"],"names":[],"mappings":";;;;;;;;;;;;AAsBO,MAAM,gBAAmB,GAAA,aAAA,CAAc,kBAAoB,EAAA,CAAC,KAAU,KAAA;AAC3E,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,uBAA0B,GAAA,GAAA;AAAA,IAC1B,GAAA;AAAA,IACA,GAAG;AAAA,GACD,GAAA,KAAA;AAEJ,EAAA,MAAM,aAAgB,GAAA,IAAA;AAAA,IACpB,eAAgB,CAAA,SAAA;AAAA,IAChB,MAAO,CAAA,yBAAA;AAAA,IACP,SAAA;AAAA,IACA,MAAA,CAAO,mCAAoC,CAAA,uBAAuB,CAAC;AAAA,GACrE;AAEA,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,KAAO,EAAA;AAAA,MACL,WAAW,eAAgB,CAAA;AAAA,KAC7B;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,WAAW,eAAgB,CAAA,gBAAA;AAAA,MAC3B,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,UAAY,EAAA;AAAA,MACV,WAAW,eAAgB,CAAA,gBAAA;AAAA,MAC3B,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,OAAS,EAAA;AAAA,MACP,QAAU,EAAA,UAAA;AAAA,MACV,WAAW,MAAO,CAAA;AAAA;AACpB,GACF;AAEA,EACE,uBAAA,IAAA,CAAC,KAAK,UAAL,EAAA,EAAiB,GAAG,IAAM,EAAA,SAAA,EAAW,eAAe,GACnD,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,oBAAA,EAAA,EAAqB,cAAc,CAAC,SAAS,GAAG,KAAO,EAAA,YAAA,EACtD,+BAAC,cACE,EAAA,EAAA,QAAA,EAAA;AAAA,MAAA,QAAA;AAAA,sBAEA,GAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,MAAA,CAAO,kBACrB,QAAC,kBAAA,GAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,MAAA,CAAO,UACrB,QAAC,kBAAA,GAAA,CAAA,UAAA,EAAA,EAAW,EAAG,EAAA,UAAA,EAAW,GAC5B,CACF,EAAA,CAAA;AAAA,sBAEA,GAAA,CAAC,UAAW,EAAA,EAAA,EAAA,EAAG,kBAAmB,EAAA,CAAA;AAAA,sBAClC,GAAA,CAAC,UAAW,EAAA,EAAA,EAAA,EAAG,YAAa,EAAA;AAAA,KAAA,EAC9B,CACF,EAAA,CAAA;AAAA,oBACC,GAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,eAAA,CAAgB,UAAY,EAAA;AAAA,GACrD,EAAA,CAAA;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"SegmentedControl.mjs","sources":["../../../../../../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["import {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithContainerBreakpointSize } from \"@/lib/types/props\";\nimport React, { type PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport styles from \"./SegmentedControl.module.scss\";\nimport { getContainerBreakpointSizeClassName } from \"@/lib/getContainerBreakpointSizeClassName\";\nimport { type PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport { FieldError } from \"@/components/FieldError\";\nimport clsx from \"clsx\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\n\nexport interface SegmentedControlProps\n extends PropsWithChildren<Omit<Aria.RadioGroupProps, \"children\">>,\n FlowComponentProps,\n PropsWithContainerBreakpointSize {}\n\n/** @flr-generate all */\nexport const SegmentedControl = flowComponent(\"SegmentedControl\", (props) => {\n const {\n children,\n className,\n containerBreakpointSize = \"m\",\n ref,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n formFieldStyles.formField,\n styles.segmentedControlContainer,\n className,\n styles[getContainerBreakpointSizeClassName(containerBreakpointSize)],\n );\n\n const propsContext: PropsContext = {\n Label: {\n className: formFieldStyles.label,\n },\n FieldDescription: {\n className: formFieldStyles.fieldDescription,\n tunnelId: \"fieldDescription\",\n },\n FieldError: {\n className: formFieldStyles.customFieldError,\n tunnelId: \"fieldError\",\n },\n Segment: {\n tunnelId: \"segments\",\n className: styles.segment,\n },\n };\n\n const localRadioRef = useObjectRef(ref);\n useMakeFocusable(localRadioRef);\n\n return (\n <Aria.RadioGroup {...rest} className={rootClassName} ref={localRadioRef}>\n <PropsContextProvider dependencies={[\"segment\"]} props={propsContext}>\n <TunnelProvider>\n {children}\n\n <div className={styles.segmentedControl}>\n <div className={styles.segments}>\n <TunnelExit id=\"segments\" />\n </div>\n </div>\n\n <TunnelExit id=\"fieldDescription\" />\n <TunnelExit id=\"fieldError\" />\n </TunnelProvider>\n </PropsContextProvider>\n <FieldError className={formFieldStyles.fieldError} />\n </Aria.RadioGroup>\n );\n});\n\nexport default SegmentedControl;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAwBO,MAAM,gBAAmB,GAAA,aAAA,CAAc,kBAAoB,EAAA,CAAC,KAAU,KAAA;AAC3E,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,uBAA0B,GAAA,GAAA;AAAA,IAC1B,GAAA;AAAA,IACA,GAAG;AAAA,GACD,GAAA,KAAA;AAEJ,EAAA,MAAM,a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AA,CAAA;AAAA,sBAClC,GAAA,CAAC,UAAW,EAAA,EAAA,EAAA,EAAG,YAAa,EAAA;AAAA,KAAA,EAC9B,CACF,EAAA,CAAA;AAAA,oBACC,GAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,eAAA,CAAgB,UAAY,EAAA;AAAA,GACrD,EAAA,CAAA;AAEJ,CAAC;;;;"}
@@ -1,6 +1,7 @@
1
1
  "use client"
2
2
  /* */
3
3
  import { jsx, jsxs } from 'react/jsx-runtime';
4
+ import { useRef } from 'react';
4
5
  import * as Aria from 'react-aria-components';
5
6
  import '../../lib/propsContext/propsContext.mjs';
6
7
  import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
@@ -8,7 +9,6 @@ import formFieldStyles from '../FormField/FormField.module.scss.mjs';
8
9
  import { FieldError } from '../FieldError/FieldError.mjs';
9
10
  import styles from './Select.module.scss.mjs';
10
11
  import clsx from 'clsx';
11
- import 'react';
12
12
  import '@tabler/icons-react';
13
13
  import '../Icon/Icon.mjs';
14
14
  import '../../views/IconView.mjs';
@@ -18,6 +18,8 @@ import { Options } from '../Options/Options.mjs';
18
18
  import { TunnelProvider, TunnelExit } from '@mittwald/react-tunnel';
19
19
  import 'mobx';
20
20
  import { useOverlayController } from '../../lib/controller/overlay/useOverlayController.mjs';
21
+ import { useObjectRef } from '@react-aria/utils';
22
+ import { useMakeFocusable } from '../../lib/hooks/dom/useMakeFocusable.mjs';
21
23
 
22
24
  const Select = flowComponent("Select", (props) => {
23
25
  const {
@@ -59,6 +61,11 @@ const Select = flowComponent("Select", (props) => {
59
61
  const controllerFromContext = useOverlayController("Select", {
60
62
  reuseControllerFromContext: true
61
63
  });
64
+ const localSelectRef = useObjectRef(ref);
65
+ const localButtonRef = useRef(null);
66
+ useMakeFocusable(localSelectRef, () => {
67
+ localButtonRef.current?.focus();
68
+ });
62
69
  const controller = controllerFromProps ?? controllerFromContext;
63
70
  const isOpen = controller.useIsOpen();
64
71
  return /* @__PURE__ */ jsx(
@@ -66,16 +73,24 @@ const Select = flowComponent("Select", (props) => {
66
73
  {
67
74
  ...rest,
68
75
  className: rootClassName,
69
- ref,
76
+ ref: localSelectRef,
70
77
  onSelectionChange: isReadOnly ? void 0 : handleOnSelectionChange,
71
78
  onOpenChange: (isOpen2) => !isReadOnly && controller.setOpen(isOpen2),
72
79
  isOpen,
73
80
  "data-readonly": isReadOnly,
74
81
  children: /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, children: /* @__PURE__ */ jsxs(TunnelProvider, { children: [
75
- /* @__PURE__ */ jsxs(Aria.Button, { "data-readonly": isReadOnly, className: styles.toggle, children: [
76
- /* @__PURE__ */ jsx(Aria.SelectValue, {}),
77
- /* @__PURE__ */ jsx(IconChevronDown, {})
78
- ] }),
82
+ /* @__PURE__ */ jsxs(
83
+ Aria.Button,
84
+ {
85
+ ref: localButtonRef,
86
+ "data-readonly": isReadOnly,
87
+ className: styles.toggle,
88
+ children: [
89
+ /* @__PURE__ */ jsx(Aria.SelectValue, {}),
90
+ /* @__PURE__ */ jsx(IconChevronDown, {})
91
+ ]
92
+ }
93
+ ),
79
94
  children,
80
95
  /* @__PURE__ */ jsx(Options, { controller, children: /* @__PURE__ */ jsx(TunnelExit, { id: "options" }) }),
81
96
  /* @__PURE__ */ jsx(FieldError, { className: formFieldStyles.fieldError })
@@ -1 +1 @@
1
- {"version":3,"file":"Select.mjs","sources":["../../../../../../src/components/Select/Select.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport * as Aria from \"react-aria-components\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport { FieldError } from \"@/components/FieldError\";\nimport styles from \"./Select.module.scss\";\nimport clsx from \"clsx\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { Options } from \"@/components/Options\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { type OverlayController, useOverlayController } from \"@/lib/controller\";\n\nexport interface SelectProps\n extends PropsWithChildren<\n Omit<Aria.SelectProps<{ example: string }>, \"children\" | \"className\">\n >,\n FlowComponentProps,\n PropsWithClassName {\n /** Handler that is called when the selected value changes. */\n onChange?: (value: string | number) => void;\n /** An overlay controller to control the select option popover state. */\n controller?: OverlayController;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const Select = flowComponent(\"Select\", (props) => {\n const {\n children,\n className,\n onChange = () => {\n // default: do nothing\n },\n onSelectionChange = () => {\n // default: do nothing\n },\n controller: controllerFromProps,\n ref,\n isReadOnly,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.select,\n formFieldStyles.formField,\n className,\n );\n\n const propsContext: PropsContext = {\n Label: {\n className: formFieldStyles.label,\n optional: !props.isRequired,\n },\n FieldDescription: {\n className: formFieldStyles.fieldDescription,\n },\n FieldError: {\n className: formFieldStyles.customFieldError,\n },\n Option: {\n tunnelId: \"options\",\n },\n };\n\n const handleOnSelectionChange = (id: Key | null) => {\n onChange(String(id));\n onSelectionChange(id);\n };\n\n const controllerFromContext = useOverlayController(\"Select\", {\n reuseControllerFromContext: true,\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n\n const isOpen = controller.useIsOpen();\n\n return (\n <Aria.Select\n {...rest}\n className={rootClassName}\n ref={ref}\n onSelectionChange={isReadOnly ? undefined : handleOnSelectionChange}\n onOpenChange={(isOpen) => !isReadOnly && controller.setOpen(isOpen)}\n isOpen={isOpen}\n data-readonly={isReadOnly}\n >\n <PropsContextProvider props={propsContext}>\n <TunnelProvider>\n <Aria.Button data-readonly={isReadOnly} className={styles.toggle}>\n <Aria.SelectValue />\n <IconChevronDown />\n </Aria.Button>\n\n {children}\n <Options controller={controller}>\n <TunnelExit id=\"options\" />\n </Options>\n\n <FieldError className={formFieldStyles.fieldError} />\n </TunnelProvider>\n </PropsContextProvider>\n </Aria.Select>\n );\n});\n\nexport default Select;\n"],"names":["isOpen"],"mappings":";;;;;;;;;;;;;;;;;;;AAgCO,MAAM,MAAS,GAAA,aAAA,CAAc,QAAU,EAAA,CAAC,KAAU,KAAA;AACvD,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAW,MAAM;AAAA,KAEjB;AAAA,IACA,oBAAoB,MAAM;AAAA,KAE1B;AAAA,IACA,UAAY,EAAA,mBAAA;AAAA,IACZ,GAAA;AAAA,IACA,UAAA;AAAA,IACA,GAAG;AAAA,GACD,GAAA,KAAA;AAEJ,EAAA,MAAM,aAAgB,GAAA,IAAA;AAAA,IACpB,MAAO,CAAA,MAAA;AAAA,IACP,eAAgB,CAAA,SAAA;AAAA,IAChB;AAAA,GACF;AAEA,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,KAAO,EAAA;AAAA,MACL,WAAW,eAAgB,CAAA,KAAA;AAAA,MAC3B,QAAA,EAAU,CAAC,KAAM,CAAA;AAAA,KACnB;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,WAAW,eAAgB,CAAA;AAAA,KAC7B;AAAA,IACA,UAAY,EAAA;AAAA,MACV,WAAW,eAAgB,CAAA;AAAA,KAC7B;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA;AAAA;AACZ,GACF;AAEA,EAAM,MAAA,uBAAA,GAA0B,CAAC,EAAmB,KAAA;AAClD,IAAS,QAAA,CAAA,MAAA,CAAO,EAAE,CAAC,CAAA;AACnB,IAAA,iBAAA,CAAkB,EAAE,CAAA;AAAA,GACtB;AAEA,EAAM,MAAA,qBAAA,GAAwB,qBAAqB,QAAU,EAAA;AAAA,IAC3D,0BAA4B,EAAA;AAAA,GAC7B,CAAA;AAED,EAAA,MAAM,aAAa,mBAAuB,IAAA,qBAAA;AAE1C,EAAM,MAAA,MAAA,GAAS,WAAW,SAAU,EAAA;AAEpC,EACE,uBAAA,GAAA;AAAA,IAAC,IAAK,CAAA,MAAA;AAAA,IAAL;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,SAAW,EAAA,aAAA;AAAA,MACX,GAAA;AAAA,MACA,iBAAA,EAAmB,aAAa,MAAY,GAAA,uBAAA;AAAA,MAC5C,cAAc,CAACA,OAAAA,KAAW,CAAC,UAAc,IAAA,UAAA,CAAW,QAAQA,OAAM,CAAA;AAAA,MAClE,MAAA;AAAA,MACA,eAAe,EAAA,UAAA;AAAA,MAEf,QAAC,kBAAA,GAAA,CAAA,oBAAA,EAAA,EAAqB,KAAO,EAAA,YAAA,EAC3B,+BAAC,cACC,EAAA,EAAA,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,KAAK,MAAL,EAAA,EAAY,iBAAe,UAAY,EAAA,SAAA,EAAW,OAAO,MACxD,EAAA,QAAA,EAAA;AAAA,0BAAC,GAAA,CAAA,IAAA,CAAK,aAAL,EAAiB,CAAA;AAAA,8BACjB,eAAgB,EAAA,EAAA;AAAA,SACnB,EAAA,CAAA;AAAA,QAEC,QAAA;AAAA,4BACA,OAAQ,EAAA,EAAA,UAAA,EACP,8BAAC,UAAW,EAAA,EAAA,EAAA,EAAG,WAAU,CAC3B,EAAA,CAAA;AAAA,wBAEC,GAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,eAAA,CAAgB,UAAY,EAAA;AAAA,OAAA,EACrD,CACF,EAAA;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"Select.mjs","sources":["../../../../../../src/components/Select/Select.tsx"],"sourcesContent":["import { type PropsWithChildren, useRef } from \"react\";\nimport type { Key } from \"react-aria-components\";\nimport * as Aria from \"react-aria-components\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport { FieldError } from \"@/components/FieldError\";\nimport styles from \"./Select.module.scss\";\nimport clsx from \"clsx\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { Options } from \"@/components/Options\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { type OverlayController, useOverlayController } from \"@/lib/controller\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\n\nexport interface SelectProps\n extends PropsWithChildren<Omit<Aria.SelectProps, \"children\" | \"className\">>,\n FlowComponentProps,\n PropsWithClassName {\n /** Handler that is called when the selected value changes. */\n onChange?: (value: string | number) => void;\n /** An overlay controller to control the select option popover state. */\n controller?: OverlayController;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const Select = flowComponent(\"Select\", (props) => {\n const {\n children,\n className,\n onChange = () => {\n // default: do nothing\n },\n onSelectionChange = () => {\n // default: do nothing\n },\n controller: controllerFromProps,\n ref,\n isReadOnly,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.select,\n formFieldStyles.formField,\n className,\n );\n\n const propsContext: PropsContext = {\n Label: {\n className: formFieldStyles.label,\n optional: !props.isRequired,\n },\n FieldDescription: {\n className: formFieldStyles.fieldDescription,\n },\n FieldError: {\n className: formFieldStyles.customFieldError,\n },\n Option: {\n tunnelId: \"options\",\n },\n };\n\n const handleOnSelectionChange = (id: Key | null) => {\n onChange(String(id));\n onSelectionChange(id);\n };\n\n const controllerFromContext = useOverlayController(\"Select\", {\n reuseControllerFromContext: true,\n });\n\n const localSelectRef = useObjectRef(ref);\n const localButtonRef = useRef<HTMLButtonElement>(null);\n\n useMakeFocusable(localSelectRef, () => {\n localButtonRef.current?.focus();\n });\n\n const controller = controllerFromProps ?? controllerFromContext;\n const isOpen = controller.useIsOpen();\n\n return (\n <Aria.Select\n {...rest}\n className={rootClassName}\n ref={localSelectRef}\n onSelectionChange={isReadOnly ? undefined : handleOnSelectionChange}\n onOpenChange={(isOpen) => !isReadOnly && controller.setOpen(isOpen)}\n isOpen={isOpen}\n data-readonly={isReadOnly}\n >\n <PropsContextProvider props={propsContext}>\n <TunnelProvider>\n <Aria.Button\n ref={localButtonRef}\n data-readonly={isReadOnly}\n className={styles.toggle}\n >\n <Aria.SelectValue />\n <IconChevronDown />\n </Aria.Button>\n\n {children}\n <Options controller={controller}>\n <TunnelExit id=\"options\" />\n </Options>\n\n <FieldError className={formFieldStyles.fieldError} />\n </TunnelProvider>\n </PropsContextProvider>\n </Aria.Select>\n );\n});\n\nexport default Select;\n"],"names":["isOpen"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgCO,MAAM,MAAS,GAAA,aAAA,CAAc,QAAU,EAAA,CAAC,KAAU,KAAA;AACvD,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAW,MAAM;AAAA,KAEjB;AAAA,IACA,oBAAoB,MAAM;AAAA,KAE1B;AAAA,IACA,UAAY,EAAA,mBAAA;AAAA,IACZ,GAAA;AAAA,IACA,UAAA;AAAA,IACA,GAAG;AAAA,GACD,GAAA,KAAA;AAEJ,EAAA,MAAM,aAAgB,GAAA,IAAA;AAAA,IACpB,MAAO,CAAA,MAAA;AAAA,IACP,eAAgB,CAAA,SAAA;AAAA,IAChB;AAAA,GACF;AAEA,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,KAAO,EAAA;AAAA,MACL,WAAW,eAAgB,CAAA,KAAA;AAAA,MAC3B,QAAA,EAAU,CAAC,KAAM,CAAA;AAAA,KACnB;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,WAAW,eAAgB,CAAA;AAAA,KAC7B;AAAA,IACA,UAAY,EAAA;AAAA,M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f,WAAW,MAAO,CAAA,MAAA;AAAA,YAElB,QAAA,EAAA;AAAA,8BAAC,GAAA,CAAA,IAAA,CAAK,aAAL,EAAiB,CAAA;AAAA,kCACjB,eAAgB,EAAA,EAAA;AAAA;AAAA;AAAA,SACnB;AAAA,QAEC,QAAA;AAAA,4BACA,OAAQ,EAAA,EAAA,UAAA,EACP,8BAAC,UAAW,EAAA,EAAA,EAAA,EAAG,WAAU,CAC3B,EAAA,CAAA;AAAA,wBAEC,GAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,eAAA,CAAgB,UAAY,EAAA;AAAA,OAAA,EACrD,CACF,EAAA;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
@@ -1,6 +1,7 @@
1
1
  "use client"
2
2
  /* */
3
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+ import { jsx, jsxs } from 'react/jsx-runtime';
4
+ import 'react';
4
5
  import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
5
6
  import * as Aria from 'react-aria-components';
6
7
  import clsx from 'clsx';
@@ -8,7 +9,6 @@ import styles from './Slider.module.scss.mjs';
8
9
  import '../../lib/propsContext/propsContext.mjs';
9
10
  import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
10
11
  import { Button } from '../Button/Button.mjs';
11
- import 'react';
12
12
  import '@tabler/icons-react';
13
13
  import '../Icon/Icon.mjs';
14
14
  import '../../views/IconView.mjs';
@@ -16,6 +16,9 @@ import { IconMinus } from '../Icon/components/icons/IconMinus.mjs';
16
16
  import { IconPlus } from '../Icon/components/icons/IconPlus.mjs';
17
17
  import locales from '../../../../_virtual/_.locale.json@3ed2dc50f997451bdd85a713c54e1025.mjs';
18
18
  import { useLocalizedStringFormatter } from 'react-aria';
19
+ import { TunnelExit } from '@mittwald/react-tunnel';
20
+ import { useObjectRef } from '@react-aria/utils';
21
+ import { useMakeFocusable } from '../../lib/hooks/dom/useMakeFocusable.mjs';
19
22
 
20
23
  const Slider = flowComponent("Slider", (props) => {
21
24
  const {
@@ -26,6 +29,8 @@ const Slider = flowComponent("Slider", (props) => {
26
29
  defaultValue,
27
30
  showInitialMarker,
28
31
  isReadOnly,
32
+ ref,
33
+ inputRef,
29
34
  ...rest
30
35
  } = props;
31
36
  const rootClassName = clsx(
@@ -34,80 +39,96 @@ const Slider = flowComponent("Slider", (props) => {
34
39
  className
35
40
  );
36
41
  const stringFormatter = useLocalizedStringFormatter(locales);
42
+ const localSliderRef = useObjectRef(ref);
43
+ const localInputRef = useObjectRef(inputRef);
44
+ useMakeFocusable(localSliderRef, () => {
45
+ localInputRef.current?.focus();
46
+ });
37
47
  const propsContext = {
38
48
  Label: {
39
- unstyled: true
49
+ unstyled: true,
50
+ tunnelId: "label"
40
51
  }
41
52
  };
42
- return /* @__PURE__ */ jsxs(
53
+ return /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, children: /* @__PURE__ */ jsxs(
43
54
  Aria.Slider,
44
55
  {
56
+ ...rest,
57
+ ref: localSliderRef,
45
58
  className: rootClassName,
46
59
  isDisabled,
47
60
  defaultValue,
48
- ...rest,
49
61
  children: [
50
62
  /* @__PURE__ */ jsxs("div", { className: styles.text, children: [
51
63
  /* @__PURE__ */ jsx(Aria.SliderOutput, { className: styles.value }),
52
- /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, children })
64
+ /* @__PURE__ */ jsx(TunnelExit, { id: "label" })
53
65
  ] }),
54
- /* @__PURE__ */ jsx(Aria.SliderTrack, { className: styles.track, children: ({ state }) => /* @__PURE__ */ jsxs(Fragment, { children: [
55
- /* @__PURE__ */ jsx(
56
- Button,
57
- {
58
- onPress: () => state.decrementThumb(0),
59
- "aria-label": stringFormatter.format("slider.decrement"),
60
- variant: "plain",
61
- color: "secondary",
62
- className: styles.decrement,
63
- isDisabled,
64
- excludeFromTabOrder: true,
65
- isReadOnly,
66
- children: /* @__PURE__ */ jsx(IconMinus, {})
67
- }
68
- ),
69
- /* @__PURE__ */ jsx(
70
- Button,
71
- {
72
- onPress: () => state.incrementThumb(0),
73
- "aria-label": stringFormatter.format("slider.increment"),
74
- variant: "plain",
75
- color: "secondary",
76
- className: styles.increment,
77
- isDisabled,
78
- excludeFromTabOrder: true,
79
- isReadOnly,
80
- children: /* @__PURE__ */ jsx(IconPlus, {})
81
- }
82
- ),
83
- /* @__PURE__ */ jsx(
84
- "div",
85
- {
86
- className: styles.fill,
87
- style: { width: state.getThumbPercent(0) * 100 + "%" }
88
- }
89
- ),
90
- showInitialMarker && defaultValue && typeof defaultValue === "number" && /* @__PURE__ */ jsx(
91
- "div",
92
- {
93
- className: styles.initialMarker,
94
- style: {
95
- left: `calc(${state.getValuePercent(defaultValue) * 100}% - 2px)`
66
+ /* @__PURE__ */ jsx(Aria.SliderTrack, { className: styles.track, children: ({ state }) => /* @__PURE__ */ jsxs(
67
+ PropsContextProvider,
68
+ {
69
+ props: {
70
+ Button: {
71
+ isPending: false,
72
+ isFailed: false,
73
+ isSucceeded: false,
74
+ isReadOnly,
75
+ excludeFromTabOrder: true,
76
+ isDisabled,
77
+ variant: "plain",
78
+ color: "secondary"
96
79
  }
97
- }
98
- ),
99
- /* @__PURE__ */ jsx(
100
- Aria.SliderThumb,
101
- {
102
- name,
103
- className: styles.handle,
104
- isDisabled: isReadOnly
105
- }
106
- )
107
- ] }) })
80
+ },
81
+ children: [
82
+ /* @__PURE__ */ jsx(
83
+ Button,
84
+ {
85
+ onPress: () => state.decrementThumb(0),
86
+ "aria-label": stringFormatter.format("slider.decrement"),
87
+ className: styles.decrement,
88
+ children: /* @__PURE__ */ jsx(IconMinus, {})
89
+ }
90
+ ),
91
+ /* @__PURE__ */ jsx(
92
+ Button,
93
+ {
94
+ onPress: () => state.incrementThumb(0),
95
+ "aria-label": stringFormatter.format("slider.increment"),
96
+ className: styles.increment,
97
+ children: /* @__PURE__ */ jsx(IconPlus, {})
98
+ }
99
+ ),
100
+ /* @__PURE__ */ jsx(
101
+ "div",
102
+ {
103
+ className: styles.fill,
104
+ style: { width: state.getThumbPercent(0) * 100 + "%" }
105
+ }
106
+ ),
107
+ showInitialMarker && defaultValue && typeof defaultValue === "number" && /* @__PURE__ */ jsx(
108
+ "div",
109
+ {
110
+ className: styles.initialMarker,
111
+ style: {
112
+ left: `calc(${state.getValuePercent(defaultValue) * 100}% - 2px)`
113
+ }
114
+ }
115
+ ),
116
+ /* @__PURE__ */ jsx(
117
+ Aria.SliderThumb,
118
+ {
119
+ inputRef: localInputRef,
120
+ name,
121
+ className: styles.handle,
122
+ isDisabled: isReadOnly
123
+ }
124
+ )
125
+ ]
126
+ }
127
+ ) }),
128
+ children
108
129
  ]
109
130
  }
110
- );
131
+ ) });
111
132
  });
112
133
 
113
134
  export { Slider, Slider as default };
@@ -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\";\n\nexport interface SliderProps\n extends FlowComponentProps<HTMLDivElement>,\n PropsWithChildren<Aria.SliderProps>,\n Pick<Aria.SliderThumbProps, \"name\"> {\n showInitialMarker?: boolean;\n /** Whether the component is read only. */\n isReadOnly?: 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 ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.slider,\n isDisabled && styles.disabled,\n className,\n );\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const propsContext: PropsContext = {\n Label: {\n unstyled: true,\n },\n };\n\n return (\n <Aria.Slider\n className={rootClassName}\n isDisabled={isDisabled}\n defaultValue={defaultValue}\n {...rest}\n >\n <div className={styles.text}>\n <Aria.SliderOutput className={styles.value} />\n\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </div>\n\n <Aria.SliderTrack className={styles.track}>\n {({ state }) => (\n <>\n <Button\n onPress={() => state.decrementThumb(0)}\n aria-label={stringFormatter.format(\"slider.decrement\")}\n variant=\"plain\"\n color=\"secondary\"\n className={styles.decrement}\n isDisabled={isDisabled}\n excludeFromTabOrder\n isReadOnly={isReadOnly}\n >\n <IconMinus />\n </Button>\n\n <Button\n onPress={() => state.incrementThumb(0)}\n aria-label={stringFormatter.format(\"slider.increment\")}\n variant=\"plain\"\n color=\"secondary\"\n className={styles.increment}\n isDisabled={isDisabled}\n excludeFromTabOrder\n isReadOnly={isReadOnly}\n >\n <IconPlus />\n </Button>\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\n <Aria.SliderThumb\n name={name}\n className={styles.handle}\n isDisabled={isReadOnly}\n />\n </>\n )}\n </Aria.SliderTrack>\n </Aria.Slider>\n );\n});\n\nexport default Slider;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuBO,MAAM,MAAS,GAAA,aAAA,CAAc,QAAU,EAAA,CAAC,KAAU,KAAA;AACvD,EAAM,MAAA;AAAA,IACJ,SAAA;AAAA,IACA,QAAA;AAAA,IACA,IAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,iBAAA;AAAA,IACA,UAAA;AAAA,IACA,GAAG;AAAA,GACD,GAAA,KAAA;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"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport React 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 } from \"@mittwald/react-tunnel\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\n\nexport interface SliderProps\n extends FlowComponentProps,\n PropsWithChildren<Aria.SliderProps>,\n Pick<Aria.SliderThumbProps, \"inputRef\" | \"name\"> {\n showInitialMarker?: boolean;\n /** Whether the component is read only. */\n isReadOnly?: 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 inputRef,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.slider,\n isDisabled && styles.disabled,\n className,\n );\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const localSliderRef = useObjectRef(ref);\n const localInputRef = useObjectRef(inputRef);\n\n useMakeFocusable(localSliderRef, () => {\n localInputRef.current?.focus();\n });\n\n const propsContext: PropsContext = {\n Label: {\n unstyled: true,\n tunnelId: \"label\",\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n <Aria.Slider\n {...rest}\n ref={localSliderRef}\n className={rootClassName}\n isDisabled={isDisabled}\n defaultValue={defaultValue}\n >\n <div className={styles.text}>\n <Aria.SliderOutput className={styles.value} />\n <TunnelExit id=\"label\" />\n </div>\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 <Button\n onPress={() => state.decrementThumb(0)}\n aria-label={stringFormatter.format(\"slider.decrement\")}\n className={styles.decrement}\n >\n <IconMinus />\n </Button>\n\n <Button\n onPress={() => state.incrementThumb(0)}\n aria-label={stringFormatter.format(\"slider.increment\")}\n className={styles.increment}\n >\n <IconPlus />\n </Button>\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\n <Aria.SliderThumb\n inputRef={localInputRef}\n name={name}\n className={styles.handle}\n isDisabled={isReadOnly}\n />\n </PropsContextProvider>\n )}\n </Aria.SliderTrack>\n {children}\n </Aria.Slider>\n </PropsContextProvider>\n );\n});\n\nexport default Slider;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,MAAS,GAAA,aAAA,CAAc,QAAU,EAAA,CAAC,KAAU,KAAA;AACvD,EAAM,MAAA;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,QAAA;AAAA,IACA,GAAG;AAAA,GACD,GAAA,KAAA;AAEJ,EAAA,MAAM,aAAgB,GAAA,IAAA;AAAA,IACpB,MAAO,CAAA,MAAA;AAAA,IACP,cAAc,MAAO,CAAA,QAAA;AAAA,IACrB;AAAA,GACF;AAEA,EAAM,MAAA,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAA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AA;AAAA,kBACV,IAAA;AAAA,kBACA,WAAW,MAAO,CAAA,MAAA;AAAA,kBAClB,UAAY,EAAA;AAAA;AAAA;AACd;AAAA;AAAA,SAGN,EAAA,CAAA;AAAA,QACC;AAAA;AAAA;AAAA,GAEL,EAAA,CAAA;AAEJ,CAAC;;;;"}
@@ -1,17 +1,21 @@
1
1
  "use client"
2
2
  /* */
3
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
+ import 'react';
4
5
  import * as Aria from 'react-aria-components';
5
6
  import styles from './Switch.module.scss.mjs';
6
7
  import clsx from 'clsx';
7
- import 'react';
8
8
  import '@tabler/icons-react';
9
9
  import '../Icon/Icon.mjs';
10
10
  import '../../views/IconView.mjs';
11
11
  import { IconCheck } from '../Icon/components/icons/IconCheck.mjs';
12
12
  import { IconClose } from '../Icon/components/icons/IconClose.mjs';
13
- import { Label } from '../Label/Label.mjs';
14
13
  import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
14
+ import '../../lib/propsContext/propsContext.mjs';
15
+ import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
16
+ import { TunnelExit } from '@mittwald/react-tunnel';
17
+ import { useObjectRef } from '@react-aria/utils';
18
+ import { useMakeFocusable } from '../../lib/hooks/dom/useMakeFocusable.mjs';
15
19
 
16
20
  const Switch = flowComponent("Switch", (props) => {
17
21
  const {
@@ -19,6 +23,7 @@ const Switch = flowComponent("Switch", (props) => {
19
23
  className,
20
24
  labelPosition = "trailing",
21
25
  ref,
26
+ inputRef,
22
27
  ...rest
23
28
  } = props;
24
29
  const rootClassName = clsx(
@@ -26,10 +31,38 @@ const Switch = flowComponent("Switch", (props) => {
26
31
  styles[`label-${labelPosition}`],
27
32
  className
28
33
  );
29
- return /* @__PURE__ */ jsx(Aria.Switch, { ...rest, className: rootClassName, ref, children: ({ isSelected }) => /* @__PURE__ */ jsxs(Fragment, { children: [
30
- /* @__PURE__ */ jsx("div", { className: styles.track, children: /* @__PURE__ */ jsx("div", { className: styles.handle, children: isSelected ? /* @__PURE__ */ jsx(IconCheck, { size: "s" }) : /* @__PURE__ */ jsx(IconClose, { size: "s" }) }) }),
31
- children && /* @__PURE__ */ jsx(Label, { className: styles.label, children })
32
- ] }) });
34
+ const localSwitchRef = useObjectRef(ref);
35
+ const localInputRef = useObjectRef(inputRef);
36
+ useMakeFocusable(localSwitchRef, () => {
37
+ localInputRef.current?.focus();
38
+ });
39
+ return /* @__PURE__ */ jsxs(
40
+ PropsContextProvider,
41
+ {
42
+ props: {
43
+ Label: {
44
+ tunnelId: "label",
45
+ className: styles.label
46
+ }
47
+ },
48
+ children: [
49
+ /* @__PURE__ */ jsx(
50
+ Aria.Switch,
51
+ {
52
+ ...rest,
53
+ className: rootClassName,
54
+ ref: localSwitchRef,
55
+ inputRef: localInputRef,
56
+ children: ({ isSelected }) => /* @__PURE__ */ jsxs(Fragment, { children: [
57
+ /* @__PURE__ */ jsx("div", { className: styles.track, children: /* @__PURE__ */ jsx("div", { className: styles.handle, children: isSelected ? /* @__PURE__ */ jsx(IconCheck, { size: "s" }) : /* @__PURE__ */ jsx(IconClose, { size: "s" }) }) }),
58
+ /* @__PURE__ */ jsx(TunnelExit, { id: "label" })
59
+ ] })
60
+ }
61
+ ),
62
+ children
63
+ ]
64
+ }
65
+ );
33
66
  });
34
67
 
35
68
  export { Switch, Switch as default };
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.mjs","sources":["../../../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Switch.module.scss\";\nimport clsx from \"clsx\";\nimport { IconCheck, IconClose } from \"@/components/Icon/components/icons\";\nimport { Label } from \"@/components/Label\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\n\nexport interface SwitchProps\n extends PropsWithChildren<Omit<Aria.SwitchProps, \"children\">>,\n FlowComponentProps<HTMLLabelElement> {\n /**\n * Whether the label should appear before or after the switch. @default\n * \"trailing\"\n */\n labelPosition?: \"leading\" | \"trailing\";\n}\n\n/** @flr-generate all */\nexport const Switch = flowComponent(\"Switch\", (props) => {\n const {\n children,\n className,\n labelPosition = \"trailing\",\n ref,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.switch,\n styles[`label-${labelPosition}`],\n className,\n );\n\n return (\n <Aria.Switch {...rest} className={rootClassName} ref={ref}>\n {({ isSelected }) => (\n <>\n <div className={styles.track}>\n <div className={styles.handle}>\n {isSelected ? <IconCheck size=\"s\" /> : <IconClose size=\"s\" />}\n </div>\n </div>\n {children && <Label className={styles.label}>{children}</Label>}\n </>\n )}\n </Aria.Switch>\n );\n});\n\nexport default Switch;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAoBO,MAAM,MAAS,GAAA,aAAA,CAAc,QAAU,EAAA,CAAC,KAAU,KAAA;AACvD,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,aAAgB,GAAA,UAAA;AAAA,IAChB,GAAA;AAAA,IACA,GAAG;AAAA,GACD,GAAA,KAAA;AAEJ,EAAA,MAAM,aAAgB,GAAA,IAAA;AAAA,IACpB,MAAO,CAAA,MAAA;AAAA,IACP,MAAA,CAAO,CAAS,MAAA,EAAA,aAAa,CAAE,CAAA,CAAA;AAAA,IAC/B;AAAA,GACF;AAEA,EAAA,uBACG,GAAA,CAAA,IAAA,CAAK,MAAL,EAAA,EAAa,GAAG,IAAA,EAAM,SAAW,EAAA,aAAA,EAAe,GAC9C,EAAA,QAAA,EAAA,CAAC,EAAE,UAAA,uBAEA,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,KAAA,EAAA,EAAI,WAAW,MAAO,CAAA,KAAA,EACrB,8BAAC,KAAI,EAAA,EAAA,SAAA,EAAW,OAAO,MACpB,EAAA,QAAA,EAAA,UAAA,uBAAc,SAAU,EAAA,EAAA,IAAA,EAAK,KAAI,CAAK,mBAAA,GAAA,CAAC,aAAU,IAAK,EAAA,GAAA,EAAI,GAC7D,CACF,EAAA,CAAA;AAAA,IACC,4BAAa,GAAA,CAAA,KAAA,EAAA,EAAM,SAAW,EAAA,MAAA,CAAO,OAAQ,QAAS,EAAA;AAAA,GAAA,EACzD,CAEJ,EAAA,CAAA;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"Switch.mjs","sources":["../../../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Switch.module.scss\";\nimport clsx from \"clsx\";\nimport { IconCheck, IconClose } from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { TunnelExit } from \"@mittwald/react-tunnel\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\n\nexport interface SwitchProps\n extends PropsWithChildren<Omit<Aria.SwitchProps, \"children\">>,\n FlowComponentProps<HTMLLabelElement> {\n /**\n * Whether the label should appear before or after the switch. @default\n * \"trailing\"\n */\n labelPosition?: \"leading\" | \"trailing\";\n}\n\n/** @flr-generate all */\nexport const Switch = flowComponent(\"Switch\", (props) => {\n const {\n children,\n className,\n labelPosition = \"trailing\",\n ref,\n inputRef,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.switch,\n styles[`label-${labelPosition}`],\n className,\n );\n\n const localSwitchRef = useObjectRef(ref);\n const localInputRef = useObjectRef(inputRef);\n\n useMakeFocusable(localSwitchRef, () => {\n localInputRef.current?.focus();\n });\n\n return (\n <PropsContextProvider\n props={{\n Label: {\n tunnelId: \"label\",\n className: styles.label,\n },\n }}\n >\n <Aria.Switch\n {...rest}\n className={rootClassName}\n ref={localSwitchRef}\n inputRef={localInputRef}\n >\n {({ isSelected }) => (\n <>\n <div className={styles.track}>\n <div className={styles.handle}>\n {isSelected ? <IconCheck size=\"s\" /> : <IconClose size=\"s\" />}\n </div>\n </div>\n <TunnelExit id=\"label\" />\n </>\n )}\n </Aria.Switch>\n {children}\n </PropsContextProvider>\n );\n});\n\nexport default Switch;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuBO,MAAM,MAAS,GAAA,aAAA,CAAc,QAAU,EAAA,CAAC,KAAU,KAAA;AACvD,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,aAAgB,GAAA,UAAA;AAAA,IAChB,GAAA;AAAA,IACA,QAAA;AAAA,IACA,GAAG;AAAA,GACD,GAAA,KAAA;AAEJ,EAAA,MAAM,aAAgB,GAAA,IAAA;AAAA,IACpB,MAAO,CAAA,MAAA;AAAA,IACP,MAAA,CAAO,CAAS,MAAA,EAAA,aAAa,CAAE,CAAA,CAAA;AAAA,IAC/B;AAAA,GACF;AAEA,EAAM,MAAA,cAAA,GAAiB,aAAa,GAAG,CAAA;AACvC,EAAM,MAAA,aAAA,GAAgB,aAAa,QAAQ,CAAA;AAE3C,EAAA,gBAAA,CAAiB,gBAAgB,MAAM;AACrC,IAAA,aAAA,CAAc,SAAS,KAAM,EAAA;AAAA,GAC9B,CAAA;AAED,EACE,uBAAA,IAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA;AAAA,QACL,KAAO,EAAA;AAAA,UACL,QAAU,EAAA,OAAA;AAAA,UACV,WAAW,MAAO,CAAA;AAAA;AACpB,OACF;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,IAAK,CAAA,MAAA;AAAA,UAAL;AAAA,YACE,GAAG,IAAA;AAAA,YACJ,SAAW,EAAA,aAAA;AAAA,YACX,GAAK,EAAA,cAAA;AAAA,YACL,QAAU,EAAA,aAAA;AAAA,YAET,QAAC,EAAA,CAAA,EAAE,UAAW,EAAA,qBAEX,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,8BAAC,GAAA,CAAA,KAAA,EAAA,EAAI,WAAW,MAAO,CAAA,KAAA,EACrB,8BAAC,KAAI,EAAA,EAAA,SAAA,EAAW,OAAO,MACpB,EAAA,QAAA,EAAA,UAAA,uBAAc,SAAU,EAAA,EAAA,IAAA,EAAK,KAAI,CAAK,mBAAA,GAAA,CAAC,aAAU,IAAK,EAAA,GAAA,EAAI,GAC7D,CACF,EAAA,CAAA;AAAA,8BACA,GAAA,CAAC,UAAW,EAAA,EAAA,EAAA,EAAG,OAAQ,EAAA;AAAA,aACzB,EAAA;AAAA;AAAA,SAEJ;AAAA,QACC;AAAA;AAAA;AAAA,GACH;AAEJ,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.mjs","sources":["../../../../../../../../src/components/Table/components/TableCell/TableCell.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport React, { Suspense } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"../../Table.module.scss\";\nimport { SkeletonText } from \"@/components/SkeletonText\";\nimport { TableColumn } from \"@/components/Table\";\n\nexport interface TableCellProps\n extends Omit<Aria.CellProps, \"children\" | \"style\">,\n PropsWithChildren {\n /** Use cell as row header */\n rowHeader?: boolean;\n /** Horizontal alignment of the cell content @default \"start\" */\n horizontalAlign?: \"start\" | \"center\" | \"end\";\n}\n\n/** @flr-generate all */\nexport const TableCell: FC<TableCellProps> = (props) => {\n const {\n children,\n className,\n rowHeader,\n horizontalAlign = \"start\",\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.cell,\n styles[`horizontal-align-${horizontalAlign}`],\n className,\n );\n\n const content = (\n <Suspense fallback={<SkeletonText width=\"100px\" />}>{children}</Suspense>\n );\n\n if (rowHeader) {\n return (\n <TableColumn className={rootClassName} {...rest}>\n {content}\n </TableColumn>\n );\n }\n\n return (\n <Aria.Cell className={rootClassName} {...rest}>\n {content}\n </Aria.Cell>\n );\n};\n\nexport default TableCell;\n"],"names":[],"mappings":";;;;;;;;AAkBa,MAAA,SAAA,GAAgC,CAAC,KAAU,KAAA;AACtD,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,SAAA;AAAA,IACA,eAAkB,GAAA,OAAA;AAAA,IAClB,GAAG;AAAA,GACD,GAAA,KAAA;AAEJ,EAAA,MAAM,aAAgB,GAAA,IAAA;AAAA,IACpB,MAAO,CAAA,IAAA;AAAA,IACP,MAAA,CAAO,CAAoB,iBAAA,EAAA,eAAe,CAAE,CAAA,CAAA;AAAA,IAC5C;AAAA,GACF;AAEA,EAAM,MAAA,OAAA,uBACH,QAAS,EAAA,EAAA,QAAA,sBAAW,YAAa,EAAA,EAAA,KAAA,EAAM,OAAQ,EAAA,CAAA,EAAK,QAAS,EAAA,CAAA;AAGhE,EAAA,IAAI,SAAW,EAAA;AACb,IAAA,2BACG,WAAY,EAAA,EAAA,SAAA,EAAW,aAAgB,EAAA,GAAG,MACxC,QACH,EAAA,OAAA,EAAA,CAAA;AAAA;AAIJ,EACE,uBAAA,GAAA,CAAC,KAAK,IAAL,EAAA,EAAU,WAAW,aAAgB,EAAA,GAAG,MACtC,QACH,EAAA,OAAA,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"TableCell.mjs","sources":["../../../../../../../../src/components/Table/components/TableCell/TableCell.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { Suspense } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"../../Table.module.scss\";\nimport { SkeletonText } from \"@/components/SkeletonText\";\nimport { TableColumn } from \"@/components/Table/components/TableColumn/TableColumn\";\n\nexport interface TableCellProps\n extends Omit<Aria.CellProps, \"children\" | \"style\">,\n PropsWithChildren {\n /** Use cell as row header */\n rowHeader?: boolean;\n /** Horizontal alignment of the cell content @default \"start\" */\n horizontalAlign?: \"start\" | \"center\" | \"end\";\n}\n\n/** @flr-generate all */\nexport const TableCell: FC<TableCellProps> = (props) => {\n const {\n children,\n className,\n rowHeader,\n horizontalAlign = \"start\",\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.cell,\n styles[`horizontal-align-${horizontalAlign}`],\n className,\n );\n\n const content = (\n <Suspense fallback={<SkeletonText width=\"100px\" />}>{children}</Suspense>\n );\n\n if (rowHeader) {\n return (\n <TableColumn className={rootClassName} {...rest}>\n {content}\n </TableColumn>\n );\n }\n\n return (\n <Aria.Cell className={rootClassName} {...rest}>\n {content}\n </Aria.Cell>\n );\n};\n\nexport default TableCell;\n"],"names":[],"mappings":";;;;;;;;AAkBa,MAAA,SAAA,GAAgC,CAAC,KAAU,KAAA;AACtD,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,SAAA;AAAA,IACA,eAAkB,GAAA,OAAA;AAAA,IAClB,GAAG;AAAA,GACD,GAAA,KAAA;AAEJ,EAAA,MAAM,aAAgB,GAAA,IAAA;AAAA,IACpB,MAAO,CAAA,IAAA;AAAA,IACP,MAAA,CAAO,CAAoB,iBAAA,EAAA,eAAe,CAAE,CAAA,CAAA;AAAA,IAC5C;AAAA,GACF;AAEA,EAAM,MAAA,OAAA,uBACH,QAAS,EAAA,EAAA,QAAA,sBAAW,YAAa,EAAA,EAAA,KAAA,EAAM,OAAQ,EAAA,CAAA,EAAK,QAAS,EAAA,CAAA;AAGhE,EAAA,IAAI,SAAW,EAAA;AACb,IAAA,2BACG,WAAY,EAAA,EAAA,SAAA,EAAW,aAAgB,EAAA,GAAG,MACxC,QACH,EAAA,OAAA,EAAA,CAAA;AAAA;AAIJ,EACE,uBAAA,GAAA,CAAC,KAAK,IAAL,EAAA,EAAU,WAAW,aAAgB,EAAA,GAAG,MACtC,QACH,EAAA,OAAA,EAAA,CAAA;AAEJ;;;;"}
@@ -1,6 +1,7 @@
1
1
  "use client"
2
2
  /* */
3
3
  import { jsxs, jsx } from 'react/jsx-runtime';
4
+ import 'react';
4
5
  import * as Aria from 'react-aria-components';
5
6
  import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
6
7
  import '../../lib/propsContext/propsContext.mjs';
@@ -9,6 +10,8 @@ import formFieldStyles from '../FormField/FormField.module.scss.mjs';
9
10
  import { FieldError } from '../FieldError/FieldError.mjs';
10
11
  import clsx from 'clsx';
11
12
  import styles from './TimeField.module.scss.mjs';
13
+ import { useMakeFocusable } from '../../lib/hooks/dom/useMakeFocusable.mjs';
14
+ import { useObjectRef } from '@react-aria/utils';
12
15
 
13
16
  const TimeField = flowComponent("TimeField", (props) => {
14
17
  const { children, errorMessage, className, ref, ...rest } = props;
@@ -26,10 +29,12 @@ const TimeField = flowComponent("TimeField", (props) => {
26
29
  className: formFieldStyles.customFieldError
27
30
  }
28
31
  };
32
+ const localRef = useObjectRef(ref);
33
+ useMakeFocusable(localRef);
29
34
  return /* @__PURE__ */ jsxs(
30
35
  Aria.TimeField,
31
36
  {
32
- ref,
37
+ ref: localRef,
33
38
  hourCycle: 24,
34
39
  className: rootClassName,
35
40
  ...rest,
@@ -1 +1 @@
1
- {"version":3,"file":"TimeField.mjs","sources":["../../../../../../src/components/TimeField/TimeField.tsx"],"sourcesContent":["import type { PropsWithChildren, ReactNode } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport { FieldError } from \"@/components/FieldError\";\nimport clsx from \"clsx\";\nimport styles from \"./TimeField.module.scss\";\n\nexport interface TimeFieldProps<T extends Aria.TimeValue = Aria.TimeValue>\n extends PropsWithChildren<Omit<Aria.TimeFieldProps<T>, \"children\">>,\n FlowComponentProps<HTMLInputElement> {\n /** An error message to be displayed below the field */\n errorMessage?: ReactNode;\n}\n\n/** @flr-generate all */\nexport const TimeField = flowComponent(\"TimeField\", (props) => {\n const { children, errorMessage, className, ref, ...rest } = props;\n\n const rootClassName = clsx(formFieldStyles.formField, className);\n\n const propsContext: PropsContext = {\n Label: {\n className: formFieldStyles.label,\n optional: !props.isRequired,\n isDisabled: rest.isDisabled,\n },\n FieldDescription: {\n className: formFieldStyles.fieldDescription,\n },\n FieldError: {\n className: formFieldStyles.customFieldError,\n },\n };\n\n return (\n <Aria.TimeField\n ref={ref}\n hourCycle={24}\n className={rootClassName}\n {...rest}\n >\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n <FieldError className={formFieldStyles.fieldError}>\n {errorMessage}\n </FieldError>\n <Aria.DateInput className={styles.dateInput}>\n {(segment) => <Aria.DateSegment segment={segment} />}\n </Aria.DateInput>\n </Aria.TimeField>\n );\n});\n\nexport default TimeField;\n"],"names":[],"mappings":";;;;;;;;;;AAqBO,MAAM,SAAY,GAAA,aAAA,CAAc,WAAa,EAAA,CAAC,KAAU,KAAA;AAC7D,EAAA,MAAM,EAAE,QAAU,EAAA,YAAA,EAAc,WAAW,GAAK,EAAA,GAAG,MAAS,GAAA,KAAA;AAE5D,EAAA,MAAM,aAAgB,GAAA,IAAA,CAAK,eAAgB,CAAA,SAAA,EAAW,SAAS,CAAA;AAE/D,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,KAAO,EAAA;AAAA,MACL,WAAW,eAAgB,CAAA,KAAA;AAAA,MAC3B,QAAA,EAAU,CAAC,KAAM,CAAA,UAAA;AAAA,MACjB,YAAY,IAAK,CAAA;AAAA,KACnB;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,WAAW,eAAgB,CAAA;AAAA,KAC7B;AAAA,IACA,UAAY,EAAA;AAAA,MACV,WAAW,eAAgB,CAAA;AAAA;AAC7B,GACF;AAEA,EACE,uBAAA,IAAA;AAAA,IAAC,IAAK,CAAA,SAAA;AAAA,IAAL;AAAA,MACC,GAAA;AAAA,MACA,SAAW,EAAA,EAAA;AAAA,MACX,SAAW,EAAA,aAAA;AAAA,MACV,GAAG,IAAA;AAAA,MAEJ,QAAA,EAAA;AAAA,wBAAC,GAAA,CAAA,oBAAA,EAAA,EAAqB,KAAO,EAAA,YAAA,EAC1B,QACH,EAAA,CAAA;AAAA,wBACC,GAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,eAAA,CAAgB,YACpC,QACH,EAAA,YAAA,EAAA,CAAA;AAAA,wBACC,GAAA,CAAA,IAAA,CAAK,SAAL,EAAA,EAAe,WAAW,MAAO,CAAA,SAAA,EAC/B,QAAC,EAAA,CAAA,OAAA,qBAAa,GAAA,CAAA,IAAA,CAAK,WAAL,EAAA,EAAiB,SAAkB,CACpD,EAAA;AAAA;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"TimeField.mjs","sources":["../../../../../../src/components/TimeField/TimeField.tsx"],"sourcesContent":["import { type PropsWithChildren, type ReactNode } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport { FieldError } from \"@/components/FieldError\";\nimport clsx from \"clsx\";\nimport styles from \"./TimeField.module.scss\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useObjectRef } from \"@react-aria/utils\";\n\nexport interface TimeFieldProps<T extends Aria.TimeValue = Aria.TimeValue>\n extends PropsWithChildren<Omit<Aria.TimeFieldProps<T>, \"children\">>,\n FlowComponentProps<HTMLInputElement> {\n /** An error message to be displayed below the field */\n errorMessage?: ReactNode;\n}\n\n/** @flr-generate all */\nexport const TimeField = flowComponent(\"TimeField\", (props) => {\n const { children, errorMessage, className, ref, ...rest } = props;\n\n const rootClassName = clsx(formFieldStyles.formField, className);\n\n const propsContext: PropsContext = {\n Label: {\n className: formFieldStyles.label,\n optional: !props.isRequired,\n isDisabled: rest.isDisabled,\n },\n FieldDescription: {\n className: formFieldStyles.fieldDescription,\n },\n FieldError: {\n className: formFieldStyles.customFieldError,\n },\n };\n\n const localRef = useObjectRef(ref);\n useMakeFocusable(localRef);\n\n return (\n <Aria.TimeField\n ref={localRef}\n hourCycle={24}\n className={rootClassName}\n {...rest}\n >\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n <FieldError className={formFieldStyles.fieldError}>\n {errorMessage}\n </FieldError>\n <Aria.DateInput className={styles.dateInput}>\n {(segment) => <Aria.DateSegment segment={segment} />}\n </Aria.DateInput>\n </Aria.TimeField>\n );\n});\n\nexport default TimeField;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAuBO,MAAM,SAAY,GAAA,aAAA,CAAc,WAAa,EAAA,CAAC,KAAU,KAAA;AAC7D,EAAA,MAAM,EAAE,QAAU,EAAA,YAAA,EAAc,WAAW,GAAK,EAAA,GAAG,MAAS,GAAA,KAAA;AAE5D,EAAA,MAAM,aAAgB,GAAA,IAAA,CAAK,eAAgB,CAAA,SAAA,EAAW,SAAS,CAAA;AAE/D,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,KAAO,EAAA;AAAA,MACL,WAAW,eAAgB,CAAA,KAAA;AAAA,MAC3B,QAAA,EAAU,CAAC,KAAM,CAAA,UAAA;AAAA,MACjB,YAAY,IAAK,CAAA;AAAA,KACnB;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,WAAW,eAAgB,CAAA;AAAA,KAC7B;AAAA,IACA,UAAY,EAAA;AAAA,MACV,WAAW,eAAgB,CAAA;AAAA;AAC7B,GACF;AAEA,EAAM,MAAA,QAAA,GAAW,aAAa,GAAG,CAAA;AACjC,EAAA,gBAAA,CAAiB,QAAQ,CAAA;AAEzB,EACE,uBAAA,IAAA;AAAA,IAAC,IAAK,CAAA,SAAA;AAAA,IAAL;AAAA,MACC,GAAK,EAAA,QAAA;AAAA,MACL,SAAW,EAAA,EAAA;AAAA,MACX,SAAW,EAAA,aAAA;AAAA,MACV,GAAG,IAAA;AAAA,MAEJ,QAAA,EAAA;AAAA,wBAAC,GAAA,CAAA,oBAAA,EAAA,EAAqB,KAAO,EAAA,YAAA,EAC1B,QACH,EAAA,CAAA;AAAA,wBACC,GAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,eAAA,CAAgB,YACpC,QACH,EAAA,YAAA,EAAA,CAAA;AAAA,wBACC,GAAA,CAAA,IAAA,CAAK,SAAL,EAAA,EAAe,WAAW,MAAO,CAAA,SAAA,EAC/B,QAAC,EAAA,CAAA,OAAA,qBAAa,GAAA,CAAA,IAAA,CAAK,WAAL,EAAA,EAAiB,SAAkB,CACpD,EAAA;AAAA;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
@@ -55,9 +55,13 @@ const useRegisterActionStateContext = (form) => {
55
55
  });
56
56
  }, [form.subscribe, action.state]);
57
57
  const registerSubmitResult = (result) => {
58
- submitHandlerResultRef.current = result;
59
58
  if (isPromise(result)) {
60
59
  void action.state.onAsyncStart();
60
+ result.then((submitResult) => {
61
+ submitHandlerResultRef.current = submitResult;
62
+ });
63
+ } else {
64
+ submitHandlerResultRef.current = result;
61
65
  }
62
66
  };
63
67
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"useRegisterActionStateContext.mjs","sources":["../../../../../../../../../src/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.ts"],"sourcesContent":["import { ActionModel } from \"@/components/Action/models/ActionModel\";\nimport { useEffect, useRef } from \"react\";\nimport { isPromise } from \"remeda\";\nimport type { FieldValues, UseFormReturn } from \"react-hook-form\";\n\nconst callAfterSubmitFunction = (result: unknown) => {\n const callFn = (something: unknown) => {\n if (typeof something === \"function\") {\n something();\n }\n };\n\n if (result instanceof Promise) {\n result.then(callFn);\n } else {\n callFn(result);\n }\n};\n\nexport const useRegisterActionStateContext = <T extends FieldValues>(\n form: UseFormReturn<T>,\n) => {\n const action = ActionModel.useNew({});\n const trackedSubmitCount = useRef(0);\n const submitHandlerResultRef = useRef<unknown>(null);\n\n useEffect(() => {\n return form.subscribe({\n formState: {\n errors: true,\n isValid: true,\n },\n callback: ({\n isValid,\n isSubmitted = false,\n isSubmitSuccessful = false,\n submitCount = 0,\n errors,\n }) => {\n if (submitCount === 0 && trackedSubmitCount.current > 0) {\n trackedSubmitCount.current = 0;\n }\n\n if (trackedSubmitCount.current === submitCount) {\n return;\n }\n trackedSubmitCount.current = submitCount;\n\n if (isSubmitted) {\n if (isSubmitSuccessful) {\n void action.state.onSucceeded();\n\n if (isValid) {\n callAfterSubmitFunction(submitHandlerResultRef.current);\n }\n } else {\n const hasFailedWithError =\n isSubmitted && errors && Object.entries(errors).length > 0\n ? errors\n : undefined;\n\n void action.state.onFailed(hasFailedWithError);\n }\n }\n },\n });\n }, [form.subscribe, action.state]);\n\n const registerSubmitResult = (result: unknown) => {\n submitHandlerResultRef.current = result;\n\n if (isPromise(result)) {\n void action.state.onAsyncStart();\n }\n };\n\n return {\n action,\n registerSubmitResult,\n } as const;\n};\n"],"names":[],"mappings":";;;;AAKA,MAAM,uBAAA,GAA0B,CAAC,MAAoB,KAAA;AACnD,EAAM,MAAA,MAAA,GAAS,CAAC,SAAuB,KAAA;AACrC,IAAI,IAAA,OAAO,cAAc,UAAY,EAAA;AACnC,MAAU,SAAA,EAAA;AAAA;AACZ,GACF;AAEA,EAAA,IAAI,kBAAkB,OAAS,EAAA;AAC7B,IAAA,MAAA,CAAO,KAAK,MAAM,CAAA;AAAA,GACb,MAAA;AACL,IAAA,MAAA,CAAO,MAAM,CAAA;AAAA;AAEjB,CAAA;AAEa,MAAA,6BAAA,GAAgC,CAC3C,IACG,KAAA;AACH,EAAA,MAAM,MAAS,GAAA,WAAA,CAAY,MAAO,CAAA,EAAE,CAAA;AACpC,EAAM,MAAA,kBAAA,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GAAA,MAAA;AAEjC,IAAI,IAAA,SAAA,CAAU,MAAM,CAAG,EAAA;AACrB,MAAK,KAAA,MAAA,CAAO,MAAM,YAAa,EAAA;AAAA;AACjC,GACF;AAEA,EAAO,OAAA;AAAA,IACL,MAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"useRegisterActionStateContext.mjs","sources":["../../../../../../../../../src/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext.ts"],"sourcesContent":["import { ActionModel } from \"@/components/Action/models/ActionModel\";\nimport { useEffect, useRef } from \"react\";\nimport { isPromise } from \"remeda\";\nimport type { FieldValues, UseFormReturn } from \"react-hook-form\";\n\nconst callAfterSubmitFunction = (result: unknown) => {\n const callFn = (something: unknown) => {\n if (typeof something === \"function\") {\n something();\n }\n };\n\n if (result instanceof Promise) {\n result.then(callFn);\n } else {\n callFn(result);\n }\n};\n\nexport const useRegisterActionStateContext = <T extends FieldValues>(\n form: UseFormReturn<T>,\n) => {\n const action = ActionModel.useNew({});\n const trackedSubmitCount = useRef(0);\n const submitHandlerResultRef = useRef<unknown>(null);\n\n useEffect(() => {\n return form.subscribe({\n formState: {\n errors: true,\n isValid: true,\n },\n callback: ({\n isValid,\n isSubmitted = false,\n isSubmitSuccessful = false,\n submitCount = 0,\n errors,\n }) => {\n if (submitCount === 0 && trackedSubmitCount.current > 0) {\n trackedSubmitCount.current = 0;\n }\n\n if (trackedSubmitCount.current === submitCount) {\n return;\n }\n trackedSubmitCount.current = submitCount;\n\n if (isSubmitted) {\n if (isSubmitSuccessful) {\n void action.state.onSucceeded();\n\n if (isValid) {\n callAfterSubmitFunction(submitHandlerResultRef.current);\n }\n } else {\n const hasFailedWithError =\n isSubmitted && errors && Object.entries(errors).length > 0\n ? errors\n : undefined;\n\n void action.state.onFailed(hasFailedWithError);\n }\n }\n },\n });\n }, [form.subscribe, action.state]);\n\n const registerSubmitResult = (result: unknown) => {\n if (isPromise(result)) {\n void action.state.onAsyncStart();\n result.then((submitResult) => {\n submitHandlerResultRef.current = submitResult;\n });\n } else {\n submitHandlerResultRef.current = result;\n }\n };\n\n return {\n action,\n registerSubmitResult,\n } as const;\n};\n"],"names":[],"mappings":";;;;AAKA,MAAM,uBAAA,GAA0B,CAAC,MAAoB,KAAA;AACnD,EAAM,MAAA,MAAA,GAAS,CAAC,SAAuB,KAAA;AACrC,IAAI,IAAA,OAAO,cAAc,UAAY,EAAA;AACnC,MAAU,SAAA,EAAA;AAAA;AACZ,GACF;AAEA,EAAA,IAAI,kBAAkB,OAAS,EAAA;AAC7B,IAAA,MAAA,CAAO,KAAK,MAAM,CAAA;AAAA,GACb,MAAA;AACL,IAAA,MAAA,CAAO,MAAM,CAAA;AAAA;AAEjB,CAAA;AAEa,MAAA,6BAAA,GAAgC,CAC3C,IACG,KAAA;AACH,EAAA,MAAM,MAAS,GAAA,WAAA,CAAY,MAAO,CAAA,EAAE,CAAA;AACpC,EAAM,MAAA,kBAAA,GAAqB,OAAO,CAAC,CAAA;AACnC,EAAM,MAAA,sBAAA,GAAyB,OAAgB,IAAI,CAAA;AAEnD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,OAAO,KAAK,SAAU,CAAA;AAAA,MACpB,SAAW,EAAA;AAAA,QACT,MAAQ,EAAA,IAAA;AAAA,QACR,OAAS,EAAA;AAAA,OACX;AAAA,MACA,UAAU,CAAC;AAAA,QACT,OAAA;AAAA,QACA,WAAc,GAAA,KAAA;AAAA,QACd,kBAAqB,GAAA,KAAA;AAAA,QACrB,WAAc,GAAA,CAAA;AAAA,QACd;AAAA,OACI,KAAA;AACJ,QAAA,IAAI,WAAgB,KAAA,CAAA,IAAK,kBAAmB,CAAA,OAAA,GAAU,CAAG,EAAA;AACvD,UAAA,kBAAA,CAAmB,OAAU,GAAA,CAAA;AAAA;AAG/B,QAAI,IAAA,kBAAA,CAAmB,YAAY,WAAa,EAAA;AAC9C,UAAA;AAAA;AAEF,QAAA,kBAAA,CAAmB,OAAU,GAAA,WAAA;AAE7B,QAAA,IAAI,WAAa,EAAA;AACf,UAAA,IAAI,kBAAoB,EAAA;AACtB,YAAK,KAAA,MAAA,CAAO,MAAM,WAAY,EAAA;AAE9B,YAAA,IAAI,OAAS,EAAA;AACX,cAAA,uBAAA,CAAwB,uBAAuB,OAAO,CAAA;AAAA;AACxD,WACK,MAAA;AACL,YAAM,MAAA,kBAAA,GACJ,eAAe,MAAU,IAAA,MAAA,CAAO,QAAQ,MAAM,CAAA,CAAE,MAAS,GAAA,CAAA,GACrD,MACA,GAAA,MAAA;AAEN,YAAK,KAAA,MAAA,CAAO,KAAM,CAAA,QAAA,CAAS,kBAAkB,CAAA;AAAA;AAC/C;AACF;AACF,KACD,CAAA;AAAA,KACA,CAAC,IAAA,CAAK,SAAW,EAAA,MAAA,CAAO,KAAK,CAAC,CAAA;AAEjC,EAAM,MAAA,oBAAA,GAAuB,CAAC,MAAoB,KAAA;AAChD,IAAI,IAAA,SAAA,CAAU,MAAM,CAAG,EAAA;AACrB,MAAK,KAAA,MAAA,CAAO,MAAM,YAAa,EAAA;AAC/B,MAAO,MAAA,CAAA,IAAA,CAAK,CAAC,YAAiB,KAAA;AAC5B,QAAA,sBAAA,CAAuB,OAAU,GAAA,YAAA;AAAA,OAClC,CAAA;AAAA,KACI,MAAA;AACL,MAAA,sBAAA,CAAuB,OAAU,GAAA,MAAA;AAAA;AACnC,GACF;AAEA,EAAO,OAAA;AAAA,IACL,MAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"getContainerBreakpointSizeClassName.mjs","sources":["../../../../../src/lib/getContainerBreakpointSizeClassName.ts"],"sourcesContent":["import type { ContainerBreakpointSize } from \"@/lib/types/props\";\n\nexport const getContainerBreakpointSizeClassName = (\n containerBreakpointSize: ContainerBreakpointSize,\n): string => `container-breakpoint-size-${containerBreakpointSize}`;\n"],"names":[],"mappings":"AAEO,MAAM,mCAAsC,GAAA,CACjD,uBACW,KAAA,CAAA,0BAAA,EAA6B,uBAAuB,CAAA;;;;"}
1
+ {"version":3,"file":"getContainerBreakpointSizeClassName.mjs","sources":["../../../../../src/lib/getContainerBreakpointSizeClassName.ts"],"sourcesContent":["import type { ContainerBreakpointSize } from \"@/lib/types/props\";\n\nexport const getContainerBreakpointSizeClassName = (\n containerBreakpointSize: ContainerBreakpointSize,\n) => `container-breakpoint-size-${containerBreakpointSize}`;\n"],"names":[],"mappings":"AAEO,MAAM,mCAAsC,GAAA,CACjD,uBACG,KAAA,CAAA,0BAAA,EAA6B,uBAAuB,CAAA;;;;"}
@@ -0,0 +1,28 @@
1
+ "use client"
2
+ /* */
3
+ import { useEffect } from 'react';
4
+
5
+ const useMakeFocusable = (ref, onFocus) => {
6
+ useEffect(() => {
7
+ const element = ref.current;
8
+ const shouldProcessElement = element && element instanceof HTMLElement;
9
+ if (!shouldProcessElement) {
10
+ return;
11
+ }
12
+ const onFocusHandler = () => onFocus?.();
13
+ element.addEventListener("focus", onFocusHandler);
14
+ const hasTabIndex = element.hasAttribute("tabIndex");
15
+ if (!hasTabIndex) {
16
+ element.setAttribute("tabIndex", "-1");
17
+ }
18
+ return () => {
19
+ element.removeEventListener("focus", onFocusHandler);
20
+ if (!hasTabIndex) {
21
+ element.removeAttribute("tabIndex");
22
+ }
23
+ };
24
+ }, [ref.current, onFocus]);
25
+ };
26
+
27
+ export { useMakeFocusable };
28
+ //# sourceMappingURL=useMakeFocusable.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMakeFocusable.mjs","sources":["../../../../../../../src/lib/hooks/dom/useMakeFocusable.ts"],"sourcesContent":["import { type RefObject, useEffect } from \"react\";\n\n/**\n * A hook that makes an element focusable and calls a callback when it receives\n * focus.\n */\nexport const useMakeFocusable = (\n ref: RefObject<unknown>,\n onFocus?: CallableFunction,\n) => {\n useEffect(() => {\n const element = ref.current;\n const shouldProcessElement = element && element instanceof HTMLElement;\n\n if (!shouldProcessElement) {\n return;\n }\n\n const onFocusHandler = () => onFocus?.();\n element.addEventListener(\"focus\", onFocusHandler);\n\n const hasTabIndex = element.hasAttribute(\"tabIndex\");\n if (!hasTabIndex) {\n // when we have no tabIndex, we set it to -1 to make it focusable\n element.setAttribute(\"tabIndex\", \"-1\");\n }\n\n return () => {\n element.removeEventListener(\"focus\", onFocusHandler);\n if (!hasTabIndex) {\n element.removeAttribute(\"tabIndex\");\n }\n };\n }, [ref.current, onFocus]);\n};\n"],"names":[],"mappings":";;AAMa,MAAA,gBAAA,GAAmB,CAC9B,GAAA,EACA,OACG,KAAA;AACH,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,UAAU,GAAI,CAAA,OAAA;AACpB,IAAM,MAAA,oBAAA,GAAuB,WAAW,OAAmB,YAAA,WAAA;AAE3D,IAAA,IAAI,CAAC,oBAAsB,EAAA;AACzB,MAAA;AAAA;AAGF,IAAM,MAAA,cAAA,GAAiB,MAAM,OAAU,IAAA;AACvC,IAAQ,OAAA,CAAA,gBAAA,CAAiB,SAAS,cAAc,CAAA;AAEhD,IAAM,MAAA,WAAA,GAAc,OAAQ,CAAA,YAAA,CAAa,UAAU,CAAA;AACnD,IAAA,IAAI,CAAC,WAAa,EAAA;AAEhB,MAAQ,OAAA,CAAA,YAAA,CAAa,YAAY,IAAI,CAAA;AAAA;AAGvC,IAAA,OAAO,MAAM;AACX,MAAQ,OAAA,CAAA,mBAAA,CAAoB,SAAS,cAAc,CAAA;AACnD,MAAA,IAAI,CAAC,WAAa,EAAA;AAChB,QAAA,OAAA,CAAQ,gBAAgB,UAAU,CAAA;AAAA;AACpC,KACF;AAAA,GACC,EAAA,CAAC,GAAI,CAAA,OAAA,EAAS,OAAO,CAAC,CAAA;AAC3B;;;;"}