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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. package/{src/components/actionLabel/ActionLabel.module.css → css/components/_actionLabel.css} +4 -4
  2. package/{src/overlays/alert/Alert.module.css → css/components/_alert.css} +3 -3
  3. package/{src/components/animations/Animations.module.css → css/components/_animations.css} +9 -9
  4. package/{src/components/avatar/Avatar.module.css → css/components/_avatar.css} +11 -11
  5. package/{src/components/badge/Badge.module.css → css/components/_badge.css} +19 -17
  6. package/{src/components/breadcrumbs/Breadcrumbs.module.css → css/components/_breadcrumbs.css} +52 -47
  7. package/{src/components/button/Button.module.css → css/components/_button.css} +86 -84
  8. package/{src/components/card/Card.module.css → css/components/_card.css} +54 -28
  9. package/{src/components/chip/Chip.module.css → css/components/_chip.css} +14 -10
  10. package/{src/components/collapsable/Collapsable.module.css → css/components/_collapsable.css} +3 -3
  11. package/css/components/_divider.css +38 -0
  12. package/{src/components/dropdown/Dropdown.module.css → css/components/_dropdown.css} +2 -2
  13. package/{src/overlays/flyout/Flyout.module.css → css/components/_flyout.css} +6 -6
  14. package/{src/components/icon/Icon.module.css → css/components/_icon.css} +12 -9
  15. package/{src/components/media/Media.module.css → css/components/_media.css} +17 -17
  16. package/{src/components/menu/Menu.module.css → css/components/_menu.css} +21 -20
  17. package/{src/overlays/message/Message.module.css → css/components/_message.css} +2 -2
  18. package/{src/components/meter/Meter.module.css → css/components/_meter.css} +10 -10
  19. package/{src/overlays/modal/Modal.module.css → css/components/_modal.css} +8 -8
  20. package/{src/components/panel/Panel.module.css → css/components/_panel.css} +17 -17
  21. package/{src/components/progress/Progress.module.css → css/components/_progress.css} +7 -10
  22. package/css/components/_stepper.css +86 -0
  23. package/{src/components/tabpanel/TabPanel.module.css → css/components/_tabPanel.css} +130 -85
  24. package/{src/overlays/toast/Toast.module.css → css/components/_toast.css} +2 -2
  25. package/css/components/_tooltip.css +29 -0
  26. package/{src/core/content/Content.module.css → css/components/index.css} +26 -18
  27. package/{src/core/aside/Aside.module.css → css/core/_aside.css} +60 -48
  28. package/{src/core/section/Section.module.css → css/core/_content.css} +5 -3
  29. package/{src/core/boundary/ErrorBoundary.module.css → css/core/_errorboundary.css} +9 -9
  30. package/{src/core/headfoot/HeadFoot.module.css → css/core/_headfoot.css} +4 -10
  31. package/{src/core/page/Page.module.css → css/core/_page.css} +10 -14
  32. package/{src/core/responsive/Responsive.module.css → css/core/_responsive.css} +10 -10
  33. package/css/core/_section.css +28 -0
  34. package/{src/core/theme/Theme.module.css → css/core/_theme.css} +3 -3
  35. package/{src/typography/Typography.module.css → css/core/_typography.css} +14 -12
  36. package/{src/core/viewport/Viewport.module.css → css/core/_viewport.css} +7 -3
  37. package/css/core/index.css +33 -0
  38. package/css/reset/_gradients.css +8 -8
  39. package/css/reset/_reset.css +56 -224
  40. package/css/reset/_text.css +14 -29
  41. package/css/reset/_theme.css +331 -52
  42. package/css/reset/index.css +4 -4
  43. package/css/styles.css +9 -6
  44. package/css/theme/_colors.css +320 -0
  45. package/css/theme/_utilities.css +541 -0
  46. package/css/theme/index.css +45 -0
  47. package/dist/cjs/components/actionLabel/ActionLabel.js +26 -8
  48. package/dist/cjs/components/animations/Animations.js +137 -45
  49. package/dist/cjs/components/avatar/Avatar.js +46 -13
  50. package/dist/cjs/components/avatar/AvatarGroup.js +22 -4
  51. package/dist/cjs/components/badge/Badge.js +36 -15
  52. package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +40 -9
  53. package/dist/cjs/components/button/Button.js +51 -29
  54. package/dist/cjs/components/button/ButtonGroup.js +30 -3
  55. package/dist/cjs/components/button/ConfirmButton.js +28 -2
  56. package/dist/cjs/components/button/ToggleButtonGroup.js +41 -15
  57. package/dist/cjs/components/callout/Callout.js +47 -7
  58. package/dist/cjs/components/card/Card.js +60 -18
  59. package/dist/cjs/components/card/CardCover.js +36 -5
  60. package/dist/cjs/components/card/FlipContent.js +56 -0
  61. package/dist/cjs/components/chip/Chip.js +40 -20
  62. package/dist/cjs/components/collapsable/Collapsable.js +32 -8
  63. package/dist/cjs/components/divider/Divider.js +30 -7
  64. package/dist/cjs/components/dropdown/Dropdown.js +48 -9
  65. package/dist/cjs/components/dropdown/DropdownTool.js +2 -3
  66. package/dist/cjs/components/empty/EmptyContent.js +37 -7
  67. package/dist/cjs/components/icon/Icon.js +76 -13
  68. package/dist/cjs/components/media/Media.js +174 -76
  69. package/dist/cjs/components/menu/ContextMenu.js +19 -0
  70. package/dist/cjs/components/menu/Menu.js +77 -23
  71. package/dist/cjs/components/menu/MenuItem.js +54 -27
  72. package/dist/cjs/components/meter/Meter.js +26 -3
  73. package/dist/cjs/components/navigator/Navigator.js +50 -18
  74. package/dist/cjs/components/panel/Panel.js +59 -28
  75. package/dist/cjs/components/panel/PanelGroup.js +25 -2
  76. package/dist/cjs/components/panel/PanelStack.js +31 -2
  77. package/dist/cjs/components/progress/ProgressBar.js +31 -9
  78. package/dist/cjs/components/progress/ProgressCircle.js +29 -7
  79. package/dist/cjs/components/tabpanel/Tab.js +39 -16
  80. package/dist/cjs/components/tabpanel/TabPanel.js +56 -16
  81. package/dist/cjs/context/Global.js +28 -1
  82. package/dist/cjs/context/NotificationCenter.js +3 -3
  83. package/dist/cjs/core/aside/Aside.js +50 -25
  84. package/dist/cjs/core/boundary/ErrorBoundary.js +25 -8
  85. package/dist/cjs/core/boundary/ErrorIcon.js +1 -2
  86. package/dist/cjs/core/content/Content.js +7 -3
  87. package/dist/cjs/core/headfoot/HeadFoot.js +48 -22
  88. package/dist/cjs/core/page/Page.js +41 -40
  89. package/dist/cjs/core/responsive/Responsive.js +59 -6
  90. package/dist/cjs/core/section/Section.js +12 -29
  91. package/dist/cjs/core/theme/ThemeProvider.js +32 -10
  92. package/dist/cjs/core/viewport/Viewport.js +18 -2
  93. package/dist/cjs/hooks/useControlledValue.js +12 -0
  94. package/dist/cjs/hooks/useDebounce.js +14 -1
  95. package/dist/cjs/hooks/useEffectDebugger.js +54 -2
  96. package/dist/cjs/hooks/useIsDark.js +8 -0
  97. package/dist/cjs/hooks/useIsRtl.js +12 -0
  98. package/dist/cjs/hooks/useNavigator.js +6 -4
  99. package/dist/cjs/hooks/useOverlayService.js +24 -0
  100. package/dist/cjs/hooks/usePropToggle.js +16 -5
  101. package/dist/cjs/hooks/useResize.js +18 -0
  102. package/dist/cjs/hooks/useResizeObserver.js +20 -1
  103. package/dist/cjs/hooks/useStepper.js +74 -0
  104. package/dist/cjs/hooks/useStorage.js +39 -0
  105. package/dist/cjs/hotkeys/HotKeyLabel.js +1 -1
  106. package/dist/cjs/hotkeys/HotKeyWrapper.js +3 -1
  107. package/dist/cjs/index.js +14 -10
  108. package/dist/cjs/overlays/alert/Alert.js +24 -17
  109. package/dist/cjs/overlays/flyout/Flyout.js +48 -65
  110. package/dist/cjs/overlays/message/Message.js +8 -3
  111. package/dist/cjs/overlays/modal/Modal.js +19 -23
  112. package/dist/cjs/overlays/toast/Toast.js +22 -13
  113. package/dist/cjs/overlays/tooltip/Tooltip.js +25 -13
  114. package/dist/cjs/typography/Abbr.js +35 -7
  115. package/dist/cjs/typography/{Link.js → Anchor.js} +23 -5
  116. package/dist/cjs/typography/Copy.js +1 -2
  117. package/dist/cjs/typography/Mark.js +25 -5
  118. package/dist/cjs/typography/Text.js +30 -5
  119. package/dist/cjs/typography/Title.js +19 -4
  120. package/dist/cjs/utils/cloneElement.js +47 -0
  121. package/dist/cjs/utils/getColor.js +1 -18
  122. package/dist/esm/components/actionLabel/ActionLabel.js +26 -8
  123. package/dist/esm/components/animations/Animations.js +135 -44
  124. package/dist/esm/components/avatar/Avatar.js +46 -13
  125. package/dist/esm/components/avatar/AvatarGroup.js +22 -4
  126. package/dist/esm/components/badge/Badge.js +38 -17
  127. package/dist/esm/components/breadcrumbs/Breadcrumbs.js +40 -9
  128. package/dist/esm/components/button/Button.js +53 -31
  129. package/dist/esm/components/button/ButtonGroup.js +31 -4
  130. package/dist/esm/components/button/ConfirmButton.js +28 -2
  131. package/dist/esm/components/button/ToggleButtonGroup.js +42 -16
  132. package/dist/esm/components/callout/Callout.js +47 -7
  133. package/dist/esm/components/card/Card.js +61 -19
  134. package/dist/esm/components/card/CardCover.js +36 -5
  135. package/dist/esm/components/card/FlipContent.js +56 -0
  136. package/dist/esm/components/chip/Chip.js +42 -22
  137. package/dist/esm/components/collapsable/Collapsable.js +32 -8
  138. package/dist/esm/components/divider/Divider.js +31 -8
  139. package/dist/esm/components/dropdown/Dropdown.js +48 -9
  140. package/dist/esm/components/dropdown/DropdownTool.js +2 -3
  141. package/dist/esm/components/empty/EmptyContent.js +37 -7
  142. package/dist/esm/components/icon/Icon.js +78 -16
  143. package/dist/esm/components/media/Media.js +175 -77
  144. package/dist/esm/components/menu/ContextMenu.js +19 -0
  145. package/dist/esm/components/menu/Menu.js +79 -25
  146. package/dist/esm/components/menu/MenuItem.js +49 -22
  147. package/dist/esm/components/meter/Meter.js +26 -3
  148. package/dist/esm/components/navigator/Navigator.js +50 -18
  149. package/dist/esm/components/panel/Panel.js +61 -30
  150. package/dist/esm/components/panel/PanelGroup.js +25 -2
  151. package/dist/esm/components/panel/PanelStack.js +31 -2
  152. package/dist/esm/components/progress/ProgressBar.js +31 -9
  153. package/dist/esm/components/progress/ProgressCircle.js +29 -7
  154. package/dist/esm/components/tabpanel/Tab.js +40 -17
  155. package/dist/esm/components/tabpanel/TabPanel.js +56 -16
  156. package/dist/esm/context/Global.js +28 -1
  157. package/dist/esm/context/NotificationCenter.js +3 -3
  158. package/dist/esm/core/aside/Aside.js +52 -27
  159. package/dist/esm/core/boundary/ErrorBoundary.js +25 -8
  160. package/dist/esm/core/boundary/ErrorIcon.js +1 -2
  161. package/dist/esm/core/content/Content.js +7 -3
  162. package/dist/esm/core/headfoot/HeadFoot.js +48 -22
  163. package/dist/esm/core/page/Page.js +43 -42
  164. package/dist/esm/core/responsive/Responsive.js +59 -6
  165. package/dist/esm/core/section/Section.js +12 -29
  166. package/dist/esm/core/theme/ThemeProvider.js +32 -10
  167. package/dist/esm/core/viewport/Viewport.js +18 -2
  168. package/dist/esm/hooks/useControlledValue.js +12 -0
  169. package/dist/esm/hooks/useDebounce.js +14 -1
  170. package/dist/esm/hooks/useEffectDebugger.js +54 -2
  171. package/dist/esm/hooks/useIsDark.js +8 -0
  172. package/dist/esm/hooks/useIsRtl.js +12 -0
  173. package/dist/esm/hooks/useNavigator.js +7 -5
  174. package/dist/esm/hooks/useOverlayService.js +24 -0
  175. package/dist/esm/hooks/usePropToggle.js +16 -5
  176. package/dist/esm/hooks/useResize.js +18 -0
  177. package/dist/esm/hooks/useResizeObserver.js +20 -1
  178. package/dist/esm/hooks/useStepper.js +74 -0
  179. package/dist/esm/hooks/useStorage.js +39 -0
  180. package/dist/esm/hotkeys/HotKeyLabel.js +1 -1
  181. package/dist/esm/hotkeys/HotKeyWrapper.js +3 -1
  182. package/dist/esm/index.js +7 -4
  183. package/dist/esm/overlays/alert/Alert.js +25 -18
  184. package/dist/esm/overlays/flyout/Flyout.js +53 -70
  185. package/dist/esm/overlays/message/Message.js +9 -4
  186. package/dist/esm/overlays/modal/Modal.js +22 -26
  187. package/dist/esm/overlays/toast/Toast.js +23 -14
  188. package/dist/esm/overlays/tooltip/Tooltip.js +25 -13
  189. package/dist/esm/typography/Abbr.js +35 -7
  190. package/dist/esm/typography/{Link.js → Anchor.js} +24 -6
  191. package/dist/esm/typography/Copy.js +1 -2
  192. package/dist/esm/typography/Mark.js +25 -5
  193. package/dist/esm/typography/Text.js +31 -6
  194. package/dist/esm/typography/Title.js +20 -5
  195. package/dist/esm/utils/cloneElement.js +47 -0
  196. package/dist/esm/utils/getColor.js +2 -16
  197. package/dist/types/components/actionLabel/ActionLabel.d.ts +21 -2
  198. package/dist/types/components/animations/Animations.d.ts +105 -7
  199. package/dist/types/components/avatar/Avatar.d.ts +34 -6
  200. package/dist/types/components/avatar/AvatarGroup.d.ts +19 -1
  201. package/dist/types/components/badge/Badge.d.ts +37 -3
  202. package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +31 -2
  203. package/dist/types/components/button/Button.d.ts +39 -7
  204. package/dist/types/components/button/ButtonGroup.d.ts +28 -3
  205. package/dist/types/components/button/ConfirmButton.d.ts +23 -3
  206. package/dist/types/components/button/ToggleButtonGroup.d.ts +39 -11
  207. package/dist/types/components/callout/Callout.d.ts +29 -3
  208. package/dist/types/components/card/Card.d.ts +44 -4
  209. package/dist/types/components/card/CardCover.d.ts +25 -0
  210. package/dist/types/components/card/FlipContent.d.ts +28 -0
  211. package/dist/types/components/chip/Chip.d.ts +34 -5
  212. package/dist/types/components/collapsable/Collapsable.d.ts +28 -2
  213. package/dist/types/components/divider/Divider.d.ts +30 -7
  214. package/dist/types/components/dropdown/Dropdown.d.ts +40 -1
  215. package/dist/types/components/dropdown/DropdownTool.d.ts +25 -0
  216. package/dist/types/components/empty/EmptyContent.d.ts +32 -3
  217. package/dist/types/components/icon/Icon.d.ts +40 -8
  218. package/dist/types/components/index.d.ts +3 -2
  219. package/dist/types/components/media/Media.d.ts +54 -0
  220. package/dist/types/components/menu/ContextMenu.d.ts +19 -1
  221. package/dist/types/components/menu/Menu.d.ts +29 -0
  222. package/dist/types/components/menu/MenuItem.d.ts +22 -2
  223. package/dist/types/components/menu/types.d.ts +9 -3
  224. package/dist/types/components/meter/Meter.d.ts +24 -0
  225. package/dist/types/components/navigator/Navigator.d.ts +29 -4
  226. package/dist/types/components/panel/Panel.d.ts +43 -4
  227. package/dist/types/components/panel/PanelGroup.d.ts +24 -0
  228. package/dist/types/components/panel/PanelStack.d.ts +31 -0
  229. package/dist/types/components/progress/ProgressBar.d.ts +23 -3
  230. package/dist/types/components/progress/ProgressCircle.d.ts +22 -3
  231. package/dist/types/components/tabpanel/Tab.d.ts +38 -4
  232. package/dist/types/components/tabpanel/TabPanel.d.ts +51 -2
  233. package/dist/types/context/Global.d.ts +24 -1
  234. package/dist/types/core/aside/Aside.d.ts +45 -6
  235. package/dist/types/core/boundary/ErrorBoundary.d.ts +18 -2
  236. package/dist/types/core/content/Content.d.ts +6 -1
  237. package/dist/types/core/headfoot/HeadFoot.d.ts +41 -9
  238. package/dist/types/core/page/Page.d.ts +32 -4
  239. package/dist/types/core/responsive/Responsive.d.ts +58 -3
  240. package/dist/types/core/section/Section.d.ts +18 -3
  241. package/dist/types/core/theme/ThemeProvider.d.ts +25 -5
  242. package/dist/types/core/viewport/Viewport.d.ts +15 -1
  243. package/dist/types/hooks/useControlledValue.d.ts +13 -2
  244. package/dist/types/hooks/useDebounce.d.ts +12 -0
  245. package/dist/types/hooks/useEffectDebugger.d.ts +49 -0
  246. package/dist/types/hooks/useIsDark.d.ts +8 -0
  247. package/dist/types/hooks/useIsRtl.d.ts +12 -0
  248. package/dist/types/hooks/useNavigator.d.ts +18 -1
  249. package/dist/types/hooks/useOverlayService.d.ts +28 -9
  250. package/dist/types/hooks/usePropToggle.d.ts +16 -5
  251. package/dist/types/hooks/useResize.d.ts +19 -1
  252. package/dist/types/hooks/useResizeObserver.d.ts +20 -1
  253. package/dist/types/hooks/useStepper.d.ts +14 -0
  254. package/dist/types/hooks/useStorage.d.ts +38 -0
  255. package/dist/types/index.d.ts +4 -1
  256. package/dist/types/overlays/alert/Alert.d.ts +16 -5
  257. package/dist/types/overlays/flyout/Flyout.d.ts +9 -4
  258. package/dist/types/overlays/message/Message.d.ts +16 -5
  259. package/dist/types/overlays/modal/Modal.d.ts +13 -4
  260. package/dist/types/overlays/toast/Toast.d.ts +16 -5
  261. package/dist/types/overlays/tooltip/Tooltip.d.ts +2 -2
  262. package/dist/types/types/index.d.ts +28 -24
  263. package/dist/types/typography/Abbr.d.ts +34 -4
  264. package/dist/types/typography/Anchor.d.ts +42 -0
  265. package/dist/types/typography/Copy.d.ts +15 -0
  266. package/dist/types/typography/Mark.d.ts +22 -4
  267. package/dist/types/typography/Text.d.ts +27 -1
  268. package/dist/types/typography/Title.d.ts +16 -1
  269. package/dist/types/typography/index.d.ts +1 -1
  270. package/dist/types/utils/cloneElement.d.ts +1 -0
  271. package/dist/types/utils/getColor.d.ts +1 -4
  272. package/dist/types/utils/index.d.ts +1 -0
  273. package/package.json +17 -16
  274. package/src/components/actionLabel/ActionLabel.tsx +26 -8
  275. package/src/components/animations/Animations.tsx +139 -52
  276. package/src/components/avatar/Avatar.tsx +51 -15
  277. package/src/components/avatar/AvatarGroup.tsx +23 -5
  278. package/src/components/badge/Badge.tsx +50 -22
  279. package/src/components/breadcrumbs/Breadcrumbs.tsx +43 -10
  280. package/src/components/button/Button.tsx +75 -43
  281. package/src/components/button/ButtonGroup.tsx +33 -7
  282. package/src/components/button/ConfirmButton.tsx +31 -3
  283. package/src/components/button/ToggleButtonGroup.tsx +74 -47
  284. package/src/components/callout/Callout.tsx +58 -16
  285. package/src/components/card/Card.tsx +84 -25
  286. package/src/components/card/CardCover.tsx +36 -6
  287. package/src/components/card/FlipContent.tsx +90 -0
  288. package/src/components/chip/Chip.tsx +53 -25
  289. package/src/components/collapsable/Collapsable.tsx +35 -11
  290. package/src/components/divider/Divider.tsx +42 -16
  291. package/src/components/dropdown/Dropdown.tsx +47 -12
  292. package/src/components/dropdown/DropdownTool.tsx +28 -4
  293. package/src/components/empty/EmptyContent.tsx +49 -8
  294. package/src/components/icon/Icon.tsx +96 -18
  295. package/src/components/index.ts +5 -4
  296. package/src/components/media/Media.tsx +193 -105
  297. package/src/components/menu/ContextMenu.tsx +19 -0
  298. package/src/components/menu/Menu.tsx +88 -32
  299. package/src/components/menu/MenuItem.tsx +44 -19
  300. package/src/components/menu/types.ts +9 -8
  301. package/src/components/meter/Meter.tsx +27 -4
  302. package/src/components/navigator/Navigator.tsx +60 -12
  303. package/src/components/panel/Panel.tsx +66 -28
  304. package/src/components/panel/PanelGroup.tsx +25 -2
  305. package/src/components/panel/PanelStack.tsx +33 -2
  306. package/src/components/progress/ProgressBar.tsx +33 -14
  307. package/src/components/progress/ProgressCircle.tsx +29 -13
  308. package/src/components/tabpanel/Tab.tsx +47 -24
  309. package/src/components/tabpanel/TabPanel.tsx +79 -13
  310. package/src/context/Global.tsx +28 -1
  311. package/src/context/NotificationCenter.tsx +3 -3
  312. package/src/core/aside/Aside.tsx +59 -38
  313. package/src/core/boundary/ErrorBoundary.tsx +26 -8
  314. package/src/core/boundary/ErrorIcon.tsx +1 -2
  315. package/src/core/content/Content.tsx +7 -3
  316. package/src/core/headfoot/HeadFoot.tsx +44 -37
  317. package/src/core/page/Page.tsx +44 -22
  318. package/src/core/responsive/Responsive.tsx +66 -8
  319. package/src/core/section/Section.tsx +26 -4
  320. package/src/core/theme/ThemeProvider.tsx +35 -14
  321. package/src/core/viewport/Viewport.tsx +16 -3
  322. package/src/hooks/useControlledValue.tsx +12 -0
  323. package/src/hooks/useDebounce.ts +13 -1
  324. package/src/hooks/useEffectDebugger.ts +50 -2
  325. package/src/hooks/useIsDark.ts +8 -0
  326. package/src/hooks/useIsRtl.ts +12 -0
  327. package/src/hooks/useNavigator.tsx +28 -5
  328. package/src/hooks/useOverlayService.tsx +33 -8
  329. package/src/hooks/usePropToggle.ts +16 -5
  330. package/src/hooks/useResize.ts +19 -1
  331. package/src/hooks/useResizeObserver.ts +32 -9
  332. package/src/hooks/useStepper.tsx +68 -0
  333. package/src/hooks/useStorage.ts +38 -0
  334. package/src/hotkeys/HotKeyLabel.tsx +1 -1
  335. package/src/hotkeys/HotKeyWrapper.tsx +3 -1
  336. package/src/index.ts +5 -1
  337. package/src/overlays/alert/Alert.tsx +51 -36
  338. package/src/overlays/flyout/Flyout.tsx +74 -99
  339. package/src/overlays/message/Message.tsx +28 -9
  340. package/src/overlays/modal/Modal.tsx +39 -34
  341. package/src/overlays/toast/Toast.tsx +44 -33
  342. package/src/overlays/tooltip/Tooltip.tsx +44 -20
  343. package/src/types/global.d.ts +8 -0
  344. package/src/types/index.ts +293 -47
  345. package/src/typography/Abbr.tsx +45 -11
  346. package/src/typography/{Link.tsx → Anchor.tsx} +26 -14
  347. package/src/typography/Copy.tsx +16 -2
  348. package/src/typography/Mark.tsx +25 -10
  349. package/src/typography/Text.tsx +31 -13
  350. package/src/typography/Title.tsx +18 -7
  351. package/src/typography/index.ts +1 -1
  352. package/src/{overlays/tooltip/Tooltip.module.css → utils/cloneElement.ts} +21 -27
  353. package/src/utils/getColor.ts +1 -17
  354. package/src/utils/index.ts +1 -0
  355. package/css/flags.rect.css +0 -1607
  356. package/css/flags.wavy.css +0 -1606
  357. package/css/index.js +0 -250
  358. package/css/tailwind/colors.ts +0 -158
  359. package/dist/cjs/components/actionLabel/ActionLabel.module.css +0 -1
  360. package/dist/cjs/components/animations/Animations.module.css +0 -1
  361. package/dist/cjs/components/avatar/Avatar.module.css +0 -1
  362. package/dist/cjs/components/badge/Badge.module.css +0 -1
  363. package/dist/cjs/components/breadcrumbs/Breadcrumbs.module.css +0 -1
  364. package/dist/cjs/components/button/Button.module.css +0 -1
  365. package/dist/cjs/components/card/Card.module.css +0 -1
  366. package/dist/cjs/components/chip/Chip.module.css +0 -1
  367. package/dist/cjs/components/collapsable/Collapsable.module.css +0 -1
  368. package/dist/cjs/components/dropdown/Dropdown.module.css +0 -1
  369. package/dist/cjs/components/icon/Icon.module.css +0 -1
  370. package/dist/cjs/components/media/Media.module.css +0 -1
  371. package/dist/cjs/components/menu/Menu.module.css +0 -1
  372. package/dist/cjs/components/meter/Meter.module.css +0 -1
  373. package/dist/cjs/components/panel/Panel.module.css +0 -1
  374. package/dist/cjs/components/progress/Progress.module.css +0 -1
  375. package/dist/cjs/components/tabpanel/TabPanel.module.css +0 -1
  376. package/dist/cjs/core/aside/Aside.module.css +0 -1
  377. package/dist/cjs/core/boundary/ErrorBoundary.module.css +0 -1
  378. package/dist/cjs/core/content/Content.module.css +0 -1
  379. package/dist/cjs/core/headfoot/HeadFoot.module.css +0 -1
  380. package/dist/cjs/core/page/Page.module.css +0 -1
  381. package/dist/cjs/core/responsive/Responsive.module.css +0 -1
  382. package/dist/cjs/core/section/Section.module.css +0 -1
  383. package/dist/cjs/core/theme/Theme.module.css +0 -1
  384. package/dist/cjs/core/viewport/Viewport.module.css +0 -1
  385. package/dist/cjs/overlays/alert/Alert.module.css +0 -1
  386. package/dist/cjs/overlays/flyout/Flyout.module.css +0 -1
  387. package/dist/cjs/overlays/message/Message.module.css +0 -1
  388. package/dist/cjs/overlays/modal/Modal.module.css +0 -1
  389. package/dist/cjs/overlays/toast/Toast.module.css +0 -1
  390. package/dist/cjs/overlays/tooltip/Tooltip.module.css +0 -1
  391. package/dist/cjs/types/icons.js +0 -199
  392. package/dist/cjs/typography/Typography.module.css +0 -1
  393. package/dist/esm/components/actionLabel/ActionLabel.module.css +0 -1
  394. package/dist/esm/components/animations/Animations.module.css +0 -1
  395. package/dist/esm/components/avatar/Avatar.module.css +0 -1
  396. package/dist/esm/components/badge/Badge.module.css +0 -1
  397. package/dist/esm/components/breadcrumbs/Breadcrumbs.module.css +0 -1
  398. package/dist/esm/components/button/Button.module.css +0 -1
  399. package/dist/esm/components/card/Card.module.css +0 -1
  400. package/dist/esm/components/chip/Chip.module.css +0 -1
  401. package/dist/esm/components/collapsable/Collapsable.module.css +0 -1
  402. package/dist/esm/components/dropdown/Dropdown.module.css +0 -1
  403. package/dist/esm/components/icon/Icon.module.css +0 -1
  404. package/dist/esm/components/media/Media.module.css +0 -1
  405. package/dist/esm/components/menu/Menu.module.css +0 -1
  406. package/dist/esm/components/meter/Meter.module.css +0 -1
  407. package/dist/esm/components/panel/Panel.module.css +0 -1
  408. package/dist/esm/components/progress/Progress.module.css +0 -1
  409. package/dist/esm/components/tabpanel/TabPanel.module.css +0 -1
  410. package/dist/esm/core/aside/Aside.module.css +0 -1
  411. package/dist/esm/core/boundary/ErrorBoundary.module.css +0 -1
  412. package/dist/esm/core/content/Content.module.css +0 -1
  413. package/dist/esm/core/headfoot/HeadFoot.module.css +0 -1
  414. package/dist/esm/core/page/Page.module.css +0 -1
  415. package/dist/esm/core/responsive/Responsive.module.css +0 -1
  416. package/dist/esm/core/section/Section.module.css +0 -1
  417. package/dist/esm/core/theme/Theme.module.css +0 -1
  418. package/dist/esm/core/viewport/Viewport.module.css +0 -1
  419. package/dist/esm/overlays/alert/Alert.module.css +0 -1
  420. package/dist/esm/overlays/flyout/Flyout.module.css +0 -1
  421. package/dist/esm/overlays/message/Message.module.css +0 -1
  422. package/dist/esm/overlays/modal/Modal.module.css +0 -1
  423. package/dist/esm/overlays/toast/Toast.module.css +0 -1
  424. package/dist/esm/overlays/tooltip/Tooltip.module.css +0 -1
  425. package/dist/esm/types/icons.js +0 -201
  426. package/dist/esm/typography/Typography.module.css +0 -1
  427. package/dist/types/types/icons.d.ts +0 -196
  428. package/dist/types/typography/Link.d.ts +0 -25
  429. package/src/types/icons.ts +0 -425
