@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
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import { useMemo, useRef,
|
|
4
|
+
import { useMemo, useRef, useEffectEvent, useLayoutEffect, Fragment } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { AnimationIndicator } from '../../components/animations/Animations.js';
|
|
7
7
|
import { Button } from '../../components/button/Button.js';
|
|
8
8
|
import { Icon } from '../../components/icon/Icon.js';
|
|
9
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
|
-
import { getColor } from '../../utils/getColor.js';
|
|
11
10
|
import '@react-fabric/utilities';
|
|
11
|
+
import { getColor } from '../../utils/getColor.js';
|
|
12
12
|
|
|
13
13
|
/*
|
|
14
14
|
* React Fabric
|
|
@@ -81,12 +81,12 @@ var Toast = function Toast(_ref) {
|
|
|
81
81
|
}
|
|
82
82
|
}, [color, type, icon, iconSrc, rtlFlip]);
|
|
83
83
|
var elRef = useRef(null);
|
|
84
|
-
var handleClose =
|
|
84
|
+
var handleClose = useEffectEvent(function (ret) {
|
|
85
85
|
elRef.current && (elRef.current.dataset.show = "false");
|
|
86
86
|
setTimeout(function () {
|
|
87
87
|
onClose(ret);
|
|
88
88
|
}, 250);
|
|
89
|
-
}
|
|
89
|
+
});
|
|
90
90
|
useLayoutEffect(function () {
|
|
91
91
|
setTimeout(function () {
|
|
92
92
|
return elRef.current && (elRef.current.dataset.show = "true");
|
|
@@ -94,7 +94,7 @@ var Toast = function Toast(_ref) {
|
|
|
94
94
|
}, []);
|
|
95
95
|
return /*#__PURE__*/jsxs("div", {
|
|
96
96
|
role: "alert",
|
|
97
|
-
className: classNames("fabric-toast", "flex flex-nowrap max-w-sm bg-
|
|
97
|
+
className: classNames("fabric-toast", "flex flex-nowrap max-w-sm bg-default min-w-72 border pointer-events-auto relative overflow-hidden rounded-capped mt-4 select-none"),
|
|
98
98
|
style: {
|
|
99
99
|
borderColor: getColor(color + "-300")
|
|
100
100
|
},
|
|
@@ -4,7 +4,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
6
|
import { useFloating, autoUpdate, shift, flip, offset, arrow, useHover, safePolygon, useInteractions, FloatingPortal, FloatingArrow } from '@floating-ui/react';
|
|
7
|
-
import { mergeRefs, isString
|
|
7
|
+
import { mergeRefs, isString } from '@react-fabric/utilities';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { useRef, useState, useEffect, useMemo, Fragment, cloneElement, isValidElement } from 'react';
|
|
10
10
|
import { Icon } from '../../components/icon/Icon.js';
|
|
@@ -15,22 +15,8 @@ import { getColor } from '../../utils/getColor.js';
|
|
|
15
15
|
var _excluded = ["ref", "children", "color", "textColor", "content", "open", "copyContent", "disabled", "placement"];
|
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
-
var getTooltipProps = function getTooltipProps(tooltip, innerRef) {
|
|
19
|
-
if (isString(tooltip) || /*#__PURE__*/isValidElement(tooltip)) {
|
|
20
|
-
return {
|
|
21
|
-
ref: innerRef,
|
|
22
|
-
placement: "top",
|
|
23
|
-
content: tooltip
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
if (isObject(tooltip)) {
|
|
27
|
-
return Object.assign({
|
|
28
|
-
ref: innerRef,
|
|
29
|
-
placement: "top"
|
|
30
|
-
}, tooltip);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
18
|
var Tooltip = function Tooltip(_ref) {
|
|
19
|
+
var _refs$domReference$cu, _refs$domReference$cu2;
|
|
34
20
|
var ref = _ref.ref,
|
|
35
21
|
children = _ref.children,
|
|
36
22
|
color = _ref.color,
|
|
@@ -111,6 +97,7 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
111
97
|
children: [/*#__PURE__*/cloneElement(children, _objectSpread({
|
|
112
98
|
ref: innerRef
|
|
113
99
|
}, open ? {} : getReferenceProps(rest))), isOpen && content && /*#__PURE__*/jsx(FloatingPortal, {
|
|
100
|
+
root: (_refs$domReference$cu = (_refs$domReference$cu2 = refs.domReference.current) === null || _refs$domReference$cu2 === void 0 ? void 0 : _refs$domReference$cu2.closest(".theme-base")) !== null && _refs$domReference$cu !== void 0 ? _refs$domReference$cu : undefined,
|
|
114
101
|
children: /*#__PURE__*/jsxs("dfn", _objectSpread(_objectSpread({
|
|
115
102
|
"data-ref": "tooltip",
|
|
116
103
|
className: classNames("fabric-tooltip z-(--z-tooltip)", "select-none text-sm not-italic flex py-1 px-2 max-w-lg! rounded shadow-md bg-muted"),
|
|
@@ -141,4 +128,4 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
141
128
|
});
|
|
142
129
|
};
|
|
143
130
|
|
|
144
|
-
export { Tooltip
|
|
131
|
+
export { Tooltip };
|
|
@@ -6,9 +6,10 @@ import { isString, isEmpty, tokenize } from '@react-fabric/utilities';
|
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import { useCallback, Fragment, useMemo } from 'react';
|
|
8
8
|
import { useMemoDebugger } from '../hooks/useEffectDebugger.js';
|
|
9
|
-
import { Tooltip
|
|
9
|
+
import { Tooltip } from '../overlays/tooltip/Tooltip.js';
|
|
10
10
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
11
|
import { getColor } from '../utils/getColor.js';
|
|
12
|
+
import { getTooltipProps } from '../utils/getTooltipProps.js';
|
|
12
13
|
|
|
13
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -44,7 +45,7 @@ var AbbrText = function AbbrText(_ref) {
|
|
|
44
45
|
* while providing additional context through tooltips.
|
|
45
46
|
*
|
|
46
47
|
* @param {AbbrProps} props - The properties for the Abbr component.
|
|
47
|
-
* @returns {
|
|
48
|
+
* @returns {React.ReactElement} The rendered Abbr component.
|
|
48
49
|
*
|
|
49
50
|
* @example
|
|
50
51
|
* ```jsx
|
|
@@ -85,9 +86,7 @@ var Abbr = function Abbr(_ref2) {
|
|
|
85
86
|
}, [renderer, copyContent]);
|
|
86
87
|
|
|
87
88
|
/** ***************** tokenize text with abbr list *******************/
|
|
88
|
-
var inner = useMemoDebugger(
|
|
89
|
-
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
90
|
-
function () {
|
|
89
|
+
var inner = useMemoDebugger(function () {
|
|
91
90
|
if (isString(children)) {
|
|
92
91
|
if (!isEmpty(abbr)) {
|
|
93
92
|
var tokens = tokenize(children, abbr.map(function (_ref3) {
|
|
@@ -6,8 +6,8 @@ import classNames from 'classnames';
|
|
|
6
6
|
import { useMemoDebugger } from '../hooks/useEffectDebugger.js';
|
|
7
7
|
import 'react';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
|
-
import { getColor } from '../utils/getColor.js';
|
|
10
9
|
import '@react-fabric/utilities';
|
|
10
|
+
import { getColor } from '../utils/getColor.js';
|
|
11
11
|
import { TextSizeMap } from './types.js';
|
|
12
12
|
|
|
13
13
|
var _excluded = ["ref", "as", "children", "className", "bg", "color", "family", "size"];
|
|
@@ -21,7 +21,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
21
21
|
*
|
|
22
22
|
* @param {AnchorProps} props - The properties for the Anchor component.
|
|
23
23
|
* @param {Tag} as - The HTML element type to render as (default is "a").
|
|
24
|
-
* @returns {
|
|
24
|
+
* @returns {React.ReactElement} - A styled anchor element with the specified properties.
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* ```jsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import {
|
|
4
|
+
import { useEffectEvent } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { Button } from '../components/button/Button.js';
|
|
7
7
|
import { Tooltip } from '../overlays/tooltip/Tooltip.js';
|
|
@@ -38,9 +38,9 @@ var Copy = function Copy(_ref) {
|
|
|
38
38
|
t = _useTranslation.t;
|
|
39
39
|
|
|
40
40
|
/** ***************** handle copy *******************/
|
|
41
|
-
var doCopy =
|
|
41
|
+
var doCopy = useEffectEvent(function () {
|
|
42
42
|
void navigator.clipboard.writeText(text);
|
|
43
|
-
}
|
|
43
|
+
});
|
|
44
44
|
return /*#__PURE__*/jsx(Tooltip, {
|
|
45
45
|
content: t("action.copy"),
|
|
46
46
|
children: /*#__PURE__*/jsx(Button, {
|
|
@@ -30,7 +30,7 @@ var MarkText = function MarkText(_ref) {
|
|
|
30
30
|
* allowing for greater flexibility in how the text is presented.
|
|
31
31
|
*
|
|
32
32
|
* @param {MarkProps} props - The properties for the Mark component.
|
|
33
|
-
* @returns {
|
|
33
|
+
* @returns {React.ReactElement} The rendered Mark component.
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* <Mark
|
|
@@ -59,9 +59,7 @@ var Mark = function Mark(_ref2) {
|
|
|
59
59
|
}, [renderer]);
|
|
60
60
|
|
|
61
61
|
/** ***************** tokenize text with abbr list *******************/
|
|
62
|
-
var inner = useMemoDebugger(
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
64
|
-
function () {
|
|
62
|
+
var inner = useMemoDebugger(function () {
|
|
65
63
|
if (isString(children)) {
|
|
66
64
|
if (!isEmpty(mark)) {
|
|
67
65
|
var tokens = tokenize(children, mark.map(function (_ref3) {
|
|
@@ -5,7 +5,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
5
5
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
6
|
import { isNumber } from '@react-fabric/utilities';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
import { useRef, useState,
|
|
8
|
+
import { useRef, useState, useEffectEvent } from 'react';
|
|
9
9
|
import { useTranslation } from 'react-i18next';
|
|
10
10
|
import { useLayoutEffectDebugger, useMemoDebugger } from '../hooks/useEffectDebugger.js';
|
|
11
11
|
import { usePropToggle } from '../hooks/usePropToggle.js';
|
|
@@ -25,7 +25,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
25
25
|
* It leverages the ResizeObserver API to detect changes in the text container's size and adjust the line clamping accordingly.
|
|
26
26
|
*
|
|
27
27
|
* @param {TextProps} props - The properties for the Text component.
|
|
28
|
-
* @returns {
|
|
28
|
+
* @returns {React.ReactElement} The rendered Text component.
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```jsx
|
|
@@ -71,12 +71,12 @@ var Text = function Text(_ref) {
|
|
|
71
71
|
refShowMore = _usePropToggle2[2];
|
|
72
72
|
|
|
73
73
|
/** ***************** check text height if clip enabled *******************/
|
|
74
|
-
var checkHeight =
|
|
74
|
+
var checkHeight = useEffectEvent(function () {
|
|
75
75
|
var el = refContainer.current;
|
|
76
76
|
if (el && isNumber(clamp) && clamp > 0 && !refShowMore.current) {
|
|
77
77
|
setClipped(calculateTextHeight(el.firstElementChild, el) > el.offsetHeight);
|
|
78
78
|
}
|
|
79
|
-
}
|
|
79
|
+
});
|
|
80
80
|
|
|
81
81
|
/** ***************** observe element resize to recalculate height *******************/
|
|
82
82
|
useLayoutEffectDebugger(function () {
|
|
@@ -123,7 +123,7 @@ var Text = function Text(_ref) {
|
|
|
123
123
|
"--text-clamp": showMore ? "unset" : clamp !== null && clamp !== void 0 ? clamp : "unset"
|
|
124
124
|
},
|
|
125
125
|
children: /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
126
|
-
className: classNames("fabric-text", "mixed-lang px-
|
|
126
|
+
className: classNames("fabric-text", "mixed-lang px-0.5 whitespace-pre-wrap", family && "font-".concat(family), clamp && "line-clamp-1"),
|
|
127
127
|
style: styles
|
|
128
128
|
}, aria), {}, {
|
|
129
129
|
children: children
|
|
@@ -6,8 +6,8 @@ import classNames from 'classnames';
|
|
|
6
6
|
import { useMemoDebugger } from '../hooks/useEffectDebugger.js';
|
|
7
7
|
import 'react';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
|
-
import { getColor } from '../utils/getColor.js';
|
|
10
9
|
import '@react-fabric/utilities';
|
|
10
|
+
import { getColor } from '../utils/getColor.js';
|
|
11
11
|
import { TitleSizeMap } from './types.js';
|
|
12
12
|
|
|
13
13
|
var _excluded = ["children", "className", "as", "bg", "color", "size", "align", "family"];
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
* This component is useful for creating headings or titles in a consistent style across an application.
|
|
20
20
|
*
|
|
21
21
|
* @param {TitleProps} props - The properties for the Title component.
|
|
22
|
-
* @returns {
|
|
22
|
+
* @returns {React.ReactElement} The rendered Title component.
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```jsx
|
|
@@ -26,14 +26,14 @@ import { Fragment } from 'react/jsx-runtime';
|
|
|
26
26
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _cloneChildren = function cloneChildren(children, callback) {
|
|
30
30
|
var _Children$map;
|
|
31
31
|
return (_Children$map = Children.map(children, function (c) {
|
|
32
|
-
if (
|
|
32
|
+
if (/*#__PURE__*/isValidElement(c)) {
|
|
33
33
|
if (c.type === Fragment) {
|
|
34
34
|
var _c$props;
|
|
35
35
|
// just compare to `Fragment`
|
|
36
|
-
return
|
|
36
|
+
return _cloneChildren((_c$props = c.props) === null || _c$props === void 0 ? void 0 : _c$props.children, callback);
|
|
37
37
|
}
|
|
38
38
|
return c;
|
|
39
39
|
}
|
|
@@ -44,4 +44,4 @@ var cloneChildren = function cloneChildren(children, callback) {
|
|
|
44
44
|
})) === null || _Children$map === void 0 ? void 0 : _Children$map.flat().filter(Boolean).map(callback);
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
export { cloneChildren };
|
|
47
|
+
export { _cloneChildren as cloneChildren };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { isObject } from '@react-fabric/utilities';
|
|
4
|
+
import { isValidElement } from 'react';
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* React Fabric
|
|
8
|
+
* @version: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* The MIT License (MIT)
|
|
12
|
+
* Copyright (c) 2026 Adarsh Pastakia
|
|
13
|
+
*
|
|
14
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
15
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
16
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
17
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
*
|
|
20
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
21
|
+
* portions of the Software.
|
|
22
|
+
*
|
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
24
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
25
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
26
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Utility function to get badge properties from a badge value or object.
|
|
31
|
+
* It checks if the badge is an object and returns its properties,
|
|
32
|
+
*
|
|
33
|
+
* @param {string | number | BadgeType} badge - The badge value or object.
|
|
34
|
+
* @returns {AnyObject} An object containing badge properties.
|
|
35
|
+
*/
|
|
36
|
+
var getBadgeProps = function getBadgeProps(badge) {
|
|
37
|
+
if (isObject(badge) && ! /*#__PURE__*/isValidElement(badge)) {
|
|
38
|
+
return Object.assign({
|
|
39
|
+
forButton: true,
|
|
40
|
+
placement: ""
|
|
41
|
+
}, badge);
|
|
42
|
+
} else {
|
|
43
|
+
return {
|
|
44
|
+
value: badge,
|
|
45
|
+
forButton: true,
|
|
46
|
+
placement: ""
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { getBadgeProps };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { isValidElement } from 'react';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* React Fabric
|
|
7
|
+
* @version: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* The MIT License (MIT)
|
|
11
|
+
* Copyright (c) 2026 Adarsh Pastakia
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
14
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
15
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
16
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
17
|
+
* subject to the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
20
|
+
* portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
23
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
24
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
25
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
var getIconProps = function getIconProps(props) {
|
|
29
|
+
if (typeof props === "string") {
|
|
30
|
+
return {
|
|
31
|
+
icon: props
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (/*#__PURE__*/isValidElement(props)) {
|
|
35
|
+
return {
|
|
36
|
+
icon: props
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return props;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { getIconProps };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { isString, isObject } from '@react-fabric/utilities';
|
|
4
|
+
import { isValidElement } from 'react';
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* React Fabric
|
|
8
|
+
* @version: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* The MIT License (MIT)
|
|
12
|
+
* Copyright (c) 2026 Adarsh Pastakia
|
|
13
|
+
*
|
|
14
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
15
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
16
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
17
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
*
|
|
20
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
21
|
+
* portions of the Software.
|
|
22
|
+
*
|
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
24
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
25
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
26
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
var getTooltipProps = function getTooltipProps(tooltip, innerRef) {
|
|
30
|
+
if (isString(tooltip) || /*#__PURE__*/isValidElement(tooltip)) {
|
|
31
|
+
return {
|
|
32
|
+
ref: innerRef,
|
|
33
|
+
placement: "top",
|
|
34
|
+
content: tooltip
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (isObject(tooltip)) {
|
|
38
|
+
return Object.assign({
|
|
39
|
+
ref: innerRef,
|
|
40
|
+
placement: "top"
|
|
41
|
+
}, tooltip);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export { getTooltipProps };
|
|
@@ -23,7 +23,7 @@ export interface ActionLabelProps extends AriaProps, CssProp, ChildProp, TestPro
|
|
|
23
23
|
* It supports custom alignment, disabled states, and can be easily styled with additional CSS classes.
|
|
24
24
|
*
|
|
25
25
|
* @param {ActionLabelProps} props - The properties for the ActionLabel component.
|
|
26
|
-
* @returns {
|
|
26
|
+
* @returns {React.ReactElement} The rendered ActionLabel component.
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* ```jsx
|
|
@@ -17,7 +17,7 @@ export interface AnimationProps extends CssProp, AriaProps {
|
|
|
17
17
|
* It also allows customization of the icon color and stroke color.
|
|
18
18
|
*
|
|
19
19
|
* @param {AnimationProps} props - The properties for the AnimationIndicator component.
|
|
20
|
-
* @returns {
|
|
20
|
+
* @returns {React.ReactElement} The rendered AnimationIndicator component.
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```jsx
|
|
@@ -42,7 +42,7 @@ export declare const AnimationIndicator: ({ className, color, strokeColor, type,
|
|
|
42
42
|
* @param {number | string} [props.size="2rem"] - The size of the loader icon.
|
|
43
43
|
* @param {string} props.icon - The icon to be displayed as the loader.
|
|
44
44
|
* @param {"sm" | "md" | "lg"} [props.maskBlur] - The blur effect for the background mask.
|
|
45
|
-
* @returns {
|
|
45
|
+
* @returns {React.ReactElement} The rendered AnimationLoader component.
|
|
46
46
|
*/
|
|
47
47
|
export declare const AnimationLoader: ({ color, size, icon, maskBlur, }: {
|
|
48
48
|
icon: string;
|
|
@@ -58,7 +58,7 @@ export declare const AnimationLoader: ({ color, size, icon, maskBlur, }: {
|
|
|
58
58
|
* @param {Object} props - The properties for the LoadingBars component.
|
|
59
59
|
* @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the bars.
|
|
60
60
|
* @param {number | string} [props.size="2rem"] - The size of the bars.
|
|
61
|
-
* @returns {
|
|
61
|
+
* @returns {React.ReactElement} The rendered LoadingBars component.
|
|
62
62
|
*
|
|
63
63
|
* @example
|
|
64
64
|
* ```jsx
|
|
@@ -80,7 +80,7 @@ export declare const LoadingBars: (props: {
|
|
|
80
80
|
* @param {Object} props - The properties for the LoadingSpinner component.
|
|
81
81
|
* @param {ColorType | PaletteType | string} [props.color="tint-700"] - The color of the spinner.
|
|
82
82
|
* @param {number | string} [props.size="2rem"] - The size of the spinner.
|
|
83
|
-
* @returns {
|
|
83
|
+
* @returns {React.ReactElement} The rendered LoadingSpinner component.
|
|
84
84
|
*
|
|
85
85
|
* @example
|
|
86
86
|
* ```jsx
|
|
@@ -101,7 +101,7 @@ export declare const LoadingSpinner: (props: {
|
|
|
101
101
|
* providing a visual placeholder for content that is being loaded.
|
|
102
102
|
*
|
|
103
103
|
* @param {CssProp} props - The properties for the Skeleton component.
|
|
104
|
-
* @returns {
|
|
104
|
+
* @returns {React.ReactElement} The rendered Skeleton component.
|
|
105
105
|
*
|
|
106
106
|
* @example
|
|
107
107
|
* ```jsx
|
|
@@ -116,6 +116,6 @@ export declare const Skeleton: ({ className, ...rest }: CssProp) => import("reac
|
|
|
116
116
|
* A component that displays a loading animation with a top border.
|
|
117
117
|
* It is typically used to indicate that content is being loaded in pages and page sections.
|
|
118
118
|
*
|
|
119
|
-
* @returns {
|
|
119
|
+
* @returns {React.ReactElement} The rendered Loading component.
|
|
120
120
|
*/
|
|
121
121
|
export declare const LoadingLine: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -53,7 +53,7 @@ export interface AvatarProps extends CssProp, AriaProps, TestProps, RefProp {
|
|
|
53
53
|
* It uses the Boring Avatars library for generating fallback avatars based on the user's name.
|
|
54
54
|
*
|
|
55
55
|
* @param {AvatarProps} props - The properties for the Avatar component.
|
|
56
|
-
* @returns {
|
|
56
|
+
* @returns {React.ReactElement} The rendered Avatar component.
|
|
57
57
|
*
|
|
58
58
|
* @example
|
|
59
59
|
* ```jsx
|
|
@@ -24,7 +24,7 @@ export interface AvatarGroupProps extends CssProp, RefProp, AriaProps {
|
|
|
24
24
|
* It automatically calculates the number of additional avatars based on the `totalCount` prop and the number of children provided.
|
|
25
25
|
*
|
|
26
26
|
* @param {AvatarGroupProps} props - The properties for the AvatarGroup component.
|
|
27
|
-
* @returns {
|
|
27
|
+
* @returns {React.ReactElement} The rendered AvatarGroup component.
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* ```jsx
|
|
@@ -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
|