@mittwald/flow-react-components 1.6.0-next.4 → 1.6.0-next.40

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 (256) hide show
  1. package/AGENTS.md +132 -88
  2. package/USAGE.md +7 -2
  3. package/dist/assets/component-index.json +1 -1
  4. package/dist/assets/doc-properties.json +1 -1
  5. package/dist/css/all-layered.css +1 -1
  6. package/dist/css/all.css +1 -1
  7. package/dist/js/_virtual/_18.locale.mjs +14 -0
  8. package/dist/js/default.mjs +4 -3
  9. package/dist/js/flr-universal.mjs +2 -1
  10. package/dist/js/node_modules/.pnpm/{@lezer_lr@1.4.10 → @lezer_lr@1.4.11}/node_modules/@lezer/lr/dist/index.mjs +40 -28
  11. package/dist/js/node_modules/.pnpm/@lezer_lr@1.4.11/node_modules/@lezer/lr/dist/index.mjs.map +1 -0
  12. package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs +3 -2
  13. package/dist/js/packages/components/src/components/AccentBox/AccentBox.mjs.map +1 -1
  14. package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +3 -2
  15. package/dist/js/packages/components/src/components/Accordion/Accordion.mjs.map +1 -1
  16. package/dist/js/packages/components/src/components/Action/models/ActionState.mjs +2 -2
  17. package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs +3 -3
  18. package/dist/js/packages/components/src/components/ActionGroup/ActionGroup.mjs.map +1 -1
  19. package/dist/js/packages/components/src/components/Activity/Activity.mjs +1 -1
  20. package/dist/js/packages/components/src/components/Activity/Activity.mjs.map +1 -1
  21. package/dist/js/packages/components/src/components/Alert/Alert.mjs +3 -2
  22. package/dist/js/packages/components/src/components/Alert/Alert.mjs.map +1 -1
  23. package/dist/js/packages/components/src/components/AlertBadge/AlertBadge.mjs +1 -1
  24. package/dist/js/packages/components/src/components/AlertBadge/AlertBadge.mjs.map +1 -1
  25. package/dist/js/packages/components/src/components/AlertBadge/AlertBadge.module.mjs.map +1 -1
  26. package/dist/js/packages/components/src/components/Badge/Badge.mjs +2 -2
  27. package/dist/js/packages/components/src/components/Badge/Badge.mjs.map +1 -1
  28. package/dist/js/packages/components/src/components/Badge/Badge.module.mjs.map +1 -1
  29. package/dist/js/packages/components/src/components/Calendar/components/RangeCalendar/helpers/useCalendarDateRangePresets.mjs +1 -1
  30. package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs +6 -8
  31. package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs.map +1 -1
  32. package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs +23 -5
  33. package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs.map +1 -1
  34. package/dist/js/packages/components/src/components/CartesianChart/hooks/useTickLabelWidth.mjs +67 -0
  35. package/dist/js/packages/components/src/components/CartesianChart/hooks/useTickLabelWidth.mjs.map +1 -0
  36. package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs +2 -2
  37. package/dist/js/packages/components/src/components/Checkbox/Checkbox.mjs.map +1 -1
  38. package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs +3 -3
  39. package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs.map +1 -1
  40. package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs +41 -12
  41. package/dist/js/packages/components/src/components/CodeEditor/CodeEditor.mjs.map +1 -1
  42. package/dist/js/packages/components/src/components/CodeEditor/hooks/useCodeEditorExtensions.mjs +29 -16
  43. package/dist/js/packages/components/src/components/CodeEditor/hooks/useCodeEditorExtensions.mjs.map +1 -1
  44. package/dist/js/packages/components/src/components/CodeEditor/languages/dotEnv/dotEnv.mjs +1 -1
  45. package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs +3 -2
  46. package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs.map +1 -1
  47. package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs +3 -2
  48. package/dist/js/packages/components/src/components/ContextMenu/ContextMenu.mjs.map +1 -1
  49. package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs +5 -1
  50. package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs.map +1 -1
  51. package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs +2 -1
  52. package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
  53. package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs +2 -1
  54. package/dist/js/packages/components/src/components/DateRangePicker/DateRangePicker.mjs.map +1 -1
  55. package/dist/js/packages/components/src/components/DeprecationWarningProvider/DeprecationWarningProvider.mjs +40 -8
  56. package/dist/js/packages/components/src/components/DeprecationWarningProvider/DeprecationWarningProvider.mjs.map +1 -1
  57. package/dist/js/packages/components/src/components/DonutChart/DonutChart.mjs.map +1 -1
  58. package/dist/js/packages/components/src/components/Heading/Heading.mjs +2 -0
  59. package/dist/js/packages/components/src/components/Heading/Heading.mjs.map +1 -1
  60. package/dist/js/packages/components/src/components/Icon/Icon.module.mjs.map +1 -1
  61. package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs +3 -2
  62. package/dist/js/packages/components/src/components/IllustratedMessage/IllustratedMessage.mjs.map +1 -1
  63. package/dist/js/packages/components/src/components/Label/Label.mjs +0 -4
  64. package/dist/js/packages/components/src/components/Label/Label.mjs.map +1 -1
  65. package/dist/js/packages/components/src/components/Link/Link.mjs.map +1 -1
  66. package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs +5 -2
  67. package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs.map +1 -1
  68. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs +2 -2
  69. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs.map +1 -1
  70. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs +5 -3
  71. package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs.map +1 -1
  72. package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.mjs +101 -0
  73. package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.mjs.map +1 -0
  74. package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.mjs +13 -0
  75. package/dist/js/packages/components/src/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.module.mjs.map +1 -0
  76. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs +16 -9
  77. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs.map +1 -1
  78. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.mjs +6 -2
  79. package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/FilterContextMenus.module.mjs.map +1 -1
  80. package/dist/js/packages/components/src/components/List/components/Header/components/SearchField/SearchField.mjs +4 -2
  81. package/dist/js/packages/components/src/components/List/components/Header/components/SearchField/SearchField.mjs.map +1 -1
  82. package/dist/js/packages/components/src/components/List/components/Items/Items.mjs +3 -0
  83. package/dist/js/packages/components/src/components/List/components/Items/Items.mjs.map +1 -1
  84. package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.mjs +1 -1
  85. package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.mjs.map +1 -1
  86. package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs +1 -2
  87. package/dist/js/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.mjs.map +1 -1
  88. package/dist/js/packages/components/src/components/List/components/Items/views/GridList/GridList.mjs +3 -0
  89. package/dist/js/packages/components/src/components/List/components/Items/views/GridList/GridList.mjs.map +1 -1
  90. package/dist/js/packages/components/src/components/List/components/ListSummary/ListSummary.mjs +5 -9
  91. package/dist/js/packages/components/src/components/List/components/ListSummary/ListSummary.mjs.map +1 -1
  92. package/dist/js/packages/components/src/components/List/components/Table/Table.mjs +8 -12
  93. package/dist/js/packages/components/src/components/List/components/Table/Table.mjs.map +1 -1
  94. package/dist/js/packages/components/src/components/List/components/Table/components/Row.mjs +31 -0
  95. package/dist/js/packages/components/src/components/List/components/Table/components/Row.mjs.map +1 -0
  96. package/dist/js/packages/components/src/components/List/hooks/useLatestOnAction.mjs +21 -0
  97. package/dist/js/packages/components/src/components/List/hooks/useLatestOnAction.mjs.map +1 -0
  98. package/dist/js/packages/components/src/components/List/model/List.mjs +1 -0
  99. package/dist/js/packages/components/src/components/List/model/List.mjs.map +1 -1
  100. package/dist/js/packages/components/src/components/List/model/ListViewMode.mjs +2 -2
  101. package/dist/js/packages/components/src/components/List/model/ReactTable.mjs +2 -2
  102. package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs +15 -2
  103. package/dist/js/packages/components/src/components/List/model/filter/DateRangeFilter.mjs.map +1 -1
  104. package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs +16 -0
  105. package/dist/js/packages/components/src/components/List/model/filter/resolveDateRangeFilterValue.mjs.map +1 -0
  106. package/dist/js/packages/components/src/components/List/model/item/ItemView.mjs +20 -7
  107. package/dist/js/packages/components/src/components/List/model/item/ItemView.mjs.map +1 -1
  108. package/dist/js/packages/components/src/components/List/model/loading/IncrementalLoaderState.mjs +2 -2
  109. package/dist/js/packages/components/src/components/List/model/table/TableCell.mjs +1 -1
  110. package/dist/js/packages/components/src/components/List/model/table/TableCell.mjs.map +1 -1
  111. package/dist/js/packages/components/src/components/List/model/table/TableRow.mjs +28 -1
  112. package/dist/js/packages/components/src/components/List/model/table/TableRow.mjs.map +1 -1
  113. package/dist/js/packages/components/src/components/Markdown/Markdown.mjs +25 -7
  114. package/dist/js/packages/components/src/components/Markdown/Markdown.mjs.map +1 -1
  115. package/dist/js/packages/components/src/components/Markdown/components/SkeletonBlocks.mjs +1 -1
  116. package/dist/js/packages/components/src/components/Markdown/components/SkeletonBlocks.mjs.map +1 -1
  117. package/dist/js/packages/components/src/components/Markdown/lib/isExternalHref.mjs +8 -0
  118. package/dist/js/packages/components/src/components/Markdown/lib/isExternalHref.mjs.map +1 -0
  119. package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs +32 -3
  120. package/dist/js/packages/components/src/components/MenuItem/MenuItem.mjs.map +1 -1
  121. package/dist/js/packages/components/src/components/MenuItem/MenuItem.module.mjs +1 -3
  122. package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs +1 -1
  123. package/dist/js/packages/components/src/components/MessageThread/MessageThread.mjs.map +1 -1
  124. package/dist/js/packages/components/src/components/Modal/Modal.mjs +9 -2
  125. package/dist/js/packages/components/src/components/Modal/Modal.mjs.map +1 -1
  126. package/dist/js/packages/components/src/components/Navigation/Navigation.module.mjs +1 -3
  127. package/dist/js/packages/components/src/components/NumberField/NumberField.mjs +2 -3
  128. package/dist/js/packages/components/src/components/NumberField/NumberField.mjs.map +1 -1
  129. package/dist/js/packages/components/src/components/Option/Option.module.mjs +1 -3
  130. package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs +2 -1
  131. package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs.map +1 -1
  132. package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +1 -1
  133. package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
  134. package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs +1 -1
  135. package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs.map +1 -1
  136. package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs +4 -2
  137. package/dist/js/packages/components/src/components/Popover/components/PopoverContent/PopoverContent.mjs.map +1 -1
  138. package/dist/js/packages/components/src/components/ProgressBar/ProgressBar.mjs.map +1 -1
  139. package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarLegend.mjs +5 -4
  140. package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarLegend.mjs.map +1 -1
  141. package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs +2 -3
  142. package/dist/js/packages/components/src/components/RadioGroup/RadioGroup.mjs.map +1 -1
  143. package/dist/js/packages/components/src/components/Rating/Rating.mjs +12 -11
  144. package/dist/js/packages/components/src/components/Rating/Rating.mjs.map +1 -1
  145. package/dist/js/packages/components/src/components/SearchField/SearchField.mjs +2 -3
  146. package/dist/js/packages/components/src/components/SearchField/SearchField.mjs.map +1 -1
  147. package/dist/js/packages/components/src/components/Section/Section.mjs +10 -6
  148. package/dist/js/packages/components/src/components/Section/Section.mjs.map +1 -1
  149. package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs +0 -4
  150. package/dist/js/packages/components/src/components/Section/components/SectionHeader/SectionHeader.mjs.map +1 -1
  151. package/dist/js/packages/components/src/components/Section/context.mjs +47 -0
  152. package/dist/js/packages/components/src/components/Section/context.mjs.map +1 -0
  153. package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs +2 -3
  154. package/dist/js/packages/components/src/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  155. package/dist/js/packages/components/src/components/Select/Select.mjs +2 -3
  156. package/dist/js/packages/components/src/components/Select/Select.mjs.map +1 -1
  157. package/dist/js/packages/components/src/components/SkeletonText/SkeletonText.mjs +4 -3
  158. package/dist/js/packages/components/src/components/SkeletonText/SkeletonText.mjs.map +1 -1
  159. package/dist/js/packages/components/src/components/Slider/Slider.mjs +47 -41
  160. package/dist/js/packages/components/src/components/Slider/Slider.mjs.map +1 -1
  161. package/dist/js/packages/components/src/components/Table/Table.mjs +3 -0
  162. package/dist/js/packages/components/src/components/Table/Table.mjs.map +1 -1
  163. package/dist/js/packages/components/src/components/Table/Table.module.mjs.map +1 -1
  164. package/dist/js/packages/components/src/components/Table/components/TableCell/TableCell.mjs +5 -12
  165. package/dist/js/packages/components/src/components/Table/components/TableCell/TableCell.mjs.map +1 -1
  166. package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs +4 -2
  167. package/dist/js/packages/components/src/components/Table/components/TableColumn/TableColumn.mjs.map +1 -1
  168. package/dist/js/packages/components/src/components/Table/components/TableHeader/TableHeader.mjs +7 -1
  169. package/dist/js/packages/components/src/components/Table/components/TableHeader/TableHeader.mjs.map +1 -1
  170. package/dist/js/packages/components/src/components/Table/components/TableHeader/context.mjs +14 -0
  171. package/dist/js/packages/components/src/components/Table/components/TableHeader/context.mjs.map +1 -0
  172. package/dist/js/packages/components/src/components/Tabs/Tabs.mjs +6 -8
  173. package/dist/js/packages/components/src/components/Tabs/Tabs.mjs.map +1 -1
  174. package/dist/js/packages/components/src/components/Tabs/Tabs.module.mjs.map +1 -1
  175. package/dist/js/packages/components/src/components/Tabs/components/TabTitle/TabTitle.module.mjs.map +1 -1
  176. package/dist/js/packages/components/src/components/TextField/TextField.mjs +11 -8
  177. package/dist/js/packages/components/src/components/TextField/TextField.mjs.map +1 -1
  178. package/dist/js/packages/components/src/components/TimeField/TimeField.mjs +4 -2
  179. package/dist/js/packages/components/src/components/TimeField/TimeField.mjs.map +1 -1
  180. package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedStringFormatter.mjs +15 -2
  181. package/dist/js/packages/components/src/components/TranslationProvider/useLocalizedStringFormatter.mjs.map +1 -1
  182. package/dist/js/packages/components/src/components/Wrap/Wrap.mjs.map +1 -1
  183. package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs +1 -1
  184. package/dist/js/packages/components/src/integrations/react-hook-form/components/Form/Form.mjs +4 -1
  185. package/dist/js/packages/components/src/integrations/react-hook-form/components/Form/Form.mjs.map +1 -1
  186. package/dist/js/packages/components/src/integrations/react-hook-form/components/FormRootError/FormRootError.mjs +1 -1
  187. package/dist/js/packages/components/src/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.mjs.map +1 -1
  188. package/dist/js/packages/components/src/lib/controller/overlay/OverlayController.mjs +10 -158
  189. package/dist/js/packages/components/src/lib/controller/overlay/OverlayController.mjs.map +1 -1
  190. package/dist/js/packages/components/src/lib/controller/overlay/useCloseOverlayConfirmationController.mjs +1 -0
  191. package/dist/js/packages/components/src/lib/controller/overlay/useCloseOverlayConfirmationController.mjs.map +1 -1
  192. package/dist/js/packages/components/src/lib/hooks/dom/useVirtualKeyboardVisible.mjs +8 -4
  193. package/dist/js/packages/components/src/lib/hooks/dom/useVirtualKeyboardVisible.mjs.map +1 -1
  194. package/dist/js/packages/components/src/views/DatePickerView.mjs +16 -0
  195. package/dist/js/packages/components/src/views/DatePickerView.mjs.map +1 -0
  196. package/dist/js/packages/components/src/views/LabelView.mjs +16 -0
  197. package/dist/js/packages/components/src/views/LabelView.mjs.map +1 -0
  198. package/dist/js/packages/components/src/views/TimeFieldView.mjs +16 -0
  199. package/dist/js/packages/components/src/views/TimeFieldView.mjs.map +1 -0
  200. package/dist/js/packages/components-base/src/index.mjs +5 -2
  201. package/dist/js/packages/components-base/src/list/filter/ListDateRangeFilter.mjs +1 -0
  202. package/dist/js/packages/components-base/src/list/filter/ListDateRangeFilter.mjs.map +1 -1
  203. package/dist/js/packages/components-base/src/list/filter/ListFilter.mjs +4 -1
  204. package/dist/js/packages/components-base/src/list/filter/ListFilter.mjs.map +1 -1
  205. package/dist/js/packages/components-base/src/list/filter/dateRange.mjs +37 -13
  206. package/dist/js/packages/components-base/src/list/filter/dateRange.mjs.map +1 -1
  207. package/dist/js/packages/components-base/src/list/filter/dateTimeRangeFields.mjs +55 -0
  208. package/dist/js/packages/components-base/src/list/filter/dateTimeRangeFields.mjs.map +1 -0
  209. package/dist/js/packages/components-base/src/list/filter/formatDateRange.mjs +27 -0
  210. package/dist/js/packages/components-base/src/list/filter/formatDateRange.mjs.map +1 -0
  211. package/dist/js/packages/components-base/src/overlay/OverlayState.mjs +196 -0
  212. package/dist/js/packages/components-base/src/overlay/OverlayState.mjs.map +1 -0
  213. package/dist/types/_bundled/flow-components-base/index.d.ts +4 -1
  214. package/dist/types/_bundled/flow-components-base/list/filter/ListFilter.d.ts +2 -0
  215. package/dist/types/_bundled/flow-components-base/list/filter/dateRange.d.ts +24 -1
  216. package/dist/types/_bundled/flow-components-base/list/filter/dateTimeRangeFields.d.ts +34 -0
  217. package/dist/types/_bundled/flow-components-base/list/filter/formatDateRange.d.ts +7 -0
  218. package/dist/types/_bundled/flow-components-base/overlay/OverlayState.d.ts +94 -0
  219. package/dist/types/components/AlertBadge/AlertBadge.d.ts +2 -2
  220. package/dist/types/components/Badge/Badge.d.ts +2 -2
  221. package/dist/types/components/CartesianChart/hooks/useTickLabelWidth.d.ts +1 -0
  222. package/dist/types/components/CodeBlock/CodeBlock.d.ts +1 -1
  223. package/dist/types/components/DonutChart/DonutChart.d.ts +1 -4
  224. package/dist/types/components/Link/Link.d.ts +1 -1
  225. package/dist/types/components/List/components/Header/components/DateTimeRangeFields/DateTimeRangeFields.d.ts +8 -0
  226. package/dist/types/components/List/components/Items/components/Item/Item.d.ts +2 -0
  227. package/dist/types/components/List/components/Items/components/Item/hooks/useGridItemProps.d.ts +1 -0
  228. package/dist/types/components/List/components/ListSummary/ListSummary.d.ts +3 -2
  229. package/dist/types/components/List/components/Table/components/Row.d.ts +13 -0
  230. package/dist/types/components/List/hooks/useLatestOnAction.d.ts +7 -0
  231. package/dist/types/components/List/index.d.ts +2 -0
  232. package/dist/types/components/List/model/filter/DateRangeFilter.d.ts +15 -8
  233. package/dist/types/components/List/model/filter/resolveDateRangeFilterValue.d.ts +11 -0
  234. package/dist/types/components/List/model/filter/types.d.ts +23 -1
  235. package/dist/types/components/List/model/item/ItemView.d.ts +34 -11
  236. package/dist/types/components/List/model/table/TableRow.d.ts +14 -0
  237. package/dist/types/components/List/model/table/types.d.ts +17 -1
  238. package/dist/types/components/List/typedList.d.ts +1 -0
  239. package/dist/types/components/Markdown/lib/isExternalHref.d.ts +1 -0
  240. package/dist/types/components/ProgressBar/ProgressBar.d.ts +1 -4
  241. package/dist/types/components/Rating/Rating.d.ts +5 -5
  242. package/dist/types/components/Section/context.d.ts +28 -0
  243. package/dist/types/components/Table/components/TableCell/TableCell.d.ts +4 -1
  244. package/dist/types/components/Table/components/TableHeader/context.d.ts +6 -0
  245. package/dist/types/components/Wrap/Wrap.d.ts +5 -0
  246. package/dist/types/index/flr-universal.d.ts +1 -1
  247. package/dist/types/integrations/react-hook-form/components/FormSettingsProvider/FormSettingsProvider.d.ts +7 -1
  248. package/dist/types/lib/controller/overlay/OverlayController.d.ts +8 -74
  249. package/dist/types/lib/dev/hydrateServerMarkup.d.ts +2 -0
  250. package/dist/types/lib/hooks/dom/useVirtualKeyboardVisible.d.ts +4 -1
  251. package/package.json +12 -12
  252. package/dist/js/node_modules/.pnpm/@lezer_lr@1.4.10/node_modules/@lezer/lr/dist/index.mjs.map +0 -1
  253. package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs +0 -10
  254. package/dist/js/packages/components/src/lib/date/transformDateValueToFormattedDate.mjs.map +0 -1
  255. package/dist/types/lib/date/transformDateValueToDateTime.d.ts +0 -3
  256. package/dist/types/lib/date/transformDateValueToFormattedDate.d.ts +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.mjs","names":["styles"],"sources":["../../../../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import type { ComponentProps, FC, PropsWithChildren } from \"react\";\nimport { createContext, useContext, useEffect, useId, useRef } from \"react\";\nimport { useDisclosure } from \"react-aria\";\nimport { useDisclosureState } from \"react-stately\";\nimport clsx from \"clsx\";\nimport styles from \"./Accordion.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { Button, type ButtonProps } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\nimport {\n AccordionGroupContext,\n useAccordionGroupContext,\n} from \"@/components/AccordionGroup/context\";\n\nexport interface AccordionProps extends PropsWithChildren<\n ComponentProps<\"div\">\n> {\n /**\n * The key of the accordion inside an `AccordionGroup`, used by its\n * `expandedKeys`. Also set as the DOM id.\n */\n id?: string;\n /** Whether the accordion should be initially expanded. */\n defaultExpanded?: boolean;\n /**\n * The visual variant of the accordion. Has no effect.\n *\n * @deprecated Use `AccordionGroup` or a `LayoutCard` to set accordions apart.\n */\n variant?: \"default\" | \"outline\";\n}\n\n/*\n * The header button is rendered by the `Heading`, `Text` or `Label` the\n * consumer wrote, through a memoized props context. It reads the disclosure\n * state from a React context instead, so it always gets the current one.\n */\ntype TriggerProps = Pick<\n ButtonProps,\n \"id\" | \"aria-expanded\" | \"aria-controls\" | \"onPress\" | \"onPressStart\"\n>;\n\nconst TriggerContext = createContext<TriggerProps | null>(null);\n\ninterface HeaderButtonProps extends PropsWithChildren {\n /** Text and label headers are smaller than headings, so is their chevron. */\n isCompact?: boolean;\n}\n\n/*\n * Declared here and not inside the accordion: a component defined in a render\n * body gets a new identity on every render, so React unmounts and remounts it —\n * and the toggle loses the focus it just received on its own press.\n */\nconst HeaderButton: FC<HeaderButtonProps> = (props) => {\n const { children, isCompact } = props;\n const buttonProps = useContext(TriggerContext);\n\n return (\n <Button\n tunnel={null}\n unstyled\n className={styles.headerButton}\n {...buttonProps}\n >\n <span className={styles.headerContent}>{children}</span>\n <IconChevronDown\n className={styles.chevron}\n size={isCompact ? \"s\" : \"m\"}\n />\n </Button>\n );\n};\n\n/* Text and label headers render the same compact toggle. */\nconst compactHeader = {\n className: clsx(styles.header, styles.textHeader),\n children: dynamic((props: PropsWithChildren) => (\n <HeaderButton isCompact>{props.children}</HeaderButton>\n )),\n};\n\nconst propsContext: PropsContext = {\n Content: {\n className: styles.contentInner,\n tunnel: {\n id: \"content\",\n component: \"Accordion\",\n },\n },\n Heading: {\n className: styles.header,\n level: 3,\n children: dynamic((props) => <HeaderButton>{props.children}</HeaderButton>),\n Button: { size: \"m\" },\n },\n Text: {\n ...compactHeader,\n elementType: \"div\",\n },\n Label: {\n ...compactHeader,\n /*\n * A <label> names the first labelable element below it — here the toggle,\n * whose own text is the label's only content. The name computation walks\n * into the label, meets the button it started from and stops, so the\n * toggle ends up with an empty name. A <span> names nothing and the name\n * comes from the toggle's content again.\n */\n elementType: \"span\",\n },\n};\n\n/**\n * @flr-generate all\n * @flowStatus beta\n */\nexport const Accordion: FC<AccordionProps> = flowComponent(\n \"Accordion\",\n (props) => {\n const {\n children,\n className,\n id,\n defaultExpanded = false,\n variant,\n ...rest\n } = props;\n\n const warnDeprecation = useWarnDeprecation();\n if (variant !== undefined) {\n warnDeprecation(\n \"The 'variant' prop of the 'Accordion' component is deprecated and will be removed in a future release. Use 'AccordionGroup' or a 'LayoutCard' to set accordions apart instead.\",\n );\n }\n\n const generatedKey = useId();\n const key = id ?? generatedKey;\n const group = useAccordionGroupContext();\n const register = group?.register;\n\n /* `onExpandedChange` reports only keys the consumer gave. */\n useEffect(\n () => (id === undefined ? undefined : register?.(id, defaultExpanded)),\n [register, id, defaultExpanded],\n );\n\n const state = useDisclosureState({\n defaultExpanded,\n ...(group && {\n isExpanded: group.isExpanded(key, defaultExpanded),\n onExpandedChange: (isExpanded) => group.setExpanded(key, isExpanded),\n }),\n });\n\n const panelRef = useRef<HTMLDivElement>(null);\n const { buttonProps, panelProps } = useDisclosure({}, state, panelRef);\n const triggerProps: TriggerProps = {\n id: buttonProps.id,\n \"aria-expanded\": state.isExpanded,\n \"aria-controls\": buttonProps[\"aria-controls\"],\n onPress: buttonProps.onPress,\n onPressStart: buttonProps.onPressStart,\n };\n\n const rootClassName = clsx(\n styles.accordion,\n state.isExpanded && styles.expanded,\n group && styles.grouped,\n className,\n );\n\n return (\n <div {...rest} id={id} className={rootClassName}>\n <TriggerContext value={triggerProps}>\n <PropsContextProvider props={propsContext}>\n {children}\n <div {...panelProps} ref={panelRef} className={styles.content}>\n {/* An accordion inside the content is not part of this group. */}\n <AccordionGroupContext value={null}>\n <UiComponentTunnelExit id=\"content\" component=\"Accordion\" />\n </AccordionGroupContext>\n </div>\n </PropsContextProvider>\n </TriggerContext>\n </div>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default Accordion;\n"],"mappings":";;;;;;;;;;;;;;;;;AA8CA,IAAM,iBAAiB,cAAmC,IAAI;AAY9D,IAAM,gBAAuC,UAAU;CACrD,MAAM,EAAE,UAAU,cAAc;CAChC,MAAM,cAAc,WAAW,cAAc;CAE7C,OACE,qBAAC,QAAD;EACE,QAAQ;EACR,UAAA;EACA,WAAWA,yBAAO;EAClB,GAAI;EAJN,UAAA,CAME,oBAAC,QAAD;GAAM,WAAWA,yBAAO;GAAgB;EAAe,CAAA,GACvD,oBAAC,iBAAD;GACE,WAAWA,yBAAO;GAClB,MAAM,YAAY,MAAM;EACzB,CAAA,CACK;;AAEZ;AAGA,IAAM,gBAAgB;CACpB,WAAW,KAAKA,yBAAO,QAAQA,yBAAO,UAAU;CAChD,UAAU,SAAS,UACjB,oBAAC,cAAD;EAAc,WAAA;EAAW,UAAA,MAAM;CAAuB,CAAA,CACvD;AACH;AAEA,IAAM,eAA6B;CACjC,SAAS;EACP,WAAWA,yBAAO;EAClB,QAAQ;GACN,IAAI;GACJ,WAAW;EACb;CACF;CACA,SAAS;EACP,WAAWA,yBAAO;EAClB,OAAO;EACP,UAAU,SAAS,UAAU,oBAAC,cAAD,EAAA,UAAe,MAAM,SAAuB,CAAA,CAAC;EAC1E,QAAQ,EAAE,MAAM,IAAI;CACtB;CACA,MAAM;EACJ,GAAG;EACH,aAAa;CACf;CACA,OAAO;EACL,GAAG;EAQH,aAAa;CACf;AACF;;;;;AAMA,IAAa,YAAgC,cAC3C,cACC,UAAU;CACT,MAAM,EACJ,UACA,WACA,IACA,kBAAkB,OAClB,SACA,GAAG,SACD;CAEJ,MAAM,kBAAkB,mBAAmB;CAC3C,IAAI,YAAY,KAAA,GACd,gBACE,gLACF;CAGF,MAAM,eAAe,MAAM;CAC3B,MAAM,MAAM,MAAM;CAClB,MAAM,QAAQ,yBAAyB;CACvC,MAAM,WAAW,OAAO;CAGxB,gBACS,OAAO,KAAA,IAAY,KAAA,IAAY,WAAW,IAAI,eAAe,GACpE;EAAC;EAAU;EAAI;CAAe,CAChC;CAEA,MAAM,QAAQ,mBAAmB;EAC/B;EACA,GAAI,SAAS;GACX,YAAY,MAAM,WAAW,KAAK,eAAe;GACjD,mBAAmB,eAAe,MAAM,YAAY,KAAK,UAAU;EACrE;CACF,CAAC;CAED,MAAM,WAAW,OAAuB,IAAI;CAC5C,MAAM,EAAE,aAAa,eAAe,cAAc,CAAC,GAAG,OAAO,QAAQ;CACrE,MAAM,eAA6B;EACjC,IAAI,YAAY;EAChB,iBAAiB,MAAM;EACvB,iBAAiB,YAAY;EAC7B,SAAS,YAAY;EACrB,cAAc,YAAY;CAC5B;CAEA,MAAM,gBAAgB,KACpBA,yBAAO,WACP,MAAM,cAAcA,yBAAO,UAC3B,SAASA,yBAAO,SAChB,SACF;CAEA,OACE,oBAAC,OAAD;EAAK,GAAI;EAAU;EAAI,WAAW;EAChC,UAAA,oBAAC,gBAAD;GAAgB,OAAO;GACrB,UAAA,qBAAC,sBAAD;IAAsB,OAAO;IAA7B,UAAA,CACG,UACD,oBAAC,OAAD;KAAK,GAAI;KAAY,KAAK;KAAU,WAAWA,yBAAO;KAEpD,UAAA,oBAAC,uBAAD;MAAuB,OAAO;MAC5B,UAAA,oBAAC,uBAAD;OAAuB,IAAG;OAAU,WAAU;MAAa,CAAA;KACtC,CAAA;IACpB,CAAA,CACe;;EACR,CAAA;CACb,CAAA;AAET,GACA,EACE,MAAM,SACR,CACF"}