@@ -1,3 +1,22 @@
1
1
  import { type RefObject } from "react";
2
2
  import { type SizeObject } from "../types";
3
- export declare const useResizeObserver: <T extends HTMLElement = HTMLDivElement>(onResize?: (size: SizeObject) => void) => RefObject<T>;
3
+ /**
4
+ * Custom hook to observe size changes of an element using ResizeObserver.
5
+ * It returns a ref that can be attached to the element you want to observe.
6
+ * The hook will call the provided `onResize` callback with the new size of the element
7
+ * whenever it changes.
8
+ * * This is useful for responsive designs where you need to adjust the layout or styles
9
+ * based on the size of an element.
10
+ *
11
+ * @param onResize Callback function that receives the new size of the element.
12
+ * @returns A ref object to be attached to the element you want to observe.
13
+ *
14
+ * @example
15
+ * ```jsx
16
+ * const ref = useResizeObserver((size) => {
17
+ * console.log("Element resized:", size);
18
+ * });
19
+ * <div ref={ref}>Resize me!</div>
20
+ * ```
21
+ */
22
+ export declare const useResizeObserver: <T extends HTMLElement = HTMLDivElement>(onResize?: (size: SizeObject) => void) => RefObject<T | null>;
@@ -0,0 +1,14 @@
1
+ export declare const useStepper: ({ steps, activeStep: _initialActiveStep, }: {
2
+ steps: Array<{
3
+ label?: React.ReactNode;
4
+ icon?: React.ReactNode;
5
+ }>;
6
+ activeStep?: number;
7
+ }) => {
8
+ stepper: import("react/jsx-runtime").JSX.Element;
9
+ activeStep: number;
10
+ firstStep: boolean;
11
+ lastStep: boolean;
12
+ next: () => void;
13
+ prev: () => void;
14
+ };
@@ -1,2 +1,40 @@
1
+ /**
2
+ * Custom hook to manage local storage state.
3
+ * This hook allows you to store and retrieve values from the browser's local storage,
4
+ * and provides a way to update the stored value while keeping the state in sync with local storage.
5
+ * It initializes the state with the value from local storage if it exists, or uses a default value if it does not.
6
+ * The hook returns a tuple containing the current value and a function to update the value.
7
+ * This is useful for persisting user preferences or application state across page reloads.
8
+ *
9
+ * @param key - The key under which the value is stored in local storage.
10
+ * @param defaultValue - The default value to use if the key does not exist in local storage.
11
+ * @returns A tuple containing the current value and a function to update the value.
12
+ *
13
+ * @example
14
+ * ```jsx
15
+ * const [settings, setSettings] = useLocalStorage("userSettings", { theme: "light" });
16
+ * // This will initialize the settings state from local storage or use the default value.
17
+ * ```
18
+ */
1
19
  export declare const useLocalStorage: <T>(key: string, defaultValue: T) => [T, (value: T) => void];
