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

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 (425) 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} +77 -83
  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} +11 -8
  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 +7 -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 +110 -23
  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 +50 -28
  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 +44 -4
  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 +30 -5
  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 +1 -1
  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 +172 -75
  69. package/dist/cjs/components/menu/ContextMenu.js +19 -0
  70. package/dist/cjs/components/menu/Menu.js +76 -21
  71. package/dist/cjs/components/menu/MenuItem.js +54 -26
  72. package/dist/cjs/components/meter/Meter.js +26 -3
  73. package/dist/cjs/components/navigator/Navigator.js +48 -15
  74. package/dist/cjs/components/panel/Panel.js +53 -22
  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 -15
  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 +48 -22
  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 +40 -39
  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 +75 -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 +11 -2
  108. package/dist/cjs/overlays/alert/Alert.js +23 -15
  109. package/dist/cjs/overlays/flyout/Flyout.js +48 -64
  110. package/dist/cjs/overlays/message/Message.js +8 -3
  111. package/dist/cjs/overlays/modal/Modal.js +17 -20
  112. package/dist/cjs/overlays/toast/Toast.js +20 -10
  113. package/dist/cjs/overlays/tooltip/Tooltip.js +24 -11
  114. package/dist/cjs/types/icons.js +17 -4
  115. package/dist/cjs/typography/Abbr.js +35 -7
  116. package/dist/cjs/typography/{Link.js → Anchor.js} +23 -5
  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 +111 -24
  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 +52 -30
  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 +44 -4
  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 +30 -5
  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 +1 -1
  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 +173 -76
  144. package/dist/esm/components/menu/ContextMenu.js +19 -0
  145. package/dist/esm/components/menu/Menu.js +78 -23
  146. package/dist/esm/components/menu/MenuItem.js +49 -21
  147. package/dist/esm/components/meter/Meter.js +26 -3
  148. package/dist/esm/components/navigator/Navigator.js +48 -15
  149. package/dist/esm/components/panel/Panel.js +54 -23
  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 -16
  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 +49 -23
  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 +41 -40
  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 +75 -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 +6 -2
  183. package/dist/esm/overlays/alert/Alert.js +24 -16
  184. package/dist/esm/overlays/flyout/Flyout.js +52 -68
  185. package/dist/esm/overlays/message/Message.js +9 -4
  186. package/dist/esm/overlays/modal/Modal.js +19 -22
  187. package/dist/esm/overlays/toast/Toast.js +21 -11
  188. package/dist/esm/overlays/tooltip/Tooltip.js +24 -11
  189. package/dist/esm/types/icons.js +17 -4
  190. package/dist/esm/typography/Abbr.js +35 -7
  191. package/dist/esm/typography/{Link.js → Anchor.js} +24 -6
  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 +84 -5
  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 -0
  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/icons.d.ts +17 -3
  263. package/dist/types/types/index.d.ts +20 -22
  264. package/dist/types/typography/Abbr.d.ts +34 -4
  265. package/dist/types/typography/Anchor.d.ts +42 -0
  266. package/dist/types/typography/Copy.d.ts +15 -0
  267. package/dist/types/typography/Mark.d.ts +22 -4
  268. package/dist/types/typography/Text.d.ts +27 -1
  269. package/dist/types/typography/Title.d.ts +16 -1
  270. package/dist/types/typography/index.d.ts +1 -1
  271. package/dist/types/utils/cloneElement.d.ts +1 -0
  272. package/dist/types/utils/getColor.d.ts +1 -4
  273. package/dist/types/utils/index.d.ts +1 -0
  274. package/package.json +14 -16
  275. package/src/components/actionLabel/ActionLabel.tsx +26 -8
  276. package/src/components/animations/Animations.tsx +115 -36
  277. package/src/components/avatar/Avatar.tsx +51 -15
  278. package/src/components/avatar/AvatarGroup.tsx +23 -5
  279. package/src/components/badge/Badge.tsx +50 -22
  280. package/src/components/breadcrumbs/Breadcrumbs.tsx +43 -10
  281. package/src/components/button/Button.tsx +74 -42
  282. package/src/components/button/ButtonGroup.tsx +33 -7
  283. package/src/components/button/ConfirmButton.tsx +31 -3
  284. package/src/components/button/ToggleButtonGroup.tsx +74 -47
  285. package/src/components/callout/Callout.tsx +55 -12
  286. package/src/components/card/Card.tsx +84 -25
  287. package/src/components/card/CardCover.tsx +36 -6
  288. package/src/components/card/FlipContent.tsx +90 -0
  289. package/src/components/chip/Chip.tsx +53 -25
  290. package/src/components/collapsable/Collapsable.tsx +33 -8
  291. package/src/components/divider/Divider.tsx +42 -16
  292. package/src/components/dropdown/Dropdown.tsx +47 -12
  293. package/src/components/dropdown/DropdownTool.tsx +27 -2
  294. package/src/components/empty/EmptyContent.tsx +49 -8
  295. package/src/components/icon/Icon.tsx +96 -18
  296. package/src/components/index.ts +3 -2
  297. package/src/components/media/Media.tsx +193 -104
  298. package/src/components/menu/ContextMenu.tsx +19 -0
  299. package/src/components/menu/Menu.tsx +87 -30
  300. package/src/components/menu/MenuItem.tsx +44 -19
  301. package/src/components/menu/types.ts +9 -8
  302. package/src/components/meter/Meter.tsx +27 -4
  303. package/src/components/navigator/Navigator.tsx +58 -9
  304. package/src/components/panel/Panel.tsx +53 -21
  305. package/src/components/panel/PanelGroup.tsx +25 -2
  306. package/src/components/panel/PanelStack.tsx +33 -2
  307. package/src/components/progress/ProgressBar.tsx +33 -14
  308. package/src/components/progress/ProgressCircle.tsx +29 -13
  309. package/src/components/tabpanel/Tab.tsx +47 -24
  310. package/src/components/tabpanel/TabPanel.tsx +79 -13
  311. package/src/context/Global.tsx +28 -1
  312. package/src/context/NotificationCenter.tsx +3 -3
  313. package/src/core/aside/Aside.tsx +56 -34
  314. package/src/core/boundary/ErrorBoundary.tsx +26 -8
  315. package/src/core/boundary/ErrorIcon.tsx +1 -2
  316. package/src/core/content/Content.tsx +7 -3
  317. package/src/core/headfoot/HeadFoot.tsx +44 -37
  318. package/src/core/page/Page.tsx +42 -20
  319. package/src/core/responsive/Responsive.tsx +66 -8
  320. package/src/core/section/Section.tsx +26 -4
  321. package/src/core/theme/ThemeProvider.tsx +35 -14
  322. package/src/core/viewport/Viewport.tsx +16 -3
  323. package/src/hooks/useControlledValue.tsx +12 -0
  324. package/src/hooks/useDebounce.ts +13 -1
  325. package/src/hooks/useEffectDebugger.ts +50 -2
  326. package/src/hooks/useIsDark.ts +8 -0
  327. package/src/hooks/useIsRtl.ts +12 -0
  328. package/src/hooks/useNavigator.tsx +28 -5
  329. package/src/hooks/useOverlayService.tsx +33 -8
  330. package/src/hooks/usePropToggle.ts +16 -5
  331. package/src/hooks/useResize.ts +19 -1
  332. package/src/hooks/useResizeObserver.ts +32 -9
  333. package/src/hooks/useStepper.tsx +68 -0
  334. package/src/hooks/useStorage.ts +38 -0
  335. package/src/hotkeys/HotKeyLabel.tsx +1 -1
  336. package/src/hotkeys/HotKeyWrapper.tsx +3 -1
  337. package/src/index.ts +5 -0
  338. package/src/overlays/alert/Alert.tsx +50 -34
  339. package/src/overlays/flyout/Flyout.tsx +73 -97
  340. package/src/overlays/message/Message.tsx +28 -9
  341. package/src/overlays/modal/Modal.tsx +36 -30
  342. package/src/overlays/toast/Toast.tsx +42 -30
  343. package/src/overlays/tooltip/Tooltip.tsx +43 -18
  344. package/src/types/global.d.ts +8 -0
  345. package/src/types/icons.ts +32 -6
  346. package/src/types/index.ts +261 -45
  347. package/src/typography/Abbr.tsx +45 -11
  348. package/src/typography/{Link.tsx → Anchor.tsx} +26 -14
  349. package/src/typography/Copy.tsx +15 -0
  350. package/src/typography/Mark.tsx +25 -10
  351. package/src/typography/Text.tsx +31 -13
  352. package/src/typography/Title.tsx +18 -7
  353. package/src/typography/index.ts +1 -1
  354. package/src/{overlays/tooltip/Tooltip.module.css → utils/cloneElement.ts} +21 -27
  355. package/src/utils/getColor.ts +1 -17
  356. package/src/utils/index.ts +1 -0
  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/typography/Typography.module.css +0 -1
  392. package/dist/esm/components/actionLabel/ActionLabel.module.css +0 -1
  393. package/dist/esm/components/animations/Animations.module.css +0 -1
  394. package/dist/esm/components/avatar/Avatar.module.css +0 -1
  395. package/dist/esm/components/badge/Badge.module.css +0 -1
  396. package/dist/esm/components/breadcrumbs/Breadcrumbs.module.css +0 -1
  397. package/dist/esm/components/button/Button.module.css +0 -1
  398. package/dist/esm/components/card/Card.module.css +0 -1
  399. package/dist/esm/components/chip/Chip.module.css +0 -1
  400. package/dist/esm/components/collapsable/Collapsable.module.css +0 -1
  401. package/dist/esm/components/dropdown/Dropdown.module.css +0 -1
  402. package/dist/esm/components/icon/Icon.module.css +0 -1
  403. package/dist/esm/components/media/Media.module.css +0 -1
  404. package/dist/esm/components/menu/Menu.module.css +0 -1
  405. package/dist/esm/components/meter/Meter.module.css +0 -1
  406. package/dist/esm/components/panel/Panel.module.css +0 -1
  407. package/dist/esm/components/progress/Progress.module.css +0 -1
  408. package/dist/esm/components/tabpanel/TabPanel.module.css +0 -1
  409. package/dist/esm/core/aside/Aside.module.css +0 -1
  410. package/dist/esm/core/boundary/ErrorBoundary.module.css +0 -1
  411. package/dist/esm/core/content/Content.module.css +0 -1
  412. package/dist/esm/core/headfoot/HeadFoot.module.css +0 -1
  413. package/dist/esm/core/page/Page.module.css +0 -1
  414. package/dist/esm/core/responsive/Responsive.module.css +0 -1
  415. package/dist/esm/core/section/Section.module.css +0 -1
  416. package/dist/esm/core/theme/Theme.module.css +0 -1
  417. package/dist/esm/core/viewport/Viewport.module.css +0 -1
  418. package/dist/esm/overlays/alert/Alert.module.css +0 -1
  419. package/dist/esm/overlays/flyout/Flyout.module.css +0 -1
  420. package/dist/esm/overlays/message/Message.module.css +0 -1
  421. package/dist/esm/overlays/modal/Modal.module.css +0 -1
  422. package/dist/esm/overlays/toast/Toast.module.css +0 -1
  423. package/dist/esm/overlays/tooltip/Tooltip.module.css +0 -1
  424. package/dist/esm/typography/Typography.module.css +0 -1
  425. package/dist/types/typography/Link.d.ts +0 -25
