@react-fabric/core 1.0.0-beta.51 → 1.0.0-beta.53

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 (248) hide show
  1. package/css/components/_breadcrumbs.css +3 -3
  2. package/css/components/_menu.css +2 -0
  3. package/css/components/_modal.css +2 -2
  4. package/css/core/_aside.css +2 -2
  5. package/css/theme/_utilities.css +2 -2
  6. package/dist/cjs/components/actionLabel/ActionLabel.js +23 -5
  7. package/dist/cjs/components/animations/Animations.js +92 -9
  8. package/dist/cjs/components/avatar/Avatar.js +33 -3
  9. package/dist/cjs/components/avatar/AvatarGroup.js +19 -1
  10. package/dist/cjs/components/badge/Badge.js +31 -2
  11. package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +30 -1
  12. package/dist/cjs/components/button/Button.js +25 -2
  13. package/dist/cjs/components/button/ButtonGroup.js +26 -0
  14. package/dist/cjs/components/button/ConfirmButton.js +22 -1
  15. package/dist/cjs/components/button/ToggleButtonGroup.js +38 -12
  16. package/dist/cjs/components/callout/Callout.js +28 -0
  17. package/dist/cjs/components/card/Card.js +34 -0
  18. package/dist/cjs/components/card/CardCover.js +26 -0
  19. package/dist/cjs/components/card/FlipContent.js +21 -0
  20. package/dist/cjs/components/chip/Chip.js +22 -1
  21. package/dist/cjs/components/collapsable/Collapsable.js +26 -0
  22. package/dist/cjs/components/divider/Divider.js +19 -0
  23. package/dist/cjs/components/dropdown/Dropdown.js +42 -0
  24. package/dist/cjs/components/empty/EmptyContent.js +27 -0
  25. package/dist/cjs/components/icon/Icon.js +27 -1
  26. package/dist/cjs/components/media/Media.js +56 -0
  27. package/dist/cjs/components/menu/ContextMenu.js +19 -0
  28. package/dist/cjs/components/menu/Menu.js +30 -0
  29. package/dist/cjs/components/menu/MenuItem.js +22 -1
  30. package/dist/cjs/components/meter/Meter.js +24 -0
  31. package/dist/cjs/components/navigator/Navigator.js +22 -0
  32. package/dist/cjs/components/panel/Panel.js +37 -0
  33. package/dist/cjs/components/panel/PanelGroup.js +24 -0
  34. package/dist/cjs/components/panel/PanelStack.js +31 -0
  35. package/dist/cjs/components/progress/ProgressBar.js +21 -0
  36. package/dist/cjs/components/progress/ProgressCircle.js +20 -0
  37. package/dist/cjs/components/tabpanel/Tab.js +31 -0
  38. package/dist/cjs/components/tabpanel/TabPanel.js +33 -0
  39. package/dist/cjs/context/Global.js +25 -1
  40. package/dist/cjs/core/aside/Aside.js +39 -2
  41. package/dist/cjs/core/boundary/ErrorBoundary.js +17 -1
  42. package/dist/cjs/core/content/Content.js +6 -1
  43. package/dist/cjs/core/headfoot/HeadFoot.js +42 -0
  44. package/dist/cjs/core/page/Page.js +26 -1
  45. package/dist/cjs/core/responsive/Responsive.js +55 -2
  46. package/dist/cjs/core/section/Section.js +11 -27
  47. package/dist/cjs/core/theme/ThemeProvider.js +21 -1
  48. package/dist/cjs/core/viewport/Viewport.js +15 -1
  49. package/dist/cjs/hooks/useControlledValue.js +12 -0
  50. package/dist/cjs/hooks/useDebounce.js +13 -0
  51. package/dist/cjs/hooks/useEffectDebugger.js +52 -0
  52. package/dist/cjs/hooks/useIsDark.js +8 -0
  53. package/dist/cjs/hooks/useIsRtl.js +12 -0
  54. package/dist/cjs/hooks/useOverlayService.js +24 -0
  55. package/dist/cjs/hooks/usePropToggle.js +16 -5
  56. package/dist/cjs/hooks/useResize.js +18 -0
  57. package/dist/cjs/hooks/useResizeObserver.js +19 -0
  58. package/dist/cjs/hooks/useStorage.js +39 -0
  59. package/dist/cjs/types/icons.js +4 -0
  60. package/dist/cjs/typography/Abbr.js +28 -1
  61. package/dist/cjs/typography/Anchor.js +18 -1
  62. package/dist/cjs/typography/Mark.js +20 -1
  63. package/dist/cjs/typography/Text.js +27 -1
  64. package/dist/cjs/typography/Title.js +16 -1
  65. package/dist/esm/components/actionLabel/ActionLabel.js +23 -5
  66. package/dist/esm/components/animations/Animations.js +92 -9
  67. package/dist/esm/components/avatar/Avatar.js +33 -3
  68. package/dist/esm/components/avatar/AvatarGroup.js +19 -1
  69. package/dist/esm/components/badge/Badge.js +32 -3
  70. package/dist/esm/components/breadcrumbs/Breadcrumbs.js +30 -1
  71. package/dist/esm/components/button/Button.js +25 -2
  72. package/dist/esm/components/button/ButtonGroup.js +26 -0
  73. package/dist/esm/components/button/ConfirmButton.js +22 -1
  74. package/dist/esm/components/button/ToggleButtonGroup.js +39 -13
  75. package/dist/esm/components/callout/Callout.js +28 -0
  76. package/dist/esm/components/card/Card.js +34 -0
  77. package/dist/esm/components/card/CardCover.js +26 -0
  78. package/dist/esm/components/card/FlipContent.js +21 -0
  79. package/dist/esm/components/chip/Chip.js +22 -1
  80. package/dist/esm/components/collapsable/Collapsable.js +26 -0
  81. package/dist/esm/components/divider/Divider.js +19 -0
  82. package/dist/esm/components/dropdown/Dropdown.js +42 -0
  83. package/dist/esm/components/empty/EmptyContent.js +27 -0
  84. package/dist/esm/components/icon/Icon.js +27 -1
  85. package/dist/esm/components/media/Media.js +56 -0
  86. package/dist/esm/components/menu/ContextMenu.js +19 -0
  87. package/dist/esm/components/menu/Menu.js +30 -0
  88. package/dist/esm/components/menu/MenuItem.js +22 -1
  89. package/dist/esm/components/meter/Meter.js +24 -0
  90. package/dist/esm/components/navigator/Navigator.js +22 -0
  91. package/dist/esm/components/panel/Panel.js +37 -0
  92. package/dist/esm/components/panel/PanelGroup.js +24 -0
  93. package/dist/esm/components/panel/PanelStack.js +31 -0
  94. package/dist/esm/components/progress/ProgressBar.js +21 -0
  95. package/dist/esm/components/progress/ProgressCircle.js +20 -0
  96. package/dist/esm/components/tabpanel/Tab.js +31 -0
  97. package/dist/esm/components/tabpanel/TabPanel.js +33 -0
  98. package/dist/esm/context/Global.js +25 -1
  99. package/dist/esm/core/aside/Aside.js +39 -2
  100. package/dist/esm/core/boundary/ErrorBoundary.js +17 -1
  101. package/dist/esm/core/content/Content.js +6 -1
  102. package/dist/esm/core/headfoot/HeadFoot.js +42 -0
  103. package/dist/esm/core/page/Page.js +26 -1
  104. package/dist/esm/core/responsive/Responsive.js +55 -2
  105. package/dist/esm/core/section/Section.js +11 -27
  106. package/dist/esm/core/theme/ThemeProvider.js +21 -1
  107. package/dist/esm/core/viewport/Viewport.js +15 -1
  108. package/dist/esm/hooks/useControlledValue.js +12 -0
  109. package/dist/esm/hooks/useDebounce.js +13 -0
  110. package/dist/esm/hooks/useEffectDebugger.js +52 -0
  111. package/dist/esm/hooks/useIsDark.js +8 -0
  112. package/dist/esm/hooks/useIsRtl.js +12 -0
  113. package/dist/esm/hooks/useOverlayService.js +24 -0
  114. package/dist/esm/hooks/usePropToggle.js +16 -5
  115. package/dist/esm/hooks/useResize.js +18 -0
  116. package/dist/esm/hooks/useResizeObserver.js +19 -0
  117. package/dist/esm/hooks/useStorage.js +39 -0
  118. package/dist/esm/types/icons.js +4 -0
  119. package/dist/esm/typography/Abbr.js +28 -1
  120. package/dist/esm/typography/Anchor.js +18 -1
  121. package/dist/esm/typography/Mark.js +20 -1
  122. package/dist/esm/typography/Text.js +27 -1
  123. package/dist/esm/typography/Title.js +16 -1
  124. package/dist/types/components/actionLabel/ActionLabel.d.ts +21 -2
  125. package/dist/types/components/animations/Animations.d.ts +80 -1
  126. package/dist/types/components/avatar/Avatar.d.ts +26 -2
  127. package/dist/types/components/avatar/AvatarGroup.d.ts +19 -1
  128. package/dist/types/components/badge/Badge.d.ts +25 -0
  129. package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +29 -0
  130. package/dist/types/components/button/Button.d.ts +23 -2
  131. package/dist/types/components/button/ButtonGroup.d.ts +26 -1
  132. package/dist/types/components/button/ConfirmButton.d.ts +23 -3
  133. package/dist/types/components/button/ToggleButtonGroup.d.ts +39 -11
  134. package/dist/types/components/callout/Callout.d.ts +26 -1
  135. package/dist/types/components/card/Card.d.ts +34 -0
  136. package/dist/types/components/card/CardCover.d.ts +25 -0
  137. package/dist/types/components/card/FlipContent.d.ts +21 -0
  138. package/dist/types/components/chip/Chip.d.ts +21 -1
  139. package/dist/types/components/collapsable/Collapsable.d.ts +26 -0
  140. package/dist/types/components/divider/Divider.d.ts +19 -0
  141. package/dist/types/components/dropdown/Dropdown.d.ts +40 -1
  142. package/dist/types/components/dropdown/DropdownTool.d.ts +25 -0
  143. package/dist/types/components/empty/EmptyContent.d.ts +26 -1
  144. package/dist/types/components/icon/Icon.d.ts +27 -2
  145. package/dist/types/components/media/Media.d.ts +54 -0
  146. package/dist/types/components/menu/ContextMenu.d.ts +19 -1
  147. package/dist/types/components/menu/Menu.d.ts +29 -0
  148. package/dist/types/components/menu/MenuItem.d.ts +22 -2
  149. package/dist/types/components/meter/Meter.d.ts +24 -0
  150. package/dist/types/components/navigator/Navigator.d.ts +22 -0
  151. package/dist/types/components/panel/Panel.d.ts +37 -0
  152. package/dist/types/components/panel/PanelGroup.d.ts +24 -0
  153. package/dist/types/components/panel/PanelStack.d.ts +31 -0
  154. package/dist/types/components/progress/ProgressBar.d.ts +20 -0
  155. package/dist/types/components/progress/ProgressCircle.d.ts +19 -0
  156. package/dist/types/components/tabpanel/Tab.d.ts +32 -1
  157. package/dist/types/components/tabpanel/TabPanel.d.ts +33 -0
  158. package/dist/types/context/Global.d.ts +24 -1
  159. package/dist/types/core/aside/Aside.d.ts +38 -1
  160. package/dist/types/core/boundary/ErrorBoundary.d.ts +17 -1
  161. package/dist/types/core/content/Content.d.ts +6 -1
  162. package/dist/types/core/headfoot/HeadFoot.d.ts +40 -0
  163. package/dist/types/core/page/Page.d.ts +26 -1
  164. package/dist/types/core/responsive/Responsive.d.ts +52 -1
  165. package/dist/types/core/section/Section.d.ts +18 -3
  166. package/dist/types/core/theme/ThemeProvider.d.ts +21 -1
  167. package/dist/types/core/viewport/Viewport.d.ts +15 -1
  168. package/dist/types/hooks/useControlledValue.d.ts +13 -2
  169. package/dist/types/hooks/useDebounce.d.ts +12 -0
  170. package/dist/types/hooks/useEffectDebugger.d.ts +49 -0
  171. package/dist/types/hooks/useIsDark.d.ts +8 -0
  172. package/dist/types/hooks/useIsRtl.d.ts +12 -0
  173. package/dist/types/hooks/useNavigator.d.ts +18 -1
  174. package/dist/types/hooks/useOverlayService.d.ts +25 -4
  175. package/dist/types/hooks/usePropToggle.d.ts +16 -5
  176. package/dist/types/hooks/useResize.d.ts +18 -0
  177. package/dist/types/hooks/useResizeObserver.d.ts +19 -0
  178. package/dist/types/hooks/useStorage.d.ts +38 -0
  179. package/dist/types/types/icons.d.ts +4 -0
  180. package/dist/types/typography/Abbr.d.ts +28 -1
  181. package/dist/types/typography/Anchor.d.ts +19 -2
  182. package/dist/types/typography/Copy.d.ts +15 -0
  183. package/dist/types/typography/Mark.d.ts +20 -1
  184. package/dist/types/typography/Text.d.ts +27 -1
  185. package/dist/types/typography/Title.d.ts +16 -1
  186. package/package.json +3 -3
  187. package/src/components/actionLabel/ActionLabel.tsx +23 -5
  188. package/src/components/animations/Animations.tsx +93 -14
  189. package/src/components/avatar/Avatar.tsx +32 -3
  190. package/src/components/avatar/AvatarGroup.tsx +19 -1
  191. package/src/components/badge/Badge.tsx +33 -3
  192. package/src/components/breadcrumbs/Breadcrumbs.tsx +30 -1
  193. package/src/components/button/Button.tsx +24 -2
  194. package/src/components/button/ButtonGroup.tsx +26 -0
  195. package/src/components/button/ConfirmButton.tsx +22 -1
  196. package/src/components/button/ToggleButtonGroup.tsx +70 -43
  197. package/src/components/callout/Callout.tsx +27 -0
  198. package/src/components/card/Card.tsx +34 -0
  199. package/src/components/card/CardCover.tsx +25 -0
  200. package/src/components/card/FlipContent.tsx +21 -0
  201. package/src/components/chip/Chip.tsx +21 -1
  202. package/src/components/collapsable/Collapsable.tsx +26 -0
  203. package/src/components/divider/Divider.tsx +19 -0
  204. package/src/components/dropdown/Dropdown.tsx +40 -0
  205. package/src/components/dropdown/DropdownTool.tsx +25 -0
  206. package/src/components/empty/EmptyContent.tsx +26 -0
  207. package/src/components/icon/Icon.tsx +27 -1
  208. package/src/components/media/Media.tsx +54 -0
  209. package/src/components/menu/ContextMenu.tsx +19 -0
  210. package/src/components/menu/Menu.tsx +29 -0
  211. package/src/components/menu/MenuItem.tsx +22 -1
  212. package/src/components/meter/Meter.tsx +24 -0
  213. package/src/components/navigator/Navigator.tsx +22 -0
  214. package/src/components/panel/Panel.tsx +37 -0
  215. package/src/components/panel/PanelGroup.tsx +24 -0
  216. package/src/components/panel/PanelStack.tsx +31 -0
  217. package/src/components/progress/ProgressBar.tsx +20 -0
  218. package/src/components/progress/ProgressCircle.tsx +19 -0
  219. package/src/components/tabpanel/Tab.tsx +31 -0
  220. package/src/components/tabpanel/TabPanel.tsx +33 -0
  221. package/src/context/Global.tsx +24 -1
  222. package/src/core/aside/Aside.tsx +39 -2
  223. package/src/core/boundary/ErrorBoundary.tsx +17 -1
  224. package/src/core/content/Content.tsx +6 -1
  225. package/src/core/headfoot/HeadFoot.tsx +40 -0
  226. package/src/core/page/Page.tsx +26 -1
  227. package/src/core/responsive/Responsive.tsx +53 -2
  228. package/src/core/section/Section.tsx +25 -2
  229. package/src/core/theme/ThemeProvider.tsx +21 -1
  230. package/src/core/viewport/Viewport.tsx +15 -1
  231. package/src/hooks/useControlledValue.tsx +12 -0
  232. package/src/hooks/useDebounce.ts +12 -0
  233. package/src/hooks/useEffectDebugger.ts +49 -0
  234. package/src/hooks/useIsDark.ts +8 -0
  235. package/src/hooks/useIsRtl.ts +12 -0
  236. package/src/hooks/useNavigator.tsx +18 -0
  237. package/src/hooks/useOverlayService.tsx +24 -0
  238. package/src/hooks/usePropToggle.ts +16 -5
  239. package/src/hooks/useResize.ts +18 -0
  240. package/src/hooks/useResizeObserver.ts +19 -0
  241. package/src/hooks/useStorage.ts +38 -0
  242. package/src/types/icons.ts +5 -1
  243. package/src/typography/Abbr.tsx +28 -1
  244. package/src/typography/Anchor.tsx +18 -1
  245. package/src/typography/Copy.tsx +15 -0
  246. package/src/typography/Mark.tsx +20 -1
  247. package/src/typography/Text.tsx +27 -1
  248. package/src/typography/Title.tsx +16 -1