20
+ /**
21
+ * Custom hook to manage session storage state.
22
+ * This hook allows you to store and retrieve values from the browser's session storage,
23
+ * and provides a way to update the stored value while keeping the state in sync with session storage.
24
+ * It initializes the state with the value from session storage if it exists, or uses a default value if it does not.
25
+ * The hook returns a tuple containing the current value and a function to update the value.
26
+ * This is useful for persisting user preferences or application state during a single session,
27
+ * such as form data or temporary settings that should not persist across page reloads.
28
+ * This hook is similar to `useLocalStorage`, but it uses session storage instead of local storage.
29
+ *
30
+ * @param key - The key under which the value is stored in session storage.
31
+ * @param defaultValue - The default value to use if the key does not exist in session storage.
32
+ * @returns A tuple containing the current value and a function to update the value.
33
+ *
34
+ * @example
35
+ * ```jsx
36
+ * const [user, setUser] = useSessionStorage("user", { name: "", age: 0 });
37
+ * // This will initialize the user state from session storage or use the default value.
38
+ * ```
39
+ */
2
40
  export declare const useSessionStorage: <T>(key: string, defaultValue: T) => [T, (value: T) => void];
@@ -12,8 +12,11 @@ export * from "./hooks/useNavigator";
12
12
  export * from "./hooks/useOverlayService";
