@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
|
@@ -5,15 +5,36 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
|
|
|
5
5
|
var classNames = require('classnames');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var useEffectDebugger = require('../../hooks/useEffectDebugger.js');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
9
|
var getColor = require('../../utils/getColor.js');
|
|
9
10
|
require('@react-fabric/utilities');
|
|
10
|
-
var Animations_module = require('./Animations.module.css');
|
|
11
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
12
11
|
|
|
13
12
|
var _excluded = ["className", "color", "strokeColor", "type"],
|
|
14
13
|
_excluded2 = ["className"];
|
|
15
14
|
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; }
|
|
16
15
|
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; }
|
|
16
|
+
/**
|
|
17
|
+
* A component that displays an animated indicator with a customizable icon type and colors.
|
|
18
|
+
* It can be used to indicate various states such as success, error, or information.
|
|
19
|
+
* The component supports different icon types like check, cross, question, and exclamation.
|
|
20
|
+
* It also allows customization of the icon color and stroke color.
|
|
21
|
+
*
|
|
22
|
+
* @param {AnimationProps} props - The properties for the AnimationIndicator component.
|
|
23
|
+
* @returns {JSX.Element} The rendered AnimationIndicator component.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```jsx
|
|
27
|
+
* <AnimationIndicator
|
|
28
|
+
* type="check"
|
|
29
|
+
* color="primary-500"
|
|
30
|
+
* strokeColor="primary-700"
|
|
31
|
+
* className="my-custom-class"
|
|
32
|
+
* aria-label="Loading"
|
|
33
|
+
* />
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
37
|
+
*/
|
|
17
38
|
var AnimationIndicator = function AnimationIndicator(_ref) {
|
|
18
39
|
var className = _ref.className,
|
|
19
40
|
color = _ref.color,
|
|
@@ -40,41 +61,81 @@ var AnimationIndicator = function AnimationIndicator(_ref) {
|
|
|
40
61
|
/** ***************** component *******************/
|
|
41
62
|
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread(_objectSpread({
|
|
42
63
|
"data-ref": "animated-indicator",
|
|
43
|
-
className: classNames(
|
|
64
|
+
className: classNames("fabric-checkAnimation", className, "inline-block rounded-full"),
|
|
44
65
|
style: styles,
|
|
45
66
|
xmlns: "http://www.w3.org/2000/svg",
|
|
46
67
|
viewBox: "0 0 52 52",
|
|
47
68
|
"aria-hidden": "true"
|
|
48
69
|
}, aria), {}, {
|
|
49
70
|
children: [/*#__PURE__*/jsxRuntime.jsx("circle", {
|
|
50
|
-
className:
|
|
71
|
+
className: "fabric-circlePart",
|
|
51
72
|
cx: "26",
|
|
52
73
|
cy: "26",
|
|
53
74
|
r: "25"
|
|
54
75
|
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
55
|
-
className: classNames(
|
|
76
|
+
className: classNames("fabric-iconPart"),
|
|
77
|
+
style: {
|
|
78
|
+
color: strokeColor ? getColor.getColor(strokeColor) : "var(--text-color-invert)"
|
|
79
|
+
},
|
|
56
80
|
d: path
|
|
57
81
|
})]
|
|
58
82
|
}));
|
|
59
83
|
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* A component that displays an animated bars loader.
|
|
87
|
+
* It can be customized with color and size properties.
|
|
88
|
+
* This component is typically used to indicate loading states in the UI.
|
|
89
|
+
*
|
|
90
|
+
* @param {Object} props - The properties for the AnimationBars component.
|
|
91
|
+
* @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the bars.
|
|
92
|
+
* @param {number | string} [props.size="2rem"] - The size of the bars.
|
|
93
|
+
* @returns {JSX.Element} The rendered AnimationBars component.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```jsx
|
|
97
|
+
* <AnimationBars color="primary-500" size="3rem" />
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
101
|
+
*/
|
|
60
102
|
var AnimationBars = function AnimationBars(_ref2) {
|
|
61
103
|
var _ref2$color = _ref2.color,
|
|
62
|
-
color = _ref2$color === void 0 ? "tint" : _ref2$color,
|
|
104
|
+
color = _ref2$color === void 0 ? "tint-500" : _ref2$color,
|
|
63
105
|
_ref2$size = _ref2.size,
|
|
64
106
|
size = _ref2$size === void 0 ? "2rem" : _ref2$size;
|
|
65
107
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
66
108
|
className: classNames("absolute inset-0 z-10 flex justify-center items-center cursor-wait"),
|
|
67
109
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
68
|
-
className: classNames("outline outline-tint-500/20 p-4 bg-
|
|
110
|
+
className: classNames("outline outline-tint-500/20 p-4 bg-tint-50/50 backdrop-blur-sm rounded"),
|
|
69
111
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
70
|
-
className: classNames(
|
|
112
|
+
className: classNames("fabric-bars"),
|
|
71
113
|
style: {
|
|
72
|
-
width: size
|
|
114
|
+
width: size,
|
|
115
|
+
color: getColor.getColor(color)
|
|
73
116
|
}
|
|
74
117
|
})
|
|
75
118
|
})
|
|
76
119
|
});
|
|
77
120
|
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* A component that displays a spinner animation.
|
|
124
|
+
* It can be customized with color and size properties.
|
|
125
|
+
* This component is typically used to indicate loading states in the UI.
|
|
126
|
+
*
|
|
127
|
+
* @param {Object} props - The properties for the AnimationSpinner component.
|
|
128
|
+
* @param {ColorType | PaletteType | string} [props.color="tint-700"] - The color of the spinner.
|
|
129
|
+
* @param {number | string} [props.size="2rem"] - The size of the spinner.
|
|
130
|
+
* @returns {JSX.Element} The rendered AnimationSpinner component.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```jsx
|
|
134
|
+
* <AnimationSpinner color="primary-500" size="3rem" />
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
138
|
+
*/
|
|
78
139
|
var AnimationSpinner = function AnimationSpinner(_ref3) {
|
|
79
140
|
var _ref3$color = _ref3.color,
|
|
80
141
|
color = _ref3$color === void 0 ? "tint-700" : _ref3$color,
|
|
@@ -82,33 +143,43 @@ var AnimationSpinner = function AnimationSpinner(_ref3) {
|
|
|
82
143
|
size = _ref3$size === void 0 ? "2rem" : _ref3$size;
|
|
83
144
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
84
145
|
className: classNames("absolute inset-0 z-10 flex justify-center items-center cursor-wait"),
|
|
85
|
-
"data-
|
|
146
|
+
"data-ref": "spinner",
|
|
86
147
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
87
|
-
className: classNames("outline outline-tint-500/20 p-4 bg-
|
|
148
|
+
className: classNames("outline outline-tint-500/20 p-4 bg-tint-50/50 backdrop-blur-sm rounded"),
|
|
88
149
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
89
|
-
className: classNames(
|
|
150
|
+
className: classNames("fabric-spinner"),
|
|
90
151
|
style: {
|
|
91
|
-
width: size
|
|
152
|
+
width: size,
|
|
153
|
+
color: getColor.getColor(color)
|
|
92
154
|
}
|
|
93
155
|
})
|
|
94
156
|
})
|
|
95
157
|
});
|
|
96
158
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* A component that displays a skeleton loader with a placeholder for content.
|
|
162
|
+
* It can be customized with color and size properties.
|
|
163
|
+
* This component is typically used to indicate loading states in the cards, panels and virtual lists,
|
|
164
|
+
* providing a visual placeholder for content that is being loaded.
|
|
165
|
+
*
|
|
166
|
+
* @param {CssProp} props - The properties for the Skeleton component.
|
|
167
|
+
* @returns {JSX.Element} The rendered Skeleton component.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```jsx
|
|
171
|
+
* <Skeleton className="my-skeleton" />
|
|
172
|
+
* * // Renders a skeleton loader with a placeholder for content.
|
|
173
|
+
* ```
|
|
174
|
+
*
|
|
175
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
176
|
+
*/
|
|
106
177
|
var Skeleton = function Skeleton(_ref4) {
|
|
107
178
|
var className = _ref4.className,
|
|
108
179
|
rest = _objectWithoutProperties(_ref4, _excluded2);
|
|
109
180
|
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({
|
|
110
181
|
className: classNames(className, "p-2 animate-pulse flex gap-2 max-w-lg"),
|
|
111
|
-
"data-
|
|
182
|
+
"data-ref": "skeleton"
|
|
112
183
|
}, rest), {}, {
|
|
113
184
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
114
185
|
className: "bg-tint-100 rounded aspect-square h-12"
|
|
@@ -135,6 +206,22 @@ var Skeleton = function Skeleton(_ref4) {
|
|
|
135
206
|
}));
|
|
136
207
|
};
|
|
137
208
|
|
|
209
|
+
/**
|
|
210
|
+
* A component that displays a loading animation with a top border.
|
|
211
|
+
* It is typically used to indicate that content is being loaded in pages and page sections.
|
|
212
|
+
*
|
|
213
|
+
* @returns {JSX.Element} The rendered Loading component.
|
|
214
|
+
*/
|
|
215
|
+
var Loading = function Loading() {
|
|
216
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
217
|
+
className: classNames("fabric-loader", "area-[loader] relative overflow-x-clip"),
|
|
218
|
+
"data-ref": "loading",
|
|
219
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
220
|
+
className: "absolute z-10 py-px inset-x-0 top-0 after:h-0.5 after:block after:bg-primary-500"
|
|
221
|
+
})
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
|
|
138
225
|
exports.AnimationBars = AnimationBars;
|
|
139
226
|
exports.AnimationIndicator = AnimationIndicator;
|
|
140
227
|
exports.AnimationSpinner = AnimationSpinner;
|
|
@@ -7,11 +7,10 @@ var utilities = require('@react-fabric/utilities');
|
|
|
7
7
|
var BoringAvatar = require('boring-avatars');
|
|
8
8
|
var classNames = require('classnames');
|
|
9
9
|
var react = require('react');
|
|
10
|
-
var getColor = require('../../utils/getColor.js');
|
|
11
|
-
var Avatar_module = require('./Avatar.module.css');
|
|
12
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
+
var getColor = require('../../utils/getColor.js');
|
|
13
12
|
|
|
14
|
-
var _excluded = ["ref", "name", "avatar", "fallbackIcon", "bg", "color", "size", "rounded", "variant", "className", "viewBox", "onClick"];
|
|
13
|
+
var _excluded = ["ref", "name", "avatar", "fallbackIcon", "bg", "color", "size", "rounded", "variant", "className", "viewBox", "preventDefault", "onClick"];
|
|
15
14
|
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; }
|
|
16
15
|
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
16
|
var SizeMap = {
|
|
@@ -23,7 +22,32 @@ var SizeMap = {
|
|
|
23
22
|
};
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
|
-
*
|
|
25
|
+
* A component that displays an avatar image or a fallback icon with customizable styles and properties.
|
|
26
|
+
* It supports various avatar types, including text-based avatars, and allows for customization of background color, icon color, size, and rounded corners.
|
|
27
|
+
* This component is useful for displaying user avatars in applications, providing a visual representation of users or entities.
|
|
28
|
+
* It can also handle cases where the avatar image fails to load by displaying a fallback icon or text.
|
|
29
|
+
* It uses the Boring Avatars library for generating fallback avatars based on the user's name.
|
|
30
|
+
*
|
|
31
|
+
* @param {AvatarProps} props - The properties for the Avatar component.
|
|
32
|
+
* @returns {JSX.Element} The rendered Avatar component.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```jsx
|
|
36
|
+
* <Avatar
|
|
37
|
+
* name="John Doe"
|
|
38
|
+
* avatar="https://example.com/avatar.jpg"
|
|
39
|
+
* fallbackIcon="fas fa-user"
|
|
40
|
+
* bg="bg-blue-500"
|
|
41
|
+
* color="text-white"
|
|
42
|
+
* size="md"
|
|
43
|
+
* rounded
|
|
44
|
+
* variant="beam"
|
|
45
|
+
* onClick={() => console.log("Avatar clicked")}
|
|
46
|
+
* />
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-avatar--docs} for more details.
|
|
50
|
+
* @see {@link https://boringavatars.com/} for more information on Boring Avatars.
|
|
27
51
|
*/
|
|
28
52
|
var Avatar = function Avatar(_ref) {
|
|
29
53
|
var ref = _ref.ref,
|
|
@@ -40,14 +64,16 @@ var Avatar = function Avatar(_ref) {
|
|
|
40
64
|
className = _ref.className,
|
|
41
65
|
_ref$viewBox = _ref.viewBox,
|
|
42
66
|
viewBox = _ref$viewBox === void 0 ? "0 0 24 24" : _ref$viewBox,
|
|
43
|
-
|
|
67
|
+
preventDefault = _ref.preventDefault,
|
|
68
|
+
_onClick = _ref.onClick,
|
|
44
69
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
45
70
|
var _useState = react.useState(true),
|
|
46
71
|
_useState2 = _slicedToArray(_useState, 2),
|
|
47
72
|
fallback = _useState2[0],
|
|
48
73
|
setFallback = _useState2[1];
|
|
49
74
|
|
|
50
|
-
|
|
75
|
+
// Memoize styles to avoid unnecessary recalculations
|
|
76
|
+
// and to ensure styles are only recalculated when dependencies change
|
|
51
77
|
var styles = react.useMemo(function () {
|
|
52
78
|
var s = {};
|
|
53
79
|
if (bg) {
|
|
@@ -65,13 +91,14 @@ var Avatar = function Avatar(_ref) {
|
|
|
65
91
|
return s;
|
|
66
92
|
}, [bg, color, size]);
|
|
67
93
|
|
|
68
|
-
|
|
94
|
+
// avatar image
|
|
95
|
+
// if avatar is not provided, fallback to icon or text
|
|
69
96
|
var avatarImage = react.useMemo(function () {
|
|
70
97
|
setFallback(!avatar);
|
|
71
98
|
return avatar && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
72
99
|
className: "contents",
|
|
73
100
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
74
|
-
className: classNames(
|
|
101
|
+
className: classNames("fabric-imgPlaceholder", "absolute inset-0 bg-gray animate-pulse")
|
|
75
102
|
}), /*#__PURE__*/jsxRuntime.jsx("img", {
|
|
76
103
|
src: avatar,
|
|
77
104
|
alt: avatar,
|
|
@@ -86,10 +113,13 @@ var Avatar = function Avatar(_ref) {
|
|
|
86
113
|
})]
|
|
87
114
|
});
|
|
88
115
|
}, [avatar]);
|
|
116
|
+
|
|
117
|
+
// render fallback icon or text
|
|
89
118
|
var fallbackAvatar = react.useMemo(function () {
|
|
90
119
|
if (fallbackIcon) {
|
|
91
120
|
return utilities.isSvgPath(fallbackIcon) ? /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
92
121
|
viewBox: viewBox,
|
|
122
|
+
className: "p-[0.125em]",
|
|
93
123
|
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
94
124
|
fill: "currentColor",
|
|
95
125
|
d: fallbackIcon.toString()
|
|
@@ -99,8 +129,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
99
129
|
});
|
|
100
130
|
}
|
|
101
131
|
if (variant === "text") {
|
|
102
|
-
var
|
|
103
|
-
var _ref2 = (_name$match = name.match(/(?=(\w).* (\w).*)|(?=(\w\w).*)/)) !== null && _name$match !== void 0 ? _name$match : [],
|
|
132
|
+
var _ref2 = name.match(/(?=(\w).* (\w).*)|(?=(\w\w).*)/),
|
|
104
133
|
_ref3 = _slicedToArray(_ref2, 4),
|
|
105
134
|
first = _ref3[1],
|
|
106
135
|
second = _ref3[2],
|
|
@@ -121,6 +150,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
121
150
|
})
|
|
122
151
|
});
|
|
123
152
|
}
|
|
153
|
+
// Fallback to BoringAvatar
|
|
124
154
|
return /*#__PURE__*/jsxRuntime.jsx(BoringAvatar, {
|
|
125
155
|
square: true,
|
|
126
156
|
size: 64,
|
|
@@ -130,10 +160,13 @@ var Avatar = function Avatar(_ref) {
|
|
|
130
160
|
}, [name, variant, fallbackIcon]);
|
|
131
161
|
return /*#__PURE__*/jsxRuntime.jsxs("dfn", _objectSpread(_objectSpread({
|
|
132
162
|
role: "presentation",
|
|
133
|
-
className: classNames(
|
|
134
|
-
onClick: onClick
|
|
163
|
+
className: classNames("fabric-avatar", className, "select-none relative overflow-hidden inline-block box-content leading-none not-italic text-center", !rounded && "rounded", rounded && "rounded-full"),
|
|
164
|
+
onClick: function onClick(e) {
|
|
165
|
+
preventDefault && e.preventDefault();
|
|
166
|
+
_onClick === null || _onClick === void 0 || _onClick(e);
|
|
167
|
+
},
|
|
135
168
|
style: styles,
|
|
136
|
-
"data-clickable": !!
|
|
169
|
+
"data-clickable": !!_onClick,
|
|
137
170
|
ref: ref
|
|
138
171
|
}, aria), {}, {
|
|
139
172
|
children: [!fallback && avatarImage, fallback && fallbackAvatar]
|
|
@@ -5,7 +5,6 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
|
|
|
5
5
|
var classNames = require('classnames');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var useEffectDebugger = require('../../hooks/useEffectDebugger.js');
|
|
8
|
-
var Avatar_module = require('./Avatar.module.css');
|
|
9
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
9
|
|
|
11
10
|
var _excluded = ["ref", "children", "className", "totalCount", "rounded", "size"];
|
|
@@ -20,7 +19,25 @@ var SizeMap = {
|
|
|
20
19
|
};
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
22
|
+
* A component that groups multiple avatars together, displaying a count of additional avatars if the total exceeds the visible ones.
|
|
23
|
+
* It allows customization of size, rounding, and additional aria attributes.
|
|
24
|
+
* This component is useful for displaying a collection of user avatars in a compact format, such as in a chat application or user list.
|
|
25
|
+
* It automatically calculates the number of additional avatars based on the `totalCount` prop and the number of children provided.
|
|
26
|
+
*
|
|
27
|
+
* @param {AvatarGroupProps} props - The properties for the AvatarGroup component.
|
|
28
|
+
* @returns {JSX.Element} The rendered AvatarGroup component.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```jsx
|
|
32
|
+
* <AvatarGroup totalCount={5} size="md" className="my-avatar-group">
|
|
33
|
+
* <Avatar name="John Doe" avatar="https://example.com/avatar1.jpg" />
|
|
34
|
+
* <Avatar name="Jane Smith" avatar="https://example.com/avatar2.jpg" />
|
|
35
|
+
* <Avatar name="Alice Johnson" avatar="https://example.com/avatar3.jpg" />
|
|
36
|
+
* <Avatar name="Bob Brown" avatar="https://example.com/avatar4.jpg" />
|
|
37
|
+
* </AvatarGroup>
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-avatar--docs} for more details.
|
|
24
41
|
*/
|
|
25
42
|
var AvatarGroup = function AvatarGroup(_ref) {
|
|
26
43
|
var ref = _ref.ref,
|
|
@@ -49,10 +66,11 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
49
66
|
}, [avatars, totalCount]);
|
|
50
67
|
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({}, aria), {}, {
|
|
51
68
|
ref: ref,
|
|
52
|
-
className: classNames(
|
|
69
|
+
className: classNames("fabric-avatarGroup", className, "inline-flex flex-nowrap", !rounded && "rounded", rounded && "rounded-full"),
|
|
53
70
|
style: styles,
|
|
54
71
|
children: [avatars, !!diff && /*#__PURE__*/jsxRuntime.jsx("dfn", {
|
|
55
|
-
|
|
72
|
+
"data-ref": "avatarCount",
|
|
73
|
+
className: classNames("fabric-avatar", "select-none relative overflow-hidden inline-block box-content leading-none not-italic text-center", "fabric-avatarGroup--extra"),
|
|
56
74
|
children: /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
57
75
|
children: /*#__PURE__*/jsxRuntime.jsx("text", {
|
|
58
76
|
x: "50%",
|
|
@@ -6,14 +6,20 @@ var utilities = require('@react-fabric/utilities');
|
|
|
6
6
|
var classNames = require('classnames');
|
|
7
7
|
var react = require('react');
|
|
8
8
|
var Icon = require('../icon/Icon.js');
|
|
9
|
-
var Badge_module = require('./Badge.module.css');
|
|
10
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
10
|
|
|
12
|
-
var _excluded = ["ref", "className", "value", "max", "ping", "block", "placement", "children", "forButton", "icon"
|
|
11
|
+
var _excluded = ["ref", "className", "value", "max", "ping", "block", "inline", "placement", "children", "forButton", "icon"];
|
|
13
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
13
|
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; }
|
|
14
|
+
/**
|
|
15
|
+
* Utility function to get badge properties from a badge value or object.
|
|
16
|
+
* It checks if the badge is an object and returns its properties,
|
|
17
|
+
*
|
|
18
|
+
* @param {string | number | BadgeType} badge - The badge value or object.
|
|
19
|
+
* @returns {AnyObject} An object containing badge properties.
|
|
20
|
+
*/
|
|
15
21
|
var getBadgeProps = function getBadgeProps(badge) {
|
|
16
|
-
if (utilities.isObject(badge)) {
|
|
22
|
+
if (utilities.isObject(badge) && ! /*#__PURE__*/react.isValidElement(badge)) {
|
|
17
23
|
return Object.assign({
|
|
18
24
|
forButton: true,
|
|
19
25
|
placement: ""
|
|
@@ -26,6 +32,25 @@ var getBadgeProps = function getBadgeProps(badge) {
|
|
|
26
32
|
};
|
|
27
33
|
}
|
|
28
34
|
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A component that displays a badge with a value, icon, and optional ping animation.
|
|
38
|
+
* It can be used to indicate notifications, messages, or other important information.
|
|
39
|
+
* It supports various placements, inline or block display, and custom styling.
|
|
40
|
+
* It can also wrap children elements, allowing for flexible usage in buttons or other components.
|
|
41
|
+
*
|
|
42
|
+
* @param {BadgeProps} props - The properties for the Badge component.
|
|
43
|
+
* @returns {JSX.Element} The rendered Badge component.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```jsx
|
|
47
|
+
* <Badge value={5} max={10} ping>
|
|
48
|
+
* <button>Notifications</button>
|
|
49
|
+
* </Badge>
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-badge--docs} for more details.
|
|
53
|
+
*/
|
|
29
54
|
var Badge = function Badge(_ref) {
|
|
30
55
|
var ref = _ref.ref,
|
|
31
56
|
className = _ref.className,
|
|
@@ -33,17 +58,18 @@ var Badge = function Badge(_ref) {
|
|
|
33
58
|
max = _ref.max,
|
|
34
59
|
ping = _ref.ping,
|
|
35
60
|
block = _ref.block,
|
|
61
|
+
inline = _ref.inline,
|
|
36
62
|
_ref$placement = _ref.placement,
|
|
37
63
|
placement = _ref$placement === void 0 ? "top-end" : _ref$placement,
|
|
38
64
|
children = _ref.children,
|
|
39
65
|
_ref$forButton = _ref.forButton,
|
|
40
66
|
forButton = _ref$forButton === void 0 ? false : _ref$forButton,
|
|
41
67
|
icon = _ref.icon,
|
|
42
|
-
iconBg = _ref.iconBg,
|
|
43
|
-
iconColor = _ref.iconColor,
|
|
44
|
-
rtlFlip = _ref.rtlFlip,
|
|
45
68
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
46
69
|
var label = react.useMemo(function () {
|
|
70
|
+
if ( /*#__PURE__*/react.isValidElement(value)) {
|
|
71
|
+
return value;
|
|
72
|
+
}
|
|
47
73
|
if (!utilities.isNil(value)) {
|
|
48
74
|
if (utilities.isNumber(value) && max && value > max) {
|
|
49
75
|
return "".concat(max, "+");
|
|
@@ -59,23 +85,18 @@ var Badge = function Badge(_ref) {
|
|
|
59
85
|
* wrap children in a relative div to float badge, wrapper allows for floating a badge on elements with overflow hidden
|
|
60
86
|
*/
|
|
61
87
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
62
|
-
className: classNames(forButton ? "contents" :
|
|
88
|
+
className: classNames(forButton || inline ? "contents" : block ? "block" : "inline-block", forButton || inline ? "" : "relative"),
|
|
63
89
|
children: [children && /*#__PURE__*/react.cloneElement(children, _objectSpread(_objectSpread({}, rest), {}, {
|
|
64
90
|
ref: innerRef
|
|
65
|
-
})), (!!ping || label) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
91
|
+
})), (!!ping || (label !== null && label !== void 0 ? label : icon)) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
66
92
|
"data-ref": "badge",
|
|
67
93
|
"data-ping": ping,
|
|
68
94
|
"data-placement": placement,
|
|
69
|
-
className: classNames(
|
|
95
|
+
className: classNames("fabric-badge", className, "inline-block p-px min-w-2 min-h-2 text-center select-none rounded-full leading-none z-2 pointer-events-none", forButton && !placement || inline ? "relative flex-content" : "absolute"),
|
|
70
96
|
children: [label && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
71
97
|
className: "p-1",
|
|
72
98
|
children: label
|
|
73
|
-
}), icon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, {
|
|
74
|
-
icon: icon,
|
|
75
|
-
bg: iconBg,
|
|
76
|
-
color: iconColor,
|
|
77
|
-
rtlFlip: rtlFlip
|
|
78
|
-
})]
|
|
99
|
+
}), icon && /*#__PURE__*/jsxRuntime.jsx(Icon.Icon, _objectSpread({}, Icon.getIconProps(icon)))]
|
|
79
100
|
})]
|
|
80
101
|
});
|
|
81
102
|
};
|
|
@@ -5,14 +5,42 @@ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
|
5
5
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
6
|
var classNames = require('classnames');
|
|
7
7
|
var react = require('react');
|
|
8
|
-
var
|
|
8
|
+
var Anchor = require('../../typography/Anchor.js');
|
|
9
9
|
var Dropdown = require('../dropdown/Dropdown.js');
|
|
10
|
-
var Breadcrumbs_module = require('./Breadcrumbs.module.css');
|
|
11
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
12
11
|
|
|
13
12
|
var _excluded = ["variant", "className", "separator", "children", "color"];
|
|
14
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; }
|
|
15
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 navigation component that displays the current page's location within a hierarchy and allows users to navigate back to previous pages.
|
|
17
|
+
* It supports different styles, separators, and colors, and can handle a variable number of breadcrumb links.
|
|
18
|
+
* This component is useful for enhancing user navigation experience in applications with multiple levels of content hierarchy.
|
|
19
|
+
* It automatically manages the display of overflow items when there are too many links to fit in the available space, providing a dropdown for additional links.
|
|
20
|
+
*
|
|
21
|
+
* @param {BreadcrumbProps} props - The properties for the Breadcrumbs component.
|
|
22
|
+
* @returns {JSX.Element} The rendered Breadcrumbs component.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```jsx
|
|
26
|
+
* <Breadcrumbs
|
|
27
|
+
* variant="classic"
|
|
28
|
+
* separator=">"
|
|
29
|
+
* color="primary"
|
|
30
|
+
* className="my-custom-class"
|
|
31
|
+
* aria-label="Breadcrumbs"
|
|
32
|
+
* >
|
|
33
|
+
* <Anchor href="/">Home</Anchor>
|
|
34
|
+
* <Anchor href="/products">Products</Anchor>
|
|
35
|
+
* <Anchor href="/products/shoes">Shoes</Anchor>
|
|
36
|
+
* <Anchor href="/products/shoes/sneakers">Sneakers</Anchor>
|
|
37
|
+
* <Anchor href="/products/shoes/sneakers/nike">Nike</Anchor>
|
|
38
|
+
* <Anchor href="/products/shoes/sneakers/nike/airmax">Air Max</Anchor>
|
|
39
|
+
* </Breadcrumbs>
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-breadcrumbs--docs} for more details.
|
|
43
|
+
*/
|
|
16
44
|
var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
17
45
|
var _ref$variant = _ref.variant,
|
|
18
46
|
variant = _ref$variant === void 0 ? "classic" : _ref$variant,
|
|
@@ -23,7 +51,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
|
23
51
|
color = _ref.color,
|
|
24
52
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
25
53
|
var _useMemo = react.useMemo(function () {
|
|
26
|
-
var nodeList = react.Children.toArray(children);
|
|
54
|
+
var nodeList = react.Children.toArray(children).filter(Boolean);
|
|
27
55
|
if (nodeList.length > 7) {
|
|
28
56
|
return [nodeList.slice(0, 3), nodeList.slice(3, -3), nodeList.slice(-3)];
|
|
29
57
|
}
|
|
@@ -34,13 +62,14 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
|
34
62
|
overflow = _useMemo2[1],
|
|
35
63
|
end = _useMemo2[2];
|
|
36
64
|
return /*#__PURE__*/jsxRuntime.jsxs("nav", _objectSpread(_objectSpread({
|
|
65
|
+
"data-ref": "breadcrumbs",
|
|
37
66
|
"data-color": color,
|
|
38
67
|
"data-variant": variant,
|
|
39
|
-
className: classNames(
|
|
68
|
+
className: classNames("fabric-breadcrumbs", className, "flex flex-nowrap items-center")
|
|
40
69
|
}, aria), {}, {
|
|
41
70
|
children: [start.map(function (link, idx) {
|
|
42
71
|
return /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
43
|
-
className:
|
|
72
|
+
className: "fabric-breadcrumbLink",
|
|
44
73
|
"data-separator": separator,
|
|
45
74
|
children: link
|
|
46
75
|
}, idx);
|
|
@@ -48,19 +77,21 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
|
48
77
|
closeOnClick: true,
|
|
49
78
|
showArrow: true,
|
|
50
79
|
children: [/*#__PURE__*/jsxRuntime.jsx("li", {
|
|
51
|
-
className:
|
|
80
|
+
className: "fabric-breadcrumbLink",
|
|
52
81
|
"data-separator": separator,
|
|
53
|
-
|
|
82
|
+
"data-ref": "breadcrumbOverflow",
|
|
83
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Anchor.Anchor, {
|
|
84
|
+
"data-": true,
|
|
54
85
|
children: "..."
|
|
55
86
|
})
|
|
56
87
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
57
88
|
"data-color": color,
|
|
58
|
-
className: classNames(
|
|
89
|
+
className: classNames("fabric-breadcrumbOverflow", "flex flex-col"),
|
|
59
90
|
children: overflow
|
|
60
91
|
})]
|
|
61
92
|
}), end === null || end === void 0 ? void 0 : end.map(function (link, idx) {
|
|
62
93
|
return /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
63
|
-
className:
|
|
94
|
+
className: "fabric-breadcrumbLink",
|
|
64
95
|
"data-separator": separator,
|
|
65
96
|
children: link
|
|
66
97
|
}, idx);
|