@@ -55,4 +55,41 @@ export interface PanelProps extends CssProp, AriaProps, TestProps, IconProps, Ex
55
55
  */
56
56
  onClose?: () => void;
57
57
  }
58
+ /**
59
+ * A component that represents a panel with a header, body, and optional actions.
60
+ * It supports expandable and collapsible functionality, loading state, and customizable styles.
61
+ * The panel can be resized and has a fixed position when expanded.
62
+ * It can be customized with different colors, icons, and behaviors.
63
+ * This component is useful for displaying content in a structured way, allowing users to interact with it through actions and toggles.
64
+ * It can be used in various applications where panels are needed, such as dashboards, settings pages, or content management systems.
65
+ *
66
+ * @param {PanelProps} props - The properties for the Panel component.
67
+ * @returns {JSX.Element} The rendered Panel component.
68
+ *
69
+ * @example
70
+ * ```jsx
71
+ * <Panel
72
+ * title="Panel Title"
73
+ * icon={CoreIcons.info}
74
+ * iconBg="bg-blue-500"
75
+ * iconColor="text-white"
76
+ * actions={<button>Action</button>}
77
+ * expandable
78
+ * collapsable
79
+ * onExpand={() => console.log("Expanded")}
80
+ * onCollapse={() => console.log("Collapsed")}
81
+ * onClose={() => console.log("Closed")}
82
+ * height="400px"
83
+ * width="300px"
84
+ * minHeight="200px"
85
+ * minWidth="200px"
86
+ * maxHeight="600px"
87
+ * maxWidth="600px"
88
+ * >
89
+ * <p>This is the content of the panel.</p>
90
+ * </Panel>
91
+ * ```
92
+ *
93
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-panel--docs} for more details.
94
+ */
58
95
  export declare const Panel: ({ children, className, titleClassName, headerClassName, title, actions, icon, iconBg, iconColor, rtlFlip, panelId, height, width, minHeight, minWidth, maxHeight, maxWidth, loading, expandable, expanded: _expanded, onExpand, collapsable, collapsed: _collapsed, onCollapse, onClose, onBack, ...aria }: PanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -9,4 +9,28 @@ export interface PanelGroupProps extends ChildrenProp {
9
9
  */
10
10
  onActiveChange?: (panelId: string) => void;
11
11
  }
12
+ /**
13
+ * A component that groups multiple panels together, allowing for one panel to be expanded at a time.
14
+ * This component allows you to manage a group of panels where only one can be expanded at a time.
15
+ * It accepts an `activePanel` prop to control which panel is currently expanded,
16
+ * and an `onActiveChange` callback that is triggered when the active panel changes.
17
+ * It uses the `Panel` component to render each individual panel within the group.
18
+ *
19
+ * @param {PanelGroupProps} props - The properties for the PanelGroup component.
20
+ * @returns {JSX.Element} The rendered PanelGroup component.
21
+ *
22
+ * @example
23
+ * ```jsx
24
+ * <PanelGroup
25
+ * activePanel="panel1"
26
+ * onActiveChange={(panelId) => console.log(`Active panel changed to: ${panelId}`)}
27
+ * >
28
+ * <Panel panelId="panel1" title="Panel 1">Content for Panel 1</Panel>
29
+ * <Panel panelId="panel2" title="Panel 2">Content for Panel 2</Panel>
30
+ * <Panel panelId="panel3" title="Panel 3">Content for Panel 3</Panel>
31
+ * </PanelGroup>
32
+ * ```
33
+ *
34
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-panel--docs} for more details.
35
+ */
12
36
  export declare const PanelGroup: ({ children, activePanel, onActiveChange, }: PanelGroupProps) => import("react/jsx-runtime").JSX.Element;
@@ -13,4 +13,35 @@ export interface PanelStackProps extends CssProp, ChildrenProp {
13
13
  */
14
14
  onBack?: (panelId: string, nextPanelId: string) => boolean | undefined;
15
15
  }
16
+ /**
17
+ * A component that manages a stack of panels, allowing navigation between them.
18
+ * This component allows you to manage a stack of panels where you can navigate between them.
19
+ * It accepts an `active` prop to control which panel is currently active,
20
+ * an `onPanelChange` callback that is triggered when the active panel changes,
21
+ * and an `onBack` callback to handle navigation to the previous panel in the history.
22
+ * It uses the `Panel` component to render each individual panel within the stack.
23
+ * The component maintains a history of panels to allow back navigation,
24
+ * and it updates the active panel based on user interactions.
25
+ *
26
+ * @param {PanelStackProps} props - The properties for the PanelStack component.
27
+ * @returns {JSX.Element} The rendered PanelStack component.
28
+ *
29
+ * @example
30
+ * ```jsx
31
+ * <PanelStack
32
+ * active="panel1"
33
+ * onPanelChange={(panelId) => console.log(`Active panel changed to: ${panelId}`)}
34
+ * onBack={(currentPanel, nextPanel) => {
35
+ * console.log(`Navigating back from ${currentPanel} to ${nextPanel}`);
36
+ * return true; // return false to prevent navigation
37
+ * }}
38
+ * >
39
+ * <Panel panelId="panel1" title="Panel 1">Content for Panel 1</Panel>
40
+ * <Panel panelId="panel2" title="Panel 2">Content for Panel 2</Panel>
41
+ * <Panel panelId="panel3" title="Panel 3">Content for Panel 3</Panel>
42
+ * </PanelStack>
43
+ * ```
44
+ *
45
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-panelstack--docs} for more details.
46
+ */
16
47
  export declare const PanelStack: ({ active, children, className, onPanelChange, onBack, ...rest }: PanelStackProps) => import("react/jsx-runtime").JSX.Element;
@@ -21,4 +21,24 @@ export interface ProgressProps {
21
21
  */
22
22
  label?: string;
23
23
  }
24
+ /**
25
+ * A component that displays a progress bar indicating the completion percentage of a task or operation.
26
+ * The progress bar is styled with a background color and a track that fills based on the value provided.
27
+ * It can also display a label showing the percentage value.
28
+ * The label can be customized or hidden based on the props provided.
29
+ *
30
+ * @param {ProgressProps} props - The properties for the ProgressBar component.
31
+ * @returns {JSX.Element} The rendered ProgressBar component.
32
+ *
33
+ * @example
34
+ * ```jsx
35
+ * <ProgressBar value={0.75} size="md" color="primary-500" label="Loading" animate />
36
+ * // Renders a progress bar with 75% completion, medium size, primary color, and a label "Loading"
37
+ *
38
+ * <ProgressBar value={0.5} size="lg" color="success-500" />
39
+ * // Renders a progress bar with 50% completion, large size, and success color without a label
40
+ * ```
41
+ *
42
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-progress--docs} for more details.
43
+ */
24
44
  export declare const ProgressBar: ({ value, size, color, label, animate, }: ProgressProps) => import("react/jsx-runtime").JSX.Element;
@@ -13,4 +13,23 @@ export interface ProgressProps {
13
13
  */
14
14
  color?: ColorType | PaletteType;
15
15
  }
16
+ /**
17
+ * A circular progress indicator that visually represents a percentage of completion.
18
+ * It displays a circular track with a stroke that fills based on the `value` prop.
19
+ * The component is customizable with size and color props.
20
+ *
21
+ * @param {ProgressProps} props - The properties for the ProgressCircle component.
22
+ * @returns {JSX.Element} - A circular progress indicator.
23
+ *
24
+ * @example
25
+ * ```jsx
26
+ * <ProgressCircle value={0.75} size="md" color="primary-500" />
27
+ * // Renders a circular progress indicator with 75% completion, medium size, and primary color.
28
+ *
29
+ * <ProgressCircle value={0.5} size="lg" color="secondary-500" />
30
+ * // Renders a circular progress indicator with 50% completion, large size, and secondary color.
31
+ * ```
32
+ *
33
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-progress--docs} for more details.
34
+ */
16
35
  export declare const ProgressCircle: ({ value, size, color, }: ProgressProps) => import("react/jsx-runtime").JSX.Element;
@@ -42,4 +42,35 @@ export interface TabProps extends Partial<ChildrenProp>, CssProp, RefProp, AriaP
42
42
  */
43
43
  onClick?: (id: string) => CallbackReturn;
44
44
  }