13
13
  export * from "./hooks/useResize";
14
14
  export * from "./hooks/useResizeObserver";
15
+ export * from "./hooks/useStepper";
15
16
  export * from "./hooks/useStorage";
16
17
  export { HotKey } from "./hotkeys/HotKey";
17
18
  export { HotKeyLabel } from "./hotkeys/HotKeyLabel";
18
- export { CoreIcons } from "./types/icons";
19
+ export { HotKeyWrapper } from "./hotkeys/HotKeyWrapper";
20
+ export { type ModalProps } from "./types";
21
+ export { cloneChildren } from "./utils";
19
22
  export { ApplicationProvider, useApplicationContext, useGlobals, useNotificationService, } from "./context/Global";
@@ -1,10 +1,21 @@
1
- /// <reference types="react" />
2
- import { type ColorType, type Elements, type IconProps } from "../../types";
3
- export interface AlertProps extends Omit<IconProps, "iconBg" | "iconColor"> {
1
+ import { type ColorState, type Elements } from "../../types";
2
+ export interface AlertProps {
4
3
  /**
5
4
  * toast type
6
5
  */
7
6
  type?: "alert" | "confirm" | "prompt";
7
+ /**
8
+ * svg path / webfont className / 1-4 letter text
9
+ */
10
+ icon?: string;
11
+ /**
12
+ * icon image source URL, if failed to load then shows icon
13
+ */
14
+ iconSrc?: string;
15
+ /**
16
+ * flip icon in rtl
17
+ */
18
+ rtlFlip?: boolean;
8
19
  /**
9
20
  * toast title
10
21
  */
@@ -16,7 +27,7 @@ export interface AlertProps extends Omit<IconProps, "iconBg" | "iconColor"> {
16
27
  /**
17
28
  * theme color
18
29
  */
19
- color?: ColorType;
30
+ color?: ColorState;
20
31
  /**
21
32
  * extra action button
22
33
  */
@@ -38,4 +49,4 @@ export interface AlertProps extends Omit<IconProps, "iconBg" | "iconColor"> {
38
49
  */
39
50
  defaultValue?: string;
40
51
  }
41
- export declare const Alert: ({ title, message, color, icon, rtlFlip, actions, onClose, type, okLabel, cancelLabel, placeholder, defaultValue, }: AlertProps) => import("react/jsx-runtime").JSX.Element;
52
+ export declare const Alert: ({ title, message, color, icon, iconSrc, rtlFlip, actions, onClose, type, okLabel, cancelLabel, placeholder, defaultValue, }: AlertProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
- /// <reference types="react" />
2
- import { type AriaProps, type CallbackReturn, type ChildrenProp, type Elements, type IconProps, type TestProps } from "../../types";
3
- export interface FlyoutProps extends AriaProps, TestProps, IconProps, ChildrenProp {
1
+ import { type IconProps } from "../../components/icon/Icon";
2
+ import { type AriaProps, type CallbackReturn, type ChildrenProp, type Elements, type TestProps } from "../../types";
3
+ export interface FlyoutProps extends AriaProps, TestProps, ChildrenProp {
4
+ icon?: IconProps;
4
5
  /**
5
6
  * flyout alignment
6
7
  */
@@ -37,6 +38,10 @@ export interface FlyoutProps extends AriaProps, TestProps, IconProps, ChildrenPr
37
38
  * minimum width
38
39
  */
39
40
  minWidth?: string | number;
41
+ /**
42
+ * portal root element
43
+ */
44
+ root?: HTMLElement;
40
45
  /**
41
46
  * hide backdrop mask
42
47
  */
@@ -54,4 +59,4 @@ export interface FlyoutProps extends AriaProps, TestProps, IconProps, ChildrenPr
54
59
  */
55
60
  onBeforeClose?: (...args: AnyObject) => CallbackReturn;
56
61
  }
57
- export declare const Flyout: ({ icon, iconBg, iconColor, iconClassName, rtlFlip, title, actions, closeOnClick, headerClassName, onClose, onBeforeClose, children, loading, size, width, minWidth, hideMask, align, ...aria }: FlyoutProps) => import("react/jsx-runtime").JSX.Element;
62
+ export declare const Flyout: ({ icon, iconClassName, title, actions, closeOnClick, headerClassName, onClose, onBeforeClose, children, loading, size, width, minWidth, root, hideMask, align, ...aria }: FlyoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,17 @@
1
- /// <reference types="react" />
2
- import { type ColorType, type Elements, type IconProps } from "../../types";
3
- export interface MessageProps extends Omit<IconProps, "iconBg" | "iconColor"> {
1
+ import { type ColorState, type Elements } from "../../types";
2
+ export interface MessageProps {
3
+ /**
4
+ * svg path / webfont className / 1-4 letter text
5
+ */
6
+ icon: string;
7
+ /**
8
+ * icon image source URL, if failed to load then shows icon
9
+ */
10
+ iconSrc?: string;
11
+ /**
12
+ * flip icon in rtl
13
+ */
14
+ rtlFlip?: boolean;
4
15
  /**
5
16
  * message title
6
17
  */
@@ -12,10 +23,10 @@ export interface MessageProps extends Omit<IconProps, "iconBg" | "iconColor"> {
12
23
  /**
13
24
  * theme color
14
25
  */
15
- color?: ColorType;
26
+ color?: ColorState;
16
27
  /**
17
28
  * extra action button
18
29
  */
19
30
  actions?: Elements<JSX.Element>;
20
31
  }
21
- export declare const Message: ({ title, message, color, icon, rtlFlip, actions, onClose, }: MessageProps) => import("react/jsx-runtime").JSX.Element;
32
+ export declare const Message: ({ title, message, color, icon, iconSrc, rtlFlip, actions, onClose, }: MessageProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
- /// <reference types="react" />
2
- import { type AriaProps, type CallbackReturn, type ChildrenProp, type Elements, type IconProps, type TestProps } from "../../types";
3
- export interface ModalProps extends AriaProps, TestProps, IconProps, ChildrenProp {
1
+ import { type IconProps } from "../../components/icon/Icon";
2
+ import { type AriaProps, type CallbackReturn, type ChildrenProp, type Elements, type TestProps } from "../../types";
3
+ export interface ModalProps extends AriaProps, TestProps, ChildrenProp {
4
+ icon?: IconProps;
4
5
  /**
5
6
  * header className
6
7
  */
@@ -41,6 +42,14 @@ export interface ModalProps extends AriaProps, TestProps, IconProps, ChildrenPro
41
42
  * minimum width
42
43
  */
43
44
  minWidth?: string | number;
45
+ /**
46
+ * portal root element
47
+ */
48
+ root?: HTMLElement;
49
+ /**
50
+ * hide mask background
51
+ */
52
+ hideMask?: boolean;
44
53
  /**
45
54
  * close handler
46
55
  */
@@ -50,4 +59,4 @@ export interface ModalProps extends AriaProps, TestProps, IconProps, ChildrenPro
50
59
  */
51
60
  onBeforeClose?: (...args: AnyObject) => CallbackReturn;
52
61
  }
53
- export declare const Modal: ({ icon, iconBg, iconColor, iconClassName, rtlFlip, title, actions, headerClassName, onClose, onBeforeClose, children, loading, size, width, height, minHeight, minWidth, ...aria }: ModalProps) => import("react/jsx-runtime").JSX.Element;
62
+ export declare const Modal: ({ icon, iconClassName, title, actions, headerClassName, onClose, onBeforeClose, children, loading, root, size, hideMask, width, height, minHeight, minWidth, ...aria }: ModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,21 @@
1
- /// <reference types="react" />
2
- import { type ColorType, type Elements, type IconProps } from "../../types";
3
- export interface ToastProps extends Omit<IconProps, "iconBg" | "iconColor"> {
1
+ import { type ColorState, type Elements } from "../../types";
2
+ export interface ToastProps {
4
3
  /**
5
4
  * toast type
6
5
  */
7
6
  type?: "alert" | "confirm";
7
+ /**
8
+ * svg path / webfont className / 1-4 letter text
9
+ */
10
+ icon?: string;
11
+ /**
12
+ * icon image source URL, if failed to load then shows icon
13
+ */
14
+ iconSrc?: string;
15
+ /**
16
+ * flip icon in rtl
17
+ */
18
+ rtlFlip?: boolean;
8
19
  /**
9
20
  * toast title
10
21
  */
@@ -16,7 +27,7 @@ export interface ToastProps extends Omit<IconProps, "iconBg" | "iconColor"> {
16
27
  /**
17
28
  * theme color
18
29
  */
19
- color?: ColorType;
30
+ color?: ColorState;
20
31
  /**
21
32
  * extra action button
22
33
  */
@@ -30,4 +41,4 @@ export interface ToastProps extends Omit<IconProps, "iconBg" | "iconColor"> {
30
41
  */
31
42
  cancelLabel?: string;
32
43
  }
33
- export declare const Toast: ({ title, message, color, icon, rtlFlip, actions, onClose, onCloseAll, type, okLabel, cancelLabel, }: ToastProps) => import("react/jsx-runtime").JSX.Element;
44
+ export declare const Toast: ({ title, message, color, icon, iconSrc, rtlFlip, actions, onClose, onCloseAll, type, okLabel, cancelLabel, }: ToastProps) => import("react/jsx-runtime").JSX.Element;
@@ -10,9 +10,9 @@ export interface TooltipProps extends TooltipType, RefProp {
10
10
  */
11
11
  copyContent?: boolean | string;
12
12
  disabled?: boolean;
13
- children: ReactElement;
13
+ children: ReactElement<KeyValue>;
14
14
  }
15
15
  export declare const getTooltipProps: (tooltip?: string | TooltipType, innerRef?: AnyObject) => (TooltipType & {
16
16
  ref: AnyObject;
17
17
  }) | undefined;
18
- export declare const Tooltip: ({ ref, children, color, content, open, copyContent, disabled, placement: _placement, ...rest }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const Tooltip: ({ ref, children, color, textColor, content, open, copyContent, disabled, placement: _placement, ...rest }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,13 @@
1
1
  import { type Placement } from "@floating-ui/react";
2
2
  import { type JSXElementConstructor, type Ref } from "react";
3
+ export type ModalProps<P = unknown> = P & {
4
+ onClose: (...args: AnyObject) => void;
5
+ };
3
6
  export type SizeType = "xs" | "sm" | "md" | "lg" | "xl";
4
7
  export type SizeTypeWithZero = "xs" | "sm" | "md" | "lg" | "xl" | 0;
5
- export type ColorType = "primary" | "accent" | "info" | "danger" | "success" | "warning";
6
- export type PaletteType = "scarlet" | "pumpkin" | "marigold" | "avacado" | "jade" | "denim" | "iris" | "lilac" | "coral" | "wood" | "silver" | "steel" | "olive" | "sand";
8
+ export type ColorState = "default" | "primary" | "accent" | "muted" | "info" | "danger" | "success" | "warning";
9
+ export type ColorType = "primary-50" | "primary-100" | "primary-200" | "primary-300" | "primary-400" | "primary-500" | "primary-600" | "primary-700" | "primary-800" | "primary-900" | "primary-950" | "accent-50" | "accent-100" | "accent-200" | "accent-300" | "accent-400" | "accent-500" | "accent-600" | "accent-700" | "accent-800" | "accent-900" | "accent-950" | "info-50" | "info-100" | "info-200" | "info-300" | "info-400" | "info-500" | "info-600" | "info-700" | "info-800" | "info-900" | "info-950" | "danger-50" | "danger-100" | "danger-200" | "danger-300" | "danger-400" | "danger-500" | "danger-600" | "danger-700" | "danger-800" | "danger-900" | "danger-950" | "success-50" | "success-100" | "success-200" | "success-300" | "success-400" | "success-500" | "success-600" | "success-700" | "success-800" | "success-900" | "success-950" | "warning-50" | "warning-100" | "warning-200" | "warning-300" | "warning-400" | "warning-500" | "warning-600" | "warning-700" | "warning-800" | "warning-900" | "warning-950";
10
+ export type PaletteType = "scarlet-50" | "scarlet-100" | "scarlet-200" | "scarlet-300" | "scarlet-400" | "scarlet-500" | "scarlet-600" | "scarlet-700" | "scarlet-800" | "scarlet-900" | "scarlet-950" | "pumpkin-50" | "pumpkin-100" | "pumpkin-200" | "pumpkin-300" | "pumpkin-400" | "pumpkin-500" | "pumpkin-600" | "pumpkin-700" | "pumpkin-800" | "pumpkin-900" | "pumpkin-950" | "marigold-50" | "marigold-100" | "marigold-200" | "marigold-300" | "marigold-400" | "marigold-500" | "marigold-600" | "marigold-700" | "marigold-800" | "marigold-900" | "marigold-950" | "avacado-50" | "avacado-100" | "avacado-200" | "avacado-300" | "avacado-400" | "avacado-500" | "avacado-600" | "avacado-700" | "avacado-800" | "avacado-900" | "avacado-950" | "jade-50" | "jade-100" | "jade-200" | "jade-300" | "jade-400" | "jade-500" | "jade-600" | "jade-700" | "jade-800" | "jade-900" | "jade-950" | "denim-50" | "denim-100" | "denim-200" | "denim-300" | "denim-400" | "denim-500" | "denim-600" | "denim-700" | "denim-800" | "denim-900" | "denim-950" | "iris-50" | "iris-100" | "iris-200" | "iris-300" | "iris-400" | "iris-500" | "iris-600" | "iris-700" | "iris-800" | "iris-900" | "iris-950" | "lilac-50" | "lilac-100" | "lilac-200" | "lilac-300" | "lilac-400" | "lilac-500" | "lilac-600" | "lilac-700" | "lilac-800" | "lilac-900" | "lilac-950" | "coral-50" | "coral-100" | "coral-200" | "coral-300" | "coral-400" | "coral-500" | "coral-600" | "coral-700" | "coral-800" | "coral-900" | "coral-950" | "wood-50" | "wood-100" | "wood-200" | "wood-300" | "wood-400" | "wood-500" | "wood-600" | "wood-700" | "wood-800" | "wood-900" | "wood-950" | "silver-50" | "silver-100" | "silver-200" | "silver-300" | "silver-400" | "silver-500" | "silver-600" | "silver-700" | "silver-800" | "silver-900" | "silver-950" | "steel-50" | "steel-100" | "steel-200" | "steel-300" | "steel-400" | "steel-500" | "steel-600" | "steel-700" | "steel-800" | "steel-900" | "steel-950" | "olive-50" | "olive-100" | "olive-200" | "olive-300" | "olive-400" | "olive-500" | "olive-600" | "olive-700" | "olive-800" | "olive-900" | "olive-950" | "sand-50" | "sand-100" | "sand-200" | "sand-300" | "sand-400" | "sand-500" | "sand-600" | "sand-700" | "sand-800" | "sand-900" | "sand-950" | "tint-50" | "tint-100" | "tint-200" | "tint-300" | "tint-400" | "tint-500" | "tint-600" | "tint-700" | "tint-800" | "tint-900" | "tint-950";
7
11
  export type ColorWithGrays = ColorType | "invert" | "dimmed" | "muted";
8
12
  export declare const ThemeColors: string[];
9
13
  export interface TooltipType {
@@ -14,7 +18,11 @@ export interface TooltipType {
14
18
  /**
15
19
  * tooltip color
16
20
  */
17
- color?: ColorType;
21
+ color?: ColorType | PaletteType | string;
22
+ /**
23
+ * text color
24
+ */
25
+ textColor?: ColorType | PaletteType | string;
18
26
  /**
19
27
  * tooltip placement
20
28
  */
@@ -43,6 +51,10 @@ export interface CssProp {
43
51
  * css classname(s)
44
52
  */
45
53
  className?: string;
54
+ /**
55
+ * direction
56
+ */
57
+ dir?: "ltr" | "rtl";
46
58
  }
47
59
  export interface TestProps {
48
60
  /**
@@ -54,7 +66,7 @@ export interface TestProps {
54
66
  */
55
67
  "data-test-value"?: AnyObject;
56
68
  }
57
- export type Elements<T> = React.ReactElement<T> | React.ReactPortal | React.ReactNode | string | number | boolean | null | undefined;
69
+ export type Elements<T> = React.ReactElement<T> | React.ReactNode;
58
70
  export type AriaProps = React.AriaAttributes;
59
71
  /**
60
72
  * For wrapping components
@@ -72,24 +84,6 @@ export type PolymorphicProps<AsTag extends ReactTag> = Omit<PropsOf<AsTag>, "chi
72
84
  */
73
85
  as?: AsTag;
74
86
  };
75
- export interface IconProps {
76
- /**
77
- * svg path / image url
78
- */
79
- icon?: string;
80
- /**
81
- * flip icon in rtl
82
- */
83
- rtlFlip?: boolean;
84
- /**
85
- * icon background color
86
- */
87
- iconBg?: ColorType | string;
88
- /**
89
- * icon color
90
- */
91
- iconColor?: ColorType | string;
92
- }
93
87
  export interface CollapseProps {
94
88
  /**
95
89
  * Allow collapsing
@@ -124,10 +118,11 @@ export interface TooltipProp {
124
118
  */
125
119
  tooltip?: string | TooltipType;
126
120
  }
127
- export interface ChildProp<T = JSX.Element> {
121
+ export type ReactElement = React.ReactElement | string | number | bigint | Iterable<React.ReactNode> | React.ReactPortal | boolean | null | undefined;
122
+ export interface ChildProp<T = ReactElement> {
128
123
  children: Elements<T>;
129
124
  }
130
- export interface ChildrenProp<T = JSX.Element> {
125
+ export interface ChildrenProp<T = ReactElement> {
131
126
  children: Elements<T> | Array<Elements<T>>;
132
127
  }
133
128
  export interface PositionObject {
@@ -142,3 +137,12 @@ export interface ScrollObject extends PositionObject, SizeObject {
142
137
  scrollWidth?: number;
143
138
  scrollHeight: number;
144
139
  }
140
+ export type ArrayType<T extends readonly any[] | ArrayLike<any> | undefined> = T extends readonly any[] ? T[number] : T extends ArrayLike<any> ? T[number] : undefined;
141
+ export type Complete<T> = {
142
+ [P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : T[P] | undefined;
143
+ };
144
+ export type NestedKeys<T> = T extends object ? {
145
+ [K in keyof T]: K extends string | number ? T[K] extends object ? T[K] extends readonly any[] ? T[K][number] extends object ? // Array of objects/items: return key with array index notation and recurse
146
+ `${K}.${NestedKeys<T[K][number]>}` | `${K}` : `${K}` : // Standard object: return key with dot notation and recurse
147
+ `${K}.${NestedKeys<T[K]>}` | `${K}` : `${K}` : never;
148
+ }[keyof T] : "";
@@ -1,5 +1,4 @@
1
- /// <reference types="react" />
2
- import { type ChildProp, type ColorType, type CssProp } from "../types";
1
+ import { type ChildProp, type ColorType, type CssProp, type PaletteType } from "../types";
3
2
  export interface AbbrProps extends ChildProp<string>, CssProp {
4
3
  /**
5
4
  * content to copy using the tooltip copy action
@@ -10,13 +9,44 @@ export interface AbbrProps extends ChildProp<string>, CssProp {
10
9
  *
11
10
  * [textPart, tooltip, color (class name or color string)]
12
11
  */
13
- abbr: Array<[textPart: string, tooltip: string, color?: ColorType | string]>;
12
+ abbr: Array<[
13
+ textPart: string,
14
+ tooltip: string,
15
+ color?: ColorType | PaletteType | string
16
+ ]>;
14
17
  /**
15
18
  * renderer callback
16
19
  */
17
20
  renderer?: (part: string[]) => JSX.Element;
18
21
  }
19
22
  /**
20
- * Typography abbr component to wrap text parts in `abbr` with tooltip
23
+ * A component that renders abbreviated text with tooltips for additional information.
24
+ * It allows you to define a list of abbreviations, each with a tooltip and optional color.
25
+ * The component will tokenize the children text and replace matching parts with the abbreviated version.
26
+ * It supports a copy action that can either copy the text or the tooltip content.
27
+ * This component is useful for displaying technical terms or acronyms in a user-friendly way,
28
+ * while providing additional context through tooltips.
29
+ *
30
+ * @param {AbbrProps} props - The properties for the Abbr component.
31
+ * @returns {JSX.Element} The rendered Abbr component.
32
+ *
33
+ * @example
34
+ * ```jsx
35
+ * <Abbr
36
+ * abbr={[
37
+ * ["HTML", "HyperText Markup Language", "primary"],
38
+ * ["CSS", "Cascading Style Sheets", "secondary"],
39
+ * ["JS", "JavaScript", "success"],
40
+ * ]}
41
+ * className="text-sm"
42
+ * copyContent="tooltip"
43
+ * >
44
+ * Learn more about HTML, CSS, and JS.
45
+ * </Abbr>
46
+ * // Renders the text with abbreviations for HTML, CSS, and JS,
47
+ * // each with a tooltip showing the full form and colored according to the specified color.
48
+ * ```
49
+ *
50
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-typography--abbr} for more details.
21
51
  */
22
52
  export declare const Abbr: ({ children, abbr, className, renderer, copyContent, }: AbbrProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { type MouseEventHandler } from "react";
2
+ import { type AriaProps, type ChildrenProp, type ColorType, type CssProp, type PaletteType, type PolymorphicProps, type RefProp, type SizeType } from "../types";
3
+ export interface AnchorProps extends ChildrenProp, CssProp, RefProp, AriaProps {
4
+ /**
5
+ * link background (CSS color / tailwind color)
6
+ */
7
+ bg?: ColorType | PaletteType | string;
8
+ /**
9
+ * link color (CSS color / tailwind color)
10
+ */
11
+ color?: ColorType | PaletteType | string;
12
+ /**
13
+ * link size
14
+ */
15
+ size?: SizeType | number | string;
16
+ /**
17
+ * font family
18
+ */
19
+ family?: "sans" | "serif" | "mono";
20
+ onClick?: MouseEventHandler;
21
+ }
22
+ /**
23
+ * A versatile link component that supports polymorphic rendering, allowing it to be used as an anchor (`<a>`), button, or any other HTML element.
24
+ * It can be styled with background color, text color, font size, and font family.
25
+ * It accepts various properties such as `bg`, `color`, `size`, and `family` to customize its appearance.
26
+ * This component is useful for creating links that need to be styled consistently across an application, while also providing flexibility in terms of the HTML element used.
27
+ *
28
+ * @param {AnchorProps} props - The properties for the Anchor component.
29
+ * @param {Tag} as - The HTML element type to render as (default is "a").
30
+ * @returns {JSX.Element} - A styled anchor element with the specified properties.
31
+ *
32
+ * @example
33
+ * ```jsx
34
+ * <Anchor href="https://example.com" bg="blue-500" color="white" size="md">
35
+ * Click here
36
+ * </Anchor>
37
+ * // Renders a link with a blue background, white text, and medium font size.
38
+ * ```
39
+ *
40
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-typography--anchor} for more details.
41
+ */
42
+ export declare const Anchor: <Tag extends React.ElementType = "a">({ ref, as, children, className, bg, color, family, size, ...aria }: AnchorProps & PolymorphicProps<Tag>) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,19 @@
1
1
  import { type CssProp, type SizeType } from "../types";
2
+ /**
3
+ * A component that provides a button to copy text to the clipboard.
4
+ * It uses the Clipboard API to write the specified text to the clipboard.
5
+ * The button displays a tooltip feedback when the text is successfully copied.
6
+ *
7
+ * @param {CopyProps} props - The properties for the Copy component.
8
+ * @returns {JSX.Element} The rendered Copy component.
9
+ *
10
+ * @example
11
+ * ```jsx
12
+ * <Copy text="Text to copy" size="small" />
13
+ * ```
14
+ *
15
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-typography--copy} for more details.
16
+ */
2
17
  export interface CopyProps extends CssProp {
3
18
  text: string;
4
19
  /**
@@ -1,18 +1,36 @@
1
- /// <reference types="react" />
2
- import { type ChildProp, type ColorType } from "../types";
1
+ import { type ChildProp, type ColorType, type PaletteType } from "../types";
3
2
  export interface MarkProps extends ChildProp<string> {
4
3
  /**
5
4
  * texts to match and abbreviate within
6
5
  *
7
6
  * [textPart, color (class name or color string)]
8
7
  */
9
- mark: Array<[textPart: string, color?: ColorType | string]>;
8
+ mark: Array<[textPart: string, color?: ColorType | PaletteType | string]>;
10
9
  /**
11
10
  * renderer callback
12
11
  */
13
12
  renderer?: (part: string[]) => JSX.Element;
14
13
  }
15
14
  /**
16
- * Typography mark component to wrap text parts in `mark`
15
+ * A component that highlights specific text parts with a mark element, allowing for custom rendering and color.
16
+ * It tokenizes the children string based on the provided `mark` array,
17
+ * which contains pairs of text parts and their corresponding colors.
18
+ * The component can use a custom renderer to display the marked text,
19
+ * allowing for greater flexibility in how the text is presented.
20
+ *
21
+ * @param {MarkProps} props - The properties for the Mark component.
22
+ * @returns {JSX.Element} The rendered Mark component.
23
+ *
24
+ * @example
25
+ * <Mark
26
+ * mark={[
27
+ * ["important", "red"],
28
+ * ["note", "blue"],
29
+ * ]}
30
+ * >
31
+ * This is an important note that should be highlighted.
32
+ * </Mark>
33
+ *
34
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-typography--mark} for more details.
17
35
  */
18
36
  export declare const Mark: ({ children, mark, renderer }: MarkProps) => import("react/jsx-runtime").JSX.Element;
@@ -30,6 +30,32 @@ export interface TextProps extends ChildrenProp, CssProp, AriaProps, TestProps {
30
30
  clamp?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
31
31
  }
32
32
  /**
33
- * Typography text component
33
+ * A component that renders text with various styles, supports line clamping, and provides a "show more" link if the text is clipped.
34
+ * It can be rendered as an inline element or a block element, and allows customization of background color, text color, font size, font family, and text alignment.
35
+ * It also supports line clamping to limit the number of visible lines, and provides a toggle to show more or less text when the content exceeds the specified clamp.
36
+ * The component uses a combination of CSS and JavaScript to achieve the desired effects, ensuring a smooth user experience.
37
+ * It leverages the ResizeObserver API to detect changes in the text container's size and adjust the line clamping accordingly.
38
+ *
39
+ * @param {TextProps} props - The properties for the Text component.
40
+ * @returns {JSX.Element} The rendered Text component.
41
+ *
42
+ * @example
43
+ * ```jsx
44
+ * <Text
45
+ * inline={false}
46
+ * bg="bg-gray-100"
47
+ * color="text-gray-800"
48
+ * size="md"
49
+ * family="sans"
50
+ * clamp={2}
51
+ * align="start"
52
+ * >
53
+ * This is a sample text that demonstrates the Text component with various styles applied.
54
+ * </Text>
55
+ * // Renders a block-level text with gray background, dark gray text, medium font size,
56
+ * // sans-serif font family, clamped to 2 lines, and left-aligned.
57
+ * ```
58
+ *
59
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-typography--text} for more details.
34
60
  */
35
61
  export declare const Text: ({ children, className, inline, bg, color, family, size, clamp, align, ...aria }: TextProps) => import("react/jsx-runtime").JSX.Element;
@@ -24,6 +24,21 @@ export interface TitleProps extends ChildrenProp, CssProp, AriaProps {
24
24
  align?: "start" | "end" | "center" | "justify";
25
25
  }
26
26
  /**
27
- * Typography title component
27
+ * A component that renders a title with customizable styles such as background color, text color, size, alignment, and font family.
28
+ * It can be rendered as different HTML elements based on the `as` prop.
29
+ * This component is useful for creating headings or titles in a consistent style across an application.
30
+ *
31
+ * @param {TitleProps} props - The properties for the Title component.
32
+ * @returns {JSX.Element} The rendered Title component.
33
+ *
34
+ * @example
35
+ * ```jsx
36
+ * <Title as="h1" bg="blue-500" color="white" size="2xl" align="center">
37
+ * This is a Title
38
+ * </Title>
39
+ * // Renders a title as an h1 element with a blue background, white text color, size of 2xl, and centered alignment.
40
+ * ```
41
+ *
42
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-typography--title} for more details.
28
43
  */
29
44
  export declare const Title: ({ children, className, as, bg, color, size, align, family, ...aria }: TitleProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  export { Abbr } from "./Abbr";
2
+ export { Anchor } from "./Anchor";
2
3
  export { Copy } from "./Copy";
3
- export { Link } from "./Link";
4
4
  export { Mark } from "./Mark";
5
5
  export { Text } from "./Text";
6
6
  export { Title } from "./Title";
@@ -0,0 +1 @@
1
+ export declare const cloneChildren: (children: React.ReactNode, callback: (child: React.ReactNode, index: number) => React.ReactNode) => React.ReactNode;
@@ -1,4 +1 @@
1
- export declare const getColor: (color: string) => string | undefined;
2
- export declare const getBgClass: (bg: string) => string | undefined;
3
- export declare const getColorClass: (color: string) => string | undefined;
4
- export declare const getBorderClass: (color: string) => string | undefined;
1
+ export declare const getColor: (color: string) => string;
@@ -1,3 +1,4 @@
1
1
  export * from "./calculateDimensions";
2
+ export * from "./cloneElement";
2
3
  export * from "./getColor";
3
4
  export * from "./nodeCheck";