@react-fabric/core 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (453) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -0
  3. package/css/flags.rect.css +1607 -0
  4. package/css/flags.wavy.css +1606 -0
  5. package/css/index.js +250 -0
  6. package/css/reset/_gradients.css +51 -0
  7. package/css/reset/_reset.css +407 -0
  8. package/css/reset/_text.css +179 -0
  9. package/css/reset/_theme.css +110 -0
  10. package/css/reset/index.css +27 -0
  11. package/css/styles.css +31 -0
  12. package/css/tailwind/colors.ts +158 -0
  13. package/dist/cjs/components/actionLabel/ActionLabel.js +56 -0
  14. package/dist/cjs/components/actionLabel/ActionLabel.module.css +1 -0
  15. package/dist/cjs/components/animations/Animations.js +135 -0
  16. package/dist/cjs/components/animations/Animations.module.css +1 -0
  17. package/dist/cjs/components/avatar/Avatar.js +144 -0
  18. package/dist/cjs/components/avatar/Avatar.module.css +1 -0
  19. package/dist/cjs/components/avatar/AvatarGroup.js +74 -0
  20. package/dist/cjs/components/badge/Badge.js +82 -0
  21. package/dist/cjs/components/badge/Badge.module.css +1 -0
  22. package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +71 -0
  23. package/dist/cjs/components/breadcrumbs/Breadcrumbs.module.css +1 -0
  24. package/dist/cjs/components/button/Button.js +170 -0
  25. package/dist/cjs/components/button/Button.module.css +1 -0
  26. package/dist/cjs/components/button/ButtonGroup.js +41 -0
  27. package/dist/cjs/components/button/ConfirmButton.js +166 -0
  28. package/dist/cjs/components/button/ToggleButtonGroup.js +68 -0
  29. package/dist/cjs/components/callout/Callout.js +54 -0
  30. package/dist/cjs/components/card/Card.js +62 -0
  31. package/dist/cjs/components/card/Card.module.css +1 -0
  32. package/dist/cjs/components/card/CardCover.js +48 -0
  33. package/dist/cjs/components/chip/Chip.js +94 -0
  34. package/dist/cjs/components/chip/Chip.module.css +1 -0
  35. package/dist/cjs/components/collapsable/Collapsable.js +84 -0
  36. package/dist/cjs/components/collapsable/Collapsable.module.css +1 -0
  37. package/dist/cjs/components/divider/Divider.js +65 -0
  38. package/dist/cjs/components/dropdown/Dropdown.js +180 -0
  39. package/dist/cjs/components/dropdown/Dropdown.module.css +1 -0
  40. package/dist/cjs/components/dropdown/DropdownTool.js +26 -0
  41. package/dist/cjs/components/empty/EmptyContent.js +92 -0
  42. package/dist/cjs/components/icon/Icon.js +106 -0
  43. package/dist/cjs/components/icon/Icon.module.css +1 -0
  44. package/dist/cjs/components/media/Media.js +149 -0
  45. package/dist/cjs/components/media/Media.module.css +1 -0
  46. package/dist/cjs/components/menu/ContextMenu.js +84 -0
  47. package/dist/cjs/components/menu/Menu.js +204 -0
  48. package/dist/cjs/components/menu/Menu.module.css +1 -0
  49. package/dist/cjs/components/menu/MenuItem.js +119 -0
  50. package/dist/cjs/components/meter/Meter.js +41 -0
  51. package/dist/cjs/components/meter/Meter.module.css +1 -0
  52. package/dist/cjs/components/navigator/Navigator.js +54 -0
  53. package/dist/cjs/components/panel/Panel.js +125 -0
  54. package/dist/cjs/components/panel/Panel.module.css +1 -0
  55. package/dist/cjs/components/panel/PanelGroup.js +50 -0
  56. package/dist/cjs/components/panel/PanelStack.js +85 -0
  57. package/dist/cjs/components/progress/Progress.module.css +1 -0
  58. package/dist/cjs/components/progress/ProgressBar.js +62 -0
  59. package/dist/cjs/components/progress/ProgressCircle.js +96 -0
  60. package/dist/cjs/components/tabpanel/Tab.js +78 -0
  61. package/dist/cjs/components/tabpanel/TabPanel.js +77 -0
  62. package/dist/cjs/components/tabpanel/TabPanel.module.css +1 -0
  63. package/dist/cjs/context/Global.js +169 -0
  64. package/dist/cjs/context/NotificationCenter.js +254 -0
  65. package/dist/cjs/core/aside/Aside.js +152 -0
  66. package/dist/cjs/core/aside/Aside.module.css +1 -0
  67. package/dist/cjs/core/boundary/ErrorBoundary.js +140 -0
  68. package/dist/cjs/core/boundary/ErrorBoundary.module.css +1 -0
  69. package/dist/cjs/core/boundary/ErrorIcon.js +51 -0
  70. package/dist/cjs/core/content/Content.js +70 -0
  71. package/dist/cjs/core/content/Content.module.css +1 -0
  72. package/dist/cjs/core/headfoot/HeadFoot.js +62 -0
  73. package/dist/cjs/core/headfoot/HeadFoot.module.css +1 -0
  74. package/dist/cjs/core/page/Page.js +65 -0
  75. package/dist/cjs/core/page/Page.module.css +1 -0
  76. package/dist/cjs/core/responsive/Responsive.js +64 -0
  77. package/dist/cjs/core/responsive/Responsive.module.css +1 -0
  78. package/dist/cjs/core/section/Section.js +44 -0
  79. package/dist/cjs/core/section/Section.module.css +1 -0
  80. package/dist/cjs/core/theme/Theme.module.css +1 -0
  81. package/dist/cjs/core/theme/ThemeProvider.js +74 -0
  82. package/dist/cjs/core/viewport/Viewport.js +39 -0
  83. package/dist/cjs/core/viewport/Viewport.module.css +1 -0
  84. package/dist/cjs/hooks/useClientService.js +30 -0
  85. package/dist/cjs/hooks/useControlledValue.js +22 -0
  86. package/dist/cjs/hooks/useDebounce.js +56 -0
  87. package/dist/cjs/hooks/useEffectDebugger.js +113 -0
  88. package/dist/cjs/hooks/useIsDark.js +33 -0
  89. package/dist/cjs/hooks/useIsRtl.js +27 -0
  90. package/dist/cjs/hooks/useNavigator.js +36 -0
  91. package/dist/cjs/hooks/useOverlayService.js +55 -0
  92. package/dist/cjs/hooks/usePropToggle.js +40 -0
  93. package/dist/cjs/hooks/useResize.js +75 -0
  94. package/dist/cjs/hooks/useResizeObserver.js +38 -0
  95. package/dist/cjs/hooks/useStorage.js +44 -0
  96. package/dist/cjs/hotkeys/HotKey.js +47 -0
  97. package/dist/cjs/hotkeys/HotKeyLabel.js +52 -0
  98. package/dist/cjs/hotkeys/HotKeyWrapper.js +98 -0
  99. package/dist/cjs/hotkeys/commons.js +56 -0
  100. package/dist/cjs/i18n/ar.json.js +31 -0
  101. package/dist/cjs/i18n/en.json.js +46 -0
  102. package/dist/cjs/i18n/index.js +55 -0
  103. package/dist/cjs/index.js +162 -0
  104. package/dist/cjs/overlays/alert/Alert.js +163 -0
  105. package/dist/cjs/overlays/alert/Alert.module.css +1 -0
  106. package/dist/cjs/overlays/flyout/Flyout.js +152 -0
  107. package/dist/cjs/overlays/flyout/Flyout.module.css +1 -0
  108. package/dist/cjs/overlays/message/Message.js +84 -0
  109. package/dist/cjs/overlays/message/Message.module.css +1 -0
  110. package/dist/cjs/overlays/modal/Modal.js +132 -0
  111. package/dist/cjs/overlays/modal/Modal.module.css +1 -0
  112. package/dist/cjs/overlays/toast/Toast.js +166 -0
  113. package/dist/cjs/overlays/toast/Toast.module.css +1 -0
  114. package/dist/cjs/overlays/tooltip/Tooltip.js +133 -0
  115. package/dist/cjs/overlays/tooltip/Tooltip.module.css +1 -0
  116. package/dist/cjs/types/icons.js +197 -0
  117. package/dist/cjs/typography/Abbr.js +108 -0
  118. package/dist/cjs/typography/Copy.js +59 -0
  119. package/dist/cjs/typography/Link.js +55 -0
  120. package/dist/cjs/typography/Mark.js +86 -0
  121. package/dist/cjs/typography/Text.js +121 -0
  122. package/dist/cjs/typography/Title.js +58 -0
  123. package/dist/cjs/typography/Typography.module.css +1 -0
  124. package/dist/cjs/typography/types.js +42 -0
  125. package/dist/cjs/utils/calculateDimensions.js +51 -0
  126. package/dist/cjs/utils/getColor.js +52 -0
  127. package/dist/cjs/utils/nodeCheck.js +35 -0
  128. package/dist/esm/components/actionLabel/ActionLabel.js +56 -0
  129. package/dist/esm/components/actionLabel/ActionLabel.module.css +1 -0
  130. package/dist/esm/components/animations/Animations.js +131 -0
  131. package/dist/esm/components/animations/Animations.module.css +1 -0
  132. package/dist/esm/components/avatar/Avatar.js +144 -0
  133. package/dist/esm/components/avatar/Avatar.module.css +1 -0
  134. package/dist/esm/components/avatar/AvatarGroup.js +74 -0
  135. package/dist/esm/components/badge/Badge.js +81 -0
  136. package/dist/esm/components/badge/Badge.module.css +1 -0
  137. package/dist/esm/components/breadcrumbs/Breadcrumbs.js +71 -0
  138. package/dist/esm/components/breadcrumbs/Breadcrumbs.module.css +1 -0
  139. package/dist/esm/components/button/Button.js +170 -0
  140. package/dist/esm/components/button/Button.module.css +1 -0
  141. package/dist/esm/components/button/ButtonGroup.js +41 -0
  142. package/dist/esm/components/button/ConfirmButton.js +166 -0
  143. package/dist/esm/components/button/ToggleButtonGroup.js +68 -0
  144. package/dist/esm/components/callout/Callout.js +54 -0
  145. package/dist/esm/components/card/Card.js +62 -0
  146. package/dist/esm/components/card/Card.module.css +1 -0
  147. package/dist/esm/components/card/CardCover.js +48 -0
  148. package/dist/esm/components/chip/Chip.js +94 -0
  149. package/dist/esm/components/chip/Chip.module.css +1 -0
  150. package/dist/esm/components/collapsable/Collapsable.js +84 -0
  151. package/dist/esm/components/collapsable/Collapsable.module.css +1 -0
  152. package/dist/esm/components/divider/Divider.js +65 -0
  153. package/dist/esm/components/dropdown/Dropdown.js +179 -0
  154. package/dist/esm/components/dropdown/Dropdown.module.css +1 -0
  155. package/dist/esm/components/dropdown/DropdownTool.js +26 -0
  156. package/dist/esm/components/empty/EmptyContent.js +92 -0
  157. package/dist/esm/components/icon/Icon.js +106 -0
  158. package/dist/esm/components/icon/Icon.module.css +1 -0
  159. package/dist/esm/components/media/Media.js +148 -0
  160. package/dist/esm/components/media/Media.module.css +1 -0
  161. package/dist/esm/components/menu/ContextMenu.js +84 -0
  162. package/dist/esm/components/menu/Menu.js +204 -0
  163. package/dist/esm/components/menu/Menu.module.css +1 -0
  164. package/dist/esm/components/menu/MenuItem.js +119 -0
  165. package/dist/esm/components/meter/Meter.js +41 -0
  166. package/dist/esm/components/meter/Meter.module.css +1 -0
  167. package/dist/esm/components/navigator/Navigator.js +54 -0
  168. package/dist/esm/components/panel/Panel.js +125 -0
  169. package/dist/esm/components/panel/Panel.module.css +1 -0
  170. package/dist/esm/components/panel/PanelGroup.js +50 -0
  171. package/dist/esm/components/panel/PanelStack.js +85 -0
  172. package/dist/esm/components/progress/Progress.module.css +1 -0
  173. package/dist/esm/components/progress/ProgressBar.js +62 -0
  174. package/dist/esm/components/progress/ProgressCircle.js +96 -0
  175. package/dist/esm/components/tabpanel/Tab.js +78 -0
  176. package/dist/esm/components/tabpanel/TabPanel.js +77 -0
  177. package/dist/esm/components/tabpanel/TabPanel.module.css +1 -0
  178. package/dist/esm/context/Global.js +165 -0
  179. package/dist/esm/context/NotificationCenter.js +254 -0
  180. package/dist/esm/core/aside/Aside.js +152 -0
  181. package/dist/esm/core/aside/Aside.module.css +1 -0
  182. package/dist/esm/core/boundary/ErrorBoundary.js +140 -0
  183. package/dist/esm/core/boundary/ErrorBoundary.module.css +1 -0
  184. package/dist/esm/core/boundary/ErrorIcon.js +51 -0
  185. package/dist/esm/core/content/Content.js +70 -0
  186. package/dist/esm/core/content/Content.module.css +1 -0
  187. package/dist/esm/core/headfoot/HeadFoot.js +61 -0
  188. package/dist/esm/core/headfoot/HeadFoot.module.css +1 -0
  189. package/dist/esm/core/page/Page.js +65 -0
  190. package/dist/esm/core/page/Page.module.css +1 -0
  191. package/dist/esm/core/responsive/Responsive.js +62 -0
  192. package/dist/esm/core/responsive/Responsive.module.css +1 -0
  193. package/dist/esm/core/section/Section.js +44 -0
  194. package/dist/esm/core/section/Section.module.css +1 -0
  195. package/dist/esm/core/theme/Theme.module.css +1 -0
  196. package/dist/esm/core/theme/ThemeProvider.js +74 -0
  197. package/dist/esm/core/viewport/Viewport.js +39 -0
  198. package/dist/esm/core/viewport/Viewport.module.css +1 -0
  199. package/dist/esm/hooks/useClientService.js +30 -0
  200. package/dist/esm/hooks/useControlledValue.js +22 -0
  201. package/dist/esm/hooks/useDebounce.js +56 -0
  202. package/dist/esm/hooks/useEffectDebugger.js +111 -0
  203. package/dist/esm/hooks/useIsDark.js +33 -0
  204. package/dist/esm/hooks/useIsRtl.js +27 -0
  205. package/dist/esm/hooks/useNavigator.js +36 -0
  206. package/dist/esm/hooks/useOverlayService.js +55 -0
  207. package/dist/esm/hooks/usePropToggle.js +40 -0
  208. package/dist/esm/hooks/useResize.js +75 -0
  209. package/dist/esm/hooks/useResizeObserver.js +38 -0
  210. package/dist/esm/hooks/useStorage.js +43 -0
  211. package/dist/esm/hotkeys/HotKey.js +47 -0
  212. package/dist/esm/hotkeys/HotKeyLabel.js +52 -0
  213. package/dist/esm/hotkeys/HotKeyWrapper.js +96 -0
  214. package/dist/esm/hotkeys/commons.js +56 -0
  215. package/dist/esm/i18n/ar.json.js +27 -0
  216. package/dist/esm/i18n/en.json.js +41 -0
  217. package/dist/esm/i18n/index.js +55 -0
  218. package/dist/esm/index.js +75 -0
  219. package/dist/esm/overlays/alert/Alert.js +163 -0
  220. package/dist/esm/overlays/alert/Alert.module.css +1 -0
  221. package/dist/esm/overlays/flyout/Flyout.js +152 -0
  222. package/dist/esm/overlays/flyout/Flyout.module.css +1 -0
  223. package/dist/esm/overlays/message/Message.js +84 -0
  224. package/dist/esm/overlays/message/Message.module.css +1 -0
  225. package/dist/esm/overlays/modal/Modal.js +132 -0
  226. package/dist/esm/overlays/modal/Modal.module.css +1 -0
  227. package/dist/esm/overlays/toast/Toast.js +166 -0
  228. package/dist/esm/overlays/toast/Toast.module.css +1 -0
  229. package/dist/esm/overlays/tooltip/Tooltip.js +132 -0
  230. package/dist/esm/overlays/tooltip/Tooltip.module.css +1 -0
  231. package/dist/esm/types/icons.js +199 -0
  232. package/dist/esm/typography/Abbr.js +108 -0
  233. package/dist/esm/typography/Copy.js +59 -0
  234. package/dist/esm/typography/Link.js +55 -0
  235. package/dist/esm/typography/Mark.js +86 -0
  236. package/dist/esm/typography/Text.js +121 -0
  237. package/dist/esm/typography/Title.js +58 -0
  238. package/dist/esm/typography/Typography.module.css +1 -0
  239. package/dist/esm/typography/types.js +41 -0
  240. package/dist/esm/utils/calculateDimensions.js +50 -0
  241. package/dist/esm/utils/getColor.js +49 -0
  242. package/dist/esm/utils/nodeCheck.js +35 -0
  243. package/dist/types/components/actionLabel/ActionLabel.d.ts +21 -0
  244. package/dist/types/components/animations/Animations.d.ts +23 -0
  245. package/dist/types/components/avatar/Avatar.d.ts +48 -0
  246. package/dist/types/components/avatar/AvatarGroup.d.ts +24 -0
  247. package/dist/types/components/badge/Badge.d.ts +25 -0
  248. package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +17 -0
  249. package/dist/types/components/button/Button.d.ts +94 -0
  250. package/dist/types/components/button/ButtonGroup.d.ts +34 -0
  251. package/dist/types/components/button/ConfirmButton.d.ts +27 -0
  252. package/dist/types/components/button/ToggleButtonGroup.d.ts +56 -0
  253. package/dist/types/components/callout/Callout.d.ts +28 -0
  254. package/dist/types/components/card/Card.d.ts +39 -0
  255. package/dist/types/components/card/CardCover.d.ts +16 -0
  256. package/dist/types/components/chip/Chip.d.ts +41 -0
  257. package/dist/types/components/collapsable/Collapsable.d.ts +43 -0
  258. package/dist/types/components/divider/Divider.d.ts +20 -0
  259. package/dist/types/components/dropdown/Dropdown.d.ts +50 -0
  260. package/dist/types/components/dropdown/DropdownTool.d.ts +8 -0
  261. package/dist/types/components/empty/EmptyContent.d.ts +21 -0
  262. package/dist/types/components/icon/Icon.d.ts +44 -0
  263. package/dist/types/components/index.d.ts +33 -0
  264. package/dist/types/components/media/Media.d.ts +37 -0
  265. package/dist/types/components/menu/ContextMenu.d.ts +7 -0
  266. package/dist/types/components/menu/Menu.d.ts +2 -0
  267. package/dist/types/components/menu/MenuItem.d.ts +4 -0
  268. package/dist/types/components/menu/types.d.ts +59 -0
  269. package/dist/types/components/meter/Meter.d.ts +12 -0
  270. package/dist/types/components/navigator/Navigator.d.ts +12 -0
  271. package/dist/types/components/panel/Panel.d.ts +59 -0
  272. package/dist/types/components/panel/PanelGroup.d.ts +12 -0
  273. package/dist/types/components/panel/PanelStack.d.ts +16 -0
  274. package/dist/types/components/progress/ProgressBar.d.ts +24 -0
  275. package/dist/types/components/progress/ProgressCircle.d.ts +16 -0
  276. package/dist/types/components/tabpanel/Tab.d.ts +41 -0
  277. package/dist/types/components/tabpanel/TabPanel.d.ts +41 -0
  278. package/dist/types/context/Global.d.ts +81 -0
  279. package/dist/types/context/NotificationCenter.d.ts +11 -0
  280. package/dist/types/core/aside/Aside.d.ts +52 -0
  281. package/dist/types/core/boundary/ErrorBoundary.d.ts +26 -0
  282. package/dist/types/core/boundary/ErrorIcon.d.ts +1 -0
  283. package/dist/types/core/content/Content.d.ts +15 -0
  284. package/dist/types/core/headfoot/HeadFoot.d.ts +24 -0
  285. package/dist/types/core/index.d.ts +9 -0
  286. package/dist/types/core/page/Page.d.ts +23 -0
  287. package/dist/types/core/responsive/Responsive.d.ts +53 -0
  288. package/dist/types/core/section/Section.d.ts +7 -0
  289. package/dist/types/core/theme/ThemeProvider.d.ts +37 -0
  290. package/dist/types/core/viewport/Viewport.d.ts +5 -0
  291. package/dist/types/hooks/useClientService.d.ts +1 -0
  292. package/dist/types/hooks/useControlledValue.d.ts +5 -0
  293. package/dist/types/hooks/useDebounce.d.ts +4 -0
  294. package/dist/types/hooks/useEffectDebugger.d.ts +4 -0
  295. package/dist/types/hooks/useIsDark.d.ts +1 -0
  296. package/dist/types/hooks/useIsRtl.d.ts +1 -0
  297. package/dist/types/hooks/useNavigator.d.ts +7 -0
  298. package/dist/types/hooks/useOverlayService.d.ts +10 -0
  299. package/dist/types/hooks/usePropToggle.d.ts +9 -0
  300. package/dist/types/hooks/useResize.d.ts +27 -0
  301. package/dist/types/hooks/useResizeObserver.d.ts +3 -0
  302. package/dist/types/hooks/useStorage.d.ts +2 -0
  303. package/dist/types/hotkeys/HotKey.d.ts +2 -0
  304. package/dist/types/hotkeys/HotKeyLabel.d.ts +2 -0
  305. package/dist/types/hotkeys/HotKeyWrapper.d.ts +11 -0
  306. package/dist/types/hotkeys/commons.d.ts +28 -0
  307. package/dist/types/i18n/index.d.ts +6 -0
  308. package/dist/types/index.d.ts +19 -0
  309. package/dist/types/overlays/alert/Alert.d.ts +33 -0
  310. package/dist/types/overlays/flyout/Flyout.d.ts +57 -0
  311. package/dist/types/overlays/index.d.ts +6 -0
  312. package/dist/types/overlays/message/Message.d.ts +21 -0
  313. package/dist/types/overlays/modal/Modal.d.ts +53 -0
  314. package/dist/types/overlays/toast/Toast.d.ts +33 -0
  315. package/dist/types/overlays/tooltip/Tooltip.d.ts +18 -0
  316. package/dist/types/types/icons.d.ts +194 -0
  317. package/dist/types/types/index.d.ts +140 -0
  318. package/dist/types/typography/Abbr.d.ts +22 -0
  319. package/dist/types/typography/Copy.d.ts +9 -0
  320. package/dist/types/typography/Link.d.ts +24 -0
  321. package/dist/types/typography/Mark.d.ts +18 -0
  322. package/dist/types/typography/Text.d.ts +35 -0
  323. package/dist/types/typography/Title.d.ts +29 -0
  324. package/dist/types/typography/index.d.ts +6 -0
  325. package/dist/types/typography/types.d.ts +2 -0
  326. package/dist/types/utils/calculateDimensions.d.ts +6 -0
  327. package/dist/types/utils/getColor.d.ts +4 -0
  328. package/dist/types/utils/index.d.ts +3 -0
  329. package/dist/types/utils/nodeCheck.d.ts +2 -0
  330. package/package.json +60 -0
  331. package/src/components/actionLabel/ActionLabel.module.css +38 -0
  332. package/src/components/actionLabel/ActionLabel.tsx +97 -0
  333. package/src/components/animations/Animations.module.css +253 -0
  334. package/src/components/animations/Animations.tsx +190 -0
  335. package/src/components/avatar/Avatar.module.css +90 -0
  336. package/src/components/avatar/Avatar.tsx +218 -0
  337. package/src/components/avatar/AvatarGroup.tsx +140 -0
  338. package/src/components/badge/Badge.module.css +165 -0
  339. package/src/components/badge/Badge.tsx +148 -0
  340. package/src/components/breadcrumbs/Breadcrumbs.module.css +189 -0
  341. package/src/components/breadcrumbs/Breadcrumbs.tsx +109 -0
  342. package/src/components/button/Button.module.css +375 -0
  343. package/src/components/button/Button.tsx +323 -0
  344. package/src/components/button/ButtonGroup.tsx +112 -0
  345. package/src/components/button/ConfirmButton.tsx +221 -0
  346. package/src/components/button/ToggleButtonGroup.tsx +161 -0
  347. package/src/components/callout/Callout.tsx +104 -0
  348. package/src/components/card/Card.module.css +152 -0
  349. package/src/components/card/Card.tsx +154 -0
  350. package/src/components/card/CardCover.tsx +87 -0
  351. package/src/components/chip/Chip.module.css +118 -0
  352. package/src/components/chip/Chip.tsx +201 -0
  353. package/src/components/collapsable/Collapsable.module.css +30 -0
  354. package/src/components/collapsable/Collapsable.tsx +153 -0
  355. package/src/components/divider/Divider.tsx +105 -0
  356. package/src/components/dropdown/Dropdown.module.css +39 -0
  357. package/src/components/dropdown/Dropdown.tsx +307 -0
  358. package/src/components/dropdown/DropdownTool.tsx +56 -0
  359. package/src/components/empty/EmptyContent.tsx +141 -0
  360. package/src/components/icon/Icon.module.css +71 -0
  361. package/src/components/icon/Icon.tsx +188 -0
  362. package/src/components/index.ts +61 -0
  363. package/src/components/media/Media.module.css +112 -0
  364. package/src/components/media/Media.tsx +224 -0
  365. package/src/components/menu/ContextMenu.tsx +116 -0
  366. package/src/components/menu/Menu.module.css +109 -0
  367. package/src/components/menu/Menu.tsx +278 -0
  368. package/src/components/menu/MenuItem.tsx +162 -0
  369. package/src/components/menu/types.ts +100 -0
  370. package/src/components/meter/Meter.module.css +116 -0
  371. package/src/components/meter/Meter.tsx +80 -0
  372. package/src/components/navigator/Navigator.tsx +77 -0
  373. package/src/components/panel/Panel.module.css +86 -0
  374. package/src/components/panel/Panel.tsx +254 -0
  375. package/src/components/panel/PanelGroup.tsx +99 -0
  376. package/src/components/panel/PanelStack.tsx +133 -0
  377. package/src/components/progress/Progress.module.css +70 -0
  378. package/src/components/progress/ProgressBar.tsx +122 -0
  379. package/src/components/progress/ProgressCircle.tsx +118 -0
  380. package/src/components/tabpanel/Tab.tsx +175 -0
  381. package/src/components/tabpanel/TabPanel.module.css +200 -0
  382. package/src/components/tabpanel/TabPanel.tsx +155 -0
  383. package/src/context/Global.tsx +241 -0
  384. package/src/context/NotificationCenter.tsx +223 -0
  385. package/src/core/aside/Aside.module.css +231 -0
  386. package/src/core/aside/Aside.tsx +262 -0
  387. package/src/core/boundary/ErrorBoundary.module.css +65 -0
  388. package/src/core/boundary/ErrorBoundary.tsx +146 -0
  389. package/src/core/boundary/ErrorIcon.tsx +50 -0
  390. package/src/core/content/Content.module.css +40 -0
  391. package/src/core/content/Content.tsx +91 -0
  392. package/src/core/headfoot/HeadFoot.module.css +38 -0
  393. package/src/core/headfoot/HeadFoot.tsx +114 -0
  394. package/src/core/index.ts +32 -0
  395. package/src/core/page/Page.module.css +46 -0
  396. package/src/core/page/Page.tsx +100 -0
  397. package/src/core/responsive/Responsive.module.css +85 -0
  398. package/src/core/responsive/Responsive.tsx +172 -0
  399. package/src/core/section/Section.module.css +28 -0
  400. package/src/core/section/Section.tsx +48 -0
  401. package/src/core/theme/Theme.module.css +30 -0
  402. package/src/core/theme/ThemeProvider.tsx +112 -0
  403. package/src/core/viewport/Viewport.module.css +32 -0
  404. package/src/core/viewport/Viewport.tsx +43 -0
  405. package/src/hooks/useClientService.tsx +29 -0
  406. package/src/hooks/useControlledValue.tsx +43 -0
  407. package/src/hooks/useDebounce.ts +52 -0
  408. package/src/hooks/useEffectDebugger.ts +154 -0
  409. package/src/hooks/useIsDark.ts +50 -0
  410. package/src/hooks/useIsRtl.ts +46 -0
  411. package/src/hooks/useNavigator.tsx +54 -0
  412. package/src/hooks/useOverlayService.tsx +51 -0
  413. package/src/hooks/usePropToggle.ts +61 -0
  414. package/src/hooks/useResize.ts +90 -0
  415. package/src/hooks/useResizeObserver.ts +55 -0
  416. package/src/hooks/useStorage.ts +76 -0
  417. package/src/hotkeys/HotKey.tsx +39 -0
  418. package/src/hotkeys/HotKeyLabel.tsx +61 -0
  419. package/src/hotkeys/HotKeyWrapper.tsx +137 -0
  420. package/src/hotkeys/commons.ts +74 -0
  421. package/src/i18n/ar.json +21 -0
  422. package/src/i18n/en.json +34 -0
  423. package/src/i18n/index.ts +50 -0
  424. package/src/index.ts +51 -0
  425. package/src/overlays/alert/Alert.module.css +44 -0
  426. package/src/overlays/alert/Alert.tsx +229 -0
  427. package/src/overlays/flyout/Flyout.module.css +52 -0
  428. package/src/overlays/flyout/Flyout.tsx +283 -0
  429. package/src/overlays/index.ts +29 -0
  430. package/src/overlays/message/Message.module.css +37 -0
  431. package/src/overlays/message/Message.tsx +107 -0
  432. package/src/overlays/modal/Modal.module.css +53 -0
  433. package/src/overlays/modal/Modal.tsx +244 -0
  434. package/src/overlays/toast/Toast.module.css +37 -0
  435. package/src/overlays/toast/Toast.tsx +216 -0
  436. package/src/overlays/tooltip/Tooltip.module.css +53 -0
  437. package/src/overlays/tooltip/Tooltip.tsx +200 -0
  438. package/src/types/global.d.ts +83 -0
  439. package/src/types/icons.ts +420 -0
  440. package/src/types/index.ts +238 -0
  441. package/src/typography/Abbr.tsx +152 -0
  442. package/src/typography/Copy.tsx +61 -0
  443. package/src/typography/Link.tsx +110 -0
  444. package/src/typography/Mark.tsx +122 -0
  445. package/src/typography/Text.tsx +194 -0
  446. package/src/typography/Title.tsx +126 -0
  447. package/src/typography/Typography.module.css +68 -0
  448. package/src/typography/index.ts +29 -0
  449. package/src/typography/types.ts +38 -0
  450. package/src/utils/calculateDimensions.ts +72 -0
  451. package/src/utils/getColor.ts +49 -0
  452. package/src/utils/index.ts +28 -0
  453. package/src/utils/nodeCheck.ts +34 -0
