@react-fabric/core 1.0.0-beta.6 → 1.0.0-beta.61
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} +52 -47
- package/{src/components/button/Button.module.css → css/components/_button.css} +86 -84
- package/{src/components/card/Card.module.css → css/components/_card.css} +54 -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} +12 -9
- package/{src/components/media/Media.module.css → css/components/_media.css} +17 -17
- package/{src/components/menu/Menu.module.css → css/components/_menu.css} +21 -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/css/components/_stepper.css +86 -0
- package/{src/components/tabpanel/TabPanel.module.css → css/components/_tabPanel.css} +130 -85
- 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} +26 -18
- package/{src/core/aside/Aside.module.css → css/core/_aside.css} +60 -48
- 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 +56 -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 +9 -6
- package/css/theme/_colors.css +320 -0
- package/css/theme/_utilities.css +541 -0
- package/css/theme/index.css +45 -0
- package/dist/cjs/components/actionLabel/ActionLabel.js +26 -8
- package/dist/cjs/components/animations/Animations.js +137 -45
- package/dist/cjs/components/avatar/Avatar.js +46 -13
- package/dist/cjs/components/avatar/AvatarGroup.js +22 -4
- package/dist/cjs/components/badge/Badge.js +36 -15
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +40 -9
- package/dist/cjs/components/button/Button.js +51 -29
- package/dist/cjs/components/button/ButtonGroup.js +30 -3
- package/dist/cjs/components/button/ConfirmButton.js +28 -2
- package/dist/cjs/components/button/ToggleButtonGroup.js +41 -15
- package/dist/cjs/components/callout/Callout.js +47 -7
- package/dist/cjs/components/card/Card.js +60 -18
- 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 +40 -20
- package/dist/cjs/components/collapsable/Collapsable.js +32 -8
- 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 +2 -3
- package/dist/cjs/components/empty/EmptyContent.js +37 -7
- package/dist/cjs/components/icon/Icon.js +76 -13
- package/dist/cjs/components/media/Media.js +174 -76
- package/dist/cjs/components/menu/ContextMenu.js +19 -0
- package/dist/cjs/components/menu/Menu.js +77 -23
- package/dist/cjs/components/menu/MenuItem.js +54 -27
- package/dist/cjs/components/meter/Meter.js +26 -3
- package/dist/cjs/components/navigator/Navigator.js +50 -18
- package/dist/cjs/components/panel/Panel.js +59 -28
- package/dist/cjs/components/panel/PanelGroup.js +25 -2
- package/dist/cjs/components/panel/PanelStack.js +31 -2
- 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 +39 -16
- package/dist/cjs/components/tabpanel/TabPanel.js +56 -16
- package/dist/cjs/context/Global.js +28 -1
- package/dist/cjs/context/NotificationCenter.js +3 -3
- package/dist/cjs/core/aside/Aside.js +50 -25
- package/dist/cjs/core/boundary/ErrorBoundary.js +25 -8
- package/dist/cjs/core/boundary/ErrorIcon.js +1 -2
- package/dist/cjs/core/content/Content.js +7 -3
- package/dist/cjs/core/headfoot/HeadFoot.js +48 -22
- package/dist/cjs/core/page/Page.js +41 -40
- package/dist/cjs/core/responsive/Responsive.js +59 -6
- package/dist/cjs/core/section/Section.js +12 -29
- 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/useStepper.js +74 -0
- 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 +14 -10
- package/dist/cjs/overlays/alert/Alert.js +24 -17
- package/dist/cjs/overlays/flyout/Flyout.js +48 -65
- package/dist/cjs/overlays/message/Message.js +8 -3
- package/dist/cjs/overlays/modal/Modal.js +19 -23
- package/dist/cjs/overlays/toast/Toast.js +22 -13
- package/dist/cjs/overlays/tooltip/Tooltip.js +25 -13
- package/dist/cjs/typography/Abbr.js +35 -7
- package/dist/cjs/typography/{Link.js → Anchor.js} +23 -5
- package/dist/cjs/typography/Copy.js +1 -2
- package/dist/cjs/typography/Mark.js +25 -5
- 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 +135 -44
- package/dist/esm/components/avatar/Avatar.js +46 -13
- package/dist/esm/components/avatar/AvatarGroup.js +22 -4
- package/dist/esm/components/badge/Badge.js +38 -17
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +40 -9
- package/dist/esm/components/button/Button.js +53 -31
- package/dist/esm/components/button/ButtonGroup.js +31 -4
- package/dist/esm/components/button/ConfirmButton.js +28 -2
- package/dist/esm/components/button/ToggleButtonGroup.js +42 -16
- package/dist/esm/components/callout/Callout.js +47 -7
- package/dist/esm/components/card/Card.js +61 -19
- 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 +42 -22
- package/dist/esm/components/collapsable/Collapsable.js +32 -8
- 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 +2 -3
- package/dist/esm/components/empty/EmptyContent.js +37 -7
- package/dist/esm/components/icon/Icon.js +78 -16
- package/dist/esm/components/media/Media.js +175 -77
- package/dist/esm/components/menu/ContextMenu.js +19 -0
- package/dist/esm/components/menu/Menu.js +79 -25
- package/dist/esm/components/menu/MenuItem.js +49 -22
- package/dist/esm/components/meter/Meter.js +26 -3
- package/dist/esm/components/navigator/Navigator.js +50 -18
- package/dist/esm/components/panel/Panel.js +61 -30
- package/dist/esm/components/panel/PanelGroup.js +25 -2
- package/dist/esm/components/panel/PanelStack.js +31 -2
- 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 +40 -17
- package/dist/esm/components/tabpanel/TabPanel.js +56 -16
- package/dist/esm/context/Global.js +28 -1
- package/dist/esm/context/NotificationCenter.js +3 -3
- package/dist/esm/core/aside/Aside.js +52 -27
- package/dist/esm/core/boundary/ErrorBoundary.js +25 -8
- package/dist/esm/core/boundary/ErrorIcon.js +1 -2
- package/dist/esm/core/content/Content.js +7 -3
- package/dist/esm/core/headfoot/HeadFoot.js +48 -22
- package/dist/esm/core/page/Page.js +43 -42
- package/dist/esm/core/responsive/Responsive.js +59 -6
- package/dist/esm/core/section/Section.js +12 -29
- 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/useStepper.js +74 -0
- 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 +7 -4
- package/dist/esm/overlays/alert/Alert.js +25 -18
- package/dist/esm/overlays/flyout/Flyout.js +53 -70
- package/dist/esm/overlays/message/Message.js +9 -4
- package/dist/esm/overlays/modal/Modal.js +22 -26
- package/dist/esm/overlays/toast/Toast.js +23 -14
- package/dist/esm/overlays/tooltip/Tooltip.js +25 -13
- package/dist/esm/typography/Abbr.js +35 -7
- package/dist/esm/typography/{Link.js → Anchor.js} +24 -6
- package/dist/esm/typography/Copy.js +1 -2
- package/dist/esm/typography/Mark.js +25 -5
- 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 +21 -2
- package/dist/types/components/animations/Animations.d.ts +105 -7
- package/dist/types/components/avatar/Avatar.d.ts +34 -6
- package/dist/types/components/avatar/AvatarGroup.d.ts +19 -1
- package/dist/types/components/badge/Badge.d.ts +37 -3
- package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +31 -2
- package/dist/types/components/button/Button.d.ts +39 -7
- package/dist/types/components/button/ButtonGroup.d.ts +28 -3
- package/dist/types/components/button/ConfirmButton.d.ts +23 -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 +44 -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 +34 -5
- package/dist/types/components/collapsable/Collapsable.d.ts +28 -2
- 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 +25 -0
- package/dist/types/components/empty/EmptyContent.d.ts +32 -3
- package/dist/types/components/icon/Icon.d.ts +40 -8
- package/dist/types/components/index.d.ts +3 -2
- package/dist/types/components/media/Media.d.ts +54 -0
- package/dist/types/components/menu/ContextMenu.d.ts +19 -1
- 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 +9 -3
- 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 +43 -4
- 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 +38 -4
- package/dist/types/components/tabpanel/TabPanel.d.ts +51 -2
- package/dist/types/context/Global.d.ts +24 -1
- package/dist/types/core/aside/Aside.d.ts +45 -6
- package/dist/types/core/boundary/ErrorBoundary.d.ts +18 -2
- package/dist/types/core/content/Content.d.ts +6 -1
- package/dist/types/core/headfoot/HeadFoot.d.ts +41 -9
- package/dist/types/core/page/Page.d.ts +32 -4
- package/dist/types/core/responsive/Responsive.d.ts +58 -3
- package/dist/types/core/section/Section.d.ts +18 -3
- 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/useStepper.d.ts +14 -0
- package/dist/types/hooks/useStorage.d.ts +38 -0
- package/dist/types/index.d.ts +4 -1
- package/dist/types/overlays/alert/Alert.d.ts +16 -5
- package/dist/types/overlays/flyout/Flyout.d.ts +9 -4
- package/dist/types/overlays/message/Message.d.ts +16 -5
- package/dist/types/overlays/modal/Modal.d.ts +13 -4
- package/dist/types/overlays/toast/Toast.d.ts +16 -5
- package/dist/types/overlays/tooltip/Tooltip.d.ts +2 -2
- package/dist/types/types/index.d.ts +28 -24
- 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 +1 -0
- package/dist/types/utils/getColor.d.ts +1 -4
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +17 -16
- package/src/components/actionLabel/ActionLabel.tsx +26 -8
- package/src/components/animations/Animations.tsx +139 -52
- package/src/components/avatar/Avatar.tsx +51 -15
- package/src/components/avatar/AvatarGroup.tsx +23 -5
- package/src/components/badge/Badge.tsx +50 -22
- package/src/components/breadcrumbs/Breadcrumbs.tsx +43 -10
- package/src/components/button/Button.tsx +75 -43
- package/src/components/button/ButtonGroup.tsx +33 -7
- package/src/components/button/ConfirmButton.tsx +31 -3
- package/src/components/button/ToggleButtonGroup.tsx +74 -47
- package/src/components/callout/Callout.tsx +58 -16
- package/src/components/card/Card.tsx +84 -25
- package/src/components/card/CardCover.tsx +36 -6
- package/src/components/card/FlipContent.tsx +90 -0
- package/src/components/chip/Chip.tsx +53 -25
- package/src/components/collapsable/Collapsable.tsx +35 -11
- package/src/components/divider/Divider.tsx +42 -16
- package/src/components/dropdown/Dropdown.tsx +47 -12
- package/src/components/dropdown/DropdownTool.tsx +28 -4
- package/src/components/empty/EmptyContent.tsx +49 -8
- package/src/components/icon/Icon.tsx +96 -18
- package/src/components/index.ts +5 -4
- package/src/components/media/Media.tsx +193 -105
- package/src/components/menu/ContextMenu.tsx +19 -0
- package/src/components/menu/Menu.tsx +88 -32
- package/src/components/menu/MenuItem.tsx +44 -19
- package/src/components/menu/types.ts +9 -8
- package/src/components/meter/Meter.tsx +27 -4
- package/src/components/navigator/Navigator.tsx +60 -12
- package/src/components/panel/Panel.tsx +66 -28
- package/src/components/panel/PanelGroup.tsx +25 -2
- package/src/components/panel/PanelStack.tsx +33 -2
- package/src/components/progress/ProgressBar.tsx +33 -14
- package/src/components/progress/ProgressCircle.tsx +29 -13
- package/src/components/tabpanel/Tab.tsx +47 -24
- package/src/components/tabpanel/TabPanel.tsx +79 -13
- package/src/context/Global.tsx +28 -1
- package/src/context/NotificationCenter.tsx +3 -3
- package/src/core/aside/Aside.tsx +59 -38
- package/src/core/boundary/ErrorBoundary.tsx +26 -8
- package/src/core/boundary/ErrorIcon.tsx +1 -2
- package/src/core/content/Content.tsx +7 -3
- package/src/core/headfoot/HeadFoot.tsx +44 -37
- package/src/core/page/Page.tsx +44 -22
- package/src/core/responsive/Responsive.tsx +66 -8
- package/src/core/section/Section.tsx +26 -4
- 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 +33 -8
- package/src/hooks/usePropToggle.ts +16 -5
- package/src/hooks/useResize.ts +19 -1
- package/src/hooks/useResizeObserver.ts +32 -9
- package/src/hooks/useStepper.tsx +68 -0
- 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 +5 -1
- package/src/overlays/alert/Alert.tsx +51 -36
- package/src/overlays/flyout/Flyout.tsx +74 -99
- package/src/overlays/message/Message.tsx +28 -9
- package/src/overlays/modal/Modal.tsx +39 -34
- package/src/overlays/toast/Toast.tsx +44 -33
- package/src/overlays/tooltip/Tooltip.tsx +44 -20
- package/src/types/global.d.ts +8 -0
- package/src/types/index.ts +293 -47
- package/src/typography/Abbr.tsx +45 -11
- package/src/typography/{Link.tsx → Anchor.tsx} +26 -14
- package/src/typography/Copy.tsx +16 -2
- package/src/typography/Mark.tsx +25 -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/flags.rect.css +0 -1607
- package/css/flags.wavy.css +0 -1606
- 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/types/icons.js +0 -199
- 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/types/icons.js +0 -201
- package/dist/esm/typography/Typography.module.css +0 -1
- package/dist/types/types/icons.d.ts +0 -196
- package/dist/types/typography/Link.d.ts +0 -25
- package/src/types/icons.ts +0 -425
|
@@ -33,7 +33,6 @@ import {
|
|
|
33
33
|
import { type CallbackReturn, type ChildrenProp } from "../../types";
|
|
34
34
|
import { nodeCheck } from "../../utils";
|
|
35
35
|
import { Tab } from "./Tab";
|
|
36
|
-
import classes from "./TabPanel.module.css";
|
|
37
36
|
|
|
38
37
|
export interface TabPanelProps extends ChildrenProp<typeof Tab> {
|
|
39
38
|
/**
|
|
@@ -47,11 +46,15 @@ export interface TabPanelProps extends ChildrenProp<typeof Tab> {
|
|
|
47
46
|
/**
|
|
48
47
|
* tab variations
|
|
49
48
|
*/
|
|
50
|
-
variant?: "soft" | "solid" | "outline";
|
|
49
|
+
variant?: "soft" | "solid" | "outline" | "pills";
|
|
51
50
|
/**
|
|
52
51
|
* tab button flex to fill tabs
|
|
53
52
|
*/
|
|
54
53
|
tabFlex?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* rotate tab sideways for start/end orientation
|
|
56
|
+
*/
|
|
57
|
+
tabRotate?: boolean;
|
|
55
58
|
/**
|
|
56
59
|
* tab button gap
|
|
57
60
|
*/
|
|
@@ -64,6 +67,18 @@ export interface TabPanelProps extends ChildrenProp<typeof Tab> {
|
|
|
64
67
|
* tab list className
|
|
65
68
|
*/
|
|
66
69
|
headerClassName?: string;
|
|
70
|
+
/**
|
|
71
|
+
* active tab className
|
|
72
|
+
*/
|
|
73
|
+
activeClassName?: string;
|
|
74
|
+
/**
|
|
75
|
+
* append element
|
|
76
|
+
*/
|
|
77
|
+
append?: React.ReactNode;
|
|
78
|
+
/**
|
|
79
|
+
* prepend element
|
|
80
|
+
*/
|
|
81
|
+
prepend?: React.ReactNode;
|
|
67
82
|
/**
|
|
68
83
|
* change handler
|
|
69
84
|
*/
|
|
@@ -76,14 +91,51 @@ export interface TabPanelProps extends ChildrenProp<typeof Tab> {
|
|
|
76
91
|
|
|
77
92
|
// TODO: implement append/prepend tab-bar items
|
|
78
93
|
|
|
94
|
+
/**
|
|
95
|
+
* A component that provides a tabbed interface for displaying content.
|
|
96
|
+
* It allows users to switch between different tabs, each containing its own content.
|
|
97
|
+
* It supports various orientations, justify options, and variants for the tab header.
|
|
98
|
+
* It also provides hooks for handling tab changes before and after they occur.
|
|
99
|
+
* This component is useful for organizing content into separate sections that can be easily navigated by the user.
|
|
100
|
+
* It can be customized with different styles and behaviors to fit the needs of the application.
|
|
101
|
+
*
|
|
102
|
+
* @param {TabPanelProps} props - The properties for the TabPanel component.
|
|
103
|
+
* @returns {JSX.Element} The rendered TabPanel component.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```jsx
|
|
107
|
+
* <TabPanel
|
|
108
|
+
* orientation="top"
|
|
109
|
+
* activeTab="tab1"
|
|
110
|
+
* justify="start"
|
|
111
|
+
* variant="solid"
|
|
112
|
+
* tabFlex={true}
|
|
113
|
+
* onBeforeChange={(nextTab, currentTab) => {
|
|
114
|
+
* console.log(`Switching from ${currentTab} to ${nextTab}`);
|
|
115
|
+
* return true; // or false to prevent change
|
|
116
|
+
* }}
|
|
117
|
+
* onChange={(id) => console.log(`Active tab changed to: ${id}`)}
|
|
118
|
+
* >
|
|
119
|
+
* <Tab id="tab1" label="Tab 1">Content for Tab 1</Tab>
|
|
120
|
+
* <Tab id="tab2" label="Tab 2">Content for Tab 2</Tab>
|
|
121
|
+
* <Tab id="tab3" label="Tab 3">Content for Tab 3</Tab>
|
|
122
|
+
* </TabPanel>
|
|
123
|
+
* ```
|
|
124
|
+
*
|
|
125
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-tabpanel--docs} for more details.
|
|
126
|
+
*/
|
|
79
127
|
export const TabPanel = ({
|
|
80
128
|
children,
|
|
81
129
|
headerClassName,
|
|
82
130
|
orientation = "top",
|
|
83
131
|
activeTab,
|
|
132
|
+
activeClassName,
|
|
84
133
|
justify,
|
|
85
134
|
variant,
|
|
86
135
|
tabFlex,
|
|
136
|
+
append,
|
|
137
|
+
prepend,
|
|
138
|
+
tabRotate,
|
|
87
139
|
gap,
|
|
88
140
|
onBeforeChange,
|
|
89
141
|
onChange,
|
|
@@ -124,7 +176,7 @@ export const TabPanel = ({
|
|
|
124
176
|
return (
|
|
125
177
|
<div
|
|
126
178
|
className={classNames(
|
|
127
|
-
|
|
179
|
+
"fabric-tabPanel",
|
|
128
180
|
"area-content grid bg-base overflow-hidden",
|
|
129
181
|
)}
|
|
130
182
|
data-orientation={orientation}
|
|
@@ -132,21 +184,35 @@ export const TabPanel = ({
|
|
|
132
184
|
>
|
|
133
185
|
<div
|
|
134
186
|
className={classNames(
|
|
135
|
-
|
|
187
|
+
"fabric-tabHeader",
|
|
136
188
|
headerClassName,
|
|
189
|
+
tabRotate && "tab-rotate",
|
|
137
190
|
justify && `justify-${justify}`,
|
|
138
191
|
["start", "end"].includes(orientation) && "flex-col",
|
|
139
|
-
"flex flex-nowrap overflow-
|
|
192
|
+
"flex flex-nowrap overflow-hidden items-center",
|
|
140
193
|
)}
|
|
141
|
-
style={{ gap }}
|
|
142
194
|
>
|
|
143
|
-
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
195
|
+
{prepend}
|
|
196
|
+
<div
|
|
197
|
+
className={classNames(
|
|
198
|
+
"fabric-tabList",
|
|
199
|
+
justify && `justify-${justify}`,
|
|
200
|
+
["start", "end"].includes(orientation) && "flex-col",
|
|
201
|
+
["bottom", "end"].includes(orientation) ? "self-start" : "self-end",
|
|
202
|
+
"flex flex-1 flex-nowrap overflow-auto scroll-thin",
|
|
203
|
+
)}
|
|
204
|
+
style={{ gap }}
|
|
205
|
+
>
|
|
206
|
+
{tabs.map((node: AnyObject) =>
|
|
207
|
+
cloneElement(node, {
|
|
208
|
+
tabFlex: node.props.tabFlex ?? tabFlex,
|
|
209
|
+
activeClassName: node.props.activeClassName ?? activeClassName,
|
|
210
|
+
onClick: handleClick,
|
|
211
|
+
active: node.props.id === active,
|
|
212
|
+
}),
|
|
213
|
+
)}
|
|
214
|
+
</div>
|
|
215
|
+
{append}
|
|
150
216
|
</div>
|
|
151
217
|
{rest}
|
|
152
218
|
{activeTabPanel}
|
package/src/context/Global.tsx
CHANGED
|
@@ -146,6 +146,10 @@ export const ApplicationProvider: FC<GlobalProps> = ({
|
|
|
146
146
|
defaultLocale ?? systemLocale(),
|
|
147
147
|
);
|
|
148
148
|
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
defaultColorScheme && setColorScheme(defaultColorScheme);
|
|
151
|
+
}, [defaultColorScheme]);
|
|
152
|
+
|
|
149
153
|
/** ***************** set initial theme and locale dir *******************/
|
|
150
154
|
useEffect(() => {
|
|
151
155
|
document.documentElement.lang = locale;
|
|
@@ -228,13 +232,36 @@ export const ApplicationProvider: FC<GlobalProps> = ({
|
|
|
228
232
|
export const useGlobals = () => useContext(GlobalContext);
|
|
229
233
|
|
|
230
234
|
/**
|
|
231
|
-
* global application context
|
|
235
|
+
* Hook to access the global application context.
|
|
236
|
+
* This hook provides access to the global context values, including the current locale, calendar, and color scheme.
|
|
237
|
+
*
|
|
238
|
+
* @returns {GlobalContextType} The global context values excluding the error element.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* ```jsx
|
|
242
|
+
* const { changeLocale, currentLocale, toggleColorScheme } = useApplicationContext();
|
|
243
|
+
* ```
|
|
232
244
|
*/
|
|
233
245
|
export const useApplicationContext = () => {
|
|
234
246
|
const { errorElement, ...rest } = useContext(GlobalContext);
|
|
235
247
|
return rest;
|
|
236
248
|
};
|
|
237
249
|
|
|
250
|
+
/**
|
|
251
|
+
* Hook to access the notification manager from the global context.
|
|
252
|
+
* This hook provides methods to show alerts, errors, messages, and toasts.
|
|
253
|
+
* It returns a reference to the notification manager, which can be used to display notifications in the application.
|
|
254
|
+
*
|
|
255
|
+
* @returns {NotificationManagerRef} The notification manager reference.
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```jsx
|
|
259
|
+
* const notificationService = useNotificationService();
|
|
260
|
+
* notificationService.showMessage("Hello World");
|
|
261
|
+
* ```
|
|
262
|
+
*
|
|
263
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-notifications--notifications} for more details on available methods.
|
|
264
|
+
*/
|
|
238
265
|
export const useNotificationService = () => {
|
|
239
266
|
const { notificationManager } = useContext(GlobalContext);
|
|
240
267
|
return notificationManager ?? {};
|
|
@@ -194,7 +194,7 @@ export const NotificationManager = ({ onLoad }: KeyValue) => {
|
|
|
194
194
|
{createPortal(
|
|
195
195
|
<div
|
|
196
196
|
style={{ zIndex: "var(--z-overlay)" }}
|
|
197
|
-
className="
|
|
197
|
+
className="fabric-container__overlays pointer-events-none fixed inset-0 p-4 bg-transparent"
|
|
198
198
|
>
|
|
199
199
|
{Object.values(alerts).map(([el]: AnyObject) => el)}
|
|
200
200
|
</div>,
|
|
@@ -203,7 +203,7 @@ export const NotificationManager = ({ onLoad }: KeyValue) => {
|
|
|
203
203
|
{createPortal(
|
|
204
204
|
<div
|
|
205
205
|
style={{ zIndex: "var(--z-notifications)" }}
|
|
206
|
-
className="
|
|
206
|
+
className="fabric-container__notifs flex flex-nowrap pointer-events-none fixed inset-0 p-2 bg-transparent flex-col-reverse items-center justify-end"
|
|
207
207
|
>
|
|
208
208
|
{Object.values(messages).map(([el]: AnyObject) => el)}
|
|
209
209
|
</div>,
|
|
@@ -212,7 +212,7 @@ export const NotificationManager = ({ onLoad }: KeyValue) => {
|
|
|
212
212
|
{createPortal(
|
|
213
213
|
<div
|
|
214
214
|
style={{ zIndex: "var(--z-notifications)" }}
|
|
215
|
-
className="
|
|
215
|
+
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"
|
|
216
216
|
>
|
|
217
217
|
{Object.values(toasts).map(([el]: AnyObject) => el)}
|
|
218
218
|
</div>,
|
package/src/core/aside/Aside.tsx
CHANGED
|
@@ -22,16 +22,9 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import classNames from "classnames";
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
useMemo,
|
|
29
|
-
useRef,
|
|
30
|
-
useState,
|
|
31
|
-
type ReactNode,
|
|
32
|
-
} from "react";
|
|
33
|
-
import { Loading } from "../../components/animations/Animations";
|
|
34
|
-
import { Icon } from "../../components/icon/Icon";
|
|
25
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
26
|
+
import { LoadingLine } from "../../components/animations/Animations";
|
|
27
|
+
import { getIconProps, Icon, type IconProps } from "../../components/icon/Icon";
|
|
35
28
|
import { useLayoutEffectDebugger } from "../../hooks/useEffectDebugger";
|
|
36
29
|
import { usePropToggle } from "../../hooks/usePropToggle";
|
|
37
30
|
import { useResize } from "../../hooks/useResize";
|
|
@@ -40,27 +33,27 @@ import {
|
|
|
40
33
|
type CollapseProps,
|
|
41
34
|
type CssProp,
|
|
42
35
|
type Elements,
|
|
43
|
-
type IconProps,
|
|
44
36
|
type TestProps,
|
|
45
37
|
} from "../../types";
|
|
46
|
-
import { CoreIcons } from "../../types/icons";
|
|
47
38
|
import { ErrorBoundary } from "../boundary/ErrorBoundary";
|
|
48
|
-
import classes from "./Aside.module.css";
|
|
49
39
|
|
|
50
40
|
export interface AsideProps
|
|
51
|
-
extends
|
|
52
|
-
ChildrenProp,
|
|
41
|
+
extends ChildrenProp,
|
|
53
42
|
CollapseProps,
|
|
54
43
|
CssProp,
|
|
55
44
|
TestProps {
|
|
56
45
|
/**
|
|
57
46
|
* page title
|
|
58
47
|
*/
|
|
59
|
-
title?: ReactNode;
|
|
48
|
+
title?: React.ReactNode;
|
|
60
49
|
/**
|
|
61
50
|
* align inline-end
|
|
62
51
|
*/
|
|
63
52
|
align?: "start" | "end";
|
|
53
|
+
/**
|
|
54
|
+
* icon path or props
|
|
55
|
+
*/
|
|
56
|
+
icon?: IconProps;
|
|
64
57
|
/**
|
|
65
58
|
* header actions
|
|
66
59
|
*/
|
|
@@ -106,15 +99,47 @@ export interface AsideProps
|
|
|
106
99
|
}
|
|
107
100
|
|
|
108
101
|
/**
|
|
109
|
-
*
|
|
102
|
+
* A sidebar component that can be collapsed, resized, and has a flyout feature.
|
|
103
|
+
* It supports a title, icon, actions, and loading state.
|
|
104
|
+
* It can be aligned to the start or end of the page.
|
|
105
|
+
*
|
|
106
|
+
* @param {AsideProps} props - The properties for the Aside component.
|
|
107
|
+
* @returns {JSX.Element} The rendered Aside component.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```jsx
|
|
111
|
+
* <Aside
|
|
112
|
+
* title="Sidebar Title"
|
|
113
|
+
* icon=icon-[mdi--menu]
|
|
114
|
+
* rtlFlip={true}
|
|
115
|
+
* className="custom-aside"
|
|
116
|
+
* bodyClassName="custom-aside-body"
|
|
117
|
+
* headerClassName="custom-aside-header"
|
|
118
|
+
* resizeable={true}
|
|
119
|
+
* flyout={true}
|
|
120
|
+
* onFlyout={() => console.log("Flyout triggered")}
|
|
121
|
+
* collapsed={false}
|
|
122
|
+
* collapsable={true}
|
|
123
|
+
* onCollapse={() => console.log("Collapsed toggled")}
|
|
124
|
+
* actions={<button>Action</button>}
|
|
125
|
+
* loading={false}
|
|
126
|
+
* align="start"
|
|
127
|
+
* width="20rem"
|
|
128
|
+
* minWidth="2rem"
|
|
129
|
+
* maxWidth="30vw"
|
|
130
|
+
* data-testid="aside-test"
|
|
131
|
+
* data-test-value="aside-value"
|
|
132
|
+
* >
|
|
133
|
+
* <Content>This is the content of the aside.</Content>
|
|
134
|
+
* </Aside>
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--aside} for more details.
|
|
110
138
|
*/
|
|
111
139
|
export const Aside = ({
|
|
112
140
|
children,
|
|
113
141
|
title,
|
|
114
142
|
icon,
|
|
115
|
-
iconBg,
|
|
116
|
-
iconColor,
|
|
117
|
-
rtlFlip,
|
|
118
143
|
className,
|
|
119
144
|
bodyClassName,
|
|
120
145
|
headerClassName,
|
|
@@ -197,7 +222,7 @@ export const Aside = ({
|
|
|
197
222
|
|
|
198
223
|
return (
|
|
199
224
|
<aside
|
|
200
|
-
className={classNames(
|
|
225
|
+
className={classNames("fabric-aside", className, "overflow-hidden grid")}
|
|
201
226
|
data-align={align}
|
|
202
227
|
data-flyout={peek}
|
|
203
228
|
data-loading={loading}
|
|
@@ -208,16 +233,16 @@ export const Aside = ({
|
|
|
208
233
|
>
|
|
209
234
|
<header
|
|
210
235
|
className={classNames(
|
|
211
|
-
|
|
236
|
+
"fabric-asideHeader",
|
|
212
237
|
headerClassName,
|
|
213
238
|
"grid area-head items-center",
|
|
214
239
|
)}
|
|
215
|
-
data-
|
|
240
|
+
data-ref="asideHeader"
|
|
216
241
|
>
|
|
217
242
|
{title && (
|
|
218
243
|
<div
|
|
219
244
|
className={classNames(
|
|
220
|
-
|
|
245
|
+
"fabric-asideTitle",
|
|
221
246
|
"truncate py-0.5 px-1 select-none pointer-events-none",
|
|
222
247
|
)}
|
|
223
248
|
>
|
|
@@ -227,8 +252,8 @@ export const Aside = ({
|
|
|
227
252
|
{collapsable && (
|
|
228
253
|
<Icon
|
|
229
254
|
aria-label={isCollapsed ? "expand" : "collapse"}
|
|
230
|
-
className={classNames(
|
|
231
|
-
icon=
|
|
255
|
+
className={classNames("fabric-asideCollapse", "p-2 select-none")}
|
|
256
|
+
icon="icon-[mdi--chevron-left]"
|
|
232
257
|
rtlFlip
|
|
233
258
|
onClick={toggleCollapse}
|
|
234
259
|
data-ref="asideToggle"
|
|
@@ -236,37 +261,33 @@ export const Aside = ({
|
|
|
236
261
|
)}
|
|
237
262
|
{icon && (
|
|
238
263
|
<Icon
|
|
239
|
-
icon={icon}
|
|
240
|
-
bg={iconBg}
|
|
241
|
-
color={iconColor}
|
|
242
|
-
rtlFlip={rtlFlip}
|
|
243
264
|
className={classNames(
|
|
244
|
-
|
|
265
|
+
"fabric-asideIcon",
|
|
245
266
|
"p-1 text-lg select-none pointer-events-none",
|
|
246
267
|
)}
|
|
268
|
+
{...getIconProps(icon)}
|
|
247
269
|
/>
|
|
248
270
|
)}
|
|
249
|
-
{actions && <div className={
|
|
271
|
+
{actions && <div className={"fabric-asideActions"}>{actions}</div>}
|
|
250
272
|
</header>
|
|
251
|
-
{loading && <
|
|
273
|
+
{loading && <LoadingLine />}
|
|
252
274
|
{isCollapsed && (
|
|
253
275
|
<div
|
|
254
276
|
role="none"
|
|
255
277
|
onClick={tryPeek}
|
|
256
278
|
data-ref="asidePlaceholder"
|
|
257
|
-
className={
|
|
279
|
+
className={"fabric-asidePlaceholder"}
|
|
258
280
|
/>
|
|
259
281
|
)}
|
|
260
282
|
<section
|
|
261
283
|
ref={elementRef}
|
|
262
284
|
data-ref="asideBody"
|
|
263
285
|
className={classNames(
|
|
264
|
-
|
|
286
|
+
"fabric-asideBody",
|
|
265
287
|
bodyClassName,
|
|
266
288
|
"overflow-hidden grid",
|
|
267
289
|
)}
|
|
268
290
|
style={isCollapsed ? widthStyles : undefined}
|
|
269
|
-
data-testid="aside-body"
|
|
270
291
|
>
|
|
271
292
|
<ErrorBoundary>{children}</ErrorBoundary>
|
|
272
293
|
</section>
|
|
@@ -274,8 +295,8 @@ export const Aside = ({
|
|
|
274
295
|
<div
|
|
275
296
|
{...resizeHandleProps}
|
|
276
297
|
className={classNames(
|
|
277
|
-
|
|
278
|
-
"before:absolute before:inset-0 before:w-1 before:top-1/2 before:-translate-y-1/2 before:transition-all",
|
|
298
|
+
"fabric-asideResizer",
|
|
299
|
+
"before:absolute before:inset-0 before:w-1 before:top-1/2 before:-translate-y-1/2 before:transition-all before:delay-150",
|
|
279
300
|
)}
|
|
280
301
|
/>
|
|
281
302
|
)}
|
|
@@ -29,7 +29,6 @@ import { Fragment } from "react/jsx-runtime";
|
|
|
29
29
|
import { useMemoDebugger } from "../../hooks/useEffectDebugger";
|
|
30
30
|
import { usePropToggle } from "../../hooks/usePropToggle";
|
|
31
31
|
import { type ChildrenProp } from "../../types";
|
|
32
|
-
import classes from "./ErrorBoundary.module.css";
|
|
33
32
|
import { ErrorIcon } from "./ErrorIcon";
|
|
34
33
|
import { useGlobals } from "../../context/Global";
|
|
35
34
|
|
|
@@ -53,7 +52,7 @@ const ErrorMessage = ({ error, errorElement }: KeyValue) => {
|
|
|
53
52
|
return (
|
|
54
53
|
<Fragment>
|
|
55
54
|
<ErrorIcon />
|
|
56
|
-
<div className={classNames(
|
|
55
|
+
<div className={classNames("fabric-boundaryMessage", "p-2")}>
|
|
57
56
|
<EE error={error} />
|
|
58
57
|
</div>
|
|
59
58
|
</Fragment>
|
|
@@ -64,10 +63,12 @@ const ErrorStack = ({ error, stack }: KeyValue) => {
|
|
|
64
63
|
const [show, toggleShow] = usePropToggle(false);
|
|
65
64
|
useLogger().error(error, {}, stack);
|
|
66
65
|
return (
|
|
67
|
-
<div
|
|
66
|
+
<div
|
|
67
|
+
className={classNames("fabric-boundaryDetail", "overflow-hidden grid")}
|
|
68
|
+
>
|
|
68
69
|
<div
|
|
69
70
|
className={classNames(
|
|
70
|
-
|
|
71
|
+
"fabric-boundaryLink",
|
|
71
72
|
"px-2 py-1 text-xs text-end",
|
|
72
73
|
)}
|
|
73
74
|
>
|
|
@@ -78,7 +79,7 @@ const ErrorStack = ({ error, stack }: KeyValue) => {
|
|
|
78
79
|
{show && (
|
|
79
80
|
<div
|
|
80
81
|
className={classNames(
|
|
81
|
-
|
|
82
|
+
"fabric-boundaryStack",
|
|
82
83
|
"overflow-auto p-2 text-xs border-t",
|
|
83
84
|
)}
|
|
84
85
|
>
|
|
@@ -90,7 +91,23 @@ const ErrorStack = ({ error, stack }: KeyValue) => {
|
|
|
90
91
|
};
|
|
91
92
|
|
|
92
93
|
/**
|
|
93
|
-
*
|
|
94
|
+
* ErrorBoundary component to catch JavaScript errors anywhere in the child component tree,
|
|
95
|
+
* log those errors, and display a fallback UI.
|
|
96
|
+
* It can also display a custom error element if provided.
|
|
97
|
+
* This component is useful for preventing the entire application from crashing
|
|
98
|
+
* when an error occurs in a part of the component tree.
|
|
99
|
+
* It can be used to wrap any part of the application.
|
|
100
|
+
* It supports custom error display components and provides a default error message.
|
|
101
|
+
* It also conditionally displays the error stack trace in development mode.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```jsx
|
|
105
|
+
* <ErrorBoundary errorElement={CustomErrorComponent}>
|
|
106
|
+
* <YourComponent />
|
|
107
|
+
* </ErrorBoundary>
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--error-boundary}
|
|
94
111
|
*/
|
|
95
112
|
export class ErrorBoundary extends Component<
|
|
96
113
|
{
|
|
@@ -114,6 +131,7 @@ export class ErrorBoundary extends Component<
|
|
|
114
131
|
this.setState({ hasError: true, error: error.message, stack: error.stack });
|
|
115
132
|
}
|
|
116
133
|
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
117
135
|
render() {
|
|
118
136
|
const env = process.env.NODE_ENV;
|
|
119
137
|
if (this.state.hasError) {
|
|
@@ -122,13 +140,13 @@ export class ErrorBoundary extends Component<
|
|
|
122
140
|
return (
|
|
123
141
|
<div
|
|
124
142
|
className={classNames(
|
|
125
|
-
|
|
143
|
+
"fabric-errorBoundary",
|
|
126
144
|
"grid grid-rows-1 overflow-hidden p-0.5 rounded-capped",
|
|
127
145
|
)}
|
|
128
146
|
>
|
|
129
147
|
<div
|
|
130
148
|
className={classNames(
|
|
131
|
-
|
|
149
|
+
"fabric-boundaryContent",
|
|
132
150
|
"overflow-hidden grid rounded-capped",
|
|
133
151
|
)}
|
|
134
152
|
>
|
|
@@ -22,13 +22,12 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import classNames from "classnames";
|
|
25
|
-
import classes from "./ErrorBoundary.module.css";
|
|
26
25
|
|
|
27
26
|
export const ErrorIcon = () => (
|
|
28
27
|
<svg
|
|
29
28
|
xmlns="http://www.w3.org/2000/svg"
|
|
30
29
|
viewBox="0 0 64 64"
|
|
31
|
-
className={classNames(
|
|
30
|
+
className={classNames("fabric-boundaryIcon", "size-6 m-2")}
|
|
32
31
|
>
|
|
33
32
|
<path
|
|
34
33
|
fill="#808080"
|
|
@@ -34,7 +34,6 @@ import {
|
|
|
34
34
|
type TestProps,
|
|
35
35
|
} from "../../types";
|
|
36
36
|
import { ErrorBoundary } from "../boundary/ErrorBoundary";
|
|
37
|
-
import classes from "./Content.module.css";
|
|
38
37
|
|
|
39
38
|
export interface ContentProps
|
|
40
39
|
extends ChildrenProp,
|
|
@@ -52,7 +51,12 @@ export interface ContentProps
|
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
/**
|
|
55
|
-
*
|
|
54
|
+
* Content component that wraps children in a section element.
|
|
55
|
+
* It uses a resize observer to handle resizing and a debounced scroll handler.
|
|
56
|
+
* It also includes an error boundary to catch any errors in the children.
|
|
57
|
+
*
|
|
58
|
+
* @param {ContentProps} props - The properties for the Content component.
|
|
59
|
+
* @returns A section element containing the children wrapped in an error boundary.
|
|
56
60
|
*/
|
|
57
61
|
export const Content = ({
|
|
58
62
|
ref,
|
|
@@ -89,7 +93,7 @@ export const Content = ({
|
|
|
89
93
|
data-test-value={testValue}
|
|
90
94
|
ref={resizeHandle}
|
|
91
95
|
onScroll={scrollHandler}
|
|
92
|
-
className={classNames(
|
|
96
|
+
className={classNames("fabric-content", "area-content", className)}
|
|
93
97
|
>
|
|
94
98
|
<ErrorBoundary>{children}</ErrorBoundary>
|
|
95
99
|
</section>
|
|
@@ -22,27 +22,15 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import classNames from "classnames";
|
|
25
|
-
import { useMemoDebugger } from "../../hooks/useEffectDebugger";
|
|
26
25
|
import {
|
|
27
26
|
type AriaProps,
|
|
28
27
|
type ChildrenProp,
|
|
29
|
-
type ColorWithGrays,
|
|
30
28
|
type CssProp,
|
|
31
29
|
type TestProps,
|
|
32
30
|
} from "../../types";
|
|
33
|
-
import { getBgClass, getColor, getColorClass } from "../../utils";
|
|
34
|
-
import classes from "./HeadFoot.module.css";
|
|
35
31
|
|
|
36
32
|
interface BaseProps extends CssProp, AriaProps, ChildrenProp, TestProps {
|
|
37
33
|
dir?: "ltr" | "rtl";
|
|
38
|
-
/**
|
|
39
|
-
* background color
|
|
40
|
-
*/
|
|
41
|
-
bg?: ColorWithGrays | string;
|
|
42
|
-
/**
|
|
43
|
-
* background color
|
|
44
|
-
*/
|
|
45
|
-
color?: ColorWithGrays | string;
|
|
46
34
|
}
|
|
47
35
|
|
|
48
36
|
type DefaultProps = BaseProps & { flex?: false };
|
|
@@ -58,8 +46,6 @@ const HeadFoot = ({
|
|
|
58
46
|
as: E,
|
|
59
47
|
children,
|
|
60
48
|
className,
|
|
61
|
-
bg,
|
|
62
|
-
color,
|
|
63
49
|
flex,
|
|
64
50
|
area,
|
|
65
51
|
dir,
|
|
@@ -67,37 +53,18 @@ const HeadFoot = ({
|
|
|
67
53
|
justify = "start",
|
|
68
54
|
...aria
|
|
69
55
|
}: KeyValue & { as: "header" | "footer" }) => {
|
|
70
|
-
/** ***************** style map *******************/
|
|
71
|
-
const styles = useMemoDebugger(
|
|
72
|
-
() => {
|
|
73
|
-
const s: KeyValue = {};
|
|
74
|
-
if (bg) {
|
|
75
|
-
s.backgroundColor = getColor(bg);
|
|
76
|
-
}
|
|
77
|
-
if (color) {
|
|
78
|
-
s.color = getColor(color);
|
|
79
|
-
}
|
|
80
|
-
return s;
|
|
81
|
-
},
|
|
82
|
-
[bg],
|
|
83
|
-
"HeadFoot styles",
|
|
84
|
-
);
|
|
85
|
-
|
|
86
56
|
return (
|
|
87
57
|
<E
|
|
88
58
|
dir={dir}
|
|
89
59
|
className={classNames(
|
|
90
|
-
|
|
60
|
+
"fabric-headfoot",
|
|
91
61
|
className,
|
|
92
|
-
bg && getBgClass(bg),
|
|
93
|
-
color && getColorClass(color),
|
|
94
62
|
area === "head" ? "area-head" : "area-foot",
|
|
95
63
|
`leading-none`,
|
|
96
|
-
flex && "flex flex-nowrap
|
|
64
|
+
flex && "flex flex-nowrap",
|
|
97
65
|
align && `items-${align}`,
|
|
98
66
|
justify && `justify-${justify}`,
|
|
99
67
|
)}
|
|
100
|
-
style={styles}
|
|
101
68
|
{...aria}
|
|
102
69
|
>
|
|
103
70
|
{children}
|
|
@@ -105,10 +72,50 @@ const HeadFoot = ({
|
|
|
105
72
|
);
|
|
106
73
|
};
|
|
107
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Header component that wraps children in a header element.
|
|
77
|
+
* It uses the HeadFoot component to handle layout and styling.
|
|
78
|
+
* It accepts properties for direction, alignment, and justification,
|
|
79
|
+
* allowing for flexible layout configurations.
|
|
80
|
+
* The `as` prop is set to "header" to render the element as a header.
|
|
81
|
+
* The `area` prop is set to "head" to indicate that this is a header area.
|
|
82
|
+
* It can be used to create a consistent header layout across an application.
|
|
83
|
+
*
|
|
84
|
+
* @param {HeadFootProps} props - The properties for the Header component.
|
|
85
|
+
* @returns A header element containing the children wrapped in the HeadFoot component.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```jsx
|
|
89
|
+
* <Header className="custom-header" dir="ltr">
|
|
90
|
+
* <h1>Header content goes here</h1>
|
|
91
|
+
* </Header>
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
108
94
|
export const Header = (props: HeadFootProps) => (
|
|
109
|
-
<HeadFoot as="header" area="head" {...props} />
|
|
95
|
+
<HeadFoot as="header" area="head" data-ref="header" {...props} />
|
|
110
96
|
);
|
|
111
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Footer component that wraps children in a footer element.
|
|
100
|
+
* It uses the HeadFoot component to handle layout and styling.
|
|
101
|
+
* It accepts properties for direction, alignment, and justification,
|
|
102
|
+
* allowing for flexible layout configurations.
|
|
103
|
+
* The `as` prop is set to "footer" to render the element as a footer.
|
|
104
|
+
* The `area` prop is set to "foot" to indicate that this is a footer area.
|
|
105
|
+
* It can be used to create a consistent footer layout across an application.
|
|
106
|
+
* * The Footer component is designed to be flexible and can be styled with custom classes.
|
|
107
|
+
* It supports both default and flex layouts, allowing for alignment and justification of its children.
|
|
108
|
+
*
|
|
109
|
+
* @param {HeadFootProps} props - The properties for the Footer component.
|
|
110
|
+
* @returns A footer element containing the children wrapped in the HeadFoot component.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```jsx
|
|
114
|
+
* <Footer className="custom-footer" dir="ltr">
|
|
115
|
+
* <p>Footer content goes here</p>
|
|
116
|
+
* </Footer>
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
112
119
|
export const Footer = (props: HeadFootProps) => (
|
|
113
|
-
<HeadFoot as="footer" area="foot" {...props} />
|
|
120
|
+
<HeadFoot as="footer" area="foot" data-ref="footer" {...props} />
|
|
114
121
|
);
|