@react-fabric/core 1.0.0-beta.61 → 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 +7 -5
- package/css/components/_button.css +49 -9
- 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 +3 -3
- 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/_theme.css +1 -1
- package/css/core/_viewport.css +1 -5
- package/css/reset/_reset.css +42 -43
- 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 +8 -6
- 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 +28 -14
- package/dist/cjs/components/empty/EmptyContent.js +1 -1
- package/dist/cjs/components/icon/Icon.js +26 -40
- 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 +19 -14
- package/dist/cjs/components/menu/MenuItem.js +5 -4
- package/dist/cjs/components/meter/Meter.js +1 -1
- package/dist/cjs/components/navigator/Navigator.js +6 -6
- 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 +7 -6
- 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 +5 -4
- 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 +11 -10
- package/dist/cjs/hooks/useOverlayService.js +27 -38
- 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/i18n/index.js +4 -4
- package/dist/cjs/index.js +10 -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 +9 -7
- 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 +30 -16
- package/dist/esm/components/empty/EmptyContent.js +1 -1
- package/dist/esm/components/icon/Icon.js +28 -41
- 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 +22 -17
- package/dist/esm/components/menu/MenuItem.js +6 -5
- package/dist/esm/components/meter/Meter.js +1 -1
- package/dist/esm/components/navigator/Navigator.js +7 -7
- 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 +8 -7
- 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 +4 -3
- 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 +12 -11
- package/dist/esm/hooks/useOverlayService.js +28 -39
- 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/i18n/index.js +2 -2
- package/dist/esm/index.js +8 -4
- 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 +3 -3
- 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 +6 -1
- package/dist/types/components/meter/Meter.d.ts +1 -1
- package/dist/types/components/navigator/Navigator.d.ts +7 -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/core/theme/ThemeProvider.d.ts +2 -2
- package/dist/types/hooks/useContextMenu.d.ts +10 -0
- package/dist/types/hooks/useOverlayService.d.ts +3 -5
- 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 -52
- 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 +60 -73
- package/src/components/dropdown/DropdownTool.tsx +1 -1
- package/src/components/empty/EmptyContent.tsx +3 -3
- package/src/components/icon/Icon.tsx +27 -54
- package/src/components/index.ts +5 -4
- package/src/components/media/Media.tsx +3 -3
- package/src/components/menu/ContextMenu.tsx +30 -30
- package/src/components/menu/Menu.tsx +35 -63
- package/src/components/menu/MenuItem.tsx +9 -28
- package/src/components/menu/types.ts +6 -1
- package/src/components/meter/Meter.tsx +1 -1
- package/src/components/navigator/Navigator.tsx +13 -11
- 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 +13 -15
- 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 +5 -8
- 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 +8 -12
- package/src/hooks/useOverlayService.tsx +22 -17
- 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/i18n/index.ts +2 -2
- 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
- /package/dist/cjs/i18n/{ar.json.js → ar/core.json.js} +0 -0
- /package/dist/cjs/i18n/{en.json.js → en/core.json.js} +0 -0
- /package/dist/esm/i18n/{ar.json.js → ar/core.json.js} +0 -0
- /package/dist/esm/i18n/{en.json.js → en/core.json.js} +0 -0
- /package/src/i18n/{ar.json → ar/core.json} +0 -0
- /package/src/i18n/{en.json → en/core.json} +0 -0
|
@@ -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
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { ActionLabel } from "./actionLabel/ActionLabel";
|
|
2
|
-
export {
|
|
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 { Icon
|
|
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?: string | false;
|
|
16
|
+
appendLabel?: React.ReactElement | string | number | false;
|
|
17
17
|
/**
|
|
18
18
|
* menu color
|
|
19
19
|
*/
|
|
@@ -50,6 +50,10 @@ export interface MenuItemProps extends CssProp, AriaProps, TestProps {
|
|
|
50
50
|
export interface MenuRootProps extends CssProp {
|
|
51
51
|
label?: never;
|
|
52
52
|
minimal?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* use this create a dropdown button within menu-item
|
|
55
|
+
*/
|
|
56
|
+
forDropdown?: boolean;
|
|
53
57
|
menuClassName?: never;
|
|
54
58
|
onClick?: (id: string) => CallbackReturn;
|
|
55
59
|
}
|
|
@@ -57,6 +61,7 @@ export interface MenuInnerProps extends MenuItemProps {
|
|
|
57
61
|
label: string;
|
|
58
62
|
minimal?: never;
|
|
59
63
|
trigger?: "hover" | "click";
|
|
64
|
+
forDropdown?: boolean;
|
|
60
65
|
/**
|
|
61
66
|
* floating menu className
|
|
62
67
|
*/
|
|
@@ -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
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type AriaProps, type ChildProp, type ColorType, type CssProp, type PaletteType, type TestProps } from "../../types";
|
|
2
2
|
export interface NavigatorProps extends CssProp, AriaProps, TestProps, Partial<ChildProp> {
|
|
3
|
+
/**
|
|
4
|
+
* item list length (ignore to enable infinite navigation)
|
|
5
|
+
*/
|
|
3
6
|
length?: number;
|
|
7
|
+
/**
|
|
8
|
+
* current item index (ignore to enable infinite navigation)
|
|
9
|
+
*/
|
|
4
10
|
current?: number;
|
|
5
11
|
disableKeyHandlers?: boolean;
|
|
6
12
|
/**
|
|
@@ -17,7 +23,7 @@ export interface NavigatorProps extends CssProp, AriaProps, TestProps, Partial<C
|
|
|
17
23
|
* It includes previous and next buttons, and supports keyboard navigation.
|
|
18
24
|
*
|
|
19
25
|
* @param {NavigatorProps} props - The properties for the Navigator component.
|
|
20
|
-
* @returns {
|
|
26
|
+
* @returns {React.ReactElement} The rendered Navigator component.
|
|
21
27
|
*
|
|
22
28
|
* @example
|
|
23
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
|
|
@@ -8,6 +8,10 @@ export interface ContainerProps extends AriaProps, CssProp, ChildrenProp, TestPr
|
|
|
8
8
|
* gutter size
|
|
9
9
|
*/
|
|
10
10
|
gutter?: SizeTypeWithZero;
|
|
11
|
+
/**
|
|
12
|
+
* use @container size queries for max-width
|
|
13
|
+
*/
|
|
14
|
+
useContainer?: boolean;
|
|
11
15
|
}
|
|
12
16
|
export interface RowProps extends AriaProps, CssProp, ChildrenProp, TestProps {
|
|
13
17
|
/**
|
|
@@ -65,7 +69,7 @@ export interface ColProps extends AriaProps, CssProp, TestProps, Partial<Childre
|
|
|
65
69
|
* </Container>
|
|
66
70
|
* ```
|
|
67
71
|
*/
|
|
68
|
-
export declare const Container: ({ children, fullWidth, className, gutter, ...aria }: ContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
export declare const Container: ({ children, fullWidth, className, gutter, useContainer, ...aria }: ContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
69
73
|
/**
|
|
70
74
|
* Row component that allows for flexible layout of columns.
|
|
71
75
|
* It supports various flex properties, alignment, and wrapping.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ChildrenProp } from "../../types";
|
|
1
|
+
import { type ChildrenProp, type CssProp } from "../../types";
|
|
2
2
|
export interface ThemeProps {
|
|
3
3
|
/**
|
|
4
4
|
* light/dark color scheme
|
|
@@ -54,4 +54,4 @@ export interface ThemeProps {
|
|
|
54
54
|
*
|
|
55
55
|
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--theme-provider} for more details.
|
|
56
56
|
*/
|
|
57
|
-
export declare const ThemeProvider: ({ children, branding, primaryColor, accentColor, tintColor, colorScheme, rounding, }: ThemeProps & ChildrenProp) => import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export declare const ThemeProvider: ({ children, branding, primaryColor, accentColor, tintColor, colorScheme, rounding, className, }: ThemeProps & ChildrenProp & CssProp) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Menu } from "../components/menu/Menu";
|
|
2
|
+
/**
|
|
3
|
+
* A hook that provides a context menu that appears on right-click.
|
|
4
|
+
* It uses the Floating UI library to manage the positioning and interactions of the menu.
|
|
5
|
+
* This hook is useful for creating custom context menus that can be triggered by right-clicking on elements.
|
|
6
|
+
*
|
|
7
|
+
* @param {ContextMenuProps} props - The properties for the ContextMenu hook.
|
|
8
|
+
* @returns {[React.ReactElement | null, (e: MouseEvent) => void]} An array containing the rendered ContextMenu component (or null if not open) and the function to handle right-click events.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useContextMenu: (menu: React.ReactElement<typeof Menu>) => [Overlay: React.ReactNode, onContentMenu: (e: React.MouseEvent) => void];
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { type ElementType } from "react";
|
|
2
1
|
import { type ModalProps } from "../types";
|
|
3
|
-
type OverlayComponent = ElementType<ModalProps<AnyObject>>;
|
|
4
2
|
/**
|
|
5
3
|
* Hook to manage overlay components like modals or flyouts.
|
|
6
4
|
* It provides a way to open an overlay with specified properties and handle its closure.
|
|
@@ -11,7 +9,8 @@ type OverlayComponent = ElementType<ModalProps<AnyObject>>;
|
|
|
11
9
|
* of the overlay when it is closed, allowing you to handle the result in a controlled manner.
|
|
12
10
|
*
|
|
13
11
|
* @param ModalOrFlyout - The component to be used as an overlay.
|
|
14
|
-
* @
|
|
12
|
+
* @param toggleOpen - If true, calling `openOverlay` while an overlay is already open will close the existing one instead of opening a new one.
|
|
13
|
+
* @returns An array containing the current overlay, a function to open it, and a boolean indicating if the overlay is open.
|
|
15
14
|
*
|
|
16
15
|
* @example
|
|
17
16
|
* ```jsx
|
|
@@ -25,5 +24,4 @@ type OverlayComponent = ElementType<ModalProps<AnyObject>>;
|
|
|
25
24
|
* <Overlay />
|
|
26
25
|
* ```
|
|
27
26
|
*/
|
|
28
|
-
export declare const useOverlayService: (ModalOrFlyout:
|
|
29
|
-
export {};
|
|
27
|
+
export declare const useOverlayService: <T extends AnyObject = AnyObject>(ModalOrFlyout: React.FunctionComponent<ModalProps<T>>) => [Overlay: React.FunctionComponent<Partial<T>>, openOverlay: (props?: Partial<T>) => Promise<AnyObject>, closeOverlay: ((args?: AnyObject) => void) | null];
|
|
@@ -1,11 +1,2 @@
|
|
|
1
1
|
import { type FC, type PropsWithChildren } from "react";
|
|
2
|
-
/** @internal */
|
|
3
|
-
export declare const HotKeysContext: import("react").Context<{
|
|
4
|
-
addHotKey: (key: string, handler: () => void, global?: boolean) => void;
|
|
5
|
-
removeHotKey: (key: string) => void;
|
|
6
|
-
}>;
|
|
7
|
-
export declare const useHotKeys: () => {
|
|
8
|
-
addHotKey: (key: string, handler: () => void, global?: boolean) => void;
|
|
9
|
-
removeHotKey: (key: string) => void;
|
|
10
|
-
};
|
|
11
2
|
export declare const HotKeyWrapper: FC<PropsWithChildren>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @internal */
|
|
2
|
+
export declare const HotKeysContext: import("react").Context<{
|
|
3
|
+
addHotKey: (key: string, handler: () => void, global?: boolean) => void;
|
|
4
|
+
removeHotKey: (key: string) => void;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const useHotKeys: () => {
|
|
7
|
+
addHotKey: (key: string, handler: () => void, global?: boolean) => void;
|
|
8
|
+
removeHotKey: (key: string) => void;
|
|
9
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { addTranslationBundle } from "./i18n";
|
|
|
4
4
|
export { Flyout, Modal, Tooltip } from "./overlays";
|
|
5
5
|
export * from "./typography";
|
|
6
6
|
export * from "./hooks/useClientService";
|
|
7
|
+
export * from "./hooks/useContextMenu";
|
|
7
8
|
export * from "./hooks/useDebounce";
|
|
8
9
|
export * from "./hooks/useEffectDebugger";
|
|
9
10
|
export * from "./hooks/useIsDark";
|
|
@@ -18,5 +19,6 @@ export { HotKey } from "./hotkeys/HotKey";
|
|
|
18
19
|
export { HotKeyLabel } from "./hotkeys/HotKeyLabel";
|
|
19
20
|
export { HotKeyWrapper } from "./hotkeys/HotKeyWrapper";
|
|
20
21
|
export { type ModalProps } from "./types";
|
|
21
|
-
export { cloneChildren } from "./utils";
|
|
22
|
-
export {
|
|
22
|
+
export { cloneChildren, getBadgeProps, getIconProps } from "./utils";
|
|
23
|
+
export { useApplicationContext, useNotificationService } from "./context/context";
|
|
24
|
+
export { ApplicationProvider } from "./context/Global";
|
|
@@ -23,7 +23,7 @@ export interface AlertProps {
|
|
|
23
23
|
/**
|
|
24
24
|
* toast text
|
|
25
25
|
*/
|
|
26
|
-
message: string |
|
|
26
|
+
message: string | React.ReactElement;
|
|
27
27
|
/**
|
|
28
28
|
* theme color
|
|
29
29
|
*/
|
|
@@ -31,7 +31,7 @@ export interface AlertProps {
|
|
|
31
31
|
/**
|
|
32
32
|
* extra action button
|
|
33
33
|
*/
|
|
34
|
-
actions?: Elements<
|
|
34
|
+
actions?: Elements<React.ReactElement>;
|
|
35
35
|
/**
|
|
36
36
|
* ok label
|
|
37
37
|
*/
|