@react-fabric/core 1.0.0-beta.5 → 1.0.0-beta.52
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} +69 -79
- package/{src/components/card/Card.module.css → css/components/_card.css} +50 -28
- package/{src/components/chip/Chip.module.css → css/components/_chip.css} +14 -10
- package/{src/components/collapsable/Collapsable.module.css → css/components/_collapsable.css} +3 -3
- package/css/components/_divider.css +38 -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} +19 -20
- 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} +8 -8
- 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} +56 -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 +42 -224
- package/css/reset/_text.css +14 -29
- package/css/reset/_theme.css +331 -52
- 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 +45 -0
- package/dist/cjs/components/actionLabel/ActionLabel.js +26 -8
- package/dist/cjs/components/animations/Animations.js +118 -24
- package/dist/cjs/components/avatar/Avatar.js +43 -16
- package/dist/cjs/components/avatar/AvatarGroup.js +22 -4
- package/dist/cjs/components/badge/Badge.js +35 -6
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +39 -8
- package/dist/cjs/components/button/Button.js +42 -15
- package/dist/cjs/components/button/ButtonGroup.js +30 -3
- package/dist/cjs/components/button/ConfirmButton.js +32 -4
- package/dist/cjs/components/button/ToggleButtonGroup.js +41 -15
- package/dist/cjs/components/callout/Callout.js +44 -4
- package/dist/cjs/components/card/Card.js +48 -10
- package/dist/cjs/components/card/CardCover.js +36 -5
- package/dist/cjs/components/card/FlipContent.js +56 -0
- package/dist/cjs/components/chip/Chip.js +32 -7
- package/dist/cjs/components/collapsable/Collapsable.js +32 -6
- package/dist/cjs/components/divider/Divider.js +30 -7
- package/dist/cjs/components/dropdown/Dropdown.js +48 -9
- package/dist/cjs/components/dropdown/DropdownTool.js +4 -3
- package/dist/cjs/components/empty/EmptyContent.js +35 -5
- package/dist/cjs/components/icon/Icon.js +44 -16
- package/dist/cjs/components/media/Media.js +172 -75
- package/dist/cjs/components/menu/ContextMenu.js +49 -10
- package/dist/cjs/components/menu/Menu.js +74 -21
- package/dist/cjs/components/menu/MenuItem.js +51 -16
- package/dist/cjs/components/meter/Meter.js +26 -3
- package/dist/cjs/components/navigator/Navigator.js +48 -13
- package/dist/cjs/components/panel/Panel.js +47 -9
- package/dist/cjs/components/panel/PanelGroup.js +25 -2
- package/dist/cjs/components/panel/PanelStack.js +31 -0
- package/dist/cjs/components/progress/ProgressBar.js +31 -9
- package/dist/cjs/components/progress/ProgressCircle.js +29 -7
- package/dist/cjs/components/tabpanel/Tab.js +89 -38
- package/dist/cjs/components/tabpanel/TabPanel.js +53 -16
- package/dist/cjs/context/Global.js +28 -1
- package/dist/cjs/context/NotificationCenter.js +3 -3
- package/dist/cjs/core/aside/Aside.js +49 -11
- package/dist/cjs/core/boundary/ErrorBoundary.js +23 -8
- package/dist/cjs/core/boundary/ErrorIcon.js +1 -2
- package/dist/cjs/core/content/Content.js +15 -8
- package/dist/cjs/core/headfoot/HeadFoot.js +44 -20
- package/dist/cjs/core/page/Page.js +40 -29
- package/dist/cjs/core/responsive/Responsive.js +59 -6
- package/dist/cjs/core/section/Section.js +1 -2
- package/dist/cjs/core/theme/ThemeProvider.js +32 -10
- package/dist/cjs/core/viewport/Viewport.js +18 -2
- package/dist/cjs/hooks/useControlledValue.js +12 -0
- package/dist/cjs/hooks/useDebounce.js +14 -1
- package/dist/cjs/hooks/useEffectDebugger.js +54 -2
- package/dist/cjs/hooks/useIsDark.js +8 -0
- package/dist/cjs/hooks/useIsRtl.js +12 -0
- package/dist/cjs/hooks/useNavigator.js +6 -4
- package/dist/cjs/hooks/useOverlayService.js +24 -0
- package/dist/cjs/hooks/usePropToggle.js +16 -5
- package/dist/cjs/hooks/useResize.js +18 -0
- package/dist/cjs/hooks/useResizeObserver.js +20 -1
- package/dist/cjs/hooks/useStorage.js +39 -0
- package/dist/cjs/hotkeys/HotKeyLabel.js +1 -1
- package/dist/cjs/hotkeys/HotKeyWrapper.js +3 -1
- package/dist/cjs/index.js +8 -2
- package/dist/cjs/overlays/alert/Alert.js +20 -14
- package/dist/cjs/overlays/flyout/Flyout.js +49 -60
- package/dist/cjs/overlays/message/Message.js +6 -3
- package/dist/cjs/overlays/modal/Modal.js +16 -12
- package/dist/cjs/overlays/toast/Toast.js +17 -9
- package/dist/cjs/overlays/tooltip/Tooltip.js +24 -11
- package/dist/cjs/types/icons.js +10 -1
- package/dist/cjs/typography/Abbr.js +32 -6
- package/dist/cjs/typography/{Link.js → Anchor.js} +23 -5
- package/dist/cjs/typography/Mark.js +22 -4
- package/dist/cjs/typography/Text.js +30 -5
- package/dist/cjs/typography/Title.js +19 -4
- package/dist/cjs/utils/cloneElement.js +47 -0
- package/dist/cjs/utils/getColor.js +1 -18
- package/dist/esm/components/actionLabel/ActionLabel.js +26 -8
- package/dist/esm/components/animations/Animations.js +119 -25
- package/dist/esm/components/avatar/Avatar.js +44 -17
- package/dist/esm/components/avatar/AvatarGroup.js +22 -4
- package/dist/esm/components/badge/Badge.js +36 -7
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +39 -8
- package/dist/esm/components/button/Button.js +42 -15
- package/dist/esm/components/button/ButtonGroup.js +31 -4
- package/dist/esm/components/button/ConfirmButton.js +32 -4
- package/dist/esm/components/button/ToggleButtonGroup.js +42 -16
- package/dist/esm/components/callout/Callout.js +44 -4
- package/dist/esm/components/card/Card.js +49 -11
- package/dist/esm/components/card/CardCover.js +36 -5
- package/dist/esm/components/card/FlipContent.js +56 -0
- package/dist/esm/components/chip/Chip.js +33 -8
- package/dist/esm/components/collapsable/Collapsable.js +32 -6
- package/dist/esm/components/divider/Divider.js +31 -8
- package/dist/esm/components/dropdown/Dropdown.js +48 -9
- package/dist/esm/components/dropdown/DropdownTool.js +4 -3
- package/dist/esm/components/empty/EmptyContent.js +35 -5
- package/dist/esm/components/icon/Icon.js +44 -16
- package/dist/esm/components/media/Media.js +173 -76
- package/dist/esm/components/menu/ContextMenu.js +51 -12
- package/dist/esm/components/menu/Menu.js +76 -23
- package/dist/esm/components/menu/MenuItem.js +45 -10
- package/dist/esm/components/meter/Meter.js +26 -3
- package/dist/esm/components/navigator/Navigator.js +48 -13
- package/dist/esm/components/panel/Panel.js +47 -9
- package/dist/esm/components/panel/PanelGroup.js +25 -2
- package/dist/esm/components/panel/PanelStack.js +31 -0
- package/dist/esm/components/progress/ProgressBar.js +31 -9
- package/dist/esm/components/progress/ProgressCircle.js +29 -7
- package/dist/esm/components/tabpanel/Tab.js +90 -39
- package/dist/esm/components/tabpanel/TabPanel.js +53 -16
- package/dist/esm/context/Global.js +28 -1
- package/dist/esm/context/NotificationCenter.js +3 -3
- package/dist/esm/core/aside/Aside.js +49 -11
- package/dist/esm/core/boundary/ErrorBoundary.js +23 -8
- package/dist/esm/core/boundary/ErrorIcon.js +1 -2
- package/dist/esm/core/content/Content.js +15 -8
- package/dist/esm/core/headfoot/HeadFoot.js +44 -20
- package/dist/esm/core/page/Page.js +40 -29
- package/dist/esm/core/responsive/Responsive.js +59 -6
- package/dist/esm/core/section/Section.js +1 -2
- package/dist/esm/core/theme/ThemeProvider.js +32 -10
- package/dist/esm/core/viewport/Viewport.js +18 -2
- package/dist/esm/hooks/useControlledValue.js +12 -0
- package/dist/esm/hooks/useDebounce.js +14 -1
- package/dist/esm/hooks/useEffectDebugger.js +54 -2
- package/dist/esm/hooks/useIsDark.js +8 -0
- package/dist/esm/hooks/useIsRtl.js +12 -0
- package/dist/esm/hooks/useNavigator.js +7 -5
- package/dist/esm/hooks/useOverlayService.js +24 -0
- package/dist/esm/hooks/usePropToggle.js +16 -5
- package/dist/esm/hooks/useResize.js +18 -0
- package/dist/esm/hooks/useResizeObserver.js +20 -1
- package/dist/esm/hooks/useStorage.js +39 -0
- package/dist/esm/hotkeys/HotKeyLabel.js +1 -1
- package/dist/esm/hotkeys/HotKeyWrapper.js +3 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/overlays/alert/Alert.js +21 -15
- package/dist/esm/overlays/flyout/Flyout.js +52 -63
- package/dist/esm/overlays/message/Message.js +7 -4
- package/dist/esm/overlays/modal/Modal.js +17 -13
- package/dist/esm/overlays/toast/Toast.js +18 -10
- package/dist/esm/overlays/tooltip/Tooltip.js +24 -11
- package/dist/esm/types/icons.js +10 -1
- package/dist/esm/typography/Abbr.js +32 -6
- package/dist/esm/typography/{Link.js → Anchor.js} +24 -6
- package/dist/esm/typography/Mark.js +22 -4
- package/dist/esm/typography/Text.js +31 -6
- package/dist/esm/typography/Title.js +20 -5
- package/dist/esm/utils/cloneElement.js +47 -0
- package/dist/esm/utils/getColor.js +2 -16
- package/dist/types/components/actionLabel/ActionLabel.d.ts +23 -4
- package/dist/types/components/animations/Animations.d.ts +84 -5
- package/dist/types/components/avatar/Avatar.d.ts +29 -5
- package/dist/types/components/avatar/AvatarGroup.d.ts +19 -1
- package/dist/types/components/badge/Badge.d.ts +30 -1
- package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +31 -2
- package/dist/types/components/button/Button.d.ts +29 -6
- package/dist/types/components/button/ButtonGroup.d.ts +28 -3
- package/dist/types/components/button/ConfirmButton.d.ts +28 -3
- package/dist/types/components/button/ToggleButtonGroup.d.ts +39 -11
- package/dist/types/components/callout/Callout.d.ts +29 -3
- package/dist/types/components/card/Card.d.ts +42 -4
- package/dist/types/components/card/CardCover.d.ts +25 -0
- package/dist/types/components/card/FlipContent.d.ts +28 -0
- package/dist/types/components/chip/Chip.d.ts +24 -4
- package/dist/types/components/collapsable/Collapsable.d.ts +33 -3
- package/dist/types/components/divider/Divider.d.ts +30 -7
- package/dist/types/components/dropdown/Dropdown.d.ts +40 -1
- package/dist/types/components/dropdown/DropdownTool.d.ts +27 -1
- package/dist/types/components/empty/EmptyContent.d.ts +32 -3
- package/dist/types/components/icon/Icon.d.ts +32 -6
- package/dist/types/components/index.d.ts +2 -1
- package/dist/types/components/media/Media.d.ts +56 -2
- package/dist/types/components/menu/ContextMenu.d.ts +21 -2
- package/dist/types/components/menu/Menu.d.ts +29 -0
- package/dist/types/components/menu/MenuItem.d.ts +22 -2
- package/dist/types/components/menu/types.d.ts +3 -2
- package/dist/types/components/meter/Meter.d.ts +24 -0
- package/dist/types/components/navigator/Navigator.d.ts +29 -4
- package/dist/types/components/panel/Panel.d.ts +37 -1
- package/dist/types/components/panel/PanelGroup.d.ts +24 -0
- package/dist/types/components/panel/PanelStack.d.ts +31 -0
- package/dist/types/components/progress/ProgressBar.d.ts +23 -3
- package/dist/types/components/progress/ProgressCircle.d.ts +22 -3
- package/dist/types/components/tabpanel/Tab.d.ts +36 -5
- package/dist/types/components/tabpanel/TabPanel.d.ts +43 -1
- package/dist/types/context/Global.d.ts +24 -1
- package/dist/types/core/aside/Aside.d.ts +38 -1
- package/dist/types/core/boundary/ErrorBoundary.d.ts +18 -2
- package/dist/types/core/content/Content.d.ts +9 -3
- package/dist/types/core/headfoot/HeadFoot.d.ts +41 -9
- package/dist/types/core/page/Page.d.ts +29 -4
- package/dist/types/core/responsive/Responsive.d.ts +58 -3
- package/dist/types/core/section/Section.d.ts +16 -1
- package/dist/types/core/theme/ThemeProvider.d.ts +25 -5
- package/dist/types/core/viewport/Viewport.d.ts +15 -1
- package/dist/types/hooks/useControlledValue.d.ts +13 -2
- package/dist/types/hooks/useDebounce.d.ts +12 -0
- package/dist/types/hooks/useEffectDebugger.d.ts +49 -0
- package/dist/types/hooks/useIsDark.d.ts +8 -0
- package/dist/types/hooks/useIsRtl.d.ts +12 -0
- package/dist/types/hooks/useNavigator.d.ts +18 -1
- package/dist/types/hooks/useOverlayService.d.ts +28 -9
- package/dist/types/hooks/usePropToggle.d.ts +16 -5
- package/dist/types/hooks/useResize.d.ts +19 -1
- package/dist/types/hooks/useResizeObserver.d.ts +20 -1
- package/dist/types/hooks/useStorage.d.ts +38 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/overlays/alert/Alert.d.ts +2 -3
- package/dist/types/overlays/flyout/Flyout.d.ts +3 -2
- package/dist/types/overlays/message/Message.d.ts +2 -3
- package/dist/types/overlays/modal/Modal.d.ts +12 -3
- package/dist/types/overlays/toast/Toast.d.ts +2 -3
- package/dist/types/overlays/tooltip/Tooltip.d.ts +2 -2
- package/dist/types/types/icons.d.ts +10 -1
- package/dist/types/types/index.d.ts +26 -6
- package/dist/types/typography/Abbr.d.ts +34 -4
- package/dist/types/typography/Anchor.d.ts +42 -0
- package/dist/types/typography/Copy.d.ts +15 -0
- package/dist/types/typography/Mark.d.ts +22 -4
- package/dist/types/typography/Text.d.ts +27 -1
- package/dist/types/typography/Title.d.ts +16 -1
- 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 +11 -13
- package/src/components/actionLabel/ActionLabel.tsx +38 -11
- package/src/components/animations/Animations.tsx +118 -33
- package/src/components/avatar/Avatar.tsx +106 -91
- package/src/components/avatar/AvatarGroup.tsx +23 -5
- package/src/components/badge/Badge.tsx +41 -9
- package/src/components/breadcrumbs/Breadcrumbs.tsx +42 -9
- package/src/components/button/Button.tsx +50 -23
- package/src/components/button/ButtonGroup.tsx +33 -7
- package/src/components/button/ConfirmButton.tsx +41 -7
- package/src/components/button/ToggleButtonGroup.tsx +74 -47
- package/src/components/callout/Callout.tsx +55 -12
- package/src/components/card/Card.tsx +64 -15
- package/src/components/card/CardCover.tsx +36 -6
- package/src/components/card/FlipContent.tsx +90 -0
- package/src/components/chip/Chip.tsx +39 -13
- package/src/components/collapsable/Collapsable.tsx +38 -7
- package/src/components/divider/Divider.tsx +42 -16
- package/src/components/dropdown/Dropdown.tsx +46 -11
- package/src/components/dropdown/DropdownTool.tsx +30 -3
- package/src/components/empty/EmptyContent.tsx +47 -6
- package/src/components/icon/Icon.tsx +85 -68
- package/src/components/index.ts +2 -1
- package/src/components/media/Media.tsx +195 -106
- package/src/components/menu/ContextMenu.tsx +55 -11
- package/src/components/menu/Menu.tsx +85 -30
- package/src/components/menu/MenuItem.tsx +40 -9
- package/src/components/menu/types.ts +3 -2
- package/src/components/meter/Meter.tsx +26 -3
- package/src/components/navigator/Navigator.tsx +58 -7
- package/src/components/panel/Panel.tsx +47 -9
- package/src/components/panel/PanelGroup.tsx +25 -2
- package/src/components/panel/PanelStack.tsx +31 -0
- package/src/components/progress/ProgressBar.tsx +33 -14
- package/src/components/progress/ProgressCircle.tsx +29 -13
- package/src/components/tabpanel/Tab.tsx +112 -64
- package/src/components/tabpanel/TabPanel.tsx +67 -12
- package/src/context/Global.tsx +28 -1
- package/src/context/NotificationCenter.tsx +3 -3
- package/src/core/aside/Aside.tsx +50 -12
- package/src/core/boundary/ErrorBoundary.tsx +25 -8
- package/src/core/boundary/ErrorIcon.tsx +1 -2
- package/src/core/content/Content.tsx +23 -13
- package/src/core/headfoot/HeadFoot.tsx +42 -35
- package/src/core/page/Page.tsx +44 -6
- package/src/core/responsive/Responsive.tsx +66 -8
- package/src/core/section/Section.tsx +17 -3
- package/src/core/theme/ThemeProvider.tsx +35 -14
- package/src/core/viewport/Viewport.tsx +16 -3
- package/src/hooks/useControlledValue.tsx +12 -0
- package/src/hooks/useDebounce.ts +13 -1
- package/src/hooks/useEffectDebugger.ts +50 -2
- package/src/hooks/useIsDark.ts +8 -0
- package/src/hooks/useIsRtl.ts +12 -0
- package/src/hooks/useNavigator.tsx +28 -5
- package/src/hooks/useOverlayService.tsx +36 -6
- package/src/hooks/usePropToggle.ts +16 -5
- package/src/hooks/useResize.ts +19 -1
- package/src/hooks/useResizeObserver.ts +32 -9
- package/src/hooks/useStorage.ts +38 -0
- 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 +28 -32
- package/src/overlays/flyout/Flyout.tsx +71 -84
- package/src/overlays/message/Message.tsx +10 -7
- package/src/overlays/modal/Modal.tsx +37 -15
- package/src/overlays/toast/Toast.tsx +18 -27
- package/src/overlays/tooltip/Tooltip.tsx +43 -18
- package/src/types/icons.ts +18 -3
- package/src/types/index.ts +268 -27
- package/src/typography/Abbr.tsx +44 -11
- package/src/typography/{Link.tsx → Anchor.tsx} +26 -14
- package/src/typography/Copy.tsx +15 -0
- package/src/typography/Mark.tsx +24 -10
- package/src/typography/Text.tsx +31 -13
- package/src/typography/Title.tsx +18 -7
- package/src/typography/index.ts +1 -1
- package/src/{overlays/tooltip/Tooltip.module.css → utils/cloneElement.ts} +21 -27
- 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
|
@@ -30,12 +30,13 @@ import {
|
|
|
30
30
|
useInteractions,
|
|
31
31
|
useRole,
|
|
32
32
|
} from "@floating-ui/react";
|
|
33
|
+
import { isString } from "@react-fabric/utilities";
|
|
33
34
|
import classNames from "classnames";
|
|
34
35
|
import {
|
|
35
|
-
|
|
36
|
+
isValidElement,
|
|
36
37
|
useCallback,
|
|
37
38
|
useEffect,
|
|
38
|
-
type
|
|
39
|
+
type ElementType,
|
|
39
40
|
} from "react";
|
|
40
41
|
import { Loading } from "../../components/animations/Animations";
|
|
41
42
|
import { Icon } from "../../components/icon/Icon";
|
|
@@ -50,13 +51,13 @@ import {
|
|
|
50
51
|
type TestProps,
|
|
51
52
|
} from "../../types";
|
|
52
53
|
import { CoreIcons } from "../../types/icons";
|
|
53
|
-
import classes from "./Flyout.module.css";
|
|
54
54
|
|
|
55
55
|
export interface FlyoutProps
|
|
56
56
|
extends AriaProps,
|
|
57
57
|
TestProps,
|
|
58
|
-
IconProps,
|
|
58
|
+
Omit<IconProps, "icon">,
|
|
59
59
|
ChildrenProp {
|
|
60
|
+
icon?: string | ElementType<IconProps>;
|
|
60
61
|
/**
|
|
61
62
|
* flyout alignment
|
|
62
63
|
*/
|
|
@@ -140,6 +141,7 @@ export const Flyout = ({
|
|
|
140
141
|
});
|
|
141
142
|
const dismiss = useDismiss(context, {
|
|
142
143
|
outsidePressEvent: "mousedown",
|
|
144
|
+
outsidePress: !hideMask,
|
|
143
145
|
escapeKey: true,
|
|
144
146
|
});
|
|
145
147
|
const role = useRole(context);
|
|
@@ -173,9 +175,6 @@ export const Flyout = ({
|
|
|
173
175
|
useEffect(() => {
|
|
174
176
|
setTimeout(() => {
|
|
175
177
|
refs.floating.current && (refs.floating.current.dataset.show = "true");
|
|
176
|
-
refs.floating.current
|
|
177
|
-
?.querySelector<HTMLElement>('[role="dialog"]')
|
|
178
|
-
?.focus();
|
|
179
178
|
}, 50);
|
|
180
179
|
}, []);
|
|
181
180
|
|
|
@@ -193,91 +192,79 @@ export const Flyout = ({
|
|
|
193
192
|
[closeOnClick, handleClose],
|
|
194
193
|
);
|
|
195
194
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return (
|
|
195
|
+
return (
|
|
196
|
+
<FloatingPortal>
|
|
197
|
+
{!hideMask && (
|
|
201
198
|
<FloatingOverlay
|
|
202
199
|
lockScroll
|
|
203
|
-
style={{ zIndex: "var(--z-overlay-mask)" }}
|
|
204
|
-
className="bg-
|
|
200
|
+
style={{ zIndex: "var(--z-overlay-mask)", overflow: "hidden" }}
|
|
201
|
+
className="bg-tint-100/10 backdrop-blur-sm transition-all"
|
|
202
|
+
/>
|
|
203
|
+
)}
|
|
204
|
+
<FloatingFocusManager context={context}>
|
|
205
|
+
<div
|
|
206
|
+
data-align={align}
|
|
207
|
+
className={classNames(
|
|
208
|
+
"fabric-flyout",
|
|
209
|
+
"fixed inset-y-0 overflow-hidden flex flex-col flex-nowrap pointer-events-auto shadow-xl",
|
|
210
|
+
align === "start" ? "start-0" : "end-0",
|
|
211
|
+
size === "sm" && "w-[20rem]",
|
|
212
|
+
size === "md" && "w-[40rem]",
|
|
213
|
+
size === "lg" && "w-[60vw]",
|
|
214
|
+
size === "xl" && "w-[80vw]",
|
|
215
|
+
)}
|
|
216
|
+
style={{
|
|
217
|
+
width,
|
|
218
|
+
minWidth,
|
|
219
|
+
}}
|
|
220
|
+
onMouseUpCapture={tryClosing}
|
|
221
|
+
ref={refs.setFloating}
|
|
222
|
+
{...getFloatingProps()}
|
|
223
|
+
{...aria}
|
|
224
|
+
{...aria}
|
|
205
225
|
>
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
226
|
+
<HotKeyWrapper>
|
|
227
|
+
<Header
|
|
228
|
+
flex
|
|
229
|
+
align="center"
|
|
230
|
+
className={classNames("fabric-flyoutHeader", headerClassName)}
|
|
231
|
+
>
|
|
232
|
+
{isString(icon) && (
|
|
233
|
+
<Icon
|
|
234
|
+
icon={icon}
|
|
235
|
+
bg={iconBg}
|
|
236
|
+
color={iconColor}
|
|
237
|
+
className={classNames(iconClassName, "p-1")}
|
|
238
|
+
rtlFlip={rtlFlip}
|
|
239
|
+
/>
|
|
240
|
+
)}
|
|
241
|
+
{isValidElement(icon) && icon}
|
|
242
|
+
<label className="flex-1 truncate py-2 px-1">{title}</label>
|
|
243
|
+
{actions}
|
|
244
|
+
<Icon
|
|
245
|
+
data-ref="panelClose"
|
|
246
|
+
className={classNames(
|
|
247
|
+
"fabric-panelAction",
|
|
248
|
+
"cursor-pointer p-1 text-xl self-stretch",
|
|
249
|
+
)}
|
|
250
|
+
icon={CoreIcons.close}
|
|
251
|
+
onClick={() => handleClose(false)}
|
|
252
|
+
/>
|
|
253
|
+
</Header>
|
|
254
|
+
{loading && <Loading />}
|
|
218
255
|
<div
|
|
219
|
-
|
|
256
|
+
role="dialog"
|
|
220
257
|
className={classNames(
|
|
221
|
-
|
|
222
|
-
"
|
|
223
|
-
align === "start" ? "start-0" : "end-0",
|
|
224
|
-
size === "sm" && "w-[20rem]",
|
|
225
|
-
size === "md" && "w-[40rem]",
|
|
226
|
-
size === "lg" && "w-[60vw]",
|
|
227
|
-
size === "xl" && "w-[80vw]",
|
|
258
|
+
"fabric-flyoutBody",
|
|
259
|
+
"flex-1 grid overflow-hidden",
|
|
228
260
|
)}
|
|
229
|
-
|
|
230
|
-
width,
|
|
231
|
-
minWidth,
|
|
232
|
-
}}
|
|
233
|
-
onMouseUpCapture={tryClosing}
|
|
234
|
-
ref={refs.setFloating}
|
|
235
|
-
{...getFloatingProps()}
|
|
236
|
-
{...aria}
|
|
237
|
-
{...aria}
|
|
261
|
+
{...({ tabIndex: 0 } as AnyObject)}
|
|
238
262
|
>
|
|
239
|
-
|
|
240
|
-
<Header
|
|
241
|
-
flex
|
|
242
|
-
className={classNames(classes.flyoutHeader, headerClassName)}
|
|
243
|
-
>
|
|
244
|
-
{icon && (
|
|
245
|
-
<Icon
|
|
246
|
-
icon={icon}
|
|
247
|
-
bg={iconBg}
|
|
248
|
-
color={iconColor}
|
|
249
|
-
className={classNames(iconClassName, "p-1")}
|
|
250
|
-
rtlFlip={rtlFlip}
|
|
251
|
-
/>
|
|
252
|
-
)}
|
|
253
|
-
<label className="flex-1 truncate py-2 px-1">{title}</label>
|
|
254
|
-
{actions}
|
|
255
|
-
<Icon
|
|
256
|
-
data-ref="panelClose"
|
|
257
|
-
className={classNames(
|
|
258
|
-
classes.panelAction,
|
|
259
|
-
"cursor-pointer p-1 text-xl self-stretch",
|
|
260
|
-
)}
|
|
261
|
-
icon={CoreIcons.close}
|
|
262
|
-
onClick={() => handleClose(false)}
|
|
263
|
-
/>
|
|
264
|
-
</Header>
|
|
265
|
-
{loading && <Loading />}
|
|
266
|
-
<div
|
|
267
|
-
role="dialog"
|
|
268
|
-
className={classNames(
|
|
269
|
-
classes.flyoutBody,
|
|
270
|
-
"flex-1 grid overflow-hidden",
|
|
271
|
-
)}
|
|
272
|
-
{...({ tabIndex: 0 } as AnyObject)}
|
|
273
|
-
>
|
|
274
|
-
{children}
|
|
275
|
-
</div>
|
|
276
|
-
</HotKeyWrapper>
|
|
263
|
+
{children}
|
|
277
264
|
</div>
|
|
278
|
-
</
|
|
279
|
-
</
|
|
280
|
-
</
|
|
265
|
+
</HotKeyWrapper>
|
|
266
|
+
</div>
|
|
267
|
+
</FloatingFocusManager>
|
|
281
268
|
</FloatingPortal>
|
|
282
269
|
);
|
|
283
270
|
};
|
|
@@ -24,9 +24,8 @@
|
|
|
24
24
|
import classNames from "classnames";
|
|
25
25
|
import { useCallback, useLayoutEffect, useRef } from "react";
|
|
26
26
|
import { Icon } from "../../components/icon/Icon";
|
|
27
|
-
import { type
|
|
28
|
-
import {
|
|
29
|
-
import classes from "./Message.module.css";
|
|
27
|
+
import { type ColorState, type Elements, type IconProps } from "../../types";
|
|
28
|
+
import { getColor } from "../../utils";
|
|
30
29
|
|
|
31
30
|
export interface MessageProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
32
31
|
/**
|
|
@@ -40,7 +39,7 @@ export interface MessageProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
|
40
39
|
/**
|
|
41
40
|
* theme color
|
|
42
41
|
*/
|
|
43
|
-
color?:
|
|
42
|
+
color?: ColorState;
|
|
44
43
|
/**
|
|
45
44
|
* extra action button
|
|
46
45
|
*/
|
|
@@ -77,11 +76,15 @@ export const Message = ({
|
|
|
77
76
|
return (
|
|
78
77
|
<div
|
|
79
78
|
className={classNames(
|
|
80
|
-
|
|
81
|
-
color ? getBgClass(color + "-300") : "bg-invert",
|
|
82
|
-
color ? getColorClass(color + "-900") : "text-invert",
|
|
79
|
+
"fabric-message",
|
|
83
80
|
"flex flex-nowrap gap-1 px-8 relative justify-center max-w-md pointer-events-auto rounded mb-2 select-none",
|
|
84
81
|
)}
|
|
82
|
+
style={{
|
|
83
|
+
backgroundColor: color
|
|
84
|
+
? getColor(color + "-300")
|
|
85
|
+
: "var(--bg-color-invert)",
|
|
86
|
+
color: color ? getColor(color + "-900") : "var(--text-color-invert)",
|
|
87
|
+
}}
|
|
85
88
|
ref={elRef}
|
|
86
89
|
>
|
|
87
90
|
{icon && <Icon icon={icon} size="md" rtlFlip={rtlFlip} />}
|
|
@@ -30,8 +30,14 @@ import {
|
|
|
30
30
|
useInteractions,
|
|
31
31
|
useRole,
|
|
32
32
|
} from "@floating-ui/react";
|
|
33
|
+
import { isString } from "@react-fabric/utilities";
|
|
33
34
|
import classNames from "classnames";
|
|
34
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
type ElementType,
|
|
37
|
+
isValidElement,
|
|
38
|
+
useCallback,
|
|
39
|
+
useEffect,
|
|
40
|
+
} from "react";
|
|
35
41
|
import { Loading } from "../../components/animations/Animations";
|
|
36
42
|
import { Icon } from "../../components/icon/Icon";
|
|
37
43
|
import { Header } from "../../core/headfoot/HeadFoot";
|
|
@@ -45,13 +51,13 @@ import {
|
|
|
45
51
|
type TestProps,
|
|
46
52
|
} from "../../types";
|
|
47
53
|
import { CoreIcons } from "../../types/icons";
|
|
48
|
-
import classes from "./Modal.module.css";
|
|
49
54
|
|
|
50
55
|
export interface ModalProps
|
|
51
56
|
extends AriaProps,
|
|
52
57
|
TestProps,
|
|
53
|
-
IconProps,
|
|
58
|
+
Omit<IconProps, "icon">,
|
|
54
59
|
ChildrenProp {
|
|
60
|
+
icon?: string | ElementType<IconProps>;
|
|
55
61
|
/**
|
|
56
62
|
* header className
|
|
57
63
|
*/
|
|
@@ -92,6 +98,14 @@ export interface ModalProps
|
|
|
92
98
|
* minimum width
|
|
93
99
|
*/
|
|
94
100
|
minWidth?: string | number;
|
|
101
|
+
/**
|
|
102
|
+
* portal root element
|
|
103
|
+
*/
|
|
104
|
+
root?: HTMLElement;
|
|
105
|
+
/**
|
|
106
|
+
* hide mask background
|
|
107
|
+
*/
|
|
108
|
+
noMask?: boolean;
|
|
95
109
|
/**
|
|
96
110
|
* close handler
|
|
97
111
|
*/
|
|
@@ -115,7 +129,9 @@ export const Modal = ({
|
|
|
115
129
|
onBeforeClose,
|
|
116
130
|
children,
|
|
117
131
|
loading,
|
|
132
|
+
root,
|
|
118
133
|
size,
|
|
134
|
+
noMask,
|
|
119
135
|
width,
|
|
120
136
|
height,
|
|
121
137
|
minHeight,
|
|
@@ -163,25 +179,29 @@ export const Modal = ({
|
|
|
163
179
|
useEffect(() => {
|
|
164
180
|
setTimeout(() => {
|
|
165
181
|
refs.floating.current && (refs.floating.current.dataset.show = "true");
|
|
166
|
-
refs.floating.current
|
|
167
|
-
?.querySelector<HTMLElement>("[role='dialog']")
|
|
168
|
-
?.focus();
|
|
169
182
|
}, 50);
|
|
170
183
|
}, []);
|
|
171
184
|
|
|
172
185
|
return (
|
|
173
|
-
<FloatingPortal>
|
|
186
|
+
<FloatingPortal root={root}>
|
|
174
187
|
<FloatingOverlay
|
|
175
188
|
lockScroll
|
|
176
|
-
style={{
|
|
177
|
-
|
|
189
|
+
style={{
|
|
190
|
+
zIndex: "var(--z-overlay-mask)",
|
|
191
|
+
position: "absolute",
|
|
192
|
+
overflow: "hidden",
|
|
193
|
+
}}
|
|
194
|
+
className={classNames(
|
|
195
|
+
"grid place-items-center p-16",
|
|
196
|
+
!noMask && "bg-tint-100/20 backdrop-blur-sm",
|
|
197
|
+
)}
|
|
178
198
|
>
|
|
179
199
|
<FloatingFocusManager context={context}>
|
|
180
200
|
<dialog
|
|
181
201
|
className={classNames(
|
|
182
|
-
|
|
202
|
+
"fabric-modal",
|
|
183
203
|
"rounded-capped relative overflow-hidden flex flex-col flex-nowrap",
|
|
184
|
-
"ring-
|
|
204
|
+
"ring-2 ring-offset-2 ring-tint-100 focus-within:ring-primary-300 shadow-xl",
|
|
185
205
|
size === "sm" && "w-[20rem]",
|
|
186
206
|
size === "md" && "w-[40rem]",
|
|
187
207
|
size === "lg" && "w-[60vw]",
|
|
@@ -201,9 +221,10 @@ export const Modal = ({
|
|
|
201
221
|
<HotKeyWrapper>
|
|
202
222
|
<Header
|
|
203
223
|
flex
|
|
204
|
-
|
|
224
|
+
align="center"
|
|
225
|
+
className={classNames("fabric-modalHeader", headerClassName)}
|
|
205
226
|
>
|
|
206
|
-
{icon && (
|
|
227
|
+
{isString(icon) && (
|
|
207
228
|
<Icon
|
|
208
229
|
icon={icon}
|
|
209
230
|
bg={iconBg}
|
|
@@ -212,12 +233,13 @@ export const Modal = ({
|
|
|
212
233
|
rtlFlip={rtlFlip}
|
|
213
234
|
/>
|
|
214
235
|
)}
|
|
236
|
+
{isValidElement(icon) && icon}
|
|
215
237
|
<label className="flex-1 truncate py-2 px-1">{title}</label>
|
|
216
238
|
{actions}
|
|
217
239
|
<Icon
|
|
218
240
|
data-ref="panelClose"
|
|
219
241
|
className={classNames(
|
|
220
|
-
|
|
242
|
+
"fabric-panelAction",
|
|
221
243
|
"cursor-pointer p-1 text-xl self-stretch",
|
|
222
244
|
)}
|
|
223
245
|
icon={CoreIcons.close}
|
|
@@ -228,7 +250,7 @@ export const Modal = ({
|
|
|
228
250
|
<div
|
|
229
251
|
role="dialog"
|
|
230
252
|
className={classNames(
|
|
231
|
-
|
|
253
|
+
"fabric-modalBody",
|
|
232
254
|
"flex-1 grid overflow-hidden",
|
|
233
255
|
)}
|
|
234
256
|
{...({ tabIndex: 0 } as AnyObject)}
|
|
@@ -27,10 +27,9 @@ import { useTranslation } from "react-i18next";
|
|
|
27
27
|
import { AnimationIndicator } from "../../components/animations/Animations";
|
|
28
28
|
import { Button } from "../../components/button/Button";
|
|
29
29
|
import { Icon } from "../../components/icon/Icon";
|
|
30
|
-
import { type
|
|
30
|
+
import { type ColorState, type Elements, type IconProps } from "../../types";
|
|
31
31
|
import { CoreIcons } from "../../types/icons";
|
|
32
|
-
import {
|
|
33
|
-
import classes from "./Toast.module.css";
|
|
32
|
+
import { getColor } from "../../utils";
|
|
34
33
|
|
|
35
34
|
export interface ToastProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
36
35
|
/**
|
|
@@ -48,7 +47,7 @@ export interface ToastProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
|
48
47
|
/**
|
|
49
48
|
* theme color
|
|
50
49
|
*/
|
|
51
|
-
color?:
|
|
50
|
+
color?: ColorState;
|
|
52
51
|
/**
|
|
53
52
|
* extra action button
|
|
54
53
|
*/
|
|
@@ -87,31 +86,16 @@ export const Toast = ({
|
|
|
87
86
|
);
|
|
88
87
|
switch (color) {
|
|
89
88
|
case "danger":
|
|
90
|
-
return
|
|
91
|
-
<AnimationIndicator
|
|
92
|
-
type="cross"
|
|
93
|
-
className={getColorClass(color + "-600")}
|
|
94
|
-
/>
|
|
95
|
-
);
|
|
89
|
+
return <AnimationIndicator type="cross" color={"danger-600"} />;
|
|
96
90
|
case "success":
|
|
97
|
-
return
|
|
98
|
-
<AnimationIndicator
|
|
99
|
-
type="check"
|
|
100
|
-
className={getColorClass(color + "-600")}
|
|
101
|
-
/>
|
|
102
|
-
);
|
|
91
|
+
return <AnimationIndicator type="check" color={"success-600"} />;
|
|
103
92
|
case "warning":
|
|
104
|
-
return
|
|
105
|
-
<AnimationIndicator
|
|
106
|
-
type="exclaim"
|
|
107
|
-
className={getColorClass(color + "-600")}
|
|
108
|
-
/>
|
|
109
|
-
);
|
|
93
|
+
return <AnimationIndicator type="exclaim" color={"warning-600"} />;
|
|
110
94
|
default:
|
|
111
95
|
return (
|
|
112
96
|
<AnimationIndicator
|
|
113
97
|
type={type === "confirm" ? "question" : "info"}
|
|
114
|
-
|
|
98
|
+
color={`${color}-600`}
|
|
115
99
|
/>
|
|
116
100
|
);
|
|
117
101
|
}
|
|
@@ -138,22 +122,29 @@ export const Toast = ({
|
|
|
138
122
|
<div
|
|
139
123
|
role="alert"
|
|
140
124
|
className={classNames(
|
|
141
|
-
|
|
142
|
-
getBorderClass(color + "-300"),
|
|
125
|
+
"fabric-toast",
|
|
143
126
|
"flex flex-nowrap max-w-sm bg-base min-w-72 border pointer-events-auto relative overflow-hidden rounded-capped mt-4 select-none",
|
|
144
127
|
)}
|
|
128
|
+
style={{
|
|
129
|
+
borderColor: getColor(color + "-300"),
|
|
130
|
+
}}
|
|
145
131
|
ref={elRef}
|
|
146
132
|
>
|
|
147
133
|
<div
|
|
148
|
-
className={classNames("flex-initial p-2"
|
|
134
|
+
className={classNames("flex-initial p-2")}
|
|
135
|
+
style={{
|
|
136
|
+
backgroundColor: getColor(color + "-300"),
|
|
137
|
+
}}
|
|
149
138
|
>
|
|
150
139
|
{iconType}
|
|
151
140
|
</div>
|
|
152
141
|
<div
|
|
153
142
|
className={classNames(
|
|
154
|
-
getBgClass(color + "-50/50"),
|
|
155
143
|
"flex flex-col flex-1 flex-nowrap overflow-hidden p-2",
|
|
156
144
|
)}
|
|
145
|
+
style={{
|
|
146
|
+
backgroundColor: getColor(color + "-50"),
|
|
147
|
+
}}
|
|
157
148
|
>
|
|
158
149
|
<div className="flex flex-nowrap gap-2 items-start">
|
|
159
150
|
<div className="font-medium flex-1">{title}</div>
|
|
@@ -45,13 +45,14 @@ import {
|
|
|
45
45
|
useMemo,
|
|
46
46
|
useRef,
|
|
47
47
|
useState,
|
|
48
|
+
type MouseEvent,
|
|
48
49
|
type ReactElement,
|
|
49
50
|
} from "react";
|
|
50
51
|
import { Icon } from "../../components/icon/Icon";
|
|
51
52
|
import { useIsRtl } from "../../hooks/useIsRtl";
|
|
52
53
|
import { type RefProp, type TooltipType } from "../../types";
|
|
53
54
|
import { CoreIcons } from "../../types/icons";
|
|
54
|
-
import
|
|
55
|
+
import { getColor } from "../../utils";
|
|
55
56
|
|
|
56
57
|
export interface TooltipProps extends TooltipType, RefProp {
|
|
57
58
|
/**
|
|
@@ -63,7 +64,7 @@ export interface TooltipProps extends TooltipType, RefProp {
|
|
|
63
64
|
*/
|
|
64
65
|
copyContent?: boolean | string;
|
|
65
66
|
disabled?: boolean;
|
|
66
|
-
children: ReactElement
|
|
67
|
+
children: ReactElement<KeyValue>;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
export const getTooltipProps = (
|
|
@@ -82,6 +83,7 @@ export const Tooltip = ({
|
|
|
82
83
|
ref,
|
|
83
84
|
children,
|
|
84
85
|
color,
|
|
86
|
+
textColor,
|
|
85
87
|
content,
|
|
86
88
|
open,
|
|
87
89
|
copyContent,
|
|
@@ -125,7 +127,7 @@ export const Tooltip = ({
|
|
|
125
127
|
});
|
|
126
128
|
|
|
127
129
|
const hover = useHover(context, {
|
|
128
|
-
restMs:
|
|
130
|
+
restMs: 500,
|
|
129
131
|
delay: { open: 1000 },
|
|
130
132
|
handleClose: copyContent ? safePolygon({ buffer: 1 }) : undefined,
|
|
131
133
|
});
|
|
@@ -146,14 +148,15 @@ export const Tooltip = ({
|
|
|
146
148
|
const copyEl = useMemo(() => {
|
|
147
149
|
if (copyContent) {
|
|
148
150
|
const copyText: AnyObject = isString(copyContent) ? copyContent : content;
|
|
149
|
-
const handler = () => {
|
|
151
|
+
const handler = (e: MouseEvent) => {
|
|
150
152
|
setIsOpen(false);
|
|
153
|
+
e.stopPropagation();
|
|
151
154
|
void navigator.clipboard.writeText(copyText.toString());
|
|
152
155
|
};
|
|
153
156
|
return (
|
|
154
157
|
<span
|
|
155
158
|
role="none"
|
|
156
|
-
className="ms-2 cursor-pointer text-
|
|
159
|
+
className="ms-2 cursor-pointer text-dimmed flex-content opacity-75 hover:opacity-90 active:opacity-60"
|
|
157
160
|
onClick={handler}
|
|
158
161
|
>
|
|
159
162
|
<Icon icon={CoreIcons.copy} />
|
|
@@ -173,25 +176,47 @@ export const Tooltip = ({
|
|
|
173
176
|
<FloatingPortal>
|
|
174
177
|
<dfn
|
|
175
178
|
data-ref="tooltip"
|
|
176
|
-
data-color={color}
|
|
177
179
|
className={classNames(
|
|
178
|
-
|
|
179
|
-
"select-none text-sm not-italic flex py-1 px-2 rounded shadow-md bg-
|
|
180
|
+
"fabric-tooltip z-(--z-tooltip)",
|
|
181
|
+
"select-none text-sm not-italic flex py-1 px-2 !max-w-lg rounded shadow-md bg-muted",
|
|
180
182
|
)}
|
|
181
183
|
ref={refs.setFloating}
|
|
182
|
-
style={
|
|
184
|
+
style={{
|
|
185
|
+
color: textColor ? getColor(textColor) : undefined,
|
|
186
|
+
backgroundColor: color ? getColor(color) : undefined,
|
|
187
|
+
...floatingStyles,
|
|
188
|
+
}}
|
|
183
189
|
{...getFloatingProps()}
|
|
184
190
|
>
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
{isValidElement(content) && content}
|
|
192
|
+
{isString(content) && (
|
|
193
|
+
<span
|
|
194
|
+
className={classNames(
|
|
195
|
+
"font-medium flex-1 break-all whitespace-pre-wrap mixed-lang",
|
|
196
|
+
!textColor && "contrast",
|
|
197
|
+
)}
|
|
198
|
+
style={{
|
|
199
|
+
color: textColor
|
|
200
|
+
? undefined
|
|
201
|
+
: color
|
|
202
|
+
? getColor(color)
|
|
203
|
+
: "var(--bg-color-muted)",
|
|
204
|
+
}}
|
|
205
|
+
>
|
|
206
|
+
{content}
|
|
207
|
+
</span>
|
|
208
|
+
)}
|
|
193
209
|
{copyEl}
|
|
194
|
-
<FloatingArrow
|
|
210
|
+
<FloatingArrow
|
|
211
|
+
ref={arrowRef}
|
|
212
|
+
context={context}
|
|
213
|
+
strokeWidth={0.5}
|
|
214
|
+
className="fill-muted stroke-dimmed"
|
|
215
|
+
style={{
|
|
216
|
+
stroke: color ? getColor(color) : undefined,
|
|
217
|
+
fill: color ? getColor(color) : undefined,
|
|
218
|
+
}}
|
|
219
|
+
/>
|
|
195
220
|
</dfn>
|
|
196
221
|
</FloatingPortal>
|
|
197
222
|
)}
|
package/src/types/icons.ts
CHANGED
|
@@ -24,7 +24,11 @@
|
|
|
24
24
|
/* istanbul ignore file */
|
|
25
25
|
/* eslint-disable @typescript-eslint/no-namespace */
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Core icons used in the application.
|
|
29
|
+
* These icons are typically used for navigation, actions, and other UI elements.
|
|
30
|
+
*/
|
|
31
|
+
export namespace CoreIcons {
|
|
28
32
|
/**
|
|
29
33
|
* carets
|
|
30
34
|
*/
|
|
@@ -100,6 +104,11 @@ export module CoreIcons {
|
|
|
100
104
|
export const colapseAll =
|
|
101
105
|
"M18.707 21.293l-6-6c-0.391-0.391-1.024-0.391-1.414 0l-6 6c-0.391 0.391-0.391 1.024 0 1.414s1.024 0.391 1.414 0l5.293-5.293 5.293 5.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414zM5.293 2.707l6 6c0.391 0.391 1.024 0.391 1.414 0l6-6c0.391-0.391 0.391-1.024 0-1.414s-1.024-0.391-1.414 0l-5.293 5.293-5.293-5.293c-0.391-0.391-1.024-0.391-1.414 0s-0.391 1.024 0 1.414z";
|
|
102
106
|
|
|
107
|
+
export const expandAllVar =
|
|
108
|
+
"M13,9V15H16L12,19L8,15H11V9H8L12,5L16,9H13M4,2H20V4H4V2M4,20H20V22H4V20Z";
|
|
109
|
+
export const colapseAllVar =
|
|
110
|
+
"M4,12H20V14H4V12M4,9H20V11H4V9M16,4L12,8L8,4H11V1H13V4H16M8,19L12,15L16,19H13V22H11V19H8Z";
|
|
111
|
+
|
|
103
112
|
export const folderClosed =
|
|
104
113
|
"M20,18H4V8H20M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z";
|
|
105
114
|
export const folderOpen =
|
|
@@ -119,11 +128,13 @@ export module CoreIcons {
|
|
|
119
128
|
"M19.547 14.667c-0.736 2.083-2.245 3.67-4.094 4.553s-4.031 1.061-6.114 0.325-3.67-2.245-4.553-4.094-1.061-4.031-0.325-6.114 2.245-3.67 4.094-4.553 4.031-1.061 6.114-0.325c1.188 0.42 2.209 1.088 2.987 1.882l2.824 2.659h-3.48c-0.552 0-1 0.448-1 1s0.448 1 1 1h5.997c0.004 0 0.009 0 0.013 0 0.137-0.001 0.267-0.030 0.386-0.082 0.119-0.051 0.229-0.126 0.324-0.225 0.012-0.012 0.023-0.025 0.034-0.038 0.076-0.087 0.134-0.184 0.175-0.287s0.065-0.213 0.069-0.328c0.002-0.014 0.002-0.028 0.002-0.042v-5.998c0-0.552-0.448-1-1-1s-1 0.448-1 1v3.685l-2.916-2.745c-0.993-1.012-2.274-1.846-3.748-2.366-2.604-0.921-5.336-0.698-7.644 0.405s-4.197 3.088-5.117 5.692-0.696 5.335 0.406 7.643 3.088 4.197 5.692 5.117 5.335 0.697 7.643-0.406 4.197-3.088 5.117-5.692c0.184-0.521-0.089-1.092-0.61-1.276s-1.092 0.089-1.276 0.61z";
|
|
120
129
|
export const search =
|
|
121
130
|
"M16.041 15.856c-0.034 0.026-0.067 0.055-0.099 0.087s-0.060 0.064-0.087 0.099c-1.258 1.213-2.969 1.958-4.855 1.958-1.933 0-3.682-0.782-4.95-2.050s-2.050-3.017-2.050-4.95 0.782-3.682 2.050-4.95 3.017-2.050 4.95-2.050 3.682 0.782 4.95 2.050 2.050 3.017 2.050 4.95c0 1.886-0.745 3.597-1.959 4.856zM21.707 20.293l-3.675-3.675c1.231-1.54 1.968-3.493 1.968-5.618 0-2.485-1.008-4.736-2.636-6.364s-3.879-2.636-6.364-2.636-4.736 1.008-6.364 2.636-2.636 3.879-2.636 6.364 1.008 4.736 2.636 6.364 3.879 2.636 6.364 2.636c2.125 0 4.078-0.737 5.618-1.968l3.675 3.675c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414z";
|
|
131
|
+
export const ellipsis =
|
|
132
|
+
"M14 12c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414zM14 5c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414zM14 19c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586-1.053 0.225-1.414 0.586-0.586 0.862-0.586 1.414 0.225 1.053 0.586 1.414 0.862 0.586 1.414 0.586 1.053-0.225 1.414-0.586 0.586-0.862 0.586-1.414z";
|
|
122
133
|
export const filter = "M6,13H18V11H6M3,6V8H21V6M10,18H14V16H10V18Z";
|
|
123
134
|
export const funnel =
|
|
124
135
|
"M19.845 4l-6.609 7.814c-0.147 0.173-0.236 0.399-0.236 0.646v6.922l-2-1v-5.922c0.001-0.227-0.077-0.457-0.236-0.646l-6.609-7.814zM22 2h-20c-0.552 0-1 0.448-1 1 0 0.247 0.089 0.473 0.236 0.646l7.764 9.18v6.174c0 0.389 0.222 0.727 0.553 0.894l4 2c0.494 0.247 1.095 0.047 1.342-0.447 0.072-0.146 0.106-0.301 0.105-0.447v-8.174l7.764-9.18c0.357-0.422 0.304-1.053-0.118-1.409-0.189-0.16-0.419-0.238-0.646-0.237z";
|
|
125
|
-
export const
|
|
126
|
-
"M14
|
|
136
|
+
export const funnelFull =
|
|
137
|
+
"M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z";
|
|
127
138
|
export const funnelPlus =
|
|
128
139
|
"M15 17H18V14H20V17H23V19H20V22H18V19H15V17M13 19.88C13.04 20.18 12.94 20.5 12.72 20.71C12.32 21.1 11.69 21.1 11.3 20.71L7.29 16.7C7.06 16.47 6.96 16.16 7 15.87V10.75L2.21 4.62C1.87 4.19 1.95 3.56 2.38 3.22C2.57 3.08 2.78 3 3 3V3H17V3C17.22 3 17.43 3.08 17.62 3.22C18.05 3.56 18.13 4.19 17.79 4.62L13 10.75V19.88M5.04 5L9 10.07V15.58L11 17.58V10.05L14.96 5H5.04Z";
|
|
129
140
|
export const funnelRemove =
|
|
@@ -249,6 +260,7 @@ export module CoreIcons {
|
|
|
249
260
|
"M5.541 2.159c-0.153-0.1-0.34-0.159-0.541-0.159-0.552 0-1 0.448-1 1v18c-0.001 0.182 0.050 0.372 0.159 0.541 0.299 0.465 0.917 0.599 1.382 0.3l14-9c0.114-0.072 0.219-0.174 0.3-0.3 0.299-0.465 0.164-1.083-0.3-1.382zM6 4.832l11.151 7.168-11.151 7.168z";
|
|
250
261
|
export const pause =
|
|
251
262
|
"M6 3c-0.552 0-1 0.448-1 1v16c0 0.552 0.448 1 1 1h4c0.552 0 1-0.448 1-1v-16c0-0.552-0.448-1-1-1zM7 5h2v14h-2zM14 3c-0.552 0-1 0.448-1 1v16c0 0.552 0.448 1 1 1h4c0.552 0 1-0.448 1-1v-16c0-0.552-0.448-1-1-1zM15 5h2v14h-2z";
|
|
263
|
+
export const stop = "M18,18H6V6H18V18Z";
|
|
252
264
|
export const volumeOn =
|
|
253
265
|
"M10 7.081v9.839l-3.375-2.7c-0.17-0.137-0.388-0.22-0.625-0.22h-3v-4h3c0.218 0.001 0.439-0.071 0.625-0.219zM10.375 4.219l-4.726 3.781h-3.649c-0.552 0-1 0.448-1 1v6c0 0.552 0.448 1 1 1h3.649l4.726 3.781c0.431 0.345 1.061 0.275 1.406-0.156 0.148-0.185 0.22-0.407 0.219-0.625v-14c0-0.552-0.448-1-1-1-0.237 0-0.455 0.083-0.625 0.219zM18.363 5.637c1.757 1.758 2.635 4.059 2.635 6.364 0 2.304-0.878 4.605-2.635 6.362-0.39 0.391-0.39 1.024 0 1.414s1.024 0.39 1.414 0c2.147-2.147 3.22-4.963 3.221-7.776s-1.074-5.63-3.221-7.778c-0.39-0.391-1.024-0.391-1.414 0s-0.391 1.024 0 1.414zM14.833 9.167c0.781 0.781 1.171 1.803 1.171 2.828s-0.39 2.047-1.171 2.828c-0.39 0.391-0.39 1.024 0 1.414s1.024 0.39 1.414 0c1.171-1.171 1.757-2.708 1.757-4.242s-0.586-3.071-1.757-4.242c-0.39-0.391-1.024-0.391-1.414 0s-0.391 1.024 0 1.414z";
|
|
254
266
|
export const volumeOff =
|
|
@@ -348,6 +360,9 @@ export module CoreIcons {
|
|
|
348
360
|
export const colorPicker =
|
|
349
361
|
"M19.35,11.72L17.22,13.85L15.81,12.43L8.1,20.14L3.5,22L2,20.5L3.86,15.9L11.57,8.19L10.15,6.78L12.28,4.65L19.35,11.72M16.76,3C17.93,1.83 19.83,1.83 21,3C22.17,4.17 22.17,6.07 21,7.24L19.08,9.16L14.84,4.92L16.76,3M5.56,17.03L4.5,19.5L6.97,18.44L14.4,11L13,9.6L5.56,17.03Z";
|
|
350
362
|
|
|
363
|
+
export const list =
|
|
364
|
+
"M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z";
|
|
365
|
+
|
|
351
366
|
/**
|
|
352
367
|
* alert icons
|
|
353
368
|
*/
|