@react-fabric/core 1.0.0-beta.6 → 1.0.0-beta.60
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} +77 -83
- 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} +11 -8
- 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 +7 -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 +110 -23
- 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 +50 -28
- 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 +44 -4
- 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 +30 -5
- 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 +1 -1
- 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 +172 -75
- package/dist/cjs/components/menu/ContextMenu.js +19 -0
- package/dist/cjs/components/menu/Menu.js +76 -21
- package/dist/cjs/components/menu/MenuItem.js +54 -26
- package/dist/cjs/components/meter/Meter.js +26 -3
- package/dist/cjs/components/navigator/Navigator.js +48 -15
- package/dist/cjs/components/panel/Panel.js +53 -22
- 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 -15
- 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 +48 -22
- 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 +40 -39
- 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 +75 -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 +11 -2
- package/dist/cjs/overlays/alert/Alert.js +23 -15
- package/dist/cjs/overlays/flyout/Flyout.js +48 -64
- package/dist/cjs/overlays/message/Message.js +8 -3
- package/dist/cjs/overlays/modal/Modal.js +17 -20
- package/dist/cjs/overlays/toast/Toast.js +20 -10
- package/dist/cjs/overlays/tooltip/Tooltip.js +24 -11
- package/dist/cjs/types/icons.js +17 -4
- package/dist/cjs/typography/Abbr.js +35 -7
- package/dist/cjs/typography/{Link.js → Anchor.js} +23 -5
- 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 +111 -24
- 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 +52 -30
- 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 +44 -4
- 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 +30 -5
- 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 +1 -1
- 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 +173 -76
- package/dist/esm/components/menu/ContextMenu.js +19 -0
- package/dist/esm/components/menu/Menu.js +78 -23
- package/dist/esm/components/menu/MenuItem.js +49 -21
- package/dist/esm/components/meter/Meter.js +26 -3
- package/dist/esm/components/navigator/Navigator.js +48 -15
- package/dist/esm/components/panel/Panel.js +54 -23
- 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 -16
- 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 +49 -23
- 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 +41 -40
- 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 +75 -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 +6 -2
- package/dist/esm/overlays/alert/Alert.js +24 -16
- package/dist/esm/overlays/flyout/Flyout.js +52 -68
- package/dist/esm/overlays/message/Message.js +9 -4
- package/dist/esm/overlays/modal/Modal.js +19 -22
- package/dist/esm/overlays/toast/Toast.js +21 -11
- package/dist/esm/overlays/tooltip/Tooltip.js +24 -11
- package/dist/esm/types/icons.js +17 -4
- package/dist/esm/typography/Abbr.js +35 -7
- package/dist/esm/typography/{Link.js → Anchor.js} +24 -6
- 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 +84 -5
- 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 -0
- 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/icons.d.ts +17 -3
- package/dist/types/types/index.d.ts +20 -22
- 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 +14 -16
- package/src/components/actionLabel/ActionLabel.tsx +26 -8
- package/src/components/animations/Animations.tsx +115 -36
- 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 +74 -42
- 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 +55 -12
- 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 +33 -8
- package/src/components/divider/Divider.tsx +42 -16
- package/src/components/dropdown/Dropdown.tsx +47 -12
- package/src/components/dropdown/DropdownTool.tsx +27 -2
- package/src/components/empty/EmptyContent.tsx +49 -8
- package/src/components/icon/Icon.tsx +96 -18
- package/src/components/index.ts +3 -2
- package/src/components/media/Media.tsx +193 -104
- package/src/components/menu/ContextMenu.tsx +19 -0
- package/src/components/menu/Menu.tsx +87 -30
- 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 +58 -9
- package/src/components/panel/Panel.tsx +53 -21
- 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 +56 -34
- 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 +42 -20
- 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 -0
- package/src/overlays/alert/Alert.tsx +50 -34
- package/src/overlays/flyout/Flyout.tsx +73 -97
- package/src/overlays/message/Message.tsx +28 -9
- package/src/overlays/modal/Modal.tsx +36 -30
- package/src/overlays/toast/Toast.tsx +42 -30
- package/src/overlays/tooltip/Tooltip.tsx +43 -18
- package/src/types/global.d.ts +8 -0
- package/src/types/icons.ts +32 -6
- package/src/types/index.ts +261 -45
- package/src/typography/Abbr.tsx +45 -11
- package/src/typography/{Link.tsx → Anchor.tsx} +26 -14
- package/src/typography/Copy.tsx +15 -0
- 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/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
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
var utilities = require('@react-fabric/utilities');
|
|
4
4
|
var classNames = require('classnames');
|
|
5
5
|
var useEffectDebugger = require('../../hooks/useEffectDebugger.js');
|
|
6
|
-
|
|
6
|
+
require('react');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
var getColor = require('../../utils/getColor.js');
|
|
8
9
|
|
|
9
10
|
/*
|
|
10
11
|
* React Fabric
|
|
@@ -36,30 +37,51 @@ var SizeMap = {
|
|
|
36
37
|
lg: "1.5rem",
|
|
37
38
|
xl: "2rem"
|
|
38
39
|
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A circular progress indicator that visually represents a percentage of completion.
|
|
43
|
+
* It displays a circular track with a stroke that fills based on the `value` prop.
|
|
44
|
+
* The component is customizable with size and color props.
|
|
45
|
+
*
|
|
46
|
+
* @param {ProgressProps} props - The properties for the ProgressCircle component.
|
|
47
|
+
* @returns {JSX.Element} - A circular progress indicator.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```jsx
|
|
51
|
+
* <ProgressCircle value={0.75} size="md" color="primary-500" />
|
|
52
|
+
* // Renders a circular progress indicator with 75% completion, medium size, and primary color.
|
|
53
|
+
*
|
|
54
|
+
* <ProgressCircle value={0.5} size="lg" color="secondary-500" />
|
|
55
|
+
* // Renders a circular progress indicator with 50% completion, large size, and secondary color.
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-progress--docs} for more details.
|
|
59
|
+
*/
|
|
39
60
|
var ProgressCircle = function ProgressCircle(_ref) {
|
|
40
61
|
var _ref$value = _ref.value,
|
|
41
62
|
value = _ref$value === void 0 ? 0 : _ref$value,
|
|
42
63
|
_ref$size = _ref.size,
|
|
43
64
|
size = _ref$size === void 0 ? "sm" : _ref$size,
|
|
44
65
|
_ref$color = _ref.color,
|
|
45
|
-
color = _ref$color === void 0 ? "primary" : _ref$color;
|
|
66
|
+
color = _ref$color === void 0 ? "primary-500" : _ref$color;
|
|
46
67
|
/** ***************** make sure value is between 0 and 100 *******************/
|
|
47
68
|
var actualValue = useEffectDebugger.useMemoDebugger(function () {
|
|
48
|
-
return Math.min(Math.max(value, 0),
|
|
69
|
+
return Math.min(Math.max(value, 0), 1);
|
|
49
70
|
}, [value], "ProgressCirle value");
|
|
50
71
|
|
|
51
72
|
/** ***************** calculate stroke offset by actual value *******************/
|
|
52
73
|
var strokeDashoffset = useEffectDebugger.useMemoDebugger(function () {
|
|
53
74
|
var circumfrence = Math.PI * 2 * 44;
|
|
54
|
-
return circumfrence * (1 - actualValue
|
|
75
|
+
return circumfrence * (1 - actualValue);
|
|
55
76
|
}, [actualValue], "ProgressCirle dashOffset");
|
|
56
77
|
|
|
57
78
|
/** ***************** component *******************/
|
|
58
79
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
59
|
-
className: classNames("inline-block w-[4em] h-[4em] text-lg relative"
|
|
80
|
+
className: classNames("inline-block w-[4em] h-[4em] text-lg relative"),
|
|
60
81
|
"aria-hidden": "true",
|
|
61
82
|
style: {
|
|
62
|
-
fontSize: SizeMap[size]
|
|
83
|
+
fontSize: SizeMap[size],
|
|
84
|
+
color: getColor.getColor(color)
|
|
63
85
|
},
|
|
64
86
|
children: [/*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
65
87
|
viewBox: "0 0 100 100",
|
|
@@ -88,7 +110,7 @@ var ProgressCircle = function ProgressCircle(_ref) {
|
|
|
88
110
|
})]
|
|
89
111
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
90
112
|
className: "flex w-full h-full items-center justify-center select-none font-bold text-[0.625em]",
|
|
91
|
-
children: utilities.Format.percent(actualValue
|
|
113
|
+
children: utilities.Format.percent(actualValue)
|
|
92
114
|
})]
|
|
93
115
|
});
|
|
94
116
|
};
|
|
@@ -16,11 +16,39 @@ var Badge = require('../badge/Badge.js');
|
|
|
16
16
|
var Icon = require('../icon/Icon.js');
|
|
17
17
|
require('../../types/icons.js');
|
|
18
18
|
var DropdownTool = require('../dropdown/DropdownTool.js');
|
|
19
|
-
var TabPanel_module = require('./TabPanel.module.css');
|
|
20
19
|
|
|
21
|
-
var _excluded = ["ref", "as", "id", "className", "label", "icon", "
|
|
20
|
+
var _excluded = ["ref", "as", "id", "className", "label", "icon", "badge", "disabled", "onClose", "active", "onClick", "tabFlex", "color", "actions", "tooltip", "activeClassName"];
|
|
22
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; }
|
|
23
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
|
+
* badge="New"
|
|
38
|
+
* onClick={(id) => console.log(`Tab clicked: ${id}`)}
|
|
39
|
+
* onClose={() => console.log("Tab closed")}
|
|
40
|
+
* active={true}
|
|
41
|
+
* actions={<button>Action</button>}
|
|
42
|
+
* color="primary"
|
|
43
|
+
* tooltip="This is a tab"
|
|
44
|
+
* activeClassName="bg-blue-100"
|
|
45
|
+
* />
|
|
46
|
+
* // Renders a tab with label "Tab 1", home icon, blue background, white text, badge "New",
|
|
47
|
+
* // and an action button. The tab is active and has a tooltip.
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-tabpanel--docs} for more details.
|
|
51
|
+
*/
|
|
24
52
|
var Tab = function Tab(_ref) {
|
|
25
53
|
var ref = _ref.ref,
|
|
26
54
|
as = _ref.as,
|
|
@@ -28,14 +56,10 @@ var Tab = function Tab(_ref) {
|
|
|
28
56
|
className = _ref.className,
|
|
29
57
|
label = _ref.label,
|
|
30
58
|
icon = _ref.icon,
|
|
31
|
-
iconBg = _ref.iconBg,
|
|
32
|
-
iconColor = _ref.iconColor,
|
|
33
|
-
rtlFlip = _ref.rtlFlip,
|
|
34
59
|
badge = _ref.badge,
|
|
35
60
|
disabled = _ref.disabled,
|
|
36
61
|
onClose = _ref.onClose,
|
|
37
62
|
active = _ref.active,
|
|
38
|
-
minimal = _ref.minimal,
|
|
39
63
|
_onClick = _ref.onClick,
|
|
40
64
|
tabFlex = _ref.tabFlex,
|
|
41
65
|
color = _ref.color,
|
|
@@ -46,6 +70,9 @@ var Tab = function Tab(_ref) {
|
|
|
46
70
|
var badgeProps = react.useMemo(function () {
|
|
47
71
|
return Badge.getBadgeProps(badge);
|
|
48
72
|
}, [badge]);
|
|
73
|
+
var minimal = react.useMemo(function () {
|
|
74
|
+
return !label;
|
|
75
|
+
}, [label]);
|
|
49
76
|
var tooltipProps = react.useMemo(function () {
|
|
50
77
|
if (utilities.isString(tooltip)) return {
|
|
51
78
|
content: tooltip
|
|
@@ -59,26 +86,23 @@ var Tab = function Tab(_ref) {
|
|
|
59
86
|
"data-id": id,
|
|
60
87
|
disabled: disabled,
|
|
61
88
|
"data-color": color,
|
|
62
|
-
|
|
89
|
+
"data-inner-clickable": true,
|
|
90
|
+
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 rounded" : "rounded-capped", "flex items-center justify-center overflow-hidden cursor-pointer"),
|
|
63
91
|
onClick: function onClick() {
|
|
64
92
|
return !active && (_onClick === null || _onClick === void 0 ? void 0 : _onClick(id));
|
|
65
93
|
},
|
|
66
94
|
ref: ref
|
|
67
95
|
}, aria), {}, {
|
|
68
|
-
children: [icon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
color: iconColor,
|
|
72
|
-
rtlFlip: rtlFlip,
|
|
73
|
-
className: "flex-content"
|
|
74
|
-
}), !minimal && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
96
|
+
children: [icon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, _objectSpread({
|
|
97
|
+
className: "flex-content p-2"
|
|
98
|
+
}, Icon.getIconProps(icon))), !minimal && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
75
99
|
className: "flex-initial truncate text-center px-1 py-1",
|
|
76
100
|
children: label
|
|
77
101
|
}), badge && /*#__PURE__*/jsxRuntime.jsx(Badge.Badge, _objectSpread(_objectSpread({}, badgeProps), {}, {
|
|
78
102
|
placement: minimal ? "end" : "",
|
|
79
103
|
className: classNames("me-1", badgeProps.className)
|
|
80
104
|
})), actions && active && /*#__PURE__*/jsxRuntime.jsx(DropdownTool.DropdownTool, {
|
|
81
|
-
className: "bg-
|
|
105
|
+
className: "bg-tint-50/20 me-1 z-5",
|
|
82
106
|
children: actions
|
|
83
107
|
}), onClose && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
84
108
|
role: "none",
|
|
@@ -3,23 +3,59 @@
|
|
|
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,
|
|
17
49
|
_ref$orientation = _ref.orientation,
|
|
18
50
|
orientation = _ref$orientation === void 0 ? "top" : _ref$orientation,
|
|
19
51
|
activeTab = _ref.activeTab,
|
|
52
|
+
activeClassName = _ref.activeClassName,
|
|
20
53
|
justify = _ref.justify,
|
|
21
54
|
variant = _ref.variant,
|
|
22
55
|
tabFlex = _ref.tabFlex,
|
|
56
|
+
append = _ref.append,
|
|
57
|
+
prepend = _ref.prepend,
|
|
58
|
+
tabRotate = _ref.tabRotate,
|
|
23
59
|
gap = _ref.gap,
|
|
24
60
|
onBeforeChange = _ref.onBeforeChange,
|
|
25
61
|
onChange = _ref.onChange;
|
|
@@ -54,22 +90,26 @@ var TabPanel = function TabPanel(_ref) {
|
|
|
54
90
|
});
|
|
55
91
|
}, [onBeforeChange, onChange, active]);
|
|
56
92
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
57
|
-
className: classNames(
|
|
93
|
+
className: classNames("fabric-tabPanel", "area-content grid bg-base overflow-hidden"),
|
|
58
94
|
"data-orientation": orientation,
|
|
59
95
|
"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
|
-
|
|
96
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
97
|
+
className: classNames("fabric-tabHeader", headerClassName, tabRotate && "tab-rotate", justify && "justify-".concat(justify), ["start", "end"].includes(orientation) && "flex-col", "flex flex-nowrap overflow-hidden items-center"),
|
|
98
|
+
children: [prepend, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
99
|
+
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"),
|
|
100
|
+
style: {
|
|
101
|
+
gap: gap
|
|
102
|
+
},
|
|
103
|
+
children: tabs.map(function (node) {
|
|
104
|
+
var _node$props$tabFlex, _node$props$activeCla;
|
|
105
|
+
return /*#__PURE__*/react.cloneElement(node, {
|
|
106
|
+
tabFlex: (_node$props$tabFlex = node.props.tabFlex) !== null && _node$props$tabFlex !== void 0 ? _node$props$tabFlex : tabFlex,
|
|
107
|
+
activeClassName: (_node$props$activeCla = node.props.activeClassName) !== null && _node$props$activeCla !== void 0 ? _node$props$activeCla : activeClassName,
|
|
108
|
+
onClick: handleClick,
|
|
109
|
+
active: node.props.id === active
|
|
110
|
+
});
|
|
111
|
+
})
|
|
112
|
+
}), append]
|
|
73
113
|
}), rest, activeTabPanel]
|
|
74
114
|
});
|
|
75
115
|
};
|
|
@@ -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,21 +11,52 @@ 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
|
+
* rtlFlip={true}
|
|
32
|
+
* className="custom-aside"
|
|
33
|
+
* bodyClassName="custom-aside-body"
|
|
34
|
+
* headerClassName="custom-aside-header"
|
|
35
|
+
* resizeable={true}
|
|
36
|
+
* flyout={true}
|
|
37
|
+
* onFlyout={() => console.log("Flyout triggered")}
|
|
38
|
+
* collapsed={false}
|
|
39
|
+
* collapsable={true}
|
|
40
|
+
* onCollapse={() => console.log("Collapsed toggled")}
|
|
41
|
+
* actions={<button>Action</button>}
|
|
42
|
+
* loading={false}
|
|
43
|
+
* align="start"
|
|
44
|
+
* width="20rem"
|
|
45
|
+
* minWidth="2rem"
|
|
46
|
+
* maxWidth="30vw"
|
|
47
|
+
* data-testid="aside-test"
|
|
48
|
+
* data-test-value="aside-value"
|
|
49
|
+
* >
|
|
50
|
+
* <Content>This is the content of the aside.</Content>
|
|
51
|
+
* </Aside>
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--aside} for more details.
|
|
21
55
|
*/
|
|
22
56
|
var Aside = function Aside(_ref) {
|
|
23
57
|
var children = _ref.children,
|
|
24
58
|
title = _ref.title,
|
|
25
59
|
icon = _ref.icon,
|
|
26
|
-
iconBg = _ref.iconBg,
|
|
27
|
-
iconColor = _ref.iconColor,
|
|
28
|
-
rtlFlip = _ref.rtlFlip,
|
|
29
60
|
className = _ref.className,
|
|
30
61
|
bodyClassName = _ref.bodyClassName,
|
|
31
62
|
headerClassName = _ref.headerClassName,
|
|
@@ -103,7 +134,7 @@ var Aside = function Aside(_ref) {
|
|
|
103
134
|
};
|
|
104
135
|
}, [width, minWidth, maxWidth]);
|
|
105
136
|
return /*#__PURE__*/jsxRuntime.jsxs("aside", {
|
|
106
|
-
className: classNames(
|
|
137
|
+
className: classNames("fabric-aside", className, "overflow-hidden grid"),
|
|
107
138
|
"data-align": align,
|
|
108
139
|
"data-flyout": peek,
|
|
109
140
|
"data-loading": loading,
|
|
@@ -112,44 +143,39 @@ var Aside = function Aside(_ref) {
|
|
|
112
143
|
"data-testid": testId,
|
|
113
144
|
"data-test-value": testValue,
|
|
114
145
|
children: [/*#__PURE__*/jsxRuntime.jsxs("header", {
|
|
115
|
-
className: classNames(
|
|
116
|
-
"data-
|
|
146
|
+
className: classNames("fabric-asideHeader", headerClassName, "grid area-head items-center"),
|
|
147
|
+
"data-ref": "asideHeader",
|
|
117
148
|
children: [title && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
118
|
-
className: classNames(
|
|
149
|
+
className: classNames("fabric-asideTitle", "truncate py-0.5 px-1 select-none pointer-events-none"),
|
|
119
150
|
children: title
|
|
120
151
|
}), collapsable && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
|
|
121
152
|
"aria-label": isCollapsed ? "expand" : "collapse",
|
|
122
|
-
className: classNames(
|
|
153
|
+
className: classNames("fabric-asideCollapse", "p-2 select-none"),
|
|
123
154
|
icon: icons.CoreIcons.chevronLeft,
|
|
124
155
|
rtlFlip: true,
|
|
125
156
|
onClick: toggleCollapse,
|
|
126
157
|
"data-ref": "asideToggle"
|
|
127
|
-
}), icon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
rtlFlip: rtlFlip,
|
|
132
|
-
className: classNames(Aside_module.asideIcon, "p-1 text-lg select-none pointer-events-none")
|
|
133
|
-
}), actions && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
134
|
-
className: Aside_module.asideActions,
|
|
158
|
+
}), icon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, _objectSpread({
|
|
159
|
+
className: classNames("fabric-asideIcon", "p-1 text-lg select-none pointer-events-none")
|
|
160
|
+
}, Icon.getIconProps(icon))), actions && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
161
|
+
className: "fabric-asideActions",
|
|
135
162
|
children: actions
|
|
136
163
|
})]
|
|
137
164
|
}), loading && /*#__PURE__*/jsxRuntime.jsx(Animations.Loading, {}), isCollapsed && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
138
165
|
role: "none",
|
|
139
166
|
onClick: tryPeek,
|
|
140
167
|
"data-ref": "asidePlaceholder",
|
|
141
|
-
className:
|
|
168
|
+
className: "fabric-asidePlaceholder"
|
|
142
169
|
}), /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
143
170
|
ref: elementRef,
|
|
144
171
|
"data-ref": "asideBody",
|
|
145
|
-
className: classNames(
|
|
172
|
+
className: classNames("fabric-asideBody", bodyClassName, "overflow-hidden grid"),
|
|
146
173
|
style: isCollapsed ? widthStyles : undefined,
|
|
147
|
-
"data-testid": "aside-body",
|
|
148
174
|
children: /*#__PURE__*/jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, {
|
|
149
175
|
children: children
|
|
150
176
|
})
|
|
151
177
|
}), resizeable && /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({}, resizeHandleProps), {}, {
|
|
152
|
-
className: classNames(
|
|
178
|
+
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")
|
|
153
179
|
}))]
|
|
154
180
|
});
|
|
155
181
|
};
|
|
@@ -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) {
|
|
@@ -102,6 +117,8 @@ var ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
102
117
|
stack: error.stack
|
|
103
118
|
});
|
|
104
119
|
}
|
|
120
|
+
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
105
122
|
}, {
|
|
106
123
|
key: "render",
|
|
107
124
|
value: function render() {
|
|
@@ -110,9 +127,9 @@ var ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
110
127
|
var E = this.props.errorElement;
|
|
111
128
|
// You can render any custom fallback UI
|
|
112
129
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
113
|
-
className: classNames(
|
|
130
|
+
className: classNames("fabric-errorBoundary", "grid grid-rows-1 overflow-hidden p-0.5 rounded-capped"),
|
|
114
131
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
115
|
-
className: classNames(
|
|
132
|
+
className: classNames("fabric-boundaryContent", "overflow-hidden grid rounded-capped"),
|
|
116
133
|
children: [/*#__PURE__*/jsxRuntime.jsx(ErrorMessage, {
|
|
117
134
|
error: this.state.error,
|
|
118
135
|
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,
|
|
@@ -63,7 +67,7 @@ var Content = function Content(_ref) {
|
|
|
63
67
|
"data-test-value": testValue,
|
|
64
68
|
ref: resizeHandle,
|
|
65
69
|
onScroll: scrollHandler,
|
|
66
|
-
className: classNames(
|
|
70
|
+
className: classNames("fabric-content", "area-content", className),
|
|
67
71
|
children: /*#__PURE__*/jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, {
|
|
68
72
|
children: children
|
|
69
73
|
})
|