@react-fabric/core 1.0.0-beta.4 → 1.0.0-beta.40
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/{src/components/actionLabel/ActionLabel.module.css → css/components/_actionLabel.css} +4 -4
- package/{src/overlays/alert/Alert.module.css → css/components/_alert.css} +3 -3
- package/{src/components/animations/Animations.module.css → css/components/_animations.css} +9 -9
- package/{src/components/avatar/Avatar.module.css → css/components/_avatar.css} +11 -11
- package/{src/components/badge/Badge.module.css → css/components/_badge.css} +19 -17
- package/{src/components/breadcrumbs/Breadcrumbs.module.css → css/components/_breadcrumbs.css} +49 -44
- package/{src/components/button/Button.module.css → css/components/_button.css} +68 -78
- package/{src/components/card/Card.module.css → css/components/_card.css} +32 -28
- package/{src/components/chip/Chip.module.css → css/components/_chip.css} +15 -11
- package/{src/components/collapsable/Collapsable.module.css → css/components/_collapsable.css} +3 -3
- package/css/components/_divider.css +32 -0
- package/{src/components/dropdown/Dropdown.module.css → css/components/_dropdown.css} +2 -2
- package/{src/overlays/flyout/Flyout.module.css → css/components/_flyout.css} +6 -6
- package/{src/components/icon/Icon.module.css → css/components/_icon.css} +8 -5
- package/{src/components/media/Media.module.css → css/components/_media.css} +17 -17
- package/{src/components/menu/Menu.module.css → css/components/_menu.css} +15 -16
- package/{src/overlays/message/Message.module.css → css/components/_message.css} +2 -2
- package/{src/components/meter/Meter.module.css → css/components/_meter.css} +10 -10
- package/{src/overlays/modal/Modal.module.css → css/components/_modal.css} +6 -6
- package/{src/components/panel/Panel.module.css → css/components/_panel.css} +17 -17
- package/{src/components/progress/Progress.module.css → css/components/_progress.css} +7 -10
- package/{src/components/tabpanel/TabPanel.module.css → css/components/_tabPanel.css} +73 -84
- package/{src/overlays/toast/Toast.module.css → css/components/_toast.css} +2 -2
- package/css/components/_tooltip.css +29 -0
- package/{src/core/content/Content.module.css → css/components/index.css} +25 -18
- package/{src/core/aside/Aside.module.css → css/core/_aside.css} +42 -42
- package/{src/core/section/Section.module.css → css/core/_content.css} +5 -3
- package/{src/core/boundary/ErrorBoundary.module.css → css/core/_errorboundary.css} +9 -9
- package/{src/core/headfoot/HeadFoot.module.css → css/core/_headfoot.css} +4 -10
- package/{src/core/page/Page.module.css → css/core/_page.css} +10 -14
- package/{src/core/responsive/Responsive.module.css → css/core/_responsive.css} +10 -10
- package/css/core/_section.css +28 -0
- package/{src/core/theme/Theme.module.css → css/core/_theme.css} +3 -3
- package/{src/typography/Typography.module.css → css/core/_typography.css} +14 -12
- package/{src/core/viewport/Viewport.module.css → css/core/_viewport.css} +7 -3
- package/css/core/index.css +33 -0
- package/css/reset/_gradients.css +8 -8
- package/css/reset/_reset.css +41 -223
- package/css/reset/_text.css +14 -29
- package/css/reset/_theme.css +315 -32
- package/css/reset/index.css +4 -4
- package/css/styles.css +7 -6
- package/css/theme/_colors.css +320 -0
- package/css/theme/_utilities.css +530 -0
- package/css/theme/index.css +44 -0
- package/dist/cjs/components/actionLabel/ActionLabel.js +3 -3
- package/dist/cjs/components/animations/Animations.js +29 -18
- package/dist/cjs/components/avatar/Avatar.js +10 -13
- package/dist/cjs/components/avatar/AvatarGroup.js +3 -3
- package/dist/cjs/components/badge/Badge.js +5 -5
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +10 -8
- package/dist/cjs/components/button/Button.js +18 -14
- package/dist/cjs/components/button/ButtonGroup.js +4 -3
- package/dist/cjs/components/button/ConfirmButton.js +7 -2
- package/dist/cjs/components/button/ToggleButtonGroup.js +3 -3
- package/dist/cjs/components/callout/Callout.js +15 -4
- package/dist/cjs/components/card/Card.js +8 -7
- package/dist/cjs/components/card/CardCover.js +10 -5
- package/dist/cjs/components/chip/Chip.js +11 -7
- package/dist/cjs/components/collapsable/Collapsable.js +5 -5
- package/dist/cjs/components/divider/Divider.js +10 -7
- package/dist/cjs/components/dropdown/Dropdown.js +5 -4
- package/dist/cjs/components/dropdown/DropdownTool.js +4 -3
- package/dist/cjs/components/icon/Icon.js +15 -14
- package/dist/cjs/components/media/Media.js +116 -75
- package/dist/cjs/components/menu/ContextMenu.js +30 -10
- package/dist/cjs/components/menu/Menu.js +39 -20
- package/dist/cjs/components/menu/MenuItem.js +30 -16
- package/dist/cjs/components/meter/Meter.js +2 -3
- package/dist/cjs/components/navigator/Navigator.js +16 -9
- package/dist/cjs/components/panel/Panel.js +10 -9
- package/dist/cjs/components/panel/PanelGroup.js +1 -2
- package/dist/cjs/components/progress/ProgressBar.js +6 -5
- package/dist/cjs/components/progress/ProgressCircle.js +6 -4
- package/dist/cjs/components/tabpanel/Tab.js +58 -38
- package/dist/cjs/components/tabpanel/TabPanel.js +20 -16
- package/dist/cjs/core/aside/Aside.js +11 -10
- package/dist/cjs/core/boundary/ErrorBoundary.js +6 -7
- package/dist/cjs/core/boundary/ErrorIcon.js +1 -2
- package/dist/cjs/core/content/Content.js +9 -7
- package/dist/cjs/core/headfoot/HeadFoot.js +2 -20
- package/dist/cjs/core/page/Page.js +3 -3
- package/dist/cjs/core/responsive/Responsive.js +3 -4
- package/dist/cjs/core/section/Section.js +1 -2
- package/dist/cjs/core/theme/ThemeProvider.js +7 -8
- package/dist/cjs/core/viewport/Viewport.js +4 -2
- package/dist/cjs/hooks/useNavigator.js +6 -4
- package/dist/cjs/hotkeys/HotKeyLabel.js +1 -1
- package/dist/cjs/hotkeys/HotKeyWrapper.js +3 -1
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/overlays/alert/Alert.js +19 -13
- package/dist/cjs/overlays/flyout/Flyout.js +42 -44
- package/dist/cjs/overlays/message/Message.js +6 -3
- package/dist/cjs/overlays/modal/Modal.js +9 -10
- package/dist/cjs/overlays/toast/Toast.js +17 -9
- package/dist/cjs/overlays/tooltip/Tooltip.js +20 -8
- package/dist/cjs/types/icons.js +4 -0
- package/dist/cjs/typography/Abbr.js +2 -3
- package/dist/cjs/typography/{Link.js → Anchor.js} +5 -4
- package/dist/cjs/typography/Mark.js +2 -3
- package/dist/cjs/typography/Text.js +3 -4
- package/dist/cjs/typography/Title.js +3 -3
- package/dist/cjs/utils/cloneElement.js +44 -0
- package/dist/cjs/utils/getColor.js +1 -18
- package/dist/esm/components/actionLabel/ActionLabel.js +3 -3
- package/dist/esm/components/animations/Animations.js +30 -19
- package/dist/esm/components/avatar/Avatar.js +11 -14
- package/dist/esm/components/avatar/AvatarGroup.js +3 -3
- package/dist/esm/components/badge/Badge.js +5 -5
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +10 -8
- package/dist/esm/components/button/Button.js +18 -14
- package/dist/esm/components/button/ButtonGroup.js +5 -4
- package/dist/esm/components/button/ConfirmButton.js +7 -2
- package/dist/esm/components/button/ToggleButtonGroup.js +4 -4
- package/dist/esm/components/callout/Callout.js +15 -4
- package/dist/esm/components/card/Card.js +8 -7
- package/dist/esm/components/card/CardCover.js +10 -5
- package/dist/esm/components/chip/Chip.js +12 -8
- package/dist/esm/components/collapsable/Collapsable.js +5 -5
- package/dist/esm/components/divider/Divider.js +11 -8
- package/dist/esm/components/dropdown/Dropdown.js +5 -4
- package/dist/esm/components/dropdown/DropdownTool.js +4 -3
- package/dist/esm/components/icon/Icon.js +15 -14
- package/dist/esm/components/media/Media.js +117 -76
- package/dist/esm/components/menu/ContextMenu.js +32 -12
- package/dist/esm/components/menu/Menu.js +41 -22
- package/dist/esm/components/menu/MenuItem.js +24 -10
- package/dist/esm/components/meter/Meter.js +2 -3
- package/dist/esm/components/navigator/Navigator.js +16 -9
- package/dist/esm/components/panel/Panel.js +10 -9
- package/dist/esm/components/panel/PanelGroup.js +1 -2
- package/dist/esm/components/progress/ProgressBar.js +6 -5
- package/dist/esm/components/progress/ProgressCircle.js +6 -4
- package/dist/esm/components/tabpanel/Tab.js +59 -39
- package/dist/esm/components/tabpanel/TabPanel.js +20 -16
- package/dist/esm/core/aside/Aside.js +11 -10
- package/dist/esm/core/boundary/ErrorBoundary.js +6 -7
- package/dist/esm/core/boundary/ErrorIcon.js +1 -2
- package/dist/esm/core/content/Content.js +9 -7
- package/dist/esm/core/headfoot/HeadFoot.js +2 -20
- package/dist/esm/core/page/Page.js +3 -3
- package/dist/esm/core/responsive/Responsive.js +3 -4
- package/dist/esm/core/section/Section.js +1 -2
- package/dist/esm/core/theme/ThemeProvider.js +7 -8
- package/dist/esm/core/viewport/Viewport.js +4 -2
- package/dist/esm/hooks/useNavigator.js +7 -5
- package/dist/esm/hotkeys/HotKeyLabel.js +1 -1
- package/dist/esm/hotkeys/HotKeyWrapper.js +3 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/overlays/alert/Alert.js +20 -14
- package/dist/esm/overlays/flyout/Flyout.js +43 -45
- package/dist/esm/overlays/message/Message.js +7 -4
- package/dist/esm/overlays/modal/Modal.js +10 -11
- package/dist/esm/overlays/toast/Toast.js +18 -10
- package/dist/esm/overlays/tooltip/Tooltip.js +20 -8
- package/dist/esm/types/icons.js +4 -0
- package/dist/esm/typography/Abbr.js +2 -3
- package/dist/esm/typography/{Link.js → Anchor.js} +6 -5
- package/dist/esm/typography/Mark.js +2 -3
- package/dist/esm/typography/Text.js +4 -5
- package/dist/esm/typography/Title.js +4 -4
- package/dist/esm/utils/cloneElement.js +44 -0
- package/dist/esm/utils/getColor.js +2 -16
- package/dist/types/components/actionLabel/ActionLabel.d.ts +2 -2
- package/dist/types/components/animations/Animations.d.ts +5 -5
- package/dist/types/components/avatar/Avatar.d.ts +3 -3
- package/dist/types/components/badge/Badge.d.ts +5 -1
- package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/dist/types/components/button/Button.d.ts +7 -5
- package/dist/types/components/button/ButtonGroup.d.ts +2 -2
- package/dist/types/components/button/ConfirmButton.d.ts +6 -1
- package/dist/types/components/callout/Callout.d.ts +2 -2
- package/dist/types/components/card/Card.d.ts +3 -3
- package/dist/types/components/chip/Chip.d.ts +3 -3
- package/dist/types/components/collapsable/Collapsable.d.ts +5 -1
- package/dist/types/components/divider/Divider.d.ts +7 -3
- package/dist/types/components/dropdown/DropdownTool.d.ts +2 -1
- package/dist/types/components/icon/Icon.d.ts +3 -3
- package/dist/types/components/media/Media.d.ts +2 -2
- package/dist/types/components/menu/ContextMenu.d.ts +2 -1
- package/dist/types/components/menu/MenuItem.d.ts +1 -1
- package/dist/types/components/menu/types.d.ts +2 -2
- package/dist/types/components/navigator/Navigator.d.ts +4 -4
- package/dist/types/components/progress/ProgressBar.d.ts +2 -2
- package/dist/types/components/progress/ProgressCircle.d.ts +2 -2
- package/dist/types/components/tabpanel/Tab.d.ts +5 -5
- package/dist/types/components/tabpanel/TabPanel.d.ts +10 -1
- package/dist/types/core/content/Content.d.ts +3 -2
- package/dist/types/core/headfoot/HeadFoot.d.ts +1 -9
- package/dist/types/core/responsive/Responsive.d.ts +1 -1
- package/dist/types/core/theme/ThemeProvider.d.ts +4 -4
- package/dist/types/hooks/useOverlayService.d.ts +3 -5
- package/dist/types/index.d.ts +3 -0
- package/dist/types/overlays/alert/Alert.d.ts +2 -2
- package/dist/types/overlays/flyout/Flyout.d.ts +3 -2
- package/dist/types/overlays/message/Message.d.ts +2 -2
- package/dist/types/overlays/modal/Modal.d.ts +4 -3
- package/dist/types/overlays/toast/Toast.d.ts +2 -2
- package/dist/types/overlays/tooltip/Tooltip.d.ts +1 -1
- package/dist/types/types/icons.d.ts +4 -0
- package/dist/types/types/index.d.ts +18 -6
- package/dist/types/typography/Abbr.d.ts +6 -2
- package/dist/types/typography/Anchor.d.ts +25 -0
- package/dist/types/typography/Mark.d.ts +2 -2
- package/dist/types/typography/index.d.ts +1 -1
- package/dist/types/utils/cloneElement.d.ts +2 -0
- package/dist/types/utils/getColor.d.ts +1 -4
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +7 -9
- package/src/components/actionLabel/ActionLabel.tsx +15 -6
- package/src/components/animations/Animations.tsx +29 -23
- package/src/components/avatar/Avatar.tsx +74 -88
- package/src/components/avatar/AvatarGroup.tsx +4 -4
- package/src/components/badge/Badge.tsx +11 -7
- package/src/components/breadcrumbs/Breadcrumbs.tsx +13 -9
- package/src/components/button/Button.tsx +27 -22
- package/src/components/button/ButtonGroup.tsx +7 -7
- package/src/components/button/ConfirmButton.tsx +15 -5
- package/src/components/button/ToggleButtonGroup.tsx +5 -5
- package/src/components/callout/Callout.tsx +26 -11
- package/src/components/card/Card.tsx +10 -7
- package/src/components/card/CardCover.tsx +11 -6
- package/src/components/chip/Chip.tsx +17 -13
- package/src/components/collapsable/Collapsable.tsx +9 -4
- package/src/components/divider/Divider.tsx +15 -10
- package/src/components/dropdown/Dropdown.tsx +5 -5
- package/src/components/dropdown/DropdownTool.tsx +5 -3
- package/src/components/icon/Icon.tsx +55 -67
- package/src/components/media/Media.tsx +141 -106
- package/src/components/menu/ContextMenu.tsx +36 -11
- package/src/components/menu/Menu.tsx +51 -30
- package/src/components/menu/MenuItem.tsx +19 -9
- package/src/components/menu/types.ts +2 -2
- package/src/components/meter/Meter.tsx +2 -3
- package/src/components/navigator/Navigator.tsx +19 -5
- package/src/components/panel/Panel.tsx +10 -9
- package/src/components/panel/PanelGroup.tsx +1 -2
- package/src/components/progress/ProgressBar.tsx +8 -9
- package/src/components/progress/ProgressCircle.tsx +6 -9
- package/src/components/tabpanel/Tab.tsx +81 -64
- package/src/components/tabpanel/TabPanel.tsx +34 -12
- package/src/core/aside/Aside.tsx +11 -10
- package/src/core/boundary/ErrorBoundary.tsx +8 -7
- package/src/core/boundary/ErrorIcon.tsx +1 -2
- package/src/core/content/Content.tsx +17 -12
- package/src/core/headfoot/HeadFoot.tsx +2 -35
- package/src/core/page/Page.tsx +3 -3
- package/src/core/responsive/Responsive.tsx +8 -7
- package/src/core/section/Section.tsx +1 -2
- package/src/core/theme/ThemeProvider.tsx +11 -12
- package/src/core/viewport/Viewport.tsx +1 -2
- package/src/hooks/useNavigator.tsx +10 -5
- package/src/hooks/useOverlayService.tsx +12 -6
- package/src/hotkeys/HotKeyLabel.tsx +1 -1
- package/src/hotkeys/HotKeyWrapper.tsx +3 -1
- package/src/index.ts +4 -0
- package/src/overlays/alert/Alert.tsx +25 -31
- package/src/overlays/flyout/Flyout.tsx +65 -64
- package/src/overlays/message/Message.tsx +10 -7
- package/src/overlays/modal/Modal.tsx +18 -13
- package/src/overlays/toast/Toast.tsx +18 -27
- package/src/overlays/tooltip/Tooltip.tsx +30 -9
- package/src/types/icons.ts +9 -0
- package/src/types/index.ts +240 -27
- package/src/typography/Abbr.tsx +15 -9
- package/src/typography/{Link.tsx → Anchor.tsx} +8 -13
- package/src/typography/Mark.tsx +4 -9
- package/src/typography/Text.tsx +4 -12
- package/src/typography/Title.tsx +2 -6
- package/src/typography/index.ts +1 -1
- package/src/utils/cloneElement.ts +44 -0
- package/src/utils/getColor.ts +1 -17
- package/src/utils/index.ts +1 -0
- package/css/index.js +0 -250
- package/css/tailwind/colors.ts +0 -158
- package/dist/cjs/components/actionLabel/ActionLabel.module.css +0 -1
- package/dist/cjs/components/animations/Animations.module.css +0 -1
- package/dist/cjs/components/avatar/Avatar.module.css +0 -1
- package/dist/cjs/components/badge/Badge.module.css +0 -1
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.module.css +0 -1
- package/dist/cjs/components/button/Button.module.css +0 -1
- package/dist/cjs/components/card/Card.module.css +0 -1
- package/dist/cjs/components/chip/Chip.module.css +0 -1
- package/dist/cjs/components/collapsable/Collapsable.module.css +0 -1
- package/dist/cjs/components/dropdown/Dropdown.module.css +0 -1
- package/dist/cjs/components/icon/Icon.module.css +0 -1
- package/dist/cjs/components/media/Media.module.css +0 -1
- package/dist/cjs/components/menu/Menu.module.css +0 -1
- package/dist/cjs/components/meter/Meter.module.css +0 -1
- package/dist/cjs/components/panel/Panel.module.css +0 -1
- package/dist/cjs/components/progress/Progress.module.css +0 -1
- package/dist/cjs/components/tabpanel/TabPanel.module.css +0 -1
- package/dist/cjs/core/aside/Aside.module.css +0 -1
- package/dist/cjs/core/boundary/ErrorBoundary.module.css +0 -1
- package/dist/cjs/core/content/Content.module.css +0 -1
- package/dist/cjs/core/headfoot/HeadFoot.module.css +0 -1
- package/dist/cjs/core/page/Page.module.css +0 -1
- package/dist/cjs/core/responsive/Responsive.module.css +0 -1
- package/dist/cjs/core/section/Section.module.css +0 -1
- package/dist/cjs/core/theme/Theme.module.css +0 -1
- package/dist/cjs/core/viewport/Viewport.module.css +0 -1
- package/dist/cjs/overlays/alert/Alert.module.css +0 -1
- package/dist/cjs/overlays/flyout/Flyout.module.css +0 -1
- package/dist/cjs/overlays/message/Message.module.css +0 -1
- package/dist/cjs/overlays/modal/Modal.module.css +0 -1
- package/dist/cjs/overlays/toast/Toast.module.css +0 -1
- package/dist/cjs/overlays/tooltip/Tooltip.module.css +0 -1
- package/dist/cjs/typography/Typography.module.css +0 -1
- package/dist/esm/components/actionLabel/ActionLabel.module.css +0 -1
- package/dist/esm/components/animations/Animations.module.css +0 -1
- package/dist/esm/components/avatar/Avatar.module.css +0 -1
- package/dist/esm/components/badge/Badge.module.css +0 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.module.css +0 -1
- package/dist/esm/components/button/Button.module.css +0 -1
- package/dist/esm/components/card/Card.module.css +0 -1
- package/dist/esm/components/chip/Chip.module.css +0 -1
- package/dist/esm/components/collapsable/Collapsable.module.css +0 -1
- package/dist/esm/components/dropdown/Dropdown.module.css +0 -1
- package/dist/esm/components/icon/Icon.module.css +0 -1
- package/dist/esm/components/media/Media.module.css +0 -1
- package/dist/esm/components/menu/Menu.module.css +0 -1
- package/dist/esm/components/meter/Meter.module.css +0 -1
- package/dist/esm/components/panel/Panel.module.css +0 -1
- package/dist/esm/components/progress/Progress.module.css +0 -1
- package/dist/esm/components/tabpanel/TabPanel.module.css +0 -1
- package/dist/esm/core/aside/Aside.module.css +0 -1
- package/dist/esm/core/boundary/ErrorBoundary.module.css +0 -1
- package/dist/esm/core/content/Content.module.css +0 -1
- package/dist/esm/core/headfoot/HeadFoot.module.css +0 -1
- package/dist/esm/core/page/Page.module.css +0 -1
- package/dist/esm/core/responsive/Responsive.module.css +0 -1
- package/dist/esm/core/section/Section.module.css +0 -1
- package/dist/esm/core/theme/Theme.module.css +0 -1
- package/dist/esm/core/viewport/Viewport.module.css +0 -1
- package/dist/esm/overlays/alert/Alert.module.css +0 -1
- package/dist/esm/overlays/flyout/Flyout.module.css +0 -1
- package/dist/esm/overlays/message/Message.module.css +0 -1
- package/dist/esm/overlays/modal/Modal.module.css +0 -1
- package/dist/esm/overlays/toast/Toast.module.css +0 -1
- package/dist/esm/overlays/tooltip/Tooltip.module.css +0 -1
- package/dist/esm/typography/Typography.module.css +0 -1
- package/dist/types/typography/Link.d.ts +0 -25
- package/src/overlays/tooltip/Tooltip.module.css +0 -53
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
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
|
-
import { useFloatingParentNodeId,
|
|
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, useCallback,
|
|
9
|
+
import { useState, useRef, useEffect, useCallback, cloneElement, Fragment } from 'react';
|
|
10
|
+
import { HotKeyWrapper } from '../../hotkeys/HotKeyWrapper.js';
|
|
10
11
|
import { CoreIcons } from '../../types/icons.js';
|
|
12
|
+
import { cloneChildren } from '../../utils/cloneElement.js';
|
|
11
13
|
import { nodeCheck } from '../../utils/nodeCheck.js';
|
|
12
14
|
import { MenuItem } from './MenuItem.js';
|
|
13
15
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -64,8 +66,9 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
64
66
|
})
|
|
65
67
|
});
|
|
66
68
|
var click = useClick(context, {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
event: "mousedown",
|
|
70
|
+
toggle: !isNested,
|
|
71
|
+
ignoreMouse: isNested
|
|
69
72
|
});
|
|
70
73
|
var role = useRole(context, {
|
|
71
74
|
role: "menu"
|
|
@@ -137,6 +140,16 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
137
140
|
});
|
|
138
141
|
}, 100);
|
|
139
142
|
}, [isOpen]);
|
|
143
|
+
useEffect(function () {
|
|
144
|
+
if ((!isNested || isOpen) && activeIndex) {
|
|
145
|
+
setTimeout(function () {
|
|
146
|
+
var _elementsRef$current$;
|
|
147
|
+
(_elementsRef$current$ = elementsRef.current[activeIndex]) === null || _elementsRef$current$ === void 0 || _elementsRef$current$.scrollIntoView({
|
|
148
|
+
block: "nearest"
|
|
149
|
+
});
|
|
150
|
+
}, 100);
|
|
151
|
+
}
|
|
152
|
+
}, [isOpen, activeIndex]);
|
|
140
153
|
return /*#__PURE__*/jsxs(FloatingNode, {
|
|
141
154
|
id: nodeId,
|
|
142
155
|
children: [isNested && /*#__PURE__*/jsx(MenuItem, _objectSpread(_objectSpread({}, getReferenceProps(_objectSpread(_objectSpread({}, rest), {}, {
|
|
@@ -155,21 +168,21 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
155
168
|
elementsRef: elementsRef,
|
|
156
169
|
labelsRef: labelsRef,
|
|
157
170
|
children: (!isNested || isOpen) && /*#__PURE__*/jsxs(Wrapper, _objectSpread(_objectSpread({}, wrapperProps), {}, {
|
|
158
|
-
children: [isNested && /*#__PURE__*/jsx(FloatingOverlay, {}), /*#__PURE__*/jsx(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
children: [isNested && /*#__PURE__*/jsx(FloatingOverlay, {}), /*#__PURE__*/jsx(HotKeyWrapper, {
|
|
172
|
+
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
173
|
+
context: context,
|
|
174
|
+
modal: !isNested,
|
|
175
|
+
initialFocus: isNested ? -1 : 0,
|
|
176
|
+
returnFocus: !isNested,
|
|
177
|
+
children: /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
178
|
+
className: classNames(menuClassName, "flex flex-col bg-base p-1 menu-list", isNested && "outline shadow-lg rounded-capped max-h-96 overflow-auto scroll-thin z-(--z-popover)"),
|
|
179
|
+
autoFocus: true,
|
|
180
|
+
ref: mergeRefs(isNested ? refs.setFloating : ref)
|
|
181
|
+
}, getFloatingProps({
|
|
182
|
+
onClick: isNested ? undefined : handleClick
|
|
183
|
+
})), {}, {
|
|
184
|
+
style: !isNested ? rest.style : floatingStyles,
|
|
185
|
+
children: cloneChildren(children, function (child, index) {
|
|
173
186
|
labelsRef.current[index] = child.props.label;
|
|
174
187
|
return /*#__PURE__*/cloneElement(child, nodeCheck(child, MenuItem, Menu, MenuComponent) ? _objectSpread({
|
|
175
188
|
minimal: !isNested && minimal,
|
|
@@ -181,9 +194,9 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
181
194
|
onClick: child.props.onClick,
|
|
182
195
|
tabIndex: activeIndex === index ? 0 : -1
|
|
183
196
|
})) : {});
|
|
184
|
-
}
|
|
185
|
-
})
|
|
186
|
-
})
|
|
197
|
+
})
|
|
198
|
+
}))
|
|
199
|
+
})
|
|
187
200
|
})]
|
|
188
201
|
}))
|
|
189
202
|
})]
|
|
@@ -191,6 +204,12 @@ var MenuComponent = function MenuComponent(_ref) {
|
|
|
191
204
|
};
|
|
192
205
|
var Menu = function Menu(props) {
|
|
193
206
|
var parentId = useFloatingParentNodeId();
|
|
207
|
+
var tree = useFloatingTree();
|
|
208
|
+
if (tree) {
|
|
209
|
+
return /*#__PURE__*/jsx(MenuComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
210
|
+
menuClassName: props.className
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
194
213
|
if (parentId === null) {
|
|
195
214
|
return /*#__PURE__*/jsx(FloatingTree, {
|
|
196
215
|
children: /*#__PURE__*/jsx(MenuComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import { useFloatingTree } from '@floating-ui/react';
|
|
6
|
-
import { iconToken } from '@react-fabric/utilities';
|
|
6
|
+
import { iconToken, mergeRefs } from '@react-fabric/utilities';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
import { useMemo, useCallback, Fragment } from 'react';
|
|
8
|
+
import { useRef, useMemo, useEffect, useCallback, Fragment } from 'react';
|
|
9
|
+
import { HotKey } from '../../hotkeys/HotKey.js';
|
|
9
10
|
import { HotKeyLabel } from '../../hotkeys/HotKeyLabel.js';
|
|
10
11
|
import '@babel/runtime/helpers/slicedToArray';
|
|
11
12
|
import 'react-i18next';
|
|
12
13
|
import '../../hooks/useEffectDebugger.js';
|
|
13
14
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
14
|
-
import '../../hotkeys/HotKeyWrapper.js';
|
|
15
15
|
import { Tooltip } from '../../overlays/tooltip/Tooltip.js';
|
|
16
16
|
import { getBadgeProps, Badge } from '../badge/Badge.js';
|
|
17
17
|
import { Icon } from '../icon/Icon.js';
|
|
18
18
|
import '../../types/icons.js';
|
|
19
|
-
import
|
|
19
|
+
import '../../hotkeys/HotKeyWrapper.js';
|
|
20
20
|
|
|
21
|
-
var _excluded = ["as", "label", "color", "className", "icon", "iconBg", "iconColor", "appendLabel", "rtlFlip", "altIcon", "id", "active", "disabled", "onClick", "badge", "hotKey", "minimal", "data-open", "ref"],
|
|
21
|
+
var _excluded = ["as", "label", "color", "className", "icon", "iconBg", "iconColor", "appendLabel", "rtlFlip", "altIcon", "id", "active", "disabled", "onClick", "badge", "hotKey", "tabIndex", "minimal", "data-open", "ref"],
|
|
22
22
|
_excluded2 = ["children"];
|
|
23
23
|
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; }
|
|
24
24
|
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; }
|
|
@@ -40,14 +40,21 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
40
40
|
_onClick = _ref.onClick,
|
|
41
41
|
badge = _ref.badge,
|
|
42
42
|
hotKey = _ref.hotKey,
|
|
43
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
44
|
+
tabIndex = _ref$tabIndex === void 0 ? -1 : _ref$tabIndex,
|
|
43
45
|
minimal = _ref.minimal,
|
|
44
46
|
childOpen = _ref["data-open"],
|
|
45
47
|
ref = _ref.ref,
|
|
46
48
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
49
|
+
var elRef = useRef(null);
|
|
47
50
|
var tree = useFloatingTree();
|
|
48
51
|
var badgeProps = useMemo(function () {
|
|
49
52
|
return getBadgeProps(badge);
|
|
50
53
|
}, [badge]);
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
var _elRef$current;
|
|
56
|
+
tabIndex === 0 && ((_elRef$current = elRef.current) === null || _elRef$current === void 0 ? void 0 : _elRef$current.focus());
|
|
57
|
+
}, [tabIndex]);
|
|
51
58
|
var iconEl = useMemo(function () {
|
|
52
59
|
var _path;
|
|
53
60
|
var path = icon;
|
|
@@ -55,7 +62,7 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
55
62
|
path = iconToken(label);
|
|
56
63
|
}
|
|
57
64
|
return /*#__PURE__*/jsx(Icon, {
|
|
58
|
-
className: classNames(
|
|
65
|
+
className: classNames("fabric-menuIcon", minimal && "minimal"),
|
|
59
66
|
icon: (_path = path) !== null && _path !== void 0 ? _path : "",
|
|
60
67
|
bg: iconBg,
|
|
61
68
|
color: iconColor,
|
|
@@ -98,20 +105,27 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
98
105
|
}, [iconEl, minimal, appendLabel, label, badge, badgeProps, hotKey, active]);
|
|
99
106
|
var E = as !== null && as !== void 0 ? as : "button";
|
|
100
107
|
return /*#__PURE__*/jsx(Wrapper, _objectSpread(_objectSpread({}, aria), {}, {
|
|
101
|
-
children: /*#__PURE__*/
|
|
102
|
-
ref: ref,
|
|
108
|
+
children: /*#__PURE__*/jsxs(E, _objectSpread(_objectSpread({
|
|
109
|
+
ref: mergeRefs(ref, elRef),
|
|
103
110
|
"data-dropdown-dismiss": true,
|
|
104
111
|
"data-color": color,
|
|
105
|
-
className: classNames(
|
|
112
|
+
className: classNames("fabric-menuItem cursor-pointer", className, active && "active", minimal && "minimal", disabled && "disabled", "rounded-capped relative max-w-[50vw] my-0.5"),
|
|
106
113
|
"data-active": active,
|
|
107
114
|
"data-open": childOpen,
|
|
108
115
|
disabled: disabled,
|
|
109
116
|
"data-id": id,
|
|
117
|
+
tabIndex: tabIndex,
|
|
110
118
|
onClick: function onClick(e) {
|
|
111
119
|
(_onClick === null || _onClick === void 0 ? void 0 : _onClick(e)) !== false && (tree === null || tree === void 0 ? void 0 : tree.events.emit("click"));
|
|
112
120
|
}
|
|
113
121
|
}, minimal ? {} : aria), {}, {
|
|
114
|
-
children:
|
|
122
|
+
children: [hotKey && /*#__PURE__*/jsx(HotKey, {
|
|
123
|
+
keyCombo: hotKey,
|
|
124
|
+
handler: function handler() {
|
|
125
|
+
var _elRef$current2, _elRef$current2$click;
|
|
126
|
+
return (_elRef$current2 = elRef.current) === null || _elRef$current2 === void 0 || (_elRef$current2$click = _elRef$current2.click) === null || _elRef$current2$click === void 0 ? void 0 : _elRef$current2$click.call(_elRef$current2);
|
|
127
|
+
}
|
|
128
|
+
}), menuLabel]
|
|
115
129
|
}))
|
|
116
130
|
}));
|
|
117
131
|
};
|
|
@@ -5,7 +5,6 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
5
5
|
import { Format } from '@react-fabric/utilities';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import { useMemoDebugger } from '../../hooks/useEffectDebugger.js';
|
|
8
|
-
import classes from './Meter.module.css';
|
|
9
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
9
|
|
|
11
10
|
var _excluded = ["value", "hideLabel", "className"];
|
|
@@ -21,11 +20,11 @@ var Meter = function Meter(_ref) {
|
|
|
21
20
|
return value / 16.67;
|
|
22
21
|
}, [value], "Meter activeCount");
|
|
23
22
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
24
|
-
className: classNames(
|
|
23
|
+
className: classNames("fabric-meter", className, "flex flex-nowrap items-center gap-[2px]")
|
|
25
24
|
}, aria), {}, {
|
|
26
25
|
children: [[0, 1, 2, 3, 4, 5].map(function (step) {
|
|
27
26
|
return /*#__PURE__*/jsx("div", {
|
|
28
|
-
className: classNames(
|
|
27
|
+
className: classNames("fabric-meterBar", "first-of-type:rounded-s last-of-type:rounded-e bg-tint-100 relative outline -outline-offset-1 outline-muted overflow-hidden after:absolute after:inset-0"),
|
|
29
28
|
"data-active": activeCount >= step,
|
|
30
29
|
style: {
|
|
31
30
|
"--width": "".concat(Math.min((activeCount - step) * 100, 100), "%")
|
|
@@ -3,46 +3,53 @@
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
+
import { useCallback } from 'react';
|
|
6
7
|
import { HotKey } from '../../hotkeys/HotKey.js';
|
|
7
8
|
import { CoreIcons } from '../../types/icons.js';
|
|
8
9
|
import { Icon } from '../icon/Icon.js';
|
|
9
10
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
11
|
|
|
11
|
-
var _excluded = ["className", "onNavigate", "color"];
|
|
12
|
+
var _excluded = ["className", "onNavigate", "color", "children"];
|
|
12
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; }
|
|
13
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; }
|
|
14
15
|
var Navigator = function Navigator(_ref) {
|
|
15
16
|
var className = _ref.className,
|
|
16
17
|
onNavigate = _ref.onNavigate,
|
|
17
18
|
color = _ref.color,
|
|
19
|
+
children = _ref.children,
|
|
18
20
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var navPrev = useCallback(function () {
|
|
22
|
+
return onNavigate(-1);
|
|
23
|
+
}, [onNavigate]);
|
|
24
|
+
var navNext = useCallback(function () {
|
|
25
|
+
return onNavigate(+1);
|
|
26
|
+
}, [onNavigate]);
|
|
19
27
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
20
|
-
|
|
28
|
+
"data-ref": "navigator",
|
|
29
|
+
className: classNames(className, "inline-flex items-center leading-none")
|
|
21
30
|
}, aria), {}, {
|
|
22
31
|
children: [/*#__PURE__*/jsx(HotKey, {
|
|
23
32
|
keyCombo: "left",
|
|
24
|
-
handler:
|
|
25
|
-
return onNavigate(-1);
|
|
26
|
-
}
|
|
33
|
+
handler: navPrev
|
|
27
34
|
}), /*#__PURE__*/jsx(HotKey, {
|
|
28
35
|
keyCombo: "right",
|
|
29
|
-
handler:
|
|
30
|
-
return onNavigate(1);
|
|
31
|
-
}
|
|
36
|
+
handler: navNext
|
|
32
37
|
}), /*#__PURE__*/jsx(Icon, {
|
|
33
38
|
rtlFlip: true,
|
|
34
39
|
color: color,
|
|
35
40
|
className: "text-[1em] p-1",
|
|
36
41
|
"aria-label": "previous",
|
|
42
|
+
"data-ref": "previous",
|
|
37
43
|
icon: CoreIcons.chevronLeft,
|
|
38
44
|
onClick: function onClick(e) {
|
|
39
45
|
return [e.stopPropagation(), onNavigate(-1)];
|
|
40
46
|
}
|
|
41
|
-
}), /*#__PURE__*/jsx(Icon, {
|
|
47
|
+
}), children, /*#__PURE__*/jsx(Icon, {
|
|
42
48
|
rtlFlip: true,
|
|
43
49
|
className: "text-[1em] p-1",
|
|
44
50
|
color: color,
|
|
45
51
|
"aria-label": "next",
|
|
52
|
+
"data-ref": "next",
|
|
46
53
|
icon: CoreIcons.chevronRight,
|
|
47
54
|
onClick: function onClick(e) {
|
|
48
55
|
return [e.stopPropagation(), onNavigate(1)];
|
|
@@ -9,7 +9,6 @@ import { usePropToggle } from '../../hooks/usePropToggle.js';
|
|
|
9
9
|
import { CoreIcons } from '../../types/icons.js';
|
|
10
10
|
import { Loading } from '../animations/Animations.js';
|
|
11
11
|
import { Icon } from '../icon/Icon.js';
|
|
12
|
-
import classes from './Panel.module.css';
|
|
13
12
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
14
13
|
|
|
15
14
|
var _excluded = ["children", "className", "titleClassName", "headerClassName", "title", "actions", "icon", "iconBg", "iconColor", "rtlFlip", "panelId", "height", "width", "minHeight", "minWidth", "maxHeight", "maxWidth", "loading", "expandable", "expanded", "onExpand", "collapsable", "collapsed", "onCollapse", "onClose", "onBack"];
|
|
@@ -55,7 +54,7 @@ var Panel = function Panel(_ref) {
|
|
|
55
54
|
return !!expandable || !!collapsable || !!onClose;
|
|
56
55
|
}, [expandable, collapsable, onClose]);
|
|
57
56
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
58
|
-
className: classNames(
|
|
57
|
+
className: classNames("fabric-panel", className, "rounded-capped overflow-hidden outline grid", expanded ? "fixed inset-4 z-50" : "relative"),
|
|
59
58
|
"data-ref": "panel",
|
|
60
59
|
"data-collapsed": collapsed,
|
|
61
60
|
style: expanded ? {} : collapsed ? {
|
|
@@ -73,11 +72,12 @@ var Panel = function Panel(_ref) {
|
|
|
73
72
|
}, aria), {}, {
|
|
74
73
|
children: [/*#__PURE__*/jsxs("header", {
|
|
75
74
|
role: "none",
|
|
76
|
-
className: classNames(
|
|
75
|
+
className: classNames("fabric-panelHeader", headerClassName, "flex flex-nowrap items-center area-head"),
|
|
76
|
+
"data-ref": "panelHeader",
|
|
77
77
|
onClick: collapsable ? toggleCollapse : undefined,
|
|
78
78
|
children: [onBack && /*#__PURE__*/jsx(Icon, {
|
|
79
79
|
"data-ref": "panelBack",
|
|
80
|
-
className: classNames(
|
|
80
|
+
className: classNames("fabric-panelAction", "cursor-pointer"),
|
|
81
81
|
icon: CoreIcons.chevronLeft,
|
|
82
82
|
onClick: onBack
|
|
83
83
|
}), icon && /*#__PURE__*/jsx(Icon, {
|
|
@@ -90,7 +90,7 @@ var Panel = function Panel(_ref) {
|
|
|
90
90
|
className: classNames(titleClassName, "flex-1 select-none truncate", title && "py-1 first:px-2"),
|
|
91
91
|
children: title
|
|
92
92
|
}), /*#__PURE__*/jsx("div", {
|
|
93
|
-
className: "px-1",
|
|
93
|
+
className: "px-1 leading-none",
|
|
94
94
|
children: actions
|
|
95
95
|
}), hasTools && /*#__PURE__*/jsxs("div", {
|
|
96
96
|
role: "none",
|
|
@@ -100,23 +100,24 @@ var Panel = function Panel(_ref) {
|
|
|
100
100
|
},
|
|
101
101
|
children: [expandable && /*#__PURE__*/jsx(Icon, {
|
|
102
102
|
"data-ref": "panelExpand",
|
|
103
|
-
className: classNames(
|
|
103
|
+
className: classNames("fabric-panelAction", "cursor-pointer"),
|
|
104
104
|
icon: expanded ? CoreIcons.minimize : CoreIcons.maximize,
|
|
105
105
|
onClick: toggleExpand
|
|
106
106
|
}), !expanded && collapsable && /*#__PURE__*/jsx(Icon, {
|
|
107
107
|
"data-ref": "panelCollapse",
|
|
108
|
-
className: classNames(
|
|
108
|
+
className: classNames("fabric-panelAction", "cursor-pointer"),
|
|
109
109
|
icon: collapsed ? CoreIcons.expand : CoreIcons.collapse,
|
|
110
110
|
onClick: toggleCollapse
|
|
111
111
|
}), !expanded && onClose && /*#__PURE__*/jsx(Icon, {
|
|
112
112
|
"data-ref": "panelClose",
|
|
113
|
-
className: classNames(
|
|
113
|
+
className: classNames("fabric-panelAction", "cursor-pointer"),
|
|
114
114
|
icon: CoreIcons.close,
|
|
115
115
|
onClick: onClose
|
|
116
116
|
})]
|
|
117
117
|
})]
|
|
118
118
|
}), (!collapsed || expanded) && /*#__PURE__*/jsxs("div", {
|
|
119
|
-
|
|
119
|
+
"data-ref": "panelBody",
|
|
120
|
+
className: classNames("fabric-panelBody", "area-content grid overflow-hidden"),
|
|
120
121
|
children: [loading && /*#__PURE__*/jsx(Loading, {}), children]
|
|
121
122
|
})]
|
|
122
123
|
}));
|
|
@@ -4,7 +4,6 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { useState, Children, useCallback, cloneElement } from 'react';
|
|
6
6
|
import { useMemoDebugger, useEffectDebugger } from '../../hooks/useEffectDebugger.js';
|
|
7
|
-
import classes from './Panel.module.css';
|
|
8
7
|
import { jsx } from 'react/jsx-runtime';
|
|
9
8
|
|
|
10
9
|
var PanelGroup = function PanelGroup(_ref) {
|
|
@@ -33,7 +32,7 @@ var PanelGroup = function PanelGroup(_ref) {
|
|
|
33
32
|
}, [onActiveChange, expandedPanel]);
|
|
34
33
|
return /*#__PURE__*/jsx("div", {
|
|
35
34
|
"data-ref": "panelGroup",
|
|
36
|
-
className: classNames(
|
|
35
|
+
className: classNames("fabric-panelGroup", "flex flex-col overflow-auto area-content p-px"),
|
|
37
36
|
children: Children.toArray(children).map(function (child, index) {
|
|
38
37
|
return /*#__PURE__*/cloneElement(child, {
|
|
39
38
|
panelId: child.props.panelId || index,
|
|
@@ -4,9 +4,9 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import { Format } from '@react-fabric/utilities';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { useMemoDebugger } from '../../hooks/useEffectDebugger.js';
|
|
7
|
-
import
|
|
8
|
-
import classes from './Progress.module.css';
|
|
7
|
+
import 'react';
|
|
9
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
+
import { getColor } from '../../utils/getColor.js';
|
|
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; }
|
|
@@ -24,7 +24,7 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
24
24
|
value = _ref$value === void 0 ? 0 : _ref$value,
|
|
25
25
|
size = _ref.size,
|
|
26
26
|
_ref$color = _ref.color,
|
|
27
|
-
color = _ref$color === void 0 ? "primary" : _ref$color,
|
|
27
|
+
color = _ref$color === void 0 ? "primary-500" : _ref$color,
|
|
28
28
|
_ref$label = _ref.label,
|
|
29
29
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
30
30
|
animate = _ref.animate;
|
|
@@ -40,8 +40,9 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
40
40
|
|
|
41
41
|
/** ***************** component *******************/
|
|
42
42
|
return /*#__PURE__*/jsxs("div", {
|
|
43
|
-
className: classNames(
|
|
43
|
+
className: classNames("fabric-progressbar", "block bg-dimmed relative rounded font-bold overflow-hidden whitespace-nowrap"),
|
|
44
44
|
style: _objectSpread(_objectSpread({}, progressVar), {}, {
|
|
45
|
+
color: getColor(color),
|
|
45
46
|
minHeight: SizeMap[size !== null && size !== void 0 ? size : ""],
|
|
46
47
|
fontSize: SizeMap[size !== null && size !== void 0 ? size : ""]
|
|
47
48
|
}),
|
|
@@ -51,7 +52,7 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
51
52
|
className: "absolute inset-0 text-center z-0 align-top",
|
|
52
53
|
children: [label, " ", Format.percent(actualValue / 100)]
|
|
53
54
|
}), /*#__PURE__*/jsx("div", {
|
|
54
|
-
className: classNames(
|
|
55
|
+
className: classNames("fabric-progressTrack", animate && "fabric-progressAnimate", "h-full overflow-clip bg-current relative z-0")
|
|
55
56
|
}), !["xxs", "xs", "sm"].includes(size !== null && size !== void 0 ? size : "") && /*#__PURE__*/jsx("div", {
|
|
56
57
|
className: classNames("h-full absolute inset-0 overflow-hidden z-1"),
|
|
57
58
|
"data-label": "".concat(label, " ").concat(Format.percent(actualValue / 100))
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import { Format } from '@react-fabric/utilities';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { useMemoDebugger } from '../../hooks/useEffectDebugger.js';
|
|
6
|
-
import
|
|
6
|
+
import 'react';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
import { getColor } from '../../utils/getColor.js';
|
|
8
9
|
|
|
9
10
|
/*
|
|
10
11
|
* React Fabric
|
|
@@ -42,7 +43,7 @@ var ProgressCircle = function ProgressCircle(_ref) {
|
|
|
42
43
|
_ref$size = _ref.size,
|
|
43
44
|
size = _ref$size === void 0 ? "sm" : _ref$size,
|
|
44
45
|
_ref$color = _ref.color,
|
|
45
|
-
color = _ref$color === void 0 ? "primary" : _ref$color;
|
|
46
|
+
color = _ref$color === void 0 ? "primary-500" : _ref$color;
|
|
46
47
|
/** ***************** make sure value is between 0 and 100 *******************/
|
|
47
48
|
var actualValue = useMemoDebugger(function () {
|
|
48
49
|
return Math.min(Math.max(value, 0), 100);
|
|
@@ -56,10 +57,11 @@ var ProgressCircle = function ProgressCircle(_ref) {
|
|
|
56
57
|
|
|
57
58
|
/** ***************** component *******************/
|
|
58
59
|
return /*#__PURE__*/jsxs("div", {
|
|
59
|
-
className: classNames("inline-block w-[4em] h-[4em] text-lg relative"
|
|
60
|
+
className: classNames("inline-block w-[4em] h-[4em] text-lg relative"),
|
|
60
61
|
"aria-hidden": "true",
|
|
61
62
|
style: {
|
|
62
|
-
fontSize: SizeMap[size]
|
|
63
|
+
fontSize: SizeMap[size],
|
|
64
|
+
color: getColor(color)
|
|
63
65
|
},
|
|
64
66
|
children: [/*#__PURE__*/jsxs("svg", {
|
|
65
67
|
viewBox: "0 0 100 100",
|
|
@@ -2,15 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
+
import { isString } from '@react-fabric/utilities';
|
|
5
6
|
import classNames from 'classnames';
|
|
6
|
-
import { useMemo } from 'react';
|
|
7
|
+
import { useMemo, Fragment } from 'react';
|
|
8
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
9
|
+
import '@floating-ui/react';
|
|
10
|
+
import 'react-i18next';
|
|
11
|
+
import '../../hooks/useEffectDebugger.js';
|
|
12
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
|
+
import '../../hotkeys/HotKeyWrapper.js';
|
|
14
|
+
import { Tooltip } from '../../overlays/tooltip/Tooltip.js';
|
|
7
15
|
import { getBadgeProps, Badge } from '../badge/Badge.js';
|
|
8
|
-
import { DropdownTool } from '../dropdown/DropdownTool.js';
|
|
9
16
|
import { Icon } from '../icon/Icon.js';
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
17
|
+
import '../../types/icons.js';
|
|
18
|
+
import { DropdownTool } from '../dropdown/DropdownTool.js';
|
|
12
19
|
|
|
13
|
-
var _excluded = ["ref", "as", "id", "className", "label", "icon", "iconBg", "iconColor", "rtlFlip", "badge", "disabled", "onClose", "active", "
|
|
20
|
+
var _excluded = ["ref", "as", "id", "className", "label", "icon", "iconBg", "iconColor", "rtlFlip", "badge", "disabled", "onClose", "active", "onClick", "tabFlex", "color", "actions", "tooltip", "activeClassName"];
|
|
14
21
|
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; }
|
|
15
22
|
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; }
|
|
16
23
|
var Tab = function Tab(_ref) {
|
|
@@ -27,51 +34,64 @@ var Tab = function Tab(_ref) {
|
|
|
27
34
|
disabled = _ref.disabled,
|
|
28
35
|
onClose = _ref.onClose,
|
|
29
36
|
active = _ref.active,
|
|
30
|
-
minimal = _ref.minimal,
|
|
31
37
|
_onClick = _ref.onClick,
|
|
32
38
|
tabFlex = _ref.tabFlex,
|
|
33
39
|
color = _ref.color,
|
|
34
40
|
actions = _ref.actions,
|
|
41
|
+
tooltip = _ref.tooltip,
|
|
35
42
|
activeClassName = _ref.activeClassName,
|
|
36
43
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
37
44
|
var badgeProps = useMemo(function () {
|
|
38
45
|
return getBadgeProps(badge);
|
|
39
46
|
}, [badge]);
|
|
47
|
+
var minimal = useMemo(function () {
|
|
48
|
+
return !label;
|
|
49
|
+
}, [label]);
|
|
50
|
+
var tooltipProps = useMemo(function () {
|
|
51
|
+
if (isString(tooltip)) return {
|
|
52
|
+
content: tooltip
|
|
53
|
+
};
|
|
54
|
+
return tooltip !== null && tooltip !== void 0 ? tooltip : {};
|
|
55
|
+
}, [tooltip]);
|
|
40
56
|
var E = as !== null && as !== void 0 ? as : "button";
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
children: [icon && /*#__PURE__*/jsx(Icon, {
|
|
52
|
-
icon: icon,
|
|
53
|
-
bg: iconBg,
|
|
54
|
-
color: iconColor,
|
|
55
|
-
rtlFlip: rtlFlip,
|
|
56
|
-
className: "flex-content"
|
|
57
|
-
}), !minimal && /*#__PURE__*/jsx("label", {
|
|
58
|
-
className: "flex-initial truncate text-center px-1 py-1",
|
|
59
|
-
children: label
|
|
60
|
-
}), badge && /*#__PURE__*/jsx(Badge, _objectSpread(_objectSpread({}, badgeProps), {}, {
|
|
61
|
-
placement: minimal ? "end" : "",
|
|
62
|
-
className: classNames("me-1", badgeProps.className)
|
|
63
|
-
})), actions && active && /*#__PURE__*/jsx(DropdownTool, {
|
|
64
|
-
className: "bg-base/20 me-1 z-5",
|
|
65
|
-
children: actions
|
|
66
|
-
}), onClose && /*#__PURE__*/jsx("span", {
|
|
67
|
-
role: "none",
|
|
68
|
-
className: classNames("cursor-pointer me-1 opacity-65 hover:opacity-90 pointer-events-auto"),
|
|
69
|
-
onClick: function onClick(e) {
|
|
70
|
-
onClose === null || onClose === void 0 || onClose();
|
|
71
|
-
e.stopPropagation();
|
|
57
|
+
var W = tooltip ? Tooltip : Fragment;
|
|
58
|
+
return /*#__PURE__*/jsx(W, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
59
|
+
children: /*#__PURE__*/jsxs(E, _objectSpread(_objectSpread({
|
|
60
|
+
"data-id": id,
|
|
61
|
+
disabled: disabled,
|
|
62
|
+
"data-color": color,
|
|
63
|
+
"data-inner-clickable": true,
|
|
64
|
+
className: classNames("fabric-tabButton", className, active && "active pointer-events-none", active && activeClassName, disabled && "text-tint-500 pointer-events-none", tabFlex ? "flex-1" : "flex-initial max-w-36", minimal ? "min-w-6" : "min-w-18", "flex items-center justify-center px-1 rounded overflow-hidden"),
|
|
65
|
+
onClick: function onClick() {
|
|
66
|
+
return !active && (_onClick === null || _onClick === void 0 ? void 0 : _onClick(id));
|
|
72
67
|
},
|
|
73
|
-
|
|
74
|
-
})
|
|
68
|
+
ref: ref
|
|
69
|
+
}, aria), {}, {
|
|
70
|
+
children: [icon && /*#__PURE__*/jsx(Icon, {
|
|
71
|
+
icon: icon,
|
|
72
|
+
bg: iconBg,
|
|
73
|
+
color: iconColor,
|
|
74
|
+
rtlFlip: rtlFlip,
|
|
75
|
+
className: "flex-content p-2"
|
|
76
|
+
}), !minimal && /*#__PURE__*/jsx("label", {
|
|
77
|
+
className: "flex-initial truncate text-center px-1 py-1",
|
|
78
|
+
children: label
|
|
79
|
+
}), badge && /*#__PURE__*/jsx(Badge, _objectSpread(_objectSpread({}, badgeProps), {}, {
|
|
80
|
+
placement: minimal ? "end" : "",
|
|
81
|
+
className: classNames("me-1", badgeProps.className)
|
|
82
|
+
})), actions && active && /*#__PURE__*/jsx(DropdownTool, {
|
|
83
|
+
className: "bg-tint-50/20 me-1 z-5",
|
|
84
|
+
children: actions
|
|
85
|
+
}), onClose && /*#__PURE__*/jsx("span", {
|
|
86
|
+
role: "none",
|
|
87
|
+
className: classNames("cursor-pointer me-1 opacity-65 hover:opacity-90 pointer-events-auto"),
|
|
88
|
+
onClick: function onClick(e) {
|
|
89
|
+
onClose === null || onClose === void 0 || onClose();
|
|
90
|
+
e.stopPropagation();
|
|
91
|
+
},
|
|
92
|
+
children: "\xD7"
|
|
93
|
+
})]
|
|
94
|
+
}))
|
|
75
95
|
}));
|
|
76
96
|
};
|
|
77
97
|
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { useState, useMemo, Children, useEffect, useCallback, cloneElement } from 'react';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
7
|
import '@react-fabric/utilities';
|
|
7
8
|
import { nodeCheck } from '../../utils/nodeCheck.js';
|
|
8
9
|
import { Tab } from './Tab.js';
|
|
9
|
-
import classes from './TabPanel.module.css';
|
|
10
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
11
10
|
|
|
12
11
|
// TODO: implement append/prepend tab-bar items
|
|
13
12
|
|
|
@@ -20,6 +19,8 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
20
19
|
justify = _ref.justify,
|
|
21
20
|
variant = _ref.variant,
|
|
22
21
|
tabFlex = _ref.tabFlex,
|
|
22
|
+
append = _ref.append,
|
|
23
|
+
prepend = _ref.prepend,
|
|
23
24
|
gap = _ref.gap,
|
|
24
25
|
onBeforeChange = _ref.onBeforeChange,
|
|
25
26
|
onChange = _ref.onChange;
|
|
@@ -54,22 +55,25 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
54
55
|
});
|
|
55
56
|
}, [onBeforeChange, onChange, active]);
|
|
56
57
|
return /*#__PURE__*/jsxs("div", {
|
|
57
|
-
className: classNames(
|
|
58
|
+
className: classNames("fabric-tabPanel", "area-content grid bg-base overflow-hidden"),
|
|
58
59
|
"data-orientation": orientation,
|
|
59
60
|
"data-variant": variant !== null && variant !== void 0 ? variant : "default",
|
|
60
|
-
children: [/*#__PURE__*/
|
|
61
|
-
className: classNames(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
62
|
+
className: classNames("fabric-tabHeader", headerClassName, justify && "justify-".concat(justify), ["start", "end"].includes(orientation) && "flex-col", "flex flex-nowrap overflow-hidden items-center"),
|
|
63
|
+
children: [prepend, /*#__PURE__*/jsx("div", {
|
|
64
|
+
className: classNames("fabric-tabList", justify && "justify-".concat(justify), ["start", "end"].includes(orientation) && "flex-col", ["bottom", "end"].includes(orientation) ? "self-start" : "self-end", "flex flex-1 flex-nowrap overflow-auto scroll-thin"),
|
|
65
|
+
style: {
|
|
66
|
+
gap: gap
|
|
67
|
+
},
|
|
68
|
+
children: tabs.map(function (node) {
|
|
69
|
+
var _node$props$tabFlex;
|
|
70
|
+
return /*#__PURE__*/cloneElement(node, {
|
|
71
|
+
tabFlex: (_node$props$tabFlex = node.props.tabFlex) !== null && _node$props$tabFlex !== void 0 ? _node$props$tabFlex : tabFlex,
|
|
72
|
+
onClick: handleClick,
|
|
73
|
+
active: node.props.id === active
|
|
74
|
+
});
|
|
75
|
+
})
|
|
76
|
+
}), append]
|
|
73
77
|
}), rest, activeTabPanel]
|
|
74
78
|
});
|
|
75
79
|
};
|