@react-fabric/core 1.0.0-beta.5 → 1.0.0-beta.51
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} +69 -79
- package/{src/components/card/Card.module.css → css/components/_card.css} +50 -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} +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} +19 -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} +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} +56 -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 +42 -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 +530 -0
- package/css/theme/index.css +45 -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 +10 -3
- package/dist/cjs/components/button/ToggleButtonGroup.js +3 -3
- package/dist/cjs/components/callout/Callout.js +16 -4
- package/dist/cjs/components/card/Card.js +14 -10
- package/dist/cjs/components/card/CardCover.js +10 -5
- package/dist/cjs/components/card/FlipContent.js +35 -0
- package/dist/cjs/components/chip/Chip.js +11 -7
- package/dist/cjs/components/collapsable/Collapsable.js +6 -6
- package/dist/cjs/components/divider/Divider.js +11 -7
- package/dist/cjs/components/dropdown/Dropdown.js +6 -9
- package/dist/cjs/components/dropdown/DropdownTool.js +4 -3
- package/dist/cjs/components/empty/EmptyContent.js +8 -5
- package/dist/cjs/components/icon/Icon.js +17 -15
- 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 +44 -21
- 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 +26 -13
- 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 +10 -9
- package/dist/cjs/components/progress/ProgressCircle.js +9 -7
- package/dist/cjs/components/tabpanel/Tab.js +58 -38
- package/dist/cjs/components/tabpanel/TabPanel.js +20 -16
- package/dist/cjs/context/Global.js +3 -0
- package/dist/cjs/context/NotificationCenter.js +3 -3
- 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 +16 -30
- package/dist/cjs/core/responsive/Responsive.js +5 -5
- package/dist/cjs/core/section/Section.js +1 -2
- package/dist/cjs/core/theme/ThemeProvider.js +11 -9
- package/dist/cjs/core/viewport/Viewport.js +4 -2
- package/dist/cjs/hooks/useDebounce.js +1 -1
- package/dist/cjs/hooks/useEffectDebugger.js +2 -2
- package/dist/cjs/hooks/useNavigator.js +6 -4
- package/dist/cjs/hooks/useResizeObserver.js +1 -1
- package/dist/cjs/hotkeys/HotKeyLabel.js +1 -1
- package/dist/cjs/hotkeys/HotKeyWrapper.js +3 -1
- package/dist/cjs/index.js +8 -2
- package/dist/cjs/overlays/alert/Alert.js +20 -14
- 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 +16 -12
- package/dist/cjs/overlays/toast/Toast.js +17 -9
- package/dist/cjs/overlays/tooltip/Tooltip.js +24 -11
- package/dist/cjs/types/icons.js +6 -1
- package/dist/cjs/typography/Abbr.js +4 -5
- 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 +47 -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 +10 -3
- package/dist/esm/components/button/ToggleButtonGroup.js +4 -4
- package/dist/esm/components/callout/Callout.js +16 -4
- package/dist/esm/components/card/Card.js +15 -11
- package/dist/esm/components/card/CardCover.js +10 -5
- package/dist/esm/components/card/FlipContent.js +35 -0
- package/dist/esm/components/chip/Chip.js +12 -8
- package/dist/esm/components/collapsable/Collapsable.js +6 -6
- package/dist/esm/components/divider/Divider.js +12 -8
- package/dist/esm/components/dropdown/Dropdown.js +6 -9
- package/dist/esm/components/dropdown/DropdownTool.js +4 -3
- package/dist/esm/components/empty/EmptyContent.js +8 -5
- package/dist/esm/components/icon/Icon.js +17 -15
- 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 +46 -23
- 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 +26 -13
- 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 +10 -9
- package/dist/esm/components/progress/ProgressCircle.js +9 -7
- package/dist/esm/components/tabpanel/Tab.js +59 -39
- package/dist/esm/components/tabpanel/TabPanel.js +20 -16
- package/dist/esm/context/Global.js +3 -0
- package/dist/esm/context/NotificationCenter.js +3 -3
- 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 +16 -30
- package/dist/esm/core/responsive/Responsive.js +5 -5
- package/dist/esm/core/section/Section.js +1 -2
- package/dist/esm/core/theme/ThemeProvider.js +11 -9
- package/dist/esm/core/viewport/Viewport.js +4 -2
- package/dist/esm/hooks/useDebounce.js +1 -1
- package/dist/esm/hooks/useEffectDebugger.js +2 -2
- package/dist/esm/hooks/useNavigator.js +7 -5
- package/dist/esm/hooks/useResizeObserver.js +1 -1
- package/dist/esm/hotkeys/HotKeyLabel.js +1 -1
- package/dist/esm/hotkeys/HotKeyWrapper.js +3 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/overlays/alert/Alert.js +21 -15
- 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 +17 -13
- package/dist/esm/overlays/toast/Toast.js +18 -10
- package/dist/esm/overlays/tooltip/Tooltip.js +24 -11
- package/dist/esm/types/icons.js +6 -1
- package/dist/esm/typography/Abbr.js +4 -5
- 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 +47 -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 +4 -3
- package/dist/types/components/card/Card.d.ts +8 -4
- package/dist/types/components/card/FlipContent.d.ts +7 -0
- package/dist/types/components/chip/Chip.d.ts +3 -3
- package/dist/types/components/collapsable/Collapsable.d.ts +7 -3
- package/dist/types/components/divider/Divider.d.ts +11 -7
- 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 +5 -4
- package/dist/types/components/index.d.ts +2 -1
- 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 +3 -2
- package/dist/types/components/navigator/Navigator.d.ts +7 -4
- package/dist/types/components/panel/Panel.d.ts +0 -1
- package/dist/types/components/progress/ProgressBar.d.ts +3 -3
- package/dist/types/components/progress/ProgressCircle.d.ts +3 -3
- package/dist/types/components/tabpanel/Tab.d.ts +5 -5
- package/dist/types/components/tabpanel/TabPanel.d.ts +10 -1
- package/dist/types/core/boundary/ErrorBoundary.d.ts +1 -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/page/Page.d.ts +3 -3
- package/dist/types/core/responsive/Responsive.d.ts +6 -2
- package/dist/types/core/theme/ThemeProvider.d.ts +4 -4
- package/dist/types/hooks/useOverlayService.d.ts +3 -5
- package/dist/types/hooks/useResize.d.ts +1 -1
- package/dist/types/hooks/useResizeObserver.d.ts +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/overlays/alert/Alert.d.ts +2 -3
- package/dist/types/overlays/flyout/Flyout.d.ts +3 -2
- package/dist/types/overlays/message/Message.d.ts +2 -3
- package/dist/types/overlays/modal/Modal.d.ts +12 -3
- package/dist/types/overlays/toast/Toast.d.ts +2 -3
- package/dist/types/overlays/tooltip/Tooltip.d.ts +2 -2
- package/dist/types/types/icons.d.ts +6 -1
- package/dist/types/types/index.d.ts +26 -6
- package/dist/types/typography/Abbr.d.ts +6 -3
- package/dist/types/typography/Anchor.d.ts +25 -0
- package/dist/types/typography/Mark.d.ts +2 -3
- 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 +11 -13
- 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 +19 -6
- package/src/components/button/ToggleButtonGroup.tsx +5 -5
- package/src/components/callout/Callout.tsx +28 -12
- package/src/components/card/Card.tsx +30 -15
- package/src/components/card/CardCover.tsx +11 -6
- package/src/components/card/FlipContent.tsx +69 -0
- package/src/components/chip/Chip.tsx +19 -13
- package/src/components/collapsable/Collapsable.tsx +12 -7
- package/src/components/divider/Divider.tsx +23 -16
- package/src/components/dropdown/Dropdown.tsx +6 -11
- package/src/components/dropdown/DropdownTool.tsx +5 -3
- package/src/components/empty/EmptyContent.tsx +21 -6
- package/src/components/icon/Icon.tsx +58 -67
- package/src/components/index.ts +2 -1
- package/src/components/media/Media.tsx +141 -106
- package/src/components/menu/ContextMenu.tsx +36 -11
- package/src/components/menu/Menu.tsx +56 -30
- package/src/components/menu/MenuItem.tsx +19 -9
- package/src/components/menu/types.ts +3 -2
- package/src/components/meter/Meter.tsx +2 -3
- package/src/components/navigator/Navigator.tsx +36 -7
- package/src/components/panel/Panel.tsx +10 -9
- package/src/components/panel/PanelGroup.tsx +1 -2
- package/src/components/progress/ProgressBar.tsx +13 -14
- package/src/components/progress/ProgressCircle.tsx +10 -13
- package/src/components/tabpanel/Tab.tsx +81 -64
- package/src/components/tabpanel/TabPanel.tsx +34 -12
- package/src/context/Global.tsx +4 -0
- package/src/context/NotificationCenter.tsx +3 -3
- 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 +18 -5
- package/src/core/responsive/Responsive.tsx +14 -7
- package/src/core/section/Section.tsx +1 -2
- package/src/core/theme/ThemeProvider.tsx +14 -13
- package/src/core/viewport/Viewport.tsx +1 -2
- package/src/hooks/useDebounce.ts +1 -1
- package/src/hooks/useEffectDebugger.ts +1 -2
- package/src/hooks/useNavigator.tsx +10 -5
- package/src/hooks/useOverlayService.tsx +12 -6
- package/src/hooks/useResize.ts +1 -1
- package/src/hooks/useResizeObserver.ts +13 -9
- 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 +28 -32
- package/src/overlays/flyout/Flyout.tsx +71 -84
- package/src/overlays/message/Message.tsx +10 -7
- package/src/overlays/modal/Modal.tsx +37 -15
- package/src/overlays/toast/Toast.tsx +18 -27
- package/src/overlays/tooltip/Tooltip.tsx +43 -18
- package/src/types/icons.ts +13 -2
- package/src/types/index.ts +268 -27
- package/src/typography/Abbr.tsx +16 -10
- 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/{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
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
import { EMPTY_ARRAY, isArray } from "@react-fabric/utilities";
|
|
25
25
|
import classNames from "classnames";
|
|
26
|
-
import {
|
|
26
|
+
import { cloneElement, useCallback, useMemo } from "react";
|
|
27
27
|
import { useControlledValue } from "../../hooks/useControlledValue";
|
|
28
28
|
import {
|
|
29
29
|
type AriaProps,
|
|
@@ -32,8 +32,8 @@ import {
|
|
|
32
32
|
type CssProp,
|
|
33
33
|
type SizeType,
|
|
34
34
|
} from "../../types";
|
|
35
|
+
import { cloneChildren } from "../../utils";
|
|
35
36
|
import { type ButtonProps } from "./Button";
|
|
36
|
-
import classes from "./Button.module.css";
|
|
37
37
|
|
|
38
38
|
interface BaseProps
|
|
39
39
|
extends CssProp,
|
|
@@ -131,16 +131,16 @@ export const ToggleButtonGroup = ({
|
|
|
131
131
|
return (
|
|
132
132
|
<div
|
|
133
133
|
className={classNames(
|
|
134
|
-
|
|
134
|
+
"fabric-buttonGroup",
|
|
135
135
|
className,
|
|
136
136
|
fullWidth ? "flex" : "inline-flex",
|
|
137
137
|
"flex-nowrap align-middle",
|
|
138
|
-
vertical &&
|
|
138
|
+
vertical && "vertical",
|
|
139
139
|
vertical && "flex-col",
|
|
140
140
|
)}
|
|
141
141
|
{...aria}
|
|
142
142
|
>
|
|
143
|
-
{
|
|
143
|
+
{cloneChildren(children, (child: AnyObject) =>
|
|
144
144
|
cloneElement(child, {
|
|
145
145
|
color,
|
|
146
146
|
size,
|
|
@@ -25,13 +25,11 @@ import classNames from "classnames";
|
|
|
25
25
|
import {
|
|
26
26
|
type AriaProps,
|
|
27
27
|
type ChildrenProp,
|
|
28
|
-
type
|
|
28
|
+
type ColorState,
|
|
29
29
|
type CssProp,
|
|
30
|
-
type PaletteType,
|
|
31
30
|
type TestProps,
|
|
32
31
|
} from "../../types";
|
|
33
32
|
import { CoreIcons } from "../../types/icons";
|
|
34
|
-
import { getBgClass, getBorderClass, getColorClass } from "../../utils";
|
|
35
33
|
import { Icon } from "../icon/Icon";
|
|
36
34
|
|
|
37
35
|
export interface CalloutProps
|
|
@@ -42,11 +40,11 @@ export interface CalloutProps
|
|
|
42
40
|
/**
|
|
43
41
|
* callout color
|
|
44
42
|
*/
|
|
45
|
-
color?:
|
|
43
|
+
color?: ColorState | "none";
|
|
46
44
|
/**
|
|
47
45
|
* legend title
|
|
48
46
|
*/
|
|
49
|
-
legend?: string;
|
|
47
|
+
legend?: string | React.ReactElement;
|
|
50
48
|
/**
|
|
51
49
|
* callout icon
|
|
52
50
|
*/
|
|
@@ -65,6 +63,17 @@ export interface CalloutProps
|
|
|
65
63
|
onClose?: () => void;
|
|
66
64
|
}
|
|
67
65
|
|
|
66
|
+
const colors = {
|
|
67
|
+
none: "bg-base text-tint-900 border-tint-100",
|
|
68
|
+
tint: "bg-tint-50/50 text-tint-800 border-tint-300",
|
|
69
|
+
primary: "bg-primary-50/50 text-primary-800 border-primary-300",
|
|
70
|
+
accent: "bg-accent-50/50 text-accent-800 border-accent-300",
|
|
71
|
+
info: "bg-info-50/50 text-info-800 border-info-300",
|
|
72
|
+
danger: "bg-danger-50/50 text-danger-800 border-danger-300",
|
|
73
|
+
success: "bg-success-50/50 text-success-800 border-success-300",
|
|
74
|
+
warning: "bg-warning-50/50 text-warning-800 border-warning-300",
|
|
75
|
+
};
|
|
76
|
+
|
|
68
77
|
export const Callout = ({
|
|
69
78
|
children,
|
|
70
79
|
// @ts-expect-error ignore
|
|
@@ -80,27 +89,34 @@ export const Callout = ({
|
|
|
80
89
|
return (
|
|
81
90
|
<fieldset
|
|
82
91
|
className={classNames(
|
|
83
|
-
className,
|
|
84
92
|
"block rounded-capped border max-w-full relative overflow-hidden mb-4",
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
getBorderClass(color + "-300"),
|
|
93
|
+
colors[color],
|
|
94
|
+
className,
|
|
88
95
|
border === "dashed" && "border-dashed",
|
|
89
96
|
border === "dotted" && "border-dotted",
|
|
90
97
|
)}
|
|
91
98
|
{...aria}
|
|
92
99
|
>
|
|
93
|
-
{legend &&
|
|
100
|
+
{legend && (
|
|
101
|
+
<legend className="px-2 mx-4 font-medium" data-ref="calloutLegend">
|
|
102
|
+
{legend}
|
|
103
|
+
</legend>
|
|
104
|
+
)}
|
|
94
105
|
<div className={classNames("break-words whitespace-break-spaces p-2")}>
|
|
95
106
|
<div className="flex flex-nowrap items-center text-xl pe-4 gap-2 mb-4 empty:mb-0">
|
|
96
|
-
{icon && <Icon icon={icon} />}
|
|
97
|
-
{title &&
|
|
107
|
+
{icon && <Icon icon={icon} data-ref="calloutIcon" />}
|
|
108
|
+
{title && (
|
|
109
|
+
<p className="flex-1" data-ref="calloutTitle">
|
|
110
|
+
{title}
|
|
111
|
+
</p>
|
|
112
|
+
)}
|
|
98
113
|
</div>
|
|
99
114
|
<div className="pe-4">{children}</div>
|
|
100
115
|
</div>
|
|
101
116
|
{onClose && (
|
|
102
117
|
<Icon
|
|
103
118
|
size="md"
|
|
119
|
+
data-ref="calloutClose"
|
|
104
120
|
className={classNames("absolute end-2", legend ? "top-0" : "top-2")}
|
|
105
121
|
icon={CoreIcons.close}
|
|
106
122
|
onClick={onClose}
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
import classNames from "classnames";
|
|
25
25
|
import {
|
|
26
26
|
Children,
|
|
27
|
-
useMemo,
|
|
28
27
|
type DragEvent,
|
|
29
28
|
type MouseEventHandler,
|
|
29
|
+
useCallback,
|
|
30
|
+
useMemo,
|
|
30
31
|
} from "react";
|
|
31
32
|
import { ErrorBoundary } from "../../core/boundary/ErrorBoundary";
|
|
32
33
|
import { type ContentProps } from "../../core/content/Content";
|
|
@@ -39,15 +40,16 @@ import {
|
|
|
39
40
|
type AriaProps,
|
|
40
41
|
type ChildrenProp,
|
|
41
42
|
type CssProp,
|
|
43
|
+
type RefProp,
|
|
42
44
|
type TestProps,
|
|
43
45
|
} from "../../types";
|
|
44
46
|
import { nodeCheck } from "../../utils";
|
|
45
|
-
import classes from "./Card.module.css";
|
|
46
47
|
|
|
47
48
|
export interface CardProps
|
|
48
49
|
extends CssProp,
|
|
49
50
|
AriaProps,
|
|
50
51
|
TestProps,
|
|
52
|
+
RefProp<HTMLDivElement>,
|
|
51
53
|
ChildrenProp<React.ReactElement<HeadFootProps | ContentProps>> {
|
|
52
54
|
/**
|
|
53
55
|
* apply flex fill styling
|
|
@@ -57,6 +59,14 @@ export interface CardProps
|
|
|
57
59
|
* click handler
|
|
58
60
|
*/
|
|
59
61
|
onClick?: MouseEventHandler;
|
|
62
|
+
/**
|
|
63
|
+
* drag start handler
|
|
64
|
+
*/
|
|
65
|
+
onDragStart?: (
|
|
66
|
+
event: DragEvent,
|
|
67
|
+
dragKey: string,
|
|
68
|
+
dragData?: KeyValue,
|
|
69
|
+
) => void;
|
|
60
70
|
/**
|
|
61
71
|
* body css classname(s)
|
|
62
72
|
*/
|
|
@@ -90,10 +100,12 @@ export const Card = ({
|
|
|
90
100
|
selected,
|
|
91
101
|
selectedRibbon,
|
|
92
102
|
onClick,
|
|
103
|
+
onDragStart,
|
|
93
104
|
flex,
|
|
94
105
|
draggable,
|
|
95
106
|
dragKey,
|
|
96
107
|
dragData,
|
|
108
|
+
ref,
|
|
97
109
|
...aria
|
|
98
110
|
}: CardProps) => {
|
|
99
111
|
const [header, body, footer] = useMemo(() => {
|
|
@@ -110,38 +122,41 @@ export const Card = ({
|
|
|
110
122
|
);
|
|
111
123
|
}, [children]);
|
|
112
124
|
|
|
125
|
+
const handleDragStart = useCallback(
|
|
126
|
+
(event: DragEvent) => {
|
|
127
|
+
dragKey && event.dataTransfer?.setData(dragKey, JSON.stringify(dragData));
|
|
128
|
+
dragKey && onDragStart?.(event, dragKey, dragData);
|
|
129
|
+
},
|
|
130
|
+
[onDragStart, dragKey, dragData],
|
|
131
|
+
);
|
|
132
|
+
|
|
113
133
|
return (
|
|
114
134
|
<div
|
|
115
135
|
className={classNames(
|
|
116
|
-
|
|
136
|
+
"fabric-cardWrapper",
|
|
117
137
|
"rounded-capped relative grid",
|
|
118
138
|
flex && "flex-1",
|
|
119
|
-
selected && selectedRibbon &&
|
|
120
|
-
selected && "outline
|
|
139
|
+
selected && selectedRibbon && "selected",
|
|
140
|
+
selected && "outline-2 outline-accent-500 outline-offset-2",
|
|
121
141
|
)}
|
|
122
142
|
>
|
|
123
143
|
<ErrorBoundary>
|
|
124
144
|
<div
|
|
125
145
|
className={classNames(
|
|
126
|
-
|
|
146
|
+
"fabric-card",
|
|
127
147
|
className,
|
|
128
148
|
"rounded-capped flex flex-col flex-nowrap overflow-hidden",
|
|
129
|
-
onClick &&
|
|
149
|
+
onClick && "clickable",
|
|
130
150
|
)}
|
|
131
151
|
draggable={draggable}
|
|
132
|
-
onDragStart={
|
|
133
|
-
|
|
134
|
-
? undefined
|
|
135
|
-
: (e: DragEvent) =>
|
|
136
|
-
dragKey &&
|
|
137
|
-
e.dataTransfer?.setData(dragKey, JSON.stringify(dragData))
|
|
138
|
-
}
|
|
152
|
+
onDragStart={!draggable ? undefined : handleDragStart}
|
|
153
|
+
ref={ref}
|
|
139
154
|
{...aria}
|
|
140
155
|
>
|
|
141
156
|
{header}
|
|
142
157
|
<div
|
|
143
158
|
role="none"
|
|
144
|
-
className={classNames(
|
|
159
|
+
className={classNames("fabric-cardBody", bodyClassName, "flex-1")}
|
|
145
160
|
onClick={onClick}
|
|
146
161
|
>
|
|
147
162
|
{body}
|
|
@@ -26,7 +26,6 @@ import { Children, useMemo } from "react";
|
|
|
26
26
|
import { type AriaProps, type ChildrenProp, type CssProp } from "../../types";
|
|
27
27
|
import { nodeCheck } from "../../utils";
|
|
28
28
|
import { Image, Video } from "../media/Media";
|
|
29
|
-
import classes from "./Card.module.css";
|
|
30
29
|
|
|
31
30
|
export interface CardCoverProps extends CssProp, AriaProps, ChildrenProp {
|
|
32
31
|
/**
|
|
@@ -43,12 +42,19 @@ export interface CardCoverProps extends CssProp, AriaProps, ChildrenProp {
|
|
|
43
42
|
justify?: "start" | "center" | "end";
|
|
44
43
|
}
|
|
45
44
|
|
|
45
|
+
const scheme = {
|
|
46
|
+
inheritScheme: "inheritScheme",
|
|
47
|
+
light: "light",
|
|
48
|
+
dark: "dark",
|
|
49
|
+
};
|
|
50
|
+
|
|
46
51
|
export const CardCover = ({
|
|
47
52
|
className,
|
|
48
53
|
children,
|
|
49
54
|
height = 120,
|
|
50
55
|
justify = "end",
|
|
51
|
-
|
|
56
|
+
// @ts-expect-error ignore
|
|
57
|
+
colorScheme = "inheritScheme",
|
|
52
58
|
...aria
|
|
53
59
|
}: CardCoverProps) => {
|
|
54
60
|
const [media, body] = useMemo(() => {
|
|
@@ -64,8 +70,8 @@ export const CardCover = ({
|
|
|
64
70
|
<div
|
|
65
71
|
style={{ height }}
|
|
66
72
|
className={classNames(
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
"fabric-cardCover",
|
|
74
|
+
scheme[colorScheme],
|
|
69
75
|
"relative z-0",
|
|
70
76
|
)}
|
|
71
77
|
{...aria}
|
|
@@ -73,9 +79,8 @@ export const CardCover = ({
|
|
|
73
79
|
{media}
|
|
74
80
|
<div
|
|
75
81
|
className={classNames(
|
|
76
|
-
|
|
82
|
+
"fabric-cardCoverContent",
|
|
77
83
|
"relative pointer-events-none z-1 flex flex-col flex-nowrap p-4 h-full",
|
|
78
|
-
className,
|
|
79
84
|
`justify-${justify}`,
|
|
80
85
|
className,
|
|
81
86
|
)}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* React Fabric
|
|
3
|
+
* @version: 1.0.0
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* The MIT License (MIT)
|
|
7
|
+
* Copyright (c) 2025 Adarsh Pastakia
|
|
8
|
+
*
|
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
10
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
11
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
12
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
13
|
+
* subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
16
|
+
* portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
19
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
20
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import classNames from "classnames";
|
|
25
|
+
import {
|
|
26
|
+
Children,
|
|
27
|
+
cloneElement,
|
|
28
|
+
isValidElement,
|
|
29
|
+
useImperativeHandle,
|
|
30
|
+
useState,
|
|
31
|
+
} from "react";
|
|
32
|
+
import { type ChildrenProp, type CssProp, type RefProp } from "../../types";
|
|
33
|
+
|
|
34
|
+
export interface FlipContentRef {
|
|
35
|
+
flipCard: () => void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Props extends ChildrenProp, RefProp<FlipContentRef> {
|
|
39
|
+
//
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const FlipContent = ({ ref, children }: Props) => {
|
|
43
|
+
const [showBack, setShowBack] = useState(false);
|
|
44
|
+
|
|
45
|
+
useImperativeHandle(
|
|
46
|
+
ref,
|
|
47
|
+
() => ({
|
|
48
|
+
flipCard: () => setShowBack(!showBack),
|
|
49
|
+
}),
|
|
50
|
+
[showBack],
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className="relative flex-1" data-card-flip={showBack}>
|
|
55
|
+
{Children.map(
|
|
56
|
+
children,
|
|
57
|
+
(child, idx) =>
|
|
58
|
+
isValidElement<CssProp>(child) &&
|
|
59
|
+
cloneElement(child, {
|
|
60
|
+
className: classNames(
|
|
61
|
+
child.props?.className ?? "",
|
|
62
|
+
idx === 0 ? "bg-base relative" : "bg-base absolute inset-0",
|
|
63
|
+
),
|
|
64
|
+
"data-card-flip-face": idx === 0 ? "front" : "back",
|
|
65
|
+
} as AnyObject),
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
@@ -30,14 +30,14 @@ import {
|
|
|
30
30
|
type ColorType,
|
|
31
31
|
type CssProp,
|
|
32
32
|
type IconProps,
|
|
33
|
+
type PaletteType,
|
|
33
34
|
type PolymorphicProps,
|
|
34
35
|
type RefProp,
|
|
35
36
|
type SizeType,
|
|
36
37
|
type TestProps,
|
|
37
38
|
} from "../../types";
|
|
38
|
-
import { getColor
|
|
39
|
+
import { getColor } from "../../utils";
|
|
39
40
|
import { Icon } from "../icon/Icon";
|
|
40
|
-
import classes from "./Chip.module.css";
|
|
41
41
|
|
|
42
42
|
export interface ChipProps
|
|
43
43
|
extends CssProp,
|
|
@@ -49,11 +49,11 @@ export interface ChipProps
|
|
|
49
49
|
/**
|
|
50
50
|
* chip size
|
|
51
51
|
*/
|
|
52
|
-
size?: SizeType;
|
|
52
|
+
size?: SizeType | number | string;
|
|
53
53
|
/**
|
|
54
54
|
* chip color (CSS color / tailwind color)
|
|
55
55
|
*/
|
|
56
|
-
color?: ColorType | string;
|
|
56
|
+
color?: ColorType | PaletteType | string;
|
|
57
57
|
/**
|
|
58
58
|
* chip styling
|
|
59
59
|
*/
|
|
@@ -152,24 +152,25 @@ export const Chip = <Tag extends React.ElementType = "div">({
|
|
|
152
152
|
<E
|
|
153
153
|
ref={ref}
|
|
154
154
|
role="term"
|
|
155
|
+
data-ref="chip"
|
|
155
156
|
className={classNames(
|
|
156
|
-
|
|
157
|
+
"fabric-chip",
|
|
157
158
|
className,
|
|
158
|
-
|
|
159
|
-
"select-none inline-flex flex-nowrap items-center max-w-72 text-sm rounded",
|
|
159
|
+
"select-none inline-flex flex-nowrap items-center align-middle max-w-72 rounded",
|
|
160
160
|
rounded && "rounded-full",
|
|
161
|
-
!!onClick &&
|
|
162
|
-
disabled &&
|
|
161
|
+
!!onClick && "clickable",
|
|
162
|
+
disabled && "disabled",
|
|
163
163
|
)}
|
|
164
164
|
style={styles}
|
|
165
165
|
data-variant={variant}
|
|
166
166
|
data-inner-clickable={!!onClick}
|
|
167
|
-
{...{ onClick: clickHandler }}
|
|
167
|
+
{...{ onClick: disabled ? undefined : clickHandler }}
|
|
168
168
|
{...aria}
|
|
169
169
|
>
|
|
170
170
|
{icon && (
|
|
171
171
|
<Icon
|
|
172
|
-
|
|
172
|
+
data-ref="chipIcon"
|
|
173
|
+
className={classNames("fabric-chipIcon", "m-1")}
|
|
173
174
|
icon={icon}
|
|
174
175
|
bg={iconBg}
|
|
175
176
|
onClick={onIconClick}
|
|
@@ -178,15 +179,20 @@ export const Chip = <Tag extends React.ElementType = "div">({
|
|
|
178
179
|
/>
|
|
179
180
|
)}
|
|
180
181
|
{children && (
|
|
181
|
-
<label
|
|
182
|
+
<label
|
|
183
|
+
data-ref="chipLabel"
|
|
184
|
+
className={classNames("fabric-chipLabel", "truncate")}
|
|
185
|
+
>
|
|
182
186
|
{children}
|
|
183
187
|
</label>
|
|
184
188
|
)}
|
|
185
189
|
{onRemove && (
|
|
186
190
|
<span
|
|
187
191
|
role="none"
|
|
192
|
+
data-ref="chipRemove"
|
|
193
|
+
data-inner-cliackable
|
|
188
194
|
className={classNames(
|
|
189
|
-
|
|
195
|
+
"fabric-chipRemove",
|
|
190
196
|
"cursor-pointer pe-1 opacity-65 hover:opacity-90",
|
|
191
197
|
)}
|
|
192
198
|
onClick={removeHandler}
|
|
@@ -40,11 +40,10 @@ import {
|
|
|
40
40
|
} from "../../types";
|
|
41
41
|
import { CoreIcons } from "../../types/icons";
|
|
42
42
|
import { Icon } from "../icon/Icon";
|
|
43
|
-
import classes from "./Collapsable.module.css";
|
|
44
43
|
|
|
45
44
|
interface CollapsableRef {
|
|
46
|
-
button: RefObject<HTMLElement>;
|
|
47
|
-
body: RefObject<HTMLElement>;
|
|
45
|
+
button: RefObject<HTMLElement | null>;
|
|
46
|
+
body: RefObject<HTMLElement | null>;
|
|
48
47
|
open: boolean;
|
|
49
48
|
}
|
|
50
49
|
|
|
@@ -66,6 +65,10 @@ export interface CollapsableProps
|
|
|
66
65
|
* header button className
|
|
67
66
|
*/
|
|
68
67
|
headerClassName?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Header position sticky
|
|
70
|
+
*/
|
|
71
|
+
stickyHeader?: boolean;
|
|
69
72
|
/**
|
|
70
73
|
* open state icon
|
|
71
74
|
*/
|
|
@@ -100,6 +103,7 @@ export const Collapsable = ({
|
|
|
100
103
|
headerClassName,
|
|
101
104
|
children,
|
|
102
105
|
iconAlign,
|
|
106
|
+
stickyHeader,
|
|
103
107
|
iconClosed = CoreIcons.chevronRight,
|
|
104
108
|
iconOpen = CoreIcons.chevronDown,
|
|
105
109
|
open,
|
|
@@ -130,25 +134,26 @@ export const Collapsable = ({
|
|
|
130
134
|
return [h, b];
|
|
131
135
|
}, [children]);
|
|
132
136
|
return (
|
|
133
|
-
<div className={classNames(
|
|
137
|
+
<div className={classNames("fabric-collapsable", className)} {...aria}>
|
|
134
138
|
<div
|
|
135
139
|
role="none"
|
|
136
140
|
ref={headRef}
|
|
137
141
|
className={classNames(
|
|
138
|
-
|
|
142
|
+
"fabric-collapsableHead",
|
|
139
143
|
"flex gap-1 flex-nowrap py-2 font-medium cursor-pointer items-center select-none hover:opacity-70",
|
|
140
144
|
headerClassName,
|
|
145
|
+
stickyHeader && "bg-base sticky top-0 py-1 z-10",
|
|
141
146
|
iconAlign === "end" ? "flex-row-reverse" : "flex-row",
|
|
142
147
|
)}
|
|
143
148
|
onClick={() => !disabled && setOpenState(!openState)}
|
|
144
149
|
>
|
|
145
150
|
<Icon size="1.125em" icon={openState ? iconOpen : iconClosed} rtlFlip />
|
|
146
|
-
<div className="flex-1
|
|
151
|
+
<div className="flex-1">{head}</div>
|
|
147
152
|
</div>
|
|
148
153
|
{openState && (
|
|
149
154
|
<div
|
|
150
155
|
ref={bodyRef}
|
|
151
|
-
className={classNames(
|
|
156
|
+
className={classNames("fabric-collapsableBody", bodyClassName)}
|
|
152
157
|
>
|
|
153
158
|
{body}
|
|
154
159
|
</div>
|
|
@@ -24,37 +24,42 @@
|
|
|
24
24
|
import classNames from "classnames";
|
|
25
25
|
import { useCallback } from "react";
|
|
26
26
|
import {
|
|
27
|
-
type CssProp,
|
|
28
27
|
type ChildProp,
|
|
29
28
|
type ColorType,
|
|
29
|
+
type CssProp,
|
|
30
30
|
type PaletteType,
|
|
31
31
|
} from "../../types";
|
|
32
|
-
import {
|
|
32
|
+
import { getColor } from "../../utils";
|
|
33
33
|
|
|
34
34
|
export interface DividerProps extends CssProp, Partial<ChildProp> {
|
|
35
|
-
/**
|
|
36
|
-
* apply text bg
|
|
37
|
-
*/
|
|
38
|
-
fill?: boolean;
|
|
39
35
|
/**
|
|
40
36
|
* vertical rule
|
|
41
37
|
*/
|
|
42
38
|
vertical?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* divider label classname(s)
|
|
41
|
+
*/
|
|
42
|
+
labelClassName?: string;
|
|
43
43
|
/**
|
|
44
44
|
* rule color
|
|
45
45
|
*/
|
|
46
|
-
color?: ColorType | PaletteType |
|
|
46
|
+
color?: ColorType | PaletteType | string;
|
|
47
47
|
/**
|
|
48
48
|
* text alignment
|
|
49
49
|
*/
|
|
50
50
|
align?: "start" | "end" | "center";
|
|
51
|
+
/**
|
|
52
|
+
* divider style
|
|
53
|
+
*/
|
|
54
|
+
style?: "solid" | "dashed" | "dotted";
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
export const Divider = ({
|
|
54
58
|
children,
|
|
55
|
-
color,
|
|
59
|
+
color = "tint-300",
|
|
56
60
|
vertical,
|
|
57
|
-
|
|
61
|
+
labelClassName,
|
|
62
|
+
style,
|
|
58
63
|
align = "start",
|
|
59
64
|
className,
|
|
60
65
|
}: DividerProps) => {
|
|
@@ -62,13 +67,14 @@ export const Divider = ({
|
|
|
62
67
|
({ flex, className }: KeyValue) => {
|
|
63
68
|
return (
|
|
64
69
|
<hr
|
|
65
|
-
style={{ flex }}
|
|
70
|
+
style={{ flex, borderColor: getColor(color), borderStyle: style }}
|
|
66
71
|
className={classNames(
|
|
67
72
|
className,
|
|
68
73
|
vertical && "vertical",
|
|
69
74
|
!flex && "self-stretch",
|
|
70
|
-
vertical
|
|
71
|
-
|
|
75
|
+
vertical
|
|
76
|
+
? "fabric-divider--vertical"
|
|
77
|
+
: "fabric-divider--horizontal",
|
|
72
78
|
)}
|
|
73
79
|
/>
|
|
74
80
|
);
|
|
@@ -79,7 +85,7 @@ export const Divider = ({
|
|
|
79
85
|
return children ? (
|
|
80
86
|
<div
|
|
81
87
|
className={classNames(
|
|
82
|
-
"flex flex-nowrap items-center",
|
|
88
|
+
"flex flex-nowrap items-center fabric-divider",
|
|
83
89
|
vertical && "flex-col",
|
|
84
90
|
className,
|
|
85
91
|
)}
|
|
@@ -88,9 +94,10 @@ export const Divider = ({
|
|
|
88
94
|
<div
|
|
89
95
|
className={classNames(
|
|
90
96
|
"px-2 whitespace-nowrap",
|
|
91
|
-
vertical
|
|
92
|
-
|
|
93
|
-
|
|
97
|
+
vertical
|
|
98
|
+
? "fabric-divider-label--vertical"
|
|
99
|
+
: "fabric-divider-label--horizontal",
|
|
100
|
+
labelClassName,
|
|
94
101
|
"rounded-full text-[0.75em]",
|
|
95
102
|
vertical && "origin-center -rotate-90 z-1",
|
|
96
103
|
)}
|
|
@@ -54,7 +54,6 @@ import {
|
|
|
54
54
|
useState,
|
|
55
55
|
} from "react";
|
|
56
56
|
import { type ChildProp, type RefProp } from "../../types";
|
|
57
|
-
import classes from "./Dropdown.module.css";
|
|
58
57
|
|
|
59
58
|
export interface DropdownProps extends RefProp {
|
|
60
59
|
children: [React.ReactNode, React.ReactNode];
|
|
@@ -224,6 +223,7 @@ const DropdownElement = ({
|
|
|
224
223
|
e.stopPropagation();
|
|
225
224
|
},
|
|
226
225
|
}),
|
|
226
|
+
"data-inner-clickable": "true",
|
|
227
227
|
"data-dropdown-open": isOpen ? true : undefined,
|
|
228
228
|
ref: innerRef,
|
|
229
229
|
})}
|
|
@@ -237,17 +237,13 @@ const DropdownElement = ({
|
|
|
237
237
|
<FloatingOverlay />
|
|
238
238
|
<FloatingFocusManager context={context} modal>
|
|
239
239
|
<div
|
|
240
|
-
ref={
|
|
241
|
-
refs.setFloating(el);
|
|
242
|
-
el
|
|
243
|
-
?.querySelector<HTMLElement>("input,textarea,button")
|
|
244
|
-
?.focus();
|
|
245
|
-
}}
|
|
240
|
+
ref={refs.setFloating}
|
|
246
241
|
style={{
|
|
247
242
|
minWidth,
|
|
248
243
|
zIndex: "var(--z-popover)",
|
|
249
244
|
...floatingStyles,
|
|
250
245
|
}}
|
|
246
|
+
data-ref="dropdownBody"
|
|
251
247
|
{...getFloatingProps({
|
|
252
248
|
onClick: (e) => e.stopPropagation(),
|
|
253
249
|
})}
|
|
@@ -255,10 +251,9 @@ const DropdownElement = ({
|
|
|
255
251
|
<div
|
|
256
252
|
role="none"
|
|
257
253
|
className={classNames(
|
|
258
|
-
|
|
254
|
+
"fabric-dropdownBody",
|
|
259
255
|
dropdownClassName,
|
|
260
|
-
!plainDropdown &&
|
|
261
|
-
"shadow-lg shadow-base bg-base ring-1 ring-tint-100",
|
|
256
|
+
!plainDropdown && "shadow-lg bg-base ring-1 ring-tint-100",
|
|
262
257
|
"rounded-capped overflow-auto scroll-thin grid max-h-[70vh]",
|
|
263
258
|
)}
|
|
264
259
|
onMouseUpCapture={tryClosing}
|
|
@@ -270,7 +265,7 @@ const DropdownElement = ({
|
|
|
270
265
|
ref={arrowRef}
|
|
271
266
|
context={context}
|
|
272
267
|
strokeWidth={0.5}
|
|
273
|
-
className="fill-base stroke-
|
|
268
|
+
className="fill-base stroke-dimmed"
|
|
274
269
|
/>
|
|
275
270
|
)}
|
|
276
271
|
</div>
|
|
@@ -31,10 +31,12 @@ export const DropdownTool = ({
|
|
|
31
31
|
children,
|
|
32
32
|
className,
|
|
33
33
|
groupHover,
|
|
34
|
+
icon,
|
|
34
35
|
...props
|
|
35
36
|
}: ChildProp &
|
|
36
37
|
CssProp &
|
|
37
38
|
Omit<DropdownProps, "children"> & {
|
|
39
|
+
icon?: string;
|
|
38
40
|
/**
|
|
39
41
|
* hide until group hovered
|
|
40
42
|
*/
|
|
@@ -43,12 +45,12 @@ export const DropdownTool = ({
|
|
|
43
45
|
return (
|
|
44
46
|
<Dropdown {...props}>
|
|
45
47
|
<Icon
|
|
46
|
-
icon={CoreIcons.caretDown}
|
|
48
|
+
icon={icon ?? CoreIcons.caretDown}
|
|
47
49
|
className={classNames(
|
|
50
|
+
"outline bg-tint-50/50 flex-content pointer-events-auto cursor-pointer",
|
|
48
51
|
className,
|
|
49
|
-
"outline bg-base flex-content pointer-events-auto cursor-pointer",
|
|
50
52
|
groupHover &&
|
|
51
|
-
"hidden group-hover:inline-block data-[dropdown-open]:inline-block",
|
|
53
|
+
"hidden group-hover/tool:inline-block data-[dropdown-open]:inline-block",
|
|
52
54
|
)}
|
|
53
55
|
/>
|
|
54
56
|
{children}
|