@qoretechnologies/reqore 0.78.6-pr.715.gdfefa70 → 0.78.7-pr.717.gae33bdc
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 +73 -23
- 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 +75 -0
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +324 -110
- 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 +78 -27
- 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 +120 -44
- 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 +36 -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 +37 -6
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js +216 -49
- package/dist/components/Effect/index.js.map +1 -1
- package/dist/components/EntityRow/index.d.ts +19 -1
- package/dist/components/EntityRow/index.d.ts.map +1 -1
- package/dist/components/EntityRow/index.js +139 -44
- 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 +82 -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 +44 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +96 -30
- 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 +47 -8
- 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 +11 -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 +136 -46
- 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 +95 -60
- 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 +45 -17
- 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 +513 -202
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Paragraph/index.d.ts +6 -0
- package/dist/components/Paragraph/index.d.ts.map +1 -1
- package/dist/components/Paragraph/index.js +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 +33 -47
- 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 +80 -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 +92 -77
- 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 +20 -1
- package/dist/components/SeverityRow/index.d.ts.map +1 -1
- package/dist/components/SeverityRow/index.js +58 -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 +44 -45
- 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 +59 -23
- 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 +178 -33
- 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 +27 -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 +10 -0
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +34 -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 +183 -11
- package/dist/helpers/colors.d.ts.map +1 -1
- package/dist/helpers/colors.js +736 -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/helpers/surface.d.ts +31 -0
- package/dist/helpers/surface.d.ts.map +1 -0
- package/dist/helpers/surface.js +87 -0
- package/dist/helpers/surface.js.map +1 -0
- 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/useDrawnSurface.d.ts +38 -0
- package/dist/hooks/useDrawnSurface.d.ts.map +1 -0
- package/dist/hooks/useDrawnSurface.js +48 -0
- package/dist/hooks/useDrawnSurface.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 +115 -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("../../helpers/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,125 @@ 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
|
-
|
|
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
|
+
/** A panel's fill at `opacity`: what its styled rule paints and what it hands what it holds as its surface. */
|
|
332
|
+
var getPanelFill = function (theme, opacity) {
|
|
333
|
+
return (0, colors_2.fadeColor)((0, colors_2.changeDarkness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity);
|
|
210
334
|
};
|
|
211
|
-
/**
|
|
212
|
-
var
|
|
213
|
-
|
|
214
|
-
var themed = !(intent && !accentPosition) ? (0, colors_2.getThemePanelSurface)(theme) : undefined;
|
|
215
|
-
return (themed === null || themed === void 0 ? void 0 : themed.border)
|
|
216
|
-
? (0, colors_2.changeLightness)(themed.border, 0.12)
|
|
217
|
-
: (0, colors_2.changeLightness)(getPanelBorderBaseColor(theme, { intent: intent, accentPosition: accentPosition }), 0.25);
|
|
335
|
+
/** A panel's title and top bar fill at `opacity`, painted and handed down alike. */
|
|
336
|
+
var getPanelBarFill = function (theme, opacity) {
|
|
337
|
+
return (0, colors_2.fadeColor)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity);
|
|
218
338
|
};
|
|
219
|
-
exports.StyledPanel = (0,
|
|
220
|
-
// `
|
|
221
|
-
//
|
|
222
|
-
//
|
|
223
|
-
|
|
224
|
-
// Everything else follows styled-components' own rule, so re-resizable still receives its
|
|
225
|
-
// `enable` / size / handle config — those are component props, not HTML attributes.
|
|
226
|
-
// `opacity` is the surface's background opacity, an SVG attribute a `div` would keep; the
|
|
227
|
-
// remaining flags only style the surface, and re-resizable would write them onto its div.
|
|
228
|
-
shouldForwardProp: (0, styled_1.omitStyleProps)('accentPosition', 'fill', 'flat', 'fluid', 'interactive', 'isCollapsed', 'opacity', 'rounded'),
|
|
339
|
+
exports.StyledPanel = (0, styled_1.default)(Effect_1.StyledEffect).withConfig({
|
|
340
|
+
// Its own props, `interactive` (set by the panel for its hover styles) and the layout flags a
|
|
341
|
+
// containing ControlGroup hands it — except `size`, which a panel never forwards but a
|
|
342
|
+
// `Resizable` reads as its own.
|
|
343
|
+
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
344
|
})(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
345
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
231
|
-
return (
|
|
346
|
+
return getPanelFill(theme, opacity);
|
|
232
347
|
}, function (_a) {
|
|
233
348
|
var rounded = _a.rounded, radiusSize = _a.radiusSize;
|
|
234
349
|
return rounded ? (0, sizes_1.resolveRadius)('normal', radiusSize) : 0;
|
|
235
350
|
}, function (_a) {
|
|
236
351
|
var theme = _a.theme, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition;
|
|
237
352
|
return hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition })
|
|
238
|
-
? "1px solid ".concat(
|
|
353
|
+
? "1px solid ".concat((0, colors_2.changeLightness)(getPanelBorderBaseColor(theme, { intent: intent, accentPosition: accentPosition }), 0.08))
|
|
239
354
|
: undefined;
|
|
240
355
|
}, function (_a) {
|
|
241
|
-
var theme = _a.theme;
|
|
242
|
-
return (0, colors_2.getReadableColor)(theme, undefined, undefined, true);
|
|
356
|
+
var theme = _a.theme, $color = _a.$color;
|
|
357
|
+
return $color !== null && $color !== void 0 ? $color : (0, colors_2.getReadableColor)(theme, undefined, undefined, true);
|
|
243
358
|
}, function (_a) {
|
|
244
359
|
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
360
|
if (!accentPosition) {
|
|
@@ -283,9 +398,9 @@ exports.StyledPanel = (0, styled_components_1.default)(Effect_1.StyledEffect).wi
|
|
|
283
398
|
return interactive
|
|
284
399
|
? (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
400
|
? 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,
|
|
401
|
+
: (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 })
|
|
402
|
+
? (0, colors_2.changeLightness)(getPanelBorderBaseColor(theme, { intent: intent, accentPosition: accentPosition }), 0.25)
|
|
403
|
+
: 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
404
|
}, function (_a) {
|
|
290
405
|
var raised = _a.raised, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition;
|
|
291
406
|
return raised && !hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition }) && styles_1.RaisedElement;
|
|
@@ -297,7 +412,7 @@ exports.StyledPanel = (0, styled_components_1.default)(Effect_1.StyledEffect).wi
|
|
|
297
412
|
var disabled = _a.disabled;
|
|
298
413
|
return disabled && styles_1.DisabledElement;
|
|
299
414
|
});
|
|
300
|
-
exports.StyledPanelTitle =
|
|
415
|
+
exports.StyledPanelTitle = styled_1.default.div.withConfig({
|
|
301
416
|
shouldForwardProp: (0, styled_1.omitStyleProps)('opacity'),
|
|
302
417
|
})(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
418
|
var $descriptionBelow = _a.$descriptionBelow;
|
|
@@ -313,23 +428,26 @@ exports.StyledPanelTitle = styled_components_1.default.div.withConfig({
|
|
|
313
428
|
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
429
|
}, function (_a) {
|
|
315
430
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
316
|
-
return (
|
|
431
|
+
return getPanelBarFill(theme, opacity);
|
|
317
432
|
}, function (_a) {
|
|
318
433
|
var noHorizontalPadding = _a.noHorizontalPadding, size = _a.size, padded = _a.padded, opacity = _a.opacity, flat = _a.flat, intent = _a.intent;
|
|
319
434
|
return "".concat(opacity === 0 && flat && !intent ? 0 : getPaddingSize(padded, size), "px ").concat(noHorizontalPadding ? 0 : "".concat(getPaddingSize(padded, size), "px"));
|
|
320
435
|
}, function (_a) {
|
|
321
436
|
var theme = _a.theme, isCollapsed = _a.isCollapsed, flat = _a.flat, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
322
437
|
return !isCollapsed && !flat && opacity
|
|
323
|
-
? "1px solid ".concat((0,
|
|
438
|
+
? "1px solid ".concat((0, colors_2.fadeColor)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.08), opacity))
|
|
324
439
|
: null;
|
|
325
440
|
}, sizes_1.GAP_FROM_SIZE.normal, exports.StyledPanelTitleHeaderContent, styles_1.INACTIVE_ICON_SCALE, function (_a) {
|
|
326
441
|
var collapsible = _a.collapsible;
|
|
327
442
|
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
443
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
329
|
-
return (0,
|
|
444
|
+
return (0, colors_2.fadeColor)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.05), opacity);
|
|
330
445
|
});
|
|
331
446
|
});
|
|
332
|
-
exports.StyledPanelTopBar = (0,
|
|
447
|
+
exports.StyledPanelTopBar = (0, styled_1.default)(exports.StyledPanelTitle)(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n /* What the bar holds that sets no color of its own (its icon) is written in the bar's text, read on the bar's\n fill. The panel's own text is read on its content, which it paints a step darker than the bar: on a mid grey\n the two are different colors. */\n color: ", ";\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 /* What the bar holds that sets no color of its own (its icon) is written in the bar's text, read on the bar's\n fill. The panel's own text is read on its content, which it paints a step darker than the bar: on a mid grey\n the two are different colors. */\n color: ", ";\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) {
|
|
448
|
+
var $color = _a.$color;
|
|
449
|
+
return $color;
|
|
450
|
+
}, function (_a) {
|
|
333
451
|
var padded = _a.padded, size = _a.size, isCollapsed = _a.isCollapsed, minimal = _a.minimal;
|
|
334
452
|
return !padded || isCollapsed || !minimal
|
|
335
453
|
? "".concat(getPaddingSize(padded, size), "px")
|
|
@@ -370,13 +488,13 @@ exports.StyledPanelTopBar = (0, styled_components_1.default)(exports.StyledPanel
|
|
|
370
488
|
: undefined;
|
|
371
489
|
}, function (_a) {
|
|
372
490
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
373
|
-
return (
|
|
491
|
+
return getPanelBarFill(theme, opacity);
|
|
374
492
|
}, function (_a) {
|
|
375
493
|
var stickyHeader = _a.stickyHeader, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
376
494
|
return stickyHeader &&
|
|
377
495
|
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
496
|
});
|
|
379
|
-
exports.StyledPanelBottomActions = (0,
|
|
497
|
+
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
498
|
var padded = _a.padded, size = _a.size, minimal = _a.minimal;
|
|
381
499
|
return !padded || !minimal
|
|
382
500
|
? "".concat(getPaddingSize(padded, size), "px")
|
|
@@ -393,10 +511,10 @@ exports.StyledPanelBottomActions = (0, styled_components_1.default)(exports.Styl
|
|
|
393
511
|
}, function (_a) {
|
|
394
512
|
var theme = _a.theme, flat = _a.flat, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
395
513
|
return !flat
|
|
396
|
-
? "1px solid ".concat((0,
|
|
514
|
+
? "1px solid ".concat((0, colors_2.fadeColor)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.08), opacity))
|
|
397
515
|
: null;
|
|
398
516
|
});
|
|
399
|
-
exports.StyledPanelContent =
|
|
517
|
+
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
518
|
var isCollapsed = _a.isCollapsed;
|
|
401
519
|
return (isCollapsed ? 'none !important' : undefined);
|
|
402
520
|
}, function (_a) {
|
|
@@ -413,7 +531,7 @@ exports.StyledPanelContent = styled_components_1.default.div(templateObject_29 |
|
|
|
413
531
|
/** The media frame. Its outer corners take the panel's inner curve, so the media is clipped to
|
|
414
532
|
* the panel's shape even where the panel cannot clip it (a sticky header makes the panel
|
|
415
533
|
* overflow visible). */
|
|
416
|
-
exports.StyledPanelMedia =
|
|
534
|
+
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
535
|
var $position = _a.$position, $radius = _a.$radius;
|
|
418
536
|
return $position === 'top'
|
|
419
537
|
? (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 +539,12 @@ exports.StyledPanelMedia = styled_components_1.default.div(templateObject_33 ||
|
|
|
421
539
|
var $aspectRatio = _a.$aspectRatio;
|
|
422
540
|
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
541
|
});
|
|
424
|
-
exports.StyledFloatingActions =
|
|
542
|
+
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
543
|
var size = _a.size;
|
|
426
544
|
return sizes_1.PADDING_FROM_SIZE[size];
|
|
427
545
|
}, function (_a) {
|
|
428
546
|
var theme = _a.theme;
|
|
429
|
-
return (0, polished_1.rgba)((0, colors_2.
|
|
547
|
+
return (0, polished_1.rgba)((0, colors_2.changeDarkness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), 1);
|
|
430
548
|
}, function (_a) {
|
|
431
549
|
var theme = _a.theme, flat = _a.flat, intent = _a.intent;
|
|
432
550
|
return flat && !intent
|
|
@@ -448,13 +566,15 @@ exports.ReqorePanelSkeleton = (0, react_2.memo)(function (_a) {
|
|
|
448
566
|
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
567
|
(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
568
|
});
|
|
569
|
+
/** A description given no effect: one object, so what is made from it holds from render to render. */
|
|
570
|
+
var NO_DESCRIPTION_EFFECT = {};
|
|
451
571
|
exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
452
|
-
var _b, _c;
|
|
453
|
-
var children = _a.children, label = _a.label, description = _a.description,
|
|
572
|
+
var _b, _c, _d;
|
|
573
|
+
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
574
|
// Resolved ONCE, here — the accent styles interpolate px and reserve padding,
|
|
455
575
|
// so they must only ever see a number. Shared with ReqoreCallout.
|
|
456
576
|
var accentSizePx = (0, react_2.useMemo)(function () { return (0, utils_1.resolveAccentSize)(accentSize); }, [accentSize]);
|
|
457
|
-
var
|
|
577
|
+
var _8 = (0, react_2.useState)(isCollapsed || false), _isCollapsed = _8[0], setIsCollapsed = _8[1];
|
|
458
578
|
var primaryContentGradient = (0, Effect_1.getPrimaryGradient)(contentEffect === null || contentEffect === void 0 ? void 0 : contentEffect.gradient);
|
|
459
579
|
var primaryContentColors = primaryContentGradient && typeof primaryContentGradient.colors === 'object'
|
|
460
580
|
? primaryContentGradient.colors
|
|
@@ -471,9 +591,14 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
471
591
|
};
|
|
472
592
|
}, []);
|
|
473
593
|
var isMobile = (0, useReqoreContext_1.useReqoreProperty)('isMobile');
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
594
|
+
/* Floating actions are a hover's. Where the device cannot hover (a phone, a tablet), nothing
|
|
595
|
+
would ever float them, so its hover actions stay in the panel's own bar, shown (see the
|
|
596
|
+
hover gate on StyledPanel). */
|
|
597
|
+
var isHoverCapable = (0, useReqoreContext_1.useReqoreProperty)('isHoverCapable');
|
|
598
|
+
var floatingActions = !!floatingActionsProp && isHoverCapable !== false;
|
|
599
|
+
var setRef = (0, useCombinedRefs_1.useCombinedRefs)(ref).setRef;
|
|
600
|
+
var _9 = (0, react_use_1.useMeasure)(), measureRef = _9[0], width = _9[1].width;
|
|
601
|
+
var _10 = (0, react_2.useState)(false), _isHovered = _10[0], setIsHovered = _10[1];
|
|
477
602
|
var floatingActionsRef = (0, react_2.useRef)(null);
|
|
478
603
|
var panelRef = (0, react_2.useRef)(null);
|
|
479
604
|
var hoverTimerRef = (0, react_2.useRef)(null);
|
|
@@ -491,8 +616,8 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
491
616
|
// triggers it. Only wired when `stickyHeader` is on, so ordinary panels pay
|
|
492
617
|
// nothing.
|
|
493
618
|
var stickySentinelRef = (0, react_2.useRef)(null);
|
|
494
|
-
var
|
|
495
|
-
var
|
|
619
|
+
var _11 = (0, react_2.useState)(false), isHeaderStuck = _11[0], setIsHeaderStuck = _11[1];
|
|
620
|
+
var _12 = (0, react_2.useState)(0), stickyInset = _12[0], setStickyInset = _12[1];
|
|
496
621
|
(0, react_2.useEffect)(function () {
|
|
497
622
|
var _a;
|
|
498
623
|
if (!rest.stickyHeader) {
|
|
@@ -574,23 +699,67 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
574
699
|
floatingActionsRef.current.style.top = "".concat(panelRect.top - floatingRect.height + (flat ? 0 : 1), "px");
|
|
575
700
|
floatingActionsRef.current.style.left = "".concat(panelRect.right - floatingRect.width, "px");
|
|
576
701
|
}, [flat]);
|
|
702
|
+
var showsFloatingActions = _isHovered && !!floatingActions && (0, lodash_1.size)(floatingActionsList) > 0;
|
|
703
|
+
// placed as they are shown, and again whenever the actions change
|
|
577
704
|
(0, react_2.useEffect)(function () {
|
|
578
|
-
if (
|
|
705
|
+
if (showsFloatingActions)
|
|
706
|
+
updateFloatingActionsPosition();
|
|
707
|
+
}, [showsFloatingActions, floatingActionsList, updateFloatingActionsPosition]);
|
|
708
|
+
/* ...and again whenever what they are placed by moves: the actions are fixed to the screen, placed
|
|
709
|
+
* by the panel's corner and their own size, so nothing follows on its own. A page that scrolls, a
|
|
710
|
+
* screen or window that resizes, a panel that grows or shrinks, and actions whose content changes
|
|
711
|
+
* width (a label, an icon or a font that loads) each moved the panel's corner or the actions' size
|
|
712
|
+
* without placing them again: they were left where the panel had been - mid-screen once the window
|
|
713
|
+
* widened - or reached past the panel's edge once they widened. One placement per frame, however
|
|
714
|
+
* many of these come in; none once they are hidden or the panel is gone. */
|
|
715
|
+
(0, react_2.useEffect)(function () {
|
|
716
|
+
if (!showsFloatingActions)
|
|
579
717
|
return undefined;
|
|
580
|
-
|
|
581
|
-
var
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
718
|
+
var frame = 0;
|
|
719
|
+
var schedule = function () {
|
|
720
|
+
if (!frame) {
|
|
721
|
+
frame = requestAnimationFrame(function () {
|
|
722
|
+
frame = 0;
|
|
723
|
+
updateFloatingActionsPosition();
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
window.addEventListener('scroll', schedule, true);
|
|
728
|
+
window.addEventListener('resize', schedule, { passive: true });
|
|
729
|
+
var observer = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(schedule) : undefined;
|
|
730
|
+
if (observer) {
|
|
731
|
+
if (panelRef.current)
|
|
732
|
+
observer.observe(panelRef.current);
|
|
733
|
+
if (floatingActionsRef.current)
|
|
734
|
+
observer.observe(floatingActionsRef.current);
|
|
735
|
+
}
|
|
736
|
+
return function () {
|
|
737
|
+
window.removeEventListener('scroll', schedule, true);
|
|
738
|
+
window.removeEventListener('resize', schedule);
|
|
739
|
+
observer === null || observer === void 0 ? void 0 : observer.disconnect();
|
|
740
|
+
if (frame)
|
|
741
|
+
cancelAnimationFrame(frame);
|
|
742
|
+
};
|
|
743
|
+
}, [showsFloatingActions, updateFloatingActionsPosition]);
|
|
744
|
+
/* The floating actions are a hover's: a finger's tap - and the `mouseenter` a browser emulates after it -
|
|
745
|
+
shows none (see `createHoverGate`). Where a finger is the primary pointer (`isHoverCapable` false) the
|
|
746
|
+
actions are in the panel's own bar instead (`floatingActions` is off, above), and on a touch laptop its
|
|
747
|
+
tap left them floating until the next. */
|
|
748
|
+
var hoverGate = (0, hoveringPointer_1.useHoverGate)();
|
|
749
|
+
var handlePointerEnter = (0, react_2.useCallback)(function (e) {
|
|
750
|
+
var _a;
|
|
751
|
+
hoverGate.notePointer(e);
|
|
752
|
+
(_a = rest.onPointerEnter) === null || _a === void 0 ? void 0 : _a.call(rest, e);
|
|
753
|
+
}, [hoverGate, rest.onPointerEnter]);
|
|
585
754
|
var handleMouseEnter = (0, react_2.useCallback)(function (e) {
|
|
586
755
|
var _a;
|
|
587
|
-
if (floatingActions) {
|
|
756
|
+
if (floatingActions && hoverGate.isHover()) {
|
|
588
757
|
if (hoverTimerRef.current)
|
|
589
758
|
clearTimeout(hoverTimerRef.current);
|
|
590
759
|
hoverTimerRef.current = setTimeout(function () { return setIsHovered(true); }, 150);
|
|
591
760
|
}
|
|
592
761
|
(_a = rest.onMouseEnter) === null || _a === void 0 ? void 0 : _a.call(rest, e);
|
|
593
|
-
}, [floatingActions, rest.onMouseEnter]);
|
|
762
|
+
}, [floatingActions, rest.onMouseEnter, hoverGate]);
|
|
594
763
|
var cancelHover = (0, react_2.useCallback)(function () {
|
|
595
764
|
if (hoverTimerRef.current) {
|
|
596
765
|
clearTimeout(hoverTimerRef.current);
|
|
@@ -598,6 +767,59 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
598
767
|
}
|
|
599
768
|
setIsHovered(false);
|
|
600
769
|
}, []);
|
|
770
|
+
/* The way from the panel to its floating actions.
|
|
771
|
+
*
|
|
772
|
+
* The actions float above the panel's top-right corner, so a pointer heading for
|
|
773
|
+
* them from inside the panel leaves the panel through its top edge - usually to the
|
|
774
|
+
* LEFT of the actions, on a diagonal - and passes over what lies above the panel
|
|
775
|
+
* before it reaches them. Ending the hover the moment the pointer left the panel
|
|
776
|
+
* hid the actions on that way, and the click meant for them landed on what they had
|
|
777
|
+
* been covering (in reqraft's expression editor: the Visual / Text switch, so
|
|
778
|
+
* "Remove" switched the view instead).
|
|
779
|
+
*
|
|
780
|
+
* So while the pointer is in the strip between the panel's top edge and the top of
|
|
781
|
+
* the actions, across the panel's width, the hover stays; it ends when the pointer
|
|
782
|
+
* leaves that strip for anything that is neither the panel nor the actions. Decided
|
|
783
|
+
* by where the pointer IS, on each move - no timer to guess the time a person needs. */
|
|
784
|
+
var corridorUntrackRef = (0, react_2.useRef)(null);
|
|
785
|
+
var stopCorridor = (0, react_2.useCallback)(function () {
|
|
786
|
+
var _a;
|
|
787
|
+
(_a = corridorUntrackRef.current) === null || _a === void 0 ? void 0 : _a.call(corridorUntrackRef);
|
|
788
|
+
corridorUntrackRef.current = null;
|
|
789
|
+
}, []);
|
|
790
|
+
var inCorridor = (0, react_2.useCallback)(function (x, y) {
|
|
791
|
+
if (!panelRef.current || !floatingActionsRef.current)
|
|
792
|
+
return false;
|
|
793
|
+
if (floatingActionsRef.current.style.display === 'none')
|
|
794
|
+
return false;
|
|
795
|
+
var panelRect = panelRef.current.getBoundingClientRect();
|
|
796
|
+
var actionsRect = floatingActionsRef.current.getBoundingClientRect();
|
|
797
|
+
return (x >= Math.min(panelRect.left, actionsRect.left) &&
|
|
798
|
+
x <= Math.max(panelRect.right, actionsRect.right) &&
|
|
799
|
+
y >= actionsRect.top &&
|
|
800
|
+
y <= panelRect.top + 1);
|
|
801
|
+
}, []);
|
|
802
|
+
var followCorridor = (0, react_2.useCallback)(function () {
|
|
803
|
+
stopCorridor();
|
|
804
|
+
var onMove = function (event) {
|
|
805
|
+
var _a, _b;
|
|
806
|
+
var target = event.target instanceof Node ? event.target : null;
|
|
807
|
+
// reached the actions or came back into the panel: their own handlers take over
|
|
808
|
+
if (target &&
|
|
809
|
+
(((_a = floatingActionsRef.current) === null || _a === void 0 ? void 0 : _a.contains(target)) || ((_b = panelRef.current) === null || _b === void 0 ? void 0 : _b.contains(target)))) {
|
|
810
|
+
stopCorridor();
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
if (!inCorridor(event.clientX, event.clientY)) {
|
|
814
|
+
stopCorridor();
|
|
815
|
+
cancelHover();
|
|
816
|
+
}
|
|
817
|
+
};
|
|
818
|
+
document.addEventListener('mousemove', onMove, true);
|
|
819
|
+
corridorUntrackRef.current = function () { return document.removeEventListener('mousemove', onMove, true); };
|
|
820
|
+
}, [cancelHover, inCorridor, stopCorridor]);
|
|
821
|
+
// a corridor followed when the panel goes is followed no more
|
|
822
|
+
(0, react_2.useEffect)(function () { return stopCorridor; }, [stopCorridor]);
|
|
601
823
|
var handleMouseLeave = (0, react_2.useCallback)(function (e) {
|
|
602
824
|
var _a;
|
|
603
825
|
if (floatingActions) {
|
|
@@ -607,10 +829,15 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
607
829
|
floatingActionsRef.current.contains(relatedTarget)) {
|
|
608
830
|
return;
|
|
609
831
|
}
|
|
610
|
-
|
|
832
|
+
if (_isHovered && inCorridor(e.clientX, e.clientY)) {
|
|
833
|
+
followCorridor();
|
|
834
|
+
}
|
|
835
|
+
else {
|
|
836
|
+
cancelHover();
|
|
837
|
+
}
|
|
611
838
|
}
|
|
612
839
|
(_a = rest.onMouseLeave) === null || _a === void 0 ? void 0 : _a.call(rest, e);
|
|
613
|
-
}, [floatingActions, rest.onMouseLeave, cancelHover]);
|
|
840
|
+
}, [floatingActions, rest.onMouseLeave, cancelHover, _isHovered, inCorridor, followCorridor]);
|
|
614
841
|
var handleFloatingActionsMouseLeave = (0, react_2.useCallback)(function (e) {
|
|
615
842
|
var relatedTarget = e.relatedTarget;
|
|
616
843
|
if (panelRef.current &&
|
|
@@ -618,8 +845,13 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
618
845
|
panelRef.current.contains(relatedTarget)) {
|
|
619
846
|
return;
|
|
620
847
|
}
|
|
848
|
+
// back towards the panel through the strip between them
|
|
849
|
+
if (inCorridor(e.clientX, e.clientY)) {
|
|
850
|
+
followCorridor();
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
621
853
|
cancelHover();
|
|
622
|
-
}, [cancelHover]);
|
|
854
|
+
}, [cancelHover, inCorridor, followCorridor]);
|
|
623
855
|
/* The panel renders as re-resizable's `Resizable` when it is resizable — unless the caller
|
|
624
856
|
gave its own element in `as`, which always wins. (`rest.as || cond ? Resizable : 'div'`
|
|
625
857
|
binds as `(rest.as || cond) ? …`, so a panel given `as` used to render a `Resizable`.) */
|
|
@@ -826,6 +1058,36 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
826
1058
|
}, [intent, theme, contentEffect, interactive]);
|
|
827
1059
|
var opacity = rest.transparent ? 0 : rest.opacity;
|
|
828
1060
|
var noHorizontalPadding = opacity === 0 && flat && !intent && !rest.raised;
|
|
1061
|
+
/* What the panel holds is drawn on the panel - its content on the panel's background, its
|
|
1062
|
+
title bar and bottom actions on the bar's - and is told so, to pick its text and icons
|
|
1063
|
+
against that rather than the page. */
|
|
1064
|
+
var aroundSurface = (0, SurfaceContext_1.useReqoreSurface)();
|
|
1065
|
+
// a panel drawn at no opacity is on what is around it: what a component there says, or its customTheme's main
|
|
1066
|
+
var surface = (0, react_2.useMemo)(function () { return (0, surface_1.getUnpaintedSurface)(theme, customTheme, aroundSurface, opacity === 0); }, [theme, customTheme, aroundSurface, opacity]);
|
|
1067
|
+
var contentSurface = (0, react_2.useMemo)(function () {
|
|
1068
|
+
return (0, colors_2.getDrawnColor)(getPanelFill(theme, opacity !== null && opacity !== void 0 ? opacity : 1), (0, colors_2.getThemeSurface)(theme, surface));
|
|
1069
|
+
}, [theme, opacity, surface]);
|
|
1070
|
+
/* each color of the content's gradient, when its effect draws one: for as long as its colors hold, not the
|
|
1071
|
+
effect object - one given inline is new on every render, and so was every surface the panel hands down */
|
|
1072
|
+
var contentGradientKey = JSON.stringify((_b = transformedContentEffect === null || transformedContentEffect === void 0 ? void 0 : transformedContentEffect.gradient) !== null && _b !== void 0 ? _b : null);
|
|
1073
|
+
var contentSurfaces = (0, react_2.useMemo)(function () {
|
|
1074
|
+
return (0, Effect_1.getEffectBackgrounds)(theme, transformedContentEffect, contentSurface, (0, colors_2.getThemeSurface)(theme, surface));
|
|
1075
|
+
}, [theme, contentGradientKey, contentSurface, surface]);
|
|
1076
|
+
var barSurface = (0, react_2.useMemo)(function () {
|
|
1077
|
+
return contentSurfaces.map(function (under) {
|
|
1078
|
+
return (0, colors_2.getDrawnColor)(getPanelBarFill(theme, minimal ? 0 : (opacity !== null && opacity !== void 0 ? opacity : 1)), under);
|
|
1079
|
+
});
|
|
1080
|
+
}, [theme, minimal, opacity, contentSurfaces]);
|
|
1081
|
+
// The bar's description and icon fade only as far as they stay readable there.
|
|
1082
|
+
var barText = (0, react_2.useMemo)(function () { return (0, colors_2.getReadableTextOn)(theme, barSurface); }, [theme, barSurface]);
|
|
1083
|
+
/* The panel's own text (what it holds that sets no color of its own) is read on what its content is drawn on, as
|
|
1084
|
+
what it holds is - not on the theme's main, which it does not paint: it paints it a step darker, and at less
|
|
1085
|
+
than full opacity barely at all. On a mid grey the step alone decides which text reads. */
|
|
1086
|
+
var panelText = (0, react_2.useMemo)(function () { return (0, colors_2.getReadableTextOn)(theme, contentSurfaces); }, [theme, contentSurfaces]);
|
|
1087
|
+
// the title icon's own color: in its props (which win, as they are spread over the rest), else the panel's
|
|
1088
|
+
var _13 = (0, iconProps_1.splitIconColor)(iconProps), titleIconPropsColor = _13[0], titleIconRest = _13[1];
|
|
1089
|
+
var titleIconOwn = titleIconPropsColor || iconColor;
|
|
1090
|
+
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
1091
|
// The media frame's outer corners follow the panel's INNER curve: its radius, less the 1px
|
|
830
1092
|
// border when it draws one — the same inset the sticky header and the accent strip take.
|
|
831
1093
|
var mediaRadius = rounded
|
|
@@ -857,7 +1119,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
857
1119
|
* The title's natural size in px, from the heading level it renders at — the same
|
|
858
1120
|
* `labelSize || HEADER_SIZE_TO_NUMBER[panelSize]` the icon is sized from.
|
|
859
1121
|
*/
|
|
860
|
-
var labelNaturalPx = (
|
|
1122
|
+
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
1123
|
/**
|
|
862
1124
|
* SECOND thing to give: the title's size. Once the actions are down to icons and the
|
|
863
1125
|
* row is still short, the title shrinks toward a floor rather than dropping characters
|
|
@@ -887,8 +1149,8 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
887
1149
|
* way it always has. When it IS cut, that same click must not reach the bar — opening the
|
|
888
1150
|
* text and folding the panel away in one gesture is the worst of both.
|
|
889
1151
|
*/
|
|
890
|
-
var
|
|
891
|
-
var
|
|
1152
|
+
var _14 = (0, react_2.useState)(false), isDescriptionExpanded = _14[0], setIsDescriptionExpanded = _14[1];
|
|
1153
|
+
var _15 = (0, react_2.useState)(false), isDescriptionTruncated = _15[0], setIsDescriptionTruncated = _15[1];
|
|
892
1154
|
var descriptionRef = (0, react_2.useRef)(null);
|
|
893
1155
|
var descriptionIsClamped = descriptionClamp > 0 && !isDescriptionExpanded;
|
|
894
1156
|
(0, react_2.useLayoutEffect)(function () {
|
|
@@ -905,9 +1167,23 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
905
1167
|
event.stopPropagation();
|
|
906
1168
|
setIsDescriptionExpanded(function (expanded) { return !expanded; });
|
|
907
1169
|
}, [descriptionIsInteractive]);
|
|
1170
|
+
/* Dimmer than the title, as far as it stays readable on the bar: the color it is drawn in - its effect's
|
|
1171
|
+
(where the theme can resolve it), its intent's, else the bar's text - at 0.7, or as much more as it needs.
|
|
1172
|
+
An opacity the caller gives is the caller's, as given. Worked out only for a description there is. */
|
|
1173
|
+
var descriptionLook = (0, react_2.useMemo)(function () {
|
|
1174
|
+
if (!description || descriptionEffect.opacity !== undefined) {
|
|
1175
|
+
return descriptionEffect;
|
|
1176
|
+
}
|
|
1177
|
+
var drawn = descriptionEffect.color
|
|
1178
|
+
? (0, surface_1.getDrawnEffectTextColor)(theme, descriptionEffect.color, barSurface)
|
|
1179
|
+
: descriptionIntent
|
|
1180
|
+
? (0, colors_2.getReadableIntentColor)(theme, descriptionIntent, undefined, barSurface)
|
|
1181
|
+
: undefined;
|
|
1182
|
+
return __assign(__assign({}, descriptionEffect), { opacity: (0, colors_2.getReadableAlpha)(drawn !== null && drawn !== void 0 ? drawn : barText, barSurface, 0.7) });
|
|
1183
|
+
}, [description, descriptionEffect, descriptionIntent, theme, barSurface, barText]);
|
|
908
1184
|
/** Shared by both places the description can render — inline with the title, or on its
|
|
909
1185
|
* own row below — so the two cannot drift apart. */
|
|
910
|
-
var descriptionProps = __assign({ ref: descriptionRef, className: 'reqore-panel-title-description', size: panelSize, effect:
|
|
1186
|
+
var descriptionProps = __assign({ ref: descriptionRef, className: 'reqore-panel-title-description', size: panelSize, effect: descriptionLook, intent: descriptionIntent, onClick: handleDescriptionClick }, (descriptionIsInteractive
|
|
911
1187
|
? {
|
|
912
1188
|
role: 'button',
|
|
913
1189
|
tabIndex: 0,
|
|
@@ -921,19 +1197,19 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
921
1197
|
style: { cursor: 'pointer' },
|
|
922
1198
|
}
|
|
923
1199
|
: {}));
|
|
924
|
-
var
|
|
925
|
-
var
|
|
1200
|
+
var _16 = (0, react_2.useState)(undefined), labelAvailable = _16[0], setLabelAvailable = _16[1];
|
|
1201
|
+
var _17 = (0, useFitTextSize_1.useFitTextSize)({
|
|
926
1202
|
text: typeof label === 'string' ? label : '',
|
|
927
1203
|
available: labelAvailable,
|
|
928
1204
|
max: labelNaturalPx,
|
|
929
1205
|
min: labelMinTextSize,
|
|
930
1206
|
lines: clampLines,
|
|
931
1207
|
enabled: fitLabel !== false && typeof label === 'string' && !(labelEffect === null || labelEffect === void 0 ? void 0 : labelEffect.textSize),
|
|
932
|
-
}), labelFitRef =
|
|
1208
|
+
}), labelFitRef = _17[0], labelFitPx = _17[1];
|
|
933
1209
|
/** Only while the title is actually below its natural size, and never over a caller who
|
|
934
1210
|
* pinned the description's own size. */
|
|
935
1211
|
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(((
|
|
1212
|
+
? 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
1213
|
: 0;
|
|
938
1214
|
/**
|
|
939
1215
|
* How much room the title has, computed rather than measured off its own box.
|
|
@@ -969,6 +1245,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
969
1245
|
* the right answer either way.
|
|
970
1246
|
*/
|
|
971
1247
|
(0, react_2.useLayoutEffect)(function () {
|
|
1248
|
+
var _a;
|
|
972
1249
|
var node = labelFitRef.current;
|
|
973
1250
|
var parent = node === null || node === void 0 ? void 0 : node.parentElement;
|
|
974
1251
|
if (!fitLabel || !node || !parent) {
|
|
@@ -982,9 +1259,26 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
982
1259
|
return child === node ? total : total + child.getBoundingClientRect().width;
|
|
983
1260
|
}, 0);
|
|
984
1261
|
var gaps = gap * Math.max(0, parent.children.length - 1);
|
|
985
|
-
|
|
1262
|
+
/* What the title could still gain, which the box measured above does not show: the box is
|
|
1263
|
+
only as wide as the title at its present size, so a title shrunk on a narrow bar measured
|
|
1264
|
+
that small box when the bar widened again, and stayed shrunk however wide the bar became
|
|
1265
|
+
(qorus#646). The room is the title box's own beyond what it holds (it grows; what it holds
|
|
1266
|
+
does not), and on a narrow bar the actions group's beyond its least (it gives way to the
|
|
1267
|
+
title, down to what its controls cannot do without). Neither moves when the title's font
|
|
1268
|
+
does: the sum is the title's whole claim on the bar. */
|
|
1269
|
+
var header = node.closest('.reqore-panel-title-header');
|
|
1270
|
+
var headerRoom = header
|
|
1271
|
+
? header.clientWidth -
|
|
1272
|
+
Array.from(header.children).reduce(function (total, child) { return total + child.getBoundingClientRect().width; }, 0)
|
|
1273
|
+
: 0;
|
|
1274
|
+
var narrowActions = isNarrow
|
|
1275
|
+
? (_a = node
|
|
1276
|
+
.closest('.reqore-panel-title')) === null || _a === void 0 ? void 0 : _a.querySelector(":scope > .".concat(NON_RESPONSIVE_ACTIONS_CLASS))
|
|
1277
|
+
: undefined;
|
|
1278
|
+
var actionsRoom = narrowActions ? getWidthAboveMinimum(narrowActions) : 0;
|
|
1279
|
+
var next = Math.max(0, Math.round(parent.clientWidth - padding - siblings - gaps + Math.max(0, headerRoom) + actionsRoom));
|
|
986
1280
|
setLabelAvailable(function (current) { return (current === next ? current : next); });
|
|
987
|
-
}, [fitLabel, label, width, badge, actions, panelSize, description, clampLines]);
|
|
1281
|
+
}, [fitLabel, label, width, badge, actions, panelSize, description, clampLines, isNarrow]);
|
|
988
1282
|
var iconTooltip = (0, react_2.useMemo)(function () { return ({
|
|
989
1283
|
content: label,
|
|
990
1284
|
}); }, [label]);
|
|
@@ -993,127 +1287,144 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
993
1287
|
if (ref === null || ref === void 0 ? void 0 : ref.resizable) {
|
|
994
1288
|
_ref = ref.resizable;
|
|
995
1289
|
}
|
|
996
|
-
|
|
997
|
-
}, []);
|
|
1290
|
+
setRef(_ref);
|
|
1291
|
+
}, [setRef]);
|
|
998
1292
|
if (skeleton) {
|
|
999
1293
|
return (0, jsx_runtime_1.jsx)(exports.ReqorePanelSkeleton, { size: panelSize, isCollapsed: _isCollapsed });
|
|
1000
1294
|
}
|
|
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) {
|
|
1295
|
+
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
1296
|
handleRef(node);
|
|
1003
1297
|
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 &&
|
|
1298
|
+
}, 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
1299
|
(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
|
-
, {
|
|
1300
|
+
(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, { "$color": barText, 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 () {
|
|
1301
|
+
var _a;
|
|
1302
|
+
var hasPanelIcon = !!icon || !!iconImage || loading;
|
|
1303
|
+
// The icon takes the label's place, so there has to BE an icon. Without one
|
|
1304
|
+
// the label is the only thing identifying the panel and it stays put — a
|
|
1305
|
+
// header with neither is not a compact header, it is an empty one. The label
|
|
1306
|
+
// is not lost either way: it is already this icon's tooltip.
|
|
1307
|
+
var hideTitleText = hideTitleForIcon && hasPanelIcon;
|
|
1308
|
+
// Layout decision:
|
|
1309
|
+
// - iconWithLabel=true → render the icon INSIDE the
|
|
1310
|
+
// label-and-badge row (no outer icon column). The
|
|
1311
|
+
// description sits flush-left under the icon+label.
|
|
1312
|
+
// - When there is NO description, fall back to the
|
|
1313
|
+
// inline layout regardless of iconVerticalAlign — the
|
|
1314
|
+
// outer grid only earns its keep when there is a
|
|
1315
|
+
// description row to anchor against, and the inline
|
|
1316
|
+
// layout aligns icon-to-text glyphs more naturally
|
|
1317
|
+
// via the heading's own line-height.
|
|
1318
|
+
// - Otherwise → outer two-column grid where the icon
|
|
1319
|
+
// sits in a reserved column. iconVerticalAlign places
|
|
1320
|
+
// the icon in row 1 (label), row 2 (description), or
|
|
1321
|
+
// spans both rows (center). The description always
|
|
1322
|
+
// indents past the icon column.
|
|
1323
|
+
var inlineWithLabel = hasPanelIcon && (iconWithLabel || !description || hideTitleText);
|
|
1324
|
+
var useOuterGrid = hasPanelIcon && !inlineWithLabel;
|
|
1325
|
+
// Outer grid → grid column-gap handles icon→label
|
|
1326
|
+
// spacing, so the icon itself takes no margin.
|
|
1327
|
+
// Inline → keep 'margin=right' so ReqoreIcon adds its
|
|
1328
|
+
// standard side-spacer between icon and label.
|
|
1329
|
+
var iconMargin = useOuterGrid ? undefined : 'right';
|
|
1330
|
+
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: {
|
|
1331
|
+
opacity: titleIconLook.opacity,
|
|
1332
|
+
} }, 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;
|
|
1333
|
+
var labelRow = ((0, jsx_runtime_1.jsxs)(exports.StyledPanelTitleHeaderLabelAndBadge, { className: 'reqore-panel-title-label-row', children: [inlineWithLabel && panelIcon, hideTitleText ? null : typeof label === 'string' ? (
|
|
1334
|
+
// The measured box is this wrapper, not the heading: as a
|
|
1335
|
+
// `min-width: 0` flex child it reports the width the row actually
|
|
1336
|
+
// left for the title, where the heading would report what the text
|
|
1337
|
+
// wants. `overflow: hidden` is what makes it shrinkable at all.
|
|
1338
|
+
// `display: flex` keeps the wrapper from opening a line box around
|
|
1339
|
+
// the inline-flex heading: a block wrapper adds the row's leading on
|
|
1340
|
+
// top of the heading's own box, which made a `tiny` panel 3px taller
|
|
1341
|
+
// than it was before this wrapper existed.
|
|
1342
|
+
(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({
|
|
1343
|
+
// `noWrap` pins the heading to one line; a clamped title is
|
|
1344
|
+
// allowed to wrap, and the clamp brings its own ellipsis.
|
|
1345
|
+
noWrap: clampLines === 1 }, labelEffect), style: __assign(__assign(__assign({}, (clampLines > 1
|
|
1346
|
+
? {}
|
|
1347
|
+
: { display: 'inline-flex', alignItems: 'center' })), { minWidth: 0,
|
|
1348
|
+
// Capped to the measured wrapper so the heading's own
|
|
1349
|
+
// `text-overflow: ellipsis` (from `noWrap`) has a box to overflow.
|
|
1350
|
+
// An `inline-flex` heading otherwise sizes to its text, and the
|
|
1351
|
+
// wrapper clips it mid-word with no ellipsis at all.
|
|
1352
|
+
maxWidth: '100%' }), (fitLabel !== false && !(labelEffect === null || labelEffect === void 0 ? void 0 : labelEffect.textSize)
|
|
1353
|
+
? { fontSize: "".concat(labelFitPx, "px") }
|
|
1354
|
+
: {})), 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] }));
|
|
1355
|
+
// Description size is driven by the panel size only —
|
|
1356
|
+
// explicitly NOT by `labelSize`. `NUMBER_TO_SIZE` maps
|
|
1357
|
+
// 1..6 → micro..huge, which means bumping `labelSize`
|
|
1358
|
+
// from 4 to 2 to grow the heading would inversely
|
|
1359
|
+
// shrink the description to `tiny`. That's the wrong
|
|
1360
|
+
// pairing: a bigger label should not make supporting
|
|
1361
|
+
// text smaller. Consumers that want to size the
|
|
1362
|
+
// description explicitly pass `descriptionEffect.textSize`.
|
|
1363
|
+
var descriptionRow = description && !hideTitleText && !descriptionBelow ? ((0, jsx_runtime_1.jsx)(Span_1.ReqoreSpan, __assign({}, descriptionProps, { children: description }))) : null;
|
|
1364
|
+
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] })) })));
|
|
1365
|
+
})()) : 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
1366
|
// The narrow bar keeps its controls in the trailing group, so this row —
|
|
1075
1367
|
// 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
|
-
|
|
1368
|
+
, {
|
|
1369
|
+
// The narrow bar keeps its controls in the trailing group, so this row —
|
|
1370
|
+
// which existed only for the stacked layout — never shows.
|
|
1371
|
+
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,
|
|
1372
|
+
// Not fluid by default. `fluid` emits `width: 100%`, so the group's flex basis
|
|
1373
|
+
// becomes the whole bar and the title — the only shrinkable thing on the other
|
|
1374
|
+
// side — collapses to nothing: measured at 0px of title on a 400px panel, and
|
|
1375
|
+
// 142px of a 518px bar where the buttons needed 90.
|
|
1376
|
+
//
|
|
1377
|
+
// A caller whose actions include something with no useful width of its own —
|
|
1378
|
+
// Collection puts a search input in here — opts back in through
|
|
1379
|
+
// `responsiveActionsWrapperProps`, because `fluid` is also what ControlGroup
|
|
1380
|
+
// propagates to its children, and that input has nothing to fill without it.
|
|
1381
|
+
fluid: false, horizontalAlign: 'flex-end', customTheme: theme, size: panelSize }, responsiveActionsWrapperProps, {
|
|
1382
|
+
// The cap is the whole fix. Half the bar guarantees the title the other half,
|
|
1383
|
+
// and the moment the buttons need more than their share the group overflows —
|
|
1384
|
+
// which is what `responsive` collapse watches (`scrollWidth > clientWidth`), so
|
|
1385
|
+
// the fold into the `…` menu still fires. Floored at 40px because shrinking to
|
|
1386
|
+
// nothing clips the buttons rather than folding them, and ControlGroup ignores
|
|
1387
|
+
// its own overflow below that width, which would strand them clipped.
|
|
1388
|
+
style: __assign({
|
|
1389
|
+
// Pushed to the trailing edge. A `fluid` group used to span the bar and its
|
|
1390
|
+
// own `horizontalAlign` put the buttons on the right; a content-sized one is
|
|
1391
|
+
// only as wide as its buttons, so with no title header beside it — Tree has
|
|
1392
|
+
// no label — it would sit at the LEFT of an otherwise empty bar. `auto`
|
|
1393
|
+
// margin restores the edge without giving the group any width back.
|
|
1394
|
+
marginLeft: 'auto',
|
|
1395
|
+
// Content basis that may still shrink. `fluid={false}` alone compiles to
|
|
1396
|
+
// `flex: 0 0 auto`, which pins the group at its content width so it can never
|
|
1397
|
+
// overflow — and `responsive` collapse watches `scrollWidth > clientWidth`,
|
|
1398
|
+
// so the fold into the `…` menu would simply stop happening.
|
|
1399
|
+
flex: '0 1 auto',
|
|
1400
|
+
// Floored, because shrinking to nothing clips the buttons instead of folding
|
|
1401
|
+
// them, and ControlGroup ignores its own overflow below 40px.
|
|
1402
|
+
minWidth: 40,
|
|
1403
|
+
// Capped, so a group that IS opted back into growing cannot take the row —
|
|
1404
|
+
// but only while there is a title header to take it FROM. With no label,
|
|
1405
|
+
// badge, icon or breadcrumbs the bar is the group's alone, and holding a
|
|
1406
|
+
// Collection's search input to half of an empty bar guards nothing.
|
|
1407
|
+
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,
|
|
1408
|
+
// Beside a title in a NARROW bar the title comes first (qorus#646). The group is
|
|
1409
|
+
// `0 0 auto`, so a narrow bar - a table in a card on a phone - squeezed the title
|
|
1410
|
+
// to nothing and still pushed its last button past the panel's edge. Narrow, the
|
|
1411
|
+
// title takes its whole width first and the group what is left, at least what its
|
|
1412
|
+
// controls cannot do without (a search field narrows, a button never does) and at
|
|
1413
|
+
// most its own width. A basis of 0 is what gives the title the first claim: the
|
|
1414
|
+
// group is sized from the leftover, so the title shrinks only once the controls
|
|
1415
|
+
// are at their smallest - and its words break only when one is wider than the
|
|
1416
|
+
// space left beside them. Shrinking the two against each other instead, by any
|
|
1417
|
+
// factor, took a fraction of a pixel off the title, and that broke "Services" into
|
|
1418
|
+
// "Servic / es". Room the title does not need goes to the group first (a grow no
|
|
1419
|
+
// title's comes near), so a search field widens before the title's box does. A
|
|
1420
|
+
// wide bar keeps the group at its own width: there the title's claim was its
|
|
1421
|
+
// one-line width, a description beside it included, and a long description
|
|
1422
|
+
// squeezed a table's search to its least instead of wrapping.
|
|
1423
|
+
style: hasTitleHeader && isNarrow ? NARROW_ACTIONS_BESIDE_TITLE : undefined, children: nonFloatingActions.map(renderNonResponsiveActions()) }), descriptionBelow ? (
|
|
1424
|
+
// `flex-basis: 100%` is what puts it on its own line — the bar is a wrapping
|
|
1425
|
+
// flex row, so a full-width item cannot share one with anything before it.
|
|
1426
|
+
// `min-width: 0` so a long sentence wraps inside the bar instead of widening it.
|
|
1427
|
+
(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
1428
|
});
|
|
1118
1429
|
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
1430
|
//# sourceMappingURL=index.js.map
|