@@ -1,66 +1,67 @@
1
1
  'use client';
2
2
 
3
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
5
  import classNames from 'classnames';
4
6
  import { Loading } from '../../components/animations/Animations.js';
5
- import { Icon } from '../../components/icon/Icon.js';
6
- import classes from './Page.module.css';
7
+ import { Icon, getIconProps } from '../../components/icon/Icon.js';
7
8
  import { jsxs, jsx } from 'react/jsx-runtime';
8
9
 
9
- /*
10
- * React Fabric
11
- * @version: 1.0.0
12
- *
13
- *
14
- * The MIT License (MIT)
15
- * Copyright (c) 2024 Adarsh Pastakia
10
+ var _excluded = ["ref", "children", "paper", "title", "titleClassName", "icon", "loading", "data-testid", "data-test-value"];
11
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
+ /**
14
+ * Page component that wraps children in a div element.
15
+ * It includes a title section with an optional icon and a loading indicator.
16
+ * The component can be styled with a paper effect, page icon and title.
17
+ * It also accepts a loading prop to display a loading indicator.
16
18
  *
17
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
18
- * and associated documentation files (the "Software"), to deal in the Software without restriction,
19
- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
20
- * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
21
- * subject to the following conditions:
19
+ * @param {PageProps} props - The properties for the Page component.
20
+ * @returns A div element containing the title and children, with optional loading indicator.
22
21
  *
23
- * The above copyright notice and this permission notice shall be included in all copies or substantial
24
- * portions of the Software.
22
+ * @example
23
+ * ```jsx
24
+ * <Page
25
+ * title="My Page"
26
+ * icon="home"
27
+ * loading={false}
28
+ * paper={true}
29
+ * data-testid="my-page"
30
+ * data-test-value="page-value"
31
+ * >
32
+ * <p>This is the content of the page.</p>
33
+ * </Page>
34
+ * // Renders a page with a title, icon, and content.
35
+ * ```
25
36
  *
26
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
27
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
28
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
29
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30
- */
31
-
32
- /**
33
- * 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.
37
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--page} for more details.
34
38
  */
