@react-fabric/core 1.0.0-beta.4 → 1.0.0-beta.41
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/empty/EmptyContent.js +6 -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 +49 -60
- package/dist/cjs/overlays/message/Message.js +6 -3
- package/dist/cjs/overlays/modal/Modal.js +11 -11
- 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/empty/EmptyContent.js +6 -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 +52 -63
- package/dist/esm/overlays/message/Message.js +7 -4
- package/dist/esm/overlays/modal/Modal.js +12 -12
- 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/empty/EmptyContent.d.ts +6 -2
- 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/empty/EmptyContent.tsx +17 -2
- 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 +71 -84
- package/src/overlays/message/Message.tsx +10 -7
- package/src/overlays/modal/Modal.tsx +20 -15
- 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 +251 -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
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
import classNames from "classnames";
|
|
25
25
|
import { type ChildrenProp, type CssProp, type RefProp } from "../../types";
|
|
26
26
|
import { ErrorBoundary } from "../boundary/ErrorBoundary";
|
|
27
|
-
import classes from "./Section.module.css";
|
|
28
27
|
|
|
29
28
|
/**
|
|
30
29
|
* The section component provides a structured layout used within a page to organize and display content in a sectioned format, ensuring a consistent and intuitive user experience.
|
|
@@ -43,7 +42,7 @@ export const Section = ({
|
|
|
43
42
|
dir={dir}
|
|
44
43
|
ref={ref}
|
|
45
44
|
className={classNames(
|
|
46
|
-
|
|
45
|
+
"fabric-section",
|
|
47
46
|
className,
|
|
48
47
|
"grid area-content overflow-hidden",
|
|
49
48
|
)}
|
|
@@ -25,7 +25,6 @@ import { isColor } from "@react-fabric/utilities";
|
|
|
25
25
|
import classNames from "classnames";
|
|
26
26
|
import { useMemo } from "react";
|
|
27
27
|
import { type ChildrenProp } from "../../types";
|
|
28
|
-
import classes from "./Theme.module.css";
|
|
29
28
|
|
|
30
29
|
export interface ThemeProps {
|
|
31
30
|
/**
|
|
@@ -36,9 +35,9 @@ export interface ThemeProps {
|
|
|
36
35
|
* branding css className
|
|
37
36
|
*
|
|
38
37
|
* .branding {
|
|
39
|
-
* --primary: #color;
|
|
40
|
-
* --accent: #color;
|
|
41
|
-
* --tint: #color;
|
|
38
|
+
* --color-primary: #color;
|
|
39
|
+
* --color-accent: #color;
|
|
40
|
+
* --color-tint: #color;
|
|
42
41
|
* }
|
|
43
42
|
*/
|
|
44
43
|
branding?: string;
|
|
@@ -57,7 +56,7 @@ export interface ThemeProps {
|
|
|
57
56
|
/**
|
|
58
57
|
* component rounding
|
|
59
58
|
*/
|
|
60
|
-
rounding?: "
|
|
59
|
+
rounding?: "sm" | "md" | "full";
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
/**
|
|
@@ -75,22 +74,22 @@ export const ThemeProvider = ({
|
|
|
75
74
|
const styles = useMemo(() => {
|
|
76
75
|
const ret: KeyValue = {};
|
|
77
76
|
if (primaryColor && isColor(primaryColor)) {
|
|
78
|
-
ret["--primary"] = primaryColor;
|
|
77
|
+
ret["--color-primary"] = primaryColor;
|
|
79
78
|
}
|
|
80
79
|
if (primaryColor && !isColor(primaryColor)) {
|
|
81
|
-
ret["--primary"] = `var(
|
|
80
|
+
ret["--color-primary"] = `var(--color-${primaryColor})`;
|
|
82
81
|
}
|
|
83
82
|
if (accentColor && isColor(accentColor)) {
|
|
84
|
-
ret["--accent"] = accentColor;
|
|
83
|
+
ret["--color-accent"] = accentColor;
|
|
85
84
|
}
|
|
86
85
|
if (accentColor && !isColor(accentColor)) {
|
|
87
|
-
ret["--accent"] = `var(
|
|
86
|
+
ret["--color-accent"] = `var(--color-${accentColor})`;
|
|
88
87
|
}
|
|
89
88
|
if (tintColor && isColor(tintColor)) {
|
|
90
|
-
ret["--tint"] = tintColor;
|
|
89
|
+
ret["--color-tint"] = tintColor;
|
|
91
90
|
}
|
|
92
91
|
if (tintColor && !isColor(tintColor)) {
|
|
93
|
-
ret["--tint"] = `var(
|
|
92
|
+
ret["--color-tint"] = `var(--color-${tintColor})`;
|
|
94
93
|
}
|
|
95
94
|
return ret;
|
|
96
95
|
}, [primaryColor, accentColor, tintColor]);
|
|
@@ -101,7 +100,7 @@ export const ThemeProvider = ({
|
|
|
101
100
|
data-color-scheme={colorScheme}
|
|
102
101
|
data-rounding={rounding}
|
|
103
102
|
className={classNames(
|
|
104
|
-
|
|
103
|
+
"fabric-themeProvider",
|
|
105
104
|
"contents theme-base",
|
|
106
105
|
branding,
|
|
107
106
|
)}
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
|
|
24
24
|
import classNames from "classnames";
|
|
25
25
|
import { type PropsWithChildren } from "react";
|
|
26
|
-
import classes from "./Viewport.module.css";
|
|
27
26
|
|
|
28
27
|
/**
|
|
29
28
|
* The application viewport is the main container that defines the visible area where content is displayed and interacted with.
|
|
@@ -33,7 +32,7 @@ export const Viewport = ({ children }: PropsWithChildren) => {
|
|
|
33
32
|
<div
|
|
34
33
|
data-ref="viewport"
|
|
35
34
|
className={classNames(
|
|
36
|
-
|
|
35
|
+
"fabric-viewport",
|
|
37
36
|
"grid overflow-hidden absolute inset-0",
|
|
38
37
|
)}
|
|
39
38
|
>
|
|
@@ -21,24 +21,29 @@
|
|
|
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 { useCallback, useMemo, useState } from "react";
|
|
24
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
25
25
|
|
|
26
26
|
export const useNavigator = (totalCount = 0, defaultIndex = 0) => {
|
|
27
27
|
const [currentIndex, setCurrentIndex] = useState(defaultIndex);
|
|
28
|
+
const refCurrent = useRef(defaultIndex);
|
|
29
|
+
|
|
28
30
|
const onNavigate = useCallback(
|
|
29
31
|
(dir: 1 | -1) => {
|
|
30
32
|
if (dir === -1) {
|
|
31
|
-
|
|
33
|
+
refCurrent.current =
|
|
34
|
+
refCurrent.current > 0 ? refCurrent.current - 1 : totalCount - 1;
|
|
32
35
|
}
|
|
33
36
|
if (dir === 1) {
|
|
34
|
-
|
|
37
|
+
refCurrent.current =
|
|
38
|
+
refCurrent.current + 1 < totalCount ? refCurrent.current + 1 : 0;
|
|
35
39
|
}
|
|
40
|
+
setCurrentIndex(refCurrent.current);
|
|
36
41
|
},
|
|
37
|
-
[
|
|
42
|
+
[totalCount],
|
|
38
43
|
);
|
|
39
44
|
const headLabel = useMemo(
|
|
40
45
|
() => (
|
|
41
|
-
<span className="text-muted leading-none">
|
|
46
|
+
<span className="text-muted leading-none select-none">
|
|
42
47
|
{currentIndex + 1}/{totalCount}
|
|
43
48
|
</span>
|
|
44
49
|
),
|
|
@@ -21,12 +21,15 @@
|
|
|
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 {
|
|
24
|
+
import {
|
|
25
|
+
useState,
|
|
26
|
+
type ComponentProps,
|
|
27
|
+
type ElementType,
|
|
28
|
+
type ReactNode,
|
|
29
|
+
} from "react";
|
|
30
|
+
import { type ModalProps } from "../types";
|
|
25
31
|
|
|
26
|
-
type OverlayComponent =
|
|
27
|
-
onClose: (args?: AnyObject) => void;
|
|
28
|
-
[key: string]: AnyObject;
|
|
29
|
-
}>;
|
|
32
|
+
type OverlayComponent = ElementType<ModalProps<AnyObject>>;
|
|
30
33
|
|
|
31
34
|
export const useOverlayService = (
|
|
32
35
|
ModalOrFlyout: OverlayComponent,
|
|
@@ -36,7 +39,10 @@ export const useOverlayService = (
|
|
|
36
39
|
] => {
|
|
37
40
|
const [Overlay, setOverlay] = useState<ReactNode | null>(null);
|
|
38
41
|
|
|
39
|
-
const openOverlay = async ({
|
|
42
|
+
const openOverlay = async ({
|
|
43
|
+
onClose,
|
|
44
|
+
...props
|
|
45
|
+
}: ComponentProps<typeof ModalOrFlyout> = {}) => {
|
|
40
46
|
return await new Promise((resolve) => {
|
|
41
47
|
const handleClose = (args: AnyObject) => {
|
|
42
48
|
setOverlay(null);
|
|
@@ -54,7 +54,7 @@ export const HotKeyLabel = ({
|
|
|
54
54
|
);
|
|
55
55
|
|
|
56
56
|
return (
|
|
57
|
-
<kbd className="hotkey-label inline-flex gap-1 select-none self-center font-mono items-center text-[0.625rem] leading-4 bg-tint-500/
|
|
57
|
+
<kbd className="hotkey-label inline-flex gap-1 select-none self-center font-mono items-center text-[0.625rem] leading-4 bg-tint-500/20 text-tint-900/65 whitespace-nowrap rounded px-2 mx-1">
|
|
58
58
|
{label}
|
|
59
59
|
</kbd>
|
|
60
60
|
);
|
|
@@ -76,7 +76,9 @@ export const HotKeyWrapper: FC<PropsWithChildren> = memo(
|
|
|
76
76
|
const find = items.find(
|
|
77
77
|
({ key, alt, ctrl, meta, shift }: KeyValue) =>
|
|
78
78
|
(key.toLowerCase() === keyCode.toLowerCase() ||
|
|
79
|
-
key.toLowerCase() === code.toLowerCase()
|
|
79
|
+
key.toLowerCase() === code.toLowerCase() ||
|
|
80
|
+
// work around for macos alt+key issue
|
|
81
|
+
`key${key.toLowerCase()}` === code.toLowerCase()) &&
|
|
80
82
|
alt === altKey &&
|
|
81
83
|
ctrl === ctrlKey &&
|
|
82
84
|
meta === metaKey &&
|
package/src/index.ts
CHANGED
|
@@ -40,9 +40,13 @@ export * from "./hooks/useStorage";
|
|
|
40
40
|
|
|
41
41
|
export { HotKey } from "./hotkeys/HotKey";
|
|
42
42
|
export { HotKeyLabel } from "./hotkeys/HotKeyLabel";
|
|
43
|
+
export { HotKeyWrapper } from "./hotkeys/HotKeyWrapper";
|
|
43
44
|
|
|
45
|
+
export { type ModalProps } from "./types";
|
|
44
46
|
export { CoreIcons } from "./types/icons";
|
|
45
47
|
|
|
48
|
+
export { cloneChildren } from "./utils";
|
|
49
|
+
|
|
46
50
|
export {
|
|
47
51
|
ApplicationProvider,
|
|
48
52
|
useApplicationContext,
|
|
@@ -36,11 +36,10 @@ import { useTranslation } from "react-i18next";
|
|
|
36
36
|
import { AnimationIndicator } from "../../components/animations/Animations";
|
|
37
37
|
import { Button } from "../../components/button/Button";
|
|
38
38
|
import { Icon } from "../../components/icon/Icon";
|
|
39
|
-
import { type
|
|
39
|
+
import { type ColorState, type Elements, type IconProps } from "../../types";
|
|
40
40
|
import { CoreIcons } from "../../types/icons";
|
|
41
41
|
import { Title } from "../../typography/Title";
|
|
42
|
-
import {
|
|
43
|
-
import classes from "./Alert.module.css";
|
|
42
|
+
import { getColor } from "../../utils";
|
|
44
43
|
|
|
45
44
|
export interface AlertProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
46
45
|
/**
|
|
@@ -58,7 +57,7 @@ export interface AlertProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
|
58
57
|
/**
|
|
59
58
|
* theme color
|
|
60
59
|
*/
|
|
61
|
-
color?:
|
|
60
|
+
color?: ColorState;
|
|
62
61
|
/**
|
|
63
62
|
* extra action button
|
|
64
63
|
*/
|
|
@@ -116,35 +115,20 @@ export const Alert = ({
|
|
|
116
115
|
const iconType = useMemo(() => {
|
|
117
116
|
if (icon)
|
|
118
117
|
return (
|
|
119
|
-
<Icon icon={icon} size="md" rtlFlip={rtlFlip} color={color
|
|
118
|
+
<Icon icon={icon} size="md" rtlFlip={rtlFlip} color={`${color}-600`} />
|
|
120
119
|
);
|
|
121
120
|
switch (color) {
|
|
122
121
|
case "danger":
|
|
123
|
-
return
|
|
124
|
-
<AnimationIndicator
|
|
125
|
-
type="cross"
|
|
126
|
-
className={getColorClass(color + "-600")}
|
|
127
|
-
/>
|
|
128
|
-
);
|
|
122
|
+
return <AnimationIndicator type="cross" color={"danger-600"} />;
|
|
129
123
|
case "success":
|
|
130
|
-
return
|
|
131
|
-
<AnimationIndicator
|
|
132
|
-
type="check"
|
|
133
|
-
className={getColorClass(color + "-600")}
|
|
134
|
-
/>
|
|
135
|
-
);
|
|
124
|
+
return <AnimationIndicator type="check" color={"success-600"} />;
|
|
136
125
|
case "warning":
|
|
137
|
-
return
|
|
138
|
-
<AnimationIndicator
|
|
139
|
-
type="exclaim"
|
|
140
|
-
className={getColorClass(color + "-600")}
|
|
141
|
-
/>
|
|
142
|
-
);
|
|
126
|
+
return <AnimationIndicator type="exclaim" color={"warning-600"} />;
|
|
143
127
|
default:
|
|
144
128
|
return (
|
|
145
129
|
<AnimationIndicator
|
|
146
130
|
type={type === "confirm" ? "question" : "info"}
|
|
147
|
-
|
|
131
|
+
color={`${color}-600`}
|
|
148
132
|
/>
|
|
149
133
|
);
|
|
150
134
|
}
|
|
@@ -172,17 +156,19 @@ export const Alert = ({
|
|
|
172
156
|
<FloatingOverlay
|
|
173
157
|
lockScroll
|
|
174
158
|
style={{ zIndex: "var(--z-overlay-mask)" }}
|
|
175
|
-
className="bg-
|
|
159
|
+
className="bg-tint-100/50 backdrop-blur-sm grid place-items-center"
|
|
176
160
|
>
|
|
177
161
|
<FloatingFocusManager context={context}>
|
|
178
162
|
<dialog
|
|
179
163
|
role="alertdialog"
|
|
180
164
|
className={classNames(
|
|
181
|
-
|
|
182
|
-
getBorderClass(color + "-300"),
|
|
165
|
+
"fabric-alert",
|
|
183
166
|
"grid bg-base border-2 pointer-events-auto overflow-hidden rounded-capped select-none",
|
|
184
167
|
"min-w-72 max-w-sm p-6 relative outline-0 shadow-lg",
|
|
185
168
|
)}
|
|
169
|
+
style={{
|
|
170
|
+
borderColor: getColor(`${color}-300`),
|
|
171
|
+
}}
|
|
186
172
|
ref={refs.setFloating}
|
|
187
173
|
{...getFloatingProps()}
|
|
188
174
|
>
|
|
@@ -190,15 +176,23 @@ export const Alert = ({
|
|
|
190
176
|
{iconType}
|
|
191
177
|
</div>
|
|
192
178
|
|
|
193
|
-
<Title className="font-medium area-[title]">
|
|
194
|
-
|
|
179
|
+
<Title className="font-medium area-[title] self-center">
|
|
180
|
+
{title}
|
|
181
|
+
</Title>
|
|
182
|
+
<div className="area-[message] py-4">{message}</div>
|
|
195
183
|
{type === "prompt" && (
|
|
196
184
|
<input
|
|
197
185
|
value={value}
|
|
198
186
|
placeholder={placeholder}
|
|
199
187
|
className={classNames(
|
|
200
|
-
|
|
188
|
+
`area-[input] appearance-none outline-0 border rounded w-full px-2 py-1`,
|
|
201
189
|
)}
|
|
190
|
+
style={
|
|
191
|
+
{
|
|
192
|
+
borderColor: getColor(`${color}-200`),
|
|
193
|
+
"--tw-ring-color": getColor(`${color}-500`),
|
|
194
|
+
} as AnyObject
|
|
195
|
+
}
|
|
202
196
|
ref={(e) => e != null && setTimeout(() => e.focus(), 100)}
|
|
203
197
|
onBlur={(e) => e.target.focus()}
|
|
204
198
|
onChange={(e) => setValue(e.target.value)}
|
|
@@ -228,7 +222,7 @@ export const Alert = ({
|
|
|
228
222
|
size="sm"
|
|
229
223
|
variant="solid"
|
|
230
224
|
color={color}
|
|
231
|
-
onClick={() => handleClose(true)}
|
|
225
|
+
onClick={() => handleClose(type === "prompt" ? value : true)}
|
|
232
226
|
>
|
|
233
227
|
{okLabel ?? t("action.ok", "OK")}
|
|
234
228
|
</Button>
|
|
@@ -30,12 +30,13 @@ import {
|
|
|
30
30
|
useInteractions,
|
|
31
31
|
useRole,
|
|
32
32
|
} from "@floating-ui/react";
|
|
33
|
+
import { isString } from "@react-fabric/utilities";
|
|
33
34
|
import classNames from "classnames";
|
|
34
35
|
import {
|
|
35
|
-
|
|
36
|
+
isValidElement,
|
|
36
37
|
useCallback,
|
|
37
38
|
useEffect,
|
|
38
|
-
type
|
|
39
|
+
type ElementType,
|
|
39
40
|
} from "react";
|
|
40
41
|
import { Loading } from "../../components/animations/Animations";
|
|
41
42
|
import { Icon } from "../../components/icon/Icon";
|
|
@@ -50,13 +51,13 @@ import {
|
|
|
50
51
|
type TestProps,
|
|
51
52
|
} from "../../types";
|
|
52
53
|
import { CoreIcons } from "../../types/icons";
|
|
53
|
-
import classes from "./Flyout.module.css";
|
|
54
54
|
|
|
55
55
|
export interface FlyoutProps
|
|
56
56
|
extends AriaProps,
|
|
57
57
|
TestProps,
|
|
58
|
-
IconProps,
|
|
58
|
+
Omit<IconProps, "icon">,
|
|
59
59
|
ChildrenProp {
|
|
60
|
+
icon?: string | ElementType<IconProps>;
|
|
60
61
|
/**
|
|
61
62
|
* flyout alignment
|
|
62
63
|
*/
|
|
@@ -140,6 +141,7 @@ export const Flyout = ({
|
|
|
140
141
|
});
|
|
141
142
|
const dismiss = useDismiss(context, {
|
|
142
143
|
outsidePressEvent: "mousedown",
|
|
144
|
+
outsidePress: !hideMask,
|
|
143
145
|
escapeKey: true,
|
|
144
146
|
});
|
|
145
147
|
const role = useRole(context);
|
|
@@ -173,9 +175,6 @@ export const Flyout = ({
|
|
|
173
175
|
useEffect(() => {
|
|
174
176
|
setTimeout(() => {
|
|
175
177
|
refs.floating.current && (refs.floating.current.dataset.show = "true");
|
|
176
|
-
refs.floating.current
|
|
177
|
-
?.querySelector<HTMLElement>('[role="dialog"]')
|
|
178
|
-
?.focus();
|
|
179
178
|
}, 50);
|
|
180
179
|
}, []);
|
|
181
180
|
|
|
@@ -193,91 +192,79 @@ export const Flyout = ({
|
|
|
193
192
|
[closeOnClick, handleClose],
|
|
194
193
|
);
|
|
195
194
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return (
|
|
195
|
+
return (
|
|
196
|
+
<FloatingPortal>
|
|
197
|
+
{!hideMask && (
|
|
201
198
|
<FloatingOverlay
|
|
202
199
|
lockScroll
|
|
203
|
-
style={{ zIndex: "var(--z-overlay-mask)" }}
|
|
204
|
-
className="bg-
|
|
200
|
+
style={{ zIndex: "var(--z-overlay-mask)", overflow: "hidden" }}
|
|
201
|
+
className="bg-tint-100/10 backdrop-blur-sm transition-all"
|
|
202
|
+
/>
|
|
203
|
+
)}
|
|
204
|
+
<FloatingFocusManager context={context}>
|
|
205
|
+
<div
|
|
206
|
+
data-align={align}
|
|
207
|
+
className={classNames(
|
|
208
|
+
"fabric-flyout",
|
|
209
|
+
"fixed inset-y-0 overflow-hidden flex flex-col flex-nowrap pointer-events-auto shadow-xl",
|
|
210
|
+
align === "start" ? "start-0" : "end-0",
|
|
211
|
+
size === "sm" && "w-[20rem]",
|
|
212
|
+
size === "md" && "w-[40rem]",
|
|
213
|
+
size === "lg" && "w-[60vw]",
|
|
214
|
+
size === "xl" && "w-[80vw]",
|
|
215
|
+
)}
|
|
216
|
+
style={{
|
|
217
|
+
width,
|
|
218
|
+
minWidth,
|
|
219
|
+
}}
|
|
220
|
+
onMouseUpCapture={tryClosing}
|
|
221
|
+
ref={refs.setFloating}
|
|
222
|
+
{...getFloatingProps()}
|
|
223
|
+
{...aria}
|
|
224
|
+
{...aria}
|
|
205
225
|
>
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
226
|
+
<HotKeyWrapper>
|
|
227
|
+
<Header
|
|
228
|
+
flex
|
|
229
|
+
align="center"
|
|
230
|
+
className={classNames("fabric-flyoutHeader", headerClassName)}
|
|
231
|
+
>
|
|
232
|
+
{isString(icon) && (
|
|
233
|
+
<Icon
|
|
234
|
+
icon={icon}
|
|
235
|
+
bg={iconBg}
|
|
236
|
+
color={iconColor}
|
|
237
|
+
className={classNames(iconClassName, "p-1")}
|
|
238
|
+
rtlFlip={rtlFlip}
|
|
239
|
+
/>
|
|
240
|
+
)}
|
|
241
|
+
{isValidElement(icon) && icon}
|
|
242
|
+
<label className="flex-1 truncate py-2 px-1">{title}</label>
|
|
243
|
+
{actions}
|
|
244
|
+
<Icon
|
|
245
|
+
data-ref="panelClose"
|
|
246
|
+
className={classNames(
|
|
247
|
+
"fabric-panelAction",
|
|
248
|
+
"cursor-pointer p-1 text-xl self-stretch",
|
|
249
|
+
)}
|
|
250
|
+
icon={CoreIcons.close}
|
|
251
|
+
onClick={() => handleClose(false)}
|
|
252
|
+
/>
|
|
253
|
+
</Header>
|
|
254
|
+
{loading && <Loading />}
|
|
218
255
|
<div
|
|
219
|
-
|
|
256
|
+
role="dialog"
|
|
220
257
|
className={classNames(
|
|
221
|
-
|
|
222
|
-
"
|
|
223
|
-
align === "start" ? "start-0" : "end-0",
|
|
224
|
-
size === "sm" && "w-[20rem]",
|
|
225
|
-
size === "md" && "w-[40rem]",
|
|
226
|
-
size === "lg" && "w-[60vw]",
|
|
227
|
-
size === "xl" && "w-[80vw]",
|
|
258
|
+
"fabric-flyoutBody",
|
|
259
|
+
"flex-1 grid overflow-hidden",
|
|
228
260
|
)}
|
|
229
|
-
|
|
230
|
-
width,
|
|
231
|
-
minWidth,
|
|
232
|
-
}}
|
|
233
|
-
onMouseUpCapture={tryClosing}
|
|
234
|
-
ref={refs.setFloating}
|
|
235
|
-
{...getFloatingProps()}
|
|
236
|
-
{...aria}
|
|
237
|
-
{...aria}
|
|
261
|
+
{...({ tabIndex: 0 } as AnyObject)}
|
|
238
262
|
>
|
|
239
|
-
|
|
240
|
-
<Header
|
|
241
|
-
flex
|
|
242
|
-
className={classNames(classes.flyoutHeader, headerClassName)}
|
|
243
|
-
>
|
|
244
|
-
{icon && (
|
|
245
|
-
<Icon
|
|
246
|
-
icon={icon}
|
|
247
|
-
bg={iconBg}
|
|
248
|
-
color={iconColor}
|
|
249
|
-
className={classNames(iconClassName, "p-1")}
|
|
250
|
-
rtlFlip={rtlFlip}
|
|
251
|
-
/>
|
|
252
|
-
)}
|
|
253
|
-
<label className="flex-1 truncate py-2 px-1">{title}</label>
|
|
254
|
-
{actions}
|
|
255
|
-
<Icon
|
|
256
|
-
data-ref="panelClose"
|
|
257
|
-
className={classNames(
|
|
258
|
-
classes.panelAction,
|
|
259
|
-
"cursor-pointer p-1 text-xl self-stretch",
|
|
260
|
-
)}
|
|
261
|
-
icon={CoreIcons.close}
|
|
262
|
-
onClick={() => handleClose(false)}
|
|
263
|
-
/>
|
|
264
|
-
</Header>
|
|
265
|
-
{loading && <Loading />}
|
|
266
|
-
<div
|
|
267
|
-
role="dialog"
|
|
268
|
-
className={classNames(
|
|
269
|
-
classes.flyoutBody,
|
|
270
|
-
"flex-1 grid overflow-hidden",
|
|
271
|
-
)}
|
|
272
|
-
{...({ tabIndex: 0 } as AnyObject)}
|
|
273
|
-
>
|
|
274
|
-
{children}
|
|
275
|
-
</div>
|
|
276
|
-
</HotKeyWrapper>
|
|
263
|
+
{children}
|
|
277
264
|
</div>
|
|
278
|
-
</
|
|
279
|
-
</
|
|
280
|
-
</
|
|
265
|
+
</HotKeyWrapper>
|
|
266
|
+
</div>
|
|
267
|
+
</FloatingFocusManager>
|
|
281
268
|
</FloatingPortal>
|
|
282
269
|
);
|
|
283
270
|
};
|
|
@@ -24,9 +24,8 @@
|
|
|
24
24
|
import classNames from "classnames";
|
|
25
25
|
import { useCallback, useLayoutEffect, useRef } from "react";
|
|
26
26
|
import { Icon } from "../../components/icon/Icon";
|
|
27
|
-
import { type
|
|
28
|
-
import {
|
|
29
|
-
import classes from "./Message.module.css";
|
|
27
|
+
import { type ColorState, type Elements, type IconProps } from "../../types";
|
|
28
|
+
import { getColor } from "../../utils";
|
|
30
29
|
|
|
31
30
|
export interface MessageProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
32
31
|
/**
|
|
@@ -40,7 +39,7 @@ export interface MessageProps extends Omit<IconProps, "iconBg" | "iconColor"> {
|
|
|
40
39
|
/**
|
|
41
40
|
* theme color
|
|
42
41
|
*/
|
|
43
|
-
color?:
|
|
42
|
+
color?: ColorState;
|
|
44
43
|
/**
|
|
45
44
|
* extra action button
|
|
46
45
|
*/
|
|
@@ -77,11 +76,15 @@ export const Message = ({
|
|
|
77
76
|
return (
|
|
78
77
|
<div
|
|
79
78
|
className={classNames(
|
|
80
|
-
|
|
81
|
-
color ? getBgClass(color + "-300") : "bg-invert",
|
|
82
|
-
color ? getColorClass(color + "-900") : "text-invert",
|
|
79
|
+
"fabric-message",
|
|
83
80
|
"flex flex-nowrap gap-1 px-8 relative justify-center max-w-md pointer-events-auto rounded mb-2 select-none",
|
|
84
81
|
)}
|
|
82
|
+
style={{
|
|
83
|
+
backgroundColor: color
|
|
84
|
+
? getColor(color + "-300")
|
|
85
|
+
: "var(--bg-color-invert)",
|
|
86
|
+
color: color ? getColor(color + "-900") : "var(--text-color-invert)",
|
|
87
|
+
}}
|
|
85
88
|
ref={elRef}
|
|
86
89
|
>
|
|
87
90
|
{icon && <Icon icon={icon} size="md" rtlFlip={rtlFlip} />}
|