@qoretechnologies/reqore 0.78.6-pr.715.g3e70b13 → 0.78.6-pr.715.g4e6c5cf
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/.claude/CLAUDE.md +14 -0
- package/dist/components/Accordion/index.d.ts.map +1 -1
- package/dist/components/Accordion/index.js +17 -12
- package/dist/components/Accordion/index.js.map +1 -1
- package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/index.js +293 -34
- package/dist/components/Breadcrumbs/index.js.map +1 -1
- package/dist/components/Breadcrumbs/item.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/item.js +6 -2
- package/dist/components/Breadcrumbs/item.js.map +1 -1
- package/dist/components/Bubble/index.d.ts.map +1 -1
- package/dist/components/Bubble/index.js +10 -41
- package/dist/components/Bubble/index.js.map +1 -1
- package/dist/components/Button/index.d.ts +8 -0
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +78 -14
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/ButtonRail/index.d.ts.map +1 -1
- package/dist/components/ButtonRail/index.js +3 -2
- package/dist/components/ButtonRail/index.js.map +1 -1
- package/dist/components/Callout/index.d.ts +4 -3
- package/dist/components/Callout/index.d.ts.map +1 -1
- package/dist/components/Callout/index.js +40 -8
- package/dist/components/Callout/index.js.map +1 -1
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +11 -10
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Collapse/index.d.ts.map +1 -1
- package/dist/components/Collapse/index.js +7 -36
- package/dist/components/Collapse/index.js.map +1 -1
- package/dist/components/CollapsibleContent/index.d.ts.map +1 -1
- package/dist/components/CollapsibleContent/index.js +6 -38
- package/dist/components/CollapsibleContent/index.js.map +1 -1
- package/dist/components/Collection/index.js +3 -3
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/Collection/item.d.ts.map +1 -1
- package/dist/components/Collection/item.js +3 -3
- package/dist/components/Collection/item.js.map +1 -1
- package/dist/components/Columns/column.d.ts.map +1 -1
- package/dist/components/Columns/column.js +6 -35
- package/dist/components/Columns/column.js.map +1 -1
- package/dist/components/Columns/index.d.ts.map +1 -1
- package/dist/components/Columns/index.js +3 -35
- package/dist/components/Columns/index.js.map +1 -1
- package/dist/components/Comment/index.js +8 -8
- package/dist/components/Comment/index.js.map +1 -1
- package/dist/components/CommentFeed/index.js +2 -2
- package/dist/components/CommentFeed/index.js.map +1 -1
- package/dist/components/Content/index.d.ts.map +1 -1
- package/dist/components/Content/index.js +3 -35
- package/dist/components/Content/index.js.map +1 -1
- package/dist/components/Content/wrapper.js +2 -2
- package/dist/components/Content/wrapper.js.map +1 -1
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +8 -4
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/ControlGroup/item.d.ts.map +1 -1
- package/dist/components/ControlGroup/item.js +35 -6
- package/dist/components/ControlGroup/item.js.map +1 -1
- package/dist/components/DataView/index.d.ts +6 -0
- package/dist/components/DataView/index.d.ts.map +1 -1
- package/dist/components/DataView/index.js +39 -66
- package/dist/components/DataView/index.js.map +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +40 -8
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DescriptionList/index.d.ts.map +1 -1
- package/dist/components/DescriptionList/index.js +12 -40
- package/dist/components/DescriptionList/index.js.map +1 -1
- package/dist/components/Drawer/backdrop.d.ts.map +1 -1
- package/dist/components/Drawer/backdrop.js +35 -6
- package/dist/components/Drawer/backdrop.js.map +1 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +39 -44
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Dropdown/index.d.ts.map +1 -1
- package/dist/components/Dropdown/index.js +3 -1
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Dropdown/list.js +71 -5
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js +12 -6
- package/dist/components/Effect/index.js.map +1 -1
- package/dist/components/EntityRow/index.d.ts +18 -1
- package/dist/components/EntityRow/index.d.ts.map +1 -1
- package/dist/components/EntityRow/index.js +57 -13
- package/dist/components/EntityRow/index.js.map +1 -1
- package/dist/components/FadeScroller/index.d.ts.map +1 -1
- package/dist/components/FadeScroller/index.js +12 -62
- package/dist/components/FadeScroller/index.js.map +1 -1
- package/dist/components/FeatureCard/index.d.ts +7 -1
- package/dist/components/FeatureCard/index.d.ts.map +1 -1
- package/dist/components/FeatureCard/index.js +33 -10
- package/dist/components/FeatureCard/index.js.map +1 -1
- package/dist/components/Header/index.js +2 -2
- package/dist/components/Header/index.js.map +1 -1
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +21 -6
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/IconPicker/index.js +2 -2
- package/dist/components/IconPicker/index.js.map +1 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +11 -10
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InputClearButton/index.d.ts.map +1 -1
- package/dist/components/InputClearButton/index.js +35 -3
- package/dist/components/InputClearButton/index.js.map +1 -1
- package/dist/components/InternalPopover/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.js +37 -9
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/KeyboardShortcut/index.d.ts.map +1 -1
- package/dist/components/KeyboardShortcut/index.js +6 -5
- package/dist/components/KeyboardShortcut/index.js.map +1 -1
- package/dist/components/Layout/content.js +2 -2
- package/dist/components/Layout/content.js.map +1 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +8 -36
- package/dist/components/Layout/index.js.map +1 -1
- package/dist/components/Link/index.d.ts.map +1 -1
- package/dist/components/Link/index.js +13 -40
- package/dist/components/Link/index.js.map +1 -1
- package/dist/components/Menu/divider.d.ts.map +1 -1
- package/dist/components/Menu/divider.js +7 -4
- package/dist/components/Menu/divider.js.map +1 -1
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +17 -11
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Menu/item.d.ts.map +1 -1
- package/dist/components/Menu/item.js +28 -0
- package/dist/components/Menu/item.js.map +1 -1
- package/dist/components/Menu/section.d.ts.map +1 -1
- package/dist/components/Menu/section.js +11 -6
- package/dist/components/Menu/section.js.map +1 -1
- package/dist/components/NavRail/index.d.ts.map +1 -1
- package/dist/components/NavRail/index.js +16 -6
- package/dist/components/NavRail/index.js.map +1 -1
- package/dist/components/Navbar/divider.d.ts.map +1 -1
- package/dist/components/Navbar/divider.js +35 -6
- package/dist/components/Navbar/divider.js.map +1 -1
- package/dist/components/Navbar/group.js +3 -3
- package/dist/components/Navbar/group.js.map +1 -1
- package/dist/components/Navbar/index.js +3 -3
- package/dist/components/Navbar/index.js.map +1 -1
- package/dist/components/Navbar/item.js +3 -3
- package/dist/components/Navbar/item.js.map +1 -1
- package/dist/components/Notifications/index.d.ts.map +1 -1
- package/dist/components/Notifications/index.js +6 -35
- package/dist/components/Notifications/index.js.map +1 -1
- package/dist/components/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +23 -47
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Notifications/styles.d.ts.map +1 -1
- package/dist/components/Notifications/styles.js +11 -10
- package/dist/components/Notifications/styles.js.map +1 -1
- package/dist/components/Paging/index.d.ts.map +1 -1
- package/dist/components/Paging/index.js +19 -19
- package/dist/components/Paging/index.js.map +1 -1
- package/dist/components/Panel/index.d.ts +12 -0
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +321 -44
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Paragraph/index.d.ts +6 -0
- package/dist/components/Paragraph/index.d.ts.map +1 -1
- package/dist/components/Paragraph/index.js +60 -11
- package/dist/components/Paragraph/index.js.map +1 -1
- package/dist/components/Popover/index.d.ts +8 -0
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +166 -18
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/Progress/index.d.ts.map +1 -1
- package/dist/components/Progress/index.js +13 -44
- package/dist/components/Progress/index.js.map +1 -1
- package/dist/components/Rating/index.d.ts.map +1 -1
- package/dist/components/Rating/index.js +13 -39
- package/dist/components/Rating/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +42 -7
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/RowActionsMenu/index.d.ts +69 -0
- package/dist/components/RowActionsMenu/index.d.ts.map +1 -0
- package/dist/components/RowActionsMenu/index.js +170 -0
- package/dist/components/RowActionsMenu/index.js.map +1 -0
- package/dist/components/SegmentedControl/index.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index.js +17 -46
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/Select/valuePreview.js +6 -3
- package/dist/components/Select/valuePreview.js.map +1 -1
- package/dist/components/SeverityRow/index.d.ts +19 -1
- package/dist/components/SeverityRow/index.d.ts.map +1 -1
- package/dist/components/SeverityRow/index.js +59 -15
- package/dist/components/SeverityRow/index.js.map +1 -1
- package/dist/components/Skeleton/index.d.ts.map +1 -1
- package/dist/components/Skeleton/index.js +6 -35
- package/dist/components/Skeleton/index.js.map +1 -1
- package/dist/components/Slider/index.js +9 -9
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Spacer/index.js +7 -7
- package/dist/components/Spacer/index.js.map +1 -1
- package/dist/components/Span/index.d.ts.map +1 -1
- package/dist/components/Span/index.js +38 -9
- package/dist/components/Span/index.js.map +1 -1
- package/dist/components/StackedBar/index.d.ts.map +1 -1
- package/dist/components/StackedBar/index.js +16 -39
- package/dist/components/StackedBar/index.js.map +1 -1
- package/dist/components/Statistic/index.d.ts +8 -1
- package/dist/components/Statistic/index.d.ts.map +1 -1
- package/dist/components/Statistic/index.js +12 -40
- package/dist/components/Statistic/index.js.map +1 -1
- package/dist/components/Table/body.d.ts.map +1 -1
- package/dist/components/Table/body.js +41 -41
- package/dist/components/Table/body.js.map +1 -1
- package/dist/components/Table/cell.d.ts.map +1 -1
- package/dist/components/Table/cell.js +32 -24
- package/dist/components/Table/cell.js.map +1 -1
- package/dist/components/Table/header.d.ts.map +1 -1
- package/dist/components/Table/header.js +13 -10
- package/dist/components/Table/header.js.map +1 -1
- package/dist/components/Table/headerCell.d.ts.map +1 -1
- package/dist/components/Table/headerCell.js +26 -52
- package/dist/components/Table/headerCell.js.map +1 -1
- package/dist/components/Table/helpers.d.ts +37 -0
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +72 -1
- package/dist/components/Table/helpers.js.map +1 -1
- package/dist/components/Table/index.d.ts +57 -2
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +154 -59
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/row.d.ts +3 -1
- package/dist/components/Table/row.d.ts.map +1 -1
- package/dist/components/Table/row.js +45 -14
- package/dist/components/Table/row.js.map +1 -1
- package/dist/components/Table/scrollbar.js +3 -3
- package/dist/components/Table/scrollbar.js.map +1 -1
- package/dist/components/Tabs/content.js +2 -2
- package/dist/components/Tabs/content.js.map +1 -1
- package/dist/components/Tabs/index.js +3 -3
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/item.d.ts.map +1 -1
- package/dist/components/Tabs/item.js +7 -5
- package/dist/components/Tabs/item.js.map +1 -1
- package/dist/components/Tabs/list.d.ts +4 -2
- package/dist/components/Tabs/list.d.ts.map +1 -1
- package/dist/components/Tabs/list.js +31 -19
- package/dist/components/Tabs/list.js.map +1 -1
- package/dist/components/Tag/group.d.ts.map +1 -1
- package/dist/components/Tag/group.js +3 -35
- package/dist/components/Tag/group.js.map +1 -1
- package/dist/components/Tag/index.d.ts +7 -0
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +91 -24
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Testimonial/index.d.ts +6 -1
- package/dist/components/Testimonial/index.d.ts.map +1 -1
- package/dist/components/Testimonial/index.js +29 -7
- package/dist/components/Testimonial/index.js.map +1 -1
- package/dist/components/Textarea/index.d.ts +10 -0
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +164 -18
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/components/Tier/group.d.ts.map +1 -1
- package/dist/components/Tier/group.js +9 -8
- package/dist/components/Tier/group.js.map +1 -1
- package/dist/components/Tier/index.d.ts +5 -0
- package/dist/components/Tier/index.d.ts.map +1 -1
- package/dist/components/Tier/index.js +15 -11
- package/dist/components/Tier/index.js.map +1 -1
- package/dist/components/Timeline/index.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +21 -18
- package/dist/components/Timeline/index.js.map +1 -1
- package/dist/components/TooltipComponent/index.d.ts.map +1 -1
- package/dist/components/TooltipComponent/index.js +6 -7
- package/dist/components/TooltipComponent/index.js.map +1 -1
- package/dist/components/Tree/index.js +3 -3
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/components/Tree/modal.d.ts.map +1 -1
- package/dist/components/Tree/modal.js +3 -1
- package/dist/components/Tree/modal.js.map +1 -1
- package/dist/constants/sizes.d.ts +5 -0
- package/dist/constants/sizes.d.ts.map +1 -1
- package/dist/constants/sizes.js +6 -1
- package/dist/constants/sizes.js.map +1 -1
- package/dist/constants/theme.d.ts +44 -0
- package/dist/constants/theme.d.ts.map +1 -1
- package/dist/constants/theme.js.map +1 -1
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/ReqoreProvider.js +27 -13
- package/dist/containers/ReqoreProvider.js.map +1 -1
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +8 -36
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/helpers/hoveringPointer.d.ts +54 -0
- package/dist/helpers/hoveringPointer.d.ts.map +1 -0
- package/dist/helpers/hoveringPointer.js +66 -0
- package/dist/helpers/hoveringPointer.js.map +1 -0
- package/dist/helpers/styled.d.ts +39 -26
- package/dist/helpers/styled.d.ts.map +1 -1
- package/dist/helpers/styled.js +156 -4
- package/dist/helpers/styled.js.map +1 -1
- package/dist/helpers/typeScale.d.ts +25 -0
- package/dist/helpers/typeScale.d.ts.map +1 -0
- package/dist/helpers/typeScale.js +28 -0
- package/dist/helpers/typeScale.js.map +1 -0
- package/dist/hooks/useCloneThroughFragments.d.ts.map +1 -1
- package/dist/hooks/useCloneThroughFragments.js +51 -18
- package/dist/hooks/useCloneThroughFragments.js.map +1 -1
- package/dist/hooks/useDragToScroll.d.ts +58 -0
- package/dist/hooks/useDragToScroll.d.ts.map +1 -0
- package/dist/hooks/useDragToScroll.js +262 -0
- package/dist/hooks/useDragToScroll.js.map +1 -0
- package/dist/hooks/useMarqueeOnHover.d.ts.map +1 -1
- package/dist/hooks/useMarqueeOnHover.js +10 -0
- package/dist/hooks/useMarqueeOnHover.js.map +1 -1
- package/dist/hooks/usePaging.d.ts +9 -4
- package/dist/hooks/usePaging.d.ts.map +1 -1
- package/dist/hooks/usePaging.js +21 -32
- package/dist/hooks/usePaging.js.map +1 -1
- package/dist/hooks/usePointerDrag.d.ts.map +1 -1
- package/dist/hooks/usePointerDrag.js +13 -3
- package/dist/hooks/usePointerDrag.js.map +1 -1
- package/dist/hooks/useReqoreMedia.d.ts +22 -7
- package/dist/hooks/useReqoreMedia.d.ts.map +1 -1
- package/dist/hooks/useReqoreMedia.js +33 -9
- package/dist/hooks/useReqoreMedia.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/styles.js +6 -6
- package/dist/styles.js.map +1 -1
- package/docs/docs/guides/theming.mdx +15 -0
- package/package.json +2 -4
- package/vitest.config.ts +105 -31
|
@@ -58,11 +58,20 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
58
58
|
}
|
|
59
59
|
return t;
|
|
60
60
|
};
|
|
61
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
62
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
63
|
+
if (ar || !(i in from)) {
|
|
64
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
65
|
+
ar[i] = from[i];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
69
|
+
};
|
|
61
70
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
71
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
72
|
};
|
|
64
73
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
exports.ReqorePanel = exports.ReqorePanelSkeleton = exports.StyledFloatingActions = exports.StyledPanelMedia = exports.StyledPanelContent = exports.StyledPanelBottomActions = exports.StyledPanelTopBar = exports.StyledPanelTitle = exports.StyledPanel = exports.StyledPanelTitleHeaderLabelAndBadge = exports.StyledPanelTitleHeaderLabelAndDescription = exports.StyledPanelTitleHeaderContent = exports.StyledPanelTitleHeader = void 0;
|
|
74
|
+
exports.ReqorePanel = exports.ReqorePanelSkeleton = exports.StyledFloatingActions = exports.StyledPanelMedia = exports.StyledPanelContent = exports.StyledPanelBottomActions = exports.StyledPanelTopBar = exports.StyledPanelTitle = exports.StyledPanel = exports.REQORE_PANEL_STYLE_PROPS = exports.StyledPanelTitleHeaderLabelAndBadge = exports.StyledPanelTitleHeaderLabelAndDescription = exports.StyledPanelTitleHeaderContent = exports.StyledPanelTitleHeader = void 0;
|
|
66
75
|
var react_1 = require("react");
|
|
67
76
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
68
77
|
var classnames_1 = __importDefault(require("classnames"));
|
|
@@ -73,12 +82,14 @@ var react_2 = require("react");
|
|
|
73
82
|
var react_dom_1 = require("react-dom");
|
|
74
83
|
var react_use_1 = require("react-use");
|
|
75
84
|
var responsive_1 = require("./responsive");
|
|
76
|
-
var styled_components_1 =
|
|
85
|
+
var styled_components_1 = require("styled-components");
|
|
77
86
|
var colors_1 = require("../../constants/colors");
|
|
78
87
|
var sizes_1 = require("../../constants/sizes");
|
|
88
|
+
var typeScale_1 = require("../../helpers/typeScale");
|
|
79
89
|
var colors_2 = require("../../helpers/colors");
|
|
80
|
-
var styled_1 = require("../../helpers/styled");
|
|
90
|
+
var styled_1 = __importStar(require("../../helpers/styled"));
|
|
81
91
|
var utils_1 = require("../../helpers/utils");
|
|
92
|
+
var hoveringPointer_1 = require("../../helpers/hoveringPointer");
|
|
82
93
|
var useCombinedRefs_1 = require("../../hooks/useCombinedRefs");
|
|
83
94
|
var useReqoreContext_1 = require("../../hooks/useReqoreContext");
|
|
84
95
|
var useFitTextSize_1 = require("../../hooks/useFitTextSize");
|
|
@@ -145,12 +156,44 @@ var getScrollportInset = function (el) {
|
|
|
145
156
|
* opening a line box around the inline-flex heading — a block wrapper adds the row's leading on
|
|
146
157
|
* top of the heading's own box, which made a `tiny` panel 3px taller than it used to be.
|
|
147
158
|
*/
|
|
148
|
-
var StyledPanelTitleLabelBox =
|
|
159
|
+
var StyledPanelTitleLabelBox = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n min-width: 0;\n overflow: hidden;\n flex: 0 1 auto;\n\n ", "\n"], ["\n display: flex;\n min-width: 0;\n overflow: hidden;\n flex: 0 1 auto;\n\n ", "\n"])), function (_a) {
|
|
149
160
|
var $clampLines = _a.$clampLines;
|
|
150
161
|
return $clampLines > 1 && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .reqore-heading {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ", ";\n overflow: hidden;\n white-space: normal;\n /* A single word longer than the box would push past it rather than break, and the\n clamp would have nothing to ellipsize. */\n overflow-wrap: anywhere;\n max-width: 100%;\n\n /* The heading wraps its text in a span of its own, and `-webkit-line-clamp` counts the\n box's CHILDREN rather than the lines inside them \u2014 so one block-level child reads as\n a single line and nothing is ever clamped, however far the text overruns. Putting the\n text back into the heading's own line boxes is what the clamp actually measures. */\n .reqore-span {\n display: inline;\n }\n }\n "], ["\n .reqore-heading {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ", ";\n overflow: hidden;\n white-space: normal;\n /* A single word longer than the box would push past it rather than break, and the\n clamp would have nothing to ellipsize. */\n overflow-wrap: anywhere;\n max-width: 100%;\n\n /* The heading wraps its text in a span of its own, and \\`-webkit-line-clamp\\` counts the\n box's CHILDREN rather than the lines inside them \u2014 so one block-level child reads as\n a single line and nothing is ever clamped, however far the text overruns. Putting the\n text back into the heading's own line boxes is what the clamp actually measures. */\n .reqore-span {\n display: inline;\n }\n }\n "])), $clampLines);
|
|
151
162
|
});
|
|
152
|
-
|
|
153
|
-
|
|
163
|
+
/**
|
|
164
|
+
* How much more than the title a group of actions that do not collapse takes of the room left over: so much
|
|
165
|
+
* that the title's box widens only once the group is at its own width (a flex item takes its grow factor's
|
|
166
|
+
* share of the free space, and the title's is 1).
|
|
167
|
+
*/
|
|
168
|
+
var ACTIONS_GROW_BEFORE_TITLE = 1000;
|
|
169
|
+
/**
|
|
170
|
+
* The flex of the group of actions that do not collapse, beside a title in a NARROW bar
|
|
171
|
+
* (qorus#646): sized from what the title leaves, between what its controls cannot do without and
|
|
172
|
+
* its own width. See where it is used. A wide bar leaves the group at its own width (`0 0 auto`),
|
|
173
|
+
* as it always was.
|
|
174
|
+
*/
|
|
175
|
+
var NARROW_ACTIONS_BESIDE_TITLE = {
|
|
176
|
+
flex: "".concat(ACTIONS_GROW_BEFORE_TITLE, " 1 0%"),
|
|
177
|
+
maxWidth: 'max-content',
|
|
178
|
+
};
|
|
179
|
+
/** The class of the bar's group of actions that do not collapse, which the title's fit measures. */
|
|
180
|
+
var NON_RESPONSIVE_ACTIONS_CLASS = 'reqore-panel-non-responsive-actions';
|
|
181
|
+
/**
|
|
182
|
+
* How much wider `element` is than the least it can be: its width less its min-content width, read
|
|
183
|
+
* with its flex and width set aside for the measurement and put back before anything is drawn.
|
|
184
|
+
*/
|
|
185
|
+
var getWidthAboveMinimum = function (element) {
|
|
186
|
+
var width = element.getBoundingClientRect().width;
|
|
187
|
+
var _a = element.style, flex = _a.flex, styleWidth = _a.width;
|
|
188
|
+
element.style.flex = '0 0 auto';
|
|
189
|
+
element.style.width = 'min-content';
|
|
190
|
+
var minimum = element.getBoundingClientRect().width;
|
|
191
|
+
element.style.flex = flex;
|
|
192
|
+
element.style.width = styleWidth;
|
|
193
|
+
return Math.max(0, width - minimum);
|
|
194
|
+
};
|
|
195
|
+
exports.StyledPanelTitleHeader = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\n display: flex;\n justify-content: flex-start;\n align-items: center;\n /* A CONTENT basis, and both extremes were tried before settling here. Basis 0 hands the action\n group beside this one its full content width, so nothing ever overflows and the fold into the\n menu never fires \u2014 actions labelled \"hidden when small\" stay visible on a small panel. A 100%\n width does the opposite: this header claims the entire row, so the group is always crushed to\n its floor and always folds however much room there is, which hid Tree's save button behind an\n overflow menu on a panel with space to spare. On a content basis the two shrink against each\n other in proportion to what they each need, which is the only version where folding means\n \"there is no room\" rather than \"there is a header\". */\n flex: 1 1 auto;\n overflow: hidden;\n"], ["\n\n display: flex;\n justify-content: flex-start;\n align-items: center;\n /* A CONTENT basis, and both extremes were tried before settling here. Basis 0 hands the action\n group beside this one its full content width, so nothing ever overflows and the fold into the\n menu never fires \u2014 actions labelled \"hidden when small\" stay visible on a small panel. A 100%\n width does the opposite: this header claims the entire row, so the group is always crushed to\n its floor and always folds however much room there is, which hid Tree's save button behind an\n overflow menu on a panel with space to spare. On a content basis the two shrink against each\n other in proportion to what they each need, which is the only version where folding means\n \"there is no room\" rather than \"there is a header\". */\n flex: 1 1 auto;\n overflow: hidden;\n"])));
|
|
196
|
+
exports.StyledPanelTitleHeaderContent = styled_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n // When the icon lives in the outer container (iconVerticalAlign mode),\n // we use a 2-column \u00D7 N-row CSS Grid where the LABEL ROW and DESCRIPTION\n // ROW are direct grid items \u2014 not wrapped inside a span-2 stack. That\n // makes each row's auto-sized height equal to the actual text row's\n // line-box height, so 'align-self: center' on the icon (in column 1)\n // visually centres the icon against the text row it shares a grid row\n // with \u2014 no font-metric guesswork.\n display: ", ";\n ", "\n flex: 0 1 auto;\n overflow: hidden;\n min-width: ", "px;\n"], ["\n // When the icon lives in the outer container (iconVerticalAlign mode),\n // we use a 2-column \u00D7 N-row CSS Grid where the LABEL ROW and DESCRIPTION\n // ROW are direct grid items \u2014 not wrapped inside a span-2 stack. That\n // makes each row's auto-sized height equal to the actual text row's\n // line-box height, so 'align-self: center' on the icon (in column 1)\n // visually centres the icon against the text row it shares a grid row\n // with \u2014 no font-metric guesswork.\n display: ", ";\n ", "\n flex: 0 1 auto;\n overflow: hidden;\n min-width: ", "px;\n"])), function (_a) {
|
|
154
197
|
var $hasOuterIcon = _a.$hasOuterIcon;
|
|
155
198
|
return ($hasOuterIcon ? 'grid' : 'flex');
|
|
156
199
|
}, function (_a) {
|
|
@@ -167,8 +210,8 @@ exports.StyledPanelTitleHeaderContent = styled_components_1.default.div(template
|
|
|
167
210
|
}
|
|
168
211
|
return width;
|
|
169
212
|
});
|
|
170
|
-
exports.StyledPanelTitleHeaderLabelAndDescription =
|
|
171
|
-
exports.StyledPanelTitleHeaderLabelAndBadge =
|
|
213
|
+
exports.StyledPanelTitleHeaderLabelAndDescription = styled_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: flex;\n flex-flow: column;\n gap: 3px;\n min-width: 0;\n flex: 1 auto;\n"], ["\n display: flex;\n flex-flow: column;\n gap: 3px;\n min-width: 0;\n flex: 1 auto;\n"])));
|
|
214
|
+
exports.StyledPanelTitleHeaderLabelAndBadge = styled_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n"], ["\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n"])));
|
|
172
215
|
/**
|
|
173
216
|
* Does the panel wrapper draw its 1px border?
|
|
174
217
|
*
|
|
@@ -216,16 +259,103 @@ var getPanelHoverBorderColor = function (theme, _a) {
|
|
|
216
259
|
? (0, colors_2.changeLightness)(themed.border, 0.12)
|
|
217
260
|
: (0, colors_2.changeLightness)(getPanelBorderBaseColor(theme, { intent: intent, accentPosition: accentPosition }), 0.25);
|
|
218
261
|
};
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Every panel prop that only styles or configures the panel. None of them reaches the rendered
|
|
264
|
+
* element — the `div`, re-resizable's `Resizable` (which spreads every prop it does not know onto
|
|
265
|
+
* its wrapper div), or a component given as `as`. The compiler checks the record against
|
|
266
|
+
* `IStyledPanel`, so a new prop that is not added here fails the build instead of leaking.
|
|
267
|
+
*
|
|
268
|
+
* re-resizable's own props (`size`, `enable`, `minWidth`, handles, ...) are not in it: they are
|
|
269
|
+
* the `Resizable`'s to receive. `opacity` is the surface's background opacity, an SVG attribute
|
|
270
|
+
* a `div` would keep.
|
|
271
|
+
*/
|
|
272
|
+
exports.REQORE_PANEL_STYLE_PROPS = (0, styled_1.listReqoreStyleProps)({
|
|
273
|
+
accentPosition: true,
|
|
274
|
+
actions: true,
|
|
275
|
+
badge: true,
|
|
276
|
+
blur: true,
|
|
277
|
+
bottomActions: true,
|
|
278
|
+
breadcrumbs: true,
|
|
279
|
+
closeButtonProps: true,
|
|
280
|
+
closePopover: true,
|
|
281
|
+
closeTooltip: true,
|
|
282
|
+
collapseButtonProps: true,
|
|
283
|
+
collapseTooltip: true,
|
|
284
|
+
collapsible: true,
|
|
285
|
+
compactTitle: true,
|
|
286
|
+
contentEffect: true,
|
|
287
|
+
contentSize: true,
|
|
288
|
+
contentStyle: true,
|
|
289
|
+
customLabelTooltip: true,
|
|
290
|
+
customTheme: true,
|
|
291
|
+
description: true,
|
|
292
|
+
descriptionEffect: true,
|
|
293
|
+
descriptionIntent: true,
|
|
294
|
+
descriptionMaxLines: true,
|
|
295
|
+
descriptionPosition: true,
|
|
296
|
+
disabled: true,
|
|
297
|
+
errorBoundaryOptions: true,
|
|
298
|
+
expandTooltip: true,
|
|
299
|
+
fill: true,
|
|
300
|
+
fitLabel: true,
|
|
301
|
+
flat: true,
|
|
302
|
+
floatingActions: true,
|
|
303
|
+
fluid: true,
|
|
304
|
+
getContentRef: true,
|
|
305
|
+
icon: true,
|
|
306
|
+
iconColor: true,
|
|
307
|
+
iconImage: true,
|
|
308
|
+
iconProps: true,
|
|
309
|
+
iconVerticalAlign: true,
|
|
310
|
+
iconWithLabel: true,
|
|
311
|
+
inheritCustomTheme: true,
|
|
312
|
+
intent: true,
|
|
313
|
+
isCollapsed: true,
|
|
314
|
+
isStuck: true,
|
|
315
|
+
label: true,
|
|
316
|
+
labelEffect: true,
|
|
317
|
+
labelMaxLines: true,
|
|
318
|
+
labelMinTextSize: true,
|
|
319
|
+
labelProps: true,
|
|
320
|
+
labelSize: true,
|
|
321
|
+
loading: true,
|
|
322
|
+
loadingIconType: true,
|
|
323
|
+
media: true,
|
|
324
|
+
mediaAlt: true,
|
|
325
|
+
mediaAspectRatio: true,
|
|
326
|
+
mediaPosition: true,
|
|
327
|
+
mediaProps: true,
|
|
328
|
+
minimal: true,
|
|
329
|
+
noHorizontalPadding: true,
|
|
330
|
+
onClose: true,
|
|
331
|
+
onCollapseChange: true,
|
|
332
|
+
onLabelEdit: true,
|
|
333
|
+
opacity: true,
|
|
334
|
+
padded: true,
|
|
335
|
+
radiusSize: true,
|
|
336
|
+
raised: true,
|
|
337
|
+
resizable: true,
|
|
338
|
+
responsiveActions: true,
|
|
339
|
+
responsiveActionsWrapperProps: true,
|
|
340
|
+
responsiveTitle: true,
|
|
341
|
+
rounded: true,
|
|
342
|
+
showActionsWhenCollapsed: true,
|
|
343
|
+
showLabelTooltip: true,
|
|
344
|
+
skeleton: true,
|
|
345
|
+
stickyHeader: true,
|
|
346
|
+
stickyHeaderInset: true,
|
|
347
|
+
stickyHeaderOffset: true,
|
|
348
|
+
theme: true,
|
|
349
|
+
tooltip: true,
|
|
350
|
+
transparent: true,
|
|
351
|
+
unMountContentOnCollapse: true,
|
|
352
|
+
wrapperPadding: true,
|
|
353
|
+
});
|
|
354
|
+
exports.StyledPanel = (0, styled_1.default)(Effect_1.StyledEffect).withConfig({
|
|
355
|
+
// Its own props, `interactive` (set by the panel for its hover styles) and the layout flags a
|
|
356
|
+
// containing ControlGroup hands it — except `size`, which a panel never forwards but a
|
|
357
|
+
// `Resizable` reads as its own.
|
|
358
|
+
shouldForwardProp: styled_1.omitStyleProps.apply(void 0, __spreadArray(__spreadArray(__spreadArray([], exports.REQORE_PANEL_STYLE_PROPS, false), styled_1.REQORE_CONTROL_GROUP_CHILD_PROPS.filter(function (prop) { return prop !== 'size'; }), false), ['interactive'], false)),
|
|
229
359
|
})(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: ", "px;\n border: ", ";\n color: ", ";\n ", "\n overflow: ", ";\n display: flex;\n flex-flow: column;\n position: relative;\n backdrop-filter: ", ";\n width: ", ";\n max-width: 100%;\n flex: ", ";\n\n /* Hover-hiding applies ONLY where the pointer can hover. A touch device never\n fires :hover, so without this gate a `show: 'hover'` action is display:none\n forever \u2014 not merely invisible but absent from the layout, with nothing on\n screen hinting it exists. Where hover is unavailable the action stays\n visible; losing the tidiness beats losing the action. */\n @media (hover: hover) and (pointer: fine) {\n &:not(:hover) {\n .reqore-panel-action-hidden {\n display: none;\n }\n }\n }\n\n &.reqore-panel-floating-active {\n border-top-right-radius: 0;\n }\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n"], ["\n background-color: ", ";\n border-radius: ", "px;\n border: ", ";\n color: ", ";\n ", "\n overflow: ", ";\n display: flex;\n flex-flow: column;\n position: relative;\n backdrop-filter: ", ";\n width: ", ";\n max-width: 100%;\n flex: ", ";\n\n /* Hover-hiding applies ONLY where the pointer can hover. A touch device never\n fires :hover, so without this gate a \\`show: 'hover'\\` action is display:none\n forever \u2014 not merely invisible but absent from the layout, with nothing on\n screen hinting it exists. Where hover is unavailable the action stays\n visible; losing the tidiness beats losing the action. */\n @media (hover: hover) and (pointer: fine) {\n &:not(:hover) {\n .reqore-panel-action-hidden {\n display: none;\n }\n }\n }\n\n &.reqore-panel-floating-active {\n border-top-right-radius: 0;\n }\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
230
360
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
231
361
|
return (0, polished_1.rgba)((0, colors_2.getPanelBackgroundColor)(theme), opacity);
|
|
@@ -297,14 +427,14 @@ exports.StyledPanel = (0, styled_components_1.default)(Effect_1.StyledEffect).wi
|
|
|
297
427
|
var disabled = _a.disabled;
|
|
298
428
|
return disabled && styles_1.DisabledElement;
|
|
299
429
|
});
|
|
300
|
-
exports.StyledPanelTitle =
|
|
430
|
+
exports.StyledPanelTitle = styled_1.default.div.withConfig({
|
|
301
431
|
shouldForwardProp: (0, styled_1.omitStyleProps)('opacity'),
|
|
302
432
|
})(templateObject_25 || (templateObject_25 = __makeTemplateObject(["\n display: flex;\n /* Always a row. The title bar used to flip to a column when narrow; it now ellipsizes its\n label and lets the responsive action group collapse instead, which is what the \"hidden when\n small\" actions are for and what the stack was quietly defeating (a column made the group\n fluid, and a full-width group had room not to collapse). */\n flex-flow: ", ";\n\n ", "\n\n ", "\n\n ", "\n\n background-color: ", ";\n justify-content: space-between;\n\n padding: ", ";\n\n align-items: center;\n border-bottom: ", ";\n transition: background-color 0.2s ease-out;\n overflow: hidden;\n flex: 0 0 auto;\n gap: ", "px;\n\n ", " .reqore-panel-title-icon {\n transform: scale(", ");\n }\n\n ", "\n"], ["\n display: flex;\n /* Always a row. The title bar used to flip to a column when narrow; it now ellipsizes its\n label and lets the responsive action group collapse instead, which is what the \"hidden when\n small\" actions are for and what the stack was quietly defeating (a column made the group\n fluid, and a full-width group had room not to collapse). */\n flex-flow: ", ";\n\n ", "\n\n ", "\n\n ", "\n\n background-color: ", ";\n justify-content: space-between;\n\n padding: ", ";\n\n align-items: center;\n border-bottom: ", ";\n transition: background-color 0.2s ease-out;\n overflow: hidden;\n flex: 0 0 auto;\n gap: ", "px;\n\n ", " .reqore-panel-title-icon {\n transform: scale(", ");\n }\n\n ", "\n"])), function (_a) {
|
|
303
433
|
var $descriptionBelow = _a.$descriptionBelow;
|
|
304
434
|
return ($descriptionBelow ? 'row wrap' : 'row');
|
|
305
435
|
}, function (_a) {
|
|
306
436
|
var $descriptionFontPx = _a.$descriptionFontPx;
|
|
307
|
-
return !!$descriptionFontPx && (0, styled_components_1.css)(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n /* The description is a fixed px from `
|
|
437
|
+
return !!$descriptionFontPx && (0, styled_components_1.css)(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n /* The description is a fixed px from the type scale (`getTextSize`) and knows nothing\n about the title having shrunk, so a fitted title crosses under it: at the 12px floor\n the support text renders at 15px and outranks the heading it supports. Scaling it by\n the SAME factor the title took keeps the two in their original proportion instead of\n giving the description a fit of its own \u2014 which would size it against its own box and\n let the pair drift apart again, in the other direction. */\n .reqore-panel-title-description {\n font-size: ", "px;\n }\n "], ["\n /* The description is a fixed px from the type scale (\\`getTextSize\\`) and knows nothing\n about the title having shrunk, so a fitted title crosses under it: at the 12px floor\n the support text renders at 15px and outranks the heading it supports. Scaling it by\n the SAME factor the title took keeps the two in their original proportion instead of\n giving the description a fit of its own \u2014 which would size it against its own box and\n let the pair drift apart again, in the other direction. */\n .reqore-panel-title-description {\n font-size: ", "px;\n }\n "])), $descriptionFontPx);
|
|
308
438
|
}, function (_a) {
|
|
309
439
|
var $descriptionBelow = _a.$descriptionBelow;
|
|
310
440
|
return $descriptionBelow && (0, styled_components_1.css)(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n /* Only on a wrapping bar. The header claims the row so the action group beside it gets\n squeezed and folds \u2014 that is what the base rule is for \u2014 but in a WRAPPING row a\n full-width claim takes the whole line and pushes the actions onto their own, which is\n not what \"description below\" asked for. Here the header grows from 0 into whatever the\n actions leave, on line one, and the description takes line two. */\n > .reqore-panel-title-header {\n width: auto;\n flex: 1 1 0%;\n min-width: 0;\n }\n "], ["\n /* Only on a wrapping bar. The header claims the row so the action group beside it gets\n squeezed and folds \u2014 that is what the base rule is for \u2014 but in a WRAPPING row a\n full-width claim takes the whole line and pushes the actions onto their own, which is\n not what \"description below\" asked for. Here the header grows from 0 into whatever the\n actions leave, on line one, and the description takes line two. */\n > .reqore-panel-title-header {\n width: auto;\n flex: 1 1 0%;\n min-width: 0;\n }\n "])));
|
|
@@ -329,7 +459,7 @@ exports.StyledPanelTitle = styled_components_1.default.div.withConfig({
|
|
|
329
459
|
return (0, polished_1.rgba)(getPanelHeaderColor(theme, true), opacity);
|
|
330
460
|
});
|
|
331
461
|
});
|
|
332
|
-
exports.StyledPanelTopBar = (0,
|
|
462
|
+
exports.StyledPanelTopBar = (0, styled_1.default)(exports.StyledPanelTitle)(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n padding-bottom: ", ";\n padding-top: ", ";\n position: ", ";\n /* `top: 0` must mean \"flush with the visible top edge of whatever scrolls\",\n which is what every call site assumes. Sticky resolves against the scroll\n container's CONTENT box, so on a padded scrollport \u2014 which every default\n panel/drawer/modal body is, since StyledPanelContent puts padding and\n overflow on one element \u2014 an uncompensated 0 parks the header below the\n padding and lets content scroll through the gap. `stickyHeaderInset` is\n that padding, measured from the real scroll ancestor at runtime;\n `stickyHeaderOffset` stays a deliberate caller offset on top of a now\n correct zero. */\n top: ", ";\n z-index: ", ";\n // A sticky header forces the panel wrapper to overflow visible (so the\n // header can stick), which stops the wrapper from clipping the header's top\n // corners \u2014 so without this the panel reads as square-topped even at rest.\n // AT REST, round the header's own top corners to the panel's inner radius so\n // the panel keeps its radius (inset 1px past a visible border to match the\n // wrapper's inner curve; flat border-less panels need no inset). ONCE STUCK\n // (pinned to the scroll container, detected at runtime via isStuck), drop the\n // radius to 0 so the pinned header reads as a full-width bar and only loses\n // its corners while it is actually moving with the scroll.\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n background: ", ";\n // When the header is sticky AND the panel is minimal / transparent (opacity === 0), the\n // header has no surface of its own \u2014 scrolling content slides straight under it and the\n // label / actions become illegible. Apply a backdrop blur so the underlying content stays\n // visible but is softened enough for the header text to read clearly. Idle (no overflow,\n // nothing behind) the blur is a no-op so the static appearance is unchanged.\n ", "\n"], ["\n padding-bottom: ", ";\n padding-top: ", ";\n position: ", ";\n /* \\`top: 0\\` must mean \"flush with the visible top edge of whatever scrolls\",\n which is what every call site assumes. Sticky resolves against the scroll\n container's CONTENT box, so on a padded scrollport \u2014 which every default\n panel/drawer/modal body is, since StyledPanelContent puts padding and\n overflow on one element \u2014 an uncompensated 0 parks the header below the\n padding and lets content scroll through the gap. \\`stickyHeaderInset\\` is\n that padding, measured from the real scroll ancestor at runtime;\n \\`stickyHeaderOffset\\` stays a deliberate caller offset on top of a now\n correct zero. */\n top: ", ";\n z-index: ", ";\n // A sticky header forces the panel wrapper to overflow visible (so the\n // header can stick), which stops the wrapper from clipping the header's top\n // corners \u2014 so without this the panel reads as square-topped even at rest.\n // AT REST, round the header's own top corners to the panel's inner radius so\n // the panel keeps its radius (inset 1px past a visible border to match the\n // wrapper's inner curve; flat border-less panels need no inset). ONCE STUCK\n // (pinned to the scroll container, detected at runtime via isStuck), drop the\n // radius to 0 so the pinned header reads as a full-width bar and only loses\n // its corners while it is actually moving with the scroll.\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n background: ", ";\n // When the header is sticky AND the panel is minimal / transparent (opacity === 0), the\n // header has no surface of its own \u2014 scrolling content slides straight under it and the\n // label / actions become illegible. Apply a backdrop blur so the underlying content stays\n // visible but is softened enough for the header text to read clearly. Idle (no overflow,\n // nothing behind) the blur is a no-op so the static appearance is unchanged.\n ", "\n"])), function (_a) {
|
|
333
463
|
var padded = _a.padded, size = _a.size, isCollapsed = _a.isCollapsed, minimal = _a.minimal;
|
|
334
464
|
return !padded || isCollapsed || !minimal
|
|
335
465
|
? "".concat(getPaddingSize(padded, size), "px")
|
|
@@ -376,7 +506,7 @@ exports.StyledPanelTopBar = (0, styled_components_1.default)(exports.StyledPanel
|
|
|
376
506
|
return stickyHeader &&
|
|
377
507
|
opacity === 0 && (0, styled_components_1.css)(templateObject_26 || (templateObject_26 = __makeTemplateObject(["\n backdrop-filter: blur(30px);\n -webkit-backdrop-filter: blur(30px);\n "], ["\n backdrop-filter: blur(30px);\n -webkit-backdrop-filter: blur(30px);\n "])));
|
|
378
508
|
});
|
|
379
|
-
exports.StyledPanelBottomActions = (0,
|
|
509
|
+
exports.StyledPanelBottomActions = (0, styled_1.default)(exports.StyledPanelTitle)(templateObject_28 || (templateObject_28 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n border-bottom: 0;\n border-top: ", ";\n"], ["\n padding-top: ", ";\n padding-bottom: ", ";\n border-bottom: 0;\n border-top: ", ";\n"])), function (_a) {
|
|
380
510
|
var padded = _a.padded, size = _a.size, minimal = _a.minimal;
|
|
381
511
|
return !padded || !minimal
|
|
382
512
|
? "".concat(getPaddingSize(padded, size), "px")
|
|
@@ -396,7 +526,7 @@ exports.StyledPanelBottomActions = (0, styled_components_1.default)(exports.Styl
|
|
|
396
526
|
? "1px solid ".concat((0, polished_1.rgba)((0, colors_2.getPanelHairlineColor)(theme), opacity))
|
|
397
527
|
: null;
|
|
398
528
|
});
|
|
399
|
-
exports.StyledPanelContent =
|
|
529
|
+
exports.StyledPanelContent = styled_1.default.div(templateObject_29 || (templateObject_29 = __makeTemplateObject(["\n display: ", ";\n padding: ", ";\n flex: 1;\n /* A flex child's min-height defaults to its content size, so without this the\n scrollable content can't shrink: a panel/drawer body taller than the panel\n pushes the (flex: 0 0 auto) bottom-actions footer past the panel's clipped\n edge and strands it, instead of scrolling. */\n min-height: 0;\n overflow: auto;\n overflow-wrap: anywhere;\n font-size: ", "px;\n"], ["\n display: ", ";\n padding: ", ";\n flex: 1;\n /* A flex child's min-height defaults to its content size, so without this the\n scrollable content can't shrink: a panel/drawer body taller than the panel\n pushes the (flex: 0 0 auto) bottom-actions footer past the panel's clipped\n edge and strands it, instead of scrolling. */\n min-height: 0;\n overflow: auto;\n overflow-wrap: anywhere;\n font-size: ", "px;\n"])), function (_a) {
|
|
400
530
|
var isCollapsed = _a.isCollapsed;
|
|
401
531
|
return (isCollapsed ? 'none !important' : undefined);
|
|
402
532
|
}, function (_a) {
|
|
@@ -407,13 +537,13 @@ exports.StyledPanelContent = styled_components_1.default.div(templateObject_29 |
|
|
|
407
537
|
? "".concat(getPaddingSize(padded, size), "px 0")
|
|
408
538
|
: "".concat(getPaddingSize(padded, size), "px ").concat(getPaddingSize(padded, size), "px");
|
|
409
539
|
}, function (_a) {
|
|
410
|
-
var size = _a.size;
|
|
411
|
-
return
|
|
540
|
+
var size = _a.size, theme = _a.theme;
|
|
541
|
+
return (0, typeScale_1.getTextSize)(theme, size);
|
|
412
542
|
});
|
|
413
543
|
/** The media frame. Its outer corners take the panel's inner curve, so the media is clipped to
|
|
414
544
|
* the panel's shape even where the panel cannot clip it (a sticky header makes the panel
|
|
415
545
|
* overflow visible). */
|
|
416
|
-
exports.StyledPanelMedia =
|
|
546
|
+
exports.StyledPanelMedia = styled_1.default.div(templateObject_33 || (templateObject_33 = __makeTemplateObject(["\n flex: 0 0 auto;\n position: relative;\n overflow: hidden;\n ", "\n\n > img,\n > video,\n > picture,\n > picture > img,\n > svg,\n > canvas,\n > iframe {\n display: block;\n width: 100%;\n max-width: 100%;\n border: 0;\n }\n\n > img,\n > video,\n > picture > img {\n height: auto;\n }\n\n ", "\n"], ["\n flex: 0 0 auto;\n position: relative;\n overflow: hidden;\n ", "\n\n > img,\n > video,\n > picture,\n > picture > img,\n > svg,\n > canvas,\n > iframe {\n display: block;\n width: 100%;\n max-width: 100%;\n border: 0;\n }\n\n > img,\n > video,\n > picture > img {\n height: auto;\n }\n\n ", "\n"])), function (_a) {
|
|
417
547
|
var $position = _a.$position, $radius = _a.$radius;
|
|
418
548
|
return $position === 'top'
|
|
419
549
|
? (0, styled_components_1.css)(templateObject_30 || (templateObject_30 = __makeTemplateObject(["\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n "], ["\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n "])), $radius, $radius) : (0, styled_components_1.css)(templateObject_31 || (templateObject_31 = __makeTemplateObject(["\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n "], ["\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n "])), $radius, $radius);
|
|
@@ -421,7 +551,7 @@ exports.StyledPanelMedia = styled_components_1.default.div(templateObject_33 ||
|
|
|
421
551
|
var $aspectRatio = _a.$aspectRatio;
|
|
422
552
|
return $aspectRatio !== undefined && (0, styled_components_1.css)(templateObject_32 || (templateObject_32 = __makeTemplateObject(["\n aspect-ratio: ", ";\n\n > img,\n > video,\n > picture,\n > picture > img,\n > svg,\n > canvas,\n > iframe {\n height: 100%;\n object-fit: cover;\n }\n "], ["\n aspect-ratio: ", ";\n\n > img,\n > video,\n > picture,\n > picture > img,\n > svg,\n > canvas,\n > iframe {\n height: 100%;\n object-fit: cover;\n }\n "])), $aspectRatio);
|
|
423
553
|
});
|
|
424
|
-
exports.StyledFloatingActions =
|
|
554
|
+
exports.StyledFloatingActions = styled_1.default.div(templateObject_34 || (templateObject_34 = __makeTemplateObject(["\n position: fixed;\n z-index: 999999;\n display: flex;\n padding: ", "px;\n background-color: ", ";\n border: ", ";\n border-bottom: none;\n border-radius: ", "px\n ", "px 0 0;\n gap: ", "px;\n pointer-events: auto;\n"], ["\n position: fixed;\n z-index: 999999;\n display: flex;\n padding: ", "px;\n background-color: ", ";\n border: ", ";\n border-bottom: none;\n border-radius: ", "px\n ", "px 0 0;\n gap: ", "px;\n pointer-events: auto;\n"])), function (_a) {
|
|
425
555
|
var size = _a.size;
|
|
426
556
|
return sizes_1.PADDING_FROM_SIZE[size];
|
|
427
557
|
}, function (_a) {
|
|
@@ -450,7 +580,7 @@ exports.ReqorePanelSkeleton = (0, react_2.memo)(function (_a) {
|
|
|
450
580
|
});
|
|
451
581
|
exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
452
582
|
var _b, _c;
|
|
453
|
-
var children = _a.children, label = _a.label, description = _a.description, _d = _a.collapseButtonProps, collapseButtonProps = _d === void 0 ? {} : _d, collapsible = _a.collapsible, onClose = _a.onClose, _e = _a.closeButtonProps, closeButtonProps = _e === void 0 ? {} : _e, _f = _a.rounded, rounded = _f === void 0 ? true : _f, _g = _a.actions, actions = _g === void 0 ? [] : _g, _h = _a.bottomActions, bottomActions = _h === void 0 ? [] : _h, isCollapsed = _a.isCollapsed, customTheme = _a.customTheme, inheritCustomTheme = _a.inheritCustomTheme, icon = _a.icon, iconImage = _a.iconImage, _j = _a.iconWithLabel, iconWithLabel = _j === void 0 ? false : _j, _k = _a.iconVerticalAlign, iconVerticalAlign = _k === void 0 ? 'center' : _k, intent = _a.intent, className = _a.className, flat = _a.flat, _l = _a.unMountContentOnCollapse, unMountContentOnCollapse = _l === void 0 ? true : _l, onCollapseChange = _a.onCollapseChange, _m = _a.padded, padded = _m === void 0 ? true : _m, _o = _a.wrapperPadding, wrapperPadding = _o === void 0 ? 'both' : _o, contentStyle = _a.contentStyle, contentEffect = _a.contentEffect, _p = _a.labelEffect, labelEffect = _p === void 0 ? {} : _p, _q = _a.descriptionEffect, descriptionEffect = _q === void 0 ? {} : _q, descriptionIntent = _a.descriptionIntent, labelSize = _a.labelSize, contentSize = _a.contentSize, minimal = _a.minimal, badge = _a.badge, iconColor = _a.iconColor, _r = _a.iconProps, iconProps = _r === void 0 ? {} : _r, fluid = _a.fluid, _s = _a.responsiveActions, responsiveActions = _s === void 0 ? true : _s, _t = _a.responsiveTitle, responsiveTitle = _t === void 0 ? true : _t, _u = _a.compactTitle, compactTitle = _u === void 0 ? false : _u, _v = _a.fitLabel, fitLabel = _v === void 0 ? true : _v, _w = _a.labelMaxLines, labelMaxLines = _w === void 0 ? 2 : _w, _x = _a.descriptionPosition, descriptionPosition = _x === void 0 ? 'inline' : _x, _y = _a.descriptionMaxLines, descriptionMaxLines = _y === void 0 ? 2 : _y, labelMinTextSize = _a.labelMinTextSize, _z = _a.size, panelSize = _z === void 0 ? 'normal' : _z, getContentRef = _a.getContentRef, _0 = _a.labelProps, labelProps = _0 === void 0 ? {} : _0, disabled = _a.disabled, breadcrumbs = _a.breadcrumbs, _1 = _a.showActionsWhenCollapsed, showActionsWhenCollapsed = _1 === void 0 ? true : _1, showLabelTooltip = _a.showLabelTooltip, customLabelTooltip = _a.customLabelTooltip, resizable = _a.resizable, onLabelEdit = _a.onLabelEdit, responsiveActionsWrapperProps = _a.responsiveActionsWrapperProps, loading = _a.loading, loadingIconType = _a.loadingIconType, skeleton = _a.skeleton, errorBoundaryOptions = _a.errorBoundaryOptions,
|
|
583
|
+
var children = _a.children, label = _a.label, description = _a.description, _d = _a.collapseButtonProps, collapseButtonProps = _d === void 0 ? {} : _d, collapsible = _a.collapsible, onClose = _a.onClose, _e = _a.closeButtonProps, closeButtonProps = _e === void 0 ? {} : _e, _f = _a.rounded, rounded = _f === void 0 ? true : _f, _g = _a.actions, actions = _g === void 0 ? [] : _g, _h = _a.bottomActions, bottomActions = _h === void 0 ? [] : _h, isCollapsed = _a.isCollapsed, customTheme = _a.customTheme, inheritCustomTheme = _a.inheritCustomTheme, icon = _a.icon, iconImage = _a.iconImage, _j = _a.iconWithLabel, iconWithLabel = _j === void 0 ? false : _j, _k = _a.iconVerticalAlign, iconVerticalAlign = _k === void 0 ? 'center' : _k, intent = _a.intent, className = _a.className, flat = _a.flat, _l = _a.unMountContentOnCollapse, unMountContentOnCollapse = _l === void 0 ? true : _l, onCollapseChange = _a.onCollapseChange, _m = _a.padded, padded = _m === void 0 ? true : _m, _o = _a.wrapperPadding, wrapperPadding = _o === void 0 ? 'both' : _o, contentStyle = _a.contentStyle, contentEffect = _a.contentEffect, _p = _a.labelEffect, labelEffect = _p === void 0 ? {} : _p, _q = _a.descriptionEffect, descriptionEffect = _q === void 0 ? {} : _q, descriptionIntent = _a.descriptionIntent, labelSize = _a.labelSize, contentSize = _a.contentSize, minimal = _a.minimal, badge = _a.badge, iconColor = _a.iconColor, _r = _a.iconProps, iconProps = _r === void 0 ? {} : _r, fluid = _a.fluid, _s = _a.responsiveActions, responsiveActions = _s === void 0 ? true : _s, _t = _a.responsiveTitle, responsiveTitle = _t === void 0 ? true : _t, _u = _a.compactTitle, compactTitle = _u === void 0 ? false : _u, _v = _a.fitLabel, fitLabel = _v === void 0 ? true : _v, _w = _a.labelMaxLines, labelMaxLines = _w === void 0 ? 2 : _w, _x = _a.descriptionPosition, descriptionPosition = _x === void 0 ? 'inline' : _x, _y = _a.descriptionMaxLines, descriptionMaxLines = _y === void 0 ? 2 : _y, labelMinTextSize = _a.labelMinTextSize, _z = _a.size, panelSize = _z === void 0 ? 'normal' : _z, getContentRef = _a.getContentRef, _0 = _a.labelProps, labelProps = _0 === void 0 ? {} : _0, disabled = _a.disabled, breadcrumbs = _a.breadcrumbs, _1 = _a.showActionsWhenCollapsed, showActionsWhenCollapsed = _1 === void 0 ? true : _1, showLabelTooltip = _a.showLabelTooltip, customLabelTooltip = _a.customLabelTooltip, resizable = _a.resizable, onLabelEdit = _a.onLabelEdit, responsiveActionsWrapperProps = _a.responsiveActionsWrapperProps, loading = _a.loading, loadingIconType = _a.loadingIconType, skeleton = _a.skeleton, errorBoundaryOptions = _a.errorBoundaryOptions, floatingActionsProp = _a.floatingActions, _2 = _a.collapseTooltip, collapseTooltip = _2 === void 0 ? 'Collapse' : _2, _3 = _a.expandTooltip, expandTooltip = _3 === void 0 ? 'Expand' : _3, _4 = _a.closeTooltip, closeTooltip = _4 === void 0 ? 'Close' : _4, accentPosition = _a.accentPosition, accentSize = _a.accentSize, media = _a.media, _5 = _a.mediaAlt, mediaAlt = _5 === void 0 ? '' : _5, _6 = _a.mediaPosition, mediaPosition = _6 === void 0 ? 'top' : _6, mediaAspectRatio = _a.mediaAspectRatio, mediaProps = _a.mediaProps, rest = __rest(_a, ["children", "label", "description", "collapseButtonProps", "collapsible", "onClose", "closeButtonProps", "rounded", "actions", "bottomActions", "isCollapsed", "customTheme", "inheritCustomTheme", "icon", "iconImage", "iconWithLabel", "iconVerticalAlign", "intent", "className", "flat", "unMountContentOnCollapse", "onCollapseChange", "padded", "wrapperPadding", "contentStyle", "contentEffect", "labelEffect", "descriptionEffect", "descriptionIntent", "labelSize", "contentSize", "minimal", "badge", "iconColor", "iconProps", "fluid", "responsiveActions", "responsiveTitle", "compactTitle", "fitLabel", "labelMaxLines", "descriptionPosition", "descriptionMaxLines", "labelMinTextSize", "size", "getContentRef", "labelProps", "disabled", "breadcrumbs", "showActionsWhenCollapsed", "showLabelTooltip", "customLabelTooltip", "resizable", "onLabelEdit", "responsiveActionsWrapperProps", "loading", "loadingIconType", "skeleton", "errorBoundaryOptions", "floatingActions", "collapseTooltip", "expandTooltip", "closeTooltip", "accentPosition", "accentSize", "media", "mediaAlt", "mediaPosition", "mediaAspectRatio", "mediaProps"]);
|
|
454
584
|
// Resolved ONCE, here — the accent styles interpolate px and reserve padding,
|
|
455
585
|
// so they must only ever see a number. Shared with ReqoreCallout.
|
|
456
586
|
var accentSizePx = (0, react_2.useMemo)(function () { return (0, utils_1.resolveAccentSize)(accentSize); }, [accentSize]);
|
|
@@ -471,6 +601,11 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
471
601
|
};
|
|
472
602
|
}, []);
|
|
473
603
|
var isMobile = (0, useReqoreContext_1.useReqoreProperty)('isMobile');
|
|
604
|
+
/* Floating actions are a hover's. Where the device cannot hover (a phone, a tablet), nothing
|
|
605
|
+
would ever float them, so its hover actions stay in the panel's own bar, shown (see the
|
|
606
|
+
hover gate on StyledPanel). */
|
|
607
|
+
var isHoverCapable = (0, useReqoreContext_1.useReqoreProperty)('isHoverCapable');
|
|
608
|
+
var floatingActions = !!floatingActionsProp && isHoverCapable !== false;
|
|
474
609
|
var targetRef = (0, useCombinedRefs_1.useCombinedRefs)(ref).targetRef;
|
|
475
610
|
var _8 = (0, react_use_1.useMeasure)(), measureRef = _8[0], width = _8[1].width;
|
|
476
611
|
var _9 = (0, react_2.useState)(false), _isHovered = _9[0], setIsHovered = _9[1];
|
|
@@ -574,23 +709,67 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
574
709
|
floatingActionsRef.current.style.top = "".concat(panelRect.top - floatingRect.height + (flat ? 0 : 1), "px");
|
|
575
710
|
floatingActionsRef.current.style.left = "".concat(panelRect.right - floatingRect.width, "px");
|
|
576
711
|
}, [flat]);
|
|
712
|
+
var showsFloatingActions = _isHovered && !!floatingActions && (0, lodash_1.size)(floatingActionsList) > 0;
|
|
713
|
+
// placed as they are shown, and again whenever the actions change
|
|
714
|
+
(0, react_2.useEffect)(function () {
|
|
715
|
+
if (showsFloatingActions)
|
|
716
|
+
updateFloatingActionsPosition();
|
|
717
|
+
}, [showsFloatingActions, floatingActionsList, updateFloatingActionsPosition]);
|
|
718
|
+
/* ...and again whenever what they are placed by moves: the actions are fixed to the screen, placed
|
|
719
|
+
* by the panel's corner and their own size, so nothing follows on its own. A page that scrolls, a
|
|
720
|
+
* screen or window that resizes, a panel that grows or shrinks, and actions whose content changes
|
|
721
|
+
* width (a label, an icon or a font that loads) each moved the panel's corner or the actions' size
|
|
722
|
+
* without placing them again: they were left where the panel had been - mid-screen once the window
|
|
723
|
+
* widened - or reached past the panel's edge once they widened. One placement per frame, however
|
|
724
|
+
* many of these come in; none once they are hidden or the panel is gone. */
|
|
577
725
|
(0, react_2.useEffect)(function () {
|
|
578
|
-
if (!
|
|
726
|
+
if (!showsFloatingActions)
|
|
579
727
|
return undefined;
|
|
580
|
-
|
|
581
|
-
var
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
728
|
+
var frame = 0;
|
|
729
|
+
var schedule = function () {
|
|
730
|
+
if (!frame) {
|
|
731
|
+
frame = requestAnimationFrame(function () {
|
|
732
|
+
frame = 0;
|
|
733
|
+
updateFloatingActionsPosition();
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
window.addEventListener('scroll', schedule, true);
|
|
738
|
+
window.addEventListener('resize', schedule, { passive: true });
|
|
739
|
+
var observer = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(schedule) : undefined;
|
|
740
|
+
if (observer) {
|
|
741
|
+
if (panelRef.current)
|
|
742
|
+
observer.observe(panelRef.current);
|
|
743
|
+
if (floatingActionsRef.current)
|
|
744
|
+
observer.observe(floatingActionsRef.current);
|
|
745
|
+
}
|
|
746
|
+
return function () {
|
|
747
|
+
window.removeEventListener('scroll', schedule, true);
|
|
748
|
+
window.removeEventListener('resize', schedule);
|
|
749
|
+
observer === null || observer === void 0 ? void 0 : observer.disconnect();
|
|
750
|
+
if (frame)
|
|
751
|
+
cancelAnimationFrame(frame);
|
|
752
|
+
};
|
|
753
|
+
}, [showsFloatingActions, updateFloatingActionsPosition]);
|
|
754
|
+
/* The floating actions are a hover's: a finger's tap - and the `mouseenter` a browser emulates after it -
|
|
755
|
+
shows none (see `createHoverGate`). Where a finger is the primary pointer (`isHoverCapable` false) the
|
|
756
|
+
actions are in the panel's own bar instead (`floatingActions` is off, above), and on a touch laptop its
|
|
757
|
+
tap left them floating until the next. */
|
|
758
|
+
var hoverGate = (0, hoveringPointer_1.useHoverGate)();
|
|
759
|
+
var handlePointerEnter = (0, react_2.useCallback)(function (e) {
|
|
760
|
+
var _a;
|
|
761
|
+
hoverGate.notePointer(e);
|
|
762
|
+
(_a = rest.onPointerEnter) === null || _a === void 0 ? void 0 : _a.call(rest, e);
|
|
763
|
+
}, [hoverGate, rest.onPointerEnter]);
|
|
585
764
|
var handleMouseEnter = (0, react_2.useCallback)(function (e) {
|
|
586
765
|
var _a;
|
|
587
|
-
if (floatingActions) {
|
|
766
|
+
if (floatingActions && hoverGate.isHover()) {
|
|
588
767
|
if (hoverTimerRef.current)
|
|
589
768
|
clearTimeout(hoverTimerRef.current);
|
|
590
769
|
hoverTimerRef.current = setTimeout(function () { return setIsHovered(true); }, 150);
|
|
591
770
|
}
|
|
592
771
|
(_a = rest.onMouseEnter) === null || _a === void 0 ? void 0 : _a.call(rest, e);
|
|
593
|
-
}, [floatingActions, rest.onMouseEnter]);
|
|
772
|
+
}, [floatingActions, rest.onMouseEnter, hoverGate]);
|
|
594
773
|
var cancelHover = (0, react_2.useCallback)(function () {
|
|
595
774
|
if (hoverTimerRef.current) {
|
|
596
775
|
clearTimeout(hoverTimerRef.current);
|
|
@@ -598,6 +777,59 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
598
777
|
}
|
|
599
778
|
setIsHovered(false);
|
|
600
779
|
}, []);
|
|
780
|
+
/* The way from the panel to its floating actions.
|
|
781
|
+
*
|
|
782
|
+
* The actions float above the panel's top-right corner, so a pointer heading for
|
|
783
|
+
* them from inside the panel leaves the panel through its top edge - usually to the
|
|
784
|
+
* LEFT of the actions, on a diagonal - and passes over what lies above the panel
|
|
785
|
+
* before it reaches them. Ending the hover the moment the pointer left the panel
|
|
786
|
+
* hid the actions on that way, and the click meant for them landed on what they had
|
|
787
|
+
* been covering (in reqraft's expression editor: the Visual / Text switch, so
|
|
788
|
+
* "Remove" switched the view instead).
|
|
789
|
+
*
|
|
790
|
+
* So while the pointer is in the strip between the panel's top edge and the top of
|
|
791
|
+
* the actions, across the panel's width, the hover stays; it ends when the pointer
|
|
792
|
+
* leaves that strip for anything that is neither the panel nor the actions. Decided
|
|
793
|
+
* by where the pointer IS, on each move - no timer to guess the time a person needs. */
|
|
794
|
+
var corridorUntrackRef = (0, react_2.useRef)(null);
|
|
795
|
+
var stopCorridor = (0, react_2.useCallback)(function () {
|
|
796
|
+
var _a;
|
|
797
|
+
(_a = corridorUntrackRef.current) === null || _a === void 0 ? void 0 : _a.call(corridorUntrackRef);
|
|
798
|
+
corridorUntrackRef.current = null;
|
|
799
|
+
}, []);
|
|
800
|
+
var inCorridor = (0, react_2.useCallback)(function (x, y) {
|
|
801
|
+
if (!panelRef.current || !floatingActionsRef.current)
|
|
802
|
+
return false;
|
|
803
|
+
if (floatingActionsRef.current.style.display === 'none')
|
|
804
|
+
return false;
|
|
805
|
+
var panelRect = panelRef.current.getBoundingClientRect();
|
|
806
|
+
var actionsRect = floatingActionsRef.current.getBoundingClientRect();
|
|
807
|
+
return (x >= Math.min(panelRect.left, actionsRect.left) &&
|
|
808
|
+
x <= Math.max(panelRect.right, actionsRect.right) &&
|
|
809
|
+
y >= actionsRect.top &&
|
|
810
|
+
y <= panelRect.top + 1);
|
|
811
|
+
}, []);
|
|
812
|
+
var followCorridor = (0, react_2.useCallback)(function () {
|
|
813
|
+
stopCorridor();
|
|
814
|
+
var onMove = function (event) {
|
|
815
|
+
var _a, _b;
|
|
816
|
+
var target = event.target instanceof Node ? event.target : null;
|
|
817
|
+
// reached the actions or came back into the panel: their own handlers take over
|
|
818
|
+
if (target &&
|
|
819
|
+
(((_a = floatingActionsRef.current) === null || _a === void 0 ? void 0 : _a.contains(target)) || ((_b = panelRef.current) === null || _b === void 0 ? void 0 : _b.contains(target)))) {
|
|
820
|
+
stopCorridor();
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
if (!inCorridor(event.clientX, event.clientY)) {
|
|
824
|
+
stopCorridor();
|
|
825
|
+
cancelHover();
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
document.addEventListener('mousemove', onMove, true);
|
|
829
|
+
corridorUntrackRef.current = function () { return document.removeEventListener('mousemove', onMove, true); };
|
|
830
|
+
}, [cancelHover, inCorridor, stopCorridor]);
|
|
831
|
+
// a corridor followed when the panel goes is followed no more
|
|
832
|
+
(0, react_2.useEffect)(function () { return stopCorridor; }, [stopCorridor]);
|
|
601
833
|
var handleMouseLeave = (0, react_2.useCallback)(function (e) {
|
|
602
834
|
var _a;
|
|
603
835
|
if (floatingActions) {
|
|
@@ -607,10 +839,15 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
607
839
|
floatingActionsRef.current.contains(relatedTarget)) {
|
|
608
840
|
return;
|
|
609
841
|
}
|
|
610
|
-
|
|
842
|
+
if (_isHovered && inCorridor(e.clientX, e.clientY)) {
|
|
843
|
+
followCorridor();
|
|
844
|
+
}
|
|
845
|
+
else {
|
|
846
|
+
cancelHover();
|
|
847
|
+
}
|
|
611
848
|
}
|
|
612
849
|
(_a = rest.onMouseLeave) === null || _a === void 0 ? void 0 : _a.call(rest, e);
|
|
613
|
-
}, [floatingActions, rest.onMouseLeave, cancelHover]);
|
|
850
|
+
}, [floatingActions, rest.onMouseLeave, cancelHover, _isHovered, inCorridor, followCorridor]);
|
|
614
851
|
var handleFloatingActionsMouseLeave = (0, react_2.useCallback)(function (e) {
|
|
615
852
|
var relatedTarget = e.relatedTarget;
|
|
616
853
|
if (panelRef.current &&
|
|
@@ -618,8 +855,13 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
618
855
|
panelRef.current.contains(relatedTarget)) {
|
|
619
856
|
return;
|
|
620
857
|
}
|
|
858
|
+
// back towards the panel through the strip between them
|
|
859
|
+
if (inCorridor(e.clientX, e.clientY)) {
|
|
860
|
+
followCorridor();
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
621
863
|
cancelHover();
|
|
622
|
-
}, [cancelHover]);
|
|
864
|
+
}, [cancelHover, inCorridor, followCorridor]);
|
|
623
865
|
/* The panel renders as re-resizable's `Resizable` when it is resizable — unless the caller
|
|
624
866
|
gave its own element in `as`, which always wins. (`rest.as || cond ? Resizable : 'div'`
|
|
625
867
|
binds as `(rest.as || cond) ? …`, so a panel given `as` used to render a `Resizable`.) */
|
|
@@ -933,7 +1175,8 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
933
1175
|
/** Only while the title is actually below its natural size, and never over a caller who
|
|
934
1176
|
* pinned the description's own size. */
|
|
935
1177
|
var descriptionFontPx = fitLabel && !(descriptionEffect === null || descriptionEffect === void 0 ? void 0 : descriptionEffect.textSize) && labelFitPx < labelNaturalPx
|
|
936
|
-
? Math.max(useFitTextSize_1.FIT_TEXT_FLOOR_PX, Math.round(((_c =
|
|
1178
|
+
? Math.max(useFitTextSize_1.FIT_TEXT_FLOOR_PX, Math.round(((_c = (0, typeScale_1.getTextSize)(theme, panelSize)) !== null && _c !== void 0 ? _c : (0, typeScale_1.getTextSize)(theme, 'normal')) *
|
|
1179
|
+
(labelFitPx / labelNaturalPx)))
|
|
937
1180
|
: 0;
|
|
938
1181
|
/**
|
|
939
1182
|
* How much room the title has, computed rather than measured off its own box.
|
|
@@ -969,6 +1212,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
969
1212
|
* the right answer either way.
|
|
970
1213
|
*/
|
|
971
1214
|
(0, react_2.useLayoutEffect)(function () {
|
|
1215
|
+
var _a;
|
|
972
1216
|
var node = labelFitRef.current;
|
|
973
1217
|
var parent = node === null || node === void 0 ? void 0 : node.parentElement;
|
|
974
1218
|
if (!fitLabel || !node || !parent) {
|
|
@@ -982,9 +1226,26 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
982
1226
|
return child === node ? total : total + child.getBoundingClientRect().width;
|
|
983
1227
|
}, 0);
|
|
984
1228
|
var gaps = gap * Math.max(0, parent.children.length - 1);
|
|
985
|
-
|
|
1229
|
+
/* What the title could still gain, which the box measured above does not show: the box is
|
|
1230
|
+
only as wide as the title at its present size, so a title shrunk on a narrow bar measured
|
|
1231
|
+
that small box when the bar widened again, and stayed shrunk however wide the bar became
|
|
1232
|
+
(qorus#646). The room is the title box's own beyond what it holds (it grows; what it holds
|
|
1233
|
+
does not), and on a narrow bar the actions group's beyond its least (it gives way to the
|
|
1234
|
+
title, down to what its controls cannot do without). Neither moves when the title's font
|
|
1235
|
+
does: the sum is the title's whole claim on the bar. */
|
|
1236
|
+
var header = node.closest('.reqore-panel-title-header');
|
|
1237
|
+
var headerRoom = header
|
|
1238
|
+
? header.clientWidth -
|
|
1239
|
+
Array.from(header.children).reduce(function (total, child) { return total + child.getBoundingClientRect().width; }, 0)
|
|
1240
|
+
: 0;
|
|
1241
|
+
var narrowActions = isNarrow
|
|
1242
|
+
? (_a = node
|
|
1243
|
+
.closest('.reqore-panel-title')) === null || _a === void 0 ? void 0 : _a.querySelector(":scope > .".concat(NON_RESPONSIVE_ACTIONS_CLASS))
|
|
1244
|
+
: undefined;
|
|
1245
|
+
var actionsRoom = narrowActions ? getWidthAboveMinimum(narrowActions) : 0;
|
|
1246
|
+
var next = Math.max(0, Math.round(parent.clientWidth - padding - siblings - gaps + Math.max(0, headerRoom) + actionsRoom));
|
|
986
1247
|
setLabelAvailable(function (current) { return (current === next ? current : next); });
|
|
987
|
-
}, [fitLabel, label, width, badge, actions, panelSize, description, clampLines]);
|
|
1248
|
+
}, [fitLabel, label, width, badge, actions, panelSize, description, clampLines, isNarrow]);
|
|
988
1249
|
var iconTooltip = (0, react_2.useMemo)(function () { return ({
|
|
989
1250
|
content: label,
|
|
990
1251
|
}); }, [label]);
|
|
@@ -1001,7 +1262,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1001
1262
|
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ReqoreErrorBoundary, __assign({}, errorBoundaryOptions, { children: (0, jsx_runtime_1.jsxs)(TooltipComponent_1.ReqoreTooltipComponent, __assign({}, (0, lodash_1.omit)(rest, ['onResize']), _resizable, { as: rest.as || (isResizableElement ? re_resizable_1.Resizable : 'div'), isCollapsed: _isCollapsed, rounded: rounded, flat: flat, intent: intent, accentPosition: accentPosition, "$accentSize": accentSizePx, className: "".concat(className || '', " reqore-panel").concat(_isHovered && (0, lodash_1.size)(floatingActionsList) > 0 ? ' reqore-panel-floating-active' : ''), interactive: interactive, theme: theme, effect: transformedContentEffect, opacity: opacity, fluid: fluid, disabled: disabled, Component: exports.StyledPanel, ref: function (node) {
|
|
1002
1263
|
handleRef(node);
|
|
1003
1264
|
panelRef.current = node;
|
|
1004
|
-
}, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [!_isCollapsed && mediaPosition === 'top' ? mediaNode : null, rest.stickyHeader ? ((0, jsx_runtime_1.jsx)("div", { ref: stickySentinelRef, "aria-hidden": 'true', style: { height: 0 } })) : null, _isHovered &&
|
|
1265
|
+
}, onPointerEnter: handlePointerEnter, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [!_isCollapsed && mediaPosition === 'top' ? mediaNode : null, rest.stickyHeader ? ((0, jsx_runtime_1.jsx)("div", { ref: stickySentinelRef, "aria-hidden": 'true', style: { height: 0 } })) : null, _isHovered &&
|
|
1005
1266
|
(0, lodash_1.size)(floatingActionsList) > 0 &&
|
|
1006
1267
|
(0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(exports.StyledFloatingActions, { className: 'reqore-panel-floating-actions', theme: theme, size: panelSize, intent: intent, flat: flat, ref: floatingActionsRef, onMouseLeave: handleFloatingActionsMouseLeave, children: (0, jsx_runtime_1.jsx)(ControlGroup_1.default, { size: panelSize, gapSize: panelSize, children: floatingActionsList.map(function (action, index) { return renderActions(action, index, true); }) }) }), document.body), hasTitleBar && ((0, jsx_runtime_1.jsxs)(exports.StyledPanelTopBar, { flat: flat, isCollapsed: _isCollapsed, collapsible: collapsible, className: 'reqore-panel-title', onClick: handleCollapseClick, theme: theme, minimal: minimal || opacity === 0, size: contentSize || panelSize, opacity: minimal ? 0 : (opacity !== null && opacity !== void 0 ? opacity : 1), noHorizontalPadding: noHorizontalPadding, responsive: responsiveTitle, "$descriptionBelow": descriptionBelow, "$descriptionMaxLines": descriptionIsClamped ? descriptionClamp : 0, "$descriptionFontPx": descriptionFontPx, "data-narrow": isNarrow ? 'true' : 'false', ref: measureRef, padded: padded, wrapperPadding: wrapperPadding, intent: intent, rounded: rounded, radiusSize: rest.radiusSize, stickyHeader: rest.stickyHeader, stickyHeaderOffset: rest.stickyHeaderOffset, stickyHeaderInset: stickyInset, isStuck: isHeaderStuck, "$mediaAbove": hasMedia && mediaPosition === 'top' && !_isCollapsed, children: [hasTitleHeader && ((0, jsx_runtime_1.jsxs)(exports.StyledPanelTitleHeader, { className: 'reqore-panel-title-header', children: [breadcrumbs ? ((0, jsx_runtime_1.jsx)(Breadcrumbs_1.default, __assign({}, breadcrumbs, { padded: false, margin: 'none', flat: true, responsive: true }))) : icon || iconImage || label || badge ? ((function () {
|
|
1007
1268
|
var hasPanelIcon = !!icon || !!iconImage || loading;
|
|
@@ -1109,7 +1370,23 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1109
1370
|
// but only while there is a title header to take it FROM. With no label,
|
|
1110
1371
|
// badge, icon or breadcrumbs the bar is the group's alone, and holding a
|
|
1111
1372
|
// Collection's search input to half of an empty bar guards nothing.
|
|
1112
|
-
maxWidth: hasTitleHeader ? '50%' : undefined }, responsiveActionsWrapperProps === null || responsiveActionsWrapperProps === void 0 ? void 0 : responsiveActionsWrapperProps.style), children: nonFloatingActions.map(renderResponsiveActions()) }))), (0, jsx_runtime_1.jsx)(NonResponsiveActions_1.ReqorePanelNonResponsiveActions, { show: showNonResponsiveGroup(), isSmall: false, showControlButtons: true, size: panelSize, hasResponsiveActions: hasResponsiveActions(nonFloatingActions), customTheme: theme, isCollapsed: _isCollapsed, onCollapseClick: collapsible ? handleCollapseClick : undefined, onCloseClick: onClose, closeButtonProps: closeButtonProps, collapseButtonProps: collapseButtonProps, collapseTooltip: collapseTooltip, expandTooltip: expandTooltip, closeTooltip: closeTooltip, fluid: !hasTitleHeader,
|
|
1373
|
+
maxWidth: hasTitleHeader ? '50%' : undefined }, responsiveActionsWrapperProps === null || responsiveActionsWrapperProps === void 0 ? void 0 : responsiveActionsWrapperProps.style), children: nonFloatingActions.map(renderResponsiveActions()) }))), (0, jsx_runtime_1.jsx)(NonResponsiveActions_1.ReqorePanelNonResponsiveActions, { show: showNonResponsiveGroup(), isSmall: false, showControlButtons: true, size: panelSize, hasResponsiveActions: hasResponsiveActions(nonFloatingActions), customTheme: theme, isCollapsed: _isCollapsed, onCollapseClick: collapsible ? handleCollapseClick : undefined, onCloseClick: onClose, closeButtonProps: closeButtonProps, collapseButtonProps: collapseButtonProps, collapseTooltip: collapseTooltip, expandTooltip: expandTooltip, closeTooltip: closeTooltip, fluid: !hasTitleHeader, className: NON_RESPONSIVE_ACTIONS_CLASS,
|
|
1374
|
+
// Beside a title in a NARROW bar the title comes first (qorus#646). The group is
|
|
1375
|
+
// `0 0 auto`, so a narrow bar - a table in a card on a phone - squeezed the title
|
|
1376
|
+
// to nothing and still pushed its last button past the panel's edge. Narrow, the
|
|
1377
|
+
// title takes its whole width first and the group what is left, at least what its
|
|
1378
|
+
// controls cannot do without (a search field narrows, a button never does) and at
|
|
1379
|
+
// most its own width. A basis of 0 is what gives the title the first claim: the
|
|
1380
|
+
// group is sized from the leftover, so the title shrinks only once the controls
|
|
1381
|
+
// are at their smallest - and its words break only when one is wider than the
|
|
1382
|
+
// space left beside them. Shrinking the two against each other instead, by any
|
|
1383
|
+
// factor, took a fraction of a pixel off the title, and that broke "Services" into
|
|
1384
|
+
// "Servic / es". Room the title does not need goes to the group first (a grow no
|
|
1385
|
+
// title's comes near), so a search field widens before the title's box does. A
|
|
1386
|
+
// wide bar keeps the group at its own width: there the title's claim was its
|
|
1387
|
+
// one-line width, a description beside it included, and a long description
|
|
1388
|
+
// squeezed a table's search to its least instead of wrapping.
|
|
1389
|
+
style: hasTitleHeader && isNarrow ? NARROW_ACTIONS_BESIDE_TITLE : undefined, children: nonFloatingActions.map(renderNonResponsiveActions()) }), descriptionBelow ? (
|
|
1113
1390
|
// `flex-basis: 100%` is what puts it on its own line — the bar is a wrapping
|
|
1114
1391
|
// flex row, so a full-width item cannot share one with anything before it.
|
|
1115
1392
|
// `min-width: 0` so a long sentence wraps inside the bar instead of widening it.
|