35
39
  var Page = function Page(_ref) {
36
- var children = _ref.children,
40
+ var ref = _ref.ref,
41
+ children = _ref.children,
37
42
  paper = _ref.paper,
38
43
  title = _ref.title,
39
44
  titleClassName = _ref.titleClassName,
40
45
  icon = _ref.icon,
41
- rtlFlip = _ref.rtlFlip,
42
- iconBg = _ref.iconBg,
43
- iconColor = _ref.iconColor,
44
46
  loading = _ref.loading,
45
47
  testId = _ref["data-testid"],
46
- testValue = _ref["data-test-value"];
47
- return /*#__PURE__*/jsxs("div", {
48
+ testValue = _ref["data-test-value"],
49
+ rest = _objectWithoutProperties(_ref, _excluded);
50
+ return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
48
51
  "data-testid": testId,
49
52
  "data-test-value": testValue,
50
53
  "data-loading": loading,
51
- className: classNames(classes.page, "overflow-hidden grid area-content", paper && "shadow-paper m-[6px] rounded-capped"),
54
+ className: classNames("fabric-page relative", "overflow-hidden grid area-content", paper && "shadow-paper m-1.5 rounded-capped"),
55
+ ref: ref
56
+ }, rest), {}, {
52
57
  children: [title && /*#__PURE__*/jsxs("div", {
53
58
  "data-ref": "pageTitle",
54
- className: classNames(classes.pageTitle, "select-none flex gap-1 items-center justify-center px-1 py-0.5 font-medium text-center", titleClassName),
55
- children: [icon && /*#__PURE__*/jsx(Icon, {
56
- icon: icon,
57
- size: "1.25em",
58
- rtlFlip: rtlFlip,
59
- bg: iconBg,
60
- color: iconColor
61
- }), title]
59
+ className: classNames("fabric-pageTitle", "select-none flex gap-1 items-center justify-center px-1 py-0.5 font-medium text-center", titleClassName),
60
+ children: [icon && /*#__PURE__*/jsx(Icon, _objectSpread({
61
+ size: "1.25em"
62
+ }, getIconProps(icon))), title]
62
63
  }), loading && /*#__PURE__*/jsx(Loading, {}), children]
63
- });
64
+ }));
64
65
  };
