@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
|
@@ -12,6 +12,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
12
12
|
var _excluded = ["ref", "disabled", "className", "bodyClassName", "headerClassName", "children", "iconAlign", "stickyHeader", "iconClosed", "iconOpen", "open", "onClose", "onOpen"];
|
|
13
13
|
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
14
|
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; }
|
|
15
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
16
|
/**
|
|
16
17
|
* A component that can be expanded or collapsed to show or hide content.
|
|
17
18
|
* It is useful for organizing content in a way that allows users to focus on the information they are interested in.
|
|
@@ -19,7 +20,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
20
|
* This component is ideal for creating accordions, expandable panels, or sections that can be toggled by the user.
|
|
20
21
|
*
|
|
21
22
|
* @param {CollapsableProps} props - The properties for the Collapsable component.
|
|
22
|
-
* @returns {
|
|
23
|
+
* @returns {React.ReactElement} The rendered Collapsable component.
|
|
23
24
|
*
|
|
24
25
|
* @example
|
|
25
26
|
* ```jsx
|
|
@@ -75,7 +76,7 @@ var Collapsable = function Collapsable(_ref) {
|
|
|
75
76
|
var _Children$toArray = Children.toArray(children),
|
|
76
77
|
_Children$toArray2 = _toArray(_Children$toArray),
|
|
77
78
|
h = _Children$toArray2[0],
|
|
78
|
-
b = _Children$toArray2.slice(1);
|
|
79
|
+
b = _arrayLikeToArray(_Children$toArray2).slice(1);
|
|
79
80
|
return [h, b];
|
|
80
81
|
}, [children]),
|
|
81
82
|
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
@@ -87,7 +88,7 @@ var Collapsable = function Collapsable(_ref) {
|
|
|
87
88
|
children: [/*#__PURE__*/jsxs("div", {
|
|
88
89
|
role: "none",
|
|
89
90
|
ref: headRef,
|
|
90
|
-
className: classNames("fabric-collapsableHead", "flex gap-1 flex-nowrap py-2 font-medium cursor-pointer items-center select-none hover:opacity-70", headerClassName, stickyHeader && "bg-
|
|
91
|
+
className: classNames("fabric-collapsableHead", "flex gap-1 flex-nowrap py-2 font-medium cursor-pointer items-center select-none hover:opacity-70", headerClassName, stickyHeader && "bg-default sticky top-0 py-1 z-10", iconAlign === "end" ? "flex-row-reverse" : "flex-row"),
|
|
91
92
|
onClick: function onClick() {
|
|
92
93
|
return !disabled && setOpenState(!openState);
|
|
93
94
|
},
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { useCallback } from 'react';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
import { getColor } from '../../utils/getColor.js';
|
|
7
6
|
import '@react-fabric/utilities';
|
|
7
|
+
import { getColor } from '../../utils/getColor.js';
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
* React Fabric
|
|
@@ -36,7 +36,7 @@ import '@react-fabric/utilities';
|
|
|
36
36
|
* styles, and alignment options.
|
|
37
37
|
*
|
|
38
38
|
* @param {DividerProps} props - The properties for the Divider component.
|
|
39
|
-
* @returns {
|
|
39
|
+
* @returns {React.ReactElement} The rendered Divider component.
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```jsx
|
|
@@ -5,13 +5,13 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
5
5
|
import { useFloatingTree, FloatingTree, useFloatingNodeId, useFloating, autoUpdate, shift, flip, offset, arrow, safePolygon, useDismiss, useInteractions, FloatingPortal, FloatingOverlay, FloatingFocusManager, FloatingArrow, useHover, useClick } from '@floating-ui/react';
|
|
6
6
|
import { mergeRefs } from '@react-fabric/utilities';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
import { useRef, useState, useMemo, Children,
|
|
8
|
+
import { useRef, useState, useMemo, Children, useEffectEvent, useEffect, Fragment, cloneElement } from 'react';
|
|
9
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
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; }
|
|
12
12
|
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; }
|
|
13
13
|
var DropdownElement = function DropdownElement(_ref) {
|
|
14
|
-
var
|
|
14
|
+
var _ref3, _refs$domReference$cu;
|
|
15
15
|
var ref = _ref.ref,
|
|
16
16
|
children = _ref.children,
|
|
17
17
|
showArrow = _ref.showArrow,
|
|
@@ -22,9 +22,11 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
22
22
|
placement = _ref$placement === void 0 ? "bottom" : _ref$placement,
|
|
23
23
|
onClose = _ref.onClose,
|
|
24
24
|
onOpen = _ref.onOpen,
|
|
25
|
+
root = _ref.root,
|
|
25
26
|
disabled = _ref.disabled,
|
|
26
27
|
plainDropdown = _ref.plainDropdown,
|
|
27
|
-
|
|
28
|
+
_ref$trigger = _ref.trigger,
|
|
29
|
+
trigger = _ref$trigger === void 0 ? "click" : _ref$trigger,
|
|
28
30
|
dropdownClassName = _ref.dropdownClassName;
|
|
29
31
|
var arrowRef = useRef(null);
|
|
30
32
|
var _useState = useState(false),
|
|
@@ -60,7 +62,7 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
60
62
|
refs = _useFloating.refs,
|
|
61
63
|
floatingStyles = _useFloating.floatingStyles,
|
|
62
64
|
context = _useFloating.context;
|
|
63
|
-
var handler =
|
|
65
|
+
var handler = trigger === "hover" ? useHover : useClick;
|
|
64
66
|
var click = handler(context, {
|
|
65
67
|
enabled: !disabled,
|
|
66
68
|
handleClose: safePolygon({
|
|
@@ -82,11 +84,11 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
82
84
|
}
|
|
83
85
|
return undefined;
|
|
84
86
|
}, [refs, isOpen, fitToParent]);
|
|
85
|
-
var dismissDropdown =
|
|
87
|
+
var dismissDropdown = useEffectEvent(function () {
|
|
86
88
|
setIsOpen(false);
|
|
87
89
|
onClose === null || onClose === void 0 || onClose();
|
|
88
|
-
}
|
|
89
|
-
var tryClosing =
|
|
90
|
+
});
|
|
91
|
+
var tryClosing = useEffectEvent(function (e) {
|
|
90
92
|
var _refs$floating$curren, _refs$floating$curren2;
|
|
91
93
|
if (!((_refs$floating$curren = refs.floating.current) !== null && _refs$floating$curren !== void 0 && _refs$floating$curren.contains(e.target.closest("[data-dropdown-dismiss='false']"))) && (!!closeOnClick || (_refs$floating$curren2 = refs.floating.current) !== null && _refs$floating$curren2 !== void 0 && _refs$floating$curren2.contains(e.target.closest("[data-dropdown-dismiss='true']")))) {
|
|
92
94
|
setTimeout(function () {
|
|
@@ -94,7 +96,7 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
94
96
|
onClose === null || onClose === void 0 || onClose();
|
|
95
97
|
}, 100);
|
|
96
98
|
}
|
|
97
|
-
}
|
|
99
|
+
});
|
|
98
100
|
var innerRef = useMemo(function () {
|
|
99
101
|
return mergeRefs(ref, anchor.props.ref, refs.setReference);
|
|
100
102
|
}, [ref, anchor.props.ref, refs.setReference]);
|
|
@@ -125,10 +127,10 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
125
127
|
"data-dropdown-open": isOpen ? true : undefined,
|
|
126
128
|
ref: innerRef
|
|
127
129
|
})), isOpen && /*#__PURE__*/jsxs(FloatingPortal, {
|
|
128
|
-
root: (
|
|
130
|
+
root: (_ref3 = root !== null && root !== void 0 ? root : (_refs$domReference$cu = refs.domReference.current) === null || _refs$domReference$cu === void 0 ? void 0 : _refs$domReference$cu.closest(".theme-base")) !== null && _ref3 !== void 0 ? _ref3 : undefined,
|
|
129
131
|
children: [/*#__PURE__*/jsx(FloatingOverlay, {}), /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
130
132
|
context: context,
|
|
131
|
-
|
|
133
|
+
closeOnFocusOut: true,
|
|
132
134
|
children: /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
133
135
|
ref: refs.setFloating,
|
|
134
136
|
style: _objectSpread({
|
|
@@ -143,16 +145,16 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
143
145
|
})), {}, {
|
|
144
146
|
children: [/*#__PURE__*/jsx("div", {
|
|
145
147
|
role: "none",
|
|
146
|
-
className: classNames("fabric-dropdownBody", dropdownClassName, !plainDropdown && "shadow-lg bg-
|
|
148
|
+
className: classNames("fabric-dropdownBody", dropdownClassName, !plainDropdown && "shadow-lg bg-default ring-1 ring-tint-100", "rounded-capped grid max-h-[70vh]"),
|
|
147
149
|
onMouseUpCapture: tryClosing,
|
|
148
|
-
children: /*#__PURE__*/cloneElement(panel, {
|
|
150
|
+
children: /*#__PURE__*/cloneElement(panel, typeof panel.type === "string" ? {} : {
|
|
149
151
|
dismiss: dismissDropdown
|
|
150
152
|
})
|
|
151
153
|
}), showArrow && /*#__PURE__*/jsx(FloatingArrow, {
|
|
152
154
|
ref: arrowRef,
|
|
153
155
|
context: context,
|
|
154
156
|
strokeWidth: 0.5,
|
|
155
|
-
className: "fill-
|
|
157
|
+
className: "fill-default stroke-dimmed"
|
|
156
158
|
})]
|
|
157
159
|
}))
|
|
158
160
|
})]
|
|
@@ -210,10 +212,10 @@ var Dropdown = function Dropdown(props) {
|
|
|
210
212
|
* @param dismiss - Whether to dismiss the dropdown on click (default: true).
|
|
211
213
|
* @returns JSX Element
|
|
212
214
|
*/
|
|
213
|
-
var DropdownDismiss = function DropdownDismiss(
|
|
214
|
-
var children =
|
|
215
|
-
|
|
216
|
-
dismiss =
|
|
215
|
+
var DropdownDismiss = function DropdownDismiss(_ref4) {
|
|
216
|
+
var children = _ref4.children,
|
|
217
|
+
_ref4$dismiss = _ref4.dismiss,
|
|
218
|
+
dismiss = _ref4$dismiss === void 0 ? true : _ref4$dismiss;
|
|
217
219
|
var tree = useFloatingTree();
|
|
218
220
|
return /*#__PURE__*/jsx("div", {
|
|
219
221
|
role: "none",
|
|
@@ -58,7 +58,7 @@ var DefaultIcon = function DefaultIcon() {
|
|
|
58
58
|
* such as in empty states of lists, tables, or other content areas.
|
|
59
59
|
*
|
|
60
60
|
* @param {EmptyContentProps} props - The properties for the EmptyContent component.
|
|
61
|
-
* @returns {
|
|
61
|
+
* @returns {React.ReactElement} The rendered EmptyContent component.
|
|
62
62
|
*
|
|
63
63
|
* @example
|
|
64
64
|
* ```jsx
|
|
@@ -5,26 +5,13 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
5
5
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
6
|
import { isSvgPath, isString } from '@react-fabric/utilities';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
import {
|
|
8
|
+
import { useState, useEffect, useMemo, isValidElement } from 'react';
|
|
9
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
10
|
import { getColor } from '../../utils/getColor.js';
|
|
11
11
|
|
|
12
12
|
var _excluded = ["ref", "icon", "iconSrc", "bg", "color", "size", "rtlFlip", "animate", "rounded", "disabled", "viewBox", "className", "onClick"];
|
|
13
13
|
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
14
|
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; }
|
|
15
|
-
var getIconProps = function getIconProps(props) {
|
|
16
|
-
if (typeof props === "string") {
|
|
17
|
-
return {
|
|
18
|
-
icon: props
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
if ( /*#__PURE__*/isValidElement(props)) {
|
|
22
|
-
return {
|
|
23
|
-
icon: props
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
return props;
|
|
27
|
-
};
|
|
28
15
|
var SvgTextSize = ["", ".875em", ".525em", ".35em", ".25em"];
|
|
29
16
|
var SizeMap = {
|
|
30
17
|
xs: "0.625rem",
|
|
@@ -43,7 +30,7 @@ var SizeMap = {
|
|
|
43
30
|
* These include `bg`, `color`, `size`, `rtlFlip`, `animate`, and `rounded`.
|
|
44
31
|
*
|
|
45
32
|
* @param {IconProps} props - The properties for the Icon component.
|
|
46
|
-
* @returns {
|
|
33
|
+
* @returns {React.ReactElement} The rendered Icon component.
|
|
47
34
|
*
|
|
48
35
|
* @example
|
|
49
36
|
* ```jsx
|
|
@@ -113,7 +100,7 @@ var Icon = function Icon(_ref) {
|
|
|
113
100
|
|
|
114
101
|
/** ***************** render icon *******************/
|
|
115
102
|
var iconEl = useMemo(function () {
|
|
116
|
-
if (
|
|
103
|
+
if (/*#__PURE__*/isValidElement(icon)) return icon;
|
|
117
104
|
if (isString(icon)) {
|
|
118
105
|
return isSvg ? /*#__PURE__*/jsx("svg", {
|
|
119
106
|
viewBox: viewBox,
|
|
@@ -165,4 +152,4 @@ var Icon = function Icon(_ref) {
|
|
|
165
152
|
}));
|
|
166
153
|
};
|
|
167
154
|
|
|
168
|
-
export { Icon
|
|
155
|
+
export { Icon };
|
|
@@ -34,7 +34,7 @@ var loadIndicator = /*#__PURE__*/jsx("div", {
|
|
|
34
34
|
* It automatically adjusts the display based on the provided fit property, allowing for different styles such as cover, contain, or fill.
|
|
35
35
|
*
|
|
36
36
|
* @param {ImageProps | VideoProps} props - The properties for the Media component.
|
|
37
|
-
* @returns {
|
|
37
|
+
* @returns {React.ReactElement} The rendered Media component.
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* ```jsx
|
|
@@ -112,7 +112,7 @@ var Image = function Image(_ref) {
|
|
|
112
112
|
* It also includes a reel decoration for a more engaging visual presentation.
|
|
113
113
|
*
|
|
114
114
|
* @param {VideoProps} props - The properties for the Video component.
|
|
115
|
-
* @returns {
|
|
115
|
+
* @returns {React.ReactElement} The rendered Video component.
|
|
116
116
|
*
|
|
117
117
|
* @example
|
|
118
118
|
* ```jsx
|
|
@@ -146,21 +146,21 @@ var Video = function Video(_ref2) {
|
|
|
146
146
|
loaded = _useState8[0],
|
|
147
147
|
setLoaded = _useState8[1];
|
|
148
148
|
var _useState9 = useState(false),
|
|
149
|
-
|
|
150
|
-
errored =
|
|
151
|
-
setErrored =
|
|
149
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
150
|
+
errored = _useState0[0],
|
|
151
|
+
setErrored = _useState0[1];
|
|
152
152
|
useEffect(function () {
|
|
153
153
|
setLoaded(false);
|
|
154
154
|
setErrored(false);
|
|
155
155
|
}, [src]);
|
|
156
|
-
var
|
|
156
|
+
var _useState1 = useState(true),
|
|
157
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
158
|
+
state = _useState10[0],
|
|
159
|
+
setState = _useState10[1];
|
|
160
|
+
var _useState11 = useState(false),
|
|
157
161
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
var _useState13 = useState(false),
|
|
161
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
162
|
-
volume = _useState14[0],
|
|
163
|
-
setVolume = _useState14[1];
|
|
162
|
+
volume = _useState12[0],
|
|
163
|
+
setVolume = _useState12[1];
|
|
164
164
|
useEffect(function () {
|
|
165
165
|
setErrored(false);
|
|
166
166
|
}, [src]);
|
|
@@ -207,7 +207,7 @@ var Video = function Video(_ref2) {
|
|
|
207
207
|
})]
|
|
208
208
|
}), /*#__PURE__*/jsxs("div", {
|
|
209
209
|
"data-inner-clickable": true,
|
|
210
|
-
className: classNames("fabric-mediaControls", "absolute bottom-6
|
|
210
|
+
className: classNames("fabric-mediaControls", "absolute bottom-6 inset-e-6 rounded-full flex flex-col"),
|
|
211
211
|
children: [/*#__PURE__*/jsx(Button, {
|
|
212
212
|
rounded: true,
|
|
213
213
|
variant: "link",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
|
-
import { useFloatingNodeId, useFloating, autoUpdate, offset, flip, useClick, useDismiss, useInteractions, FloatingPortal } from '@floating-ui/react';
|
|
5
|
+
import { useFloatingNodeId, useFloating, autoUpdate, offset, flip, useClick, useDismiss, useInteractions, FloatingPortal, FloatingOverlay, FloatingFocusManager } from '@floating-ui/react';
|
|
6
6
|
import { useState, useRef, useEffect, cloneElement } from 'react';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
14
14
|
* This component is useful for creating custom context menus that can be triggered by right-clicking on elements.
|
|
15
15
|
*
|
|
16
16
|
* @param {ContextMenuProps} props - The properties for the ContextMenu component.
|
|
17
|
-
* @returns {
|
|
17
|
+
* @returns {React.ReactElement} The rendered ContextMenu component.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```jsx
|
|
@@ -96,26 +96,36 @@ var ContextMenu = function ContextMenu(_ref) {
|
|
|
96
96
|
}, [disabled]);
|
|
97
97
|
var tryClosing = useRef(function (e) {
|
|
98
98
|
var _e$target;
|
|
99
|
-
if ((_e$target = e.target) !== null && _e$target !== void 0 && _e$target.closest("[data-dropdown-dismiss='
|
|
99
|
+
if (!((_e$target = e.target) !== null && _e$target !== void 0 && _e$target.closest("[data-dropdown-dismiss='false']"))) setTimeout(function () {
|
|
100
100
|
return setIsOpen(false);
|
|
101
101
|
}, 50);
|
|
102
102
|
});
|
|
103
103
|
return /*#__PURE__*/jsxs("div", {
|
|
104
104
|
className: "contents",
|
|
105
105
|
ref: wrapperRef,
|
|
106
|
-
onMouseUpCapture: tryClosing.current,
|
|
107
106
|
children: [children, isOpen && /*#__PURE__*/jsx(FloatingPortal, {
|
|
108
107
|
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,
|
|
109
|
-
children: /*#__PURE__*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
zIndex: "var(--z-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
108
|
+
children: /*#__PURE__*/jsx(FloatingOverlay, {
|
|
109
|
+
lockScroll: true,
|
|
110
|
+
style: {
|
|
111
|
+
zIndex: "var(--z-overlay-mask)",
|
|
112
|
+
position: "absolute",
|
|
113
|
+
overflow: "hidden"
|
|
114
|
+
},
|
|
115
|
+
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
116
|
+
context: context,
|
|
117
|
+
children: /*#__PURE__*/cloneElement(menu, _objectSpread(_objectSpread({}, getFloatingProps()), {}, {
|
|
118
|
+
style: _objectSpread(_objectSpread({}, floatingStyles), {}, {
|
|
119
|
+
borderRadius: "var(--rounding)",
|
|
120
|
+
zIndex: "var(--z-popover)",
|
|
121
|
+
fontSize: "0.875rem"
|
|
122
|
+
}),
|
|
123
|
+
className: "bg-default outline rounded-capped shadow-lg",
|
|
124
|
+
ref: refs.setFloating,
|
|
125
|
+
onMouseUp: tryClosing.current
|
|
126
|
+
}))
|
|
127
|
+
})
|
|
128
|
+
})
|
|
119
129
|
})]
|
|
120
130
|
});
|
|
121
131
|
};
|
|
@@ -6,19 +6,19 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
6
6
|
import { useFloatingParentNodeId, useFloatingTree, FloatingTree, useFloatingNodeId, useFloating, offset, flip, shift, autoUpdate, useHover, safePolygon, useClick, useRole, useDismiss, useListNavigation, useTypeahead, useInteractions, FloatingNode, FloatingList, FloatingOverlay, FloatingFocusManager, FloatingPortal } from '@floating-ui/react';
|
|
7
7
|
import { mergeRefs } from '@react-fabric/utilities';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
|
-
import { useState, useRef, useEffect,
|
|
9
|
+
import { useState, useRef, useEffect, useEffectEvent, cloneElement, Fragment } from 'react';
|
|
10
10
|
import { HotKeyWrapper } from '../../hotkeys/HotKeyWrapper.js';
|
|
11
|
-
import { cloneChildren } from '../../utils/cloneElement.js';
|
|
11
|
+
import { cloneChildren as _cloneChildren } from '../../utils/cloneElement.js';
|
|
12
12
|
import { nodeCheck } from '../../utils/nodeCheck.js';
|
|
13
13
|
import { MenuItem } from './MenuItem.js';
|
|
14
14
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
15
15
|
|
|
16
|
-
var _excluded = ["children", "minimal", "menuClassName", "onClick", "trigger", "ref", "forDropdown"];
|
|
16
|
+
var _excluded = ["children", "minimal", "menuClassName", "onClick", "trigger", "ref", "onMouseUp", "onMouseDown", "forDropdown"];
|
|
17
17
|
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; }
|
|
18
18
|
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; }
|
|
19
19
|
// FIXME: refactor menu implementation to differentiate between static and floating menus, implement context wrapper for each menu level
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _MenuComponent = function MenuComponent(_ref) {
|
|
22
22
|
var _refs$domReference$cu, _refs$domReference$cu2;
|
|
23
23
|
var children = _ref.children,
|
|
24
24
|
minimal = _ref.minimal,
|
|
@@ -27,6 +27,8 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
27
27
|
_ref$trigger = _ref.trigger,
|
|
28
28
|
trigger = _ref$trigger === void 0 ? "hover" : _ref$trigger,
|
|
29
29
|
ref = _ref.ref,
|
|
30
|
+
onMouseUp = _ref.onMouseUp,
|
|
31
|
+
onMouseDown = _ref.onMouseDown,
|
|
30
32
|
forDropdown = _ref.forDropdown,
|
|
31
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
34
|
var _useState = useState(false),
|
|
@@ -126,12 +128,12 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
126
128
|
});
|
|
127
129
|
}
|
|
128
130
|
}, [tree, isOpen, nodeId, parentId]);
|
|
129
|
-
var handleClick =
|
|
131
|
+
var handleClick = useEffectEvent(function (e) {
|
|
130
132
|
var el = e.target;
|
|
131
133
|
if (el.dataset.id) {
|
|
132
134
|
onClick === null || onClick === void 0 || onClick(el.dataset.id);
|
|
133
135
|
}
|
|
134
|
-
}
|
|
136
|
+
});
|
|
135
137
|
var Wrapper = isNested ? FloatingPortal : Fragment;
|
|
136
138
|
var wrapperProps = isNested ? {
|
|
137
139
|
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
|
|
@@ -175,20 +177,22 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
175
177
|
children: [isNested && /*#__PURE__*/jsx(FloatingOverlay, {}), /*#__PURE__*/jsx(HotKeyWrapper, {
|
|
176
178
|
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
177
179
|
context: context,
|
|
178
|
-
|
|
180
|
+
closeOnFocusOut: true,
|
|
179
181
|
initialFocus: isNested ? -1 : 0,
|
|
180
182
|
returnFocus: !isNested,
|
|
181
183
|
children: /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
182
|
-
className: classNames(menuClassName, "flex flex-col
|
|
184
|
+
className: classNames(menuClassName, "flex flex-col p-1 menu-list", isNested && "outline shadow-lg rounded-capped max-h-96 overflow-auto scroll-thin z-(--z-popover)"),
|
|
183
185
|
autoFocus: true,
|
|
184
186
|
ref: mergeRefs(isNested ? refs.setFloating : ref)
|
|
185
187
|
}, getFloatingProps({
|
|
186
|
-
onClick: isNested ? undefined : handleClick
|
|
188
|
+
onClick: isNested ? undefined : handleClick,
|
|
189
|
+
onMouseDown: onMouseDown,
|
|
190
|
+
onMouseUp: onMouseUp
|
|
187
191
|
})), {}, {
|
|
188
192
|
style: !isNested ? rest.style : floatingStyles,
|
|
189
|
-
children:
|
|
193
|
+
children: _cloneChildren(children, function (child, index) {
|
|
190
194
|
labelsRef.current[index] = child.props.label;
|
|
191
|
-
return /*#__PURE__*/cloneElement(child, nodeCheck(child, MenuItem, Menu,
|
|
195
|
+
return /*#__PURE__*/cloneElement(child, nodeCheck(child, MenuItem, Menu, _MenuComponent) ? _objectSpread({
|
|
192
196
|
minimal: !isNested && minimal,
|
|
193
197
|
"data-focus": activeIndex === index,
|
|
194
198
|
ref: function ref(el) {
|
|
@@ -214,7 +218,7 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
214
218
|
* It can be nested within other menus to create complex menu structures.
|
|
215
219
|
*
|
|
216
220
|
* @param {MenuProps} props - The properties for the Menu component.
|
|
217
|
-
* @returns {
|
|
221
|
+
* @returns {React.ReactElement} The rendered Menu component.
|
|
218
222
|
*
|
|
219
223
|
* @example
|
|
220
224
|
* ```jsx
|
|
@@ -240,20 +244,20 @@ var Menu = function Menu(props) {
|
|
|
240
244
|
var parentId = useFloatingParentNodeId();
|
|
241
245
|
var tree = useFloatingTree();
|
|
242
246
|
if (tree) {
|
|
243
|
-
return /*#__PURE__*/jsx(
|
|
247
|
+
return /*#__PURE__*/jsx(_MenuComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
244
248
|
className: "",
|
|
245
249
|
menuClassName: props.className
|
|
246
250
|
}));
|
|
247
251
|
}
|
|
248
252
|
if (parentId === null) {
|
|
249
253
|
return /*#__PURE__*/jsx(FloatingTree, {
|
|
250
|
-
children: /*#__PURE__*/jsx(
|
|
254
|
+
children: /*#__PURE__*/jsx(_MenuComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
251
255
|
className: "",
|
|
252
256
|
menuClassName: props.className
|
|
253
257
|
}))
|
|
254
258
|
});
|
|
255
259
|
}
|
|
256
|
-
return /*#__PURE__*/jsx(
|
|
260
|
+
return /*#__PURE__*/jsx(_MenuComponent, _objectSpread({}, props));
|
|
257
261
|
};
|
|
258
262
|
|
|
259
263
|
export { Menu };
|
|
@@ -12,9 +12,11 @@ import '@babel/runtime/helpers/slicedToArray';
|
|
|
12
12
|
import 'react-i18next';
|
|
13
13
|
import '../../hooks/useEffectDebugger.js';
|
|
14
14
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
15
|
+
import { getBadgeProps } from '../../utils/getBadgeProps.js';
|
|
16
|
+
import { getIconProps } from '../../utils/getIconProps.js';
|
|
15
17
|
import { Tooltip } from '../../overlays/tooltip/Tooltip.js';
|
|
16
|
-
import {
|
|
17
|
-
import { Icon
|
|
18
|
+
import { Badge } from '../badge/Badge.js';
|
|
19
|
+
import { Icon } from '../icon/Icon.js';
|
|
18
20
|
import '../../hotkeys/HotKeyWrapper.js';
|
|
19
21
|
|
|
20
22
|
var _excluded = ["as", "label", "color", "className", "icon", "appendLabel", "altIcon", "id", "active", "disabled", "onClick", "badge", "hotKey", "tabIndex", "minimal", "data-open", "ref"],
|
|
@@ -73,14 +75,13 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
73
75
|
tabIndex === 0 && ((_elRef$current = elRef.current) === null || _elRef$current === void 0 ? void 0 : _elRef$current.focus());
|
|
74
76
|
}, [tabIndex]);
|
|
75
77
|
var iconEl = useMemo(function () {
|
|
76
|
-
var _path;
|
|
77
78
|
var path = icon;
|
|
78
79
|
if (minimal && !path) {
|
|
79
80
|
path = iconToken(label);
|
|
80
81
|
}
|
|
81
82
|
return /*#__PURE__*/jsx(Icon, _objectSpread({
|
|
82
83
|
className: classNames("fabric-menuIcon", minimal && "minimal")
|
|
83
|
-
}, getIconProps(
|
|
84
|
+
}, getIconProps(path !== null && path !== void 0 ? path : "")));
|
|
84
85
|
}, [icon, minimal, label]);
|
|
85
86
|
var Wrapper = useCallback(function (_ref2) {
|
|
86
87
|
var children = _ref2.children,
|
|
@@ -18,7 +18,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
18
18
|
* The component can also display a label showing the percentage value.
|
|
19
19
|
*
|
|
20
20
|
* @param {MeterProps} props - The properties for the Meter component.
|
|
21
|
-
* @returns {
|
|
21
|
+
* @returns {React.ReactElement} The rendered Meter component.
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```jsx
|
|
@@ -4,7 +4,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import { isEmpty } from '@react-fabric/utilities';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import {
|
|
7
|
+
import { useEffectEvent } from 'react';
|
|
8
8
|
import { HotKey } from '../../hotkeys/HotKey.js';
|
|
9
9
|
import { Icon } from '../icon/Icon.js';
|
|
10
10
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -17,7 +17,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
17
17
|
* It includes previous and next buttons, and supports keyboard navigation.
|
|
18
18
|
*
|
|
19
19
|
* @param {NavigatorProps} props - The properties for the Navigator component.
|
|
20
|
-
* @returns {
|
|
20
|
+
* @returns {React.ReactElement} The rendered Navigator component.
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```jsx
|
|
@@ -43,12 +43,12 @@ var Navigator = function Navigator(_ref) {
|
|
|
43
43
|
current = _ref.current,
|
|
44
44
|
disableKeyHandlers = _ref.disableKeyHandlers,
|
|
45
45
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
-
var navPrev =
|
|
46
|
+
var navPrev = useEffectEvent(function () {
|
|
47
47
|
return (isEmpty(current) || current !== 0) && onNavigate(-1);
|
|
48
|
-
}
|
|
49
|
-
var navNext =
|
|
48
|
+
});
|
|
49
|
+
var navNext = useEffectEvent(function () {
|
|
50
50
|
return (isEmpty(current) || current + 1 < (length !== null && length !== void 0 ? length : 0)) && onNavigate(+1);
|
|
51
|
-
}
|
|
51
|
+
});
|
|
52
52
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
53
53
|
"data-ref": "navigator",
|
|
54
54
|
className: classNames(className, "inline-flex items-center leading-none")
|
|
@@ -7,9 +7,11 @@ import classNames from 'classnames';
|
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { usePropToggle } from '../../hooks/usePropToggle.js';
|
|
9
9
|
import { HotKey } from '../../hotkeys/HotKey.js';
|
|
10
|
-
import { LoadingLine } from '../animations/Animations.js';
|
|
11
|
-
import { Icon, getIconProps } from '../icon/Icon.js';
|
|
12
10
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
11
|
+
import '@react-fabric/utilities';
|
|
12
|
+
import { getIconProps } from '../../utils/getIconProps.js';
|
|
13
|
+
import { LoadingLine } from '../animations/Animations.js';
|
|
14
|
+
import { Icon } from '../icon/Icon.js';
|
|
13
15
|
|
|
14
16
|
var _excluded = ["children", "className", "titleClassName", "headerClassName", "title", "actions", "icon", "panelId", "height", "width", "minHeight", "minWidth", "maxHeight", "maxWidth", "loading", "expandable", "expanded", "onExpand", "collapsable", "collapsed", "onCollapse", "onClose", "onBack"];
|
|
15
17
|
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; }
|
|
@@ -23,7 +25,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
23
25
|
* It can be used in various applications where panels are needed, such as dashboards, settings pages, or content management systems.
|
|
24
26
|
*
|
|
25
27
|
* @param {PanelProps} props - The properties for the Panel component.
|
|
26
|
-
* @returns {
|
|
28
|
+
* @returns {React.ReactElement} The rendered Panel component.
|
|
27
29
|
*
|
|
28
30
|
* @example
|
|
29
31
|
* ```jsx
|
|
@@ -138,7 +140,7 @@ var Panel = function Panel(_ref) {
|
|
|
138
140
|
}), !expanded && collapsable && /*#__PURE__*/jsx(Icon, {
|
|
139
141
|
"data-ref": "panelCollapse",
|
|
140
142
|
className: classNames("fabric-panelAction", "cursor-pointer"),
|
|
141
|
-
icon: collapsed ? "icon-[mdi--plus-box]" : "icon-[mdi--minus-box]",
|
|
143
|
+
icon: collapsed ? "icon-[mdi--plus-box-outline]" : "icon-[mdi--minus-box-outline]",
|
|
142
144
|
onClick: toggleCollapse
|
|
143
145
|
}), !expanded && onClose && /*#__PURE__*/jsx(Icon, {
|
|
144
146
|
"data-ref": "panelClose",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import { useState, Children,
|
|
5
|
+
import { useState, Children, useEffectEvent, cloneElement } from 'react';
|
|
6
6
|
import { useMemoDebugger, useEffectDebugger } from '../../hooks/useEffectDebugger.js';
|
|
7
7
|
import { jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
14
14
|
* It uses the `Panel` component to render each individual panel within the group.
|
|
15
15
|
*
|
|
16
16
|
* @param {PanelGroupProps} props - The properties for the PanelGroup component.
|
|
17
|
-
* @returns {
|
|
17
|
+
* @returns {React.ReactElement} The rendered PanelGroup component.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```jsx
|
|
@@ -46,14 +46,14 @@ var PanelGroup = function PanelGroup(_ref) {
|
|
|
46
46
|
useEffectDebugger(function () {
|
|
47
47
|
setExpandedPanel(activePanel !== null && activePanel !== void 0 ? activePanel : panels[0]);
|
|
48
48
|
}, [activePanel, panels], "PanelGroup setActive");
|
|
49
|
-
var changeExpanded =
|
|
49
|
+
var changeExpanded = useEffectEvent(function (collapsed, id, handler) {
|
|
50
50
|
if (!collapsed) {
|
|
51
51
|
setExpandedPanel(id);
|
|
52
52
|
onActiveChange === null || onActiveChange === void 0 || onActiveChange(id);
|
|
53
53
|
}
|
|
54
54
|
handler === null || handler === void 0 || handler(collapsed);
|
|
55
55
|
return id !== expandedPanel;
|
|
56
|
-
}
|
|
56
|
+
});
|
|
57
57
|
return /*#__PURE__*/jsx("div", {
|
|
58
58
|
"data-ref": "panelGroup",
|
|
59
59
|
className: classNames("fabric-panelGroup", "flex flex-col overflow-auto area-content p-px"),
|