@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
|
@@ -5,12 +5,35 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
5
5
|
import { Format } from '@react-fabric/utilities';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import { useMemoDebugger } from '../../hooks/useEffectDebugger.js';
|
|
8
|
-
import classes from './Meter.module.css';
|
|
9
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
9
|
|
|
11
10
|
var _excluded = ["value", "hideLabel", "className"];
|
|
12
11
|
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; }
|
|
13
12
|
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; }
|
|
13
|
+
/**
|
|
14
|
+
* A component that displays a visual representation of a value as a series of dots.
|
|
15
|
+
* It is useful for showing progress or completion status in a compact form.
|
|
16
|
+
* The meter consists of 6 dots, each representing approximately 16.67% of the total value.
|
|
17
|
+
* The active dots are filled based on the value provided, and the remaining dots are empty.
|
|
18
|
+
* The component can also display a label showing the percentage value.
|
|
19
|
+
*
|
|
20
|
+
* @param {MeterProps} props - The properties for the Meter component.
|
|
21
|
+
* @returns {JSX.Element} The rendered Meter component.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```jsx
|
|
25
|
+
* <Meter value={75} />
|
|
26
|
+
* // Renders a meter with 4 active dots and a label showing "75%"
|
|
27
|
+
*
|
|
28
|
+
* <Meter value={50} hideLabel />
|
|
29
|
+
* // Renders a meter with 3 active dots and no label
|
|
30
|
+
*
|
|
31
|
+
* <Meter value={100} className="custom-meter" />
|
|
32
|
+
* // Renders a meter with all 6 active dots and a custom class name
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-meter--docs} for more details.
|
|
36
|
+
*/
|
|
14
37
|
var Meter = function Meter(_ref) {
|
|
15
38
|
var value = _ref.value,
|
|
16
39
|
hideLabel = _ref.hideLabel,
|
|
@@ -21,11 +44,11 @@ var Meter = function Meter(_ref) {
|
|
|
21
44
|
return value / 16.67;
|
|
22
45
|
}, [value], "Meter activeCount");
|
|
23
46
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
24
|
-
className: classNames(
|
|
47
|
+
className: classNames("fabric-meter", className, "flex flex-nowrap items-center gap-0.5")
|
|
25
48
|
}, aria), {}, {
|
|
26
49
|
children: [[0, 1, 2, 3, 4, 5].map(function (step) {
|
|
27
50
|
return /*#__PURE__*/jsx("div", {
|
|
28
|
-
className: classNames(
|
|
51
|
+
className: classNames("fabric-meterBar", "first-of-type:rounded-s last-of-type:rounded-e bg-tint-100 relative outline -outline-offset-1 outline-muted overflow-hidden after:absolute after:inset-0"),
|
|
29
52
|
"data-active": activeCount >= step,
|
|
30
53
|
style: {
|
|
31
54
|
"--width": "".concat(Math.min((activeCount - step) * 100, 100), "%")
|
|
@@ -3,51 +3,83 @@
|
|
|
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 { useCallback } from 'react';
|
|
6
7
|
import { HotKey } from '../../hotkeys/HotKey.js';
|
|
7
|
-
import { CoreIcons } from '../../types/icons.js';
|
|
8
8
|
import { Icon } from '../icon/Icon.js';
|
|
9
|
+
import { isEmpty } from '@react-fabric/utilities';
|
|
9
10
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
11
|
|
|
11
|
-
var _excluded = ["className", "onNavigate", "color"];
|
|
12
|
+
var _excluded = ["className", "onNavigate", "color", "children", "length", "current", "disableKeyHandlers"];
|
|
12
13
|
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; }
|
|
13
14
|
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
|
+
/**
|
|
16
|
+
* A component that provides navigation controls for traversing through items.
|
|
17
|
+
* It includes previous and next buttons, and supports keyboard navigation.
|
|
18
|
+
*
|
|
19
|
+
* @param {NavigatorProps} props - The properties for the Navigator component.
|
|
20
|
+
* @returns {JSX.Element} The rendered Navigator component.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```jsx
|
|
24
|
+
* <Navigator
|
|
25
|
+
* className="my-navigator"
|
|
26
|
+
* onNavigate={(dir) => console.log(`Navigate ${dir === -1 ? 'previous' : 'next'}`)}
|
|
27
|
+
* color="blue"
|
|
28
|
+
* length={10}
|
|
29
|
+
* current={0}
|
|
30
|
+
* >
|
|
31
|
+
* <span>Current Item: 1</span>
|
|
32
|
+
* </Navigator>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-navigator--docs} for more details.
|
|
36
|
+
*/
|
|
14
37
|
var Navigator = function Navigator(_ref) {
|
|
15
38
|
var className = _ref.className,
|
|
16
39
|
onNavigate = _ref.onNavigate,
|
|
17
40
|
color = _ref.color,
|
|
41
|
+
children = _ref.children,
|
|
42
|
+
length = _ref.length,
|
|
43
|
+
current = _ref.current,
|
|
44
|
+
disableKeyHandlers = _ref.disableKeyHandlers,
|
|
18
45
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
+
var navPrev = useCallback(function () {
|
|
47
|
+
return (isEmpty(current) || current !== 0) && onNavigate(-1);
|
|
48
|
+
}, [onNavigate, current]);
|
|
49
|
+
var navNext = useCallback(function () {
|
|
50
|
+
return (isEmpty(current) || current + 1 < (length !== null && length !== void 0 ? length : 0)) && onNavigate(+1);
|
|
51
|
+
}, [onNavigate, current, length]);
|
|
19
52
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
20
|
-
|
|
53
|
+
"data-ref": "navigator",
|
|
54
|
+
className: classNames(className, "inline-flex items-center leading-none")
|
|
21
55
|
}, aria), {}, {
|
|
22
|
-
children: [/*#__PURE__*/jsx(HotKey, {
|
|
56
|
+
children: [!disableKeyHandlers && /*#__PURE__*/jsx(HotKey, {
|
|
23
57
|
keyCombo: "left",
|
|
24
|
-
handler:
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
}), /*#__PURE__*/jsx(HotKey, {
|
|
58
|
+
handler: navPrev
|
|
59
|
+
}), !disableKeyHandlers && /*#__PURE__*/jsx(HotKey, {
|
|
28
60
|
keyCombo: "right",
|
|
29
|
-
handler:
|
|
30
|
-
return onNavigate(1);
|
|
31
|
-
}
|
|
61
|
+
handler: navNext
|
|
32
62
|
}), /*#__PURE__*/jsx(Icon, {
|
|
33
63
|
rtlFlip: true,
|
|
34
64
|
color: color,
|
|
35
65
|
className: "text-[1em] p-1",
|
|
36
66
|
"aria-label": "previous",
|
|
37
|
-
"data-
|
|
38
|
-
icon:
|
|
67
|
+
"data-ref": "previous",
|
|
68
|
+
icon: "icon-[mdi--chevron-left]",
|
|
69
|
+
disabled: !isEmpty(current) && current === 0,
|
|
39
70
|
onClick: function onClick(e) {
|
|
40
|
-
return [e.stopPropagation(),
|
|
71
|
+
return [e.stopPropagation(), navPrev()];
|
|
41
72
|
}
|
|
42
|
-
}), /*#__PURE__*/jsx(Icon, {
|
|
73
|
+
}), children, /*#__PURE__*/jsx(Icon, {
|
|
43
74
|
rtlFlip: true,
|
|
44
75
|
className: "text-[1em] p-1",
|
|
45
76
|
color: color,
|
|
46
77
|
"aria-label": "next",
|
|
47
|
-
"data-
|
|
48
|
-
icon:
|
|
78
|
+
"data-ref": "next",
|
|
79
|
+
icon: "icon-[mdi--chevron-right]",
|
|
80
|
+
disabled: !isEmpty(current) && current + 1 === length,
|
|
49
81
|
onClick: function onClick(e) {
|
|
50
|
-
return [e.stopPropagation(),
|
|
82
|
+
return [e.stopPropagation(), navNext()];
|
|
51
83
|
}
|
|
52
84
|
})]
|
|
53
85
|
}));
|
|
@@ -6,15 +6,49 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { usePropToggle } from '../../hooks/usePropToggle.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { Icon } from '../icon/Icon.js';
|
|
12
|
-
import classes from './Panel.module.css';
|
|
9
|
+
import { HotKey } from '../../hotkeys/HotKey.js';
|
|
10
|
+
import { LoadingLine } from '../animations/Animations.js';
|
|
11
|
+
import { Icon, getIconProps } from '../icon/Icon.js';
|
|
13
12
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
14
13
|
|
|
15
|
-
var _excluded = ["children", "className", "titleClassName", "headerClassName", "title", "actions", "icon", "
|
|
14
|
+
var _excluded = ["children", "className", "titleClassName", "headerClassName", "title", "actions", "icon", "panelId", "height", "width", "minHeight", "minWidth", "maxHeight", "maxWidth", "loading", "expandable", "expanded", "onExpand", "collapsable", "collapsed", "onCollapse", "onClose", "onBack"];
|
|
16
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; }
|
|
17
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; }
|
|
17
|
+
/**
|
|
18
|
+
* A component that represents a panel with a header, body, and optional actions.
|
|
19
|
+
* It supports expandable and collapsible functionality, loading state, and customizable styles.
|
|
20
|
+
* The panel can be resized and has a fixed position when expanded.
|
|
21
|
+
* It can be customized with different colors, icons, and behaviors.
|
|
22
|
+
* This component is useful for displaying content in a structured way, allowing users to interact with it through actions and toggles.
|
|
23
|
+
* It can be used in various applications where panels are needed, such as dashboards, settings pages, or content management systems.
|
|
24
|
+
*
|
|
25
|
+
* @param {PanelProps} props - The properties for the Panel component.
|
|
26
|
+
* @returns {JSX.Element} The rendered Panel component.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```jsx
|
|
30
|
+
* <Panel
|
|
31
|
+
* title="Panel Title"
|
|
32
|
+
* icon="icon-[mdi--info]"
|
|
33
|
+
* actions={<button>Action</button>}
|
|
34
|
+
* expandable
|
|
35
|
+
* collapsable
|
|
36
|
+
* onExpand={() => console.log("Expanded")}
|
|
37
|
+
* onCollapse={() => console.log("Collapsed")}
|
|
38
|
+
* onClose={() => console.log("Closed")}
|
|
39
|
+
* height="400px"
|
|
40
|
+
* width="300px"
|
|
41
|
+
* minHeight="200px"
|
|
42
|
+
* minWidth="200px"
|
|
43
|
+
* maxHeight="600px"
|
|
44
|
+
* maxWidth="600px"
|
|
45
|
+
* >
|
|
46
|
+
* <p>This is the content of the panel.</p>
|
|
47
|
+
* </Panel>
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-panel--docs} for more details.
|
|
51
|
+
*/
|
|
18
52
|
var Panel = function Panel(_ref) {
|
|
19
53
|
var children = _ref.children,
|
|
20
54
|
className = _ref.className,
|
|
@@ -23,9 +57,6 @@ var Panel = function Panel(_ref) {
|
|
|
23
57
|
title = _ref.title,
|
|
24
58
|
actions = _ref.actions,
|
|
25
59
|
icon = _ref.icon,
|
|
26
|
-
iconBg = _ref.iconBg,
|
|
27
|
-
iconColor = _ref.iconColor,
|
|
28
|
-
rtlFlip = _ref.rtlFlip,
|
|
29
60
|
panelId = _ref.panelId,
|
|
30
61
|
height = _ref.height,
|
|
31
62
|
width = _ref.width,
|
|
@@ -55,7 +86,7 @@ var Panel = function Panel(_ref) {
|
|
|
55
86
|
return !!expandable || !!collapsable || !!onClose;
|
|
56
87
|
}, [expandable, collapsable, onClose]);
|
|
57
88
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
58
|
-
className: classNames(
|
|
89
|
+
className: classNames("fabric-panel", className, "rounded-capped overflow-hidden outline grid", expanded ? "fixed inset-4 z-50" : "relative"),
|
|
59
90
|
"data-ref": "panel",
|
|
60
91
|
"data-collapsed": collapsed,
|
|
61
92
|
style: expanded ? {} : collapsed ? {
|
|
@@ -71,27 +102,27 @@ var Panel = function Panel(_ref) {
|
|
|
71
102
|
maxHeight: maxHeight
|
|
72
103
|
}
|
|
73
104
|
}, aria), {}, {
|
|
74
|
-
children: [/*#__PURE__*/
|
|
105
|
+
children: [expanded && /*#__PURE__*/jsx(HotKey, {
|
|
106
|
+
keyCombo: "esc",
|
|
107
|
+
handler: toggleExpand
|
|
108
|
+
}), /*#__PURE__*/jsxs("header", {
|
|
75
109
|
role: "none",
|
|
76
|
-
className: classNames(
|
|
77
|
-
"data-
|
|
110
|
+
className: classNames("fabric-panelHeader", headerClassName, "flex flex-nowrap items-center area-head"),
|
|
111
|
+
"data-ref": "panelHeader",
|
|
78
112
|
onClick: collapsable ? toggleCollapse : undefined,
|
|
79
113
|
children: [onBack && /*#__PURE__*/jsx(Icon, {
|
|
114
|
+
rtlFlip: true,
|
|
80
115
|
"data-ref": "panelBack",
|
|
81
|
-
className: classNames(
|
|
82
|
-
icon:
|
|
116
|
+
className: classNames("fabric-panelAction", "cursor-pointer"),
|
|
117
|
+
icon: "icon-[mdi--chevron-left]",
|
|
83
118
|
onClick: onBack
|
|
84
|
-
}), icon && /*#__PURE__*/jsx(Icon, {
|
|
85
|
-
icon: icon,
|
|
86
|
-
bg: iconBg,
|
|
87
|
-
color: iconColor,
|
|
88
|
-
rtlFlip: rtlFlip,
|
|
119
|
+
}), icon && /*#__PURE__*/jsx(Icon, _objectSpread({
|
|
89
120
|
className: "p-2 text-md select-none pointer-events-none"
|
|
90
|
-
}), /*#__PURE__*/jsx("div", {
|
|
121
|
+
}, getIconProps(icon))), /*#__PURE__*/jsx("div", {
|
|
91
122
|
className: classNames(titleClassName, "flex-1 select-none truncate", title && "py-1 first:px-2"),
|
|
92
123
|
children: title
|
|
93
124
|
}), /*#__PURE__*/jsx("div", {
|
|
94
|
-
className: "px-1",
|
|
125
|
+
className: "px-1 leading-none",
|
|
95
126
|
children: actions
|
|
96
127
|
}), hasTools && /*#__PURE__*/jsxs("div", {
|
|
97
128
|
role: "none",
|
|
@@ -101,25 +132,25 @@ var Panel = function Panel(_ref) {
|
|
|
101
132
|
},
|
|
102
133
|
children: [expandable && /*#__PURE__*/jsx(Icon, {
|
|
103
134
|
"data-ref": "panelExpand",
|
|
104
|
-
className: classNames(
|
|
105
|
-
icon: expanded ?
|
|
135
|
+
className: classNames("fabric-panelAction", "cursor-pointer"),
|
|
136
|
+
icon: expanded ? "icon-[mdi--fullscreen-exit]" : "icon-[mdi--fullscreen]",
|
|
106
137
|
onClick: toggleExpand
|
|
107
138
|
}), !expanded && collapsable && /*#__PURE__*/jsx(Icon, {
|
|
108
139
|
"data-ref": "panelCollapse",
|
|
109
|
-
className: classNames(
|
|
110
|
-
icon: collapsed ?
|
|
140
|
+
className: classNames("fabric-panelAction", "cursor-pointer"),
|
|
141
|
+
icon: collapsed ? "icon-[mdi--plus-box]" : "icon-[mdi--minus-box]",
|
|
111
142
|
onClick: toggleCollapse
|
|
112
143
|
}), !expanded && onClose && /*#__PURE__*/jsx(Icon, {
|
|
113
144
|
"data-ref": "panelClose",
|
|
114
|
-
className: classNames(
|
|
115
|
-
icon:
|
|
145
|
+
className: classNames("fabric-panelAction", "cursor-pointer"),
|
|
146
|
+
icon: "icon-[mdi--close]",
|
|
116
147
|
onClick: onClose
|
|
117
148
|
})]
|
|
118
149
|
})]
|
|
119
150
|
}), (!collapsed || expanded) && /*#__PURE__*/jsxs("div", {
|
|
120
|
-
"data-
|
|
121
|
-
className: classNames(
|
|
122
|
-
children: [loading && /*#__PURE__*/jsx(
|
|
151
|
+
"data-ref": "panelBody",
|
|
152
|
+
className: classNames("fabric-panelBody", "area-content grid overflow-hidden"),
|
|
153
|
+
children: [loading && /*#__PURE__*/jsx(LoadingLine, {}), children]
|
|
123
154
|
})]
|
|
124
155
|
}));
|
|
125
156
|
};
|
|
@@ -4,9 +4,32 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { useState, Children, useCallback, cloneElement } from 'react';
|
|
6
6
|
import { useMemoDebugger, useEffectDebugger } from '../../hooks/useEffectDebugger.js';
|
|
7
|
-
import classes from './Panel.module.css';
|
|
8
7
|
import { jsx } from 'react/jsx-runtime';
|
|
9
8
|
|
|
9
|
+
/**
|
|
10
|
+
* A component that groups multiple panels together, allowing for one panel to be expanded at a time.
|
|
11
|
+
* This component allows you to manage a group of panels where only one can be expanded at a time.
|
|
12
|
+
* It accepts an `activePanel` prop to control which panel is currently expanded,
|
|
13
|
+
* and an `onActiveChange` callback that is triggered when the active panel changes.
|
|
14
|
+
* It uses the `Panel` component to render each individual panel within the group.
|
|
15
|
+
*
|
|
16
|
+
* @param {PanelGroupProps} props - The properties for the PanelGroup component.
|
|
17
|
+
* @returns {JSX.Element} The rendered PanelGroup component.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```jsx
|
|
21
|
+
* <PanelGroup
|
|
22
|
+
* activePanel="panel1"
|
|
23
|
+
* onActiveChange={(panelId) => console.log(`Active panel changed to: ${panelId}`)}
|
|
24
|
+
* >
|
|
25
|
+
* <Panel panelId="panel1" title="Panel 1">Content for Panel 1</Panel>
|
|
26
|
+
* <Panel panelId="panel2" title="Panel 2">Content for Panel 2</Panel>
|
|
27
|
+
* <Panel panelId="panel3" title="Panel 3">Content for Panel 3</Panel>
|
|
28
|
+
* </PanelGroup>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-panel--docs} for more details.
|
|
32
|
+
*/
|
|
10
33
|
var PanelGroup = function PanelGroup(_ref) {
|
|
11
34
|
var children = _ref.children,
|
|
12
35
|
activePanel = _ref.activePanel,
|
|
@@ -33,7 +56,7 @@ var PanelGroup = function PanelGroup(_ref) {
|
|
|
33
56
|
}, [onActiveChange, expandedPanel]);
|
|
34
57
|
return /*#__PURE__*/jsx("div", {
|
|
35
58
|
"data-ref": "panelGroup",
|
|
36
|
-
className: classNames(
|
|
59
|
+
className: classNames("fabric-panelGroup", "flex flex-col overflow-auto area-content p-px"),
|
|
37
60
|
children: Children.toArray(children).map(function (child, index) {
|
|
38
61
|
return /*#__PURE__*/cloneElement(child, {
|
|
39
62
|
panelId: child.props.panelId || index,
|
|
@@ -10,6 +10,37 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
10
10
|
var _excluded = ["active", "children", "className", "onPanelChange", "onBack"];
|
|
11
11
|
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; }
|
|
12
12
|
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; }
|
|
13
|
+
/**
|
|
14
|
+
* A component that manages a stack of panels, allowing navigation between them.
|
|
15
|
+
* This component allows you to manage a stack of panels where you can navigate between them.
|
|
16
|
+
* It accepts an `active` prop to control which panel is currently active,
|
|
17
|
+
* an `onPanelChange` callback that is triggered when the active panel changes,
|
|
18
|
+
* and an `onBack` callback to handle navigation to the previous panel in the history.
|
|
19
|
+
* It uses the `Panel` component to render each individual panel within the stack.
|
|
20
|
+
* The component maintains a history of panels to allow back navigation,
|
|
21
|
+
* and it updates the active panel based on user interactions.
|
|
22
|
+
*
|
|
23
|
+
* @param {PanelStackProps} props - The properties for the PanelStack component.
|
|
24
|
+
* @returns {JSX.Element} The rendered PanelStack component.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```jsx
|
|
28
|
+
* <PanelStack
|
|
29
|
+
* active="panel1"
|
|
30
|
+
* onPanelChange={(panelId) => console.log(`Active panel changed to: ${panelId}`)}
|
|
31
|
+
* onBack={(currentPanel, nextPanel) => {
|
|
32
|
+
* console.log(`Navigating back from ${currentPanel} to ${nextPanel}`);
|
|
33
|
+
* return true; // return false to prevent navigation
|
|
34
|
+
* }}
|
|
35
|
+
* >
|
|
36
|
+
* <Panel panelId="panel1" title="Panel 1">Content for Panel 1</Panel>
|
|
37
|
+
* <Panel panelId="panel2" title="Panel 2">Content for Panel 2</Panel>
|
|
38
|
+
* <Panel panelId="panel3" title="Panel 3">Content for Panel 3</Panel>
|
|
39
|
+
* </PanelStack>
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-panelstack--docs} for more details.
|
|
43
|
+
*/
|
|
13
44
|
var PanelStack = function PanelStack(_ref) {
|
|
14
45
|
_ref.active;
|
|
15
46
|
var children = _ref.children,
|
|
@@ -42,7 +73,6 @@ var PanelStack = function PanelStack(_ref) {
|
|
|
42
73
|
}, [onPanelChange, history]);
|
|
43
74
|
var goBack = useCallback(function () {
|
|
44
75
|
var _history$2;
|
|
45
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
|
|
46
76
|
if ((onBack === null || onBack === void 0 ? void 0 : onBack(history[0], (_history$2 = history[1]) !== null && _history$2 !== void 0 ? _history$2 : "root")) !== false) {
|
|
47
77
|
setHistory(history.slice(1));
|
|
48
78
|
}
|
|
@@ -58,7 +88,6 @@ var PanelStack = function PanelStack(_ref) {
|
|
|
58
88
|
if (panelKey === "back") {
|
|
59
89
|
goBack();
|
|
60
90
|
} else if (panelKey === "root") {
|
|
61
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
|
|
62
91
|
if ((onBack === null || onBack === void 0 ? void 0 : onBack(history[0], "root")) !== false) {
|
|
63
92
|
setHistory([]);
|
|
64
93
|
}
|
|
@@ -4,9 +4,9 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import { Format } from '@react-fabric/utilities';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { useMemoDebugger } from '../../hooks/useEffectDebugger.js';
|
|
7
|
-
import
|
|
8
|
-
import classes from './Progress.module.css';
|
|
7
|
+
import 'react';
|
|
9
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
+
import { getColor } from '../../utils/getColor.js';
|
|
10
10
|
|
|
11
11
|
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; }
|
|
12
12
|
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,29 +19,51 @@ var SizeMap = {
|
|
|
19
19
|
lg: "1.5rem",
|
|
20
20
|
xl: "2rem"
|
|
21
21
|
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A component that displays a progress bar indicating the completion percentage of a task or operation.
|
|
25
|
+
* The progress bar is styled with a background color and a track that fills based on the value provided.
|
|
26
|
+
* It can also display a label showing the percentage value.
|
|
27
|
+
* The label can be customized or hidden based on the props provided.
|
|
28
|
+
*
|
|
29
|
+
* @param {ProgressProps} props - The properties for the ProgressBar component.
|
|
30
|
+
* @returns {JSX.Element} The rendered ProgressBar component.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```jsx
|
|
34
|
+
* <ProgressBar value={0.75} size="md" color="primary-500" label="Loading" animate />
|
|
35
|
+
* // Renders a progress bar with 75% completion, medium size, primary color, and a label "Loading"
|
|
36
|
+
*
|
|
37
|
+
* <ProgressBar value={0.5} size="lg" color="success-500" />
|
|
38
|
+
* // Renders a progress bar with 50% completion, large size, and success color without a label
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-progress--docs} for more details.
|
|
42
|
+
*/
|
|
22
43
|
var ProgressBar = function ProgressBar(_ref) {
|
|
23
44
|
var _ref$value = _ref.value,
|
|
24
45
|
value = _ref$value === void 0 ? 0 : _ref$value,
|
|
25
46
|
size = _ref.size,
|
|
26
47
|
_ref$color = _ref.color,
|
|
27
|
-
color = _ref$color === void 0 ? "primary" : _ref$color,
|
|
48
|
+
color = _ref$color === void 0 ? "primary-500" : _ref$color,
|
|
28
49
|
_ref$label = _ref.label,
|
|
29
50
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
30
51
|
animate = _ref.animate;
|
|
31
52
|
/** ***************** make sure value is between 0 and 100 *******************/
|
|
32
53
|
var actualValue = useMemoDebugger(function () {
|
|
33
|
-
return Math.min(Math.max(value, 0),
|
|
54
|
+
return Math.min(Math.max(value, 0), 1);
|
|
34
55
|
}, [value], "ProgressBar value");
|
|
35
56
|
var progressVar = useMemoDebugger(function () {
|
|
36
57
|
return {
|
|
37
|
-
"--progress": actualValue
|
|
58
|
+
"--progress": actualValue * 100
|
|
38
59
|
};
|
|
39
60
|
}, [actualValue], "ProgressBar cssVar");
|
|
40
61
|
|
|
41
62
|
/** ***************** component *******************/
|
|
42
63
|
return /*#__PURE__*/jsxs("div", {
|
|
43
|
-
className: classNames(
|
|
64
|
+
className: classNames("fabric-progressbar", "block bg-dimmed relative rounded font-bold overflow-hidden whitespace-nowrap"),
|
|
44
65
|
style: _objectSpread(_objectSpread({}, progressVar), {}, {
|
|
66
|
+
color: getColor(color),
|
|
45
67
|
minHeight: SizeMap[size !== null && size !== void 0 ? size : ""],
|
|
46
68
|
fontSize: SizeMap[size !== null && size !== void 0 ? size : ""]
|
|
47
69
|
}),
|
|
@@ -49,12 +71,12 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
49
71
|
"aria-hidden": "true",
|
|
50
72
|
children: [!["xxs", "xs", "sm"].includes(size !== null && size !== void 0 ? size : "") && /*#__PURE__*/jsxs("div", {
|
|
51
73
|
className: "absolute inset-0 text-center z-0 align-top",
|
|
52
|
-
children: [label, " ", Format.percent(actualValue
|
|
74
|
+
children: [label, " ", Format.percent(actualValue)]
|
|
53
75
|
}), /*#__PURE__*/jsx("div", {
|
|
54
|
-
className: classNames(
|
|
76
|
+
className: classNames("fabric-progressTrack", animate && "fabric-progressAnimate", "h-full overflow-clip bg-current relative z-0")
|
|
55
77
|
}), !["xxs", "xs", "sm"].includes(size !== null && size !== void 0 ? size : "") && /*#__PURE__*/jsx("div", {
|
|
56
78
|
className: classNames("h-full absolute inset-0 overflow-hidden z-1"),
|
|
57
|
-
"data-label": "".concat(label, " ").concat(Format.percent(actualValue
|
|
79
|
+
"data-label": "".concat(label, " ").concat(Format.percent(actualValue))
|
|
58
80
|
})]
|
|
59
81
|
});
|
|
60
82
|
};
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import { Format } from '@react-fabric/utilities';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { useMemoDebugger } from '../../hooks/useEffectDebugger.js';
|
|
6
|
-
import
|
|
6
|
+
import 'react';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
import { getColor } from '../../utils/getColor.js';
|
|
8
9
|
|
|
9
10
|
/*
|
|
10
11
|
* React Fabric
|
|
@@ -36,30 +37,51 @@ var SizeMap = {
|
|
|
36
37
|
lg: "1.5rem",
|
|
37
38
|
xl: "2rem"
|
|
38
39
|
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A circular progress indicator that visually represents a percentage of completion.
|
|
43
|
+
* It displays a circular track with a stroke that fills based on the `value` prop.
|
|
44
|
+
* The component is customizable with size and color props.
|
|
45
|
+
*
|
|
46
|
+
* @param {ProgressProps} props - The properties for the ProgressCircle component.
|
|
47
|
+
* @returns {JSX.Element} - A circular progress indicator.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```jsx
|
|
51
|
+
* <ProgressCircle value={0.75} size="md" color="primary-500" />
|
|
52
|
+
* // Renders a circular progress indicator with 75% completion, medium size, and primary color.
|
|
53
|
+
*
|
|
54
|
+
* <ProgressCircle value={0.5} size="lg" color="secondary-500" />
|
|
55
|
+
* // Renders a circular progress indicator with 50% completion, large size, and secondary color.
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-progress--docs} for more details.
|
|
59
|
+
*/
|
|
39
60
|
var ProgressCircle = function ProgressCircle(_ref) {
|
|
40
61
|
var _ref$value = _ref.value,
|
|
41
62
|
value = _ref$value === void 0 ? 0 : _ref$value,
|
|
42
63
|
_ref$size = _ref.size,
|
|
43
64
|
size = _ref$size === void 0 ? "sm" : _ref$size,
|
|
44
65
|
_ref$color = _ref.color,
|
|
45
|
-
color = _ref$color === void 0 ? "primary" : _ref$color;
|
|
66
|
+
color = _ref$color === void 0 ? "primary-500" : _ref$color;
|
|
46
67
|
/** ***************** make sure value is between 0 and 100 *******************/
|
|
47
68
|
var actualValue = useMemoDebugger(function () {
|
|
48
|
-
return Math.min(Math.max(value, 0),
|
|
69
|
+
return Math.min(Math.max(value, 0), 1);
|
|
49
70
|
}, [value], "ProgressCirle value");
|
|
50
71
|
|
|
51
72
|
/** ***************** calculate stroke offset by actual value *******************/
|
|
52
73
|
var strokeDashoffset = useMemoDebugger(function () {
|
|
53
74
|
var circumfrence = Math.PI * 2 * 44;
|
|
54
|
-
return circumfrence * (1 - actualValue
|
|
75
|
+
return circumfrence * (1 - actualValue);
|
|
55
76
|
}, [actualValue], "ProgressCirle dashOffset");
|
|
56
77
|
|
|
57
78
|
/** ***************** component *******************/
|
|
58
79
|
return /*#__PURE__*/jsxs("div", {
|
|
59
|
-
className: classNames("inline-block w-[4em] h-[4em] text-lg relative"
|
|
80
|
+
className: classNames("inline-block w-[4em] h-[4em] text-lg relative"),
|
|
60
81
|
"aria-hidden": "true",
|
|
61
82
|
style: {
|
|
62
|
-
fontSize: SizeMap[size]
|
|
83
|
+
fontSize: SizeMap[size],
|
|
84
|
+
color: getColor(color)
|
|
63
85
|
},
|
|
64
86
|
children: [/*#__PURE__*/jsxs("svg", {
|
|
65
87
|
viewBox: "0 0 100 100",
|
|
@@ -88,7 +110,7 @@ var ProgressCircle = function ProgressCircle(_ref) {
|
|
|
88
110
|
})]
|
|
89
111
|
}), /*#__PURE__*/jsx("span", {
|
|
90
112
|
className: "flex w-full h-full items-center justify-center select-none font-bold text-[0.625em]",
|
|
91
|
-
children: Format.percent(actualValue
|
|
113
|
+
children: Format.percent(actualValue)
|
|
92
114
|
})]
|
|
93
115
|
});
|
|
94
116
|
};
|