@react-fabric/core 1.0.0-beta.62 → 1.0.0-beta.63
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.
- package/css/components/_animations.css +7 -11
- package/css/components/_avatar.css +5 -5
- package/css/components/_badge.css +2 -1
- package/css/components/_breadcrumbs.css +5 -5
- package/css/components/_button.css +48 -14
- package/css/components/_card.css +9 -17
- package/css/components/_chip.css +0 -4
- package/css/components/_dropdown.css +1 -0
- package/css/components/_flyout.css +1 -1
- package/css/components/_media.css +2 -14
- package/css/components/_menu.css +1 -1
- package/css/components/_modal.css +1 -1
- package/css/components/_progress.css +1 -1
- package/css/components/_stepper.css +2 -1
- package/css/components/_tabPanel.css +4 -4
- package/css/core/_aside.css +3 -3
- package/css/core/_errorboundary.css +2 -10
- package/css/core/_page.css +1 -1
- package/css/core/_responsive.css +8 -0
- package/css/core/_viewport.css +1 -5
- package/css/reset/_reset.css +36 -41
- package/css/reset/_theme.css +214 -201
- package/css/styles.css +5 -0
- package/css/theme/_colors.css +14 -0
- package/css/theme/_utilities.css +103 -225
- package/css/theme/index.css +4 -6
- package/dist/cjs/components/actionLabel/ActionLabel.js +1 -1
- package/dist/cjs/components/animations/Animations.js +7 -7
- package/dist/cjs/components/avatar/Avatar.js +1 -1
- package/dist/cjs/components/avatar/AvatarGroup.js +1 -1
- package/dist/cjs/components/badge/Badge.js +5 -27
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/cjs/components/button/Button.js +7 -5
- package/dist/cjs/components/button/ButtonGroup.js +1 -1
- package/dist/cjs/components/button/ConfirmButton.js +7 -6
- package/dist/cjs/components/button/ToggleButtonGroup.js +1 -1
- package/dist/cjs/components/callout/Callout.js +8 -7
- package/dist/cjs/components/card/Card.js +3 -3
- package/dist/cjs/components/card/CardCover.js +1 -1
- package/dist/cjs/components/card/FlipContent.js +2 -2
- package/dist/cjs/components/chip/Chip.js +8 -7
- package/dist/cjs/components/collapsable/Collapsable.js +4 -3
- package/dist/cjs/components/divider/Divider.js +2 -2
- package/dist/cjs/components/dropdown/Dropdown.js +18 -16
- package/dist/cjs/components/empty/EmptyContent.js +1 -1
- package/dist/cjs/components/icon/Icon.js +2 -16
- package/dist/cjs/components/media/Media.js +13 -13
- package/dist/cjs/components/menu/ContextMenu.js +23 -13
- package/dist/cjs/components/menu/Menu.js +16 -12
- package/dist/cjs/components/menu/MenuItem.js +4 -3
- package/dist/cjs/components/meter/Meter.js +1 -1
- package/dist/cjs/components/navigator/Navigator.js +5 -5
- package/dist/cjs/components/panel/Panel.js +6 -4
- package/dist/cjs/components/panel/PanelGroup.js +3 -3
- package/dist/cjs/components/panel/PanelStack.js +5 -5
- package/dist/cjs/components/progress/ProgressBar.js +2 -2
- package/dist/cjs/components/progress/ProgressCircle.js +2 -2
- package/dist/cjs/components/tabpanel/Tab.js +6 -4
- package/dist/cjs/components/tabpanel/TabPanel.js +4 -4
- package/dist/cjs/context/Global.js +2 -55
- package/dist/cjs/context/NotificationCenter.js +38 -39
- package/dist/cjs/context/context.js +59 -0
- package/dist/cjs/core/aside/Aside.js +9 -7
- package/dist/cjs/core/boundary/ErrorBoundary.js +2 -4
- package/dist/cjs/core/page/Page.js +4 -1
- package/dist/cjs/core/responsive/Responsive.js +3 -2
- package/dist/cjs/core/theme/ThemeProvider.js +2 -2
- package/dist/cjs/core/viewport/Viewport.js +1 -1
- package/dist/cjs/hooks/useContextMenu.js +103 -0
- package/dist/cjs/hooks/useIsDark.js +6 -4
- package/dist/cjs/hooks/useNavigator.js +2 -2
- package/dist/cjs/hooks/useOverlayService.js +10 -42
- package/dist/cjs/hooks/usePropToggle.js +2 -2
- package/dist/cjs/hooks/useResize.js +8 -6
- package/dist/cjs/hooks/useResizeObserver.js +5 -5
- package/dist/cjs/hooks/useStepper.js +2 -6
- package/dist/cjs/hotkeys/HotKey.js +2 -2
- package/dist/cjs/hotkeys/HotKeyWrapper.js +8 -13
- package/dist/cjs/hotkeys/commons.js +1 -1
- package/dist/cjs/hotkeys/context.js +36 -0
- package/dist/cjs/index.js +9 -5
- package/dist/cjs/overlays/alert/Alert.js +6 -5
- package/dist/cjs/overlays/flyout/Flyout.js +8 -6
- package/dist/cjs/overlays/message/Message.js +5 -5
- package/dist/cjs/overlays/modal/Modal.js +5 -3
- package/dist/cjs/overlays/toast/Toast.js +4 -4
- package/dist/cjs/overlays/tooltip/Tooltip.js +2 -16
- package/dist/cjs/typography/Abbr.js +4 -5
- package/dist/cjs/typography/Anchor.js +2 -2
- package/dist/cjs/typography/Copy.js +2 -2
- package/dist/cjs/typography/Mark.js +2 -4
- package/dist/cjs/typography/Text.js +4 -4
- package/dist/cjs/typography/Title.js +2 -2
- package/dist/cjs/utils/cloneElement.js +4 -4
- package/dist/cjs/utils/getBadgeProps.js +51 -0
- package/dist/cjs/utils/getIconProps.js +42 -0
- package/dist/cjs/utils/getTooltipProps.js +45 -0
- package/dist/esm/components/actionLabel/ActionLabel.js +1 -1
- package/dist/esm/components/animations/Animations.js +7 -7
- package/dist/esm/components/avatar/Avatar.js +1 -1
- package/dist/esm/components/avatar/AvatarGroup.js +1 -1
- package/dist/esm/components/badge/Badge.js +7 -28
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/esm/components/button/Button.js +8 -6
- package/dist/esm/components/button/ButtonGroup.js +3 -3
- package/dist/esm/components/button/ConfirmButton.js +8 -7
- package/dist/esm/components/button/ToggleButtonGroup.js +3 -3
- package/dist/esm/components/callout/Callout.js +8 -7
- package/dist/esm/components/card/Card.js +4 -4
- package/dist/esm/components/card/CardCover.js +1 -1
- package/dist/esm/components/card/FlipContent.js +2 -2
- package/dist/esm/components/chip/Chip.js +9 -8
- package/dist/esm/components/collapsable/Collapsable.js +4 -3
- package/dist/esm/components/divider/Divider.js +2 -2
- package/dist/esm/components/dropdown/Dropdown.js +19 -17
- package/dist/esm/components/empty/EmptyContent.js +1 -1
- package/dist/esm/components/icon/Icon.js +4 -17
- package/dist/esm/components/media/Media.js +13 -13
- package/dist/esm/components/menu/ContextMenu.js +24 -14
- package/dist/esm/components/menu/Menu.js +19 -15
- package/dist/esm/components/menu/MenuItem.js +5 -4
- package/dist/esm/components/meter/Meter.js +1 -1
- package/dist/esm/components/navigator/Navigator.js +6 -6
- package/dist/esm/components/panel/Panel.js +6 -4
- package/dist/esm/components/panel/PanelGroup.js +4 -4
- package/dist/esm/components/panel/PanelStack.js +6 -6
- package/dist/esm/components/progress/ProgressBar.js +2 -2
- package/dist/esm/components/progress/ProgressCircle.js +2 -2
- package/dist/esm/components/tabpanel/Tab.js +6 -4
- package/dist/esm/components/tabpanel/TabPanel.js +5 -5
- package/dist/esm/context/Global.js +3 -52
- package/dist/esm/context/NotificationCenter.js +38 -39
- package/dist/esm/context/context.js +56 -0
- package/dist/esm/core/aside/Aside.js +10 -8
- package/dist/esm/core/boundary/ErrorBoundary.js +1 -3
- package/dist/esm/core/page/Page.js +4 -1
- package/dist/esm/core/responsive/Responsive.js +3 -2
- package/dist/esm/core/theme/ThemeProvider.js +1 -1
- package/dist/esm/core/viewport/Viewport.js +1 -1
- package/dist/esm/hooks/useContextMenu.js +103 -0
- package/dist/esm/hooks/useIsDark.js +7 -5
- package/dist/esm/hooks/useNavigator.js +3 -3
- package/dist/esm/hooks/useOverlayService.js +8 -40
- package/dist/esm/hooks/usePropToggle.js +3 -3
- package/dist/esm/hooks/useResize.js +9 -7
- package/dist/esm/hooks/useResizeObserver.js +6 -6
- package/dist/esm/hooks/useStepper.js +2 -6
- package/dist/esm/hotkeys/HotKey.js +1 -1
- package/dist/esm/hotkeys/HotKeyWrapper.js +9 -12
- package/dist/esm/hotkeys/commons.js +1 -1
- package/dist/esm/hotkeys/context.js +35 -0
- package/dist/esm/index.js +7 -3
- package/dist/esm/overlays/alert/Alert.js +7 -6
- package/dist/esm/overlays/flyout/Flyout.js +9 -7
- package/dist/esm/overlays/message/Message.js +6 -6
- package/dist/esm/overlays/modal/Modal.js +6 -4
- package/dist/esm/overlays/toast/Toast.js +5 -5
- package/dist/esm/overlays/tooltip/Tooltip.js +4 -17
- package/dist/esm/typography/Abbr.js +4 -5
- package/dist/esm/typography/Anchor.js +2 -2
- package/dist/esm/typography/Copy.js +3 -3
- package/dist/esm/typography/Mark.js +2 -4
- package/dist/esm/typography/Text.js +5 -5
- package/dist/esm/typography/Title.js +2 -2
- package/dist/esm/utils/cloneElement.js +4 -4
- package/dist/esm/utils/getBadgeProps.js +51 -0
- package/dist/esm/utils/getIconProps.js +42 -0
- package/dist/esm/utils/getTooltipProps.js +45 -0
- package/dist/types/components/actionLabel/ActionLabel.d.ts +1 -1
- package/dist/types/components/animations/Animations.d.ts +6 -6
- package/dist/types/components/avatar/Avatar.d.ts +1 -1
- package/dist/types/components/avatar/AvatarGroup.d.ts +1 -1
- package/dist/types/components/badge/Badge.d.ts +2 -10
- package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/types/components/button/Button.d.ts +1 -1
- package/dist/types/components/button/ButtonGroup.d.ts +1 -1
- package/dist/types/components/button/ConfirmButton.d.ts +1 -1
- package/dist/types/components/button/ToggleButtonGroup.d.ts +1 -1
- package/dist/types/components/callout/Callout.d.ts +7 -3
- package/dist/types/components/card/Card.d.ts +2 -2
- package/dist/types/components/card/CardCover.d.ts +1 -1
- package/dist/types/components/card/FlipContent.d.ts +1 -1
- package/dist/types/components/chip/Chip.d.ts +1 -1
- package/dist/types/components/collapsable/Collapsable.d.ts +1 -1
- package/dist/types/components/divider/Divider.d.ts +1 -1
- package/dist/types/components/dropdown/Dropdown.d.ts +7 -3
- package/dist/types/components/dropdown/DropdownTool.d.ts +1 -1
- package/dist/types/components/empty/EmptyContent.d.ts +3 -3
- package/dist/types/components/icon/Icon.d.ts +3 -4
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/components/media/Media.d.ts +2 -2
- package/dist/types/components/menu/ContextMenu.d.ts +1 -1
- package/dist/types/components/menu/Menu.d.ts +1 -1
- package/dist/types/components/menu/types.d.ts +1 -1
- package/dist/types/components/meter/Meter.d.ts +1 -1
- package/dist/types/components/navigator/Navigator.d.ts +1 -1
- package/dist/types/components/panel/Panel.d.ts +2 -2
- package/dist/types/components/panel/PanelGroup.d.ts +1 -1
- package/dist/types/components/panel/PanelStack.d.ts +1 -1
- package/dist/types/components/progress/ProgressBar.d.ts +1 -1
- package/dist/types/components/progress/ProgressCircle.d.ts +1 -1
- package/dist/types/components/tabpanel/Tab.d.ts +1 -1
- package/dist/types/components/tabpanel/TabPanel.d.ts +1 -1
- package/dist/types/context/Global.d.ts +0 -82
- package/dist/types/context/context.d.ts +85 -0
- package/dist/types/core/aside/Aside.d.ts +2 -2
- package/dist/types/core/responsive/Responsive.d.ts +5 -1
- package/dist/types/hooks/useContextMenu.d.ts +10 -0
- package/dist/types/hotkeys/HotKeyWrapper.d.ts +0 -9
- package/dist/types/hotkeys/context.d.ts +9 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/overlays/alert/Alert.d.ts +2 -2
- package/dist/types/overlays/flyout/Flyout.d.ts +2 -2
- package/dist/types/overlays/message/Message.d.ts +2 -2
- package/dist/types/overlays/modal/Modal.d.ts +2 -2
- package/dist/types/overlays/toast/Toast.d.ts +2 -2
- package/dist/types/overlays/tooltip/Tooltip.d.ts +0 -3
- package/dist/types/types/index.d.ts +2 -2
- package/dist/types/typography/Abbr.d.ts +4 -8
- package/dist/types/typography/Anchor.d.ts +1 -1
- package/dist/types/typography/Copy.d.ts +1 -1
- package/dist/types/typography/Mark.d.ts +2 -2
- package/dist/types/typography/Text.d.ts +1 -1
- package/dist/types/typography/Title.d.ts +1 -1
- package/dist/types/utils/getBadgeProps.d.ts +9 -0
- package/dist/types/utils/getIconProps.d.ts +2 -0
- package/dist/types/utils/getTooltipProps.d.ts +4 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/package.json +14 -15
- package/src/components/actionLabel/ActionLabel.tsx +1 -1
- package/src/components/animations/Animations.tsx +6 -6
- package/src/components/avatar/Avatar.tsx +1 -1
- package/src/components/avatar/AvatarGroup.tsx +1 -1
- package/src/components/badge/Badge.tsx +8 -46
- package/src/components/breadcrumbs/Breadcrumbs.tsx +1 -1
- package/src/components/button/Button.tsx +24 -54
- package/src/components/button/ButtonGroup.tsx +1 -1
- package/src/components/button/ConfirmButton.tsx +23 -20
- package/src/components/button/ToggleButtonGroup.tsx +1 -1
- package/src/components/callout/Callout.tsx +14 -19
- package/src/components/card/Card.tsx +9 -11
- package/src/components/card/CardCover.tsx +1 -1
- package/src/components/card/FlipContent.tsx +2 -2
- package/src/components/chip/Chip.tsx +16 -33
- package/src/components/collapsable/Collapsable.tsx +2 -2
- package/src/components/divider/Divider.tsx +1 -1
- package/src/components/dropdown/Dropdown.tsx +42 -72
- package/src/components/dropdown/DropdownTool.tsx +1 -1
- package/src/components/empty/EmptyContent.tsx +3 -3
- package/src/components/icon/Icon.tsx +5 -32
- package/src/components/index.ts +2 -2
- package/src/components/media/Media.tsx +3 -3
- package/src/components/menu/ContextMenu.tsx +30 -30
- package/src/components/menu/Menu.tsx +32 -61
- package/src/components/menu/MenuItem.tsx +9 -28
- package/src/components/menu/types.ts +1 -1
- package/src/components/meter/Meter.tsx +1 -1
- package/src/components/navigator/Navigator.tsx +5 -10
- package/src/components/panel/Panel.tsx +13 -54
- package/src/components/panel/PanelGroup.tsx +3 -4
- package/src/components/panel/PanelStack.tsx +20 -25
- package/src/components/progress/ProgressBar.tsx +2 -2
- package/src/components/progress/ProgressCircle.tsx +2 -2
- package/src/components/tabpanel/Tab.tsx +9 -28
- package/src/components/tabpanel/TabPanel.tsx +11 -14
- package/src/context/Global.tsx +18 -125
- package/src/context/NotificationCenter.tsx +0 -1
- package/src/context/context.ts +100 -0
- package/src/core/aside/Aside.tsx +18 -55
- package/src/core/boundary/ErrorBoundary.tsx +8 -37
- package/src/core/page/Page.tsx +3 -5
- package/src/core/responsive/Responsive.tsx +10 -34
- package/src/core/theme/ThemeProvider.tsx +2 -7
- package/src/core/viewport/Viewport.tsx +1 -1
- package/src/hooks/useContextMenu.tsx +131 -0
- package/src/hooks/useIsDark.ts +7 -5
- package/src/hooks/useNavigator.tsx +12 -15
- package/src/hooks/useOverlayService.tsx +3 -11
- package/src/hooks/usePropToggle.ts +3 -3
- package/src/hooks/useResize.ts +14 -17
- package/src/hooks/useResizeObserver.ts +21 -21
- package/src/hooks/useStepper.tsx +1 -1
- package/src/hotkeys/HotKey.tsx +1 -1
- package/src/hotkeys/HotKeyWrapper.tsx +81 -105
- package/src/hotkeys/commons.ts +2 -0
- package/src/hotkeys/context.ts +32 -0
- package/src/index.ts +4 -7
- package/src/overlays/alert/Alert.tsx +12 -16
- package/src/overlays/flyout/Flyout.tsx +32 -69
- package/src/overlays/message/Message.tsx +11 -15
- package/src/overlays/modal/Modal.tsx +23 -57
- package/src/overlays/toast/Toast.tsx +16 -15
- package/src/overlays/tooltip/Tooltip.tsx +6 -29
- package/src/types/global.d.ts +12 -0
- package/src/types/index.ts +2 -2
- package/src/typography/Abbr.tsx +11 -39
- package/src/typography/Anchor.tsx +1 -1
- package/src/typography/Copy.tsx +4 -4
- package/src/typography/Mark.tsx +2 -3
- package/src/typography/Text.tsx +8 -6
- package/src/typography/Title.tsx +1 -1
- package/src/utils/getBadgeProps.ts +45 -0
- package/src/utils/getIconProps.ts +35 -0
- package/src/utils/getTooltipProps.ts +38 -0
- package/src/utils/index.ts +3 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ChildProp, type CssProp, type RefProp } from "../../types";
|
|
2
2
|
import { type IconProps } from "../icon/Icon";
|
|
3
3
|
export interface BadgeProps extends CssProp, RefProp, Partial<ChildProp> {
|
|
4
4
|
/**
|
|
@@ -30,14 +30,6 @@ export interface BadgeProps extends CssProp, RefProp, Partial<ChildProp> {
|
|
|
30
30
|
*/
|
|
31
31
|
placement?: "top-start" | "top-end" | "bottom-start" | "bottom-end" | "top" | "bottom" | "start" | "end";
|
|
32
32
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Utility function to get badge properties from a badge value or object.
|
|
35
|
-
* It checks if the badge is an object and returns its properties,
|
|
36
|
-
*
|
|
37
|
-
* @param {string | number | BadgeType} badge - The badge value or object.
|
|
38
|
-
* @returns {AnyObject} An object containing badge properties.
|
|
39
|
-
*/
|
|
40
|
-
export declare const getBadgeProps: (badge?: string | number | BadgeType) => AnyObject;
|
|
41
33
|
/**
|
|
42
34
|
* A component that displays a badge with a value, icon, and optional ping animation.
|
|
43
35
|
* It can be used to indicate notifications, messages, or other important information.
|
|
@@ -45,7 +37,7 @@ export declare const getBadgeProps: (badge?: string | number | BadgeType) => Any
|
|
|
45
37
|
* It can also wrap children elements, allowing for flexible usage in buttons or other components.
|
|
46
38
|
*
|
|
47
39
|
* @param {BadgeProps} props - The properties for the Badge component.
|
|
48
|
-
* @returns {
|
|
40
|
+
* @returns {React.ReactElement} The rendered Badge component.
|
|
49
41
|
*
|
|
50
42
|
* @example
|
|
51
43
|
* ```jsx
|
|
@@ -21,7 +21,7 @@ export interface BreadcrumbProps extends CssProp, AriaProps, ChildrenProp<typeof
|
|
|
21
21
|
* It automatically manages the display of overflow items when there are too many links to fit in the available space, providing a dropdown for additional links.
|
|
22
22
|
*
|
|
23
23
|
* @param {BreadcrumbProps} props - The properties for the Breadcrumbs component.
|
|
24
|
-
* @returns {
|
|
24
|
+
* @returns {React.ReactElement} The rendered Breadcrumbs component.
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* ```jsx
|
|
@@ -106,7 +106,7 @@ export type ButtonProps<Tag extends React.ElementType = "button"> = BaseProps &
|
|
|
106
106
|
* It also includes features like after action tooltips, badges, and keyboard shortcuts.
|
|
107
107
|
*
|
|
108
108
|
* @param {ButtonProps} props - The properties for the Button component.
|
|
109
|
-
* @returns {
|
|
109
|
+
* @returns {React.ReactElement} The rendered Button component.
|
|
110
110
|
*
|
|
111
111
|
* @example
|
|
112
112
|
* ```jsx
|
|
@@ -37,7 +37,7 @@ export interface ButtonGroupProps extends CssProp, AriaProps, TestProps, RefProp
|
|
|
37
37
|
* such as toolbars, action groups, or navigation buttons.
|
|
38
38
|
*
|
|
39
39
|
* @param {ButtonGroupProps} props - The properties for the ButtonGroup component.
|
|
40
|
-
* @returns {
|
|
40
|
+
* @returns {React.ReactElement} The rendered ButtonGroup component.
|
|
41
41
|
*
|
|
42
42
|
* @example
|
|
43
43
|
* ```jsx
|
|
@@ -32,7 +32,7 @@ export type ConfirmButtonProps = ExtendedProps & ButtonProps;
|
|
|
32
32
|
* It also supports custom placement of the dialog, and can display an action message when the action is completed.
|
|
33
33
|
*
|
|
34
34
|
* @param {ConfirmButtonProps} props - The properties for the ConfirmButton component.
|
|
35
|
-
* @returns {
|
|
35
|
+
* @returns {React.ReactElement} The rendered ConfirmButton component.
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
38
|
* ```jsx
|
|
@@ -59,7 +59,7 @@ export type ToggleButtonGroupProps<T> = BaseProps & ChildrenProp<React.ReactElem
|
|
|
59
59
|
* such as toggle switches, selection groups, or multi-select options.
|
|
60
60
|
*
|
|
61
61
|
* @param {ToggleButtonGroupProps} props - The properties for the ToggleButtonGroup component.
|
|
62
|
-
* @returns {
|
|
62
|
+
* @returns {React.ReactElement} The rendered ToggleButtonGroup component.
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
65
|
* ```jsx
|
|
@@ -3,11 +3,15 @@ export interface CalloutProps extends AriaProps, ChildrenProp, CssProp, TestProp
|
|
|
3
3
|
/**
|
|
4
4
|
* callout color
|
|
5
5
|
*/
|
|
6
|
-
color?: ColorState | "
|
|
6
|
+
color?: ColorState | "dimmed";
|
|
7
7
|
/**
|
|
8
8
|
* legend title
|
|
9
9
|
*/
|
|
10
10
|
legend?: string | React.ReactElement;
|
|
11
|
+
/**
|
|
12
|
+
* legend class name
|
|
13
|
+
*/
|
|
14
|
+
legendClassName?: string;
|
|
11
15
|
/**
|
|
12
16
|
* callout icon
|
|
13
17
|
*/
|
|
@@ -33,7 +37,7 @@ export interface CalloutProps extends AriaProps, ChildrenProp, CssProp, TestProp
|
|
|
33
37
|
* such as alerts, notifications, or important messages.
|
|
34
38
|
*
|
|
35
39
|
* @param {CalloutProps} props - The properties for the Callout component.
|
|
36
|
-
* @returns {
|
|
40
|
+
* @returns {React.ReactElement} The rendered Callout component.
|
|
37
41
|
*
|
|
38
42
|
* @example
|
|
39
43
|
* ```jsx
|
|
@@ -51,4 +55,4 @@ export interface CalloutProps extends AriaProps, ChildrenProp, CssProp, TestProp
|
|
|
51
55
|
*
|
|
52
56
|
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-callout--docs} for more details.
|
|
53
57
|
*/
|
|
54
|
-
export declare const Callout: ({ children, color, legend, title, icon, border, onClose, className, ...aria }: CalloutProps) => import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
export declare const Callout: ({ children, color, legend, legendClassName, title, icon, border, onClose, className, ...aria }: CalloutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type DragEvent, type MouseEventHandler } from "react";
|
|
2
2
|
import { type ContentProps } from "../../core/content/Content";
|
|
3
3
|
import { type HeadFootProps } from "../../core/headfoot/HeadFoot";
|
|
4
|
-
import { type
|
|
4
|
+
import { type AriaProps, type ChildrenProp, type CssProp, type PolymorphicProps, type RefProp, type TestProps } from "../../types";
|
|
5
5
|
interface BaseProps extends CssProp, AriaProps, TestProps, RefProp<HTMLDivElement>, ChildrenProp<React.ReactElement<HeadFootProps | ContentProps>> {
|
|
6
6
|
/**
|
|
7
7
|
* apply flex fill styling
|
|
@@ -50,7 +50,7 @@ export type CardProps<Tag extends React.ElementType = "div"> = BaseProps & Polym
|
|
|
50
50
|
* It can be styled with custom CSS classes and supports features like selection indication and drag-and-drop functionality.
|
|
51
51
|
*
|
|
52
52
|
* @param {CardProps} props - The properties for the Card component.
|
|
53
|
-
* @returns {
|
|
53
|
+
* @returns {React.ReactElement} The rendered Card component.
|
|
54
54
|
*
|
|
55
55
|
* @example
|
|
56
56
|
* ```jsx
|
|
@@ -19,7 +19,7 @@ export interface CardCoverProps extends CssProp, AriaProps, ChildrenProp {
|
|
|
19
19
|
* It can be used to create visually appealing card layouts with media content.
|
|
20
20
|
*
|
|
21
21
|
* @param {CardCoverProps} props - The properties for the CardCover component.
|
|
22
|
-
* @returns {
|
|
22
|
+
* @returns {React.ReactElement} The rendered CardCover component.
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```jsx
|
|
@@ -13,7 +13,7 @@ export interface Props extends ChildrenProp, RefProp<FlipContentRef> {
|
|
|
13
13
|
* The `flipCard` method can be called to toggle the visibility of the back content.
|
|
14
14
|
*
|
|
15
15
|
* @param {Props} props - The properties for the FlipContent component.
|
|
16
|
-
* @returns {
|
|
16
|
+
* @returns {React.ReactElement} The rendered FlipContent component.
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* ```jsx
|
|
@@ -56,7 +56,7 @@ export interface ChipProps extends CssProp, AriaProps, TestProps, ChildProp<stri
|
|
|
56
56
|
* It can also include an icon and a remove button, making it versatile for different use cases.
|
|
57
57
|
*
|
|
58
58
|
* @param {ChipProps} props - The properties for the Chip component.
|
|
59
|
-
* @returns {
|
|
59
|
+
* @returns {React.ReactElement} The rendered Chip component.
|
|
60
60
|
*
|
|
61
61
|
* @example
|
|
62
62
|
* ```jsx
|
|
@@ -54,7 +54,7 @@ export interface CollapsableProps extends CssProp, AriaProps, TestProps, RefProp
|
|
|
54
54
|
* This component is ideal for creating accordions, expandable panels, or sections that can be toggled by the user.
|
|
55
55
|
*
|
|
56
56
|
* @param {CollapsableProps} props - The properties for the Collapsable component.
|
|
57
|
-
* @returns {
|
|
57
|
+
* @returns {React.ReactElement} The rendered Collapsable component.
|
|
58
58
|
*
|
|
59
59
|
* @example
|
|
60
60
|
* ```jsx
|
|
@@ -28,7 +28,7 @@ export interface DividerProps extends CssProp, Partial<ChildProp> {
|
|
|
28
28
|
* styles, and alignment options.
|
|
29
29
|
*
|
|
30
30
|
* @param {DividerProps} props - The properties for the Divider component.
|
|
31
|
-
* @returns {
|
|
31
|
+
* @returns {React.ReactElement} The rendered Divider component.
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* ```jsx
|
|
@@ -31,9 +31,13 @@ export interface DropdownProps extends RefProp {
|
|
|
31
31
|
*/
|
|
32
32
|
dropdownClassName?: string;
|
|
33
33
|
/**
|
|
34
|
-
* dropdown event
|
|
34
|
+
* dropdown trigger event, default is click
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
trigger?: "click" | "hover";
|
|
37
|
+
/**
|
|
38
|
+
* portal root element
|
|
39
|
+
*/
|
|
40
|
+
root?: HTMLElement;
|
|
37
41
|
/**
|
|
38
42
|
* open handler
|
|
39
43
|
*/
|
|
@@ -84,6 +88,6 @@ export declare const Dropdown: (props: DropdownProps) => import("react/jsx-runti
|
|
|
84
88
|
* @param dismiss - Whether to dismiss the dropdown on click (default: true).
|
|
85
89
|
* @returns JSX Element
|
|
86
90
|
*/
|
|
87
|
-
export declare const DropdownDismiss: ({ children, dismiss
|
|
91
|
+
export declare const DropdownDismiss: ({ children, dismiss }: ChildProp & {
|
|
88
92
|
dismiss?: boolean;
|
|
89
93
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,7 +11,7 @@ import { type DropdownProps } from "./Dropdown";
|
|
|
11
11
|
* @param {string} icon - The icon to be displayed in the dropdown.
|
|
12
12
|
* @param {boolean} groupHover - If true, the dropdown will only be visible when the parent group is hovered.
|
|
13
13
|
* @param {DropdownProps} props - Additional properties for the dropdown.
|
|
14
|
-
* @returns {
|
|
14
|
+
* @returns {React.ReactElement} The rendered DropdownTool component.
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```jsx
|
|
@@ -3,11 +3,11 @@ export interface EmptyContentProps extends CssProp, TestProps, Partial<ChildrenP
|
|
|
3
3
|
/**
|
|
4
4
|
* empty title
|
|
5
5
|
*/
|
|
6
|
-
title?: string |
|
|
6
|
+
title?: string | React.ReactElement;
|
|
7
7
|
/**
|
|
8
8
|
* empty message
|
|
9
9
|
*/
|
|
10
|
-
message: string |
|
|
10
|
+
message: string | React.ReactElement;
|
|
11
11
|
/**
|
|
12
12
|
* content size
|
|
13
13
|
*/
|
|
@@ -29,7 +29,7 @@ export interface EmptyContentProps extends CssProp, TestProps, Partial<ChildrenP
|
|
|
29
29
|
* such as in empty states of lists, tables, or other content areas.
|
|
30
30
|
*
|
|
31
31
|
* @param {EmptyContentProps} props - The properties for the EmptyContent component.
|
|
32
|
-
* @returns {
|
|
32
|
+
* @returns {React.ReactElement} The rendered EmptyContent component.
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
35
35
|
* ```jsx
|
|
@@ -3,7 +3,7 @@ export interface Props extends CssProp, AriaProps, RefProp, TestProps {
|
|
|
3
3
|
/**
|
|
4
4
|
* svg path / webfont className / 1-4 letter text
|
|
5
5
|
*/
|
|
6
|
-
icon: string |
|
|
6
|
+
icon: string | React.ReactElement;
|
|
7
7
|
/**
|
|
8
8
|
* icon image source URL, if failed to load then shows icon
|
|
9
9
|
*/
|
|
@@ -42,8 +42,7 @@ export interface Props extends CssProp, AriaProps, RefProp, TestProps {
|
|
|
42
42
|
*/
|
|
43
43
|
onClick?: React.MouseEventHandler;
|
|
44
44
|
}
|
|
45
|
-
export type IconProps = string |
|
|
46
|
-
export declare const getIconProps: (props: IconProps) => Props;
|
|
45
|
+
export type IconProps = string | React.ReactElement | Pick<Props, "icon" | "iconSrc" | "bg" | "color" | "size" | "rtlFlip" | "viewBox" | "rounded" | "animate">;
|
|
47
46
|
/**
|
|
48
47
|
* A versatile icon component that supports SVG paths, webfont icons, and text icons.
|
|
49
48
|
* It can be styled with background color, icon color, size, and animations.
|
|
@@ -53,7 +52,7 @@ export declare const getIconProps: (props: IconProps) => Props;
|
|
|
53
52
|
* These include `bg`, `color`, `size`, `rtlFlip`, `animate`, and `rounded`.
|
|
54
53
|
*
|
|
55
54
|
* @param {IconProps} props - The properties for the Icon component.
|
|
56
|
-
* @returns {
|
|
55
|
+
* @returns {React.ReactElement} The rendered Icon component.
|
|
57
56
|
*
|
|
58
57
|
* @example
|
|
59
58
|
* ```jsx
|
|
@@ -2,7 +2,7 @@ export { ActionLabel } from "./actionLabel/ActionLabel";
|
|
|
2
2
|
export { AnimationIndicator, AnimationLoader, LoadingBars, LoadingLine, LoadingSpinner, Skeleton, } from "./animations/Animations";
|
|
3
3
|
export { Avatar } from "./avatar/Avatar";
|
|
4
4
|
export { AvatarGroup } from "./avatar/AvatarGroup";
|
|
5
|
-
export { Badge
|
|
5
|
+
export { Badge } from "./badge/Badge";
|
|
6
6
|
export { Breadcrumbs } from "./breadcrumbs/Breadcrumbs";
|
|
7
7
|
export { Button } from "./button/Button";
|
|
8
8
|
export { ButtonGroup } from "./button/ButtonGroup";
|
|
@@ -18,7 +18,7 @@ export { Divider } from "./divider/Divider";
|
|
|
18
18
|
export { Dropdown, DropdownDismiss } from "./dropdown/Dropdown";
|
|
19
19
|
export { DropdownTool } from "./dropdown/DropdownTool";
|
|
20
20
|
export { EmptyContent } from "./empty/EmptyContent";
|
|
21
|
-
export {
|
|
21
|
+
export { Icon } from "./icon/Icon";
|
|
22
22
|
export { Image, Video } from "./media/Media";
|
|
23
23
|
export { ContextMenu } from "./menu/ContextMenu";
|
|
24
24
|
export { Menu } from "./menu/Menu";
|
|
@@ -41,7 +41,7 @@ export interface VideoProps extends BaseProps {
|
|
|
41
41
|
* It automatically adjusts the display based on the provided fit property, allowing for different styles such as cover, contain, or fill.
|
|
42
42
|
*
|
|
43
43
|
* @param {ImageProps | VideoProps} props - The properties for the Media component.
|
|
44
|
-
* @returns {
|
|
44
|
+
* @returns {React.ReactElement} The rendered Media component.
|
|
45
45
|
*
|
|
46
46
|
* @example
|
|
47
47
|
* ```jsx
|
|
@@ -70,7 +70,7 @@ export declare const Image: ({ src, alt, reel, fit, className, ...aria }: ImageP
|
|
|
70
70
|
* It also includes a reel decoration for a more engaging visual presentation.
|
|
71
71
|
*
|
|
72
72
|
* @param {VideoProps} props - The properties for the Video component.
|
|
73
|
-
* @returns {
|
|
73
|
+
* @returns {React.ReactElement} The rendered Video component.
|
|
74
74
|
*
|
|
75
75
|
* @example
|
|
76
76
|
* ```jsx
|
|
@@ -10,7 +10,7 @@ export interface ContextMenuProps extends ChildrenProp {
|
|
|
10
10
|
* This component is useful for creating custom context menus that can be triggered by right-clicking on elements.
|
|
11
11
|
*
|
|
12
12
|
* @param {ContextMenuProps} props - The properties for the ContextMenu component.
|
|
13
|
-
* @returns {
|
|
13
|
+
* @returns {React.ReactElement} The rendered ContextMenu component.
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```jsx
|
|
@@ -6,7 +6,7 @@ import { type MenuProps } from "./types";
|
|
|
6
6
|
* It can be nested within other menus to create complex menu structures.
|
|
7
7
|
*
|
|
8
8
|
* @param {MenuProps} props - The properties for the Menu component.
|
|
9
|
-
* @returns {
|
|
9
|
+
* @returns {React.ReactElement} The rendered Menu component.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```jsx
|
|
@@ -13,7 +13,7 @@ export interface MenuItemProps extends CssProp, AriaProps, TestProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* append label badge text
|
|
15
15
|
*/
|
|
16
|
-
appendLabel?:
|
|
16
|
+
appendLabel?: React.ReactElement | string | number | false;
|
|
17
17
|
/**
|
|
18
18
|
* menu color
|
|
19
19
|
*/
|
|
@@ -17,7 +17,7 @@ export interface MeterProps extends CssProp, AriaProps, TestProps {
|
|
|
17
17
|
* The component can also display a label showing the percentage value.
|
|
18
18
|
*
|
|
19
19
|
* @param {MeterProps} props - The properties for the Meter component.
|
|
20
|
-
* @returns {
|
|
20
|
+
* @returns {React.ReactElement} The rendered Meter component.
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```jsx
|
|
@@ -23,7 +23,7 @@ export interface NavigatorProps extends CssProp, AriaProps, TestProps, Partial<C
|
|
|
23
23
|
* It includes previous and next buttons, and supports keyboard navigation.
|
|
24
24
|
*
|
|
25
25
|
* @param {NavigatorProps} props - The properties for the Navigator component.
|
|
26
|
-
* @returns {
|
|
26
|
+
* @returns {React.ReactElement} The rendered Navigator component.
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* ```jsx
|
|
@@ -14,7 +14,7 @@ export interface PanelProps extends CssProp, AriaProps, TestProps, ExpandProps,
|
|
|
14
14
|
/**
|
|
15
15
|
* header actions
|
|
16
16
|
*/
|
|
17
|
-
actions?:
|
|
17
|
+
actions?: React.ReactElement;
|
|
18
18
|
/**
|
|
19
19
|
* header css classname(s)
|
|
20
20
|
*/
|
|
@@ -69,7 +69,7 @@ export interface PanelProps extends CssProp, AriaProps, TestProps, ExpandProps,
|
|
|
69
69
|
* It can be used in various applications where panels are needed, such as dashboards, settings pages, or content management systems.
|
|
70
70
|
*
|
|
71
71
|
* @param {PanelProps} props - The properties for the Panel component.
|
|
72
|
-
* @returns {
|
|
72
|
+
* @returns {React.ReactElement} The rendered Panel component.
|
|
73
73
|
*
|
|
74
74
|
* @example
|
|
75
75
|
* ```jsx
|
|
@@ -17,7 +17,7 @@ export interface PanelGroupProps extends ChildrenProp {
|
|
|
17
17
|
* It uses the `Panel` component to render each individual panel within the group.
|
|
18
18
|
*
|
|
19
19
|
* @param {PanelGroupProps} props - The properties for the PanelGroup component.
|
|
20
|
-
* @returns {
|
|
20
|
+
* @returns {React.ReactElement} The rendered PanelGroup component.
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```jsx
|
|
@@ -24,7 +24,7 @@ export interface PanelStackProps extends CssProp, ChildrenProp {
|
|
|
24
24
|
* and it updates the active panel based on user interactions.
|
|
25
25
|
*
|
|
26
26
|
* @param {PanelStackProps} props - The properties for the PanelStack component.
|
|
27
|
-
* @returns {
|
|
27
|
+
* @returns {React.ReactElement} The rendered PanelStack component.
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* ```jsx
|
|
@@ -28,7 +28,7 @@ export interface ProgressProps {
|
|
|
28
28
|
* The label can be customized or hidden based on the props provided.
|
|
29
29
|
*
|
|
30
30
|
* @param {ProgressProps} props - The properties for the ProgressBar component.
|
|
31
|
-
* @returns {
|
|
31
|
+
* @returns {React.ReactElement} The rendered ProgressBar component.
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* ```jsx
|
|
@@ -19,7 +19,7 @@ export interface ProgressProps {
|
|
|
19
19
|
* The component is customizable with size and color props.
|
|
20
20
|
*
|
|
21
21
|
* @param {ProgressProps} props - The properties for the ProgressCircle component.
|
|
22
|
-
* @returns {
|
|
22
|
+
* @returns {React.ReactElement} - A circular progress indicator.
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```jsx
|
|
@@ -53,7 +53,7 @@ export interface TabProps extends Partial<ChildrenProp>, CssProp, RefProp, AriaP
|
|
|
53
53
|
* It also supports tooltips, active states, and click handling.
|
|
54
54
|
*
|
|
55
55
|
* @param {TabProps} props - The properties for the Tab component.
|
|
56
|
-
* @returns {
|
|
56
|
+
* @returns {React.ReactElement} The rendered Tab component.
|
|
57
57
|
*
|
|
58
58
|
* @example
|
|
59
59
|
* ```jsx
|
|
@@ -63,7 +63,7 @@ export interface TabPanelProps extends ChildrenProp<typeof Tab> {
|
|
|
63
63
|
* It can be customized with different styles and behaviors to fit the needs of the application.
|
|
64
64
|
*
|
|
65
65
|
* @param {TabPanelProps} props - The properties for the TabPanel component.
|
|
66
|
-
* @returns {
|
|
66
|
+
* @returns {React.ReactElement} The rendered TabPanel component.
|
|
67
67
|
*
|
|
68
68
|
* @example
|
|
69
69
|
* ```jsx
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type ComponentType, type FC, type PropsWithChildren } from "react";
|
|
2
|
-
import { type NotificationManagerRef } from "./NotificationCenter";
|
|
3
2
|
interface State {
|
|
4
3
|
locale: string;
|
|
5
4
|
colorScheme: "light" | "dark";
|
|
@@ -16,89 +15,8 @@ export interface GlobalProps extends PropsWithChildren {
|
|
|
16
15
|
defaultCalendar?: State["calendar"];
|
|
17
16
|
defaultColorScheme?: State["colorScheme"];
|
|
18
17
|
}
|
|
19
|
-
interface GlobalContextType {
|
|
20
|
-
/**
|
|
21
|
-
* change language locale
|
|
22
|
-
* @param locale
|
|
23
|
-
*/
|
|
24
|
-
changeLocale: (locale: string) => string;
|
|
25
|
-
/**
|
|
26
|
-
* change date calendat
|
|
27
|
-
* @param locale
|
|
28
|
-
*/
|
|
29
|
-
changeCalendar: (calendar: State["calendar"]) => State["calendar"];
|
|
30
|
-
/**
|
|
31
|
-
* toggle theme between light and dark
|
|
32
|
-
* or force to theme provided
|
|
33
|
-
* @param theme
|
|
34
|
-
*/
|
|
35
|
-
toggleColorScheme: (colorScheme?: State["colorScheme"]) => State["colorScheme"];
|
|
36
|
-
/**
|
|
37
|
-
* application default error display
|
|
38
|
-
*/
|
|
39
|
-
errorElement: GlobalProps["errorElement"];
|
|
40
|
-
currentLocale: string;
|
|
41
|
-
currentCalendar: State["calendar"];
|
|
42
|
-
currentColorScheme: State["colorScheme"];
|
|
43
|
-
notificationManager: NotificationManagerRef;
|
|
44
|
-
}
|
|
45
|
-
export declare const GlobalContext: import("react").Context<GlobalContextType>;
|
|
46
18
|
/**
|
|
47
19
|
* global context provider
|
|
48
20
|
*/
|
|
49
21
|
export declare const ApplicationProvider: FC<GlobalProps>;
|
|
50
|
-
/**
|
|
51
|
-
* internal usage only
|
|
52
|
-
* @internal
|
|
53
|
-
*/
|
|
54
|
-
export declare const useGlobals: () => GlobalContextType;
|
|
55
|
-
/**
|
|
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
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
export declare const useApplicationContext: () => {
|
|
67
|
-
/**
|
|
68
|
-
* change language locale
|
|
69
|
-
* @param locale
|
|
70
|
-
*/
|
|
71
|
-
changeLocale: (locale: string) => string;
|
|
72
|
-
/**
|
|
73
|
-
* change date calendat
|
|
74
|
-
* @param locale
|
|
75
|
-
*/
|
|
76
|
-
changeCalendar: (calendar: State["calendar"]) => State["calendar"];
|
|
77
|
-
/**
|
|
78
|
-
* toggle theme between light and dark
|
|
79
|
-
* or force to theme provided
|
|
80
|
-
* @param theme
|
|
81
|
-
*/
|
|
82
|
-
toggleColorScheme: (colorScheme?: State["colorScheme"]) => State["colorScheme"];
|
|
83
|
-
currentLocale: string;
|
|
84
|
-
currentCalendar: State["calendar"];
|
|
85
|
-
currentColorScheme: State["colorScheme"];
|
|
86
|
-
notificationManager: NotificationManagerRef;
|
|
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
|
-
*/
|
|
103
|
-
export declare const useNotificationService: () => NotificationManagerRef;
|
|
104
22
|
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { State } from "storybook/manager-api";
|
|
2
|
+
import { GlobalProps } from "./Global";
|
|
3
|
+
import { NotificationManagerRef } from "./NotificationCenter";
|
|
4
|
+
interface GlobalContextType {
|
|
5
|
+
/**
|
|
6
|
+
* change language locale
|
|
7
|
+
* @param locale
|
|
8
|
+
*/
|
|
9
|
+
changeLocale: (locale: string) => string;
|
|
10
|
+
/**
|
|
11
|
+
* change date calendar
|
|
12
|
+
* @param locale
|
|
13
|
+
*/
|
|
14
|
+
changeCalendar: (calendar: State["calendar"]) => State["calendar"];
|
|
15
|
+
/**
|
|
16
|
+
* toggle theme between light and dark
|
|
17
|
+
* or force to theme provided
|
|
18
|
+
* @param theme
|
|
19
|
+
*/
|
|
20
|
+
toggleColorScheme: (colorScheme?: State["colorScheme"]) => State["colorScheme"];
|
|
21
|
+
/**
|
|
22
|
+
* application default error display
|
|
23
|
+
*/
|
|
24
|
+
errorElement: GlobalProps["errorElement"];
|
|
25
|
+
currentLocale: string;
|
|
26
|
+
currentCalendar: State["calendar"];
|
|
27
|
+
currentColorScheme: State["colorScheme"];
|
|
28
|
+
notificationManager: NotificationManagerRef;
|
|
29
|
+
}
|
|
30
|
+
export declare const GlobalContext: import("react").Context<GlobalContextType>;
|
|
31
|
+
/**
|
|
32
|
+
* internal usage only
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare const useGlobals: () => GlobalContextType;
|
|
36
|
+
/**
|
|
37
|
+
* Hook to access the global application context.
|
|
38
|
+
* This hook provides access to the global context values, including the current locale, calendar, and color scheme.
|
|
39
|
+
*
|
|
40
|
+
* @returns {GlobalContextType} The global context values excluding the error element.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```jsx
|
|
44
|
+
* const { changeLocale, currentLocale, toggleColorScheme } = useApplicationContext();
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare const useApplicationContext: () => {
|
|
48
|
+
/**
|
|
49
|
+
* change language locale
|
|
50
|
+
* @param locale
|
|
51
|
+
*/
|
|
52
|
+
changeLocale: (locale: string) => string;
|
|
53
|
+
/**
|
|
54
|
+
* change date calendar
|
|
55
|
+
* @param locale
|
|
56
|
+
*/
|
|
57
|
+
changeCalendar: (calendar: State["calendar"]) => State["calendar"];
|
|
58
|
+
/**
|
|
59
|
+
* toggle theme between light and dark
|
|
60
|
+
* or force to theme provided
|
|
61
|
+
* @param theme
|
|
62
|
+
*/
|
|
63
|
+
toggleColorScheme: (colorScheme?: State["colorScheme"]) => State["colorScheme"];
|
|
64
|
+
currentLocale: string;
|
|
65
|
+
currentCalendar: State["calendar"];
|
|
66
|
+
currentColorScheme: State["colorScheme"];
|
|
67
|
+
notificationManager: NotificationManagerRef;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Hook to access the notification manager from the global context.
|
|
71
|
+
* This hook provides methods to show alerts, errors, messages, and toasts.
|
|
72
|
+
* It returns a reference to the notification manager, which can be used to display notifications in the application.
|
|
73
|
+
*
|
|
74
|
+
* @returns {NotificationManagerRef} The notification manager reference.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```jsx
|
|
78
|
+
* const notificationService = useNotificationService();
|
|
79
|
+
* notificationService.showMessage("Hello World");
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-notifications--notifications} for more details on available methods.
|
|
83
|
+
*/
|
|
84
|
+
export declare const useNotificationService: () => NotificationManagerRef;
|
|
85
|
+
export {};
|
|
@@ -16,7 +16,7 @@ export interface AsideProps extends ChildrenProp, CollapseProps, CssProp, TestPr
|
|
|
16
16
|
/**
|
|
17
17
|
* header actions
|
|
18
18
|
*/
|
|
19
|
-
actions?: Elements<
|
|
19
|
+
actions?: Elements<React.ReactElement>;
|
|
20
20
|
/**
|
|
21
21
|
* header class
|
|
22
22
|
*/
|
|
@@ -60,7 +60,7 @@ export interface AsideProps extends ChildrenProp, CollapseProps, CssProp, TestPr
|
|
|
60
60
|
* It can be aligned to the start or end of the page.
|
|
61
61
|
*
|
|
62
62
|
* @param {AsideProps} props - The properties for the Aside component.
|
|
63
|
-
* @returns {
|
|
63
|
+
* @returns {React.ReactElement} The rendered Aside component.
|
|
64
64
|
*
|
|
65
65
|
* @example
|
|
66
66
|
* ```jsx
|