@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
|
@@ -8,10 +8,9 @@ import classNames from 'classnames';
|
|
|
8
8
|
import { useState, useRef, useImperativeHandle, useEffect, useMemo, Children } from 'react';
|
|
9
9
|
import { CoreIcons } from '../../types/icons.js';
|
|
10
10
|
import { Icon } from '../icon/Icon.js';
|
|
11
|
-
import classes from './Collapsable.module.css';
|
|
12
11
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
13
12
|
|
|
14
|
-
var _excluded = ["ref", "disabled", "className", "bodyClassName", "headerClassName", "children", "iconAlign", "iconClosed", "iconOpen", "open", "onClose", "onOpen"];
|
|
13
|
+
var _excluded = ["ref", "disabled", "className", "bodyClassName", "headerClassName", "children", "iconAlign", "stickyHeader", "iconClosed", "iconOpen", "open", "onClose", "onOpen"];
|
|
15
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
16
|
var Collapsable = function Collapsable(_ref) {
|
|
@@ -22,6 +21,7 @@ var Collapsable = function Collapsable(_ref) {
|
|
|
22
21
|
headerClassName = _ref.headerClassName,
|
|
23
22
|
children = _ref.children,
|
|
24
23
|
iconAlign = _ref.iconAlign,
|
|
24
|
+
stickyHeader = _ref.stickyHeader,
|
|
25
25
|
_ref$iconClosed = _ref.iconClosed,
|
|
26
26
|
iconClosed = _ref$iconClosed === void 0 ? CoreIcons.chevronRight : _ref$iconClosed,
|
|
27
27
|
_ref$iconOpen = _ref.iconOpen,
|
|
@@ -57,12 +57,12 @@ var Collapsable = function Collapsable(_ref) {
|
|
|
57
57
|
head = _useMemo2[0],
|
|
58
58
|
body = _useMemo2[1];
|
|
59
59
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
60
|
-
className: classNames(
|
|
60
|
+
className: classNames("fabric-collapsable", className)
|
|
61
61
|
}, aria), {}, {
|
|
62
62
|
children: [/*#__PURE__*/jsxs("div", {
|
|
63
63
|
role: "none",
|
|
64
64
|
ref: headRef,
|
|
65
|
-
className: classNames(
|
|
65
|
+
className: classNames("fabric-collapsableHead", "flex gap-1 flex-nowrap py-2 font-medium cursor-pointer items-center select-none hover:opacity-70", headerClassName, stickyHeader && "bg-base sticky top-0 px-2 py-1 z-10", iconAlign === "end" ? "flex-row-reverse" : "flex-row"),
|
|
66
66
|
onClick: function onClick() {
|
|
67
67
|
return !disabled && setOpenState(!openState);
|
|
68
68
|
},
|
|
@@ -76,7 +76,7 @@ var Collapsable = function Collapsable(_ref) {
|
|
|
76
76
|
})]
|
|
77
77
|
}), openState && /*#__PURE__*/jsx("div", {
|
|
78
78
|
ref: bodyRef,
|
|
79
|
-
className: classNames(
|
|
79
|
+
className: classNames("fabric-collapsableBody", bodyClassName),
|
|
80
80
|
children: body
|
|
81
81
|
})]
|
|
82
82
|
}));
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { useCallback } from 'react';
|
|
5
|
-
import { getBorderClass, getBgClass, getColorClass } from '../../utils/getColor.js';
|
|
6
|
-
import '@react-fabric/utilities';
|
|
7
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
import { getColor } from '../../utils/getColor.js';
|
|
7
|
+
import '@react-fabric/utilities';
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
* React Fabric
|
|
@@ -31,10 +31,12 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
31
31
|
|
|
32
32
|
var Divider = function Divider(_ref) {
|
|
33
33
|
var children = _ref.children,
|
|
34
|
-
color = _ref.color,
|
|
34
|
+
_ref$color = _ref.color,
|
|
35
|
+
color = _ref$color === void 0 ? "tint-300" : _ref$color,
|
|
35
36
|
vertical = _ref.vertical,
|
|
36
|
-
|
|
37
|
-
_ref
|
|
37
|
+
labelClassName = _ref.labelClassName;
|
|
38
|
+
_ref.fill;
|
|
39
|
+
var _ref$align = _ref.align,
|
|
38
40
|
align = _ref$align === void 0 ? "start" : _ref$align,
|
|
39
41
|
className = _ref.className;
|
|
40
42
|
var Rule = useCallback(function (_ref2) {
|
|
@@ -42,9 +44,10 @@ var Divider = function Divider(_ref) {
|
|
|
42
44
|
className = _ref2.className;
|
|
43
45
|
return /*#__PURE__*/jsx("hr", {
|
|
44
46
|
style: {
|
|
45
|
-
flex: flex
|
|
47
|
+
flex: flex,
|
|
48
|
+
borderColor: getColor(color)
|
|
46
49
|
},
|
|
47
|
-
className: classNames(className, vertical && "vertical", !flex && "self-stretch", vertical ? "
|
|
50
|
+
className: classNames(className, vertical && "vertical", !flex && "self-stretch", vertical ? "fabric-divider--vertical" : "fabric-divider--horizontal")
|
|
48
51
|
});
|
|
49
52
|
}, [color, vertical]);
|
|
50
53
|
return children ? /*#__PURE__*/jsxs("div", {
|
|
@@ -52,7 +55,7 @@ var Divider = function Divider(_ref) {
|
|
|
52
55
|
children: [/*#__PURE__*/jsx(Rule, {
|
|
53
56
|
flex: align === "start" ? "0 0 1rem" : "1 1 1em"
|
|
54
57
|
}), /*#__PURE__*/jsx("div", {
|
|
55
|
-
className: classNames("px-2 whitespace-nowrap", vertical ? "
|
|
58
|
+
className: classNames("px-2 whitespace-nowrap", vertical ? "fabric-divider--vertical" : "fabric-divider--horizontal", labelClassName, "rounded-full text-[0.75em]", vertical && "origin-center -rotate-90 z-1"),
|
|
56
59
|
children: children
|
|
57
60
|
}), /*#__PURE__*/jsx(Rule, {
|
|
58
61
|
flex: align === "end" ? "0 0 1rem" : "1 1 1em"
|
|
@@ -6,7 +6,6 @@ import { FloatingTree, useFloatingTree, useFloating, autoUpdate, shift, flip, of
|
|
|
6
6
|
import { mergeRefs } from '@react-fabric/utilities';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { useRef, useState, useMemo, Children, useCallback, useEffect, Fragment, cloneElement } from 'react';
|
|
9
|
-
import classes from './Dropdown.module.css';
|
|
10
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
10
|
|
|
12
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -115,6 +114,7 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
115
114
|
e.stopPropagation();
|
|
116
115
|
}
|
|
117
116
|
})), {}, {
|
|
117
|
+
"data-inner-clickable": "true",
|
|
118
118
|
"data-dropdown-open": isOpen ? true : undefined,
|
|
119
119
|
ref: innerRef
|
|
120
120
|
})), isOpen && /*#__PURE__*/jsxs(FloatingPortal, {
|
|
@@ -131,7 +131,8 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
131
131
|
style: _objectSpread({
|
|
132
132
|
minWidth: minWidth,
|
|
133
133
|
zIndex: "var(--z-popover)"
|
|
134
|
-
}, floatingStyles)
|
|
134
|
+
}, floatingStyles),
|
|
135
|
+
"data-ref": "dropdownBody"
|
|
135
136
|
}, getFloatingProps({
|
|
136
137
|
onClick: function onClick(e) {
|
|
137
138
|
return e.stopPropagation();
|
|
@@ -139,14 +140,14 @@ var DropdownElement = function DropdownElement(_ref) {
|
|
|
139
140
|
})), {}, {
|
|
140
141
|
children: [/*#__PURE__*/jsx("div", {
|
|
141
142
|
role: "none",
|
|
142
|
-
className: classNames(
|
|
143
|
+
className: classNames("fabric-dropdownBody", dropdownClassName, !plainDropdown && "shadow-lg bg-base ring-1 ring-tint-100", "rounded-capped overflow-auto scroll-thin grid max-h-[70vh]"),
|
|
143
144
|
onMouseUpCapture: tryClosing,
|
|
144
145
|
children: panel
|
|
145
146
|
}), showArrow && /*#__PURE__*/jsx(FloatingArrow, {
|
|
146
147
|
ref: arrowRef,
|
|
147
148
|
context: context,
|
|
148
149
|
strokeWidth: 0.5,
|
|
149
|
-
className: "fill-base stroke-
|
|
150
|
+
className: "fill-base stroke-dimmed"
|
|
150
151
|
})]
|
|
151
152
|
}))
|
|
152
153
|
})]
|
|
@@ -8,18 +8,19 @@ import { Icon } from '../icon/Icon.js';
|
|
|
8
8
|
import { Dropdown } from './Dropdown.js';
|
|
9
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
|
-
var _excluded = ["children", "className", "groupHover"];
|
|
11
|
+
var _excluded = ["children", "className", "groupHover", "icon"];
|
|
12
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
var DropdownTool = function DropdownTool(_ref) {
|
|
15
15
|
var children = _ref.children,
|
|
16
16
|
className = _ref.className,
|
|
17
17
|
groupHover = _ref.groupHover,
|
|
18
|
+
icon = _ref.icon,
|
|
18
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
20
|
return /*#__PURE__*/jsxs(Dropdown, _objectSpread(_objectSpread({}, props), {}, {
|
|
20
21
|
children: [/*#__PURE__*/jsx(Icon, {
|
|
21
|
-
icon: CoreIcons.caretDown,
|
|
22
|
-
className: classNames(
|
|
22
|
+
icon: icon !== null && icon !== void 0 ? icon : CoreIcons.caretDown,
|
|
23
|
+
className: classNames("outline bg-tint-50/50 flex-content pointer-events-auto cursor-pointer", className, groupHover && "hidden group-hover/tool:inline-block data-[dropdown-open]:inline-block")
|
|
23
24
|
}), children]
|
|
24
25
|
}));
|
|
25
26
|
};
|
|
@@ -4,10 +4,9 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import { isSvgPath, isString } from '@react-fabric/utilities';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import {
|
|
8
|
-
import { getColor, getBgClass, getColorClass } from '../../utils/getColor.js';
|
|
9
|
-
import classes from './Icon.module.css';
|
|
7
|
+
import { useMemo } from 'react';
|
|
10
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
|
+
import { getColor } from '../../utils/getColor.js';
|
|
11
10
|
|
|
12
11
|
var _excluded = ["ref", "icon", "bg", "color", "size", "rtlFlip", "animate", "rounded", "viewBox", "className", "onClick"];
|
|
13
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -40,7 +39,7 @@ var Icon = function Icon(_ref) {
|
|
|
40
39
|
onClick = _ref.onClick,
|
|
41
40
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
42
41
|
/** ***************** style map *******************/
|
|
43
|
-
var styles =
|
|
42
|
+
var styles = useMemo(function () {
|
|
44
43
|
var s = {};
|
|
45
44
|
if (bg) {
|
|
46
45
|
s.backgroundColor = getColor(bg);
|
|
@@ -55,16 +54,15 @@ var Icon = function Icon(_ref) {
|
|
|
55
54
|
s.fontSize = SizeMap[size];
|
|
56
55
|
}
|
|
57
56
|
return s;
|
|
58
|
-
}, [bg, color, size]
|
|
57
|
+
}, [bg, color, size]);
|
|
59
58
|
|
|
60
59
|
/** ***************** check if icon is svg path *******************/
|
|
61
|
-
var isSvg =
|
|
60
|
+
var isSvg = useMemo(function () {
|
|
62
61
|
return isSvgPath(icon);
|
|
63
|
-
}, [icon]
|
|
62
|
+
}, [icon]);
|
|
64
63
|
|
|
65
64
|
/** ***************** render icon *******************/
|
|
66
|
-
var iconEl =
|
|
67
|
-
var _SvgTextSize$icon$len;
|
|
65
|
+
var iconEl = useMemo(function () {
|
|
68
66
|
if (!isString(icon)) {
|
|
69
67
|
throw Error("Invalid icon expected string");
|
|
70
68
|
}
|
|
@@ -83,22 +81,25 @@ var Icon = function Icon(_ref) {
|
|
|
83
81
|
dominantBaseline: "middle",
|
|
84
82
|
textAnchor: "middle",
|
|
85
83
|
style: {
|
|
86
|
-
fontSize:
|
|
84
|
+
fontSize: SvgTextSize[icon.length]
|
|
87
85
|
},
|
|
88
86
|
children: icon
|
|
89
87
|
})
|
|
90
88
|
}) : /*#__PURE__*/jsx("i", {
|
|
91
89
|
className: "".concat(icon)
|
|
92
90
|
});
|
|
93
|
-
}, [icon, isSvg, viewBox]
|
|
94
|
-
return /*#__PURE__*/jsx("dfn", _objectSpread(_objectSpread({
|
|
95
|
-
ref:
|
|
91
|
+
}, [icon, isSvg, viewBox]);
|
|
92
|
+
return /*#__PURE__*/jsx("dfn", _objectSpread(_objectSpread({
|
|
93
|
+
"data-ref": "icon",
|
|
94
|
+
ref: ref
|
|
95
|
+
}, rest), {}, {
|
|
96
96
|
role: "presentation",
|
|
97
|
-
className: classNames(
|
|
97
|
+
className: classNames("fabric-icon", "select-none overflow-hidden box-content leading-none not-italic text-center", !rounded && "rounded", rounded && "rounded-full", animate && "animate-".concat(animate), className),
|
|
98
98
|
onClick: onClick,
|
|
99
99
|
"data-flip": rtlFlip,
|
|
100
100
|
style: styles,
|
|
101
101
|
"data-clickable": !!onClick,
|
|
102
|
+
"data-inner-clickable": !!onClick,
|
|
102
103
|
children: iconEl
|
|
103
104
|
}));
|
|
104
105
|
};
|
|
@@ -5,16 +5,25 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
5
5
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
6
|
import { getImageColorset } from '@react-fabric/utilities';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
import { useState,
|
|
8
|
+
import { useState, useEffect, useRef, Fragment } from 'react';
|
|
9
9
|
import { CoreIcons } from '../../types/icons.js';
|
|
10
10
|
import { Button } from '../button/Button.js';
|
|
11
|
-
import
|
|
11
|
+
import { Icon } from '../icon/Icon.js';
|
|
12
12
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
13
|
|
|
14
14
|
var _excluded = ["src", "alt", "reel", "fit", "className"],
|
|
15
15
|
_excluded2 = ["src", "poster", "reel", "autoPlay", "playOnHover", "fit", "className"];
|
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
+
var cover = {
|
|
19
|
+
fill: "object-fill",
|
|
20
|
+
cover: "object-cover",
|
|
21
|
+
contain: "object-contain"
|
|
22
|
+
};
|
|
23
|
+
var loadIndicator = /*#__PURE__*/jsx("div", {
|
|
24
|
+
className: classNames("fabric-mediaPlaceholder", "absolute z-1 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-4xl text-gray animate-pulse"),
|
|
25
|
+
children: "\u25CF\u25CF\u25CF"
|
|
26
|
+
});
|
|
18
27
|
var Image = function Image(_ref) {
|
|
19
28
|
var src = _ref.src,
|
|
20
29
|
alt = _ref.alt,
|
|
@@ -27,28 +36,40 @@ var Image = function Image(_ref) {
|
|
|
27
36
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28
37
|
colorSet = _useState2[0],
|
|
29
38
|
setColorSet = _useState2[1];
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
var _useState3 = useState(false),
|
|
40
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
41
|
+
loaded = _useState4[0],
|
|
42
|
+
setLoaded = _useState4[1];
|
|
43
|
+
var _useState5 = useState(false),
|
|
44
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
45
|
+
errored = _useState6[0],
|
|
46
|
+
setErrored = _useState6[1];
|
|
47
|
+
useEffect(function () {
|
|
48
|
+
setLoaded(false);
|
|
49
|
+
setErrored(false);
|
|
35
50
|
}, [src]);
|
|
36
51
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
37
52
|
"data-ref": "image",
|
|
38
|
-
className: classNames(
|
|
53
|
+
className: classNames("fabric-mediaContainer", "relative overflow-hidden inline-block", reel && "fabric-mediaReel", className),
|
|
39
54
|
"data-colorset": colorSet
|
|
40
55
|
}, aria), {}, {
|
|
41
|
-
children: [loadIndicator, /*#__PURE__*/jsx("img", {
|
|
56
|
+
children: [!loaded && !errored && loadIndicator, !errored && /*#__PURE__*/jsx("img", {
|
|
42
57
|
alt: alt !== null && alt !== void 0 ? alt : src,
|
|
43
58
|
src: src,
|
|
44
59
|
loading: "lazy",
|
|
45
60
|
crossOrigin: "anonymous",
|
|
46
|
-
className: classNames(
|
|
61
|
+
className: classNames("fabric-media", "pointer-events-none w-full h-full", cover[fit]),
|
|
47
62
|
onLoad: function onLoad(e) {
|
|
48
|
-
|
|
49
|
-
(_e$currentTarget$prev = e.currentTarget.previousElementSibling) === null || _e$currentTarget$prev === void 0 || _e$currentTarget$prev.remove();
|
|
63
|
+
setLoaded(true);
|
|
50
64
|
setColorSet(getImageColorset(e.currentTarget));
|
|
65
|
+
},
|
|
66
|
+
onError: function onError() {
|
|
67
|
+
return setErrored(true);
|
|
51
68
|
}
|
|
69
|
+
}), errored && /*#__PURE__*/jsx(Icon, {
|
|
70
|
+
size: "2rem",
|
|
71
|
+
className: "absolute text-tint-300 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
72
|
+
icon: CoreIcons.mediaImageBroken
|
|
52
73
|
})]
|
|
53
74
|
}));
|
|
54
75
|
};
|
|
@@ -63,17 +84,32 @@ var Video = function Video(_ref2) {
|
|
|
63
84
|
className = _ref2.className,
|
|
64
85
|
aria = _objectWithoutProperties(_ref2, _excluded2);
|
|
65
86
|
var videoRef = useRef(null);
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
87
|
+
var _useState7 = useState(false),
|
|
88
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
89
|
+
loaded = _useState8[0],
|
|
90
|
+
setLoaded = _useState8[1];
|
|
91
|
+
var _useState9 = useState(false),
|
|
92
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
93
|
+
errored = _useState10[0],
|
|
94
|
+
setErrored = _useState10[1];
|
|
95
|
+
useEffect(function () {
|
|
96
|
+
setLoaded(false);
|
|
97
|
+
setErrored(false);
|
|
98
|
+
}, [src]);
|
|
99
|
+
var _useState11 = useState(true),
|
|
100
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
101
|
+
state = _useState12[0],
|
|
102
|
+
setState = _useState12[1];
|
|
103
|
+
var _useState13 = useState(false),
|
|
104
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
105
|
+
volume = _useState14[0],
|
|
106
|
+
setVolume = _useState14[1];
|
|
107
|
+
useEffect(function () {
|
|
108
|
+
setErrored(false);
|
|
109
|
+
}, [src]);
|
|
74
110
|
return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
75
111
|
"data-ref": "video",
|
|
76
|
-
className: classNames(
|
|
112
|
+
className: classNames("fabric-mediaContainer", "relative overflow-hidden inline-block", reel && "fabric-mediaReel", className),
|
|
77
113
|
onMouseEnter: function onMouseEnter() {
|
|
78
114
|
var _videoRef$current;
|
|
79
115
|
playOnHover && ((_videoRef$current = videoRef.current) === null || _videoRef$current === void 0 ? void 0 : _videoRef$current.play());
|
|
@@ -83,64 +119,69 @@ var Video = function Video(_ref2) {
|
|
|
83
119
|
playOnHover && ((_videoRef$current2 = videoRef.current) === null || _videoRef$current2 === void 0 ? void 0 : _videoRef$current2.pause());
|
|
84
120
|
}
|
|
85
121
|
}, aria), {}, {
|
|
86
|
-
children: [/*#__PURE__*/
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
var _e$currentTarget$prev2;
|
|
107
|
-
e.currentTarget.volume = 0;
|
|
108
|
-
(_e$currentTarget$prev2 = e.currentTarget.previousElementSibling) === null || _e$currentTarget$prev2 === void 0 || _e$currentTarget$prev2.remove();
|
|
109
|
-
},
|
|
110
|
-
children: [/*#__PURE__*/jsx("source", {
|
|
111
|
-
src: src
|
|
112
|
-
}), /*#__PURE__*/jsx("track", {
|
|
113
|
-
kind: "captions"
|
|
114
|
-
})]
|
|
115
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
116
|
-
"data-inner-clickable": true,
|
|
117
|
-
className: classNames(classes.mediaControls, "absolute bottom-6 end-6 rounded-full flex flex-col"),
|
|
118
|
-
children: [/*#__PURE__*/jsx(Button, {
|
|
119
|
-
rounded: true,
|
|
120
|
-
variant: "link",
|
|
121
|
-
className: classes.mediaControlPlaceholder,
|
|
122
|
-
icon: CoreIcons.ellipsis,
|
|
123
|
-
"aria-label": "controls"
|
|
124
|
-
}), /*#__PURE__*/jsx(Button, {
|
|
125
|
-
rounded: true,
|
|
126
|
-
variant: "link",
|
|
127
|
-
"aria-label": "controls",
|
|
128
|
-
className: classes.mediaControlAction,
|
|
129
|
-
onClick: function onClick() {
|
|
130
|
-
videoRef.current && (videoRef.current.volume = videoRef.current.volume ? 0 : 1);
|
|
122
|
+
children: [!loaded && !errored && loadIndicator, !errored && /*#__PURE__*/jsxs(Fragment, {
|
|
123
|
+
children: [/*#__PURE__*/jsxs("video", {
|
|
124
|
+
loop: true,
|
|
125
|
+
ref: videoRef,
|
|
126
|
+
controls: false,
|
|
127
|
+
poster: poster,
|
|
128
|
+
autoPlay: autoPlay,
|
|
129
|
+
className: classNames("fabric-media", "pointer-events-none w-full h-full", fit && "object-".concat(fit)),
|
|
130
|
+
onPlay: function onPlay() {
|
|
131
|
+
return setState(true);
|
|
132
|
+
},
|
|
133
|
+
onPause: function onPause() {
|
|
134
|
+
return setState(false);
|
|
135
|
+
},
|
|
136
|
+
onVolumeChange: function onVolumeChange(e) {
|
|
137
|
+
return setVolume(!!e.currentTarget.volume);
|
|
138
|
+
},
|
|
139
|
+
onLoadedData: function onLoadedData(e) {
|
|
140
|
+
e.currentTarget.volume = 0;
|
|
141
|
+
setLoaded(true);
|
|
131
142
|
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
rounded: true,
|
|
135
|
-
variant: "link",
|
|
136
|
-
"aria-label": "controls",
|
|
137
|
-
className: classes.mediaControlAction,
|
|
138
|
-
onClick: function onClick() {
|
|
139
|
-
var _videoRef$current3, _videoRef$current4, _videoRef$current5;
|
|
140
|
-
(_videoRef$current3 = videoRef.current) !== null && _videoRef$current3 !== void 0 && _videoRef$current3.paused ? (_videoRef$current4 = videoRef.current) === null || _videoRef$current4 === void 0 ? void 0 : _videoRef$current4.play() : (_videoRef$current5 = videoRef.current) === null || _videoRef$current5 === void 0 ? void 0 : _videoRef$current5.pause();
|
|
143
|
+
onError: function onError() {
|
|
144
|
+
return setErrored(true);
|
|
141
145
|
},
|
|
142
|
-
|
|
146
|
+
children: [/*#__PURE__*/jsx("source", {
|
|
147
|
+
src: src
|
|
148
|
+
}), /*#__PURE__*/jsx("track", {
|
|
149
|
+
kind: "captions"
|
|
150
|
+
})]
|
|
151
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
152
|
+
"data-inner-clickable": true,
|
|
153
|
+
className: classNames("fabric-mediaControls", "absolute bottom-6 end-6 rounded-full flex flex-col"),
|
|
154
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
155
|
+
rounded: true,
|
|
156
|
+
variant: "link",
|
|
157
|
+
className: "fabric-mediaControlPlaceholder",
|
|
158
|
+
icon: CoreIcons.ellipsis,
|
|
159
|
+
"aria-label": "controls"
|
|
160
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
161
|
+
rounded: true,
|
|
162
|
+
variant: "link",
|
|
163
|
+
"aria-label": "controls",
|
|
164
|
+
className: "fabric-mediaControlAction",
|
|
165
|
+
onClick: function onClick() {
|
|
166
|
+
videoRef.current && (videoRef.current.volume = videoRef.current.volume ? 0 : 1);
|
|
167
|
+
},
|
|
168
|
+
icon: volume ? CoreIcons.volumeOn : CoreIcons.volumeOff
|
|
169
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
170
|
+
rounded: true,
|
|
171
|
+
variant: "link",
|
|
172
|
+
"aria-label": "controls",
|
|
173
|
+
className: "fabric-mediaControlAction",
|
|
174
|
+
onClick: function onClick() {
|
|
175
|
+
var _videoRef$current3, _videoRef$current4, _videoRef$current5;
|
|
176
|
+
(_videoRef$current3 = videoRef.current) !== null && _videoRef$current3 !== void 0 && _videoRef$current3.paused ? (_videoRef$current4 = videoRef.current) === null || _videoRef$current4 === void 0 ? void 0 : _videoRef$current4.play() : (_videoRef$current5 = videoRef.current) === null || _videoRef$current5 === void 0 ? void 0 : _videoRef$current5.pause();
|
|
177
|
+
},
|
|
178
|
+
icon: state ? CoreIcons.pause : CoreIcons.play
|
|
179
|
+
})]
|
|
143
180
|
})]
|
|
181
|
+
}), errored && /*#__PURE__*/jsx(Icon, {
|
|
182
|
+
size: "2rem",
|
|
183
|
+
className: "absolute text-tint-300 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
184
|
+
icon: CoreIcons.mediaVideoBroken
|
|
144
185
|
})]
|
|
145
186
|
}));
|
|
146
187
|
};
|
|
@@ -2,22 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
|
-
import { useFloating, autoUpdate, offset, flip, useClick, useDismiss, useInteractions, FloatingPortal } from '@floating-ui/react';
|
|
6
|
-
import { useState, useRef, cloneElement } from 'react';
|
|
5
|
+
import { useFloatingNodeId, useFloating, autoUpdate, offset, flip, useClick, useDismiss, useInteractions, FloatingPortal } from '@floating-ui/react';
|
|
6
|
+
import { useState, useRef, useEffect, cloneElement } from 'react';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
10
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
11
|
var ContextMenu = function ContextMenu(_ref) {
|
|
12
|
+
var _refs$domReference$cu, _refs$domReference$cu2;
|
|
12
13
|
var children = _ref.children,
|
|
13
|
-
menu = _ref.menu
|
|
14
|
+
menu = _ref.menu,
|
|
15
|
+
disabled = _ref.disabled;
|
|
14
16
|
var _useState = useState(false),
|
|
15
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
16
18
|
isOpen = _useState2[0],
|
|
17
19
|
setIsOpen = _useState2[1];
|
|
20
|
+
var nodeId = useFloatingNodeId();
|
|
18
21
|
var _useFloating = useFloating({
|
|
19
22
|
open: isOpen,
|
|
20
|
-
|
|
23
|
+
nodeId: nodeId,
|
|
24
|
+
onOpenChange: function onOpenChange(open, evt, reason) {
|
|
25
|
+
var target = evt === null || evt === void 0 ? void 0 : evt.target;
|
|
26
|
+
if (!(target !== null && target !== void 0 && target.closest(".menu-list"))) setIsOpen(open);
|
|
27
|
+
},
|
|
21
28
|
strategy: "fixed",
|
|
22
29
|
placement: "bottom-start",
|
|
23
30
|
whileElementsMounted: autoUpdate,
|
|
@@ -26,8 +33,13 @@ var ContextMenu = function ContextMenu(_ref) {
|
|
|
26
33
|
refs = _useFloating.refs,
|
|
27
34
|
floatingStyles = _useFloating.floatingStyles,
|
|
28
35
|
context = _useFloating.context;
|
|
29
|
-
var click = useClick(context, {
|
|
30
|
-
|
|
36
|
+
var click = useClick(context, {
|
|
37
|
+
toggle: true,
|
|
38
|
+
ignoreMouse: true
|
|
39
|
+
});
|
|
40
|
+
var dismiss = useDismiss(context, {
|
|
41
|
+
bubbles: true
|
|
42
|
+
});
|
|
31
43
|
var _useInteractions = useInteractions([dismiss, click]),
|
|
32
44
|
getFloatingProps = _useInteractions.getFloatingProps;
|
|
33
45
|
var handleClick = useRef(function (e) {
|
|
@@ -51,11 +63,18 @@ var ContextMenu = function ContextMenu(_ref) {
|
|
|
51
63
|
e.preventDefault();
|
|
52
64
|
return false;
|
|
53
65
|
});
|
|
54
|
-
var wrapperRef = useRef(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
66
|
+
var wrapperRef = useRef(null);
|
|
67
|
+
useEffect(function () {
|
|
68
|
+
var el = wrapperRef.current;
|
|
69
|
+
if (el && !disabled) {
|
|
70
|
+
var _el$parentElement;
|
|
71
|
+
el === null || el === void 0 || (_el$parentElement = el.parentElement) === null || _el$parentElement === void 0 || _el$parentElement.addEventListener("contextmenu", handleClick.current);
|
|
72
|
+
return function () {
|
|
73
|
+
var _el$parentElement2;
|
|
74
|
+
el === null || el === void 0 || (_el$parentElement2 = el.parentElement) === null || _el$parentElement2 === void 0 || _el$parentElement2.removeEventListener("contextmenu", handleClick.current);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}, [disabled]);
|
|
59
78
|
var tryClosing = useRef(function (e) {
|
|
60
79
|
var _e$target;
|
|
61
80
|
if ((_e$target = e.target) !== null && _e$target !== void 0 && _e$target.closest("[data-dropdown-dismiss='true']")) setTimeout(function () {
|
|
@@ -64,9 +83,10 @@ var ContextMenu = function ContextMenu(_ref) {
|
|
|
64
83
|
});
|
|
65
84
|
return /*#__PURE__*/jsxs("div", {
|
|
66
85
|
className: "contents",
|
|
67
|
-
ref: wrapperRef
|
|
86
|
+
ref: wrapperRef,
|
|
68
87
|
onMouseUpCapture: tryClosing.current,
|
|
69
88
|
children: [children, isOpen && /*#__PURE__*/jsx(FloatingPortal, {
|
|
89
|
+
root: (_refs$domReference$cu = (_refs$domReference$cu2 = refs.domReference.current) === null || _refs$domReference$cu2 === void 0 ? void 0 : _refs$domReference$cu2.closest(".theme-base")) !== null && _refs$domReference$cu !== void 0 ? _refs$domReference$cu : undefined,
|
|
70
90
|
children: /*#__PURE__*/cloneElement(menu, _objectSpread(_objectSpread({}, getFloatingProps()), {}, {
|
|
71
91
|
style: _objectSpread(_objectSpread({}, floatingStyles), {}, {
|
|
72
92
|
borderRadius: "var(--rounding)",
|