@databiosphere/findable-ui 22.0.0 → 24.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/.storybook/preview.js +4 -37
  3. package/CHANGELOG.md +53 -0
  4. package/jest.config.js +1 -0
  5. package/lib/common/selectors.d.ts +6 -2
  6. package/lib/common/selectors.js +7 -2
  7. package/lib/components/DataDictionary/components/Entities/constants.d.ts +1 -0
  8. package/lib/components/DataDictionary/components/Entities/constants.js +2 -1
  9. package/lib/components/DataDictionary/components/Entities/entities.d.ts +1 -1
  10. package/lib/components/DataDictionary/components/Entities/entities.js +2 -2
  11. package/lib/components/DataDictionary/components/Entities/types.d.ts +2 -0
  12. package/lib/components/DataDictionary/components/Entity/entity.d.ts +1 -1
  13. package/lib/components/DataDictionary/components/Entity/entity.js +9 -4
  14. package/lib/components/DataDictionary/components/Entity/entity.styles.d.ts +2 -0
  15. package/lib/components/DataDictionary/components/Entity/entity.styles.js +10 -0
  16. package/lib/components/DataDictionary/components/Entity/types.d.ts +2 -0
  17. package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.d.ts +2 -0
  18. package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.js +5 -0
  19. package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.d.ts +5 -0
  20. package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.js +19 -0
  21. package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/types.d.ts +5 -0
  22. package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/types.js +1 -0
  23. package/lib/components/DataDictionary/components/Layout/components/OutlineLayout/outlineLayout.d.ts +2 -0
  24. package/lib/components/DataDictionary/components/Layout/components/OutlineLayout/outlineLayout.js +6 -0
  25. package/lib/components/DataDictionary/components/Layout/components/OutlineLayout/outlineLayout.styles.d.ts +9 -0
  26. package/lib/components/DataDictionary/components/Layout/components/OutlineLayout/outlineLayout.styles.js +26 -0
  27. package/lib/components/DataDictionary/components/Layout/components/OutlineLayout/types.d.ts +5 -0
  28. package/lib/components/DataDictionary/components/Layout/components/OutlineLayout/types.js +1 -0
  29. package/lib/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.d.ts +2 -0
  30. package/lib/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.js +5 -0
  31. package/lib/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.styles.d.ts +5 -0
  32. package/lib/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.styles.js +16 -0
  33. package/lib/components/DataDictionary/components/Layout/components/TitleLayout/types.d.ts +5 -0
  34. package/lib/components/DataDictionary/components/Layout/components/TitleLayout/types.js +1 -0
  35. package/lib/components/DataDictionary/components/Layout/constants.d.ts +5 -0
  36. package/lib/components/DataDictionary/components/Layout/constants.js +5 -0
  37. package/lib/components/DataDictionary/components/Outline/components/ContentsTab/constants.d.ts +2 -0
  38. package/lib/components/DataDictionary/components/Outline/components/ContentsTab/constants.js +5 -0
  39. package/lib/components/DataDictionary/components/Outline/components/ContentsTab/contentsTab.d.ts +1 -0
  40. package/lib/components/DataDictionary/components/Outline/components/ContentsTab/contentsTab.js +6 -0
  41. package/lib/components/DataDictionary/components/Outline/components/ContentsTab/contentsTab.styles.d.ts +3 -0
  42. package/lib/components/DataDictionary/components/Outline/components/ContentsTab/contentsTab.styles.js +7 -0
  43. package/lib/components/DataDictionary/components/Outline/outline.d.ts +2 -0
  44. package/lib/components/DataDictionary/components/Outline/outline.js +6 -0
  45. package/lib/components/DataDictionary/components/Outline/outline.styles.d.ts +3 -0
  46. package/lib/components/DataDictionary/components/Outline/outline.styles.js +19 -0
  47. package/lib/components/DataDictionary/components/Outline/types.d.ts +5 -0
  48. package/lib/components/DataDictionary/components/Outline/types.js +1 -0
  49. package/lib/components/DataDictionary/components/Outline/utils.d.ts +8 -0
  50. package/lib/components/DataDictionary/components/Outline/utils.js +15 -0
  51. package/lib/components/DataDictionary/components/Table/components/BasicCell/basicCell.js +2 -2
  52. package/lib/components/DataDictionary/components/Title/title.d.ts +2 -0
  53. package/lib/components/DataDictionary/components/Title/title.js +3 -0
  54. package/lib/components/DataDictionary/components/Title/title.styles.d.ts +3 -0
  55. package/lib/components/DataDictionary/components/Title/title.styles.js +17 -0
  56. package/lib/components/DataDictionary/dataDictionary.d.ts +2 -2
  57. package/lib/components/DataDictionary/dataDictionary.js +17 -3
  58. package/lib/components/DataDictionary/dataDictionary.styles.d.ts +5 -1
  59. package/lib/components/DataDictionary/dataDictionary.styles.js +16 -3
  60. package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +2 -1
  61. package/lib/components/DataDictionary/hooks/UseLayoutSpacing/hook.d.ts +2 -0
  62. package/lib/components/DataDictionary/hooks/UseLayoutSpacing/hook.js +10 -0
  63. package/lib/components/DataDictionary/hooks/UseLayoutSpacing/types.d.ts +7 -0
  64. package/lib/components/DataDictionary/hooks/UseLayoutSpacing/types.js +1 -0
  65. package/lib/components/DataDictionary/types.d.ts +9 -0
  66. package/lib/components/DataDictionary/types.js +1 -0
  67. package/lib/components/Error/error.js +3 -3
  68. package/lib/components/Export/components/ExportForm/exportForm.styles.d.ts +2 -2
  69. package/lib/components/Filter/components/FilterLabel/filterLabel.styles.d.ts +1 -1
  70. package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.js +3 -3
  71. package/lib/components/Index/index.js +3 -4
  72. package/lib/components/Layout/components/ContentLayout/contentLayout.js +7 -7
  73. package/lib/components/Layout/components/Footer/footer.js +4 -1
  74. package/lib/components/Layout/components/Footer/footer.styles.js +1 -0
  75. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.styles.d.ts +1 -1
  76. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/Button/button.styles.d.ts +1 -1
  77. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/Button/button.styles.d.ts +1 -1
  78. package/lib/components/Layout/components/Header/header.js +4 -3
  79. package/lib/components/Layout/components/Main/main.js +3 -4
  80. package/lib/components/Layout/components/Outline/components/ContentsTab/contentsTab.d.ts +1 -5
  81. package/lib/components/Layout/components/Outline/components/ContentsTab/contentsTab.js +5 -3
  82. package/lib/components/Layout/components/Outline/components/ContentsTab/contentsTab.styles.d.ts +1 -1
  83. package/lib/components/Layout/components/Outline/components/ContentsTab/contentsTab.styles.js +2 -2
  84. package/lib/components/Layout/components/Outline/components/ContentsTab/types.d.ts +5 -0
  85. package/lib/components/Layout/components/Outline/components/ContentsTab/types.js +1 -0
  86. package/lib/components/Layout/components/Outline/hooks/UseHash/hook.d.ts +11 -0
  87. package/lib/components/Layout/components/Outline/hooks/UseHash/hook.js +16 -0
  88. package/lib/components/Layout/components/Outline/hooks/UseHash/types.d.ts +3 -0
  89. package/lib/components/Layout/components/Outline/hooks/UseHash/types.js +1 -0
  90. package/lib/components/Layout/components/Outline/hooks/UseTabs/constants.d.ts +2 -0
  91. package/lib/components/Layout/components/Outline/hooks/UseTabs/hook.d.ts +3 -0
  92. package/lib/components/Layout/components/Outline/hooks/UseTabs/hook.js +24 -0
  93. package/lib/components/Layout/components/Outline/hooks/UseTabs/utils.d.ts +9 -0
  94. package/lib/components/Layout/components/Outline/hooks/UseTabs/utils.js +13 -0
  95. package/lib/components/Layout/components/Outline/outline.d.ts +2 -13
  96. package/lib/components/Layout/components/Outline/outline.js +8 -32
  97. package/lib/components/Layout/components/Outline/outline.styles.d.ts +3 -3
  98. package/lib/components/Layout/components/Outline/outline.styles.js +2 -2
  99. package/lib/components/Layout/components/Outline/types.d.ts +14 -0
  100. package/lib/components/Layout/components/Outline/types.js +1 -0
  101. package/lib/components/Layout/components/Sidebar/components/SidebarPositioner/sidebarPositioner.js +4 -4
  102. package/lib/components/Loading/loading.stories.d.ts +3 -31
  103. package/lib/components/Login/components/Button/button.styles.d.ts +1 -1
  104. package/lib/components/Login/components/Section/components/Warning/warning.js +2 -3
  105. package/lib/components/Stepper/components/Step/components/StepContent/stepContent.d.ts +3 -0
  106. package/lib/components/Stepper/components/Step/components/StepContent/stepContent.js +7 -0
  107. package/lib/components/Stepper/components/Step/components/StepContent/stepContent.styles.d.ts +3 -0
  108. package/lib/components/Stepper/components/Step/components/StepContent/stepContent.styles.js +17 -0
  109. package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.d.ts +2 -0
  110. package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.js +8 -0
  111. package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.d.ts +5 -0
  112. package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.js +15 -0
  113. package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.d.ts +2 -0
  114. package/lib/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.js +4 -0
  115. package/lib/components/Stepper/components/Step/components/StepIcon/constants.d.ts +1 -0
  116. package/lib/components/Stepper/components/Step/components/StepIcon/constants.js +1 -0
  117. package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.d.ts +3 -0
  118. package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.js +6 -0
  119. package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.d.ts +3 -0
  120. package/lib/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.js +27 -0
  121. package/lib/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.d.ts +9 -0
  122. package/lib/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.js +38 -0
  123. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.d.ts +3 -0
  124. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.js +11 -0
  125. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.d.ts +2 -0
  126. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.js +9 -0
  127. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.d.ts +3 -0
  128. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.js +3 -0
  129. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.d.ts +6 -0
  130. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.js +20 -0
  131. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.d.ts +7 -0
  132. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.js +1 -0
  133. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/constants.d.ts +2 -0
  134. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/constants.js +6 -0
  135. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.d.ts +2 -0
  136. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.js +6 -0
  137. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.d.ts +5 -0
  138. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.js +7 -0
  139. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.d.ts +7 -0
  140. package/lib/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.js +21 -0
  141. package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.d.ts +2 -0
  142. package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.js +5 -0
  143. package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.d.ts +2 -0
  144. package/lib/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.js +6 -0
  145. package/lib/components/Stepper/components/Step/components/StepLabel/constants.d.ts +2 -0
  146. package/lib/components/Stepper/components/Step/components/StepLabel/constants.js +8 -0
  147. package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.d.ts +2 -0
  148. package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.js +6 -0
  149. package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.d.ts +3 -0
  150. package/lib/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.js +12 -0
  151. package/lib/components/Stepper/components/Step/components/StepLabel/stories/contants.d.ts +4 -0
  152. package/lib/components/Stepper/components/Step/components/StepLabel/stories/contants.js +15 -0
  153. package/lib/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.d.ts +8 -0
  154. package/lib/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.js +37 -0
  155. package/lib/components/Stepper/components/Step/constants.d.ts +2 -0
  156. package/lib/components/Stepper/components/Step/constants.js +4 -0
  157. package/lib/components/Stepper/components/Step/step.d.ts +3 -0
  158. package/lib/components/Stepper/components/Step/step.js +6 -0
  159. package/lib/components/Stepper/components/Step/step.styles.d.ts +5 -0
  160. package/lib/components/Stepper/components/Step/step.styles.js +31 -0
  161. package/lib/components/Stepper/components/Step/stories/contants.d.ts +4 -0
  162. package/lib/components/Stepper/components/Step/stories/contants.js +14 -0
  163. package/lib/components/Stepper/components/Step/stories/step.stories.d.ts +8 -0
  164. package/lib/components/Stepper/components/Step/stories/step.stories.js +62 -0
  165. package/lib/components/Table/components/TableCell/components/RowPositionCell/constants.js +2 -2
  166. package/lib/components/common/AnchorLink/anchorLink.d.ts +6 -0
  167. package/lib/components/common/Form/components/Input/input.styles.d.ts +1 -1
  168. package/lib/components/common/Form/components/Select/select.js +2 -1
  169. package/lib/components/common/Form/components/Select/select.styles.d.ts +1 -1
  170. package/lib/components/common/Input/input.styles.d.ts +1 -1
  171. package/lib/components/common/KeyValuePairs/components/KeyElType/keyElType.d.ts +2 -5
  172. package/lib/components/common/KeyValuePairs/components/KeyElType/keyElType.js +6 -2
  173. package/lib/components/common/KeyValuePairs/components/ValueElType/valueElType.d.ts +2 -5
  174. package/lib/components/common/KeyValuePairs/components/ValueElType/valueElType.js +6 -2
  175. package/lib/components/common/LoginDialog/constants.js +4 -4
  176. package/lib/providers/layoutDimensions/constants.d.ts +2 -0
  177. package/lib/providers/layoutDimensions/constants.js +4 -0
  178. package/lib/providers/layoutDimensions/context.d.ts +2 -0
  179. package/lib/providers/layoutDimensions/context.js +7 -0
  180. package/lib/providers/layoutDimensions/hook.d.ts +2 -0
  181. package/lib/providers/layoutDimensions/hook.js +5 -0
  182. package/lib/providers/layoutDimensions/provider.d.ts +2 -0
  183. package/lib/providers/layoutDimensions/provider.js +14 -0
  184. package/lib/providers/layoutDimensions/types.d.ts +14 -0
  185. package/lib/providers/layoutDimensions/types.js +1 -0
  186. package/lib/storybook/controls/constants.d.ts +4 -0
  187. package/lib/storybook/controls/constants.js +6 -0
  188. package/lib/storybook/controls/types.d.ts +4 -0
  189. package/lib/storybook/controls/types.js +5 -0
  190. package/lib/storybook/controls/utils.d.ts +9 -0
  191. package/lib/storybook/controls/utils.js +10 -0
  192. package/lib/storybook/decorators.d.ts +2 -0
  193. package/lib/storybook/decorators.js +11 -0
  194. package/lib/storybook/loremIpsum.d.ts +4 -0
  195. package/lib/storybook/loremIpsum.js +4 -0
  196. package/lib/storybook/parameters.d.ts +2 -0
  197. package/lib/storybook/parameters.js +12 -0
  198. package/lib/styles/common/mui/stepper.d.ts +7 -0
  199. package/lib/styles/common/mui/stepper.js +7 -0
  200. package/lib/styles/common/mui/svgIcon.d.ts +9 -0
  201. package/lib/styles/common/mui/svgIcon.js +26 -0
  202. package/lib/styles/common/mui/tab.d.ts +7 -0
  203. package/lib/styles/common/mui/tab.js +9 -0
  204. package/lib/styles/common/mui/tabs.d.ts +9 -0
  205. package/lib/styles/common/mui/tabs.js +11 -0
  206. package/lib/styles/common/mui/typography.d.ts +8 -2
  207. package/lib/styles/common/mui/typography.js +9 -2
  208. package/lib/tests/mui/constants.d.ts +4 -0
  209. package/lib/tests/mui/constants.js +4 -0
  210. package/lib/theme/common/components.js +0 -4
  211. package/lib/theme/common/typography.d.ts +5 -1
  212. package/lib/theme/common/typography.js +10 -1
  213. package/lib/theme/theme.js +1 -0
  214. package/lib/utils/tests.d.ts +12 -0
  215. package/lib/utils/tests.js +20 -0
  216. package/package.json +1 -1
  217. package/src/common/selectors.ts +6 -3
  218. package/src/components/DataDictionary/components/Entities/constants.ts +3 -1
  219. package/src/components/DataDictionary/components/Entities/entities.tsx +2 -2
  220. package/src/components/DataDictionary/components/Entities/types.ts +2 -0
  221. package/src/components/DataDictionary/components/Entity/entity.styles.ts +12 -0
  222. package/src/components/DataDictionary/components/Entity/entity.tsx +17 -7
  223. package/src/components/DataDictionary/components/Entity/types.ts +2 -0
  224. package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.ts +22 -0
  225. package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.tsx +10 -0
  226. package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/types.ts +6 -0
  227. package/src/components/DataDictionary/components/Layout/components/OutlineLayout/outlineLayout.styles.ts +31 -0
  228. package/src/components/DataDictionary/components/Layout/components/OutlineLayout/outlineLayout.tsx +14 -0
  229. package/src/components/DataDictionary/components/Layout/components/OutlineLayout/types.ts +6 -0
  230. package/src/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.styles.ts +18 -0
  231. package/src/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.tsx +10 -0
  232. package/src/components/DataDictionary/components/Layout/components/TitleLayout/types.ts +6 -0
  233. package/src/components/DataDictionary/components/Layout/constants.ts +5 -0
  234. package/src/components/DataDictionary/components/Outline/components/ContentsTab/constants.ts +7 -0
  235. package/src/components/DataDictionary/components/Outline/components/ContentsTab/contentsTab.styles.ts +8 -0
  236. package/src/components/DataDictionary/components/Outline/components/ContentsTab/contentsTab.tsx +7 -0
  237. package/src/components/DataDictionary/components/Outline/outline.styles.ts +24 -0
  238. package/src/components/DataDictionary/components/Outline/outline.tsx +11 -0
  239. package/src/components/DataDictionary/components/Outline/types.ts +6 -0
  240. package/src/components/DataDictionary/components/Outline/utils.ts +18 -0
  241. package/src/components/DataDictionary/components/Table/components/BasicCell/basicCell.tsx +6 -2
  242. package/src/components/DataDictionary/components/Title/title.styles.ts +18 -0
  243. package/src/components/DataDictionary/components/Title/title.tsx +8 -0
  244. package/src/components/DataDictionary/dataDictionary.styles.ts +17 -3
  245. package/src/components/DataDictionary/dataDictionary.tsx +26 -4
  246. package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +2 -1
  247. package/src/components/DataDictionary/hooks/UseLayoutSpacing/hook.ts +12 -0
  248. package/src/components/DataDictionary/hooks/UseLayoutSpacing/types.ts +8 -0
  249. package/src/components/DataDictionary/types.ts +10 -0
  250. package/src/components/Error/error.tsx +3 -5
  251. package/src/components/Filter/components/SearchAllFilters/searchAllFilters.tsx +3 -3
  252. package/src/components/Index/index.tsx +3 -4
  253. package/src/components/Layout/components/ContentLayout/contentLayout.tsx +7 -9
  254. package/src/components/Layout/components/Footer/footer.styles.ts +1 -0
  255. package/src/components/Layout/components/Footer/footer.tsx +5 -0
  256. package/src/components/Layout/components/Header/header.tsx +9 -3
  257. package/src/components/Layout/components/Main/main.tsx +3 -4
  258. package/src/components/Layout/components/Outline/components/ContentsTab/contentsTab.styles.ts +2 -2
  259. package/src/components/Layout/components/Outline/components/ContentsTab/contentsTab.tsx +8 -11
  260. package/src/components/Layout/components/Outline/components/ContentsTab/types.ts +8 -0
  261. package/src/components/Layout/components/Outline/hooks/UseHash/hook.ts +17 -0
  262. package/src/components/Layout/components/Outline/hooks/UseHash/types.ts +3 -0
  263. package/src/components/Layout/components/Outline/hooks/UseTabs/constants.ts +3 -0
  264. package/src/components/Layout/components/Outline/hooks/UseTabs/hook.ts +32 -0
  265. package/src/components/Layout/components/Outline/hooks/UseTabs/utils.ts +18 -0
  266. package/src/components/Layout/components/Outline/outline.styles.ts +2 -2
  267. package/src/components/Layout/components/Outline/outline.tsx +22 -59
  268. package/src/components/Layout/components/Outline/types.ts +16 -0
  269. package/src/components/Layout/components/Sidebar/components/SidebarPositioner/sidebarPositioner.tsx +7 -6
  270. package/src/components/Loading/loading.stories.tsx +2 -2
  271. package/src/components/Login/components/Section/components/Warning/warning.tsx +3 -4
  272. package/src/components/Stepper/components/Step/components/StepContent/stepContent.styles.ts +18 -0
  273. package/src/components/Stepper/components/Step/components/StepContent/stepContent.tsx +16 -0
  274. package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.styles.ts +19 -0
  275. package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/completedIcon.tsx +20 -0
  276. package/src/components/Stepper/components/Step/components/StepIcon/components/CompletedIcon/contants.ts +6 -0
  277. package/src/components/Stepper/components/Step/components/StepIcon/constants.ts +1 -0
  278. package/src/components/Stepper/components/Step/components/StepIcon/stepIcon.styles.ts +32 -0
  279. package/src/components/Stepper/components/Step/components/StepIcon/stepIcon.tsx +21 -0
  280. package/src/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories.tsx +52 -0
  281. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/constants.ts +14 -0
  282. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/icon.tsx +13 -0
  283. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/contants.ts +6 -0
  284. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/stories/icon.stories.tsx +30 -0
  285. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/components/Icon/types.ts +8 -0
  286. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/constants.ts +8 -0
  287. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/label.styles.ts +8 -0
  288. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/label.tsx +10 -0
  289. package/src/components/Stepper/components/Step/components/StepLabel/components/Label/stories/label.stories.tsx +31 -0
  290. package/src/components/Stepper/components/Step/components/StepLabel/components/Optional/constants.ts +7 -0
  291. package/src/components/Stepper/components/Step/components/StepLabel/components/Optional/optional.tsx +9 -0
  292. package/src/components/Stepper/components/Step/components/StepLabel/constants.ts +10 -0
  293. package/src/components/Stepper/components/Step/components/StepLabel/stepLabel.styles.ts +13 -0
  294. package/src/components/Stepper/components/Step/components/StepLabel/stepLabel.tsx +10 -0
  295. package/src/components/Stepper/components/Step/components/StepLabel/stories/contants.ts +19 -0
  296. package/src/components/Stepper/components/Step/components/StepLabel/stories/stepLabel.stories.tsx +48 -0
  297. package/src/components/Stepper/components/Step/constants.ts +6 -0
  298. package/src/components/Stepper/components/Step/step.styles.ts +33 -0
  299. package/src/components/Stepper/components/Step/step.tsx +12 -0
  300. package/src/components/Stepper/components/Step/stories/contants.ts +18 -0
  301. package/src/components/Stepper/components/Step/stories/step.stories.tsx +87 -0
  302. package/src/components/Table/components/TableCell/components/RowPositionCell/constants.ts +2 -2
  303. package/src/components/common/AnchorLink/anchorLink.tsx +7 -0
  304. package/src/components/common/Form/components/Select/select.tsx +8 -1
  305. package/src/components/common/KeyValuePairs/components/KeyElType/keyElType.tsx +14 -9
  306. package/src/components/common/KeyValuePairs/components/ValueElType/valueElType.tsx +8 -9
  307. package/src/components/common/LoginDialog/constants.ts +4 -4
  308. package/src/providers/layoutDimensions/constants.ts +6 -0
  309. package/src/providers/layoutDimensions/context.tsx +10 -0
  310. package/src/providers/layoutDimensions/hook.ts +7 -0
  311. package/src/providers/layoutDimensions/provider.tsx +29 -0
  312. package/src/providers/layoutDimensions/types.ts +17 -0
  313. package/src/storybook/controls/constants.ts +12 -0
  314. package/src/storybook/controls/types.ts +4 -0
  315. package/src/storybook/controls/utils.ts +18 -0
  316. package/src/storybook/decorators.tsx +17 -0
  317. package/src/storybook/loremIpsum.ts +5 -0
  318. package/src/storybook/parameters.ts +14 -0
  319. package/src/styles/common/mui/stepper.ts +14 -0
  320. package/src/styles/common/mui/svgIcon.ts +35 -0
  321. package/src/styles/common/mui/tab.ts +16 -0
  322. package/src/styles/common/mui/tabs.ts +20 -0
  323. package/src/styles/common/mui/typography.ts +15 -2
  324. package/src/tests/mui/constants.ts +4 -0
  325. package/src/theme/common/components.ts +0 -4
  326. package/src/theme/common/typography.ts +11 -0
  327. package/src/theme/theme.ts +1 -0
  328. package/src/utils/tests.ts +20 -0
  329. package/tests/setup.ts +6 -0
  330. package/tests/stepIcon.test.tsx +42 -0
  331. package/types/data-explorer-ui.d.ts +3 -0
  332. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.d.ts +0 -5
  333. package/lib/components/Layout/components/Header/hooks/useMeasureHeader.js +0 -19
  334. package/lib/components/Layout/components/Outline/common/constants.d.ts +0 -2
  335. package/lib/hooks/useLayoutState.d.ts +0 -6
  336. package/lib/hooks/useLayoutState.js +0 -9
  337. package/lib/providers/layoutState.d.ts +0 -40
  338. package/lib/providers/layoutState.js +0 -47
  339. package/src/components/Layout/components/Header/hooks/useMeasureHeader.ts +0 -28
  340. package/src/components/Layout/components/Outline/common/constants.ts +0 -3
  341. package/src/hooks/useLayoutState.ts +0 -13
  342. package/src/providers/layoutState.tsx +0 -94
  343. /package/lib/components/Layout/components/Outline/{common → hooks/UseTabs}/constants.js +0 -0