65
66
 
66
67
  export { Page };
@@ -3,16 +3,28 @@
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
5
5
  import classNames from 'classnames';
6
- import classes from './Responsive.module.css';
7
6
  import { jsx } from 'react/jsx-runtime';
8
7
 
9
8
  var _excluded = ["children", "fullWidth", "className", "gutter"],
10
9
  _excluded2 = ["children", "gutter", "noWrap", "orient", "align", "justify", "className"],
11
- _excluded3 = ["children", "flex", "align", "className", "stretchContent"];
10
+ _excluded3 = ["children", "flex", "align", "truncate", "className", "stretchContent"];
12
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
13
  /**
15
- * Responsive layout container
14
+ * Container component that wraps children in a div element.
15
+ * It supports full width, gutter size, and additional CSS classes.
16
+ * It can be used to create a responsive layout with optional gutters for spacing.
17
+ * It accepts properties for full width, gutter size, and additional CSS classes.
18
+ *
19
+ * @param {ContainerProps} props - The properties for the Container component.
20
+ * @returns A div element containing the children with optional full width and gutter size.
21
+ *
22
+ * @example
23
+ * ```jsx
24
+ * <Container fullWidth={true} gutter="16px" className="custom-container">
25
+ * <p>This is a container with full width and gutter.</p>
26
+ * </Container>
27
+ * ```
16
28
  */
17
29
  var Container = function Container(_ref) {
18
30
  var children = _ref.children,
@@ -21,12 +33,33 @@ var Container = function Container(_ref) {
21
33
  gutter = _ref.gutter,
22
34
  aria = _objectWithoutProperties(_ref, _excluded);
23
35
  return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
24
- className: classNames(classes.container, className, !fullWidth && "container mx-auto"),
36
+ className: classNames("fabric-container", className, !fullWidth && "container mx-auto"),
25
37
  "data-gutter": gutter
26
38
  }, aria), {}, {
27
39
  children: children
28
40
  }));
29
41
  };
42
+
43
+ /**
44
+ * Row component that allows for flexible layout of columns.
45
+ * It supports various flex properties, alignment, and wrapping.
46
+ * It can be used to create a responsive layout with optional gutters for spacing.
47
+ * It accepts properties for gutter size, orientation, alignment, justification, and additional CSS classes.
48
+ *
49
+ * @param {RowProps} props - The properties for the Row component.
50
+ * @returns A div element representing a row with the specified flex and alignment properties.
51
+ *
52
+ * @example
53
+ * ```jsx
54
+ * <Row gutter="16px" orient="row" align="center" justify="between">
55
+ * <Col flex="fill">Column 1</Col>
56
+ * <Col flex="fill">Column 2</Col>
57
+ * </Row>
58
+ * // Renders a row with two columns, each taking equal space, centered vertically and spaced evenly.
59
+ * ```
60
+ *
61
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--responsive} for more details.
62
+ */
30
63
  var Row = function Row(_ref2) {
31
64
  var children = _ref2.children,
32
65
  gutter = _ref2.gutter,
@@ -39,21 +72,41 @@ var Row = function Row(_ref2) {
39
72
  className = _ref2.className,
40
73
  aria = _objectWithoutProperties(_ref2, _excluded2);
41
74
  return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
42
- className: classNames(classes.row, className, "flex", orient === "row" && "flex-row", orient === "col" && "flex-col", orient === "row-reverse" && "flex-row-reverse", orient === "col-reverse" && "flex-col-reverse", noWrap ? "flex-nowrap" : "flex-wrap", "justify-".concat(justify), "items-".concat(align)),
75
+ className: classNames("fabric-row", className, "flex", orient === "row" && "flex-row", orient === "col" && "flex-col", orient === "row-reverse" && "flex-row-reverse", orient === "col-reverse" && "flex-col-reverse", noWrap ? "flex-nowrap" : "flex-wrap", "justify-".concat(justify), "items-".concat(align)),
43
76
  "data-gutter": gutter
44
77
  }, aria), {}, {
45
78
  children: children
46
79
  }));