1
+ {"version":3,"file":"Accordion.mjs","names":["styles"],"sources":["../../../../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import type { ComponentProps, FC, PropsWithChildren } from \"react\";\nimport { createContext, useContext, useEffect, useId, useRef } from \"react\";\nimport { useDisclosure } from \"react-aria\";\nimport { useDisclosureState } from \"react-stately\";\nimport clsx from \"clsx\";\nimport styles from \"./Accordion.module.scss\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { Button, type ButtonProps } from \"@/components/Button\";\nimport { IconChevronDown } from \"@/components/Icon/components/icons\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\nimport {\n AccordionGroupContext,\n useAccordionGroupContext,\n} from \"@/components/AccordionGroup/context\";\nimport { SectionHeadingReset } from \"@/components/Section/context\";\n\nexport interface AccordionProps extends PropsWithChildren<\n ComponentProps<\"div\">\n> {\n /**\n * The key of the accordion inside an `AccordionGroup`, used by its\n * `expandedKeys`. Also set as the DOM id.\n */\n id?: string;\n /** Whether the accordion should be initially expanded. */\n defaultExpanded?: boolean;\n /**\n * The visual variant of the accordion. Has no effect.\n *\n * @deprecated Use `AccordionGroup` or a `LayoutCard` to set accordions apart.\n */\n variant?: \"default\" | \"outline\";\n}\n\n/*\n * The header button is rendered by the `Heading`, `Text` or `Label` the\n * consumer wrote, through a memoized props context. It reads the disclosure\n * state from a React context instead, so it always gets the current one.\n */\ntype TriggerProps = Pick<\n ButtonProps,\n \"id\" | \"aria-expanded\" | \"aria-controls\" | \"onPress\" | \"onPressStart\"\n>;\n\nconst TriggerContext = createContext<TriggerProps | null>(null);\n\ninterface HeaderButtonProps extends PropsWithChildren {\n /** Text and label headers are smaller than headings, so is their chevron. */\n isCompact?: boolean;\n}\n\n/*\n * Declared here and not inside the accordion: a component defined in a render\n * body gets a new identity on every render, so React unmounts and remounts it —\n * and the toggle loses the focus it just received on its own press.\n */\nconst HeaderButton: FC<HeaderButtonProps> = (props) => {\n const { children, isCompact } = props;\n const buttonProps = useContext(TriggerContext);\n\n return (\n <Button\n tunnel={null}\n unstyled\n className={styles.headerButton}\n {...buttonProps}\n >\n <span className={styles.headerContent}>{children}</span>\n <IconChevronDown\n className={styles.chevron}\n size={isCompact ? \"s\" : \"m\"}\n />\n </Button>\n );\n};\n\n/* Text and label headers render the same compact toggle. */\nconst compactHeader = {\n className: clsx(styles.header, styles.textHeader),\n children: dynamic((props: PropsWithChildren) => (\n <HeaderButton isCompact>{props.children}</HeaderButton>\n )),\n};\n\nconst propsContext: PropsContext = {\n Content: {\n className: styles.contentInner,\n tunnel: {\n id: \"content\",\n component: \"Accordion\",\n },\n },\n Heading: {\n className: styles.header,\n level: 3,\n children: dynamic((props) => <HeaderButton>{props.children}</HeaderButton>),\n Button: { size: \"m\" },\n },\n Text: {\n ...compactHeader,\n elementType: \"div\",\n },\n Label: {\n ...compactHeader,\n /*\n * A <label> names the first labelable element below it — here the toggle,\n * whose own text is the label's only content. The name computation walks\n * into the label, meets the button it started from and stops, so the\n * toggle ends up with an empty name. A <span> names nothing and the name\n * comes from the toggle's content again.\n */\n elementType: \"span\",\n },\n};\n\n/**\n * @flr-generate all\n * @flowStatus beta\n */\nexport const Accordion: FC<AccordionProps> = flowComponent(\n \"Accordion\",\n (props) => {\n const {\n children,\n className,\n id,\n defaultExpanded = false,\n variant,\n ...rest\n } = props;\n\n const warnDeprecation = useWarnDeprecation();\n if (variant !== undefined) {\n warnDeprecation(\n \"The 'variant' prop of the 'Accordion' component is deprecated and will be removed in a future release. Use 'AccordionGroup' or a 'LayoutCard' to set accordions apart instead.\",\n );\n }\n\n const generatedKey = useId();\n const key = id ?? generatedKey;\n const group = useAccordionGroupContext();\n const register = group?.register;\n\n /* `onExpandedChange` reports only keys the consumer gave. */\n useEffect(\n () => (id === undefined ? undefined : register?.(id, defaultExpanded)),\n [register, id, defaultExpanded],\n );\n\n const state = useDisclosureState({\n defaultExpanded,\n ...(group && {\n isExpanded: group.isExpanded(key, defaultExpanded),\n onExpandedChange: (isExpanded) => group.setExpanded(key, isExpanded),\n }),\n });\n\n const panelRef = useRef<HTMLDivElement>(null);\n const { buttonProps, panelProps } = useDisclosure({}, state, panelRef);\n const triggerProps: TriggerProps = {\n id: buttonProps.id,\n \"aria-expanded\": state.isExpanded,\n \"aria-controls\": buttonProps[\"aria-controls\"],\n onPress: buttonProps.onPress,\n onPressStart: buttonProps.onPressStart,\n };\n\n const rootClassName = clsx(\n styles.accordion,\n state.isExpanded && styles.expanded,\n group && styles.grouped,\n className,\n );\n\n return (\n <div {...rest} id={id} className={rootClassName}>\n <SectionHeadingReset>\n <TriggerContext value={triggerProps}>\n <PropsContextProvider props={propsContext}>\n {children}\n <div {...panelProps} ref={panelRef} className={styles.content}>\n {/* An accordion inside the content is not part of this group. */}\n <AccordionGroupContext value={null}>\n <UiComponentTunnelExit id=\"content\" component=\"Accordion\" />\n </AccordionGroupContext>\n </div>\n </PropsContextProvider>\n </TriggerContext>\n </SectionHeadingReset>\n </div>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default Accordion;\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+CA,IAAM,iBAAiB,cAAmC,IAAI;AAY9D,IAAM,gBAAuC,UAAU;CACrD,MAAM,EAAE,UAAU,cAAc;CAChC,MAAM,cAAc,WAAW,cAAc;CAE7C,OACE,qBAAC,QAAD;EACE,QAAQ;EACR,UAAA;EACA,WAAWA,yBAAO;EAClB,GAAI;EAJN,UAAA,CAME,oBAAC,QAAD;GAAM,WAAWA,yBAAO;GAAgB;EAAe,CAAA,GACvD,oBAAC,iBAAD;GACE,WAAWA,yBAAO;GAClB,MAAM,YAAY,MAAM;EACzB,CAAA,CACK;;AAEZ;AAGA,IAAM,gBAAgB;CACpB,WAAW,KAAKA,yBAAO,QAAQA,yBAAO,UAAU;CAChD,UAAU,SAAS,UACjB,oBAAC,cAAD;EAAc,WAAA;EAAW,UAAA,MAAM;CAAuB,CAAA,CACvD;AACH;AAEA,IAAM,eAA6B;CACjC,SAAS;EACP,WAAWA,yBAAO;EAClB,QAAQ;GACN,IAAI;GACJ,WAAW;EACb;CACF;CACA,SAAS;EACP,WAAWA,yBAAO;EAClB,OAAO;EACP,UAAU,SAAS,UAAU,oBAAC,cAAD,EAAA,UAAe,MAAM,SAAuB,CAAA,CAAC;EAC1E,QAAQ,EAAE,MAAM,IAAI;CACtB;CACA,MAAM;EACJ,GAAG;EACH,aAAa;CACf;CACA,OAAO;EACL,GAAG;EAQH,aAAa;CACf;AACF;;;;;AAMA,IAAa,YAAgC,cAC3C,cACC,UAAU;CACT,MAAM,EACJ,UACA,WACA,IACA,kBAAkB,OAClB,SACA,GAAG,SACD;CAEJ,MAAM,kBAAkB,mBAAmB;CAC3C,IAAI,YAAY,KAAA,GACd,gBACE,gLACF;CAGF,MAAM,eAAe,MAAM;CAC3B,MAAM,MAAM,MAAM;CAClB,MAAM,QAAQ,yBAAyB;CACvC,MAAM,WAAW,OAAO;CAGxB,gBACS,OAAO,KAAA,IAAY,KAAA,IAAY,WAAW,IAAI,eAAe,GACpE;EAAC;EAAU;EAAI;CAAe,CAChC;CAEA,MAAM,QAAQ,mBAAmB;EAC/B;EACA,GAAI,SAAS;GACX,YAAY,MAAM,WAAW,KAAK,eAAe;GACjD,mBAAmB,eAAe,MAAM,YAAY,KAAK,UAAU;EACrE;CACF,CAAC;CAED,MAAM,WAAW,OAAuB,IAAI;CAC5C,MAAM,EAAE,aAAa,eAAe,cAAc,CAAC,GAAG,OAAO,QAAQ;CACrE,MAAM,eAA6B;EACjC,IAAI,YAAY;EAChB,iBAAiB,MAAM;EACvB,iBAAiB,YAAY;EAC7B,SAAS,YAAY;EACrB,cAAc,YAAY;CAC5B;CAEA,MAAM,gBAAgB,KACpBA,yBAAO,WACP,MAAM,cAAcA,yBAAO,UAC3B,SAASA,yBAAO,SAChB,SACF;CAEA,OACE,oBAAC,OAAD;EAAK,GAAI;EAAU;EAAI,WAAW;EAChC,UAAA,oBAAC,qBAAD,EAAA,UACE,oBAAC,gBAAD;GAAgB,OAAO;GACrB,UAAA,qBAAC,sBAAD;IAAsB,OAAO;IAA7B,UAAA,CACG,UACD,oBAAC,OAAD;KAAK,GAAI;KAAY,KAAK;KAAU,WAAWA,yBAAO;KAEpD,UAAA,oBAAC,uBAAD;MAAuB,OAAO;MAC5B,UAAA,oBAAC,uBAAD;OAAuB,IAAG;OAAU,WAAU;MAAa,CAAA;KACtC,CAAA;IACpB,CAAA,CACe;;EACR,CAAA,EACG,CAAA;CAClB,CAAA;AAET,GACA,EACE,MAAM,SACR,CACF"}
@@ -1,9 +1,9 @@
1
1
  "use client"
2
2
  /* */
3
- import useSelector from "../../../lib/mobx/useSelector.mjs";
4
- import { useStatic } from "../../../lib/hooks/useStatic.mjs";
5
3
  import { ActionState as ActionState$1, actionStateDurations } from "../../../../../components-base/src/action/ActionState.mjs";
6
4
  import "../../../../../components-base/src/index.mjs";
5
+ import useSelector from "../../../lib/mobx/useSelector.mjs";
6
+ import { useStatic } from "../../../lib/hooks/useStatic.mjs";
7
7
  //#region src/components/Action/models/ActionState.ts
8
8
  var duration = actionStateDurations;
9
9
  /**
@@ -24,19 +24,19 @@ var ActionGroup = flowComponent("ActionGroup", (props) => {
24
24
  slot: dynamic((props) => getActionGroupSlot(props)),
25
25
  className: dynamic((props) => {
26
26
  const slot = getActionGroupSlot(props);
27
- return clsx(props.className, styleClassname(ActionGroup_module_default, slot));
27
+ return clsx(styleClassname(ActionGroup_module_default, slot), props.className);
28
28
  })
29
29
  },
30
30
  Switch: {
31
31
  labelPosition: "leading",
32
32
  className: dynamic((props) => {
33
- return clsx(props.className, props.slot && styleClassname(ActionGroup_module_default, props.slot));
33
+ return clsx(props.slot && styleClassname(ActionGroup_module_default, props.slot), props.className);
34
34
  })
35
35
  },
36
36
  Link: {
37
37
  size,
38
38
  className: dynamic((props) => {
39
- return clsx(props.className, props.slot && styleClassname(ActionGroup_module_default, props.slot));
39
+ return clsx(props.slot && styleClassname(ActionGroup_module_default, props.slot), props.className);
40
40
  })
41
41
  }
42
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ActionGroup.mjs","names":["styles"],"sources":["../../../../../../../src/components/ActionGroup/ActionGroup.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./ActionGroup.module.scss\";\nimport { styleClassname } from \"@/lib/scss/selectors\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { ActionStateContextProvider } from \"@/components/Action/models/ActionStateContext\";\nimport { getActionGroupSlot } from \"@/components/ActionGroup/lib/getActionGroupSlot\";\nimport type { ButtonProps } from \"@/components/Button\";\n\nexport interface ActionGroupProps\n extends\n PropsWithChildren,\n FlowComponentProps<HTMLDivElement>,\n PropsWithClassName {\n /** The spacing between the buttons inside the action group. @default \"s\" */\n spacing?: \"s\" | \"m\";\n /** The size of the buttons and links inside the action group. @default \"m\" */\n size?: ButtonProps[\"size\"];\n /**\n * When set, the buttons are not sorted into the slots `primary`, `secondary`\n * and `abort` but stay in source order. Use it when the actions have no such\n * hierarchy, e.g. a row of equal actions or icon buttons. @default false\n */\n preserveOrder?: boolean;\n}\n\n/** @flr-generate all */\nexport const ActionGroup = flowComponent(\n \"ActionGroup\",\n (props) => {\n const {\n children,\n className,\n ref,\n spacing = \"s\",\n size,\n preserveOrder = false,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.actionGroup,\n styles[spacing],\n !preserveOrder && styles.sorted,\n className,\n );\n\n const propsContext: PropsContext = preserveOrder\n ? {\n Button: { size },\n Switch: {\n labelPosition: \"leading\",\n },\n Link: { size },\n }\n : {\n Button: {\n size,\n slot: dynamic((props) => getActionGroupSlot(props)),\n className: dynamic((props) => {\n const slot = getActionGroupSlot(props);\n return clsx(props.className, styleClassname(styles, slot));\n }),\n },\n Switch: {\n labelPosition: \"leading\",\n className: dynamic((props) => {\n return clsx(\n props.className,\n props.slot && styleClassname(styles, props.slot),\n );\n }),\n },\n Link: {\n size,\n className: dynamic((props) => {\n return clsx(\n props.className,\n props.slot && styleClassname(styles, props.slot),\n );\n }),\n },\n };\n\n return (\n <ActionStateContextProvider>\n <PropsContextProvider\n props={propsContext}\n dependencies={[preserveOrder, size]}\n >\n <div {...rest} className={rootClassName} ref={ref} role=\"group\">\n {children}\n </div>\n </PropsContextProvider>\n </ActionStateContextProvider>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default ActionGroup;\n"],"mappings":";;;;;;;;;;;;;AA+BA,IAAa,cAAc,cACzB,gBACC,UAAU;CACT,MAAM,EACJ,UACA,WACA,KACA,UAAU,KACV,MACA,gBAAgB,OAChB,GAAG,SACD;CAEJ,MAAM,gBAAgB,KACpBA,2BAAO,aACPA,2BAAO,UACP,CAAC,iBAAiBA,2BAAO,QACzB,SACF;CAEA,MAAM,eAA6B,gBAC/B;EACE,QAAQ,EAAE,KAAK;EACf,QAAQ,EACN,eAAe,UACjB;EACA,MAAM,EAAE,KAAK;CACf,IACA;EACE,QAAQ;GACN;GACA,MAAM,SAAS,UAAU,mBAAmB,KAAK,CAAC;GAClD,WAAW,SAAS,UAAU;IAC5B,MAAM,OAAO,mBAAmB,KAAK;IACrC,OAAO,KAAK,MAAM,WAAW,eAAeA,4BAAQ,IAAI,CAAC;GAC3D,CAAC;EACH;EACA,QAAQ;GACN,eAAe;GACf,WAAW,SAAS,UAAU;IAC5B,OAAO,KACL,MAAM,WACN,MAAM,QAAQ,eAAeA,4BAAQ,MAAM,IAAI,CACjD;GACF,CAAC;EACH;EACA,MAAM;GACJ;GACA,WAAW,SAAS,UAAU;IAC5B,OAAO,KACL,MAAM,WACN,MAAM,QAAQ,eAAeA,4BAAQ,MAAM,IAAI,CACjD;GACF,CAAC;EACH;CACF;CAEJ,OACE,oBAAC,4BAAD,EAAA,UACE,oBAAC,sBAAD;EACE,OAAO;EACP,cAAc,CAAC,eAAe,IAAI;EAElC,UAAA,oBAAC,OAAD;GAAK,GAAI;GAAM,WAAW;GAAoB;GAAK,MAAK;GACrD;EACE,CAAA;CACe,CAAA,EACI,CAAA;AAEhC,GACA,EACE,MAAM,SACR,CACF"}
1
+ {"version":3,"file":"ActionGroup.mjs","names":["styles"],"sources":["../../../../../../../src/components/ActionGroup/ActionGroup.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./ActionGroup.module.scss\";\nimport { styleClassname } from \"@/lib/scss/selectors\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { ActionStateContextProvider } from \"@/components/Action/models/ActionStateContext\";\nimport { getActionGroupSlot } from \"@/components/ActionGroup/lib/getActionGroupSlot\";\nimport type { ButtonProps } from \"@/components/Button\";\n\nexport interface ActionGroupProps\n extends\n PropsWithChildren,\n FlowComponentProps<HTMLDivElement>,\n PropsWithClassName {\n /** The spacing between the buttons inside the action group. @default \"s\" */\n spacing?: \"s\" | \"m\";\n /** The size of the buttons and links inside the action group. @default \"m\" */\n size?: ButtonProps[\"size\"];\n /**\n * When set, the buttons are not sorted into the slots `primary`, `secondary`\n * and `abort` but stay in source order. Use it when the actions have no such\n * hierarchy, e.g. a row of equal actions or icon buttons. @default false\n */\n preserveOrder?: boolean;\n}\n\n/** @flr-generate all */\nexport const ActionGroup = flowComponent(\n \"ActionGroup\",\n (props) => {\n const {\n children,\n className,\n ref,\n spacing = \"s\",\n size,\n preserveOrder = false,\n ...rest\n } = props;\n\n const rootClassName = clsx(\n styles.actionGroup,\n styles[spacing],\n !preserveOrder && styles.sorted,\n className,\n );\n\n const propsContext: PropsContext = preserveOrder\n ? {\n Button: { size },\n Switch: {\n labelPosition: \"leading\",\n },\n Link: { size },\n }\n : {\n Button: {\n size,\n slot: dynamic((props) => getActionGroupSlot(props)),\n className: dynamic((props) => {\n const slot = getActionGroupSlot(props);\n return clsx(styleClassname(styles, slot), props.className);\n }),\n },\n Switch: {\n labelPosition: \"leading\",\n className: dynamic((props) => {\n return clsx(\n props.slot && styleClassname(styles, props.slot),\n props.className,\n );\n }),\n },\n Link: {\n size,\n className: dynamic((props) => {\n return clsx(\n props.slot && styleClassname(styles, props.slot),\n props.className,\n );\n }),\n },\n };\n\n return (\n <ActionStateContextProvider>\n <PropsContextProvider\n props={propsContext}\n dependencies={[preserveOrder, size]}\n >\n <div {...rest} className={rootClassName} ref={ref} role=\"group\">\n {children}\n </div>\n </PropsContextProvider>\n </ActionStateContextProvider>\n );\n },\n {\n type: \"layout\",\n },\n);\n\nexport default ActionGroup;\n"],"mappings":";;;;;;;;;;;;;AA+BA,IAAa,cAAc,cACzB,gBACC,UAAU;CACT,MAAM,EACJ,UACA,WACA,KACA,UAAU,KACV,MACA,gBAAgB,OAChB,GAAG,SACD;CAEJ,MAAM,gBAAgB,KACpBA,2BAAO,aACPA,2BAAO,UACP,CAAC,iBAAiBA,2BAAO,QACzB,SACF;CAEA,MAAM,eAA6B,gBAC/B;EACE,QAAQ,EAAE,KAAK;EACf,QAAQ,EACN,eAAe,UACjB;EACA,MAAM,EAAE,KAAK;CACf,IACA;EACE,QAAQ;GACN;GACA,MAAM,SAAS,UAAU,mBAAmB,KAAK,CAAC;GAClD,WAAW,SAAS,UAAU;IAC5B,MAAM,OAAO,mBAAmB,KAAK;IACrC,OAAO,KAAK,eAAeA,4BAAQ,IAAI,GAAG,MAAM,SAAS;GAC3D,CAAC;EACH;EACA,QAAQ;GACN,eAAe;GACf,WAAW,SAAS,UAAU;IAC5B,OAAO,KACL,MAAM,QAAQ,eAAeA,4BAAQ,MAAM,IAAI,GAC/C,MAAM,SACR;GACF,CAAC;EACH;EACA,MAAM;GACJ;GACA,WAAW,SAAS,UAAU;IAC5B,OAAO,KACL,MAAM,QAAQ,eAAeA,4BAAQ,MAAM,IAAI,GAC/C,MAAM,SACR;GACF,CAAC;EACH;CACF;CAEJ,OACE,oBAAC,4BAAD,EAAA,UACE,oBAAC,sBAAD;EACE,OAAO;EACP,cAAc,CAAC,eAAe,IAAI;EAElC,UAAA,oBAAC,OAAD;GAAK,GAAI;GAAM,WAAW;GAAoB;GAAK,MAAK;GACrD;EACE,CAAA;CACe,CAAA,EACI,CAAA;AAEhC,GACA,EACE,MAAM,SACR,CACF"}
@@ -6,7 +6,7 @@ import React, { Suspense, useEffect, useLayoutEffect, useState } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { useIsSSR } from "react-aria";
8
8
  //#region src/components/Activity/Activity.tsx
