@react-fabric/core 1.0.0-beta.4 → 1.0.0-beta.40
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} +49 -44
- package/{src/components/button/Button.module.css → css/components/_button.css} +68 -78
- package/{src/components/card/Card.module.css → css/components/_card.css} +32 -28
- package/{src/components/chip/Chip.module.css → css/components/_chip.css} +15 -11
- package/{src/components/collapsable/Collapsable.module.css → css/components/_collapsable.css} +3 -3
- package/css/components/_divider.css +32 -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} +8 -5
- package/{src/components/media/Media.module.css → css/components/_media.css} +17 -17
- package/{src/components/menu/Menu.module.css → css/components/_menu.css} +15 -16
- 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} +6 -6
- 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/{src/components/tabpanel/TabPanel.module.css → css/components/_tabPanel.css} +73 -84
- 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} +25 -18
- package/{src/core/aside/Aside.module.css → css/core/_aside.css} +42 -42
- 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 +41 -223
- package/css/reset/_text.css +14 -29
- package/css/reset/_theme.css +315 -32
- 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 +530 -0
- package/css/theme/index.css +44 -0
- package/dist/cjs/components/actionLabel/ActionLabel.js +3 -3
- package/dist/cjs/components/animations/Animations.js +29 -18
- package/dist/cjs/components/avatar/Avatar.js +10 -13
- package/dist/cjs/components/avatar/AvatarGroup.js +3 -3
- package/dist/cjs/components/badge/Badge.js +5 -5
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +10 -8
- package/dist/cjs/components/button/Button.js +18 -14
- package/dist/cjs/components/button/ButtonGroup.js +4 -3
- package/dist/cjs/components/button/ConfirmButton.js +7 -2
- package/dist/cjs/components/button/ToggleButtonGroup.js +3 -3
- package/dist/cjs/components/callout/Callout.js +15 -4
- package/dist/cjs/components/card/Card.js +8 -7
- package/dist/cjs/components/card/CardCover.js +10 -5
- package/dist/cjs/components/chip/Chip.js +11 -7
- package/dist/cjs/components/collapsable/Collapsable.js +5 -5
- package/dist/cjs/components/divider/Divider.js +10 -7
- package/dist/cjs/components/dropdown/Dropdown.js +5 -4
- package/dist/cjs/components/dropdown/DropdownTool.js +4 -3
- package/dist/cjs/components/icon/Icon.js +15 -14
- package/dist/cjs/components/media/Media.js +116 -75
- package/dist/cjs/components/menu/ContextMenu.js +30 -10
- package/dist/cjs/components/menu/Menu.js +39 -20
- package/dist/cjs/components/menu/MenuItem.js +30 -16
- package/dist/cjs/components/meter/Meter.js +2 -3
- package/dist/cjs/components/navigator/Navigator.js +16 -9
- package/dist/cjs/components/panel/Panel.js +10 -9
- package/dist/cjs/components/panel/PanelGroup.js +1 -2
- package/dist/cjs/components/progress/ProgressBar.js +6 -5
- package/dist/cjs/components/progress/ProgressCircle.js +6 -4
- package/dist/cjs/components/tabpanel/Tab.js +58 -38
- package/dist/cjs/components/tabpanel/TabPanel.js +20 -16
- package/dist/cjs/core/aside/Aside.js +11 -10
- package/dist/cjs/core/boundary/ErrorBoundary.js +6 -7
- package/dist/cjs/core/boundary/ErrorIcon.js +1 -2
- package/dist/cjs/core/content/Content.js +9 -7
- package/dist/cjs/core/headfoot/HeadFoot.js +2 -20
- package/dist/cjs/core/page/Page.js +3 -3
- package/dist/cjs/core/responsive/Responsive.js +3 -4
- package/dist/cjs/core/section/Section.js +1 -2
- package/dist/cjs/core/theme/ThemeProvider.js +7 -8
- package/dist/cjs/core/viewport/Viewport.js +4 -2
- package/dist/cjs/hooks/useNavigator.js +6 -4
- package/dist/cjs/hotkeys/HotKeyLabel.js +1 -1
- package/dist/cjs/hotkeys/HotKeyWrapper.js +3 -1
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/overlays/alert/Alert.js +19 -13
- package/dist/cjs/overlays/flyout/Flyout.js +42 -44
- package/dist/cjs/overlays/message/Message.js +6 -3
- package/dist/cjs/overlays/modal/Modal.js +9 -10
- package/dist/cjs/overlays/toast/Toast.js +17 -9
- package/dist/cjs/overlays/tooltip/Tooltip.js +20 -8
- package/dist/cjs/types/icons.js +4 -0
- package/dist/cjs/typography/Abbr.js +2 -3
- package/dist/cjs/typography/{Link.js → Anchor.js} +5 -4
- package/dist/cjs/typography/Mark.js +2 -3
- package/dist/cjs/typography/Text.js +3 -4
- package/dist/cjs/typography/Title.js +3 -3
- package/dist/cjs/utils/cloneElement.js +44 -0
- package/dist/cjs/utils/getColor.js +1 -18
- package/dist/esm/components/actionLabel/ActionLabel.js +3 -3
- package/dist/esm/components/animations/Animations.js +30 -19
- package/dist/esm/components/avatar/Avatar.js +11 -14
- package/dist/esm/components/avatar/AvatarGroup.js +3 -3
- package/dist/esm/components/badge/Badge.js +5 -5
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +10 -8
- package/dist/esm/components/button/Button.js +18 -14
- package/dist/esm/components/button/ButtonGroup.js +5 -4
- package/dist/esm/components/button/ConfirmButton.js +7 -2
- package/dist/esm/components/button/ToggleButtonGroup.js +4 -4
- package/dist/esm/components/callout/Callout.js +15 -4
- package/dist/esm/components/card/Card.js +8 -7
- package/dist/esm/components/card/CardCover.js +10 -5
- package/dist/esm/components/chip/Chip.js +12 -8
- package/dist/esm/components/collapsable/Collapsable.js +5 -5
- package/dist/esm/components/divider/Divider.js +11 -8
- package/dist/esm/components/dropdown/Dropdown.js +5 -4
- package/dist/esm/components/dropdown/DropdownTool.js +4 -3
- package/dist/esm/components/icon/Icon.js +15 -14
- package/dist/esm/components/media/Media.js +117 -76
- package/dist/esm/components/menu/ContextMenu.js +32 -12
- package/dist/esm/components/menu/Menu.js +41 -22
- package/dist/esm/components/menu/MenuItem.js +24 -10
- package/dist/esm/components/meter/Meter.js +2 -3
- package/dist/esm/components/navigator/Navigator.js +16 -9
- package/dist/esm/components/panel/Panel.js +10 -9
- package/dist/esm/components/panel/PanelGroup.js +1 -2
- package/dist/esm/components/progress/ProgressBar.js +6 -5
- package/dist/esm/components/progress/ProgressCircle.js +6 -4
- package/dist/esm/components/tabpanel/Tab.js +59 -39
- package/dist/esm/components/tabpanel/TabPanel.js +20 -16
- package/dist/esm/core/aside/Aside.js +11 -10
- package/dist/esm/core/boundary/ErrorBoundary.js +6 -7
- package/dist/esm/core/boundary/ErrorIcon.js +1 -2
- package/dist/esm/core/content/Content.js +9 -7
- package/dist/esm/core/headfoot/HeadFoot.js +2 -20
- package/dist/esm/core/page/Page.js +3 -3
- package/dist/esm/core/responsive/Responsive.js +3 -4
- package/dist/esm/core/section/Section.js +1 -2
- package/dist/esm/core/theme/ThemeProvider.js +7 -8
- package/dist/esm/core/viewport/Viewport.js +4 -2
- package/dist/esm/hooks/useNavigator.js +7 -5
- package/dist/esm/hotkeys/HotKeyLabel.js +1 -1
- package/dist/esm/hotkeys/HotKeyWrapper.js +3 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/overlays/alert/Alert.js +20 -14
- package/dist/esm/overlays/flyout/Flyout.js +43 -45
- package/dist/esm/overlays/message/Message.js +7 -4
- package/dist/esm/overlays/modal/Modal.js +10 -11
- package/dist/esm/overlays/toast/Toast.js +18 -10
- package/dist/esm/overlays/tooltip/Tooltip.js +20 -8
- package/dist/esm/types/icons.js +4 -0
- package/dist/esm/typography/Abbr.js +2 -3
- package/dist/esm/typography/{Link.js → Anchor.js} +6 -5
- package/dist/esm/typography/Mark.js +2 -3
- package/dist/esm/typography/Text.js +4 -5
- package/dist/esm/typography/Title.js +4 -4
- package/dist/esm/utils/cloneElement.js +44 -0
- package/dist/esm/utils/getColor.js +2 -16
- package/dist/types/components/actionLabel/ActionLabel.d.ts +2 -2
- package/dist/types/components/animations/Animations.d.ts +5 -5
- package/dist/types/components/avatar/Avatar.d.ts +3 -3
- package/dist/types/components/badge/Badge.d.ts +5 -1
- package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/dist/types/components/button/Button.d.ts +7 -5
- package/dist/types/components/button/ButtonGroup.d.ts +2 -2
- package/dist/types/components/button/ConfirmButton.d.ts +6 -1
- package/dist/types/components/callout/Callout.d.ts +2 -2
- package/dist/types/components/card/Card.d.ts +3 -3
- package/dist/types/components/chip/Chip.d.ts +3 -3
- package/dist/types/components/collapsable/Collapsable.d.ts +5 -1
- package/dist/types/components/divider/Divider.d.ts +7 -3
- package/dist/types/components/dropdown/DropdownTool.d.ts +2 -1
- package/dist/types/components/icon/Icon.d.ts +3 -3
- package/dist/types/components/media/Media.d.ts +2 -2
- package/dist/types/components/menu/ContextMenu.d.ts +2 -1
- package/dist/types/components/menu/MenuItem.d.ts +1 -1
- package/dist/types/components/menu/types.d.ts +2 -2
- package/dist/types/components/navigator/Navigator.d.ts +4 -4
- package/dist/types/components/progress/ProgressBar.d.ts +2 -2
- package/dist/types/components/progress/ProgressCircle.d.ts +2 -2
- package/dist/types/components/tabpanel/Tab.d.ts +5 -5
- package/dist/types/components/tabpanel/TabPanel.d.ts +10 -1
- package/dist/types/core/content/Content.d.ts +3 -2
- package/dist/types/core/headfoot/HeadFoot.d.ts +1 -9
- package/dist/types/core/responsive/Responsive.d.ts +1 -1
- package/dist/types/core/theme/ThemeProvider.d.ts +4 -4
- package/dist/types/hooks/useOverlayService.d.ts +3 -5
- package/dist/types/index.d.ts +3 -0
- package/dist/types/overlays/alert/Alert.d.ts +2 -2
- package/dist/types/overlays/flyout/Flyout.d.ts +3 -2
- package/dist/types/overlays/message/Message.d.ts +2 -2
- package/dist/types/overlays/modal/Modal.d.ts +4 -3
- package/dist/types/overlays/toast/Toast.d.ts +2 -2
- package/dist/types/overlays/tooltip/Tooltip.d.ts +1 -1
- package/dist/types/types/icons.d.ts +4 -0
- package/dist/types/types/index.d.ts +18 -6
- package/dist/types/typography/Abbr.d.ts +6 -2
- package/dist/types/typography/Anchor.d.ts +25 -0
- package/dist/types/typography/Mark.d.ts +2 -2
- package/dist/types/typography/index.d.ts +1 -1
- package/dist/types/utils/cloneElement.d.ts +2 -0
- package/dist/types/utils/getColor.d.ts +1 -4
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +7 -9
- package/src/components/actionLabel/ActionLabel.tsx +15 -6
- package/src/components/animations/Animations.tsx +29 -23
- package/src/components/avatar/Avatar.tsx +74 -88
- package/src/components/avatar/AvatarGroup.tsx +4 -4
- package/src/components/badge/Badge.tsx +11 -7
- package/src/components/breadcrumbs/Breadcrumbs.tsx +13 -9
- package/src/components/button/Button.tsx +27 -22
- package/src/components/button/ButtonGroup.tsx +7 -7
- package/src/components/button/ConfirmButton.tsx +15 -5
- package/src/components/button/ToggleButtonGroup.tsx +5 -5
- package/src/components/callout/Callout.tsx +26 -11
- package/src/components/card/Card.tsx +10 -7
- package/src/components/card/CardCover.tsx +11 -6
- package/src/components/chip/Chip.tsx +17 -13
- package/src/components/collapsable/Collapsable.tsx +9 -4
- package/src/components/divider/Divider.tsx +15 -10
- package/src/components/dropdown/Dropdown.tsx +5 -5
- package/src/components/dropdown/DropdownTool.tsx +5 -3
- package/src/components/icon/Icon.tsx +55 -67
- package/src/components/media/Media.tsx +141 -106
- package/src/components/menu/ContextMenu.tsx +36 -11
- package/src/components/menu/Menu.tsx +51 -30
- package/src/components/menu/MenuItem.tsx +19 -9
- package/src/components/menu/types.ts +2 -2
- package/src/components/meter/Meter.tsx +2 -3
- package/src/components/navigator/Navigator.tsx +19 -5
- package/src/components/panel/Panel.tsx +10 -9
- package/src/components/panel/PanelGroup.tsx +1 -2
- package/src/components/progress/ProgressBar.tsx +8 -9
- package/src/components/progress/ProgressCircle.tsx +6 -9
- package/src/components/tabpanel/Tab.tsx +81 -64
- package/src/components/tabpanel/TabPanel.tsx +34 -12
- package/src/core/aside/Aside.tsx +11 -10
- package/src/core/boundary/ErrorBoundary.tsx +8 -7
- package/src/core/boundary/ErrorIcon.tsx +1 -2
- package/src/core/content/Content.tsx +17 -12
- package/src/core/headfoot/HeadFoot.tsx +2 -35
- package/src/core/page/Page.tsx +3 -3
- package/src/core/responsive/Responsive.tsx +8 -7
- package/src/core/section/Section.tsx +1 -2
- package/src/core/theme/ThemeProvider.tsx +11 -12
- package/src/core/viewport/Viewport.tsx +1 -2
- package/src/hooks/useNavigator.tsx +10 -5
- package/src/hooks/useOverlayService.tsx +12 -6
- package/src/hotkeys/HotKeyLabel.tsx +1 -1
- package/src/hotkeys/HotKeyWrapper.tsx +3 -1
- package/src/index.ts +4 -0
- package/src/overlays/alert/Alert.tsx +25 -31
- package/src/overlays/flyout/Flyout.tsx +65 -64
- package/src/overlays/message/Message.tsx +10 -7
- package/src/overlays/modal/Modal.tsx +18 -13
- package/src/overlays/toast/Toast.tsx +18 -27
- package/src/overlays/tooltip/Tooltip.tsx +30 -9
- package/src/types/icons.ts +9 -0
- package/src/types/index.ts +240 -27
- package/src/typography/Abbr.tsx +15 -9
- package/src/typography/{Link.tsx → Anchor.tsx} +8 -13
- package/src/typography/Mark.tsx +4 -9
- package/src/typography/Text.tsx +4 -12
- package/src/typography/Title.tsx +2 -6
- package/src/typography/index.ts +1 -1
- package/src/utils/cloneElement.ts +44 -0
- 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
- package/src/overlays/tooltip/Tooltip.module.css +0 -53
|
@@ -22,21 +22,28 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import classNames from "classnames";
|
|
25
|
+
import { useCallback } from "react";
|
|
25
26
|
import { HotKey } from "../../hotkeys/HotKey";
|
|
26
27
|
import {
|
|
27
28
|
type AriaProps,
|
|
29
|
+
type ChildProp,
|
|
28
30
|
type ColorType,
|
|
29
31
|
type CssProp,
|
|
32
|
+
type PaletteType,
|
|
30
33
|
type TestProps,
|
|
31
34
|
} from "../../types";
|
|
32
35
|
import { CoreIcons } from "../../types/icons";
|
|
33
36
|
import { Icon } from "../icon/Icon";
|
|
34
37
|
|
|
35
|
-
export interface NavigatorProps
|
|
38
|
+
export interface NavigatorProps
|
|
39
|
+
extends CssProp,
|
|
40
|
+
AriaProps,
|
|
41
|
+
TestProps,
|
|
42
|
+
Partial<ChildProp> {
|
|
36
43
|
/**
|
|
37
44
|
* navigator button color
|
|
38
45
|
*/
|
|
39
|
-
color?: ColorType | string;
|
|
46
|
+
color?: ColorType | PaletteType | string;
|
|
40
47
|
/**
|
|
41
48
|
* navigation handler
|
|
42
49
|
*/
|
|
@@ -47,28 +54,35 @@ export const Navigator = ({
|
|
|
47
54
|
className,
|
|
48
55
|
onNavigate,
|
|
49
56
|
color,
|
|
57
|
+
children,
|
|
50
58
|
...aria
|
|
51
59
|
}: NavigatorProps) => {
|
|
60
|
+
const navPrev = useCallback(() => onNavigate(-1), [onNavigate]);
|
|
61
|
+
const navNext = useCallback(() => onNavigate(+1), [onNavigate]);
|
|
52
62
|
return (
|
|
53
63
|
<div
|
|
54
|
-
|
|
64
|
+
data-ref="navigator"
|
|
65
|
+
className={classNames(className, "inline-flex items-center leading-none")}
|
|
55
66
|
{...aria}
|
|
56
67
|
>
|
|
57
|
-
<HotKey keyCombo="left" handler={
|
|
58
|
-
<HotKey keyCombo="right" handler={
|
|
68
|
+
<HotKey keyCombo="left" handler={navPrev} />
|
|
69
|
+
<HotKey keyCombo="right" handler={navNext} />
|
|
59
70
|
<Icon
|
|
60
71
|
rtlFlip
|
|
61
72
|
color={color}
|
|
62
73
|
className="text-[1em] p-1"
|
|
63
74
|
aria-label="previous"
|
|
75
|
+
data-ref="previous"
|
|
64
76
|
icon={CoreIcons.chevronLeft}
|
|
65
77
|
onClick={(e) => [e.stopPropagation(), onNavigate(-1)]}
|
|
66
78
|
/>
|
|
79
|
+
{children}
|
|
67
80
|
<Icon
|
|
68
81
|
rtlFlip
|
|
69
82
|
className="text-[1em] p-1"
|
|
70
83
|
color={color}
|
|
71
84
|
aria-label="next"
|
|
85
|
+
data-ref="next"
|
|
72
86
|
icon={CoreIcons.chevronRight}
|
|
73
87
|
onClick={(e) => [e.stopPropagation(), onNavigate(1)]}
|
|
74
88
|
/>
|
|
@@ -38,7 +38,6 @@ import {
|
|
|
38
38
|
import { CoreIcons } from "../../types/icons";
|
|
39
39
|
import { Loading } from "../animations/Animations";
|
|
40
40
|
import { Icon } from "../icon/Icon";
|
|
41
|
-
import classes from "./Panel.module.css";
|
|
42
41
|
|
|
43
42
|
export interface PanelProps
|
|
44
43
|
extends CssProp,
|
|
@@ -146,7 +145,7 @@ export const Panel = ({
|
|
|
146
145
|
return (
|
|
147
146
|
<div
|
|
148
147
|
className={classNames(
|
|
149
|
-
|
|
148
|
+
"fabric-panel",
|
|
150
149
|
className,
|
|
151
150
|
"rounded-capped overflow-hidden outline grid",
|
|
152
151
|
expanded ? "fixed inset-4 z-50" : "relative",
|
|
@@ -172,16 +171,17 @@ export const Panel = ({
|
|
|
172
171
|
<header
|
|
173
172
|
role="none"
|
|
174
173
|
className={classNames(
|
|
175
|
-
|
|
174
|
+
"fabric-panelHeader",
|
|
176
175
|
headerClassName,
|
|
177
176
|
"flex flex-nowrap items-center area-head",
|
|
178
177
|
)}
|
|
178
|
+
data-ref="panelHeader"
|
|
179
179
|
onClick={collapsable ? toggleCollapse : undefined}
|
|
180
180
|
>
|
|
181
181
|
{onBack && (
|
|
182
182
|
<Icon
|
|
183
183
|
data-ref="panelBack"
|
|
184
|
-
className={classNames(
|
|
184
|
+
className={classNames("fabric-panelAction", "cursor-pointer")}
|
|
185
185
|
icon={CoreIcons.chevronLeft}
|
|
186
186
|
onClick={onBack}
|
|
187
187
|
/>
|
|
@@ -204,7 +204,7 @@ export const Panel = ({
|
|
|
204
204
|
>
|
|
205
205
|
{title}
|
|
206
206
|
</div>
|
|
207
|
-
<div className="px-1">{actions}</div>
|
|
207
|
+
<div className="px-1 leading-none">{actions}</div>
|
|
208
208
|
{hasTools && (
|
|
209
209
|
<div
|
|
210
210
|
role="none"
|
|
@@ -214,7 +214,7 @@ export const Panel = ({
|
|
|
214
214
|
{expandable && (
|
|
215
215
|
<Icon
|
|
216
216
|
data-ref="panelExpand"
|
|
217
|
-
className={classNames(
|
|
217
|
+
className={classNames("fabric-panelAction", "cursor-pointer")}
|
|
218
218
|
icon={expanded ? CoreIcons.minimize : CoreIcons.maximize}
|
|
219
219
|
onClick={toggleExpand}
|
|
220
220
|
/>
|
|
@@ -222,7 +222,7 @@ export const Panel = ({
|
|
|
222
222
|
{!expanded && collapsable && (
|
|
223
223
|
<Icon
|
|
224
224
|
data-ref="panelCollapse"
|
|
225
|
-
className={classNames(
|
|
225
|
+
className={classNames("fabric-panelAction", "cursor-pointer")}
|
|
226
226
|
icon={collapsed ? CoreIcons.expand : CoreIcons.collapse}
|
|
227
227
|
onClick={toggleCollapse}
|
|
228
228
|
/>
|
|
@@ -230,7 +230,7 @@ export const Panel = ({
|
|
|
230
230
|
{!expanded && onClose && (
|
|
231
231
|
<Icon
|
|
232
232
|
data-ref="panelClose"
|
|
233
|
-
className={classNames(
|
|
233
|
+
className={classNames("fabric-panelAction", "cursor-pointer")}
|
|
234
234
|
icon={CoreIcons.close}
|
|
235
235
|
onClick={onClose}
|
|
236
236
|
/>
|
|
@@ -240,8 +240,9 @@ export const Panel = ({
|
|
|
240
240
|
</header>
|
|
241
241
|
{(!collapsed || expanded) && (
|
|
242
242
|
<div
|
|
243
|
+
data-ref="panelBody"
|
|
243
244
|
className={classNames(
|
|
244
|
-
|
|
245
|
+
"fabric-panelBody",
|
|
245
246
|
"area-content grid overflow-hidden",
|
|
246
247
|
)}
|
|
247
248
|
>
|
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
useMemoDebugger,
|
|
29
29
|
} from "../../hooks/useEffectDebugger";
|
|
30
30
|
import { type ChildrenProp } from "../../types";
|
|
31
|
-
import classes from "./Panel.module.css";
|
|
32
31
|
|
|
33
32
|
export interface PanelGroupProps extends ChildrenProp {
|
|
34
33
|
/**
|
|
@@ -81,7 +80,7 @@ export const PanelGroup = ({
|
|
|
81
80
|
<div
|
|
82
81
|
data-ref="panelGroup"
|
|
83
82
|
className={classNames(
|
|
84
|
-
|
|
83
|
+
"fabric-panelGroup",
|
|
85
84
|
"flex flex-col overflow-auto area-content p-px",
|
|
86
85
|
)}
|
|
87
86
|
>
|
|
@@ -24,9 +24,8 @@
|
|
|
24
24
|
import { Format } from "@react-fabric/utilities";
|
|
25
25
|
import classNames from "classnames";
|
|
26
26
|
import { useMemoDebugger } from "../../hooks/useEffectDebugger";
|
|
27
|
-
import { type ColorType } from "../../types";
|
|
28
|
-
import {
|
|
29
|
-
import classes from "./Progress.module.css";
|
|
27
|
+
import { type PaletteType, type ColorType } from "../../types";
|
|
28
|
+
import { getColor } from "../../utils";
|
|
30
29
|
|
|
31
30
|
export interface ProgressProps {
|
|
32
31
|
/**
|
|
@@ -40,7 +39,7 @@ export interface ProgressProps {
|
|
|
40
39
|
/**
|
|
41
40
|
* color
|
|
42
41
|
*/
|
|
43
|
-
color?: ColorType;
|
|
42
|
+
color?: ColorType | PaletteType;
|
|
44
43
|
/**
|
|
45
44
|
* animate
|
|
46
45
|
*/
|
|
@@ -64,7 +63,7 @@ const SizeMap: KeyValue = {
|
|
|
64
63
|
export const ProgressBar = ({
|
|
65
64
|
value = 0,
|
|
66
65
|
size,
|
|
67
|
-
color = "primary",
|
|
66
|
+
color = "primary-500",
|
|
68
67
|
label = "",
|
|
69
68
|
animate,
|
|
70
69
|
}: ProgressProps) => {
|
|
@@ -87,12 +86,12 @@ export const ProgressBar = ({
|
|
|
87
86
|
return (
|
|
88
87
|
<div
|
|
89
88
|
className={classNames(
|
|
90
|
-
|
|
91
|
-
getColorClass(color),
|
|
89
|
+
"fabric-progressbar",
|
|
92
90
|
"block bg-dimmed relative rounded font-bold overflow-hidden whitespace-nowrap",
|
|
93
91
|
)}
|
|
94
92
|
style={{
|
|
95
93
|
...progressVar,
|
|
94
|
+
color: getColor(color),
|
|
96
95
|
minHeight: SizeMap[size ?? ""],
|
|
97
96
|
fontSize: SizeMap[size ?? ""],
|
|
98
97
|
}}
|
|
@@ -106,8 +105,8 @@ export const ProgressBar = ({
|
|
|
106
105
|
)}
|
|
107
106
|
<div
|
|
108
107
|
className={classNames(
|
|
109
|
-
|
|
110
|
-
animate &&
|
|
108
|
+
"fabric-progressTrack",
|
|
109
|
+
animate && "fabric-progressAnimate",
|
|
111
110
|
"h-full overflow-clip bg-current relative z-0",
|
|
112
111
|
)}
|
|
113
112
|
/>
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
import { Format } from "@react-fabric/utilities";
|
|
25
25
|
import classNames from "classnames";
|
|
26
26
|
import { useMemoDebugger } from "../../hooks/useEffectDebugger";
|
|
27
|
-
import { type ColorType } from "../../types";
|
|
28
|
-
import {
|
|
27
|
+
import { type PaletteType, type ColorType } from "../../types";
|
|
28
|
+
import { getColor } from "../../utils";
|
|
29
29
|
|
|
30
30
|
export interface ProgressProps {
|
|
31
31
|
/**
|
|
@@ -39,7 +39,7 @@ export interface ProgressProps {
|
|
|
39
39
|
/**
|
|
40
40
|
* color
|
|
41
41
|
*/
|
|
42
|
-
color?: ColorType;
|
|
42
|
+
color?: ColorType | PaletteType;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
const SizeMap: KeyValue = {
|
|
@@ -53,7 +53,7 @@ const SizeMap: KeyValue = {
|
|
|
53
53
|
export const ProgressCircle = ({
|
|
54
54
|
value = 0,
|
|
55
55
|
size = "sm",
|
|
56
|
-
color = "primary",
|
|
56
|
+
color = "primary-500",
|
|
57
57
|
}: ProgressProps) => {
|
|
58
58
|
/** ***************** make sure value is between 0 and 100 *******************/
|
|
59
59
|
const actualValue = useMemoDebugger(
|
|
@@ -75,12 +75,9 @@ export const ProgressCircle = ({
|
|
|
75
75
|
/** ***************** component *******************/
|
|
76
76
|
return (
|
|
77
77
|
<div
|
|
78
|
-
className={classNames(
|
|
79
|
-
"inline-block w-[4em] h-[4em] text-lg relative",
|
|
80
|
-
getColorClass(color),
|
|
81
|
-
)}
|
|
78
|
+
className={classNames("inline-block w-[4em] h-[4em] text-lg relative")}
|
|
82
79
|
aria-hidden="true"
|
|
83
|
-
style={{ fontSize: SizeMap[size] }}
|
|
80
|
+
style={{ fontSize: SizeMap[size], color: getColor(color) }}
|
|
84
81
|
>
|
|
85
82
|
<svg
|
|
86
83
|
viewBox="0 0 100 100"
|
|
@@ -21,24 +21,26 @@
|
|
|
21
21
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
+
import { isString } from "@react-fabric/utilities";
|
|
24
25
|
import classNames from "classnames";
|
|
25
|
-
import { type ReactElement, useMemo } from "react";
|
|
26
|
+
import { Fragment, type ReactElement, useMemo } from "react";
|
|
27
|
+
import { Tooltip } from "../../overlays";
|
|
26
28
|
import {
|
|
27
29
|
type AriaProps,
|
|
28
30
|
type BadgeType,
|
|
29
31
|
type CallbackReturn,
|
|
30
32
|
type ChildrenProp,
|
|
31
|
-
type
|
|
33
|
+
type ColorState,
|
|
32
34
|
type CssProp,
|
|
33
35
|
type IconProps,
|
|
34
36
|
type PolymorphicProps,
|
|
35
37
|
type RefProp,
|
|
36
38
|
type TestProps,
|
|
39
|
+
type TooltipProp,
|
|
37
40
|
} from "../../types";
|
|
38
41
|
import { Badge, getBadgeProps } from "../badge/Badge";
|
|
39
42
|
import { DropdownTool } from "../dropdown/DropdownTool";
|
|
40
43
|
import { Icon } from "../icon/Icon";
|
|
41
|
-
import classes from "./TabPanel.module.css";
|
|
42
44
|
|
|
43
45
|
export interface TabProps
|
|
44
46
|
extends Partial<ChildrenProp>,
|
|
@@ -46,7 +48,8 @@ export interface TabProps
|
|
|
46
48
|
RefProp,
|
|
47
49
|
AriaProps,
|
|
48
50
|
TestProps,
|
|
49
|
-
IconProps
|
|
51
|
+
IconProps,
|
|
52
|
+
TooltipProp {
|
|
50
53
|
/**
|
|
51
54
|
* tab id
|
|
52
55
|
*/
|
|
@@ -58,11 +61,11 @@ export interface TabProps
|
|
|
58
61
|
/**
|
|
59
62
|
* tab color
|
|
60
63
|
*/
|
|
61
|
-
color?:
|
|
64
|
+
color?: ColorState;
|
|
62
65
|
/**
|
|
63
66
|
* tab badge
|
|
64
67
|
*/
|
|
65
|
-
badge?: BadgeType;
|
|
68
|
+
badge?: string | number | BadgeType;
|
|
66
69
|
/**
|
|
67
70
|
* disabled
|
|
68
71
|
*/
|
|
@@ -104,12 +107,11 @@ export const Tab = <Tag extends React.ElementType = "button">({
|
|
|
104
107
|
onClose,
|
|
105
108
|
// @ts-expect-error ignore
|
|
106
109
|
active,
|
|
107
|
-
// @ts-expect-error ignore
|
|
108
|
-
minimal,
|
|
109
110
|
onClick,
|
|
110
111
|
tabFlex,
|
|
111
112
|
color,
|
|
112
113
|
actions,
|
|
114
|
+
tooltip,
|
|
113
115
|
activeClassName,
|
|
114
116
|
...aria
|
|
115
117
|
}: TabProps & PolymorphicProps<Tag>) => {
|
|
@@ -117,63 +119,78 @@ export const Tab = <Tag extends React.ElementType = "button">({
|
|
|
117
119
|
return getBadgeProps(badge);
|
|
118
120
|
}, [badge]);
|
|
119
121
|
|
|
122
|
+
const minimal = useMemo(() => !label, [label]);
|
|
123
|
+
|
|
124
|
+
const tooltipProps = useMemo(() => {
|
|
125
|
+
if (isString(tooltip)) return { content: tooltip };
|
|
126
|
+
|
|
127
|
+
return tooltip ?? {};
|
|
128
|
+
}, [tooltip]);
|
|
129
|
+
|
|
120
130
|
const E = as ?? "button";
|
|
131
|
+
const W = tooltip ? Tooltip : Fragment;
|
|
121
132
|
return (
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
className
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
133
|
+
<W {...tooltipProps}>
|
|
134
|
+
<E
|
|
135
|
+
data-id={id}
|
|
136
|
+
disabled={disabled}
|
|
137
|
+
data-color={color}
|
|
138
|
+
data-inner-clickable
|
|
139
|
+
className={classNames(
|
|
140
|
+
"fabric-tabButton",
|
|
141
|
+
className,
|
|
142
|
+
active && "active pointer-events-none",
|
|
143
|
+
active && activeClassName,
|
|
144
|
+
disabled && "text-tint-500 pointer-events-none",
|
|
145
|
+
tabFlex ? "flex-1" : "flex-initial max-w-36",
|
|
146
|
+
minimal ? "min-w-6" : "min-w-18",
|
|
147
|
+
"flex items-center justify-center px-1 rounded overflow-hidden",
|
|
148
|
+
)}
|
|
149
|
+
onClick={() => !active && onClick?.(id)}
|
|
150
|
+
ref={ref as AnyObject}
|
|
151
|
+
{...aria}
|
|
152
|
+
>
|
|
153
|
+
{icon && (
|
|
154
|
+
<Icon
|
|
155
|
+
icon={icon}
|
|
156
|
+
bg={iconBg}
|
|
157
|
+
color={iconColor}
|
|
158
|
+
rtlFlip={rtlFlip}
|
|
159
|
+
className="flex-content p-2"
|
|
160
|
+
/>
|
|
161
|
+
)}
|
|
162
|
+
{!minimal && (
|
|
163
|
+
<label className="flex-initial truncate text-center px-1 py-1">
|
|
164
|
+
{label}
|
|
165
|
+
</label>
|
|
166
|
+
)}
|
|
167
|
+
{badge && (
|
|
168
|
+
<Badge
|
|
169
|
+
{...badgeProps}
|
|
170
|
+
placement={minimal ? "end" : ""}
|
|
171
|
+
className={classNames("me-1", badgeProps.className)}
|
|
172
|
+
/>
|
|
173
|
+
)}
|
|
174
|
+
{actions && active && (
|
|
175
|
+
<DropdownTool className="bg-tint-50/20 me-1 z-5">
|
|
176
|
+
{actions}
|
|
177
|
+
</DropdownTool>
|
|
178
|
+
)}
|
|
179
|
+
{onClose && (
|
|
180
|
+
<span
|
|
181
|
+
role="none"
|
|
182
|
+
className={classNames(
|
|
183
|
+
"cursor-pointer me-1 opacity-65 hover:opacity-90 pointer-events-auto",
|
|
184
|
+
)}
|
|
185
|
+
onClick={(e) => {
|
|
186
|
+
onClose?.();
|
|
187
|
+
e.stopPropagation();
|
|
188
|
+
}}
|
|
189
|
+
>
|
|
190
|
+
×
|
|
191
|
+
</span>
|
|
192
|
+
)}
|
|
193
|
+
</E>
|
|
194
|
+
</W>
|
|
178
195
|
);
|
|
179
196
|
};
|
|
@@ -25,6 +25,7 @@ import classNames from "classnames";
|
|
|
25
25
|
import {
|
|
26
26
|
Children,
|
|
27
27
|
cloneElement,
|
|
28
|
+
type ReactNode,
|
|
28
29
|
useCallback,
|
|
29
30
|
useEffect,
|
|
30
31
|
useMemo,
|
|
@@ -33,7 +34,6 @@ import {
|
|
|
33
34
|
import { type CallbackReturn, type ChildrenProp } from "../../types";
|
|
34
35
|
import { nodeCheck } from "../../utils";
|
|
35
36
|
import { Tab } from "./Tab";
|
|
36
|
-
import classes from "./TabPanel.module.css";
|
|
37
37
|
|
|
38
38
|
export interface TabPanelProps extends ChildrenProp<typeof Tab> {
|
|
39
39
|
/**
|
|
@@ -64,6 +64,14 @@ export interface TabPanelProps extends ChildrenProp<typeof Tab> {
|
|
|
64
64
|
* tab list className
|
|
65
65
|
*/
|
|
66
66
|
headerClassName?: string;
|
|
67
|
+
/**
|
|
68
|
+
* append element
|
|
69
|
+
*/
|
|
70
|
+
append?: ReactNode;
|
|
71
|
+
/**
|
|
72
|
+
* prepend element
|
|
73
|
+
*/
|
|
74
|
+
prepend?: ReactNode;
|
|
67
75
|
/**
|
|
68
76
|
* change handler
|
|
69
77
|
*/
|
|
@@ -84,6 +92,8 @@ export const TabPanel = ({
|
|
|
84
92
|
justify,
|
|
85
93
|
variant,
|
|
86
94
|
tabFlex,
|
|
95
|
+
append,
|
|
96
|
+
prepend,
|
|
87
97
|
gap,
|
|
88
98
|
onBeforeChange,
|
|
89
99
|
onChange,
|
|
@@ -124,7 +134,7 @@ export const TabPanel = ({
|
|
|
124
134
|
return (
|
|
125
135
|
<div
|
|
126
136
|
className={classNames(
|
|
127
|
-
|
|
137
|
+
"fabric-tabPanel",
|
|
128
138
|
"area-content grid bg-base overflow-hidden",
|
|
129
139
|
)}
|
|
130
140
|
data-orientation={orientation}
|
|
@@ -132,21 +142,33 @@ export const TabPanel = ({
|
|
|
132
142
|
>
|
|
133
143
|
<div
|
|
134
144
|
className={classNames(
|
|
135
|
-
|
|
145
|
+
"fabric-tabHeader",
|
|
136
146
|
headerClassName,
|
|
137
147
|
justify && `justify-${justify}`,
|
|
138
148
|
["start", "end"].includes(orientation) && "flex-col",
|
|
139
|
-
"flex flex-nowrap overflow-
|
|
149
|
+
"flex flex-nowrap overflow-hidden items-center",
|
|
140
150
|
)}
|
|
141
|
-
style={{ gap }}
|
|
142
151
|
>
|
|
143
|
-
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
152
|
+
{prepend}
|
|
153
|
+
<div
|
|
154
|
+
className={classNames(
|
|
155
|
+
"fabric-tabList",
|
|
156
|
+
justify && `justify-${justify}`,
|
|
157
|
+
["start", "end"].includes(orientation) && "flex-col",
|
|
158
|
+
["bottom", "end"].includes(orientation) ? "self-start" : "self-end",
|
|
159
|
+
"flex flex-1 flex-nowrap overflow-auto scroll-thin",
|
|
160
|
+
)}
|
|
161
|
+
style={{ gap }}
|
|
162
|
+
>
|
|
163
|
+
{tabs.map((node: AnyObject) =>
|
|
164
|
+
cloneElement(node, {
|
|
165
|
+
tabFlex: node.props.tabFlex ?? tabFlex,
|
|
166
|
+
onClick: handleClick,
|
|
167
|
+
active: node.props.id === active,
|
|
168
|
+
}),
|
|
169
|
+
)}
|
|
170
|
+
</div>
|
|
171
|
+
{append}
|
|
150
172
|
</div>
|
|
151
173
|
{rest}
|
|
152
174
|
{activeTabPanel}
|
package/src/core/aside/Aside.tsx
CHANGED
|
@@ -45,7 +45,6 @@ import {
|
|
|
45
45
|
} from "../../types";
|
|
46
46
|
import { CoreIcons } from "../../types/icons";
|
|
47
47
|
import { ErrorBoundary } from "../boundary/ErrorBoundary";
|
|
48
|
-
import classes from "./Aside.module.css";
|
|
49
48
|
|
|
50
49
|
export interface AsideProps
|
|
51
50
|
extends IconProps,
|
|
@@ -197,9 +196,10 @@ export const Aside = ({
|
|
|
197
196
|
|
|
198
197
|
return (
|
|
199
198
|
<aside
|
|
200
|
-
className={classNames(
|
|
199
|
+
className={classNames("fabric-aside", className, "overflow-hidden grid")}
|
|
201
200
|
data-align={align}
|
|
202
201
|
data-flyout={peek}
|
|
202
|
+
data-loading={loading}
|
|
203
203
|
data-collapsed={isCollapsed}
|
|
204
204
|
style={isCollapsed ? undefined : widthStyles}
|
|
205
205
|
data-testid={testId}
|
|
@@ -207,15 +207,16 @@ export const Aside = ({
|
|
|
207
207
|
>
|
|
208
208
|
<header
|
|
209
209
|
className={classNames(
|
|
210
|
-
|
|
210
|
+
"fabric-asideHeader",
|
|
211
211
|
headerClassName,
|
|
212
212
|
"grid area-head items-center",
|
|
213
213
|
)}
|
|
214
|
+
data-ref="asideHeader"
|
|
214
215
|
>
|
|
215
216
|
{title && (
|
|
216
217
|
<div
|
|
217
218
|
className={classNames(
|
|
218
|
-
|
|
219
|
+
"fabric-asideTitle",
|
|
219
220
|
"truncate py-0.5 px-1 select-none pointer-events-none",
|
|
220
221
|
)}
|
|
221
222
|
>
|
|
@@ -225,7 +226,7 @@ export const Aside = ({
|
|
|
225
226
|
{collapsable && (
|
|
226
227
|
<Icon
|
|
227
228
|
aria-label={isCollapsed ? "expand" : "collapse"}
|
|
228
|
-
className={classNames(
|
|
229
|
+
className={classNames("fabric-asideCollapse", "p-2 select-none")}
|
|
229
230
|
icon={CoreIcons.chevronLeft}
|
|
230
231
|
rtlFlip
|
|
231
232
|
onClick={toggleCollapse}
|
|
@@ -239,12 +240,12 @@ export const Aside = ({
|
|
|
239
240
|
color={iconColor}
|
|
240
241
|
rtlFlip={rtlFlip}
|
|
241
242
|
className={classNames(
|
|
242
|
-
|
|
243
|
+
"fabric-asideIcon",
|
|
243
244
|
"p-1 text-lg select-none pointer-events-none",
|
|
244
245
|
)}
|
|
245
246
|
/>
|
|
246
247
|
)}
|
|
247
|
-
{actions && <div className={
|
|
248
|
+
{actions && <div className={"fabric-asideActions"}>{actions}</div>}
|
|
248
249
|
</header>
|
|
249
250
|
{loading && <Loading />}
|
|
250
251
|
{isCollapsed && (
|
|
@@ -252,14 +253,14 @@ export const Aside = ({
|
|
|
252
253
|
role="none"
|
|
253
254
|
onClick={tryPeek}
|
|
254
255
|
data-ref="asidePlaceholder"
|
|
255
|
-
className={
|
|
256
|
+
className={"fabric-asidePlaceholder"}
|
|
256
257
|
/>
|
|
257
258
|
)}
|
|
258
259
|
<section
|
|
259
260
|
ref={elementRef}
|
|
260
261
|
data-ref="asideBody"
|
|
261
262
|
className={classNames(
|
|
262
|
-
|
|
263
|
+
"fabric-asideBody",
|
|
263
264
|
bodyClassName,
|
|
264
265
|
"overflow-hidden grid",
|
|
265
266
|
)}
|
|
@@ -271,7 +272,7 @@ export const Aside = ({
|
|
|
271
272
|
<div
|
|
272
273
|
{...resizeHandleProps}
|
|
273
274
|
className={classNames(
|
|
274
|
-
|
|
275
|
+
"fabric-asideResizer",
|
|
275
276
|
"before:absolute before:inset-0 before:w-1 before:top-1/2 before:-translate-y-1/2 before:transition-all",
|
|
276
277
|
)}
|
|
277
278
|
/>
|