@@ -0,0 +1,61 @@
1
+ 'use client';
2
+
3
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
5
+ import classNames from 'classnames';
6
+ import { useMemoDebugger } from '../../hooks/useEffectDebugger.js';
7
+ import { getColor, getBgClass, getColorClass } from '../../utils/getColor.js';
8
+ import '@react-fabric/utilities';
9
+ import classes from './HeadFoot.module.css';
10
+ import { jsx } from 'react/jsx-runtime';
11
+
12
+ var _excluded = ["as", "children", "className", "bg", "color", "flex", "area", "dir", "align", "justify"];
13
+ 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; }
14
+ 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; }
15
+ var HeadFoot = function HeadFoot(_ref) {
16
+ var E = _ref.as,
17
+ children = _ref.children,
18
+ className = _ref.className,
19
+ bg = _ref.bg,
20
+ color = _ref.color,
21
+ flex = _ref.flex,
22
+ area = _ref.area,
23
+ dir = _ref.dir,
24
+ _ref$align = _ref.align,
25
+ align = _ref$align === void 0 ? "center" : _ref$align,
26
+ _ref$justify = _ref.justify,
27
+ justify = _ref$justify === void 0 ? "start" : _ref$justify,
28
+ aria = _objectWithoutProperties(_ref, _excluded);
29
+ /** ***************** style map *******************/
30
+ var styles = useMemoDebugger(function () {
31
+ var s = {};
32
+ if (bg) {
33
+ s.backgroundColor = getColor(bg);
34
+ }
35
+ if (color) {
36
+ s.color = getColor(color);
37
+ }
38
+ return s;
39
+ }, [bg], "HeadFoot styles");
40
+ return /*#__PURE__*/jsx(E, _objectSpread(_objectSpread({
41
+ dir: dir,
42
+ className: classNames(classes.headfoot, className, bg && getBgClass(bg), color && getColorClass(color), area === "head" ? "area-head" : "area-foot", "leading-none", flex && "flex flex-nowrap gap-px", align && "items-".concat(align), justify && "justify-".concat(justify)),
43
+ style: styles
44
+ }, aria), {}, {
45
+ children: children
46
+ }));
47
+ };
48
+ var Header = function Header(props) {
49
+ return /*#__PURE__*/jsx(HeadFoot, _objectSpread({
50
+ as: "header",
51
+ area: "head"
52
+ }, props));
53
+ };
54
+ var Footer = function Footer(props) {
55
+ return /*#__PURE__*/jsx(HeadFoot, _objectSpread({
56
+ as: "footer",
57
+ area: "foot"
58
+ }, props));
59
+ };
60
+
61
+ export { Footer, Header };
@@ -0,0 +1 @@
1
+ @layer comp{.headfoot{.buttonWrapper+.buttonWrapper{margin-inline-start:.25rem}}}@layer util{.headfoot{height:unset;margin:unset;width:unset}}
@@ -0,0 +1,65 @@
1
+ 'use client';
2
+
3
+ import classNames from 'classnames';
4
+ import { Loading } from '../../components/animations/Animations.js';
5
+ import { Icon } from '../../components/icon/Icon.js';
6
+ import classes from './Page.module.css';
7
+ import { jsxs, jsx } from 'react/jsx-runtime';
8
+
9
+ /*
10
+ * React Fabric
11
+ * @version: 1.0.0
12
+ *
13
+ *
14
+ * The MIT License (MIT)
15
+ * Copyright (c) 2024 Adarsh Pastakia
16
+ *
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:
22
+ *
23
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
24
+ * portions of the Software.
25
+ *
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.
34
+ */
35
+ var Page = function Page(_ref) {
36
+ var children = _ref.children,
37
+ paper = _ref.paper,
38
+ title = _ref.title,
39
+ titleClassName = _ref.titleClassName,
40
+ icon = _ref.icon,
41
+ rtlFlip = _ref.rtlFlip,
42
+ iconBg = _ref.iconBg,
43
+ iconColor = _ref.iconColor,
44
+ loading = _ref.loading,
45
+ testId = _ref["data-testid"],
46
+ testValue = _ref["data-test-value"];
47
+ return /*#__PURE__*/jsxs("div", {
48
+ "data-testid": testId,
49
+ "data-test-value": testValue,
50
+ className: classNames(classes.page, "overflow-hidden grid area-content", paper && "shadow-paper m-[6px] rounded-capped"),
51
+ children: [title && /*#__PURE__*/jsxs("div", {
52
+ "data-ref": "pageTitle",
53
+ className: classNames(classes.pageTitle, "select-none flex gap-1 items-center justify-center px-1 py-0.5 font-medium text-center", titleClassName),
54
+ children: [icon && /*#__PURE__*/jsx(Icon, {
55
+ icon: icon,
56
+ size: "1.25em",
57
+ rtlFlip: rtlFlip,
58
+ bg: iconBg,
59
+ color: iconColor
60
+ }), title]
61
+ }), loading && /*#__PURE__*/jsx(Loading, {}), children]
62
+ });
63
+ };
64
+
65
+ export { Page };
@@ -0,0 +1 @@
1
+ @layer comp{.page{--fabric-page:color-mix(in lab,var(--fabric-bg) 94%,var(--tint));--fabric-page-title:color-mix(in lab,var(--fabric-bg) 90%,var(--tint));background-color:var(--fabric-page);grid-template:"title title title" auto "head head head" auto ". loader ." auto "side-s content side-e" 1fr "foot foot foot" auto/auto 1fr auto;.pageTitle{background-color:var(--fabric-page-title);color:theme(colors.primary.600);grid-area:title}}}@layer util{.pageTitle{height:unset;margin:unset;width:unset}}
@@ -0,0 +1,62 @@
1
+ 'use client';
2
+
3
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
5
+ import classNames from 'classnames';
6
+ import classes from './Responsive.module.css';
7
+ import { jsx } from 'react/jsx-runtime';
8
+
9
+ var _excluded = ["children", "fullWidth", "className", "gutter"],
10
+ _excluded2 = ["children", "gutter", "noWrap", "orient", "align", "justify", "className"],
11
+ _excluded3 = ["children", "flex", "align", "className", "stretchContent"];
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
+ 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
+ * Responsive layout container
16
+ */
17
+ var Container = function Container(_ref) {
18
+ var children = _ref.children,
19
+ fullWidth = _ref.fullWidth,
20
+ className = _ref.className,
21
+ gutter = _ref.gutter,
22
+ aria = _objectWithoutProperties(_ref, _excluded);
23
+ return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
24
+ className: classNames(classes.container, className, !fullWidth && "container mx-auto"),
25
+ "data-gutter": gutter
26
+ }, aria), {}, {
27
+ children: children
28
+ }));
29
+ };
30
+ var Row = function Row(_ref2) {
31
+ var children = _ref2.children,
32
+ gutter = _ref2.gutter,
33
+ noWrap = _ref2.noWrap,
34
+ orient = _ref2.orient,
35
+ _ref2$align = _ref2.align,
36
+ align = _ref2$align === void 0 ? "stretch" : _ref2$align,
37
+ _ref2$justify = _ref2.justify,
38
+ justify = _ref2$justify === void 0 ? "start" : _ref2$justify,
39
+ className = _ref2.className,
40
+ aria = _objectWithoutProperties(_ref2, _excluded2);
41
+ 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)),
43
+ "data-gutter": gutter
44
+ }, aria), {}, {
45
+ children: children
46
+ }));
47
+ };
48
+ var Col = function Col(_ref3) {
49
+ var children = _ref3.children,
50
+ flex = _ref3.flex,
51
+ align = _ref3.align,
52
+ className = _ref3.className,
53
+ stretchContent = _ref3.stretchContent,
54
+ aria = _objectWithoutProperties(_ref3, _excluded3);
55
+ 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))
57
+ }, aria), {}, {
58
+ children: children
59
+ }));
60
+ };
61
+
62
+ export { Col, Container, Row };
@@ -0,0 +1 @@
1
+ @layer comp{.row{margin:calc(var(--gutter)*-.5);&+.row{margin-top:calc(var(--gutter)*.5)}}.col{flex:0 0 auto;margin:calc(var(--gutter)*.5);max-width:calc(100% - var(--gutter, 0px));&.stretchContent>*{min-height:100%;min-width:100%}}[data-gutter="0"]{&.container,&.row{--gutter:0px}}[data-gutter=xs]{&.container,&.row{--gutter:2px}}[data-gutter=sm]{&.container,&.row{--gutter:0.25rem}}[data-gutter=md]{&.container,&.row{--gutter:0.75rem}}[data-gutter=lg]{&.container,&.row{--gutter:1rem}}[data-gutter=xl]{&.container,&.row{--gutter:1.5rem}}}
@@ -0,0 +1,44 @@
1
+ 'use client';
2
+
3
+ import classNames from 'classnames';
4
+ import { ErrorBoundary } from '../boundary/ErrorBoundary.js';
5
+ import classes from './Section.module.css';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
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
+
31
+ var Section = function Section(_ref) {
32
+ var children = _ref.children,
33
+ dir = _ref.dir;
34
+ return /*#__PURE__*/jsx("div", {
35
+ "data-ref": "section",
36
+ dir: dir,
37
+ className: classNames(classes.section, "grid area-content overflow-hidden"),
38
+ children: /*#__PURE__*/jsx(ErrorBoundary, {
39
+ children: children
40
+ })
41
+ });
42
+ };
43
+
44
+ export { Section };
@@ -0,0 +1 @@
1
+ @layer comp{.section{grid-template:"head head head" auto "side-s content side-e" 1fr "foot foot foot" auto/auto 1fr auto}}
@@ -0,0 +1 @@
1
+ @layer comp{.themeProvider{&>*{background-color:theme(backgroundColor.base)}}}
@@ -0,0 +1,74 @@
1
+ 'use client';
2
+
3
+ import { isColor } from '@react-fabric/utilities';
4
+ import classNames from 'classnames';
5
+ import { useMemo } from 'react';
6
+ import classes from './Theme.module.css';
7
+ import { jsx } from 'react/jsx-runtime';
8
+
9
+ /*
10
+ * React Fabric
11
+ * @version: 1.0.0
12
+ *
13
+ *
14
+ * The MIT License (MIT)
15
+ * Copyright (c) 2024 Adarsh Pastakia
16
+ *
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:
22
+ *
23
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
24
+ * portions of the Software.
25
+ *
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
+ * Theme override
34
+ */
35
+ var ThemeProvider = function ThemeProvider(_ref) {
36
+ var children = _ref.children,
37
+ branding = _ref.branding,
38
+ primaryColor = _ref.primaryColor,
39
+ accentColor = _ref.accentColor,
40
+ tintColor = _ref.tintColor,
41
+ colorScheme = _ref.colorScheme,
42
+ rounding = _ref.rounding;
43
+ var styles = useMemo(function () {
44
+ var ret = {};
45
+ if (primaryColor && isColor(primaryColor)) {
46
+ ret["--primary"] = primaryColor;
47
+ }
48
+ if (primaryColor && !isColor(primaryColor)) {
49
+ ret["--primary"] = "var(--".concat(primaryColor, ")");
50
+ }
51
+ if (accentColor && isColor(accentColor)) {
52
+ ret["--accent"] = accentColor;
53
+ }
54
+ if (accentColor && !isColor(accentColor)) {
55
+ ret["--accent"] = "var(--".concat(accentColor, ")");
56
+ }
57
+ if (tintColor && isColor(tintColor)) {
58
+ ret["--tint"] = tintColor;
59
+ }
60
+ if (tintColor && !isColor(tintColor)) {
61
+ ret["--tint"] = "var(--".concat(tintColor, ")");
62
+ }
63
+ return ret;
64
+ }, [primaryColor, accentColor, tintColor]);
65
+ return /*#__PURE__*/jsx("div", {
66
+ style: styles,
67
+ "data-color-scheme": colorScheme,
68
+ "data-rounding": rounding,
69
+ className: classNames(classes.themeProvider, "contents theme-base", branding),
70
+ children: children
71
+ });
72
+ };
73
+
74
+ export { ThemeProvider };
@@ -0,0 +1,39 @@
1
+ 'use client';
2
+
3
+ import classNames from 'classnames';
4
+ import classes from './Viewport.module.css';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ /*
8
+ * React Fabric
9
+ * @version: 1.0.0
10
+ *
11
+ *
12
+ * The MIT License (MIT)
13
+ * Copyright (c) 2024 Adarsh Pastakia
14
+ *
15
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
16
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
17
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
18
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
19
+ * subject to the following conditions:
20
+ *
21
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
22
+ * portions of the Software.
23
+ *
24
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
25
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
+ */
29
+
30
+ var Viewport = function Viewport(_ref) {
31
+ var children = _ref.children;
32
+ return /*#__PURE__*/jsx("div", {
33
+ "data-ref": "viewport",
34
+ className: classNames(classes.viewport, "grid overflow-hidden absolute inset-0"),
35
+ children: children
36
+ });
37
+ };
38
+
39
+ export { Viewport };
@@ -0,0 +1 @@
1
+ @layer comp{.viewport{--fabric-viewport:color-mix(in lab,var(--fabric-bg) 76%,var(--tint));background-color:var(--fabric-viewport);color:var(--fabric-text);grid-template:"head head head" auto "crumbbar crumbbar crumbbar" auto "side-s content side-e" 1fr "foot foot foot" auto/auto 1fr auto}}
@@ -0,0 +1,30 @@
1
+ 'use client';
2
+
3
+ /*
4
+ * React Fabric
5
+ * @version: 1.0.0
6
+ *
7
+ *
8
+ * The MIT License (MIT)
9
+ * Copyright (c) 2024 Adarsh Pastakia
10
+ *
11
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
12
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
13
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
14
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
15
+ * subject to the following conditions:
16
+ *
17
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
18
+ * portions of the Software.
19
+ *
20
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
21
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
+ */
25
+
26
+ var useClientService = function useClientService(clientApi, serverMock) {
27
+ return typeof window === "undefined" ? serverMock : clientApi;
28
+ };
29
+
30
+ export { useClientService };
@@ -0,0 +1,22 @@
1
+ 'use client';
2
+
3
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
+ import { useState, useDeferredValue } from 'react';
5
+ import { useEffectDebugger } from './useEffectDebugger.js';
6
+
7
+ var useControlledValue = function useControlledValue(value, defaultValue) {
8
+ var _useState = useState(defaultValue),
9
+ _useState2 = _slicedToArray(_useState, 2),
10
+ currentValue = _useState2[0],
11
+ updateValue = _useState2[1];
12
+ var deferred = useDeferredValue(value);
13
+ useEffectDebugger(function () {
14
+ updateValue(deferred !== null && deferred !== void 0 ? deferred : defaultValue);
15
+ }, [deferred], "useControlledValue change");
16
+ return {
17
+ currentValue: currentValue,
18
+ updateValue: updateValue
19
+ };
20
+ };
21
+
22
+ export { useControlledValue };
@@ -0,0 +1,56 @@
1
+ 'use client';
2
+
3
+ import { useRef, useMemo } from 'react';
4
+
5
+ /*
6
+ * React Fabric
7
+ * @version: 1.0.0
8
+ *
9
+ *
10
+ * The MIT License (MIT)
11
+ * Copyright (c) 2024 Adarsh Pastakia
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
14
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
15
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
16
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
17
+ * subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
20
+ * portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
23
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
+ */
27
+
28
+ var useDebounce = function useDebounce(callback, deps) {
29
+ var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
30
+ var timerRef = useRef();
31
+ var cb = useMemo(function () {
32
+ if (typeof window !== "undefined") {
33
+ window.clearTimeout(timerRef.current);
34
+ }
35
+ var fn = function fn() {
36
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
37
+ args[_key] = arguments[_key];
38
+ }
39
+ if (typeof window !== "undefined") {
40
+ window.clearTimeout(timerRef.current);
41
+ timerRef.current = window.setTimeout(function () {
42
+ return callback === null || callback === void 0 ? void 0 : callback.apply(void 0, args);
43
+ }, delay);
44
+ }
45
+ };
46
+ fn.cancel = function () {
47
+ if (typeof window !== "undefined") {
48
+ clearTimeout(timerRef.current);
49
+ }
50
+ };
51
+ return fn;
52
+ }, deps);
53
+ return cb;
54
+ };
55
+
56
+ export { useDebounce };
@@ -0,0 +1,111 @@
1
+ 'use client';
2
+
3
+ import { useLogger } from '@react-fabric/utilities';
4
+ import { useRef, useMemo, useEffect, useLayoutEffect } from 'react';
5
+
6
+ /*
7
+ * React Fabric
8
+ * @version: 1.0.0
9
+ *
10
+ *
11
+ * The MIT License (MIT)
12
+ * Copyright (c) 2024 Adarsh Pastakia
13
+ *
14
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
15
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
16
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
17
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
18
+ * subject to the following conditions:
19
+ *
20
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
21
+ * portions of the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
24
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
+ */
28
+
29
+ var loggerM = useLogger("useMemoDebugger");
30
+ var loggerE = useLogger("useEffectDebugger");
31
+ var loggerLE = useLogger("useLayoutEffectDebugger");
32
+ var compareInputs = function compareInputs(oldInputs, newInputs, prefix, logger) {
33
+ if (process.env.NODE_ENV === "production" && typeof window !== "undefined" &&
34
+ // @ts-expect-error ignore
35
+ window.DEBUG_HOOKS !== true) return;
36
+
37
+ // Edge-case: different array lengths
38
+ if (oldInputs.length !== newInputs.length) {
39
+ // Not helpful to compare item by item, so just output the whole array
40
+ logger.debug("Deps have a different length", {
41
+ process: prefix
42
+ }, oldInputs.length, newInputs.length);
43
+ return;
44
+ }
45
+
46
+ // Compare individual items
47
+ oldInputs.forEach(function (oldInput, index) {
48
+ var newInput = newInputs[index];
49
+ var diff = [];
50
+ if (oldInput !== newInput) {
51
+ var _ref, _ref2, _ref3, _oldInput$type$name, _oldInput$type, _oldInput$substr, _ref4, _ref5, _ref6, _newInput$type$name, _newInput$type, _newInput$substr;
52
+ diff.push("Dep [".concat(index, "] has a different value"), (_ref = (_ref2 = (_ref3 = (_oldInput$type$name = oldInput === null || oldInput === void 0 || (_oldInput$type = oldInput.type) === null || _oldInput$type === void 0 ? void 0 : _oldInput$type.name) !== null && _oldInput$type$name !== void 0 ? _oldInput$type$name : oldInput === null || oldInput === void 0 ? void 0 : oldInput.tagName) !== null && _ref3 !== void 0 ? _ref3 : oldInput === null || oldInput === void 0 ? void 0 : oldInput.name) !== null && _ref2 !== void 0 ? _ref2 : oldInput === null || oldInput === void 0 || (_oldInput$substr = oldInput.substr) === null || _oldInput$substr === void 0 ? void 0 : _oldInput$substr.call(oldInput, 0, 24)) !== null && _ref !== void 0 ? _ref : oldInput, (_ref4 = (_ref5 = (_ref6 = (_newInput$type$name = newInput === null || newInput === void 0 || (_newInput$type = newInput.type) === null || _newInput$type === void 0 ? void 0 : _newInput$type.name) !== null && _newInput$type$name !== void 0 ? _newInput$type$name : newInput === null || newInput === void 0 ? void 0 : newInput.tagName) !== null && _ref6 !== void 0 ? _ref6 : newInput === null || newInput === void 0 ? void 0 : newInput.name) !== null && _ref5 !== void 0 ? _ref5 : newInput === null || newInput === void 0 || (_newInput$substr = newInput.substr) === null || _newInput$substr === void 0 ? void 0 : _newInput$substr.call(newInput, 0, 24)) !== null && _ref4 !== void 0 ? _ref4 : newInput, "\n\n");
53
+ }
54
+ diff.length && logger.debug.apply(logger, ["Diff", {
55
+ process: prefix
56
+ }].concat(diff));
57
+ });
58
+ };
59
+ var useMemoDebugger = function useMemoDebugger(func, inputs, prefix) {
60
+ // Using a ref to hold the inputs from the previous run (or same run for initial run
61
+ var oldInputsRef = useRef(inputs);
62
+ return useMemo(function () {
63
+ // Get the old inputs
64
+ var oldInputs = oldInputsRef.current;
65
+
66
+ // Compare the old inputs to the current inputs
67
+ compareInputs(oldInputs, inputs, prefix, loggerM);
68
+
69
+ // Save the current inputs
70
+ oldInputsRef.current = inputs;
71
+
72
+ // Execute wrapped effect
73
+ return func();
74
+ }, inputs);
75
+ };
76
+ var useEffectDebugger = function useEffectDebugger(func, inputs, prefix) {
77
+ // Using a ref to hold the inputs from the previous run (or same run for initial run
78
+ var oldInputsRef = useRef(inputs);
79
+ useEffect(function () {
80
+ // Get the old inputs
81
+ var oldInputs = oldInputsRef.current;
82
+
83
+ // Compare the old inputs to the current inputs
84
+ compareInputs(oldInputs, inputs, prefix, loggerE);
85
+
86
+ // Save the current inputs
87
+ oldInputsRef.current = inputs;
88
+
89
+ // Execute wrapped effect
90
+ return func();
91
+ }, inputs);
92
+ };
93
+ var useLayoutEffectDebugger = function useLayoutEffectDebugger(func, inputs, prefix) {
94
+ // Using a ref to hold the inputs from the previous run (or same run for initial run
95
+ var oldInputsRef = useRef(inputs);
96
+ useLayoutEffect(function () {
97
+ // Get the old inputs
98
+ var oldInputs = oldInputsRef.current;
99
+
100
+ // Compare the old inputs to the current inputs
101
+ compareInputs(oldInputs, inputs, prefix, loggerLE);
102
+
103
+ // Save the current inputs
104
+ oldInputsRef.current = inputs;
105
+
106
+ // Execute wrapped effect
107
+ return func();
108
+ }, inputs);
109
+ };
110
+
111
+ export { useEffectDebugger, useLayoutEffectDebugger, useMemoDebugger };
@@ -0,0 +1,33 @@
1
+ 'use client';
2
+
3
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
+ import { useState, useCallback } from 'react';
5
+ import { useLayoutEffectDebugger } from './useEffectDebugger.js';
6
+
7
+ var useIsDark = function useIsDark() {
8
+ var _useState = useState(false),
9
+ _useState2 = _slicedToArray(_useState, 2),
10
+ isDark = _useState2[0],
11
+ setDark = _useState2[1];
12
+ var checkTheme = useCallback(function () {
13
+ var _ref = getComputedStyle(document.documentElement).backgroundColor.match(/\d?\d?\d/g),
14
+ _ref2 = _slicedToArray(_ref, 1),
15
+ r = _ref2[0];
16
+ setDark(+r < 50);
17
+ }, []);
18
+ useLayoutEffectDebugger(function () {
19
+ if (MutationObserver) {
20
+ var ob = new MutationObserver(checkTheme);
21
+ ob.observe(document.documentElement, {
22
+ attributes: true
23
+ });
24
+ checkTheme();
25
+ return function () {
26
+ ob.disconnect();
27
+ };
28
+ }
29
+ }, [], "useIsDark");
30
+ return isDark;
31
+ };
32
+
33
+ export { useIsDark };
@@ -0,0 +1,27 @@
1
+ 'use client';
2
+
3
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
+ import { useState } from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { useLayoutEffectDebugger } from './useEffectDebugger.js';
7
+
8
+ var useIsRtl = function useIsRtl() {
9
+ var _useTranslation = useTranslation("core"),
10
+ i18n = _useTranslation.i18n;
11
+ var _useState = useState(false),
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ isRtl = _useState2[0],
14
+ setIsRtl = _useState2[1];
15
+
16
+ /** ***************** update RTL flag on i18n locale change *******************/
17
+ useLayoutEffectDebugger(function () {
18
+ try {
19
+ setIsRtl(i18n.dir() === "rtl");
20
+ } catch (_unused) {
21
+ //
22
+ }
23
+ }, [i18n.language], "useIsRtl");
24
+ return isRtl;
25
+ };
26
+
27
+ export { useIsRtl };