9
- var isActivitySupported = React.version.startsWith("19.2");
9
+ var isActivitySupported = "Activity" in React;
10
10
  var CustomActivity = (props) => {
11
11
  const { children, isActive = true } = props;
12
12
  return /* @__PURE__ */ jsxs(Suspense, {
@@ -1 +1 @@
1
- {"version":3,"file":"Activity.mjs","names":[],"sources":["../../../../../../../src/components/Activity/Activity.tsx"],"sourcesContent":["import SuspenseTrigger from \"@/components/SuspenseTrigger\";\nimport React, { useEffect, useLayoutEffect, useState } from \"react\";\nimport { type FC, type PropsWithChildren } from \"react\";\nimport { Suspense } from \"react\";\nimport { useIsSSR } from \"react-aria\";\nimport {\n ActivityContextProvider,\n useIsActivityActive,\n} from \"@/components/Activity/context\";\n\nexport interface ActivityProps extends PropsWithChildren {\n isActive?: boolean;\n inactiveDelay?: number;\n /** @internal */\n forceCustomActivity?: boolean;\n}\n\nconst isActivitySupported = React.version.startsWith(\"19.2\");\n\nconst CustomActivity: FC<ActivityProps> = (props) => {\n const { children, isActive: isActive = true } = props;\n\n return (\n <Suspense fallback={null}>\n <SuspenseTrigger show={!isActive} />\n {children}\n </Suspense>\n );\n};\n\nexport const Activity: FC<ActivityProps> = (props) => {\n const {\n isActive: isActiveFromProps = true,\n inactiveDelay,\n forceCustomActivity = false,\n children,\n } = props;\n\n const [isActiveState, setIsActiveState] = useState(isActiveFromProps);\n const isSsr = useIsSSR();\n const isParentActive = useIsActivityActive();\n\n useEffect(() => {\n if (!inactiveDelay) {\n return;\n }\n\n if (isActiveFromProps) {\n setIsActiveState(true);\n } else {\n const timeout = setTimeout(() => {\n setIsActiveState(false);\n }, inactiveDelay);\n\n return () => {\n clearTimeout(timeout);\n };\n }\n }, [isActiveFromProps, inactiveDelay]);\n\n const isActive = inactiveDelay ? isActiveState : isActiveFromProps;\n\n /*\n * A hidden subtree keeps rendering, but React commits none of those renders —\n * that holds for React's own `Activity` as much as for the suspended one. Its\n * inline DOM is hidden along with it, yet anything it portalled elsewhere\n * stays on screen, frozen at the last commit: the open Select popover of the\n * tab you just left. So hide one commit after deactivating, which is the\n * commit the subtree needs to unmount its overlays. Setting the state from a\n * layout effect keeps that intermediate commit off the screen.\n */\n const [isHiddenState, setIsHiddenState] = useState(!isActive);\n\n useLayoutEffect(() => {\n setIsHiddenState(!isActive);\n }, [isActive]);\n\n const isHidden = isHiddenState && !isActive;\n\n if (isSsr) {\n return isActive ? children : null;\n }\n\n const content = (\n <ActivityContextProvider value={isParentActive && isActive}>\n {children}\n </ActivityContextProvider>\n );\n\n if (isActivitySupported && !forceCustomActivity) {\n return (\n <React.Activity mode={isHidden ? \"hidden\" : \"visible\"}>\n {content}\n </React.Activity>\n );\n }\n\n return <CustomActivity isActive={!isHidden}>{content}</CustomActivity>;\n};\n\nexport default Activity;\n"],"mappings":";;;;;;;;AAiBA,IAAM,sBAAsB,MAAM,QAAQ,WAAW,MAAM;AAE3D,IAAM,kBAAqC,UAAU;CACnD,MAAM,EAAE,UAAoB,WAAW,SAAS;CAEhD,OACE,qBAAC,UAAD;EAAU,UAAU;EAApB,UAAA,CACE,oBAAC,iBAAD,EAAiB,MAAM,CAAC,SAAW,CAAA,GAClC,QACO;;AAEd;AAEA,IAAa,YAA+B,UAAU;CACpD,MAAM,EACJ,UAAU,oBAAoB,MAC9B,eACA,sBAAsB,OACtB,aACE;CAEJ,MAAM,CAAC,eAAe,oBAAoB,SAAS,iBAAiB;CACpE,MAAM,QAAQ,SAAS;CACvB,MAAM,iBAAiB,oBAAoB;CAE3C,gBAAgB;EACd,IAAI,CAAC,eACH;EAGF,IAAI,mBACF,iBAAiB,IAAI;OAChB;GACL,MAAM,UAAU,iBAAiB;IAC/B,iBAAiB,KAAK;GACxB,GAAG,aAAa;GAEhB,aAAa;IACX,aAAa,OAAO;GACtB;EACF;CACF,GAAG,CAAC,mBAAmB,aAAa,CAAC;CAErC,MAAM,WAAW,gBAAgB,gBAAgB;CAWjD,MAAM,CAAC,eAAe,oBAAoB,SAAS,CAAC,QAAQ;CAE5D,sBAAsB;EACpB,iBAAiB,CAAC,QAAQ;CAC5B,GAAG,CAAC,QAAQ,CAAC;CAEb,MAAM,WAAW,iBAAiB,CAAC;CAEnC,IAAI,OACF,OAAO,WAAW,WAAW;CAG/B,MAAM,UACJ,oBAAC,yBAAD;EAAyB,OAAO,kBAAkB;EAC/C;CACsB,CAAA;CAG3B,IAAI,uBAAuB,CAAC,qBAC1B,OACE,oBAAC,MAAM,UAAP;EAAgB,MAAM,WAAW,WAAW;EACzC,UAAA;CACa,CAAA;CAIpB,OAAO,oBAAC,gBAAD;EAAgB,UAAU,CAAC;EAAW,UAAA;CAAwB,CAAA;AACvE"}
1
+ {"version":3,"file":"Activity.mjs","names":[],"sources":["../../../../../../../src/components/Activity/Activity.tsx"],"sourcesContent":["import SuspenseTrigger from \"@/components/SuspenseTrigger\";\nimport React, { useEffect, useLayoutEffect, useState } from \"react\";\nimport { type FC, type PropsWithChildren } from \"react\";\nimport { Suspense } from \"react\";\nimport { useIsSSR } from \"react-aria\";\nimport {\n ActivityContextProvider,\n useIsActivityActive,\n} from \"@/components/Activity/context\";\n\nexport interface ActivityProps extends PropsWithChildren {\n isActive?: boolean;\n inactiveDelay?: number;\n /** @internal */\n forceCustomActivity?: boolean;\n}\n\nconst isActivitySupported = \"Activity\" in React;\n\nconst CustomActivity: FC<ActivityProps> = (props) => {\n const { children, isActive: isActive = true } = props;\n\n return (\n <Suspense fallback={null}>\n <SuspenseTrigger show={!isActive} />\n {children}\n </Suspense>\n );\n};\n\nexport const Activity: FC<ActivityProps> = (props) => {\n const {\n isActive: isActiveFromProps = true,\n inactiveDelay,\n forceCustomActivity = false,\n children,\n } = props;\n\n const [isActiveState, setIsActiveState] = useState(isActiveFromProps);\n const isSsr = useIsSSR();\n const isParentActive = useIsActivityActive();\n\n useEffect(() => {\n if (!inactiveDelay) {\n return;\n }\n\n if (isActiveFromProps) {\n setIsActiveState(true);\n } else {\n const timeout = setTimeout(() => {\n setIsActiveState(false);\n }, inactiveDelay);\n\n return () => {\n clearTimeout(timeout);\n };\n }\n }, [isActiveFromProps, inactiveDelay]);\n\n const isActive = inactiveDelay ? isActiveState : isActiveFromProps;\n\n /*\n * A hidden subtree keeps rendering, but React commits none of those renders —\n * that holds for React's own `Activity` as much as for the suspended one. Its\n * inline DOM is hidden along with it, yet anything it portalled elsewhere\n * stays on screen, frozen at the last commit: the open Select popover of the\n * tab you just left. So hide one commit after deactivating, which is the\n * commit the subtree needs to unmount its overlays. Setting the state from a\n * layout effect keeps that intermediate commit off the screen.\n */\n const [isHiddenState, setIsHiddenState] = useState(!isActive);\n\n useLayoutEffect(() => {\n setIsHiddenState(!isActive);\n }, [isActive]);\n\n const isHidden = isHiddenState && !isActive;\n\n if (isSsr) {\n return isActive ? children : null;\n }\n\n const content = (\n <ActivityContextProvider value={isParentActive && isActive}>\n {children}\n </ActivityContextProvider>\n );\n\n if (isActivitySupported && !forceCustomActivity) {\n return (\n <React.Activity mode={isHidden ? \"hidden\" : \"visible\"}>\n {content}\n </React.Activity>\n );\n }\n\n return <CustomActivity isActive={!isHidden}>{content}</CustomActivity>;\n};\n\nexport default Activity;\n"],"mappings":";;;;;;;;AAiBA,IAAM,sBAAsB,cAAc;AAE1C,IAAM,kBAAqC,UAAU;CACnD,MAAM,EAAE,UAAoB,WAAW,SAAS;CAEhD,OACE,qBAAC,UAAD;EAAU,UAAU;EAApB,UAAA,CACE,oBAAC,iBAAD,EAAiB,MAAM,CAAC,SAAW,CAAA,GAClC,QACO;;AAEd;AAEA,IAAa,YAA+B,UAAU;CACpD,MAAM,EACJ,UAAU,oBAAoB,MAC9B,eACA,sBAAsB,OACtB,aACE;CAEJ,MAAM,CAAC,eAAe,oBAAoB,SAAS,iBAAiB;CACpE,MAAM,QAAQ,SAAS;CACvB,MAAM,iBAAiB,oBAAoB;CAE3C,gBAAgB;EACd,IAAI,CAAC,eACH;EAGF,IAAI,mBACF,iBAAiB,IAAI;OAChB;GACL,MAAM,UAAU,iBAAiB;IAC/B,iBAAiB,KAAK;GACxB,GAAG,aAAa;GAEhB,aAAa;IACX,aAAa,OAAO;GACtB;EACF;CACF,GAAG,CAAC,mBAAmB,aAAa,CAAC;CAErC,MAAM,WAAW,gBAAgB,gBAAgB;CAWjD,MAAM,CAAC,eAAe,oBAAoB,SAAS,CAAC,QAAQ;CAE5D,sBAAsB;EACpB,iBAAiB,CAAC,QAAQ;CAC5B,GAAG,CAAC,QAAQ,CAAC;CAEb,MAAM,WAAW,iBAAiB,CAAC;CAEnC,IAAI,OACF,OAAO,WAAW,WAAW;CAG/B,MAAM,UACJ,oBAAC,yBAAD;EAAyB,OAAO,kBAAkB;EAC/C;CACsB,CAAA;CAG3B,IAAI,uBAAuB,CAAC,qBAC1B,OACE,oBAAC,MAAM,UAAP;EAAgB,MAAM,WAAW,WAAW;EACzC,UAAA;CACa,CAAA;CAIpB,OAAO,oBAAC,gBAAD;EAAgB,UAAU,CAAC;EAAW,UAAA;CAAwB,CAAA;AACvE"}
@@ -3,6 +3,7 @@
3
3
  import { PropsContextProvider } from "../../lib/propsContext/components/PropsContextProvider.mjs";
4
4
  import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
5
5
  import dynamic from "../../lib/propsContext/dynamicProps/dynamic.mjs";
6
+ import { SectionHeadingReset } from "../Section/context.mjs";
6
7
  import { useSkeletonMode } from "../SkeletonMode/skeletonModeContext.mjs";
7
8
  import { AlertIcon } from "../AlertIcon/AlertIcon.mjs";
8
9
  import Alert_module_default from "./Alert.module.mjs";
@@ -37,11 +38,11 @@ var Alert = flowComponent("Alert", (props) => {
37
38
  ...rest,
38
39
  className: rootClassName,
39
40
  ref,
40
- children: /* @__PURE__ */ jsx(PropsContextProvider, {
41
+ children: /* @__PURE__ */ jsx(SectionHeadingReset, { children: /* @__PURE__ */ jsx(PropsContextProvider, {
41
42
  props: propsContext,
42
43
  dependencies: [status],
43
44
  children
44
- })
45
+ }) })
45
46
  });
46
47
  });
47
48
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.mjs","names":["styles","_Fragment"],"sources":["../../../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { AlertIcon } from \"@/components/AlertIcon\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithStatus } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./Alert.module.scss\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface AlertProps\n extends\n PropsWithChildren<ComponentProps<\"aside\">>,\n PropsWithStatus,\n FlowComponentProps<HTMLElement> {}\n\n/** @flr-generate all */\nexport const Alert = flowComponent(\"Alert\", (props) => {\n const { children, className, status = \"info\", ref, ...rest } = props;\n\n const isSkeleton = useSkeletonMode();\n\n const rootClassName = clsx(\n styles.alert,\n styles[status],\n isSkeleton && styles.skeleton,\n className,\n );\n\n const propsContext: PropsContext = {\n Heading: {\n className: styles.heading,\n level: 3,\n size: \"s\",\n children: dynamic((props) => (\n <>\n <AlertIcon status={status} className={styles.icon} />\n {props.children}\n </>\n )),\n },\n Content: {\n className: styles.content,\n Button: {\n size: \"s\",\n },\n ActionGroup: {\n preserveOrder: true,\n size: \"s\",\n },\n },\n };\n\n return (\n <aside {...rest} className={rootClassName} ref={ref}>\n <PropsContextProvider props={propsContext} dependencies={[status]}>\n {children}\n </PropsContextProvider>\n </aside>\n );\n});\n\nexport default Alert;\n"],"mappings":";;;;;;;;;;;;AAkBA,IAAa,QAAQ,cAAc,UAAU,UAAU;CACrD,MAAM,EAAE,UAAU,WAAW,SAAS,QAAQ,KAAK,GAAG,SAAS;CAE/D,MAAM,aAAa,gBAAgB;CAEnC,MAAM,gBAAgB,KACpBA,qBAAO,OACPA,qBAAO,SACP,cAAcA,qBAAO,UACrB,SACF;CAEA,MAAM,eAA6B;EACjC,SAAS;GACP,WAAWA,qBAAO;GAClB,OAAO;GACP,MAAM;GACN,UAAU,SAAS,UACjB,qBAAAC,UAAA,EAAA,UAAA,CACE,oBAAC,WAAD;IAAmB;IAAQ,WAAWD,qBAAO;GAAO,CAAA,GACnD,MAAM,QACP,EAAA,CAAA,CACH;EACH;EACA,SAAS;GACP,WAAWA,qBAAO;GAClB,QAAQ,EACN,MAAM,IACR;GACA,aAAa;IACX,eAAe;IACf,MAAM;GACR;EACF;CACF;CAEA,OACE,oBAAC,SAAD;EAAO,GAAI;EAAM,WAAW;EAAoB;EAC9C,UAAA,oBAAC,sBAAD;GAAsB,OAAO;GAAc,cAAc,CAAC,MAAM;GAC7D;EACmB,CAAA;CACjB,CAAA;AAEX,CAAC"}
1
+ {"version":3,"file":"Alert.mjs","names":["styles","_Fragment"],"sources":["../../../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { AlertIcon } from \"@/components/AlertIcon\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithStatus } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./Alert.module.scss\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\nimport { SectionHeadingReset } from \"@/components/Section/context\";\n\nexport interface AlertProps\n extends\n PropsWithChildren<ComponentProps<\"aside\">>,\n PropsWithStatus,\n FlowComponentProps<HTMLElement> {}\n\n/** @flr-generate all */\nexport const Alert = flowComponent(\"Alert\", (props) => {\n const { children, className, status = \"info\", ref, ...rest } = props;\n\n const isSkeleton = useSkeletonMode();\n\n const rootClassName = clsx(\n styles.alert,\n styles[status],\n isSkeleton && styles.skeleton,\n className,\n );\n\n const propsContext: PropsContext = {\n Heading: {\n className: styles.heading,\n level: 3,\n size: \"s\",\n children: dynamic((props) => (\n <>\n <AlertIcon status={status} className={styles.icon} />\n {props.children}\n </>\n )),\n },\n Content: {\n className: styles.content,\n Button: {\n size: \"s\",\n },\n ActionGroup: {\n preserveOrder: true,\n size: \"s\",\n },\n },\n };\n\n return (\n <aside {...rest} className={rootClassName} ref={ref}>\n <SectionHeadingReset>\n <PropsContextProvider props={propsContext} dependencies={[status]}>\n {children}\n </PropsContextProvider>\n </SectionHeadingReset>\n </aside>\n );\n});\n\nexport default Alert;\n"],"mappings":";;;;;;;;;;;;;AAmBA,IAAa,QAAQ,cAAc,UAAU,UAAU;CACrD,MAAM,EAAE,UAAU,WAAW,SAAS,QAAQ,KAAK,GAAG,SAAS;CAE/D,MAAM,aAAa,gBAAgB;CAEnC,MAAM,gBAAgB,KACpBA,qBAAO,OACPA,qBAAO,SACP,cAAcA,qBAAO,UACrB,SACF;CAEA,MAAM,eAA6B;EACjC,SAAS;GACP,WAAWA,qBAAO;GAClB,OAAO;GACP,MAAM;GACN,UAAU,SAAS,UACjB,qBAAAC,UAAA,EAAA,UAAA,CACE,oBAAC,WAAD;IAAmB;IAAQ,WAAWD,qBAAO;GAAO,CAAA,GACnD,MAAM,QACP,EAAA,CAAA,CACH;EACH;EACA,SAAS;GACP,WAAWA,qBAAO;GAClB,QAAQ,EACN,MAAM,IACR;GACA,aAAa;IACX,eAAe;IACf,MAAM;GACR;EACF;CACF;CAEA,OACE,oBAAC,SAAD;EAAO,GAAI;EAAM,WAAW;EAAoB;EAC9C,UAAA,oBAAC,qBAAD,EAAA,UACE,oBAAC,sBAAD;GAAsB,OAAO;GAAc,cAAc,CAAC,MAAM;GAC7D;EACmB,CAAA,EACH,CAAA;CAChB,CAAA;AAEX,CAAC"}
@@ -13,7 +13,7 @@ var AlertBadge = flowComponent("AlertBadge", (props) => {
13
13
  const { children, className, status = "info", ref, ...rest } = props;
14
14
  const isSkeleton = useSkeletonMode();
15
15
  const rootClassName = clsx(AlertBadge_module_default.alertBadge, AlertBadge_module_default[status], isSkeleton && AlertBadge_module_default.skeleton, className);
16
- return /* @__PURE__ */ jsx("div", {
16
+ return /* @__PURE__ */ jsx("span", {
17
17
  className: rootClassName,
18
18
  ...rest,
19
19
  ref,
@@ -1 +1 @@
1
- {"version":3,"file":"AlertBadge.mjs","names":["styles"],"sources":["../../../../../../../src/components/AlertBadge/AlertBadge.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./AlertBadge.module.scss\";\nimport clsx from \"clsx\";\nimport { AlertIcon } from \"@/components/AlertIcon\";\nimport { Text } from \"@/components/Text\";\nimport type { PropsWithStatus, PropsWithClassName } from \"@/lib/types/props\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport {\n SkeletonModeReset,\n useSkeletonMode,\n} from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface AlertBadgeProps\n extends\n PropsWithChildren,\n PropsWithStatus,\n FlowComponentProps,\n PropsWithClassName {}\n\n/** @flr-generate all */\nexport const AlertBadge = flowComponent(\"AlertBadge\", (props) => {\n const { children, className, status = \"info\", ref, ...rest } = props;\n\n const isSkeleton = useSkeletonMode();\n\n const rootClassName = clsx(\n styles.alertBadge,\n styles[status],\n isSkeleton && styles.skeleton,\n className,\n );\n\n return (\n <div\n className={rootClassName}\n {...rest}\n ref={ref}\n inert={isSkeleton || undefined}\n >\n <SkeletonModeReset>\n <AlertIcon size=\"s\" status={status} />\n <Text className={styles.text}>{children}</Text>\n </SkeletonModeReset>\n </div>\n );\n});\n\nexport default AlertBadge;\n"],"mappings":";;;;;;;;;;;AAqBA,IAAa,aAAa,cAAc,eAAe,UAAU;CAC/D,MAAM,EAAE,UAAU,WAAW,SAAS,QAAQ,KAAK,GAAG,SAAS;CAE/D,MAAM,aAAa,gBAAgB;CAEnC,MAAM,gBAAgB,KACpBA,0BAAO,YACPA,0BAAO,SACP,cAAcA,0BAAO,UACrB,SACF;CAEA,OACE,oBAAC,OAAD;EACE,WAAW;EACX,GAAI;EACC;EACL,OAAO,cAAc,KAAA;EAErB,UAAA,qBAAC,mBAAD,EAAA,UAAA,CACE,oBAAC,WAAD;GAAW,MAAK;GAAY;EAAS,CAAA,GACrC,oBAAC,MAAD;GAAM,WAAWA,0BAAO;GAAO;EAAe,CAAA,CAC7B,EAAA,CAAA;CAChB,CAAA;AAET,CAAC"}
1
+ {"version":3,"file":"AlertBadge.mjs","names":["styles"],"sources":["../../../../../../../src/components/AlertBadge/AlertBadge.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./AlertBadge.module.scss\";\nimport clsx from \"clsx\";\nimport { AlertIcon } from \"@/components/AlertIcon\";\nimport { Text } from \"@/components/Text\";\nimport type { PropsWithStatus, PropsWithClassName } from \"@/lib/types/props\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport {\n SkeletonModeReset,\n useSkeletonMode,\n} from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface AlertBadgeProps\n extends\n PropsWithChildren,\n PropsWithStatus,\n FlowComponentProps<HTMLSpanElement>,\n PropsWithClassName {}\n\n/** @flr-generate all */\nexport const AlertBadge = flowComponent(\"AlertBadge\", (props) => {\n const { children, className, status = \"info\", ref, ...rest } = props;\n\n const isSkeleton = useSkeletonMode();\n\n const rootClassName = clsx(\n styles.alertBadge,\n styles[status],\n isSkeleton && styles.skeleton,\n className,\n );\n\n return (\n <span\n className={rootClassName}\n {...rest}\n ref={ref}\n inert={isSkeleton || undefined}\n >\n <SkeletonModeReset>\n <AlertIcon size=\"s\" status={status} />\n <Text className={styles.text}>{children}</Text>\n </SkeletonModeReset>\n </span>\n );\n});\n\nexport default AlertBadge;\n"],"mappings":";;;;;;;;;;;AAqBA,IAAa,aAAa,cAAc,eAAe,UAAU;CAC/D,MAAM,EAAE,UAAU,WAAW,SAAS,QAAQ,KAAK,GAAG,SAAS;CAE/D,MAAM,aAAa,gBAAgB;CAEnC,MAAM,gBAAgB,KACpBA,0BAAO,YACPA,0BAAO,SACP,cAAcA,0BAAO,UACrB,SACF;CAEA,OACE,oBAAC,QAAD;EACE,WAAW;EACX,GAAI;EACC;EACL,OAAO,cAAc,KAAA;EAErB,UAAA,qBAAC,mBAAD,EAAA,UAAA,CACE,oBAAC,WAAD;GAAW,MAAK;GAAY;EAAS,CAAA,GACrC,oBAAC,MAAD;GAAM,WAAWA,0BAAO;GAAO;EAAe,CAAA,CAC7B,EAAA,CAAA;CACf,CAAA;AAEV,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AlertBadge.module.mjs","names":[],"sources":["../../../../../../../src/components/AlertBadge/AlertBadge.module.scss"],"sourcesContent":["@use \"@/styles/mixins/ellipsis\";\n@use \"@/styles/mixins/skeleton\";\n\n.alertBadge {\n font-size: var(--badge--font-size);\n font-weight: var(--badge--font-weight);\n line-height: var(--badge--line-height);\n border-radius: var(--badge--corner-radius);\n padding-inline: var(--badge--padding-x);\n padding-block: calc(var(--badge--padding-y) - (var(--badge--border-width)));\n display: flex;\n align-items: center;\n column-gap: var(--badge--spacing);\n max-width: fit-content;\n border-style: var(--badge--border-style);\n border-width: var(--badge--border-width);\n\n .text {\n @include ellipsis.ellipsis();\n }\n\n @extend .info;\n\n /* Status */\n @mixin status($status) {\n &.#{$status} {\n color: var(--alert-badge--#{$status}-content-color);\n background-color: var(--alert-badge--#{$status}-background-color);\n border-color: var(--alert-badge--#{$status}-border-color);\n }\n }\n\n @include status(info);\n @include status(success);\n @include status(warning);\n @include status(danger);\n @include status(unavailable);\n\n /* SkeletonMode */\n\n &.skeleton {\n @include skeleton.shape;\n\n --skeleton-radius: var(--badge--corner-radius);\n }\n}\n\n@include skeleton.keyframes;\n"],"mappings":""}
1
+ {"version":3,"file":"AlertBadge.module.mjs","names":[],"sources":["../../../../../../../src/components/AlertBadge/AlertBadge.module.scss"],"sourcesContent":["@use \"@/styles/mixins/ellipsis\";\n@use \"@/styles/mixins/skeleton\";\n\n.alertBadge {\n font-size: var(--badge--font-size);\n font-weight: var(--badge--font-weight);\n line-height: var(--badge--line-height);\n border-radius: var(--badge--corner-radius);\n padding-inline: var(--badge--padding-x);\n padding-block: calc(var(--badge--padding-y) - (var(--badge--border-width)));\n display: inline-flex;\n align-items: center;\n column-gap: var(--badge--spacing);\n max-width: 100%;\n border-style: var(--badge--border-style);\n border-width: var(--badge--border-width);\n\n .text {\n @include ellipsis.ellipsis();\n\n /* In running text the badge sits on the baseline of its text, not on the\n bottom edge of the icon */\n align-self: baseline;\n }\n\n @extend .info;\n\n /* Status */\n @mixin status($status) {\n &.#{$status} {\n color: var(--alert-badge--#{$status}-content-color);\n background-color: var(--alert-badge--#{$status}-background-color);\n border-color: var(--alert-badge--#{$status}-border-color);\n }\n }\n\n @include status(info);\n @include status(success);\n @include status(warning);\n @include status(danger);\n @include status(unavailable);\n\n /* SkeletonMode */\n\n &.skeleton {\n @include skeleton.shape;\n\n --skeleton-radius: var(--badge--corner-radius);\n }\n}\n\n@include skeleton.keyframes;\n"],"mappings":""}
@@ -67,13 +67,13 @@ var Badge = flowComponent("Badge", (props) => {
67
67
  };
68
68
  return /* @__PURE__ */ jsx(PropsContextProvider, {
69
69
  props: propsContext,
70
- children: /* @__PURE__ */ jsx(SkeletonModeReset, { children: /* @__PURE__ */ jsxs("div", {
70
+ children: /* @__PURE__ */ jsx(SkeletonModeReset, { children: /* @__PURE__ */ jsxs("span", {
71
71
  className: rootClassName,
72
72
  ...rest,
73
73
  ref,
74
74
  inert: isSkeleton || void 0,
75
75
  children: [
76
- !onPress && /* @__PURE__ */ jsx("div", {
76
+ !onPress && /* @__PURE__ */ jsx("span", {
77
77
  className: Badge_module_default.content,
78
78
  children
79
79
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.mjs","names":["locales","styles"],"sources":["../../../../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./Badge.module.scss\";\nimport clsx from \"clsx\";\nimport {\n alphaColors,\n isAlphaColor,\n type PropsWithClassName,\n} from \"@/lib/types/props\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PressEvent } from \"@react-types/shared\";\nimport { Button } from \"@/components/Button\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { ContextualHelpButton } from \"@/components/Badge/components/ContextualHelpButton\";\nimport locales from \"./locales/*.locale.json\";\nimport {\n SkeletonModeReset,\n useSkeletonMode,\n} from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport const badgeColors = [\n \"neutral\",\n \"blue\",\n \"navy\",\n \"violet\",\n \"teal\",\n \"lilac\",\n \"green\",\n \"orange\",\n \"red\",\n ...alphaColors,\n] as const;\nexport type BadgeColors = (typeof badgeColors)[number];\n\nexport interface BadgeProps\n extends PropsWithChildren, FlowComponentProps, PropsWithClassName {\n /** Handler that is called when the badge is pressed. */\n onPress?: (e: PressEvent) => void;\n /** Handler that is called when the badges close icon is pressed. */\n onClose?: (e: PressEvent) => void;\n /** The color of the badge. @default \"neutral\" */\n color?: BadgeColors;\n /** Whether the badge is disabled. */\n isDisabled?: boolean;\n}\n\nconst contextualHelpTunnel = {\n id: \"contextualHelp\",\n component: \"Badge\",\n} as const;\n\n/** @flr-generate all */\nexport const Badge = flowComponent(\"Badge\", (props) => {\n const {\n children,\n className,\n color = \"neutral\",\n ref,\n onPress,\n onClose,\n isDisabled,\n ...rest\n } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"Badge\");\n const isSkeleton = useSkeletonMode();\n\n const rootClassName = clsx(\n styles.badge,\n styles[color],\n isDisabled && styles.disabled,\n isSkeleton && styles.skeleton,\n className,\n );\n\n const buttonColor = isAlphaColor(color) ? color : \"dark\";\n\n const propsContext: PropsContext = {\n Label: {\n elementType: \"span\",\n className: styles.scope,\n unstyled: true,\n },\n Text: {\n elementType: \"span\",\n className: styles.value,\n },\n Button: {\n Label: {\n elementType: \"span\",\n className: styles.scope,\n unstyled: true,\n },\n Text: {\n elementType: \"span\",\n className: styles.value,\n },\n },\n ContextualHelp: {\n tunnel: contextualHelpTunnel,\n wrapWith: (\n <ContextualHelpButton\n className={styles.action}\n color={buttonColor}\n isDisabled={isDisabled}\n />\n ),\n },\n // A trigger the consumer wrote brings its own button. It goes to the same\n // place, styled like the one the badge supplies.\n ContextualHelpTrigger: {\n tunnel: contextualHelpTunnel,\n Button: {\n className: styles.action,\n color: buttonColor,\n variant: \"plain\",\n size: \"s\",\n isDisabled,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n {/* The badge is one skeleton surface, its content draws none. */}\n <SkeletonModeReset>\n <div\n className={rootClassName}\n {...rest}\n ref={ref}\n inert={isSkeleton || undefined}\n >\n {!onPress && <div className={styles.content}>{children}</div>}\n {onPress && (\n <Button\n isDisabled={isDisabled}\n unstyled\n className={styles.button}\n onPress={onPress}\n >\n {children}\n </Button>\n )}\n\n <UiComponentTunnelExit\n id={contextualHelpTunnel.id}\n component=\"Badge\"\n />\n\n {onClose && (\n <Button\n className={styles.close}\n size=\"s\"\n color={buttonColor}\n variant=\"plain\"\n onPress={onClose}\n isDisabled={isDisabled}\n aria-label={stringFormatter.format(\"remove\")}\n >\n <IconClose />\n </Button>\n )}\n </div>\n </SkeletonModeReset>\n </PropsContextProvider>\n );\n});\n\nexport default Badge;\n"],"mappings":";;;;;;;;;;;;;;;AAuB2B,CAUzB,GAAG,WACL;AAeA,IAAM,uBAAuB;CAC3B,IAAI;CACJ,WAAW;AACb;;AAGA,IAAa,QAAQ,cAAc,UAAU,UAAU;CACrD,MAAM,EACJ,UACA,WACA,QAAQ,WACR,KACA,SACA,SACA,YACA,GAAG,SACD;CAEJ,MAAM,kBAAkB,4BAA4BA,kBAAS,OAAO;CACpE,MAAM,aAAa,gBAAgB;CAEnC,MAAM,gBAAgB,KACpBC,qBAAO,OACPA,qBAAO,QACP,cAAcA,qBAAO,UACrB,cAAcA,qBAAO,UACrB,SACF;CAEA,MAAM,cAAc,aAAa,KAAK,IAAI,QAAQ;CAElD,MAAM,eAA6B;EACjC,OAAO;GACL,aAAa;GACb,WAAWA,qBAAO;GAClB,UAAU;EACZ;EACA,MAAM;GACJ,aAAa;GACb,WAAWA,qBAAO;EACpB;EACA,QAAQ;GACN,OAAO;IACL,aAAa;IACb,WAAWA,qBAAO;IAClB,UAAU;GACZ;GACA,MAAM;IACJ,aAAa;IACb,WAAWA,qBAAO;GACpB;EACF;EACA,gBAAgB;GACd,QAAQ;GACR,UACE,oBAAC,sBAAD;IACE,WAAWA,qBAAO;IAClB,OAAO;IACK;GACb,CAAA;EAEL;EAGA,uBAAuB;GACrB,QAAQ;GACR,QAAQ;IACN,WAAWA,qBAAO;IAClB,OAAO;IACP,SAAS;IACT,MAAM;IACN;GACF;EACF;CACF;CAEA,OACE,oBAAC,sBAAD;EAAsB,OAAO;EAE3B,UAAA,oBAAC,mBAAD,EAAA,UACE,qBAAC,OAAD;GACE,WAAW;GACX,GAAI;GACC;GACL,OAAO,cAAc,KAAA;GAJvB,UAAA;IAMG,CAAC,WAAW,oBAAC,OAAD;KAAK,WAAWA,qBAAO;KAAU;IAAc,CAAA;IAC3D,WACC,oBAAC,QAAD;KACc;KACZ,UAAA;KACA,WAAWA,qBAAO;KACT;KAER;IACK,CAAA;IAGV,oBAAC,uBAAD;KACE,IAAI,qBAAqB;KACzB,WAAU;IACX,CAAA;IAEA,WACC,oBAAC,QAAD;KACE,WAAWA,qBAAO;KAClB,MAAK;KACL,OAAO;KACP,SAAQ;KACR,SAAS;KACG;KACZ,cAAY,gBAAgB,OAAO,QAAQ;KAE3C,UAAA,oBAAC,WAAD,CAAY,CAAA;IACN,CAAA;GAEP;EACY,CAAA,EAAA,CAAA;CACC,CAAA;AAE1B,CAAC"}
1
+ {"version":3,"file":"Badge.mjs","names":["locales","styles"],"sources":["../../../../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport styles from \"./Badge.module.scss\";\nimport clsx from \"clsx\";\nimport {\n alphaColors,\n isAlphaColor,\n type PropsWithClassName,\n} from \"@/lib/types/props\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PressEvent } from \"@react-types/shared\";\nimport { Button } from \"@/components/Button\";\nimport { IconClose } from \"@/components/Icon/components/icons\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport { ContextualHelpButton } from \"@/components/Badge/components/ContextualHelpButton\";\nimport locales from \"./locales/*.locale.json\";\nimport {\n SkeletonModeReset,\n useSkeletonMode,\n} from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport const badgeColors = [\n \"neutral\",\n \"blue\",\n \"navy\",\n \"violet\",\n \"teal\",\n \"lilac\",\n \"green\",\n \"orange\",\n \"red\",\n ...alphaColors,\n] as const;\nexport type BadgeColors = (typeof badgeColors)[number];\n\nexport interface BadgeProps\n extends\n PropsWithChildren,\n FlowComponentProps<HTMLSpanElement>,\n PropsWithClassName {\n /** Handler that is called when the badge is pressed. */\n onPress?: (e: PressEvent) => void;\n /** Handler that is called when the badges close icon is pressed. */\n onClose?: (e: PressEvent) => void;\n /** The color of the badge. @default \"neutral\" */\n color?: BadgeColors;\n /** Whether the badge is disabled. */\n isDisabled?: boolean;\n}\n\nconst contextualHelpTunnel = {\n id: \"contextualHelp\",\n component: \"Badge\",\n} as const;\n\n/** @flr-generate all */\nexport const Badge = flowComponent(\"Badge\", (props) => {\n const {\n children,\n className,\n color = \"neutral\",\n ref,\n onPress,\n onClose,\n isDisabled,\n ...rest\n } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales, \"Badge\");\n const isSkeleton = useSkeletonMode();\n\n const rootClassName = clsx(\n styles.badge,\n styles[color],\n isDisabled && styles.disabled,\n isSkeleton && styles.skeleton,\n className,\n );\n\n const buttonColor = isAlphaColor(color) ? color : \"dark\";\n\n const propsContext: PropsContext = {\n Label: {\n elementType: \"span\",\n className: styles.scope,\n unstyled: true,\n },\n Text: {\n elementType: \"span\",\n className: styles.value,\n },\n Button: {\n Label: {\n elementType: \"span\",\n className: styles.scope,\n unstyled: true,\n },\n Text: {\n elementType: \"span\",\n className: styles.value,\n },\n },\n ContextualHelp: {\n tunnel: contextualHelpTunnel,\n wrapWith: (\n <ContextualHelpButton\n className={styles.action}\n color={buttonColor}\n isDisabled={isDisabled}\n />\n ),\n },\n // A trigger the consumer wrote brings its own button. It goes to the same\n // place, styled like the one the badge supplies.\n ContextualHelpTrigger: {\n tunnel: contextualHelpTunnel,\n Button: {\n className: styles.action,\n color: buttonColor,\n variant: \"plain\",\n size: \"s\",\n isDisabled,\n },\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n {/* The badge is one skeleton surface, its content draws none. */}\n <SkeletonModeReset>\n <span\n className={rootClassName}\n {...rest}\n ref={ref}\n inert={isSkeleton || undefined}\n >\n {!onPress && <span className={styles.content}>{children}</span>}\n {onPress && (\n <Button\n isDisabled={isDisabled}\n unstyled\n className={styles.button}\n onPress={onPress}\n >\n {children}\n </Button>\n )}\n\n <UiComponentTunnelExit\n id={contextualHelpTunnel.id}\n component=\"Badge\"\n />\n\n {onClose && (\n <Button\n className={styles.close}\n size=\"s\"\n color={buttonColor}\n variant=\"plain\"\n onPress={onClose}\n isDisabled={isDisabled}\n aria-label={stringFormatter.format(\"remove\")}\n >\n <IconClose />\n </Button>\n )}\n </span>\n </SkeletonModeReset>\n </PropsContextProvider>\n );\n});\n\nexport default Badge;\n"],"mappings":";;;;;;;;;;;;;;;AAuB2B,CAUzB,GAAG,WACL;AAkBA,IAAM,uBAAuB;CAC3B,IAAI;CACJ,WAAW;AACb;;AAGA,IAAa,QAAQ,cAAc,UAAU,UAAU;CACrD,MAAM,EACJ,UACA,WACA,QAAQ,WACR,KACA,SACA,SACA,YACA,GAAG,SACD;CAEJ,MAAM,kBAAkB,4BAA4BA,kBAAS,OAAO;CACpE,MAAM,aAAa,gBAAgB;CAEnC,MAAM,gBAAgB,KACpBC,qBAAO,OACPA,qBAAO,QACP,cAAcA,qBAAO,UACrB,cAAcA,qBAAO,UACrB,SACF;CAEA,MAAM,cAAc,aAAa,KAAK,IAAI,QAAQ;CAElD,MAAM,eAA6B;EACjC,OAAO;GACL,aAAa;GACb,WAAWA,qBAAO;GAClB,UAAU;EACZ;EACA,MAAM;GACJ,aAAa;GACb,WAAWA,qBAAO;EACpB;EACA,QAAQ;GACN,OAAO;IACL,aAAa;IACb,WAAWA,qBAAO;IAClB,UAAU;GACZ;GACA,MAAM;IACJ,aAAa;IACb,WAAWA,qBAAO;GACpB;EACF;EACA,gBAAgB;GACd,QAAQ;GACR,UACE,oBAAC,sBAAD;IACE,WAAWA,qBAAO;IAClB,OAAO;IACK;GACb,CAAA;EAEL;EAGA,uBAAuB;GACrB,QAAQ;GACR,QAAQ;IACN,WAAWA,qBAAO;IAClB,OAAO;IACP,SAAS;IACT,MAAM;IACN;GACF;EACF;CACF;CAEA,OACE,oBAAC,sBAAD;EAAsB,OAAO;EAE3B,UAAA,oBAAC,mBAAD,EAAA,UACE,qBAAC,QAAD;GACE,WAAW;GACX,GAAI;GACC;GACL,OAAO,cAAc,KAAA;GAJvB,UAAA;IAMG,CAAC,WAAW,oBAAC,QAAD;KAAM,WAAWA,qBAAO;KAAU;IAAe,CAAA;IAC7D,WACC,oBAAC,QAAD;KACc;KACZ,UAAA;KACA,WAAWA,qBAAO;KACT;KAER;IACK,CAAA;IAGV,oBAAC,uBAAD;KACE,IAAI,qBAAqB;KACzB,WAAU;IACX,CAAA;IAEA,WACC,oBAAC,QAAD;KACE,WAAWA,qBAAO;KAClB,MAAK;KACL,OAAO;KACP,SAAQ;KACR,SAAS;KACG;KACZ,cAAY,gBAAgB,OAAO,QAAQ;KAE3C,UAAA,oBAAC,WAAD,CAAY,CAAA;IACN,CAAA;GAEN;EACW,CAAA,EAAA,CAAA;CACC,CAAA;AAE1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.module.mjs","names":[],"sources":["../../../../../../../src/components/Badge/Badge.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n@use \"@/styles/mixins/ellipsis\";\n@use \"@/styles/mixins/skeleton\";\n\n.badge {\n display: flex;\n width: fit-content;\n max-width: 100%;\n\n --badge-size: calc(var(--badge--line-height) + var(--badge--padding-y) * 2);\n --content-size: calc(var(--badge-size) - var(--badge--border-width) * 2);\n\n .content,\n .button {\n border-radius: var(--badge--corner-radius);\n border-width: var(--badge--border-width);\n border-style: var(--badge--border-style);\n font-size: var(--badge--font-size);\n font-weight: var(--badge--font-weight);\n padding: 0;\n display: flex;\n overflow: hidden;\n align-items: center;\n height: var(--badge-size);\n line-height: var(--content-size);\n padding-inline: var(--badge--padding-x);\n transition-property: background-color;\n transition-duration: var(--transition--duration--default);\n\n @include ellipsis.ellipsis();\n }\n\n .button,\n .action,\n .close {\n @include focus.focus;\n }\n\n @extend .neutral;\n\n &:has(.close),\n &:has(.action) {\n .button,\n .content {\n padding-inline-end: calc(var(--content-size) + var(--badge--spacing));\n }\n }\n\n &:has(.action):has(.close) {\n .button,\n .content {\n padding-inline-end: calc(var(--content-size) * 2 + var(--badge--spacing));\n }\n }\n\n &:has(.scope) {\n .content,\n .button {\n padding: 0;\n }\n\n .value {\n padding-inline: var(--badge--spacing) var(--badge--padding-x);\n }\n\n .scope {\n padding-inline: var(--badge--padding-x) var(--badge--spacing);\n height: 100%;\n flex-shrink: 0;\n }\n\n &:has(.close),\n &:has(.action) {\n .button,\n .content {\n padding-inline-end: var(--content-size);\n\n .value {\n padding-inline-end: var(--badge--spacing);\n }\n }\n }\n\n &:has(.action):has(.close) {\n .button,\n .content {\n padding-inline-end: calc(var(--content-size) * 2);\n }\n }\n }\n\n .action,\n .close {\n height: var(--content-size);\n padding: calc(var(--badge--padding-y) - var(--badge--border-width));\n border-radius: 0;\n margin-inline-start: calc(\n (var(--content-size) + var(--badge--border-width)) * -1\n );\n margin-top: var(--badge--border-width);\n }\n\n /* The trailing button rounds off the badge */\n .close,\n &:not(:has(.close)) .action {\n border-end-end-radius: var(--badge-size);\n border-start-end-radius: var(--badge-size);\n }\n\n &:has(.action):has(.close) {\n .action {\n margin-inline-start: calc(\n (var(--content-size) * 2 + var(--badge--border-width)) * -1\n );\n }\n\n .close {\n margin-inline-start: 0;\n }\n }\n\n /* Colors */\n\n @mixin color($color) {\n &:where(.#{$color}) {\n .content,\n .button {\n border-color: var(--badge--#{$color}-border-color);\n background-color: var(--badge--#{$color}-background-color--default);\n color: var(--badge--#{$color}-content-color);\n }\n\n &:not(.disabled) {\n .button {\n &:hover {\n background-color: var(--badge--#{$color}-background-color--hover);\n }\n\n &[data-pressed] {\n background-color: var(--badge--#{$color}-background-color--pressed);\n }\n }\n }\n\n .scope {\n background-color: var(--badge--#{$color}-scope-background-color);\n color: var(--badge--#{$color}-scope-content-color);\n }\n }\n }\n\n @include color(\"neutral\");\n @include color(\"blue\");\n @include color(\"navy\");\n @include color(\"violet\");\n @include color(\"teal\");\n @include color(\"lilac\");\n @include color(\"green\");\n @include color(\"orange\");\n @include color(\"red\");\n @include color(\"dark\");\n @include color(\"light\");\n @include color(\"dark-static\");\n @include color(\"light-static\");\n\n &.disabled {\n .content,\n .button {\n border-color: var(--badge--disabled-border-color);\n background-color: var(--badge--disabled-background-color);\n color: var(--badge--disabled-content-color);\n }\n\n .action,\n .close {\n color: var(--badge--disabled-content-color);\n }\n\n .scope {\n background-color: var(--badge--disabled-scope-background-color);\n color: var(--badge--disabled-scope-content-color);\n }\n }\n\n /* Alpha Colors Disabled */\n\n @mixin alphaColor($color) {\n &.#{$color}.disabled {\n .content,\n .button {\n border-color: var(--badge--disabled-#{$color}-border-color);\n background-color: var(--badge--disabled-#{$color}-background-color);\n color: var(--badge--disabled-#{$color}-content-color);\n }\n\n .action,\n .close {\n color: var(--badge--disabled-#{$color}-content-color);\n }\n\n .scope {\n background-color: var(\n --badge--disabled-#{$color}-scope-background-color\n );\n color: var(--badge--disabled-#{$color}-scope-content-color);\n }\n }\n }\n\n @include alphaColor(\"dark\");\n @include alphaColor(\"light\");\n @include alphaColor(\"dark-static\");\n @include alphaColor(\"light-static\");\n\n /* SkeletonMode */\n\n &.skeleton {\n @include skeleton.shape;\n\n --skeleton-radius: var(--badge--corner-radius);\n }\n}\n\n@include skeleton.keyframes;\n"],"mappings":""}
1
+ {"version":3,"file":"Badge.module.mjs","names":[],"sources":["../../../../../../../src/components/Badge/Badge.module.scss"],"sourcesContent":["@use \"@/styles/mixins/focus\";\n@use \"@/styles/mixins/ellipsis\";\n@use \"@/styles/mixins/skeleton\";\n\n.badge {\n display: inline-flex;\n width: fit-content;\n max-width: 100%;\n\n --badge-size: calc(var(--badge--line-height) + var(--badge--padding-y) * 2);\n --content-size: calc(var(--badge-size) - var(--badge--border-width) * 2);\n\n .content,\n .button {\n border-radius: var(--badge--corner-radius);\n border-width: var(--badge--border-width);\n border-style: var(--badge--border-style);\n font-size: var(--badge--font-size);\n font-weight: var(--badge--font-weight);\n padding: 0;\n display: flex;\n overflow: hidden;\n align-items: center;\n height: var(--badge-size);\n line-height: var(--content-size);\n padding-inline: var(--badge--padding-x);\n transition-property: background-color;\n transition-duration: var(--transition--duration--default);\n\n @include ellipsis.ellipsis();\n }\n\n .button,\n .action,\n .close {\n @include focus.focus;\n }\n\n @extend .neutral;\n\n &:has(.close),\n &:has(.action) {\n .button,\n .content {\n padding-inline-end: calc(var(--content-size) + var(--badge--spacing));\n }\n }\n\n &:has(.action):has(.close) {\n .button,\n .content {\n padding-inline-end: calc(var(--content-size) * 2 + var(--badge--spacing));\n }\n }\n\n &:has(.scope) {\n .content,\n .button {\n padding: 0;\n }\n\n .value {\n padding-inline: var(--badge--spacing) var(--badge--padding-x);\n }\n\n .scope {\n padding-inline: var(--badge--padding-x) var(--badge--spacing);\n height: 100%;\n flex-shrink: 0;\n }\n\n &:has(.close),\n &:has(.action) {\n .button,\n .content {\n padding-inline-end: var(--content-size);\n\n .value {\n padding-inline-end: var(--badge--spacing);\n }\n }\n }\n\n &:has(.action):has(.close) {\n .button,\n .content {\n padding-inline-end: calc(var(--content-size) * 2);\n }\n }\n }\n\n .action,\n .close {\n height: var(--content-size);\n padding: calc(var(--badge--padding-y) - var(--badge--border-width));\n border-radius: 0;\n margin-inline-start: calc(\n (var(--content-size) + var(--badge--border-width)) * -1\n );\n margin-top: var(--badge--border-width);\n }\n\n /* The trailing button rounds off the badge */\n .close,\n &:not(:has(.close)) .action {\n border-end-end-radius: var(--badge-size);\n border-start-end-radius: var(--badge-size);\n }\n\n &:has(.action):has(.close) {\n .action {\n margin-inline-start: calc(\n (var(--content-size) * 2 + var(--badge--border-width)) * -1\n );\n }\n\n .close {\n margin-inline-start: 0;\n }\n }\n\n /* Colors */\n\n @mixin color($color) {\n &:where(.#{$color}) {\n .content,\n .button {\n border-color: var(--badge--#{$color}-border-color);\n background-color: var(--badge--#{$color}-background-color--default);\n color: var(--badge--#{$color}-content-color);\n }\n\n &:not(.disabled) {\n .button {\n &:hover {\n background-color: var(--badge--#{$color}-background-color--hover);\n }\n\n &[data-pressed] {\n background-color: var(--badge--#{$color}-background-color--pressed);\n }\n }\n }\n\n .scope {\n background-color: var(--badge--#{$color}-scope-background-color);\n color: var(--badge--#{$color}-scope-content-color);\n }\n }\n }\n\n @include color(\"neutral\");\n @include color(\"blue\");\n @include color(\"navy\");\n @include color(\"violet\");\n @include color(\"teal\");\n @include color(\"lilac\");\n @include color(\"green\");\n @include color(\"orange\");\n @include color(\"red\");\n @include color(\"dark\");\n @include color(\"light\");\n @include color(\"dark-static\");\n @include color(\"light-static\");\n\n &.disabled {\n .content,\n .button {\n border-color: var(--badge--disabled-border-color);\n background-color: var(--badge--disabled-background-color);\n color: var(--badge--disabled-content-color);\n }\n\n .action,\n .close {\n color: var(--badge--disabled-content-color);\n }\n\n .scope {\n background-color: var(--badge--disabled-scope-background-color);\n color: var(--badge--disabled-scope-content-color);\n }\n }\n\n /* Alpha Colors Disabled */\n\n @mixin alphaColor($color) {\n &.#{$color}.disabled {\n .content,\n .button {\n border-color: var(--badge--disabled-#{$color}-border-color);\n background-color: var(--badge--disabled-#{$color}-background-color);\n color: var(--badge--disabled-#{$color}-content-color);\n }\n\n .action,\n .close {\n color: var(--badge--disabled-#{$color}-content-color);\n }\n\n .scope {\n background-color: var(\n --badge--disabled-#{$color}-scope-background-color\n );\n color: var(--badge--disabled-#{$color}-scope-content-color);\n }\n }\n }\n\n @include alphaColor(\"dark\");\n @include alphaColor(\"light\");\n @include alphaColor(\"dark-static\");\n @include alphaColor(\"light-static\");\n\n /* SkeletonMode */\n\n &.skeleton {\n @include skeleton.shape;\n\n --skeleton-radius: var(--badge--corner-radius);\n }\n}\n\n@include skeleton.keyframes;\n"],"mappings":""}
@@ -4,9 +4,9 @@ import { useLocalizedStringFormatter } from "../../../../TranslationProvider/use
4
4
  import __locale_default from "../../../../../../../../_virtual/_7.locale.mjs";
5
5
  import { useContext, useMemo } from "react";
6
6
  import { RangeCalendarStateContext } from "react-aria-components";
7
- import invariant from "invariant";
8
7
  import { CalendarDate, toCalendarDate } from "@internationalized/date";
9
8
  import { DateTime } from "luxon";
9
+ import invariant from "invariant";
10
10
  //#region src/components/Calendar/components/RangeCalendar/helpers/useCalendarDateRangePresets.ts
11
11
  var clampCalendarDate = (date, minDate, maxDate) => {
12
12
  if (minDate && date.compare(minDate) < 0) return minDate;
@@ -16,10 +16,12 @@ import { TypedChartLegend } from "./components/ChartLegend/ChartLegend.mjs";
16
16
  import { TypedChartTooltip } from "./components/ChartTooltip/types.mjs";
17
17
  import { TypedLine } from "./components/Line/Line.mjs";
18
18
  import clsx from "clsx";
19
- import { isValidElement, useId, useMemo } from "react";
19
+ import { useId, useMemo } from "react";
20
20
  import { jsx, jsxs } from "react/jsx-runtime";
21
21
  import { ComposedChart, ResponsiveContainer } from "recharts";
22
22
  //#region src/components/CartesianChart/CartesianChart.tsx
23
+ var reactComponentTypes = [Symbol.for("react.memo"), Symbol.for("react.forward_ref")];
24
+ var isEmptyViewComponent = (value) => typeof value === "function" || typeof value === "object" && value !== null && "$$typeof" in value && reactComponentTypes.includes(value.$$typeof);
23
25
  /** @flr-generate all */
24
26
  var CartesianChart = (props) => {
25
27
  const { children, data, className, height, flexGrow, emptyView, layout = "horizontal", ...rest } = props;
@@ -27,12 +29,8 @@ var CartesianChart = (props) => {
27
29
  const { viewDimensions, ref: containerRef } = useChartClipRect();
28
30
  const showEmptyView = !!((!data || data.length === 0) && emptyView);
29
31
  const rootClassName = clsx(CartesianChart_module_default.cartesianChart, showEmptyView && CartesianChart_module_default.emptyView, className);
30
- if (!!emptyView && !isValidElement(emptyView)) warnDeprecation("CartesianChart: emptyView as a non-element is deprecated and will be removed in a future release. Please provide an element as emptyView.");
31
- const emptyElement = useMemo(() => {
32
- if (isValidElement(emptyView)) return emptyView;
33
- if (!emptyView) return;
34
- return null;
35
- }, [emptyView]);
32
+ const EmptyViewComponent = isEmptyViewComponent(emptyView) ? emptyView : void 0;
33
+ if (EmptyViewComponent) warnDeprecation("Passing a component to the 'emptyView' prop is deprecated and will be removed in a future release. Use 'emptyView={<Element />}' instead.");
36
34
  const chartId = useId().replaceAll(/[^\w-]/g, "");
37
35
  const contextValue = useMemo(() => ({
38
36
  layout,
@@ -74,7 +72,7 @@ var CartesianChart = (props) => {
74
72
  ...viewDimensions,
75
73
  children: /* @__PURE__ */ jsx(DivView, {
76
74
  className: CartesianChart_module_default.emptyViewContainer,
77
- children: emptyElement
75
+ children: EmptyViewComponent ? /* @__PURE__ */ jsx(EmptyViewComponent, { data }) : emptyView
78
76
  })
79
77
  })]
80
78
  })
@@ -1 +1 @@
1
- {"version":3,"file":"CartesianChart.mjs","names":["styles"],"sources":["../../../../../../../src/components/CartesianChart/CartesianChart.tsx"],"sourcesContent":["import { ComposedChart, ResponsiveContainer } from \"recharts\";\nimport {\n type ComponentProps,\n type ComponentType,\n type FC,\n isValidElement,\n type PropsWithChildren,\n type ReactNode,\n useId,\n useMemo,\n} from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./CartesianChart.module.scss\";\nimport { useChartClipRect } from \"@/components/CartesianChart/hooks/useChartClipRect\";\nimport DivView from \"@/views/DivView\";\nimport Wrap from \"@/components/Wrap\";\nimport type {\n CartesianChartLayout,\n ChartDataValue,\n DataKeyProp,\n} from \"@/components/CartesianChart/types\";\nimport { CartesianChartContextProvider } from \"@/components/CartesianChart/context\";\nimport { TypedArea } from \"@/components/CartesianChart/components/Area\";\nimport { TypedBar } from \"@/components/CartesianChart/components/Bar\";\nimport { TypedXAxis } from \"@/components/CartesianChart/components/XAxis\";\nimport { TypedYAxis } from \"@/components/CartesianChart/components/YAxis\";\nimport { TypedChartGrid } from \"@/components/CartesianChart/components/ChartGrid\";\nimport { TypedChartLegend } from \"@/components/CartesianChart/components/ChartLegend\";\nimport { TypedChartTooltip } from \"@/components/CartesianChart/components/ChartTooltip\";\nimport { TypedLine } from \"@/components/CartesianChart/components/Line\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\n/** @deprecated Use a ReactNode instead */\nexport interface CartesianChartEmptyViewProps {\n data?: ComponentProps<typeof ComposedChart>[\"data\"];\n}\n\nexport interface CartesianChartProps<TData = ChartDataValue>\n extends\n Pick<\n ComponentProps<typeof ComposedChart>,\n \"className\" | \"syncId\" | \"syncMethod\"\n >,\n PropsWithChildren {\n /** The data points rendered by the chart. */\n data?: TData[];\n\n /** The height of the chart. */\n height?: string;\n\n /**\n * The orientation of the axes and graphical items. `\"horizontal\"` puts the\n * category axis on the x-axis — bars grow upwards. `\"vertical\"` puts it on\n * the y-axis — bars grow to the side. `XAxis` and `YAxis` follow the layout\n * on their own; only the `dataKey` moves to whichever axis is the categorical\n * one.\n *\n * @default \"horizontal\"\n */\n layout?: CartesianChartLayout;\n\n /** View that is provided when data is empty/undefined */\n emptyView?: ReactNode;\n\n /**\n * Allow the height controlling container to set flex-grow: 1. Can only be\n * used in combination with `height`\n */\n flexGrow?: boolean;\n}\n\n/** @flr-generate all */\nexport const CartesianChart: FC<CartesianChartProps> = (props) => {\n const {\n children,\n data,\n className,\n height,\n flexGrow,\n emptyView,\n layout = \"horizontal\",\n ...rest\n } = props;\n const warnDeprecation = useWarnDeprecation();\n\n const { viewDimensions, ref: containerRef } = useChartClipRect();\n\n const showEmptyView = !!((!data || data.length === 0) && emptyView);\n const rootClassName = clsx(\n styles.cartesianChart,\n showEmptyView && styles.emptyView,\n className,\n );\n const usesDeprecatedEmptyView = !!emptyView && !isValidElement(emptyView);\n\n if (usesDeprecatedEmptyView) {\n warnDeprecation(\n \"CartesianChart: emptyView as a non-element is deprecated and will be removed in a future release. Please provide an element as emptyView.\",\n );\n }\n\n const emptyElement = useMemo(() => {\n if (isValidElement(emptyView)) {\n return emptyView;\n }\n\n if (!emptyView) {\n return;\n }\n\n return null;\n }, [emptyView]);\n\n const chartId = useId().replaceAll(/[^\\w-]/g, \"\");\n const contextValue = useMemo(\n () => ({ layout, stackIdPrefix: `${chartId}-` }),\n [layout, chartId],\n );\n\n const isSkeleton = useSkeletonMode();\n\n /* No recharts and no svg: one surface in the size the chart would take. */\n if (isSkeleton) {\n return (\n <div\n className={styles.skeleton}\n style={{\n height,\n aspectRatio: height ? undefined : 3,\n flex: flexGrow ? 1 : undefined,\n }}\n aria-hidden\n inert\n />\n );\n }\n\n return (\n <CartesianChartContextProvider value={contextValue}>\n <Wrap if={height}>\n <div style={{ height, flex: flexGrow ? 1 : undefined }}>\n <ResponsiveContainer\n initialDimension={{\n // fix warning on initial render\n width: 1,\n height: 1,\n }}\n width={height ? undefined : \"100%\"}\n aspect={height ? undefined : 3}\n ref={containerRef}\n >\n <ComposedChart\n data={data}\n className={rootClassName}\n layout={layout}\n {...rest}\n >\n {children}\n {showEmptyView && viewDimensions && (\n <foreignObject {...viewDimensions}>\n <DivView className={styles.emptyViewContainer}>\n {emptyElement}\n </DivView>\n </foreignObject>\n )}\n </ComposedChart>\n </ResponsiveContainer>\n </div>\n </Wrap>\n </CartesianChartContextProvider>\n );\n};\n\nexport const typedCartesianChart = <\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TData extends ChartDataValue<any> = ChartDataValue<any>,\n XAxisDataKey extends DataKeyProp<TData> = DataKeyProp<TData>,\n>() => ({\n Chart: CartesianChart as ComponentType<CartesianChartProps<TData>>,\n Area: TypedArea<TData>(),\n Bar: TypedBar<TData>(),\n XAxis: TypedXAxis<TData, XAxisDataKey>(),\n YAxis: TypedYAxis<TData>(),\n Grid: TypedChartGrid(),\n Legend: TypedChartLegend(),\n Tooltip: TypedChartTooltip<TData, XAxisDataKey>(),\n Line: TypedLine<TData>(),\n});\n\nexport default CartesianChart;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyEA,IAAa,kBAA2C,UAAU;CAChE,MAAM,EACJ,UACA,MACA,WACA,QACA,UACA,WACA,SAAS,cACT,GAAG,SACD;CACJ,MAAM,kBAAkB,mBAAmB;CAE3C,MAAM,EAAE,gBAAgB,KAAK,iBAAiB,iBAAiB;CAE/D,MAAM,gBAAgB,CAAC,GAAG,CAAC,QAAQ,KAAK,WAAW,MAAM;CACzD,MAAM,gBAAgB,KACpBA,8BAAO,gBACP,iBAAiBA,8BAAO,WACxB,SACF;CAGA,IAFgC,CAAC,CAAC,aAAa,CAAC,eAAe,SAAS,GAGtE,gBACE,2IACF;CAGF,MAAM,eAAe,cAAc;EACjC,IAAI,eAAe,SAAS,GAC1B,OAAO;EAGT,IAAI,CAAC,WACH;EAGF,OAAO;CACT,GAAG,CAAC,SAAS,CAAC;CAEd,MAAM,UAAU,MAAM,CAAC,CAAC,WAAW,WAAW,EAAE;CAChD,MAAM,eAAe,eACZ;EAAE;EAAQ,eAAe,GAAG,QAAQ;CAAG,IAC9C,CAAC,QAAQ,OAAO,CAClB;CAKA,IAHmB,gBAGf,GACF,OACE,oBAAC,OAAD;EACE,WAAWA,8BAAO;EAClB,OAAO;GACL;GACA,aAAa,SAAS,KAAA,IAAY;GAClC,MAAM,WAAW,IAAI,KAAA;EACvB;EACA,eAAA;EACA,OAAA;CACD,CAAA;CAIL,OACE,oBAAC,+BAAD;EAA+B,OAAO;EACpC,UAAA,oBAAC,MAAD;GAAM,IAAI;GACR,UAAA,oBAAC,OAAD;IAAK,OAAO;KAAE;KAAQ,MAAM,WAAW,IAAI,KAAA;IAAU;IACnD,UAAA,oBAAC,qBAAD;KACE,kBAAkB;MAEhB,OAAO;MACP,QAAQ;KACV;KACA,OAAO,SAAS,KAAA,IAAY;KAC5B,QAAQ,SAAS,KAAA,IAAY;KAC7B,KAAK;KAEL,UAAA,qBAAC,eAAD;MACQ;MACN,WAAW;MACH;MACR,GAAI;MAJN,UAAA,CAMG,UACA,iBAAiB,kBAChB,oBAAC,iBAAD;OAAe,GAAI;OACjB,UAAA,oBAAC,SAAD;QAAS,WAAWA,8BAAO;QACxB,UAAA;OACM,CAAA;MACI,CAAA,CAEJ;;IACI,CAAA;GAClB,CAAA;EACD,CAAA;CACuB,CAAA;AAEnC;AAEA,IAAa,6BAIL;CACN,OAAO;CACP,MAAM,UAAiB;CACvB,KAAK,SAAgB;CACrB,OAAO,WAAgC;CACvC,OAAO,WAAkB;CACzB,MAAM,eAAe;CACrB,QAAQ,iBAAiB;CACzB,SAAS,kBAAuC;CAChD,MAAM,UAAiB;AACzB"}
1
+ {"version":3,"file":"CartesianChart.mjs","names":["styles"],"sources":["../../../../../../../src/components/CartesianChart/CartesianChart.tsx"],"sourcesContent":["import { ComposedChart, ResponsiveContainer } from \"recharts\";\nimport {\n type ComponentProps,\n type ComponentType,\n type FC,\n type PropsWithChildren,\n type ReactNode,\n useId,\n useMemo,\n} from \"react\";\nimport clsx from \"clsx\";\nimport styles from \"./CartesianChart.module.scss\";\nimport { useChartClipRect } from \"@/components/CartesianChart/hooks/useChartClipRect\";\nimport DivView from \"@/views/DivView\";\nimport Wrap from \"@/components/Wrap\";\nimport type {\n CartesianChartLayout,\n ChartDataValue,\n DataKeyProp,\n} from \"@/components/CartesianChart/types\";\nimport { CartesianChartContextProvider } from \"@/components/CartesianChart/context\";\nimport { TypedArea } from \"@/components/CartesianChart/components/Area\";\nimport { TypedBar } from \"@/components/CartesianChart/components/Bar\";\nimport { TypedXAxis } from \"@/components/CartesianChart/components/XAxis\";\nimport { TypedYAxis } from \"@/components/CartesianChart/components/YAxis\";\nimport { TypedChartGrid } from \"@/components/CartesianChart/components/ChartGrid\";\nimport { TypedChartLegend } from \"@/components/CartesianChart/components/ChartLegend\";\nimport { TypedChartTooltip } from \"@/components/CartesianChart/components/ChartTooltip\";\nimport { TypedLine } from \"@/components/CartesianChart/components/Line\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\n/** @deprecated Use a ReactNode instead */\nexport interface CartesianChartEmptyViewProps {\n data?: ComponentProps<typeof ComposedChart>[\"data\"];\n}\n\nexport interface CartesianChartProps<TData = ChartDataValue>\n extends\n Pick<\n ComponentProps<typeof ComposedChart>,\n \"className\" | \"syncId\" | \"syncMethod\"\n >,\n PropsWithChildren {\n /** The data points rendered by the chart. */\n data?: TData[];\n\n /** The height of the chart. */\n height?: string;\n\n /**\n * The orientation of the axes and graphical items. `\"horizontal\"` puts the\n * category axis on the x-axis — bars grow upwards. `\"vertical\"` puts it on\n * the y-axis — bars grow to the side. `XAxis` and `YAxis` follow the layout\n * on their own; only the `dataKey` moves to whichever axis is the categorical\n * one.\n *\n * @default \"horizontal\"\n */\n layout?: CartesianChartLayout;\n\n /** View that is provided when data is empty/undefined */\n emptyView?: ReactNode;\n\n /**\n * Allow the height controlling container to set flex-grow: 1. Can only be\n * used in combination with `height`\n */\n flexGrow?: boolean;\n}\n\nconst reactComponentTypes = [\n Symbol.for(\"react.memo\"),\n Symbol.for(\"react.forward_ref\"),\n];\n\nconst isEmptyViewComponent = (\n value: unknown,\n): value is ComponentType<CartesianChartEmptyViewProps> =>\n typeof value === \"function\" ||\n (typeof value === \"object\" &&\n value !== null &&\n \"$$typeof\" in value &&\n reactComponentTypes.includes(value.$$typeof as symbol));\n\n/** @flr-generate all */\nexport const CartesianChart: FC<CartesianChartProps> = (props) => {\n const {\n children,\n data,\n className,\n height,\n flexGrow,\n emptyView,\n layout = \"horizontal\",\n ...rest\n } = props;\n const warnDeprecation = useWarnDeprecation();\n\n const { viewDimensions, ref: containerRef } = useChartClipRect();\n\n const showEmptyView = !!((!data || data.length === 0) && emptyView);\n const rootClassName = clsx(\n styles.cartesianChart,\n showEmptyView && styles.emptyView,\n className,\n );\n const EmptyViewComponent = isEmptyViewComponent(emptyView)\n ? emptyView\n : undefined;\n\n if (EmptyViewComponent) {\n warnDeprecation(\n \"Passing a component to the 'emptyView' prop is deprecated and will be removed in a future release. Use 'emptyView={<Element />}' instead.\",\n );\n }\n\n const chartId = useId().replaceAll(/[^\\w-]/g, \"\");\n const contextValue = useMemo(\n () => ({ layout, stackIdPrefix: `${chartId}-` }),\n [layout, chartId],\n );\n\n const isSkeleton = useSkeletonMode();\n\n /* No recharts and no svg: one surface in the size the chart would take. */\n if (isSkeleton) {\n return (\n <div\n className={styles.skeleton}\n style={{\n height,\n aspectRatio: height ? undefined : 3,\n flex: flexGrow ? 1 : undefined,\n }}\n aria-hidden\n inert\n />\n );\n }\n\n return (\n <CartesianChartContextProvider value={contextValue}>\n <Wrap if={height}>\n <div style={{ height, flex: flexGrow ? 1 : undefined }}>\n <ResponsiveContainer\n initialDimension={{\n // fix warning on initial render\n width: 1,\n height: 1,\n }}\n width={height ? undefined : \"100%\"}\n aspect={height ? undefined : 3}\n ref={containerRef}\n >\n <ComposedChart\n data={data}\n className={rootClassName}\n layout={layout}\n {...rest}\n >\n {children}\n {showEmptyView && viewDimensions && (\n <foreignObject {...viewDimensions}>\n <DivView className={styles.emptyViewContainer}>\n {EmptyViewComponent ? (\n <EmptyViewComponent data={data} />\n ) : (\n emptyView\n )}\n </DivView>\n </foreignObject>\n )}\n </ComposedChart>\n </ResponsiveContainer>\n </div>\n </Wrap>\n </CartesianChartContextProvider>\n );\n};\n\nexport const typedCartesianChart = <\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TData extends ChartDataValue<any> = ChartDataValue<any>,\n XAxisDataKey extends DataKeyProp<TData> = DataKeyProp<TData>,\n>() => ({\n Chart: CartesianChart as ComponentType<CartesianChartProps<TData>>,\n Area: TypedArea<TData>(),\n Bar: TypedBar<TData>(),\n XAxis: TypedXAxis<TData, XAxisDataKey>(),\n YAxis: TypedYAxis<TData>(),\n Grid: TypedChartGrid(),\n Legend: TypedChartLegend(),\n Tooltip: TypedChartTooltip<TData, XAxisDataKey>(),\n Line: TypedLine<TData>(),\n});\n\nexport default CartesianChart;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuEA,IAAM,sBAAsB,CAC1B,OAAO,IAAI,YAAY,GACvB,OAAO,IAAI,mBAAmB,CAChC;AAEA,IAAM,wBACJ,UAEA,OAAO,UAAU,cAChB,OAAO,UAAU,YAChB,UAAU,QACV,cAAc,SACd,oBAAoB,SAAS,MAAM,QAAkB;;AAGzD,IAAa,kBAA2C,UAAU;CAChE,MAAM,EACJ,UACA,MACA,WACA,QACA,UACA,WACA,SAAS,cACT,GAAG,SACD;CACJ,MAAM,kBAAkB,mBAAmB;CAE3C,MAAM,EAAE,gBAAgB,KAAK,iBAAiB,iBAAiB;CAE/D,MAAM,gBAAgB,CAAC,GAAG,CAAC,QAAQ,KAAK,WAAW,MAAM;CACzD,MAAM,gBAAgB,KACpBA,8BAAO,gBACP,iBAAiBA,8BAAO,WACxB,SACF;CACA,MAAM,qBAAqB,qBAAqB,SAAS,IACrD,YACA,KAAA;CAEJ,IAAI,oBACF,gBACE,2IACF;CAGF,MAAM,UAAU,MAAM,CAAC,CAAC,WAAW,WAAW,EAAE;CAChD,MAAM,eAAe,eACZ;EAAE;EAAQ,eAAe,GAAG,QAAQ;CAAG,IAC9C,CAAC,QAAQ,OAAO,CAClB;CAKA,IAHmB,gBAGf,GACF,OACE,oBAAC,OAAD;EACE,WAAWA,8BAAO;EAClB,OAAO;GACL;GACA,aAAa,SAAS,KAAA,IAAY;GAClC,MAAM,WAAW,IAAI,KAAA;EACvB;EACA,eAAA;EACA,OAAA;CACD,CAAA;CAIL,OACE,oBAAC,+BAAD;EAA+B,OAAO;EACpC,UAAA,oBAAC,MAAD;GAAM,IAAI;GACR,UAAA,oBAAC,OAAD;IAAK,OAAO;KAAE;KAAQ,MAAM,WAAW,IAAI,KAAA;IAAU;IACnD,UAAA,oBAAC,qBAAD;KACE,kBAAkB;MAEhB,OAAO;MACP,QAAQ;KACV;KACA,OAAO,SAAS,KAAA,IAAY;KAC5B,QAAQ,SAAS,KAAA,IAAY;KAC7B,KAAK;KAEL,UAAA,qBAAC,eAAD;MACQ;MACN,WAAW;MACH;MACR,GAAI;MAJN,UAAA,CAMG,UACA,iBAAiB,kBAChB,oBAAC,iBAAD;OAAe,GAAI;OACjB,UAAA,oBAAC,SAAD;QAAS,WAAWA,8BAAO;QACxB,UAAA,qBACC,oBAAC,oBAAD,EAA0B,KAAO,CAAA,IAEjC;OAEK,CAAA;MACI,CAAA,CAEJ;;IACI,CAAA;GAClB,CAAA;EACD,CAAA;CACuB,CAAA;AAEnC;AAEA,IAAa,6BAIL;CACN,OAAO;CACP,MAAM,UAAiB;CACvB,KAAK,SAAgB;CACrB,OAAO,WAAgC;CACvC,OAAO,WAAkB;CACzB,MAAM,eAAe;CACrB,QAAQ,iBAAiB;CACzB,SAAS,kBAAuC;CAChD,MAAM,UAAiB;AACzB"}
@@ -2,6 +2,7 @@
2
2
  /* */
3
3
  import { useDesignTokens } from "../../../../lib/theming/hooks/useDesignTokens.mjs";
4
4
  import { useCartesianChartContext } from "../../context.mjs";
5
+ import { useTickLabelWidth } from "../../hooks/useTickLabelWidth.mjs";
5
6
  import { TypedYAxis } from "./types.mjs";
6
7
  import { jsx } from "react/jsx-runtime";
7
8
  import * as Recharts from "recharts";
@@ -20,17 +21,34 @@ var YAxis = (props) => {
20
21
  const { domain, type = "auto", width, ...rest } = props;
21
22
  const tokens = useDesignTokens();
22
23
  const { layout } = useCartesianChartContext();
23
- const isCategoryAxis = type === "category" || type === "auto" && layout === "vertical";
24
+ const tickLabels = useTickLabelWidth();
25
+ const isAutoWidth = (width ?? (type === "category" || type === "auto" && layout === "vertical" ? "auto" : void 0)) === "auto";
26
+ const tickMargin = parseInt(tokens.axis.spacing.value);
27
+ const tickSize = parseInt(tokens.axis["tick-size"].value);
28
+ const tickFill = tokens.axis["color"].value;
29
+ const autoWidth = tickLabels.width === void 0 ? "auto" : tickLabels.width + tickSize + tickMargin;
30
+ const measuredTick = (tickProps) => {
31
+ const { payload, index, tickFormatter } = tickProps;
32
+ const value = `${tickFormatter ? tickFormatter(payload.value, index) : payload.value}${rest.unit ?? ""}`;
33
+ return /* @__PURE__ */ jsx(Recharts.Text, {
34
+ ...tickProps,
35
+ ref: tickLabels.labelRef,
36
+ className: "recharts-cartesian-axis-tick-value",
37
+ fill: tickFill,
38
+ width: void 0,
39
+ children: value
40
+ });
41
+ };
24
42
  return /* @__PURE__ */ jsx(Recharts.YAxis, {
25
43
  ...rest,
26
44
  allowDataOverflow: true,
27
45
  domain,
28
46
  type,
29
- width: width ?? (isCategoryAxis ? "auto" : void 0),
47
+ width: isAutoWidth ? autoWidth : width,
30
48
  fontSize: tokens.axis["font-size"].value,
31
- tick: { fill: tokens.axis["color"].value },
32
- tickMargin: parseInt(tokens.axis.spacing.value),
33
- tickSize: parseInt(tokens.axis["tick-size"].value)
49
+ tick: isAutoWidth ? measuredTick : { fill: tickFill },
50
+ tickMargin,
51
+ tickSize
34
52
  });
35
53
  };
36
54
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"YAxis.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/YAxis/YAxis.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type {\n ChartDataValue,\n DataKey,\n DataKeyValue,\n} from \"@/components/CartesianChart/types\";\nimport { useCartesianChartContext } from \"@/components/CartesianChart/context\";\nimport { useDesignTokens } from \"@/lib/theming\";\n\nexport type YAxisProps<\n TData extends ChartDataValue = ChartDataValue,\n TDataKey extends DataKey<TData> = DataKey<TData>,\n TDataMatch = DataKeyValue<TData, TDataKey>,\n> = Pick<\n Recharts.YAxisProps,\n | \"className\"\n | \"orientation\"\n | \"allowDecimals\"\n | \"interval\"\n | \"minTickGap\"\n | \"scale\"\n | \"type\"\n | \"domain\"\n | \"hide\"\n | \"unit\"\n> & {\n dataKey?: TDataKey;\n tickFormatter?: (value: TDataMatch, index: number) => string;\n /**\n * The width of the axis in pixels. `\"auto\"` sizes the axis to its widest tick\n * label. Defaults to `\"auto\"` for a category axis (e.g. with `layout` set to\n * `\"vertical\"`) and to `60` otherwise. Pin a number to align the plot areas\n * of synchronized charts.\n */\n width?: number | \"auto\";\n};\n\n/**\n * `tickFormatter` is deliberately not part of the remote surface. A function\n * property crosses the boundary as a thread proxy whose call returns a Promise,\n * and recharts concatenates the formatter's result straight into the tick label\n * — so remotely every tick rendered `[object Promise]`. Dropping it from the\n * remote surface leaves the raw value there; the prop keeps working locally.\n *\n * @flr-generate all\n * @flr-ignore-props tickFormatter\n */\nexport const YAxis: FC<YAxisProps> = (props) => {\n const { domain, type = \"auto\", width, ...rest } = props;\n\n const tokens = useDesignTokens();\n const { layout } = useCartesianChartContext();\n\n const isCategoryAxis =\n type === \"category\" || (type === \"auto\" && layout === \"vertical\");\n\n return (\n <Recharts.YAxis\n {...rest}\n allowDataOverflow\n domain={domain}\n type={type}\n width={width ?? (isCategoryAxis ? \"auto\" : undefined)}\n fontSize={tokens.axis[\"font-size\"].value}\n tick={{\n fill: tokens.axis[\"color\"].value,\n }}\n tickMargin={parseInt(tokens.axis.spacing.value)}\n tickSize={parseInt(tokens.axis[\"tick-size\"].value)}\n />\n );\n};\n\nexport { TypedYAxis } from \"./types\";\n\nexport default YAxis;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgDA,IAAa,SAAyB,UAAU;CAC9C,MAAM,EAAE,QAAQ,OAAO,QAAQ,OAAO,GAAG,SAAS;CAElD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,EAAE,WAAW,yBAAyB;CAE5C,MAAM,iBACJ,SAAS,cAAe,SAAS,UAAU,WAAW;CAExD,OACE,oBAAC,SAAS,OAAV;EACE,GAAI;EACJ,mBAAA;EACQ;EACF;EACN,OAAO,UAAU,iBAAiB,SAAS,KAAA;EAC3C,UAAU,OAAO,KAAK,YAAY,CAAC;EACnC,MAAM,EACJ,MAAM,OAAO,KAAK,QAAQ,CAAC,MAC7B;EACA,YAAY,SAAS,OAAO,KAAK,QAAQ,KAAK;EAC9C,UAAU,SAAS,OAAO,KAAK,YAAY,CAAC,KAAK;CAClD,CAAA;AAEL"}
1
+ {"version":3,"file":"YAxis.mjs","names":[],"sources":["../../../../../../../../../src/components/CartesianChart/components/YAxis/YAxis.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport * as Recharts from \"recharts\";\nimport type {\n ChartDataValue,\n DataKey,\n DataKeyValue,\n} from \"@/components/CartesianChart/types\";\nimport { useCartesianChartContext } from \"@/components/CartesianChart/context\";\nimport { useDesignTokens } from \"@/lib/theming\";\nimport { useTickLabelWidth } from \"@/components/CartesianChart/hooks/useTickLabelWidth\";\n\nexport type YAxisProps<\n TData extends ChartDataValue = ChartDataValue,\n TDataKey extends DataKey<TData> = DataKey<TData>,\n TDataMatch = DataKeyValue<TData, TDataKey>,\n> = Pick<\n Recharts.YAxisProps,\n | \"className\"\n | \"orientation\"\n | \"allowDecimals\"\n | \"interval\"\n | \"minTickGap\"\n | \"scale\"\n | \"type\"\n | \"domain\"\n | \"hide\"\n | \"unit\"\n> & {\n dataKey?: TDataKey;\n tickFormatter?: (value: TDataMatch, index: number) => string;\n /**\n * The width of the axis in pixels. `\"auto\"` sizes the axis to its widest tick\n * label. Defaults to `\"auto\"` for a category axis (e.g. with `layout` set to\n * `\"vertical\"`) and to `60` otherwise. Pin a number to align the plot areas\n * of synchronized charts.\n */\n width?: number | \"auto\";\n};\n\n/**\n * `tickFormatter` is deliberately not part of the remote surface. A function\n * property crosses the boundary as a thread proxy whose call returns a Promise,\n * and recharts concatenates the formatter's result straight into the tick label\n * — so remotely every tick rendered `[object Promise]`. Dropping it from the\n * remote surface leaves the raw value there; the prop keeps working locally.\n *\n * @flr-generate all\n * @flr-ignore-props tickFormatter\n */\nexport const YAxis: FC<YAxisProps> = (props) => {\n const { domain, type = \"auto\", width, ...rest } = props;\n\n const tokens = useDesignTokens();\n const { layout } = useCartesianChartContext();\n const tickLabels = useTickLabelWidth();\n\n const isCategoryAxis =\n type === \"category\" || (type === \"auto\" && layout === \"vertical\");\n const isAutoWidth =\n (width ?? (isCategoryAxis ? \"auto\" : undefined)) === \"auto\";\n\n const tickMargin = parseInt(tokens.axis.spacing.value);\n const tickSize = parseInt(tokens.axis[\"tick-size\"].value);\n const tickFill = tokens.axis[\"color\"].value;\n\n /*\n * Recharts' own `\"auto\"` stays in charge until the labels are measured, so\n * the first frame is close already.\n */\n const autoWidth =\n tickLabels.width === undefined\n ? \"auto\"\n : tickLabels.width + tickSize + tickMargin;\n\n /*\n * Recharts' default tick label, plus the measuring ref. Recharts passes a\n * numeric axis width on to the label, which wraps once the text is wider —\n * so the label drops it, as it does with `\"auto\"`.\n */\n const measuredTick = (tickProps: Recharts.YAxisTickContentProps) => {\n const { payload, index, tickFormatter } = tickProps;\n const value = `${tickFormatter ? tickFormatter(payload.value, index) : payload.value}${rest.unit ?? \"\"}`;\n return (\n <Recharts.Text\n {...tickProps}\n ref={tickLabels.labelRef}\n className=\"recharts-cartesian-axis-tick-value\"\n fill={tickFill}\n width={undefined}\n >\n {value}\n </Recharts.Text>\n );\n };\n\n return (\n <Recharts.YAxis\n {...rest}\n allowDataOverflow\n domain={domain}\n type={type}\n width={isAutoWidth ? autoWidth : width}\n fontSize={tokens.axis[\"font-size\"].value}\n tick={isAutoWidth ? measuredTick : { fill: tickFill }}\n tickMargin={tickMargin}\n tickSize={tickSize}\n />\n );\n};\n\nexport { TypedYAxis } from \"./types\";\n\nexport default YAxis;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiDA,IAAa,SAAyB,UAAU;CAC9C,MAAM,EAAE,QAAQ,OAAO,QAAQ,OAAO,GAAG,SAAS;CAElD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,EAAE,WAAW,yBAAyB;CAC5C,MAAM,aAAa,kBAAkB;CAIrC,MAAM,eACH,UAFD,SAAS,cAAe,SAAS,UAAU,WAAW,aAE1B,SAAS,KAAA,QAAgB;CAEvD,MAAM,aAAa,SAAS,OAAO,KAAK,QAAQ,KAAK;CACrD,MAAM,WAAW,SAAS,OAAO,KAAK,YAAY,CAAC,KAAK;CACxD,MAAM,WAAW,OAAO,KAAK,QAAQ,CAAC;CAMtC,MAAM,YACJ,WAAW,UAAU,KAAA,IACjB,SACA,WAAW,QAAQ,WAAW;CAOpC,MAAM,gBAAgB,cAA8C;EAClE,MAAM,EAAE,SAAS,OAAO,kBAAkB;EAC1C,MAAM,QAAQ,GAAG,gBAAgB,cAAc,QAAQ,OAAO,KAAK,IAAI,QAAQ,QAAQ,KAAK,QAAQ;EACpG,OACE,oBAAC,SAAS,MAAV;GACE,GAAI;GACJ,KAAK,WAAW;GAChB,WAAU;GACV,MAAM;GACN,OAAO,KAAA;GAEN,UAAA;EACY,CAAA;CAEnB;CAEA,OACE,oBAAC,SAAS,OAAV;EACE,GAAI;EACJ,mBAAA;EACQ;EACF;EACN,OAAO,cAAc,YAAY;EACjC,UAAU,OAAO,KAAK,YAAY,CAAC;EACnC,MAAM,cAAc,eAAe,EAAE,MAAM,SAAS;EACxC;EACF;CACX,CAAA;AAEL"}
@@ -0,0 +1,67 @@
1
+ "use client"
2
+ /* */
3
+ import { createFrameResizeObserver } from "../../../lib/dom/createFrameResizeObserver.mjs";
4
+ import { useCallback, useEffect, useRef, useState } from "react";
5
+ //#region src/components/CartesianChart/hooks/useTickLabelWidth.ts
6
+ var measureLabel = (label) => {
7
+ try {
8
+ return label.getBBox().width;
9
+ } catch {
10
+ return 0;
11
+ }
12
+ };
13
+ /**
14
+ * Measures the widest tick label of an axis, for an axis that sizes itself to
15
+ * its labels.
16
+ *
17
+ * Replaces recharts' own `width="auto"` measurement, which undersizes the axis
18
+ * in two ways. It reads `getBoundingClientRect()` — screen pixels, which a CSS
19
+ * `zoom` or `transform` on an ancestor scales — and uses the result as SVG user
20
+ * units. And it measures once, so a web font that replaces its fallback after
21
+ * mount widens the labels past the axis. `getBBox()` measures in user units,
22
+ * and a `ResizeObserver` — which tracks an SVG element's bbox — measures again
23
+ * whenever a label changes size: a font swap, a new text, a hidden chart that
24
+ * is shown.
25
+ *
26
+ * Attach the returned ref to every tick label. The width is `undefined` until a
27
+ * label has been measured.
28
+ *
29
+ * @internal
30
+ */
31
+ var useTickLabelWidth = () => {
32
+ const labels = useRef(/* @__PURE__ */ new Set());
33
+ const observer = useRef(null);
34
+ const [width, setWidth] = useState();
35
+ const measure = useCallback(() => {
36
+ const widest = Math.max(0, ...[...labels.current].map(measureLabel));
37
+ setWidth(widest > 0 ? Math.ceil(widest) : void 0);
38
+ }, []);
39
+ useEffect(() => {
40
+ if (typeof ResizeObserver === "undefined") return;
41
+ const frameObserver = createFrameResizeObserver(measure);
42
+ frameObserver.observe(labels.current);
43
+ observer.current = frameObserver;
44
+ return () => {
45
+ frameObserver.disconnect();
46
+ observer.current = null;
47
+ };
48
+ }, [measure]);
49
+ return {
50
+ width,
51
+ labelRef: useCallback((label) => {
52
+ if (!label) return;
53
+ labels.current.add(label);
54
+ observer.current?.observe(labels.current);
55
+ measure();
56
+ return () => {
57
+ labels.current.delete(label);
58
+ observer.current?.observe(labels.current);
59
+ measure();
60
+ };
61
+ }, [measure])
62
+ };
63
+ };
64
+ //#endregion
65
+ export { useTickLabelWidth };
66
+
67
+ //# sourceMappingURL=useTickLabelWidth.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTickLabelWidth.mjs","names":[],"sources":["../../../../../../../../src/components/CartesianChart/hooks/useTickLabelWidth.ts"],"sourcesContent":["import {\n type RefCallback,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport {\n createFrameResizeObserver,\n type FrameResizeObserver,\n} from \"@/lib/dom/createFrameResizeObserver\";\n\nconst measureLabel = (label: SVGTextElement): number => {\n try {\n return label.getBBox().width;\n } catch {\n // Firefox throws for an element that is not rendered, and jsdom has no\n // `getBBox` at all.\n return 0;\n }\n};\n\n/**\n * Measures the widest tick label of an axis, for an axis that sizes itself to\n * its labels.\n *\n * Replaces recharts' own `width=\"auto\"` measurement, which undersizes the axis\n * in two ways. It reads `getBoundingClientRect()` — screen pixels, which a CSS\n * `zoom` or `transform` on an ancestor scales — and uses the result as SVG user\n * units. And it measures once, so a web font that replaces its fallback after\n * mount widens the labels past the axis. `getBBox()` measures in user units,\n * and a `ResizeObserver` — which tracks an SVG element's bbox — measures again\n * whenever a label changes size: a font swap, a new text, a hidden chart that\n * is shown.\n *\n * Attach the returned ref to every tick label. The width is `undefined` until a\n * label has been measured.\n *\n * @internal\n */\nexport const useTickLabelWidth = () => {\n const labels = useRef(new Set<SVGTextElement>());\n const observer = useRef<FrameResizeObserver>(null);\n const [width, setWidth] = useState<number>();\n\n const measure = useCallback(() => {\n const widest = Math.max(0, ...[...labels.current].map(measureLabel));\n setWidth(widest > 0 ? Math.ceil(widest) : undefined);\n }, []);\n\n useEffect(() => {\n // jsdom has no `ResizeObserver`.\n if (typeof ResizeObserver === \"undefined\") {\n return;\n }\n const frameObserver = createFrameResizeObserver(measure);\n frameObserver.observe(labels.current);\n observer.current = frameObserver;\n return () => {\n frameObserver.disconnect();\n observer.current = null;\n };\n }, [measure]);\n\n const labelRef: RefCallback<SVGTextElement> = useCallback(\n (label) => {\n if (!label) {\n return;\n }\n labels.current.add(label);\n observer.current?.observe(labels.current);\n measure();\n return () => {\n labels.current.delete(label);\n observer.current?.observe(labels.current);\n measure();\n };\n },\n [measure],\n );\n\n return { width, labelRef };\n};\n"],"mappings":";;;;;AAYA,IAAM,gBAAgB,UAAkC;CACtD,IAAI;EACF,OAAO,MAAM,QAAQ,CAAC,CAAC;CACzB,QAAQ;EAGN,OAAO;CACT;AACF;;;;;;;;;;;;;;;;;;;AAoBA,IAAa,0BAA0B;CACrC,MAAM,SAAS,uBAAO,IAAI,IAAoB,CAAC;CAC/C,MAAM,WAAW,OAA4B,IAAI;CACjD,MAAM,CAAC,OAAO,YAAY,SAAiB;CAE3C,MAAM,UAAU,kBAAkB;EAChC,MAAM,SAAS,KAAK,IAAI,GAAG,GAAG,CAAC,GAAG,OAAO,OAAO,CAAC,CAAC,IAAI,YAAY,CAAC;EACnE,SAAS,SAAS,IAAI,KAAK,KAAK,MAAM,IAAI,KAAA,CAAS;CACrD,GAAG,CAAC,CAAC;CAEL,gBAAgB;EAEd,IAAI,OAAO,mBAAmB,aAC5B;EAEF,MAAM,gBAAgB,0BAA0B,OAAO;EACvD,cAAc,QAAQ,OAAO,OAAO;EACpC,SAAS,UAAU;EACnB,aAAa;GACX,cAAc,WAAW;GACzB,SAAS,UAAU;EACrB;CACF,GAAG,CAAC,OAAO,CAAC;CAmBZ,OAAO;EAAE;EAAO,UAjB8B,aAC3C,UAAU;GACT,IAAI,CAAC,OACH;GAEF,OAAO,QAAQ,IAAI,KAAK;GACxB,SAAS,SAAS,QAAQ,OAAO,OAAO;GACxC,QAAQ;GACR,aAAa;IACX,OAAO,QAAQ,OAAO,KAAK;IAC3B,SAAS,SAAS,QAAQ,OAAO,OAAO;IACxC,QAAQ;GACV;EACF,GACA,CAAC,OAAO,CAGM;CAAS;AAC3B"}
@@ -33,12 +33,12 @@ var Checkbox = flowComponent("Checkbox", (props) => {
33
33
  };
34
34
  return /* @__PURE__ */ jsxs("div", {
35
35
  ...skeletonProps,
36
- className: clsx(Checkbox_module_default.checkbox, className, wrapperProps.className),
36
+ className: clsx(wrapperProps.className, Checkbox_module_default.checkbox, className),
37
37
  children: [/* @__PURE__ */ jsx(FieldErrorCaptureContext, { children: /* @__PURE__ */ jsx(Aria.Checkbox, {
38
38
  ...rest,
39
39
  "aria-describedby": controlProps["aria-describedby"],
40
40
  inputRef,
41
- className: clsx(inputClassName, Checkbox_module_default.input),
41
+ className: clsx(Checkbox_module_default.input, inputClassName),
42
42
  children: ({ isSelected, isIndeterminate }) => /* @__PURE__ */ jsxs(PropsContextProvider, {
43
43
  props: fieldPropsContext,
44
44
  children: [renderIcon(isSelected, isIndeterminate), /* @__PURE__ */ jsx(SkeletonRawText, { children })]
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.mjs","names":["styles"],"sources":["../../../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import {\n IconCheckboxChecked,\n IconCheckboxEmpty,\n IconCheckboxIndeterminate,\n} from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport clsx from \"clsx\";\nimport type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Checkbox.module.scss\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { useObjectRef } from \"react-aria\";\nimport { SkeletonRawText } from \"@/components/SkeletonMode/components/SkeletonRawText\";\nimport {\n SkeletonModeReset,\n useSkeletonMode,\n} from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface CheckboxProps\n extends\n PropsWithChildren<\n Omit<Aria.CheckboxProps, \"children\" | \"ref\" | \"inputRef\">\n >,\n FlowComponentProps<HTMLInputElement> {\n /** The class name of the underlying input element. */\n inputClassName?: string;\n}\n\n/** @flr-generate all */\nexport const Checkbox = flowComponent(\"Checkbox\", (props) => {\n const { children, className, ref, inputClassName, ...rest } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n wrapperProps,\n controlProps,\n skeletonProps,\n } = useFieldComponent(props, \"Checkbox\");\n\n const inputRef = useObjectRef(ref);\n const isSkeleton = useSkeletonMode();\n\n const checkedIcon = <IconCheckboxChecked className={styles.icon} />;\n const indeterminateIcon = (\n <IconCheckboxIndeterminate className={styles.icon} />\n );\n const emptyIcon = <IconCheckboxEmpty className={styles.icon} />;\n\n const renderIcon = (isSelected: boolean, isIndeterminate: boolean) => {\n const icon = isSelected\n ? checkedIcon\n : isIndeterminate\n ? indeterminateIcon\n : emptyIcon;\n\n const skeletonIcon = (\n <span className={styles.skeletonIcon}>\n <SkeletonModeReset>{icon}</SkeletonModeReset>\n </span>\n );\n\n return isSkeleton ? skeletonIcon : icon;\n };\n\n return (\n <div\n {...skeletonProps}\n className={clsx(styles.checkbox, className, wrapperProps.className)}\n >\n <FieldErrorCaptureContext>\n <Aria.Checkbox\n {...rest}\n aria-describedby={controlProps[\"aria-describedby\"]}\n inputRef={inputRef}\n className={clsx(inputClassName, styles.input)}\n >\n {({ isSelected, isIndeterminate }) => (\n <PropsContextProvider props={fieldPropsContext}>\n {renderIcon(isSelected, isIndeterminate)}\n <SkeletonRawText>{children}</SkeletonRawText>\n </PropsContextProvider>\n )}\n </Aria.Checkbox>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n});\n\nexport default Checkbox;\n"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,IAAa,WAAW,cAAc,aAAa,UAAU;CAC3D,MAAM,EAAE,UAAU,WAAW,KAAK,gBAAgB,GAAG,SAAS;CAE9D,MAAM,EACJ,gBACA,0BACA,mBACA,cACA,cACA,kBACE,kBAAkB,OAAO,UAAU;CAEvC,MAAM,WAAW,aAAa,GAAG;CACjC,MAAM,aAAa,gBAAgB;CAEnC,MAAM,cAAc,oBAAC,qBAAD,EAAqB,WAAWA,wBAAO,KAAO,CAAA;CAClE,MAAM,oBACJ,oBAAC,2BAAD,EAA2B,WAAWA,wBAAO,KAAO,CAAA;CAEtD,MAAM,YAAY,oBAAC,mBAAD,EAAmB,WAAWA,wBAAO,KAAO,CAAA;CAE9D,MAAM,cAAc,YAAqB,oBAA6B;EACpE,MAAM,OAAO,aACT,cACA,kBACE,oBACA;EAEN,MAAM,eACJ,oBAAC,QAAD;GAAM,WAAWA,wBAAO;GACtB,UAAA,oBAAC,mBAAD,EAAA,UAAoB,KAAwB,CAAA;EACxC,CAAA;EAGR,OAAO,aAAa,eAAe;CACrC;CAEA,OACE,qBAAC,OAAD;EACE,GAAI;EACJ,WAAW,KAAKA,wBAAO,UAAU,WAAW,aAAa,SAAS;EAFpE,UAAA,CAIE,oBAAC,0BAAD,EAAA,UACE,oBAAC,KAAK,UAAN;GACE,GAAI;GACJ,oBAAkB,aAAa;GACrB;GACV,WAAW,KAAK,gBAAgBA,wBAAO,KAAK;GAE1C,WAAA,EAAE,YAAY,sBACd,qBAAC,sBAAD;IAAsB,OAAO;IAA7B,UAAA,CACG,WAAW,YAAY,eAAe,GACvC,oBAAC,iBAAD,EAAkB,SAA0B,CAAA,CACxB;;EAEX,CAAA,EACS,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACd;;AAET,CAAC"}
1
+ {"version":3,"file":"Checkbox.mjs","names":["styles"],"sources":["../../../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import {\n IconCheckboxChecked,\n IconCheckboxEmpty,\n IconCheckboxIndeterminate,\n} from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport clsx from \"clsx\";\nimport type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport styles from \"./Checkbox.module.scss\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { useObjectRef } from \"react-aria\";\nimport { SkeletonRawText } from \"@/components/SkeletonMode/components/SkeletonRawText\";\nimport {\n SkeletonModeReset,\n useSkeletonMode,\n} from \"@/components/SkeletonMode/skeletonModeContext\";\n\nexport interface CheckboxProps\n extends\n PropsWithChildren<\n Omit<Aria.CheckboxProps, \"children\" | \"ref\" | \"inputRef\">\n >,\n FlowComponentProps<HTMLInputElement> {\n /** The class name of the underlying input element. */\n inputClassName?: string;\n}\n\n/** @flr-generate all */\nexport const Checkbox = flowComponent(\"Checkbox\", (props) => {\n const { children, className, ref, inputClassName, ...rest } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n wrapperProps,\n controlProps,\n skeletonProps,\n } = useFieldComponent(props, \"Checkbox\");\n\n const inputRef = useObjectRef(ref);\n const isSkeleton = useSkeletonMode();\n\n const checkedIcon = <IconCheckboxChecked className={styles.icon} />;\n const indeterminateIcon = (\n <IconCheckboxIndeterminate className={styles.icon} />\n );\n const emptyIcon = <IconCheckboxEmpty className={styles.icon} />;\n\n const renderIcon = (isSelected: boolean, isIndeterminate: boolean) => {\n const icon = isSelected\n ? checkedIcon\n : isIndeterminate\n ? indeterminateIcon\n : emptyIcon;\n\n const skeletonIcon = (\n <span className={styles.skeletonIcon}>\n <SkeletonModeReset>{icon}</SkeletonModeReset>\n </span>\n );\n\n return isSkeleton ? skeletonIcon : icon;\n };\n\n return (\n <div\n {...skeletonProps}\n className={clsx(wrapperProps.className, styles.checkbox, className)}\n >\n <FieldErrorCaptureContext>\n <Aria.Checkbox\n {...rest}\n aria-describedby={controlProps[\"aria-describedby\"]}\n inputRef={inputRef}\n className={clsx(styles.input, inputClassName)}\n >\n {({ isSelected, isIndeterminate }) => (\n <PropsContextProvider props={fieldPropsContext}>\n {renderIcon(isSelected, isIndeterminate)}\n <SkeletonRawText>{children}</SkeletonRawText>\n </PropsContextProvider>\n )}\n </Aria.Checkbox>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n});\n\nexport default Checkbox;\n"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,IAAa,WAAW,cAAc,aAAa,UAAU;CAC3D,MAAM,EAAE,UAAU,WAAW,KAAK,gBAAgB,GAAG,SAAS;CAE9D,MAAM,EACJ,gBACA,0BACA,mBACA,cACA,cACA,kBACE,kBAAkB,OAAO,UAAU;CAEvC,MAAM,WAAW,aAAa,GAAG;CACjC,MAAM,aAAa,gBAAgB;CAEnC,MAAM,cAAc,oBAAC,qBAAD,EAAqB,WAAWA,wBAAO,KAAO,CAAA;CAClE,MAAM,oBACJ,oBAAC,2BAAD,EAA2B,WAAWA,wBAAO,KAAO,CAAA;CAEtD,MAAM,YAAY,oBAAC,mBAAD,EAAmB,WAAWA,wBAAO,KAAO,CAAA;CAE9D,MAAM,cAAc,YAAqB,oBAA6B;EACpE,MAAM,OAAO,aACT,cACA,kBACE,oBACA;EAEN,MAAM,eACJ,oBAAC,QAAD;GAAM,WAAWA,wBAAO;GACtB,UAAA,oBAAC,mBAAD,EAAA,UAAoB,KAAwB,CAAA;EACxC,CAAA;EAGR,OAAO,aAAa,eAAe;CACrC;CAEA,OACE,qBAAC,OAAD;EACE,GAAI;EACJ,WAAW,KAAK,aAAa,WAAWA,wBAAO,UAAU,SAAS;EAFpE,UAAA,CAIE,oBAAC,0BAAD,EAAA,UACE,oBAAC,KAAK,UAAN;GACE,GAAI;GACJ,oBAAkB,aAAa;GACrB;GACV,WAAW,KAAKA,wBAAO,OAAO,cAAc;GAE1C,WAAA,EAAE,YAAY,sBACd,qBAAC,sBAAD;IAAsB,OAAO;IAA7B,UAAA,CACG,WAAW,YAAY,eAAe,GACvC,oBAAC,iBAAD,EAAkB,SAA0B,CAAA,CACxB;;EAEX,CAAA,EACS,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACd;;AAET,CAAC"}