47
80
  };
81
+
82
+ /**
83
+ * Column component that allows for flexible layout within a row.
84
+ * It supports various flex properties, alignment, and truncation.
85
+ * It can be used to create a responsive layout with optional stretching of inner content.
86
+ * It accepts properties for flex size, alignment, truncation, and additional CSS classes.
87
+ *
88
+ * @param {ColProps} props - The properties for the Col component.
89
+ * @returns A div element representing a column with the specified flex and alignment properties.
90
+ *
91
+ * @example
92
+ * ```jsx
93
+ * <Col flex="fill" align="center" truncate className="custom-col">
94
+ * <p>This is a column with flexible layout.</p>
95
+ * </Col>
96
+ * ```
97
+ *
98
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--responsive} for more details.
99
+ */
48
100
  var Col = function Col(_ref3) {
49
101
  var children = _ref3.children,
50
102
  flex = _ref3.flex,
51
103
  align = _ref3.align,
104
+ truncate = _ref3.truncate,
52
105
  className = _ref3.className,
53
106
  stretchContent = _ref3.stretchContent,
54
107
  aria = _objectWithoutProperties(_ref3, _excluded3);
55
108
  return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
56
- className: classNames(classes.col, className, stretchContent && classes.stretchContent, flex === "auto" && "flex-content", flex === "fill" && "flex-1", flex === "full" && "flex-full", align && "self-".concat(align))
109
+ className: classNames("fabric-col", className, stretchContent && "stretchContent", flex === "fill" && "flex-1", flex === "full" && "flex-full", flex === "auto" && "flex-auto", flex === "initial" && "flex-initial", flex === "content" && "flex-content", align && "self-".concat(align), truncate && "truncate")
57
110
  }, aria), {}, {
58
111
  children: children
59
112
  }));
@@ -1,47 +1,30 @@
1
1
  'use client';
2
2
 
3
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
5
  import classNames from 'classnames';
4
6
  import { ErrorBoundary } from '../boundary/ErrorBoundary.js';
5
- import classes from './Section.module.css';
6
7
  import { jsx } from 'react/jsx-runtime';
7
8
 
8
- /*
9
- * React Fabric
10
- * @version: 1.0.0
11
- *
12
- *
13
- * The MIT License (MIT)
14
- * Copyright (c) 2024 Adarsh Pastakia
15
- *
16
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
17
- * and associated documentation files (the "Software"), to deal in the Software without restriction,
18
- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
19
- * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
20
- * subject to the following conditions:
21
- *
22
- * The above copyright notice and this permission notice shall be included in all copies or substantial
23
- * portions of the Software.
24
- *
25
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
26
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
28
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
- */
30
-
9
+ var _excluded = ["children", "className", "dir", "ref"];
10
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31
12
  var Section = function Section(_ref) {
32
13
  var children = _ref.children,
33
14
  className = _ref.className,
34
15
  dir = _ref.dir,
35
- ref = _ref.ref;
36
- return /*#__PURE__*/jsx("div", {
16
+ ref = _ref.ref,
17
+ rest = _objectWithoutProperties(_ref, _excluded);
18
+ return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
37
19
  "data-ref": "section",
38
20
  dir: dir,
39
- ref: ref,
40
- className: classNames(classes.section, className, "grid area-content overflow-hidden"),
21
+ ref: ref
22
+ }, rest), {}, {
23
+ className: classNames("fabric-section", className, "grid area-content overflow-hidden"),
41
24
  children: /*#__PURE__*/jsx(ErrorBoundary, {
42
25
  children: children
43
26
  })
44
- });
27
+ }));
45
28
  };
46
29
 
47
30
  export { Section };
@@ -3,7 +3,7 @@
3
3
  import { isColor } from '@react-fabric/utilities';
4
4
  import classNames from 'classnames';
5
5
  import { useMemo } from 'react';
6
- import classes from './Theme.module.css';
6
+ import { useApplicationContext } from '../../context/Global.js';
7
7
  import { jsx } from 'react/jsx-runtime';
8
8
 
9
9
  /*
@@ -30,7 +30,27 @@ import { jsx } from 'react/jsx-runtime';
30
30
  */
31
31
 
32
32
  /**
33
- * Theme override
33
+ * This component provides a way to set the theme for the application.
34
+ * It allows you to set the primary, accent, and tint colors, as well as the color scheme and rounding.
35
+ * It uses CSS variables to apply the colors and styles.
36
+ * It also applies the branding className to the root element.
37
+ * The component uses the `useApplicationContext` hook to get the current color scheme from the application context.
38
+ *
39
+ * @example
40
+ * ```jsx
41
+ * <ThemeProvider
42
+ * branding="my-branding"
43
+ * primaryColor="#ff0000"
44
+ * accentColor="#00ff00"
45
+ * tintColor="#0000ff"
46
+ * colorScheme="dark"
47
+ * rounding="md"
48
+ * >
49
+ * <div>Your content here</div>
50
+ * </ThemeProvider>
51
+ * ```
52
+ *
53
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--theme-provider} for more details.
34
54
  */
