@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
|
@@ -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.
|
|
@@ -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,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
|
*/
|
|
@@ -21,11 +21,11 @@ export interface FlyoutProps extends AriaProps, TestProps, ChildrenProp {
|
|
|
21
21
|
/**
|
|
22
22
|
* modal title
|
|
23
23
|
*/
|
|
24
|
-
title?:
|
|
24
|
+
title?: React.ReactElement | string | false;
|
|
25
25
|
/**
|
|
26
26
|
* header actions
|
|
27
27
|
*/
|
|
28
|
-
actions?: Elements<
|
|
28
|
+
actions?: Elements<React.ReactElement>;
|
|
29
29
|
/**
|
|
30
30
|
* modal size
|
|
31
31
|
*/
|
|
@@ -19,7 +19,7 @@ export interface MessageProps {
|
|
|
19
19
|
/**
|
|
20
20
|
* message text
|
|
21
21
|
*/
|
|
22
|
-
message: string |
|
|
22
|
+
message: string | React.ReactElement;
|
|
23
23
|
/**
|
|
24
24
|
* theme color
|
|
25
25
|
*/
|
|
@@ -27,6 +27,6 @@ export interface MessageProps {
|
|
|
27
27
|
/**
|
|
28
28
|
* extra action button
|
|
29
29
|
*/
|
|
30
|
-
actions?: Elements<
|
|
30
|
+
actions?: Elements<React.ReactElement>;
|
|
31
31
|
}
|
|
32
32
|
export declare const Message: ({ title, message, color, icon, iconSrc, rtlFlip, actions, onClose, }: MessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -17,11 +17,11 @@ export interface ModalProps extends AriaProps, TestProps, ChildrenProp {
|
|
|
17
17
|
/**
|
|
18
18
|
* modal title
|
|
19
19
|
*/
|
|
20
|
-
title?:
|
|
20
|
+
title?: React.ReactElement | string | false;
|
|
21
21
|
/**
|
|
22
22
|
* header actions
|
|
23
23
|
*/
|
|
24
|
-
actions?: Elements<
|
|
24
|
+
actions?: Elements<React.ReactElement>;
|
|
25
25
|
/**
|
|
26
26
|
* modal size
|
|
27
27
|
*/
|
|
@@ -23,7 +23,7 @@ export interface ToastProps {
|
|
|
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 ToastProps {
|
|
|
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
|
*/
|
|
@@ -12,7 +12,4 @@ export interface TooltipProps extends TooltipType, RefProp {
|
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
children: ReactElement<KeyValue>;
|
|
14
14
|
}
|
|
15
|
-
export declare const getTooltipProps: (tooltip?: string | TooltipType, innerRef?: AnyObject) => (TooltipType & {
|
|
16
|
-
ref: AnyObject;
|
|
17
|
-
}) | undefined;
|
|
18
15
|
export declare const Tooltip: ({ ref, children, color, textColor, content, open, copyContent, disabled, placement: _placement, ...rest }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Placement } from "@floating-ui/react";
|
|
2
|
-
import { type JSXElementConstructor, type Ref } from "react";
|
|
2
|
+
import { type JSX, type JSXElementConstructor, type Ref } from "react";
|
|
3
3
|
export type ModalProps<P = unknown> = P & {
|
|
4
4
|
onClose: (...args: AnyObject) => void;
|
|
5
5
|
};
|
|
@@ -14,7 +14,7 @@ export interface TooltipType {
|
|
|
14
14
|
/**
|
|
15
15
|
* tooltip content
|
|
16
16
|
*/
|
|
17
|
-
content?: string |
|
|
17
|
+
content?: string | React.ReactElement;
|
|
18
18
|
/**
|
|
19
19
|
* tooltip color
|
|
20
20
|
*/
|
|
@@ -9,15 +9,11 @@ export interface AbbrProps extends ChildProp<string>, CssProp {
|
|
|
9
9
|
*
|
|
10
10
|
* [textPart, tooltip, color (class name or color string)]
|
|
11
11
|
*/
|
|
12
|
-
abbr: Array<[
|
|
13
|
-
textPart: string,
|
|
14
|
-
tooltip: string,
|
|
15
|
-
color?: ColorType | PaletteType | string
|
|
16
|
-
]>;
|
|
12
|
+
abbr: Array<[textPart: string, tooltip: string, color?: ColorType | PaletteType | string]>;
|
|
17
13
|
/**
|
|
18
14
|
* renderer callback
|
|
19
15
|
*/
|
|
20
|
-
renderer?: (part: string[]) =>
|
|
16
|
+
renderer?: (part: string[]) => React.ReactElement;
|
|
21
17
|
}
|
|
22
18
|
/**
|
|
23
19
|
* A component that renders abbreviated text with tooltips for additional information.
|
|
@@ -28,7 +24,7 @@ export interface AbbrProps extends ChildProp<string>, CssProp {
|
|
|
28
24
|
* while providing additional context through tooltips.
|
|
29
25
|
*
|
|
30
26
|
* @param {AbbrProps} props - The properties for the Abbr component.
|
|
31
|
-
* @returns {
|
|
27
|
+
* @returns {React.ReactElement} The rendered Abbr component.
|
|
32
28
|
*
|
|
33
29
|
* @example
|
|
34
30
|
* ```jsx
|
|
@@ -49,4 +45,4 @@ export interface AbbrProps extends ChildProp<string>, CssProp {
|
|
|
49
45
|
*
|
|
50
46
|
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-typography--abbr} for more details.
|
|
51
47
|
*/
|
|
52
|
-
export declare const Abbr: ({ children, abbr, className, renderer, copyContent
|
|
48
|
+
export declare const Abbr: ({ children, abbr, className, renderer, copyContent }: AbbrProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -27,7 +27,7 @@ export interface AnchorProps extends ChildrenProp, CssProp, RefProp, AriaProps {
|
|
|
27
27
|
*
|
|
28
28
|
* @param {AnchorProps} props - The properties for the Anchor component.
|
|
29
29
|
* @param {Tag} as - The HTML element type to render as (default is "a").
|
|
30
|
-
* @returns {
|
|
30
|
+
* @returns {React.ReactElement} - A styled anchor element with the specified properties.
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```jsx
|
|
@@ -5,7 +5,7 @@ import { type CssProp, type SizeType } from "../types";
|
|
|
5
5
|
* The button displays a tooltip feedback when the text is successfully copied.
|
|
6
6
|
*
|
|
7
7
|
* @param {CopyProps} props - The properties for the Copy component.
|
|
8
|
-
* @returns {
|
|
8
|
+
* @returns {React.ReactElement} The rendered Copy component.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* ```jsx
|
|
@@ -9,7 +9,7 @@ export interface MarkProps extends ChildProp<string> {
|
|
|
9
9
|
/**
|
|
10
10
|
* renderer callback
|
|
11
11
|
*/
|
|
12
|
-
renderer?: (part: string[]) =>
|
|
12
|
+
renderer?: (part: string[]) => React.ReactElement;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* A component that highlights specific text parts with a mark element, allowing for custom rendering and color.
|
|
@@ -19,7 +19,7 @@ export interface MarkProps extends ChildProp<string> {
|
|
|
19
19
|
* allowing for greater flexibility in how the text is presented.
|
|
20
20
|
*
|
|
21
21
|
* @param {MarkProps} props - The properties for the Mark component.
|
|
22
|
-
* @returns {
|
|
22
|
+
* @returns {React.ReactElement} The rendered Mark component.
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* <Mark
|
|
@@ -37,7 +37,7 @@ export interface TextProps extends ChildrenProp, CssProp, AriaProps, TestProps {
|
|
|
37
37
|
* It leverages the ResizeObserver API to detect changes in the text container's size and adjust the line clamping accordingly.
|
|
38
38
|
*
|
|
39
39
|
* @param {TextProps} props - The properties for the Text component.
|
|
40
|
-
* @returns {
|
|
40
|
+
* @returns {React.ReactElement} The rendered Text component.
|
|
41
41
|
*
|
|
42
42
|
* @example
|
|
43
43
|
* ```jsx
|
|
@@ -29,7 +29,7 @@ export interface TitleProps extends ChildrenProp, CssProp, AriaProps {
|
|
|
29
29
|
* This component is useful for creating headings or titles in a consistent style across an application.
|
|
30
30
|
*
|
|
31
31
|
* @param {TitleProps} props - The properties for the Title component.
|
|
32
|
-
* @returns {
|
|
32
|
+
* @returns {React.ReactElement} The rendered Title component.
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
35
35
|
* ```jsx
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BadgeType } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Utility function to get badge properties from a badge value or object.
|
|
4
|
+
* It checks if the badge is an object and returns its properties,
|
|
5
|
+
*
|
|
6
|
+
* @param {string | number | BadgeType} badge - The badge value or object.
|
|
7
|
+
* @returns {AnyObject} An object containing badge properties.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getBadgeProps: (badge?: string | number | BadgeType) => AnyObject;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/core",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.63",
|
|
4
4
|
"description": "RUF: Core package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,27 +35,26 @@
|
|
|
35
35
|
"watch": "npm-run-all -p watch:rollup watch:dts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@floating-ui/react": "~0.27.
|
|
38
|
+
"@floating-ui/react": "~0.27.19",
|
|
39
39
|
"@iconify-json/mdi": "~1.2.3",
|
|
40
40
|
"@iconify-json/svg-spinners": "~1.2.4",
|
|
41
|
-
"@iconify/tailwind4": "~1.2.
|
|
42
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
43
|
-
"@tailwindcss/postcss": "~4.1
|
|
44
|
-
"boring-avatars": "~
|
|
41
|
+
"@iconify/tailwind4": "~1.2.3",
|
|
42
|
+
"@react-fabric/utilities": "^1.0.0-beta.63",
|
|
43
|
+
"@tailwindcss/postcss": "~4.2.1",
|
|
44
|
+
"boring-avatars": "~2.0.4",
|
|
45
45
|
"classnames": "~2.5.1",
|
|
46
|
-
"color": "~5.0.2",
|
|
47
46
|
"resize-observer-polyfill": "~1.5.1",
|
|
48
|
-
"tailwindcss": "~4.1
|
|
47
|
+
"tailwindcss": "~4.2.1"
|
|
49
48
|
},
|
|
50
49
|
"peerDependencies": {
|
|
51
|
-
"i18next": "~25.
|
|
52
|
-
"react": "~19.2.
|
|
53
|
-
"react-dom": "~19.2.
|
|
54
|
-
"react-i18next": "~16.
|
|
50
|
+
"i18next": "~25.8.18",
|
|
51
|
+
"react": "~19.2.4",
|
|
52
|
+
"react-dom": "~19.2.4",
|
|
53
|
+
"react-i18next": "~16.5.8"
|
|
55
54
|
},
|
|
56
55
|
"engines": {
|
|
57
|
-
"node": ">=18.
|
|
58
|
-
"npm": ">=8.
|
|
56
|
+
"node": ">=22.18.0",
|
|
57
|
+
"npm": ">=10.8.0"
|
|
59
58
|
},
|
|
60
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "6e0652b15c6384fbc316842862572e21299a5466"
|
|
61
60
|
}
|
|
@@ -59,7 +59,7 @@ export interface ActionLabelProps
|
|
|
59
59
|
* It supports custom alignment, disabled states, and can be easily styled with additional CSS classes.
|
|
60
60
|
*
|
|
61
61
|
* @param {ActionLabelProps} props - The properties for the ActionLabel component.
|
|
62
|
-
* @returns {
|
|
62
|
+
* @returns {React.ReactElement} The rendered ActionLabel component.
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
65
|
* ```jsx
|
|
@@ -51,7 +51,7 @@ export interface AnimationProps extends CssProp, AriaProps {
|
|
|
51
51
|
* It also allows customization of the icon color and stroke color.
|
|
52
52
|
*
|
|
53
53
|
* @param {AnimationProps} props - The properties for the AnimationIndicator component.
|
|
54
|
-
* @returns {
|
|
54
|
+
* @returns {React.ReactElement} The rendered AnimationIndicator component.
|
|
55
55
|
*
|
|
56
56
|
* @example
|
|
57
57
|
* ```jsx
|
|
@@ -134,7 +134,7 @@ export const AnimationIndicator = ({
|
|
|
134
134
|
* @param {number | string} [props.size="2rem"] - The size of the loader icon.
|
|
135
135
|
* @param {string} props.icon - The icon to be displayed as the loader.
|
|
136
136
|
* @param {"sm" | "md" | "lg"} [props.maskBlur] - The blur effect for the background mask.
|
|
137
|
-
* @returns {
|
|
137
|
+
* @returns {React.ReactElement} The rendered AnimationLoader component.
|
|
138
138
|
*/
|
|
139
139
|
export const AnimationLoader = ({
|
|
140
140
|
color = "tint-500",
|
|
@@ -178,7 +178,7 @@ export const AnimationLoader = ({
|
|
|
178
178
|
* @param {Object} props - The properties for the LoadingBars component.
|
|
179
179
|
* @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the bars.
|
|
180
180
|
* @param {number | string} [props.size="2rem"] - The size of the bars.
|
|
181
|
-
* @returns {
|
|
181
|
+
* @returns {React.ReactElement} The rendered LoadingBars component.
|
|
182
182
|
*
|
|
183
183
|
* @example
|
|
184
184
|
* ```jsx
|
|
@@ -205,7 +205,7 @@ export const LoadingBars = (props: {
|
|
|
205
205
|
* @param {Object} props - The properties for the LoadingSpinner component.
|
|
206
206
|
* @param {ColorType | PaletteType | string} [props.color="tint-700"] - The color of the spinner.
|
|
207
207
|
* @param {number | string} [props.size="2rem"] - The size of the spinner.
|
|
208
|
-
* @returns {
|
|
208
|
+
* @returns {React.ReactElement} The rendered LoadingSpinner component.
|
|
209
209
|
*
|
|
210
210
|
* @example
|
|
211
211
|
* ```jsx
|
|
@@ -229,7 +229,7 @@ export const LoadingSpinner = (props: {
|
|
|
229
229
|
* providing a visual placeholder for content that is being loaded.
|
|
230
230
|
*
|
|
231
231
|
* @param {CssProp} props - The properties for the Skeleton component.
|
|
232
|
-
* @returns {
|
|
232
|
+
* @returns {React.ReactElement} The rendered Skeleton component.
|
|
233
233
|
*
|
|
234
234
|
* @example
|
|
235
235
|
* ```jsx
|
|
@@ -266,7 +266,7 @@ export const Skeleton = ({ className, ...rest }: CssProp) => {
|
|
|
266
266
|
* A component that displays a loading animation with a top border.
|
|
267
267
|
* It is typically used to indicate that content is being loaded in pages and page sections.
|
|
268
268
|
*
|
|
269
|
-
* @returns {
|
|
269
|
+
* @returns {React.ReactElement} The rendered Loading component.
|
|
270
270
|
*/
|
|
271
271
|
export const LoadingLine = () => {
|
|
272
272
|
return (
|
|
@@ -99,7 +99,7 @@ const SizeMap: KeyValue<string> = {
|
|
|
99
99
|
* It uses the Boring Avatars library for generating fallback avatars based on the user's name.
|
|
100
100
|
*
|
|
101
101
|
* @param {AvatarProps} props - The properties for the Avatar component.
|
|
102
|
-
* @returns {
|
|
102
|
+
* @returns {React.ReactElement} The rendered Avatar component.
|
|
103
103
|
*
|
|
104
104
|
* @example
|
|
105
105
|
* ```jsx
|
|
@@ -68,7 +68,7 @@ const SizeMap: KeyValue<string> = {
|
|
|
68
68
|
* It automatically calculates the number of additional avatars based on the `totalCount` prop and the number of children provided.
|
|
69
69
|
*
|
|
70
70
|
* @param {AvatarGroupProps} props - The properties for the AvatarGroup component.
|
|
71
|
-
* @returns {
|
|
71
|
+
* @returns {React.ReactElement} The rendered AvatarGroup component.
|
|
72
72
|
*
|
|
73
73
|
* @example
|
|
74
74
|
* ```jsx
|
|
@@ -21,16 +21,12 @@
|
|
|
21
21
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { isNil, isNumber,
|
|
24
|
+
import { isNil, isNumber, mergeRefs } from "@react-fabric/utilities";
|
|
25
25
|
import classNames from "classnames";
|
|
26
26
|
import { cloneElement, isValidElement, useMemo } from "react";
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
type CssProp,
|
|
31
|
-
type RefProp,
|
|
32
|
-
} from "../../types";
|
|
33
|
-
import { getIconProps, Icon, type IconProps } from "../icon/Icon";
|
|
27
|
+
import { type ChildProp, type CssProp, type RefProp } from "../../types";
|
|
28
|
+
import { getIconProps } from "../../utils";
|
|
29
|
+
import { Icon, type IconProps } from "../icon/Icon";
|
|
34
30
|
|
|
35
31
|
export interface BadgeProps extends CssProp, RefProp, Partial<ChildProp> {
|
|
36
32
|
/**
|
|
@@ -60,38 +56,9 @@ export interface BadgeProps extends CssProp, RefProp, Partial<ChildProp> {
|
|
|
60
56
|
/**
|
|
61
57
|
* badge placement
|
|
62
58
|
*/
|
|
63
|
-
placement?:
|
|
64
|
-
| "top-start"
|
|
65
|
-
| "top-end"
|
|
66
|
-
| "bottom-start"
|
|
67
|
-
| "bottom-end"
|
|
68
|
-
| "top"
|
|
69
|
-
| "bottom"
|
|
70
|
-
| "start"
|
|
71
|
-
| "end";
|
|
59
|
+
placement?: "top-start" | "top-end" | "bottom-start" | "bottom-end" | "top" | "bottom" | "start" | "end";
|
|
72
60
|
}
|
|
73
61
|
|
|
74
|
-
/**
|
|
75
|
-
* Utility function to get badge properties from a badge value or object.
|
|
76
|
-
* It checks if the badge is an object and returns its properties,
|
|
77
|
-
*
|
|
78
|
-
* @param {string | number | BadgeType} badge - The badge value or object.
|
|
79
|
-
* @returns {AnyObject} An object containing badge properties.
|
|
80
|
-
*/
|
|
81
|
-
export const getBadgeProps = (
|
|
82
|
-
badge?: string | number | BadgeType,
|
|
83
|
-
): AnyObject => {
|
|
84
|
-
if (isObject(badge) && !isValidElement(badge)) {
|
|
85
|
-
return Object.assign({ forButton: true, placement: "" }, badge);
|
|
86
|
-
} else {
|
|
87
|
-
return {
|
|
88
|
-
value: badge,
|
|
89
|
-
forButton: true,
|
|
90
|
-
placement: "",
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
62
|
/**
|
|
96
63
|
* A component that displays a badge with a value, icon, and optional ping animation.
|
|
97
64
|
* It can be used to indicate notifications, messages, or other important information.
|
|
@@ -99,7 +66,7 @@ export const getBadgeProps = (
|
|
|
99
66
|
* It can also wrap children elements, allowing for flexible usage in buttons or other components.
|
|
100
67
|
*
|
|
101
68
|
* @param {BadgeProps} props - The properties for the Badge component.
|
|
102
|
-
* @returns {
|
|
69
|
+
* @returns {React.ReactElement} The rendered Badge component.
|
|
103
70
|
*
|
|
104
71
|
* @example
|
|
105
72
|
* ```jsx
|
|
@@ -137,10 +104,7 @@ export const Badge = ({
|
|
|
137
104
|
}
|
|
138
105
|
}, [value, max]);
|
|
139
106
|
|
|
140
|
-
const innerRef = useMemo(
|
|
141
|
-
() => mergeRefs(ref, (children as AnyObject)?.props.ref),
|
|
142
|
-
[ref, (children as AnyObject)?.props.ref],
|
|
143
|
-
);
|
|
107
|
+
const innerRef = useMemo(() => mergeRefs(ref, (children as AnyObject)?.props.ref), [ref, (children as AnyObject)?.props.ref]);
|
|
144
108
|
|
|
145
109
|
/**
|
|
146
110
|
* wrap children in a relative div to float badge, wrapper allows for floating a badge on elements with overflow hidden
|
|
@@ -166,9 +130,7 @@ export const Badge = ({
|
|
|
166
130
|
"fabric-badge",
|
|
167
131
|
className,
|
|
168
132
|
"inline-block p-px min-w-2 min-h-2 text-center select-none rounded-full leading-none z-2 pointer-events-none",
|
|
169
|
-
(forButton && !placement) || inline
|
|
170
|
-
? "relative flex-content"
|
|
171
|
-
: "absolute",
|
|
133
|
+
(forButton && !placement) || inline ? "relative flex-content" : "absolute",
|
|
172
134
|
)}
|
|
173
135
|
>
|
|
174
136
|
{label && <span className="p-1">{label}</span>}
|
|
@@ -52,7 +52,7 @@ export interface BreadcrumbProps
|
|
|
52
52
|
* 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.
|
|
53
53
|
*
|
|
54
54
|
* @param {BreadcrumbProps} props - The properties for the Breadcrumbs component.
|
|
55
|
-
* @returns {
|
|
55
|
+
* @returns {React.ReactElement} The rendered Breadcrumbs component.
|
|
56
56
|
*
|
|
57
57
|
* @example
|
|
58
58
|
* ```jsx
|