@qoretechnologies/reqore 0.78.6-pr.715.gdfefa70 → 0.78.7-pr.717.gdcb33d8
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 +48 -21
- 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 +344 -44
- 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 +20 -43
- package/dist/components/Bubble/index.js.map +1 -1
- package/dist/components/Button/index.d.ts +73 -0
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +307 -109
- 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 +87 -23
- 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 +117 -40
- 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 +11 -39
- 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 +4 -4
- 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 +52 -19
- 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.map +1 -1
- package/dist/components/DataView/index.js +35 -65
- 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 +28 -42
- 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 +77 -66
- 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 +90 -19
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Effect/index.d.ts +48 -6
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js +207 -46
- 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 +135 -40
- 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 +14 -64
- 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 +88 -27
- package/dist/components/FeatureCard/index.js.map +1 -1
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +8 -5
- 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 +39 -19
- 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 +37 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +91 -28
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InputClearButton/index.d.ts +7 -2
- package/dist/components/InputClearButton/index.d.ts.map +1 -1
- package/dist/components/InputClearButton/index.js +48 -9
- 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 +56 -19
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/KeyboardShortcut/index.js +3 -3
- 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 +3 -35
- 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 +12 -39
- 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 +10 -6
- 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 +40 -22
- 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 +35 -5
- 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/Message/index.d.ts.map +1 -1
- package/dist/components/Message/index.js +20 -4
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/NavRail/index.d.ts +2 -0
- package/dist/components/NavRail/index.d.ts.map +1 -1
- package/dist/components/NavRail/index.js +110 -27
- 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 +6 -2
- package/dist/components/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +87 -57
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Notifications/styles.d.ts +20 -0
- package/dist/components/Notifications/styles.d.ts.map +1 -1
- package/dist/components/Notifications/styles.js +40 -15
- 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 +15 -0
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +505 -204
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Panel/surface.d.ts +18 -0
- package/dist/components/Panel/surface.d.ts.map +1 -0
- package/dist/components/Panel/surface.js +56 -0
- package/dist/components/Panel/surface.js.map +1 -0
- 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 +65 -13
- 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 +169 -21
- 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 +11 -43
- 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 +24 -43
- 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 +130 -52
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/RowActionsMenu/index.d.ts +76 -0
- package/dist/components/RowActionsMenu/index.d.ts.map +1 -0
- package/dist/components/RowActionsMenu/index.js +182 -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 +72 -76
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/Select/valuePreview.js +2 -2
- 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 +46 -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 +43 -11
- 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 +48 -47
- package/dist/components/StackedBar/index.js.map +1 -1
- package/dist/components/Statistic/index.d.ts +0 -8
- package/dist/components/Statistic/index.d.ts.map +1 -1
- package/dist/components/Statistic/index.js +50 -44
- 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 +12 -44
- 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 +76 -52
- 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 +15 -12
- 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 +8 -38
- package/dist/components/Table/headerCell.js.map +1 -1
- package/dist/components/Table/helpers.d.ts +20 -0
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +52 -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 +44 -13
- 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 +8 -6
- package/dist/components/Tabs/item.js.map +1 -1
- package/dist/components/Tabs/list.d.ts.map +1 -1
- package/dist/components/Tabs/list.js +6 -4
- 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 +77 -3
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +315 -83
- 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 +65 -19
- package/dist/components/Testimonial/index.js.map +1 -1
- package/dist/components/Textarea/index.d.ts +16 -0
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +179 -30
- 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 +14 -10
- package/dist/components/Tier/index.js.map +1 -1
- package/dist/components/Timeline/index.d.ts +2 -0
- package/dist/components/Timeline/index.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +73 -28
- 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.d.ts.map +1 -1
- package/dist/components/Tree/index.js +26 -23
- 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 +0 -21
- 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 +7 -0
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +27 -36
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/context/SurfaceContext.d.ts +18 -0
- package/dist/context/SurfaceContext.d.ts.map +1 -0
- package/dist/context/SurfaceContext.js +39 -0
- package/dist/context/SurfaceContext.js.map +1 -0
- package/dist/helpers/colors.d.ts +188 -11
- package/dist/helpers/colors.d.ts.map +1 -1
- package/dist/helpers/colors.js +751 -100
- package/dist/helpers/colors.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/iconProps.d.ts +14 -0
- package/dist/helpers/iconProps.d.ts.map +1 -0
- package/dist/helpers/iconProps.js +33 -0
- package/dist/helpers/iconProps.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/hooks/useAutoFocus.d.ts.map +1 -1
- package/dist/hooks/useAutoFocus.js +11 -1
- package/dist/hooks/useAutoFocus.js.map +1 -1
- 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/useCombinedRefs.d.ts +16 -6
- package/dist/hooks/useCombinedRefs.d.ts.map +1 -1
- package/dist/hooks/useCombinedRefs.js +34 -27
- package/dist/hooks/useCombinedRefs.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 +11 -3
- package/dist/index.js.map +1 -1
- package/dist/styles.js +6 -6
- package/dist/styles.js.map +1 -1
- package/package.json +3 -4
- package/vitest.config.ts +117 -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,15 @@ 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");
|
|
79
88
|
var colors_2 = require("../../helpers/colors");
|
|
80
|
-
var
|
|
89
|
+
var SurfaceContext_1 = require("../../context/SurfaceContext");
|
|
90
|
+
var styled_1 = __importStar(require("../../helpers/styled"));
|
|
81
91
|
var utils_1 = require("../../helpers/utils");
|
|
92
|
+
var hoveringPointer_1 = require("../../helpers/hoveringPointer");
|
|
93
|
+
var iconProps_1 = require("../../helpers/iconProps");
|
|
82
94
|
var useCombinedRefs_1 = require("../../hooks/useCombinedRefs");
|
|
83
95
|
var useReqoreContext_1 = require("../../hooks/useReqoreContext");
|
|
84
96
|
var useFitTextSize_1 = require("../../hooks/useFitTextSize");
|
|
@@ -97,6 +109,7 @@ var Span_1 = require("../Span");
|
|
|
97
109
|
var TooltipComponent_1 = require("../TooltipComponent");
|
|
98
110
|
var LabelEditor_1 = require("./LabelEditor");
|
|
99
111
|
var NonResponsiveActions_1 = require("./NonResponsiveActions");
|
|
112
|
+
var surface_1 = require("./surface");
|
|
100
113
|
var getPaddingSize = function (padded, size) {
|
|
101
114
|
return typeof padded === 'string' ? sizes_1.SPECIAL_PADDING_FROM_SIZE[padded] : sizes_1.PADDING_FROM_SIZE[size];
|
|
102
115
|
};
|
|
@@ -145,12 +158,44 @@ var getScrollportInset = function (el) {
|
|
|
145
158
|
* opening a line box around the inline-flex heading — a block wrapper adds the row's leading on
|
|
146
159
|
* top of the heading's own box, which made a `tiny` panel 3px taller than it used to be.
|
|
147
160
|
*/
|
|
148
|
-
var StyledPanelTitleLabelBox =
|
|
161
|
+
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
162
|
var $clampLines = _a.$clampLines;
|
|
150
163
|
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
164
|
});
|
|
152
|
-
|
|
153
|
-
|
|
165
|
+
/**
|
|
166
|
+
* How much more than the title a group of actions that do not collapse takes of the room left over: so much
|
|
167
|
+
* that the title's box widens only once the group is at its own width (a flex item takes its grow factor's
|
|
168
|
+
* share of the free space, and the title's is 1).
|
|
169
|
+
*/
|
|
170
|
+
var ACTIONS_GROW_BEFORE_TITLE = 1000;
|
|
171
|
+
/**
|
|
172
|
+
* The flex of the group of actions that do not collapse, beside a title in a NARROW bar
|
|
173
|
+
* (qorus#646): sized from what the title leaves, between what its controls cannot do without and
|
|
174
|
+
* its own width. See where it is used. A wide bar leaves the group at its own width (`0 0 auto`),
|
|
175
|
+
* as it always was.
|
|
176
|
+
*/
|
|
177
|
+
var NARROW_ACTIONS_BESIDE_TITLE = {
|
|
178
|
+
flex: "".concat(ACTIONS_GROW_BEFORE_TITLE, " 1 0%"),
|
|
179
|
+
maxWidth: 'max-content',
|
|
180
|
+
};
|
|
181
|
+
/** The class of the bar's group of actions that do not collapse, which the title's fit measures. */
|
|
182
|
+
var NON_RESPONSIVE_ACTIONS_CLASS = 'reqore-panel-non-responsive-actions';
|
|
183
|
+
/**
|
|
184
|
+
* How much wider `element` is than the least it can be: its width less its min-content width, read
|
|
185
|
+
* with its flex and width set aside for the measurement and put back before anything is drawn.
|
|
186
|
+
*/
|
|
187
|
+
var getWidthAboveMinimum = function (element) {
|
|
188
|
+
var width = element.getBoundingClientRect().width;
|
|
189
|
+
var _a = element.style, flex = _a.flex, styleWidth = _a.width;
|
|
190
|
+
element.style.flex = '0 0 auto';
|
|
191
|
+
element.style.width = 'min-content';
|
|
192
|
+
var minimum = element.getBoundingClientRect().width;
|
|
193
|
+
element.style.flex = flex;
|
|
194
|
+
element.style.width = styleWidth;
|
|
195
|
+
return Math.max(0, width - minimum);
|
|
196
|
+
};
|
|
197
|
+
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"])));
|
|
198
|
+
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 /* Rendered as a link (labelProps.as), the title keeps the panel's text color: the browser's link blue is\n 1.1:1 on the dark theme. */\n color: inherit;\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 /* Rendered as a link (labelProps.as), the title keeps the panel's text color: the browser's link blue is\n 1.1:1 on the dark theme. */\n color: inherit;\n ", "\n flex: 0 1 auto;\n overflow: hidden;\n min-width: ", "px;\n"])), function (_a) {
|
|
154
199
|
var $hasOuterIcon = _a.$hasOuterIcon;
|
|
155
200
|
return ($hasOuterIcon ? 'grid' : 'flex');
|
|
156
201
|
}, function (_a) {
|
|
@@ -167,8 +212,8 @@ exports.StyledPanelTitleHeaderContent = styled_components_1.default.div(template
|
|
|
167
212
|
}
|
|
168
213
|
return width;
|
|
169
214
|
});
|
|
170
|
-
exports.StyledPanelTitleHeaderLabelAndDescription =
|
|
171
|
-
exports.StyledPanelTitleHeaderLabelAndBadge =
|
|
215
|
+
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"])));
|
|
216
|
+
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
217
|
/**
|
|
173
218
|
* Does the panel wrapper draw its 1px border?
|
|
174
219
|
*
|
|
@@ -191,55 +236,117 @@ var getPanelBorderBaseColor = function (theme, _a) {
|
|
|
191
236
|
var intent = _a.intent, accentPosition = _a.accentPosition;
|
|
192
237
|
return (intent && !accentPosition ? theme.intents[intent] : (0, colors_2.getMainBackgroundColor)(theme));
|
|
193
238
|
};
|
|
194
|
-
/**
|
|
195
|
-
*
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
239
|
+
/**
|
|
240
|
+
* Every panel prop that only styles or configures the panel. None of them reaches the rendered
|
|
241
|
+
* element — the `div`, re-resizable's `Resizable` (which spreads every prop it does not know onto
|
|
242
|
+
* its wrapper div), or a component given as `as`. The compiler checks the record against
|
|
243
|
+
* `IStyledPanel`, so a new prop that is not added here fails the build instead of leaking.
|
|
244
|
+
*
|
|
245
|
+
* re-resizable's own props (`size`, `enable`, `minWidth`, handles, ...) are not in it: they are
|
|
246
|
+
* the `Resizable`'s to receive. `opacity` is the surface's background opacity, an SVG attribute
|
|
247
|
+
* a `div` would keep.
|
|
248
|
+
*/
|
|
249
|
+
exports.REQORE_PANEL_STYLE_PROPS = (0, styled_1.listReqoreStyleProps)({
|
|
250
|
+
accentPosition: true,
|
|
251
|
+
actions: true,
|
|
252
|
+
badge: true,
|
|
253
|
+
blur: true,
|
|
254
|
+
bottomActions: true,
|
|
255
|
+
breadcrumbs: true,
|
|
256
|
+
closeButtonProps: true,
|
|
257
|
+
closePopover: true,
|
|
258
|
+
closeTooltip: true,
|
|
259
|
+
collapseButtonProps: true,
|
|
260
|
+
collapseTooltip: true,
|
|
261
|
+
collapsible: true,
|
|
262
|
+
compactTitle: true,
|
|
263
|
+
contentEffect: true,
|
|
264
|
+
contentSize: true,
|
|
265
|
+
contentStyle: true,
|
|
266
|
+
customLabelTooltip: true,
|
|
267
|
+
customTheme: true,
|
|
268
|
+
description: true,
|
|
269
|
+
descriptionEffect: true,
|
|
270
|
+
descriptionIntent: true,
|
|
271
|
+
descriptionMaxLines: true,
|
|
272
|
+
descriptionPosition: true,
|
|
273
|
+
disabled: true,
|
|
274
|
+
errorBoundaryOptions: true,
|
|
275
|
+
expandTooltip: true,
|
|
276
|
+
fill: true,
|
|
277
|
+
fitLabel: true,
|
|
278
|
+
flat: true,
|
|
279
|
+
floatingActions: true,
|
|
280
|
+
fluid: true,
|
|
281
|
+
getContentRef: true,
|
|
282
|
+
icon: true,
|
|
283
|
+
iconColor: true,
|
|
284
|
+
iconImage: true,
|
|
285
|
+
iconProps: true,
|
|
286
|
+
iconVerticalAlign: true,
|
|
287
|
+
iconWithLabel: true,
|
|
288
|
+
inheritCustomTheme: true,
|
|
289
|
+
intent: true,
|
|
290
|
+
isCollapsed: true,
|
|
291
|
+
isStuck: true,
|
|
292
|
+
label: true,
|
|
293
|
+
labelEffect: true,
|
|
294
|
+
labelMaxLines: true,
|
|
295
|
+
labelMinTextSize: true,
|
|
296
|
+
labelProps: true,
|
|
297
|
+
labelSize: true,
|
|
298
|
+
loading: true,
|
|
299
|
+
loadingIconType: true,
|
|
300
|
+
media: true,
|
|
301
|
+
mediaAlt: true,
|
|
302
|
+
mediaAspectRatio: true,
|
|
303
|
+
mediaPosition: true,
|
|
304
|
+
mediaProps: true,
|
|
305
|
+
minimal: true,
|
|
306
|
+
noHorizontalPadding: true,
|
|
307
|
+
onClose: true,
|
|
308
|
+
onCollapseChange: true,
|
|
309
|
+
onLabelEdit: true,
|
|
310
|
+
opacity: true,
|
|
311
|
+
padded: true,
|
|
312
|
+
radiusSize: true,
|
|
313
|
+
raised: true,
|
|
314
|
+
resizable: true,
|
|
315
|
+
responsiveActions: true,
|
|
316
|
+
responsiveActionsWrapperProps: true,
|
|
317
|
+
responsiveTitle: true,
|
|
318
|
+
rounded: true,
|
|
319
|
+
showActionsWhenCollapsed: true,
|
|
320
|
+
showLabelTooltip: true,
|
|
321
|
+
skeleton: true,
|
|
322
|
+
stickyHeader: true,
|
|
323
|
+
stickyHeaderInset: true,
|
|
324
|
+
stickyHeaderOffset: true,
|
|
325
|
+
theme: true,
|
|
326
|
+
tooltip: true,
|
|
327
|
+
transparent: true,
|
|
328
|
+
unMountContentOnCollapse: true,
|
|
329
|
+
wrapperPadding: true,
|
|
330
|
+
});
|
|
331
|
+
exports.StyledPanel = (0, styled_1.default)(Effect_1.StyledEffect).withConfig({
|
|
332
|
+
// Its own props, `interactive` (set by the panel for its hover styles) and the layout flags a
|
|
333
|
+
// containing ControlGroup hands it — except `size`, which a panel never forwards but a
|
|
334
|
+
// `Resizable` reads as its own.
|
|
335
|
+
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
336
|
})(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
337
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
231
|
-
return (0,
|
|
338
|
+
return (0, colors_2.fadeColor)((0, colors_2.changeDarkness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity);
|
|
232
339
|
}, function (_a) {
|
|
233
340
|
var rounded = _a.rounded, radiusSize = _a.radiusSize;
|
|
234
341
|
return rounded ? (0, sizes_1.resolveRadius)('normal', radiusSize) : 0;
|
|
235
342
|
}, function (_a) {
|
|
236
343
|
var theme = _a.theme, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition;
|
|
237
344
|
return hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition })
|
|
238
|
-
? "1px solid ".concat(
|
|
345
|
+
? "1px solid ".concat((0, colors_2.changeLightness)(getPanelBorderBaseColor(theme, { intent: intent, accentPosition: accentPosition }), 0.08))
|
|
239
346
|
: undefined;
|
|
240
347
|
}, function (_a) {
|
|
241
|
-
var theme = _a.theme;
|
|
242
|
-
return (0, colors_2.getReadableColor)(theme, undefined, undefined, true);
|
|
348
|
+
var theme = _a.theme, $color = _a.$color;
|
|
349
|
+
return $color !== null && $color !== void 0 ? $color : (0, colors_2.getReadableColor)(theme, undefined, undefined, true);
|
|
243
350
|
}, function (_a) {
|
|
244
351
|
var accentPosition = _a.accentPosition, _b = _a.$accentSize, $accentSize = _b === void 0 ? sizes_1.ACCENT_SIZE_TO_PX.normal : _b, theme = _a.theme, intent = _a.intent, flat = _a.flat, rounded = _a.rounded, radiusSize = _a.radiusSize, stickyHeader = _a.stickyHeader;
|
|
245
352
|
if (!accentPosition) {
|
|
@@ -283,9 +390,9 @@ exports.StyledPanel = (0, styled_components_1.default)(Effect_1.StyledEffect).wi
|
|
|
283
390
|
return interactive
|
|
284
391
|
? (0, styled_components_1.css)(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n cursor: pointer;\n\n &:hover {\n ", " ", " .reqore-panel-title-icon {\n transform: scale(", ");\n }\n\n background-color: ", ";\n\n border-color: ", ";\n\n ", "\n }\n "], ["\n cursor: pointer;\n\n &:hover {\n ", " ", " .reqore-panel-title-icon {\n transform: scale(", ");\n }\n\n background-color: ", ";\n\n border-color: ", ";\n\n ", "\n }\n "])), exports.StyledPanelTitle, exports.StyledPanelTitleHeaderContent, styles_1.ACTIVE_ICON_SCALE, opacity === 0 && flat
|
|
285
392
|
? undefined
|
|
286
|
-
: (0,
|
|
287
|
-
?
|
|
288
|
-
: undefined, opacity !== 0 && (0, styled_components_1.css)(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n ", ":after {\n background: linear-gradient(\n to top,\n ", "\n 0%,\n transparent 100%\n );\n }\n "], ["\n ", ":after {\n background: linear-gradient(\n to top,\n ", "\n 0%,\n transparent 100%\n );\n }\n "])), item_1.StyledCollectionItemContent, (0,
|
|
393
|
+
: (0, colors_2.fadeColor)((0, polished_1.darken)(0.025, (0, colors_2.changeDarkness)((0, colors_2.getMainBackgroundColor)(theme), 0.03)), opacity), hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition })
|
|
394
|
+
? (0, colors_2.changeLightness)(getPanelBorderBaseColor(theme, { intent: intent, accentPosition: accentPosition }), 0.25)
|
|
395
|
+
: undefined, opacity !== 0 && (0, styled_components_1.css)(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n ", ":after {\n background: linear-gradient(\n to top,\n ", "\n 0%,\n transparent 100%\n );\n }\n "], ["\n ", ":after {\n background: linear-gradient(\n to top,\n ", "\n 0%,\n transparent 100%\n );\n }\n "])), item_1.StyledCollectionItemContent, (0, colors_2.fadeColor)((0, polished_1.darken)(0.025, (0, colors_2.changeDarkness)((0, colors_2.getMainBackgroundColor)(theme), 0.03)), opacity))) : undefined;
|
|
289
396
|
}, function (_a) {
|
|
290
397
|
var raised = _a.raised, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition;
|
|
291
398
|
return raised && !hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition }) && styles_1.RaisedElement;
|
|
@@ -297,7 +404,7 @@ exports.StyledPanel = (0, styled_components_1.default)(Effect_1.StyledEffect).wi
|
|
|
297
404
|
var disabled = _a.disabled;
|
|
298
405
|
return disabled && styles_1.DisabledElement;
|
|
299
406
|
});
|
|
300
|
-
exports.StyledPanelTitle =
|
|
407
|
+
exports.StyledPanelTitle = styled_1.default.div.withConfig({
|
|
301
408
|
shouldForwardProp: (0, styled_1.omitStyleProps)('opacity'),
|
|
302
409
|
})(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
410
|
var $descriptionBelow = _a.$descriptionBelow;
|
|
@@ -313,23 +420,23 @@ exports.StyledPanelTitle = styled_components_1.default.div.withConfig({
|
|
|
313
420
|
return !!$descriptionMaxLines && (0, styled_components_1.css)(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n .reqore-panel-title-description {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ", ";\n overflow: hidden;\n white-space: normal;\n overflow-wrap: anywhere;\n }\n "], ["\n .reqore-panel-title-description {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ", ";\n overflow: hidden;\n white-space: normal;\n overflow-wrap: anywhere;\n }\n "])), $descriptionMaxLines);
|
|
314
421
|
}, function (_a) {
|
|
315
422
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
316
|
-
return (0,
|
|
423
|
+
return (0, colors_2.fadeColor)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity);
|
|
317
424
|
}, function (_a) {
|
|
318
425
|
var noHorizontalPadding = _a.noHorizontalPadding, size = _a.size, padded = _a.padded, opacity = _a.opacity, flat = _a.flat, intent = _a.intent;
|
|
319
426
|
return "".concat(opacity === 0 && flat && !intent ? 0 : getPaddingSize(padded, size), "px ").concat(noHorizontalPadding ? 0 : "".concat(getPaddingSize(padded, size), "px"));
|
|
320
427
|
}, function (_a) {
|
|
321
428
|
var theme = _a.theme, isCollapsed = _a.isCollapsed, flat = _a.flat, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
322
429
|
return !isCollapsed && !flat && opacity
|
|
323
|
-
? "1px solid ".concat((0,
|
|
430
|
+
? "1px solid ".concat((0, colors_2.fadeColor)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.08), opacity))
|
|
324
431
|
: null;
|
|
325
432
|
}, sizes_1.GAP_FROM_SIZE.normal, exports.StyledPanelTitleHeaderContent, styles_1.INACTIVE_ICON_SCALE, function (_a) {
|
|
326
433
|
var collapsible = _a.collapsible;
|
|
327
434
|
return collapsible && (0, styled_components_1.css)(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n cursor: pointer;\n &:hover {\n ", " .reqore-panel-title-icon {\n transform: scale(", ");\n }\n\n background-color: ", ";\n }\n "], ["\n cursor: pointer;\n &:hover {\n ", " .reqore-panel-title-icon {\n transform: scale(", ");\n }\n\n background-color: ", ";\n }\n "])), exports.StyledPanelTitleHeaderContent, styles_1.ACTIVE_ICON_SCALE, function (_a) {
|
|
328
435
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
329
|
-
return (0,
|
|
436
|
+
return (0, colors_2.fadeColor)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.05), opacity);
|
|
330
437
|
});
|
|
331
438
|
});
|
|
332
|
-
exports.StyledPanelTopBar = (0,
|
|
439
|
+
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
440
|
var padded = _a.padded, size = _a.size, isCollapsed = _a.isCollapsed, minimal = _a.minimal;
|
|
334
441
|
return !padded || isCollapsed || !minimal
|
|
335
442
|
? "".concat(getPaddingSize(padded, size), "px")
|
|
@@ -370,13 +477,13 @@ exports.StyledPanelTopBar = (0, styled_components_1.default)(exports.StyledPanel
|
|
|
370
477
|
: undefined;
|
|
371
478
|
}, function (_a) {
|
|
372
479
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
373
|
-
return (0,
|
|
480
|
+
return (0, colors_2.fadeColor)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity);
|
|
374
481
|
}, function (_a) {
|
|
375
482
|
var stickyHeader = _a.stickyHeader, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
376
483
|
return stickyHeader &&
|
|
377
484
|
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
485
|
});
|
|
379
|
-
exports.StyledPanelBottomActions = (0,
|
|
486
|
+
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
487
|
var padded = _a.padded, size = _a.size, minimal = _a.minimal;
|
|
381
488
|
return !padded || !minimal
|
|
382
489
|
? "".concat(getPaddingSize(padded, size), "px")
|
|
@@ -393,10 +500,10 @@ exports.StyledPanelBottomActions = (0, styled_components_1.default)(exports.Styl
|
|
|
393
500
|
}, function (_a) {
|
|
394
501
|
var theme = _a.theme, flat = _a.flat, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
395
502
|
return !flat
|
|
396
|
-
? "1px solid ".concat((0,
|
|
503
|
+
? "1px solid ".concat((0, colors_2.fadeColor)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.08), opacity))
|
|
397
504
|
: null;
|
|
398
505
|
});
|
|
399
|
-
exports.StyledPanelContent =
|
|
506
|
+
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
507
|
var isCollapsed = _a.isCollapsed;
|
|
401
508
|
return (isCollapsed ? 'none !important' : undefined);
|
|
402
509
|
}, function (_a) {
|
|
@@ -413,7 +520,7 @@ exports.StyledPanelContent = styled_components_1.default.div(templateObject_29 |
|
|
|
413
520
|
/** The media frame. Its outer corners take the panel's inner curve, so the media is clipped to
|
|
414
521
|
* the panel's shape even where the panel cannot clip it (a sticky header makes the panel
|
|
415
522
|
* overflow visible). */
|
|
416
|
-
exports.StyledPanelMedia =
|
|
523
|
+
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
524
|
var $position = _a.$position, $radius = _a.$radius;
|
|
418
525
|
return $position === 'top'
|
|
419
526
|
? (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,12 +528,12 @@ exports.StyledPanelMedia = styled_components_1.default.div(templateObject_33 ||
|
|
|
421
528
|
var $aspectRatio = _a.$aspectRatio;
|
|
422
529
|
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
530
|
});
|
|
424
|
-
exports.StyledFloatingActions =
|
|
531
|
+
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
532
|
var size = _a.size;
|
|
426
533
|
return sizes_1.PADDING_FROM_SIZE[size];
|
|
427
534
|
}, function (_a) {
|
|
428
535
|
var theme = _a.theme;
|
|
429
|
-
return (0, polished_1.rgba)((0, colors_2.
|
|
536
|
+
return (0, polished_1.rgba)((0, colors_2.changeDarkness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), 1);
|
|
430
537
|
}, function (_a) {
|
|
431
538
|
var theme = _a.theme, flat = _a.flat, intent = _a.intent;
|
|
432
539
|
return flat && !intent
|
|
@@ -448,13 +555,15 @@ exports.ReqorePanelSkeleton = (0, react_2.memo)(function (_a) {
|
|
|
448
555
|
return ((0, jsx_runtime_1.jsxs)(ControlGroup_1.default, { vertical: true, fluid: true, gapSize: 'big', style: style, children: [(0, jsx_runtime_1.jsxs)(ControlGroup_1.default, { spaceBetween: true, fluid: true, children: [(0, jsx_runtime_1.jsxs)(ControlGroup_1.default, { fixed: true, gapSize: 'big', children: [(0, jsx_runtime_1.jsx)(Skeleton_1.ReqoreSkeleton, { circle: true, size: size }), (0, jsx_runtime_1.jsx)(Skeleton_1.ReqoreSkeleton, { width: '200px', size: size })] }), (0, jsx_runtime_1.jsxs)(ControlGroup_1.default, { fixed: true, children: [(0, jsx_runtime_1.jsx)(Skeleton_1.ReqoreSkeleton, { size: size }), (0, jsx_runtime_1.jsx)(Skeleton_1.ReqoreSkeleton, { size: size })] })] }), !isCollapsed &&
|
|
449
556
|
(children ? (children) : ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, { vertical: true, children: (0, jsx_runtime_1.jsx)(Skeleton_1.ReqoreSkeleton, { lines: 5, width: '100%', size: 'tiny' }) })))] }));
|
|
450
557
|
});
|
|
558
|
+
/** A description given no effect: one object, so what is made from it holds from render to render. */
|
|
559
|
+
var NO_DESCRIPTION_EFFECT = {};
|
|
451
560
|
exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
452
|
-
var _b, _c;
|
|
453
|
-
var children = _a.children, label = _a.label, description = _a.description,
|
|
561
|
+
var _b, _c, _d;
|
|
562
|
+
var children = _a.children, label = _a.label, description = _a.description, _e = _a.collapseButtonProps, collapseButtonProps = _e === void 0 ? {} : _e, collapsible = _a.collapsible, onClose = _a.onClose, _f = _a.closeButtonProps, closeButtonProps = _f === void 0 ? {} : _f, _g = _a.rounded, rounded = _g === void 0 ? true : _g, _h = _a.actions, actions = _h === void 0 ? [] : _h, _j = _a.bottomActions, bottomActions = _j === void 0 ? [] : _j, isCollapsed = _a.isCollapsed, customTheme = _a.customTheme, inheritCustomTheme = _a.inheritCustomTheme, icon = _a.icon, iconImage = _a.iconImage, _k = _a.iconWithLabel, iconWithLabel = _k === void 0 ? false : _k, _l = _a.iconVerticalAlign, iconVerticalAlign = _l === void 0 ? 'center' : _l, intent = _a.intent, className = _a.className, flat = _a.flat, _m = _a.unMountContentOnCollapse, unMountContentOnCollapse = _m === void 0 ? true : _m, onCollapseChange = _a.onCollapseChange, _o = _a.padded, padded = _o === void 0 ? true : _o, _p = _a.wrapperPadding, wrapperPadding = _p === void 0 ? 'both' : _p, contentStyle = _a.contentStyle, contentEffect = _a.contentEffect, _q = _a.labelEffect, labelEffect = _q === void 0 ? {} : _q, _r = _a.descriptionEffect, descriptionEffect = _r === void 0 ? NO_DESCRIPTION_EFFECT : _r, descriptionIntent = _a.descriptionIntent, labelSize = _a.labelSize, contentSize = _a.contentSize, minimal = _a.minimal, badge = _a.badge, iconColor = _a.iconColor, _s = _a.iconProps, iconProps = _s === void 0 ? {} : _s, fluid = _a.fluid, _t = _a.responsiveActions, responsiveActions = _t === void 0 ? true : _t, _u = _a.responsiveTitle, responsiveTitle = _u === void 0 ? true : _u, _v = _a.compactTitle, compactTitle = _v === void 0 ? false : _v, _w = _a.fitLabel, fitLabel = _w === void 0 ? true : _w, _x = _a.labelMaxLines, labelMaxLines = _x === void 0 ? 2 : _x, _y = _a.descriptionPosition, descriptionPosition = _y === void 0 ? 'inline' : _y, _z = _a.descriptionMaxLines, descriptionMaxLines = _z === void 0 ? 2 : _z, labelMinTextSize = _a.labelMinTextSize, _0 = _a.size, panelSize = _0 === void 0 ? 'normal' : _0, getContentRef = _a.getContentRef, _1 = _a.labelProps, labelProps = _1 === void 0 ? {} : _1, disabled = _a.disabled, breadcrumbs = _a.breadcrumbs, _2 = _a.showActionsWhenCollapsed, showActionsWhenCollapsed = _2 === void 0 ? true : _2, 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, _3 = _a.collapseTooltip, collapseTooltip = _3 === void 0 ? 'Collapse' : _3, _4 = _a.expandTooltip, expandTooltip = _4 === void 0 ? 'Expand' : _4, _5 = _a.closeTooltip, closeTooltip = _5 === void 0 ? 'Close' : _5, accentPosition = _a.accentPosition, accentSize = _a.accentSize, media = _a.media, _6 = _a.mediaAlt, mediaAlt = _6 === void 0 ? '' : _6, _7 = _a.mediaPosition, mediaPosition = _7 === void 0 ? 'top' : _7, 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
563
|
// Resolved ONCE, here — the accent styles interpolate px and reserve padding,
|
|
455
564
|
// so they must only ever see a number. Shared with ReqoreCallout.
|
|
456
565
|
var accentSizePx = (0, react_2.useMemo)(function () { return (0, utils_1.resolveAccentSize)(accentSize); }, [accentSize]);
|
|
457
|
-
var
|
|
566
|
+
var _8 = (0, react_2.useState)(isCollapsed || false), _isCollapsed = _8[0], setIsCollapsed = _8[1];
|
|
458
567
|
var primaryContentGradient = (0, Effect_1.getPrimaryGradient)(contentEffect === null || contentEffect === void 0 ? void 0 : contentEffect.gradient);
|
|
459
568
|
var primaryContentColors = primaryContentGradient && typeof primaryContentGradient.colors === 'object'
|
|
460
569
|
? primaryContentGradient.colors
|
|
@@ -471,9 +580,14 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
471
580
|
};
|
|
472
581
|
}, []);
|
|
473
582
|
var isMobile = (0, useReqoreContext_1.useReqoreProperty)('isMobile');
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
583
|
+
/* Floating actions are a hover's. Where the device cannot hover (a phone, a tablet), nothing
|
|
584
|
+
would ever float them, so its hover actions stay in the panel's own bar, shown (see the
|
|
585
|
+
hover gate on StyledPanel). */
|
|
586
|
+
var isHoverCapable = (0, useReqoreContext_1.useReqoreProperty)('isHoverCapable');
|
|
587
|
+
var floatingActions = !!floatingActionsProp && isHoverCapable !== false;
|
|
588
|
+
var setRef = (0, useCombinedRefs_1.useCombinedRefs)(ref).setRef;
|
|
589
|
+
var _9 = (0, react_use_1.useMeasure)(), measureRef = _9[0], width = _9[1].width;
|
|
590
|
+
var _10 = (0, react_2.useState)(false), _isHovered = _10[0], setIsHovered = _10[1];
|
|
477
591
|
var floatingActionsRef = (0, react_2.useRef)(null);
|
|
478
592
|
var panelRef = (0, react_2.useRef)(null);
|
|
479
593
|
var hoverTimerRef = (0, react_2.useRef)(null);
|
|
@@ -491,8 +605,8 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
491
605
|
// triggers it. Only wired when `stickyHeader` is on, so ordinary panels pay
|
|
492
606
|
// nothing.
|
|
493
607
|
var stickySentinelRef = (0, react_2.useRef)(null);
|
|
494
|
-
var
|
|
495
|
-
var
|
|
608
|
+
var _11 = (0, react_2.useState)(false), isHeaderStuck = _11[0], setIsHeaderStuck = _11[1];
|
|
609
|
+
var _12 = (0, react_2.useState)(0), stickyInset = _12[0], setStickyInset = _12[1];
|
|
496
610
|
(0, react_2.useEffect)(function () {
|
|
497
611
|
var _a;
|
|
498
612
|
if (!rest.stickyHeader) {
|
|
@@ -574,23 +688,67 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
574
688
|
floatingActionsRef.current.style.top = "".concat(panelRect.top - floatingRect.height + (flat ? 0 : 1), "px");
|
|
575
689
|
floatingActionsRef.current.style.left = "".concat(panelRect.right - floatingRect.width, "px");
|
|
576
690
|
}, [flat]);
|
|
691
|
+
var showsFloatingActions = _isHovered && !!floatingActions && (0, lodash_1.size)(floatingActionsList) > 0;
|
|
692
|
+
// placed as they are shown, and again whenever the actions change
|
|
693
|
+
(0, react_2.useEffect)(function () {
|
|
694
|
+
if (showsFloatingActions)
|
|
695
|
+
updateFloatingActionsPosition();
|
|
696
|
+
}, [showsFloatingActions, floatingActionsList, updateFloatingActionsPosition]);
|
|
697
|
+
/* ...and again whenever what they are placed by moves: the actions are fixed to the screen, placed
|
|
698
|
+
* by the panel's corner and their own size, so nothing follows on its own. A page that scrolls, a
|
|
699
|
+
* screen or window that resizes, a panel that grows or shrinks, and actions whose content changes
|
|
700
|
+
* width (a label, an icon or a font that loads) each moved the panel's corner or the actions' size
|
|
701
|
+
* without placing them again: they were left where the panel had been - mid-screen once the window
|
|
702
|
+
* widened - or reached past the panel's edge once they widened. One placement per frame, however
|
|
703
|
+
* many of these come in; none once they are hidden or the panel is gone. */
|
|
577
704
|
(0, react_2.useEffect)(function () {
|
|
578
|
-
if (!
|
|
705
|
+
if (!showsFloatingActions)
|
|
579
706
|
return undefined;
|
|
580
|
-
|
|
581
|
-
var
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
707
|
+
var frame = 0;
|
|
708
|
+
var schedule = function () {
|
|
709
|
+
if (!frame) {
|
|
710
|
+
frame = requestAnimationFrame(function () {
|
|
711
|
+
frame = 0;
|
|
712
|
+
updateFloatingActionsPosition();
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
};
|
|
716
|
+
window.addEventListener('scroll', schedule, true);
|
|
717
|
+
window.addEventListener('resize', schedule, { passive: true });
|
|
718
|
+
var observer = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(schedule) : undefined;
|
|
719
|
+
if (observer) {
|
|
720
|
+
if (panelRef.current)
|
|
721
|
+
observer.observe(panelRef.current);
|
|
722
|
+
if (floatingActionsRef.current)
|
|
723
|
+
observer.observe(floatingActionsRef.current);
|
|
724
|
+
}
|
|
725
|
+
return function () {
|
|
726
|
+
window.removeEventListener('scroll', schedule, true);
|
|
727
|
+
window.removeEventListener('resize', schedule);
|
|
728
|
+
observer === null || observer === void 0 ? void 0 : observer.disconnect();
|
|
729
|
+
if (frame)
|
|
730
|
+
cancelAnimationFrame(frame);
|
|
731
|
+
};
|
|
732
|
+
}, [showsFloatingActions, updateFloatingActionsPosition]);
|
|
733
|
+
/* The floating actions are a hover's: a finger's tap - and the `mouseenter` a browser emulates after it -
|
|
734
|
+
shows none (see `createHoverGate`). Where a finger is the primary pointer (`isHoverCapable` false) the
|
|
735
|
+
actions are in the panel's own bar instead (`floatingActions` is off, above), and on a touch laptop its
|
|
736
|
+
tap left them floating until the next. */
|
|
737
|
+
var hoverGate = (0, hoveringPointer_1.useHoverGate)();
|
|
738
|
+
var handlePointerEnter = (0, react_2.useCallback)(function (e) {
|
|
739
|
+
var _a;
|
|
740
|
+
hoverGate.notePointer(e);
|
|
741
|
+
(_a = rest.onPointerEnter) === null || _a === void 0 ? void 0 : _a.call(rest, e);
|
|
742
|
+
}, [hoverGate, rest.onPointerEnter]);
|
|
585
743
|
var handleMouseEnter = (0, react_2.useCallback)(function (e) {
|
|
586
744
|
var _a;
|
|
587
|
-
if (floatingActions) {
|
|
745
|
+
if (floatingActions && hoverGate.isHover()) {
|
|
588
746
|
if (hoverTimerRef.current)
|
|
589
747
|
clearTimeout(hoverTimerRef.current);
|
|
590
748
|
hoverTimerRef.current = setTimeout(function () { return setIsHovered(true); }, 150);
|
|
591
749
|
}
|
|
592
750
|
(_a = rest.onMouseEnter) === null || _a === void 0 ? void 0 : _a.call(rest, e);
|
|
593
|
-
}, [floatingActions, rest.onMouseEnter]);
|
|
751
|
+
}, [floatingActions, rest.onMouseEnter, hoverGate]);
|
|
594
752
|
var cancelHover = (0, react_2.useCallback)(function () {
|
|
595
753
|
if (hoverTimerRef.current) {
|
|
596
754
|
clearTimeout(hoverTimerRef.current);
|
|
@@ -598,6 +756,59 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
598
756
|
}
|
|
599
757
|
setIsHovered(false);
|
|
600
758
|
}, []);
|
|
759
|
+
/* The way from the panel to its floating actions.
|
|
760
|
+
*
|
|
761
|
+
* The actions float above the panel's top-right corner, so a pointer heading for
|
|
762
|
+
* them from inside the panel leaves the panel through its top edge - usually to the
|
|
763
|
+
* LEFT of the actions, on a diagonal - and passes over what lies above the panel
|
|
764
|
+
* before it reaches them. Ending the hover the moment the pointer left the panel
|
|
765
|
+
* hid the actions on that way, and the click meant for them landed on what they had
|
|
766
|
+
* been covering (in reqraft's expression editor: the Visual / Text switch, so
|
|
767
|
+
* "Remove" switched the view instead).
|
|
768
|
+
*
|
|
769
|
+
* So while the pointer is in the strip between the panel's top edge and the top of
|
|
770
|
+
* the actions, across the panel's width, the hover stays; it ends when the pointer
|
|
771
|
+
* leaves that strip for anything that is neither the panel nor the actions. Decided
|
|
772
|
+
* by where the pointer IS, on each move - no timer to guess the time a person needs. */
|
|
773
|
+
var corridorUntrackRef = (0, react_2.useRef)(null);
|
|
774
|
+
var stopCorridor = (0, react_2.useCallback)(function () {
|
|
775
|
+
var _a;
|
|
776
|
+
(_a = corridorUntrackRef.current) === null || _a === void 0 ? void 0 : _a.call(corridorUntrackRef);
|
|
777
|
+
corridorUntrackRef.current = null;
|
|
778
|
+
}, []);
|
|
779
|
+
var inCorridor = (0, react_2.useCallback)(function (x, y) {
|
|
780
|
+
if (!panelRef.current || !floatingActionsRef.current)
|
|
781
|
+
return false;
|
|
782
|
+
if (floatingActionsRef.current.style.display === 'none')
|
|
783
|
+
return false;
|
|
784
|
+
var panelRect = panelRef.current.getBoundingClientRect();
|
|
785
|
+
var actionsRect = floatingActionsRef.current.getBoundingClientRect();
|
|
786
|
+
return (x >= Math.min(panelRect.left, actionsRect.left) &&
|
|
787
|
+
x <= Math.max(panelRect.right, actionsRect.right) &&
|
|
788
|
+
y >= actionsRect.top &&
|
|
789
|
+
y <= panelRect.top + 1);
|
|
790
|
+
}, []);
|
|
791
|
+
var followCorridor = (0, react_2.useCallback)(function () {
|
|
792
|
+
stopCorridor();
|
|
793
|
+
var onMove = function (event) {
|
|
794
|
+
var _a, _b;
|
|
795
|
+
var target = event.target instanceof Node ? event.target : null;
|
|
796
|
+
// reached the actions or came back into the panel: their own handlers take over
|
|
797
|
+
if (target &&
|
|
798
|
+
(((_a = floatingActionsRef.current) === null || _a === void 0 ? void 0 : _a.contains(target)) || ((_b = panelRef.current) === null || _b === void 0 ? void 0 : _b.contains(target)))) {
|
|
799
|
+
stopCorridor();
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
if (!inCorridor(event.clientX, event.clientY)) {
|
|
803
|
+
stopCorridor();
|
|
804
|
+
cancelHover();
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
document.addEventListener('mousemove', onMove, true);
|
|
808
|
+
corridorUntrackRef.current = function () { return document.removeEventListener('mousemove', onMove, true); };
|
|
809
|
+
}, [cancelHover, inCorridor, stopCorridor]);
|
|
810
|
+
// a corridor followed when the panel goes is followed no more
|
|
811
|
+
(0, react_2.useEffect)(function () { return stopCorridor; }, [stopCorridor]);
|
|
601
812
|
var handleMouseLeave = (0, react_2.useCallback)(function (e) {
|
|
602
813
|
var _a;
|
|
603
814
|
if (floatingActions) {
|
|
@@ -607,10 +818,15 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
607
818
|
floatingActionsRef.current.contains(relatedTarget)) {
|
|
608
819
|
return;
|
|
609
820
|
}
|
|
610
|
-
|
|
821
|
+
if (_isHovered && inCorridor(e.clientX, e.clientY)) {
|
|
822
|
+
followCorridor();
|
|
823
|
+
}
|
|
824
|
+
else {
|
|
825
|
+
cancelHover();
|
|
826
|
+
}
|
|
611
827
|
}
|
|
612
828
|
(_a = rest.onMouseLeave) === null || _a === void 0 ? void 0 : _a.call(rest, e);
|
|
613
|
-
}, [floatingActions, rest.onMouseLeave, cancelHover]);
|
|
829
|
+
}, [floatingActions, rest.onMouseLeave, cancelHover, _isHovered, inCorridor, followCorridor]);
|
|
614
830
|
var handleFloatingActionsMouseLeave = (0, react_2.useCallback)(function (e) {
|
|
615
831
|
var relatedTarget = e.relatedTarget;
|
|
616
832
|
if (panelRef.current &&
|
|
@@ -618,8 +834,13 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
618
834
|
panelRef.current.contains(relatedTarget)) {
|
|
619
835
|
return;
|
|
620
836
|
}
|
|
837
|
+
// back towards the panel through the strip between them
|
|
838
|
+
if (inCorridor(e.clientX, e.clientY)) {
|
|
839
|
+
followCorridor();
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
621
842
|
cancelHover();
|
|
622
|
-
}, [cancelHover]);
|
|
843
|
+
}, [cancelHover, inCorridor, followCorridor]);
|
|
623
844
|
/* The panel renders as re-resizable's `Resizable` when it is resizable — unless the caller
|
|
624
845
|
gave its own element in `as`, which always wins. (`rest.as || cond ? Resizable : 'div'`
|
|
625
846
|
binds as `(rest.as || cond) ? …`, so a panel given `as` used to render a `Resizable`.) */
|
|
@@ -826,6 +1047,37 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
826
1047
|
}, [intent, theme, contentEffect, interactive]);
|
|
827
1048
|
var opacity = rest.transparent ? 0 : rest.opacity;
|
|
828
1049
|
var noHorizontalPadding = opacity === 0 && flat && !intent && !rest.raised;
|
|
1050
|
+
/* What the panel holds is drawn on the panel - its content on the panel's background, its
|
|
1051
|
+
title bar and bottom actions on the bar's - and is told so, to pick its text and icons
|
|
1052
|
+
against that rather than the page. */
|
|
1053
|
+
var aroundSurface = (0, SurfaceContext_1.useReqoreSurface)();
|
|
1054
|
+
// a panel drawn at no opacity is on what is around it: what a component there says, or its customTheme's main
|
|
1055
|
+
var surface = (0, react_2.useMemo)(function () { return (0, surface_1.getUnpaintedSurface)(theme, customTheme, aroundSurface, opacity === 0); }, [theme, customTheme, aroundSurface, opacity]);
|
|
1056
|
+
var contentSurface = (0, react_2.useMemo)(function () {
|
|
1057
|
+
return (0, colors_2.getDrawnColor)((0, colors_2.fadeColor)((0, colors_2.changeDarkness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity !== null && opacity !== void 0 ? opacity : 1), (0, colors_2.getThemeSurface)(theme, surface));
|
|
1058
|
+
}, [theme, opacity, surface]);
|
|
1059
|
+
/* each color of the content's gradient, when its effect draws one: for as long as its colors hold, not the
|
|
1060
|
+
effect object - one given inline is new on every render, and so was every surface the panel hands down */
|
|
1061
|
+
var contentGradientKey = JSON.stringify((_b = transformedContentEffect === null || transformedContentEffect === void 0 ? void 0 : transformedContentEffect.gradient) !== null && _b !== void 0 ? _b : null);
|
|
1062
|
+
var contentSurfaces = (0, react_2.useMemo)(function () {
|
|
1063
|
+
return (0, Effect_1.getEffectBackgrounds)(theme, transformedContentEffect, contentSurface, (0, colors_2.getThemeSurface)(theme, surface));
|
|
1064
|
+
}, [theme, contentGradientKey, contentSurface, surface]);
|
|
1065
|
+
var barSurface = (0, react_2.useMemo)(function () {
|
|
1066
|
+
return contentSurfaces.map(function (under) {
|
|
1067
|
+
return (0, colors_2.getDrawnColor)((0, colors_2.fadeColor)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), minimal ? 0 : (opacity !== null && opacity !== void 0 ? opacity : 1)), under);
|
|
1068
|
+
});
|
|
1069
|
+
}, [theme, minimal, opacity, contentSurfaces]);
|
|
1070
|
+
// The bar's description and icon fade only as far as they stay readable there.
|
|
1071
|
+
var barText = (0, react_2.useMemo)(function () { return (0, colors_2.getReadableTextOn)(theme, barSurface); }, [theme, barSurface]);
|
|
1072
|
+
/* Drawn at less than full opacity, the panel's own text (what it holds that sets no color of its own) is read
|
|
1073
|
+
on what its content is drawn on, as what it holds is - not on the theme's main, which it barely paints. */
|
|
1074
|
+
var panelText = (0, react_2.useMemo)(function () {
|
|
1075
|
+
return opacity !== undefined && opacity < 1 ? (0, colors_2.getReadableTextOn)(theme, contentSurfaces) : undefined;
|
|
1076
|
+
}, [theme, opacity, contentSurfaces]);
|
|
1077
|
+
// the title icon's own color: in its props (which win, as they are spread over the rest), else the panel's
|
|
1078
|
+
var _13 = (0, iconProps_1.splitIconColor)(iconProps), titleIconPropsColor = _13[0], titleIconRest = _13[1];
|
|
1079
|
+
var titleIconOwn = titleIconPropsColor || iconColor;
|
|
1080
|
+
var titleIconLook = (0, react_2.useMemo)(function () { return (0, colors_2.getReadableIconLook)(theme, barSurface, barText, colors_1.CONTROL_ICON_OPACITY, titleIconOwn); }, [theme, barSurface, barText, titleIconOwn]);
|
|
829
1081
|
// The media frame's outer corners follow the panel's INNER curve: its radius, less the 1px
|
|
830
1082
|
// border when it draws one — the same inset the sticky header and the accent strip take.
|
|
831
1083
|
var mediaRadius = rounded
|
|
@@ -857,7 +1109,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
857
1109
|
* The title's natural size in px, from the heading level it renders at — the same
|
|
858
1110
|
* `labelSize || HEADER_SIZE_TO_NUMBER[panelSize]` the icon is sized from.
|
|
859
1111
|
*/
|
|
860
|
-
var labelNaturalPx = (
|
|
1112
|
+
var labelNaturalPx = (_c = sizes_1.HEADER_LEVEL_TO_PX[labelSize || sizes_1.HEADER_SIZE_TO_NUMBER[panelSize]]) !== null && _c !== void 0 ? _c : sizes_1.HEADER_LEVEL_TO_PX[3];
|
|
861
1113
|
/**
|
|
862
1114
|
* SECOND thing to give: the title's size. Once the actions are down to icons and the
|
|
863
1115
|
* row is still short, the title shrinks toward a floor rather than dropping characters
|
|
@@ -887,8 +1139,8 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
887
1139
|
* way it always has. When it IS cut, that same click must not reach the bar — opening the
|
|
888
1140
|
* text and folding the panel away in one gesture is the worst of both.
|
|
889
1141
|
*/
|
|
890
|
-
var
|
|
891
|
-
var
|
|
1142
|
+
var _14 = (0, react_2.useState)(false), isDescriptionExpanded = _14[0], setIsDescriptionExpanded = _14[1];
|
|
1143
|
+
var _15 = (0, react_2.useState)(false), isDescriptionTruncated = _15[0], setIsDescriptionTruncated = _15[1];
|
|
892
1144
|
var descriptionRef = (0, react_2.useRef)(null);
|
|
893
1145
|
var descriptionIsClamped = descriptionClamp > 0 && !isDescriptionExpanded;
|
|
894
1146
|
(0, react_2.useLayoutEffect)(function () {
|
|
@@ -905,9 +1157,23 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
905
1157
|
event.stopPropagation();
|
|
906
1158
|
setIsDescriptionExpanded(function (expanded) { return !expanded; });
|
|
907
1159
|
}, [descriptionIsInteractive]);
|
|
1160
|
+
/* Dimmer than the title, as far as it stays readable on the bar: the color it is drawn in - its effect's
|
|
1161
|
+
(where the theme can resolve it), its intent's, else the bar's text - at 0.7, or as much more as it needs.
|
|
1162
|
+
An opacity the caller gives is the caller's, as given. Worked out only for a description there is. */
|
|
1163
|
+
var descriptionLook = (0, react_2.useMemo)(function () {
|
|
1164
|
+
if (!description || descriptionEffect.opacity !== undefined) {
|
|
1165
|
+
return descriptionEffect;
|
|
1166
|
+
}
|
|
1167
|
+
var drawn = descriptionEffect.color
|
|
1168
|
+
? (0, surface_1.getDrawnEffectTextColor)(theme, descriptionEffect.color, barSurface)
|
|
1169
|
+
: descriptionIntent
|
|
1170
|
+
? (0, colors_2.getReadableIntentColor)(theme, descriptionIntent, undefined, barSurface)
|
|
1171
|
+
: undefined;
|
|
1172
|
+
return __assign(__assign({}, descriptionEffect), { opacity: (0, colors_2.getReadableAlpha)(drawn !== null && drawn !== void 0 ? drawn : barText, barSurface, 0.7) });
|
|
1173
|
+
}, [description, descriptionEffect, descriptionIntent, theme, barSurface, barText]);
|
|
908
1174
|
/** Shared by both places the description can render — inline with the title, or on its
|
|
909
1175
|
* own row below — so the two cannot drift apart. */
|
|
910
|
-
var descriptionProps = __assign({ ref: descriptionRef, className: 'reqore-panel-title-description', size: panelSize, effect:
|
|
1176
|
+
var descriptionProps = __assign({ ref: descriptionRef, className: 'reqore-panel-title-description', size: panelSize, effect: descriptionLook, intent: descriptionIntent, onClick: handleDescriptionClick }, (descriptionIsInteractive
|
|
911
1177
|
? {
|
|
912
1178
|
role: 'button',
|
|
913
1179
|
tabIndex: 0,
|
|
@@ -921,19 +1187,19 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
921
1187
|
style: { cursor: 'pointer' },
|
|
922
1188
|
}
|
|
923
1189
|
: {}));
|
|
924
|
-
var
|
|
925
|
-
var
|
|
1190
|
+
var _16 = (0, react_2.useState)(undefined), labelAvailable = _16[0], setLabelAvailable = _16[1];
|
|
1191
|
+
var _17 = (0, useFitTextSize_1.useFitTextSize)({
|
|
926
1192
|
text: typeof label === 'string' ? label : '',
|
|
927
1193
|
available: labelAvailable,
|
|
928
1194
|
max: labelNaturalPx,
|
|
929
1195
|
min: labelMinTextSize,
|
|
930
1196
|
lines: clampLines,
|
|
931
1197
|
enabled: fitLabel !== false && typeof label === 'string' && !(labelEffect === null || labelEffect === void 0 ? void 0 : labelEffect.textSize),
|
|
932
|
-
}), labelFitRef =
|
|
1198
|
+
}), labelFitRef = _17[0], labelFitPx = _17[1];
|
|
933
1199
|
/** Only while the title is actually below its natural size, and never over a caller who
|
|
934
1200
|
* pinned the description's own size. */
|
|
935
1201
|
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(((
|
|
1202
|
+
? Math.max(useFitTextSize_1.FIT_TEXT_FLOOR_PX, Math.round(((_d = sizes_1.TEXT_FROM_SIZE[panelSize]) !== null && _d !== void 0 ? _d : sizes_1.TEXT_FROM_SIZE.normal) * (labelFitPx / labelNaturalPx)))
|
|
937
1203
|
: 0;
|
|
938
1204
|
/**
|
|
939
1205
|
* How much room the title has, computed rather than measured off its own box.
|
|
@@ -969,6 +1235,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
969
1235
|
* the right answer either way.
|
|
970
1236
|
*/
|
|
971
1237
|
(0, react_2.useLayoutEffect)(function () {
|
|
1238
|
+
var _a;
|
|
972
1239
|
var node = labelFitRef.current;
|
|
973
1240
|
var parent = node === null || node === void 0 ? void 0 : node.parentElement;
|
|
974
1241
|
if (!fitLabel || !node || !parent) {
|
|
@@ -982,9 +1249,26 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
982
1249
|
return child === node ? total : total + child.getBoundingClientRect().width;
|
|
983
1250
|
}, 0);
|
|
984
1251
|
var gaps = gap * Math.max(0, parent.children.length - 1);
|
|
985
|
-
|
|
1252
|
+
/* What the title could still gain, which the box measured above does not show: the box is
|
|
1253
|
+
only as wide as the title at its present size, so a title shrunk on a narrow bar measured
|
|
1254
|
+
that small box when the bar widened again, and stayed shrunk however wide the bar became
|
|
1255
|
+
(qorus#646). The room is the title box's own beyond what it holds (it grows; what it holds
|
|
1256
|
+
does not), and on a narrow bar the actions group's beyond its least (it gives way to the
|
|
1257
|
+
title, down to what its controls cannot do without). Neither moves when the title's font
|
|
1258
|
+
does: the sum is the title's whole claim on the bar. */
|
|
1259
|
+
var header = node.closest('.reqore-panel-title-header');
|
|
1260
|
+
var headerRoom = header
|
|
1261
|
+
? header.clientWidth -
|
|
1262
|
+
Array.from(header.children).reduce(function (total, child) { return total + child.getBoundingClientRect().width; }, 0)
|
|
1263
|
+
: 0;
|
|
1264
|
+
var narrowActions = isNarrow
|
|
1265
|
+
? (_a = node
|
|
1266
|
+
.closest('.reqore-panel-title')) === null || _a === void 0 ? void 0 : _a.querySelector(":scope > .".concat(NON_RESPONSIVE_ACTIONS_CLASS))
|
|
1267
|
+
: undefined;
|
|
1268
|
+
var actionsRoom = narrowActions ? getWidthAboveMinimum(narrowActions) : 0;
|
|
1269
|
+
var next = Math.max(0, Math.round(parent.clientWidth - padding - siblings - gaps + Math.max(0, headerRoom) + actionsRoom));
|
|
986
1270
|
setLabelAvailable(function (current) { return (current === next ? current : next); });
|
|
987
|
-
}, [fitLabel, label, width, badge, actions, panelSize, description, clampLines]);
|
|
1271
|
+
}, [fitLabel, label, width, badge, actions, panelSize, description, clampLines, isNarrow]);
|
|
988
1272
|
var iconTooltip = (0, react_2.useMemo)(function () { return ({
|
|
989
1273
|
content: label,
|
|
990
1274
|
}); }, [label]);
|
|
@@ -993,127 +1277,144 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
993
1277
|
if (ref === null || ref === void 0 ? void 0 : ref.resizable) {
|
|
994
1278
|
_ref = ref.resizable;
|
|
995
1279
|
}
|
|
996
|
-
|
|
997
|
-
}, []);
|
|
1280
|
+
setRef(_ref);
|
|
1281
|
+
}, [setRef]);
|
|
998
1282
|
if (skeleton) {
|
|
999
1283
|
return (0, jsx_runtime_1.jsx)(exports.ReqorePanelSkeleton, { size: panelSize, isCollapsed: _isCollapsed });
|
|
1000
1284
|
}
|
|
1001
|
-
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) {
|
|
1285
|
+
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, "aria-disabled": disabled ? true : rest['aria-disabled'], "$color": panelText, Component: exports.StyledPanel, ref: function (node) {
|
|
1002
1286
|
handleRef(node);
|
|
1003
1287
|
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 &&
|
|
1288
|
+
}, 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
1289
|
(0, lodash_1.size)(floatingActionsList) > 0 &&
|
|
1006
|
-
(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
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
// which existed only for the stacked layout — never shows.
|
|
1073
|
-
, {
|
|
1290
|
+
(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.jsx)(SurfaceContext_1.ReqoreSurfaceProvider, { color: barSurface, children: (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 () {
|
|
1291
|
+
var _a;
|
|
1292
|
+
var hasPanelIcon = !!icon || !!iconImage || loading;
|
|
1293
|
+
// The icon takes the label's place, so there has to BE an icon. Without one
|
|
1294
|
+
// the label is the only thing identifying the panel and it stays put — a
|
|
1295
|
+
// header with neither is not a compact header, it is an empty one. The label
|
|
1296
|
+
// is not lost either way: it is already this icon's tooltip.
|
|
1297
|
+
var hideTitleText = hideTitleForIcon && hasPanelIcon;
|
|
1298
|
+
// Layout decision:
|
|
1299
|
+
// - iconWithLabel=true → render the icon INSIDE the
|
|
1300
|
+
// label-and-badge row (no outer icon column). The
|
|
1301
|
+
// description sits flush-left under the icon+label.
|
|
1302
|
+
// - When there is NO description, fall back to the
|
|
1303
|
+
// inline layout regardless of iconVerticalAlign — the
|
|
1304
|
+
// outer grid only earns its keep when there is a
|
|
1305
|
+
// description row to anchor against, and the inline
|
|
1306
|
+
// layout aligns icon-to-text glyphs more naturally
|
|
1307
|
+
// via the heading's own line-height.
|
|
1308
|
+
// - Otherwise → outer two-column grid where the icon
|
|
1309
|
+
// sits in a reserved column. iconVerticalAlign places
|
|
1310
|
+
// the icon in row 1 (label), row 2 (description), or
|
|
1311
|
+
// spans both rows (center). The description always
|
|
1312
|
+
// indents past the icon column.
|
|
1313
|
+
var inlineWithLabel = hasPanelIcon && (iconWithLabel || !description || hideTitleText);
|
|
1314
|
+
var useOuterGrid = hasPanelIcon && !inlineWithLabel;
|
|
1315
|
+
// Outer grid → grid column-gap handles icon→label
|
|
1316
|
+
// spacing, so the icon itself takes no margin.
|
|
1317
|
+
// Inline → keep 'margin=right' so ReqoreIcon adds its
|
|
1318
|
+
// standard side-spacer between icon and label.
|
|
1319
|
+
var iconMargin = useOuterGrid ? undefined : 'right';
|
|
1320
|
+
var panelIcon = hasPanelIcon ? ((0, jsx_runtime_1.jsx)(Icon_1.default, __assign({ size: "".concat(sizes_1.ICON_FROM_HEADER_SIZE[labelSize || sizes_1.HEADER_SIZE_TO_NUMBER[panelSize]], "px"), image: loading ? undefined : iconImage, margin: iconMargin, color: (_a = titleIconLook.color) !== null && _a !== void 0 ? _a : titleIconOwn, tooltip: iconTooltip, effect: {
|
|
1321
|
+
opacity: titleIconLook.opacity,
|
|
1322
|
+
} }, titleIconRest, { animation: loading ? 'spin' : iconProps === null || iconProps === void 0 ? void 0 : iconProps.animation, icon: loading ? "Loader".concat(loadingIconType || '', "Line") : icon || (iconProps === null || iconProps === void 0 ? void 0 : iconProps.icon), className: "reqore-panel-title-icon ".concat((iconProps === null || iconProps === void 0 ? void 0 : iconProps.className) || '').trim() }))) : null;
|
|
1323
|
+
var labelRow = ((0, jsx_runtime_1.jsxs)(exports.StyledPanelTitleHeaderLabelAndBadge, { className: 'reqore-panel-title-label-row', children: [inlineWithLabel && panelIcon, hideTitleText ? null : typeof label === 'string' ? (
|
|
1324
|
+
// The measured box is this wrapper, not the heading: as a
|
|
1325
|
+
// `min-width: 0` flex child it reports the width the row actually
|
|
1326
|
+
// left for the title, where the heading would report what the text
|
|
1327
|
+
// wants. `overflow: hidden` is what makes it shrinkable at all.
|
|
1328
|
+
// `display: flex` keeps the wrapper from opening a line box around
|
|
1329
|
+
// the inline-flex heading: a block wrapper adds the row's leading on
|
|
1330
|
+
// top of the heading's own box, which made a `tiny` panel 3px taller
|
|
1331
|
+
// than it was before this wrapper existed.
|
|
1332
|
+
(0, jsx_runtime_1.jsx)(StyledPanelTitleLabelBox, { ref: labelFitRef, className: 'reqore-panel-title-label-box', "$clampLines": clampLines, children: (0, jsx_runtime_1.jsx)(LabelEditor_1.LabelEditor, { size: labelSize || panelSize, customTheme: theme, effect: __assign({
|
|
1333
|
+
// `noWrap` pins the heading to one line; a clamped title is
|
|
1334
|
+
// allowed to wrap, and the clamp brings its own ellipsis.
|
|
1335
|
+
noWrap: clampLines === 1 }, labelEffect), style: __assign(__assign(__assign({}, (clampLines > 1
|
|
1336
|
+
? {}
|
|
1337
|
+
: { display: 'inline-flex', alignItems: 'center' })), { minWidth: 0,
|
|
1338
|
+
// Capped to the measured wrapper so the heading's own
|
|
1339
|
+
// `text-overflow: ellipsis` (from `noWrap`) has a box to overflow.
|
|
1340
|
+
// An `inline-flex` heading otherwise sizes to its text, and the
|
|
1341
|
+
// wrapper clips it mid-word with no ellipsis at all.
|
|
1342
|
+
maxWidth: '100%' }), (fitLabel !== false && !(labelEffect === null || labelEffect === void 0 ? void 0 : labelEffect.textSize)
|
|
1343
|
+
? { fontSize: "".concat(labelFitPx, "px") }
|
|
1344
|
+
: {})), label: label, onSubmit: onLabelEdit, tooltip: showLabelTooltip ? customLabelTooltip || label : undefined }) })) : (label), badge || badge === 0 ? ((0, jsx_runtime_1.jsx)(Button_1.ButtonBadge, { size: (0, utils_1.getOneHigherSize)(panelSize), content: badge, wrapGroup: isSmall, margin: label ? 'left' : 'none' })) : null] }));
|
|
1345
|
+
// Description size is driven by the panel size only —
|
|
1346
|
+
// explicitly NOT by `labelSize`. `NUMBER_TO_SIZE` maps
|
|
1347
|
+
// 1..6 → micro..huge, which means bumping `labelSize`
|
|
1348
|
+
// from 4 to 2 to grow the heading would inversely
|
|
1349
|
+
// shrink the description to `tiny`. That's the wrong
|
|
1350
|
+
// pairing: a bigger label should not make supporting
|
|
1351
|
+
// text smaller. Consumers that want to size the
|
|
1352
|
+
// description explicitly pass `descriptionEffect.textSize`.
|
|
1353
|
+
var descriptionRow = description && !hideTitleText && !descriptionBelow ? ((0, jsx_runtime_1.jsx)(Span_1.ReqoreSpan, __assign({}, descriptionProps, { children: description }))) : null;
|
|
1354
|
+
return ((0, jsx_runtime_1.jsx)(exports.StyledPanelTitleHeaderContent, __assign({ size: panelSize }, labelProps, { hasLabel: !!label && !hideTitleText, hasIcon: useOuterGrid, iconSize: sizes_1.ICON_FROM_HEADER_SIZE[labelSize || sizes_1.HEADER_SIZE_TO_NUMBER[panelSize]], "$hasOuterIcon": useOuterGrid, "$iconVerticalAlign": iconVerticalAlign, "$hasDescription": !!description && !hideTitleText, children: useOuterGrid ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [panelIcon, labelRow, descriptionRow] })) : ((0, jsx_runtime_1.jsxs)(exports.StyledPanelTitleHeaderLabelAndDescription, { children: [labelRow, descriptionRow] })) })));
|
|
1355
|
+
})()) : null, breadcrumbs && (badge || badge === 0) ? ((0, jsx_runtime_1.jsx)(Button_1.ButtonBadge, { size: (0, utils_1.getOneHigherSize)(panelSize), content: badge, wrapGroup: isSmall, margin: label ? 'left' : 'none' })) : null, (0, jsx_runtime_1.jsx)(NonResponsiveActions_1.ReqorePanelNonResponsiveActions
|
|
1074
1356
|
// The narrow bar keeps its controls in the trailing group, so this row —
|
|
1075
1357
|
// which existed only for the stacked layout — never shows.
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
//
|
|
1095
|
-
// own
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1358
|
+
, {
|
|
1359
|
+
// The narrow bar keeps its controls in the trailing group, so this row —
|
|
1360
|
+
// which existed only for the stacked layout — never shows.
|
|
1361
|
+
show: false, 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: false, style: { marginLeft: 'auto' } })] })), hasResponsiveActions(nonFloatingActions) && ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, __assign({ responsive: responsiveActions,
|
|
1362
|
+
// Not fluid by default. `fluid` emits `width: 100%`, so the group's flex basis
|
|
1363
|
+
// becomes the whole bar and the title — the only shrinkable thing on the other
|
|
1364
|
+
// side — collapses to nothing: measured at 0px of title on a 400px panel, and
|
|
1365
|
+
// 142px of a 518px bar where the buttons needed 90.
|
|
1366
|
+
//
|
|
1367
|
+
// A caller whose actions include something with no useful width of its own —
|
|
1368
|
+
// Collection puts a search input in here — opts back in through
|
|
1369
|
+
// `responsiveActionsWrapperProps`, because `fluid` is also what ControlGroup
|
|
1370
|
+
// propagates to its children, and that input has nothing to fill without it.
|
|
1371
|
+
fluid: false, horizontalAlign: 'flex-end', customTheme: theme, size: panelSize }, responsiveActionsWrapperProps, {
|
|
1372
|
+
// The cap is the whole fix. Half the bar guarantees the title the other half,
|
|
1373
|
+
// and the moment the buttons need more than their share the group overflows —
|
|
1374
|
+
// which is what `responsive` collapse watches (`scrollWidth > clientWidth`), so
|
|
1375
|
+
// the fold into the `…` menu still fires. Floored at 40px because shrinking to
|
|
1376
|
+
// nothing clips the buttons rather than folding them, and ControlGroup ignores
|
|
1377
|
+
// its own overflow below that width, which would strand them clipped.
|
|
1378
|
+
style: __assign({
|
|
1379
|
+
// Pushed to the trailing edge. A `fluid` group used to span the bar and its
|
|
1380
|
+
// own `horizontalAlign` put the buttons on the right; a content-sized one is
|
|
1381
|
+
// only as wide as its buttons, so with no title header beside it — Tree has
|
|
1382
|
+
// no label — it would sit at the LEFT of an otherwise empty bar. `auto`
|
|
1383
|
+
// margin restores the edge without giving the group any width back.
|
|
1384
|
+
marginLeft: 'auto',
|
|
1385
|
+
// Content basis that may still shrink. `fluid={false}` alone compiles to
|
|
1386
|
+
// `flex: 0 0 auto`, which pins the group at its content width so it can never
|
|
1387
|
+
// overflow — and `responsive` collapse watches `scrollWidth > clientWidth`,
|
|
1388
|
+
// so the fold into the `…` menu would simply stop happening.
|
|
1389
|
+
flex: '0 1 auto',
|
|
1390
|
+
// Floored, because shrinking to nothing clips the buttons instead of folding
|
|
1391
|
+
// them, and ControlGroup ignores its own overflow below 40px.
|
|
1392
|
+
minWidth: 40,
|
|
1393
|
+
// Capped, so a group that IS opted back into growing cannot take the row —
|
|
1394
|
+
// but only while there is a title header to take it FROM. With no label,
|
|
1395
|
+
// badge, icon or breadcrumbs the bar is the group's alone, and holding a
|
|
1396
|
+
// Collection's search input to half of an empty bar guards nothing.
|
|
1397
|
+
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,
|
|
1398
|
+
// Beside a title in a NARROW bar the title comes first (qorus#646). The group is
|
|
1399
|
+
// `0 0 auto`, so a narrow bar - a table in a card on a phone - squeezed the title
|
|
1400
|
+
// to nothing and still pushed its last button past the panel's edge. Narrow, the
|
|
1401
|
+
// title takes its whole width first and the group what is left, at least what its
|
|
1402
|
+
// controls cannot do without (a search field narrows, a button never does) and at
|
|
1403
|
+
// most its own width. A basis of 0 is what gives the title the first claim: the
|
|
1404
|
+
// group is sized from the leftover, so the title shrinks only once the controls
|
|
1405
|
+
// are at their smallest - and its words break only when one is wider than the
|
|
1406
|
+
// space left beside them. Shrinking the two against each other instead, by any
|
|
1407
|
+
// factor, took a fraction of a pixel off the title, and that broke "Services" into
|
|
1408
|
+
// "Servic / es". Room the title does not need goes to the group first (a grow no
|
|
1409
|
+
// title's comes near), so a search field widens before the title's box does. A
|
|
1410
|
+
// wide bar keeps the group at its own width: there the title's claim was its
|
|
1411
|
+
// one-line width, a description beside it included, and a long description
|
|
1412
|
+
// squeezed a table's search to its least instead of wrapping.
|
|
1413
|
+
style: hasTitleHeader && isNarrow ? NARROW_ACTIONS_BESIDE_TITLE : undefined, children: nonFloatingActions.map(renderNonResponsiveActions()) }), descriptionBelow ? (
|
|
1414
|
+
// `flex-basis: 100%` is what puts it on its own line — the bar is a wrapping
|
|
1415
|
+
// flex row, so a full-width item cannot share one with anything before it.
|
|
1416
|
+
// `min-width: 0` so a long sentence wraps inside the bar instead of widening it.
|
|
1417
|
+
(0, jsx_runtime_1.jsx)("div", { className: 'reqore-panel-title-description-row', style: { flex: '0 0 100%', minWidth: 0 }, children: (0, jsx_runtime_1.jsx)(Span_1.ReqoreSpan, __assign({}, descriptionProps, { children: description })) })) : null] }) })), !_isCollapsed || (_isCollapsed && !unMountContentOnCollapse) ? ((0, jsx_runtime_1.jsx)(exports.StyledPanelContent, { as: 'div', className: 'reqore-panel-content', hasLabel: !!hasTitleBar, hasBottomActions: hasBottomActions, isCollapsed: _isCollapsed, style: contentStyle, padded: padded, minimal: minimal || opacity === 0, size: contentSize || panelSize, ref: getContentRef, noHorizontalPadding: noHorizontalPadding, children: (0, jsx_runtime_1.jsx)(SurfaceContext_1.ReqoreSurfaceProvider, { color: contentSurfaces, children: children }) })) : null, hasBottomActions && !_isCollapsed ? ((0, jsx_runtime_1.jsx)(SurfaceContext_1.ReqoreSurfaceProvider, { color: barSurface, children: (0, jsx_runtime_1.jsxs)(exports.StyledPanelBottomActions, { flat: flat, className: 'reqore-panel-bottom-actions', theme: theme, padded: padded, intent: intent, minimal: minimal || opacity === 0, opacity: minimal ? 0 : (opacity !== null && opacity !== void 0 ? opacity : 1), size: contentSize || panelSize, noHorizontalPadding: noHorizontalPadding, children: [hasNonResponsiveActions(leftBottomActions) ? ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, { size: panelSize, style: { marginRight: 'auto' }, children: leftBottomActions.map(renderNonResponsiveActions('flex-start')) })) : null, hasResponsiveActions(leftBottomActions) && ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, { fluid: responsiveActions, responsive: responsiveActions, customTheme: theme, size: panelSize, style: { marginRight: 'auto' }, children: leftBottomActions.map(renderResponsiveActions('flex-start')) })), hasResponsiveActions(rightBottomActions) && ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, { fluid: responsiveActions, horizontalAlign: 'flex-end', responsive: responsiveActions, customTheme: theme, style: { marginLeft: 'auto' }, size: panelSize, children: rightBottomActions.map(renderResponsiveActions()) })), hasNonResponsiveActions(rightBottomActions) ? ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, { horizontalAlign: 'flex-end', size: panelSize, style: { marginLeft: 'auto' }, children: rightBottomActions.map(renderNonResponsiveActions()) })) : null] }) })) : null, !_isCollapsed && mediaPosition === 'bottom' ? mediaNode : null] })) })));
|
|
1117
1418
|
});
|
|
1118
1419
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34;
|
|
1119
1420
|
//# sourceMappingURL=index.js.map
|