@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
|
@@ -2,17 +2,55 @@
|
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
|
+
var utilities = require('@react-fabric/utilities');
|
|
5
6
|
var classNames = require('classnames');
|
|
6
7
|
var react = require('react');
|
|
8
|
+
require('@babel/runtime/helpers/slicedToArray');
|
|
9
|
+
require('@floating-ui/react');
|
|
10
|
+
require('react-i18next');
|
|
11
|
+
require('../../hooks/useEffectDebugger.js');
|
|
12
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
13
|
+
require('../../hotkeys/HotKeyWrapper.js');
|
|
14
|
+
var Tooltip = require('../../overlays/tooltip/Tooltip.js');
|
|
7
15
|
var Badge = require('../badge/Badge.js');
|
|
8
|
-
var DropdownTool = require('../dropdown/DropdownTool.js');
|
|
9
16
|
var Icon = require('../icon/Icon.js');
|
|
10
|
-
|
|
11
|
-
var
|
|
17
|
+
require('../../types/icons.js');
|
|
18
|
+
var DropdownTool = require('../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; }
|
|
23
|
+
/**
|
|
24
|
+
* A component that represents a tab in a tabbed interface. It can display an icon, label, badge, and actions.
|
|
25
|
+
* It supports polymorphic rendering, allowing it to be rendered as different HTML elements.
|
|
26
|
+
* It also supports tooltips, active states, and click handling.
|
|
27
|
+
*
|
|
28
|
+
* @param {TabProps} props - The properties for the Tab component.
|
|
29
|
+
* @returns {JSX.Element} The rendered Tab component.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```jsx
|
|
33
|
+
* <Tab
|
|
34
|
+
* id="tab1"
|
|
35
|
+
* label="Tab 1"
|
|
36
|
+
* icon="home"
|
|
37
|
+
* iconBg="bg-blue-500"
|
|
38
|
+
* iconColor="text-white"
|
|
39
|
+
* badge="New"
|
|
40
|
+
* onClick={(id) => console.log(`Tab clicked: ${id}`)}
|
|
41
|
+
* onClose={() => console.log("Tab closed")}
|
|
42
|
+
* active={true}
|
|
43
|
+
* actions={<button>Action</button>}
|
|
44
|
+
* color="primary"
|
|
45
|
+
* tooltip="This is a tab"
|
|
46
|
+
* activeClassName="bg-blue-100"
|
|
47
|
+
* />
|
|
48
|
+
* // Renders a tab with label "Tab 1", home icon, blue background, white text, badge "New",
|
|
49
|
+
* // and an action button. The tab is active and has a tooltip.
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-tabpanel--docs} for more details.
|
|
53
|
+
*/
|
|
16
54
|
var Tab = function Tab(_ref) {
|
|
17
55
|
var ref = _ref.ref,
|
|
18
56
|
as = _ref.as,
|
|
@@ -27,51 +65,64 @@ var Tab = function Tab(_ref) {
|
|
|
27
65
|
disabled = _ref.disabled,
|
|
28
66
|
onClose = _ref.onClose,
|
|
29
67
|
active = _ref.active,
|
|
30
|
-
minimal = _ref.minimal,
|
|
31
68
|
_onClick = _ref.onClick,
|
|
32
69
|
tabFlex = _ref.tabFlex,
|
|
33
70
|
color = _ref.color,
|
|
34
71
|
actions = _ref.actions,
|
|
72
|
+
tooltip = _ref.tooltip,
|
|
35
73
|
activeClassName = _ref.activeClassName,
|
|
36
74
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
37
75
|
var badgeProps = react.useMemo(function () {
|
|
38
76
|
return Badge.getBadgeProps(badge);
|
|
39
77
|
}, [badge]);
|
|
78
|
+
var minimal = react.useMemo(function () {
|
|
79
|
+
return !label;
|
|
80
|
+
}, [label]);
|
|
81
|
+
var tooltipProps = react.useMemo(function () {
|
|
82
|
+
if (utilities.isString(tooltip)) return {
|
|
83
|
+
content: tooltip
|
|
84
|
+
};
|
|
85
|
+
return tooltip !== null && tooltip !== void 0 ? tooltip : {};
|
|
86
|
+
}, [tooltip]);
|
|
40
87
|
var E = as !== null && as !== void 0 ? as : "button";
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
children: [icon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
|
|
52
|
-
icon: icon,
|
|
53
|
-
bg: iconBg,
|
|
54
|
-
color: iconColor,
|
|
55
|
-
rtlFlip: rtlFlip,
|
|
56
|
-
className: "flex-content"
|
|
57
|
-
}), !minimal && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
58
|
-
className: "flex-initial truncate text-center px-1 py-1",
|
|
59
|
-
children: label
|
|
60
|
-
}), badge && /*#__PURE__*/jsxRuntime.jsx(Badge.Badge, _objectSpread(_objectSpread({}, badgeProps), {}, {
|
|
61
|
-
placement: minimal ? "end" : "",
|
|
62
|
-
className: classNames("me-1", badgeProps.className)
|
|
63
|
-
})), actions && active && /*#__PURE__*/jsxRuntime.jsx(DropdownTool.DropdownTool, {
|
|
64
|
-
className: "bg-base/20 me-1 z-5",
|
|
65
|
-
children: actions
|
|
66
|
-
}), onClose && /*#__PURE__*/jsxRuntime.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();
|
|
88
|
+
var W = tooltip ? Tooltip.Tooltip : react.Fragment;
|
|
89
|
+
return /*#__PURE__*/jsxRuntime.jsx(W, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
90
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(E, _objectSpread(_objectSpread({
|
|
91
|
+
"data-id": id,
|
|
92
|
+
disabled: disabled,
|
|
93
|
+
"data-color": color,
|
|
94
|
+
"data-inner-clickable": true,
|
|
95
|
+
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 cursor-pointer"),
|
|
96
|
+
onClick: function onClick() {
|
|
97
|
+
return !active && (_onClick === null || _onClick === void 0 ? void 0 : _onClick(id));
|
|
72
98
|
},
|
|
73
|
-
|
|
74
|
-
})
|
|
99
|
+
ref: ref
|
|
100
|
+
}, aria), {}, {
|
|
101
|
+
children: [icon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
|
|
102
|
+
icon: icon,
|
|
103
|
+
bg: iconBg,
|
|
104
|
+
color: iconColor,
|
|
105
|
+
rtlFlip: rtlFlip,
|
|
106
|
+
className: "flex-content p-2"
|
|
107
|
+
}), !minimal && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
108
|
+
className: "flex-initial truncate text-center px-1 py-1",
|
|
109
|
+
children: label
|
|
110
|
+
}), badge && /*#__PURE__*/jsxRuntime.jsx(Badge.Badge, _objectSpread(_objectSpread({}, badgeProps), {}, {
|
|
111
|
+
placement: minimal ? "end" : "",
|
|
112
|
+
className: classNames("me-1", badgeProps.className)
|
|
113
|
+
})), actions && active && /*#__PURE__*/jsxRuntime.jsx(DropdownTool.DropdownTool, {
|
|
114
|
+
className: "bg-tint-50/20 me-1 z-5",
|
|
115
|
+
children: actions
|
|
116
|
+
}), onClose && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
117
|
+
role: "none",
|
|
118
|
+
className: classNames("cursor-pointer me-1 opacity-65 hover:opacity-90 pointer-events-auto"),
|
|
119
|
+
onClick: function onClick(e) {
|
|
120
|
+
onClose === null || onClose === void 0 || onClose();
|
|
121
|
+
e.stopPropagation();
|
|
122
|
+
},
|
|
123
|
+
children: "\xD7"
|
|
124
|
+
})]
|
|
125
|
+
}))
|
|
75
126
|
}));
|
|
76
127
|
};
|
|
77
128
|
|
|
@@ -3,14 +3,46 @@
|
|
|
3
3
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
4
4
|
var classNames = require('classnames');
|
|
5
5
|
var react = require('react');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
require('@react-fabric/utilities');
|
|
7
8
|
var nodeCheck = require('../../utils/nodeCheck.js');
|
|
8
9
|
var Tab = require('./Tab.js');
|
|
9
|
-
var TabPanel_module = require('./TabPanel.module.css');
|
|
10
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
11
10
|
|
|
12
11
|
// TODO: implement append/prepend tab-bar items
|
|
13
12
|
|
|
13
|
+
/**
|
|
14
|
+
* A component that provides a tabbed interface for displaying content.
|
|
15
|
+
* It allows users to switch between different tabs, each containing its own content.
|
|
16
|
+
* It supports various orientations, justify options, and variants for the tab header.
|
|
17
|
+
* It also provides hooks for handling tab changes before and after they occur.
|
|
18
|
+
* This component is useful for organizing content into separate sections that can be easily navigated by the user.
|
|
19
|
+
* It can be customized with different styles and behaviors to fit the needs of the application.
|
|
20
|
+
*
|
|
21
|
+
* @param {TabPanelProps} props - The properties for the TabPanel component.
|
|
22
|
+
* @returns {JSX.Element} The rendered TabPanel component.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```jsx
|
|
26
|
+
* <TabPanel
|
|
27
|
+
* orientation="top"
|
|
28
|
+
* activeTab="tab1"
|
|
29
|
+
* justify="start"
|
|
30
|
+
* variant="solid"
|
|
31
|
+
* tabFlex={true}
|
|
32
|
+
* onBeforeChange={(nextTab, currentTab) => {
|
|
33
|
+
* console.log(`Switching from ${currentTab} to ${nextTab}`);
|
|
34
|
+
* return true; // or false to prevent change
|
|
35
|
+
* }}
|
|
36
|
+
* onChange={(id) => console.log(`Active tab changed to: ${id}`)}
|
|
37
|
+
* >
|
|
38
|
+
* <Tab id="tab1" label="Tab 1">Content for Tab 1</Tab>
|
|
39
|
+
* <Tab id="tab2" label="Tab 2">Content for Tab 2</Tab>
|
|
40
|
+
* <Tab id="tab3" label="Tab 3">Content for Tab 3</Tab>
|
|
41
|
+
* </TabPanel>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-tabpanel--docs} for more details.
|
|
45
|
+
*/
|
|
14
46
|
var TabPanel = function TabPanel(_ref) {
|
|
15
47
|
var children = _ref.children,
|
|
16
48
|
headerClassName = _ref.headerClassName,
|
|
@@ -20,6 +52,8 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
20
52
|
justify = _ref.justify,
|
|
21
53
|
variant = _ref.variant,
|
|
22
54
|
tabFlex = _ref.tabFlex,
|
|
55
|
+
append = _ref.append,
|
|
56
|
+
prepend = _ref.prepend,
|
|
23
57
|
gap = _ref.gap,
|
|
24
58
|
onBeforeChange = _ref.onBeforeChange,
|
|
25
59
|
onChange = _ref.onChange;
|
|
@@ -54,22 +88,25 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
54
88
|
});
|
|
55
89
|
}, [onBeforeChange, onChange, active]);
|
|
56
90
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
57
|
-
className: classNames(
|
|
91
|
+
className: classNames("fabric-tabPanel", "area-content grid bg-base overflow-hidden"),
|
|
58
92
|
"data-orientation": orientation,
|
|
59
93
|
"data-variant": variant !== null && variant !== void 0 ? variant : "default",
|
|
60
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
61
|
-
className: classNames(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
94
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
95
|
+
className: classNames("fabric-tabHeader", headerClassName, justify && "justify-".concat(justify), ["start", "end"].includes(orientation) && "flex-col", "flex flex-nowrap overflow-hidden items-center"),
|
|
96
|
+
children: [prepend, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
97
|
+
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"),
|
|
98
|
+
style: {
|
|
99
|
+
gap: gap
|
|
100
|
+
},
|
|
101
|
+
children: tabs.map(function (node) {
|
|
102
|
+
var _node$props$tabFlex;
|
|
103
|
+
return /*#__PURE__*/react.cloneElement(node, {
|
|
104
|
+
tabFlex: (_node$props$tabFlex = node.props.tabFlex) !== null && _node$props$tabFlex !== void 0 ? _node$props$tabFlex : tabFlex,
|
|
105
|
+
onClick: handleClick,
|
|
106
|
+
active: node.props.id === active
|
|
107
|
+
});
|
|
108
|
+
})
|
|
109
|
+
}), append]
|
|
73
110
|
}), rest, activeTabPanel]
|
|
74
111
|
});
|
|
75
112
|
};
|
|
@@ -68,6 +68,9 @@ var ApplicationProvider = function ApplicationProvider(_ref3) {
|
|
|
68
68
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
69
69
|
locale = _useState8[0],
|
|
70
70
|
setLocale = _useState8[1];
|
|
71
|
+
react.useEffect(function () {
|
|
72
|
+
defaultColorScheme && setColorScheme(defaultColorScheme);
|
|
73
|
+
}, [defaultColorScheme]);
|
|
71
74
|
|
|
72
75
|
/** ***************** set initial theme and locale dir *******************/
|
|
73
76
|
react.useEffect(function () {
|
|
@@ -148,7 +151,15 @@ var useGlobals = function useGlobals() {
|
|
|
148
151
|
};
|
|
149
152
|
|
|
150
153
|
/**
|
|
151
|
-
* global application context
|
|
154
|
+
* Hook to access the global application context.
|
|
155
|
+
* This hook provides access to the global context values, including the current locale, calendar, and color scheme.
|
|
156
|
+
*
|
|
157
|
+
* @returns {GlobalContextType} The global context values excluding the error element.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```jsx
|
|
161
|
+
* const { changeLocale, currentLocale, toggleColorScheme } = useApplicationContext();
|
|
162
|
+
* ```
|
|
152
163
|
*/
|
|
153
164
|
var useApplicationContext = function useApplicationContext() {
|
|
154
165
|
var _useContext = react.useContext(GlobalContext);
|
|
@@ -156,6 +167,22 @@ var useApplicationContext = function useApplicationContext() {
|
|
|
156
167
|
var rest = _objectWithoutProperties(_useContext, _excluded);
|
|
157
168
|
return rest;
|
|
158
169
|
};
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Hook to access the notification manager from the global context.
|
|
173
|
+
* This hook provides methods to show alerts, errors, messages, and toasts.
|
|
174
|
+
* It returns a reference to the notification manager, which can be used to display notifications in the application.
|
|
175
|
+
*
|
|
176
|
+
* @returns {NotificationManagerRef} The notification manager reference.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```jsx
|
|
180
|
+
* const notificationService = useNotificationService();
|
|
181
|
+
* notificationService.showMessage("Hello World");
|
|
182
|
+
* ```
|
|
183
|
+
*
|
|
184
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-notifications--notifications} for more details on available methods.
|
|
185
|
+
*/
|
|
159
186
|
var useNotificationService = function useNotificationService() {
|
|
160
187
|
var _useContext2 = react.useContext(GlobalContext),
|
|
161
188
|
notificationManager = _useContext2.notificationManager;
|
|
@@ -221,7 +221,7 @@ var NotificationManager = function NotificationManager(_ref) {
|
|
|
221
221
|
style: {
|
|
222
222
|
zIndex: "var(--z-overlay)"
|
|
223
223
|
},
|
|
224
|
-
className: "
|
|
224
|
+
className: "fabric-container__overlays pointer-events-none fixed inset-0 p-4 bg-transparent",
|
|
225
225
|
children: Object.values(alerts).map(function (_ref7) {
|
|
226
226
|
var _ref8 = _slicedToArray(_ref7, 1),
|
|
227
227
|
el = _ref8[0];
|
|
@@ -231,7 +231,7 @@ var NotificationManager = function NotificationManager(_ref) {
|
|
|
231
231
|
style: {
|
|
232
232
|
zIndex: "var(--z-notifications)"
|
|
233
233
|
},
|
|
234
|
-
className: "
|
|
234
|
+
className: "fabric-container__notifs flex flex-nowrap pointer-events-none fixed inset-0 p-2 bg-transparent flex-col-reverse items-center justify-end",
|
|
235
235
|
children: Object.values(messages).map(function (_ref9) {
|
|
236
236
|
var _ref10 = _slicedToArray(_ref9, 1),
|
|
237
237
|
el = _ref10[0];
|
|
@@ -241,7 +241,7 @@ var NotificationManager = function NotificationManager(_ref) {
|
|
|
241
241
|
style: {
|
|
242
242
|
zIndex: "var(--z-notifications)"
|
|
243
243
|
},
|
|
244
|
-
className: "
|
|
244
|
+
className: "fabric-container__toasts flex flex-nowrap pointer-events-none fixed inset-0 p-4 bg-transparent flex-col items-end justify-end overflow-auto scroll-hide",
|
|
245
245
|
children: Object.values(toasts).map(function (_ref11) {
|
|
246
246
|
var _ref12 = _slicedToArray(_ref11, 1),
|
|
247
247
|
el = _ref12[0];
|
|
@@ -11,13 +11,49 @@ var usePropToggle = require('../../hooks/usePropToggle.js');
|
|
|
11
11
|
var useResize = require('../../hooks/useResize.js');
|
|
12
12
|
var icons = require('../../types/icons.js');
|
|
13
13
|
var ErrorBoundary = require('../boundary/ErrorBoundary.js');
|
|
14
|
-
var Aside_module = require('./Aside.module.css');
|
|
15
14
|
var jsxRuntime = require('react/jsx-runtime');
|
|
16
15
|
|
|
17
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
18
|
/**
|
|
20
|
-
*
|
|
19
|
+
* A sidebar component that can be collapsed, resized, and has a flyout feature.
|
|
20
|
+
* It supports a title, icon, actions, and loading state.
|
|
21
|
+
* It can be aligned to the start or end of the page.
|
|
22
|
+
*
|
|
23
|
+
* @param {AsideProps} props - The properties for the Aside component.
|
|
24
|
+
* @returns {JSX.Element} The rendered Aside component.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```jsx
|
|
28
|
+
* <Aside
|
|
29
|
+
* title="Sidebar Title"
|
|
30
|
+
* icon={CoreIcons.menu}
|
|
31
|
+
* iconBg="bg-gray-200"
|
|
32
|
+
* iconColor="text-gray-800"
|
|
33
|
+
* rtlFlip={true}
|
|
34
|
+
* className="custom-aside"
|
|
35
|
+
* bodyClassName="custom-aside-body"
|
|
36
|
+
* headerClassName="custom-aside-header"
|
|
37
|
+
* resizeable={true}
|
|
38
|
+
* flyout={true}
|
|
39
|
+
* onFlyout={() => console.log("Flyout triggered")}
|
|
40
|
+
* collapsed={false}
|
|
41
|
+
* collapsable={true}
|
|
42
|
+
* onCollapse={() => console.log("Collapsed toggled")}
|
|
43
|
+
* actions={<button>Action</button>}
|
|
44
|
+
* loading={false}
|
|
45
|
+
* align="start"
|
|
46
|
+
* width="20rem"
|
|
47
|
+
* minWidth="2rem"
|
|
48
|
+
* maxWidth="30vw"
|
|
49
|
+
* data-testid="aside-test"
|
|
50
|
+
* data-test-value="aside-value"
|
|
51
|
+
* >
|
|
52
|
+
* <Content>This is the content of the aside.</Content>
|
|
53
|
+
* </Aside>
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--aside} for more details.
|
|
21
57
|
*/
|
|
22
58
|
var Aside = function Aside(_ref) {
|
|
23
59
|
var children = _ref.children,
|
|
@@ -103,21 +139,23 @@ var Aside = function Aside(_ref) {
|
|
|
103
139
|
};
|
|
104
140
|
}, [width, minWidth, maxWidth]);
|
|
105
141
|
return /*#__PURE__*/jsxRuntime.jsxs("aside", {
|
|
106
|
-
className: classNames(
|
|
142
|
+
className: classNames("fabric-aside", className, "overflow-hidden grid"),
|
|
107
143
|
"data-align": align,
|
|
108
144
|
"data-flyout": peek,
|
|
145
|
+
"data-loading": loading,
|
|
109
146
|
"data-collapsed": isCollapsed,
|
|
110
147
|
style: isCollapsed ? undefined : widthStyles,
|
|
111
148
|
"data-testid": testId,
|
|
112
149
|
"data-test-value": testValue,
|
|
113
150
|
children: [/*#__PURE__*/jsxRuntime.jsxs("header", {
|
|
114
|
-
className: classNames(
|
|
151
|
+
className: classNames("fabric-asideHeader", headerClassName, "grid area-head items-center"),
|
|
152
|
+
"data-ref": "asideHeader",
|
|
115
153
|
children: [title && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
116
|
-
className: classNames(
|
|
154
|
+
className: classNames("fabric-asideTitle", "truncate py-0.5 px-1 select-none pointer-events-none"),
|
|
117
155
|
children: title
|
|
118
156
|
}), collapsable && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
|
|
119
157
|
"aria-label": isCollapsed ? "expand" : "collapse",
|
|
120
|
-
className: classNames(
|
|
158
|
+
className: classNames("fabric-asideCollapse", "p-2 select-none"),
|
|
121
159
|
icon: icons.CoreIcons.chevronLeft,
|
|
122
160
|
rtlFlip: true,
|
|
123
161
|
onClick: toggleCollapse,
|
|
@@ -127,26 +165,26 @@ var Aside = function Aside(_ref) {
|
|
|
127
165
|
bg: iconBg,
|
|
128
166
|
color: iconColor,
|
|
129
167
|
rtlFlip: rtlFlip,
|
|
130
|
-
className: classNames(
|
|
168
|
+
className: classNames("fabric-asideIcon", "p-1 text-lg select-none pointer-events-none")
|
|
131
169
|
}), actions && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
132
|
-
className:
|
|
170
|
+
className: "fabric-asideActions",
|
|
133
171
|
children: actions
|
|
134
172
|
})]
|
|
135
173
|
}), loading && /*#__PURE__*/jsxRuntime.jsx(Animations.Loading, {}), isCollapsed && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
136
174
|
role: "none",
|
|
137
175
|
onClick: tryPeek,
|
|
138
176
|
"data-ref": "asidePlaceholder",
|
|
139
|
-
className:
|
|
177
|
+
className: "fabric-asidePlaceholder"
|
|
140
178
|
}), /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
141
179
|
ref: elementRef,
|
|
142
180
|
"data-ref": "asideBody",
|
|
143
|
-
className: classNames(
|
|
181
|
+
className: classNames("fabric-asideBody", bodyClassName, "overflow-hidden grid"),
|
|
144
182
|
style: isCollapsed ? widthStyles : undefined,
|
|
145
183
|
children: /*#__PURE__*/jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, {
|
|
146
184
|
children: children
|
|
147
185
|
})
|
|
148
186
|
}), resizeable && /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({}, resizeHandleProps), {}, {
|
|
149
|
-
className: classNames(
|
|
187
|
+
className: classNames("fabric-asideResizer", "before:absolute before:inset-0 before:w-1 before:top-1/2 before:-translate-y-1/2 before:transition-all before:delay-150")
|
|
150
188
|
}))]
|
|
151
189
|
});
|
|
152
190
|
};
|
|
@@ -13,7 +13,6 @@ var reactI18next = require('react-i18next');
|
|
|
13
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
14
|
var useEffectDebugger = require('../../hooks/useEffectDebugger.js');
|
|
15
15
|
var usePropToggle = require('../../hooks/usePropToggle.js');
|
|
16
|
-
var ErrorBoundary_module = require('./ErrorBoundary.module.css');
|
|
17
16
|
var ErrorIcon = require('./ErrorIcon.js');
|
|
18
17
|
var Global = require('../../context/Global.js');
|
|
19
18
|
|
|
@@ -43,7 +42,7 @@ var ErrorMessage = function ErrorMessage(_ref2) {
|
|
|
43
42
|
}, [], "ErrorBoundary element");
|
|
44
43
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
45
44
|
children: [/*#__PURE__*/jsxRuntime.jsx(ErrorIcon.ErrorIcon, {}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
46
|
-
className: classNames(
|
|
45
|
+
className: classNames("fabric-boundaryMessage", "p-2"),
|
|
47
46
|
children: /*#__PURE__*/jsxRuntime.jsx(EE, {
|
|
48
47
|
error: error
|
|
49
48
|
})
|
|
@@ -59,9 +58,9 @@ var ErrorStack = function ErrorStack(_ref4) {
|
|
|
59
58
|
toggleShow = _usePropToggle2[1];
|
|
60
59
|
utilities.useLogger().error(error, {}, stack);
|
|
61
60
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
62
|
-
className: classNames(
|
|
61
|
+
className: classNames("fabric-boundaryDetail", "overflow-hidden grid"),
|
|
63
62
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
64
|
-
className: classNames(
|
|
63
|
+
className: classNames("fabric-boundaryLink", "px-2 py-1 text-xs text-end"),
|
|
65
64
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
66
65
|
role: "link",
|
|
67
66
|
tabIndex: 0,
|
|
@@ -70,7 +69,7 @@ var ErrorStack = function ErrorStack(_ref4) {
|
|
|
70
69
|
children: show ? "Hide Detail" : "Show Detail"
|
|
71
70
|
})
|
|
72
71
|
}), show && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
73
|
-
className: classNames(
|
|
72
|
+
className: classNames("fabric-boundaryStack", "overflow-auto p-2 text-xs border-t"),
|
|
74
73
|
children: /*#__PURE__*/jsxRuntime.jsx("pre", {
|
|
75
74
|
className: "whitespace-pre-wrap",
|
|
76
75
|
children: stack
|
|
@@ -80,7 +79,23 @@ var ErrorStack = function ErrorStack(_ref4) {
|
|
|
80
79
|
};
|
|
81
80
|
|
|
82
81
|
/**
|
|
83
|
-
*
|
|
82
|
+
* ErrorBoundary component to catch JavaScript errors anywhere in the child component tree,
|
|
83
|
+
* log those errors, and display a fallback UI.
|
|
84
|
+
* It can also display a custom error element if provided.
|
|
85
|
+
* This component is useful for preventing the entire application from crashing
|
|
86
|
+
* when an error occurs in a part of the component tree.
|
|
87
|
+
* It can be used to wrap any part of the application.
|
|
88
|
+
* It supports custom error display components and provides a default error message.
|
|
89
|
+
* It also conditionally displays the error stack trace in development mode.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```jsx
|
|
93
|
+
* <ErrorBoundary errorElement={CustomErrorComponent}>
|
|
94
|
+
* <YourComponent />
|
|
95
|
+
* </ErrorBoundary>
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--error-boundary}
|
|
84
99
|
*/
|
|
85
100
|
var ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
86
101
|
function ErrorBoundary(props) {
|
|
@@ -110,9 +125,9 @@ var ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
110
125
|
var E = this.props.errorElement;
|
|
111
126
|
// You can render any custom fallback UI
|
|
112
127
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
113
|
-
className: classNames(
|
|
128
|
+
className: classNames("fabric-errorBoundary", "grid grid-rows-1 overflow-hidden p-0.5 rounded-capped"),
|
|
114
129
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
115
|
-
className: classNames(
|
|
130
|
+
className: classNames("fabric-boundaryContent", "overflow-hidden grid rounded-capped"),
|
|
116
131
|
children: [/*#__PURE__*/jsxRuntime.jsx(ErrorMessage, {
|
|
117
132
|
error: this.state.error,
|
|
118
133
|
errorElement: E
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var classNames = require('classnames');
|
|
4
|
-
var ErrorBoundary_module = require('./ErrorBoundary.module.css');
|
|
5
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
5
|
|
|
7
6
|
/*
|
|
@@ -31,7 +30,7 @@ var ErrorIcon = function ErrorIcon() {
|
|
|
31
30
|
return /*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
32
31
|
xmlns: "http://www.w3.org/2000/svg",
|
|
33
32
|
viewBox: "0 0 64 64",
|
|
34
|
-
className: classNames(
|
|
33
|
+
className: classNames("fabric-boundaryIcon", "size-6 m-2"),
|
|
35
34
|
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
36
35
|
fill: "#808080",
|
|
37
36
|
d: "M64 32c0 17.673-14.327 32-32 32s-32-14.327-32-32 14.327-32 32-32 32 14.327 32 32z"
|
|
@@ -5,7 +5,6 @@ var react = require('react');
|
|
|
5
5
|
var useDebounce = require('../../hooks/useDebounce.js');
|
|
6
6
|
var useResizeObserver = require('../../hooks/useResizeObserver.js');
|
|
7
7
|
var ErrorBoundary = require('../boundary/ErrorBoundary.js');
|
|
8
|
-
var Content_module = require('./Content.module.css');
|
|
9
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
9
|
|
|
11
10
|
/*
|
|
@@ -32,7 +31,12 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
32
31
|
*/
|
|
33
32
|
|
|
34
33
|
/**
|
|
35
|
-
*
|
|
34
|
+
* Content component that wraps children in a section element.
|
|
35
|
+
* It uses a resize observer to handle resizing and a debounced scroll handler.
|
|
36
|
+
* It also includes an error boundary to catch any errors in the children.
|
|
37
|
+
*
|
|
38
|
+
* @param {ContentProps} props - The properties for the Content component.
|
|
39
|
+
* @returns A section element containing the children wrapped in an error boundary.
|
|
36
40
|
*/
|
|
37
41
|
var Content = function Content(_ref) {
|
|
38
42
|
var ref = _ref.ref,
|
|
@@ -44,12 +48,15 @@ var Content = function Content(_ref) {
|
|
|
44
48
|
testValue = _ref["data-test-value"];
|
|
45
49
|
var resizeHandle = useResizeObserver.useResizeObserver(onResize);
|
|
46
50
|
var scrollHandler = useDebounce.useDebounce(function (e) {
|
|
51
|
+
var el = e.target;
|
|
47
52
|
onScroll === null || onScroll === void 0 || onScroll({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
left: el.scrollLeft,
|
|
54
|
+
top: el.scrollTop,
|
|
55
|
+
scrollHeight: el.scrollHeight,
|
|
56
|
+
scrollWidth: el.scrollWidth,
|
|
57
|
+
width: el.offsetWidth,
|
|
58
|
+
height: el.offsetHeight
|
|
59
|
+
}, e);
|
|
53
60
|
}, [onScroll]);
|
|
54
61
|
react.useImperativeHandle(ref, function () {
|
|
55
62
|
return resizeHandle.current;
|
|
@@ -60,7 +67,7 @@ var Content = function Content(_ref) {
|
|
|
60
67
|
"data-test-value": testValue,
|
|
61
68
|
ref: resizeHandle,
|
|
62
69
|
onScroll: scrollHandler,
|
|
63
|
-
className: classNames(
|
|
70
|
+
className: classNames("fabric-content", "area-content", className),
|
|
64
71
|
children: /*#__PURE__*/jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, {
|
|
65
72
|
children: children
|
|
66
73
|
})
|