@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
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type ChildrenProp, type CollapseProps, type CssProp, type Elements, type
|
|
3
|
-
export interface AsideProps extends
|
|
1
|
+
import { type IconProps } from "../../components/icon/Icon";
|
|
2
|
+
import { type ChildrenProp, type CollapseProps, type CssProp, type Elements, type TestProps } from "../../types";
|
|
3
|
+
export interface AsideProps extends ChildrenProp, CollapseProps, CssProp, TestProps {
|
|
4
4
|
/**
|
|
5
5
|
* page title
|
|
6
6
|
*/
|
|
7
|
-
title?: ReactNode;
|
|
7
|
+
title?: React.ReactNode;
|
|
8
8
|
/**
|
|
9
9
|
* align inline-end
|
|
10
10
|
*/
|
|
11
11
|
align?: "start" | "end";
|
|
12
|
+
/**
|
|
13
|
+
* icon path or props
|
|
14
|
+
*/
|
|
15
|
+
icon?: IconProps;
|
|
12
16
|
/**
|
|
13
17
|
* header actions
|
|
14
18
|
*/
|
|
@@ -51,6 +55,41 @@ export interface AsideProps extends IconProps, ChildrenProp, CollapseProps, CssP
|
|
|
51
55
|
minWidth?: number | string;
|
|
52
56
|
}
|
|
53
57
|
/**
|
|
54
|
-
*
|
|
58
|
+
* A sidebar component that can be collapsed, resized, and has a flyout feature.
|
|
59
|
+
* It supports a title, icon, actions, and loading state.
|
|
60
|
+
* It can be aligned to the start or end of the page.
|
|
61
|
+
*
|
|
62
|
+
* @param {AsideProps} props - The properties for the Aside component.
|
|
63
|
+
* @returns {JSX.Element} The rendered Aside component.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```jsx
|
|
67
|
+
* <Aside
|
|
68
|
+
* title="Sidebar Title"
|
|
69
|
+
* icon={CoreIcons.menu}
|
|
70
|
+
* rtlFlip={true}
|
|
71
|
+
* className="custom-aside"
|
|
72
|
+
* bodyClassName="custom-aside-body"
|
|
73
|
+
* headerClassName="custom-aside-header"
|
|
74
|
+
* resizeable={true}
|
|
75
|
+
* flyout={true}
|
|
76
|
+
* onFlyout={() => console.log("Flyout triggered")}
|
|
77
|
+
* collapsed={false}
|
|
78
|
+
* collapsable={true}
|
|
79
|
+
* onCollapse={() => console.log("Collapsed toggled")}
|
|
80
|
+
* actions={<button>Action</button>}
|
|
81
|
+
* loading={false}
|
|
82
|
+
* align="start"
|
|
83
|
+
* width="20rem"
|
|
84
|
+
* minWidth="2rem"
|
|
85
|
+
* maxWidth="30vw"
|
|
86
|
+
* data-testid="aside-test"
|
|
87
|
+
* data-test-value="aside-value"
|
|
88
|
+
* >
|
|
89
|
+
* <Content>This is the content of the aside.</Content>
|
|
90
|
+
* </Aside>
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--aside} for more details.
|
|
55
94
|
*/
|
|
56
|
-
export declare const Aside: ({ children, title, icon,
|
|
95
|
+
export declare const Aside: ({ children, title, icon, className, bodyClassName, headerClassName, resizeable, flyout, onFlyout, collapsed, collapsable, onCollapse, actions, loading, align, width: wd, minWidth, maxWidth, "data-testid": testId, "data-test-value": testValue, }: AsideProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import { Component } from "react";
|
|
2
2
|
import { type ChildrenProp } from "../../types";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* ErrorBoundary component to catch JavaScript errors anywhere in the child component tree,
|
|
5
|
+
* log those errors, and display a fallback UI.
|
|
6
|
+
* It can also display a custom error element if provided.
|
|
7
|
+
* This component is useful for preventing the entire application from crashing
|
|
8
|
+
* when an error occurs in a part of the component tree.
|
|
9
|
+
* It can be used to wrap any part of the application.
|
|
10
|
+
* It supports custom error display components and provides a default error message.
|
|
11
|
+
* It also conditionally displays the error stack trace in development mode.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```jsx
|
|
15
|
+
* <ErrorBoundary errorElement={CustomErrorComponent}>
|
|
16
|
+
* <YourComponent />
|
|
17
|
+
* </ErrorBoundary>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--error-boundary}
|
|
5
21
|
*/
|
|
6
22
|
export declare class ErrorBoundary extends Component<{
|
|
7
23
|
/**
|
|
@@ -22,5 +38,5 @@ export declare class ErrorBoundary extends Component<{
|
|
|
22
38
|
};
|
|
23
39
|
constructor(props: AnyObject);
|
|
24
40
|
componentDidCatch(error: Error): void;
|
|
25
|
-
render(): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
41
|
+
render(): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
26
42
|
}
|
|
@@ -11,6 +11,11 @@ export interface ContentProps extends ChildrenProp, CssProp, RefProp, TestProps
|
|
|
11
11
|
onResize?: (event: SizeObject) => void;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Content component that wraps children in a section element.
|
|
15
|
+
* It uses a resize observer to handle resizing and a debounced scroll handler.
|
|
16
|
+
* It also includes an error boundary to catch any errors in the children.
|
|
17
|
+
*
|
|
18
|
+
* @param {ContentProps} props - The properties for the Content component.
|
|
19
|
+
* @returns A section element containing the children wrapped in an error boundary.
|
|
15
20
|
*/
|
|
16
21
|
export declare const Content: ({ ref, children, className, onScroll, onResize, "data-testid": testId, "data-test-value": testValue, }: ContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import { type AriaProps, type ChildrenProp, type
|
|
1
|
+
import { type AriaProps, type ChildrenProp, type CssProp, type TestProps } from "../../types";
|
|
2
2
|
interface BaseProps extends CssProp, AriaProps, ChildrenProp, TestProps {
|
|
3
3
|
dir?: "ltr" | "rtl";
|
|
4
|
-
/**
|
|
5
|
-
* background color
|
|
6
|
-
*/
|
|
7
|
-
bg?: ColorWithGrays | string;
|
|
8
|
-
/**
|
|
9
|
-
* background color
|
|
10
|
-
*/
|
|
11
|
-
color?: ColorWithGrays | string;
|
|
12
4
|
}
|
|
13
5
|
type DefaultProps = BaseProps & {
|
|
14
6
|
flex?: false;
|
|
@@ -19,6 +11,46 @@ type FlexProps = BaseProps & {
|
|
|
19
11
|
justify?: "start" | "end" | "center" | "between";
|
|
20
12
|
};
|
|
21
13
|
export type HeadFootProps = DefaultProps | FlexProps;
|
|
14
|
+
/**
|
|
15
|
+
* Header component that wraps children in a header element.
|
|
16
|
+
* It uses the HeadFoot component to handle layout and styling.
|
|
17
|
+
* It accepts properties for direction, alignment, and justification,
|
|
18
|
+
* allowing for flexible layout configurations.
|
|
19
|
+
* The `as` prop is set to "header" to render the element as a header.
|
|
20
|
+
* The `area` prop is set to "head" to indicate that this is a header area.
|
|
21
|
+
* It can be used to create a consistent header layout across an application.
|
|
22
|
+
*
|
|
23
|
+
* @param {HeadFootProps} props - The properties for the Header component.
|
|
24
|
+
* @returns A header element containing the children wrapped in the HeadFoot component.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```jsx
|
|
28
|
+
* <Header className="custom-header" dir="ltr">
|
|
29
|
+
* <h1>Header content goes here</h1>
|
|
30
|
+
* </Header>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
22
33
|
export declare const Header: (props: HeadFootProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* Footer component that wraps children in a footer element.
|
|
36
|
+
* It uses the HeadFoot component to handle layout and styling.
|
|
37
|
+
* It accepts properties for direction, alignment, and justification,
|
|
38
|
+
* allowing for flexible layout configurations.
|
|
39
|
+
* The `as` prop is set to "footer" to render the element as a footer.
|
|
40
|
+
* The `area` prop is set to "foot" to indicate that this is a footer area.
|
|
41
|
+
* It can be used to create a consistent footer layout across an application.
|
|
42
|
+
* * The Footer component is designed to be flexible and can be styled with custom classes.
|
|
43
|
+
* It supports both default and flex layouts, allowing for alignment and justification of its children.
|
|
44
|
+
*
|
|
45
|
+
* @param {HeadFootProps} props - The properties for the Footer component.
|
|
46
|
+
* @returns A footer element containing the children wrapped in the HeadFoot component.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```jsx
|
|
50
|
+
* <Footer className="custom-footer" dir="ltr">
|
|
51
|
+
* <p>Footer content goes here</p>
|
|
52
|
+
* </Footer>
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
23
55
|
export declare const Footer: (props: HeadFootProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
56
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
1
|
+
import { type IconProps } from "../../components/icon/Icon";
|
|
2
|
+
import { type ChildrenProp, type RefProp, type TestProps } from "../../types";
|
|
3
|
+
export interface PageProps extends ChildrenProp, TestProps, RefProp<HTMLDivElement> {
|
|
3
4
|
/**
|
|
4
5
|
* page title
|
|
5
6
|
*/
|
|
@@ -12,12 +13,39 @@ export interface PageProps extends IconProps, ChildrenProp, TestProps {
|
|
|
12
13
|
* paper style drop shadow
|
|
13
14
|
*/
|
|
14
15
|
paper?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* icon path or props
|
|
18
|
+
*/
|
|
19
|
+
icon?: IconProps;
|
|
15
20
|
/**
|
|
16
21
|
* loading indicator
|
|
17
22
|
*/
|
|
18
23
|
loading?: boolean;
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
|
-
*
|
|
26
|
+
* Page component that wraps children in a div element.
|
|
27
|
+
* It includes a title section with an optional icon and a loading indicator.
|
|
28
|
+
* The component can be styled with a paper effect, page icon and title.
|
|
29
|
+
* It also accepts a loading prop to display a loading indicator.
|
|
30
|
+
*
|
|
31
|
+
* @param {PageProps} props - The properties for the Page component.
|
|
32
|
+
* @returns A div element containing the title and children, with optional loading indicator.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```jsx
|
|
36
|
+
* <Page
|
|
37
|
+
* title="My Page"
|
|
38
|
+
* icon="home"
|
|
39
|
+
* loading={false}
|
|
40
|
+
* paper={true}
|
|
41
|
+
* data-testid="my-page"
|
|
42
|
+
* data-test-value="page-value"
|
|
43
|
+
* >
|
|
44
|
+
* <p>This is the content of the page.</p>
|
|
45
|
+
* </Page>
|
|
46
|
+
* // Renders a page with a title, icon, and content.
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--page} for more details.
|
|
22
50
|
*/
|
|
23
|
-
export declare const Page: ({ children, paper, title, titleClassName, icon,
|
|
51
|
+
export declare const Page: ({ ref, children, paper, title, titleClassName, icon, loading, "data-testid": testId, "data-test-value": testValue, ...rest }: PageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -39,15 +39,70 @@ export interface ColProps extends AriaProps, CssProp, TestProps, Partial<Childre
|
|
|
39
39
|
/**
|
|
40
40
|
* column flex
|
|
41
41
|
*/
|
|
42
|
-
flex?: "auto" | "fill" | "full";
|
|
42
|
+
flex?: "auto" | "fill" | "full" | "initial" | "content";
|
|
43
43
|
/**
|
|
44
44
|
* stretch inner content
|
|
45
45
|
*/
|
|
46
46
|
stretchContent?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* truncate text
|
|
49
|
+
*/
|
|
50
|
+
truncate?: boolean;
|
|
47
51
|
}
|
|
48
52
|
/**
|
|
49
|
-
*
|
|
53
|
+
* Container component that wraps children in a div element.
|
|
54
|
+
* It supports full width, gutter size, and additional CSS classes.
|
|
55
|
+
* It can be used to create a responsive layout with optional gutters for spacing.
|
|
56
|
+
* It accepts properties for full width, gutter size, and additional CSS classes.
|
|
57
|
+
*
|
|
58
|
+
* @param {ContainerProps} props - The properties for the Container component.
|
|
59
|
+
* @returns A div element containing the children with optional full width and gutter size.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```jsx
|
|
63
|
+
* <Container fullWidth={true} gutter="16px" className="custom-container">
|
|
64
|
+
* <p>This is a container with full width and gutter.</p>
|
|
65
|
+
* </Container>
|
|
66
|
+
* ```
|
|
50
67
|
*/
|
|
51
68
|
export declare const Container: ({ children, fullWidth, className, gutter, ...aria }: ContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
/**
|
|
70
|
+
* Row component that allows for flexible layout of columns.
|
|
71
|
+
* It supports various flex properties, alignment, and wrapping.
|
|
72
|
+
* It can be used to create a responsive layout with optional gutters for spacing.
|
|
73
|
+
* It accepts properties for gutter size, orientation, alignment, justification, and additional CSS classes.
|
|
74
|
+
*
|
|
75
|
+
* @param {RowProps} props - The properties for the Row component.
|
|
76
|
+
* @returns A div element representing a row with the specified flex and alignment properties.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```jsx
|
|
80
|
+
* <Row gutter="16px" orient="row" align="center" justify="between">
|
|
81
|
+
* <Col flex="fill">Column 1</Col>
|
|
82
|
+
* <Col flex="fill">Column 2</Col>
|
|
83
|
+
* </Row>
|
|
84
|
+
* // Renders a row with two columns, each taking equal space, centered vertically and spaced evenly.
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--responsive} for more details.
|
|
88
|
+
*/
|
|
52
89
|
export declare const Row: ({ children, gutter, noWrap, orient, align, justify, className, ...aria }: RowProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Column component that allows for flexible layout within a row.
|
|
92
|
+
* It supports various flex properties, alignment, and truncation.
|
|
93
|
+
* It can be used to create a responsive layout with optional stretching of inner content.
|
|
94
|
+
* It accepts properties for flex size, alignment, truncation, and additional CSS classes.
|
|
95
|
+
*
|
|
96
|
+
* @param {ColProps} props - The properties for the Col component.
|
|
97
|
+
* @returns A div element representing a column with the specified flex and alignment properties.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```jsx
|
|
101
|
+
* <Col flex="fill" align="center" truncate className="custom-col">
|
|
102
|
+
* <p>This is a column with flexible layout.</p>
|
|
103
|
+
* </Col>
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--responsive} for more details.
|
|
107
|
+
*/
|
|
108
|
+
export declare const Col: ({ children, flex, align, truncate, className, stretchContent, ...aria }: ColProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import { type ChildrenProp, type CssProp, type RefProp } from "../../types";
|
|
1
|
+
import { type TestProps, type ChildrenProp, type CssProp, type RefProp } from "../../types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* A component that represents a section of content within a page, with templated grid layout.
|
|
4
|
+
* It can be used to group related content together and can be styled with additional CSS classes.
|
|
5
|
+
* It supports RTL (right-to-left) text direction.
|
|
6
|
+
*
|
|
7
|
+
* @param {ChildrenProp} children - The children to be rendered inside the section.
|
|
8
|
+
* @param {CssProp} className - Additional CSS classes to apply to the section.
|
|
9
|
+
* @param {RefProp<HTMLDivElement>} ref - A ref to the section element.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```jsx
|
|
13
|
+
* <Section className="my-section" ref={sectionRef}>
|
|
14
|
+
* <p>This is a section.</p>
|
|
15
|
+
* </Section>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-application--section} for more details.
|
|
4
19
|
*/
|
|
5
|
-
export declare const Section: ({ children, className, dir, ref, }: ChildrenProp & CssProp & RefProp<HTMLDivElement> & {
|
|
20
|
+
export declare const Section: ({ children, className, dir, ref, ...rest }: ChildrenProp & CssProp & TestProps & RefProp<HTMLDivElement> & {
|
|
6
21
|
dir?: "ltr" | "rtl";
|
|
7
22
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,9 +8,9 @@ export interface ThemeProps {
|
|
|
8
8
|
* branding css className
|
|
9
9
|
*
|
|
10
10
|
* .branding {
|
|
11
|
-
* --primary: #color;
|
|
12
|
-
* --accent: #color;
|
|
13
|
-
* --tint: #color;
|
|
11
|
+
* --color-primary: #color;
|
|
12
|
+
* --color-accent: #color;
|
|
13
|
+
* --color-tint: #color;
|
|
14
14
|
* }
|
|
15
15
|
*/
|
|
16
16
|
branding?: string;
|
|
@@ -29,9 +29,29 @@ export interface ThemeProps {
|
|
|
29
29
|
/**
|
|
30
30
|
* component rounding
|
|
31
31
|
*/
|
|
32
|
-
rounding?: "
|
|
32
|
+
rounding?: "sm" | "md" | "full";
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* This component provides a way to set the theme for the application.
|
|
36
|
+
* It allows you to set the primary, accent, and tint colors, as well as the color scheme and rounding.
|
|
37
|
+
* It uses CSS variables to apply the colors and styles.
|
|
38
|
+
* It also applies the branding className to the root element.
|
|
39
|
+
* The component uses the `useApplicationContext` hook to get the current color scheme from the application context.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```jsx
|
|
43
|
+
* <ThemeProvider
|
|
44
|
+
* branding="my-branding"
|
|
45
|
+
* primaryColor="#ff0000"
|
|
46
|
+
* accentColor="#00ff00"
|
|
47
|
+
* tintColor="#0000ff"
|
|
48
|
+
* colorScheme="dark"
|
|
49
|
+
* rounding="md"
|
|
50
|
+
* >
|
|
51
|
+
* <div>Your content here</div>
|
|
52
|
+
* </ThemeProvider>
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--theme-provider} for more details.
|
|
36
56
|
*/
|
|
37
57
|
export declare const ThemeProvider: ({ children, branding, primaryColor, accentColor, tintColor, colorScheme, rounding, }: ThemeProps & ChildrenProp) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { type PropsWithChildren } from "react";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* This component is used to create a full-screen viewport
|
|
4
|
+
* that can be used to display content in a grid layout.
|
|
5
|
+
* It is typically used as a container for the main content of the application.
|
|
6
|
+
* It is styled to take up the full width and height of the viewport,
|
|
7
|
+
* and it uses absolute positioning to ensure it covers the entire screen.
|
|
8
|
+
* The component accepts children as props, allowing you to nest other components inside it.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```jsx
|
|
12
|
+
* <Viewport>
|
|
13
|
+
* <YourContentComponent />
|
|
14
|
+
* </Viewport>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-application--viewport} for more details.
|
|
4
18
|
*/
|
|
5
19
|
export declare const Viewport: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook to manage a controlled value with a default fallback for inputs.
|
|
3
|
+
* It updates the current value whenever the deferred value changes.
|
|
4
|
+
* This is useful for scenarios where you want to control the value of a component
|
|
5
|
+
* while also providing a default value if the controlled value is not set.
|
|
6
|
+
* This hook is particularly useful for form inputs or components that require a controlled value
|
|
7
|
+
* but also need to handle cases where the value might not be immediately available.
|
|
8
|
+
*
|
|
9
|
+
* @param value - The controlled value that may change.
|
|
10
|
+
* @param defaultValue - The default value to use if the controlled value is not set.
|
|
11
|
+
* @returns An object containing the current value and a function to update it.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useControlledValue: <T extends AnyObject = string>(value: T, defaultValue: T) => {
|
|
3
14
|
currentValue: T;
|
|
4
15
|
updateValue: import("react").Dispatch<import("react").SetStateAction<T>>;
|
|
5
16
|
};
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook to debounce a function.
|
|
3
|
+
* This hook delays the processing of the function until after a specified delay period
|
|
4
|
+
* has elapsed since the last time the function was invoked. This is useful for optimizing
|
|
5
|
+
* performance in scenarios where a function may be called frequently, such as during
|
|
6
|
+
* user input or window resizing events.
|
|
7
|
+
*
|
|
8
|
+
* @param callback - The function to debounce.
|
|
9
|
+
* @param deps - The dependency array for the hook.
|
|
10
|
+
* @param delay - The debounce delay in milliseconds.
|
|
11
|
+
* @returns A debounced version of the callback function.
|
|
12
|
+
*/
|
|
1
13
|
export declare const useDebounce: (callback: undefined | ((...rest: AnyObject) => AnyObject), deps: AnyObject[], delay?: number) => {
|
|
2
14
|
(...args: AnyObject): void;
|
|
3
15
|
cancel(): void;
|
|
@@ -1,4 +1,53 @@
|
|
|
1
1
|
import { type DependencyList, type EffectCallback } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook to debug useMemo hooks.
|
|
4
|
+
* It compares the current and previous dependency arrays and logs any differences.
|
|
5
|
+
* @param func - The function to be memoized or executed in the effect.
|
|
6
|
+
* @param inputs - The dependency array for the hook.
|
|
7
|
+
* @param prefix - A prefix for the log messages to identify the hook.
|
|
8
|
+
* @returns The result of the memoized function or the effect.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```jsx
|
|
12
|
+
* const value = useMemoDebugger(() => computeValue(), [dependency1, dependency2], "MyComponent");
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
2
15
|
export declare const useMemoDebugger: <T>(func: () => T, inputs: DependencyList, prefix: string) => T;
|
|
16
|
+
/**
|
|
17
|
+
* Custom hook to debug useEffect and useLayoutEffect hooks.
|
|
18
|
+
* It compares the current and previous dependency arrays and logs any differences.
|
|
19
|
+
* @param func - The effect function to be executed.
|
|
20
|
+
* @param inputs - The dependency array for the effect.
|
|
21
|
+
* @param prefix - A prefix for the log messages to identify the effect.
|
|
22
|
+
* @returns A cleanup function if the effect returns one.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```jsx
|
|
26
|
+
* useEffectDebugger(() => {
|
|
27
|
+
* // Effect logic here
|
|
28
|
+
* return () => {
|
|
29
|
+
* // Cleanup logic here
|
|
30
|
+
* };
|
|
31
|
+
* }, [dependency1, dependency2], "MyComponent");
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
3
34
|
export declare const useEffectDebugger: (func: EffectCallback, inputs: DependencyList, prefix: string) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Custom hook to debug useLayoutEffect hooks.
|
|
37
|
+
* It compares the current and previous dependency arrays and logs any differences.
|
|
38
|
+
* @param func - The layout effect function to be executed.
|
|
39
|
+
* @param inputs - The dependency array for the layout effect.
|
|
40
|
+
* @param prefix - A prefix for the log messages to identify the layout effect.
|
|
41
|
+
* @returns A cleanup function if the layout effect returns one.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```jsx
|
|
45
|
+
* useLayoutEffectDebugger(() => {
|
|
46
|
+
* // Layout effect logic here
|
|
47
|
+
* return () => {
|
|
48
|
+
* // Cleanup logic here
|
|
49
|
+
* };
|
|
50
|
+
* }, [dependency1, dependency2], "MyComponent");
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
4
53
|
export declare const useLayoutEffectDebugger: (func: EffectCallback, inputs: DependencyList, prefix: string) => void;
|
|
@@ -1 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook to determine if the current theme is dark.
|
|
3
|
+
* It checks the background color of the document's root element
|
|
4
|
+
* and sets the `isDark` state based on the red component of the RGB color.
|
|
5
|
+
* If the red component is less than 50, it considers the theme to be dark.
|
|
6
|
+
*
|
|
7
|
+
* @returns {boolean} - Returns true if the theme is dark, false otherwise.
|
|
8
|
+
*/
|
|
1
9
|
export declare const useIsDark: () => boolean;
|
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook to determine if the current locale is RTL (Right-to-Left).
|
|
3
|
+
* It uses the i18n instance from react-i18next to check the direction.
|
|
4
|
+
*
|
|
5
|
+
* @returns {boolean} - Returns true if the current locale is RTL, false otherwise.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```jsx
|
|
9
|
+
* const isRtl = useIsRtl();
|
|
10
|
+
* // This will return true if the current locale is RTL, false otherwise.
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
1
13
|
export declare const useIsRtl: () => boolean;
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook to manage navigation through a list of items.
|
|
3
|
+
* It provides functionality to navigate forward and backward,
|
|
4
|
+
* and keeps track of the current index and total count of items.
|
|
5
|
+
*
|
|
6
|
+
* @param totalCount - Total number of items to navigate through.
|
|
7
|
+
* @param defaultIndex - Initial index to start navigation from.
|
|
8
|
+
* @returns An object containing the current index, a function to navigate,
|
|
9
|
+
* a label for the current position, and a function to set the current index.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```jsx
|
|
13
|
+
* const { headLabel, onNavigate, currentIndex, setCurrentIndex } = useNavigator(5, 0);
|
|
14
|
+
* // headLabel will show "1/5"
|
|
15
|
+
* // onNavigate(1) will move to the next item, and onNavigate(-1) will move to the previous item.
|
|
16
|
+
* // currentIndex will be updated accordingly.
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
2
19
|
export declare const useNavigator: (totalCount?: number, defaultIndex?: number) => {
|
|
3
20
|
headLabel: import("react/jsx-runtime").JSX.Element;
|
|
4
21
|
onNavigate: (dir: 1 | -1) => void;
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { type ElementType } from "react";
|
|
2
|
+
import { type ModalProps } from "../types";
|
|
3
|
+
type OverlayComponent = ElementType<ModalProps<AnyObject>>;
|
|
4
|
+
/**
|
|
5
|
+
* Hook to manage overlay components like modals or flyouts.
|
|
6
|
+
* It provides a way to open an overlay with specified properties and handle its closure.
|
|
7
|
+
* This hook returns the current overlay component and a function to open it with props.
|
|
8
|
+
* It is useful for scenarios where you need to display overlays dynamically,
|
|
9
|
+
* such as modals, flyouts, or any other overlay components in a React application.
|
|
10
|
+
* The `openOverlay` function returns a promise that resolves with the result
|
|
11
|
+
* of the overlay when it is closed, allowing you to handle the result in a controlled manner.
|
|
12
|
+
*
|
|
13
|
+
* @param ModalOrFlyout - The component to be used as an overlay.
|
|
14
|
+
* @returns An array containing the current overlay and a function to open it.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```jsx
|
|
18
|
+
* const [Overlay, openOverlay] = useOverlayService(MyModalComponent);
|
|
19
|
+
* // To open the overlay:
|
|
20
|
+
* const handleOpen = async () => {
|
|
21
|
+
* const result = await openOverlay({ title: "My Modal", content: "Hello World" });
|
|
22
|
+
* console.log(result); // Handle the result from the overlay
|
|
23
|
+
* };
|
|
24
|
+
* <button onClick={handleOpen}>Open Modal</button>
|
|
25
|
+
* <Overlay />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const useOverlayService: (ModalOrFlyout: OverlayComponent) => [Overlay: React.ReactNode | null, openOverlay: (props?: KeyValue) => Promise<AnyObject>];
|
|
10
29
|
export {};
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { type RefObject } from "react";
|
|
2
2
|
/**
|
|
3
|
-
* hook to
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
3
|
+
* This hook is used to manage a toggle state based on a prop value.
|
|
4
|
+
* It allows you to toggle the state and also provides a reference to the current state.
|
|
5
|
+
* It is useful for scenarios where you want to control a toggle state from a parent component while also allowing local toggling.
|
|
6
|
+
*
|
|
7
|
+
* @param isOn - Initial state of the toggle (default: false)
|
|
8
|
+
* @param onToggle - Callback function that is called when the toggle state changes.
|
|
9
|
+
* @param key - Optional key to identify the toggle state, useful for multiple toggles.
|
|
10
|
+
* @returns A tuple containing the current toggle state, a function to toggle the state, and a reference to the current state.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```jsx
|
|
14
|
+
* const [isToggled, toggle, toggleRef] = usePropToggle(false, (newState) => {
|
|
15
|
+
* console.log("Toggle state changed to:", newState);
|
|
16
|
+
* });
|
|
17
|
+
* toggle(); // This will toggle the state and call the onToggle callback
|
|
18
|
+
* ```
|
|
8
19
|
*/
|
|
9
20
|
export declare const usePropToggle: (isOn?: boolean, onToggle?: (is: boolean, key?: string) => unknown, key?: string) => [boolean, () => void, RefObject<boolean>];
|
|
@@ -17,11 +17,29 @@ interface Options {
|
|
|
17
17
|
*/
|
|
18
18
|
onEnd?: () => void;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Custom hook to handle resizing of an element.
|
|
22
|
+
* It provides a ref to the element and a mouse down event handler to initiate resizing.
|
|
23
|
+
* The resizing is done by tracking mouse movements and calculating the difference in x and y coordinates.
|
|
24
|
+
* It supports both horizontal and vertical resizing, and can be configured to reverse the direction based on RTL (Right-to-Left) layout.
|
|
25
|
+
*
|
|
26
|
+
* @param onResize - callback to handle resize event with the difference in x and y
|
|
27
|
+
* @param options - options for resizing behavior
|
|
28
|
+
* @returns ref to the element and a mouse down event handler to initiate resizing
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```jsx
|
|
32
|
+
* const { ref, onMouseDown } = useResize((diff) => {
|
|
33
|
+
* console.log("Resize difference:", diff);
|
|
34
|
+
* }, { isReverse: true, isVertical: false });
|
|
35
|
+
* <div ref={ref} onMouseDown={onMouseDown}>Resize Me</div>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
20
38
|
export declare const useResize: <T extends HTMLElement = HTMLDivElement>(onResize: (diff: {
|
|
21
39
|
x: number;
|
|
22
40
|
y: number;
|
|
23
41
|
}) => void, { isReverse, isVertical, onStart, onEnd }: Options) => {
|
|
24
|
-
ref: RefObject<T>;
|
|
42
|
+
ref: RefObject<T | null>;
|
|
25
43
|
onMouseDown: React.MouseEventHandler;
|
|
26
44
|
};
|
|
27
45
|
export {};
|