@@ -0,0 +1,29 @@
1
+ import React, { useRef } from "react";
2
+ import {
3
+ getBorderBoxSizeHeight,
4
+ useResizeObserver,
5
+ } from "../../hooks/useResizeObserver";
6
+ import { LayoutDimensionsContext } from "./context";
7
+ import { LayoutDimensions, LayoutDimensionsProviderProps } from "./types";
8
+
9
+ export const LayoutDimensionsProvider = ({
10
+ children,
11
+ }: LayoutDimensionsProviderProps): JSX.Element => {
12
+ const footerRef = useRef<HTMLElement>(null);
13
+ const headerRef = useRef<HTMLElement>(null);
14
+ const footerRect = useResizeObserver(footerRef, getBorderBoxSizeHeight);
15
+ const headerRect = useResizeObserver(headerRef, getBorderBoxSizeHeight);
16
+
17
+ const dimensions: LayoutDimensions = {
18
+ footer: { height: footerRect?.height ?? 0 },
19
+ header: { height: headerRect?.height ?? 0 },
20
+ };
21
+
22
+ return (
23
+ <LayoutDimensionsContext.Provider
24
+ value={{ dimensions, footerRef, headerRef }}
25
+ >
26
+ {children}
27
+ </LayoutDimensionsContext.Provider>
28
+ );
29
+ };
@@ -0,0 +1,17 @@
1
+ import { ReactNode, RefObject } from "react";
2
+ import { ElementRect } from "../../hooks/useResizeObserver";
3
+
4
+ export interface LayoutDimensions {
5
+ footer: Pick<ElementRect, "height">;
6
+ header: Pick<ElementRect, "height">;
7
+ }
8
+
9
+ export interface LayoutDimensionsContextProps {
10
+ dimensions: LayoutDimensions;
11
+ footerRef: RefObject<HTMLElement> | null;
12
+ headerRef: RefObject<HTMLElement> | null;
13
+ }
14
+
15
+ export interface LayoutDimensionsProviderProps {
16
+ children: ReactNode | ReactNode[];
17
+ }
@@ -0,0 +1,12 @@
1
+ import { ArgTypes } from "@storybook/react";
2
+ import { CONTROL_TYPE } from "./types";
3
+
4
+ export const CONTROL_CONFIG_MAP: Record<
5
+ CONTROL_TYPE,
6
+ ArgTypes[keyof ArgTypes]["control"]
7
+ > = {
8
+ [CONTROL_TYPE.BOOLEAN]: { type: "boolean" },
9
+ [CONTROL_TYPE.DISABLED]: false,
10
+ };
11
+
12
+ export const MUI_CONTROLS = ["classes", "className", "ref", "sx"] as const;
@@ -0,0 +1,4 @@
1
+ export enum CONTROL_TYPE {
2
+ BOOLEAN = "boolean",
3
+ DISABLED = "disabled",
4
+ }
@@ -0,0 +1,18 @@
1
+ import { Args, ArgTypes } from "@storybook/react";
2
+ import { CONTROL_CONFIG_MAP } from "./constants";
3
+ import { CONTROL_TYPE } from "./types";
4
+
5
+ /**
6
+ * Configures controls for specified keys with the given control type.
7
+ * @param keys - ArgType keys.
8
+ * @param controlType - The type of control to apply (from CONTROL_TYPE enum).
9
+ * @returns An object of ArgTypes with the specified control configuration.
10
+ */
11
+ export function configureControls<TArg = Args>(
12
+ keys: (keyof TArg)[],
13
+ controlType: CONTROL_TYPE
14
+ ): Partial<ArgTypes<TArg>> {
15
+ return Object.fromEntries(
16
+ keys.map((key) => [key, { control: CONTROL_CONFIG_MAP[controlType] }])
17
+ ) as Partial<ArgTypes<TArg>>;
18
+ }
@@ -0,0 +1,17 @@
1
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
2
+ import { CssBaseline, ThemeProvider } from "@mui/material";
3
+ import { Preview } from "@storybook/react";
4
+ import React from "react";
5
+ import { createAppTheme } from "../theme/theme";
6
+
7
+ export const decorators: Preview["decorators"] = (Story, context) => {
8
+ const theme = createAppTheme();
9
+ return (
10
+ <EmotionThemeProvider theme={theme}>
11
+ <ThemeProvider theme={theme}>
12
+ <CssBaseline />
13
+ <Story {...context} />
14
+ </ThemeProvider>
15
+ </EmotionThemeProvider>
16
+ );
17
+ };
@@ -0,0 +1,5 @@
1
+ export const LOREM_IPSUM = {
2
+ LONG: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.",
3
+ SHORT:
4
+ "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.",
5
+ };
@@ -0,0 +1,14 @@
1
+ import { Preview } from "@storybook/react";
2
+
3
+ export const parameters: Preview["parameters"] = {
4
+ actions: { argTypesRegex: "^on[A-Z].*" },
5
+ controls: {
6
+ expanded: true,
7
+ matchers: {
8
+ color: /(background|color)$/i,
9
+ date: /Date$/,
10
+ },
11
+ sort: "alpha",
12
+ },
13
+ layout: "centered",
14
+ };
@@ -0,0 +1,14 @@
1
+ import { StepperProps } from "@mui/material";
2
+
3
+ type StepperPropsOptions = {
4
+ ORIENTATION: typeof ORIENTATION;
5
+ };
6
+
7
+ const ORIENTATION: Record<string, StepperProps["orientation"]> = {
8
+ HORIZONTAL: "horizontal",
9
+ VERTICAL: "vertical",
10
+ };
11
+
12
+ export const STEPPER_PROPS: StepperPropsOptions = {
13
+ ORIENTATION,
14
+ };
@@ -0,0 +1,35 @@
1
+ import { SvgIconProps } from "@mui/material";
2
+
3
+ type SvgIconPropsOptions = {
4
+ COLOR: typeof COLOR;
5
+ FONT_SIZE: typeof FONT_SIZE;
6
+ };
7
+
8
+ const COLOR: Record<string, SvgIconProps["color"]> = {
9
+ ACTION: "action",
10
+ DISABLED: "disabled",
11
+ ERROR: "error",
12
+ INFO: "info",
13
+ INHERIT: "inherit",
14
+ INK_LIGHT: "inkLight",
15
+ INK_MAIN: "inkMain",
16
+ PRIMARY: "primary",
17
+ SECONDARY: "secondary",
18
+ SUCCESS: "success",
19
+ WARNING: "warning",
20
+ };
21
+
22
+ const FONT_SIZE: Record<string, SvgIconProps["fontSize"]> = {
23
+ INHERIT: "inherit",
24
+ LARGE: "large",
25
+ MEDIUM: "medium",
26
+ SMALL: "small",
27
+ XSMALL: "xsmall",
28
+ XXLARGE: "xxlarge",
29
+ XXSMALL: "xxsmall",
30
+ };
31
+
32
+ export const SVG_ICON_PROPS: SvgIconPropsOptions = {
33
+ COLOR,
34
+ FONT_SIZE,
35
+ };
@@ -0,0 +1,16 @@
1
+ import { TabProps } from "@mui/material";
2
+
3
+ type TabPropsOptions = {
4
+ ICON_POSITION: typeof ICON_POSITION;
5
+ };
6
+
7
+ const ICON_POSITION: Record<string, TabProps["iconPosition"]> = {
8
+ BOTTOM: "bottom",
9
+ END: "end",
10
+ START: "start",
11
+ TOP: "top",
12
+ };
13
+
14
+ export const TAB_PROPS: TabPropsOptions = {
15
+ ICON_POSITION,
16
+ };
@@ -0,0 +1,20 @@
1
+ import { TabsProps } from "@mui/material";
2
+
3
+ type TabsPropsOptions = {
4
+ INDICATOR_COLOR: typeof INDICATOR_COLOR;
5
+ ORIENTATION: typeof ORIENTATION;
6
+ };
7
+
8
+ const INDICATOR_COLOR: Record<string, TabsProps["indicatorColor"]> = {
9
+ PRIMARY: "primary",
10
+ TRANSPARENT: "transparent",
11
+ };
12
+
13
+ const ORIENTATION: Record<string, TabsProps["orientation"]> = {
14
+ VERTICAL: "vertical",
15
+ };
16
+
17
+ export const TABS_PROPS: TabsPropsOptions = {
18
+ INDICATOR_COLOR,
19
+ ORIENTATION,
20
+ };
@@ -1,14 +1,27 @@
1
1
  import { TypographyOwnProps } from "@mui/material";