45
- export declare const Tab: <Tag extends import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> = "button">({ ref, as, id, className, label, icon, iconBg, iconColor, rtlFlip, badge, disabled, onClose, active, onClick, tabFlex, color, actions, tooltip, activeClassName, ...aria }: TabProps & PolymorphicProps<Tag>) => import("react/jsx-runtime").JSX.Element;
45
+ /**
46
+ * A component that represents a tab in a tabbed interface. It can display an icon, label, badge, and actions.
47
+ * It supports polymorphic rendering, allowing it to be rendered as different HTML elements.
48
+ * It also supports tooltips, active states, and click handling.
49
+ *
50
+ * @param {TabProps} props - The properties for the Tab component.
51
+ * @returns {JSX.Element} The rendered Tab component.
52
+ *
53
+ * @example
54
+ * ```jsx
55
+ * <Tab
56
+ * id="tab1"
57
+ * label="Tab 1"
58
+ * icon="home"
59
+ * iconBg="bg-blue-500"
60
+ * iconColor="text-white"
61
+ * badge="New"
62
+ * onClick={(id) => console.log(`Tab clicked: ${id}`)}
63
+ * onClose={() => console.log("Tab closed")}
64
+ * active={true}
65
+ * actions={<button>Action</button>}
66
+ * color="primary"
67
+ * tooltip="This is a tab"
68
+ * activeClassName="bg-blue-100"
69
+ * />
70
+ * // Renders a tab with label "Tab 1", home icon, blue background, white text, badge "New",
71
+ * // and an action button. The tab is active and has a tooltip.
72
+ * ```
73
+ *
74
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-tabpanel--docs} for more details.
75
+ */
76
+ export declare const Tab: <Tag extends React.ElementType = "button">({ ref, as, id, className, label, icon, iconBg, iconColor, rtlFlip, badge, disabled, onClose, active, onClick, tabFlex, color, actions, tooltip, activeClassName, ...aria }: TabProps & PolymorphicProps<Tag>) => import("react/jsx-runtime").JSX.Element;
@@ -47,4 +47,37 @@ export interface TabPanelProps extends ChildrenProp<typeof Tab> {
47
47
  */
48
48
  onBeforeChange?: (nextTab: string, currentTab?: string) => CallbackReturn;
49
49
  }
