@react-fabric/core 1.0.0-beta.6 → 1.0.0-beta.61

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 (429) hide show
  1. package/{src/components/actionLabel/ActionLabel.module.css → css/components/_actionLabel.css} +4 -4
  2. package/{src/overlays/alert/Alert.module.css → css/components/_alert.css} +3 -3
  3. package/{src/components/animations/Animations.module.css → css/components/_animations.css} +9 -9
  4. package/{src/components/avatar/Avatar.module.css → css/components/_avatar.css} +11 -11
  5. package/{src/components/badge/Badge.module.css → css/components/_badge.css} +19 -17
  6. package/{src/components/breadcrumbs/Breadcrumbs.module.css → css/components/_breadcrumbs.css} +52 -47
  7. package/{src/components/button/Button.module.css → css/components/_button.css} +86 -84
  8. package/{src/components/card/Card.module.css → css/components/_card.css} +54 -28
  9. package/{src/components/chip/Chip.module.css → css/components/_chip.css} +14 -10
  10. package/{src/components/collapsable/Collapsable.module.css → css/components/_collapsable.css} +3 -3
  11. package/css/components/_divider.css +38 -0
  12. package/{src/components/dropdown/Dropdown.module.css → css/components/_dropdown.css} +2 -2
  13. package/{src/overlays/flyout/Flyout.module.css → css/components/_flyout.css} +6 -6
  14. package/{src/components/icon/Icon.module.css → css/components/_icon.css} +12 -9
  15. package/{src/components/media/Media.module.css → css/components/_media.css} +17 -17
  16. package/{src/components/menu/Menu.module.css → css/components/_menu.css} +21 -20
  17. package/{src/overlays/message/Message.module.css → css/components/_message.css} +2 -2
  18. package/{src/components/meter/Meter.module.css → css/components/_meter.css} +10 -10
  19. package/{src/overlays/modal/Modal.module.css → css/components/_modal.css} +8 -8
  20. package/{src/components/panel/Panel.module.css → css/components/_panel.css} +17 -17
  21. package/{src/components/progress/Progress.module.css → css/components/_progress.css} +7 -10
  22. package/css/components/_stepper.css +86 -0
  23. package/{src/components/tabpanel/TabPanel.module.css → css/components/_tabPanel.css} +130 -85
  24. package/{src/overlays/toast/Toast.module.css → css/components/_toast.css} +2 -2
  25. package/css/components/_tooltip.css +29 -0
  26. package/{src/core/content/Content.module.css → css/components/index.css} +26 -18
  27. package/{src/core/aside/Aside.module.css → css/core/_aside.css} +60 -48
  28. package/{src/core/section/Section.module.css → css/core/_content.css} +5 -3
  29. package/{src/core/boundary/ErrorBoundary.module.css → css/core/_errorboundary.css} +9 -9
  30. package/{src/core/headfoot/HeadFoot.module.css → css/core/_headfoot.css} +4 -10
  31. package/{src/core/page/Page.module.css → css/core/_page.css} +10 -14
  32. package/{src/core/responsive/Responsive.module.css → css/core/_responsive.css} +10 -10
  33. package/css/core/_section.css +28 -0
  34. package/{src/core/theme/Theme.module.css → css/core/_theme.css} +3 -3
  35. package/{src/typography/Typography.module.css → css/core/_typography.css} +14 -12
  36. package/{src/core/viewport/Viewport.module.css → css/core/_viewport.css} +7 -3
  37. package/css/core/index.css +33 -0
  38. package/css/reset/_gradients.css +8 -8
  39. package/css/reset/_reset.css +56 -224
  40. package/css/reset/_text.css +14 -29
  41. package/css/reset/_theme.css +331 -52
  42. package/css/reset/index.css +4 -4
  43. package/css/styles.css +9 -6
  44. package/css/theme/_colors.css +320 -0
  45. package/css/theme/_utilities.css +541 -0
  46. package/css/theme/index.css +45 -0
  47. package/dist/cjs/components/actionLabel/ActionLabel.js +26 -8
  48. package/dist/cjs/components/animations/Animations.js +137 -45
  49. package/dist/cjs/components/avatar/Avatar.js +46 -13
  50. package/dist/cjs/components/avatar/AvatarGroup.js +22 -4
  51. package/dist/cjs/components/badge/Badge.js +36 -15
  52. package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +40 -9
  53. package/dist/cjs/components/button/Button.js +51 -29
  54. package/dist/cjs/components/button/ButtonGroup.js +30 -3
  55. package/dist/cjs/components/button/ConfirmButton.js +28 -2
  56. package/dist/cjs/components/button/ToggleButtonGroup.js +41 -15
  57. package/dist/cjs/components/callout/Callout.js +47 -7
  58. package/dist/cjs/components/card/Card.js +60 -18
  59. package/dist/cjs/components/card/CardCover.js +36 -5
  60. package/dist/cjs/components/card/FlipContent.js +56 -0
  61. package/dist/cjs/components/chip/Chip.js +40 -20
  62. package/dist/cjs/components/collapsable/Collapsable.js +32 -8
  63. package/dist/cjs/components/divider/Divider.js +30 -7
  64. package/dist/cjs/components/dropdown/Dropdown.js +48 -9
  65. package/dist/cjs/components/dropdown/DropdownTool.js +2 -3
  66. package/dist/cjs/components/empty/EmptyContent.js +37 -7
  67. package/dist/cjs/components/icon/Icon.js +76 -13
  68. package/dist/cjs/components/media/Media.js +174 -76
  69. package/dist/cjs/components/menu/ContextMenu.js +19 -0
  70. package/dist/cjs/components/menu/Menu.js +77 -23
  71. package/dist/cjs/components/menu/MenuItem.js +54 -27
  72. package/dist/cjs/components/meter/Meter.js +26 -3
  73. package/dist/cjs/components/navigator/Navigator.js +50 -18
  74. package/dist/cjs/components/panel/Panel.js +59 -28
  75. package/dist/cjs/components/panel/PanelGroup.js +25 -2
  76. package/dist/cjs/components/panel/PanelStack.js +31 -2
  77. package/dist/cjs/components/progress/ProgressBar.js +31 -9
  78. package/dist/cjs/components/progress/ProgressCircle.js +29 -7
  79. package/dist/cjs/components/tabpanel/Tab.js +39 -16
  80. package/dist/cjs/components/tabpanel/TabPanel.js +56 -16
  81. package/dist/cjs/context/Global.js +28 -1
  82. package/dist/cjs/context/NotificationCenter.js +3 -3
  83. package/dist/cjs/core/aside/Aside.js +50 -25
  84. package/dist/cjs/core/boundary/ErrorBoundary.js +25 -8
  85. package/dist/cjs/core/boundary/ErrorIcon.js +1 -2
  86. package/dist/cjs/core/content/Content.js +7 -3
  87. package/dist/cjs/core/headfoot/HeadFoot.js +48 -22
  88. package/dist/cjs/core/page/Page.js +41 -40
  89. package/dist/cjs/core/responsive/Responsive.js +59 -6
  90. package/dist/cjs/core/section/Section.js +12 -29
  91. package/dist/cjs/core/theme/ThemeProvider.js +32 -10
  92. package/dist/cjs/core/viewport/Viewport.js +18 -2
  93. package/dist/cjs/hooks/useControlledValue.js +12 -0
  94. package/dist/cjs/hooks/useDebounce.js +14 -1
  95. package/dist/cjs/hooks/useEffectDebugger.js +54 -2
  96. package/dist/cjs/hooks/useIsDark.js +8 -0
  97. package/dist/cjs/hooks/useIsRtl.js +12 -0
  98. package/dist/cjs/hooks/useNavigator.js +6 -4
  99. package/dist/cjs/hooks/useOverlayService.js +24 -0
  100. package/dist/cjs/hooks/usePropToggle.js +16 -5
  101. package/dist/cjs/hooks/useResize.js +18 -0
  102. package/dist/cjs/hooks/useResizeObserver.js +20 -1
  103. package/dist/cjs/hooks/useStepper.js +74 -0
  104. package/dist/cjs/hooks/useStorage.js +39 -0
  105. package/dist/cjs/hotkeys/HotKeyLabel.js +1 -1
  106. package/dist/cjs/hotkeys/HotKeyWrapper.js +3 -1
  107. package/dist/cjs/index.js +14 -10
  108. package/dist/cjs/overlays/alert/Alert.js +24 -17
  109. package/dist/cjs/overlays/flyout/Flyout.js +48 -65
  110. package/dist/cjs/overlays/message/Message.js +8 -3
  111. package/dist/cjs/overlays/modal/Modal.js +19 -23
  112. package/dist/cjs/overlays/toast/Toast.js +22 -13
  113. package/dist/cjs/overlays/tooltip/Tooltip.js +25 -13
  114. package/dist/cjs/typography/Abbr.js +35 -7
  115. package/dist/cjs/typography/{Link.js → Anchor.js} +23 -5
  116. package/dist/cjs/typography/Copy.js +1 -2
  117. package/dist/cjs/typography/Mark.js +25 -5
  118. package/dist/cjs/typography/Text.js +30 -5
  119. package/dist/cjs/typography/Title.js +19 -4
  120. package/dist/cjs/utils/cloneElement.js +47 -0
  121. package/dist/cjs/utils/getColor.js +1 -18
  122. package/dist/esm/components/actionLabel/ActionLabel.js +26 -8
  123. package/dist/esm/components/animations/Animations.js +135 -44
  124. package/dist/esm/components/avatar/Avatar.js +46 -13
  125. package/dist/esm/components/avatar/AvatarGroup.js +22 -4
  126. package/dist/esm/components/badge/Badge.js +38 -17
  127. package/dist/esm/components/breadcrumbs/Breadcrumbs.js +40 -9
  128. package/dist/esm/components/button/Button.js +53 -31
  129. package/dist/esm/components/button/ButtonGroup.js +31 -4
  130. package/dist/esm/components/button/ConfirmButton.js +28 -2
  131. package/dist/esm/components/button/ToggleButtonGroup.js +42 -16
  132. package/dist/esm/components/callout/Callout.js +47 -7
  133. package/dist/esm/components/card/Card.js +61 -19
  134. package/dist/esm/components/card/CardCover.js +36 -5
  135. package/dist/esm/components/card/FlipContent.js +56 -0
  136. package/dist/esm/components/chip/Chip.js +42 -22
  137. package/dist/esm/components/collapsable/Collapsable.js +32 -8
  138. package/dist/esm/components/divider/Divider.js +31 -8
  139. package/dist/esm/components/dropdown/Dropdown.js +48 -9
  140. package/dist/esm/components/dropdown/DropdownTool.js +2 -3
  141. package/dist/esm/components/empty/EmptyContent.js +37 -7
  142. package/dist/esm/components/icon/Icon.js +78 -16
  143. package/dist/esm/components/media/Media.js +175 -77
  144. package/dist/esm/components/menu/ContextMenu.js +19 -0
  145. package/dist/esm/components/menu/Menu.js +79 -25
  146. package/dist/esm/components/menu/MenuItem.js +49 -22
  147. package/dist/esm/components/meter/Meter.js +26 -3
  148. package/dist/esm/components/navigator/Navigator.js +50 -18
  149. package/dist/esm/components/panel/Panel.js +61 -30
  150. package/dist/esm/components/panel/PanelGroup.js +25 -2
  151. package/dist/esm/components/panel/PanelStack.js +31 -2
  152. package/dist/esm/components/progress/ProgressBar.js +31 -9
  153. package/dist/esm/components/progress/ProgressCircle.js +29 -7
  154. package/dist/esm/components/tabpanel/Tab.js +40 -17
  155. package/dist/esm/components/tabpanel/TabPanel.js +56 -16
  156. package/dist/esm/context/Global.js +28 -1
  157. package/dist/esm/context/NotificationCenter.js +3 -3
  158. package/dist/esm/core/aside/Aside.js +52 -27
  159. package/dist/esm/core/boundary/ErrorBoundary.js +25 -8
  160. package/dist/esm/core/boundary/ErrorIcon.js +1 -2
  161. package/dist/esm/core/content/Content.js +7 -3
  162. package/dist/esm/core/headfoot/HeadFoot.js +48 -22
  163. package/dist/esm/core/page/Page.js +43 -42
  164. package/dist/esm/core/responsive/Responsive.js +59 -6
  165. package/dist/esm/core/section/Section.js +12 -29
  166. package/dist/esm/core/theme/ThemeProvider.js +32 -10
  167. package/dist/esm/core/viewport/Viewport.js +18 -2
  168. package/dist/esm/hooks/useControlledValue.js +12 -0
  169. package/dist/esm/hooks/useDebounce.js +14 -1
  170. package/dist/esm/hooks/useEffectDebugger.js +54 -2
  171. package/dist/esm/hooks/useIsDark.js +8 -0
  172. package/dist/esm/hooks/useIsRtl.js +12 -0
  173. package/dist/esm/hooks/useNavigator.js +7 -5
  174. package/dist/esm/hooks/useOverlayService.js +24 -0
  175. package/dist/esm/hooks/usePropToggle.js +16 -5
  176. package/dist/esm/hooks/useResize.js +18 -0
  177. package/dist/esm/hooks/useResizeObserver.js +20 -1
  178. package/dist/esm/hooks/useStepper.js +74 -0
  179. package/dist/esm/hooks/useStorage.js +39 -0
  180. package/dist/esm/hotkeys/HotKeyLabel.js +1 -1
  181. package/dist/esm/hotkeys/HotKeyWrapper.js +3 -1
  182. package/dist/esm/index.js +7 -4
  183. package/dist/esm/overlays/alert/Alert.js +25 -18
  184. package/dist/esm/overlays/flyout/Flyout.js +53 -70
  185. package/dist/esm/overlays/message/Message.js +9 -4
  186. package/dist/esm/overlays/modal/Modal.js +22 -26
  187. package/dist/esm/overlays/toast/Toast.js +23 -14
  188. package/dist/esm/overlays/tooltip/Tooltip.js +25 -13
  189. package/dist/esm/typography/Abbr.js +35 -7
  190. package/dist/esm/typography/{Link.js → Anchor.js} +24 -6
  191. package/dist/esm/typography/Copy.js +1 -2
  192. package/dist/esm/typography/Mark.js +25 -5
  193. package/dist/esm/typography/Text.js +31 -6
  194. package/dist/esm/typography/Title.js +20 -5
  195. package/dist/esm/utils/cloneElement.js +47 -0
  196. package/dist/esm/utils/getColor.js +2 -16
  197. package/dist/types/components/actionLabel/ActionLabel.d.ts +21 -2
  198. package/dist/types/components/animations/Animations.d.ts +105 -7
  199. package/dist/types/components/avatar/Avatar.d.ts +34 -6
  200. package/dist/types/components/avatar/AvatarGroup.d.ts +19 -1
  201. package/dist/types/components/badge/Badge.d.ts +37 -3
  202. package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +31 -2
  203. package/dist/types/components/button/Button.d.ts +39 -7
  204. package/dist/types/components/button/ButtonGroup.d.ts +28 -3
  205. package/dist/types/components/button/ConfirmButton.d.ts +23 -3
  206. package/dist/types/components/button/ToggleButtonGroup.d.ts +39 -11
  207. package/dist/types/components/callout/Callout.d.ts +29 -3
  208. package/dist/types/components/card/Card.d.ts +44 -4
  209. package/dist/types/components/card/CardCover.d.ts +25 -0
  210. package/dist/types/components/card/FlipContent.d.ts +28 -0
  211. package/dist/types/components/chip/Chip.d.ts +34 -5
  212. package/dist/types/components/collapsable/Collapsable.d.ts +28 -2
  213. package/dist/types/components/divider/Divider.d.ts +30 -7
  214. package/dist/types/components/dropdown/Dropdown.d.ts +40 -1
  215. package/dist/types/components/dropdown/DropdownTool.d.ts +25 -0
  216. package/dist/types/components/empty/EmptyContent.d.ts +32 -3
  217. package/dist/types/components/icon/Icon.d.ts +40 -8
  218. package/dist/types/components/index.d.ts +3 -2
  219. package/dist/types/components/media/Media.d.ts +54 -0
  220. package/dist/types/components/menu/ContextMenu.d.ts +19 -1
  221. package/dist/types/components/menu/Menu.d.ts +29 -0
  222. package/dist/types/components/menu/MenuItem.d.ts +22 -2
  223. package/dist/types/components/menu/types.d.ts +9 -3
  224. package/dist/types/components/meter/Meter.d.ts +24 -0
  225. package/dist/types/components/navigator/Navigator.d.ts +29 -4
  226. package/dist/types/components/panel/Panel.d.ts +43 -4
  227. package/dist/types/components/panel/PanelGroup.d.ts +24 -0
  228. package/dist/types/components/panel/PanelStack.d.ts +31 -0
  229. package/dist/types/components/progress/ProgressBar.d.ts +23 -3
  230. package/dist/types/components/progress/ProgressCircle.d.ts +22 -3
  231. package/dist/types/components/tabpanel/Tab.d.ts +38 -4
  232. package/dist/types/components/tabpanel/TabPanel.d.ts +51 -2
  233. package/dist/types/context/Global.d.ts +24 -1
  234. package/dist/types/core/aside/Aside.d.ts +45 -6
  235. package/dist/types/core/boundary/ErrorBoundary.d.ts +18 -2
  236. package/dist/types/core/content/Content.d.ts +6 -1
  237. package/dist/types/core/headfoot/HeadFoot.d.ts +41 -9
  238. package/dist/types/core/page/Page.d.ts +32 -4
  239. package/dist/types/core/responsive/Responsive.d.ts +58 -3
  240. package/dist/types/core/section/Section.d.ts +18 -3
  241. package/dist/types/core/theme/ThemeProvider.d.ts +25 -5
  242. package/dist/types/core/viewport/Viewport.d.ts +15 -1
  243. package/dist/types/hooks/useControlledValue.d.ts +13 -2
  244. package/dist/types/hooks/useDebounce.d.ts +12 -0
  245. package/dist/types/hooks/useEffectDebugger.d.ts +49 -0
  246. package/dist/types/hooks/useIsDark.d.ts +8 -0
  247. package/dist/types/hooks/useIsRtl.d.ts +12 -0
  248. package/dist/types/hooks/useNavigator.d.ts +18 -1
  249. package/dist/types/hooks/useOverlayService.d.ts +28 -9
  250. package/dist/types/hooks/usePropToggle.d.ts +16 -5
  251. package/dist/types/hooks/useResize.d.ts +19 -1
  252. package/dist/types/hooks/useResizeObserver.d.ts +20 -1
  253. package/dist/types/hooks/useStepper.d.ts +14 -0
  254. package/dist/types/hooks/useStorage.d.ts +38 -0
  255. package/dist/types/index.d.ts +4 -1
  256. package/dist/types/overlays/alert/Alert.d.ts +16 -5
  257. package/dist/types/overlays/flyout/Flyout.d.ts +9 -4
  258. package/dist/types/overlays/message/Message.d.ts +16 -5
  259. package/dist/types/overlays/modal/Modal.d.ts +13 -4
  260. package/dist/types/overlays/toast/Toast.d.ts +16 -5
  261. package/dist/types/overlays/tooltip/Tooltip.d.ts +2 -2
  262. package/dist/types/types/index.d.ts +28 -24
  263. package/dist/types/typography/Abbr.d.ts +34 -4
  264. package/dist/types/typography/Anchor.d.ts +42 -0
  265. package/dist/types/typography/Copy.d.ts +15 -0
  266. package/dist/types/typography/Mark.d.ts +22 -4
  267. package/dist/types/typography/Text.d.ts +27 -1
  268. package/dist/types/typography/Title.d.ts +16 -1
  269. package/dist/types/typography/index.d.ts +1 -1
  270. package/dist/types/utils/cloneElement.d.ts +1 -0
  271. package/dist/types/utils/getColor.d.ts +1 -4
  272. package/dist/types/utils/index.d.ts +1 -0
  273. package/package.json +17 -16
  274. package/src/components/actionLabel/ActionLabel.tsx +26 -8
  275. package/src/components/animations/Animations.tsx +139 -52
  276. package/src/components/avatar/Avatar.tsx +51 -15
  277. package/src/components/avatar/AvatarGroup.tsx +23 -5
  278. package/src/components/badge/Badge.tsx +50 -22
  279. package/src/components/breadcrumbs/Breadcrumbs.tsx +43 -10
  280. package/src/components/button/Button.tsx +75 -43
  281. package/src/components/button/ButtonGroup.tsx +33 -7
  282. package/src/components/button/ConfirmButton.tsx +31 -3
  283. package/src/components/button/ToggleButtonGroup.tsx +74 -47
  284. package/src/components/callout/Callout.tsx +58 -16
  285. package/src/components/card/Card.tsx +84 -25
  286. package/src/components/card/CardCover.tsx +36 -6
  287. package/src/components/card/FlipContent.tsx +90 -0
  288. package/src/components/chip/Chip.tsx +53 -25
  289. package/src/components/collapsable/Collapsable.tsx +35 -11
  290. package/src/components/divider/Divider.tsx +42 -16
  291. package/src/components/dropdown/Dropdown.tsx +47 -12
  292. package/src/components/dropdown/DropdownTool.tsx +28 -4
  293. package/src/components/empty/EmptyContent.tsx +49 -8
  294. package/src/components/icon/Icon.tsx +96 -18
  295. package/src/components/index.ts +5 -4
  296. package/src/components/media/Media.tsx +193 -105
  297. package/src/components/menu/ContextMenu.tsx +19 -0
  298. package/src/components/menu/Menu.tsx +88 -32
  299. package/src/components/menu/MenuItem.tsx +44 -19
  300. package/src/components/menu/types.ts +9 -8
  301. package/src/components/meter/Meter.tsx +27 -4
  302. package/src/components/navigator/Navigator.tsx +60 -12
  303. package/src/components/panel/Panel.tsx +66 -28
  304. package/src/components/panel/PanelGroup.tsx +25 -2
  305. package/src/components/panel/PanelStack.tsx +33 -2
  306. package/src/components/progress/ProgressBar.tsx +33 -14
  307. package/src/components/progress/ProgressCircle.tsx +29 -13
  308. package/src/components/tabpanel/Tab.tsx +47 -24
  309. package/src/components/tabpanel/TabPanel.tsx +79 -13
  310. package/src/context/Global.tsx +28 -1
  311. package/src/context/NotificationCenter.tsx +3 -3
  312. package/src/core/aside/Aside.tsx +59 -38
  313. package/src/core/boundary/ErrorBoundary.tsx +26 -8
  314. package/src/core/boundary/ErrorIcon.tsx +1 -2
  315. package/src/core/content/Content.tsx +7 -3
  316. package/src/core/headfoot/HeadFoot.tsx +44 -37
  317. package/src/core/page/Page.tsx +44 -22
  318. package/src/core/responsive/Responsive.tsx +66 -8
  319. package/src/core/section/Section.tsx +26 -4
  320. package/src/core/theme/ThemeProvider.tsx +35 -14
  321. package/src/core/viewport/Viewport.tsx +16 -3
  322. package/src/hooks/useControlledValue.tsx +12 -0
  323. package/src/hooks/useDebounce.ts +13 -1
  324. package/src/hooks/useEffectDebugger.ts +50 -2
  325. package/src/hooks/useIsDark.ts +8 -0
  326. package/src/hooks/useIsRtl.ts +12 -0
  327. package/src/hooks/useNavigator.tsx +28 -5
  328. package/src/hooks/useOverlayService.tsx +33 -8
  329. package/src/hooks/usePropToggle.ts +16 -5
  330. package/src/hooks/useResize.ts +19 -1
  331. package/src/hooks/useResizeObserver.ts +32 -9
  332. package/src/hooks/useStepper.tsx +68 -0
  333. package/src/hooks/useStorage.ts +38 -0
  334. package/src/hotkeys/HotKeyLabel.tsx +1 -1
  335. package/src/hotkeys/HotKeyWrapper.tsx +3 -1
  336. package/src/index.ts +5 -1
  337. package/src/overlays/alert/Alert.tsx +51 -36
  338. package/src/overlays/flyout/Flyout.tsx +74 -99
  339. package/src/overlays/message/Message.tsx +28 -9
  340. package/src/overlays/modal/Modal.tsx +39 -34
  341. package/src/overlays/toast/Toast.tsx +44 -33
  342. package/src/overlays/tooltip/Tooltip.tsx +44 -20
  343. package/src/types/global.d.ts +8 -0
  344. package/src/types/index.ts +293 -47
  345. package/src/typography/Abbr.tsx +45 -11
  346. package/src/typography/{Link.tsx → Anchor.tsx} +26 -14
  347. package/src/typography/Copy.tsx +16 -2
  348. package/src/typography/Mark.tsx +25 -10
  349. package/src/typography/Text.tsx +31 -13
  350. package/src/typography/Title.tsx +18 -7
  351. package/src/typography/index.ts +1 -1
  352. package/src/{overlays/tooltip/Tooltip.module.css → utils/cloneElement.ts} +21 -27
  353. package/src/utils/getColor.ts +1 -17
  354. package/src/utils/index.ts +1 -0
  355. package/css/flags.rect.css +0 -1607
  356. package/css/flags.wavy.css +0 -1606
  357. package/css/index.js +0 -250
  358. package/css/tailwind/colors.ts +0 -158
  359. package/dist/cjs/components/actionLabel/ActionLabel.module.css +0 -1
  360. package/dist/cjs/components/animations/Animations.module.css +0 -1
  361. package/dist/cjs/components/avatar/Avatar.module.css +0 -1
  362. package/dist/cjs/components/badge/Badge.module.css +0 -1
  363. package/dist/cjs/components/breadcrumbs/Breadcrumbs.module.css +0 -1
  364. package/dist/cjs/components/button/Button.module.css +0 -1
  365. package/dist/cjs/components/card/Card.module.css +0 -1
  366. package/dist/cjs/components/chip/Chip.module.css +0 -1
  367. package/dist/cjs/components/collapsable/Collapsable.module.css +0 -1
  368. package/dist/cjs/components/dropdown/Dropdown.module.css +0 -1
  369. package/dist/cjs/components/icon/Icon.module.css +0 -1
  370. package/dist/cjs/components/media/Media.module.css +0 -1
  371. package/dist/cjs/components/menu/Menu.module.css +0 -1
  372. package/dist/cjs/components/meter/Meter.module.css +0 -1
  373. package/dist/cjs/components/panel/Panel.module.css +0 -1
  374. package/dist/cjs/components/progress/Progress.module.css +0 -1
  375. package/dist/cjs/components/tabpanel/TabPanel.module.css +0 -1
  376. package/dist/cjs/core/aside/Aside.module.css +0 -1
  377. package/dist/cjs/core/boundary/ErrorBoundary.module.css +0 -1
  378. package/dist/cjs/core/content/Content.module.css +0 -1
  379. package/dist/cjs/core/headfoot/HeadFoot.module.css +0 -1
  380. package/dist/cjs/core/page/Page.module.css +0 -1
  381. package/dist/cjs/core/responsive/Responsive.module.css +0 -1
  382. package/dist/cjs/core/section/Section.module.css +0 -1
  383. package/dist/cjs/core/theme/Theme.module.css +0 -1
  384. package/dist/cjs/core/viewport/Viewport.module.css +0 -1
  385. package/dist/cjs/overlays/alert/Alert.module.css +0 -1
  386. package/dist/cjs/overlays/flyout/Flyout.module.css +0 -1
  387. package/dist/cjs/overlays/message/Message.module.css +0 -1
  388. package/dist/cjs/overlays/modal/Modal.module.css +0 -1
  389. package/dist/cjs/overlays/toast/Toast.module.css +0 -1
  390. package/dist/cjs/overlays/tooltip/Tooltip.module.css +0 -1
  391. package/dist/cjs/types/icons.js +0 -199
  392. package/dist/cjs/typography/Typography.module.css +0 -1
  393. package/dist/esm/components/actionLabel/ActionLabel.module.css +0 -1
  394. package/dist/esm/components/animations/Animations.module.css +0 -1
  395. package/dist/esm/components/avatar/Avatar.module.css +0 -1
  396. package/dist/esm/components/badge/Badge.module.css +0 -1
  397. package/dist/esm/components/breadcrumbs/Breadcrumbs.module.css +0 -1
  398. package/dist/esm/components/button/Button.module.css +0 -1
  399. package/dist/esm/components/card/Card.module.css +0 -1
  400. package/dist/esm/components/chip/Chip.module.css +0 -1
  401. package/dist/esm/components/collapsable/Collapsable.module.css +0 -1
  402. package/dist/esm/components/dropdown/Dropdown.module.css +0 -1
  403. package/dist/esm/components/icon/Icon.module.css +0 -1
  404. package/dist/esm/components/media/Media.module.css +0 -1
  405. package/dist/esm/components/menu/Menu.module.css +0 -1
  406. package/dist/esm/components/meter/Meter.module.css +0 -1
  407. package/dist/esm/components/panel/Panel.module.css +0 -1
  408. package/dist/esm/components/progress/Progress.module.css +0 -1
  409. package/dist/esm/components/tabpanel/TabPanel.module.css +0 -1
  410. package/dist/esm/core/aside/Aside.module.css +0 -1
  411. package/dist/esm/core/boundary/ErrorBoundary.module.css +0 -1
  412. package/dist/esm/core/content/Content.module.css +0 -1
  413. package/dist/esm/core/headfoot/HeadFoot.module.css +0 -1
  414. package/dist/esm/core/page/Page.module.css +0 -1
  415. package/dist/esm/core/responsive/Responsive.module.css +0 -1
  416. package/dist/esm/core/section/Section.module.css +0 -1
  417. package/dist/esm/core/theme/Theme.module.css +0 -1
  418. package/dist/esm/core/viewport/Viewport.module.css +0 -1
  419. package/dist/esm/overlays/alert/Alert.module.css +0 -1
  420. package/dist/esm/overlays/flyout/Flyout.module.css +0 -1
  421. package/dist/esm/overlays/message/Message.module.css +0 -1
  422. package/dist/esm/overlays/modal/Modal.module.css +0 -1
  423. package/dist/esm/overlays/toast/Toast.module.css +0 -1
  424. package/dist/esm/overlays/tooltip/Tooltip.module.css +0 -1
  425. package/dist/esm/types/icons.js +0 -201
  426. package/dist/esm/typography/Typography.module.css +0 -1
  427. package/dist/types/types/icons.d.ts +0 -196
  428. package/dist/types/typography/Link.d.ts +0 -25
  429. package/src/types/icons.ts +0 -425