2
2
 
3
- export const COLOR: Record<string, TypographyOwnProps["color"]> = {
3
+ type TypographyPropsOptions = {
4
+ COLOR: typeof COLOR;
5
+ VARIANT: typeof VARIANT;
6
+ };
7
+
8
+ const COLOR: Record<string, TypographyOwnProps["color"]> = {
4
9
  INHERIT: "inherit",
5
10
  INK_LIGHT: "ink.light",
6
11
  INK_MAIN: "ink.main",
7
12
  };
8
13
 
9
- export const VARIANT: Record<string, TypographyOwnProps["variant"]> = {
14
+ const VARIANT: Record<string, TypographyOwnProps["variant"]> = {
10
15
  INHERIT: "inherit",
11
16
  TEXT_BODY_400: "text-body-400",
12
17
  TEXT_BODY_400_2_LINES: "text-body-400-2lines",
18
+ TEXT_BODY_SMALL_400: "text-body-small-400",
19
+ TEXT_HEADING_LARGE: "text-heading-large",
13
20
  TEXT_HEADING_SMALL: "text-heading-small",
21
+ TEXT_HEADING_XSMALL: "text-heading-xsmall",
22
+ };
23
+
24
+ export const TYPOGRAPHY_PROPS: TypographyPropsOptions = {
25
+ COLOR,
26
+ VARIANT,
14
27
  };
@@ -0,0 +1,4 @@
1
+ export const MUI_CLASSES = {
2
+ ACTIVE: "Mui-active",
3
+ COMPLETED: "Mui-completed",
4
+ };
@@ -1,5 +1,4 @@
1
1
  import { Components, Theme } from "@mui/material";
2
- import { DropDownIcon } from "../../components/common/Form/components/Select/components/DropDownIcon/dropDownIcon";
3
2
  import { CHIP_PROPS } from "../../styles/common/mui/chip";
4
3
  import { desktopUp, mobileUp, tabletUp } from "./breakpoints";
5
4
  import {
@@ -1180,9 +1179,6 @@ export const MuiRadio = (theme: Theme): Components["MuiRadio"] => {
1180
1179
  * MuiSelect Component
1181
1180
  */
1182
1181
  export const MuiSelect: Components["MuiSelect"] = {
1183
- defaultProps: {
1184
- IconComponent: DropDownIcon,
1185
- },
1186
1182
  styleOverrides: {
1187
1183
  select: {
1188
1184
  minHeight: "unset",
@@ -20,6 +20,7 @@ const TYPOGRAPHY = {
20
20
  TEXT_HEADING_LARGE: "text-heading-large",
21
21
  TEXT_HEADING_SMALL: "text-heading-small",
22
22
  TEXT_HEADING_XLARGE: "text-heading-xlarge",
23
+ TEXT_HEADING_XSMALL: "text-heading-xsmall",
23
24
  TEXT_UPPERCASE_500: "text-uppercase-500",
24
25
  } as const;
25
26
  export const {
@@ -37,6 +38,7 @@ export const {
37
38
  TEXT_HEADING_LARGE,
38
39
  TEXT_HEADING_SMALL,
39
40
  TEXT_HEADING_XLARGE,
41
+ TEXT_HEADING_XSMALL,
40
42
  TEXT_UPPERCASE_500,
41
43
  } = TYPOGRAPHY;
42
44
 
@@ -189,6 +191,15 @@ export const textHeadingXLarge: CSSProperties = {
189
191
  },
190
192
  };
191
193
 
194
+ /**
195
+ * Typography Option "text-heading-xsmall"
196
+ */
197
+ export const textHeadingXSmall: CSSProperties = {
198
+ fontSize: 16,
199
+ fontWeight: 500,
200
+ lineHeight: "24px",
201
+ };
202
+
192
203
  /**
193
204
  * Typography Option "text-uppercase-500"
194
205
  */
@@ -55,6 +55,7 @@ export function createAppTheme(customOptions?: ThemeOptions): Theme {
55
55
  [T.TEXT_HEADING_LARGE]: T.textHeadingLarge,
56
56
  [T.TEXT_HEADING_SMALL]: T.textHeadingSmall,
57
57
  [T.TEXT_HEADING_XLARGE]: T.textHeadingXLarge,
58
+ [T.TEXT_HEADING_XSMALL]: T.textHeadingXSmall,
58
59
  [T.TEXT_UPPERCASE_500]: T.textUppercase500,
59
60
  fontFamily: T.fontFamily,
60
61
  },
@@ -17,3 +17,23 @@ export function getAnchorEl(id: string): HTMLAnchorElement {
17
17
  export function getButtonById(id: string): HTMLButtonElement {
18
18
  return screen.getByTestId(id);
19
19
  }
20
+
21
+ /**
22
+ * Returns class names of the given element.
23
+ * @param element - Element.
24
+ * @returns element class names.
25
+ */
26
+ export function getClassNames(element?: Element | null): string | null {
27
+ if (!element) return null;
28
+ return element.getAttribute("class");
29
+ }
30
+
31
+ /**
32
+ * Returns tag name of the given element.
33
+ * @param element - Element.
34
+ * @returns element tag name.
35
+ */
36
+ export function getTagName(element?: Element | null): string | null {
37
+ if (!element) return null;
38
+ return element.tagName.toLowerCase();
39
+ }
package/tests/setup.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { setProjectAnnotations } from "@storybook/react";
2
+ import { decorators } from "../src/storybook/decorators";
3
+ import { parameters } from "../src/storybook/parameters";
4
+
5
+ // Set project annotations once before all tests
6
+ setProjectAnnotations({ decorators, parameters });
@@ -0,0 +1,42 @@
1
+ import { composeStories } from "@storybook/react";
2
+ import { render, screen } from "@testing-library/react";
3
+ import React from "react";
4
+ import { STEP_ICON_TEST_ID } from "../src/components/Stepper/components/Step/components/StepIcon/constants";
5
+ import * as stories from "../src/components/Stepper/components/Step/components/StepIcon/stories/stepIcon.stories";
6
+ import { MUI_CLASSES } from "../src/tests/mui/constants";
7
+ import { getClassNames, getTagName } from "../src/utils/tests";
8
+
9
+ const { Active, Completed, Default } = composeStories(stories);
10
+
11
+ describe("StepIcon", () => {
12
+ it("renders correctly", () => {
13
+ render(<Default testId={STEP_ICON_TEST_ID} />);
14
+ const stepIconEl = screen.getByTestId(STEP_ICON_TEST_ID);
15
+ expect(stepIconEl).not.toBeNull();
16
+ });
17
+
18
+ it("renders inactive step icon", () => {
19
+ render(<Default testId={STEP_ICON_TEST_ID} />);
20
+ const stepIconEl = screen.getByTestId(STEP_ICON_TEST_ID);
21
+ expect(stepIconEl.textContent).toEqual("1");
22
+ expect(getClassNames(stepIconEl)).not.toContain(MUI_CLASSES.ACTIVE);
23
+ expect(getClassNames(stepIconEl)).not.toContain(MUI_CLASSES.COMPLETED);
24
+ });
25
+
26
+ it("renders active step icon", () => {
27
+ render(<Active testId={STEP_ICON_TEST_ID} />);
28
+ const stepIconEl = screen.getByTestId(STEP_ICON_TEST_ID);
29
+ expect(stepIconEl.textContent).toEqual("1");
30
+ expect(getClassNames(stepIconEl)).toContain(MUI_CLASSES.ACTIVE);
31
+ expect(getClassNames(stepIconEl)).not.toContain(MUI_CLASSES.COMPLETED);
32
+ });
33
+
34
+ it("renders completed step icon", () => {
35
+ render(<Completed testId={STEP_ICON_TEST_ID} />);
36
+ const stepIconEl = screen.getByTestId(STEP_ICON_TEST_ID);
37
+ expect(stepIconEl.textContent).not.toEqual("1");
38
+ expect(getClassNames(stepIconEl)).not.toContain(MUI_CLASSES.ACTIVE);
39
+ expect(getClassNames(stepIconEl)).toContain(MUI_CLASSES.COMPLETED);
40
+ expect(getTagName(stepIconEl.firstElementChild)).toBe("path");
41
+ });
42
+ });
@@ -203,6 +203,7 @@ declare module "@mui/material/styles" {
203
203
  "text-heading-large": TypographyStyleOptions;
204
204
  "text-heading-small": TypographyStyleOptions;
205
205
  "text-heading-xlarge": TypographyStyleOptions;
206
+ "text-heading-xsmall": TypographyStyleOptions;
206
207
  "text-uppercase-500": TypographyStyleOptions;
207
208
  }
208
209
 
@@ -221,6 +222,7 @@ declare module "@mui/material/styles" {
221
222
  "text-heading-large"?: TypographyStyleOptions;
222
223
  "text-heading-small"?: TypographyStyleOptions;
223
224
  "text-heading-xlarge"?: TypographyStyleOptions;
225
+ "text-heading-xsmall"?: TypographyStyleOptions;
224
226
  "text-uppercase-500"?: TypographyStyleOptions;
225
227
  }
226
228
  }
@@ -253,6 +255,7 @@ declare module "@mui/material/Typography" {
253
255
  "text-heading-large": true;
254
256
  "text-heading-small": true;
255
257
  "text-heading-xlarge": true;
258
+ "text-heading-xsmall": true;
256
259
  "text-uppercase-500": true;
257
260
  }
258
261
  }
@@ -1,5 +0,0 @@
1
- import { RefObject } from "react";
2
- export interface UseMeasureHeader {
3
- headerRef: RefObject<HTMLElement>;
4
- }
5
- export declare const useMeasureHeader: () => UseMeasureHeader;
@@ -1,19 +0,0 @@
1
- import { useEffect, useRef } from "react";
2
- import { useLayoutState } from "../../../../../hooks/useLayoutState";
3
- import { getBorderBoxSizeHeight, useResizeObserver, } from "../../../../../hooks/useResizeObserver";
4
- import { LayoutActionKind } from "../../../../../providers/layoutState";
5
- export const useMeasureHeader = () => {
6
- const { layoutDispatch } = useLayoutState();
7
- const headerRef = useRef(null);
8
- const { height } = useResizeObserver(headerRef, getBorderBoxSizeHeight) || {};
9
- // Updates layout state header height.
10
- useEffect(() => {
11
- if (!height)
12
- return;
13
- layoutDispatch({
14
- payload: height,
15
- type: LayoutActionKind.UpdateHeaderHeight,
16
- });
17
- }, [height, layoutDispatch]);
18
- return { headerRef };
19
- };
@@ -1,2 +0,0 @@
1
- import { TabProps as MTabProps } from "@mui/material";
2
- export declare const DEFAULT_TAB_VALUE: MTabProps["value"];
@@ -1,6 +0,0 @@
1
- import { LayoutStateContextProps } from "../providers/layoutState";
2
- /**
3
- * Returns layout state context.
4
- * @returns layout state context.
5
- */
6
- export declare const useLayoutState: () => LayoutStateContextProps;
@@ -1,9 +0,0 @@
1
- import { useContext } from "react";
2
- import { LayoutStateContext, } from "../providers/layoutState";
3
- /**
4
- * Returns layout state context.
5
- * @returns layout state context.
6
- */
7
- export const useLayoutState = () => {
8
- return useContext(LayoutStateContext);
9
- };
@@ -1,40 +0,0 @@
1
- import React, { Dispatch, ReactNode } from "react";
2
- export declare const DEFAULT_LAYOUT_STATE: {
3
- headerHeight: number;
4
- };
5
- /**
6
- * Layout state.
7
- */
8
- export type LayoutState = {
9
- headerHeight: number;
10
- };
11
- /**
12
- * Model of layout state context.
13
- */
14
- export type LayoutStateContextProps = {
15
- layoutDispatch: Dispatch<LayoutAction>;
16
- layoutState: LayoutState;
17
- };
18
- export declare const LayoutStateContext: React.Context<LayoutStateContextProps>;
19
- export interface LayoutStateProps {
20
- children: ReactNode | ReactNode[];
21
- }
22
- export declare function LayoutStateProvider({ children, }: LayoutStateProps): JSX.Element;
23
- /**
24
- * Layout action kind.
25
- */
26
- export declare enum LayoutActionKind {
27
- UpdateHeaderHeight = "UPDATE_HEADER_HEIGHT"
28
- }
29
- /**
30
- * Layout action.
31
- */
32
- export type LayoutAction = UpdateHeaderHeightAction;
33
- /**
34
- * Update header height action.
35
- */
36
- type UpdateHeaderHeightAction = {
37
- payload?: number;
38
- type: LayoutActionKind.UpdateHeaderHeight;
39
- };
40
- export {};
@@ -1,47 +0,0 @@
1
- import React, { createContext, useReducer } from "react";
2
- import { HEADER_HEIGHT } from "../components/Layout/components/Header/common/constants";
3
- // Default layout state.
4
- export const DEFAULT_LAYOUT_STATE = {
5
- headerHeight: HEADER_HEIGHT + 1, // 1px for bottom border.
6
- };
7
- export const LayoutStateContext = createContext({
8
- // eslint-disable-next-line @typescript-eslint/no-empty-function -- allow dummy function for default state.
9
- layoutDispatch: () => { },
10
- layoutState: DEFAULT_LAYOUT_STATE,
11
- });
12
- export function LayoutStateProvider({ children, }) {
13
- // Layout state.
14
- const [layoutState, layoutDispatch] = useReducer((s, a) => layoutReducer(s, a), DEFAULT_LAYOUT_STATE);
15
- return (React.createElement(LayoutStateContext.Provider, { value: {
16
- layoutDispatch,
17
- layoutState,
18
- } }, children));
19
- }
20
- /**
21
- * Layout action kind.
22
- */
23
- export var LayoutActionKind;
24
- (function (LayoutActionKind) {
25
- LayoutActionKind["UpdateHeaderHeight"] = "UPDATE_HEADER_HEIGHT";
26
- })(LayoutActionKind || (LayoutActionKind = {}));
27
- /**
28
- * Layout reducer.
29
- * @param state - Layout state.
30
- * @param action - Layout action.
31
- * @returns layout state.
32
- */
33
- function layoutReducer(state, action) {
34
- const { payload, type } = action;
35
- // eslint-disable-next-line sonarjs/no-small-switch -- allow small switch.
36
- switch (type) {
37
- // Updates header height.
38
- case LayoutActionKind.UpdateHeaderHeight: {
39
- return {
40
- ...state,
41
- headerHeight: payload ?? state.headerHeight,
42
- };
43
- }
44
- default:
45
- return state;
46
- }
47
- }
@@ -1,28 +0,0 @@
1
- import { RefObject, useEffect, useRef } from "react";
2
- import { useLayoutState } from "../../../../../hooks/useLayoutState";
3
- import {
4
- getBorderBoxSizeHeight,
5
- useResizeObserver,
6
- } from "../../../../../hooks/useResizeObserver";
7
- import { LayoutActionKind } from "../../../../../providers/layoutState";
8
-
9
- export interface UseMeasureHeader {
10
- headerRef: RefObject<HTMLElement>;
11
- }
12
-
13
- export const useMeasureHeader = (): UseMeasureHeader => {
14
- const { layoutDispatch } = useLayoutState();
15
- const headerRef = useRef<HTMLElement>(null);
16
- const { height } = useResizeObserver(headerRef, getBorderBoxSizeHeight) || {};
17
-
18
- // Updates layout state header height.
19
- useEffect(() => {
20
- if (!height) return;
21
- layoutDispatch({
22
- payload: height,
23
- type: LayoutActionKind.UpdateHeaderHeight,
24
- });
25
- }, [height, layoutDispatch]);
26
-
27
- return { headerRef };
28
- };
@@ -1,3 +0,0 @@
1
- import { TabProps as MTabProps } from "@mui/material";
2
-
3
- export const DEFAULT_TAB_VALUE: MTabProps["value"] = "";
@@ -1,13 +0,0 @@
1
- import { useContext } from "react";
2
- import {
3
- LayoutStateContext,
4
- LayoutStateContextProps,
5
- } from "../providers/layoutState";
6
-
7
- /**
8
- * Returns layout state context.
9
- * @returns layout state context.
10
- */
11
- export const useLayoutState = (): LayoutStateContextProps => {
12
- return useContext(LayoutStateContext);
13
- };