50
+ /**
51
+ * A component that provides a tabbed interface for displaying content.
52
+ * It allows users to switch between different tabs, each containing its own content.
53
+ * It supports various orientations, justify options, and variants for the tab header.
54
+ * It also provides hooks for handling tab changes before and after they occur.
55
+ * This component is useful for organizing content into separate sections that can be easily navigated by the user.
56
+ * It can be customized with different styles and behaviors to fit the needs of the application.
57
+ *
58
+ * @param {TabPanelProps} props - The properties for the TabPanel component.
59
+ * @returns {JSX.Element} The rendered TabPanel component.
60
+ *
61
+ * @example
62
+ * ```jsx
63
+ * <TabPanel
64
+ * orientation="top"
65
+ * activeTab="tab1"
66
+ * justify="start"
67
+ * variant="solid"
68
+ * tabFlex={true}
69
+ * onBeforeChange={(nextTab, currentTab) => {
70
+ * console.log(`Switching from ${currentTab} to ${nextTab}`);
71
+ * return true; // or false to prevent change
72
+ * }}
73
+ * onChange={(id) => console.log(`Active tab changed to: ${id}`)}
74
+ * >
75
+ * <Tab id="tab1" label="Tab 1">Content for Tab 1</Tab>
76
+ * <Tab id="tab2" label="Tab 2">Content for Tab 2</Tab>
77
+ * <Tab id="tab3" label="Tab 3">Content for Tab 3</Tab>
78
+ * </TabPanel>
79
+ * ```
80
+ *
81
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-tabpanel--docs} for more details.
82
+ */
50
83
  export declare const TabPanel: ({ children, headerClassName, orientation, activeTab, justify, variant, tabFlex, append, prepend, gap, onBeforeChange, onChange, }: TabPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -53,7 +53,15 @@ export declare const ApplicationProvider: FC<GlobalProps>;
53
53
  */
54
54
  export declare const useGlobals: () => GlobalContextType;
55
55
  /**
56
- * global application context
56
+ * Hook to access the global application context.
57
+ * This hook provides access to the global context values, including the current locale, calendar, and color scheme.
58
+ *
59
+ * @returns {GlobalContextType} The global context values excluding the error element.
60
+ *
61
+ * @example
62
+ * ```jsx
63
+ * const { changeLocale, currentLocale, toggleColorScheme } = useApplicationContext();
64
+ * ```
57
65
  */
58
66
  export declare const useApplicationContext: () => {
59
67
  /**
@@ -77,5 +85,20 @@ export declare const useApplicationContext: () => {
77
85
  currentColorScheme: State["colorScheme"];
78
86
  notificationManager: NotificationManagerRef;
79
87
  };
88
+ /**
89
+ * Hook to access the notification manager from the global context.
90
+ * This hook provides methods to show alerts, errors, messages, and toasts.
91
+ * It returns a reference to the notification manager, which can be used to display notifications in the application.
92
+ *
93
+ * @returns {NotificationManagerRef} The notification manager reference.
94
+ *
95
+ * @example
96
+ * ```jsx
97
+ * const notificationService = useNotificationService();
98
+ * notificationService.showMessage("Hello World");
99
+ * ```
100
+ *
101
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-notifications--notifications} for more details on available methods.
102
+ */
80
103
  export declare const useNotificationService: () => NotificationManagerRef;
81
104
  export {};
@@ -51,6 +51,43 @@ export interface AsideProps extends IconProps, ChildrenProp, CollapseProps, CssP
51
51
  minWidth?: number | string;
52
52
  }
53
53
  /**
54
- * Side panel
54
+ * A sidebar component that can be collapsed, resized, and has a flyout feature.
55
+ * It supports a title, icon, actions, and loading state.
56
+ * It can be aligned to the start or end of the page.
57
+ *
58
+ * @param {AsideProps} props - The properties for the Aside component.
59
+ * @returns {JSX.Element} The rendered Aside component.
60
+ *
61
+ * @example
62
+ * ```jsx
63
+ * <Aside
64
+ * title="Sidebar Title"
65
+ * icon={CoreIcons.menu}
66
+ * iconBg="bg-gray-200"
67
+ * iconColor="text-gray-800"
68
+ * rtlFlip={true}
69
+ * className="custom-aside"
70
+ * bodyClassName="custom-aside-body"
71
+ * headerClassName="custom-aside-header"
72
+ * resizeable={true}
73
+ * flyout={true}
74
+ * onFlyout={() => console.log("Flyout triggered")}
75
+ * collapsed={false}
76
+ * collapsable={true}
77
+ * onCollapse={() => console.log("Collapsed toggled")}
78
+ * actions={<button>Action</button>}
79
+ * loading={false}
80
+ * align="start"
81
+ * width="20rem"
82
+ * minWidth="2rem"
83
+ * maxWidth="30vw"
84
+ * data-testid="aside-test"
85
+ * data-test-value="aside-value"
86
+ * >
87
+ * <Content>This is the content of the aside.</Content>
88
+ * </Aside>
89
+ * ```
90
+ *
91
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--aside} for more details.
55
92
  */
56
93
  export declare const Aside: ({ children, title, icon, iconBg, iconColor, rtlFlip, className, bodyClassName, headerClassName, resizeable, flyout, onFlyout, collapsed, collapsable, onCollapse, actions, loading, align, width: wd, minWidth, maxWidth, "data-testid": testId, "data-test-value": testValue, }: AsideProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,23 @@
1
1
  import { Component } from "react";
2
2
  import { type ChildrenProp } from "../../types";
3
3
  /**
4
- * An error boundary wrapper higher-order component designed to provide consistent error display across the application will trap runtime errors
4
+ * ErrorBoundary component to catch JavaScript errors anywhere in the child component tree,
5
+ * log those errors, and display a fallback UI.
6
+ * It can also display a custom error element if provided.
7
+ * This component is useful for preventing the entire application from crashing
8
+ * when an error occurs in a part of the component tree.
9
+ * It can be used to wrap any part of the application.
10
+ * It supports custom error display components and provides a default error message.
11
+ * It also conditionally displays the error stack trace in development mode.
12
+ *
13
+ * @example
14
+ * ```jsx
15
+ * <ErrorBoundary errorElement={CustomErrorComponent}>
16
+ * <YourComponent />
17
+ * </ErrorBoundary>
18
+ * ```
19
+ *
20
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--error-boundary}
5
21
  */
6
22
  export declare class ErrorBoundary extends Component<{
7
23
  /**
@@ -11,6 +11,11 @@ export interface ContentProps extends ChildrenProp, CssProp, RefProp, TestProps
11
11
  onResize?: (event: SizeObject) => void;
12
12
  }
13
13
  /**
14
- * Scrollable content element
14
+ * Content component that wraps children in a section element.
15
+ * It uses a resize observer to handle resizing and a debounced scroll handler.
16
+ * It also includes an error boundary to catch any errors in the children.
17
+ *
18
+ * @param {ContentProps} props - The properties for the Content component.
19
+ * @returns A section element containing the children wrapped in an error boundary.
15
20
  */
16
21
  export declare const Content: ({ ref, children, className, onScroll, onResize, "data-testid": testId, "data-test-value": testValue, }: ContentProps) => import("react/jsx-runtime").JSX.Element;
@@ -11,6 +11,46 @@ type FlexProps = BaseProps & {
11
11
  justify?: "start" | "end" | "center" | "between";
12
12
  };
13
13
  export type HeadFootProps = DefaultProps | FlexProps;
14
+ /**
15
+ * Header component that wraps children in a header element.
16
+ * It uses the HeadFoot component to handle layout and styling.
17
+ * It accepts properties for direction, alignment, and justification,
18
+ * allowing for flexible layout configurations.
19
+ * The `as` prop is set to "header" to render the element as a header.
20
+ * The `area` prop is set to "head" to indicate that this is a header area.
21
+ * It can be used to create a consistent header layout across an application.
22
+ *
23
+ * @param {HeadFootProps} props - The properties for the Header component.
24
+ * @returns A header element containing the children wrapped in the HeadFoot component.
25
+ *
26
+ * @example
27
+ * ```jsx
28
+ * <Header className="custom-header" dir="ltr">
29
+ * <h1>Header content goes here</h1>
30
+ * </Header>
31
+ * ```
32
+ */
14
33
  export declare const Header: (props: HeadFootProps) => import("react/jsx-runtime").JSX.Element;
34
+ /**
35
+ * Footer component that wraps children in a footer element.
36
+ * It uses the HeadFoot component to handle layout and styling.
37
+ * It accepts properties for direction, alignment, and justification,
38
+ * allowing for flexible layout configurations.
39
+ * The `as` prop is set to "footer" to render the element as a footer.
40
+ * The `area` prop is set to "foot" to indicate that this is a footer area.
41
+ * It can be used to create a consistent footer layout across an application.
42
+ * * The Footer component is designed to be flexible and can be styled with custom classes.
43
+ * It supports both default and flex layouts, allowing for alignment and justification of its children.
44
+ *
45
+ * @param {HeadFootProps} props - The properties for the Footer component.
46
+ * @returns A footer element containing the children wrapped in the HeadFoot component.
47
+ *
48
+ * @example
49
+ * ```jsx
50
+ * <Footer className="custom-footer" dir="ltr">
51
+ * <p>Footer content goes here</p>
52
+ * </Footer>
53
+ * ```
54
+ */
15
55
  export declare const Footer: (props: HeadFootProps) => import("react/jsx-runtime").JSX.Element;
16
56
  export {};
@@ -18,6 +18,31 @@ export interface PageProps extends IconProps, ChildrenProp, TestProps, RefProp<H
18
18
  loading?: boolean;
19
19
  }
20
20
  /**
21
- * The page component used typically for routes, is a structured layout used within an application to organize and display content in a sectioned format, ensuring a consistent and intuitive user experience.
21
+ * Page component that wraps children in a div element.
22
+ * It includes a title section with an optional icon and a loading indicator.
23
+ * The component can be styled with a paper effect, page icon and title.
24
+ * It also accepts a loading prop to display a loading indicator.
25
+ *
26
+ * @param {PageProps} props - The properties for the Page component.
27
+ * @returns A div element containing the title and children, with optional loading indicator.
28
+ *
29
+ * @example
30
+ * ```jsx
31
+ * <Page
32
+ * title="My Page"
33
+ * icon="home"
34
+ * iconBg="bg-blue-500"
35
+ * iconColor="text-white"
36
+ * loading={false}
37
+ * paper={true}
38
+ * data-testid="my-page"
39
+ * data-test-value="page-value"
40
+ * >
41
+ * <p>This is the content of the page.</p>
42
+ * </Page>
43
+ * // Renders a page with a title, icon, and content.
44
+ * ```
45
+ *
46
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--page} for more details.
22
47
  */
23
48
  export declare const Page: ({ ref, children, paper, title, titleClassName, icon, rtlFlip, iconBg, iconColor, loading, "data-testid": testId, "data-test-value": testValue, ...rest }: PageProps) => import("react/jsx-runtime").JSX.Element;
@@ -50,8 +50,59 @@ export interface ColProps extends AriaProps, CssProp, TestProps, Partial<Childre
50
50
  truncate?: boolean;
51
51
  }
52
52
  /**
53
- * Responsive layout container
53
+ * Container component that wraps children in a div element.
54
+ * It supports full width, gutter size, and additional CSS classes.
55
+ * It can be used to create a responsive layout with optional gutters for spacing.
56
+ * It accepts properties for full width, gutter size, and additional CSS classes.
57
+ *
58
+ * @param {ContainerProps} props - The properties for the Container component.
59
+ * @returns A div element containing the children with optional full width and gutter size.
60
+ *
61
+ * @example
62
+ * ```jsx
63
+ * <Container fullWidth={true} gutter="16px" className="custom-container">
64
+ * <p>This is a container with full width and gutter.</p>
65
+ * </Container>
66
+ * ```
54
67
  */
55
68
  export declare const Container: ({ children, fullWidth, className, gutter, ...aria }: ContainerProps) => import("react/jsx-runtime").JSX.Element;
69
+ /**
70
+ * Row component that allows for flexible layout of columns.
71
+ * It supports various flex properties, alignment, and wrapping.
72
+ * It can be used to create a responsive layout with optional gutters for spacing.
73
+ * It accepts properties for gutter size, orientation, alignment, justification, and additional CSS classes.
74
+ *
75
+ * @param {RowProps} props - The properties for the Row component.
76
+ * @returns A div element representing a row with the specified flex and alignment properties.
77
+ *
78
+ * @example
79
+ * ```jsx
80
+ * <Row gutter="16px" orient="row" align="center" justify="between">
81
+ * <Col flex="fill">Column 1</Col>
82
+ * <Col flex="fill">Column 2</Col>
83
+ * </Row>
84
+ * // Renders a row with two columns, each taking equal space, centered vertically and spaced evenly.
85
+ * ```
86
+ *
87
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--responsive} for more details.
88
+ */
56
89
  export declare const Row: ({ children, gutter, noWrap, orient, align, justify, className, ...aria }: RowProps) => import("react/jsx-runtime").JSX.Element;
90
+ /**
91
+ * Column component that allows for flexible layout within a row.
92
+ * It supports various flex properties, alignment, and truncation.
93
+ * It can be used to create a responsive layout with optional stretching of inner content.
94
+ * It accepts properties for flex size, alignment, truncation, and additional CSS classes.
95
+ *
96
+ * @param {ColProps} props - The properties for the Col component.
97
+ * @returns A div element representing a column with the specified flex and alignment properties.
98
+ *
99
+ * @example
100
+ * ```jsx
101
+ * <Col flex="fill" align="center" truncate className="custom-col">
102
+ * <p>This is a column with flexible layout.</p>
103
+ * </Col>
104
+ * ```
105
+ *
106
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--responsive} for more details.
107
+ */
57
108
  export declare const Col: ({ children, flex, align, truncate, className, stretchContent, ...aria }: ColProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,22 @@
1
- import { type ChildrenProp, type CssProp, type RefProp } from "../../types";
1
+ import { TestProps, type ChildrenProp, type CssProp, type RefProp } from "../../types";
2
2
  /**
3
- * The section component provides a structured layout used within a page to organize and display content in a sectioned format, ensuring a consistent and intuitive user experience.
3
+ * A component that represents a section of content within a page, with templated grid layout.
4
+ * It can be used to group related content together and can be styled with additional CSS classes.
5
+ * It supports RTL (right-to-left) text direction.
6
+ *
7
+ * @param {ChildrenProp} children - The children to be rendered inside the section.
8
+ * @param {CssProp} className - Additional CSS classes to apply to the section.
9
+ * @param {RefProp<HTMLDivElement>} ref - A ref to the section element.
10
+ *
11
+ * @example
12
+ * ```jsx
13
+ * <Section className="my-section" ref={sectionRef}>
14
+ * <p>This is a section.</p>
15
+ * </Section>
16
+ * ```
17
+ *
18
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-application--section} for more details.
4
19
  */
5
- export declare const Section: ({ children, className, dir, ref, }: ChildrenProp & CssProp & RefProp<HTMLDivElement> & {
20
+ export declare const Section: ({ children, className, dir, ref, ...rest }: ChildrenProp & CssProp & TestProps & RefProp<HTMLDivElement> & {
6
21
  dir?: "ltr" | "rtl";
7
22
  }) => import("react/jsx-runtime").JSX.Element;
@@ -32,6 +32,26 @@ export interface ThemeProps {
32
32
  rounding?: "sm" | "md" | "full";
33
33
  }
34
34
  /**
35
- * Theme override
35
+ * This component provides a way to set the theme for the application.
36
+ * It allows you to set the primary, accent, and tint colors, as well as the color scheme and rounding.
37
+ * It uses CSS variables to apply the colors and styles.
38
+ * It also applies the branding className to the root element.
39
+ * The component uses the `useApplicationContext` hook to get the current color scheme from the application context.
40
+ *
41
+ * @example
42
+ * ```jsx
43
+ * <ThemeProvider
44
+ * branding="my-branding"
45
+ * primaryColor="#ff0000"
46
+ * accentColor="#00ff00"
47
+ * tintColor="#0000ff"
48
+ * colorScheme="dark"
49
+ * rounding="md"
50
+ * >
51
+ * <div>Your content here</div>
52
+ * </ThemeProvider>
53
+ * ```
54
+ *
55
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--theme-provider} for more details.
36
56
  */
37
57
  export declare const ThemeProvider: ({ children, branding, primaryColor, accentColor, tintColor, colorScheme, rounding, }: ThemeProps & ChildrenProp) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,19 @@
1
1
  import { type PropsWithChildren } from "react";
2
2
  /**
3
- * The application viewport is the main container that defines the visible area where content is displayed and interacted with.
3
+ * This component is used to create a full-screen viewport
4
+ * that can be used to display content in a grid layout.
5
+ * It is typically used as a container for the main content of the application.
6
+ * It is styled to take up the full width and height of the viewport,
7
+ * and it uses absolute positioning to ensure it covers the entire screen.
8
+ * The component accepts children as props, allowing you to nest other components inside it.
9
+ *
10
+ * @example
11
+ * ```jsx
12
+ * <Viewport>
13
+ * <YourContentComponent />
14
+ * </Viewport>
15
+ * ```
16
+ *
17
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-application--viewport} for more details.
4
18
  */
5
19
  export declare const Viewport: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,16 @@
1
- /// <reference types="react" />
2
- export declare const useControlledValue: <T extends unknown = string>(value: T, defaultValue: T) => {
1
+ /**
2
+ * Custom hook to manage a controlled value with a default fallback for inputs.
3
+ * It updates the current value whenever the deferred value changes.
4
+ * This is useful for scenarios where you want to control the value of a component
5
+ * while also providing a default value if the controlled value is not set.
6
+ * This hook is particularly useful for form inputs or components that require a controlled value
7
+ * but also need to handle cases where the value might not be immediately available.
8
+ *
9
+ * @param value - The controlled value that may change.
10
+ * @param defaultValue - The default value to use if the controlled value is not set.
11
+ * @returns An object containing the current value and a function to update it.
12
+ */
13
+ export declare const useControlledValue: <T extends AnyObject = string>(value: T, defaultValue: T) => {
3
14
  currentValue: T;
4
15
  updateValue: import("react").Dispatch<import("react").SetStateAction<T>>;
5
16
  };
@@ -1,3 +1,15 @@
1
+ /**
2
+ * Custom hook to debounce a function.
3
+ * This hook delays the processing of the function until after a specified delay period
4
+ * has elapsed since the last time the function was invoked. This is useful for optimizing
5
+ * performance in scenarios where a function may be called frequently, such as during
6
+ * user input or window resizing events.
7
+ *
8
+ * @param callback - The function to debounce.
9
+ * @param deps - The dependency array for the hook.
10
+ * @param delay - The debounce delay in milliseconds.
11
+ * @returns A debounced version of the callback function.
12
+ */
1
13
  export declare const useDebounce: (callback: undefined | ((...rest: AnyObject) => AnyObject), deps: AnyObject[], delay?: number) => {
2
14
  (...args: AnyObject): void;
3
15
  cancel(): void;