35
55
  var ThemeProvider = function ThemeProvider(_ref) {
36
56
  var children = _ref.children,
@@ -40,33 +60,35 @@ var ThemeProvider = function ThemeProvider(_ref) {
40
60
  tintColor = _ref.tintColor,
41
61
  colorScheme = _ref.colorScheme,
42
62
  rounding = _ref.rounding;
63
+ var _useApplicationContex = useApplicationContext(),
64
+ currentColorScheme = _useApplicationContex.currentColorScheme;
43
65
  var styles = useMemo(function () {
44
66
  var ret = {};
45
67
  if (primaryColor && isColor(primaryColor)) {
46
- ret["--primary"] = primaryColor;
68
+ ret["--color-primary"] = primaryColor;
47
69
  }
48
70
  if (primaryColor && !isColor(primaryColor)) {
49
- ret["--primary"] = "var(--".concat(primaryColor, ")");
71
+ ret["--color-primary"] = "var(--color-".concat(primaryColor, ")");
50
72
  }
51
73
  if (accentColor && isColor(accentColor)) {
52
- ret["--accent"] = accentColor;
74
+ ret["--color-accent"] = accentColor;
53
75
  }
54
76
  if (accentColor && !isColor(accentColor)) {
55
- ret["--accent"] = "var(--".concat(accentColor, ")");
77
+ ret["--color-accent"] = "var(--color-".concat(accentColor, ")");
56
78
  }
57
79
  if (tintColor && isColor(tintColor)) {
58
- ret["--tint"] = tintColor;
80
+ ret["--color-tint"] = tintColor;
59
81
  }
60
82
  if (tintColor && !isColor(tintColor)) {
61
- ret["--tint"] = "var(--".concat(tintColor, ")");
83
+ ret["--color-tint"] = "var(--color-".concat(tintColor, ")");
62
84
  }
63
85
  return ret;
64
86
  }, [primaryColor, accentColor, tintColor]);
65
87
  return /*#__PURE__*/jsx("div", {
66
88
  style: styles,
67
- "data-color-scheme": colorScheme,
89
+ "data-color-scheme": colorScheme !== null && colorScheme !== void 0 ? colorScheme : currentColorScheme,
68
90
  "data-rounding": rounding,
69
- className: classNames(classes.themeProvider, "contents theme-base", branding),
91
+ className: classNames("fabric-themeProvider", "contents theme-base", branding),
70
92
  children: children
71
93
  });
72
94
  };
@@ -1,7 +1,6 @@
1
1
  'use client';
2
2
 
3
3
  import classNames from 'classnames';
4
- import classes from './Viewport.module.css';
5
4
  import { jsx } from 'react/jsx-runtime';
6
5
 
7
6
  /*
@@ -27,11 +26,28 @@ import { jsx } from 'react/jsx-runtime';
27
26
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
27
  */
29
28
 
29
+ /**
30
+ * This component is used to create a full-screen viewport
31
+ * that can be used to display content in a grid layout.
32
+ * It is typically used as a container for the main content of the application.
33
+ * It is styled to take up the full width and height of the viewport,
34
+ * and it uses absolute positioning to ensure it covers the entire screen.
35
+ * The component accepts children as props, allowing you to nest other components inside it.
36
+ *
37
+ * @example
38
+ * ```jsx
39
+ * <Viewport>
40
+ * <YourContentComponent />
41
+ * </Viewport>
42
+ * ```
43
+ *
44
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-application--viewport} for more details.
45
+ */
30
46
  var Viewport = function Viewport(_ref) {
31
47
  var children = _ref.children;
32
48
  return /*#__PURE__*/jsx("div", {
33
49
  "data-ref": "viewport",
34
- className: classNames(classes.viewport, "grid overflow-hidden absolute inset-0"),
50
+ className: classNames("fabric-viewport", "grid overflow-hidden absolute inset-0"),
35
51
  children: children
36
52
  });
37
53
  };
@@ -4,6 +4,18 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
4
  import { useState, useDeferredValue } from 'react';
5
5
  import { useEffectDebugger } from './useEffectDebugger.js';
6
6
 
7
+ /**
8
+ * Custom hook to manage a controlled value with a default fallback for inputs.
9
+ * It updates the current value whenever the deferred value changes.
10
+ * This is useful for scenarios where you want to control the value of a component
11
+ * while also providing a default value if the controlled value is not set.
12
+ * This hook is particularly useful for form inputs or components that require a controlled value
13
+ * but also need to handle cases where the value might not be immediately available.
14
+ *
15
+ * @param value - The controlled value that may change.
16
+ * @param defaultValue - The default value to use if the controlled value is not set.
17
+ * @returns An object containing the current value and a function to update it.
18
+ */
7
19
  var useControlledValue = function useControlledValue(value, defaultValue) {
8
20
  var _useState = useState(defaultValue),
9
21
  _useState2 = _slicedToArray(_useState, 2),
@@ -25,9 +25,22 @@ import { useRef, useMemo } from 'react';
25
25
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
26
  */
27
27
 
28
+
29
+ /**
30
+ * Custom hook to debounce a function.
31
+ * This hook delays the processing of the function until after a specified delay period
32
+ * has elapsed since the last time the function was invoked. This is useful for optimizing
33
+ * performance in scenarios where a function may be called frequently, such as during
34
+ * user input or window resizing events.
35
+ *
36
+ * @param callback - The function to debounce.
37
+ * @param deps - The dependency array for the hook.
38
+ * @param delay - The debounce delay in milliseconds.
39
+ * @returns A debounced version of the callback function.
40
+ */
28
41
  var useDebounce = function useDebounce(callback, deps) {
29
42
  var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
30
- var timerRef = useRef();
43
+ var timerRef = useRef(null);
31
44
  var cb = useMemo(function () {
32
45
  if (typeof window !== "undefined") {
33
46
  window.clearTimeout(timerRef.current);
@@ -30,9 +30,9 @@ var loggerM = useLogger("useMemoDebugger");
30
30
  var loggerE = useLogger("useEffectDebugger");
31
31
  var loggerLE = useLogger("useLayoutEffectDebugger");
32
32
  var compareInputs = function compareInputs(oldInputs, newInputs, prefix, logger) {
33
- if (process.env.NODE_ENV === "production" && typeof window !== "undefined" &&
33
+ if (typeof window !== "undefined" &&
34
34
  // @ts-expect-error ignore
35
- window.DEBUG_HOOKS !== true) return;
35
+ window.DEBUG_EFFECTS !== true) return;
36
36
 
37
37
  // Edge-case: different array lengths
38
38
  if (oldInputs.length !== newInputs.length) {
@@ -56,6 +56,20 @@ var compareInputs = function compareInputs(oldInputs, newInputs, prefix, logger)
56
56
  }].concat(diff));
57
57
  });
58
58
  };
59
+
60
+ /**
61
+ * Custom hook to debug useMemo hooks.
62
+ * It compares the current and previous dependency arrays and logs any differences.
63
+ * @param func - The function to be memoized or executed in the effect.
64
+ * @param inputs - The dependency array for the hook.
65
+ * @param prefix - A prefix for the log messages to identify the hook.
66
+ * @returns The result of the memoized function or the effect.
67
+ *
68
+ * @example
69
+ * ```jsx
70
+ * const value = useMemoDebugger(() => computeValue(), [dependency1, dependency2], "MyComponent");
71
+ * ```
72
+ */
59
73
  var useMemoDebugger = function useMemoDebugger(func, inputs, prefix) {
60
74
  // Using a ref to hold the inputs from the previous run (or same run for initial run
61
75
  var oldInputsRef = useRef(inputs);
@@ -73,6 +87,25 @@ var useMemoDebugger = function useMemoDebugger(func, inputs, prefix) {
73
87
  return func();
74
88
  }, inputs);
75
89
  };
90
+
91
+ /**
92
+ * Custom hook to debug useEffect and useLayoutEffect hooks.
93
+ * It compares the current and previous dependency arrays and logs any differences.
94
+ * @param func - The effect function to be executed.
95
+ * @param inputs - The dependency array for the effect.
96
+ * @param prefix - A prefix for the log messages to identify the effect.
97
+ * @returns A cleanup function if the effect returns one.
98
+ *
99
+ * @example
100
+ * ```jsx
101
+ * useEffectDebugger(() => {
102
+ * // Effect logic here
103
+ * return () => {
104
+ * // Cleanup logic here
105
+ * };
106
+ * }, [dependency1, dependency2], "MyComponent");
107
+ * ```
108
+ */
76
109
  var useEffectDebugger = function useEffectDebugger(func, inputs, prefix) {
77
110
  // Using a ref to hold the inputs from the previous run (or same run for initial run
78
111
  var oldInputsRef = useRef(inputs);
@@ -90,6 +123,25 @@ var useEffectDebugger = function useEffectDebugger(func, inputs, prefix) {
90
123
  return func();
91
124
  }, inputs);
92
125
  };
