@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
|
@@ -13,14 +13,41 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
13
13
|
import '../../hotkeys/HotKeyWrapper.js';
|
|
14
14
|
import { Tooltip } from '../../overlays/tooltip/Tooltip.js';
|
|
15
15
|
import { getBadgeProps, Badge } from '../badge/Badge.js';
|
|
16
|
-
import { Icon } from '../icon/Icon.js';
|
|
17
|
-
import '../../types/icons.js';
|
|
16
|
+
import { Icon, getIconProps } from '../icon/Icon.js';
|
|
18
17
|
import { DropdownTool } from '../dropdown/DropdownTool.js';
|
|
19
|
-
import classes from './TabPanel.module.css';
|
|
20
18
|
|
|
21
|
-
var _excluded = ["ref", "as", "id", "className", "label", "icon", "
|
|
19
|
+
var _excluded = ["ref", "as", "id", "className", "label", "icon", "badge", "disabled", "onClose", "active", "onClick", "tabFlex", "color", "actions", "tooltip", "activeClassName"];
|
|
22
20
|
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
21
|
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; }
|
|
22
|
+
/**
|
|
23
|
+
* A component that represents a tab in a tabbed interface. It can display an icon, label, badge, and actions.
|
|
24
|
+
* It supports polymorphic rendering, allowing it to be rendered as different HTML elements.
|
|
25
|
+
* It also supports tooltips, active states, and click handling.
|
|
26
|
+
*
|
|
27
|
+
* @param {TabProps} props - The properties for the Tab component.
|
|
28
|
+
* @returns {JSX.Element} The rendered Tab component.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```jsx
|
|
32
|
+
* <Tab
|
|
33
|
+
* id="tab1"
|
|
34
|
+
* label="Tab 1"
|
|
35
|
+
* icon="home"
|
|
36
|
+
* badge="New"
|
|
37
|
+
* onClick={(id) => console.log(`Tab clicked: ${id}`)}
|
|
38
|
+
* onClose={() => console.log("Tab closed")}
|
|
39
|
+
* active={true}
|
|
40
|
+
* actions={<button>Action</button>}
|
|
41
|
+
* color="primary"
|
|
42
|
+
* tooltip="This is a tab"
|
|
43
|
+
* activeClassName="bg-blue-100"
|
|
44
|
+
* />
|
|
45
|
+
* // Renders a tab with label "Tab 1", home icon, blue background, white text, badge "New",
|
|
46
|
+
* // and an action button. The tab is active and has a tooltip.
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-tabpanel--docs} for more details.
|
|
50
|
+
*/
|
|
24
51
|
var Tab = function Tab(_ref) {
|
|
25
52
|
var ref = _ref.ref,
|
|
26
53
|
as = _ref.as,
|
|
@@ -28,14 +55,10 @@ var Tab = function Tab(_ref) {
|
|
|
28
55
|
className = _ref.className,
|
|
29
56
|
label = _ref.label,
|
|
30
57
|
icon = _ref.icon,
|
|
31
|
-
iconBg = _ref.iconBg,
|
|
32
|
-
iconColor = _ref.iconColor,
|
|
33
|
-
rtlFlip = _ref.rtlFlip,
|
|
34
58
|
badge = _ref.badge,
|
|
35
59
|
disabled = _ref.disabled,
|
|
36
60
|
onClose = _ref.onClose,
|
|
37
61
|
active = _ref.active,
|
|
38
|
-
minimal = _ref.minimal,
|
|
39
62
|
_onClick = _ref.onClick,
|
|
40
63
|
tabFlex = _ref.tabFlex,
|
|
41
64
|
color = _ref.color,
|
|
@@ -46,6 +69,9 @@ var Tab = function Tab(_ref) {
|
|
|
46
69
|
var badgeProps = useMemo(function () {
|
|
47
70
|
return getBadgeProps(badge);
|
|
48
71
|
}, [badge]);
|
|
72
|
+
var minimal = useMemo(function () {
|
|
73
|
+
return !label;
|
|
74
|
+
}, [label]);
|
|
49
75
|
var tooltipProps = useMemo(function () {
|
|
50
76
|
if (isString(tooltip)) return {
|
|
51
77
|
content: tooltip
|
|
@@ -59,26 +85,23 @@ var Tab = function Tab(_ref) {
|
|
|
59
85
|
"data-id": id,
|
|
60
86
|
disabled: disabled,
|
|
61
87
|
"data-color": color,
|
|
62
|
-
|
|
88
|
+
"data-inner-clickable": true,
|
|
89
|
+
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
90
|
onClick: function onClick() {
|
|
64
91
|
return !active && (_onClick === null || _onClick === void 0 ? void 0 : _onClick(id));
|
|
65
92
|
},
|
|
66
93
|
ref: ref
|
|
67
94
|
}, aria), {}, {
|
|
68
|
-
children: [icon && /*#__PURE__*/jsx(Icon, {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
color: iconColor,
|
|
72
|
-
rtlFlip: rtlFlip,
|
|
73
|
-
className: "flex-content"
|
|
74
|
-
}), !minimal && /*#__PURE__*/jsx("label", {
|
|
95
|
+
children: [icon && /*#__PURE__*/jsx(Icon, _objectSpread({
|
|
96
|
+
className: "flex-content p-2"
|
|
97
|
+
}, getIconProps(icon))), !minimal && /*#__PURE__*/jsx("label", {
|
|
75
98
|
className: "flex-initial truncate text-center px-1 py-1",
|
|
76
99
|
children: label
|
|
77
100
|
}), badge && /*#__PURE__*/jsx(Badge, _objectSpread(_objectSpread({}, badgeProps), {}, {
|
|
78
101
|
placement: minimal ? "end" : "",
|
|
79
102
|
className: classNames("me-1", badgeProps.className)
|
|
80
103
|
})), actions && active && /*#__PURE__*/jsx(DropdownTool, {
|
|
81
|
-
className: "bg-
|
|
104
|
+
className: "bg-tint-50/20 me-1 z-5",
|
|
82
105
|
children: actions
|
|
83
106
|
}), onClose && /*#__PURE__*/jsx("span", {
|
|
84
107
|
role: "none",
|
|
@@ -3,23 +3,59 @@
|
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { useState, useMemo, Children, useEffect, useCallback, cloneElement } from 'react';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
7
|
import '@react-fabric/utilities';
|
|
7
8
|
import { nodeCheck } from '../../utils/nodeCheck.js';
|
|
8
9
|
import { Tab } from './Tab.js';
|
|
9
|
-
import classes from './TabPanel.module.css';
|
|
10
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
11
10
|
|
|
12
11
|
// TODO: implement append/prepend tab-bar items
|
|
13
12
|
|
|
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__*/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__*/
|
|
61
|
-
className: classNames(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
96
|
+
children: [/*#__PURE__*/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__*/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__*/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
|
+
useEffect(function () {
|
|
72
|
+
defaultColorScheme && setColorScheme(defaultColorScheme);
|
|
73
|
+
}, [defaultColorScheme]);
|
|
71
74
|
|
|
72
75
|
/** ***************** set initial theme and locale dir *******************/
|
|
73
76
|
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 = 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 = 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];
|
|
@@ -4,28 +4,58 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { useRef, useState, useEffect, useCallback, useMemo } from 'react';
|
|
7
|
-
import {
|
|
8
|
-
import { Icon } from '../../components/icon/Icon.js';
|
|
7
|
+
import { LoadingLine } from '../../components/animations/Animations.js';
|
|
8
|
+
import { Icon, getIconProps } from '../../components/icon/Icon.js';
|
|
9
9
|
import { useLayoutEffectDebugger } from '../../hooks/useEffectDebugger.js';
|
|
10
10
|
import { usePropToggle } from '../../hooks/usePropToggle.js';
|
|
11
11
|
import { useResize } from '../../hooks/useResize.js';
|
|
12
|
-
import { CoreIcons } from '../../types/icons.js';
|
|
13
12
|
import { ErrorBoundary } from '../boundary/ErrorBoundary.js';
|
|
14
|
-
import classes from './Aside.module.css';
|
|
15
13
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
16
14
|
|
|
17
15
|
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
16
|
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
17
|
/**
|
|
20
|
-
*
|
|
18
|
+
* A sidebar component that can be collapsed, resized, and has a flyout feature.
|
|
19
|
+
* It supports a title, icon, actions, and loading state.
|
|
20
|
+
* It can be aligned to the start or end of the page.
|
|
21
|
+
*
|
|
22
|
+
* @param {AsideProps} props - The properties for the Aside component.
|
|
23
|
+
* @returns {JSX.Element} The rendered Aside component.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```jsx
|
|
27
|
+
* <Aside
|
|
28
|
+
* title="Sidebar Title"
|
|
29
|
+
* icon=icon-[mdi--menu]
|
|
30
|
+
* rtlFlip={true}
|
|
31
|
+
* className="custom-aside"
|
|
32
|
+
* bodyClassName="custom-aside-body"
|
|
33
|
+
* headerClassName="custom-aside-header"
|
|
34
|
+
* resizeable={true}
|
|
35
|
+
* flyout={true}
|
|
36
|
+
* onFlyout={() => console.log("Flyout triggered")}
|
|
37
|
+
* collapsed={false}
|
|
38
|
+
* collapsable={true}
|
|
39
|
+
* onCollapse={() => console.log("Collapsed toggled")}
|
|
40
|
+
* actions={<button>Action</button>}
|
|
41
|
+
* loading={false}
|
|
42
|
+
* align="start"
|
|
43
|
+
* width="20rem"
|
|
44
|
+
* minWidth="2rem"
|
|
45
|
+
* maxWidth="30vw"
|
|
46
|
+
* data-testid="aside-test"
|
|
47
|
+
* data-test-value="aside-value"
|
|
48
|
+
* >
|
|
49
|
+
* <Content>This is the content of the aside.</Content>
|
|
50
|
+
* </Aside>
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--aside} for more details.
|
|
21
54
|
*/
|
|
22
55
|
var Aside = function Aside(_ref) {
|
|
23
56
|
var children = _ref.children,
|
|
24
57
|
title = _ref.title,
|
|
25
58
|
icon = _ref.icon,
|
|
26
|
-
iconBg = _ref.iconBg,
|
|
27
|
-
iconColor = _ref.iconColor,
|
|
28
|
-
rtlFlip = _ref.rtlFlip,
|
|
29
59
|
className = _ref.className,
|
|
30
60
|
bodyClassName = _ref.bodyClassName,
|
|
31
61
|
headerClassName = _ref.headerClassName,
|
|
@@ -103,7 +133,7 @@ var Aside = function Aside(_ref) {
|
|
|
103
133
|
};
|
|
104
134
|
}, [width, minWidth, maxWidth]);
|
|
105
135
|
return /*#__PURE__*/jsxs("aside", {
|
|
106
|
-
className: classNames(
|
|
136
|
+
className: classNames("fabric-aside", className, "overflow-hidden grid"),
|
|
107
137
|
"data-align": align,
|
|
108
138
|
"data-flyout": peek,
|
|
109
139
|
"data-loading": loading,
|
|
@@ -112,44 +142,39 @@ var Aside = function Aside(_ref) {
|
|
|
112
142
|
"data-testid": testId,
|
|
113
143
|
"data-test-value": testValue,
|
|
114
144
|
children: [/*#__PURE__*/jsxs("header", {
|
|
115
|
-
className: classNames(
|
|
116
|
-
"data-
|
|
145
|
+
className: classNames("fabric-asideHeader", headerClassName, "grid area-head items-center"),
|
|
146
|
+
"data-ref": "asideHeader",
|
|
117
147
|
children: [title && /*#__PURE__*/jsx("div", {
|
|
118
|
-
className: classNames(
|
|
148
|
+
className: classNames("fabric-asideTitle", "truncate py-0.5 px-1 select-none pointer-events-none"),
|
|
119
149
|
children: title
|
|
120
150
|
}), collapsable && /*#__PURE__*/jsx(Icon, {
|
|
121
151
|
"aria-label": isCollapsed ? "expand" : "collapse",
|
|
122
|
-
className: classNames(
|
|
123
|
-
icon:
|
|
152
|
+
className: classNames("fabric-asideCollapse", "p-2 select-none"),
|
|
153
|
+
icon: "icon-[mdi--chevron-left]",
|
|
124
154
|
rtlFlip: true,
|
|
125
155
|
onClick: toggleCollapse,
|
|
126
156
|
"data-ref": "asideToggle"
|
|
127
|
-
}), icon && /*#__PURE__*/jsx(Icon, {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
rtlFlip: rtlFlip,
|
|
132
|
-
className: classNames(classes.asideIcon, "p-1 text-lg select-none pointer-events-none")
|
|
133
|
-
}), actions && /*#__PURE__*/jsx("div", {
|
|
134
|
-
className: classes.asideActions,
|
|
157
|
+
}), icon && /*#__PURE__*/jsx(Icon, _objectSpread({
|
|
158
|
+
className: classNames("fabric-asideIcon", "p-1 text-lg select-none pointer-events-none")
|
|
159
|
+
}, getIconProps(icon))), actions && /*#__PURE__*/jsx("div", {
|
|
160
|
+
className: "fabric-asideActions",
|
|
135
161
|
children: actions
|
|
136
162
|
})]
|
|
137
|
-
}), loading && /*#__PURE__*/jsx(
|
|
163
|
+
}), loading && /*#__PURE__*/jsx(LoadingLine, {}), isCollapsed && /*#__PURE__*/jsx("div", {
|
|
138
164
|
role: "none",
|
|
139
165
|
onClick: tryPeek,
|
|
140
166
|
"data-ref": "asidePlaceholder",
|
|
141
|
-
className:
|
|
167
|
+
className: "fabric-asidePlaceholder"
|
|
142
168
|
}), /*#__PURE__*/jsx("section", {
|
|
143
169
|
ref: elementRef,
|
|
144
170
|
"data-ref": "asideBody",
|
|
145
|
-
className: classNames(
|
|
171
|
+
className: classNames("fabric-asideBody", bodyClassName, "overflow-hidden grid"),
|
|
146
172
|
style: isCollapsed ? widthStyles : undefined,
|
|
147
|
-
"data-testid": "aside-body",
|
|
148
173
|
children: /*#__PURE__*/jsx(ErrorBoundary, {
|
|
149
174
|
children: children
|
|
150
175
|
})
|
|
151
176
|
}), resizeable && /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({}, resizeHandleProps), {}, {
|
|
152
|
-
className: classNames(
|
|
177
|
+
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
178
|
}))]
|
|
154
179
|
});
|
|
155
180
|
};
|
|
@@ -13,7 +13,6 @@ import { useTranslation } from 'react-i18next';
|
|
|
13
13
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
14
|
import { useMemoDebugger } from '../../hooks/useEffectDebugger.js';
|
|
15
15
|
import { usePropToggle } from '../../hooks/usePropToggle.js';
|
|
16
|
-
import classes from './ErrorBoundary.module.css';
|
|
17
16
|
import { ErrorIcon } from './ErrorIcon.js';
|
|
18
17
|
import { useGlobals } from '../../context/Global.js';
|
|
19
18
|
|
|
@@ -43,7 +42,7 @@ var ErrorMessage = function ErrorMessage(_ref2) {
|
|
|
43
42
|
}, [], "ErrorBoundary element");
|
|
44
43
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
45
44
|
children: [/*#__PURE__*/jsx(ErrorIcon, {}), /*#__PURE__*/jsx("div", {
|
|
46
|
-
className: classNames(
|
|
45
|
+
className: classNames("fabric-boundaryMessage", "p-2"),
|
|
47
46
|
children: /*#__PURE__*/jsx(EE, {
|
|
48
47
|
error: error
|
|
49
48
|
})
|
|
@@ -59,9 +58,9 @@ var ErrorStack = function ErrorStack(_ref4) {
|
|
|
59
58
|
toggleShow = _usePropToggle2[1];
|
|
60
59
|
useLogger().error(error, {}, stack);
|
|
61
60
|
return /*#__PURE__*/jsxs("div", {
|
|
62
|
-
className: classNames(
|
|
61
|
+
className: classNames("fabric-boundaryDetail", "overflow-hidden grid"),
|
|
63
62
|
children: [/*#__PURE__*/jsx("div", {
|
|
64
|
-
className: classNames(
|
|
63
|
+
className: classNames("fabric-boundaryLink", "px-2 py-1 text-xs text-end"),
|
|
65
64
|
children: /*#__PURE__*/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__*/jsx("div", {
|
|
73
|
-
className: classNames(
|
|
72
|
+
className: classNames("fabric-boundaryStack", "overflow-auto p-2 text-xs border-t"),
|
|
74
73
|
children: /*#__PURE__*/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__*/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__*/jsxs("div", {
|
|
115
|
-
className: classNames(
|
|
132
|
+
className: classNames("fabric-boundaryContent", "overflow-hidden grid rounded-capped"),
|
|
116
133
|
children: [/*#__PURE__*/jsx(ErrorMessage, {
|
|
117
134
|
error: this.state.error,
|
|
118
135
|
errorElement: E
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import classes from './ErrorBoundary.module.css';
|
|
5
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
5
|
|
|
7
6
|
/*
|
|
@@ -31,7 +30,7 @@ var ErrorIcon = function ErrorIcon() {
|
|
|
31
30
|
return /*#__PURE__*/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__*/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 @@ import { useImperativeHandle } from 'react';
|
|
|
5
5
|
import { useDebounce } from '../../hooks/useDebounce.js';
|
|
6
6
|
import { useResizeObserver } from '../../hooks/useResizeObserver.js';
|
|
7
7
|
import { ErrorBoundary } from '../boundary/ErrorBoundary.js';
|
|
8
|
-
import classes from './Content.module.css';
|
|
9
8
|
import { jsx } from 'react/jsx-runtime';
|
|
10
9
|
|
|
11
10
|
/*
|
|
@@ -32,7 +31,12 @@ import { jsx } from '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__*/jsx(ErrorBoundary, {
|
|
68
72
|
children: children
|
|
69
73
|
})
|
|
@@ -3,21 +3,15 @@
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import { useMemoDebugger } from '../../hooks/useEffectDebugger.js';
|
|
7
|
-
import { getColor, getBgClass, getColorClass } from '../../utils/getColor.js';
|
|
8
|
-
import '@react-fabric/utilities';
|
|
9
|
-
import classes from './HeadFoot.module.css';
|
|
10
6
|
import { jsx } from 'react/jsx-runtime';
|
|
11
7
|
|
|
12
|
-
var _excluded = ["as", "children", "className", "
|
|
8
|
+
var _excluded = ["as", "children", "className", "flex", "area", "dir", "align", "justify"];
|
|
13
9
|
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; }
|
|
14
10
|
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; }
|
|
15
11
|
var HeadFoot = function HeadFoot(_ref) {
|
|
16
12
|
var E = _ref.as,
|
|
17
13
|
children = _ref.children,
|
|
18
14
|
className = _ref.className,
|
|
19
|
-
bg = _ref.bg,
|
|
20
|
-
color = _ref.color,
|
|
21
15
|
flex = _ref.flex,
|
|
22
16
|
area = _ref.area,
|
|
23
17
|
dir = _ref.dir,
|
|
@@ -26,35 +20,67 @@ var HeadFoot = function HeadFoot(_ref) {
|
|
|
26
20
|
_ref$justify = _ref.justify,
|
|
27
21
|
justify = _ref$justify === void 0 ? "start" : _ref$justify,
|
|
28
22
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
-
/** ***************** style map *******************/
|
|
30
|
-
var styles = useMemoDebugger(function () {
|
|
31
|
-
var s = {};
|
|
32
|
-
if (bg) {
|
|
33
|
-
s.backgroundColor = getColor(bg);
|
|
34
|
-
}
|
|
35
|
-
if (color) {
|
|
36
|
-
s.color = getColor(color);
|
|
37
|
-
}
|
|
38
|
-
return s;
|
|
39
|
-
}, [bg], "HeadFoot styles");
|
|
40
23
|
return /*#__PURE__*/jsx(E, _objectSpread(_objectSpread({
|
|
41
24
|
dir: dir,
|
|
42
|
-
className: classNames(
|
|
43
|
-
style: styles
|
|
25
|
+
className: classNames("fabric-headfoot", className, area === "head" ? "area-head" : "area-foot", "leading-none", flex && "flex flex-nowrap", align && "items-".concat(align), justify && "justify-".concat(justify))
|
|
44
26
|
}, aria), {}, {
|
|
45
27
|
children: children
|
|
46
28
|
}));
|
|
47
29
|
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Header component that wraps children in a header element.
|
|
33
|
+
* It uses the HeadFoot component to handle layout and styling.
|
|
34
|
+
* It accepts properties for direction, alignment, and justification,
|
|
35
|
+
* allowing for flexible layout configurations.
|
|
36
|
+
* The `as` prop is set to "header" to render the element as a header.
|
|
37
|
+
* The `area` prop is set to "head" to indicate that this is a header area.
|
|
38
|
+
* It can be used to create a consistent header layout across an application.
|
|
39
|
+
*
|
|
40
|
+
* @param {HeadFootProps} props - The properties for the Header component.
|
|
41
|
+
* @returns A header element containing the children wrapped in the HeadFoot component.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```jsx
|
|
45
|
+
* <Header className="custom-header" dir="ltr">
|
|
46
|
+
* <h1>Header content goes here</h1>
|
|
47
|
+
* </Header>
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
48
50
|
var Header = function Header(props) {
|
|
49
51
|
return /*#__PURE__*/jsx(HeadFoot, _objectSpread({
|
|
50
52
|
as: "header",
|
|
51
|
-
area: "head"
|
|
53
|
+
area: "head",
|
|
54
|
+
"data-ref": "header"
|
|
52
55
|
}, props));
|
|
53
56
|
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Footer component that wraps children in a footer element.
|
|
60
|
+
* It uses the HeadFoot component to handle layout and styling.
|
|
61
|
+
* It accepts properties for direction, alignment, and justification,
|
|
62
|
+
* allowing for flexible layout configurations.
|
|
63
|
+
* The `as` prop is set to "footer" to render the element as a footer.
|
|
64
|
+
* The `area` prop is set to "foot" to indicate that this is a footer area.
|
|
65
|
+
* It can be used to create a consistent footer layout across an application.
|
|
66
|
+
* * The Footer component is designed to be flexible and can be styled with custom classes.
|
|
67
|
+
* It supports both default and flex layouts, allowing for alignment and justification of its children.
|
|
68
|
+
*
|
|
69
|
+
* @param {HeadFootProps} props - The properties for the Footer component.
|
|
70
|
+
* @returns A footer element containing the children wrapped in the HeadFoot component.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```jsx
|
|
74
|
+
* <Footer className="custom-footer" dir="ltr">
|
|
75
|
+
* <p>Footer content goes here</p>
|
|
76
|
+
* </Footer>
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
54
79
|
var Footer = function Footer(props) {
|
|
55
80
|
return /*#__PURE__*/jsx(HeadFoot, _objectSpread({
|
|
56
81
|
as: "footer",
|
|
57
|
-
area: "foot"
|
|
82
|
+
area: "foot",
|
|
83
|
+
"data-ref": "footer"
|
|
58
84
|
}, props));
|
|
59
85
|
};
|
|
60
86
|
|