@@ -1,14 +1,18 @@
1
- import { type ReactNode } from "react";
2
- import { type ChildrenProp, type CollapseProps, type CssProp, type Elements, type IconProps, type TestProps } from "../../types";
3
- export interface AsideProps extends IconProps, ChildrenProp, CollapseProps, CssProp, TestProps {
1
+ import { type IconProps } from "../../components/icon/Icon";
2
+ import { type ChildrenProp, type CollapseProps, type CssProp, type Elements, type TestProps } from "../../types";
3
+ export interface AsideProps extends ChildrenProp, CollapseProps, CssProp, TestProps {
4
4
  /**
5
5
  * page title
6
6
  */
7
- title?: ReactNode;
7
+ title?: React.ReactNode;
8
8
  /**
9
9
  * align inline-end
10
10
  */
11
11
  align?: "start" | "end";
12
+ /**
13
+ * icon path or props
14
+ */
15
+ icon?: IconProps;
12
16
  /**
13
17
  * header actions
14
18
  */
@@ -51,6 +55,41 @@ export interface AsideProps extends IconProps, ChildrenProp, CollapseProps, CssP
51
55
  minWidth?: number | string;
52
56
  }
53
57
  /**
54
- * Side panel
58
+ * A sidebar component that can be collapsed, resized, and has a flyout feature.
59
+ * It supports a title, icon, actions, and loading state.
60
+ * It can be aligned to the start or end of the page.
61
+ *
62
+ * @param {AsideProps} props - The properties for the Aside component.
63
+ * @returns {JSX.Element} The rendered Aside component.
64
+ *
65
+ * @example
66
+ * ```jsx
67
+ * <Aside
68
+ * title="Sidebar Title"
69
+ * icon=icon-[mdi--menu]
70
+ * rtlFlip={true}
71
+ * className="custom-aside"
72
+ * bodyClassName="custom-aside-body"
73
+ * headerClassName="custom-aside-header"
74
+ * resizeable={true}
75
+ * flyout={true}
76
+ * onFlyout={() => console.log("Flyout triggered")}
77
+ * collapsed={false}
78
+ * collapsable={true}
79
+ * onCollapse={() => console.log("Collapsed toggled")}
80
+ * actions={<button>Action</button>}
81
+ * loading={false}
82
+ * align="start"
83
+ * width="20rem"
84
+ * minWidth="2rem"
85
+ * maxWidth="30vw"
86
+ * data-testid="aside-test"
87
+ * data-test-value="aside-value"
88
+ * >
89
+ * <Content>This is the content of the aside.</Content>
90
+ * </Aside>
91
+ * ```
92
+ *
93
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--aside} for more details.
55
94
  */
56
- export declare const Aside: ({ children, title, icon, iconBg, iconColor, rtlFlip, className, bodyClassName, headerClassName, resizeable, flyout, onFlyout, collapsed, collapsable, onCollapse, actions, loading, align, width: wd, minWidth, maxWidth, "data-testid": testId, "data-test-value": testValue, }: AsideProps) => import("react/jsx-runtime").JSX.Element;
95
+ export declare const Aside: ({ children, title, icon, className, bodyClassName, headerClassName, resizeable, flyout, onFlyout, collapsed, collapsable, onCollapse, actions, loading, align, width: wd, minWidth, maxWidth, "data-testid": testId, "data-test-value": testValue, }: AsideProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,23 @@
1
1
  import { Component } from "react";
2
2
  import { type ChildrenProp } from "../../types";
3
3
  /**
4
- * An error boundary wrapper higher-order component designed to provide consistent error display across the application will trap runtime errors
4
+ * ErrorBoundary component to catch JavaScript errors anywhere in the child component tree,
5
+ * log those errors, and display a fallback UI.
6
+ * It can also display a custom error element if provided.
7
+ * This component is useful for preventing the entire application from crashing
8
+ * when an error occurs in a part of the component tree.
9
+ * It can be used to wrap any part of the application.
10
+ * It supports custom error display components and provides a default error message.
11
+ * It also conditionally displays the error stack trace in development mode.
12
+ *
13
+ * @example
14
+ * ```jsx
15
+ * <ErrorBoundary errorElement={CustomErrorComponent}>
16
+ * <YourComponent />
17
+ * </ErrorBoundary>
18
+ * ```
19
+ *
20
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--error-boundary}
5
21
  */
6
22
  export declare class ErrorBoundary extends Component<{
7
23
  /**
@@ -22,5 +38,5 @@ export declare class ErrorBoundary extends Component<{
22
38
  };
23
39
  constructor(props: AnyObject);
24
40
  componentDidCatch(error: Error): void;
25
- render(): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
41
+ render(): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
26
42
  }
@@ -11,6 +11,11 @@ export interface ContentProps extends ChildrenProp, CssProp, RefProp, TestProps
11
11
  onResize?: (event: SizeObject) => void;
12
12
  }
13
13
  /**
14
- * Scrollable content element
14
+ * Content component that wraps children in a section element.
15
+ * It uses a resize observer to handle resizing and a debounced scroll handler.
16
+ * It also includes an error boundary to catch any errors in the children.
17
+ *
18
+ * @param {ContentProps} props - The properties for the Content component.
19
+ * @returns A section element containing the children wrapped in an error boundary.
15
20
  */
16
21
  export declare const Content: ({ ref, children, className, onScroll, onResize, "data-testid": testId, "data-test-value": testValue, }: ContentProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,6 @@
1
- import { type AriaProps, type ChildrenProp, type ColorWithGrays, type CssProp, type TestProps } from "../../types";
1
+ import { type AriaProps, type ChildrenProp, type CssProp, type TestProps } from "../../types";
2
2
  interface BaseProps extends CssProp, AriaProps, ChildrenProp, TestProps {
3
3
  dir?: "ltr" | "rtl";
4
- /**
5
- * background color
6
- */
7
- bg?: ColorWithGrays | string;
8
- /**
9
- * background color
10
- */
11
- color?: ColorWithGrays | string;
12
4
  }
13
5
  type DefaultProps = BaseProps & {
14
6
  flex?: false;
@@ -19,6 +11,46 @@ type FlexProps = BaseProps & {
19
11
  justify?: "start" | "end" | "center" | "between";
20
12
  };
21
13
  export type HeadFootProps = DefaultProps | FlexProps;
14
+ /**
15
+ * Header component that wraps children in a header element.
16
+ * It uses the HeadFoot component to handle layout and styling.
17
+ * It accepts properties for direction, alignment, and justification,
18
+ * allowing for flexible layout configurations.
19
+ * The `as` prop is set to "header" to render the element as a header.
20
+ * The `area` prop is set to "head" to indicate that this is a header area.
21
+ * It can be used to create a consistent header layout across an application.
22
+ *
23
+ * @param {HeadFootProps} props - The properties for the Header component.
24
+ * @returns A header element containing the children wrapped in the HeadFoot component.
25
+ *
26
+ * @example
27
+ * ```jsx
28
+ * <Header className="custom-header" dir="ltr">
29
+ * <h1>Header content goes here</h1>
30
+ * </Header>
31
+ * ```
32
+ */
22
33
  export declare const Header: (props: HeadFootProps) => import("react/jsx-runtime").JSX.Element;
34
+ /**
35
+ * Footer component that wraps children in a footer element.
36
+ * It uses the HeadFoot component to handle layout and styling.
37
+ * It accepts properties for direction, alignment, and justification,
38
+ * allowing for flexible layout configurations.
39
+ * The `as` prop is set to "footer" to render the element as a footer.
40
+ * The `area` prop is set to "foot" to indicate that this is a footer area.
41
+ * It can be used to create a consistent footer layout across an application.
42
+ * * The Footer component is designed to be flexible and can be styled with custom classes.
43
+ * It supports both default and flex layouts, allowing for alignment and justification of its children.
44
+ *
45
+ * @param {HeadFootProps} props - The properties for the Footer component.
46
+ * @returns A footer element containing the children wrapped in the HeadFoot component.
47
+ *
48
+ * @example
49
+ * ```jsx
50
+ * <Footer className="custom-footer" dir="ltr">
51
+ * <p>Footer content goes here</p>
52
+ * </Footer>
53
+ * ```
54
+ */
23
55
  export declare const Footer: (props: HeadFootProps) => import("react/jsx-runtime").JSX.Element;
24
56
  export {};
@@ -1,5 +1,6 @@
1
- import { type ChildrenProp, type IconProps, type TestProps } from "../../types";
2
- export interface PageProps extends IconProps, ChildrenProp, TestProps {
1
+ import { type IconProps } from "../../components/icon/Icon";
2
+ import { type ChildrenProp, type RefProp, type TestProps } from "../../types";
3
+ export interface PageProps extends ChildrenProp, TestProps, RefProp<HTMLDivElement> {
3
4
  /**
4
5
  * page title
5
6
  */
@@ -12,12 +13,39 @@ export interface PageProps extends IconProps, ChildrenProp, TestProps {
12
13
  * paper style drop shadow
13
14
  */
14
15
  paper?: boolean;
16
+ /**
17
+ * icon path or props
18
+ */
19
+ icon?: IconProps;
15
20
  /**
16
21
  * loading indicator
17
22
  */
18
23
  loading?: boolean;
19
24
  }
20
25
  /**
21
- * The page component used typically for routes, is a structured layout used within an application to organize and display content in a sectioned format, ensuring a consistent and intuitive user experience.
26
+ * Page component that wraps children in a div element.
27
+ * It includes a title section with an optional icon and a loading indicator.
28
+ * The component can be styled with a paper effect, page icon and title.
29
+ * It also accepts a loading prop to display a loading indicator.
30
+ *
31
+ * @param {PageProps} props - The properties for the Page component.
32
+ * @returns A div element containing the title and children, with optional loading indicator.
33
+ *
34
+ * @example
35
+ * ```jsx
36
+ * <Page
37
+ * title="My Page"
38
+ * icon="home"
39
+ * loading={false}
40
+ * paper={true}
41
+ * data-testid="my-page"
42
+ * data-test-value="page-value"
43
+ * >
44
+ * <p>This is the content of the page.</p>
45
+ * </Page>
46
+ * // Renders a page with a title, icon, and content.
47
+ * ```
48
+ *
49
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--page} for more details.
22
50
  */
23
- export declare const Page: ({ children, paper, title, titleClassName, icon, rtlFlip, iconBg, iconColor, loading, "data-testid": testId, "data-test-value": testValue, }: PageProps) => import("react/jsx-runtime").JSX.Element;
51
+ export declare const Page: ({ ref, children, paper, title, titleClassName, icon, loading, "data-testid": testId, "data-test-value": testValue, ...rest }: PageProps) => import("react/jsx-runtime").JSX.Element;
@@ -39,15 +39,70 @@ export interface ColProps extends AriaProps, CssProp, TestProps, Partial<Childre
39
39
  /**
40
40
  * column flex
41
41
  */
42
- flex?: "auto" | "fill" | "full";
42
+ flex?: "auto" | "fill" | "full" | "initial" | "content";
43
43
  /**
44
44
  * stretch inner content
45
45
  */
46
46
  stretchContent?: boolean;
47
+ /**
48
+ * truncate text
49
+ */
50
+ truncate?: boolean;
47
51
  }
48
52
  /**
49
- * Responsive layout container
53
+ * Container component that wraps children in a div element.
54
+ * It supports full width, gutter size, and additional CSS classes.
55
+ * It can be used to create a responsive layout with optional gutters for spacing.
56
+ * It accepts properties for full width, gutter size, and additional CSS classes.
57
+ *
58
+ * @param {ContainerProps} props - The properties for the Container component.
59
+ * @returns A div element containing the children with optional full width and gutter size.
60
+ *
61
+ * @example
62
+ * ```jsx
63
+ * <Container fullWidth={true} gutter="16px" className="custom-container">
64
+ * <p>This is a container with full width and gutter.</p>
65
+ * </Container>
66
+ * ```
50
67
  */
51
68
  export declare const Container: ({ children, fullWidth, className, gutter, ...aria }: ContainerProps) => import("react/jsx-runtime").JSX.Element;
69
+ /**
70
+ * Row component that allows for flexible layout of columns.
71
+ * It supports various flex properties, alignment, and wrapping.
72
+ * It can be used to create a responsive layout with optional gutters for spacing.
73
+ * It accepts properties for gutter size, orientation, alignment, justification, and additional CSS classes.
74
+ *
75
+ * @param {RowProps} props - The properties for the Row component.
76
+ * @returns A div element representing a row with the specified flex and alignment properties.
77
+ *
78
+ * @example
79
+ * ```jsx
80
+ * <Row gutter="16px" orient="row" align="center" justify="between">
81
+ * <Col flex="fill">Column 1</Col>
82
+ * <Col flex="fill">Column 2</Col>
83
+ * </Row>
84
+ * // Renders a row with two columns, each taking equal space, centered vertically and spaced evenly.
85
+ * ```
86
+ *
87
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--responsive} for more details.
88
+ */
52
89
  export declare const Row: ({ children, gutter, noWrap, orient, align, justify, className, ...aria }: RowProps) => import("react/jsx-runtime").JSX.Element;
53
- export declare const Col: ({ children, flex, align, className, stretchContent, ...aria }: ColProps) => import("react/jsx-runtime").JSX.Element;
90
+ /**
91
+ * Column component that allows for flexible layout within a row.
92
+ * It supports various flex properties, alignment, and truncation.
93
+ * It can be used to create a responsive layout with optional stretching of inner content.
94
+ * It accepts properties for flex size, alignment, truncation, and additional CSS classes.
95
+ *
96
+ * @param {ColProps} props - The properties for the Col component.
97
+ * @returns A div element representing a column with the specified flex and alignment properties.
98
+ *
99
+ * @example
100
+ * ```jsx
101
+ * <Col flex="fill" align="center" truncate className="custom-col">
102
+ * <p>This is a column with flexible layout.</p>
103
+ * </Col>
104
+ * ```
105
+ *
106
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--responsive} for more details.
107
+ */
108
+ export declare const Col: ({ children, flex, align, truncate, className, stretchContent, ...aria }: ColProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,22 @@
1
- import { type ChildrenProp, type CssProp, type RefProp } from "../../types";
1
+ import { type TestProps, type ChildrenProp, type CssProp, type RefProp } from "../../types";
2
2
  /**
3
- * The section component provides a structured layout used within a page to organize and display content in a sectioned format, ensuring a consistent and intuitive user experience.
3
+ * A component that represents a section of content within a page, with templated grid layout.
4
+ * It can be used to group related content together and can be styled with additional CSS classes.
5
+ * It supports RTL (right-to-left) text direction.
6
+ *
7
+ * @param {ChildrenProp} children - The children to be rendered inside the section.
8
+ * @param {CssProp} className - Additional CSS classes to apply to the section.
9
+ * @param {RefProp<HTMLDivElement>} ref - A ref to the section element.
10
+ *
11
+ * @example
12
+ * ```jsx
13
+ * <Section className="my-section" ref={sectionRef}>
14
+ * <p>This is a section.</p>
15
+ * </Section>
16
+ * ```
17
+ *
18
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-application--section} for more details.
4
19
  */
5
- export declare const Section: ({ children, className, dir, ref, }: ChildrenProp & CssProp & RefProp<HTMLDivElement> & {
20
+ export declare const Section: ({ children, className, dir, ref, ...rest }: ChildrenProp & CssProp & TestProps & RefProp<HTMLDivElement> & {
6
21
  dir?: "ltr" | "rtl";
7
22
  }) => import("react/jsx-runtime").JSX.Element;
@@ -8,9 +8,9 @@ export interface ThemeProps {
8
8
  * branding css className
9
9
  *
10
10
  * .branding {
11
- * --primary: #color;
12
- * --accent: #color;
13
- * --tint: #color;
11
+ * --color-primary: #color;
12
+ * --color-accent: #color;
13
+ * --color-tint: #color;
14
14
  * }
15
15
  */
16
16
  branding?: string;
@@ -29,9 +29,29 @@ export interface ThemeProps {
29
29
  /**
30
30
  * component rounding
31
31
  */
32
- rounding?: "minimal" | "normal" | "full";
32
+ rounding?: "sm" | "md" | "full";
33
33
  }
34
34
  /**
35
- * Theme override
35
+ * This component provides a way to set the theme for the application.
36
+ * It allows you to set the primary, accent, and tint colors, as well as the color scheme and rounding.
37
+ * It uses CSS variables to apply the colors and styles.
38
+ * It also applies the branding className to the root element.
39
+ * The component uses the `useApplicationContext` hook to get the current color scheme from the application context.
40
+ *
41
+ * @example
42
+ * ```jsx
43
+ * <ThemeProvider
44
+ * branding="my-branding"
45
+ * primaryColor="#ff0000"
46
+ * accentColor="#00ff00"
47
+ * tintColor="#0000ff"
48
+ * colorScheme="dark"
49
+ * rounding="md"
50
+ * >
51
+ * <div>Your content here</div>
52
+ * </ThemeProvider>
53
+ * ```
54
+ *
55
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--theme-provider} for more details.
36
56
  */
37
57
  export declare const ThemeProvider: ({ children, branding, primaryColor, accentColor, tintColor, colorScheme, rounding, }: ThemeProps & ChildrenProp) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,19 @@
1
1
  import { type PropsWithChildren } from "react";
2
2
  /**
3
- * The application viewport is the main container that defines the visible area where content is displayed and interacted with.
3
+ * This component is used to create a full-screen viewport
4
+ * that can be used to display content in a grid layout.
5
+ * It is typically used as a container for the main content of the application.
6
+ * It is styled to take up the full width and height of the viewport,
7
+ * and it uses absolute positioning to ensure it covers the entire screen.
8
+ * The component accepts children as props, allowing you to nest other components inside it.
9
+ *
10
+ * @example
11
+ * ```jsx
12
+ * <Viewport>
13
+ * <YourContentComponent />
14
+ * </Viewport>
15
+ * ```
16
+ *
17
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-application--viewport} for more details.
4
18
  */
5
19
  export declare const Viewport: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,16 @@
1
- /// <reference types="react" />
2
- export declare const useControlledValue: <T extends unknown = string>(value: T, defaultValue: T) => {
1
+ /**
2
+ * Custom hook to manage a controlled value with a default fallback for inputs.
3
+ * It updates the current value whenever the deferred value changes.
4
+ * This is useful for scenarios where you want to control the value of a component
5
+ * while also providing a default value if the controlled value is not set.
6
+ * This hook is particularly useful for form inputs or components that require a controlled value
7
+ * but also need to handle cases where the value might not be immediately available.
8
+ *
9
+ * @param value - The controlled value that may change.
10
+ * @param defaultValue - The default value to use if the controlled value is not set.
11
+ * @returns An object containing the current value and a function to update it.
12
+ */
13
+ export declare const useControlledValue: <T extends AnyObject = string>(value: T, defaultValue: T) => {
3
14
  currentValue: T;
4
15
  updateValue: import("react").Dispatch<import("react").SetStateAction<T>>;
5
16
  };
@@ -1,3 +1,15 @@
1
+ /**
2
+ * Custom hook to debounce a function.
3
+ * This hook delays the processing of the function until after a specified delay period
4
+ * has elapsed since the last time the function was invoked. This is useful for optimizing
5
+ * performance in scenarios where a function may be called frequently, such as during
6
+ * user input or window resizing events.
7
+ *
8
+ * @param callback - The function to debounce.
9
+ * @param deps - The dependency array for the hook.
10
+ * @param delay - The debounce delay in milliseconds.
11
+ * @returns A debounced version of the callback function.
12
+ */
1
13
  export declare const useDebounce: (callback: undefined | ((...rest: AnyObject) => AnyObject), deps: AnyObject[], delay?: number) => {
2
14
  (...args: AnyObject): void;
3
15
  cancel(): void;
@@ -1,4 +1,53 @@
1
1
  import { type DependencyList, type EffectCallback } from "react";
2
+ /**
3
+ * Custom hook to debug useMemo hooks.
4
+ * It compares the current and previous dependency arrays and logs any differences.
5
+ * @param func - The function to be memoized or executed in the effect.
6
+ * @param inputs - The dependency array for the hook.
7
+ * @param prefix - A prefix for the log messages to identify the hook.
8
+ * @returns The result of the memoized function or the effect.
9
+ *
10
+ * @example
11
+ * ```jsx
12
+ * const value = useMemoDebugger(() => computeValue(), [dependency1, dependency2], "MyComponent");
13
+ * ```
14
+ */
2
15
  export declare const useMemoDebugger: <T>(func: () => T, inputs: DependencyList, prefix: string) => T;
16
+ /**
17
+ * Custom hook to debug useEffect and useLayoutEffect hooks.
18
+ * It compares the current and previous dependency arrays and logs any differences.
19
+ * @param func - The effect function to be executed.
20
+ * @param inputs - The dependency array for the effect.
21
+ * @param prefix - A prefix for the log messages to identify the effect.
22
+ * @returns A cleanup function if the effect returns one.
23
+ *
24
+ * @example
25
+ * ```jsx
26
+ * useEffectDebugger(() => {
27
+ * // Effect logic here
28
+ * return () => {
29
+ * // Cleanup logic here
30
+ * };
31
+ * }, [dependency1, dependency2], "MyComponent");
32
+ * ```
33
+ */
3
34
  export declare const useEffectDebugger: (func: EffectCallback, inputs: DependencyList, prefix: string) => void;
35
+ /**
36
+ * Custom hook to debug useLayoutEffect hooks.
37
+ * It compares the current and previous dependency arrays and logs any differences.
38
+ * @param func - The layout effect function to be executed.
39
+ * @param inputs - The dependency array for the layout effect.
40
+ * @param prefix - A prefix for the log messages to identify the layout effect.
41
+ * @returns A cleanup function if the layout effect returns one.
42
+ *
43
+ * @example
44
+ * ```jsx
45
+ * useLayoutEffectDebugger(() => {
46
+ * // Layout effect logic here
47
+ * return () => {
48
+ * // Cleanup logic here
49
+ * };
50
+ * }, [dependency1, dependency2], "MyComponent");
51
+ * ```
52
+ */
4
53
  export declare const useLayoutEffectDebugger: (func: EffectCallback, inputs: DependencyList, prefix: string) => void;
@@ -1 +1,9 @@
1
+ /**
2
+ * Custom hook to determine if the current theme is dark.
3
+ * It checks the background color of the document's root element
4
+ * and sets the `isDark` state based on the red component of the RGB color.
5
+ * If the red component is less than 50, it considers the theme to be dark.
6
+ *
7
+ * @returns {boolean} - Returns true if the theme is dark, false otherwise.
8
+ */
1
9
  export declare const useIsDark: () => boolean;
@@ -1 +1,13 @@
1
+ /**
2
+ * Custom hook to determine if the current locale is RTL (Right-to-Left).
3
+ * It uses the i18n instance from react-i18next to check the direction.
4
+ *
5
+ * @returns {boolean} - Returns true if the current locale is RTL, false otherwise.
6
+ *
7
+ * @example
8
+ * ```jsx
9
+ * const isRtl = useIsRtl();
10
+ * // This will return true if the current locale is RTL, false otherwise.
11
+ * ```
12
+ */
1
13
  export declare const useIsRtl: () => boolean;
@@ -1,4 +1,21 @@
1
- /// <reference types="react" />
1
+ /**
2
+ * Custom hook to manage navigation through a list of items.
3
+ * It provides functionality to navigate forward and backward,
4
+ * and keeps track of the current index and total count of items.
5
+ *
6
+ * @param totalCount - Total number of items to navigate through.
7
+ * @param defaultIndex - Initial index to start navigation from.
8
+ * @returns An object containing the current index, a function to navigate,
9
+ * a label for the current position, and a function to set the current index.
10
+ *
11
+ * @example
12
+ * ```jsx
13
+ * const { headLabel, onNavigate, currentIndex, setCurrentIndex } = useNavigator(5, 0);
14
+ * // headLabel will show "1/5"
15
+ * // onNavigate(1) will move to the next item, and onNavigate(-1) will move to the previous item.
16
+ * // currentIndex will be updated accordingly.
17
+ * ```
18
+ */
2
19
  export declare const useNavigator: (totalCount?: number, defaultIndex?: number) => {
3
20
  headLabel: import("react/jsx-runtime").JSX.Element;
4
21
  onNavigate: (dir: 1 | -1) => void;
@@ -1,10 +1,29 @@
1
- import { type FC, type ReactNode } from "react";
2
- type OverlayComponent = FC<{
3
- onClose: (args?: AnyObject) => void;
4
- [key: string]: AnyObject;
5
- }>;
6
- export declare const useOverlayService: (ModalOrFlyout: OverlayComponent) => [
7
- Overlay: ReactNode | null,
8
- openOverlay: (props?: KeyValue) => Promise<AnyObject>
9
- ];
1
+ import { type ElementType } from "react";
2
+ import { type ModalProps } from "../types";
3
+ type OverlayComponent = ElementType<ModalProps<AnyObject>>;
4
+ /**
5
+ * Hook to manage overlay components like modals or flyouts.
6
+ * It provides a way to open an overlay with specified properties and handle its closure.
7
+ * This hook returns the current overlay component and a function to open it with props.
8
+ * It is useful for scenarios where you need to display overlays dynamically,
9
+ * such as modals, flyouts, or any other overlay components in a React application.
10
+ * The `openOverlay` function returns a promise that resolves with the result
11
+ * of the overlay when it is closed, allowing you to handle the result in a controlled manner.
12
+ *
13
+ * @param ModalOrFlyout - The component to be used as an overlay.
14
+ * @returns An array containing the current overlay and a function to open it.
15
+ *
16
+ * @example
17
+ * ```jsx
18
+ * const [Overlay, openOverlay] = useOverlayService(MyModalComponent);
19
+ * // To open the overlay:
20
+ * const handleOpen = async () => {
21
+ * const result = await openOverlay({ title: "My Modal", content: "Hello World" });
22
+ * console.log(result); // Handle the result from the overlay
23
+ * };
24
+ * <button onClick={handleOpen}>Open Modal</button>
25
+ * <Overlay />
26
+ * ```
27
+ */
28
+ export declare const useOverlayService: (ModalOrFlyout: OverlayComponent) => [Overlay: React.ReactNode | null, openOverlay: (props?: KeyValue) => Promise<AnyObject>];
10
29
  export {};
@@ -1,9 +1,20 @@
1
1
  import { type RefObject } from "react";
2
2
  /**
3
- * hook to control boolean props
4
- * @param isOn (is prop true)
5
- * @param callback (optional callback)
6
- * @param key (optional key to pass to callback)
7
- * @returns
3
+ * This hook is used to manage a toggle state based on a prop value.
4
+ * It allows you to toggle the state and also provides a reference to the current state.
5
+ * It is useful for scenarios where you want to control a toggle state from a parent component while also allowing local toggling.
6
+ *
7
+ * @param isOn - Initial state of the toggle (default: false)
8
+ * @param onToggle - Callback function that is called when the toggle state changes.
9
+ * @param key - Optional key to identify the toggle state, useful for multiple toggles.
10
+ * @returns A tuple containing the current toggle state, a function to toggle the state, and a reference to the current state.
11
+ *
12
+ * @example
13
+ * ```jsx
14
+ * const [isToggled, toggle, toggleRef] = usePropToggle(false, (newState) => {
15
+ * console.log("Toggle state changed to:", newState);
16
+ * });
17
+ * toggle(); // This will toggle the state and call the onToggle callback
18
+ * ```
8
19
  */
9
20
  export declare const usePropToggle: (isOn?: boolean, onToggle?: (is: boolean, key?: string) => unknown, key?: string) => [boolean, () => void, RefObject<boolean>];
@@ -17,11 +17,29 @@ interface Options {
17
17
  */
18
18
  onEnd?: () => void;
19
19
  }
20
+ /**
21
+ * Custom hook to handle resizing of an element.
22
+ * It provides a ref to the element and a mouse down event handler to initiate resizing.
23
+ * The resizing is done by tracking mouse movements and calculating the difference in x and y coordinates.
24
+ * It supports both horizontal and vertical resizing, and can be configured to reverse the direction based on RTL (Right-to-Left) layout.
25
+ *
26
+ * @param onResize - callback to handle resize event with the difference in x and y
27
+ * @param options - options for resizing behavior
28
+ * @returns ref to the element and a mouse down event handler to initiate resizing
29
+ *
30
+ * @example
31
+ * ```jsx
32
+ * const { ref, onMouseDown } = useResize((diff) => {
33
+ * console.log("Resize difference:", diff);
34
+ * }, { isReverse: true, isVertical: false });
35
+ * <div ref={ref} onMouseDown={onMouseDown}>Resize Me</div>
36
+ * ```
37
+ */
20
38
  export declare const useResize: <T extends HTMLElement = HTMLDivElement>(onResize: (diff: {
21
39
  x: number;
22
40
  y: number;
23
41
  }) => void, { isReverse, isVertical, onStart, onEnd }: Options) => {
24
- ref: RefObject<T>;
42
+ ref: RefObject<T | null>;
25
43
  onMouseDown: React.MouseEventHandler;
26
44
  };
27
45
  export {};