126
+
127
+ /**
128
+ * Custom hook to debug useLayoutEffect hooks.
129
+ * It compares the current and previous dependency arrays and logs any differences.
130
+ * @param func - The layout effect function to be executed.
131
+ * @param inputs - The dependency array for the layout effect.
132
+ * @param prefix - A prefix for the log messages to identify the layout effect.
133
+ * @returns A cleanup function if the layout effect returns one.
134
+ *
135
+ * @example
136
+ * ```jsx
137
+ * useLayoutEffectDebugger(() => {
138
+ * // Layout effect logic here
139
+ * return () => {
140
+ * // Cleanup logic here
141
+ * };
142
+ * }, [dependency1, dependency2], "MyComponent");
143
+ * ```
144
+ */
93
145
  var useLayoutEffectDebugger = function useLayoutEffectDebugger(func, inputs, prefix) {
94
146
  // Using a ref to hold the inputs from the previous run (or same run for initial run
95
147
  var oldInputsRef = useRef(inputs);
@@ -4,6 +4,14 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
4
  import { useState, useCallback } from 'react';
5
5
  import { useLayoutEffectDebugger } from './useEffectDebugger.js';
6
6
 
7
+ /**
8
+ * Custom hook to determine if the current theme is dark.
9
+ * It checks the background color of the document's root element
10
+ * and sets the `isDark` state based on the red component of the RGB color.
11
+ * If the red component is less than 50, it considers the theme to be dark.
12
+ *
13
+ * @returns {boolean} - Returns true if the theme is dark, false otherwise.
14
+ */
7
15
  var useIsDark = function useIsDark() {
8
16
  var _useState = useState(false),
9
17
  _useState2 = _slicedToArray(_useState, 2),
@@ -5,6 +5,18 @@ import { useState } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { useLayoutEffectDebugger } from './useEffectDebugger.js';
7
7
 
8
+ /**
9
+ * Custom hook to determine if the current locale is RTL (Right-to-Left).
10
+ * It uses the i18n instance from react-i18next to check the direction.
11
+ *
12
+ * @returns {boolean} - Returns true if the current locale is RTL, false otherwise.
13
+ *
14
+ * @example
15
+ * ```jsx
16
+ * const isRtl = useIsRtl();
17
+ * // This will return true if the current locale is RTL, false otherwise.
18
+ * ```
19
+ */
8
20
  var useIsRtl = function useIsRtl() {
9
21
  var _useTranslation = useTranslation("core"),
10
22
  i18n = _useTranslation.i18n;
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
- import { useState, useCallback, useMemo } from 'react';
4
+ import { useState, useRef, useCallback, useMemo } from 'react';
5
5
  import { jsxs } from 'react/jsx-runtime';
6
6
 
7
7
  var useNavigator = function useNavigator() {
@@ -11,17 +11,19 @@ var useNavigator = function useNavigator() {
11
11
  _useState2 = _slicedToArray(_useState, 2),
12
12
  currentIndex = _useState2[0],
13
13
  setCurrentIndex = _useState2[1];
14
+ var refCurrent = useRef(defaultIndex);
14
15
  var onNavigate = useCallback(function (dir) {
15
16
  if (dir === -1) {
16
- setCurrentIndex(currentIndex > 0 ? currentIndex - 1 : totalCount - 1);
17
+ refCurrent.current = refCurrent.current > 0 ? refCurrent.current - 1 : totalCount - 1;
17
18
  }
18
19
  if (dir === 1) {
19
- setCurrentIndex(currentIndex + 1 < totalCount ? currentIndex + 1 : 0);
20
+ refCurrent.current = refCurrent.current + 1 < totalCount ? refCurrent.current + 1 : 0;
20
21
  }
21
- }, [currentIndex, totalCount]);
22
+ setCurrentIndex(refCurrent.current);
23
+ }, [totalCount]);
22
24
  var headLabel = useMemo(function () {
23
25
  return /*#__PURE__*/jsxs("span", {
24
- className: "text-muted leading-none",
26
+ className: "text-muted leading-none select-none",
25
27
  children: [currentIndex + 1, "/", totalCount]
26
28
  });
27
29
  }, [currentIndex, totalCount]);
@@ -11,6 +11,30 @@ import { jsx } from 'react/jsx-runtime';
11
11
  var _excluded = ["onClose"];
12
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
+ /**
15
+ * Hook to manage overlay components like modals or flyouts.
16
+ * It provides a way to open an overlay with specified properties and handle its closure.
17
+ * This hook returns the current overlay component and a function to open it with props.
18
+ * It is useful for scenarios where you need to display overlays dynamically,
19
+ * such as modals, flyouts, or any other overlay components in a React application.
20
+ * The `openOverlay` function returns a promise that resolves with the result
21
+ * of the overlay when it is closed, allowing you to handle the result in a controlled manner.
22
+ *
23
+ * @param ModalOrFlyout - The component to be used as an overlay.
24
+ * @returns An array containing the current overlay and a function to open it.
25
+ *
26
+ * @example
27
+ * ```jsx
28
+ * const [Overlay, openOverlay] = useOverlayService(MyModalComponent);
29
+ * // To open the overlay:
30
+ * const handleOpen = async () => {
31
+ * const result = await openOverlay({ title: "My Modal", content: "Hello World" });
32
+ * console.log(result); // Handle the result from the overlay
33
+ * };
34
+ * <button onClick={handleOpen}>Open Modal</button>
35
+ * <Overlay />
36
+ * ```
37
+ */
14
38
  var useOverlayService = function useOverlayService(ModalOrFlyout) {
15
39
  var _useState = useState(null),
16
40
  _useState2 = _slicedToArray(_useState, 2),